Phil Hassey - game dev blog
Phil Hassey as Wolverine
"What kind of
arrogant jerk
has a website like this?"

pygame.org updated

November 1st, 2007

I just spent the last few hours working on an update to pygame.org . The most exciting feature is the tagging which I’ve added. Now you can look up all pyweek entries by going to www.pygame.org/tags/pyweek for example (at least, once people start filling in their tags!)

I haven’t had lots of time lately to work on the pygame site, but I’m glad I was able to round up a few hours today, I think this is a nice feature and I hope it encourages people who use other python game frameworks to post their games there as well, now that they can tag their games as “soya” or “pyopengl”.

ain’t broken don’t fix it

October 31st, 2007

One line PHP templating engine:

echo str_replace(array_keys($replace),
array_values($replace),$content);

Daylight whatever time

October 28th, 2007

So last night, ’bout 11, my wife Nan says, “Oh, shoot! Tonight is daylight savings time… better set the clock ahead an hour.” So I set the clock to 12 and we went to bed.

… 5:30am comes along, I wake from my slumber to hear, “Phil! I just remembered, ‘Spring forward, Fall back’! That means, it’s really 3:30 now.” So I changed my clock back to 3:30am and settle myself back to sleep.

Eventaully, I woke up around 8:00 and rounded up some cookies and milk for breakfast and sat down to read the latest rot on the internet. I notice the clock indicates that it is 9:00. A bit of checking the news reveals to me that daylight savings time is not until next week.

My thumb is now officially worn out from all that clock button pressing. On a more technical note, I guess I should have known this, since I spent a bit of time earlier manually patching several older linux servers with the latest timezone changes so that when this day came they would plod along as usual.

“The next version should be more AJAXie.”

October 24th, 2007

My business partner and I were recently discussing the next edition of our healthcare web platform. Instinctively, Akash said that, “The next version should be more AJAXie.” I replied with a, “Sure we can do that… what exactly do you mean?”

We jumped into LiveMeeting where Akash showed me the web based CRM software he was using.

“See how when I mouse over these items, a menu pops up,” said Akash, “Can we do that?”

“Sure,” I said, “though that isn’t AJAX.”

“Ah. Well, see how this form has a tabbed interface. Is that AJAX?”

“Nope,” I said, “but we can do that too.”

“Well,” said Akash, “how about this, when someone requests a report and it displays a ‘Please Wait’ note on the screen while the report is being generated. Is that AJAX?”

“Maybe,” I said, “though again you could do that without AJAX as well.”

“Ahh,” said Akash.

I first used AJAX-like techniques in 1998 in a web based version of Galcon. Since then I haven’t. Haven’t had the need for it. And as this conversation realizes, even the term AJAX is unclear to fairly technical people – it has become a synonym for “nifty”.

Great commercial libraries for web development

October 17th, 2007

Although I’m generally an Open Source enthusiast, sometimes you just need something better …

Prince XML – if you need to create lots of PDFs, you probably need this. It converts HTML to PDFs really fast and accurately. They’ve even used it to publish a book. There is an open source alternatives which may suite you: tufat html2pdf – but it isn’t as powerful, is really slow, and takes up a lot of memory. Good for small scale projects. I’ve actually used it quite a bit, but eventually the requirements of my projects grew beyond what could be done with it. (I talked with the devs about sponsoring the changes I needed, but they felt it would be impossible meet my requirements and recommended that I get Prince XML instead.) Prince XML comes as a command line binary, so it’s easy to integrate it with any language. “prince in.html out.pdf” is all it takes.

Chart Director – makes building graphical charts for your website both fun and beautiful. I haven’t really come across any open source alternatives that I cared for. The API is quite nice and includes just about everything I need. It comes with bindings for all common languages.

Brawndo the Thirst Mutilator

October 11th, 2007

Coming 12/15/07!!

http://www.brawndo.com/ – official website
http://www.youtube.com/watch?v=Tbxq0IDqD04 – youtube video / commercial

out of control!!!!

October 9th, 2007

Maybe it’s overkill… But I just wrote a class named “test_testtest” to test the “testtest” function which I will be using to test test generators that are for testing stuff.

TDD part 2

October 3rd, 2007

I’ve been using it for the past week to great success. I’ve found my test suite frequently finds tiny bugs that I add in by accident when adding in new features. It’s great having those bugs found and fixed immediately 🙂

I’m using TDD right now for building a PHP library which will be the core of a new medical records system. In the future it will be interesting to try it with a game. I don’t believe it would be useful for all aspects of game development, but if I rewrote the Galcon “core” or the Galcon network library, I think TDD would be quite useful in that case.

test driven development

September 25th, 2007

I’ve taken my first plunge into TDD today. Yesterday I read (skimmed) the book Test Driven Development by Example by Kent Beck. In the second section of the book Kent gave a step by step example of how to develop the xUnit testing framework in python. At the end of the section he recommended implementing your own version of xUnit for whatever language you will be testing so you can learn the methodology.

I considered using some of the existing PHP testing frameworks – but they were all rather large (>100k) and both included a lot of features I couldn’t see myself using. So I forged ahead with Kent’s advice and wrote my own testing framework, which I named “Testing”. The final results are:

testing.php – 2440 bytes – the Testing class
tests.php – 2508 bytes – the tests for testing the Testing class (say that 5x fast!)
run.php – 161 bytes – a couple lines of php to run the Testing tests

It was a challenging task, as I’ve not done TDD before, and I found it took me about 3-4 tries to actually “get it”. The first few times I just scrabbled at not knowing where to start. The 3rd time I ended up implementing the Testing class “the old fashioned way” – but then realized I was supposed to be using TDD – so I reimplemented it using TDD. The interesting bit is that by reimplementing it using TDD I was forced to make my testing framework testable – so I had to add in logging facilities early on in the process. I also uncovered several bugs while re-writing it.

All in all, it seems like TDD will be a useful tool in the project I’m working on – will keep you posted.

language design in 48 hours

September 19th, 2007

I’m a big fan of rapid development. I’m also a big fan of the programming languages that I use … but every now and then I come across a use case where my language of choice just isn’t cutting it. And what’s the only obvious solution? Design my own language in 48 hours!

I like the 48 hour restriction because that means I won’t waste more than one weekend of my life trying this. I honestly believe that the people in charge of the languages I use are doing a great job. It’s just that now and again I have the desire to try and make one myself. And if it turns out to be a waste of time, at least it was only 48 hours 🙂

I’ll likely be trying to make some language similar to python and lua – with a special focus on making it easy to integrate into C.