Tuesday, January 31, 2012

On the way to school...

Every morning I rush my kids to school in order to get them in before the bell rings and the doors close. On the way to school I remember my old school days.


I remember the days when mommy would shake me awake and daddy would bring tooth brush and paste direct to my bed. I would wait impatiently outside my sister's bathroom because there was a spider inside mine. My grandpa would shooo away the spider for me. I remember the days when grandma untangled and braided my hair while I did last minute homework. And the days when mom braided on one side and grandma braided on the other side making my face uneven.


On rainy days grandpa would lay stones/bricks in the puddle of water in front of our house so that we can cross over without wetting our shoes. I remember the days that daddy searched my unorganized closet for a matching pair of blue ribbon to go on my hair and polished my shoes until it shine. Just before leaving the house grandma would remind me to never talk to strangers.


Mommy would cool steamed milk under the fan so I could gulp it in faster. I remember the days when I woke up to the aroma of potato poriyal and lemon rice that mommy packs for lunch. Just thinking about it makes me hungry anytime. Mommy would hand me a glass of water before I leave home every morning and ask me to wipe off my milk mustache.


Daddy would read out my physics formulas and check my pencil box on exam day mornings. He would also fill up ink in my pens. On days that our rickshaw didn't show up which was a common scenario, daddy would drop us in the scooter.


I remember the days when mommy watched us from the balcony and grandpa watched us from the street corner until we disappeared from their sight. And then suddenly I felt lonely for a minute as I stood in front of the school doors watching my son disappear into his classroom hoping he will turn back to wave a goodbye. Soon I realized I was late for work so ran back to catch the train.

Monday, January 30, 2012

What makes a good consultant?

I was implementing a certain business rule using a tool called Blaze Advisor. Nothing too complex just needed basic string handling functions to implement my rule. The tool's function library did not include a length function although it did have other string handling functions like substring, findstring, concatenate etc. I was mad that some advance functions were built-in but something as basic as the length function was missing.

I thought the tool was so useless. Why rules are implemented using Blaze? If this was a plain java implementation, we would have had so much flexibility. Hated and cursed the tool. No progress made, task was still open. Then did some research and found a simple trick to accomplish length function using substring and findstring functions. Here it is:

Let's say we want to find the length of String str1. Find a string str2 that will not occur within your original string str1. Append str2 to the end of str1 and assign the result to str3. At this point we have;

str1 = "..." // original string that you want to find the length
str2 = "..." // string that you know for sure will not occur in str1
str3 = str1 + str2


Now use findString() to locate str2 in str3. This should return the position of one character after str1 hence a minus one should give the length of str1.

str2pos = str3.findString(str2)
length = str2pos - 1 //length of str1


Pretty neat huh? This didn't need research, just some simple logical thinking. I told myself again: there is no such thing as a bug free product. Every product has bugs - known and unknown. Know your product; know the bugs, loop holes and most importantly your work arounds. That's what makes you a good product consultant.