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 random | |
import sys | |
import copy | |
import pprint | |
seq = [chr(i) for i in range(ord('A'), ord('A') + 10)] | |
times = int(sys.argv[1]) |
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
#不用传参的key | |
static_one = 'o.nimei.xxx' | |
# 需要参数的key | |
player = lambda p: 'player.{0}.info'.format(p) | |
player_levels = lambda p, lv: 'player.{0}.{1}'.format(p, lv) | |
if __name__ == '__main__': | |
# 每次增加新key后, 运行本文件,检查是否有key重名 |
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 <iostream> | |
#include <vector> | |
#include <set> | |
#include <algorithm> | |
#include <ctime> | |
using namespace std; | |
// g++ find_duplicate.cpp -o test -Wall -std=c++0x |
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 fibo(n): | |
if n == 0: | |
return 0 | |
x = [0, 1] | |
if n < 2: | |
return sum(x) | |
for i in range(2, n): | |
x.append( x[i-1] + x[i-2] ) |
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
-module(fibo). | |
-export([start/1]). | |
-vsn(1.1). | |
start(Num) -> | |
ResultList = start(Num, 0, []), | |
Result = lists:sum(ResultList), | |
io:format("~p~n", [ResultList]), | |
io:format("~p~n", [Result]), | |
ok. |
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 gevent | |
from gevent.event import Event | |
from gevent import subprocess | |
from gevent import signal as gevent_signal | |
import os | |
import sys | |
import signal | |
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
syntax on | |
set nocompatible | |
set expandtab | |
set tabstop=4 | |
set shiftwidth=4 | |
set softtabstop=4 | |
set cindent | |
set ignorecase |
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 | |
DAYS=3650 | |
# example: http://svn.red-bean.com/repos/main/3bits/servercert_3bits.txt | |
# 1 Create a Certifying Authority (CA) keypair. | |
# ca.crt / ca.key | |
# a. generate key |
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 | |
apt-get install build-essential | |
apt-get install libpcre3-dev | |
apt-get install libssl-dev | |
apt-get install python-dev | |
apt-get install libmysqld-dev | |
apt-get install libncurses5-dev | |
apt-get install libreadline-dev | |
apt-get install python-pip |
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 | |
apt-get install build-essential | |
apt-get install libpcre3-dev | |
apt-get install libssl-dev | |
apt-get install libmysqld-dev | |
apt-get install libncurses5-dev | |
apt-get install libreadline-dev | |
apt-get install python-dev | |
apt-get install python-pip |
OlderNewer