Skip to content

Instantly share code, notes, and snippets.

View Fluxx's full-sized avatar

Jeff Pollard Fluxx

View GitHub Profile
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 369, in _handle_results
cache[job]._set(i, obj)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 533, in _set
self._callback(self._value)
File "concurrency.py", line 38, in __call__
1,2c1
< "forums_post_author_email" btree (author_email)
< "forums_post_author_email_like" btree (author_email varchar_pattern_ops)
---
> "forums_post_author_date" btree (author_id, date)
4a4,5
> "forums_post_deleted" btree (forum_id, date) WHERE killed = true
> "forums_post_forum_author" btree (forum_id, author_id)
6a8,13
> "forums_post_forum_id_date_report_count" btree (forum_id, date, report_count) WHERE report_count > 0
import time
from threading import Semaphore
from multiprocessing.pool import ThreadPool
class ThreadSafeCount(object):
def __init__(self):
self.mutex = Semaphore(1)
#!/bin/bash
unique_func_names=`grep -huRPo "def \w+" disqus | cut -d ' ' -f 2 | sort | uniq`
for func in $unique_func_names ; do
num_found=$(grep -r $func disqus | grep -v "def " | wc -l)
if [[ num_found -lt "0" ]]; then
echo $num_found $func
fi
@Fluxx
Fluxx / gist:5323263
Last active December 15, 2015 21:09
4a5,7
> import Queue
> import threading
> import heapq
13,16c16,29
< class WebSpider(object):
< def __init__(self):
< self.results = {}
<
---
@Fluxx
Fluxx / spider.diff
Last active December 15, 2015 21:09
4a5,7
> import Queue
> import threading
> import heapq
13,16c16,29
< class WebSpider(object):
< def __init__(self):
< self.results = {}
<
---
4a5,7
> import Queue
> import threading
> import heapq
13,16c16,29
< class WebSpider(object):
< def __init__(self):
< self.results = {}
<
---
4a5,7
> import Queue
> import threading
> import heapq
13,16c16,29
< class WebSpider(object):
< def __init__(self):
< self.results = {}
<
---
with self.reraise(Exception, as=EvmError):
evm.count('pclick3')...
diff --git a/exam/objects.py b/exam/objects.py
index 7e6aaf1..7bedd18 100644
--- a/exam/objects.py
+++ b/exam/objects.py
@@ -5,3 +5,19 @@ def always(value):
return lambda *a, **k: value
noop = no_op = always(None)
+
+