Tuesday, September 22, 2009

Nothing ever matters...

It started with a plan to visit a temple near Hyderabad. The Chilkur Balaji temple, better known as "Visa" Balaji, courtesy the thousands flocking there in anticipation of a work visa for the Land of milk and honey. For the natives of Andhra Pradesh, an interview at the consulate is only second to prayers at the temple.
"It is some 100 kilometers from here", suggested the e(o)ver confident S. It is actually close to 35 kilometers. This was itself an alarm, good enough, for people who like to plan even the shortest of trips well to ensure a smooth, yet enjoyable one. But, obviously, we had, by far, graduated out of that category and so we set off for the temple. Locating the temple was easy. The easiness was the booster for the next activity in the agenda, which none of us were consciously aware of. We were done with the temple-chores well in time, that was by afternoon 2 o'clock. None of us wanted to get home that early and everyone agreed to the idea of a drive till Nagarjuna Sagar dam which was 100 kms from the spot of the magnanimous decision. 'A' who was driving all through seemed over enthusiastic which was booster no. 2. S was on call with a friend who was guiding us. Whether it were the comprehension abilities of S or our phone friend's (he was referring to maps on the internet) is till a mystery, but we went completely haywire and missed the Nagarjuna Sagar milestone by couple of tens of kilometers. There was not an iota of vexation from any of us. None of us were probably aware of our mental tenacity, (and physical of course!). We planned on extending our drive till Srisailam, a religious place another 160 kilometers from where we were. By this time we had estimated we would have to spend the night at some place in Srisailam. We missed several milestones, drove back undefeated till the missed milestone, started with renewed vigour only to miss the next one, and drove till a point after which there was no scope of going wrong, as it was a drive uphill, with no digressions. We reached Srisailam by 9 in the night, pompous and proud of reaching the town, albeit late by a few hours and all ready to have a good night's sleep at a decent lodge, ofcourse in an air condioned room, after a sumptuous meal. A bath, next day, at a waterfall en route Srisailam was what we had made note of and were looking forward to. The next day was planned well - worship at the temple, drive back to Hyderabad, stopping at the waterfall for some fun. Hail us, the naive lot! It was the peak season for the Jyotirlingam worship and so all the lodges were packed. Realization, that we would have to spend our night in the car, fortunately dawned on us just before the eateries were about to close. The search for a decent-lodge-with-air-conditioned-rooms was terminated. We were too hungry to be finicky and we thoroughly enjoyed the meal at the first available food joint where flies were a one of the few ingredients in the food.
The night was spent in the car playing cards till dawn, followed by a snooze till proper sunlight. All atleast agreed that they had slept and seemed happy about it.
After the early morning chores, each part of it at a different location in the town, we again realized we could not possibly worship at the temple for the unending queue, and by then were in our minds to start for Hyderabad at a time of a day, early enough to reach before dusk. We started off for Hyderabad, the only part to look forward to being the waterfalls. One of us suggested we should ask some passersby about the place, but we would have probably had some luck if we had done the ritual of asking 25 kms earlier.
I still think the waterfall in question was actually on one of the wrong-roads we had ventured. The trip after that was a smooth ride back, stopping only for tea breaks.
All in all, by the time we reached Hyderabad, we felt triumpant that we knew the different places of visit in Srisailam.
The trip which was a succession of missed milestones and odd realizations was simply put, great fun, owing to all of ours (especially A's) enthusiasm and never-to-give-up-spirit. And ofcourse the continuous spurts of hollering laughter.

The only correct estimation we made was that we would have to halt for a night at Srisailam!

P.S "Companionship matters, and not the circumstances" exemplified!

Wednesday, July 30, 2008

'Benign' Addiction

I am in Kolkata now for a long vacation, for around two months.

I was naturally looking forward to be with my Mother who was to undergo a complete knee replacement surgery, and naturally if the home maker is on complete rest there should be someone to take care of house hold errands.

All is going as planned at home, I am spending most of the time at home, with my parents, helping whenever needed. I also get time to myself - I am indulging in my hobbies - painting, dancing, practicing yoga. In spite of everything there is always something on my mind which disturbs me. I only realized what it was while I was reading an editorial in Times of India - "A Wordy Addiction". That feeling of emptiness is attributed to my addiction to freedom and fondness for the forbidden.

I was brought up amidst a lot of restrictions, where there were colliding opinions for the simplest of things. It was purely because of difference in the thought process between generations. But when I moved out of home for work, I was all by my own and I freely indulged in a gamut of activities. In no time even without my realizing I got so used to this life style which was world apart from that in which I was brought up, that I am finding it quite difficult at home.

I don't know whether this is justified, but I feel sad and I fail to understand how that is possible - I am so fascinated to a life which I am leading just for a couple of years which is versus twenty four years of my life.

Friday, March 28, 2008

Passing thought..


It was the umpteenth time when I was taken aback by the pathetic plight of the "poor" while I was held up in a traffic jam. My mind froze upon some thoughts while I saw a couple of ill-clad children rush towards the traffic as the cars decelerated at the signal. Each of them knew exactly what to do - They are experts at putting on expressions and each of their voices was also toned well enough to drive "mercy" out of anyone. I was in an auto rickshaw as a part of that traffic jam and I could clearly make out what their "tears" were made up of. It was really shocking! I wish their parents had channelized this much of thinking into something more constructive. I wondered how these people can harness sympathy out of the passers-by but then it is rightly so I guess. It is a real pity that these children are forced into an act which I feel is worse than crime.

The traffic moved on and I was left with nothing but helplessness and remorse. I guess there are many who feel likewise but it needs immense determination and hard work to eradicate such unhealthy components from our neighborhoods which many (including me of course) don't indulge in. It is because we are too selfishly involved in our daily chores and so we think we do not have the time for these.

P.S I am not being judgmental about which course we adopt, its just a thought. But at the end of it I am genuinely happy to know there are dedicated organizations which claim to work towards improvement of the social conditions and I hope they are successful even if by a small percentage.

Monday, March 24, 2008

How 'volatile' are they?

What are volatile variables?

A variable in Java if declared volatile ensures the visibilty of the variable when shared across different threads. Lets consider a variable, say an int i and this variable is declared volatile. Now if Thread 1 changes the value of i from1 to 10 at time t = 0. At time t=1 the value of i which thread 2 reads is 10 and not 1. This is bacause for volatile variables the values which is read is the shared value, which is the most recent value of the variable.

Are they as powerful as locks?

So if the visibility of a shared variable is guaranteed, can one do away with locking with volatile variables?

Consider the following:

A Runnable Class:

public class VolatileRunnable implements Runnable{

private volatile int i;// This is a shared variable

public void run() {

for (int j = 0; j < 10000; j++) {
i++;
}
}

public int getI() {
return i;
}
}



And a main method which uses the Runnable:

public static void main(String[] args) throws InterruptedException {
VolatileRunnable r = new VolatileRunnable();
Thread t1 = new Thread(r);
Thread t2 = new Thread(r);

t1.start();
t2.start();
t1.join();
t2.join();

System.out.println("r.getI() = " + r.getI());
}


Now since the variable i is shared and declared volatile what would be the expected output? To me, going by the definition of volatile the output would be (number of threads) * 10000 (20000 in this case). On running the program I saw the output of 20000 was not always true. There were times when the output was 19445, 19667 etc.

Why is that even if the variable is declared volatile?

The operation i++ is actually a series of read, use and write operations on the variable i. Each of these individual operations are atomic but the combination of them is not.

A snapshot of time

t1 Thread 1 read (i = 3)
t2 Thread 2 read (i = 3)
t3 Thread 1 used (i + 1 = 4)
t4 Thread 2 used (i + 1 = 4)
t5 Thread 1 wrote (i = 4)
t6 Thread 2 wrote (i = 4)


This is a case of lost update. This is what would have happened when the above example was run. Some of the increments were lost and hence the non deterministic output.

Hence in this case even though the variable was volatile atomicity was not guaranteed and so synchronization is indispensable to ensure the expected outcome.

The moral:

Volatile variables are not enough when the expected behaviour in any piece of code depends on the value of a variable before any write operation.

Wednesday, January 30, 2008

Mind fresheners

Some songs carry a feeling of unknown acquaintance quite difficult to express.
They take me back in time and I enjoy the feeling though it has an element of nostalgia. I can say a sweet blend of good memories and sad ones but if I really try to identify the times it would be all in vain.

It is not for the first time these thoughts have occurred to me but I feel like penning them down today while I am listening to Ustad Rashid Khan's Aoge Jab Tum.
Yet another song which I love listening to, it encompasses a very fresh flavour with it is Jab Tassavur Mera by Ghulam Ali.
I find its extremely difficult to identify whether it is the lyric or the music that entices me but my state thereafter is just heavenly!

Sunday, July 22, 2007

These are a few of my favorite things....

I only clicked on the link http://zenhabits.net/2007/07/75-simple-pleasures-to-brighten-your-day/ thinking I would just glimpse over but there were some parts of the article which went unnoticed. I was just about to close the window when I realized how well I could relate to some of the points enlisted there. These might not necessarily brighten my day but they do leave me exhilarated for some time at least, and even more as I write about these.

So whats on my list :
  • Walking barefoot in grass - I enjoy the ticklish feeling as I walk - my feet pressing into and off the soft grass is a lovely feeling.
  • The smell of fresh uncut grass - this goes extremely well with the smell of wet earth. It leaves me rejuvenated! The latter is generally after a rain. (How about getting drenched in rain.?!!)
  • Hugging a child tightly - and what follows for most of the times is a squeak or a whimper which makes me cuddle the kid even tighter!
  • A long conversation with a good friend - all the better if over a cup of elaichi or ginger tea or coffee - It can leave me relaxed and my mood uplifted especially if I have laughed throughout the conversation. Its the same as I talk to some one unknown.
  • Acting crazy in public - Believe me its crazy! Its not that I do it intentionally - I guess that's my build - :) I get into the fits generally when I am with a good friend - (He/She should not be put off by that - and if that's the case I am put off even more! ). I knew I like being like that only when I came upon this article.
  • Being gifted with flowers and adorning my home with flowers - Buying fresh flowers every Sunday morning, arranging it on your coffee table of your living room, your dining table and bed room - what a delightful thought!!
  • Loud music - when your own voice is inaudible and you are unable to think of anything even when you want to - It can be intoxicating!
  • Enid Blyton books -I remember my school days some how (my school days are the best days of my life) I plan to have a collection of Enid Blyton books!
  • Hearing someone who can make you laugh.
I don't know if this is an exhaustive list but surely a few of my favorite things!

Wednesday, July 18, 2007

On Movies.... this and that....

The movie buff in me from time to time is active after brief periods of hibernation. If I were to describe in one sentence the kind of movies I enjoy for most of the times I would say - "Any story which reflects the director's excellence". This perhaps speaks for why I enjoy a lot of art films or maybe commercial cinemas which are based on some real incident. I am not saying I am a judge of good movie direction neither do I claim that all art movies are directed well.

Of late I have been watching a lot of Bengali films - I have liked all the movies by Satyajit Ray and Rituporno Ghosh I have seen so far. This weekend I grabbed a few VCDs - Antareen(The confined), Sati (The Ritual) and Juganto(End of an Era). These are delicacies by Mrinal Sen and Aparna Sen. I watched Antareen. Its a simple story, there is nothing very elaborate about the sets, it has only ten characters in the film, there are a total of three different locations in the film and yet the film was not seeming slow paced, it kept me engrossed till the end. Most of the films by these directors are made such. Their unique selling point undoubtedly is their story line and the subtle, intricate moves in movie direction.

I have been born and brought up in Calcutta and when I was young I remember my Father going to watch a lot of Bengali films in the theatre. One of the movies he was once trying to convince my Mother, my sisters and myself into watching was Unishe April(19th April). I think the movie had just released then. Obviously none of us agreed - I think because we were lured into watching movies with extravagant sets, good music, known actors.

I am sure it is not easy and I don't know whether I would be really doing it, but I am truly inspired to shoot a short documentary film (may be ten minutes long). It would require immense expertise I feel. I will surely think over it at least. Or is that the maximum I will do?!