Impressions from Jonah’s school
June 11th, 2008Lately, Madeleine and I took some photos of Jonah’s school. I think they’re nice, and the school is quite interesting.
Lately, Madeleine and I took some photos of Jonah’s school. I think they’re nice, and the school is quite interesting.
A while ago I was pointed to Magnatune, a cool online record label. I often browse through the catalogue on the search for good music. The cool thing about Magnatune is, you can listen everything and fully online. If you like it, you can buy and choose the price yourself. Then you can download it in all formats, including OGG Vorbis and CD quality FLAC. You are even encouraged to share the files with your friends. I like that.
Lately I found something that I really like alot, the recordings of the American Bach Soloists, especially Bach’s Mass in B minor. I’ve never been much into this kind of music before, so this is like discovering new land for me. I find it really amazing how somebody can sing that way, and how complex this music is, and still perfectly harmonic. Makes me think about values of today. Who would care about sitting down and passionately diving so deep into music to make such incredible piece of art?
Speaking about music, I’ve got tickets for Neil Young in Colmar in August, yay
I’m glad I’ve not went to see him in March or May this year, that would have cost me a lot more (up to 130€) and would have been several hours from here. Now it costs me less than 50€ and it’s basically around the corner from here. Yuppie! I’m really disappointed by his announcement at JavaOne though. Stupid audio snob. (And I don’t think BlueRay or anything is so much better quality-wise than CD, unless you own a 10000€ hifi and listen at insane volume levels).
I’m using the latest Ubuntu release for a while now. It has many nice improvements, resume and suspend seem to work perfectly now, even suspend-to-ram. The browser is slimmer and integrates better with Gnome (GTK widgets for forms, yay!) There has been some polish here and there.
But still, overall I’m a little disappointed. I have the feeling that there are many small regressions. For example, there’s no notification anymore after I unmounted my camera that it’s ready to unmounted (I thought that was a nice feature in one of the previous releases). I cannot access the data part of a hybrid audio/data CD (and thus can’t see the video that’s hidden there). The gnome-volume-manager settings don’t know about CDs/DVDs anymore and I can’t choose my favorite player for those. The default for ripping CDs is now Rhythmbox, which just can’t replace Sound-Juicer yet (cannot replace special chars in filenames with ‘_’). The browser locks up in some complicated situations with certificates. I think there’s many more.
My feeling is that it boils down to two unfortunate decisions: To include Firefox3 Beta and the brand new gio from Gnome. That just doesn’t feel right for an LTS release. I don’t envy the poor developers at Canonical that have to support that release for 3(5) years. From my point of view, the last series of non-LTS releases all appeared to be more stable and mature than this release. This is pretty sad. Luckily I don’t care much about LTS myself and happily await the Intrepid Ibex.
When you have a project in a Mercurial repository, probably using the Forest extension (like I’m doing), then you most likely want to tag the forest occasionally, be it before a release, or (like in my case) when an autobuilder was successful and wants to mark a specific version as OK. Obviously, when working with a forest, there’s a problem, because there is not a single version to tag, but in fact a couple of version. Each tree needs to be tagged. My specific requirements for tagging are those:
Here’s my solutions, in the order that I tried:
This is the first thing that comes to mind, simply because there is such a command. Frankly, in hindsight, this seems the worst solution to the problem, at least with forests. I tried to write scripts that walk the forest and set tags in all the repositories. I even started an HG extension for that. Not only is this very complicated, it turns out that it is almost impossible to push back the tags to a master repository reliably, especially when you want to do this automatically. Also, this stores the tag in each of the repositories, introducing changesets in all of them, thus cluttering all the logs. Ugly. Keep away from that.
The next solution is based on hg fsnap. This is an interesting command. Using that, you can create a snapshot of a forest, and later you can use fseed or fclone to re-create the forest at exactly this state. Seems like a reasonable candidate to implement tagging with. So I did. My script did create snapshots of a specific state, put them in their own repository inside the forest, and pushed them to the master. Since the tags are in their own repository, it is much easier to push them back. However, it is still not 100% fault-proof, especially when several autobuild-processes plus developers are involved. Much better than the first solution, but still, not recommended.
Funnily, this idea comes from the Subversion development model. Instead of hg tag or hg snapshot, it is very straightforward to simply create a clone as a tag. Just like you do with branching. (Yes, I consider in-tree branches somewhat broken. or at least confusing.) Cloning inside the same filesystem has almost zero overhead, because HG uses hardlinks internally. This makes it easy to deploy a similar structure as is common in Subversion:
trunk/ branches/ tags/
Trunk is where all the main development goes. Branches holds all the clones that are considered branches, be it separate release branches or some kind of development branch. You can do just the same with tags, simply clone the forest from trunk (or some branch) to the tags directory and don’t touch it anymore afterwards. This is very straightforward to implement and is the only solution (AFAICS) that fulfills all the requirements above. I’d even go so far to recommend this for non-forest repositories too instead of hg tag. I wish I had this idea earlier. This is why having all kind of commands in the core of HG and having them named like in other RCSs is probably not a good idea, it misleads to thinking that (for example) hg tag is just the same as cvs tag. It stole me a lot of time.
I wanted to give big KUDOs to the developers of the Wine project. Lately I’ve been trying a couple of my favorite Windows games (from back when I had a Windows machine and time to play). Namely, Baldurs Gate I & II, Heroes of Might and Magic III and Starcraft. All of them run out of the box and absolutely flawlessly! With sound, graphics, everything! This is really amazing. Ok, these games are quite old now (I still consider them classics), but from what I hear, newer games like WoW run almost perfect too.
Somehow, I can relate to the developers of the Wine project, after all, they are doing much the same thing as we did in the GNU Classpath project, only that the specs are much much worse.
It even integrates nicely into the desktop: When you click an .exe (e.g. on the setup CD) it launches correctly with Wine. After you installed a program, it shows up in the Gnome menu. Perfect!
If you have some old favorite Windows games lying around, and last time you checked they haven’t been doing anything useful (ahem) on Linux, I think there’s a good chance that they now work out of the box, or with only little effort. Again, big KUDOs to the Wine devs! Soon they are releasing 1.0, yay!
Some days ago, a friend of mine (Rainer Haage of Qemulator’s fame) started a cool wiki called ‘Everyday Apps’. There you can find everyday things written for hackers. Example:
def enter_site() result = None you = You() site = EverydayApps() if you.likethispage(site) == True: result = you.write_your_own_code(site) return result
If you have a funny idea, and it can really be anything like family things, everyday workflows, poems, prayers, etc, please add to the wiki. Should be fun.
Today I got the first graphics app running on Jamaica with OpenJDK:

This doesn’t mean, that 50% of the stuff is working, this means that graphics (Java2D, TrueType fonts, Imaging, Swing, etc) are now fully supported on Jamaica with Linux. This may not seem impressive. After all, all the code is already there, right? Well, on Jamaica it’s not that easy. All the native code needs to be statically linked, which can be a real pain. On the way I found a handful of bugs, both in Jamaica and in OpenJDK, and implemented a bunch of new things in Jamaica (namely, FileChannel support and friends). Now I can happily go off to vacation on Lago Maggiore, yay! And when I come back, I can finally start implementing Java2D pipelines for our more exotic platforms like VxWorks, WindowsCE, Nano-X and OS-9. And finish off the CVS->Mercurial transition inside aicas.
The last couple of days I was digging my way through OpenJDK’s AWT/Java2D/Font2D code and found a couple of antipatterns regarding Exception handling that really stole a lot of my time. I’d like to outline them and show sane alternatives that would have saved a lot of my time.
This is the most stupid, and frankly, the most widespread antipattern for exception handling, probably often a result of a combination of laziness and the need to handle checked exceptions:
try {
// do something
} catch (SomeCheckedException ex) {
// dunno what to do with this.
// or even worse:
// Should never happpen.
}
Really. Never ever do this. In the (possibly rare) case, that the application runs into this, it most likely ends up in an undefined state, and makes debugging a pain. (’Hey, how does the VM get out of this method without returning? Duh! A swallowed exception!’ is usually my train of thoughts) At least, print out the exception:
catch (SomeException ex) {
ex.printStackTrace();
// maybe use logger to log this.
}
If you don’t know how to handle the exception, and don’t want to just swallow it, you could wrap it into an unchecked exception or even error (depending if you think this is an exceptional or error condition):
catch (SomeException ex) {
SomeRuntimeException rte = new SomeRuntimeException();
rte.initCause(ex);
throw rte;
}
I also see this pattern from time to time:
try {
// do something.
} catch (SomeException ex) {
throw new SomeOtherException(ex.getMessage());
}
This is only little more useful than swallowing the exception completely. Again, wrapping the exception properly is a much more helpful solution, as it gives the poor developer soul at least a stacktrace to work with:
catch (SomeException ex) {
SomeOtherException ex2 = new SomeOtherException(ex.getMessage());
ex2.initCause(ex);
throw ex2;
}
There are certainly more such antipatters, these are only two of them that stole a lot of my time. If you know more, please comment and add them below.
Around christmas last year, I bought a Super T-Amp and a pair of Axiom M3 speakers. What can I say, I think I’m addicted by that T-Amp technology now :-). Some weeks ago I ordered an upgraded TA-10 amp from audiomagus.com. It takes some time to burn in before the amp comes to full bloom, and now it is really ‘ripe’. I’m really excited about this great sound that this little amp gets out of the speakers. The Super T is already great, and this amp is similar, only better in everything. Wider soundstage, more detailed sound, better dynamics. It’s just as if the musicians are in the room. Which is strange for orchestral music
It has the same limitations as the Super T though: needs efficient speakers (mine have around 90db/w/m and it is just enough), no remote control, only one input, etc. But this is exactly right for me, I tend to follow the KISS priniciple here too. I also recently bought a used Sony DVP NS900 CD/SACD/DVD player for 150€, a reference player back when it was released. Together this makes a hifi setup for 600-700€ that sounds like something that is around 5x - 10x the price.
There are two downsides you have to be aware of if you plan on such a setup: First, it reveals many limitations of not-carefully-produced CDs (or every media for that matter). For example, I already spotted a couple of clipped passages on Johnny Cash’s ‘American IV’, and Norah Jones’ ‘Feels Like Home’ CDs, which are otherwise great sounding albums. Too bad that pop/rock CDs are often not well produced, with added compression etc, only to get more bang effect on cheap hifis.
The other ‘downside’ I experienced is, that this new setup changed my musical taste quite significantly. For example, I could never stand classical music. Now I know why: it ain’t no fun listening classical music on a bad hifi. Everything gets muddied up and distorted. Now I see that classical music can be much more interesting and rewarding than rock music (my god, if you told me that I would write something like this some years ago, I would have hit you over with something
) Similar with female voices. I seldomly bought female singer’s CDs, and I was never really excited about them. Now I listen to Norah Jones, Fiona Apple, Cat Power, etc more than anything else, and they sound soooo beautiful :-). I don’t want to say that changing or adding to your musical taste is a bad thing, or a disadvantage, but it is something you should be aware of before buying some good audio gear.
That said, the most important thing is to keep listening to music, and not technology. The net is full of audiophile babble and chatter, and it seems to me that many so called audiophiles see audio tech as a kind of status symbol. Recently I saw speaker cables for 4000€ in a hifi shop. WTF?? The T amps are pretty good at bringing down audio quality back to earth.
… goes in small but significant steps. Mouse dragging works now, as well as gradients (dunno, this seems to be gratis with the rendering pipeline, I haven’t implemented one bit for gradients). I can run real Swing apps already, and the things that work show awesome performance. I really think Escher’s performance is a killer, because it avoids JNI calls almost completely, and doesn’t need the buffer pipeline for that (like the OpenGL pipeline). It simply talks efficiently with the X server directly. Obviously, one missing piece is transparent images, I will add that next. Code is still on my server, as we still have no OpenJDK project yet.
