Change of address

April 19, 2010

This blog has a new home at While the domain is a work in progress, all future posts will be at the new address.

Your feedback/suggestions are welcome.


Java EE 6: What’s new?

April 13, 2010

Here’s a concise white paper on what’s new with the latest release of Java Enterprise Edition. I recommend reading it.

And here’s a jist of things:

  • Web Profiles – For the light weight web apps where you don’t need a full blown container.
  • Servlet 3.0 – Annotation based, with support for web fragments and asynchronous processing (AJAX just got better).
  • JAX -RS – Restful web services are here.

(read more)

JavaFX: Coming of age

March 31, 2010

When it comes to web pages, I like them plain and simple. Earlier associations of flash and other embedded content with irritating ads and browser crashes makes me cringe when I hear “rich media”. Ajax was refreshing with its unleashing of the hidden powers of CSS and javascript.

But you got to face it. You cannot ignore RIA anymore. If you are going the RIA route, what options do you have?
Flex has been the industry favourite. But again, here’s reasons why (from Adam Bein’s blog) JavaFX is a good option too.

Take a deep dive!

Java Tech Days 2010

March 25, 2010

This being the first tech days post Sun’s acquisition by Oracle,the event started with a keynote from Oracle underlining their commitment to the development of java technologies. Lets jump into the highlights of the last 2 days!

  1. J6EE – This has been the biggest news on the horizon. While J5EE was about cutting the flab in JEE with JPA replacing container managed entity beans, J6EE made the stack much more easier to develop on. The following are the technologies that makes up the Enterprise Edition:
    1. Web Profiles – For the light weight web apps where you don’t need a full blown container.
    2. Servlet 3.0 – Annotation based, with support for web fragments and asynchronous processing (AJAX just got better).
    3. JAX -RS – Restful web services are here.
    4. EJB 3.1 – The business interface are optional now. Also, check out the EJB Lite.
    5. JPA 2.0 – Enhanced JPQL (java persistence query language), metamodel based query support.
    6. Context and Dependency Injection – Standardizes dependency inject in EE applications with seamless lifecycle management of the web beans.
    7. JSF 2.0 – Brings annotation support and templating of facelets.
    8. Bean Validation framework – No more writing validation code in the model. Annotate and forget it.
    9. Connector Architecture 1.6 – Standardizes bidirectional connectivity between the application and Enterprise Information System (EIS).
    10. Packaging Enhancements- Forget the ear files. EJB goes into a single war along with your web apps.
    11. and a lot more!
  2. JDK7 – Modularity and Closures are the buzz words for the new release expected any day. With a lot of new scripting languages out there running on the JVM, Closures does some catching up. Also with the multi language support, you can now pick your favourite from over 200 languages and start coding for the jvm!
  3. Bundles – Bundles is the way to go and that cannot be better emphasized with JDK7 introducing modules as a part of the language. The focus on OSGi and its support in GlassFish V3 could be java’s way of admitting its superiority when it comes to modularity. Go OSGi!
  4. Support for jvm based scripting languages – Groovy, ruby, jython, scala, closures, lisp, jcl .. The list is endless. There are more than 200 languages that are now supported by the jvm.

You can find more about the Tech Days 2010, Hyderabad edition on Arun Gupta’s blog.

ubuntu one

July 31, 2009

I guess many people were asking for something akin to Windows Skydrive. Ubuntu recently rolled out ubuntu one, an OS integrated online storage space.

And the first impression – its annoyingly simple to use. Once you are through with the two-click installation, you are left with just a “Congratulations” message.

First thing any linux user does is, right click the taskbar applet to check for Preferences. Well? Sorry folks, nothing to tweak around with. Disappointing 😦

Next thing, you click on the taskbar icon and it opens up an Ubuntu One folder on your home drive. With some relief, you then proceed to examine the folder for some sort of Nautilus extension to synchronize the drive. Nothing!

With mounting suspecion, you copy some files into it. Bloody hell!  Ubuntu One kicks into action staring synchronizing your drive.

Good  stuff: It optimizes on the bandwidth idle times to ulpoad the content in a very transparent way (means, over a slow connection you will not feel much of a drop in your surfing speed)

Bad stuff: It keeps spinning my hard drive like crazy. I hope they read blocks into memory, work off that and leave my hard drive alone! And we need a Preferences menu, to specify the location of the synchronized drive and tweak around with bandwidth shaping.

Verdict: The product is in its beta. If you are one Jaunty or Karmic (God bless you), what are you waiting for? And oh, the free version gives you 2 GB.

Update: What I thought to be heavy harddisk read was a bug in the 2.6.28 kernel around cpu fan speed control, causing the temperature to rise.

Jaunty Jackalope

July 27, 2009

Of late, there isn’t much going on at ubuntuforums. For a second there, I thought Ubuntu was losing steam. But then it occured to me how mature the OS have become from the ‘warty’ days. Not many creases to be ironed-out.

If you haven’t tried Jaunty Jackalope yet, give it a shot! The boot time is damn impressive!

compound-assignment operator and type casting

September 13, 2008

We’ve been learning since we first printed “hello world” that

i += 1

expands to

i = i + 1

Well, here’s a little problem to shake the faith.

byte i = 1;

i  = i + 1;


Being java programmers worth our salt, it wouldnt take much to identify the compilation error.

Error: Possible loss of precision

So how do we explain that the next code snippet prints the value 2?

byte i =1;

i += 1;


Here’s the secret: i += 1 is not same as i = i + 1

When you do an assignment (the first code snippet), java enforces type checking because the LHS and RHS may very well be independent of each other.

But the compound-operator is more like an incremental operator. The += modifies the value of the variable involved, rather than assigning a new value to the variable. When you modify a byte, you expect a byte as the result. To make life easier, java does an implicit type conversion for compound-operators because they are modifiers.

Have fun!

Build web apps using Adobe Flex

August 20, 2008

I hate Flash. Any day I would suggest to use AJAX to give your web application that extra pep.

Having said that, lets look at what Flex could do for you. Flex is flashy, Flex is fast to develop. Above all, Adobe has come up with a decent framework for application development.

1. Flex is a complete SDK. Flex is a combination of Action Script (an EMEA Script supporting OOPS) and MXML (XML based UI definition). That good news! But then, they combine to produce SWF files and use the much hated Flash Player to render.

2. A complete IDE in FlexBuilder. Based on Eclipse, this wouldnt let you down.

3. Integration to call REST, SOAP web services. Making REST calls and modifying dom on the fly is a must for any web 2.0 framework. But SOAP? Looks like Adobe is serious about the whole Flex business.

4. Localization support using Resource Bundles. Remember SVG and the NLS support pains? Flex is meant for serious application development.

If you want to develop jazzy looking web 2.0 components for your application in a short time, Flex is worth your time. Remember to use it very judiciously.

Installing Cisco VPN on Ubuntu

August 14, 2008

Cisco VPN client most often requires to be compiled for the linux header you are running. And with the subtle changes in the header versions, its likely that you would run into this error while installing the vpn client:

/usr/src/vpnclient/GenDefs.h:113: error: conflicting types for ‘uintptr_t’
include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here

In case you didnt notice this error while installing, you will surely notice this error when you try to start the VPN daemon:

‘/lib/modules/2.6.24-19-generic/CiscoVPN/cisco_ipsec.ko’: -1 Invalid module format

Like HHGG says, dont panic. The VPN client should be patched with the delta from that corresponds to your linux header. Patch your vpnclient as mentioned below and you are good to install!

cd vpnclientfolder
patch < ./vpnclient-linux-2.6.24-final.diff

Its not that theres a dearth of information on the web on this topic, I still end up wasting time everytime I install vpn. So here I go underlining whats been already said.

Ubuntu: Printing with a mouse right-click

August 12, 2008

Few days back, I came across this nice idea on ubuntu forums. If you want to print a file, why do have to open it and then print? What if you wanted to print multiple files?

Its the small things like these that reminds you the usefulness of scripting. So how do I do it?

cupsdoprint -P PrinterName file1 file2 file3

cupsdoprint is a command line tool to print via CUPS.

So we have our little script around CUPS to print. How do we add it to the mouse context menu? As simple as creating an executable script and dropping into the nautilus script folder. Nautilus passes the context information to the script as variables.

The script file would look like this:



cupsdoprint -P MyPrinter $files

exit 0

Name the script “Print”, make it an executable and drop it to your ~/.gnome2/nautilus-scripts folder and happy printing!