Just now, I was listening to the Java Posse podcast about the ab5k screenlet framework for Java, and I am finally convinced that software developers are a bunch of crazy, unrealistic, memory-hungry, cpu cycle stealers and by lack of normal people telling them otherwise are proud of it, too. The problem? Look at this list (no particular order):
Apple and EMI follow up
In a previous post I told you that Steve Jobs wants to provide DRM-free music through iTunes, but was held back by music companies. Steve must have had a few long and hard talks, because now EMI and Apple are teaming up to provide high quality DRM-free tracks through the iTunes music store, priced at $1.30. The same track, in a lower sound quality, with DRM costs $0.99. For 30 cents, you get a track you can actually use, with a higher bitrate.
At the same time this could be a trick by Apple to get around the legal issues currently being discussed about iTunes music not being available to other players than the iPod. Smart eh?
Bummer, back to Photoshop
I bought Photoshop Elements 4 a while ago, but didn’t use it much since I didn’t like the userinterface (dissapearing menus when you click on the desktop and such). Then came Lightroom public beta, the Photoshop killer. I haven’t touched Photoshop since I installed Lightroom. But now… the Lightroom beta testing period is over. Since I haven’t got 300 Euros to “splurge” on Lightroom, I guess I’m forced to learn to use Photoshop to process my photos now. Oh well… Let’s see how that goes.

A-Team Quotes
As I’m recording A-Team episodes, stripping the commercials and transferring them to my PSP for later viewing on the plane, I came across some funy quotes:
| Hannibal: | Now. We can do this the hard way or the easy way. In about a minute, I and my three friends are gonna unleash on you your worst nightmare. You’re gonna wish the earth opened up underneath your feet and swallowed you whole. |
|---|---|
| Bad Guy: | What’s the easy way? |
| Hannibal: | That was the easy way. |
Just after the tires of the Van are shot by a local gang, the Scorpions:
| Scorpion: | Car trouble? |
|---|---|
| Hannibal: | No thanks. We got some. |
| Bad Guy: | You’re all dead men. |
|---|---|
| Face: | Really? Gee, I didn’t think I would feel this good after I was dead. I want to thank you all for coming to the funeral. |
Almost Monty Python like quotes, and that for an American Television Series! Nice. You like it or you hate it.
Pssst. If you haven’t got the themesong yet, The A-Team soundtrack torrent is here…
The truth about Switching To Mac
Thinking about switching to a Mac? I’d say go for it, but read this article first. It really sums it all up.
PureTracks also gets it!
The DRM discussion that was started by Steve Jobs is generating some interesting ripples in the music business pond. More people are starting to think DRM is not the answer: PureTracks will sell DRM-free tracks.
Steve Jobs gets it!
Remember my rant on copy protection in the post about opening iTunes to other players? All the things record and movie companies tried the last few years has only encouraged people to rip, copy and distribute illegal media instead. It turns out that Steve Jobs also thinks that DRM is not the answer, according to bloomberg. Steve Jobs has sent a letter to the four largest music companies, in which he Asks Music Labels To End Copyright Protection.
Sure it might sound bad when you have serious record company stock options, but the idea is not so dumb as it sounds. For years, Apple software has been reasonably priced, and of good quality. You can buy it online without too much hassle. Result: There is not much illegal Mac software out there. This will surprise the Windows user, who is acustomed to running all kinds of illegal software, up until the point they are practically forced to continue to do so, because they have all their content stored in propriatary formats.
I like Apple’s way of doing things much more: Deliver good quality products, ask reasonable prices, and trust your users (up until a point ofcourse ;-). In return, Mac users are often more like “fans” than customers, because they don’t feel like they’ve been “had”.
I think loosing the copy right protection and then lowering the prices on music is a good thing. The iTunes music store is an easy store to search music or other content in, and does not force millions of tracks onto you (like your friend with the 200GB music library on an USB disk does). Who cares if I have to pay a few cents for a track if I feel like iTunes has helped me find that track? The feeling shifts more to like “paying for the service” than “paying for the track” which is probably what we all look for. As an added value, we have the old “it’s my product, I bought it” feeling back, where we can do with the content as we like because we payed for it. We are no longer restricted to stupid things as “you can listen this track only twice on your Zune before it will selfdestruct”.
Update: More information and the response from Norway is online at MacNN. Norway showing it does not understand iTunes at all, because you can configure iTunes to store the files at a location of your destination, which can ultimately be any (large enough) USB disk, which in turn can be a media player device 🙂 .
Use iTunes with *ANY* mp3 player
Many years ago, I bought an iBead Jens of Sweden MP-100. At the time I was a Windows/Linux user and everything was fine. Now that I’m a Mac user, syncing tracks to my trusty USB mp3 player is a bit harder. I had to copy tracks by hand, and when two tracks had the same title the copy would fail. THis was all very irritating. I am saving for an iPod nano, but until I get one I’m stuck with the USB copy tricks.
But not anymore, 5 minutes ago I discovered SyncTunes, a free Mac OSX application which can sync iTunes playlists to any drive as long as it’s available on your desktop. This means that any drive that mounts as a removable drive (USB memory sticks, PDA’s, Sony PSP’s…) can be used to sync the playlist to. The only catch is that you have to make the playlist fit onto the drive (in size). This can be easily done by creating a smart playlist in iTunes which is limited in size.
I tested syncing some of my playlists (through a size-limiting playlist) and it works like a charm. Size limiting playlists are also the thing to use if you do have an iPod, and want some control on how many space is used by pop music, and how many space is used by rock. I’m a happy camper now, and in no hurry to buy an iPod (but that 8GB red nano sure looks tempting).
Java 5 BigDecimal.toString() and Oracle 10g jdbc
Yesterday a collegue of mine discovered a very ugly problem when storing BigDecimals from a Java 1.5 program into an Oracle 10g database. Not by experience, but by reading the article at http://www.javalobby.org/java/forums/t88158.html. We had not encountered the problem ourselves, but when passing the dredded 12500000 value to the BigDecimal constructor and passing it to the database, we discovered that we too were affected by this bug. So off I went to search a solution.
The root of the problem lies not only in the fact that the BigDecimal.toString() method behaviour has changed in Java 1.5, but also the way BigDecimals are constructed. The Oracle driver relies on a specific formatting of the BigDecimal.toString() method, and can not handle the output of the “new and improved” BigDecimal in Java 1.5. All discussions about not using toString() for passing values and flaming Oracle and/or Sun aside, we have no option but to fix the problem right now. Oracle promised to fix this problem not sooner than in release 11g, so waiting is not an option.
Option 1: Overriding BigDecimal.toString()
In our project, we use Ibatis. This gives us a nice handle to implement our own BigDecimalTypeHandler, where we can choose to do anything to the BigDecimal before storing it into the database, and revert that when retrieving it from the databse. One of the options we thought of was to override the BigDecimal’s toString in an anonymous subclass inside our IbatisTypeHandler, like so:
public void setParameter(PreparedStatement ps, int i,
Object parameter, String jdbcType)
throws SQLException {
BigDecimal colVal = new BigDecimal(
((BigDecimal)parameter).toPlainString()){
public String toString(){
return toPlainString();
}
};
ps.setBigDecimal(i, colVal);
}
The anonymous subclass lets you add or change behaviour to an existing class without cluttering your codebase with a classfile which looks rather strange when places out of context. We tried various ways of locally changing the behaviour of BigDecimal to make it go into and out of the database in a way that our unittest would not know the difference, but at some point gave up. There is not really a good way to do this without compromising in scale or resolution in the conversion.
When using the setParameter described above, you will not get a situation where originalBigDecimal.equals(storedBigDecimal) returns true. In most cases this will not be a very big problem, since originalBigDecimal.subtract(storedBigDecimal) will always return 0.
If somebody thinks of a way to store BigDecimals into the database and retrieving them in a way it is totally transparent to the caller (compared to JDK 1.4 behaviour) please feel free to post it here.
Option 2: Loosing your BigDecimals
Perhaps this option had to be considered when thinking of using BigDecimals in the first place. BigDecimals are very awkward to calculate with, are relatively heavy both performance and memory wise. Very often they get converted to doubles before doing any calculations with them, which eliminates most of the reasons for using BigDecimals anyway.
The easy way to loose only those BigDecimals which get stored in the Database, rewrite the typeHandler you just created into the following:
public void setParameter(PreparedStatement ps, int i,
Object parameter, String jdbcType)
throws SQLException {
throw new UnsupportedOperationException(
"Oracle can not handle Java 5 BigDecimals properly");
}
Now, run all Unittest (you have unittests covering at least 80% of your software, don’t you?) and replace BigDecimals with other appropriate datatypes where you see the UnsupportedOperation popup.
Reboot…
Today the Mac OS Software update popped up, and warned that these updates would require a reboot (about 80% of the updates do not require a reboot). I have gotten so used to not having reboot and hangup troubles that I almost was surprised to see that I needed to reboot. I use my Mac mini for editting foto’s, video, recording TV programs, streaming music, programming, mail, and the usual webbrowsing. It is so quiet and uses so little power that I only power off the screen, and leave the Mac on. I noticed that I have not turned it off for the past 20 days:
rolf$ uptime 20:17 up 20 days, 23:37, 3 users, load averages: 0.20 0.26 0.20
Not bad for a workstation eh? Glad I bought a Mac, it was worth every penny. The other Mac mini I bought to replace my fileserver is also still worth every penny.Just thought I’d share some of my newly acquired Zen with you…