Feb 03


Sorry for not posting last week. Had a tight work schedule.

Here is an interesting feature of auto-boxing, which you know, was introduced with Java 5.0 where you could directly assign a primitive to a Wrapper (eg. int value to a Integer wrapper.)

Meaning….something like

Integer a = 10;

Here goes the interesting part of this feature.

Integer a = 10, b = 10 ;
Integer c = 128, d = 128 ;

System.out.println( a == 10 ) ;
System.out.println( a == b ) ;
System.out.println( c == 128 ) ;
System.out.println( c == d ) ;

This is the output for the above snippet

true
true
true
false

Strange Isnt it? ‘a’ and ‘b’ holds the same value. And they are the same. Good. But “c” and “d” also holds the same value but they arent equal !!!

Sun has something as an interesting explanation for this…

“If an int or short number between -128 and 127, let r1 and r2 be the results of any two boxing conversions. It is always the case that r1 == r2.”

It seems that -128 through 127 are cached. God knows why they did this.

Solution :

Use intValue() during unboxed comparisons. The following code would return true.

System.out.println( c.intValue() == d.intValue() ) ;

source: http://java.sun.com

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • description
  • Furl
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis

Tags:

Feb 03

Opera has released its latest version of its browser for mobile phones. The Opera Mini. For a download point your mobile browser to http://mini.opera.com/tv2/.
Or just download the installable to your computer and transfer to your mobile.

opera mini

“Mini doesn’t pull pages directly, but is kind of like a browser-front end, so you can be assured that Opera’s speed and screen-crunching powers will work their magic without you having to download a 4MB JAVA app every time you want to get on the Internet.”

If you are a fanatic Mozilla user, you just need to point your browser to http://www.mozilla.org/projects/minimo/ for the Mozilla Minimo.
minimo

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • description
  • Furl
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis

Tags: , ,

Feb 03

About me

Uncategorized No Comments »

Arun Manivannan. That’s me. Outshine. Outperform. Be an Outcast. ;-) Thats what i wanted to be.

I do Java most of the time. And anything else my day job requires me to. At home, I (mis)use other technologies just for the fun of it.

Just like you, i spend most of my time staring at my monitor. I feel proud that i dont run that buggy OS on my home desktop at least. Falling under the “I-hate-Microsoft-because-its-Microsoft” category, I hate Windows and anything that comes from the Redmond circles. Just blindly I do. Kubuntu just drives me crazy.

My greatest long term goal is to be a committer of at least one single Apache or any Open Source initiative.

Blogging is to me as chilled beer is to a desert wanderer.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • description
  • Furl
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis

Tags:

Feb 03


Sick of your .net applications and would love to have a button that just converts your .net applications to Java? Here is it.

Started in May last year, NET2Java translates any .NET source code to Java source code. It currently supports VisualBasic and C#.

The good news from NET2Java is that it got open-sourced under GPLv2 this month and is currently in the incubator of java.net. There are however, previous stable versions of the project.

“And if you have a friend struggling with .NET, do let them know there is an exit strategy.” ;-)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • description
  • Furl
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis

Tags: ,

Feb 03


“Java’s not worth building in. Nobody uses Java anymore. It’s this big heavyweight ball and chain.” This is what Steve Jobs quotes. Are they planned to run a Enterprise Server on iPhone. I guess Java ME was created just to enable Java to run on lightweight JVMs, especially Mobile phones. Millions and millions of people are downloading Java games everyday. I dont really know which planet Steve Jobs is in.

Ironically, Steve also quotes “iPhone is not meant to be a Smartphone series of phones”. Without Java, it surely wouldn’t be.

Check out the hot comments in http://www.theserverside.com/news/thread.tss?thread_id=43850#225422

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • description
  • Furl
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis

Tags: ,

Give your best to the world.