Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

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, 28 March 2007

Woah, a long time since I posted! I thought I'd say what I've been up to and have in the works:

* It is currently the Easter break, so I am at home in busy-busy Sandbach



* I am going a bit crazy brainstorming ideas that the FSS can act on (we will hold a meeting soon after getting back to Sheffield)



* The latest assignment from my COM162 Java course is to simulate a pinball machine.... Well, I am currently going a little crazy with my Physics knowledge to create an elaborate, general purpose physics engine which I can then shove values in to make a pinball table (I actually hope to let it read some kind of XML syntax in the future, and thus define tables (or whatever else it is used for) easily). Since it is an assignment which is testing my ability to understand object oriented programming I must do this myself, but after its use in my course is over rest assured I will make it publicly available as Free Software



Oh, and it may be a little late, but go on: