我正在尝试运行eclipse并遇到错误.我使用Kubuntu作为我的操作系统,当我输入java -version终端时,我得到了"java版本"1.6.0_23"'.我安装了openJDK,但我不确定下一步该怎么做.有什么想法吗?谢谢.
错误:
JVM terminated. Exit code=13
/usr/bin/java
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
-jar /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
-os linux
-ws gtk
-arch x86
-showsplash
- launcher /home/lucky/Downloads/eclipse/eclipse
-name Eclipse
--launcher.library /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.2.R36x_v20101019_1345/eclipse_1310.so
-startup /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
-exitdata 5cf8058
-product org.eclipse.epp.package.php.product
-vm /usr/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
-jar /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
Run Code Online (Sandbox Code Playgroud)
我的eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.2.R36x_v20101019_1345
-product
org.eclipse.epp.package.php.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
Run Code Online (Sandbox Code Playgroud) 我正在尝试为我编写一个复杂的脚本,我的目标是执行以下操作.我有一个字符串进来,看起来像这样:
2012 2013 "multiple words"
Run Code Online (Sandbox Code Playgroud)
我的目标是将每个这些放入由空格分割的数组中,但仅用于单个字匹配,而不是用双引号括起来的那些.那些应该被认为是一个词.所以我的想法是分两步完成.首先匹配那些是倍数的单词,从字符串中删除那些,然后在由空格分割的另一个迭代中.
很遗憾,我无法找到有关如何进行echo比赛的帮助.到目前为止我有这个:
array=$(echo $tags | sed -nE 's/"(.+)"/\1/p')
Run Code Online (Sandbox Code Playgroud)
但这会导致(在OS X上):
2012 2013 multiple words
Run Code Online (Sandbox Code Playgroud)
预期结果:
array[1]="2012"
array[2]="2013"
array[3]="multiple words"
Run Code Online (Sandbox Code Playgroud)
我该如何处理这类问题?
谢谢.
我正在使用AVAssetWriter,它完全适用于iOS6.
问题是,当我打电话时finishWritingWithCompletionHandler,iOS7 GM上没有调用完成处理程序.
我打电话markAsFinished,甚至endSessionAtSourceTime在我调用finishWritingWithCompletionHandler之前.
它在iOS6上运行良好.
甚至更多,在iOS7上,它可以工作一段时间,然后它再也不起作用了.
我不知道为什么,但如果我使用警报视图调用该方法,它就可以工作.于是,我就performSelectorOnMainThread和inBackground,但它并没有帮助.
有任何想法吗?
通常,包只是简单地开始
package Cat;
... #content
!0;
Run Code Online (Sandbox Code Playgroud)
我刚刚发现,从perl 5.14开始,还有"块"语法.
package Cat {
... #content
}
Run Code Online (Sandbox Code Playgroud)
它可能是一样的.但是可以肯定的是,有什么区别吗?
关于1;包文件的末尾.任何块的返回值都被视为最后一个计算表达式的值.所以我可以1;在结束之前把它放进去}吗?为了require开心,两者之间有什么区别:
package Cat {
... #content
1;
}
Run Code Online (Sandbox Code Playgroud)
和
package Cat {
... #content
}
1;
Run Code Online (Sandbox Code Playgroud) 在Perl中,如果我想做的foo()话bar(),我可以这样做:
sub foo {return bar(@_);}
Run Code Online (Sandbox Code Playgroud)
有没有更好的办法?更接近Ruby的"别名"运算符?
我有这样的文字:
foo bar
`which which`
Run Code Online (Sandbox Code Playgroud)
如果我使用heredoc这样做,我得到一个空白文件:
? ~ echo <<EOT > out
heredoc> foo bar
heredoc> `which which`
heredoc> EOT
? ~ cat out
? ~
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
对不起,我打算做cat.问题是它将它写入文件:which: shell built-in command,即评估反推.没有评估,任何方式做到这一点?
有了cat,我明白了
? ~ cat <<EOT > out
heredoc> foo bar
heredoc> `which which`
heredoc> EOT
? ~ cat out
foo bar
which: shell built-in command
? ~
Run Code Online (Sandbox Code Playgroud)
我不想which which被评估.
我正在尝试按以下方式打印字符串:
int main(){
string s("bla");
printf("%s \n", s);
.......
}
Run Code Online (Sandbox Code Playgroud)
但我得到的只是随机的胡言乱语.
你能解释一下原因吗?
我在这上面阅读了bash手册页,但我不明白其中的区别.我测试了它们两个,它们似乎产生完全相同的结果.
如果未通过命令行参数设置值,我想设置变量的默认值.
#!/bin/bash
var="$1"
var=${var:-word}
echo "$var"
Run Code Online (Sandbox Code Playgroud)
上面的代码回显,word如果$1为null,$1则回显if not null的值.这样做:
#!/bin/bash
var="$1"
var=${var:=word}
echo "$var"
Run Code Online (Sandbox Code Playgroud)
根据Bash手册页,
${parameter:-word}使用默认值.如果参数未设置或为null,则替换单词的扩展.否则,参数的值将被替换.
${parameter:=word}分配默认值.如果参数未设置或为null,则将字的扩展分配给参数.然后替换参数的值.不能以这种方式分配位置参数和特殊参数.
他们是一样的,${parameter:=word}只是做得更多吗?
我的模式如下
hi
hello
hallo
greetings
salutations
no more hello for you
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下命令替换所有换行符
sed -e "s_/\n_/\t_g"
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
有人可以帮忙吗?我正在寻找sed/awk的解决方案.
我的XML(a.xhtml)就像这样开始
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
...
Run Code Online (Sandbox Code Playgroud)
我的代码就像这样开始
use XML::XPath;
use XML::XPath::XMLParser;
my $xp = XML::XPath->new(filename => "a.xhtml");
my $nodeset = $xp->find('/html/body//table');
Run Code Online (Sandbox Code Playgroud)
它非常慢,事实证明它花了很多时间来获得DTD(http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd).
有没有办法在Perl XML :: family中显式声明HTTP代理服务器?我讨厌修改原始的a.xhtml文档,比如拥有DTD的本地副本.