This file contains 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
#ifndef TSTRING_H | |
#define TSTRING_H | |
#include <string.h> | |
#include <string> | |
#undef DISALLOW_EVIL_CONSTRUCTORS | |
#define DISALLOW_EVIL_CONSTRUCTORS(TypeName) \ | |
void operator=(const TypeName&) | |
This file contains 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
#encoding=utf-8 | |
import tornado | |
import pytyrant | |
import tornado.web | |
import tornado.ioloop | |
import json as simplejson | |
tt_server = None | |
class PutHandler(tornado.web.RequestHandler): |
This file contains 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
1) "account:history:huangdx" | |
2) "account:history:shidh" | |
3) "account:zhaojing" | |
4) "account:id:10" | |
5) "account:id:11" | |
6) "account:id:12" | |
7) "account:id:13" | |
8) "account:id:14" | |
9) "account:id:15" | |
10) "account:id:16" |
This file contains 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
import os | |
import jsonrpclib | |
from mongoengine import * | |
connect('dict') | |
class Page(Document): | |
created_at = db.DateTimeField(default=datetime.datetime.now, required=True) | |
word = db.StringField(max_length=255, required=True, unique = True) |
This file contains 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
#encoding=utf-8 | |
#simple http/sockJS comet server written by huangdx | |
import tornado.ioloop | |
import tornado.web | |
import sockjs.tornado | |
import json | |
class TestHandler(tornado.web.RequestHandler): | |
def get(self): |
This file contains 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
['dishuang@rd.netease.com', 'wangzhiqiang688@126.com', 'chyangny@163.com', 'baguolj@163.com', 'wordbook1', 'guotianni@163.com', 'dengxinjs@163.com', 'hi_yod@126.com', 'wayneteng87@yahoo.com.cn', 'shenli3514', 'caryonline@163.com', 'fred3k@126.com', 'wushujuanjany@163.com', 'shenli3514@163.com', 'dogshuang@163.com', 'lix7411@126.com', 'cuiwanyu1218@163.com', 'jiaoxiyin@163.com', 'c4pt0r@163.com', 'dingzongqiu@126.com', 'wujiaquanyod@163.com', 'ly-no9@163.com', 'daviddengcn', 'liuqiurunyod@163.com', 'feihong750@163.com', 'c4pt0r@126.com', 'chongynj@163.com', 'jimhuman@163.com', 'ljg-578@163.com', 'omikron', 'no_rain_today@126.com', 'kissgod97@163.com', 'wuyinghui97@163.com', 'wordbook1@163.com', 'nikanaa@163.com', 'shuke987@163.com', 'kingcardlg@163.com', 'mmwwwwwwwwwwwwwwwm@163.com', 'liu95liang@126.com', 'wanghuiyod@126.com', 'wanglei00163@163.com', 'linminhuanyod@163.com', '170257702@163.com', 'lyn_imme@163.com', 'mrbean_mrbean@126.com', 'kg-119911', 'yoheka@yeah.net', 'mdict1@163.com', 'qipengbupt@163.com', |
This file contains 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
#!/usr/bin/env python | |
# * simple RESTful http queue service * | |
# written by c4pt0r <huangdongxu1987@gmail.com> | |
# date 2012-8-29 | |
import os | |
import tornado.ioloop | |
import tornado.web | |
import tornado.gen |
This file contains 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
#encoding=utf-8 | |
import os | |
import sys | |
import redis | |
def read_list(filename): | |
c = open(filename).read() | |
return [s.lstrip().rstrip() for s in c.split('\n')] | |
r = redis.Redis('nb391x.corp.youdao.com', 6379) |
This file contains 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
#include <stdlib.h> | |
#include <stdarg.h> | |
#include <ctype.h> | |
#include <time.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include "log.h" |
This file contains 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
#include "conn.h" | |
int | |
_set_non_blocking(int s) { | |
int x; | |
x = fcntl(s,F_GETFL,0); | |
fcntl(s,F_SETFL,x | O_NONBLOCK); | |
return s; | |
} |