One thing I miss from KDE

About 6 months back I migrated to Ubuntu from OpenSUSE. I explicitly did not choose Kubunut as I did not really like KDE 4. It actually sucked! Before that my default window manager was always KDE and I thought about GNOME being lame. But not anymore!

There were a number of things that I missed from KDE most of which had alternatives in GNOME. But I still miss the cool feature of KDE where you could just open the "Run Dialogue" (Alt + F2) and use it as a simple calculator. You could say type "2*2" and press enter. It would do the calculation and show you the output instead of starting any application.

Havent found an alternative to that yet in GNOME!

Common we are in 2009! Use an IDE!!

I have seen a number of people using a naming convention of prefixing letter 'I' to names of any interfaces in Java like IHuman, IMonster. This was a very famous and essential practice about a couple of decades ago (I believe. Not that I am soo old!) I remember reading about prefixes like "lpstr" indicating that it is a "Long Pointer to the String". But all this was followed in C and C++. It was important at that time since the languages were not type safe and there were no mature IDE's. It would be easier to recognize that this pointer is to this this type of variable etc. which would prevent a lot of silly mistakes too. Seems like a few people with inclination towards Microsoft standards in .Net still like it and recommend it.

Personally I think we are in year 2009, I use IDE (Eclipse) for development and I have never needed to really see 'I' prefixed to an interface. It adds very less value. Only thing you can accidently end up doing is say do new Interface(); but your IDE will complain the very next moment anyway. I can always see what methods I can call by simply typing '.' In case I have any doubts. I generally use F4 to see hierarchy which will clearly show me that it is an Interface by coloring it purlple or I would directly F3 to get into code to see whats there.

People who still follow this beautiful practice, I am sorry but I absolutely hate it! for others, keep your Alt + Shift + R ready ;)

Environmental variables, Maven and Eclipse

If you use m2eclipse for building Maven projects in Eclipse, there are some issues while building projects having variables defined which refer Environmental Variables.

<properties>
<appserver.home>${env.APPSERVER_HOME}</appserver.home>
</properties>


Some of our developers came out with an idea of replacing the value locally to point to the directory on their machine like


<properties>
<appserver.home>/home/developer/software/appserver/</appserver.home>
</properties>


This lead to numerous incidents where developers checked in the hard coded path for this variable in our code repository, which lead to failed builds on our Hudson.

A better way to manage this is using profiles. You can create a profile in your settings.xml which resides under .m2 directory in your home directory on Linux (not sure where on Windows). Example profile configuration is as follows,


<profiles>
<profile>
<id>eclipse</id>
<properties>
<appserver.home>/home/developer/software/appserver</appserver.home>
</properties>
</profile>
</profiles>


Now you have a profile named eclipse which points to the absolute path for the varialbe appserver.home.

Now checking out / importing a maven project you can specify profile as eclipse. Or in an already checked out Maven project (note that the project needs to be checked out as Maven Project. Same thing will not work on simple java projects even if they use maven), go to project properties -> Maven and set the profile to "eclipse" (the same as id parameter in your settings.xml)

Now what this does is when you make build from eclipse, it uses the profile "eclipse" and resolves the variable to the right value. Advantage of this approach is that you do not need to change pom.xml of the project so it avoids the problem of checking in the hard coded values by mistake.

Spell check under Openoffice

Are you unable to do auto spell check in the OpenOffice applications? To make it work, you need to go to the application (oowriter, oocalc etc) menu, go to Tools -> Options -> Language Settings -> Languages and set the "Default language for the documents" to something standard. In my case "English (USA)" just worked fine.

Reliance Netconnect on Ubuntu

I am absolutely delighted as I write this post. I am using Reliance Netconnect on my Ubunut 9.04.

And if you are under impression that it was achieved after hours of googling, trial and error and after running hundreds of commands, then you are wrong.

To get it working,
  1. Plug in the dongle.
  2. Wait till the network manager applet menu shows "Auto Mobile Broadband (CDMA) connection"
  3. Best way to make it work is to select the "Auto Mobile Broadband (CDMA) connection" and let it figure out the settings
  4. After step 4, it tries to establish connection but obviously fails since the user and password are not provided
  5. Now, right click on the network manager applet and select edit connections.
  6. Go to "Mobile Broadband" tab
  7. Now there is already a configuration created named "Auto Mobile Broadband (CDMA) connection"
  8. Edit that configuration and add your user name and password.
  9. Now connect like in step 8 by clicking on Network manager applet and selecting the "Auto Mobile Broadband (CDMA) connection"
  10. Enjoy high speed mobile broadband on Ubuntu!
I am sure that same procedure will work with any latest mature Linux distribution. There could be issues bootstrapping the hardware but once its detected, NetworkManager will just work fine.