在使用默认的gradle包装器和创建目录选项在IntelliJ中创建gradle项目后,我看到项目结构是使用build.gradle文件创建的.
IntelliJ向我提示"您可以配置Gradle包装器以使用源代码分发.它将为IDE提供Gradle API/DSL文档" - 但即使单击"确定,应用suggesstion"后我也无法附加源代码.gradle项目正在刷新,但未附加源.
我们正在使用Nexus存储库.
我希望我的页脚成为粘性页脚,并尝试遵循css技巧负边距技巧,但没有用。我试图在下面的代码中模拟我的angular2应用。我希望标签不是固定的而是粘的,当主要部分中有更多可用内容时,请移至底部。注意,页脚显示在主要部分中的数据上方。
http://plnkr.co/edit/WSUC4xLMWH6fY77UyFqI?p=preview&open=app%2Fapp.component.ts
app.component:
<nav-bar></nav-bar>
<section class="main">
<div class="main-container">
Display my router-outlet here
<ul>
<li *ngFor="let hero of heroes">
{{ hero }}
</li>
</ul>
</div>
</section>
<footer-component></footer-component>
Run Code Online (Sandbox Code Playgroud)
修复和向下移动页脚的任何帮助表示赞赏。
为什么只用@CompileStatic 注释会使下面的代码给出 NullPointerException?
class GroovyEach {
static def main(args) {
List items = null
items.each {
println 'hello'
}
}
}
Run Code Online (Sandbox Code Playgroud)
下面的代码给出了例外。
import groovy.transform.CompileStatic
@CompileStatic
class GroovyEach {
static def main(args) {
List items = null
items.each {
println 'hello'
}
}
}
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
Exception in thread "main" java.lang.NullPointerException
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1372)
at trial.GroovyEach.main(GroovyEach.groovy:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Run Code Online (Sandbox Code Playgroud) 假设我有一个带有两个集合collA和collB的数据库testdb,并尝试仅从转储中恢复collB.
即使只有collB在转储中,使用mongorestore的--drop选项还是会从testdb中删除现有的集合(collA和collB)吗?
我正在使用MongoDB 2.6.5
您好我正在使用AllegroGraph和Sparql查询来检索结果.这是一个重现我的问题的示例数据.考虑以下数据,其中一个人有姓,中名和姓.
<http://mydomain.com/person1> <http://mydomain.com/firstName> "John"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://mydomain.com/middleName> "Paul"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://mydomain.com/lastName> "Jai"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person6> <http://mydomain.com/middleName> "Mannan"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person6> <http://mydomain.com/lastName> "Sathish"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person6> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
Run Code Online (Sandbox Code Playgroud)
现在我需要通过组合所有3个名称来计算人名.名称是可选的,一个人可能没有任何名字,中间名和姓.
查询我试过了
select ?person ?name ?firstName ?middleName ?lastName where
{
?person rdf:type <http://mydomain.com/person>.
optional {?person <http://mydomain.com/firstName> ?firstName}.
optional {?person <http://mydomain.com/middleName> ?middleName}.
optional {?person <http://mydomain.com/lastName> ?lastName}.
bind (concat(str(?firstName),str(?middleName),str(?lastName)) as ?name).
}
Run Code Online (Sandbox Code Playgroud)
但是结果集不包含person6(Mannan Sathish)的名称,因为第一个名称不存在.如果我没有绑定,请告诉我是否可以忽略firstName.

我使用AllegroGraph和Sparql来查询结果.我试图基于字母顺序排序,但Sparql给大写更多的偏好.下面是类似的数据和查询,类似于我的问题.
数据:
<http://mydomain.com/person1> <http://mydomain.com/name> "John"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person2> <http://mydomain.com/name> "Abraham"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person3> <http://mydomain.com/name> "edward"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
Run Code Online (Sandbox Code Playgroud)
我试图根据名字的字母顺序排序 - 所以结果应该是亚伯拉罕,爱德华和约翰.但结果是亚伯拉罕,约翰和爱德华,因为爱德华从小案开始.请让我知道如何实现这一目标.
查询:
select ?person ?name where
{
?person <http://mydomain.com/name> ?name.
?person <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>.
} order by asc(str(?name))
Run Code Online (Sandbox Code Playgroud) 我使用 AllegroGraph 和 Sparql 1.1。
我需要对列进行升序排序,并使 Sparql 查询最后返回空值。
样本数据:
<http://mydomain.com/person1> <http://mydomain.com/name> "John"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person2> <http://mydomain.com/name> "Abraham"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
Run Code Online (Sandbox Code Playgroud)
这里我需要 Sparql 来返回 Abraham,然后是没有 name 属性的 John 和 person3。
我使用的查询:
select ?name ?person {
?person <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>.
optional {?person <http://mydomain.com/name> ?name.}
} order by asc(?name )
Run Code Online (Sandbox Code Playgroud)
当前输出是 person3 (null),其次是 Abraham 和 John。
请让我知道你的想法。
在 DataGrip 中选择列时,有没有办法以漂亮的格式查看 JSON 并换行?在 MySQL Workbench 中,有一个不错的选项“在编辑器中打开值”。“编辑最大化”不会环绕或适合屏幕。