原创 M101P: MongoDB for Developers - Chapter 3: Schema Design
Homework 3.1 $ cat r.py import pymongo import sys connection = pymongo.MongoClient("mongodb://localhost") db=connec
原创 程序設計與算法 第五週測驗
1:與指定數字相同的數的個數 #include <iostream> using namespace std; #define MAX_NUM 100 int main() { int N, n[MAX_NUM]={0}, m
原创 MooseFS Master main 函數代碼簡單學習
MFS Master 版本 2.0.x,開發語言 C,使用 AutoTools 作爲構建工具集 亮點: 爲 master、chunk、metalog 提供了一套統一的公用的 main 函數處理框架 暗點: 源碼中不帶單元測試或
原创 Coursera Machine Learning Week 4 - Neural Networks
Neural Networks: Representation 1. Which of the following statements are true? Check all that apply. (OK) In a neu
原创 M101P: MongoDB for Developers - Chapter 1: Introduction
Homework 1.1 > use m101 switched to db m101 > db.hw1.findOne() { "_id" : ObjectId("xxx"), "answer"
原创 M101P: MongoDB for Developers - Chapter 2: CRUD
Homework 2.1 > db.grades.find({score:{$gte:65}}).sort({score:1}) { "_id" : ObjectId("xxx"), "student_id" : 22, "typ
原创 程序設計與算法 第三週測驗
1 奇偶數判斷 #include <iostream> #include <cstdio> using namespace std; int main() { int n; scanf("%d", &n); if (n
原创 程序設計與算法 第六週測驗
1:Pell數列 #include <iostream> using namespace std; int main() { int n; long k; long long P[1000000+1]={0}; P
原创 M202: MongoDB Advanced Deployment and Operations - Chapter 4: Sharded Cluster Management
4.1: Pre-splitting data mkdir c1 s1 s2 s3 mongod --configsvr --dbpath c1 mongos --configdb m202-ubuntu1404 mongod -
原创 M101P: MongoDB for Developers - Chapter 4: Performance
Homework 4.1 (OK) db.products.find( { $and : [ { price : { $gt : 30 } }, { price : { $lt : 50 } } ] } ).sort( { br
原创 M102: MongoDB for DBAs - Chapter 1: Introduction
Homework 1.1 db.isMaster().maxBsonObjectSize 16777216 Homework 1.2 mongoimport --drop -d pcat -c products Products_
原创 程序設計與算法 第一週測驗
1 十進制數255表示成四位十六進制形式是: 00FF 2 short類型變量n的值是-12,那麼其值的四位十六進制形式是: FFF4 3 有兩個變量a和b,在執行了如下代碼後: a = 32768; b = a; print
原创 MongoDB 日誌分析工具 mtools
概述 mtools is a collection of helper scripts to parse and filter MongoDB log files (mongod, mongos), visualize log
原创 Coursera Machine Learning Week 3 - Programming Exercise 2: Logistic Regression
sigmoid.m g = 1 ./ (1 + exp(-z)); costFunction.m S = sigmoid(X * theta); J = ( (-y' * log(S)) - ((1 - y') * log(1-S
原创 MongoDB 的用戶認證
MongoDB 2.2 的認證 https://docs.mongodb.com/v2.2/administration/security/ 提供了數據庫級別的用戶身份認證和授權 用戶認證授權信息保存在每個數據庫的 db.sys