Category archives: Snaking

Discussions of programming, particularly of programming Python

RSS feed of Snaking

Square-maps in wxPython for RunSnakeRun

Just built a little square map implementation in wxPython.  Eventually will be integrating it into RunSnakeRun to let you see a graphical breakdown of the hotspots in your profile (as you do in KCacheGrind, but this should run easily on any of the major platforms because of wxPython).  I think I'll want to tweak the ...

Continue reading

Javascript's default-global... repressed memories

I used to do ridiculous amounts of Javascript for Holodesk, so I *should* have immediately twigged to this, but it's been 8 years and I've managed to block this particular silliness out.  Say you have a reusable (Dojo) widget where you need to access "this" in a callback.  The callback function will have "this" bound ...

Continue reading

Abstractions and Drowning in Them

Have been spending a lot of quality time with Dojo this weekend, and it's making me think about abstractions again.  The pattern seems to repeat itself again and again; you dive into a deep pool of someone else's abstractions, you spend days working out all the little undocumented assumptions and missing pieces, eventually you get ...

Continue reading

Two Talks at PyCon

Looks like two of my talk proposals for PyCon have been accepted.  One is an intermediate/advanced talk porting your code to OpenGL 3.x, the other an introductory presentation on Profiling/optimization.  Should be fun :) .

Symmetric networking is cool

Back when I was doing the next-generation (now many generations old) Multi-User Technology (MUTech) for Holodesk I thought it was really cool that there was no "server", it was all just peers where any given object could be hosted on any machine, and the system would let you set up (potentially one-way) proxies on any ...

Continue reading

Programming Mantras (Rough Notes)

Here are my rough notes from PyGTA's programming mantra's discussion this evening:

In the face of ambiguity, refuse the temptation to guess.
   Have a vision before you start coding.
   Know your task.
   Know your client.
   Ignore the impossibility behind the curtain.
Your clients don't know what they want.
   Charge by the hour.
   Play around with ...

Continue reading

Upload files to a TurboGears web application...

Ran into this problem on Friday at a client site and just couldn't find a Python library that did everything I needed wrt providing login to TurboGears and properly uploading a file to a controller in the TurboGears application.  Bothered me that there was no easy way to do this (seems like it should be ...

Continue reading

Weird little glitch in wrapper code

Was looking into mitigating some of the slowdown from the recent fix, mainly be rewriting this little function:

@classmethod
def from_param( cls, instance, typeCode=None ):
try:
pointer = cls.dataPointer( instance )
except TypeError, err:
array = cls.asArray( instance, typeCode )
pp = ctypes.c_void_p( cls.dataPointer( array ) )
pp._temporary_array_ = (array,)
return pp
else:
return ctypes.c_void_p( ...

Continue reading

Getting very accustomed to bzr

Having to work with svn again at a client site... I miss bzr.  Even bzr-rebase is turning up fondly in my memories.  It's really just the merging... merging with svn seems to always be an "Oh good Lord! We have to MERGE!" event, filled with conflicts and crashes halfway through switching that leave 1/2 of ...

Continue reading

Regression on Lists/Tuples

Just discovered an annoying regression in the converters for lists/tuples, namely they will core when you have the accelerator module installed.  They don't core without the accelerator, but that seems to just be dumb luck.  Basically when you pass in a list-of-whatevers to PyOpenGL we have to convert it to something C-friendly, so we want ...

Continue reading