Saturday, April 25, 2009

Amazingly fast Jaunty Jackalope ..

As soon as the official release was announced, I decided to upgrade my Intrepid Ibex to the latest version and see what it has got. One of the most praised features is the surprisingly short boot time. Combine this with the fact that it got announced on Friday morning IST, I wouldn't wait anymore to try it out, would I?

Usually, I perform the network upgrade where in it downloads all the required packages from central repositories and starts upgrade only after all the downloads are complete. If network connection breaks for some reason, the whole process is broken and has to be restarted. But still it used to do the job for me. But this time, due to a bug in apt-get, it somehow started ignoring the changes to the proxy settings. I use proxy server for my work, and I unset it in gnome-proxy-settings when I am not working for office. However, the update-manager does not recognize the change in gnome proxy settings. It takes the proxy settings from env variable http_proxy which I must have set some time back. Unsetting it and starting update-manager from the same terminal does solve this problem, but I found a cool and nice alternative anyway.

You can download and alternate cd from here. And then start the upgrade with one command: "gksu sh /cdrom/cdromupgrade". The rest is all usual process. But this time, it just a takes half an hour because you already downloaded all the packages. This looked like a much cleaner way to upgrade.

Then I timed the booting process. From the appearance of the BIOS screen, to the appearance of the Login screen, it took exactly 30 seconds. However, not all this should be considered as OS boot time. BIOS screen is persistent for about 8 seconds and then for about 2 seconds, grub shows its choices. So, the core Ubuntu OS boot time boils down to flat 20 seconds. And then, once I input my username and password, the time it takes for loading the desktop and my preferences is roughly 15 seconds.

In summary, flat 20 seconds of boot time for an OS is indeed a very good improvement.

Tuesday, April 14, 2009

The mystery behind Java class loaders ..

I have been playing around with Java class loaders for few weeks by now .. and it still doesn't feel good. There are number of articles on the Internet that describes the internals of Java class loaders but none of them answers few of my questions.

First the basics .. A class loader is an entity in the JVM, that is responsible for reading the Java byte code from the .class file on the file system and creating a Java Class in memory. The java program can create objects or use static methods of a class only after it is loaded by a class loader. To add to the complexity, there is not a single class loader to load all the classes. In fact, there is hierarchy of them. First there is the bootstrap class loader which basically loads all the Java system classes (all those under java.lang package). Just below it is the Extensions class loader which loads all jar files you put inside Java home ext directory. And then comes the System class path class loader which loads all the classes present in the class path. If you provide any JAR files or classes using '-cp' option they are loaded by this class loader. For stand alone Java applications, the class loader hierarchy ends here.

Before going into Application servers, let me talk about the delegation model. As I described before, there is a parent-child relationship among different class loaders. When a class loader is asked to load a class, it first delegates the job to it's parent and only when the parent could not load the class, it tries to find and load it from it's own class path. For instance when you use java.util.Date in your program, the System class path class loader is first asked to load this class. Before trying to load by itself, it first delegates to the Extension class loader which further delegates to the boot strap class loader. The boot strap class loader does not have a parent, so it tries to load it by itself. It obviously finds the class in it's class path and loads the class. On the other hand, if you try to use a class from a third party library, which you specified in your class path on the command line, it goes all the way to the boot strap class loader and comes back to the System class path class loader because, no ancestor will find this class in their class path. System class path class loader obviously finds it in it's own class path and loads it for you.

Now, application servers create additional class loaders to provide run time isolation between different applications. So, just below the System class path class loader, there are several Application Class loaders one for each application deployed. I am speaking of Enterprise Applications packaged as EAR files and not stand alone java applications here. As you might have grasped by now, there is no sibling relationship among class loaders. So, an enterprise application can see (at runtime) all the classes in it's own class path, in the application server's class path, Java extension directory and Java system classes. But it cannot see classes in the class path of another Application.

If an enterprise application contains a web module, then most application servers create a separate class loader to load classes from that WAR file. So, different web applications in the same Enterprise application cannot see each others classes.

To be continued ..

Thursday, March 26, 2009

Opera or Firefox ..

I've been a loyal user of Firefox since its first release and I almost never looked for a change. There was a low point at one stage, with Firefox memory consumption getting out of control and users trying different hacks to reduce it. But when I almost decided to change, Mozilla guys have come up with fixes and improvements. And 3.0 release is too tempting to leave and it only gave more reason to stick with firefox. But one ought to get bored using the same thing for years (exception for wives ;-)). Particularly when other competing browsers start to make their presence felt. Sure IE still has most browser market share, but Firefox was and is still the fastest growing browser. In that way, even though it is not leader in it's market, it has a monopoly in a way. If Microsoft had not come up with IE 8, which fared much better than its previous versions, I could see no other way for Microsoft but going further down.

I've read many blogs which appreciated new features in IE8. I didn't try it out much, but the overall look and feel of the application felt much better than IE7 and IE6. One crucial point which is keeping users who are at least slightly technical away from IE is the lack of huge add-on base. I use around 15 different add-ons any time in Firefox, and its gonna be a long time before IE produces that kind of platform and community.

On the other hand, I have read much about Opera too. The strange thing with Opera is, all fans of Opera are die hard fans. Whenever I tried Opera before, I quit again with the same reason I quit IE - lack of strong add-on community. But this time, I decide to stick with it for some more time at least to evaluate it properly. I had to sacrifice some add-ons like the in-built twitter client and Google Notebook, Flag etc. but for some other most important ones, I found alternatives. For instance for synchronizing bookmarks across computers, Opera has a service called Opera Sync. Further, I was quite impressed with the way Opera renders pages. It is visually very pleasing and 100/100 score on acid3 tests speak for themselves about the standard compliance of the browser. Of course I am talking about Opera 10 Alpha and not the Production version. If you haven't tried it yet, it is the right time to try Opera 10. It is surprisingly stable for an Alpha release. I never experienced a single crash yet.

One thing I miss in Opera is the status bar from Firefox. There is no way to know what is happening when I load a page in Opera except a small progress bar to the right of address bar. And that too doesn't give an apt information about what is happening. In firefox, on the other hand, I know from the status bar whether it is looking up the domain name/sending request/waiting for the request and I know when the page is fully loaded. This information is missing from Opera. I hope they will include something in the final production release.

Bug in Ubuntu 8.04 doesn't let it boot right after installation ..

This rather very serious bug prevents a freshly installed Ubuntu 8.04 system from booting. If there is no other OS installed, then it is almost impossible to recover from this situation.

After getting my new desktop home, I started with the installation right away. I have a SATA hard disk and an old PATA/IDE hard disk and I connected both. In the BIOS, I set the SATA hard drive first in the boot order. The installation was smooth and finished in less than 20 mins. However, when I rebooted, the system hanged with a single cursor blinking indefinitely. At first, I couldn't understand what would have gone wrong. I booted into the Live CD and configured the network and started searching for solutions. As soon as I saw I understood the problem. Mixing SATA and IDE hard disks have always caused problem with Linux. Grub installer had to install the boot loader to the SATA disk on which I installed the system and which is first in the boot order as well. But it installed the same onto the second IDE disk.

I tried changing the boot order, in BIOS, of these two disks, but in vain. I had seen references in some forums that this worked however. The only option left for me was to remove the IDE hard disk. I was fortunate as I had an external IDE disk carrier which I can always plug in through USB port. But this bug is still open in launchpad. I hope they will soon resolve this problem.

Tuesday, March 3, 2009

One password to rule them ALL ..

Since long time, I was searching for a solution to manage all my passwords. I maintain about 15 different online accounts, and it is a nightmare to remember user names and passwords for all those accounts and I very often end up using same password for multiple accounts. I usually manage to get away with this option since I mostly operate in secure environments (like office or home) .. and my passwords are not that valuable anyway :)

But I was surprised that no solution existed for this and I was even thinking of writing one myself, until I saw PasswordMaker.

This is exactly the kind of add-on I was looking for. It works in a very simple way - When you are about to log in to any web application, just right click on the empty text boxes and click PasswordMaker->Populate this field. It automatically populates both the user name and password. This password is generated by hashing a combination of the domain part of the URL and a master password you give. You can enable it to store the master password either in memory or on disk or you can type it yourself every time you want to populate a password field.

In a sense, it acts like a password store (if you allow it to remember the master password). You never need to remember another password again. But what if you are on a different computer? No problem, if you remember all the profile settings like which algorithm to use, what is the modifier etc., you can use the online version to generate your passwords. Or you can install the add-on on that computer too, if you can replicate the profile settings.

PasswordMaker is definitely a useful tool but it would have been even more useful if there was an easier way to transfer profile settings between computers. But one can overcome that issue with several workarounds ..

Monday, March 2, 2009

Why you should be careful while cleaning your notebook ..

This is not the first time I screwed up with my notebook, but this is definitely the costliest one. On a fine Sunday, I set out to clean it. It has not been performing well since few months. It over heats in every few hours and shuts itself down automatically. Many times, I thought it is an Ubuntu specific bug. But I also had the suspicion that it is due to the dust clogged in the CPU fan. So, I bought a compressed air canister to clean the CPU heat sinks for Rs.500/- the previous day, and I set out to clean the system. Unfortunately, I missed out some important precautions while using the compressed air container and the result is the CPU fan now got stuck :( It would now cost me much more than 500 bucks and in addition ..

I am devoid of my favorite computer now and it has already been more than 24 hours. My sincere piece of advice for you all, if you are going to clean your notebook, make sure you watch this video before starting:


Computer Basics:How To Clean A Laptop

An idleness I cannot stand ..

It has been just too long since I have written something before .. not that I am a good writer .. but it just feels boring. Writing about stuff is fun, particularly when you know somebody reads it. I did not think of a specific subject this blog would be based on, I want to use it as a kind of personal scratch pad.

The blog title does not stand for any existing business entity but one that I dream about. Venustus is a popular fresh water aquarium fish. And I just kind of like the sound of it. I do not like fish at all.

Happy reading ..