Category archives: Snaking

Discussions of programming, particularly of programming Python

RSS feed of Snaking

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)


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 ...

Continue reading

Neat debugging trick from James Knight (Finding out what's hanging in your Twisted application...)


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 ...

Continue reading

Maybe it's time to add a Bayesian classifier for comments (More spam... evil spam...)


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 ...

Continue reading

Days of marketing splendour (Drat it, how many t's in that word!)


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 ...

Continue reading

We need a pydoc replacement (Modularity and extensibility being the things that are missing...)


Working on the ctypes wrappers some more this evening. Spent some time making the code generate names for the arguments. Got deeper and deeper into that until I realised I was considering rewriting the whole generation engine... that's generally a bad sign.

So, back up a little and look at something else. Realised that pydoc ...

Continue reading

Enough with the long days already (This one's trying to turn into a run-away)


Spent the first half of the day installing the demo on the laptop. Lot of headaches with PostgreSQL until I decided to install the native (instead of the CYGWIN) version. The last half of the day was spent dealing with stupid little bugs in the live systems. Lot of annoying junk. Worse, it's still going ...

Continue reading

I forgot how pretty Cinemon can be (Windows laptop and a data transfer switch makes it so obvious!)


So, after another extended day, went to the UU meeting to see Bryan and pick up the laptop. It's an IBM X31 ThinkPad with a busted screen, so I have to connect it to my monitor, making it entirely non-portable. Luckily, Steve Holden gave me a switch and cables for sharing a monitor at PyCon, ...

Continue reading

Sleep refuses to come (A little ctypes-ing to calm the mind...)


Since I couldn't sleep, decided to build a wrapper to create an OpenGL context for testing the new ctypes-based code. Simple enough with PyGame, just import, init and set the mode and we're off to the races. Found a few small bugs when the code started running, and enhanced the error reporting a little, but ...

Continue reading

These productive days are killing me (It's not the productivity, it's the length)


So, for the second day, I work 9+ straight hours w/out a break other than to grab more coffee and cookies. Sitting here at the end of that, with my hands chutneyed, and my eyes blurring from fatigue I suddenly think "why?"

It's nice that the test suite is running again. It's nice that the ...

Continue reading