我正在尝试检索Google Reporting API的库:
compile 'com.google.apis:google-api-services-analytics:v3-rev74-1.17.0-rc'
Run Code Online (Sandbox Code Playgroud)
但我得到了一个未解决的依赖项错误,我不知道如何处理它:
:: commons-codec#commons-codec;1.6: configuration not found in commons-codec#commons-codec;1.6: 'master'. It was required from org.apache.httpcomponents#httpclient;4.0.1 compile
Run Code Online (Sandbox Code Playgroud)
我检查了.grails\ivy-cache \文件夹,并且有一个commons-codec文件夹,其中包含jars of commons-codec-1.5,少量xml文件ivy-1.5.xml和ivy-1.6.xml以及ivydata-1.5.properties和ivydata- 1.6.properties.我也尝试删除整个ivy-cache文件夹,但结果是一样的.
我正在尝试用Underscore.js学习Backbone.js并遇到麻烦.我使用Grails作为服务器框架,因此Underscore.js语法<%=%>是不可能的.我想将其更改为{{}}样式.我的Javascripts在许多文件中分开,每个文件代表我需要的每个对象的视图或模型.这是我的视图的代码:
$(function () {
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g,
evaluate : /\{!(.+?)!\}/g
};
APP = window.APP || {};
APP.PlaceView = Backbone.View.extend({
initialize:function () {
this.render();
},
el:"#place-form",
formTemplate:_.template($('#search-template').html()),
render:function () {
//Pass variables in using Underscore.js Template
var variables = { street:"Ulica" };
this.$el.html(this.formTemplate({ "street":"Ulica" }));
}
});
var view = new APP.PlaceView();
});
Run Code Online (Sandbox Code Playgroud)
和模板:
<script type="text/template" id="search-template">
<!-- Access template variables with {{ }} -->
<label>{{ street }}</label>
<input type="text" id="search_input"/>
<input type="button" id="search_button" value="Search"/>
</script>
Run Code Online (Sandbox Code Playgroud)
此代码抛出Uncaught SyntaxError:Unexpected …
我正在处理一个大型的csv文件,我发现这篇关于批量导入的文章:http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/.我试图做同样的事,但似乎没有效果.
每次刷新后,实例是否可以在数据库中查看?因为当我尝试查询'SELECT COUNT(*)FROM TABLE1'时,现在有0或所有entites,所以它看起来像是一次提交所有实例.
然后我还注意到,当第一次导入到空白表时,导入工作很快,但是当表已满并且实体应该更新或保存为新实体时,整个过程非常慢.这主要是因为内存没有被清理,减少到1MB或更少,应用程序卡住了.那是因为没有刷新会话?
我的导入代码在这里:
public void saveAll(List<MedicalInstrument> listMedicalInstruments) {
log.info("start saving")
for (int i = 0; i < listMedicalInstruments.size() - 1; i++) {
def medicalInstrument = listMedicalInstruments.get(i)
def persistedMedicalInstrument = MedicalInstrument.findByCode(medicalInstrument.code)
if (persistedMedicalInstrument) {
persistedMedicalInstrument.properties = medicalInstrument.properties
persistedMedicalInstrument.save()
} else {
medicalInstrument.save()
}
if ((i + 1) % 100 == 0) {
cleanUpGorm()
if ((i + 1) % 1000 == 0) {
log.info("saved ${i} entities")
}
}
}
cleanUpGorm()
}
protected void cleanUpGorm() { …Run Code Online (Sandbox Code Playgroud) 我想在我的应用程序中使用Java 9。我的一个依赖项有一个jar名称:
sdk-http-ahc-2_0
Run Code Online (Sandbox Code Playgroud)
不幸的是,当我尝试将其更改为自动模块时,该模块的名称无效。
requires sdk.http.ahc.2_0; // not valid
Run Code Online (Sandbox Code Playgroud)
我在命名模块时缺少什么吗?我在这里还有其他选择吗?
grails ×2
backbone.js ×1
ivy ×1
java-9 ×1
java-module ×1
java-platform-module-system ×1
module ×1