Today I was playing around with Avahi for inclusion in glChess. The documentation is a little thin but luckily there are some helpful people in #avahi. So in glChess subversion _glchess._udp (still don't quite get the Zeroconf naming) services show up in the (new) join game dialog. I've got the transport layer working for the network so it should all come together some time soonish.
But I can't post without a bit of a gripe... It seems a lot of APIs have ultra generic function/method calls which means when you pass in an incorrect parameter you get some useless error message. Developers *please* explicitly check the passed variable signature is correct and generate a meaningful error message if it does not.
Oh and once the networking is done I need a serious refactoring session.
Monday, July 31, 2006
Friday, July 28, 2006
Broken base tools that need fixing
Here is a note to myself for base Linux tools that require fixing:
- ifconfig - interfaces are configured by kernel name not MAC address. You should be able to do either as Linux randomly assigns interface names (at least to ethernet devices). On my work PC I have three network interfaces. I think the issue is the USB one gets detected at different times on boot
- Fix 'ps' - As stated earlier it does not print entire process names even when it has loads of screen real-estate. I think the whole process could be rewritten and work much better.
- etc etc (post comments of more)
Thursday, July 27, 2006
The crapness of old software
Last weekend I was bitching to Robert about how 'ps' was crap - it only displays 15 characters of the process name no matter how wide the console is.
e.g.
Sure the Gnome Power Man is a great process but other examples don't work so well. ;) So together we checked out the source (
Holy crap it is an obscure mess. I have previously found a bug in mount and it was a mission to track it down - that code is appalling too. Why is this old "base" code so crap?
Eventually I found out how the columns were generated in 'ps' and found the column is hard-coded to be of length 15. You could change it to be bigger but the columns can be ordered in any way so if you wanted a complex output it would be too wide. It looked like the column was supposed to expand if it the last one but I couldn't get the damn thing to work. The data is copied so many times through global variables it is too much of a mission.
So I gave up still not sure where the actual printf is...
e.g.
bob@alchemy2:~$ ps -A
PID TTY TIME CMD
1 ? 00:00:01 init
...
4995 ? 00:00:00 gnome-power-man
Sure the Gnome Power Man is a great process but other examples don't work so well. ;) So together we checked out the source (
apt-get source procps) and had a crack at it.Holy crap it is an obscure mess. I have previously found a bug in mount and it was a mission to track it down - that code is appalling too. Why is this old "base" code so crap?
Eventually I found out how the columns were generated in 'ps' and found the column is hard-coded to be of length 15. You could change it to be bigger but the columns can be ordered in any way so if you wanted a complex output it would be too wide. It looked like the column was supposed to expand if it the last one but I couldn't get the damn thing to work. The data is copied so many times through global variables it is too much of a mission.
So I gave up still not sure where the actual printf is...
Tuesday, July 25, 2006
The Python Challenge
Mr Hunter introduced me to the Python Challenge. It's a cool puzzle that presents you with lots of computationally complex situations (which you can solve suprisingly quickly using Python). I think we got to about 15 before I thought I should catch a train home.
I enjoyed annoying him by doing it all from the command line (no smelly files/IDE for me :P)
I enjoyed annoying him by doing it all from the command line (no smelly files/IDE for me :P)
Friday, July 21, 2006
Ubuntu 6.06 versus 128MB RAM
Yeah when they say that Ubuntu 6.06 recommends 256MB+ of RAM to install they are not joking. I was trying to install it on a Dell Optiplex GX110 and it ran like a dog. The intaller died on the partitioning step (looks like the /dev entry didn't appear). So I deleted the partition table and rebooted. This time since there was no handy swap partition it ran like a very sick dog.
Insert a 128MB DIMM and it works like a charm. I never checked the RAM when I started - it would be a nice feature to write in large letters somewhere at the start of the installer "YOU HAVE THIS CPU, RAM, FREE SPACE" etc. Oh and when did it get so hard to match RAM to a PC? It took many attempts to find a working DIMM (eventually canabalised from an old Optiplex GX110). I'm sure back in the 386 days any RAM would do :)
Insert a 128MB DIMM and it works like a charm. I never checked the RAM when I started - it would be a nice feature to write in large letters somewhere at the start of the installer "YOU HAVE THIS CPU, RAM, FREE SPACE" etc. Oh and when did it get so hard to match RAM to a PC? It took many attempts to find a working DIMM (eventually canabalised from an old Optiplex GX110). I'm sure back in the 386 days any RAM would do :)
Sunday, June 25, 2006
Trawling on happypenguin.org
I seem to go trawling on the Linux Game Tome every few months to see what is going on in the Open Source game world. Normally I have a slim chance of getting most of these games working but I found Balazar Brothers which being written in Python made it quite easy. I had to install the files to make it run so some custom .deb packages and now it works quite well. It's basically a jumping puzzle game but it with more polish would be quite fun. In the future it would be nice to have a small set of simple but good quality games that average users can install on their Open Source desktop.
The english translation was a bit confusing so I've sent an updated version to the developers. I'm also not sure what to do with the .deb packages - Perhaps I should find some server space where I can make my own .deb repository...
I noticed when Balazar starts up it says:
So I went and found Psyco - a JIT compiler for Python. I remember reading about this (or a similar) project a while ago but I didn't realise it was ready and working. An apt-get install later I guess it's running in the background! I think glChess was slightly faster but I'll have to investigate more in the future.
Oh Balazar Brothers is basically a mini-game spin-off of an RPG called Balazar. Haven't got that to work yet though as it tries to write back to /usr. Naughty!
The english translation was a bit confusing so I've sent an updated version to the developers. I'm also not sure what to do with the .deb packages - Perhaps I should find some server space where I can make my own .deb repository...
I noticed when Balazar starts up it says:
* Balazar * (Psyco not found ; if you are using an x86 processor, installing psyco can speed up Balazar a little)So I went and found Psyco - a JIT compiler for Python. I remember reading about this (or a similar) project a while ago but I didn't realise it was ready and working. An apt-get install later I guess it's running in the background! I think glChess was slightly faster but I'll have to investigate more in the future.
Oh Balazar Brothers is basically a mini-game spin-off of an RPG called Balazar. Haven't got that to work yet though as it tries to write back to /usr. Naughty!
Wednesday, June 14, 2006
Dear Lazyweb (re: Python packaging)
How are Python applications supposed to be packaged?
I was building a distutils setup.py for glChess. The distutils doc describes itself as:
However glChess is an application and not a library so does not need to make any of its code publically available. Should I make a site-packages/glchess package with all the glChess code? Then what about name spaces - I guess "glchess" is safe but other application names could collide with library packages/modules. Should I use "eggs" (can't find a lot of documentation on these). Note I have not found a Python application that installs its code with distutils (links anyone?).
Also as a side note is there simple way of including translation files in distutils? For glChess I have a directory of gettext translation files po/en.po, po/en_NZ.po etc which get built to po/en.mo, po/en_NZ.mo etc. These should then be installed into /usr/share/locale as en/LC_MESSAGES/glchess.mo and en_NZ/LC_MESSAGES/glchess.mo. Note that the .mo files have been renamed however distutils.core.setup() does not allow file renaming through the data_files argument.
I was building a distutils setup.py for glChess. The distutils doc describes itself as:
... (use) Distutils to make Python modules and extensions easily available to a wider audience ...
However glChess is an application and not a library so does not need to make any of its code publically available. Should I make a site-packages/glchess package with all the glChess code? Then what about name spaces - I guess "glchess" is safe but other application names could collide with library packages/modules. Should I use "eggs" (can't find a lot of documentation on these). Note I have not found a Python application that installs its code with distutils (links anyone?).
Also as a side note is there simple way of including translation files in distutils? For glChess I have a directory of gettext translation files po/en.po, po/en_NZ.po etc which get built to po/en.mo, po/en_NZ.mo etc. These should then be installed into /usr/share/locale as en/LC_MESSAGES/glchess.mo and en_NZ/LC_MESSAGES/glchess.mo. Note that the .mo files have been renamed however distutils.core.setup() does not allow file renaming through the data_files argument.
Saturday, June 10, 2006
Pouet Chess
Found another GPL chess program, Pouet Chess. Seems quite nice, very clean and simple to use (downloaded a binary and it worked fine). It's fullscreen (SDL). I don't know what chess people do but there really does seem to be a huge gap in the Linux/open source chess market. Does everyone just use XBoard? It's very functional but fairly bland looking... I guess pros use windows/web/Java clients?
Saturday, June 03, 2006
Dapper and Network Manager
Got network manager working in Ubuntu LTS 6.06 (Dapper Drake)...
1. Install with Applications->Add/Remove... Internet->Network Manager (or apt-get install network-manager-gnome).
2. Disable your network interfaces with System->Administration->Networking and for each device Properties->Enable this connection (uncheck). Otherwise Network Manager will not have any interfaces to use.
3. Add the applet with System->Preferences->Sessions Startup Programs->Add and type in nm-applet.
4. Log out and log in again to have it all working!
For full instructions see the Ubuntu wiki.
As a side note this install crashed logging out of gnome. First I got a white screen with a working pointer, not response to alt-ctrl-backspace. Going to terminal with alt-ctrl-F1 caused stripes to appear and then the whole OS locked up. Grr
1. Install with Applications->Add/Remove... Internet->Network Manager (or apt-get install network-manager-gnome).
2. Disable your network interfaces with System->Administration->Networking and for each device Properties->Enable this connection (uncheck). Otherwise Network Manager will not have any interfaces to use.
3. Add the applet with System->Preferences->Sessions Startup Programs->Add and type in nm-applet.
4. Log out and log in again to have it all working!
For full instructions see the Ubuntu wiki.
As a side note this install crashed logging out of gnome. First I got a white screen with a working pointer, not response to alt-ctrl-backspace. Going to terminal with alt-ctrl-F1 caused stripes to appear and then the whole OS locked up. Grr
It's all dappery
Was playing around with the Ubuntu update manager and it now has a button to upgrade to 6.06 (Dapper Drake). So with just a few clicks and 800M later and I'm here. Quite a smooth upgrade, just need to install a few extra packages when you're done. Gnome is noticably smoother and some nice new features (like editing the menus and deskbar - very nice).
Only thing to get working is network manager again. Seem to have lost some audio codec support with gstreamer 0.10, though you can get better support using libxine I'll stick with gstreamer for now.
From the reviews/screenshots I've been seeing of Vista I think Microsoft is not making good progress. The rate of innovation seems a lot higher in Linux/Gnome and the fast release cycles is leaving MS in the dust. Vista seems to have mostly things that are matching the competition (composite window manager, applets, tabbed browsing) and added far too many user options (endless pop ups, dialogs etc). They really should have had the balls to remove a lot of fluff from their UIs as I think they peaked in usability in Windows 2000 (I'm always trying to find options in Windows nowadays).
I guess Apple will have some new innovation around the corner but for now they have the top polished GUI. Sneaky Apple...
Only thing to get working is network manager again. Seem to have lost some audio codec support with gstreamer 0.10, though you can get better support using libxine I'll stick with gstreamer for now.
From the reviews/screenshots I've been seeing of Vista I think Microsoft is not making good progress. The rate of innovation seems a lot higher in Linux/Gnome and the fast release cycles is leaving MS in the dust. Vista seems to have mostly things that are matching the competition (composite window manager, applets, tabbed browsing) and added far too many user options (endless pop ups, dialogs etc). They really should have had the balls to remove a lot of fluff from their UIs as I think they peaked in usability in Windows 2000 (I'm always trying to find options in Windows nowadays).
I guess Apple will have some new innovation around the corner but for now they have the top polished GUI. Sneaky Apple...
Monday, May 15, 2006
Released glChess 0.9.3
Release glChess version 0.9.3 (screenshot looks much the same as the previous one).
Didn't get the multi-threading into it but the history bar works well and I added piece animation. This had been requested many times but now with the new code was quite easy to implement. I refactored the code quite a lot from 0.9.2 so hopefully it is more to the liking of others :).
Didn't get the multi-threading into it but the history bar works well and I added piece animation. This had been requested many times but now with the new code was quite easy to implement. I refactored the code quite a lot from 0.9.2 so hopefully it is more to the liking of others :).
Sunday, May 14, 2006
New, improved! Now with navigation bar!
Tuesday, May 09, 2006
Monday, May 08, 2006
Sick of Drupal
The glChess Drupal website seems to be slowly falling apart... I'm not sure if it's sf.net or the old version but I keep getting errors about not being able to log into MySQL and not being able to upload files. So I have been unable to add new content which has put a nail in the coffin for it.
So run and hide Mr Hunter as I am trying to find you and force you to whip me up a simple Rails/Zope site that I can extend.
As I side note I found that people were leaving comments on the site but were getting stuck in a moderation queue. After deleting the 75% spam there were some good comments left.
I particularly like this one:
This is some of the WORST written code I've seen. I can understand why you morons ceased working it! Sincerely, Will L G
It's always nice to receive feedback! :)
So run and hide Mr Hunter as I am trying to find you and force you to whip me up a simple Rails/Zope site that I can extend.
As I side note I found that people were leaving comments on the site but were getting stuck in a moderation queue. After deleting the 75% spam there were some good comments left.
I particularly like this one:
This is some of the WORST written code I've seen. I can understand why you morons ceased working it! Sincerely, Will L G
It's always nice to receive feedback! :)
Sunday, May 07, 2006
glChess 0.9.2 preview
Friday, May 05, 2006
glChess 0.9.1
A rushed release... Hopefully the more artistically inclined will provide some decent textures to replace what I've got.
Thursday, May 04, 2006
I swear OOo has got worse
I've been using OpenOffice 2.0 at work and found it to be quite frankly a piece of crap. I'm sure it used to be more reliable back at 1.x. As has been pointed out by others you don't get anywhere just trying to match MS Word. I just can't decide which one is worse at the moment - they seem to be about the same.
Why can a word processor have so much difficulty:
It really doesn't have to be super fancy, RISCOS managed to work it out many many years ago. Just blend that with a modern file format (Open Document) and you're sorted.
Hopefully AbiWord will replace OOo...
Why can a word processor have so much difficulty:
- Getting outline numbering working.
- Handle styles appropriately so you don't end up with sections as 'Default' and 'Body Text' without being able to tell.
- Make images anchor properly.
- Have a simple diagram drawing tool that is usable.
It really doesn't have to be super fancy, RISCOS managed to work it out many many years ago. Just blend that with a modern file format (Open Document) and you're sorted.
Hopefully AbiWord will replace OOo...
Wednesday, April 12, 2006
New Chess Pieces
Yay for open-source.
A Mr John-Paul Gignac has provided some new pieces to be used in glChess (and other such projects). So probably in version 0.9.3 there will be two sets available (with the high-res new versions as default).

Unfortunately I haven't had enough time to make a proper release. The SVN version has been tinkered with (re-enabled texturing - hopefully someone will provide better textures/colours HINT HINT). But it isn't clean enough for a release. I have no plans at the moment for easter so maybe some good work then...
A Mr John-Paul Gignac has provided some new pieces to be used in glChess (and other such projects). So probably in version 0.9.3 there will be two sets available (with the high-res new versions as default).

Unfortunately I haven't had enough time to make a proper release. The SVN version has been tinkered with (re-enabled texturing - hopefully someone will provide better textures/colours HINT HINT). But it isn't clean enough for a release. I have no plans at the moment for easter so maybe some good work then...
Wednesday, March 08, 2006
Fall back behaviour
I found an odd bug (?) when adding texturing support to glChess.
If you use a texture with dimensions of not 2^N the performance is complete crap. Now OpenGL requires textures with these dimensions but what I assume happens is if you don't provide them in that form it falls back to a software mode (maybe Mesa). Seems like good behaviour at a glance.
But it got me thinking - Is it always good to fall back like this? Yes it gives you maximum feature support (hopefully replacing the fall back functions with optimised ones) but it does make things confusing for the user/developer. I could not work out why things were so bad (and was trying all sorts of tricks to work out what it was) and it was only on a hunch that I found it. (I think I have found this issue perviously when developing).
What would have been nice is some sort of warning that this was occuring (not that I can think of a way to fit a warning like this into OpenGL).
If you use a texture with dimensions of not 2^N the performance is complete crap. Now OpenGL requires textures with these dimensions but what I assume happens is if you don't provide them in that form it falls back to a software mode (maybe Mesa). Seems like good behaviour at a glance.
But it got me thinking - Is it always good to fall back like this? Yes it gives you maximum feature support (hopefully replacing the fall back functions with optimised ones) but it does make things confusing for the user/developer. I could not work out why things were so bad (and was trying all sorts of tricks to work out what it was) and it was only on a hunch that I found it. (I think I have found this issue perviously when developing).
What would have been nice is some sort of warning that this was occuring (not that I can think of a way to fit a warning like this into OpenGL).
Subscribe to:
Comments (Atom)


