Saturday, June 30, 2007

Goodbye, Oracle

Well, today seems to be a day of goodbyes.

About six months ago I had wished that we had opted for PostgreSQL as our database backend instead of Oracle, and I'm happy to say that the wish has been granted. Not exactly granted, because moi had a say in pushing for a move away from Oracle and towards Postgres, but I'm not complaining. Our enterprise app has been migrated to PostgreSQL without any hitches. Hibernate and minimal reliance of Oracle-specific features probably contributed a lot to this.

Having worked with Oracle for practically all my professional career, there is an element of bittersweetness about the whole thing (not to mention an erosion of my Oracle skillsets value), but open source is open source, baby.

Goodbye, SUSE

After a long stint with SUSE (and KDE), it's time to bid adieu. openSUSE 10.2 is probably the most bloated and buggy SUSE version I have used till date (for what it's worth, 9.1 was the most solid and polished distro during its time). I am now running Feisty Fawn; I had downloaded 6.10 a while back, and wonder of wonders, it had an option to upgrade to 7.04.

Two things I'm missing in FF are a) its inability to use a higher resolution than 1024x768 (Update: Turns out there is a simple fix for it), and b) the Ubuntu equivalent of Kinternet (I've heard of something called Modem Lights, plan to look into it). But these are more than made up for by Ubuntu's blazing speed and GNOME's simplicity (I know, I have said dirty things about GNOME in the past, but you reach a point in life when you are tired of all the bells and whistles and want to return to Simplicity (tm). Anyway, there was always the nagging but unstated thought at the back of my mind about not staying true to The Unix Way and taking a liking to something like KDE).

Well, talk about irony. I learn the correct way to capitalise openSUSE after I ditch it for good.

Tuesday, June 12, 2007

The helmet controversy

From a letter to The Hindu:
In a democratic society, the view of a majority of two-wheeler riders ought to be the basis for any rule. I am sure most of the two-wheeler riders are not for the compulsory helmet rule. By not wearing a helmet, one does not cause any harm to anyone else. Why should it be forced on the people?
Since I consider most two-wheeler riders to belong to a life form slightly lower than an amoeba, I'd be willing to agree to this sentiment -- I'm all for it if they want to commit harakiri on the streets of Chennai and voluntarily reduce their population, but for the fact that it is not strictly true that they don't harm anybody else by not wearing a helmet. If a helmet-less jerk gets into an accident, he causes more trouble to the other party if he croaks off in said accident than if he suffers only minor injuries.

Friday, June 08, 2007

Swing mini design pattern

I don't know whether this qualifies as a design pattern, but here goes anyway.

You have a Swing MDI application with the main window managing the lifecycles of the child windows. When the user selects a menu option, the corresponding child window should be displayed. But no action should be taken if the menu is selected when the child window is already displayed. We cannot check for the null value of the child window data member (and spawn a new window) because there is no way for the child window to set itself to null when it is closed.

Swing MDI applications where only one instance of a child window should be displayed at any point in time.

Have the main window class implement a callback interface:

public interface CallBackHandler
    public void call(int ID);

public class MainWindow implements CallBackHandler
    //repeat for each child window
    public static final int CHILDWINDOW1 = 1;
    private ChildWindow1 childWindow1;

    public void call(int windowId)
        //repeat for each child window
        if(windowId == CHILDWINDOW1)
            childWindow1 = null;


The child window constructor is passed the main window reference (but is only bound to the CallBackHandler, though nothing would prevent a ctor defined with a parameter of type MainWindow and accessing MainWindow's (public) members).

        //code to invoke child window
        if(childWindow1 == null)
            childWindow1 = new ChildWindow1(this);

public class ChildWindow1
    private CallBackHandler cbh;
    public ChildWindow1(CallBackHandler cbh)
        this.cbh = cbh;
        //code in listener that handles window closing;

Wednesday, June 06, 2007

The Ugly Indian Motorist

As promised. The Ugly Indian Motorist:
  1. Will not take his hand off the horn even when he can see that there is no fricken way for the car ahead of him to move even an inch.

  2. Will think nothing of driving on the right side of the road in order to overtake a vehicle.

  3. While performing the aforementioned overtaking maneuver, will end up blocking the opposite traffic. Everybody sits and cools their heels while UIM sheepishly tries to merge back into his own side of the road.

  4. Is under the impression that all vehicles with horsepower less than his own will have to give way for him even if they are already struggling to cling on to the margin of the road.

  5. Will respond with a blank stare when posed the term "lane discipline".

  6. Ditto for "signal" and "speed limit".

  7. Most probably does not know how to read.

  8. Most probably drives somebody else's vehicle. In other words, is not responsible for its upkeep.

  9. Terrorises hapless vehicles in front of him by revving his massive engine while waiting at the signal (the Big Red Light one needs to stop for, I mean).

  10. Chuckles to himself when he thinks of the stupid bureaucrats who have planned for zebras to cross the road when we all know that zebras live only in Africa. Duh!

  11. Is geeky enough to sport a bumper sticker that says "No place like", but still doesn't know that to turn right, one has to stay in the, um, right lane. On second thoughts, Mr UIM's son in the States probably sent the sticker to dad.

  12. Does things like this.

You could've knocked me down with a feather

Congress meeting authorises Sonia to decide on chief ministerial candidate.

Tuesday, June 05, 2007


I met a traveller from an antique land
Who said: Two vast and trunkless legs of stone
Stand in the desert. Near them on the sand,
Half sunk, a shatter'd visage lies, whose frown
And wrinkled lip and sneer of cold command
Tell that its sculptor well those passions read
Which yet survive, stamp'd on these lifeless things,
The hand that mock'd them and the heart that fed.
And on the pedestal these words appear:
"My name is Ozymandias, king of kings:
Look on my works, ye mighty, and despair!"
Nothing beside remains: round the decay
Of that colossal wreck, boundless and bare,
The lone and level sands stretch far away.

No, this is not turning into a literary blog. Came across this news item, that's all.

What's with Indians and queueing?

Let me qualify that; not Indians in general, but the 'educated', young IT professionals.

There is a coffee counter at the cafeteria at work with three sides from which the vendor can serve customers. Always, and I mean always, my beloved coworkers take up positions on these three sides, not caring about niceties like allowing the vendor to serve others who came before them.

I always make it a point to stand in a queue of sorts, taking care that I don't barge in front of somebody already there. People do cut in front of me, of course, but I limit myself to a dirty look at them and questioning their parentage in my mind. But yesterday I decided to confront one of the jerks, and asked him to join the queue behind me. He did give in to my request, but the look of horror and indignation on the faces of his companions almost made me feel as if I had insulted their mothers.

And to think these are the cream of the shining India, who are powering us into the 21st century.

Tomorrow we will turn our attention to another Ugly Indian, the Ugly Indian Motorist.

Don't you guys have any shame?

As usual, the CWC abdicates all decision-making to the uber-extra-constitutional power.