Tuesday, January 31, 2006

Cost of bad architecture

From a recent discussion with former colleagues of mine:
What are the consequential costs of a bad architecture, a wrong decision, a bad design?
(Design as in Joel's upcoming opus magnum).
About 5 years ago the company (my former employer) had to decide between 2 data models: one (everyone thought) was perfect, one was less costly to implement.
Guess which road they took.
Less costly - or as we now know: cheap(er).

Everyone knew that the other model was better. Everyone said so. In the end, the lesser cost of (the first) implementation ruled out everything else.
Now, 5 years later, we might even have an estimate on the actual cost of this model... every odd workaround, every quirk in other applications necessary, ... We don't have the exact figures, but everyone agrees, that all this (over the last 5 years) turned out probably more then twice as expensive as the "nice" model.
I'm pretty sure we could even prove it (if only anyone was listening).

So the big question for me is: could we have known (or calculated) this upfront ? At the time of the decision?
Not now... now is cheating.
post festum is for wise-guys.

Back Then, upfront, a priori, ante festum... That's what I'm interested in!
Can anyone estimate what a bad design will cost?
The actual cost difference between design A and B over the next - say - 5-10 year?

Sunday, January 29, 2006

Some thoughts on AJAX

Had a conversation with a customer recently on AJAX.
Without telling me what the had AJAX in mind for, they wanted to know whether AJAX would generate more load on the server and network components (firewall, loadbalancers, proxies, etc) than "regular web applications".
The (admittedly very techy) answer was a definite "depends".

That's the funny thing about AJAX: compared to what we could to with plain old JavaScript and HTML (may I just call it POJAH??) the possibilities now seem unlimited.

In the POJAH days, when you wanted to do some server assisted form-validation or (auto-)completion you had to do some magic with hidden frames - yuck. Maybe you wanted to fill in the city based on the ZIP - you simply did not load all possible cities with a JavaScript table in the main document - way too large.
Now this is totally easy, there are 100s of examples around.
Does this increase the server load: NO, because you had the ZIP request anyway - using the hidden frame.
If you do Java on the server, you might start here.

Then again, if you send (almost) each and every JavaScript/DOM onmouseoever event to the server, you bet your firewall admin will call you (and you better hide...)

The major advantage of AJAX - to me - is that you can respond to user interaction without reloading the document (and distracting the user while doing so).

Is that new?
NO.
Is it easier with AJAX than with POJAH?
YES.
How will it affect my server load?
DEPENDS.

Wednesday, January 25, 2006

foXpose

A very cool extension for Firefox: view all tabs at once in the browser window...
check out foXpose here.

Monday, January 23, 2006

Good XML stuff

excellent information and thoughts on XML can be found here.

And it's by someone who really knows what he's talking about ... Tim Bray

Saturday, January 21, 2006

Basic Java FTP

Looking for ways to ftp (put) files in Java, I found the hidden
sun.net.ftp classes which come with the jdk anyway.
Thanks to a javaworld article that can be found here.
It's unsafe to use, and not really documented, but does the job for the most basic ftp tasks - and its part of current Sun JDK distributions. Might obviously vanish in the future. But its still there in 1.5.

Basically you need:
import sun.net.ftp.*;

and then you can magically

String ftpserver ="ftp.foo.bar";
String ftpuser = ...;
String ftppasswd = ...;

FtpClientclient = new FtpClient();
client.openServer(ftpserver);
client.login(ftpuser, ftppasswd);

// client.binary();
// client.cd("/wherever");

OutputStream out = client.put(destfilename);

actually it is a sun.net.TelnetOutputstream, but thats a hidden implementation anyway. So at this point you have an OutputStream and do whatever you want to do with it.

out.write(...);
// etc

to close it, just do a

out.close(); // for the file
client.closeServer(); // for the connection

Some people report problems with it, but it works fine for me.

The beauty of it is, that you work with a regular OutputStream (which you can of coure pass to an OutputStreamWriter to get a Writer), so all the code you have that works on any of those output classes just runs with it... in my case the rome library from java.net to create RSS/Atom feeds.

Tuesday, January 17, 2006

What's wrong with palm? Part II

To not only do palm bashing, I'd just like to say that the WiFi integration in the T|X is a lot (really "a lot") better then the SD card was in the T|5.
It just works, and I don't have to go to the settings application everytime I want to change something (e.g. switch access point).

If only VersaMail would work...

Sunday, January 15, 2006

Generified SwingWorker class

The folks at Sun created a nice little helper class called SwingWorker.
It was designed to help with the pain with Swing and working in threads.
You can find the details here.

There was one problem though, even with Version 3 of the SwingWorker.java: it did not use generics, and therefore promped unchecked warnings everytime I used it, mainly in the get() method, used to synchronize the eventdispatcher thread with the worker thread and retrieve the result of the hard worked that has been done by then. It simply returns an java.lang.Object, which of course was OK (and the only way) before J2SE 1.5

I therefore took the liberty to modify the SwingWorker to now take a type parameter and returns exactly this type.
So it now reads:
  public abstract class SwingWorker<T>

and the get() method now is a
  public T get()

And some other more internal changes...

You can find it here.

Saturday, January 14, 2006

Vienna continues to push open source

As christoph chorherr reports in his blog: in Vienna the governing social democrats just signed a working paper with the greens for 33 projects to tackle during the next 5 year.
Amongst them is one called "Open Mind Center" to push open source projects through stimulation by the city.

So lets hope for more creative projects, beyond wienux (the linux distribution by the IT department of the City of Vienna).

Thursday, January 12, 2006

What's wrong with palm?

I know that Palm (palmOne for a short time) did have a bad reputation when I came to service (and quality).
I, however, never suffered from that - or experienced anything bad.
I lived happily with my palms (V, Vx, T|T, T|5).
My T|5 with the Wifi card died recently when I dropped it to the floor. Actually the T|5 itself continued running smoothly as if nothing had happened; the SD slot however was damaged, so I could no longer use my beloved WiFi card.

I thought it was time to move to the T|X, which is actually a bit of a downgrade.
You loose the "internal" memory card, so you can no longer use it as a USB drive or realplayer.
And you have less memory (128MB instead of 256MB, but I couldn't care less about that).
However, Wifi is built in.
So longer with that stupid card, that always seems to be in the way.
(And looked a bit to nerdy/geeky for me, anyway).

So, transition to the T|X went fine, although this still is a problem with palm: moving from a generation n device to a n+1 device (and maybe changing the hotsync id while you go).
Anyway, managed that, also quite nice.

But the VersaMail that comes with the T|X just sucks.
Lost a couple of keystroke commands (e.g. to switch account) and re-mapped some others (sync IMAP folder used to be /I, now it is /L - what gives??)
But more importantly, it does not delete messages on the server. No matter how hard you try.
(well not quite true, it does delete message from any folder but the inbox... Now most messages I delete while on the move are in the inbox, ...)
A couple of messages on the palm support forum, but no solution for it. And no reaction from palm.

Worst of all: it did work so well with the older VersaMail that came with the T|5...
(and the one I explicitly bought for the T|T...)


Palm, can you hear me ?
Whats wrong with you guys?
Are you to busy working on the windows Treo or what ?

Wednesday, January 11, 2006

Firefox Live Bookmarks

A couple of days ago I finally discovered that Firefox has an RSS/Atom feed "reader" feature called Live Bookmarks.
(At least in 1.5, don't know about earlier releases).


This is - to me - the first time the Mozilla/Firefox guys goofed in a way we were previously only used from Microsoft.

Sorry to say that, but...
a) coining a totally new, random and wrong term like "live bookmarks" for feeds is only misleading.
b) they don't really work - since they only display as bookmarks, they only show the title, ...
no read/unread status, ...
c) you can only (that's why the call it bookmark, I guess) jump to the link given in the item/entry.
... Come on, that's not FF quality.


I was under the impression that the Thunderbird hat the most crappy implementation of feeds (notably totally inconsistent with the remaining Thunderbird look-and-feel and concepts), but this one really goes to Firefox.

Totally useless.

To me.

Well, to correct the above point: it might be useful for your proverbial "mother", who might not grasp the feed concept and is happy with that semi-static bookmark-like approach. But then again, she's not your typical FF user...

Tuesday, January 10, 2006

Google Earth & vCards

Now Google Earth is supposed to allow vCards do be dropped onto it and then jump to the location/address given in the vCard.
It just doesn't.
It takes the vCard and shows it (in "My places") under "temporary places"...
But even when you click it, nothing happens - it just shows a far off place...

Sad. Would have been a wonderful feature.
And would have shown the nature for "Web 2.0" (if you like that term).

Maybe, by not working, it does show the nature of web 2.0...

Saturday, January 07, 2006

XUL preferences in Thunderbird 1.5

While migrating a little thunderbird extension to 1.5 I decided to use the new preferences system introduced by FF/TB 1.5, which is quite good stuff; keeps all the burden from read/wrinting to the preferences file from you (as well as obtaining the services, etc, etc)

However I ran into a little problem with naming the elemens and preferences.
Here's what worked (within a prefpane, within a prefwindow)


<preferences>
<preference id="nflookup.url" name="extensions.nflookup.url" defaultvalue="somedefault" type="string"/>
<preference id="nflookup.domains" name="extensions.nflookup.domains" type="string"/>
</preferences>

and then assign it to the controls as in:

<vbox>
<groupbox>
<caption label="&nflookup.settings.url;"/>
<textbox id="url" preference="nflookup.url" minwidth="350" />
<description control="url">
<html:p>&nflookup.url.help;</html:p>
</description>
</groupbox>

<groupbox>
<caption label="&nflookup.settings.domains;"/>
<textbox id="domains" preference="nflookup.domains" minwidth="350"/>
<description control="domains">
<html:p>&nflookup.domains.help;</html:p>
</description>
</groupbox>
</vbox>


Notice that the preference attribute of the textbox has to match the id attribute of the corresponding preference. Also (and this was my mistake) to not use the same values as in the id (of the textbox), it seems to be the same namespace (which would be quite obvious).
But this one was hard to identify, since there was no visible error, but the preference items just were not read from or written to the preference file. Took me quite some time.

Friday, January 06, 2006

Starting

So I finally decided to do a blog on my thoughts on IT, opensource, mobile, web, etc.
My programming/hacking experiences and pitfalls, etc.

A big sorry to Doug Kaye and the whole team of IT Conversations for the title, I hope he's not offended, but since this blog is intended to conserve (my thoughts, at least)...
I really like what you guys are doing.

What to expect:
  • thoughts (just thoughts)
  • java/perl/mozillla(xul,jscript) experiences
  • openoffice experiences
  • mobile/wap/sms/... ideas

So, without further ado... lets kick things off:

Something totally cool, I found today: newzingo.
What is it?
Let me quote them:
  • NEWZingo is constantly watching Google News for new stories, extracts related "tags" and displays them in a cloud.
  • The cloud below shows the current popular news tags. The bigger the tag, the more stories are about its topic.
  • In one glimpse you can see what the news is about, watch the cloud change as real world events unfold and then forgotten.

check it out here .
(Thanks to John Battelle (great book, btw) for the pointer.)