Tuesday, December 25, 2007

Duke Nuke is coming.

I've just seen the Duke Nuke Forever Trailer. Bwahaahahah!

Its still making me laugh. Bwahahaha. I remember many mispent evenings, days and weekends playing Duke3D over a null modem cable, and a home made setup with 2 modems and a 9 volt battery.

The last line at the end of the trailer... genius. My friend Iven disagrees, though I do understand his point of view.

Tuesday, December 18, 2007

Pylons Rocks.

I've built sites with Django, TurboGears and Pylons. I've come to prefer Pylons. Why?

Pylons gets out of the way, and stays out of the way. It lets me use SQLAlchemy, the best Python ORM available. It lets me do things the right way, and it always lets me do things my way. It doesn't hold my hand, and I don't want it to.

For example, from the Django documentation:
django.middleware.common.CommonMiddleware handles ETags based on the USE_ETAGS setting. If USE_ETAGS is set to True, Django will calculate an ETag for each request by MD5-hashing the page content, and it’ll take care of sending Not Modified responses, if appropriate.
This means that your django application most likely needs to talk to a database, process some code, parse and render a template before it can generate an etag. If you want to fix this behavior... best of luck to you.

With Pylons, I can do one lookup on the database and generate an etag, short circuiting the whole operation, shaving CPU time and RAM requirements. Sure, I had to write this code myself (2 lines including the db lookup) for each relevant controller method. However, my web service will scale much better because of it.

It is small details like this, and the tweakability of a Pylons installation that make it a much better framework for HTTP and REST nuts.

Now, I'm betting that most web developers out there don't really care about etags. If this is you, then perhaps django is the right tool for you. However, with a tad more effort and learning, Pylons will let you write better software.

CentOS, -1

I've been struggling to setup a web / db env in CentOS.

It sucks. Badly. Why rename apache to httpd? Why let PostgreSQL config files live in the data directory instead of /etc? Is there _any_ compelling reason to use this pile of junk instead of Debian or Ubuntu?


I guess I've been spoiled by the (comparatively) pure joy of configuring, maintaining and running my code on Debian based distributions.

Friday, December 14, 2007

Is hard real time Python possible?

I've been investigating the possibility of hard real time software development with Python. From some brief research, I've come up with the following:

* A Real Time OS is required.
* The .NET framework apparently cannot be used in hard real time software.
* Windows is not a RTOS, however there is a real time Linux kernel (Which I can install with Ubuntu!).

Assuming I do have an RTOS available, I might be able to use Python if:

* I turn off GC
* I don't create referential cycles
* I avoid using threads
* I use some best practices for real time software development.
* I read a good book on HRT software development.

I'm hoping that I can somehow get access (in Python) to high resolution timer and integrate that into my fibra framework so I can add some temporal based tests/constraints for individual tasklets.

Has anyone done this sort of thing with Python before? I'm looking for advice. I'm willing to consider other languages and platforms if they fit.

Wednesday, December 12, 2007

Do names belong in a URL?

Dear Lazyweb.

Imagine a nice RESTful interface for working with Tags. The URL:
will return a list of all the tags.

The URL:
will return a list of all the items that are associated with the tag "foo".

Or should it?

What happens when you may have tags in different languages? Is something like this:
possible or even desirable? (These characters were copied from a spam email, I have no idea what it says.)

Should the tag collection be accessed by id, rather than name? Eg:
This is uglier, but more usable across languages and character sets.

Hmmm. What do I do....?

Monday, December 10, 2007

Eventlet Looks Familiar

Linden labs (Second Life developers) are using a library named Eventlet to abstract non-blocking network IO behind co-routines.

I'm glad I've seen this, as Eventlet uses similar techniques to fibra, and validates my approach. In fact, this quote from the Eventlet wiki, applies equally to fibra:

Eventlet began life as Donovan Preston was talking to Bob Ippolito about coroutine-based non-blocking networking frameworks in Python. Most non-blocking frameworks require you to run the "main loop" in order to perform all network operations, but Donovan wondered if a library written using a trampolining style could get away with transparently running the main loop any time i/o was required, stopping the main loop once no more i/o was scheduled.

Saturday, December 08, 2007

What is the 2007 Independent Game of the Year?

Game Tunnel are running a poll to determine the Independent Game of the Year. Galcon consumed most of my available game time earlier this year, so it gets my vote.

If you enjoyed Galcon, go and vote for it! It would be great to see a Python game come out on top!

Wednesday, December 05, 2007

import antigravity

import antigravity t-shirts.

I need some new shirts for work, I thought I'd share these in case anyone else is thinking the same...

Popular Posts