Archives

All posts for the month January, 2012

Dear Reader,

This is in continuation with my previous post. Hope you liked it. Kindly leave a comment.

As i recall the moment of high energies, the time for us had finally come to leave the base camp. I still remember that i was waiting even on that day though i was literally standing on the edges of himalayas. I was anxiously waiting for this moment actually. I never in my life earlier had seen or touched or felt snow. When ever i used to see those movies i some where felt i could play in the snow the same way.

On the previous evening, we were asked us by the camp leader to strip off much weight from our ruck sacks. So as part of this process we did the best by taking the minimal cloths required since we do not take any bath for next 8 days until we return. So i packed just 2 tees and 2 tracks and 2 bottles and associated accessories.

We had a nice dinner that night and again there was a good briefing by the field director for us and to the rest of the group by informing about our departure tomorrow morning. He also gave couple of other tips and tracks. That night went well for me as i just slept dreaming about the next day.

We had a long journey to travel, i looked at the whole map which was hung up at our base camp kasol.

The altitude, the distance, nor the travel time did not matter to me at all. I just stood there for 10 mins looking at this map and thinking wow i get whole 7 days in the nature to just sip all the essence mother nature provides.

I woke up next morning around 6 and get ready with all the bag packs tucked in and tent cleaned up for the next batch. A nice breakfast with nice tea was served, after which under directors presence snacks was packed for us for our journey ahead. It was around 8 or so we all assembled with our back ups ready. One thing all along we maintained was a nice discipline with proper queue system. He wished us good luck and briefed a bit about progress of our previous batch. Then a nice send off applaud was shown for us departure. With all smiling faces and happy moments in our heart we just left our base camp. The sun was bright shining upon us, we waved adieu for every body and with a full discipline left the premises. A guide is always accompanied with every batch. This guide who joined us from base camp to the next camp was really a nice person and basically was from the same place kasol.

Along with this, a senior fellow is appointed as a group/batch leader who takes care of our group. Our batch was of 49 folks and there were couple of oldies too, but highly energetic. Among 49 folks, we were around 22. So ours was the biggest noisy funny group in the this batch. All along the path we kept making jokes, teasing others. The path was mostly inside the dense forest, so alot of shades and a good weather kept us with high energy and highly keen to move on. All along the path we had a nice view of the sourrounding mountains with god’s created white hat as a gift. It was soo beautiful to look at them so close. Every way i looked, there was a snow capped mountain stood there proud and beautiful. The sun rays falling up the snow cap made it even look amazing and thrilling.

With the eyes full of astound nature and all around birds chirping it was a pleasant gift from the mother nature to us. It was a real deal to walk in these woods with all these happening around me. On the way in this dense wooded forest we encountered a small water stream which looked amazing and beautiful with its shiny water due to the glimpse kisses of sun shine and the green vegetation around it.

As we walked and walked all along the wooded region with carpet like greenery all around us, it was a treat for our eyes to just stare at them and walk further. We almost took 5 hours or so to reach our first camp. The camp was situated near by a village, which had hardly few houses. On the way towards this camp of ours, we stopped by few of the houses and took couple of snaps with the local villagers as well. The view, the surrounding, and the snow capped mountains all around gave us a very good feeling and filled us with an high energy. It was almost evening when we reached our camp.

One amazing thing which happens as we ascend the altitude is the rapid changes of weather. Before we even could reach our camp, it started raining. The camp along with the greenery just pleases ones eye and makes self stumble upon its beauty. I really enjoyed being at this camp and just looking at the nature. I really wish i could spend the whole life looking at this beautiful nature.

As you can see in the above image, it was almost evening by the time we all got antiquated. A hot nice coffee/tea was served along with a snacks. We still had time before the sun really went down. So we all thought, why not just have a game. So we all decided with the local village kids to play kabbadi.

It was night on that day, we were all kinda tired but still had high energies filled inside due to this immense beautiful nature. We all went back to our tents. Each tent was equipped with 14-16 beds (sleeping bags) depending on the size. So it was almost bed time and our team just gathered inside our tent for heavy discussions, jokes and bit of masti.. ;)

One big happy trekking family i would say :D

Oh before i forget the topic of grahan, it was a pleasure for us to meet a nice cute girl of kasol village, who came along with us by selling biscuits, frootie, etc. She and her cousin put up small stalls all along our path trying to sell and make money. I wonder how strong she was. Before we reach certain point, she and her cousin used to be there long time back. They always take a short cut route i belive. But still with such heavy sack on her back, she was strong, but alas gorgeous in her own ways ;) . So i invited her to have a pic with me. ;)

It was the next day, we got all as usual ready. Had fresh nice tea, nice breakfast and a some thing for packed lunch. By around 8 AM we left the camp as usual in line and good discipline. Our next stop was Padri. It was at 9.3K feet altitude. The weather was nice and pleasant. We did not feel any heat though sun was bright and shiny and sky was almost clear. This time, the nature around us was not a dense wooded area as before. It was just rocks and sand. But here and there we had small bushes were we could rest for a bit. As i said, no matter how bright the sun was, it was always sweet, cold breeze which kept us from sweat. We started to climb, along our way we encountered few good water streams. It was nice to sip that flowing water, damn even bottled water was not so pure. It was good in its own ways. Every sip boosted our energy. Every gulp internally felt as if it was a amrutham (powerful drink).

We kept walking all this forest, unfortunately we did not encounter any animals so far. Fortunately this girl reshma and her cousin kept walking with us for couple of distance. After which they had to say adieu to us as they do not climb any more and they should return back to their village for tomorrows batch as well as refill their sack. So we all said goodbye and they disappeared on the edge of the hill. So for couple of hours we kept walking and walking.. All along the way we kept making big noise with alot of jokes and pulling legs of each other. It was fun ride though.

We all just immersed ourselves in the comedy about each others and we were laughing like any thing. Suddenly a voice screamed in a distance in front of us saying the padri camp is very near. Couple of guys already reached and they started expressing their enthusiasm. At first we thought they might too kiddish and stupid to act like that.

The area around the camp was covered by similar trees but densely packed. As many books says, the heaven door opens up with alot of beauty in it. Alas it was the same expression on all our faces. As soon as we stepped out of this canopy, for a minute we stood there starring at the huge field of greeny sourrended by snow mountains and all along this green land couple of animals was grazing. It was really a wonderful view i ever seen in my life even on tv.

This scenery just made my blood shoot up. It was a thrilling view. This place must be a heaven i thought for a minute. I was almost day dreaming about this place while i stood there glazing on it. At this point of time, the sun shine slowly made the snow capped mountain look even more beautiful. Although i had looked at this kinda mountain earlier but this time it was very close by. I enjoyed this view alot. Infact we all just threw away our bags in the tents and just enjoyed the nature for like an hour or so.

This place was even more amazing and pleasant than i thought. At one side of this place had a nice waterfall. Which was really amazing. At the end of the waterfall there was a big ice glacier. Totally the view of this place was similar to my dream heaven. So folks plan for your honeymoon then :D lol

From distance, this water fall was very beautiful. Thought the water stream was very scarce, but the beauty in it was amazing. At the bottom of this fall was a very thick ice glacier. Though the bad thing was that it was fully covered with alot of dust and leaves, so its real beauty lay hidden. We did spend couple of hours looking at this glacier. The local villagers near do come here and worship it. They do consider this place as very sacred. This pure water is merely polluted.

We even consumed it for every possible purposes. But it was too damn cold. Every hand dip in this water make our hand go numb. There is no other way go, except to enjoy this cold freezing water. Thank god we did had to take bath in it. Or else i would remember Bear Grylls taking a skinny dip in frozen water at Alaskan frozen forest.

Click to view bigger imageOne of our team member Sanjay was very smart professional photographer. He managed to get the very sharp picture of this fall. At that moment we did not see the effect. He really took his time to get this amazing pic.

This is another pic which i really love to look at. Its amazing to see those fine grains of water stream. Amazing photography.

Click to view bigger image

Having all the fun needed that evening, we had nice hot tea/coffee in that beautiful heaven. We as well did enjoy the sun set and its dusk light falling on the snow mountains. As usual, that night we spend just by talking, kidding, etc. while we were watching moonlight. The weather was quite chilling in the evening. As the night goes on, the temperature would drop close to 0C. Thankfully we were provided sleeping bags which were in very good condition. So we had a nice sleep. Thanks to YHAI.

The next morning i woke up as early as 5 AM. I was sure that i would really a get a nice sunrise rays over the mountains. So i stood outside of our tent watching those mountains. By 5.30 the sun began to rise, so slowly we got the sunrise over the mountains which was amazing to see. A small wind blowing over those mountains would take away the melting snow with it. Watching this was a god gift to me while many guys were lazy sleeping inside tent.

Today, as usual we all got ready around 8, with our packed lunch ready we left the place to our next camp Ratapani. This place is what the villagers believe the source of water source for them. Hence they call it RataPani (Rata = Brings, Pani = water). So to speak we kept going towards this place while we just drawing more information from our guide all along the journey. Infact, we did not know this journey was more tougher and more longer than others so far. In many places, the steap of climb was like 80 angle. So it was really tough to climb on snow at this steep. Atlast we reached the camp. This camp was located at one of the best view spot. The nature around this location was immensely beauty and vast. We could see the farther end of the earth, atleast thats what it feels when one looks at the far edge of the himalayas.

As always, we reached this place pretty early by around 3 PM. Though the climb for this place was kind of tough, still we managed to complete pretty early. As usual, couple of snaps taken at this spot. Then we waited for the dusk with a nice coffee and snacks. From now on we started to feel the real deal cold. It starts to get cold and chill pretty soon. The wind blowing make the cold much worse for us. Some how we passed the night. Though it was a bit windy and terribly cold in the night. Our camp leader said the temp do drops below 0 at this point at night. So it was pretty cool that we did spend at such low temperature :)

The next morning, again as usual we just woke up and had a good sunrise which was really good.

Having enjoyed this sunrise at this camp, we all got ready and once again with the command of our camp leader we marched towards our next camp Nagaru. Apparently we were told by our camp leader that the next camp is very near to this camp and you shall reach that place in just around 4 hours.

Thanking him and every other camp leaders so far we started our journey as kids in a line. The queue and the spot was so good, one of our fellow member took a snap of it. Apparently few others who were not part of this trek did like this pic. Even i do the same, and ever since this pic is one of my wallpaper ;)

This morning was a bright sunny, the wind was a bit warmer yet it was a bit cold too. So we did not feel its much effect on us. We just started off from this beautiful heaven. We slowly marched towards our next camp.

We have been told by our camp leader that the next camp distance is pretty short as we should be reaching it pretty early. So that we get enough/adequate rest.

As said, we hurried towards our next camp Nagaru. Well this camp is the final or top camp for the whole trek. After which we shall start to descend towards our original base camp kasol, though our route would not reach there.

Any ways, i was bit sad at this point because i felt a bit of enthusiasm and inspiration was just lost by listening to the camp leader saying that would be the top point. So all my climbing fun is over in just couple of hours more. Thinking about this constantly in my mind i just started to move all along with the rest of the group.

The look at our next route was just breath taking actually. It was very steep.  We some how did our best to climb this path. Some part of this steep path was filled in snow.

Its not easy as you night think to climb on the snow. Holding hand the snow covered rocks is damn tough as we would feel numbness thus loosing the grip.

But it was really thrilling to complete this path. Our legs kinda started to pain, as the rocky part of this mountain was hard part of us to climb.

Though some of ours surroundings were covered in snow, still the heat was kinda more. Having all this issues, our constant goal kept us going forward.

Along the edge of the snow patches, we walked/climbed with tasting the wildness of the nature around. We did spend some quality time in this rocky mountains just watching the nature. It was idially amazing. We could see the much farther end of the mountains range than we could in raatapani.

We had a local store kept by one of the village guy to serve us with couple of things he had. They are really nice people. I just stood there having some thing to eat and drink while enjoying the nature around. Where ever i go on this nature, i was absolutely stumbled upon by the mother nature.

This is where i would happily whole heatedly standup and salute to her greatness. Although the whole land looks pretty worse and harsh, but really the one who finds the way to lead a life is the luckiest of all.

I still do remember that standing at that point and looking at the nature, i felt whats the use of earning millions when you can not really enjoy this amazing beauty. Money is nothing in front of this nature beauty.

After enjoying a nice snacks and a drink, we kept along with our journey. In another 2 hours we reached our top i.e Nagaru camp. This camp was situated on top of this mountain almost about 13.5K altitude. It was really good to see the breathtaking view around. We were fully covered by snow mountains. Where ever we step our foot it was snow. It was very beautiful. Since we reached very early, we were told to take rest because the next morning we shall be leaving very early by 3 AM or so because we had to walk very long around 15 KMs on snow itself. So based on that, every one of us just spend rest of the evening quite and taking few pics around. We consumed a good amount of liquids and finally dinner was ready. The weather was quite warm till evening, and we enjoyed the views around. After which it started to fall down, thus we all ended up inside our tent chatting and making noise.

The next day started at 3AM….

Thanks for reading. Hope you enjoyed :)

Oh before i end this post, it gives me a great pleasure to share this small info about this awesome female dog which accompanied us the whole trekking. Every day i used to feed her the food from my share of roti’s. I still do have no idea where she got lost in the end when we were finishing our trek route. But anyways all along for couple of days i did really enjoyed her company :)

My little cute baby sister

Dear All,

Today is a very sad day for me. I woke up to have a bad news being presented to me. The one of the worst day so far. One of our beloved dog sweety (Golden retriever) left us in grief. There are no words to describe her. We raised her since she was a kid. All her life she was so active, so smart, intelligent and very emotionally attached. She used to be one of the team member of our cricket game. She used to enjoy picking up the ball for us.

I still remember passer-by folks just stop and stair at her and get surprised when she used to play the ball. She used to love the ball so much. It’s a sad thing that she is no more for us to see her charms. It’s just the memories she has left in our hearts.

She was very attached to us. She would not let any of us go away even for a moment. Perhaps a true female nature? May be. But no matter how touchy and attached she was, she always made her presence appealing, cuddling and loving. Every of her moves used to bring us a giggle/smile on our face.

She always made her presence by making a different noise when she founds out that we are not giving her any importance at that moment. Every guest to our house noticed her charm, i still remember they used to get alot of information about her. Even many folks have asked if she could have babies. Her actions, her moves, her cute face, cute little act always impressed every one around.

Every kid in the neighborhood is her friend, every elder person in the neighborhood is her pal. She used to treat every one so kind and so loving. Every one has literally liked her. It’s a real shame that we have lost her. I may never find the same loving baby sister again. We can never feel her touch, her sounds, etc. Its all just a memory now.

Lately for past couple of days she was very sick, she could barely move, barely eat, barely sleep, barely breath. Doctor did not give us any hope, as she had crossed her natural average age limit of 12 years (breed dogs avg age is 10 max) but still we did all our best to save her. Since 2 days her health deteriorated more than before. She dropped to her ground in instance, she could barely sleep, and breath. Every breath of her was audible to us. It was in struggle. We all prayed god for giving her a peaceful death. But sadly god gave her a painful death. A death with alot of breathing problems, vomiting, and sickness he finally took her today (12 Jan 2012) early morning around 3-4 AM.

This is the second loss for us since our other senior female dog Rani passed 3 years back. We still many times remember her in many situations. She was a unique kid in her own ways. She too was emotionally attached with us. She spent her 19 years wonderfully with us. God did give her a peaceful death. Till the last moment she did not have any major health issues nor sickness. Only a small injury on the leg made her not so active, as she could not handle that pain at that old age. Still she remain in our memories and heart.

step-to-heaven-map

 Dear Reader,

Today’s post is not on any geeky nerdy topics. It’s all about a topic which was a remarkable event of my life. The one and only event so far which always refreshes me all the time. Its memories still brings high spirits.

Though i should have written this blog post around 6 months back, i really wonder why i failed to do so. Perhaps my intention of having a blog at first was to have only nerdy, geeky stuffs. But lately i realized that, blog with just tech stuffs would not make any sense since i am not a complete nerd. I am half geek too, with other qualities.

It all got started somewhere around September – November 2010 in my ex company cab with my ex-colleague also a current good friend. He and his couple of friends had done another himalayan trekking called saurkundi pass in 2008. He always used to talk about it every once in a while. He used to correlate every situation viz funny, serious, adventure, problem, etc. to one of the incident in that trekking. May be at that time i never thought i would take trekking as one of my serious hobby. Although i had done 1 trekking (Kodachadri) before this with few of my other friends, but never was serious about it. It was a casual thing i thought i shall do when ever friends group up.

But at this time, my work was getting frustrated and so is the life. By then my days was just work and home and nothing else. My stupid project went for a toss and all i and other friend had to do was to work 16 hrs a day for almost 5 months continuously with out a break to fix alot of issues in the core which was messed up by earlier folks. Although we did our best to bring it up to a considerable stable state which for us was a very relieved moment but we both were zombies by then. But sooner the news came up that we still have alot more mess to clean up. So again the routine started. Life became hell for us. For me, this job started to suck to the core and became frustrating.

Thats where i started to think i needed a change. I definitely need to move and this is not a life. But before i started to apply for my new job, i wanted break, perhaps a big break. At that moment it occurred to me that i need to do some thing wild, some thing amazing, some thing adventurous so that i could rejuvenate my life once again.

At that moment i got a call from my same friend who said they are planning to go for similar himalayan trekking next year called sarpass and he asked me if i wanted to join.

Trust me, i was waiting for this, i wanted to hear this, i never though i would do some thing wild sooner in my life. Perhaps it was a bless to me, i wonder!! I just said YESSSSSS without even thinking twice. Nothing kept me worried, for the whole day i started to dream.

Since then onwards, i along with him and his friends started to exchange emails, i no more cared for this stupid sucking job. I kept doing some research about this sarpass trek. I started to see videos, reading blogs and pictures from the past trekkers. I even joined a forum called indiamike.com where i learned and discussed alot about sarpass trekking. By this time, it was Jan/Feb 2011 where in i already got a good news about my project, the management decided to stop it for purely budget reasons. It was a complete relief. It’s this time i can completely concentrate about this trekking. Nothing else cared, even the current status of not having any project for next couple of days/months too did not concern me at all.

A Long Journey:

It was early Feb 2011, we had booked our tickets and as well as booked YHAI slots on May 8th batch for this trekking. But noting else was planned nor thought about. For sure i was pretty hell excited as ever. Every moment i was excited, every moment i was awaiting for May 8th. I used to spend most part of my day just googling about sarpass.

It’s now early March 2011 and i still have not prepared myself for this trekking, for sure i was convinced that it could be a bit difficult. So by end of march i started to plan my itinerary for this trek. You can get the itinerary details at indiamike.com forum.

Early may, i was still waiting for the special day. Every day pass by, i was super excited. There was no one outside office with whom i did not speak about.

So by now we had planned our whole journey. We did not want to short it in any way, time constraint was no problem. We had whole 15 days time ahead of us. Only thing was how to utilize the time efficiently. So we all met in Jan/Fed and decided that we shall take a different route, where in we shall fly to delhi and then take a train to Kalka and then to shimla. From shimla hire a vehicle to kasol base camp.

This long journey helps us to get alot of sight-seeing which was our plan though it would consume alot of time. But trust me it was alot worthy ride which in a while you shall get to know ;)

A Spectacular Nature:

So as part of this long journey plan, we departed bangalore on 7th morning. It was a good cheap Jetlight, if i can remember one of the hostess was hot on whom i had kept one eye all time :P Sadly i did not take her pic :(

The flight journey was enjoyed by me, it was just 2.5 hours and unlike my last flight to mumbai which was shaky. So we landed in delhi somewhere around 1PM. Then we some how spend the whole day. It was pretty sunny day so for most part of the day we did spend time in either AC hotels or shades. Man o man, the delhi traffic is quite bad than bangalore. Oh not to forget, the chicks there are hot as well. Guess they add up for a bit delhi warming ;)

That night from delhi we had a train booked to kalka. The actual train was supposed to arrive around 9PM, but oh my goodness it arrived around 11PM. Let remind you that the station was too damn dirty and nowhere to sit. So we were tired of standing for hours together. Thankfully there was KFC to fulfill our starvation.

So it was a pleasant night journey in the train, as always our laloo trains is damn dirty as himself. So it was horribly maintained including the washroom. Thankfully we had to just spend a night before we reached kalka station. Around 8 AM was our Heritage train to kalka and good thing is that it’s a connecting train. So we are relived of late arrival.

This heritage train is a very small train which is available for only on bookings, so it was really maintained well and it does not stops till shimla except one place which is a junction. So the climate now has changed entirely, it was bit windy and a bit cold. But thankfully no more heat. A hot tea and biscuits was served before the train actually started. This heritage train was very small and it travels all along the hilly region like else where on earth. So its slow and the track is 6 hrs long before it reaches shimla. The train started around 9 AM and all along the path it was a worthy sight seeing. We enjoyed alot in this train, along the way breakfast was served which was another good thing about this train. Once we reached shimla around noon we had a snacks available in the road side shops and waited for the guys to come back with hired vehicle. Till then i was just standing with the guys starring chicks ;) It was a fun time though.

In an hour or so, our guys came back with the vehicle for us to depart for kasol where in our base camp was situated. We had to get enrolled there for the 8th batch which was the next day. So on the way to kasol, around 10 PM we stopped at a hotel called Himalayan village, which was a real good one for honeymooner. It was situated on the banks of parvathi river and has a very scenic view of the snow mountains. It has a backyard gardens neatly maintained and a rooms on big pillar with good privacy. So romantic guys, think this as an option for your beautiful honeymoon ;) .

So around 1 AM we reached our base camp kasol for getting enrolled. Thanks to the camp leader who co-operated very well at that point of time with out even creating issues. We all got our tents. The base camp was properly organized and neatly maintained. I really appreciate the way it was organized by the volunteers. Oh it was a bit cold in the night, but the sleeping bags provided was enough to put us into a good sleep.

The next day we woke up, refreshed ourselves, first thing we did was to wander around the tents see who all are present and then look at the other end of field where girls tent was present. For a while we did checked out all the good ones and then went for breakfast. Then there was this briefing held by the field director about YHAI and this trekking and DOs and DONTs, etc. It went on for an hour. Then they left us for roam around. So first day was just a free day. We all just roamed here and there around the base camp, couple of our guys went to the nearby village but we just did our talking and few of us slept the whole afternoon since we got tired of all traveling the previous night.

As part of the plan, first 3 days will be just acclimatization for us. So first day just went on by talking, starring ;) and then sleeping in our tents. We did not cared to do any thing. Food was just purly north indian style. So it was OK OK. Next morning, we are forced to wake up around 6 AM. Damn in that cold with such a hot sleeping bags, who wishes to wake up so early? But we were made to do so by the field instructors. We are asked to get ready in just 15 mins, after that we are taken to a nearby field for a long exercise.  So a good jogging and a few mins of work out did do good for our body i guess. We had breakfast and then we were told that we need to take a short trekking with a bit of luggage (mainly ruck sack, water and eatables). So we all got ready for this short trek and proceeded. It was a near by mountain we had to climb. We climbed around an hour or so to reach a certain level. Once we finished this trek. This day too just went as usual the same. One thing still amazes me of how a day used to pass on. I always used to wonder man the day just runs so fast even though we did not have any thing to do nor spend time with. Just talk and look at the nature around.

The third day has come, today as usual 6 AM drill, then we were told that we would be having a rock climbing and repelling activity as part of the trekking/hiking program. So we all got thrilled and walked around 1 KM or so. There we started over activity. It was really tiring and thrilling.

Rock climbing seems soo easy, but when i got on there, damn every thing started to feel damn hectic. No energy to climb or pull myself. No grip on the rock either, phew somehow made it to the top though it looks like a small doable mountain. Now i wonder how difficult climbing is when you’re at 25K feet on mount everest.

One the way back we met a couple of Israelis who were enjoying alot in that location. Damn those folks, alot of money and still they enjoy life. We have money, but do not enjoy. What a shame and wasteful life we lead!!  So we came back to our base camp and finally we had some thing for the lunch. We were starving from heavy lifting :D . So we had nice lunch and then a good sleep. Evening we all got refreshed and i knew that for next 10 days we shall be in the mountains roaming without bath. So i somehow decided to take the most thrilling bath ever. The river flowing next the base camp was consumed for every purpose. As you know this rivers flows directly from snow mountains. So its temperature was around 5 Centigrade. Did spend in the bathroom for about 15 mins taking this coldest shower. Remembering it still gives me goose bumps today. But i must tell ya, it was a thrilling experience with this too. Though you might think that such a cold water could ruin your health badly, but man we are soo wrong. Nature has the most and best healing powers. So that coldest water had all the healing powers it has and protection too. So for me nothing happened on that day and for the next 10 days. Before i went to bed, i was all cleaned up and fresh for the supper. We had a nice supper and a nice chat with the director for a while. Then we just went around the village and came back around 11 PM for the bed.

Next day is a big day. No 6 AM drills, No short trek, No other activity. This next journey was beautiful….

Thats all for this post my friend. Shall post remaining in the next post soon.

Thanks for reading :)

photogallery

Dear Reader,

Today i was fixing a bug w.r.t event handling. So as part of this there were couple of forms (classes basically) which were trying to hook to an KeyDown events and unhooking upon disposed. Basically the requirement is, for every customized control in the forms/panel, this keydown event should be hooked. So no matter which ever control (child/parent) has the focus, keydown event has to get fired. So as part of this implementation, the code goes like this:

Hooking events:
public void HookingEvents()
{
    IEnumerable < Controls > allControls =
            CollectUIControlsHelper.Instance.CollectAllControls(this);

    foreach (Control ctrl in allControls)
    {
        ctrl.KeyDown += new KeyEventHandler(OnControlKeyDownHandler);
    }
}

UnHooking events (Part of Dispose call):
public void UnHookingEvents()
{
    IEnumerable < Controls > allControls =
           CollectUIControlsHelper.Instance.CollectAllControls(this);

    foreach (Control ctrl in allControls)
    {
        ctrl.KeyDown -= new KeyEventHandler(OnControlKeyDownHandler);
    }
}

As you can see from the above code, its pretty clear that the first method is just collecting all the controls from parent to child from the current form/panel/control via a method CollectAllControls(this). And does the opposite in UnhookingEvents. Do note that these methods are called in any fashion by the usage code. Hence every call has to fetch all the child controls.

Yes i do agree that this code is noting of great. But the annoying thing for me or primary concern for me was to see this code getting repetitive in many forms or classes across my application.

So i wanted to make this above code perhaps more common so that any form which wishes to hook for Keydown events can just reuse this code. As part of that effort, i came up with this simple solution as shown in the below code:

class KeyDownEventsHelper
{
    private static readonly KeyDownEventsHelper m_Instance =
             new KeyDownEventsHelper();

    public static KeyDownEventsHelper Instance
                   { get { return m_Instance; } }

    private KeyDownEventsHelper() { }
    static KeyDownEventsHelper() { }

    public void HookingEvents(Control control,
             Action<object,KeyEventArgs> eventHandler)
    {
        IEnumerable < Control > allControls =
          CollectUIControlsHelper.Instance.CollectAllControls(control);

        foreach (Control ctrl in allControls)
        {
            ctrl.KeyDown += new KeyEventHandler(eventHandler);
        }
    }

    public void UnHookingEvents(Control control,
            Action<object, KeyEventArgs> eventHandler)
    {
        IEnumerable < Control > allControls =
          CollectUIControlsHelper.Instance.CollectAllControls(control);

        foreach (Control ctrl in allControls)
        {
            ctrl.KeyDown -= new KeyEventHandler(eventHandler);
        }
    }
}

As you can see from the above code, it is a singleton class which publishes 2 methods for hooking and unhooking. So as part of the this methods, i have provided a delegate for the event handler to invoke upon any events generated. So each class can provide its own even handlers for hooking.

Now i am feeling a bit relaxed as i could reduce around 8 lines of code getting repeated over in many different forms/classes couple of times. So as of now, i could find 4 classes/forms which are repeating this above code, so thus i could save around 32 lines altogether.

I do agree that there is still alot room for improvement. How ever at the moment i can not foresee those improvements. It would kind and great of you as a reader to suggest me those improvements.

My next concentration would be to refactor the event handlers for KeyDown so that i can minimize the implementation code. May be i shall add a base class to all of those classes which has a virtual method having common code and in the derived i invoke first base and then implement few more code.

Thanks and Happy Coding :)

Update: As part of this refactoring, today i found out few more places in my code base which could reuse this common code, such a way now i could save around 60 lines of raw code getting repeated to just few lines. I am finally happy and satisfied :)