我有一个应用程序打包为我的mac上的jar文件.我希望从Dock中启动此应用程序,就像它是.app文件一样.有没有办法做到这一点?
在 Liberty 上运行我的项目时,特别是在 Chrome 中,我收到一些警告消息。
[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BD14EBEEDBE53803FAE565131A03 to null.
Run Code Online (Sandbox Code Playgroud)
这是因为 Liberty 正在生成长度为 28 的 JSESSIONID,但 Liberty 配置文件将 httpSession 属性 idLength 默认为 23。如果我设置
<httpSession idLength="28" />
Run Code Online (Sandbox Code Playgroud)
在 Liberty server.xml 中,我没有在日志中收到这些警告消息。但是,我想在不更改 server.xml 的情况下解决这个问题。
是否可以将 JSESSIONID 的生成方式更改为默认长度 23?或者也许这是一个糟糕的方法?
我正在编写Oregon Trail的学校项目,我正在实施狩猎迷你游戏.我们正在使用具有卡片布局的模型视图演示器.当HuntingPanel切换到它调用run,然后JOptionPane出现,但随后整个应用程序冻结,我必须强制退出.我在一个单独的项目中编写了整个狩猎游戏,并且刚刚将文件带到了Oregon Trail游戏中.它在自己的项目中运行良好JFrame.我不知道该怎么做.
我这称之为初始化面板,切换到它,然后运行游戏.
public void initialize(int ammo) {
player.setBullets(ammo);
bulletLabel.setText("Bullets: "+player.getBullets());
presenter.switchToPanel(OregonTrailPresenter.HUNTING_PANEL);
run();
}
Run Code Online (Sandbox Code Playgroud)
这是我的run方法.
public void run() {
// starting message
JOptionPane.showMessageDialog(null, "You have reached a nearby field to hunt. You will stay\nhere until " +
"you run out of ammunition or click Return to Trail.");
// while the player has bullets or doesn't click return to trail
while (player.getBullets() > 0 && stillHunting) {
// creates random animals
checkForAnimal();
// moves …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 C++ 中的类上重载 << 运算符。每当我将普通字符串(例如“”)插入输出流时,我都会收到无法理解的编译错误。我以前做过一次,没有任何问题,所以我很困惑。
friend std::ostream& operator<<(std::ostream& out, Variable v);
std::ostream& operator<<(std::ostream& out, Variable v) {
out << v.type;
out << " ";
out << v.name;
return out;
}
Run Code Online (Sandbox Code Playgroud)
这是输出:
src/Variable.cpp: In function 'std::ostream& operator<<(std::ostream&, Variable)':
src/Variable.cpp:35:9: error: no match for 'operator<<' in 'out << " "'
src/Variable.cpp:35:9: note: candidates are:
src/Variable.cpp:33:15: note: std::ostream& operator<<(std::ostream&, Variable)
src/Variable.cpp:33:15: note: no known conversion for argument 2 from 'const char [2]' to 'Variable'
In file included from /usr/local/Cellar/gcc/4.7.0/gcc/lib/gcc/x86_64-apple-darwin10.8.0/4.7.0/../../../../include/c++/4.7.0/string:54:0,
from src/../inc/Variable.h:4,
from src/Variable.cpp:1: …Run Code Online (Sandbox Code Playgroud) 我找到了这个链接(http://www.spinics.net/lists/newbies/msg41016.html)并且一直在考虑这样做。所以我在内核模块中编写了代码:
\n\n#include <linux/path.h>\n#include <linux/namei.h>\n#include <linux/fs.h>\n\nstruct path p;\nstruct kstat ks;\nkern_path(filepath, 0, &p);\nvfs_getattr(&p, &ks);\nprintk(KERN_INFO "size: %lld\\n", ks.size);\nRun Code Online (Sandbox Code Playgroud)\n\n这不会编译,因为:
\n\n/root/kernelmodule/hello.c:15: warning: passing argument 1 of \xe2\x80\x98vfs_getattr\xe2\x80\x99 from incompatible pointer type\ninclude/linux/fs.h:2563: note: expected \xe2\x80\x98struct vfsmount *\xe2\x80\x99 but argument is of type \xe2\x80\x98struct path *\xe2\x80\x99\n/root/kernelmodule/hello.c:15: warning: passing argument 2 of \xe2\x80\x98vfs_getattr\xe2\x80\x99 from incompatible pointer type\ninclude/linux/fs.h:2563: note: expected \xe2\x80\x98struct dentry *\xe2\x80\x99 but argument is of type \xe2\x80\x98struct kstat *\xe2\x80\x99\n/root/kernelmodule/hello.c:15: error: too few arguments to function \xe2\x80\x98vfs_getattr\xe2\x80\x99\nRun Code Online (Sandbox Code Playgroud)\n\n所以自从我查看这个文档以来我真的很困惑:http://lxr.free-electrons.com/source/fs/stat.c#L40
\n\n现在我在 …
c ×1
c++ ×1
drawing ×1
freeze ×1
jar ×1
java ×1
javascript ×1
jpanel ×1
jsessionid ×1
kernel ×1
linux ×1
linux-kernel ×1
macos ×1
session ×1
swing ×1