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 coroutine(func): | |
def start(*args, **kwargs): | |
cr = func(*args, **kwargs) | |
cr.next() | |
return cr | |
return start | |
@coroutine | |
def grep(pattern): |
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 re | |
import subprocess | |
from urllib2 import urlopen | |
url = 'http://videolectures.net/ecmlpkdd08_carlson_bief/' | |
re_flv = re.compile(r'(flv:[\w/]+)') | |
html = urlopen(url).read() | |
m = re.search(re_flv, html) | |
if m: |
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
# login the Quora and get notifications with unofficial API (http://www.quora.com/Edmond-Lau/Edmond-Laus-Posts/Quora-Extension-API) | |
# tpeng <[email protected]> 2013/1/7 | |
# some references | |
# https://gist.github.com/2341517 | |
# http://www.ruby-doc.org/gems/docs/q/quora-client-0.1.2/Quora/Auth.html | |
# http://stackoverflow.com/questions/10616449/how-to-programmatically-log-in-to-quora-by-java-code | |
import cookielib | |
import json |
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
WindWindows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Python] | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore] | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7] | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Help] |
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 com.google.common.hash.HashFunction; | |
import com.google.common.hash.Hashing; | |
/** | |
* A simple MinHash implementation inspired by https://github.com/jmhodges/minhash | |
* | |
* @author tpeng ([email protected]) | |
*/ | |
public class MinHash { |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
a { color: #00c; text-decoration: none; } | |
a:visited { color: #00c; } | |
a:hover { text-decoration: underline; } | |
.clear {clear:both;} | |
#content { |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
a { color: #00c; text-decoration: none; } | |
a:visited { color: #00c; } | |
a:hover { text-decoration: underline; } | |
.clear {clear:both;} | |
#content { |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
a { color: #00c; text-decoration: none; } | |
a:visited { color: #00c; } | |
a:hover { text-decoration: underline; } | |
.clear {clear:both;} | |
.hl { |
NewerOlder