我正在寻找一个分发jung2包的maven存储库.不幸的是,我无法找到有关其位置的任何信息.
更新:我已经包含了cental存储库repo1.
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Run Code Online (Sandbox Code Playgroud)
但我仍然得到一个错误:10/4/10 1:31:57 PM CEST:缺少神器net.sf.jung:jung2:jar:2.0.1:编译.我在Mac OSX上使用Maven 3.0-SNAPSHOT.
Update2:Jung2依赖声明:
<dependency>
<groupId>net.sf.jung</groupId>
<artifactId>jung2</artifactId>
<version>2.0.1</version>
<type>pom</type>
</dependency>
Run Code Online (Sandbox Code Playgroud)
添加pom后,没有错误消息.不幸的是,maven没有检索jung2模块的罐子.
[解决]我还添加了对jung-graph-impl的依赖,我现在可以在我的项目中使用jung2:
<dependency>
<groupId>net.sf.jung</groupId>
<artifactId>jung-graph-impl</artifactId>
<version>2.0.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud) 在Peter Seibel的书"Practical Common Lisp"中,我们可以找到一次非常复杂的宏的定义(参见页面底部http://www.gigamonkeys.com/book/macros-defining-your-own.html).
我在过去3周内第10次阅读这个宏定义,无法理解它是如何工作的.:(更糟糕的是,我不能自己开发这个宏,即使我理解它的目的以及如何使用它.
我对这个臭名昭着的宏观系统"衍生"特别感兴趣,一步一步!有帮助吗?
我有一个多模块项目,在父pom中,我定义了几个报告插件.某些模块包含不需要对其运行报告插件的代码,并且我不需要在生成的站点中包含它们.有没有办法告诉Maven在父pom级别忽略它们?
根据ajozwik的回答,我添加了跳过配置.我的POM现在看起来如下......
父/ pom.xml的<modules>
<module>service</module>
<module>client</module>
</modules>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.4.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<formats>
<format>html</format>
</formats>
</configuration>
</plugin>
</plugins>
</reporting>
Run Code Online (Sandbox Code Playgroud)
客户机/ pom.xml的
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.1</version>
<configuration>
<skip>true</skip>
<skipDeploy>true</skipDeploy>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
当我执行:
mvn clean package site
Run Code Online (Sandbox Code Playgroud)
构建成功,客户端的目标目录不包含生成的站点.当我跑:
mvn clean package site site-stage
Run Code Online (Sandbox Code Playgroud)
为了暂存网站,它正确地分阶段.如果没有skipDeploy标记,则分段将失败...
你们都知道这个故事:程序员读取其他人的代码,程序员看到他们不理解的符号,谷歌失败了,因为搜索非字母数字符号很困难.
这次它是@符号,似乎用于将一个列表的内容注入另一个列表的中间.例如:
`(5 6 7 ,@'(8 9) 10 11)
;=> (5 6 7 8 9 10 11)
Run Code Online (Sandbox Code Playgroud)
我很满意这种用法,但我想知道我是否理解@正确的行为?它有其他用途吗?以下成绩单中的错误是什么原因(来自CLISP)?
[1]> (list 1 2 3 4 @'(5 6 7))
*** - SYSTEM::READ-EVAL-PRINT: variable @ has no value
Run Code Online (Sandbox Code Playgroud)
最后,到底是 @什么?它似乎不是一个功能:
[3]> (print #'@)
*** - FUNCTION: undefined function @
Run Code Online (Sandbox Code Playgroud)
我猜这是一个基本的语法,如backquote(`)或逗号(,).它是否正确?对不起,如果这是重复的,但是再一次,据我所知,它是不可能搜索的@.
所述partitioningBy集电极施加到谓词中的每个元素流,并产生从布尔地图以从满足或不满足谓词流元素的列表.例如:
Stream.of(1,2,3,4).collect(partitioningBy(x -> x >= 3))
// {false=[1, 2], true=[3, 4]}
Run Code Online (Sandbox Code Playgroud)
正如分区的目的是什么所讨论的,观察到的行为是partitioningBy总是返回一个包含true和false条目的映射.例如:
Stream.empty().collect(partitioningBy(x -> false));
// {false=[], true=[]}
Stream.of(1,2,3).collect(partitioningBy(x -> false));
// {false=[1, 2, 3], true=[]}
Stream.of(1,2,3).collect(partitioningBy(x -> true));
// {false=[], true=[1, 2, 3]}
Run Code Online (Sandbox Code Playgroud)
这种行为实际上是在某处指定的吗?Javadoc只说:
返回一个Collector,它根据Predicate对输入元素进行分区,并将它们组织成一个
Map<Boolean, List<T>>.返回的Map的类型,可变性,可序列化或线程安全性无法保证.
符合实现可以返回这些:
Stream.empty().collect(partitioningBy(x -> false));
// {}, or {false=[]}, or {true=[]}
Stream.of(1,2,3).collect(partitioningBy(x -> false));
// {false=[1, 2, 3]}
Stream.of(1,2,3).collect(partitioningBy(x -> true));
// {true=[1, 2, 3]}
Run Code Online (Sandbox Code Playgroud)
相应的JSR 335 …
我正在尝试select使用Underscore.js模板将Backbone.js集合呈现为列表,并且列表未填充.该select元素被显示,但目前还没有options.
我已经确认我能够将单个属性传递到我的模板并将它们渲染为label元素,因此问题必须是我试图处理集合的方式.
这是我的Backbone代码:
Rate = Backbone.Model.extend({
duration : null
});
Rates = Backbone.Collection.extend({
initialize: function (model, options) {
}
});
AppView = Backbone.View.extend({
el: $('#rate-editor-container'),
initialize: function () {
this.rates = new Rates(null, { view: this } );
this.rates.add(new Rate ({ duration: "Not Set" }));
this.rates.add(new Rate ({ duration: "Weekly" }));
this.rates.add(new Rate ({ duration: "Monthly" }));
this.render();
},
render: function() {
var rate_select_template = _.template($("#rate_select_template").html(), {rates: this.rates, labelValue: 'Something' });
$('#rate-editor-container').html(rate_select_template); …Run Code Online (Sandbox Code Playgroud) 我有一个名为ab的DataFrame .当我将ab指定为StringIndexer的输入列名时,AnalysisException的消息"无法解析'ab'给定输入列ab".我正在使用Spark 1.6.0.
我知道旧版本的Spark可能在列名中遇到点问题,但在更新版本中,可以在Spark shell和SQL查询中使用反引号.例如,这是解决另一个问题,如何在Spark SQL中使用连字符转义列名.其中一些问题是SPARK-6898报告 的,列名中的特殊字符被破坏,但是在1.4.0中得到了解决.
这是一个最小的例子和堆栈跟踪:
public class SparkMLDotColumn {
public static void main(String[] args) {
// Get the contexts
SparkConf conf = new SparkConf()
.setMaster("local[*]")
.setAppName("test")
.set("spark.ui.enabled", "false"); // http://permalink.gmane.org/gmane.comp.lang.scala.spark.user/21385
JavaSparkContext sparkContext = new JavaSparkContext(conf);
SQLContext sqlContext = new SQLContext(sparkContext);
// Create a schema with a single string column named "a.b"
StructType schema = new StructType(new StructField[] {
DataTypes.createStructField("a.b", DataTypes.StringType, false)
});
// Create …Run Code Online (Sandbox Code Playgroud) 我有一个非常简单的课程:
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "users")
public class User {
@Column(name = "firstName")
private String firstName;
@Column(name = "lastName")
private String lastName;
@Column(name = "email")
private String email;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "id")
private long id;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public …Run Code Online (Sandbox Code Playgroud) 我想通过SPDY协议编写一些基本请求.该协议将您发送的帧定义为由非常特定长度和字节顺序的二进制数据组成.
我只编写了通过套接字(HTTP)发送字符串的小程序.例如,如何实现SPDY控制帧头?我已经尝试使用bitstring库和numpy来控制控件帧头的所有不同部分的大小,但是没有任何东西真正起作用.python的当前SPDY库使用cython和C数据类型,我发现它非常不可预测.我想知道如何使用纯python构建简单的请求,或者我是如何构建一些与协议定义完全相似并通过套接字发送的东西?
我正在使用Jena ARQ编写针对从Jena TDB读取的大型本体的SPARQL查询,以便找到与基于rdfs标签的概念相关联的类型:
SELECT DISTINCT ?type WHERE {
?x <http://www.w3.org/2000/01/rdf-schema#label> "aspirin" .
?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type .
}
Run Code Online (Sandbox Code Playgroud)
这很好用,实际上非常快(<1秒).不幸的是,对于某些术语,我需要以不区分大小写的方式执行此查询.例如,因为标签"Tylenol"位于本体中,而不是"tylenol",所以以下查询为空:
SELECT DISTINCT ?type WHERE {
?x <http://www.w3.org/2000/01/rdf-schema#label> "tylenol" .
?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type .
}
Run Code Online (Sandbox Code Playgroud)
我可以使用FILTER语法编写此查询的不区分大小写的版本,如下所示:
SELECT DISTINCT ?type WHERE {
?x <http://www.w3.org/2000/01/rdf-schema#label> ?term .
?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type .
FILTER ( regex (str(?term), "tylenol", "i") )
}
Run Code Online (Sandbox Code Playgroud)
但现在查询需要一分钟才能完成!有没有办法以更有效的方式编写不区分大小写的查询?
java ×4
common-lisp ×2
lisp ×2
apache-spark ×1
arq ×1
backbone.js ×1
hibernate ×1
java-8 ×1
java-stream ×1
javascript ×1
jena ×1
jung ×1
macros ×1
maven ×1
maven-2 ×1
python ×1
rdf ×1
repository ×1
sockets ×1
sparql ×1
tdb ×1