Skip to content

Instantly share code, notes, and snippets.

View mikejs's full-sized avatar

Michael Stephens mikejs

View GitHub Profile
[error] [<0.75.0>] OS Process Error :: {os_process_error,"OS process timed out."}
[error] [<0.75.0>] ** Generic server <0.75.0> terminating
** Last message in was {execute,
{[{<<"info">>,
{[{db_name,<<"ut">>},
{doc_count,3155},
{doc_del_count,0},
{update_seq,3346},
{purge_seq,0},
{compact_running,false},
UnboundLocalError Traceback (most recent call last)
/Users/mike/fiftystates/backend/<ipython console> in <module>()
/Users/mike/code/26env/lib/python2.6/site-packages/couchdbkit-0.1.6.1-py2.6.egg/couchdbkit/loaders.pyc in sync(self, dbs, verbose)
71 dbs = [dbs]
72
---> 73 doc_or_docs = self.get_docs()
74 if not isinstance(doc_or_docs, (list, tuple,)):
75 doc_or_docs = [doc_or_docs]
>>> State.objects.count()
16
>>> Bill.objects.count()
36165
>>> Legislator.objects.count()
1636
>>> Sponsor.objects.count()
155922
>>> Action.objects.count()
367515
BeautifulSoup==3.1.0.1
Django==1.1
GChartWrapper==0.9
GnuPGInterface==0.3.2
Twisted==8.2.0
buildbot==0.7.11p3
command-not-found==0.1
## FIXME: could not find svn URL in dependency_links for this package:
flup==1.0.3.dev-20090716
html5lib==0.11.1
#!/usr/bin/env python
import logging
import pymongo
import datetime
class MongoHandler(logging.Handler):
"""
A logging handler that will record messages to a (optionally capped)
MongoDB collection.
# -*- mode: python; -*-
def exampleCheck(context):
context.Message('Custom check...')
return context.Result(True)
env = Environment()
conf = Configure(env, custom_tests={'ExampleCheck': exampleCheck})
# Always prints 'Custom check...(cached)', even when not cached
import sys
import mapnik2
import cairo
prj = mapnik2.Projection("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
m = mapnik2.Map(1280, 768, prj.params())
m.background = mapnik2.Color('white')
district_lyr = mapnik2.Layer('Districts')
district_lyr.datasource = mapnik2.PostGIS(
import sys
import mapnik2
import cairo
prj = mapnik2.Projection("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
m = mapnik2.Map(1280, 768, prj.params())
m.background = mapnik2.Color('white')
district_lyr = mapnik2.Layer('Districts')
district_lyr.datasource = mapnik2.PostGIS(
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <OpenCL/opencl.h>
const char *KernelSource = "\n" \
"#define DELTA 0x9e3779b9 \n" \
"#define ENC_ROUND(sum)" \
"{ " \
#!/usr/bin/env python
from __future__ import division
import nltk
nltk.data.path.append('/Users/mike/.nltk_data')
inaugural = nltk.corpus.inaugural
with open('./sentence_lengths.csv', 'w') as out:
for fileid in inaugural.fileids():