Posts

Showing posts from February, 2006

sqlobject transactions

When trying to figure out how to use transactions in sqlobject, I found this code snippet. As a bonus my init database code now runs twice as fast. Yah! def do_in_transaction(func, *args, **kw): old_conn = sqlhub.getConnection() conn = old_conn.transaction() sqlhub.threadConnection = conn try: try: value = func(*args, **kw) except: conn.rollback() raise else: conn.commit() return value finally: sqlhub.threadConnection = old_conn # do_in_transaction(some_function_with_sqlobject_stuff_in_it) # I needed to change my connection line to this. That is assign something # to the processConnection thing in sqlhub. # sqlhub.processConnection = db_connection = __connection__ = connectionForURI(config.conn)

Pyweek registrations are open.

It looks like pyweek registrations are open. Pyweek is a realy fun game development competition inspired by the ludumdare 48 hour competitions. Except this competition uses python, it goes for a week, and there can be teams or solo entrants! 0 minutes before the competition begins a theme is announced, and you need to make a game from scratch based on that theme. The idea is to have a lot of fun finishing a game in a week. You don't work for the whole week on the game, just spend a couple of hours a day, and perhaps more on the weekend. So for some people this is better than spending a whole weekend. For anyone interested in making games there is nothing more fun and educational than these competitions. Lots of the fun is all of the energy and excitement you get from looking at other peoples work, and chatting away on irc. Everyone is making a game all at the same time, it's a lot of fun. It is the game making equivalent of a jamming with people in a band. Except you are ...

A new version of Pretendpaper

After a couple of months of part time playing with the pretend paper code base I have put up a new version of this arts community site I work on for a hobby. The most visible change is the modified css design. Which gets rid of black lines, and makes it look more minimal. These changes were done by Dane with help from Aaron. A lot of the changes are not visible, as I rewrote things so that searching and editing are more doable. To make searching and editing how I wanted them to be I needed to be able to have multiple event listing tabs on screen at once. Which meant that I needed to change around the way it used ids to encode a tab id into each of the ids. Also the code for creating new tabs stopped using function callbacks so much, and instead used objects. By using objects I am more easily able to change, and query their behaviour. I cleaned up the javascript code a little, but it still needs a lot of work. However a lot of it is still prototype code, so I'm not finished ...

Solarwolf game port for GP2X, and less sneaker net.

Yesterday I got some help from theoddbot on the latest changes on the gp2x scene. There is now a serial over usb driver. So I can log into my gp2x and get a bash prompt through minicom. Yah! much rejoicing. However the driver is buggy, and file transfers don't work. So it's still anoying to do some things. My old development method, pre serial over usb. ' close down gp2x, then go over to win box, take out card, put card in reader, copy file over from linux to sd, then take out card, then put card in gp2x, then boot, then select program'. Now I can make a bunch of changes, unmount the SD card through my bash prompt. Sneaker net them onto my windows box with the SD card reader. Then I can run the program, debug it, and make small changes with vi. I can also run code on the python interpreter. Yah! If the program crashes, or gets stuck somewhere, then I can kill it from the bash prompt. However ctrl+c doesn't seem to work, so I need to run the program in the ...