我希望控件之间有一些间距.根据规范,应该使用form-group类来实现.但是我的情况不适用.
<div class="col-xs-12 col-sm-12">
<form role="form">
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpTitle">Title</label>
</div>
<div class="col-xs-9">
<input type="text" class="form-control" placeholder="Title of the program" id="cpTitle" />
</div>
</div>
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpDesc">Description</label>
</div>
<div class="col-xs-9">
<textarea class="form-control" rows="3" placeholder="Description of the program" id="cpDesc"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-3 text-right">
<label for="cpAddr">Program address</label>
</div>
<div class="col-xs-9">
<input type="text" class="form-control" placeholder="Name of Facility" id="cpAddr" />
<input type="text" class="form-control" placeholder="Street 1" />
<input type="text" class="form-control" placeholder="Street 2" />
<div …Run Code Online (Sandbox Code Playgroud) 我的Debian中有Python 2.7和Python 3.3.我使用arg重建了两个--enable-shared.
之后,我使用args" --enable-pythoninterp --enable-python3interp --with-features=huge --with-python-config-dir=PathToConfig --with-python3-config-dir=PathToConfig" 构建了VIM 7.4
当我发表评论vim --version时,我可以看到旗帜' +python/dyn and +python3/dyn'
但是,当我输入命令':python import sys'时,我收到错误消息:
E448: Could not load library function _PyArg_Parse_SizeT
E263: Sorry, this command is disabled, the Python library could not be loaded.
Run Code Online (Sandbox Code Playgroud)
当我输入命令':python3 import sys'时,我收到错误消息:
E448: Could not load library function PySys_SetArgv
E263: Sorry, this command is disabled, the Python library could not be loaded.
Run Code Online (Sandbox Code Playgroud)
由于这个原因,所有需要python的vim插件都无法正常工作.
请让我知道如何解决这个问题.
我正在尝试使用 db.collections.insert 将初始数据加载到 mongodb。我有一个例子,我将插入城镇集合,然后插入邮政编码集合。邮政编码集合是指城镇集合。然而,当我编写脚本时,我不知道城镇的_id。想知道如何动态构建参考。
在下面的示例中,我需要将曼切斯特镇的 ID 填充到“未知”的位置。
db.town.insert({name:"Manchester",state:{$ref:"state", $id:"CT"},status:"NOT-SUBSCRIBED"});
db.zipcode.insert({_id:"06040", town:{$ref:"town", $id:"unkown"}});
db.zipcode.insert({_id:"06041", town:{$ref:"town", $id:"unkown"}});
db.zipcode.insert({_id:"06042", town:{$ref:"town", $id:"unkown"}});
Run Code Online (Sandbox Code Playgroud)
如果有不同的方式来加载我的初始数据而不是 db.collections.insert,我也想知道。
我目前有类似下面的内容
List<String> myNewList = myList
.stream()
.map(item->{
return mappedItem
})
.collect(Collectors.toList());
repository.save(myNewList);
Run Code Online (Sandbox Code Playgroud)
在Optional中,我可以使用ifPresent方法对映射项执行操作,如下所示
myOptional
.map(item -> {
return mappedItem
})
.ifPresent(newItem -> {
repository.save(newItem);
});
Run Code Online (Sandbox Code Playgroud)
我想知道我是否可以做上面这样的事情.而不是声明myNewList,有没有一种方法可以收集新的List并在新列表中应用我的功能?
更新:根据@ tagir-valeev的回答,我修改了我的代码如下
myList
.stream()
.map(item->{
return mappedItem
})
.collect(Collectors.collectingAndThen(Collectors.toList(),
list -> {
repository.save(list);
return list;
}
));
Run Code Online (Sandbox Code Playgroud) java ×1
java-8 ×1
java-stream ×1
lambda ×1
linux ×1
mongo-shell ×1
mongodb ×1
python ×1
vim ×1
vim-plugin ×1