Friday, October 29, 2010
How I Learned to Stop Worrying and Love the Vala
After a while of thinking about it I realised that GNOME already was in this position. GObject+C already is a domain specific language. New developers already have to learn GObject and finding developers who both are proficient and willing to use C can be a struggle.
Recently I have been working on more and more with Vala and porting applications from PyGTK/C to it. Before Vala, PyGTK had a lot of advantaged over C; now the main differences are easy debugging and fast development (Python) vs fast performance and type checking for easier maintenance (Vala).
So, my recommendation is if you have a desktop application that uses GObject APIs* and you are happy with debugging tools like gdb and valgrind then consider using Vala!
* I was working on porting LightDM to Vala but old system APIs were causing difficulty. If you have this case consider wrapping them in C+Gobject first and then interfacing to that.
LightDM UDS Session
- The Ubuntu desktop login experience
- Display managers
- The LightDM project
Then come along to my session at UDS. It's at 5:10pm EDT and you can join remotely by connecting with IRC to
irc.ubuntu.com #ubuntu-uds-bonaire2 and listening in to the audio stream.Everyone is welcome and I'm particularly interested in gathering requirements for derivative distributions.
Wednesday, July 28, 2010
GUADEC 2010
Monday, July 05, 2010
LightDM
Features?
- Fully themeable (easiest with the webkit interface)
- Cross-desktop (greeters can be written in any toolkit)
- Low-complexity codebase
- Standards compliant (PAM, ConsoleKit, etc)
Tell me about themeing...
This is the part I'm most excited about...You can try the webkit interface online today. My HTML/CSS/Javascript skills are not great so please take that page, copy the lightdm.js include line (simulates the lightdm interface) and write an awesome interface! Please leave a comment here if you make a cool one. Idea - make a greeter that integrates with Facebook.
Got bigger plans? Read the libldmgreeter reference. Idea - make an OpenGL interface that uses Mii avatars.
libldmgreeter not in the right language for you? It supports GObject introspection so you should be able to write a greeter in any introspetion enabled languange (e.g. Python). And the interface to lightdm is D-Bus so you can go more direct if you want.
Wait, what is a display manager again?
The display manager handles the running of the X server (graphical display) on your system. It also provides the login screen (greeter) to authenticate users.Who is developing this?
This is a personal project developed in my own time. Patches, feedback and help welcome.What about the other display managers?
LightDM aims to support all use cases of the current display managers, from embedded to desktop systems. LightDM is still in early development and not suitable for use in production systems.Where can I get it?
Source is in Launchpad (bzr clone lp:lightdm) and tarball releases.If you are using Ubuntu (Lucid or Maverick) you can install it from a PPA:
$ sudo add-apt-repository ppa:robert-ancell/lightdm
$ sudo apt-get update
$ sudo apt-get install lightdm lightdm-theme-webkit lightdm-theme-gnomeYou can test lightdm by running it in a window:
$ sudo apt-get install xserver-xephyr
Create the file lightdm.conf:
[Greeter]
theme=webkit
$ lightdm --test-mode -c lightdm.conf11/11/2010 - Updated test instructions
Tuesday, June 22, 2010
MMS internet radio in Rhythmbox
e.g. mms://wms-trn-all.streaming.net.nz/trn-newstalk-zb-akl -> rtsp://wms-trn-all.streaming.net.nz/trn-newstalk-zb-akl
This is correctly handled by GStreamer but Rhythmbox currently does not handle this. Other applications like Totem and Amarok work fine.
Thursday, June 10, 2010
PyGI in Maverick
$ apt-get install python-gi gir1.0-gtk-2.0and then write applications like this:
from gi.repository import Gtk
def destroy_cb(widget):
Gtk.main_quit()
w = Gtk.Window()
w.connect('destroy', destroy_cb)
l = Gtk.Label()
l.set_text("Hello World!")
w.add(l)
w.show_all()
Gtk.main()Have fun!
EDIT: Updated to note you need to install the GI package for the module you are using.
Tuesday, May 18, 2010
GObject introspection in Ubuntu
You can read more about this in a blog post from Tomeu Vizoso who came to the session and is an upstream developer for Telepathy, GNOME and Sugar and helped inform us about GObject introspection and PyGI status.
Tuesday, May 11, 2010
GNOME Games Help
The games are a good project to start with because their help is relatively simple.
I've opened bugs against Sudoku, Mines, Mahjongg and Quadrapassel (Tetris), leave a comment if you start working on it.
To get started look at the existing documentation either by running the games or browsing the help in git. Learn about Mallard by doing the ten minute tour.
Sunday, May 09, 2010
GCalctool 5.31.1
Introducing basic mode:

The most noticable change is the use of colour thanks to a tip from Chris Lord.
I've also added memory operations and squares and square roots. I'm not sure if this is too much (or too little) for "Basic" - feedback welcome.
Advanced mode shows a lot more functions. Also of note is the ability to see angles in degrees at any time:

Programming and financial have similar changes but need more work. Number bases are easier to work with than in 5.30.
The internal changes that you can't see in a screenshot:
- It now starts fast. Really fast.
- It's a well behaved GTK+ application. This means that keyboard input and accessibility should work without any problems.
- The code is modular. The calculator widget could be split out and used in other applications.
Please try it out! If you are using Ubuntu Lucid you can try it using the GCalctool PPA.
There are a number of design issues that I don't yet have good solutions for, ideas and mockups welcome:
- I'm not sure of a good label for the memory buttons, the current labels don't feel right.
- There's not a good way to delete variables/add new ones. I've been trying to integrate this into the popup menus (GTK+ is getting in my way).
- The colours are done using primary colours and blending them with the GTK+ theme. I tried using Tango colours but they looked worse to me.
- While removing the spacing between the buttons has reduced the optical illusion of the grid it still remains to some degree. I'm not sure if I can get around this without making custom widget (I'd like there to be no space between groups of buttons). Note the buttons do not have to be in a grid so please do a mockup if you have a good idea.
- The programming bit editor is too big.
Monday, April 19, 2010
Simple Scan 1.0

I've prosed simple-scan for GNOME 3.0 and will be following the GNOME release schedule from now on (next release will be 2.31.1).
*Make that 1.0.2. There's always a few last minute fixes :)
Saturday, April 03, 2010
GCalctool 5.28 in Ubuntu 10.04 LTS
$ sudo add-apt-repository ppa:robert-ancell/gcalctool-528
$ sudo apt-get install gcalctool-528
(Provided so you can run the Karmic gcalctool in Lucid if the interface is more useful to you).
(UPDATE: We've decided to stick with GCalctool 5.28 for Lucid so this PPA is obsolete).
Friday, April 02, 2010
Embrace Change
If you don't want your software to change then don't upgrade.
If you want your software to improve then expect (and enjoy) change.
If a feature is present in a version X, then that feature may not exist in version X+1. This is not a regression - applications don't exist to provide features; they exist to serve the users that the application is targeted at.
Default applications are there to serve the greatest number of users. In both the proprietary and open-source worlds there is often a "basic" and an "advanced" application for a given task. This is a good thing - trying to please everyone isn't as good as focussing on one group.
If there is an application that better serves your need then use it. (If you are an advanced user then use an advanced application).
I'm personally most interested in writing applications for the beginner to intermediate user. I'll relate this to the applications that I develop:
- Simple Scan is not a replacement for xsane or gscan2pdf. But it is great if you have a picture you want to upload to Facebook.
- GCalctool does not have the features of Qalculate or wxMaxima. But it does solve common equations.
- glChess would not be used by a experienced chess player like xboard. But it is a good introduction to the game of Chess.
Monday, March 29, 2010
GCalctool 5.30
GCalctool 5.30 is now released. Gcalctool is the default GNOME calculator and this is also the default in Ubuntu.
Both GNOME and Ubuntu use a synchronised six month release cycle.
- The great thing about regular releases is... Predictability!
- The bad things is... You may not get all the features you wanted done in one cycle...
Here's my summary of what to expect in GCalctool 5.30.
The good:
- The display now acts like a standard text entry (no obscure shortcut keys)
- Equations look like correct mathematical syntax (π, |−4|, 6×10⁻², sin⁻¹ x, 2x²y, 3E₁₆)
- Polynomials can be solved (x²+2x−4, (x+1)(x−2))
- There is no limit on the number of variables (x=55, value=21)
- Bases can be mixed in the same calculation and any base between 2 and 16 can be used (120₃+3E₁₆)
- Units can be converted (3 feet in centimeters, 3.22 EUR in AUD)
- The help is now topic based (Mallard format)
- The UI has less visual clutter:

The bad:
- Hexadecimal numbers are harder to enter (you need to explicitly add the base 16 suffix (Ctrl+H) to them).
- Variables can't be removed (the workaround is to edit ~/.local/share/gcalctool/registers)
- There is no support for functions (you should be able to enter f(x)=6x+2, f(3))
- There is no GUI for non-currency conversions (use the keyboard)
- Complex numbers weren't working in time for release:

The ugly:
Saturday, March 06, 2010
Simple Scan 0.9.6 (1.0 Release Candidate)
There are two things I'd like to fix before 1.0:
- There may be some issues with scanning from an automatic document feeder (ADF). Please comment on bug 512553 if you are having problems. (I don't have an ADF to test).
- The generated PDF files do not JPEG compress the images. This is because the Cairo renderer does not support it. If you know of a C accessible library that can do this or even how to hard code this (the PDF files are just a single image per page) then please comment on bug 534122.
Tuesday, March 02, 2010
GCalctool manual available online
Friday, February 19, 2010
Jobs at Canonical
Mallard Documentation

GCalctool now has a new help document in Mallard format. This is my second Mallard document I've written, the first was the help for Simple Scan.
Wow. Mallard is really, really easy to use!
Mallard documents are topic based which basically means writing a few paragraphs on each activity your readers can do with your application (like how to use trigonometric functions or an automatic document feeder). I wrote the topics over a week with a text editor and marked them up at the end.
Testing is great. Just run yelp with the directory the files are in to browse the documents immediately.
If you want to contribute, take the ten minute tour, pick your favourite GNOME application, ask if they've got documentation that needs updating and get writing!
(I recommend starting by copying an existing document; I used the gbrainy help as a basis for the Simple Scan and GCalctool help).
Thursday, February 18, 2010
AdWords Experiment
So, if you got here via a Google ad. leave a comment!
Maybe I should have advertised a rickrolling site instead... :)
*Free if you include having to spend $20 to set up the account.
Monday, February 15, 2010
Saturday, February 13, 2010
Simple Scan 0.9.0

If you haven't tried it, it comes by default in Ubuntu 10.04 (Lucid), you can enable the PPA in Ubuntu 9.10 (Karmic) by going to System>Administration>Software Sources>Other Software>Add and adding ppa:robert-ancell/simple-scan then installing the simple-scan package.
Any other GNOME system should be able to build it from source.
From now to 1.0 I wont be adding any new features, just fixing bugs and polishing.
Post 1.0 the major features I'm most interested in are colour management, optical character recognition, integration with gscan/gnomescan, integration with photo management software and storing density information in saved files.
Please help if you can!
Thursday, February 04, 2010
Linux.conf.au 2010
Interesting Projects
Weta Digital (i.e. the New Zealand graphics company behind Lord of the Rings, Avatar)
Albany Senior High School is a New Zealand school who have successfully implemented an entirely open-source infrastructure running Ubuntu Desktop and Mandriva servers.
The Village Telco project showed off their Linux based VoIP mesh network solution for small villages.
There seemed to be a rocketry/Linux theme going on. The White Label Space project talked about their ambitious space program funded by advertising and the TeleMetrum project talked about using Linux and open hardware to make telemetry for amateur rocketry.
FOSS and Proprietary Software
Jeremy Allison from Samba talked about the elephant in the room (Microsoft) and how we shouldn't forget their threats against open-source, especially in the light of the recent Tom-Tom patent lawsuit. However he also said that the best thing to do was keep making better software as not doing that is the more likely reason for us to fail.
Benjamin Mako-Hill talked about Antifeatures - in where he described how proprietary software often comes with features you don't want (e.g. digital rights management) and how you often have to pay to remove these features (for example paying extra money to Sony to get a computer without crapware).
I sat in on some government and open-source talks and the short answer seemed to be "policy was good but not seeing major uptake".
Technology
Python 3.0 looks really well managed. There are a number of tools now available to transition from Python 2.0 to Python 3.0 and even tools to produce Python 2.0 compatible applications from a Python 3.0 codebase. The improvements by Google in Unladen Swallow are planned to be integrated into the official Python 3.0. There will be no syntax changes until Python 3.3 (a duration of two years) which will encourage Python 3.0 uptake.
The PyPy project talked about what they do. I thought they were a Python interpreter implemented in Python but in fact they are Python interpreter generator. That can generate different types of interpreters (e.g. stackless)... For different targets (e.g. C code, .NET, Java bytecode)... for different dynamic languages (e.g. Perl). So a really interesting technology. They see themselves as more of a research project at the current time.
In graphics the Cairo project talked about accelerating 2D on the GPU. The Clutter project mentioned their release cycle is now synchronised with GNOME/Moblin.
The pandora-build project talked about how they'd made autotools easier to use. A quick survey of the audience showed everyone uses autotools but no-one understands it. By using pandora-build you can write less autotool magic (pandora sets up sane defaults and provides simple macros for common things) and are have a more portable build system (pandora handles multiple versions of autotools).
Distributions
Lucas Nussbaum talked about the Debian QA team and tools (e.g. Ultimate Debian Database, debcheck, piuparts, lintian, DEHS, bapase, MIA team) they have produced to keep track of what is going on in Debian. He also talked about the relationship between Debian and Ubuntu which seems to be in reasonable state. There was some concern that Ubuntu did not provide many resources to help Debian and that Debian did not want to become Ubuntu's "package supermarket".
The vcs-pkg project showed their aims in making moving patches between distributions easier.
The Launchpad developers talked about how they are improving integration with external bug trackers and translations.
And finally; When the videos are available I highly recommend watching Glyn Moody's keynote talk. He talked about how open-source has influence other revolutions of sharing that have occurred in the last 30 years. He skilfully shows how FOSS is more than just about software.
Friday, January 15, 2010
gbrainy in Lucid

You can read more about the latest release in a blog post by Jordi Mas (the author).
gbrainy is a great game and we want to find any problems before final release so please try it out! If you don't already have it installed then you can get it from the Ubuntu Software Centre (search for gbrainy).
If you find a problem the best thing to do is file a bug in GNOME. If you don't have an account on GNOME Bugzilla but do have a Launchpad account you can file a bug against Ubuntu. I am working on getting the "Report a Problem" menu entry into the help menu which will make this even easier!
Have fun!
Monday, December 21, 2009
Translate Simple Scan
Your translations need to be reviewed by the Ubuntu Translators team, if you are a member please review any translations!
Here is the UI for 0.7.6 in Romanian:
Tuesday, December 15, 2009
The demise of the function key

I recently upgrade to a new Dell Studio 15 and retired my old Inspiron. One thing I've noticed is the function keys are now secondary - these keys are now multimedia/system functions by default and you need to use the blue Fn key to activate the old F1-12 behaviour. Other Dell and Apple laptops (at least) seem to be doing the same thing.
Is this the end of the function key? The Litl keyboard got rid of them entirely. The key combination to use them on my laptop is sufficiently difficult that they might as well not exist for me.
So this leads me to the conclusion:
- I can never rely on function key shortcuts in any software I write.
- The existing window management shortcuts (e.g. alt-F4 to close window) don't work anymore. Now I understand when people complain how applications don't consistently bind the same key to close window (Ctrl+Q or Ctrl+W or something else or nothing?).
- At the Lucid UDS we discussed Compiz keybindings - often these were bound to function keys. I notice the macbook uses the old F3 key for "show all windows". I hope some standard could emerge for these functions on PC keyboards.
I can't say I'm going to miss them overly.
Friday, December 11, 2009
Introducing Simple Scan

Please try it and report any problems you have.
To install add the PPA and install the simple-scan package or build from source.
The GUI is a mess
Yes. This is the first functional release. The GUI is being redesigned for 0.8. The 0.7 release should contain all the functionality required for 1.0.
Who is simple scan for?
This application is designed for the 95% of users who just want to connect their scanner and quickly have the image/document in an appropriate format.
How does this relate to GNOME scan?
Simple scan does not use the GNOME scan to get the scan data. This is because Ubuntu 10.04 is a Long Term Support release and bringing the whole GNOME scan stack into main is risky (it was previously proposed for 10.04 but was not found to be stable enough). There is an open bug to change to gnomescan when that is appropriate.
Wednesday, July 29, 2009
format not a string literal and no format arguments
warning: format not a string literal and no format argumentsWhat does this mean? GCC is saying that a function in printf style has a format string that it cannot check matches the format arguments. Here is some common code GLib code that causes this error:
GError *error = ...;
g_error(error->message);Why is this a problem? As
error->message cannot be checked it may contain a printf flag sequence, e.g. "Invalid data: 'g^y#%s'" (i.e. %s) that would cause run-time to try and access a non-existent argument. It could be worse and the format string could be user-input that is attempting to exploit your program.So the solution is to always use a string literal for formatting like this:
g_error("%s", error->message);
Wednesday, July 15, 2009
Gran Canaria Desktop Summit 2009
Here are my impressions:
- The community is very alive and active! There are many companies and individuals working on improving GNOME.
- The GNOME foundation is well organised and financially sound. Donations are a big part of this success. If you contribute to GNOME in any way then become member (it's easy to join!).
- Really impressed with the quality of PiTiVi — it's now a very capable basic video editing program. One thing the PiTiVi developers want though is a media manager...
- ...which may be getting closer. Banshee is splitting it's backend out into Banshee Core which will be a database of music, video and photos on your computer. Hopefully there will be some convergence between this and tracker, zeitgeist and akonadi to provide a seamless user experience to your media.
- GNOME Shell is still young but is showing some interesting breaks from the traditional desktop.
- Project Mallard is going to make the GNOME documentation much better.
- Testing initiatives like Mago and LDTP should see an increase in the quality of software.
The future looks really good!
Friday, March 20, 2009
New Job
Tuesday, July 29, 2008
I'm Going To Scale My Foot Up Your Ass
So if you're not afraid of some fairly strong languange then check out his abuse against threading, scalability and serialization.
Sunday, May 18, 2008
Gcalctool 5.23.2
unstable GNOME series.
The following changes have been made from 5.23.1:
- The cursor now behaves correctly when editing numbers with thousands separators (Bug #527669)
- Structural changes in preperation for full unicode support (Bug #530532)
- Updated translations: es (Jorge González), gl (Ignacio Casal
Quinteiro), nb (Kjartan Maraas), nl (Tino Meinen), pt_BR (Leonardo Ferreira Fontenelle), sl (Matej Urbančič)
The release is available from:
http://ftp.gnome.org/pub/GNOME/sources/gcalctool/5.23/
Wednesday, May 14, 2008
glChess on Win32

I was very impressed with the quality of the Windows packages for the dependencies. When I tried this about a year ago it didn't appear they were all supported. They are now:
Python
* python-2.5.2.msi
Setuptools
* setuptools-0.6c8.win32-py2.5.exe
GTK
* gtk-2.12.9-win32-2.exe
PyGTK
* gtk-2.12.9-win32-2.exe
* pygobject-2.14.1-1.win32-py2.5.exe
* pycairo-1.4.12-1.win32-py2.5.exe
* pygtk-2.12.1-2.win32-py2.5.exe
Python Imaging Library
* PIL-1.1.6.win32-py2.5.exe
PyOpenGL
* PyOpenGL-3.0.0b1.win32.exe
PyGtkGLExt
* pygtkglext-1.1.0.win32-py2.5.exe
Gnome Games
* gnome-games-2.23.1.tar.bz2
Friday, May 09, 2008
Hello Planet
In my more pays-the-rent side of life I am a software engineer having come from an embedded background and now working for a large financial organisation in Sydney, Australia. I get into open-source code when I have some spare time which leads to fairly unpredictable progress on projects (actually I normally find I have time after a release so I get a release worth of duplicates before the change is released - now that's Murphey's law!).
My goals for Gnome currently is to get the code I'm working on simpler and more reliable. This goal will inevitable slip when I find some flashy feature to introduce :).
p.s. I don't actually play chess so fear ye all who left me writing the Gnome version!
Apport/Bug Buddy disabled in Ubuntu 8.04?
/etc/init.d/apport showed this was disabled so I enabled that by editing /etc/default/apport and set enabled=1. After /etc/init.d/apport restart I could happily file away a nautilus bug.But wait a minute... That report went to Launchpad, not Gnome Bugzilla! (Wouldn't it be a nice world in which Ubuntu got the flood of duplicates for the things we fix but they never update </gripe>). It appears apport is only enabled during development so I shouldn't have had to enable it. I figure it is bug-buddy that normally catches bugs and sends to Gnome; is anyone else getting this/know how to tell if the crash catcher is running?
Sunday, April 20, 2008
Gcalctool 5.23.1
This release contains a number of bugfixes:
* Fixes a number of compiler warnings (Bugs #526976, #526702, #527318)
* Fixes incorrect negation precedence (Bug #526094)
* Fixes issues with thousands seperators and radix in non-english
locales (Bug #527669)
* Fixes regression in constant and function menus (Bug #527545)
* Fixes problem where display is invisible after solving equation
(Bug #524602)
Get it from:
http://ftp.gnome.org/pub/GNOME/sources/gcalctool/5.23/
Tuesday, April 08, 2008
Gcalctool 5.22.1
Anyway; let the announcing begin!
The Gcalctool team is proud to annouce the release of Gcalctool 5.22.1.
This release contains the following changes:
- Fix for bug where the initial zero in the display was not cleared (bug #520525)
- Support bracket and multiply keys on non-english keyboards (bugs
#521620 and #526671) - The replacement of sprintf() and strcpy() with the safer snprintf()
and strncpy() (bug #520769) - Remove a .svn directory from the release tarball (bug #524025)
- Updated translations bg(Yavor Doganov), en_GB(Philip Withnall),
et(Ivar Smolin), pl(GNOME PL), sk(Marcel Telka). - New maintainer; Robert Ancell takes the reins from Rich Burridge.
Get it from:
http://ftp.gnome.org/pub/GNOME/sources/gcalctool/5.22/
Thursday, January 24, 2008
A Field Guide to Free Software Supporters
Wednesday, January 23, 2008
Linux is just great
Just to let you know that I think Linux is just great. I plugged in the old Cannon Printer and the HP 3300C Scanjet and they both worked without a hitch.
I think I installed 5.04 on my fathers laptop a few years ago. I upgraded him to 7.10 the other month (he would have been able to do it himself but I had to flash the bios to get rid of a password and enable CD-ROM booting). The only additional application he needs to add is Gramps (Genealogy). From the perspective of someone wanting things to "just work" each release has been definitely been getting better.
Saturday, January 19, 2008
The Gnome Foundation
Wednesday, December 19, 2007
Sharing media with Xbox 360
Turns out to be pretty simple.
- Install ushare. There is a ushare and libdlna package to install
- Edit the config file in /etc/ushare.conf. Set USHARE_ENABLE_XBOX, USHARE_DIR and USHARE_IFACE
- Restart with /etc/init.d/ushare restart
Notes:
You don't need to add any routes that they recommend (as long as your default route is OK and you're only using one network interface). Remember to set the appropriate interface (in my case my wireless is eth1) as the USHARE_IFACE option.
The default config file in 1.1a had invalid config item names. All config items should start with USHARE_. The Xbox one did not in my default config file.
Sunday, December 09, 2007
Ubuntu Python Upgrading
I'm not 100% sure of all the details but essential the following occurs when python files are upgraded in Ubuntu:
At some point in the upgrade the site-packages Python directory (which contains all the python modules to import) is moved/symlinked out of the way. This is done to avoid binary incompatibilities between .pyc files between Python versions. The .pycs are rebuilt and then the directory returns.
What this means for application developers like me... Files installed into bin/ directories remain so a user can launch the application but the libraries have dissappeared so the application will fail with an ImportError exception.
I'm not convinced the upgrade needs to be this dramatic as .pyc files are only a load optimisation but this means that the ImportError should be caught at the top level and the user warned they have an invalid install (a good thing to report anyway) or they are upgrading and must wait for the upgrade to complete.
Monday, November 19, 2007
Confused about sound on Linux?
I seems to me the "standard" way for Gnome will probably be:
- Applications decode/generate audio using GStreamer
- GStreamer sends the audio to PulseAudio which performs volume control and routing
- ALSA drivers play the routed audio onto physical cards
All three projects have some overlap and do not require any of the others to work. OSS was replaced by ALSA. ESOUND was replaced by PulseAudio.
KDE is also using Phonon as a fourth layer for API stability and to allow applications an easy way to play sounds.
OpenGL 2.0
I noticed that since upgrading to Gutsy I appear to have OpenGL 2.0 support callable from Python... Since I've never done any OpenGL 2.0 and I have the Orange Book sitting beside my I should give it a try.
After hacking the installed libraries I got the early result of the shaders in the picture which shows hemispherical lighting (not possible in OpenGL 1).
It all seems to work quite well. I was working on some cell shading but changing shaders while drawing the scene makes everything go black. I hope it's not a driver/binding issue but something I'm doing wrong (can't work it out yet though). Hopefully sometime in the future there will be fluffy chess pieces too :)
As for putting this into glChess I think this one will have to be handled very carefully. There is enough bugs from differing OpenGL setups (and broken drivers) that the code will have to be very robust. When things start working better I'll add a secret gconf key that turns on the shaders for those in the know...
Tuesday, October 30, 2007
No more glchess.sourceforge.net
That is all; move along.
Is Gnome for the 80%?
Is Gnome for the 80% of users like subversion?
I think that is the direction Gnome has been going in for some time and I think this is the direction Gnome should be going. In saying that I don't think Gnome leaves a power user like me high and dry. I like how Gnome keeps my day to day problems simple and for power tasks I stay in Gnome Terminal and use the odd app like Firefox, Gedit, Gimp, Inkscape, Glade and Meld.
Wednesday, October 17, 2007
Moving gcalctool UI to Glade
However I was foolishly tempted to convert the ~3500 line gtk.c into using Glade (Bug 485919). Which has been taking up all my glChess/GGZ development time but is nearly finished. But I think it's a useful addition for the future of gcalctool.
Saturday, August 25, 2007
Seam Carving for Content-Aware Image Resizing
Researchers are Shai Avidan and Ariel Shamir.
Friday, August 03, 2007
Got a spare computer lying around?
SSL in Java
The initial program is quite simple:
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.SSLSocket;
public class JVT
{
public static void main(final String[] args) throws Throwable
{
SSLSocketFactory sslSocketFactory = (SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket sslsocket = (SSLSocket)sslSocketFactory.createSocket("localhost", 12345);
sslsocket.getOutputStream().write("Hello from the world of Java\n".getBytes());
}
}
But when I connected I got:
Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Oh, what a readable exception... So it appears it doesn't like the certificate of my Python end and I should probably supply that to Java somehow. keytool is the tool for the job (a very cheap and nasty tool). I tried doing a:
$ keytool -import cert
Which did seem to import it (shows with
keytool -list) but still the exception.Tried some debugging:
-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Djavax.net.debug=ssl
It showed the standard signing authority certificates but not my one...
And that's when I give up and copy someone else's solution to the problem. This is how to replace the certificate checking with a null implementation:
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
public class JVT
{
public static void main(final String[] args) throws Throwable
{
// Create empty HostnameVerifier
HostnameVerifier hv = new HostnameVerifier()
{
public boolean verify(String urlHostName, SSLSession session)
{
System.out.println("Warning: URL Host: " + urlHostName + " vs. " + session.getPeerHost());
return true;
}
};
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]
{
new X509TrustManager()
{
public java.security.cert.X509Certificate[] getAcceptedIssuers()
{
return null;
}
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType)
{
}
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType)
{
}
}
};
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
SSLSocketFactory sslSocketFactory = sc.getSocketFactory();
SSLSocket sslsocket = (SSLSocket)sslSocketFactory.createSocket("localhost", 12345);
sslsocket.getOutputStream().write("Hello from the world of Java\n".getBytes());
}
}
So now it works (for transport) but I must find out how to do the certificates properly.
Making an SSL connection in Python
The client side is pretty simple. Python comes with built in SSL support for connecting sockets. Basically you just wrap a standard socket with an SSL socket:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 12345))
sslSocket = socket.ssl(s)
print repr(sslSocket.server())
print repr(sslSocket.issuer())
sslSocket.write('Hello secure socket\n')
s.close()
The server is a bit more tricky, you need to install pyopenssl (apt-get install python-pyopenssl) for more SSL features. The server needs a private key and certificate to identify itself with.
The quick and dirty way to generate a test key+certificate is:
openssl genrsa 1024 > key
openssl req -new -x509 -nodes -sha1 -days 365 -key key > cert
And the server wraps the sockets much like the client does:
import socket
from OpenSSL import SSL
context = SSL.Context(SSL.SSLv23_METHOD)
context.use_privatekey_file('key')
context.use_certificate_file('cert')
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s = SSL.Connection(context, s)
s.bind(('', 12345))
s.listen(5)
(connection, address) = s.accept()
while True:
print repr(connection.recv(65535))
OpenSSL also provides a test SSL client/server in the style of telnet/netcat, great for debugging:
openssl s_server -accept 12345 -cert cert -key key
openssl s_client -connect localhost:12345
Friday, July 27, 2007
Tool for checking key events with curses
#!/usr/bin/evn python
import curses
import curses.ascii
keys = {}
for name in dir(curses):
if name.startswith('KEY_'):
keys[getattr(curses, name)] = name
for name in dir(curses.ascii):
if name.isupper():
keys[getattr(curses.ascii, name)] = name
for i in xrange(128):
if curses.ascii.isprint(i):
keys[i] = "'%s'" % chr(i)
s = curses.initscr()
s.keypad(1)
curses.noecho()
try:
while True:
c = s.getch()
s.clear()
try:
key = keys[c]
except KeyError:
key = '%d' % c
s.addstr("Key = %s" % key)
s.refresh()
except:
curses.endwin()
Wednesday, June 13, 2007
Google Analytics = WOW
I just went back to Google Analytics for the first time in a while and their new interface is just amazing.
Check it out:
Safari on Windows
There are two possible reasons I can see Apple doing this:
- The want to improve website compatibility with Safari - by having a Windows version hopefully more page designers will check compatibility and thus their core OSX users will get better support.
- They want to use this as their iPhone development platform - Safari will have a mode for running iPhone applications in a browser window the same size and behaviour as the iPhone (which will be like Dashboard applications?).
My gut instinct is that this started when the iTunes developers tried to see how easy it would be to port other apps. Apple must have a reasonable number of Windows savvy developers by now...
Wednesday, June 06, 2007
Have you mooed today?
apt-get is not the only mooer in town. Try ip moo (from iputils).
Sunday, June 03, 2007
The thin Gnome line
It is interesting as more distributions change to Gnome 2.18 how many 1 in a million (or other appropriate large number) bugs turn up. I can only assume this user has somehow overwritten their gobject install... Weird *. There seem to be a lot of errors in peoples libraries. Hard to know what to do with these bugs as they're outside the scope of glchess but I'd prefer not to close them NOTGNOME too quickly.
* It would be good from a maintainers point of view if the big distributions like Ubuntu had a background process that audited all installed files so corruption could be picked up (and the packages re-installed).
Monday, May 21, 2007
Nouveau + Linux Graphics
If I had the time I would love to work on a project like this. Once past a critical point the value to the open-source world would be immense.
As Dave Airlie and Ben Skeggs said at LinuxConf.au; "Graphics drivers are not that hard..."
Sunday, May 20, 2007
Gnome Games Icons
These were made some time ago by (mostly) Daniel Derozier but only some of them were in use in 2.18. I found out about these icons from the Tango mailing list and found there was some complications getting these icons used (see bug 354507).
What seemed to happen was an all too common situation in open-source where everyone wanted the change but it wasn't used due to confusion/politics/endless discussion. It seems very common with distributed development (with people you have never met) that feedback can come across as criticism. Without formal management it's very easy for issues like this to be missed and fall through the cracks.
One thing that I think helps is to divide the change into smaller parts. For instance if a bug is opened with a change that is generally good then commit that change and aim to open more bugs to fix details with the change. If all the details must be fixed before committing then the change is in danger of never reaching completion or ending up in a design by committee situation.
(note that this post is feedback and not criticism!)
Sunday, May 13, 2007
Too many parodies...
I use Macs a lot a work for point-of-sale and applications and have been generally impressed with them. They can be tricky locking down but I imagine the other OSs are similarly difficult.
Tuesday, May 08, 2007
Monday, May 07, 2007
GGZ
So glChess is getting closer to having GGZ support...

Oh, and it really is wonderful to work on a well designed protocol like GGZ. ICS is OK if you're a human but a nightmare for a computer!
Wednesday, May 02, 2007
Poisonous People
One point of particular interest was their recommendation not to put your name in files - by doing this you are implicitly claiming "ownership" of the code which will discourage potential developers. From looking at other peoples code I think I agree with this idea and plan to remove my name from code in the future.
Saturday, April 28, 2007
Gnome bug triaging
So here's my top 3 bugs that need to be fixed asap:
- #409172 - Sudoku crashes when loading. Haven't looked into this at all but we probably get a few reports each day
- #418427 and #412690 - Both Sudoku and chess can't find their libraries on Feisty - I suspect this is an upgrade issue only but none of the many reports have any information on how to reproduce
- #428560 - Some dubious Sudoku code that extracts an integer from label text. Doesn't work when the label is translated. (I've been bugging Joel to fix this).
We need your help!
Saturday, April 21, 2007
Upgrade complete
- The installer failed to complete due to the poor quality of the VMWare packages. They've now been removed.
- fglrx acceleration still does not work. I've changed to the "radeon" driver which runs but is unreliable. I can get the desktop effects working (wobbly windows got annoying after one minute) but playing video stops working when the window looses focus. I noticed glChess renders both the 2D and 3D at the same time, I'll see if this is a driver or glChess at fault.
- And most annoyingly the US keyboard layout has stopped working for my second keybord. I can't type '/' or '|' which is very annoying in the shell (the keyboard configuration shows the correct layout though).
For me both the Edgy and Feisty upgrades have been disappointing for me. I have a Dell Inspiron 6000 which I think is fairly common and I hope support gets better if Dell starts distributing Linux!
Friday, April 20, 2007
Sunday, April 15, 2007

Are Europeans big chess players or big open-source users or both?
Friday, April 13, 2007
glChess spam poetry
The Commission has concluded that " safeguards schachclub are imposed by federal skakcomputer law and forensic science is webchess glchess practiced go chessboard schachcomputer far less efficient than openings tim krabe rochade ...
I don't know whether to be flattered or annoyed.
p.s. I found this from a feed from Google Blog Search - this is a great way to keep track on what people are saying about your project. Most people don't write to you, they just write about you...
Monday, April 09, 2007
glChess 1.0.5

Yes, it has (simple) timed play support. It needs some cleaning up in the code but due to limited development time I thought it best to "release early".
Notice the navigation buttons are now on the left. I liked the symmetry of them on either side but as a user pointed out when you are in high resolution it takes too much mouse motion to move between them.
The other notable change is the 2D board now rotates and you can choose (from the menu) which side of the board to view.
These changes will be in the Gnome 2.20 release.
Enjoy!
Sunday, April 08, 2007
Beginners guide to Gnome Python games
First install Gnome games. You can install this anywhere but I usually make a subversion directory:
$ mkdir svn
$ cd svn
Check out the development version:
$ svn co http://svn.gnome.org/svn/gnome-games/trunk gnome-games
$ cd gnome-games
Configure the package:
$ ./autogen.sh --prefix=/tmp
This will get the software installed in
/tmp, you might want to use ~/build or something similar instead.For the above you will need the appropriate development tools installed. This will be distribution specific so unfortunately you're on your own here... If I remember which ones I installed on Ubuntu I'll state it here. Oh and on Ubuntu Edgy edit
configure.in and change GNOME_PYTHON_DESKTOP_REQUIRED=2.17.3 to 2.16.0 because it works fine with the old (installable) version.Install Sudoku:
$ cd gnome-sudoku
$ make install
To run:
$ PYTHONPATH=/tmp/lib/python2.4/site-packages/ /tmp/bin/gnome-sudoku
Now here's the cool part - because Sudoku is written in Python you don't need to recompile to make changes... What I do is edit the files in
/tmp/lib/python2.4/site-packages/gnome-sudoku and run again. You can add print statements, make radical changes, whatever you like. And if things get too broken overwrite the install with another make install.When you've fixed the change you need to make a patch to attach to a bug report. To do this you need to update the files in
~/svn/gnome-games. What I use is Meld:
$ meld ~/svn/gnome-games/gnome-sudoku /tmp/lib/python2.4/site-packages/gnome-sudoku
Once you've got the changes merged into the checked out copy make a patch:
$ cd ~/svn/gnome-games/gnome-sudoku
$ svn diff > your_changes_description.patch
And send that in.
Don't worry about the patch being perfect, the developers who know the codebase better will look it over and modify/suggest changes to you. It may take time to get a response because we're all volunteers but we do appreciate the work - We need more help and you're the right person for the job! The first patch is always the hardest too :)
Feedback very welcome.
Friday, March 30, 2007
Working with Java
I've more-or-less come to the end of a project refactoring a large Java GUI application for my company and I now feel I can justifiably have a practical opinion on Java. This was my first commercial work with Java and I'll compare it to C/Python/GTK+ which I have used both commercially and in open-source projects.
Java is far more complicated than it should be. Count the number of methods each class has when browsing the documentation. The complexity of the standard library exceeds the complexity of the problems you solve with it. Compare it to the Python or even C library. Instead of containing the basic tools and tools that you use frequently it's full of cruft. I think the programmer should either build up more complex functions themselves or use higher level functions from a different namespace (compare GL and GLU libraries in OpenGL).
AWT and Swing are just a complete mess. Sure this is for historical reasons but Java needs a serious replacement. Maybe SWT is it but if some leadership is not taken to make a "standard" GUI that works I cannot see vanilla Java surviving compared to something like .NET. Case in point,
java.awt.Component has four variations on getting keyboard focus. And reading the documentation on each is just worring... You may not get focus, you should use the requestFocusInWindow() because it is more cross-platform. I used to work with a commercial Java developer and he described the cross-platform support as write once; test n times. I now understand.Packing in AWT/Swing is just too difficult. The simple packing models are too simple for most cases and the complex ones create too much code. While the GTK+ model is more complex to start with I'm always surprised how my windows "just work" (try shrinking a Java window and see everything get messed up). Java needs a universally accepted equivalent of Glade or XAML.
Connecting signals takes too much code. Using Listeners requires you to write loads of empty methods to catch signals you want to and Adapters can't be inherited if you're already extending another class. I hate inline classes with a passion (so much code for so little behaviour!). Using SwingUtilities.invokeLater() (which is a really practical method that should be more central to Java) to create a runnable class every time you want to access one method later? Overkill. Why not just
gobject.idle_add(method)?Threading... All I can say is threading is an optimisation. I've seen too much excessively threaded code that is very hard to maintain. Java seems to implicitly encourage you to thread which I do not like. I don't like that a lot of the Graphics operations don't seem to have an easy way of doing them synchronously. Threading is an optimisation.
Really it's the library that lets Java down. The language is a huge improvement over C. It lacks a little in low level access (I have not really done this in Java but from a first glance it may be missing something like Pythons struct module). I dislike the lack of flexibility over Java but I do like the compile time checking for catching bugs. I must try a .NET project to see if .NET doesn't have the baggage Java does. I get the impression the dominant members of the Java community have the opinion "Don't change anything, we've got too much code" as opposed to "Keep version X stable as we have lots of code, but make version X+1 fix the big problems in X".
My opinion of Java? Not ready for the enterprise :)
Tuesday, March 20, 2007
Damn broken VMWare
- Install Ubuntu from a CD
- Install VMWare player
- Use VMWare player. Works (fairly - see below) well
- Perform a security update
- Pretty much broken from now on...
Some clues:
- The kernel modules are not loaded on startup. If you try and use modprobe they're not found. If you use insmod they load OK.
- Running /etc/init.d/vmware-player start says neither vmmon or . I think this is because it is trying to use modprobe
- If you run the player after insmodding then it runs but networking doesn't seem to work. In general the networking seems very flaky.
And why is the performance of the player so poor? Applications inside the player often pause inexplicably for a minute or more (I think it may be related to networking, for example try ifup with DHCP). Sure it's virtualised so I could understand if there was a resource problem but both CPU and IO are not active. So I just don't know what's going on.
So if anyone is wondering why there aren't any glChess packages from me for non-Ubuntu Dapper systems, now you know.
Saturday, March 17, 2007
Slashdotted!

Good to see the quality of the comments were absolutely rubbish. Why actually try/investigate something when you can rush and post about it! :)
Bonus points if anyone can actually confirm the dialog has bad grammar as some of the comments say.
Friday, March 16, 2007
Sick today...
Unfortunately a lot of the bugs are due to a save file being corrupted. Once this has occurred Sudoku will always crash on startup. So we'll have to wait until a month or so until 2.18.1 is released to get some relief from bugbuddy...
Monday, March 05, 2007
Java + keyboard bindings
I want to connect all input keys to a single widget. And I don't want to have to use 16 classes in the process. And I want all the Java library developers to get their come-uppance.
*sigh*
Python GtkGLExt
Sunday, March 04, 2007
Boo's chess engine
p.s. I found it quite funny posting the same article twice!
Saturday, March 03, 2007
ASCII
In my previous job there were a number of ASCII/Binary protocols that used STX (02) and ETX (03) for framing transmission. This now makes a whole lot more sense...
Oh and software flow control seems quite simple now. I'd assumed there was some sort of escape sequences to do this but hey, there's the characters right there!



