Category archives: Snaking
Discussions of programming, particularly of programming Python
Watch your Django field defaults do not load objects if you use South
Written by
on
in
Snaking.
Just ran into a South migration issue. Basically we had a field that looked like this (simplified):
class MyModel( models.Model ):
hostname = models.CharField(
default = random_unique_hostname,
)
where random_unique_hostname() was written like so (again, simplified):
def random_unique_hostname():
test = generate_random()
try:
MyModel.objects.get( hostname = test )
except MyModel.DoesNotExist, err:
return test
else:
return random_unique_hostname() ...
Fake French is Fun!
Written by
on
in
Snaking.
Ran FakeLion over our current project. It's actually pretty cool just as a design tool. The text is backward and in a weird "font", so you aren't distracted by what is says, you just see the site's layout with text-where-text-will-be. With this being the third time we've used it on the project, there really wasn't ...
Bad Coder, No Cookie
Written by
on
in
Snaking.
We use globalsub and MockProc extensively in our test-suite at work. Today I wanted to look up the name of the argument in MockProc (we use globalsub in almost every test case, so I don't need to look that up). So, look up the docs... wow, whoever wrote this library really sucks, there's just some ...
Minor changes to OpenGL.raw
Written by
on
in
Snaking.
I've just done a bit of hacking to make the (Py)OpenGL.raw hierarchy a little more "normal" looking when you read the auto-generated code. There are now functions declared, the functions are then annotated with decorators to make them into wrappers (which actually replaces the original functions). Doesn't really affect how the code works, it just ...
Modernising PyVRML97
Written by
on
in
Snaking.
Spent a few hours working on getting PyVRML97 (on which OpenGLContext is built) updated to use Cython instead of hand-coded C modules for the accelerators. The transformation-matrix stuff worked pretty well, but so far the frustum-culling code isn't happy. I'd like to get the rework done before releasing a new version of OpenGLContext (which really ...
Android 2.2 seems pretty 2.1-like...
Written by
on
in
Snaking.
Got one of the phones flashed up to 2.2 (an unsupported release for it), so in theory I'll be able to develop/test OpenGL ES 2.0 now. I spent far longer than I should have doing that (the whole day, basically, what with various mis-steps and spending hours trying to figure out what the best ROM ...
Android Dev Setup: What is step one, really?
Written by
on
in
Snaking.
Finally got a few minutes to poke a toe into the world of Android development. Started the installation of the Android SDK for Ubuntu (Oneiric). Eclipse won't start. Segfault just after telling it where the workspace should be. Apparently no one has ever changed the default working directory in the first dialog they ever see ...
SilleScope, a trivial OpenGL oscilloscope-like thingy for kids
Written by
on
in
Snaking.
More porting-to-python-3 notes...
Written by
on
in
Snaking.
D'Arcy asked if I could port basicproperty, basictypes, wxoo, etceteras to Python3. Not really high on the priority list, but why not dash it off; add 2to3, see happy Python3-ers. Will log any issues as they arise here...
Python3.2 testing virtualenv can't install anything (not even pip). Seems that the distribute and distutils code are ...
Evening Learning; I was hoping to get something done...
Written by
on
in
Snaking.
Documentation for how to setup the mapping isn't particularly helpful about best practice for ...