If you are wondering what happened after March 2005, well, Null Pointer moved to its own home. Please do follow me there.

Friday, October 31, 2003

Holly-Bolly ke bahane


Watching the closing credit title of a Hollywood movie makes me appreciate their dedication to the art. All people who put in their effort seem to get the due credit; so one is not surprised to see the credit for the "Teenager at the disco" or "The fifth waiter" or the "lady at street corner". Many of the credit titles are very funny and many very artistic. On the contrast the Bollywood1 flicks seem to concentrate on the opening credit and by the time the movie reaches finale, by which time half of the janata2 already gallops for the exit gates, the director himself seem to loose his interest in his movie (so typical of David Dhawan). What you get at the end of the movie is just a replay of a happy-go-lucky song from the movie with the credits running insipidly along side acknowleding the efforts put in by the film financer, friendly-neighbourhood banker and the superstar who did that 2-second obliging sequence. You can't even expect the decency from the producers to express their gratitude for the numerous technicians who put in their effort including those stuntmen who are at far greater risk doing stunts here compared to their Hollywood counterparts, who apart from the insurance factor get the advantage of all the safety-precautions technology can provide while performing a stunt.



To me this is a display of the typical Indian mindset, first: we embark on a work but we do not finish it with the same vigour, we even go the extent of losing interest by the end. Second: we don't give a damn about people who helped us in our work, all our glory is due to us, we tend to forget those on whose shoulders we stand. Thirdly: only our life is important and other's a thing to waste. Isn't this ethos visible in all walks of Indian life? We tell our illetrate chowkidaar3 to change our broken fuse fearing we would get an electrical shock if we did it on our own, we tell our 8 year old girl-servent to babysit and carry our baby all day long, we savor all the delicacies on the festivities with our well-fed neighbours forgetting the safai-wala who cleaned your house to sparkles for the occassion. This may sound melodramatic but we just need to peep inside our own proverbial girehbaan.


1 The common term for the Indian Hindi film industry 2 Hindi for public 3 Hindi for watchman 4 Urdu for collar

Thursday, October 23, 2003

Much ado about CAFEBABE


I was going through the documentation of BCEL and started wondering how come the magic-number in the Java class file 0xCAFEBABE looks so meaningful. While the original purpose for specifying the begining four bytes of Java class files is to assist in segregating prbable class files from non class files the the choice lets one ponder on whether it was just inadvertant or an easter egg. Googleing on the origin of the word lead me to some interesting discussions of the past in Java circles.


The most convincing rationale is perhaps at Doug Landauer's blog where he mentions that the term originated in 1989 from the name for an erstwhile C++ compiler CAFE (C++, A Front End) and the suffix BABE came from the cafe product manager Kim Polese's name who was "described" by people as "babe". Another opinion says "0xcafebabe is also the constant value at the start of mach-o files. mach-o is the binary format for native Mac OS X libraries and applications. " Few other interesting comments at artima are worth mentioning here:



.. they presumably had to pick something as their magic number to identify class files, and there's a limit to how many Java or coffee related words you can come up with using just the letters A-F :-)


..my guess is that (a) 32-bit magic numbers are easier to handle and more likely to be unique, and (b) the Java team wanted something with the Java-coffee metaphor, and since there's no 'J' or 'V' in hexadecimal, settled for something with CAFE in it. I guess they figured "CAFE BABE" was sexier than something like "A FAB CAFE" or "CAFE FACE", and definitely didn't like the implications of "CAFE A FAD" (or worse, "A BAD CAFE").


..they *could* have used the number 12648430, if you choose to read the hex zeros as the letter 'O'. That gives you 0xC0FFEE, or 0x00C0FFEE to specify all 32 bits. OO COFFEE? Object Oriented, of course..

Wednesday, October 22, 2003

My posts on JDJ/Ciol


One of my post made under technology catgeory has been featured by the portal Ciol. The article is available here. Another recent post of mine on Code Analyzers has made been mentioned in Eric's Pulse of 20th October and has been published in the Java Developers Journal Industry journal available here. Thanks Eric :), thanks Ciol.

DateTime and other problems


Bloglet subscribers to my feed may not be getting my posts in their email for about a week now. The problem seems to have surfaced after some changes made in the JRoller RSS feed XML format. Bloglet now throws an error "'String was not recognized as a valid DateTime" for JRoller feeds. Monsur of bloglet wrote in reply to my mail:


Bloglet is rejecting RSS feeds with dates in the following format: "Tue, 21 Oct 2003 24:56:21 -0500". Its probably a good idea to change your date to adhere to the XML-RPC spec, found here. We have registered it as an outstanding issue though.

Incidently I was playing with this taglibrary for parsing RSS XML and I had to make some change to the classes so that the permalink to the posts (guid instead of expected link element) are recognized properly. I am planning to host this JSP at mycgiserver but it seems they do not allow uploading third party jars there. I am planning to use the JSP to generate the "Recent Posts" panel on my blog. Currently this is being generated by Blogstreet however the RSS Panel tool of Blogstreet is not able to understand the permalinks too and generated the links incorrectly. I am unsure how I would be able to use the JSP unless mycgiserver allows custom tag libraries.

Tuesday, October 21, 2003

An NRI's plea for cleaniness

Through one of my sites on Amitabh Bachchan I keep on receiving occassional feedback. Many of the readers write to me presuming I am in contact with the megastar. Some are ardent fans like me and write essays in his praise. A mail I recently received from one Satpal Mehra, an NRI living in Austria, though it makes the same presumption, is unlike any other fan-letter I ever received. Realising the larger-than-life persona of BigB and the impact he can make, Satpal wrote an emotional letter to him urging him to become a part of this effort to make India clean on the lines of Singapore . Here is the unabridged letter which I reproduce without Satpal's permission, hoping it serves his purpose and that Amitabh, and most importantly us Indians, actually read and absorb it.



AMITJI, INDIA NEEDS YOU


Dear Amitji,


After living over 45 years in europe ( last 35 years in Austria), one becomes more patriotic than when one lives in own country. The words of our President Dr.A.P.J.Abdul Kalam " I HAVE A DREAM " have been haunting and following me like a shadow. His dream is to make India as great and as clean, as any country in the world. His dream is to make India as prosperous and clean as any western country. In the same breath, he had rightly and directly hit Indians and NRIs, who visit or live in Europe, America, Japan and Singapore. In those countries, like in Singapore they behave and even pay a fine for throwing an empty cigarette packet or anything on the road. But as soon as they reach India and instead of setting an example for others, they throw anything on the road. Our president is right, when he means by blaming the government such India born citizens only want to brush away their own responsibility.

Quoting him further - Don't only ask what India & Indian government can do for you, just ask yourself what I can do for India. Apart from our education, national status and pride, we NRIs owe a lot to our Nation. Last month I have started mobilising small groups of NRIs in Europe & America, and friends and relatives in India. We can't help in 100 wrong things, but we have taken up .

Amitji, few months back, I met an old man from Singapore, and he said that in 1945 Singapore was as dirty a city as any other large Asian city. A city counsellor thought of an idea, to put a token fine on people for any kind of littering in public places. Others laughed at him. He said that it was not the fine, which will make people stop littering, but the humiliation of a policeman stopping and telling them, what a wrong thing they were doing. The on-lookers shall be the main factor. He was right In his assessment. Today, Singapore is the cleanest city OF THE WORLD. We have worked out a program, through which retired military & civil officers, as well as active doctors, judges, lawyers, teachers and other people who have eccess to Internet, can build small groups of 2 - 3 persons, and only help to keep 20 to 30 metres of areas ONLY AROUND THEIR OWN PLACES OF RESIDENCES OR WORK: A comprihensive website is being prepared, to explain.

Tamil Nadu has already passed a Law to fine Rs. 100/- anyone for spitting in public places. Other states shall follow the suit. Unless we have some personalities like you, who shall raise their voices against " DIRT, LITTERING & ILLNESSES " our voice shall never reach far enough to eradicate the nasty habit of littering. We shall take the burden of work on our shoulders, but your moral help and guidance shall be our backbone.

Once again, Amitji, I request you to help us to HELP YOUR & OUR BELOVED INDIA.

With a big hope and personal regards,

Sat Pal Mehra


Saturday, October 18, 2003

Bush has a blog

Believe it or not President Bush has a Blog too.

Code Analyzers


During my search for Profilers I stumbled upon some good Java code checkers or Code Analyzers and though most of you may be already aware about them would like to share my thoughts on the same. Please feel free to correct me or add your inputs to this.


Talking of Code Review or Analysis I wonder if soembody would even think about going for the wearisome task of manually locating lapses in use of Proper Syntax, code indentation, unused variables/imports, naming convention and Javadoc comments without using any automated tool to do the task. Apart from the task of deciding about what code optimizations need be done or detecting any logical blunder rest can perhaps be safely left to these tools. Moreover more ambitious programmers can even look for these tools to operate in tight integration with their favorite IDEs. Fortunately my favorite Netbeans has many modules already available of which three are my peronal favorites : PMD, Jalopy and Checkstyle, perhaps in that order.


All the three have various plugins available for various IDEs. Jalopy is a code formatter and beautifier and is highly configurable using code snippets though it does not comprehend well line spaceing and tabs for files edited by other IDEs say Kawa or Textpad. Checkstyle is more about code formatting and nit-pickingly looks for white spaces, tabs, position of braces and javadocs and configuration is difficult (as far as I know certainly not configurable thorugh Netbeans GUI). Out of these PMD deserves my high regard, here is a synopsis of what it can detect:



  • Unused local variables, parameters and private methods (very useful)

  • Empty catch blocks 

  • Empty 'if' statements 

  • Duplicate import statements 

  • Classes which could be Singletons 

  • Short/long variable and method names


A lesser known but very powerful code checking tool is FindBugs. Too bad it has no plugin available for Nebeans though. While the conclusions of the tool about unread fields is not very accurate, it detects what many others don't such as:



  • Null pointer dereference detector

  • Ignored returns from method

  • Unclosed I/O streams

  • Objecting usage of == or != for String comparison


Here are some other tools:



  • SourceMonitor: Provides size and complexity metrics for your source code.

  • JLint: A Code verifier

  • QStudio also seems pretty good to me. As per their site it is available for download with a year license at no cost.

Using w.bloggar

Arjun had advised me about it and it based on this it seems lowem has taken a plunge too. But can w.bloggar help in posting the same post to two blogs simultaneously? That would be cool. Let me see if it works. As for w.bloggar, well the GUI is cool. Editing Blogger templates would be simpler here. Also facilities like: having your custom toolbar, spell check and formatting support is good.

PS: It seems simultaneous post (Tools > Post to many blogs) is not working properly, atleast for JRoller and Blogger combination. The post is published successfully on Blogger but not on JRoller, however posting individually works in both cases. Another problem: w.bloggar perhaps does not understand the Blogger Title tag. Also a suggestion: Instead of Blog titles the drop down list of all blog accounts in the toolbar should perhaps show the Blog Alias name.

Thursday, October 16, 2003

Javaranch newsletter: October Issue

The October issue of Javaranch newsletter is out. It includes a primer on using the Netbeans IDE and a nice deliberation on the Rowset interface implementations of which would be joining the Tiger (JDK1.5) bandwagon. Being deliberating offlate on the code optimization and performance tuning issues myself I also found the pointer to this thread useful.

Company name etymologies

Did you know that Cisco  is not an acronymn but a short name for San Francisco or that the name LG is infact a combination of two popular Korean brands Lucky and Goldstar or that Mitch Kapor got the name for his company from The Lotus Position or Padmasana. You may find a list of company names with explanation of the origin of their names at Wikipedia?

Wednesday, October 15, 2003

In praise of FeedDemon

Man I love this news aggregator FeedDemon. First of all the GUI is lovely and then the features are exactly what you need: Channel Groups to classify you feeds (and moving channels amongst the group is easy), facility to synchronise your list with an online one or simply use somebody else's subscription list in OPML format, the Group Newspaper with browser integration, auto-discovery and verification of feeds and so on. I must say though I loved Bloglines (being an online tool) but managing the feeds list once it grows beyond 10-15 becomes clumsy there, especially adding a new feed. In my last spell I had tried FeedReader and Blogstreet's Info Aggregator but the hiccup with both was they would not work behind proxy. In the latter case having email links to stories, umm is perhaps not a very pretty idea. For the impatient there is big list of news aggregators here.

Tuesday, October 14, 2003

I am in a movie?

The stardom has finally arrived. Yes I am in a movie! Don't take my word for it. Have a look here. Though I did not have a clue till now apparently the movie Mumbai Matinee has a 32 year old character called Debashish aka Debu played by Rahul Bose. If only other facts about this character (including his surname and profile and characterisation) were ditto as mine. Alas! I missed fame and glory by inches :(.

Monday, October 13, 2003

Collablog and Pebble

Few of my colleagues and I were thinking to have a sort of collaborative blog on our intranet where we could post our daily Tasks, TBD Lists, Reminders etc, a purpose which can't be called blogging perhaps. I was looking for a free Java blogging tool and recalled Pebble. It's a lightweight, personal blogger written as a web application that can run inside standard J2EE web containers. Pebble uses standard technologies such as JSP, Servlets, filters, JSP custom tags, JSTL and JAXP. The installation on Tomcat is fairly simple. Since the blog is collaborative, we wanted multiple users who could post on the blog, so I created few users in the tomcat-users.xml with role blog-contributor. Incidently Pebble needs JDK1.4x and does not work with JDK1.3.


Though we just started using it there were few suggestions which I sent to Simon Brown, who wrote Pebble:



  1. After Login the link to Login probably should become "Logout", infact there is no Logout option in Pebble interface
  2. Option needed to alter post dates/make the post private
  3. The blog main page should refresh when we make a post and close the popup window
  4. After posting we do not get any message that the post has been made (difficult to decipher as the same window remains open).
  5. Email address field missing in comments form.
  6. Facility needed to preview the blog (as user would see it) after we make the posts, because all the editing links are visible at top and there is no way we can logout.

To which Simon replied:


Thanks for the suggestions, I'll certainly be implementing some of them. :-) In addition to my website, I'm also using pebble for collaboration on an intranet, mainly for project news and stuff like that. Again, not "blogging", but it's great that I can use the same concepts and software, just by changing the JSPs.


Don't ask me why I did not go for Roller, probably because I wanted a new interface and secondly I was not looking for too many features. BTW we call this blog Collablog, any other suggestion?

Baby steps onto J2ME

Stepping into using J2ME warrants major alteration in mindset for a programmer so far promenading in J2SE. Experienced J2ME programmers may perhaps enlighten me on this but these are opening remarks as I very recently took on developing applications for mobile devices. You have an array of challenges when you compare it to developing applications for PC. The Screen size is restrained, as are the processing ability and memory of these devices. The challenge is to cope up with the limitations and do not let these dejecting facts reach the user, he must feel the richness of the user interface on the mobile as he does on his desktop, leastways closer to that.


As a developer you feel like being asked to deliver a speech in front of a mammoth crowd with no public address system. You have an abridged class library at your disposal, no reflection, and no finalization. Given that majority of the MIDP devices have less than 100K of dynamic memory available the developer has to be constantly vigilant on the memory his algorithms consume.


On the IDE front it is a solace for a Netbeans user that the IDE has lot many modules available for J2ME developers. However I prefer using KToolbar for building and packaging my application with Netbeans as the Java editor owing to the fact that it is required and that Netbeans doesn't understand the directory structure of applications created by KToolbar, causes problems with the package structure (something wrong here? please do drop a comment). However the present arrangement does not bother me, atleast for now.

Friday, October 10, 2003

Hindi for Blog

What is the most appropriate Hindi word for Blog? Alok calls it chittha. How about Roznamchaa or Vrittant?

Wednesday, October 08, 2003

Israeli attacks: a lesson for India

The recent retaliatory attack on Syrian Islamic Jihad base camps by Israel reveals the true face of America, their doublespeak on the Kashmir issue becoming more poignantly evident. The American hypocrisy lets them pats on the back of Pakistan for its help in fighting terrorism ignoring the terrorist dens right beneath their nose and tells India to exercise restraint, similar is their stand on Syria-Israel confrontation. When it comes to dealing with its own issues there is no stopping the big bully; without any proof of Saddam having WMDs and without caring for UN it attacked Iraq.


Syria has been harboring terrorism the same way as Pakistan providing training facilities, funding and logistical support to terrorist groups such as Hamas. While supporting Israel over the attacks, America has been providing support to terrorist groups and in its attempt to play the role of World Police scolding Syria as it scolds Pakistan now and then. Infact it is open now that when Bill Clinton was trying to broker peace between Israelis and Palestinians, the FBI was secretly funneling money to suspected Hamas figures to see if the militant group would use it for terrorist attacks.


Islamic nations are very worried by the Israeli attack. No wonder that Pakistani Ambassador had called Israel’s attacks a violation of international law. They have their fears and I wish that it came true. Shouldn’t the Israeli attack be cue enough for India to take on the Pakistani training camps in a similar manner? How long can we let the politicians play their diplomatic gimmick of holding olive branches in their hand and urging Pakistan to stop infiltration and terrorist activities while it audaciously continues with its foul game? Let our security forces cross the LOC and raze the enemy once and for all.

Tuesday, October 07, 2003

The Blog Matrix

Rajeev identified an occupying topic from Bloggercon reportage, elitism in blogging. Infact I was giving this a thought while chatting with a fellow blogger few days back and we both marvelled at the volume of blogging being done by Indians and whether it has any impact on others who don't blog. The fact remains that these handful of blogs and the opinions expressed therein could not be representative of the rest of the population for whom (especially in third world countries) ekeing out their daily bread and butter is more significant a matter than discussing the plight of hungry farmers inside AC drawing rooms sporting an original MF Hussain . If 97% of the US population does not blog the Indian scenario can be very well reckoned. Many of my friends are in software profession and majority of them have not even heard of blogging, I can't expect much of others who are seldom online.


When Indian bloggers, many of whom are top-executives of far-famed companies, B-School grads capable of shelving hefty fees and some others who have the luxury of a reasonabley good Internet connectivity, write or refer to each other's post they hardly do so out of empathy. Majority of posts are self-indulging and would fail to make any impact except gratifying the egoboo urge. Blogging is not technolgy alone, it is supposedly a potent platform for exchange of ideas and potential business tool. But blogging certainly cannot be termed as a revolution unless it widens its reach and really delivers on the business front (ever heard of a blogger being paid for his posts). Until blogging qualifies on its commercial viability its social repurcussions can hardly be felt. Till that time the bloggers would continue to make merry in their tiny indivisualistic Matrix of referrers and syndications.

Monday, October 06, 2003

Bush rivals Vajpayee : On Poetic turf

You may scream, you may laugh,
You might even shudder in dismay,
But Atalji now has a new rival,
As Bush becomes a poet while laura was away.

Wednesday, October 01, 2003

NDTV's dilemma

Hindi has been a weak spot at NDTV, the skipper Pronnoy himself knows very little of it and his turks including Rajdeep Sardesai, Arnab Goswami, Barkha Dutt and Abhhigyan Prakash just manage to speak tuti-phuti Hindi only when in dire need. Yet NDTV was in a dilemma to start a lateral Hindi channel when its deal with Star was over. Many news anchors made hay as they hopped from strong Hindi channels like Aaj Tak and now as you look at the state of NDTV India you can gauge that it is precisely not NDTV Bharat. The channel is for the anglicized urban India with absolutely no sarokar with ground situations. With exposure to programme like Jina Issi Ka Naam hai NDTV has these cinema-based shows where the news anchors are actually behaving like actors (remember the item where the pitch dark presenter is playing a double role, disgusting). And there has been little effort to change the style of anchors as well, Punya Prasun still speaks khadi boli the Aaj Tak way, Pankaj Pachori is still blatantly confused, Abhigyan still has that poor Hindi diction.


And it seems the team of Pronnoy, who had shown Indians how a news presenter should be, needs a lesson or two on news presentation. Take the evening newscasts for example. You may start wondering if something is wrong with Dibang's eyesight, or the studio lights are too piercing or is it the teleprompter that's gone wary. A seasoned professional like him who used to flawlessly deliver news at Aaj Tak seems utterly confused, stammering umpteen times, unable to read from the teleprompter and not having any clue what is ahead when he is stuck somewhere. The headlines are mostly are heftily assembled and utterly jumbled up fragments of Hindi. Even the local Hindi tabloids know how to frame a better crispy sentence. The only solace is, thank god, the news reports.


In the race of news channels while Sahara Samay, despite of having an obvious bias, is picking up well perhaps due to the regional approach and people who know the language. With its nodal centres on the pipeline this would be a force to reckon with.


Cumm-on NDTV, we could appreciate that commercial compulsions can lead you to jump on an unknown terrain. But at least with your reputation I expected a better preparation.

World's first Hindi blogzine

I feel elated in presenting Nirantar , World's first Hindi blogzine. It has been the result of untiring efforts of so many Hindi blogger...