当我尝试编译简单类型安全'akka程序(scala 2.10,akka,2.1.0)时:
scalac -cp "akka-actor_2.10-2.1.0.jar:akka-camel_2.10-2.1.0.jar" write2.scala
error: bad symbolic reference. A signature in package.class refers to term apache
in package org which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling package.class.
error: bad symbolic reference. A signature in package.class refers to term camel
in value org.apache which is not available.
It may be completely missing from the current classpath, or the …
Run Code Online (Sandbox Code Playgroud) 在scala的2.10下载页面(http://www.scala-lang.org/downloads)上写道:
Scala发行版也可以在Typesafe的简单预集成堆栈中使用.只需从Stack Download页面下载Typesafe Installer即可
但是当我从http://typesafe.com/stack/download(当前版本是2.0.2)下载它时,仍然有Scala版本2.9.2(不是2.10).
我是从错误的页面下载类型安全堆栈,还是只缺少Scala 2.10?我找不到scala 2.10是否应该集成在当前版本的堆栈中的信息.
我是scala的新手,我遇到了这个问题:
def main(args: Array[String]){
val source = Source.fromFile(args(0))
val target = Source.fromFile(args(1))
for (lines <- source.getLines ; linet <- target.getLines) {
println(lines + " =source| target= " + linet);
}
}
Run Code Online (Sandbox Code Playgroud)
如果源文件和目标文件包含普通数字:1,2(每行一个数字),结果为:
1 =source| target= 1 1 =source| target= 2
但是,我希望:
1 =source| target= 1 2 =source| target= 2
问题:第二个文件(目标)被正确读取(逐行,即1和2),在第一个(源)中,只读取第一行(即1).
最可能的问题在于for循环.我虽然运营商";" 表现得像"&&",因此应该从两个文件中读取一行.我试过替换";" 通过"&&"但它没有用.
任何线索将深深感激!托马斯
有没有一种简单的方法可以准确地获取 ansible 脚本(剧本)正在尝试执行的操作?
例如我有
- name: Install required packages
yum: name={{item}} state=present
with_items:
- nmp
become: True
Run Code Online (Sandbox Code Playgroud)
我想得到:
sudo yum install nmp
Run Code Online (Sandbox Code Playgroud)
也就是说,我想知道 ansible 正在运行哪些命令(操作系统级别)。基本上,我需要相反的过程:Ansible 和 Playbook。如何将shell命令转换为yaml语法?
如果我跑:
java -jar corpus-tools-0.0.2.jar removeTSfromCorpus
Run Code Online (Sandbox Code Playgroud)
它给了我错误:
Failed to parse the trailing argument list: 'removeTSfromCorpus'
Run Code Online (Sandbox Code Playgroud)
但是,如果我跑:
java -cp corpus-tools-0.0.2.jar removeTSfromCorpus
Run Code Online (Sandbox Code Playgroud)
它无缝地工作.scala-library包含在依赖项中(MANIFEST).-cp和-jar有什么区别?我认为在这种情况下应该是平等的
谢谢!
有可能做到:
"hello, I have 65 dollars".replaceFirst("65", "$")
Run Code Online (Sandbox Code Playgroud)
目前的结果是
scala> "hello, I have 65 dollars".replaceFirst("dollars", "$")
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
....
Run Code Online (Sandbox Code Playgroud)
scala 2.10中的预期结果:
hello, I have 65 $
Run Code Online (Sandbox Code Playgroud)
问题是符号$
,我需要将其作为字符串而不是正则表达式处理.我试图把它放入"""
,或者raw""
没有任何帮助