Monday, January 24, 2005

The Power of 1

Has ‘1’ lost its significance in today’s world? Who cares about 1 rupee today, when people are earning hundreds of thousands of rupees!! Do we even care about 1 second in this fast paced world? What difference can 1 person make to the way we live/ do things? The Answer ---- NO, I don’t think ‘1’ has lost its significance! Let me explain…
I have been tracking shares of Pentasoft Technologies for about a month now (The financial results of the company suck, but the share price seems to be rising due to the trading volume). Last month it was priced at 2.65 Rs./ share. Today it is at 3.70 Rs./share. How does this matter? Well, consider you had bought 10000 shares last month, investing 26500 Rs. Today, it would fetch you 37000 Rs!! ( I do agree that it is a risky proposition, but that’s not the point I am trying to make here). Do you see the significance of 1 rupee?? This is what stock markets teach you --- Every rupee counts.
Have you ever had to wait at a traffic junction for the lights to turn green? Do you remember looking at the timer impatiently, as it was ticking every second? We don’t realize how 8 hours go by at work, or for that matter, how 4 years pass by at college. But every second at a traffic signal brings down our patience exponentially!!
Can 1 person really make a significant difference to our world? Think again! How many developers did it take to write the first Linux kernel? Do you realize the support for the kernel today? Numerous devices from PDAs to PCs, from wrist watches to supercomputers run Linux. Some of the worlds largest companies like Google, IBM, Hp, Motorola (ThoughtWorks??) etc run their businesses on Linux.

The message that I am trying to convey is that ‘1’ is still significant in today’s world and will continue to be so in the future. One person can definitely make a significant difference. It’s up to you – give up, or accept the challenge.
Quoting M.K. Gandhi
First they ignore you, then they laugh at you, then they fight you, then you win.

Tuesday, January 18, 2005

Mullainagiri Trek

I had been on a weekend trek to Mullainigiri with a few colleagues from TWI. We had loads of fun on the trek -- exploring caves (with bats in them !!), hitching a ride on the roof of a bus, etc. On the first day, we began the trek at Mullainagiri. It was a relatively short trek and we were at the peak after about two and a half hours of trekking. We enjoyed the breathtaking views from the peak and then began exploring the caves near the peak. We went about 30 ft into these caves and found loads of bats (hanging upside down ofcourse !!) in them. This was our cue to get the hell out of there.
After having lunch at Mullainigiri, we began the second part of the trek to Bababudainagiri. It was pretty good initially, but then we had to walk about 5-6 kms, which was pretty tiring (considering we had climbed Karnataka's highest peak in the morning !!). We then took a jeep back to Mullainagiri. (It was a pretty adventurous ride, with a couple of punctures on the way !!). You can view the snaps here -- 1) My camera , 2) Sumukh's camera

Sunset at Kemmangundi

The next day, we hired a Tata Sumo and went to kalathagiri falls. At first, it was disheartening to see the falls (it was like tap water falling), until we figured out that the actual water fall was further up. The water was freezing cold and there was a natural water slide too. We had a ball of a time going down the slide. After spending a few hours playing in the water we headed down to Kemmangundi. This place is definitely not a trekker's delight, but is a wonderful place to check out the sunset. We then returned to the Chikkamagalur bus stand and boarded the bus back to bangalore.

Monday, January 10, 2005

Semantic Diff

Hari and I happened to read an article on Martin’s blog about Semantic diff. It talks about a smart diff utility that not only displays the difference between the two files, but also the refactoring changes that have been implemented. Traditional file diff utilities display the changes that have occurred in each line, given two source files. They do this because they treat both the source files as simple text files. But is this really the way to do it? Are source files just simple text files?

We don’t think so. We believe that source files should be treated as a stream of tokens / blocks. Consider a Java source file; The package declaration, Import statements, comments would be separate blocks. A Class/Interface definition would be a block which could contain other blocks like inner classes, methods and member declarations. Now the diff utility needs to compare the different blocks that it has identified. The order of these blocks would not be important. For example, a developer may choose to rearrange classes or methods inside classes. A traditional diff utility would show a thousand differences between the two versions, but a good diff utility would identify it as cosmetic changes to the source.

It doesn’t end here. A really smart diff program should also show you refactoring changes like method extraction. It should be able to predict that a new method has been extracted out of an existing method and also display the locations where this refactoring has been applied. Such a diff utility would be a boon to developers.

We are trying to develop a program which performs a few of the above mentioned ideas. It seems to be an extremely challenging task. We are making very slow progress with it, but progress nevertheless. Any help with this is more than welcome.

Tuesday, January 04, 2005

Lazy Loading

I am currently on a project that deals with Leases and Loans. It’s a really big project with about 60 people working on it. The customer would use this product to create thousands of organizations, leases, loans etc. and millions of assets, payments, charges etc. Going by the scale of the application, it should be apparent that performance would be a bottleneck. Yes it is !!
One of the most complicated screens in the application is the LeaseSchedule Screen. It contains 14 tabs and more than a hundred widgets. With all the SQL queries optimized, it still takes about 13 seconds just to bring up the screen !! The analysts want the screen to be loaded within 5 seconds. Now that’s asking for too much, right?

Hari, Saket and I decided to work on this card. Looking at the server console, we found out that it took 4 seconds to execute one main query where it creates the screen’s model. We concluded that we needed to tame this beast. Looking at the code, we saw that the screen initializes the model and then draws the GUI, populating the widgets with the data obtained from the model. Seems normal eh?
Well, we didn’t think so. We wanted to render the GUI independent of the model. This is where the idea of lazy loading came in. Firstly, we removed the use of the model in all the UI methods. We then initialized all the dependant models separately and collated them into a separate thread. Now, the UI would render separately and at the same time, the models would be created in another thread. With these changes the screen now loads in 2 seconds !! It actually loads in 3 stages which is clearly visible.
  1. The GUI is rendered with all the widgets, without any data.
  2. The data obtained from the model is populated into these widgets.
  3. The security features are applied to every widget.

The total time taken for the screen to be usable is still over 10 seconds, but the UI is rendered within 2 seconds. The user can now get to see the screen immediately, instead of waiting hopelessly without any visible response to the mouse/key events. I strongly recommend this approach for screens which need to display a lot of data.
But then came the final twist. We spoke to the client, telling him about the what we had achieved. He was very much impressed, but asked us not to implement this feature as of now, coz he perceived quite a few bugs to creep in due to these changes. Since we are very close to the end of the release, he told us that this would not be the appropriate time to incorporate these changes. We were told to document the approach, and probably implement it in the beginning of the next release.
After doing all this, it’s disheartening to revert all the changes. But I did learn quite a lot while doing this.

Sunday, January 02, 2005

Happy New Year

A rose from my neighbour's garden.

First and foremost... Wish you all a Happy and Prosperous New Year. Well, I am back to blogging. I used to blog at LiveJournal before, but I discontinued it coz I was bored of it. So that brings us to the obvious question -- what's this blog gonna be about ?
Well, I really dunno what I am gonna post out here. I guess it would be about my crazy ideas, programming, 3D games, my new interests, stocks/shares and ways of making money :-) , photography , blah, blah ...