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 | |
import multiprocessing | |
import time | |
import subprocess, os, signal, sys | |
def test(s): | |
while True: | |
print s | |
time.sleep(1.5) |
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
/* | |
* ===================================================================================== | |
* | |
* Filename: tree.cpp | |
* | |
* Description: some operations with binary tree | |
* | |
* Version: 1.0 | |
* Created: 09/29/2013 01:16:19 AM | |
* Revision: 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
/* | |
* ===================================================================================== | |
* | |
* Filename: sorts.c | |
* | |
* Description: basic sorting algorithms | |
* | |
* Version: 1.0 | |
* Created: 09/23/2013 03:58:30 PM | |
* Revision: 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
#include <vector> | |
#include <algorithm> | |
using std::vector; | |
using std::swap; | |
template <typename T> | |
class heap | |
{ | |
public: |
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
/* | |
* ===================================================================================== | |
* | |
* Filename: rbtree.cpp | |
* | |
* Description: red-black tree in cpp | |
* | |
* Version: 1.0 | |
* Created: 10/03/2013 11:38:50 PM | |
* Revision: 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
/* | |
* ===================================================================================== | |
* | |
* Filename: kmp.cpp | |
* | |
* Description: Knuth-Morris-Pratt Algorithm | |
* | |
* Version: 1.0 | |
* Created: 10/04/2013 06:15:30 PM | |
* Revision: 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
/* | |
* ===================================================================================== | |
* | |
* Filename: reverse_words.cpp | |
* | |
* Description: a program to reverse the words in a sentence. | |
* | |
* Version: 1.0 | |
* Created: 10/27/2013 08:21:49 PM | |
* Revision: 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
import os | |
import glob | |
import shutil | |
def rotate_files(filename, limit): | |
need_rotate = os.path.exists(filename) | |
if not need_rotate: | |
return | |
files = glob.glob('%s.*' % filename) | |
files.sort(key=lambda f: int(f.rsplit('.', 1)[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
#!/usr/bin/env python | |
import os | |
import struct | |
import hashlib | |
import hmac | |
import sys | |
import getpass | |
HMAC_KEY_FOR_AES = '\xa7\x8fd\xaa\xa9\x9cwWnjf\xf6bN\xb0\xb7<a\xdb\xd8\xbf\xc7\x99\xaf\xc1)\x96\xf8\xe4i`\xc3l\x94l7h' |
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 | |
''' | |
count occurence rate of lines with certain keyword with ewma algorithm. | |
''' | |
import math | |
import time | |
import sys | |
OlderNewer