Category archives: Snaking
Discussions of programming, particularly of programming Python
Profile first, then optimise (Surprising what you find with actual measurements...)
Written by
on
in
Snaking.
Biggest event of the day was discovering that 30% of total work in the system was being done in a __cmp__ method that was doing the equivalent of "if x is y" when everything was said and done. It appears, in the end, to have been the ultimate source of the slowdowns that I've spent ...
Wasn't I supposed to stop working back then (Look ma, hour-per-day discipline falling apart...)
Written by
on
in
Snaking.
Wanted to add some debugging code to see if I could catch some bugs during the evening's operation... turned into rather a lot of bug-fixing and minor feature implementation work that bring's the day's total to some entirely improper number of hours (sorry hands). I have to stop now or I won't be able to ...
A day of iconic splendour (Mmm graphics!)
Written by
on
in
Snaking.
Today was spent mostly cleaning up and extending the set of icons available in Cinemon 2.0. Nothing hugely challenging there; create a mechanism to allow for easily registering icon correspondence and another for defining an icon, then plough through and either assign or create-and-assign and icon for each major group-type in the system.
The impact ...!-->!-->
That day was way too long ("Finish the (major) feature" isn't a good plan for a day...)
Written by
on
in
Snaking.
For some reason (likely lack of sleep and exercise) I'm extremely tense today. My shoulders and upper arms are just masses of knots, which messes up my hands as I type. Did a huge amount of work on 2.0 today, as well as a bunch of administrative stuff for the 1.0 launch (18 days and ...
Parties take a lot of prep-time (Especially when you've been letting the housework get behind...)
Written by
on
in
Snaking,
Vindaloo.
Having a birthday party for Shane this evening. Result is that I'm not going to get any more work done on the OpenGL ctypes wrapper. Last night I fixed a few problems with the pointer-setting mechanism, and began breaking out the platform-specific code into separate modules. Spent quite a bit of time trying to figure ...
Bug turns out to be a logic problem with parallel operation (It only waits until an op is finished, if it finishes instantly it never waits)
Written by
on
in
Snaking.
Finally tracked down the hanging Twisted code. It was a big operation that happens every 20 minutes. The first time through every operation has to wait for a network connection or 2, so there's always a deferred. Subsequent times none of the (3000+) operations has to wait, but they are very heavy in terms of ...
Neat debugging trick from James Knight (Finding out what's hanging in your Twisted application...)
Written by
on
in
Snaking.
In response to my queries about how to catch a hanging application, James posted this wonderful little snippet of code:
import signal, pdb, sys
from twisted.internet import task
def timeout(*args):
sys.stderr.write("SIGALRM timeout, breaking into debugger.\n")
import pdb; pdb.set_trace()
signal.signal(signal.SIGALRM, timeout)
task.LoopingCall(signal.alarm, 10).start(1)
The reason that works is that the alarm call cancels all previous alarm ...!-->!-->
Maybe it's time to add a Bayesian classifier for comments (More spam... evil spam...)
Written by
on
in
Snaking.
Spambayes is just sitting there, beckoning me. The idea is that you would configure a Hammie instance as a Zope object pointing to an on-disk database (to avoid balooning the ZODB). You would train on all comments in your blog (assuming you have only good comments), then train on any spam that comes in.
The ...!-->!-->
Days of marketing splendour (Drat it, how many t's in that word!)
Written by
on
in
Snaking,
Vindaloo.
Spent the bulk of yesterday on various marketing tasks, reviewing and rewriting the product introduction, recreating screenshots in higher resolutions, finalising the demo install for the San Antonio conference.
The annoying part is that I didn't really enjoy it. Normally I love doing marketing-type work, it's a design discipline, after all. This time I just ...!-->!-->
Auto-generating ctypes wrappers (Overriding the auto-generation for fun and profit...)
Written by
on
in
Snaking.
The default ctypes auto-generated wrappers are really quite expensive, so I wanted to rework them. Luckily the entire function-generating operation is a single overridable method. The methods now look like this: