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 truthiness = function(obj) { | |
| /* ?P -> Boolean */ | |
| switch(obj) { | |
| case 0: | |
| case false: | |
| case null: | |
| case undefined: | |
| return false; | |
| case true: | |
| return true; |
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
| cgi-bin/php?-d+allow_url_include=on+-d+safe_mode=off+-d+suhosin.simulation=on+-d+disable_functions=""+-d+open_basedir=none+-d+auto_prepend_file=php://input+-d+cgi.force_redirect=0+-d+cgi.redirect_status_env=0+-d+auto_prepend_file=php://input+-n |
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
| static PyObject *__pyx_pf_4test_fib(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n) { | |
| PyObject *__pyx_v_SZ = NULL; | |
| PyObject *__pyx_v_i = NULL; | |
| PyObject *__pyx_v_a = NULL; | |
| PyObject *__pyx_v_b = NULL; | |
| PyObject *__pyx_v_t = NULL; | |
| PyObject *__pyx_r = NULL; | |
| __Pyx_RefNannyDeclarations | |
| PyObject *__pyx_t_1 = NULL; |
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
| http://0-www.sciencedirect.com.www.consuls.org/science?_ob=QuickSearchURL&_method=submitForm&_acct=C000050221&md5=0c4b6db32507e4a332b2aa6dd47a65f4&qs_all={searchTerms}&qs_author=&qs_title=&qs_vol=&qs_issue=&qs_pages=&x=34&y=15 | |
| http://0-dictionary.oed.com.library.utulsa.edu/cgi/findword?query_type=word&queryword={searchTerms} | |
| http://100.daum.net/search/search.do?query={searchTerms} | |
| http://1000corks.com/search?st={searchTerms}&src=myc | |
| http://11870.com/konsulto/{searchTerms} | |
| http://1000memories.com/search?q={searchTerms} | |
| http://130.219.35.129/search?q={searchTerms}&btnG=Google+Search&entqr=0&output=xml_no_dtd&sort=date%3AD%3AL%3Ad1&client=default_frontend&ud=1&oe=UTF-8&ie=UTF-8&proxystylesheet=default_frontend&site=default_collection | |
| http://1337x.org/search/{searchTerms}/0/ | |
| http://11888.ote.gr/web/guest/white-pages/search?who={searchTerms}&where= | |
| http://140.111.34.46/cgi-bin/newDict/dict.sh?idx=dict.idx&cond={searchTerms}&pieceLen=50&fld=1&cat=&imgFont=1 |
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
| (defn parse-row | |
| [^String row] | |
| (let [[k v] (.split row \tab) | |
| [k1 k2] (map (partial string/join " ") (json/read-str k))] | |
| [k1 k2 (Long/parseLong (.trim v))])) | |
| (defn co-occurrence | |
| [dir] | |
| (let [source (hfs-textline dir)] | |
| (<- [?k1 ?k2 ?count] |
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 memory_info(): | |
| res = {} | |
| for row in open('/proc/meminfo', 'r'): | |
| k, v = row.split(':') | |
| k = k.strip() | |
| v = v.split() | |
| if len(v) == 1: | |
| v = int(v[0]) | |
| elif v[1] == 'kB': | |
| v = int(v[0]) * 1024 |
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
| from contextlib import contextmanager | |
| @contextmanager | |
| def binding(**pairs): | |
| g = globals() | |
| prev = dict((k, g[k]) for k in pairs.iterkeys() if k in g) | |
| g.update(pairs) | |
| try: | |
| yield | |
| finally: |
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
| class Multi(object): | |
| def __init__(self, callback): | |
| self.callback = callback | |
| self.counter = 0 | |
| self.fired = False | |
| self.started = False | |
| def enter(self): | |
| assert not self.started |
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 Image | |
| import random | |
| target = Image.open('target.png').convert('RGB') | |
| target_distance = 10 | |
| def make_image(): | |
| return Image.new('RGB', target.size) |