Friday, February 26, 2010
Learning to rank challenge from Yahoo !
Rin Vs Tide
Income tax benefit for "not so common man" !
Tax Slab | 2010-11 | 2009-10 & Early |
Up to 1,60,000 | 0 | 0 |
1.6 - 5 Lakhs | 10% | 1.60 – 3 Lakhs 10% 3 – 5 Lakhs 20% |
5 – 8 Lakhs | 20% | Above 5 Lakhs 30% |
Above 8 Lakhs | 30% | 30% |
What this means is
Income | Old Tax | New Tax | Gain |
Upto 1.6 Lakhs | 0 | 0 | 0 |
2 Lakhs | 1,000 | 1000 | 0 |
3 Lakhs | 11,000 | 11,000 | 0 |
4 Lakhs | 31,000 | 21,000 | 10,000 |
5 Lakhs | 51,000 | 31,000 | 20,000 |
6 Lakhs | 81,000 | 51,000 | 30,000 |
7 Lakhs | 1,11,000 | 71,000 | 40,000 |
8 Lakhs | 1,41,000 | 91,000 | 50,000 |
9 Lakhs | 1,71,000 | 1,21,000 | 50,000 |
10 Lakhs | 2,01,000 | 1,51,000 | 50,000 |
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.
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.