Feeds:
Posts
Comments

“You must have not only freedom from fear, but freedom from hope and expectation. Trust in My Wisdom. I do not make mistakes. Love My uncertainty, for it is not a mistake. It is My intent and Will. Remember nothing happens without My Will. Be still. Do not ask to understand. Do not want to understand. Relinquish the imperative that demands understanding.”

- Bhagavan Baba, Sanathana Sarathi, August, 1984

To learn to drive a car, you need to be comfortable with the concept of approximations.  Migrating from a decade of two wheeler riding to a car can be a scary experience. On a two wheeler, you are basically walking, albeit very very fast! Let me clarify: When you are walking, you have a clear 180 degree view of your world, you go where you see a gap big enough to fit you and you are tired after a long walk. Riding a two wheeler is exactly the same!

Get into the driver’s seat of a car and life is suddenly more complicated!

Fact No1:

What can be unnerving to a road hardened biker is the fact that you cannot see the tip of yout vehicle anymore! You can only approximate the boundaries of your vehicle. They say, you get comfortable with practice. True, but with practice you get good at approximations!

Fact No 2:

On a two wheeler, you stop at a signal and you put your foot down on the road. This keeps you stationary. Stop the car at a signal and shift the gear to neutral and you start moving backward! This happens when there is even a minor upward incline on the road. You are now left with no option than to use all your limbs to arrive at that magical equilibrium state where your car is stationary yet in gear and ready to move (forward!) once the signal becomes green.

Fact No 3:

On new gen cars, the accelerator adapts to the user. When we got our car, it was new and it did not have any pre conceived notions about us.  The default assumption was that I wanted to drive at 100kmph every single time. Touch the accelerator and it will decide to punce forward. It was even moving forward on a flat stretch of road when my foot was nowhere near the accelerator! After a long round of negotiations between me and my car, it has now decided to give me a break!

Other than all these minor issues, driving a car activates some parts of your feelings spectrum that seemed to be dormant till now. You get a sense of compartmentalization to life that can be liberating and binding at the same time! Paradoxical as the feeling may seem, it is true and I cannot explain it any better.  Somehow, unknown to us our vehicles become a part of our family and then  they are forced to share our quota of life!

This is a new relationship and as all relationships go, you can never get to know everything, right?

“Get the job done” – this is probably one of the most used and abused phrase in the work place especially in the life of a software programmer. In large organizations, a significant part of your work life is dependent on actually getting your work environmentnt setup correctly. Before you can get the job done, you need the following “done”

1) Have your version control system point to the correct source files

2) Get the correct debug build (not necessarily the daily build)

3) Get in touch with one key architect who knows the entire product (imp in large distributed teams)

4) Get tools for : file compare, process explorer, a light weight file editor(apart from your dev env). Visual Studio developers can gawk

5) Information you need may be spread across corporate wiki pages and sites. Learn how to bookmark and more importantly learn how to look for information. Ask people who have been in the team for some time to share their books marks.

After you have done all of the above, you are now ready to ‘Get the Job Done’

First off, I am back to blogging after a long break!

I have been trying Mozilla Thunderbird for offical email for the past  100 days. My verdict – inadequate.

The search feature in Thumderbird is pretty bad. I was finding it very difficult to extract mails based on anything other than keyword searches in the subject field. That said, these are the features where thunderbird can do with a lot of development:

1) Rich editor. The message compostion features are rather rudimentary

2) Better color schemes: One look at Outlook 2007 and Thundebird and you know the difference!

3) Tighter integration with calendar, reminders etc..

Having said all this, Thunderbird is still a very good open source alternative for an email client.

In the past I considered the configuration of a wireless router to be a cumbersome and complicated task. I recently discovered that it is not that complicated when you get down to actually doing it. Here are things I need to remember if I ever have to do it again.

A wireless router would be simple if it is true to what is says – ‘Wireless’. Most wireless routers have a few ethernet ports to which computers can connect directly. The ethernet ports on the router are of two types – WAN and LAN. There will be just one WAN port and a few (4 usually) LAN ports. The WAN port is to connect the router to an existing network. The LAN ports create a new virtual network. Clients cannow connect to the ‘outside’ network through the router by directly connecting to the LAN port via cable (in this case the router functions as a regular ethernet switch) or though a wireless connection.  All traffic from the new network that are bound to nodes outside this network will be routed through the WAN port.

Usually when we configure an ethernet interface, we need to provide IP address details like IP address, subnet mask, default gateway and DNS.  The typical wireless router has two ethernet interfaces – the WAN and the LAN and hence we must provide details for both. The addressing scheme for the WAN interface will depend on the adressing scheme used by the network to which the wireless router is connecting. The addressing scheme of the LAN interface usually begins with 192.168 as it is a private network and the IP addresses must fall within the non-public IP range recommended by ICANN. The LAN interface can also be configured to issue IP addresses to clients connecting via the LAN interface or via wireless though DHCP.  All traffic from the private network will be routed as traffic orginating from the ethernet address of the WAN port. This is called NAT or network address translation.  Similarly all traffic bound for a particular node on the private network from outside the network will first arrive at the WAN port and will be routed to the correct node by the router. NAT is at workagain.  Lets look at an example.

You want to connect to an existing network and use a wireless router to extend the connection.  You need IP details for the WAN. Lets say the IP address is 10.0.1.23, subnet mask is 255.255.255.0 and gateway is 10.0.1.1. The DNS addresses can be obtained from the service provider in the case of internet connections. So in effect, you are going to connect a number of clients to the network using a single IP – 10.0.1.23. However, each of the clients need an individual address to make them unique on the network. This is the purpose of NAT and the LAN interface.  You can configure the LAN interface with a private address range. In this case we choose 192.168.10.1. If you use static routing you need to set the IP address details on each client. The IP address will be anything between 192.168.10.2 to 192.168.10.254 and the default gateway will be 192.168.10.1

Depending on the scenario, the installation can be a bit more complex. In the case of ISPs, you may need to add PPPOe dialers etc.. Will write about it in another post.

I found this poem on a web site dedicated to inspirational content this morning.  Planning to make a poster out of it very soon…

Giving Your Best 
by Author Unknown

It’s the hand we clasp with an honest grasp

That gives a hearty thrill;
It’s the good we pour into others’ lives
That comes back our own to fill.
It’s the dregs we drain from another’s cup
That makes our own seem sweet;
And the hours we give to another’s need
That makes our life complete.

It’s the burdens we help another bear
That makes our own seem light.
It’s the anger seen for another’s feet
That shows us the path to right.
It’s the good we do each passing day,
With a heart sincere and true;
In giving the world your very best
It’s best will return to you.

Source: http://www.wow4u.com/poems/index.html

The book ‘Beautiful Code’ edited by Andy Oram and Greg Wilson is a wonderful collection of articles in programming.  I recently attended a student presentation on an article from the book titled ‘Code in Motion’ by Laura Weingerd and Christopher Seiwald.  The author discusses what in his opinion are the seven pillars of beautiful code.  One of them is to avoid deep nested if statements. Deep nested if statements can confuse the reader about the list of conditions under which sections of code execute. I got to thinking about this problem and i feel there is a solution that can be provided by augmenting the language compiler or by adding ‘code reading intelligence’ to a code editor. The basic idea is to have a decode function that would take a list of conditions as a parameter and return a binary code where each bit is one or zero depending on whether the corresponding condition evaluates to true or false. The following example should help clarify my point

Let us consider the following snippet of C code

if (a<b) {

if (c>d){

if (e == f){

action 1

} else {

action 2

}

}

action 3

}

the above code could neatly expressed as

bitmapCode  = decode(“a<b”, “c>d”, “e==f”)

the following will be the valid values of code

The position of the parameters in the decode function call will have a bearing on the code returned.

In this example condition 1 is “is a < b? “, condition 2 is “is c greater than d?” and condition 3 is “if e equal to f?”

code = 000 if none of the conditions are true

code = 111 if all conditions are tur

code = 100 of condition 1 is true and conditions 2 and 3 are false

code = 110 if conditions 1 and 2 are true and 3 is false

code = 101 if conditions 1 and 3 are true and 2 is false and so on….

We can have a switch statment to process the code. This would make the code much more easier to read. This approach, however, has a drawback.  Function calls impose runtime context switch overhead. One way to overcome this problem is via inline functions.  The other radical approach is to have an editor that can provide multiple ‘intelligent’ view of a program. I will write about this in a seperate article.

I have a version 1 rough implementation of this scheme in VB.NET.  The implementation consists of two classes. The condition class implements an abstraction of a relational expression. The class maintains an LHS (left hand side), a RHS (right hand side) and a relational operator (<,==,>,<> etc…) The class also implements a method to test if the condtion is true. The second class is a decode class which is a container class for a list of conditions. The main responsibility of the decode class is to maintain a list of condtions and return a code reflecting the conditions.  I am uploading a pdf file of the source code along with this post. The condtion class right now stores the LHS and RHSas objects. I am planning to use generics and overload the relational operators in a future version.

The code has been tested to work on numeric and string data. The code can be downloaded here

Subhiksha is a company that claims that they offer the lowest prices on mobiles in any city. I wanted to verify this and i placed a call to 60607777. This is the number listed on their web site and flashed every other minute on TV advertisements.  The call was connected immediately, but i was forced to wait for 1 minute and 10 seconds as i listened to one of their ads.  Just as i was about to hang up, a sales representative (Jagan) came online. I asked him if was their corporate policy to force an ad down the throat of every unwitting caller. He offered what can best be described as a half hearted apology. I let it go and i asked him the price of a Nokia E65. He put me on hold for a few seconds this time(thankfully). Imagine my suprise when he told that he would tell me the price only if i would provide him my contact details which included my phone number. I told him that i was not ready to divulge my contact details only to have annoying marketing calls. He told me that it was company policy that they would provide price details only if i was willing to provide my personal details. I asked him how it would be if retail chains adopted this policy for every customer visiting their store. He didn’t see my point and after 4 minutes and 38 seconds i hung up none the wiser.  I would think ten times before i venture into a Subhiksha store the next time and certainly would not recommend it to a friend who asks me for buying advice. A company that forces would be customers to part with personal details to provide public domain information has to rethink on their corporate policy with respect to the customer experience.  Well, maybe…. Subhiksha has a tie up with mobile service providers where they assure them of a minimum amount of talk time for every call a customer makes to their well advertised number in return for a fee that helps offset thier lower prices… just maybe….

I borrowed the Fundamentals of Object Oriented Design book by Meiler Page-Jones from my campus library. I wanted to do a little reference lookup on UML class diagrams to better understand another related topic -Design Patterns. The author has a fantastic and simple style and it is one of those books that can distinguish the relevant from the irrelevant. I particularly liked his subtle sense of humour and also his respect for history as he devotes three full pages to the men and women who have made significant contributions to this field, albeit from their bathtubs as the author likes to put it! I would have never heard or Larry Constantine (coupling and cohesion), O J Dhal and Nygaard(Class concept), Alan Kay, Adele Goldberg et al(SmallTalk@Xerox), Barbara Liskov (ADT) and Jean Ichbiah(ADA) but for this book.

I was blown away by the author’s clear exposition of the differences between composition and aggregation. Composition and aggregation are used to model whole/part relationships. The similarities stop here. They have very specific definitions and they are usually not interchangeable if the system is well designed. Composition is used when an object(composite) is made up of other objects(components). The whole refers to the composite object and the part refers to the components. For example, a pen consists of a refill and a holder for the refill. The pen is the composite object and the components are the refill and the holder. Composition has the following three essential properties

  1. A compostion does not exist without the components. A pen without a refill has no significance.
  2. At any given time each component object can be in only one composite. A refill cannot be in two pens at the same time
  3. The components are heteromeric. This means that there is no relationship between the components. We cannot associate a meaninful relationship between refills and holders.

Composition is represented in UML by a association line with a solid diamond on the composite end. Unless otherwise specified the multiplicity is assumed to be one. Navigation is usually from the composite to the components though reverse navigation can also be established Aggregation is used in a completely differenct context. An aggregation represents a group/member relationship. The inherent understanding here is that all members are alike with respect to their general properties. The group is the whole and the members are the parts. For example a department is an aggregation of employees. Aggregation has the following three characteristics

  1. An aggregate can exist without the parts. For example a department can exist without any employees assigned to it as yet. This can be violated in some special cases. Consider the case of a sentence as an aggregation of words. Can a sentence exist without any words? (ask a zen master…)
  2. A member can belong to more than one aggregation at any point in time. An employee can belong to more than one department.
  3. All members of an aggregation are homeomeric. A fancy way to say that they are alike.

Aggregation is represented in UML as an association line with a hollow diamond on the aggregate end. It is mandatory to mention multiplicity as there can be no valid assumptions made like in the case of composition. The following table is a repetition but a one glance summary of the above content

Composition Aggregation
The whole cannot exist without the parts The whole can exist without the parts
A part can belong to only one whole at a time A part can belong to more than one whole at a time
The parts are not alike The parts are alike
Representation is a association line with solid diamond Representation is a association line with hollow diamond

Last week i went to offer prayers at the temple of Lord Saneeshwara at Tirunallar. Tirunallar is a small town about 35 kilometers from Mayavaram. Mayavaram, also called Mayiladuturai, is an hour drive from Kumbakonam. Interestingly, Tirunallar falls under the administrative jurisdiction of Pondicherry though Pondicherry is no where near this place! Tirunallar is famous for the temple dedicated to Lord Saneeshwara. According to Hindu culture and Zodiac, every person is under the influence of Lord Saneeswara for a period of seven and half years. This is called the Shani period.  A person has two Shani periods in his lifetime. It is a common belief that this Shani period brings with it lots of obstacles and difficulties in life.  Tirunallar is said to be the only temple where Lord Shani is in a benevolent mode. People visit this temple to propitiate Lord Shani and seek His benevolence and Grace to bear/overcome the obstacles to progress and happiness in their lives.  Legend has it that Nala (of the Nala Damayathi tale) overcame his Shani period by visiting this place.

The town as such is a small, laid back community that is typical of small town in Tamil Nadu. The temple is bordered by three ponds. Of these the pond named after Nala is called the Nala Theertham. It is said that Nala had a holy dip here. Devotees visiting the temple usually have a ceremonial dip in this pond and leave the clothes that they were wearing at the steps of the pond and proceed to the temple in fresh clothes. The temple is located inside an impressive courtyard and is maintained clean by the devasthanam (admin body).   I was surprised to see that the main deity in the temple (at least the deity inside the central and biggest Sanctum Sanctorum) was Lord Shiva. Lord Saneeshwara’s temple was located on the right side of the main entrance to the temple of Lord Shiva. The Santum Sanctorum of Lord Shani was beautiful and there was a clean marble stage opposite the deity for devotees to sit and offer prayers).  We were very fortunate to visit the temple on a day when there were very few devotees. This temple is legendary and on special days and Saturdays thousands of devotees throng here.  We reached the temple at 9.45 and were told that the abishekam will start only at 12.00 noon. We sat down on the marble podium and just watched the proceedings in the temple. It was impossible for me to pray with full concentration for hours on stretch and i resorted to bursts of prayer and settled to care free abandon most of the time. The abishekam started at 12.00 and was a very beautiful ritual. It is very difficult not to be carried away by the blessedness of the moment. We collected the prasadam after the abishekam and made our journey back to Mayavaram.

The geography of the place deserves special mention. The entire stretch from Kumbakonam to Mayavaram is unbelievably fertile. I finally got to see what is meant by ‘rolling feilds’. The journey by road from Mayavaram to Tirnunallar is right in the middle of lush green acres of paddy fields. I could not help but feeling that human habitation and signs of civilization were a rude interruption to the symphony of nature that this place is. Kumabakonam is itself a quaint little place. What stuck me was the ambience of the railway station that is so typical of railway stations all over India. The seek to endear the visitor to the beauty that is India. I was lucky to watch the glory of the sunrise from here. It is also one of those rare oddities where you have a platform on either side of the train!

The Tanjore Kumabakonam belt is famous for lots of temples with deep historical roots and powerful deities. It captures the essence of Shaivism and Vaishnavism that thrived in ancienct India. I was gald that i made this trip…

« Newer Posts - Older Posts »