Tag: primefaces编辑器

如何更新mongodb数组项没有竞争条件?

我有一个更新查询,certificate是受竞争条件,但我不知道为什么。 假设我在MongoDB中有一个stuff集合。 为了清晰起见,我使用了数字ID。 stuff: { _id: 123 elements: [ { _id: 456, value: 'foo', }, { _id: 789, value: 'bar' }, ] } 现在我想更新123下的element 456的值。 我认为这是好的(我使用mongoose,因此Stuff类): Stuff.update( { _id: 123, 'elements._id': 456 }, { $set: { 'elements.$': { _id: 456, value: 'foobar', something: 'else', } } } ) 然而,这个查询似乎受竞争条件的影响。 我不能解释为什么,但我可以certificate,并行解雇这个请求会弄乱我的数据。 特别是如果我尝试同时更新元素456和789 。 是否有一个全面的原因,为什么这会造成麻烦? 有没有办法来解决这个问题,所以它变得兼容certificate? 谢谢 […]

primefaces编辑器:node-gyp重build崩溃

我正在尝试安装使用node-gyp的primefaces包。 但每次都会崩溃。 这里是apm输出: Installing autocomplete-clang to /home/lars/.atom/packages ✗ > runas@1.0.1 install /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/clang-flags/node_modules/pathwatcher/node_modules/runas > node-gyp rebuild > runas@0.5.4 install /tmp/apm-install-dir-11499-22706-1lgjxbx/node_modules/autocomplete-clang/node_modules/snippets/node_modules/pathwatcher/node_modules/runas > node-gyp rebuild npm http GET https://registry.npmjs.org/underscore-plus npm http GET https://registry.npmjs.org/clang-flags npm http 304 https://registry.npmjs.org/underscore-plus npm http 304 https://registry.npmjs.org/clang-flags npm http GET https://registry.npmjs.org/underscore npm http GET https://registry.npmjs.org/pathwatcher npm http GET https://registry.npmjs.org/async npm http GET https://registry.npmjs.org/emissary npm […]

检测其他Atom包

是否有可能有一个Atom包检测是否已安装某些其他包? 我的软件包目前为第三方软件包添加了configuration,但是我希望只有在检测到它的时候才会这样做(而不是在对话框中询问)。 由于我没有在config.jsonfind已安装/活动的软件包列表,所以我想检查文件夹是否存在于~/.atom/packages 。 有更好的方法吗? 我可以检查我的JavaScript文件中的现有文件夹(还是仅限于我的包的文件夹?)

setInterval的作品setTimeout不

我目前正在编写使用APM 1.6.0,节点0.10.40和Jasmine 1.3的Atom包的asynchronous规范。 不幸的是,我不能setTimeout工作。 由于茉莉花1.3使用顺序runs允许asynchronoustesting,我试图理解从文档的例子。 事实certificate, setTimeout callback永远不会被调用。 在search这种情况发生的原因时,我将setTimeout -statement重命名为setInterval (因为两个函数都具有相同的签名)。 如果我执行下面的代码 describe('an asynchronous test', () => { it('should do some async stuff', () => { runs(() => { setInterval(() => { console.info('async'); }, 75); setTimeout(() => { console.info('async2'); }, 75); }); waitsFor(() => { return false; }, 'missing events'); // will wait ~5 seconds. […]

在mongodb中保持primefaces性

我想在我的MongoDB数据库中保持primefaces性,如果我更新我的文档中的数组,如果成功,那么其他文档将更新,否则,如果任何文档失败,则不应更新文档。 我无法理解如何在我的nodejs应用程序中使用mongoClient来实现这个function。 secureRoutes.post("/sendrequest", function (req, res) { MongoClient.connect(url, function (err, db) { if (err) throw err; else{ db.collection('users').updateOne({_id:req.user['sub']},{$addToSet:{requested:req.body.id}},function(update1Err,update1Data){ if (updateErr) throw updateErr; else { db.collection('users').updateOne({_id:req.body.id},{$addToSet:{pending:req.user['sub']}}); } }); res.send(JSON.stringify(req.body.id)); } }); }); 所以,如果第一个查询失败,那么第二个将不会运行,primefaces性将被维护,但如果第一个查询执行,第二个失败,那么primefaces性将不会被维护。 帮助我理解正确的实施。 谢谢

require('atom')如何工作?

Atom公开了一些可以从require('atom')访问的全局API 这个function如何工作? Atom包没有明确地将primefaces作为依赖,但他们仍然可以做到这一点。 而且,我怎样才能用我自己的全球软件包在我自己的Electron应用程序中做到这一点?

在Mongoose中的primefaces多个操作

考虑一个模式: var userSchema = mongoose.Schema({ … followers: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }], following: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }] … } 当userA跟随userA.following , userA.following被推入userA.following , userA被推入userB.followers 。 两个操作都需要一个.save() 。 确保如果.save()任何一个失败,两个文档都保持不变,那么什么是一种好的方法 – 或许是概念上的?

如何在Atom中显示整个项目的所有eslint警告?

目前我的客户端项目是由webpack构build的。 Linting项目是构build过程的一部分。 项目中的所有lint警告/错误都显示在控制台中。 当我在Atom中打开文件时,会显示该文件中的警告。 但是只能显示所有打开的文件的警告。 我想在整个项目中看到所有的警告,所以我可以点击它们并迅速解决。 我想知道在Atom中是否有这样的解决scheme。 有什么build议么? 我正在使用以下Atom包: 棉绒 ,版本:1.11.18 linter-eslint ,版本:8.0.0 和下面的npm包: eslint ,版本3.12.2 谢谢!

如何区分Electron(atom shell)中的主进程和渲染进程?

如何区分Electron(atom shell)中的主进程和渲染进程?

电子未捕获错误:dynamic链接库(DLL)初始化例程失败

我已经成功地构build了node.js插件,它可以在Windows上使用Node。 现在,我想用Electron创build一个Windows应用程序。 当在HTML文件中加载模块时,我得到了错误: var dbr = require('./build/Release/dbr'); ATOM_SHELL_ASAR.js有问题。 这个问题只发生在Windows上。 在Linux和Mac上,它运行良好。 我该如何解决? 谢谢!