Even a chimp can write code

Tuesday, August 31, 2004

What I didn't realize about Eclipse until today

I didn't realize that

  • the View Type Hierarchy option in Eclipse not only lists the super types, it also lists the sub types. For some reason, I used the References option to search for sub-classes. Now I feel stupid and awakened.


  • when you copy a chunk of code from one class to another [shut up, you code reuse zealots!], Eclipse intelligently copies over the requisite import statements as well.


  • if you have the JBoss IDE plugin, and have your JBoss application server running with your application deployed, and you have the Build Automatically option checked, and JBoss runs on JDK 1.4.x, then editing and saving a class results in an automatic hot deploy


Very nifty!

Email this | Bookmark this

Saturday, August 28, 2004

Is North really on 'top' of the world?

Earlier this morning I asked Ashley a question on the Dakotas, the answer to which would have been one of 'North' or 'South'. With a mouthful of cereal and the common decency generally afforded only to strangers, she opted not to speak up but instead used her index finger, pointing upwards as if to gesture 'North'.

"I am sorry, I don't get it.", I said half in jest. She chewed for a couple seconds and then replied, "North", while still making that hand gesture.

"Okay... and why is North on 'top' of the world?".

She smiled but didn't answer.

The point I was trying to make was a simple one. Why do people equate the North to be on top and the South to be on the bottom? Is it because of how maps and globes are constructed? Is it because of our inherent bias as denizens of the Northern Hemisphere? I do believe so. And don't Australians take umbrage to the phrase "down under"? I would -- after a couple pitchers of Fosters -- even though I'm not Aussie. Stereotypes like "the stock market is going south" abound in modern parlance. Until a few centuries ago, maps were oriented to the East. Hence the word 'Orient', I daresay. The ancient Arabs and Chinese had maps oriented to the South (for different reasons). The Europeans turned that around and put Europe at the center.

Legend has it that Stuart McArthur of Melbourne, Australia drew his first South-Up map in 1970 when he was 12 years old. His geography teacher later told him to re-do his assignment with the correct way up if he wanted to pass. In 1979 he created and sold the popular 'Universal Corrective Map', the first South-Up map centered on Australia.

Email this | Bookmark this

An open source eVoting solution

Why not? I am amazed at the hubbub surrounding electronic voting in the United States - the most technologically advanced country in the world. Now I have written my share of software and know an insurmountable problem when I see one. But it stupefies me to see all these talking heads on television casting doubts on a voting process that befits the age we live in.

In October 2001, the Australian Capital Region put the Electronic Voting and Counting system to test in a real state election. The eVACS was an open source system running on Linux, subject to public review as well as an independent code audit. India - the world's largest democracy - has ably demonstrated the use of electronic voting machines in more than one election. Recently, the source code for the eVoting software used in Dutch elections was made available to the public.

Hopefully we are slowly getting closer to seeing the hundredth monkey.

Email this | Bookmark this

Monday, August 23, 2004

Java Technology Concept Map

The Java Technology Concept Map can be a good resource for newbie code cutters and whiteboard architects alike. Afterall, we all need a place to start learning Java. And for some of us, a reason.

Email this | Bookmark this

Friday, August 20, 2004

Package sealing

One has frequently encountered a surfeit of protected methods within classes, where there is no need for that level of access. Instance variables inadvertently exposed by a class could be changed by malicious code or even by accident. While the correct approach would be to scan through your code and clean up such occurences (by making them package protected or even private, as the case may be), one can adopt the package sealing feature for added security.

To guarantee that all classes in a package come from the same source code, add an entry like this to the JAR's Manifest file:


Name: org/nerddawg/util/
Sealed: true



The value across the Name header represents the package name (notice the trailing slash). When the classloader needs to load a class from such a sealed package, it recognizes that classes from within that package can only be loaded from that JAR file.

Email this | Bookmark this

Friday, August 13, 2004

BEA and IBM Joint Specifications, anyone?

While the skeptic in me is quick to jump and shout "circumventing the Java Community Process!", I see some value in the new specifications made available royalty-free by BEA and IBM this week. From the lofty goals of the Service Data Objects, to Work Managers and Timers which will solve real world problems of threading, concurrency and scheduling in managed environments, these joint specifications do cover ground. Seemingly the intent is to encourage the developer community to evaluate them and provide feedback before the JCP ratifies them.

That summary probably gave away my bias. That I'd like to have my enterprise code initiate concurrent requests to disparate backend systems without relying on JMS. That I'd like to schedule tasks without doing anything illegal within a container. I am currently reading the 'Timer and Work Manager for Application Servers' specification. My only problem is that I cannot wait until WebSphere 6 or 7 comes out with these features. My problems exist today and I've had to use alternatives I don't particularly fancy.

See this and this from the CommonJ initiative.

Email this | Bookmark this

Thursday, August 05, 2004

The brawl to be the preferred developer database just got muddier

We had recently heard of Microsoft's interest in winning the developer community over by dangling the prospect of a free SQL Server Express as a preferred development database. Now IBM has jumped in and decided to contribute 'Derby', a copy of its current Cloudscape relational database product, to the Apache Software Foundation. Both companies will still hold on to their commercial database products, MS SQL Server and Cloudscape respectively.

I think it is generally accepted that most enterprise products and solutions use relation databases as persistent stores. I have always liked Cloudscape for its simplicity of use and non-imposing nature on my development environment. My main concern has been that my team has had to maintain 2 sets of scripts: one each for the development and Production environments. The advantages of having a development database like Cloudscape are numerous. Its lack of support for stored procedures keeps us honest and away from temptation. Supporting multiple databases meant that our data access code wan't married to any one of them. The new Cloudscape avatar complies with DB2 syntax. Now since DB2 is our relational database for Production systems, this will make script maintenance easier.

It will still be some time before the open source code is made available on the Apache website. Meanwhile, you can download the binaries here.

More on why we don't use MySQL or Postgres later...

Email this | Bookmark this