Wednesday, May 23, 2007

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 retailers (which means that you get no service on-site and all your hardware is sent to Bucharest for service; scary thought for a laptop) or some medium-sized companies. As in Economy 101, when you sell something that's in short supply, what do you do ? Well, of course, you increase prices.

Thus the local companies that do have service on-site have even higher prices than the retailers.

In summary: Price(Timisoara) > Price(Bucharest) > Price(EU) >>>>> Price(US).

To everyone that complains in the US about high Apple/HP prices or some other nonsense like this I have an advice: come to Romania for a while and live the experience :-)

End of trolling / muble-grumble session.

Saturday, May 19, 2007

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 notice this was the default schema. Also, while reading the same FAQ, I just skipped to the part with SQL.

So: if you migrate to Derby, always create an username with the same name as your schema (the one you import).


--
1. I wouldn't actually put Derby on a production server but I feel better during development having the data in a more cross-platform DBMS . Plus, I'm spared of all the security issues MS SQL has (or at least my fear of having those ports open).

2. Yep, sed. I know some XSLT might have been smarter but I'm quite rusty at that and there is no easy xslt shell/script I could use.

Friday, May 11, 2007

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 impossible (ie. multiple build files) so you have to make another script that calls the others.
- make sure junit.jar is in ant's classpath.

But Hudson is impressive. Help messages at each step, SVN integration (with authentication), nice charts.

It could still use some more reports and plugins but I think it has a bright future. I might even write some plugins myself if it gets selected for the build-server.

Monday, May 07, 2007

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. Using the Server Manager is quite easy to add it and it took me about 3 minutes but it was strange. I guess it has something to do with the multi-user settings.
So, wish me luck. I kept wanting to try out SJAS clustering and doing this under Solaris seems the best solution.

The Trouble with Harry time loop

I saw The Trouble with Harry (1955) a while back and it didn't have a big impression on me. But recently I rewatched it and was amazed a...