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
#!/usr/bin/env python | |
import sys | |
import string | |
from collections import deque, defaultdict | |
def findTerm( search, text ): | |
# Unique set of search terms (lowercase) | |
terms = set( s for s in search.lower().split(" ") ) |
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
#!/usr/bin/env python | |
"""phrase_finder.py | |
Find the shortest segment of haystack text containing ALL of the needle words | |
SOME LICENSE BLAH BLAH... | |
Author: Trey Stout <[email protected]> | |
""" | |
import collections |
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
#!/usr/bin/env python | |
"""phrase_finder.py | |
Find the shortest segment of haystack text containing ALL of the needle words | |
SOME LICENSE BLAH BLAH... | |
Author: Trey Stout <[email protected]> | |
""" | |
import itertools |
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
604 19:56:24 vagrant@trey-vagrant [~/real_outland] J:0 (outland_env) [back_to_sql] ⎆ cat regex.yaml | |
regex: '[a-z0-9\.-_]' | |
605 19:56:28 vagrant@trey-vagrant [~/real_outland] J:0 (outland_env) [back_to_sql] ⎆ bpython | |
>>> import re, yaml | |
>>> y = yaml.load(open('regex.yaml')) | |
>>> y | |
{'regex': '[a-z0-9\\.-_]'} | |
>>> r = re.compile(y['regex']) | |
>>> r.match('trey') | |
<_sre.SRE_Match object at 0x21a2d98> |
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
diff -r ffa320b5e178 web/site/auth.py | |
--- a/web/site/auth.py Thu Nov 29 15:47:01 2012 -0500 | |
+++ b/web/site/auth.py Fri Nov 30 16:41:17 2012 -0500 | |
@@ -5,12 +5,11 @@ | |
Date Added: Fri Mar 23 20:08:15 PDT 2012 | |
""" | |
import logging | |
+from functools import partial | |
-from flask import request as R, render_template as T, redirect, flash, \ |
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
#!/usr/bin/env python | |
import hashlib | |
import lib.akn.config as cfg | |
cfg.init(False) | |
from lib.akn.exceptions import CallError | |
def __zset_fetch(bind_pairs, start=0, end=29, count=False, | |
reverse=True, ids_only=False, operator="union", ttl=0, **kwargs): | |
"""General purpose tool for doing zset traversal in redis without abusing | |
local memory too much. To call it, you send in pairs consisting of |
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
#!/usr/bin/env python | |
import lib.akn.config as cfg | |
cfg.init(False) | |
from lib.akn.exceptions import CallError | |
def __zset_fetch(bind_pairs, start=0, end=29, count=False, | |
reverse=True, ids_only=False, operator="union", **kwargs): | |
"""General purpose tool for doing zset traversal in redis without abusing | |
local memory too much. To call it, you send in pairs consisting of | |
* a string representing a zset's key |
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
#!/usr/bin/env python | |
import lib.akn.config as cfg | |
cfg.init(False) | |
from lib.akn.exceptions import CallError | |
def __zset_fetch(bind_pairs, start=0, end=29, count=False, | |
reverse=True, ids_only=False, operator="union", **kwargs): | |
"""General purpose tool for doing zset traversal in redis without abusing | |
local memory too much. To call it, you send in pairs consisting of | |
* a string representing a zset's key |
NewerOlder