Skis / Toys / Fun

Appeal to greatness not guilt

Skis / Toys / Fun

Twisted code review…

November 12th, 2009

If you have a few minutes and speak python & twisted, it would be useful to have an extra set of eyes on this section of code. The basic idea of this is to be a reconnecting thrift client, such that I can just write simple client.function(a,b,c) calls without having to worry about [...]

Tags:   · ·

Set permission_required for your view functions

September 22nd, 2008

Working with django 1.0 and google app engine… Wanted to set every view on my admin page to have admin permission.

def _perm_admin(rootfunc) :
import sys
module = sys.modules.get(rootfunc.__module__)
for key, value in module.__dict__.items() :
if type(value) is [...]

Tags:   ·

Python Documentation — Fail!

September 5th, 2008

One of many rants against python documentation.  Fundamentally, things like this only re-enforce why it didn’t receive the rapid acceptance of PHP.
$ pydoc list
….
 |  index(…)
 |      L.index(value, [start, [stop]]) -> integer — return first index of value
….
Ok, that’s good… But what about the “not found” case, is it documented, nope!  We have three choices, can you [...]

Tags:  

Performance of Python, PHP and Perl

June 10th, 2008

Had a 7GB text file that I needed to run some parsing on (to prepare for a DB import).  As part of my habit I pulled out perl and whipped up a quick program to parse and generate some loadable files.  While watching it run I got to thinking about … why … why perl [...]

Tags:   · · ·