Thursday, 26 February 2009
More Google ...
Seems like I'm going Google crazy these days, but as part of my day job I've been looking at Google App Engine this week. It's certainly a very rapid development tool and I wouldn't hesitate to use it for personal projects ... but at the same time it feels a bit lashed together to me. It uses Python 2.5.2, so no complaints there, but why use Django 0.96.1 when Django 1.0 was released in September last year? Anyway, I'm just nit-picking to be honest - it's another great tool from Google and the benefits far outweigh the drawbacks.
Saturday, 21 February 2009
Google Code
I've written a fair amount of code now and I've been looking for somewhere to store it for a while. Up until now this has meant a combination of a friend's SVN repo, a couple of laptops and an external hard drive. However, I recently decided to take the plunge and try Google Code.
For some reason, I'd previously thought that Google Code was only used for Google App Engine. However, this turned out to be totally wrong (you can put pretty much anything on there as far as I can tell) and I now have a high availability SVN repo at my disposal. Once I'd created my top-level project I quickly added two sub-projects - one for the level editor (Java) and one for the game itself (Python).
First impressions are extremely good. Integration with Eclipse (via the Subversive plugin) was seamless and so far, the repo has been available every time I've used it. It's occasionally a little sluggish, but that's a small price to pay as far as I'm concerned.
For some reason, I'd previously thought that Google Code was only used for Google App Engine. However, this turned out to be totally wrong (you can put pretty much anything on there as far as I can tell) and I now have a high availability SVN repo at my disposal. Once I'd created my top-level project I quickly added two sub-projects - one for the level editor (Java) and one for the game itself (Python).
First impressions are extremely good. Integration with Eclipse (via the Subversive plugin) was seamless and so far, the repo has been available every time I've used it. It's occasionally a little sluggish, but that's a small price to pay as far as I'm concerned.
Monday, 2 February 2009
Lessons Learned
In contrast to my day-job as an Enterprise Java Developer, working on my level editor was generally pleasant experience. It was nice to do some proper OO on a self-contained project with no external dependencies for a change!
I didn't do any up-front design for it and developed each component in isolation, providing functional mocks for inter-component dependencies. Somewhat surprisingly, a domain model ended up simply 'falling out' of this approach as the code evolved - I guess that's what's supposed to happen with Agile methodologies.
That said, I'm not sure how well this would translate to a large project / team environment. This was a small project where I was able to mentally keep everything in the air at once, ie. whenever I changed something I had a very clear idea of how it would affect everything else. If I'd been working on a vertical slice of a much larger application, would this approach still work?
I didn't do any up-front design for it and developed each component in isolation, providing functional mocks for inter-component dependencies. Somewhat surprisingly, a domain model ended up simply 'falling out' of this approach as the code evolved - I guess that's what's supposed to happen with Agile methodologies.
That said, I'm not sure how well this would translate to a large project / team environment. This was a small project where I was able to mentally keep everything in the air at once, ie. whenever I changed something I had a very clear idea of how it would affect everything else. If I'd been working on a vertical slice of a much larger application, would this approach still work?
Level Editors
As we all know, every good game needs a level editor and mine is no exception. Here's what it looks like:

I knocked this up in Java / SWT in a few weeks and it already covers all the basic use cases. In fact, drawing the tiles was more time-consuming.
I was quite impressed by SWT. It's about a million times easier/quicker than Swing and I like the way it just looks like a native app. I did give the Eclipse Rich Client Platform a try to start with but that seemed to be one of the most impenetrably hard things I've ever looked at so I settled on SWT in the end. I also toyed with the idea of doing it in Python, but the sheer range of Windows Toolkits that are available for it put me off slightly.

I knocked this up in Java / SWT in a few weeks and it already covers all the basic use cases. In fact, drawing the tiles was more time-consuming.
I was quite impressed by SWT. It's about a million times easier/quicker than Swing and I like the way it just looks like a native app. I did give the Eclipse Rich Client Platform a try to start with but that seemed to be one of the most impenetrably hard things I've ever looked at so I settled on SWT in the end. I also toyed with the idea of doing it in Python, but the sheer range of Windows Toolkits that are available for it put me off slightly.
Wednesday, 21 January 2009
Python Gotcha
Spent ages last night trying to track down a bug in Python. I wanted to do something you don’t often need to do in Python – initialise a two-dimensional list – which I did like this ...
>>> a = [[None] * 4] * 2
>>> a
[[None, None, None, None], [None, None, None, None]]Turns out I should have used a list comprehension to do it ...>>> a = [[None] * 4 for i in range(2)]
>>> a
[[None, None, None, None], [None, None, None, None]]They both look the same, but they are not! It’s fairly obvious when you think about it, but trying to track this down in a reasonably complex piece of code wasn’t easy ...
Saturday, 20 September 2008
SQL Developer
At last, I am in my new house, I have working broadband, and (thanks to my recently purchased network cable) I can use Ubuntu again.
I was having an issue with SQL Developer a while back where the application launches but just displays an empty frame. Having tried various different versions of Java, SQL Developer and combinations of the two, I was still none the wiser ... but tonight I finally cracked it! Turns out all I needed to do was turn Visual Effects (System - Preferences - Appearance) off.
I was having an issue with SQL Developer a while back where the application launches but just displays an empty frame. Having tried various different versions of Java, SQL Developer and combinations of the two, I was still none the wiser ... but tonight I finally cracked it! Turns out all I needed to do was turn Visual Effects (System - Preferences - Appearance) off.
Monday, 16 June 2008
Ubuntu + Juniper
I've now successfully set up my development environment on Ubuntu so I can work from home without needing my work laptop. I had a few issues with installing Juniper, but these have now been resolved ...
First issue: Firefox wouldn't install the Java Plugin. Solution: apt-get the plugin and then put a symlink in the Firefox plugins folder ...
> sudo apt-get install sun-java5-plugin sun-java5-fonts
> sudo ln -s /usr/lib/jvm/java-1.5.0-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/firefox/plugins
Second issue: the juniper install needs to run as root and will prompt you for the root password. Solution: set a root password ...
> sudo -i
> passwd
To lock the root account again after you've finished ...
> sudo passwd -l root
And should you need to unlock (ie. set the password back to what it was before) ...
> sudo passwd -u root
Third issue: the juniper scripts don't work properly so it attempts to install them every time (note that this doesn't seem to prevent you from logging in!) Solution: You need to overwrite the default scripts with some provided in this rather excellent post on Ubuntu Forums.
Fourth issue: the lastest Subversive plugin for Eclipse doesn't seem to work on Ubuntu. Solution: use the old one:
> http://www.polarion.org/projects/subversive/download/1.1/update-site/
Fifth issue: Eclipse crashing randomly when it attempts to synchronise with SVN. Solution: this was either because I was running Eclipse under Java6 or because I had Java5 and Java6 both installed - it went away when I rolled back to Java5 only.
That should do it!
First issue: Firefox wouldn't install the Java Plugin. Solution: apt-get the plugin and then put a symlink in the Firefox plugins folder ...
> sudo apt-get install sun-java5-plugin sun-java5-fonts
> sudo ln -s /usr/lib/jvm/java-1.5.0-sun/jre
Second issue: the juniper install needs to run as root and will prompt you for the root password. Solution: set a root password ...
> sudo -i
> passwd
To lock the root account again after you've finished ...
> sudo passwd -l root
And should you need to unlock (ie. set the password back to what it was before) ...
> sudo passwd -u root
Third issue: the juniper scripts don't work properly so it attempts to install them every time (note that this doesn't seem to prevent you from logging in!) Solution: You need to overwrite the default scripts with some provided in this rather excellent post on Ubuntu Forums.
Fourth issue: the lastest Subversive plugin for Eclipse doesn't seem to work on Ubuntu. Solution: use the old one:
> http://www.polarion.org/projects/subversive/download/1.1/update-site/
Fifth issue: Eclipse crashing randomly when it attempts to synchronise with SVN. Solution: this was either because I was running Eclipse under Java6 or because I had Java5 and Java6 both installed - it went away when I rolled back to Java5 only.
That should do it!
Subscribe to:
Posts (Atom)
