如何从github应用补丁?
我试着编译minisat,但是我遇到了两个来自clang编译的问题.
第一个问题是在这个github提交中解决的,它是从原来的github派生出来的.由于变化很小,我可以轻松地修补代码以手动工作.
第二个问题在这个github(https://github.com/niklasso/minisat/pull/17)中解决,但补丁不适用于原始源.我可以通过复制修改后的文件手动更新代码,但如果我可以将此补丁拉入我的本地目录会更好.用github可以做到吗?如果是这样,怎么办?
我正在尝试使用gradle/Clojuresque来构建clojure代码,运行它,并获得uberjar.我使用提示从http://dev.clojure.org/display/doc/Getting+Started+with+Gradle,https://bitbucket.org/kotarak/clojuresque/wiki/Getting%20Started和"无法找到我们Grab for Clojure(Clojuresque)的.bpsm:edn-java:0.4.3'错误.
这是成绩脚本.
buildscript {
repositories {
maven { url "http://clojars.org/repo" }
mavenCentral()
}
dependencies {
classpath "clojuresque:clojuresque:1.7.0"
}
}
apply plugin: 'clojure'
clojure.aotCompile = true
repositories {
flatDir dirs: project.file("lib/runtime")
maven { url "http://clojars.org/repo" }
}
Run Code Online (Sandbox Code Playgroud)
有了gradle buildtask,没有错误,我有一个jar文件,但是我没有看到生成的任何类文件; 我不认为生成的jar什么都不包含,特别是当我比较手动构建的结果时(从命令行编译clojure源到类(AOT)(不使用lein)).
.
??? build
? ??? libs
? ? ??? clojure.jar
? ??? tmp
? ??? jar
? ??? MANIFEST.MF
??? build.gradle
??? src
??? hello
??? core.clj
Run Code Online (Sandbox Code Playgroud)
这是core.clj
(ns …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用莫扎特奥兹.我从source forge下载执行二进制文件:http://sourceforge.net/projects/mozart-oz/.
在启动Mozart.app时,emacs(适用于Mac OS X的aquamacs)开始在其中进行编码.
例如,我可以输入{Browse 'Hello World'}并执行Oz -> Feed Buffer以在Tcl/Tk浏览器中获取结果.
然后,我如何在命令行中构建或执行Oz代码,就像我使用Python或Ruby一样?
我在bin目录中找到了二进制文件.
/Applications/Mozart2.app/Contents/Resources/bin
??? oz
??? ozc
??? ozemulator
??? ozengine
??? ozwish
Run Code Online (Sandbox Code Playgroud)
但是,当我执行代码时ozc -c hello.oz,我收到了%** variable Browse not introduced错误.可能有什么问题?
在此示例代码中,func1是void (*)(int, double)和funky的类型void(&)(int, double).
#include <iostream>
using namespace std;
void someFunc(int i, double j) {
cout << i << ":" << j << endl;
}
int main(int argc, char *argv[]) {
auto func1 = someFunc;
auto& func2 = someFunc;
cout << typeid(func1).name() << endl;
cout << typeid(func2).name() << endl;
func1(10, 20.0);
func2(10, 30.0);
}
Run Code Online (Sandbox Code Playgroud)
输出显示了差异:
PFvidE
FvidE
10:20
10:30
Run Code Online (Sandbox Code Playgroud)
实际上,这两种类型有什么区别?
ML 之前在http://sml-family.org/Basis/general.html 中被描述为
a 在 b 返回 a 之前。它提供了一种符号简写,用于在返回 a 的值之前先计算 a,然后是 b。
当我尝试使用此命令时期望 x = 4 和 (4+1) 被评估
val x = (3+1 before 4+1)
Run Code Online (Sandbox Code Playgroud)
我有错误消息:
Standard ML of New Jersey v110.78 [built: Sun Apr 26 01:06:11 2015]
- stdIn:1.11-1.25 Error: operator and operand don't agree [overload conflict]
operator domain: [+ ty] * unit
operand: [+ ty] * [+ ty]
in expression:
(3 + 1 before 4 + 1)
-
Run Code Online (Sandbox Code Playgroud)
可能有什么问题?
根据马特的回答,我应该使用
val x = (3+1 …Run Code Online (Sandbox Code Playgroud) 从IntelliJ 14中的Browse Repositories,最新的Scala插件是版本1.5.2.
来自IntelliJ的Scala插件主页,最新版本(截至2015年8月10日)为1.7.4.https://plugins.jetbrains.com/plugin/?id=1347
但是,当我下载后尝试从"磁盘上的Intall插件..."安装它时scala-intellij-bin-1.7.4,我收到此错误:
可能有什么问题?
我正在尝试运行安装了苹果酒包的Clojure emacs.我在Mac OS X 10.10.4上使用Emacs 24.5.1.
I downloaded lein script and copied the script in ~/Dropbox/bin.
I checked with lein repl that Clojure works fine.
cider package is installed with M-x package-install. I edited the ~/.emacs.d/init.el to specify the lein script: (add-to-list 'exec-path "~/Dropbox/bin") with the hint from Can't launch `lein` REPL in Emacs.
However, when I started emacs and run M-x cider-jack-in, I have this error message:
When I started lein repl and executed M-x cider-connect …
假设函数r返回五个值的元组.
scala> def r = (1,2,3,4,5)
r: (Int, Int, Int, Int, Int)
Run Code Online (Sandbox Code Playgroud)
当我从中分配返回的值时r,我得到了大写字母变量的错误.
scala> val (a,b,c,d,E) = r
<console>:13: error: not found: value E
val (a,b,c,d,E) = r
^
Run Code Online (Sandbox Code Playgroud)
如果我不使用大写字母,则不会发生错误.
scala> val (a,b,c,d,e) = r
a: Int = 1
b: Int = 2
c: Int = 3
d: Int = 4
e: Int = 5
Run Code Online (Sandbox Code Playgroud)
但是,我可以用单个assignemnt分配大写字母变量.
scala> val Q = 10
Q: Int = 10
Run Code Online (Sandbox Code Playgroud)
这是Scala的错误或功能吗?
我有一个使用BitSet的库,我需要更改Set [Int]类型数据才能使用该库.
我想到的是使用.toSeq:_*操作,但我不确定这是从BitSet转换为Set [Int]还是反过来的有效方法.
scala> BitSet(Set(1,2,3).toSeq:_*)
res55: scala.collection.immutable.BitSet = BitSet(1, 2, 3)
scala> Set(BitSet(1,2,3).toSeq:_*)
res56: scala.collection.immutable.Set[Int] = Set(1, 2, 3)
Run Code Online (Sandbox Code Playgroud)
有没有更好的办法?
我有从ANTLR4生成的Java代码.Scala通过扩展一些方法来使用Java代码.问题是IntelliJ的scala插件似乎不知道Java基类和Scala子类之间的关系,以显示误报错误消息; 当Scala覆盖Java方法时,它会报告"方法...无法覆盖任何内容".
如何控制IntelliJ中的错误级别来抑制此错误消息?