Sunday, April 30, 2006

JAR and classpath

Arghhhhh, this just cost me about 2hrs...
When running a Java application packaged into my own JAR from the command line with

java -classpath /somepath/library.jar -jar myJar.jar

it just wouln't pick up the library.jar.

You can specify a Class-Path entry in the manifest for your own jar, but thats only used to references jars within your jar, not really external jars.

No matter what I did, I would always get a java.lang.NoClassDefFoundError.

Here's the entry in Sun's Java Forum that finally solved it for me - I quote from the post:

When the -jar option is used, the -classpath or any system classpath is ignored - the only classpath is the one in the manifest of the executable jar file, if specified.

Would it hurt to properly document this ??

Friday, April 28, 2006

OOo filters

New challenge: writing an OpenOffice/StarOffice import filter.
Makes the Thunderbird/XUL tasks a no-brainer.

JSP Tours

I knew that JSPs are very versatile, but this one was new even to me:

Maybe people from the city of Skopje, Macedonia come to Vienna, Austria (where the picture was taken) for JSP classes ?
Shouldn't we then host the next JavaOne ??

Thursday, April 27, 2006

SOA and "Business alignment"

Each and every presentation or textbook on SOA (including mine - presentation, not text book; not yet) starts with how IT has to align with "the business", etc, etc, ... and how there are application silos that seem to be the only thing that keep the business from being an "agile" one.

And everyone just assumes or implies that it is or was the IT department's fault that there currently is a misalignment (given there is one at all).
But weren't the business units those who requested those very silos. Or sometimes even demanded them.
(True, IT departments and the industry at large have their share as well).

But when it comes to SOA we simply assume that the cultural aspects of SOA is something IT has to learn. "The business" (i.e. the sum of the business units, quite a heterogeneous bunch themselves) has to become ready as well. They have to stop demanding their best-of-breed silos.

Once we get over that hurdle, SOA will be easy.

Well, don't quote me on the last one.

Monday, April 10, 2006

Redhat buys JBoss

So finally Redhat bought JBoss...
now it's getting interesting in the J2EE appserver market again.

Saturday, April 08, 2006

Java for-each vs iterator

Being really happy that in Java 5 the for-each shorthand for loops over collections and the like was introduced, I ran into a stupid pitfall the other day.

With an iterator you can remove an element from the underlying collection using the iterator.remove() method, like this

Iterator it = somelist.iterator();
while (it.hasNext())
{
   MyObject o = it.next();
   // o.dosomething();
   it.remove(); // removes the current object from the list
}


This is no longer visible if you change from iterator to for-each:

for (MyObject o : somelist)
{
   // o.dosomething();
   somelist.remove(o); // removes o from the list
}

Since the iterator is not exposed to your code, the pitfall is to remove the object directly from the collection...

This will cause a ConcurrentModificationException... not a nice thing to do. But actually its quite clear and obvious.

Afterwards...

Friday, April 07, 2006

why bootcamp

why use bootcamp to dual boot a intel mac (which is soooo '80s), when there's parallels, which uses a hypervisor approach... so you should be able to fade in windows when you need it, instead of rebooting...
Wouldn't that be ... like ... um ... better ?

(or rather vmware, and move my PC image right over to the mac... well, I'm allowed to dream...)

book: SOA with webservices

one of the most important books regarding SOA.
Eric Newcomer's Understanding Service-Oriented Architecture (SOA) with Web Services".



A must, when going into SOA...

Tuesday, March 28, 2006

reading: Software Hardball

McNealy's comment in the WSJ, read it at sun.com as a pdf. http://www.sun.com/aboutsun/media/features/McNealy_Oped-WSJ_3-3-06.pdf

(or - if you like to pay for content thats otherwise free - purchase it at the WSJ here.)

Monday, March 27, 2006

Thunderbird vs XUL

or should I rather say Thundberbird and XUL vs documentation:

Current score:
Thunderbird 5 : 0 documentation

Friday, March 24, 2006

Java Puzzlers


The ultimate java reading: Java Puzzlers by Joshua Bloch:

Top companion to Effective Java, by the same author.

Read it, learn it, live it.

Wednesday, March 22, 2006

iCal - finally

Ok, so I finally found a good Java iCal parser and got it working on most of the .ics files I have:
iCal4J at sourceforge

It does have problems with CHARSET properties, because it doesn't know them.
Which is actually in line with RFC2445... however, they do exist.
To work around this you have to write your own content handler, but it works.

Tuesday, March 21, 2006

Calendars - again

So I've been complaining about timezones recently.
There is something worse: charsets.
(Yes, we knew that already).

More specifically, charsets within iCal "documents".

I'm not really sure whether anything above ascii 127 is actually allowed by RFC2445 or not.
The RFC doesn't seem to be too clear about it.

More importantly - and annoyingly - I just started working with an iCal parser that believes they are not.
So everything abvoe 127 terminates e.g. a description or summary.
German invitations/events tend to have äöüß in them (especially the ß in the location component), yet they don't parse correctly...

Sigh - again.

Monday, March 20, 2006

Calendars - sigh

There are many problems as the industry tried to establish a calendaring/scheduling standard.
Less technical.

Technially speaking everything seems to be solved (for me).

The problem is rather – I think – in the plethora of ways people (in real life) work with calendars, and how their understanding of scheduling is.

One of the problems is e.g. with the understanding of recurring events (not covered today). The other is with time zones, and how people ignore them.

Yes - time zones.
We thought, that the problems of specifying a local time were actually solved with the invention of time zones.
Still, what do you do (programmatically, not as a human being), when you receive an calendar event without any time zone information.
Not even a UTC marker (as in the generally accepted ISO8601 standard).
Which time zone does this event fall into?
In real life you say “The time zone of the organizer or the person you received the invitation from (i.e. the sender)”, and you are usually able to resolve this, because in real life you at least have a hint what their time zone might be.
As a program, how do you tell – in the absence of any TZ information?
Which TZ do you pick?
Is it fair to assume that then sender has the same TZ as you (the receiver) has?

Or should you just shoot programmers who do not include TZ information in their events?
Or is it the standard ? ISO8601 allows for empty TZ information and simply declares those as being "local". Local to what?

The voting is open ... :-)

Tuesday, March 14, 2006

online music, its price & DRM

Isn't the problem of music download rather in the old business model of the recording industry?

Their model was built on charging for the media, i.e. the carrier of the (copyright protected) song/music. If you bought the same song a second time (e.g. on a sampler LP, or you broke the record and had to buy it again), did they step up to you and said, “No wait, you already paid for that; we'll just take some cent for the vinyl this time”?

Well, they didn't come knocking on my door.

Quite the contrary, by changing from vinyl to CDs, they built an entire industry around charging a second time for the very same content.

Again: The whole business model was built around charging for the physical carrier.

But know, since they lost control over the distribution channel, it's suddenly all about the (protected) rights of the artist and their royalties. (... and they do have a right to receive royalties).
In Austria and Germany (and probably some other countries as well), there was (and still is) a surcharge on each and every blank (!) MC, CD, DVD, ... just because you might copy something on it, that is royalty afflicted. Doesn't that actually imply that I can freely download (or copy) from whatever source, because I already paid some royalty? Or can I then get a refund for the surcharge on the blank CD...

Was there any limitation on a vinyl that kept me from playing “my” (in a DRM sense) record on my friends record player? No.
The only limitation was that I didn't give away my records, I couldn't “share” them. I could only lend them to a friend, and I wanted to get them back – preferably without a scratch.
And, because everything was analog, a copy had less quality than the original.

And this model of sharing formed the base for the average price of a song or LP.
Meaning: the recording industry and the artists knew that some people gave away their LPs, and their friends copied them to MCs... This limited sharing/copying was already calculated into the price of every LP/CD/...

Divide the price of a LP/CD - about 15 US$ for a new release - by the number of tracks it features, say 12.
What do you get (apart from 1.25$) ? The price per track/song.

To me, this is the price per song including the rights to give a copy to friends and/or play it on their player. Because the model is still the same as in the days of vinyl, where it was OK to do so.

So, for a “this-is-the-song-you-may-only-play-it-on-your-MP3/CD-player-and-not-give-it-away-to-friends”-copy of a song, you should pay less, because you are limited in how you use it.

The difference between the average street price per song on a CD (as given above) and the personal-use-only-price has to be the value of sharing that song.

Either that value is small, then what's the industry complaining about?
Or the value is large, then personal-use-no-copy-option-included tracks have to become cheaper... substantially cheaper.

Monday, March 13, 2006

Weird world

So while Google wastes our time with google mars, Microsoft - of all - surprises us with some new (AJAX?) features on search interfaces with live.com:


  • a slider to dynamically de-/increase the level of details
  • a ajax(?) scrollbar... Not sure if this really helps, but you get less dependent on the browser and how it reacts to large lists/documents.
Probably not a major breakthrough; the news is ... it is from Microsoft.

Sunday, March 12, 2006

Microsoft iPod

No, I'm not talking about origami, but about this little piece of video art here at youtube.
Watch it... and learn whats so cool about Apple.

mozdev before coding

You could also call this piece: "Don't re-invent mozdev!"...
and it generally applies to every SW "issue".

Before sitting down and starting a project/hack, check if it does not yet exist.


This very instance of this insight has its origin in me no longer wanting to manually switch the FireFox proxy, whenever I switched from my home directy internet connectivity (wifi+dsl) to the company VPN, where I have to use a proxy.

Actually I wanted to do some little hack to automatically determine, if the VPN was on, and then magically using the company proxy...


...but this here is quite sufficient: the ProxyButton extension.
Gives you a little button on the toolbar to switch from direct to proxy...

Read the FAQ style intro here once you installed it.

PS: if anyone feels the vpn-autodetect-thingy feels worthwhile (or has already been done), just leave a comment...

Saturday, March 04, 2006

The wordprocessor has been replaced

Very interesting (and true) thought by Dan Bricklin on one of the recent Gillmor Gang podcasts:

paper used to be the form we use to publish [...]
The wordprocessor - to most people - has been replaced by the e-mail product.

Somewhere around 60'30, but as usual its worth listening to the whole show.