python

Business Card Raytracer in Python
The business card raytracer converted to Python
Getting started with Django and AngularJS
AngularJS is a fantastic javascript framework. But it requires some tweaks if you want to use it in combination with Django.
An Online/Offline web application based on CouchDB
Repost from www.m3r.eu
Pure lambda calculus in Python
I've always been amazed by lambda calculus (the way it was tought to me at the university). A while ago (actually more than ten years, it turns out) I attempted to implement some pure lambda calculus in Python.I've updated the code a bit and I'm reposting it here. It still ...
A python classproperty
In rare occassions I need a property on a classmethod. Until now I've only needed getter-access (setting properties on classes dynamically is scary anyway). Here's my implementation:def classproperty(f): """ E.g. >>> class foo(object): ... @classproperty ... def name(cls): ... return cls.__name__ >>> print foo.name 'foo' """ class cpf(object): def __init__(self, ...
Prefix substring matching for django haystack / solr
If you're using django haystack with SOLR (both fantastic products) and you want your queries to also match partially against words, e.g. search "foo" will match "foo", "foobar", "food", then the following might be a solution.SOLR supports prefix substring matching through the EdgeNGramFilterFactory. You will need to add this to ...
boosting generic queries with Django Haystack / SOLR
More Django/Haystack/SOLR fun today: boosting a specific field on a generic query. Now, that would seem trivial using the "boost" option on a searchfield, but it isn't. It turns out this option only works if you explicitly query on the boosted field. Consider the following definition:class SomeIndex(SearchIndex): text = CharField(document=True, use_template=True, ...