Sunday, May 20, 2007

Posted an Eclipse bug in Bugzilla

My colleague told me that she was not able view the CONSOLE window in the Java Perspective, even after going through Window-->Show View-->Console and also by pressing the short-cut keys Alt+Shift+Q,C. When we were inspecting that what exactly went wrong, we were not able to bring back the CONSOLE window. It was visible in the Debug Perspective in the same Workspace. We tried creating new Workspace, & there the CONSOLE window was visible. But later we switched back to the older Workspace, the problem still persisted.
So I decided to post this bug to the Bugzilla. It's here.

Monday, May 14, 2007

MVC architecture in Ruby on Rails

Today I came to know that how RoR uses MVC(Model-View-Controller) architecture internally to faster the development of Web Apps. It's really cool.

Monday, April 23, 2007

78th percentile of Nerdiness

I just took this fun test that calculates how nerdy I am as compared to other people. I got the small batch after giving the test, here it is:

   I am nerdier than 78% of all people. Are you nerdier? Click here to find out!

Try it out :-)

Thursday, April 19, 2007

MyEclipse Enterprise Workbench starting error

From last two days, I was facing the problem while starting the MyEclipse Enterprise Workbench, by directly executing the eclipse.exe. It was giving the following error while starting:

Required Java version: 1.4.1. Available 1.3.1_01

So, I was starting the MyEclipse by using the startup.jar. But today I was able to resolve this problem by visiting some MyEclipse forums.

I done the following steps:
1. Right click the shortcut and go to Properties->Shortcut tab.
2. In the Target box, add the following in front of eclipse.exe as:
"eclipse.exe -vm [Java 1.4 or above installation directory]\bin\javaw.exe"

and the problem was solved :-)

Wednesday, March 21, 2007

Running more than one instance of Tomcat Server on the same machine

I came across one of the question in one of the Java forum on ITTOOLBOX which was like this:

Can we run more than one instance of the Tomcat server on the same machine?

I was trying this from two days, and finally I was successful in starting three Tomcat instances on the same machine with different port numbers.

I followed the following steps to do the same:
a. Made three different folders of Tomcat directory.

b. Made changes in the environment variables as CATALINA_HOME1, CATALINA_HOME2, and CATALINA_HOME3.

c. Then I reflected the above changes in the "startup.bat", "shutdown.bat" and "catalina.bat" batch files in each Tomcat "bin" folder accordingly.

d. Then I changed the default port numbers 8005, 8080, and 8009 in server.xml & server-minimal.xml files of second and third Tomcat directories.

e. Now first server was running at port 8080, second one at 8090, and the third one at 8095.

Conclusion:
We can either have the instances running on the same machine (different ports), different machines (same ports) or different machines (different ports).

Friday, March 16, 2007

JavaCompilerTool

javax.tools.JavaCompilerTool
It is a JDK 1.6+ interface that lets the Java program fire up the Java compiler, (usually javac.exe) and compile Java source, all under the program's control, in a platform-independent way.

We can use it to compile code that exists only in RAM. We can generate the source code on the fly, compile it, and execute it.

Please find in some interesting pointers related to JavaCompilerTool:

http://www.javalobby.org/java/forums/m91985882.html
http://www.velocityreviews.com/forums/t318697-javacompilertool.html

Thanks.

Tuesday, March 13, 2007

Does Java supports "Operator Overloading"?

This was the question which aroused in my mind when for the first time I saw the use of String concatenation operator "+" to concatenate two or more Strings.
To get to its root, I read many articles on forums and blogs [e.g. Sun's Forum] and finally came to the following conclusion:


> String concatenation operator "+" is an exception and is just given for the simplicity and it's used internally by the compiler.
> We cannot overload any of the operator at the language level, so this means that Java doesn't support operator overloading.

Please feel free to CORRECT me in case I am going wrong, that would be very kind of you :-).

Monday, March 12, 2007

Immutability of the "String" class in Java

Consider the following code snippet:

----------------------------
String a = "First";
System.out.println(a);
----------------------------

The output is: First
Now, I use the string concatenation operator "+" as:

----------------------------
String a = "First";
a = a + " Second"; //Creates a new String object
System.out.println(a);
----------------------------

The output is: First Second

The string concatenation operator "+" implicitly creates a new String object and the reference to the old one is lost, thus the value of String object cannot be changed after it has been created (i.e. it's Immutable).

Friday, March 9, 2007

Sunday, February 25, 2007

Sun Tech Days 2007...One day event in Pune

Sun Tech Days 2007:: Sun Microsystems organized a three day event in Hyderabad from 21st February. There was a live telecast [through Satelite link] in three cities- Pune, Mumbai and New Delhi of the first day [only for 2:1/2 hours] from Hyderabad. After that there was different live interactive sessions on various topics from Sun's speakers. I attended this one day event in Pune. All the sessions like on Java SE 6 Features, Solaris, Java Persistence API, etc. were extremely knowledgeable. I really missed the three day event of Hyderabad. Thanks to A L L for organizing, managing, conducting such worth sessions.
Also thanks to my friend Neeraj because of whom I came to know about this event.


_________________________________________________________________________________________________________________

"Look at the sky. We are not alone. The whole Universe is friendly to us and conspires only to give the best to those who dream and work."

- Dr. A P J Abdul Kalam
_________________________________________________________________________________________________________________