Mar 15, 2014

Indru Oru Thagaval: Anger Management

I heard the following story on anger management narrated by Thenkachi Ko. Swaminathan in Indru Oru Thagaval (Today's fact of the day), a popular radio show during early 90's.

Once there lived a very short tempered kid who gets angry at slightest provocation. In a fit of rage, he would break any object that comes to his hand. His father tried several methods to teach him how to control his anger.

One day, his father called his son and said, "Listen son, I have been trying to advocate you that anger is not good for your health. But you keep getting angry and break lot of objects. Destruction is the character of a demon. To teach you a lesson, I am going to try a last resort."

At this point, the boy got curious. For every time in the past the boy met his father, he has given nothing but advices. But now he is going to stop doing it for good (or bad). "What is it father that you are going to teach me this time?", he asked.

His father replied, "I am not going to teach you or advice you any more. I now realise it does not work. I am going to adopt a strategy. Every time you get angry, I am going to hit a nail in the banyan tree outside our house", saying thus, his father went outside and hit the first nail.

At the beginning, the boy did not understand how this strategy is going to make him overcome his anger. But after a few months time, he saw that his favourite banyan tree which provided shade during scorching days, swing during evenings to play, cool breeze to take a mid-day nap is bearing all suffering for his anger. He soon found that a good portion of its bark is now covered with nails.

He went to his father and said, "My dear father, I now realise that I am getting way too angry even for mundane things. Help me to get rid of my anger. Help me to control my sense".

Hearing this from his son, the father felt elated. He called his son to come near him, gave him a warm hug and replied, "Son, there is a way to control your anger. Every time you get angry, try helping someone in need in whatever way you can. And when you do that, remember to remove one nail at a time for every service you render".

The boy obeyed his father's order. After a few months time, he had removed all the nails from the banyan tree. He was so happy that he jumped in joy, went to his father and screamed from top of his voice, "Dad, today I removed the last nail from the banyan tree".

His father held his hand, took him to the banyan tree, pointed towards the nail marks and said, "Son, no matter how much you try to help others, you must realize that your anger has left a scar on the tree". At this point, the boy fell down and cried.

"Dad, I am extremely sorry. I did not realize that by getting angry, I hurt others. What should I do now?"

Being his father, he felt pity on his son. He lifted him up and said, "Do not worry my dear son. Pray to God. Think of all the times when you got angry and hit a nail. Beg for his forgiveness".

After this, every time the boy came out of his house, he would sit next to the tree and pray to God, "Dear God, I have made a grave mistake because of which I have left scar in people's heart, just like this banyan tree. Please forgive me for my shortcoming".

With time, all the scars on the bark of banyan tree was healed. The boy realized the greatest truth of all time, "getting angry is not only bad for the person's health, it also hurts people's heart and leaves a scar".

Thenkachi finished his narrative with the following quote from Thirukkural,

Theeyinal sutta-pun ullarum, aaradhe
Naavinaal sutta vadu.

Theeyinal: by fire
sutta-pun: wound caused
ullarum: heal completely
aaradhe: does not heal
naavinaal: by spoken words
sutta: caused
vadu: scar
(Wounds caused by fire would heal completely with time but the scar from wounds caused by angry words would never heal)

Sep 8, 2013

Monsoon Pregnancy

The month of December had just started. Winter monsoon was already at its peak, bringing more rain to the plains. Flood damages and record low temperatures were the topics discussed by everyone in the southern states of India. Only a couple of weeks ago, one of the worst cyclones hit the entire state of Andhra Pradesh propagating its remnants in the form of frequent rains scattered all over Tamil Nadu.

"I was on my 39th week into my pregnancy with my first baby. I still remember the day vividly", Kamatchi recollected that momentous day from her past.

Kamatchi is 55 years old now. Age had painted extra wrinkles on her face, adding more beauty with maturity. A few black hairs on her head showed that she still has years to live and share her life stories with generations.

"It happened 36 years ago! I was only seventeen then", she traversed through time. "Only a year before did I enter into the wedlock. I wanted to complete my school education, but my parents had another idea."

I paused and reflected on myself. I am Swati, Kamatchi's last daughter. When I was 16, going to school was the norm. To my generation, it was hard to believe that completing a school or going for graduate studies was a privilege once. 

That is when I felt that my mother is a phenomenal woman I have ever seen. She wanted to see her daughters graduate in higher studies, that which was denied to her when she was young.

"What other idea did your parents have?" I asked her. I was as curious to know about her first pregnancy as I was on my own.

"It was to align with the society's expectations of getting their daughter married as soon as she attained her puberty. Within a few months of my marriage, I became pregnant".

I recollected my prenatal appointments with an obstetrician. "Did you visit a doctor regularly?" I asked her curiously.

"My dear, during my days, my mother and other elderly women in our locality were the obstetricians. Each day they would prepare some healthy food cooked with herbals and make me eat. This, they said, would take care of nausea and other pregnancy-related complications".

"Did not you feel any complications?" I asked her curiously recounting my days of nausea.

"Not that I can remember, until the day my water broke, that is to say."

"What happened then?" I asked her.

"It was around 11.30 in the night when my water broke. There was continuous rain since the previous night. Most roads were filled with knee-deep water. As soon as my water broke, I started getting convulsions. I could not bear the pain any longer. But then, we did not have a car or a two-wheeler to be rushed to the hospital".

"How did you reach the hospital then?" anxiety engulfed me.

"My father made my mother and myself wait outside of our house, walked to the nearest railway station to inquire about the next train that would take us to town."

A stark contrast hit my mind hard. On the day when my water broke, I called my best friend who had earlier happily agreed to give us a ride to the hospital.

"My dad came home with his face lit brightly," she said, breaking my chain of thoughts. "Come soon. A train is about to arrive at the station. I had already bought the tickets". For the first time, I felt God is listening to my prayers.

Holding my father and mother's arms from both the sides, we walked to the nearest railway station, all the while my mouth chanting "Mariamma," begging her to be with me till I pull this through.

There was a power outage then because of heavy rain. By the time we walked through the muddy waters and hasted to the station, the train had arrived.

We got down at the town railway station and reached the government hospital by a bullock cart. My father sent for a nurse to attend me, who in turn had carried the news to the lady doctor on call. The doctor, who had just come from her home, injected chloroform, full body anesthesia.

"Were they monitoring your blood pressure and baby's heartbeat?", I asked her innocently.

"Who knows? The next thing I know was that my daughter was born".

Aug 25, 2013

Completed 31 orbits around the Sun!



Today I completed my 31st journey around the Sun, from Earth. To celebrate the occasion, Jaisri carefully plucked 31 'Sun' flowers, tied them together and made a hand-made bouquet. Thank you so much Jaisri!

Aug 16, 2013

Top 10 Productivity Tools in Matlab

Rick Rosson is a Senior Applications Engineer at Mathworks, a company that developed the Matrix Laborary (Matlab) software. He gave a talk on top ten productivity tools in Matlab, most of which I already knew. Still, I liked the talk because I got a free Matlab logo sticker for answering correctly to a question he posed during the talk (Yay!).

Here is the list of top ten productivity tools in Matlab according to Rick Rosson (not in any particular order though).
  1. Code Analyser
  2. Section Mode
  3. Publishing
  4. Command History
  5. doc command
  6. Tab completion
  7. Inline syntax guidance
  8. Automatic variable name change
  9. Matlab path
  10. startup.m
You can read about all the above ten tools from Mathworks website, however, let me give you a brief introduction to each of the tools.
 
Code Analyser: This is a new feature in Matlab which you will find at the top right corner of Matlab editor window. If your script is error free, the code analyser indicator will turn green indicating everything is alright. If your code is inefficient, or has error which does not affect the execution of the code, it turns yellow. As you would have probably guessed by now, the code analyser indicator turns red if there is any error in your script that affects the execution of the code.

Section Mode: As a Matlab user, you would have probably known that '%' symbol at the beginning of a line is used to comment a sentence. Instead, if you use '%%' symbol, it will still work as comment, but in addition, it starts a new section. So if you are writing a code which can be split into several sections (or modules), you can separate them by using '%%'. For example, you can have a section to read or import the data, another section to analyse the data and one more for making plots.

Publishing: One useful feature about Matlab is its ability to publish a report in the form of pdf or html or in many other formats. Traditionally, I execute each plot, save them as jpg or eps format and manually add/import results to create a presentation file or a report in word format. All these can be done now at the click of a button. What more? The comment tag that you type followed by the '%%' symbol will become section header when you publish!

Command History: Had a bingo moment when you created that plot some time ago, but struggling to find how did you create it later on? Command History comes to your rescue in such situations. As the name suggests, the command history windows remembers all the commands you had every typed since the last time you cleared the history manually. You can even select a portion of history and make a script out of it.

doc command: While help command gives you a rough idea of what the function is about, doc command will give you more details and insight of the function. In other words, doc gives you a complete documentation about a function which you want to learn how to use.

Tab completion: This, I think, probably came from working in a Linux environment. Its probably useful when you are creating a Matlab script that runs to 1000s of lines. To speed up writing a code, type first few characters of a command (typically two to three characters) and then hit Tab command to autofill, or to choose the right command from a list of options.

Inline syntax guidance: You probably have an idea of name of a function that you want to use, but not sure about its syntax? Don't worry. Just type the function name and wait for fraction of a second. The inline syntax guidance will pop up with a help window showing various syntax options by which the function can be called.

Automatic variable change: Suppose if you have written a function for a specific problem. And now, you want to generalize it by changing specific variable name such as 'temp' to more general variable name, such as 'x'. You have probably done this using find and replace tool. But the catch is that there could be several variables starting with temp, for eg, tempoutside, temproom. Find and Replace would probably do a nasty work (if you do try, you will get xoutside, xroom instead of general variable names such as x1, x2 etc). Automatic variable change does this job more efficiently. Just change the variable name 'temp' to 'x', hold the Shift Key and hit Enter button. It will search and replace only the variable name 'temp'.

Matlab path: addpath command adds the path to custom library folder where users can create and save custom library files specific to their work. By default, Matlab would search for a function in the current directory. In case the current directory does not have the function file, addpath will tell Matlab where to search for it.

startup.m: Instead of using addpath command every time you open a new session in Matlab, you can write a startup script and set all the paths. Matlab would execute the startup script every time it is started, and automatically add paths to various custom libraries and functions.

In addition to the top ten productivity tools, Rick also listed ten more productivity tools. They are
  1. tic toc
  2. profiler
  3. file compare
  4. todo fixme
  5. debugger
  6. stack browser
  7. plot browser
  8. plot tools
  9. generate script
  10. file import wizard.
Thanks to audience's frequent interruptions and their effort to make this talk "An introduction to Matlab", Rick did not have time to discuss about these ten tools. But then, we have Google right?