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 unittest | |
import logging | |
import time | |
import requests | |
import simplejson as json # simplejson 可以改成 Python 标准库 import josn | |
from Crypto.Cipher import AES # 加密模块为 pycrypto ,需要安装 | |
# 加密密钥为 1234567890123456 加密方法为 AES ECB ,字节填充方法为 PKCS#7 | |
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
2014-05-24 15:34:27 惰性求治 | |
在吗? | |
2014-05-24 15:34:46 表弟 | |
恩 | |
2014-05-24 15:35:34 惰性求治 | |
你现在是不是觉得上课没意思,自己根本没兴趣。我之前也是这样感觉的…… | |
2014-05-24 15:36:26 表弟 |
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
from pypeg import Symbol, parse | |
from .struct.pair import Pair | |
class ListContent(Pair): pass | |
class List(Pair): pass | |
expr = lambda: [Symbol, List, ] | |
List.grammar = '(', ListContent, ')' | |
ListContent.grammar = [(expr(), ListContent), None] |
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
def framework(): | |
pipeline = [] | |
register = lambda test, handler: pipeline.append((test, handler)) | |
def processing(*args): | |
for test, handler in pipeline: | |
tested = test(*args) | |
if tested is not False: | |
return handler(*args) |
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
#!/bin/bash | |
while : | |
do | |
read TEXT | |
echo $TEXT | |
echo $TEXT > $1 | |
done |
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 re | |
re.compile("(\"(\\\\\"|[^\"])*\")|('(\\\\\'|[^'])*')") # string |
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 ycm_core | |
flags = [ | |
'-Wall', | |
'-Wextra', | |
'-Werror', | |
'-Wc++98-compat', | |
'-Wno-long-long', | |
'-Wno-variadic-macros', |
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
eNqzf9I9UTuBgcH+353ai5IzZ9k/j5j8My0t3f6ib8ipC7vP2D/N8rm4ACj/6/kiuU6g/AO+CW715RX2n6OSHA2A4q+UiuXV0tLsnz48pyr37p39M5GTTJONjR1YuoXl+4DiG/Yc9399bIr9p0/6/MW799ifFnQ1eQdU9/J4tsu8d+8YGBhYHThsjW5EXlK3/57yfxpbWtp/IHAQVK6aL8d20f7J+1nH7f//B6pjsv+wf1FU34VL9p83htsEMDCA1TFdj9GIkd5if1nu/uK6W5VgMdEz5Q6TMhbb33SvdywvLwfbIagzQ/zSZBP7N8Zx6puNTcDqhG3OfDROPGd/1JXrXvmRe2AxkdURCnsOs9if+LPqIlAjQ3bOYoa/GUcYrk54yeDyNYchVH8xQ9PFfwwXNvczSNZcZmB9FsZwcFkDg86xVwzGb9wZWp74MehN4mNgWG/FsOJJG9AEZgDa0qX6 |
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
(define (fib n) | |
(fib-iter 1 0 0 1 n)) | |
(define (fib-iter a b p q count) | |
(define (square n) (* n n)) | |
(cond ((= count 0) b) | |
((even? count) | |
(fib-iter | |
a | |
b |
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
#lang racket | |
(define (curry f) | |
(define (min-arity arity) | |
(if (number? arity) arity (arity-at-least-value arity))) | |
(define (curry-aux f args arity) | |
(lambda (a) | |
(let ((new-args (cons a args))) | |
(cond ((= arity 1) | |
(apply f (reverse new-args))) |