查询course表中,存在lectures_count字段的记录信息db.course.find( { "lectures.lectures_count": { $exists: true } } )删除course表中,所有的lectures.lectures_count字段db.course.u... Read More
posted @ 2014-10-09 11:34 siyed Views(2802) Comments(0) Diggs(0) Edit
1 #!/usr/bin/env python2 #coding=utf-83 import traceback 4 5 try:6 1/07 except Exception, e:8 print e9 print traceback.format_exc() Read More
posted @ 2014-09-25 10:10 siyed Views(500) Comments(0) Diggs(0) Edit
@staticmethod def instance(): """Returns a global `IOLoop` instance. Most applications have a single, global `IOLoop` running on ... Read More
posted @ 2014-09-22 12:45 siyed Views(251) Comments(0) Diggs(0) Edit
python int是python把任何类型转换成int类型的方法,但是你如果运用不好的话,会引发异常,但是python的str字符串转换方法运用起来倒是比较安全,它把任何对象转换成字符串类型都不会报异常。现给个python int的例子:比如a = '123' b = int(a) print b... Read More
posted @ 2014-09-15 17:45 siyed Views(1739) Comments(0) Diggs(0) Edit
【Apache ZooKeeper】命令行zkCli.sh使用指南 Read More
posted @ 2014-09-12 17:43 siyed Views(1140) Comments(0) Diggs(0) Edit
安装mysql-python报错:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 65: ordinal not in range(128)需要先安装(yum):mysql-develpython-devel Read More
posted @ 2014-09-11 16:35 siyed Views(1091) Comments(0) Diggs(0) Edit
eclipse pydev:preferences > PyDev > Editor > Overview Ruler Minimap Read More
posted @ 2014-09-03 16:01 siyed Views(351) Comments(0) Diggs(0) Edit
staticmethod 基本上和一个全局函数差不多,只不过可以通过类或类的实例对象(python里光说对象总是容易产生混淆, 因为什么都是对象,包括类,而实际上类实例对象才是对应静态语言中所谓对象的东西)来调用而已, 不会隐式地传入任何参数。这个和静态语言中的静态方法比较像。classmethod... Read More
posted @ 2014-08-29 10:56 siyed Views(443) Comments(0) Diggs(0) Edit
0. 前期准备官方protobuf定义https://code.google.com/p/protobuf/python使用指南https://developers.google.com/protocol-buffers/docs/pythontutorialhttp://blog.csdn.net... Read More
posted @ 2014-08-25 14:09 siyed Views(3323) Comments(0) Diggs(0) Edit
使用下例中ssky-keygen和ssh-copy-id,仅需通过3个步骤的简单设置而无需输入密码就能登录远程Linux主机。 ssh-keygen 创建公钥和密钥。 ssh-copy-id 把本地主机的公钥复制到远程主机的authorized_keys文件上。ssh-copy-id 也会给远程主机... Read More
posted @ 2014-08-22 17:57 siyed Views(416) Comments(0) Diggs(0) Edit