Tuesday, 15 May 2007

Service Pack Maker

I seem to be improving my programming skills quite quickly now. I started to make a Java version of the "service pack" creator idea I had a while ago (see my comment on this Ubuntu Wiki page https://wiki.ubuntu.com/OfflineUpdateSpec) and it is coming on quite well. I have given it an Ubuntu spec page here: https://wiki.ubuntu.com/TransparentServicePackMaker if you are interested.

Currently there is a nice simple GUI (although the "Advanced" button should really be a tab, but it isn't implemented yet anyway), the text entered into the Name box is turned into lowercase and spaces are replaced with hyphens (so entering "Graphics Applications 1" will turn into "graphics-applications-1"), the value for the tick box about including the system's non-default packages is read, and the "include" field is parsed.

What I am quite proud of is teaching myself file input and output, so that the contents of /var/lib/apt/lists (the lists of packages available from your repositories) are read when the application starts up and dumped into a temporary file called /tmp/service-pack-temp-XXXX (where XXXX is a random number to make the file unique). Upon clicking "Create" the given "include" line is parsed as a space-separated list of packages. If any of the package names given are not found in the available repositories then a message comes up warning the user of this. If all of the packages are found then the list is given to the service pack for inclusion, where all of the duplicates are removed. This means that putting "gimp gimp gimp inkscape gimp inkscape Warbo" will give a message saying that Warbo cannot be found. removing Warbo from the line will include "gimp" and "inkscape" in the pack once, which I think is quite nice.

The tool doesn't yet output anything, which I am working on, but it looks like a working tool is near. When it is done I will probably ask in the forums for someone to redo it in Python and GTK.

Nuclear Bovines

There is a game I have on Amiga called "Atoms". It is a simple little game, based around a board, where each player takes turns to add atoms to the squares on the board until they explode and claim other squares for that player. I tried to make this game in Python before I came to University, to at least have attempted some coding before I started any computer science course modules, and whilst I managed to make the game itself pretty much work in about a day (quite good for zero Python knowledge and a PDF of DiveIntoPython) I spent weeks fruitlessly trying to get a GUI around it before giving up.

Now that I can code in an object oriented way in Java I thought I'd try again. Starting with the GUI builder AbeilleForms I made a quick starting place for the interface, then after about an hour I had come up with what I have dubbed Gnucleon 0.1 (because the name Gnucleus is already taken by a Gnutella client, and Googling for Gnucleon doesn't bring up any software, so I took it).

I have stored it on my free webspace here: http://www.freewebs.com/chriswarbo/Temporary/Gnucleon.tar.bz2 if you want to have a play with it. Unless you change the "players" variable in the source file and add some more switch cases for changing the square colour then it is 2 player only. Also the grid size can't be changed without editing the source. Yes, it sucks but it didn't take long to make. I'll work on it in the future.

Wednesday, 9 May 2007

Various updates

The Free Software Society had a rather anticlimactic meeting. Next on the agenda? Live CDs of useful, but not generally well known, Free Software, tailored for specific subject areas. Hopefully these will get some circulation throughout the University, who knows?

Today I finished a robot-controlling program for my Computer Architectures course, although it was pretty dodgy :) , so the only computer-related work I have now is the pinball machine simulator. I have moved it from AWT to Swing (a slightly better drawing system) so it now goes a bit quicker and doesn't flicker as much between frame updates.

The whole thing has been overhauled from a basic, hacked together demo into a flexible framework for... Bouncing balls around so far. I just got some basic collision detection working, which means the next thing to do should be linking the building blocks it uses together. Then the fun really starts :) (I will release this after I am assessed on it in a couple of weeks, and I have it working nicely enough to show off).

I have been working hard on a basic Java version of my Service Pack installer mentioned before, and am now in the process of uploading it to somewhere for some community help. Remember that it is a basic implementation which doesn't actually work properly yet, but that is why I want others to improve upon it (and to rewrite it in something like Python rather than Java). This post will probably get an update about that later on (maybe tomorrow, as it is 11:40 now :) ).