Category archives: Snaking
Discussions of programming, particularly of programming Python
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:
We need a pydoc replacement (Modularity and extensibility being the things that are missing...)
Written by
on
in
Snaking.
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 ...!-->!-->
Enough with the long days already (This one's trying to turn into a run-away)
Written by
on
in
Snaking.
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 ...
I forgot how pretty Cinemon can be (Windows laptop and a data transfer switch makes it so obvious!)
Written by
on
in
Snaking.
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, ...
Sleep refuses to come (A little ctypes-ing to calm the mind...)
Written by
on
in
Snaking.
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 ...
These productive days are killing me (It's not the productivity, it's the length)
Written by
on
in
Snaking.
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 ...!-->!-->