我遵循基本教程使用TurkServer,但我从一开始就收到错误.
我跑的时候得到的错误:流星 --settings settings.json
W20160615-01:19:27.320(-4)? (STDERR)
W20160615-01:19:27.406(-4)? (STDERR) ~/.meteor/packages/meteor-tool/.1.3.3.b5ue33++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20160615-01:19:27.406(-4)? (STDERR)
throw(ex);
W20160615-01:19:27.407(-4)? (STDERR)
^
W20160615-01:19:27.407(-4)? (STDERR) TypeError: Cannot read property 'bcrypt' of undefined
W20160615-01:19:27.407(-4)? (STDERR) at AccountsServer.Accounts._checkPassword (packages/accounts-password/password_server.js:68:33)
W20160615-01:19:27.407(-4)? (STDERR) at ~/interactiveEstimation/.meteor/local/build/programs/server/packages/mizzao_turkserver.js:4881:18
W20160615-01:19:27.407(-4)? (STDERR) at ~/interactiveEstimation/.meteor/local/build/programs/server/boot.js:298:5
=> Exited with code: 8
Run Code Online (Sandbox Code Playgroud)
我的设置文件:
{
"turkserver": {
"adminPassword": "mmaatouq95",
"experiment": {
"limit": {
}
},
"mturk": {
"accessKeyId": "AKIAJDDHTM3IRYMWUX7Q",
"secretAccessKey": "eeTud7Gml3Yz6XD9gWLUZzsJokoie2rEq"
}
}
}
Run Code Online (Sandbox Code Playgroud)
这似乎是Meteor的普遍问题,而不是TurkServer(项目文件https://www.dropbox.com/s/ppgbuwv4k3imbt5/interactiveEstimation.zip):
我有一个大型数据帧(5000 x 12039),我想获得与numpy数组匹配的列名.
例如,如果我有桌子
m1lenhr m1lenmin m1citywt m1a12a cm1age cm1numb m1b1a m1b1b m1b12a m1b12b ... kind_attention_scale_10 kind_attention_scale_22 kind_attention_scale_21 kind_attention_scale_15 kind_attention_scale_18 kind_attention_scale_19 kind_attention_scale_25 kind_attention_scale_24 kind_attention_scale_27 kind_attention_scale_23
challengeID
1 0.130765 40.0 202.485367 1.893256 27.0 1.0 2.0 0.0 2.254198 2.289966 ... 0 0 0 0 0 0 0 0 0 0
2 0.000000 40.0 45.608219 1.000000 24.0 1.0 2.0 0.0 2.000000 3.000000 ... 0 0 0 0 0 0 0 0 0 0
3 0.000000 35.0 39.060299 2.000000 23.0 1.0 2.0 0.0 2.254198 …Run Code Online (Sandbox Code Playgroud) 我在创建帐户,发布字段和订阅该出版物时为我的用户添加自定义字段,但我Meteor.user().customField无法在客户端访问该字段.
所以在我imports/api/users/users.js添加以下代码片段:
import { Random } from 'meteor/random'
Accounts.onCreateUser((options, user) => {
const cond = assignUserCondition();
user.enterTime= new Date();
user.page = null;
user.passedQuiz= false;
user.exitStatus=null;
user.quizAttempts= 0;
user.condition= cond;
user.avatar= null;
user.score= 0;
user.bonus= 0;
user.lobbyTimeout= LOBBY_TIMEOUT;
user.gameId= null;
user.condInfo = {name: cond,
groupSize: (cond+'GROUPS_SIZE').split('.').reduce((o, i) => o[i], CONDITIONS_SETTINGS),
bonusConversion: (cond+'BONUS_CONVERSION').split('.').reduce((o, i) => o[i], CONDITIONS_SETTINGS),
N_ROUNDS: (cond+'N_ROUNDS').split('.').reduce((o, i) => o[i], CONDITIONS_SETTINGS),
};
return user;
});
Run Code Online (Sandbox Code Playgroud)
然后,从meteor mongo我验证创建的用户确实有我添加的新自定义字段.现在,在 imports/api/users/server/publications.js我有以下片段:
import {Meteor} from 'meteor/meteor'
Meteor.publish('users.user', …Run Code Online (Sandbox Code Playgroud) 我知道不可能删除_idmongodb集合中的字段.但是,我的集合的大小很大,该_id字段上的索引阻止我加载RAM中的其他索引.我的机器有125GB的RAM,我的收集统计数据如下:
db.call_records.stats()
{
"ns" : "stc_cdrs.call_records",
"count" : 1825338618,
"size" : 438081268320,
"avgObjSize" : 240,
"storageSize" : 468641284752,
"numExtents" : 239,
"nindexes" : 3,
"lastExtentSize" : 2146426864,
"paddingFactor" : 1,
"systemFlags" : 0,
"userFlags" : 1,
"totalIndexSize" : 165290709024,
"indexSizes" : {
"_id_" : 73450862016,
"caller_id_1" : 45919923504,
"receiver_id_1" : 45919923504
},
"ok" : 1
}
Run Code Online (Sandbox Code Playgroud)
当我执行如下查询时:
db.call_records.find({ "$or" : [ { "caller_id": 125091840205 }, { "receiver_id" : 125091840205 } ] }).explain()
{
"clauses" : [ …Run Code Online (Sandbox Code Playgroud)