Tuesday, February 28, 2012

If Rajinikanth was a software engineer... :)

I know that there is no shortage of Rajinikanth jokes, but I couldn't stop myself after reading this post. So here it goes.

If Rajinikanth was a software engineer...
  1. Compilers don’t warn Rajinikanth. Rajinikanth warns compilers.
  2. Rajinikanth writes directly in binary. He then writes the source code as a documentation for other developers.
  3. Rajinikanth can derive private key by just looking at the public key.
  4. All pointers point to Rajinikanth.

Thursday, February 23, 2012

Image URL in XPages using Notes client and browser

In Java Charts, one of the users reported that charts were not visible in Notes client. The charts (images) are basically being generated using the XAgent technique, and you will face the same problem if your image is being generated using XPage.

To understand what exactly is happening lets take help of an example. Say you have XPage with following code snippet which displays an image using javascript formula. (actn005.gif is present in the current database as image resource.)

Saturday, February 11, 2012

Google removes plus sign on new tab button in Chrome 17

Just updated to Google Chrome 17 (to be precise 17.0.963.46 m) and there are some UI enhancements that Google has made, like this one.

Yup, they did away with the + (plus) sign on the new tab button. I kind of liked the plus sign and at first it left me confused, thinking it was a bug (I was not alone). I also couldn't find this in Google's Stable Channel Update for Chrome 17 except in the user comments.

Update 12 Feb 2012: Just found this link which basically suggests that this new look was being planned as early as 27 Sep 2011 in Chromium. It even goes on to suggest how you can get the plus sign on new tab button back.

Calling inner classes and enum from SSJS

While working on RSS Reader custom control for OpenNTF I had got stuck when trying to use enums. Basically I wanted to call the enum Proxy.Type to create instance of Proxy class. In Java you would write the code some thing like this:

But to write the same code in SSJS you need to concatenate the class and enum with $ (dollar) symbol. So your SSJS code would be:

The same goes when you are dealing with nested / inner classes. But why use the dollar symbol? I am not sure of the exact reason, but when a Java class with inner class or enum is compiled it generates two class files - one for outer and one for nested. For e.g.

The above class would generate class files as OuterClass.class and OuterClass$InnerClass.class.

Friday, February 3, 2012

Never update agent properties using web helper agents

Well... had a hard day today. But I have only myself to blame.

We had 100+ databases which were recently moved to a new server. So we had to update the "Run on" property of the agent to the new server. That can't be difficult! Just write a helper agent that will update all those agents using the ServerName property of NotesAgent class. I did just that, made it a little bit generic by adding configurable parameters. As their were a lot of databases to be updated I decided to run this agent on the server using the OpenAgent URL command. BIG MISTAKE!