So I wanted to fool around in netbeans, swing and java – here is the outcome. It’s a simple program which lets you set the date/time in one timezone, and see the corresponding date/time in another timezone. I needed this – am not always online but still need to figure out the time in different zones. Invocation is simple, unarchive the tar.gz and then execute:
java -jar TZConvert.jar
TZConvert.jar is in the dist directory. You can download it here. The program is GPLed for extra goodness .. note that it is developed on java 1.6. If you are using Ubuntu Feisty you can now do an:
aptitude install sun-java6*
(I forgot the exact package name!) My original plan was to make this a Thunderbird plugin, but it appears I cannot write plugins in java for Thunderbird.
is a NO-NO! My colleague asked me why – so here is the answer.
If you do something like this:
- Declare a variable, say ‘int glob_x’ in ‘x.h’
- Include ‘x.h’ in ‘a.c’ and ‘b.c’
- Try to link a.o and b.o into one executable, and you will get a linker error, duplicate symbol.
Basically, the header file is included in both the files, and the variable glob_x is now global in *both* the c files, which leads to a clash when you try to link them together.
The correct way of doing this is:
Make glob_x extern in x.h, and declare the variable in only one of your .c files. Now you can use the variable in any .c files that include x.h, and there will be no linker error.
From eye candy to ion2 – it’s a big change. But now that I am using this as my window manager, it feels just right. Admittedly, it’s nothing to look at (and I mean nothing – each window is full screen in a tab of its own) – but once you set up the keybindings, it’s fast! and really more useful. I’ve setup alt-left and alt-right to move between tabs, and find that most of the time, I do not have to use the mouse at all. I get more screen space, and now that I have setup thunderbird and firefox to be more keyboard friendly – quicker too. The only real problem is when I am playing Travian – have to use the mouse then. Here is the ion2 config I’m using, it’s been stripped down to the basics at the moment. Will get added to as I learn more stuff or develop more specific requirements :).