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
| requests==2.4.3 | |
| rsa==3.1.4 |
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
| package main | |
| import ( | |
| "net/http" | |
| "net/url" | |
| "log" | |
| "io/ioutil" | |
| "regexp" | |
| "fmt" | |
| //"net/http/httputil" |
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
| def quicksel(l,k): | |
| if len(l) <k: | |
| raise ValueError | |
| else: | |
| pivot=l.pop() | |
| lg=filter(lambda x:x>pivot,l) | |
| ll=filter(lambda x:x<=pivot,l) | |
| if len(lg)>=k: | |
| return quicksel(lg,k) | |
| elif len(lg)+1==k: |
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
| import redis | |
| from redis import WatchError | |
| import time | |
| RATE = 0.1 | |
| DEFAULT = 100 | |
| TIMEOUT = 60 * 60 | |
| DEBUG = False |
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 http = require('http'); | |
| var qs = require('querystring'); | |
| function parse_response(res, callback) { | |
| var list = []; | |
| res.on('data', function(chunk) { | |
| list.push(chunk); | |
| }); | |
| res.on('end', function() { | |
| callback(Buffer.concat(list).toString()); |
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
| ## ccl + quicklisp + SLIME,假设你一直用的 Emacs | |
| mkdir c:\bin | |
| cd c:\bin | |
| curl -O ftp://ftp.clozure.com/pub/release/1.8/ccl-1.8-windowsx86.zip | |
| curl -O http://beta.quicklisp.org/quicklisp.lisp | |
| 7z x ccl-1.8-windowsx86.zip ccl | |
| ccl\wx86cl -l quicklisp.lisp |
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=utf8 | |
| import pybcs | |
| import logging | |
| pybcs.init_logging(logging.INFO) | |
| AK = '' #请改为你的AK | |
| SK = '' #请改为你的SK | |
| BUCKET='myimage1' |
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
| /* Simple Memcached in Javascript | |
| * @Author: Sun, Junyi | |
| * @Email: ccnusjy@gmail.com | |
| * @Date: 2012-8-3 | |
| */ | |
| var net = require('net'); | |
| var store = {} | |
| function handle_header(header,crlf_len){ | |
| var tup = header.split(" ") |
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
| import struct | |
| import SocketServer | |
| from base64 import b64encode | |
| from hashlib import sha1 | |
| from mimetools import Message | |
| from StringIO import StringIO | |
| class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
| magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
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 -*- | |
| '写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码' | |
| '搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5' | |
| import string | |
| __dict = {} | |
| def load_dict(dict_file='words.dic'): | |
| '加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典' |