Tuesday, September 28, 2004

A good move from Sun

Linda de Michiel and Craig Russel, spec leads for JSR-220 (EJB 3) and JSR-243 (JDO 2.0) have written an open letter to the Java community that they want to unite Java persistence under the umbrella of JSR-220.

The critics will now mumble that JBoss will get (more) influence on the whole Java persistence through their jsr members and through hibernate in special (Hani, I already hear you rotating in your bed).

I think this unification is a good thing, as persistence is critical to many applications and there is no point to have various competing standards that all fill a certain niche and where you can't really tell why you are using one standard and not the other.

Can you tell what is the difference between hibernate, jdo and entity beans? If so, do you know the differences between various jdo implementations? Do you know all the vendor specific details of EntityBeans configuration?

Saturday, September 25, 2004

Ewww blogger...

For my previous post I tried to optimise the layout in a way that the tables are not miles away from each other, but no luck :-/
I have no clue what is going wrong, so I just have to accept it as is. Perhaps people are not supposed to blog tables or such...

Some statistics

I have a little web site that had some 2000 visits this month so far. I use awstats to track usage.
Below is an excerpt from some statistics.

Interesting fact: 70% of all users use a screen size of 1024x768 or less!
Also interesting: most browsers have Java and/or PDF support.









Operating SystemsHitsPercent
Windows1095587.8 %
Unknown5624.5 %
Macintosh4593.6 %
Linux3983.1 %
Sun Solaris890.7 %
FreeBSD40 %
NetBSD10 %
Symbian OS10 %














BrowsersGrabberHitsPercent
MS Internet ExplorerNo848268 %
FireFoxNo207216.6 %
MozillaNo7135.7 %
Unknown?3692.9 %
NetscapeNo2762.2 %
OperaNo1821.4 %
KonquerorNo1210.9 %
SafariNo760.6 %
LinksNo720.5 %
WebCollage (PDA/Phone browser)No510.4 %
Others 550.4 %








Screen sizesPercent
1024x76863.3 %
1280x102414.6 %
800x6009.3 %
1152x8646 %
1400x10502 %
Others4.6 %










Miscellaneous 
Browsers with Java support93.4 %
Browsers with Macromedia Director Support39.2 %
Browsers with Flash Support92.5 %
Browsers with Real audio playing support37.8 %
Browsers with Quicktime audio playing support39.5 %
Browsers with Windows Media audio playing support89 %
Browsers with PDF support84.9 %

Tuesday, September 21, 2004

SVG: Tree drawing

This article at xml.com describes how trees of data can be drawn in SVG with the help of an xslt stylesheet.
With some additional work, this could surely be converted into a nice DTD printer. A good article nevertheless.

Monday, September 20, 2004

JBoss 4.0 is out

After quite some development time, JBoss 4.0 has been released today.
Even as it was announced to be released rsn some days ago, I didn't believe it.
Now I bets will be accepted when the first patch release will follow :-)

Monday, September 06, 2004

My first time :-)


[echo] D:\devel\sim\server\build/webapp/classes
[javac] Compiling 2 source files to D:\devel\sim\server\build\webapp\classes

[javac] An exception has occurred in the compiler (1.4.2). Please file a bug
at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
[javac] java.lang.ArrayIndexOutOfBoundsException: 1886419334
[javac] at com.sun.tools.javac.v8.code.ClassReader.nextInt(ClassReader.java:335)

Wednesday, September 01, 2004

I am OS X

Just made the "What OS are you" test on http://bbspot.com/News/2003/01/os_quiz.php.

I am
You are OS X. You tend to be fashionable and clever despite being a bit transparent.  Now that you've reached some stability you're expecting greater popularity.
Which OS are You?


Not bad .. I feared to be some Win*. Try it, it is worth a laugh.

Tuesday, August 31, 2004

SVG: Batik and <tspan>

Currently I need many drawings in PDF to be able to include them in documents produced by PDFLaTeX. With Batik, there is a tool to convert SVG to PDF.
The Idea to use SVG came as Together can write this as the only vector format. And when producing class diagrams etc. with Together, the PDF result is excellent. Unfortunately Together is no general purpose drawing tool.
After some investigation I found Sodipodi, which is a nice tool with some downsides. But ok, it can produce SVG. When doing some tests, the Fonts always looked ugly (the top line in this pdf). I did some testing around and found that Sodipodi does the following

<text ....>
<tspan>This is some text</tspan>
</text>

After removing the <tspan> elements, the text can no longer be moved around in the Sodipodi canvas, but looks like it should (bottom line in this pdf).
As <tspan> is pretty valid in SVG, this seems to be a problem in Batik or FOP, which is used by Batik to produce PDF. Especially as the conversion to PNG works as it should.

Saturday, August 28, 2004

The "I want it now" syndrome

Have you ever worked in an Open Source project?
Then you probably know the folks that report a bug with "ultra critical" and "I need it yesterday". The bug report sometimes says "xxx doesn't work". When you then ask what doesn't work -- silence. Nothing. Or even flaming that one could have answered earlier.

I understand, that not everybody is able to fix things themselves. And I also understand that if you use a tool that stops working, it is very important to get it fixed at that moment.

But most people that work on Open Souce earn their living by doing other things, perhaps even having a second job in the evening. So you cannot expect them sitting behind the trouble ticket system all day long just waiting for that very urgent problem coming in.

If a tool has such a big value for you and your production chain, then get a support contract upfront or try to pay someone to help you when the problem arises. Some call that risk-management.

Friday, August 27, 2004

Things the world doesn't need

Heise newsticker reports that Cherry now offers a Linux Keyboard (click here for a larger image)!

That keyboard has keys for page forward/backward, as if ALT-/ woudn't work. It also has cut / copy / paste keys.
Ok.. nice idea. But the bad think about all those keys is that they cannot be reached without moving the hand away from the ten-finger writing position.
But I am sure, it will be a success, as it has a penguin key.

P.S.: When do they offer keyboards with a BSD daemon or a steaming java cup printed on? :-)

Friday, August 20, 2004

Maven woes again

As Xdoclet uses Maven to produce the final documentation and web site, I thought I could enable the maven-statcvs-plugin to get to fancy line of code charts.
But instead:

[java] StatCvs-XML - CVS statistics generation
[java]
[java] java.lang.NullPointerException
[java] at net.sf.statcvs.Main.getModuleName(Main.java:193)

When looking at the documentation, I found out, that this plugin uses a cvs command found on the host, while the maven-changelog-plugin uses a built-in cvs client.
This explains why maven takes that much space *sigh*.

Even worse: both plugins get the change log from the cvs server. Instead of fetching it one time only and then processing it twice, the load on the server is doubled!

Friday, August 13, 2004

Java code analysis tools

Today I stumbled over some stupid errors and thought "why doesn't eclipse tell me about that?" so I remembered Findbugs and was first looking for a findbugs output xml to html stylesheet (there is one posted in the forum at sf.net). I also saw that there is an eclipse plugin. So I was trying to get findbugs with its plugin to work together with Eclipse 3.0, but did not have success because I misunderstood part of the the documentation.
While googling for help, I came across PMD and thought to give it a try.
The plugin works nicely and is easy to set up and run.
But after running it over my source file, I was disappointed, because it mostly was a different incarnation of checkstyle. It was telling me that some variable names were too short, others too long bla bla bla.
But it did not find the real problem of the following code snippet:

Object o1 = getBla(..);
Object o2 = getBla(..);
if (o1==null && o2 !=null) {
// do something
}
else {
if (!o1.equals(o2)) // something else
}

PMD complains that o1 and o2 are too short that is all, but does not detect the NPE when o1 and o2 are both null.

Ok, this might be too tricky. Lets try something simpler:

Object o = null;
System.out.println("below is a NPE");
o.equals(null);

Even here, PMD only complains about the short variable name, but doesn't find the NPE.

I am sure, that a tool like PMD can help a lot in improving code quality, but is basically useless for bug hunting.

And for my need to convert the findbugs output into a html page, I wrote an extremly simple xslt stylesheet.

Thursday, August 12, 2004

A-Team finally free of charges

The Onion, America's Finest News Source
reports here that the heroes of my youth, the A-Team is finally cleared of all charges by the US Military.

Enjoy the article :-)

Tuesday, August 10, 2004

Downside of ubiquitous reachability

We were having some strange problems with some framework. I got the number of an expert from "his" sales guy a few days ago and I was trying to reach the expert now. Around 3pm yesterday (German time) I dialed +49 171 ... (German mobile phone number). After a few beeps I heard the voice of that guy. I started ".. bla bla bla.." then I heard "you know .. it is 6am here where I am .. you just woke me up".
I felt somewhat guilty that I did phone him and that I did not directly hang up. On the other hand I was pissed, as I did phone during normal office hours (in Germany) and cant know the German numbers are redirected to the US (California probably). If that guy doesn't want to be woken up, then he should shut down his phone).

Friday, August 06, 2004

Bahncard - I am impressed

German Railways, Deutsche Bahn offers a reduction system, Bahncard, where you buy a voucher that gives you 50% reduction on the normal railways fee.
In the past, ordering a bahncard took a week or longer and they sent you a slip of paper as preliminary Bahncard until they were able to print the plastic card.
This time things were different: including the delivery of the Bahncard by German Post, it only took one and a half days from ordering the Bahncard at the web site until I had the card in my hands. I am really impressed and hope that other services of the Bahn will ameliorate as well.

Tuesday, August 03, 2004

20 years Email in Germany

20 years ago, Germany got connected to the CSNet. This article shows the first email that reached Germany.
Why do I write this? Because the CS Department of U Karlsruhe later 'outsourced' this part into one of the first German Internet providers 'Xlink' that later became of the now bancrupt KPNQwest. I had the pleasure to follow parts of this live from '93 on @Xlink.

Sunday, August 01, 2004

A must have for Firefox

Annoyed by flash ads in Firefox, that you can't block? I was, because they sometimes use 80% CPU on my Pentium 4 grade notebook, which makes the fan spin around noisily. Luckily I found Adblock as Firefox extension.
Perfect :-)

(I know, this post looks like an ad ..)

Saturday, July 31, 2004

Google strangeness

Years ago I wrote a page about Baggerseen um Karlsruhe and put it online. The page gets quite some hits (around 30 a day). When you now google after Baggerseen, Google (DE) lists it on the first page (first ten of about 18000 entries).
Now, common knowledge says, that Google ranks pages higher that many links point to.
But when I enter 'link:www.pilhuhn.de/hwr/baggersee.html', Google says that no other page links to this page (which at least is not completely true).

So this entry is also a test if Google will in future list the contained link or not.

Sunday, July 25, 2004

Java is slow? No!

Mike Hostetler writes in this weblog entry that Java does not need to be slow when you use the -server jvm switch.
I once wrote an article for iX magazine about benchmarking Xslt processors. Here, the fastest one also was written in Java -- and I did not even experiment with the server jvm. My results are also backed by the results on the Java is faster than C benchmark page.

Also popular belief is that if you want to do fast database access, you have to do this in embedded sql (esql) within C. This might be true, if you have to go to the database for every record anyway, but if you are iterating over a known (sub)set of the data over and over again, it might be better to let your infrastructure (e.g application server or O/R manager cache the data).

And then last, but not least: Remeber that everything that can be done in O(n) can also be done in O(n²).

Friday, July 23, 2004

Source code hint

From the source code of one of our projects (anonymized):
// TODO: IF YOU CAN SEE THIS IT MEANS THAT <name> DID SOMETHING STUPID AGAIN

:-)