Skip to main content


Showing posts from 2007

The opensource bureaucracy

I always thought that only post-communist countries like mine can be bureaucratic and not capitalist, civilized countries or the meritocratic internet.

But one may be shocked to notice the kind of bureaucracy open source brings. In a normal "distributed" project where you don't have a sugar-daddy to pay for all the project hosting and other expenses, you need to get some free hosting.

This is the first place where you need to get an approval for your hosting, depending on what you do (you can't expect to have any project approved) or what license you use (you get the free hosting if you give your work under their preferred terms).

And the more "free" stuff you need (like build servers, wikis, email lists) the more you have to wait, accept rules and abide by them. But generally, wait and read a lot of strange disclaimers and terms and conditions.

Don't get me started when you get to the licensing part. Do you want your code into some high-profile codebase ? …

I really like Java's tooling

There, I've said it.

Really, Java has great developer tools.

Long ago I liked to experiment with a lot of different programming languages (I own Many languages got things right from the beginning while Java with the C++ inheritance is really, really verbose. Nowadays I mostly play with Python, Javascript (and studying Erlang).

But what Java lacks in succinctness compensates in tools. Big, juicy, gooey tools.

First, a bow to the JVM. It's such a nice feeling to develop on OSX and only test rarely on Windows and have everything work !

Second, I really like my NetBeans IDE with my debugger and trusty profiler. Problem with the EJB: bam! add --debug to Glassfish and connect from the IDE. Possible performance problems? kpow! attach the profiler to the application and see what's the problem.

Wanna see the health of your code: put a whole bunch of reports in maven and build your site (findbugs, pmd, taglist, checkstyle, all good stuff).

And if you feel in a coding mood, why do…

Java 6 meet Linux on MacBook Pro

It seems there's no Java 6 in the new OSX Leopard from Apple.

I mean, it's not like it's been almost 11 months since SUN released Java 6 on Linux, Solaris and Windows. And I bet it's more than an year since Apple started getting code for Java 6 from SUN in order to customize it in due time.

But I guess the iPhone and transparent menu is far too important to actually put some developers work on Java.

It's bad enough that they are supposed to force down on my throat a new OS release for a new JDK version -- I just want Java 6 on Tiger thank you very much. But now, they are delaying even that !

So, I'm thinking that in the future I'll probably go back to Linux and stay there. I thought proprietary Microsoft software is bad; well, I'm starting to believe maybe proprietary Apple software is just as bad (only prettier).

Hence, the first step is to get Linux working and see the hardware support. Because if it's not good enough I might just go for a Thinkpad.


Coupon or negative numbers' marketing

I've noticed a little trend in TV commercials nowadays in Romania and it also applies to computing: new commercials or new advertisements always underline the negative number, the "user gain". Stay with me...

So, you want a new car ? Well, our car is the best: it's 1000 euro "buyer (bar)gain".

Want to be subscribed to our useless service ? How could you refuse: the first month is free!

Why don't you migrate to the new version: it's 10% faster !

Want to take a 20 year long mortgage for 100K euro ? We are the best: we give you 4K euro for free.

As you noticed, all these advertisements avoid the real issue. They avoid, the actual price (or actual speed, actual time to completion, etc).

All they brag about is that you get this discount or that super-offer. But they don't even bother to tell you the actual cost anymore.

I mean, in their mind, getting anything for free should be reason enough for people to buy their product. Makes sense to me... NOT.

My opini…

New NetBeans Platform-based tool

I just noticed on my RSS feeds some talk about VisualVM so I went and downloaded it.

First, by the screenshots alone it was clear to me it's a NetBeans Platform application. Also, the charts look awfully like the NetBeans Profiler ones. Well, lo an behold, it is a simple Platform application holding the profiler cluster.

What's annoying me is that the profiling part only works with Java 6 (not available on OSX). But the NetBeans Profiler does work with Java 5 if we just configure the proper agent. I would have been nice for VisualVM to also use the agent as not everyone is using Java 6.

Second, the OSX integration is less than stellar (it's the 1st release so I'll excuse them). The menu doesn't show up on the apple menubar the 1st time you run the tool (but on subsequent runs it does, strangely). Also, no launcher like in the IDE.

Oh, forgot to mention it uses the NetBeans Platform from NetBeans 6. Looking good guys.

(Maven) Building to a ramdrive

I own a MacBook Pro and I have a few projects with Maven (and MevenIDE on NetBeans).

What's annoying me with the build system is that it usually writes a lot to the disk. Not only is that quite unnecessary (as the files will be overridden in no time) but the laptop hard-disk is also quite slow and all this writing is trashing it.

The solution: write to a ramdrive ! As you all know, a ramdrive is a "virtual" hard-disk that sits in your RAM and goes away when you shutdown the machine (not that I care, the build files are temporary).

First step: create the ramdisk

There are some utilities that do this, but it's quite doable from the terminal (eventually with a shellscript).

First, get your disksize in MB and multiply it by 2048. So 256MB means 524288.Next, create the device: hdik -nomount ram://524288 The command will also display the name of the new device file.Create a HFS filesystem in there: newfs_hfs -v "disk name"/dev/diskXXX , where diskXXX is whatever the …

Power-efficient CPU a non-issue ?

I find it interesting nowadays that CPU builders, and Intel in particular keep bragging about their power-efficient CPUs. It's like, this is getting more important than speed or number of cores.

My point is: who cares about that ? I want my CPU to be fast first, eventually have multiple cores and some fast way to talk with my memory. It would be nice to also consume little power, but that's a nice touch so to speak.

I assume 90% of the CPU buyers don't have server farms to worry about their electrical bill so why induce this trend ?

I think the solutions is clear: Intel / AMD cannot increase speed easily anymore. Therefore they are convincing consumers that this is what's important about a CPU: power consumption. The result: you see all kinds of uninformed users wondering how much the CPU consumes as if they would see the difference.

I don't want my CPU to consume less than my graphics card or my hard-drive. I'm buying it to work so I expect it to take some power. …

I saw Vista for the first time yesterday

Yesterday a neighbour of mine bought a new computer. It was a decent-ish desktop (3.0Ghz with HT, 1G Ram, 300G HDD, 19" LCD, 5.1 speaker system) but way overpriced. Could have bought an iMac probably with those money.

Anyhow, since I'm the computer guy in the building, they came to me to get it started. First, because they had no sound. Also, because they have a speaker system with 5 or so satellites and only a 2 way sound card.

And this is how I saw Windows Vista for the 1st time. I was really weird as I haven't used any Windows in a while but Vista made me even more uneasy as I just couldn't find the settings I was used to in the XP-using days.

So, fast-forward 1 hours or so after I've installed the sound drivers. The strange thing was that the system was rather slow and unresponsive, especially while installing stuff. I mean, this is better than any machine I own so I expected it to fly. But no, it was just about as slow as my iBook G4.

About those accept/deny dial…

Maven projects with NetBeans IDE (Part 1)

(This article is on google docs too).
IntroductionI'll present here how to use Maven projects with NetBeans IDE via the MevenIDE project. Since the emphasis is on Maven and Maven-support, I'll just play the devil's advocate and try to focus on most of Maven's features while also underlining ant's flaws.
As always, the answer is somewhere in the middle. There are cases where ant is preferred to Maven and some when it's the other way around.
The build systemAll NetBeans projects are ant-based. Ant is a very useful tool due to the cross-platform and usually easy to write build-scripts. But these scripts to compile, generate, build and deploy the projects usually endup being quite complex.
They are so complex sometimes that they represent basically another part of the project. They are also non-standard for each project (especially legacy free-form projects).
Now, using the IDE, we have some pre-cooked scripts and special ant-tasks. But your build-system is rather tied …

I feel like Windows98 again

I've been having some Windows98 flashbacks ever since I'm using Ubuntu 6.06 on a Dell C840.

There are various reasons: resume kills the sound system, sometimes the ethernet and once in a while corrupts the video (easily fixed by ctrl+alt+F1 ctr+alt+F7). The expected hardware support problems under Linux.

Since I've installed Google Desktop Linux I also had for a while sudden Firefox crashes (fixed by disabling their extension). Boy was that fun ! Not to mention Firefox 1.5 doesn't save the session (make sure to install the SessionSaver extension).

The latest culprit is Usually it works ok, but then you have the random crash. It's nice to have a Crash Recovery dialog and all, but I would rather not see that as often. It also has the tendency (usually after some crash recovery) to not start at all. You just click on and odt file and wait... and wait.. and nothing. You click again: and wait ...

The solution is usually a restart (so un-linuxy).

But, all in a…

Google Desktop for Linux crashes Firefox 1.5 on Ubuntu 6.06 (Dapper Drake)

I've installed Google Desktop Linux on my Ubuntu 6.06 system and found that Firefox crashes a lot ! And by a lot I mean I couldn't even google for advice ;)

Basically after some log hunting I found out the cause is quite simple: the Google Desktop for Firefox extension is broken.

Just go to Tools->Extensions,right-click Google Desktop Firefox and select Disable.

That seems to be it ! Happy google indexing.

I recommend you also comment on the bug-report here (posted on Ubuntu's

Maven and NetBeans (Platform)

As most of you know, the build system in the NetBeans IDE is entirely ANT-centric. That is, every project has a generated build.xml behind the scenes and every action (compile, run) is an ant target actually.

But, of course, you can't please everyone. Using ANT as a backend means that, of course, you need some custom ant targets to make the IDE-integration better. Thus, you're not 100% independent of NetBeans, you still need those custom tasks (some JARs basically) and the core ant scripts.

Using ANT also means some overhead for each action.

But the most nasty stuff in my projects are the 3rd party JARs. Most projects use some outside blobs. Normally, you can have the JARs in SVN and NetBeans will take care of this quite nicely (using relative paths).

But what happens if you decide not to include those JARs in the SVN ? Well, you enter a world of tweaking of .properties files and custom ant tasks to re-populate those properties files. It's not pretty and error-prone in a distr…

Gnome Typing Break

As I've said in an older post, I wasn't that impressed with the latest Ubuntu but I also couldn't install OpenSolaris on a laptop. So I installed Ubuntu 6.06 LTS, which seems to work quite nicely. I even has suspend to RAM working (though it breaks the sound afterwards).

One nice feature Gnome has that I didn't know of it is Typing Break, found in System -> Preferences -> Keyboard.

It basically forces you to take a break after a period of time. Gets useful after you start getting some hand-aches. During the break you see something like this:

It takes a bit of discipline to actually respect the breaks (especially when something is urgent and you have the "Postpone" button -- which should be renamed to Snooze). Then again, even if I disable the postpone button I might be tempted to Ctrl+Alt+Backspace or Ctrl+Alt+F1, login then kill process.

I'm also looking at some exotic and ergo- keyboards lately. Anyone has something to recommend ?

I would really like s…

Pro NetBeans IDE 5.5 Enterprise Edition Review

Adam Myatt's "Pro NetBeans IDE 5.5 Enterprise Edition" could be quite well an introductory course to Enterprise programming in general and especially a good book for NetBeans IDE (future) users in particular.

It's quite decent for a novice programmer because it consists of small tutorials and introductions in all the different technologies that the NetBeans IDE supports. It gives you the starting point in your endeavor. It's most needed for an introductory course in any Enterprise since it touches a lot of important points like unit-test, good javadoc, version control, build system (ant-centric, like the IDE) and more.

Since it covers that many topics there isn't actually enough space to go too deep into any of the subjects. The spotlight is after all on the NetBeans IDE and the features it has. This is quite a shame since there were some unique things that could have been discussed more upon: Jackpot refactorings made me really curious...

It's also nice to …

There is truth

There is truth, my boy. But the doctrine you desire, absolute, perfect dogma that alone provides wisdom, does not exist. Nor should you long for a perfect doctrine, my friend. Rather, you should long for the perfection of yourself. The deity is within you, not in ideas and books. Truth is lived, not taught.
Herman Hesse, The Glass Bead Game

OpenOffice and Java take 2

Hm, I just got this morning the weekly NetBeans newsletter and it had this part:

Netbeans Plugin for Development Sun's engineering team has developed a plug-in for building extensions. It is an easy to use set of wizards to create extensions that can be used to integrate new functionality, adopt existing functionality, and create Java applications that can remotely control Everything is ready for you to start implementing extensions, including a Java code skeleton. So, SUN is still supporting this. Maybe I'll take a look at this new plugin and see how it feels.

Is OpenOffice too late with the Java-bindings ?

I remember my first "important" job at my previous employer was to maintain some in-house Office-based application. Nothing like Excel and VBA to ruin your day ! Well, I was a rookie so I couldn't refuse but it was a depressing experience.

For some time now (I remember I was running some samples last year), OpenOffice has some nice Java bindings (or API). Now, this is all great, but the actual code looks quite arcane.

What troubles me is this: why was OpenOffice so late with this move ? I mean, most programmers don't want to live inside Excel and Visual Basic so if you have a choice, you move a simple dedicated "application" from Excel + VBA to OpenOffice + Java.

I guess it's obvious Java is a better choice (than VB) for most programmers (it would have been for me) and the final product would have been better in so many ways:
More happy programmers that they don't have to use VB or (oh, the horror), maintain VBA.A decent codebase for your initial small…

Euro ripoff (aka The gold you have to pay for pretty glass in Romania / Timisoara)

Ever since the dollar took a nose dive against the Euro I always drooled at the nice prices the US seems to have. Why ? Because most sellers in the EU (and Romania) make a really 1:1 conversion. This means that if something is about 1000 USD in the US it will be about 1000 EUR in EU (although this means about 1300 USD - 30% increase! ).

Now, on the other side of the spectrum sits Romania. Since we basically have no market-culture and we are still in some sort of Wild-wild-west kind of economy, the prices here are even higher than in the EU. So, there you are: probably in the poorest country among the EU ones, and you have the biggest prices for computers.

That would be one thing but there's more: you basically can't find decent brand workstations (powerfull desktops) and if you do, your best chance is if you live in Bucharest, the capital. And Bucharest is way in the east compared to Timisoara, and quite-ugly as a city might I add ;-)

So, outside Bucharest you only have the major…

Migrating to Derby (JavaDB) with schema

I went to a lot of trouble lately trying to migrate a database from MS SQL Server to Derby (aka JavaDB) [1]. I've used the DDLUtils ant tasks to export-import the database.

The major issue was that in my previous database we used a given schema and that schema wasn't recreated now by DDLUtils. I've tried tweaking the ant task parameters but still nothing. I even done some quick sed scripts [2] to add the schema myself (rename tables from "oldname" to "schema.oldname" basically). But all this meant nothing. Plus that the database was 100MB+ and import time was well over an hour so I couldn't actually try a lot of times.

The solution resided in the Derby FAQ but it wasn't until someone from the mailing list pointed it to me that it struck me:
The current schema for any connection defaults to a schema corresponding to the user name.You see, I was creating the database beforehand with some random user like "admin". I didn't no…

Building is fun with Hudson

I've used last year Cruise Control and really liked the feeling a continuous integration and build system gives you. There you have a central place to see the health of the project (unit tests), linked to the VCS and a build server.

This year, I've re-evaluated Continuum and Cruise Control and found out that I still had to work with some XML files to make it work. Plus, notification is exceptionally hard to get right.

So, everything was paused until I found Hudson. It's a web-application (like the other two), quite new and active (unlike the other two).

It has the best out-of-the-box experience. Just deploy the WAR and configure your project. Continuum comes close here with Cruise Control third.

Since NetBeans already generates proper ant targets for everything including tests, I just need to configure what ant task to run, which are the build artifacts and where to get the junit results from.

Of course, I did stumble on some problems:
- Running multiple ant targets it's imp…

Still in OS land: OpenSolaris

After Ubuntu, I said I could give a chance to (Open)Solaris. I do remember Solaris from the Sparc stations we had at the University and I keep on reading about ZFS and dtrace, but I never actually used it much.

So I just went and downloaded the DVD, burned it then installed Solaris with no fuss on top of the previous Ubuntu partition. Rebooted the system and it all worked! Even had an option to switch between Gnome and CDE -- well that brings back memories...

First, OpenSolaris (Developer version) really seems a Java programmer's kit: I get NetBeans 5.5 with Sun Java Application Server. Even the installer seems Java. Plus, I have Firefox, Thunderbird and a Terminal: that about covers most of the stuff you actually need while working. Sadly, no movie player like Xine or VLC.

Of course, there was some strangeness:
it also installs Sun One Studio which seems redundant with NetBeans but I didn't actually try it.even if we do have SJAS installed, it doesn't show up in NetBeans. Usi…

Ubuntu 7.04 over-hyped

I've used Linux under some form or another for some time (I think 7 years or so). Started with some SUSE then found out RedHat and switched to Ubuntu when Fedora turned out to be a mess.

Since I'm a little stuck on Windows for the programming part I use nowadays mostly Windows (2000/XP) and OSX.

Ok, so I saw all the hype about Ubuntu 7.04 and downloaded the torrent. Let's say I wasn't impressed.

I used a lot at my previous job Ubuntu on a T60 Thinkpad so I knew how it should feel. This new release was about the same plus a fancy-er splash screen.

Even more, the Live-CD detected my NVidiaQuadroNVS graphics card and installed the driver for it. Thus I could enable "Desktop Effects" and look at the wobbly window (then disable it immediately).

Ok, so I've installed 7.04. The first surprise: it didn't boot-up ! I mean, it did, but in text mode.

You know why ? The XOrg configuration still had the reference to the nvidia driver but the installer didn't actuall…

NetBeans Platform: CallbackSystemAction sync madness

An annoying problem I had this week involved the CallbackSystemAction class.

Basically the general ideea of this type of action is this: you have the Action implementation, but the "#actionPerformed code" is deferred.

What was my problem: depending on the user selection in an explorer, my action was supposed to become enabled or not (plus some othe conditions).

So, the javadoc says that way to do it is by setting an action in the ActionMap of the TopComponent.

TopComponent tc = ...;
javax.swing.Action yourCopyAction = ...; // the action to invoke instead of Copy

CopyAction globalCopyAction = SystemAction.get (CopyAction.class);
Object key = globalCopyAction.getActionMapKey(); // key is a special value defined by all CallbackSystemActions

// and finally:
tc.getActionMap ().put (key, yourCopyAction);

The problem is that there is no listener on the action map. So if I want later to disable my action and I do a tc.getActionMap().remove(key) -- it won't work ! I mean, it will work if …

NetBeans Platform: Combobox in property editor

Happy new year everyone !

I'm going to talk today about something simple GUI-wise but quite a lot asked on the mailing lists: how does one display a combobox in the property editor ? Actually, how does one use an editor that displays a combobox.

What should get you started with this task (and other editor customizing) is a little file from the Platform javadoc.

This is what we plan to get:

In order to do this note the Custom parameters in core editors paragraph from the above link and the fact that for java.lang.Integer properties there are some custom keys we can use:
stringKeys - an array of strings to be present in the comboboxintValues - an array of integers representing the values of the selection in the combobox.So something like this:

Node.Property p=new YourProperty(Integer.class);
p.setValue("intValues",new int[]{1,2,3,4});
p.setValue("stringKeys",new String[]{"One","Two","Three","Four"});

is all you need.

Note: Please tak…