This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo import MongoClient | |
import datetime | |
topics = MongoClient('10.8.8.111:27017')['onions35']['topics'] | |
users = MongoClient('10.8.8.111:27017')['onions']['users'] | |
finish_state = MongoClient('10.8.8.111:27017')['ronfedb']['finishStateNew'] | |
finish_state.drop() | |
DATE_DEFAULT_HOLD = datetime.datetime(2016,5,5,1) | |
DATE_INIT = datetime.datetime(1970,1,1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# _*_ coding:utf-8 _*_ | |
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
import subprocess | |
import jwt | |
''' | |
This script aims to generate finishPractice log from daily | |
dumped httplogs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri May 6 11:01:25 2016 | |
@author: xinruyue | |
""" | |
from pymongo import MongoClient | |
db = MongoClient("10.8.8.111:27017")["eventsV35"] | |
events = db['eventV35'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var practiceFinishSchema = new Schema({ | |
"user": ObjectId, | |
"eventTime": Number, // time of finish practice | |
"serverTime": ISODate, // time of finish practice | |
"topic": String, | |
"type": String(enum: ["A", "B", "C", "D", "E", "S"]), | |
"finishState": String(enum: ["perfect", "imperfect"]), | |
"duration": Number, //the duration from start practice to finish | |
"practiceLog": [ // not contained in first version | |
{"level": String, "problemId": ObjectId, "duration": Number, "correctness": Boolean} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# _*_ coding:utf-8 _*_ | |
from pymongo import MongoClient | |
db = MongoClient('10.8.8.111:27017')['onions-cb'] | |
chapters = db['chapters'] | |
x = chapters.find({"publisher": "北师大版", "semester": "七年级下", "status": "published"}) | |
topic_list = [] |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 10 columns, instead of 9 in line 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/signup$,POST,,signupSuccess,,channel,from,,_id,type | |
/signup/qq,POST,,signupSuccess,,channel,from,,_id,type | |
/login$,POST,,loginSuccess,,,,_id,type | |
/login/qq,POST,,loginSuccess,,,,_id,type | |
/bind/qq,PUT,,bindQQSuccess,,,,_id | |
/unbind/qq,PUT,,unbindQQSuccess,,,, | |
/logout,POST,,logoutSuccess,,,, | |
/user/password$,PUT,,modifyPassword,,,,_id | |
/me$,PUT,,updateProfile,,**,, | |
/me$,GET,,getProfile,,,,_id,allowed,partialOpen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//退款原因、拒绝续费、拒绝退费(逍遥Part) | |
{ | |
userId: {type: ObjectId, required: true}, | |
tag: {type: String, enum: ["refund", "noPay", "noRenew"]}, //refund = 退款问卷, noPay = 拒绝付费问卷, noRenew = 拒绝续费问卷 | |
publisher: {type: String}, | |
semester: {type: String}, | |
body: { | |
"anotherString": { | |
"qq": String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backSchema = new Schema({ | |
"eventKey": {type: String, required: true}, | |
"eventValue": {type: Mixed}, | |
"ua": String, | |
"url": String, //only for pc, the full url | |
"category": "onionsBackend", // to string | |
"platform": "backend", //Required | |
"ip": String, | |
"location": {type: Mixed}, | |
"user": ObjectId, //Required when user logged in, its user id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event35Schema = new Schema({ | |
"eventKey": {type: String, required: true}, | |
"eventValue": {type: Mixed}, | |
"device": String, //Required, unique id for pc, imei for android, idfa for ios | |
"deviceOld": String, | |
"deviceAttr": { | |
"os": { | |
"name": {type: String}, //Required, operating system name macos/linux/win for pc, android/ios/win for mobile | |
"version": String //Conditional optional, os version code | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"code": 101, | |
"name": "Student Home PC", | |
"block": 1, | |
"platform": "web", | |
"prevPoint": "enterHome", | |
"property": { | |
"sampleExerciseChosen": "", | |
"sampleExerciseChecked": false | |
"iosAppTrayExtended": false, |