Friday, February 26, 2010

Learning to rank challenge from Yahoo !

Yahoo ! learning to rank challenge starts this March 1st. It will be exciting to see folks around the world present their innovative ranking algorithms may be i can think of one too :) .
Is this a move to take down the mighty Google Page Rank algorithm and Google as large ?

I think Microsoft will keep an eye on this.

Rin Vs Tide

Aunty q chok gayee ?

In past horlicks going one on one with Complan

Remember Coke against Pepsi ! The era of revolutionary advertising is back !

Income tax benefit for "not so common man" !

Income tax slab for Assessment Year 2010-11

Tax Slab


2009-10 & Early

Up to 1,60,000
Up to 1,90,000 (for women)
Up to 2,40,000 (for resident individual of 65 years or above)



1.6 - 5 Lakhs


1.60 – 3 Lakhs 10%

3 – 5 Lakhs 20%

5 – 8 Lakhs


Above 5 Lakhs 30%

Above 8 Lakhs



What this means is


Old Tax

New Tax


Upto 1.6 Lakhs




2 Lakhs




3 Lakhs




4 Lakhs




5 Lakhs




6 Lakhs




7 Lakhs




8 Lakhs




9 Lakhs




10 Lakhs




In addition to above there would be a surcharge of 10% of the total tax liability is applicable where the total income exceeds 10,00,000 which was there last year also.

Well this is truly this year's budget is a history in terms of a complete walk out of the opposition for the first time in Indian parliamentary history, it also marked a budget when the "not so common man" is benefited.

So where will you spend the extra money ?

Wednesday, February 24, 2010

java.lang.OutOfMemory exception.

I was attempting to run a jar file and then i bumped into java.lang.OutOfMemory exception.

Lets start with some background. As you know every program needs certain amount of memory in heap to run. There are two values known as initial heap size and maximum heal size. In Java 5.0 the initial heap size is set to 1/64th of available physical memory on the machine and the maximum heap size is set to 1/4th of available physical memory.

Now in case you run a program say using java command and run into java.lang.OutOfMemory this simply means that your program needs more heap memory than that is available and you can do that by overriding the initial heap size and maximum heap size. To overiride the initial heap size to say 150 MB you can use java -Xms150000K and to overiride the maximum heap size to say 250 MB you can use java -Xmx250000K. Remember maximum heap size must be set greater than initial heap size or else you see
Error occurred during initialization of VM
Incompatible initial and maximum heap sizes specified

So remember the options Xms and Xmx, these are called non-standard options. For a complete list of non-standard options run java -X

So suppose am running a jar file which had run into an java.lang.OutOfMemory exception. Then i could re-run it as follows
java -Xms150000K -Xmx250000K -jar myJar.jar

Unfortunately, the only way to determine the amount of heap that your program is running is via

// Get current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();

// Get maximum size of heap in bytes. The heap cannot grow beyond this size.
// Any attempt will result in an java.lang.OutOfMemoryException.
long heapMaxSize = Runtime.getRuntime().maxMemory();

Hence one has to keep changing the heap values and run the program until you stop seeing java.lang.OutOfMemoryException. I was able to run my program with initial heap 150MB and and maximum heap of 250MB.

Monday, February 22, 2010

environmental problem

Well, I woke up today and found that my system simply refuse to behave normally. I tried to run ant command from command prompt and Windows spit an error message "ant is not recoginzed as internal or external command", so was the problem with edit, del, copy, shutdown and everything. When i try to ran eclipse i got a message saying "Java is not installed".

I immediately checked the Path environment variable and it was perfect. I double checked all the paths in the Path variable, everything was fine. It had all the paths from system, system32, java and everything. I was wondering then what could the problem be... After a while i renamed the path environmental variable from "Path" to "PATH" and whooosh everything started working as it was.... Finally was able to resolve the environmental problem :)

This all was happening with my Windows XP SP3 box :) Glad that its working again ...

Fn keys problem or a feature.

Had got a new USB keyboard for my laptop (might sound weired), but I needed a separate numeric keypad hence had to get a new keyboard. After few days of plugging in the keyboard and using the num pad, the keyboard on my laptop started to behave weird.

If i press o i used to ket 6,if I pressed p i used to get *. Finally i realized that there was a virtual numeric keypad on my laptop keyboard. i. And the way to switch it on/off was to toggle Fn + NumLck or Fn + ScrLk..... never focussed on those keys till now :)

Well now my new USB keyboard looks obsolete.

Twitter Updates

    follow me on Twitter