Sunday, September 28, 2014

My Second Brevet - 300 BRM Freedom Ride

After completing 200 BRM on June 21st 2013 (ECR Classic 200 BRM) was enjoying the success for too long that I didn't practice for quiet sometime. Even registered for 400 BRM for July but dropped out on last minute as I wasn't feeling well. During that period Kandappa Sir posted in Madras Randonneurs about a crash course he is willing to take for folks who are interested in attempting 200 / 300 BRM. Didn't think twice before requesting him to consider me as well and from then on no looking back. Took the practice rides seriously and followed it religiously. 

Me and my worries!

Couple of things I was worried about were:

  • I have never rode during night time on highway and was little worried on whether my headlight would be powerful enough to show me the way. 
  • Never during a ride I had ate anything apart from energy bar, tender coconut, Gatorade or Juices. But for a 20 hours ride one can't survive like that alone.

To overcome this fear I decided to face it and see what exactly happens instead of sitting on a sofa with a worried face. On 27th July started my ride after sunset. Chose Ramapuram - Porur toll gate - Tambaram and Loopback to Ramapuram as a route which I had never rode before. Once I crossed Porur toll gate after few minutes it was pitch dark and I was depending only on my Headlight. The fear was there for few minutes so I was pedaling as slow as possible and then I got used to the situation. After 10 minutes it became like a meditation - Me, My cycle and the Road that's it. I covered 41 kms in 1 hr 54 mins and felt more comfortable on handling the night portion of the event.

On 3rd August took a long ride on NH45 along with my friends and chose that to be my practice ride for eating during the ride and try to do the whole stretch in 2 - 7 gear combination as much as possible. Started at 4.15 AM and we reached Maduranthakam by 8.15 AM. Took breakfast there and was hoping my stomach doesn't get upset with my new decision :) Reached home at 2:15 PM and all was well.

Let's go Shopping

On the day before the event visited Nuts n Spices in Nandambakkam to purchase few things needed for the ride. Bought Gatorade and Energy bar but the more time i spent there more I was feeling that everything would come in handy on the ride day :) 

Ok the fun(?!?) part was I didn't even carry 1/4 of what I had purchased as my backpack was overweight already :) Btw do we really need to carry a backpack? That's a debate for another day but I am used to carrying 3 to 4 kg with me so no issues.

Get - Set - Go

Arrived on the venue just 5 minutes before start, got the cycle inspected and Brevet card sealed by Partha quickly. As did on my earlier BRM again started slowly and rode under 20 kmph for ~15 minutes before settling on my regular speed. Mid way to the first control point met Raghav, SaiRam and from then on we rode together. The plan was to ride along with Raghav till the second control point (102 kms) where he would take the U turn towards Chennai while myself and SaiRam would continue our 300 Kms journey.

On the Vandallur - Kelambakkam stretch got a chance to meet Vel Annamalai (One of the few persons in Chennai who have completed 1000 kms already). We rode together for few minutes before he sped away. After crossing Chengalpattu toll gate had our breakfast at Hotel Nellai and reached the second control point at 10.56 AM. Varun Spike, Vallab was manning this control point and Vallab was seen doing some stretches for another rider.

By the time we reached the control points all water CANs have already been emptied by other riders :) That's where my backup Gatorade bottles came handy. Refilled our water bottles in a shop after crossing Melmaruvathur and then continued our journey towards the 3rd control point @ 152 kms. 

Mentally started noting down hotels on the way - 18 kms before U turn point Vasantha Bhavan (veg), 12 kms before U turn point there was another Veg hotel, Hardly 2 kms from U turn Point Hotel Anjapaar (Non Veg) just in case we didn't find any good hotels near the control point where prepared to ride to one of these hotel to have our Lunch.

At last reached that control point at 1.35 PM and Guru welcomed us with some good photo clicks. We rested for few mins and took the U turn towards Chennai. Both of us first thought of having our lunch at Anjapaar as its logical to go to the nearest hotel. But on nearing that place we were not so comfortable and decided lets go to the next one at 12 kms. Just stopped to buy couple of water bottles and continued our ride towards the next hotel. On reaching that SaiRam didn't like it because there wasn't any customers in the hotel at that time so decided to go to Vasantha Bhavan itself :) So started riding for another 6 kms for lunch. Had full meals and started to continue our return journey. Few mins into the ride noticed the first problem of the day! Was not able to bring the gear down to 2 - 6 :( Tried my best but the shifter was too hard and because of the fear that it might break I stopped trying further and decided to ride the remaining distance in 2 -7 itself. Though it wasn't so tough on a flat surface but climbing bridges was really challenging. 

Unlike 200 BRM the terrain wasn't flat and there were lots of bridges to climb - was wondering why the hell do they need to build so many bridges :) The below image posted in MR FB page sometime back is what came to my mind immediately.

During this period as well we did manage an Average of around 21 kmph and as planned halted at Sangeetha Restaurant in Vandallur for dinner. That's where started getting the pain back on the ligament tear which I had very long time back on my left knee. I still believe this should be because of the extra strain on my legs as I wasn't able to bring down the gear since ~175km point.

Post dinner took the Vandallur - Kelambakkam road and was really surprised to see the roads weren't properly lit!! I believe there are many colleges on that stretch and at least they should take steps to have proper road lights on that stretch for safety of their college hostel students.

Reached the next control point which is an ATM at 9.10 PM. It wasn't working so took a snap in-front of the ATM along with SaiRam and started riding towards Velachery Just Buy Cycles (Finish Point) which we managed to reach at 10.28 PM.

Very happy to have completed 300 Kms ride comfortably and after resting for sometime thought of riding back home which is just another 12 kms. As the mind knows that the event is over it started finding reasons for not riding back home. So after phoenix mall took an auto and loaded my bike in it and started to return home. The auto driver was curious on what I have been up to with my cycle at this time of the day :) tried explaining him about the event and looks like he was quite impressed. On reaching home gave Rs. 250 which he had actually asked for that short 12 Kms distance claiming late night!!, tough to get customers from there to his home etc., but to my surprise he returned Rs. 100 and said that's enough sir. He asked me to take care of my health and get some hot water bath that night :) 

Overall the training scheduled provided by Kandappa sir was really useful and it prepared me physically and mentally for the ride. Thanks a lot sir. Looking forward for your training schedules for 400 BRM now :)

Hope you enjoyed reading my experience! Happy Cycling.

Friday, August 29, 2014

Type of Bike / Cycle to buy

Since lately I have been posting my cycling adventures in my Facebook account many of my friends have been asking suggestions on "What types of cycle should I buy?", "Tell me the best Brand of cycle to buy" etc.,

Though I am not an expert on this yet thought of sharing what I understood till now and leave for the experts to comment and help me correct any content which they feel might be misleading for the readers.

My Top 4 Learning as of now

1. DON'T just go by Brand
2. Fix your Budget - Because there are bikes from few thousands to 2+ Lakhs :)
3. Be clear on what sort of terrain you plan to ride / Major purpose of this investment
4. Test as many cycles, brands as possible and see which one YOU are comfortable with.

Majorly these are the 3 types of bikes I tested: Road Bikes, Mountain Bikes (MTB) and Hybrid Bikes.

I had always loved the Brand Cannondale and Bianchi a lot. So I had made up my mind to buy only one of these brands. But after test riding ended up buying Scott Sportster x20 - Its an Hybrid.

Let me jolt down my version of difference between these 3 types of bikes and why I went for Hybrid version.

Road Bike - For me anytime its the stylish of the lot and most of the time it has a drop (handle) bar. All bikes I had tried have been lightweight with very sleek tires. Out of the 3 types of bikes this was faster as well. Unless you tend to ride ONLY on properly laid road (tarmac) and have a budget of INR 50K+ this option is ruled out.

Mountain Bike (MTB) - When I tried out MTB felt it to be little heavy when compared with the other 2 types of bikes. It had bulky tires which is called as Knobby tires. If majority of the time you would be doing off-roading then this is the type of bike for you. I tried it on a proper tarmac road (as that is the terrain am majorly interested in) and felt to be little slower than Road / Hybrid bikes. I don't remember the price range now but i think any decent MTB would cost upwards of INR 25K+ as well.

Hybrid Bike - Its a mix of Road and MTB!! Based on the bikes I had tried this was slightly heavier than Road Bikes but lighter than MTB. This had the straight / flat handle bar as MTB. Tires weren't so sleek as Road bike but definitely sleeker than that of MTB. Found it to be faster than MTB and less energy consuming. This can be used to ride on properly laid road as well as some sort of light off-roading :) I believe we can get Hybrids for around INR 15K or 25K range.

My main purpose was to commute to office and also use the same bike for Endurance rides organized by Tamilnadu Cycling Club and Madras Randonneurs. The budget I had in my mind was max INR 25 or 30K (inclusive of all accessories). So Road bike was straight away ruled out for me.

With that budget I could have gone for either MTB or Hybrid. But based on test riding I felt doing long distance endurance rides with MTB (say 100+ kms) might need to use more energy than if done with Hybrid. So ended up buying the Hybrid bike which I have now.

FYI - cycles comes with shock observers, disc brakes etc., as well (mine doesn't have it though). But bottom-line more the features you are going to expect more you might want to shell out from your pocket.

As of now very happy with my decision and in 2014 till now have cycled 4900+ kms out of which ~1500 kms of Office commute, have done multiple 100 kms rides as well as completed 200, 300 BRM using the same bike. Hoping to try out 400 BRM also with this and beyond that would be too much of stretch and not very sure as of now.

Happy Cycling!

Saturday, August 09, 2014

My First Brevet - ECR Classic 200 BRM

During March 2014, after completing my first TCC 100 Kms ride in less than 4 hrs 30 mins decided that I should attempt BRM 200 in June. 


I wasn't having any friends who are into cycling at that time so wasn't too sure on what sort of practice is needed for this. I am used to cycling all alone and my only group event was TCC 100 Kms ride till now.

So all I did was as much as possible daily 1 hour (20 to 25 kms) of cycling and over the weekend i extended it to 2 to 3 hours. I made sure to take a rest day after every 2 days of ride. Used to carry two bottles one filled with water and another one filled with Gatorade. As a backup will also carry two more Gatorade bottles in my backpack along with 4 energy bars. Reason being I want to get used to that drink and energy bar which I plan to use on the event day as well.

Things to carry on a 200 BRM:

This is in no way an exhaustive list I am just documenting what I carried and found it useful. Hope it would be useful for someone someday in future!

1. Helmet
2. Gloves
3. Two Water Bottles
4. Four Energy Bars
5. Gatorade - Either bottles or Pouches
6. Two Spare Tubes
7. Puncture Kit
8. Reflective Vest
9. Sunglasses (I bought sunglasses with custom power based on my eye power) 
10. Money - Convert change and keep it. During the ride if you want to buy something would come in handy.
11. Must have an ATM card - Few control points would be unmanned so we need to take ATM slip as proof of reaching that point on time.
12. Cycling SpeedoMeter - Will come in handy to know how far it is to the next destination and also to monitor the (avg) speed we are maintaining
13. Tail Light (Red Color) - Have spare batteries handy
14. Head Light (White Color) - Have spare batteries handy
15. Pump
16. Cycling Shorts & Jersey
17. Ziploc - Had my smartphone, money, ATM card, Brevet Card in this. Just to be on the safer side even if we are caught in rain!
18. Rider Name, Number, Emergency contact details laminated and stuck on front as well as rear of the cycle

Control Points Calculation:

As per the rule 200 Kms should be completed overall within 13.5 hours and there would also be intermediate control points which should be reached within the specified time limit as well. Check out to know how Control Times are Calculated.

On the Event Day:

Woke up at 2 AM to get ready for the event. Had to be there at the starting point by atleast 5.15 AM so that after inspection can start at 5.30 AM. Drank lots of water and did some stretching exercises as well. Before starting from home I had coffee, biscuits and kelloggs with handful of nuts.

Arrived at the starting point (12 kms from my home) some 15 mins before start and got my cycle inspected quickly for all mandatory things. Once the event started I took it slowly and was maintaining around 20 kmph for ~15 mins before increasing the speed gradually. It took me 1 hr 14 mins to reach the first control point which was at 26 kms from the starting point. Its an Unmanned control point and we were supposed to take an ATM slip from Axis/HDFC bank there. Though took the slip quickly the mistake I did there was spent too much time just chit chatting and taking snaps with others. Learnt later from experienced riders that we should not unnecessarily spend time in control points. 

After some 10 odd mins of wastage I continued my lonely journey to the second control point which was at 48 kms (Mahabs - Thirukundram Road, ECR Poonjeri Junction). I didn't push myself too much for this stretch as well and took it easy and maintained an average of 20-22 kmph. This was a manned control point and Partha Datta was there welcoming the riders. Got my Brevet card signed and sealed from him. 

Shortly Balamurugan Palanivel arrived there with bananas, chocolates etc., had 2 bananas and a chocolate.  Unfortunately they were waiting for the other car to come in which they have water cans for riders. Already I had emptied my water bottle and also didn't want to waste too much time again in this control point for the water can to arrive. So started from there thinking on the way can buy some water bottles. Since I had spare Gatorade bottles with me I was sipping it once in 15 mins until I reached Kalpakkam. Stopped at Kalpakkam and got a 2 ltrs water can. Filled both of my water bottles and drank the remaining water. Now I started to feel fresh again and was ready for ride towards Marakannam (U turn point).

Little did I know that I am entering into a killer stretch which needs real physical and mental strength to complete successfully. From Kalpakkam to Marakkanam the headwinds were real crazy and I was struggling to maintain even 12 to 13 kmph. At one point I even felt should I take a call on quitting! During this stretch I halted multiple times to rest, drink tender coconut etc., Atlast by 11.32 AM (6 hrs from the start) reached the U turn point (111 kms). Felt very happy to see Pradeep Ravindran & Varun Spike manning that control point. 

Varun took some snaps - How ever tired I am on seeing a camera automatically will put a smiling face :) Spend ~30 mins in this control point. I am very grateful to Pradeep as he gave me a mix of lemon, water and salt - wow that really energized me. Took two of that drink. They have also arranged for ice cubes - Took and massaged it on my lower back, knee, neck etc., Other riders chit chatting there were having mixed opinions on how the return journey is going to be. Few were saying it would be tailwinds while others were saying it would be crosswinds. 

So I decided that I would ride for another 1 hour and see how I feel and based on that take a call on quitting or continuing. Fortunately few mins into the ride I was feeling very comfortable as it was tail winds :) I started to increase my pace and was doing 25+ kmph for most of the return journey.

Every 15 or 20 kms I stopped and either took Tender coconut, Nungu (Palm Fruit?), refilling water etc., At one stretch I couldn't find anything but a Hatsun shop so stopped there thinking I would get buttermilk or curd.  After entering the shop realized that they sell only ice creams. Ok so what?  Ordered a 500 ml butterscotch icecream and ate it all alone :) While I was eating there couple of local residents came and started quizzing me about the event, how long I am riding, how gears work in cycle etc., very friendly chit chat again missed to watch out for the time spent and ended up taking too much time there.

After bidding goodbye to them started my journey back maintaining a decent speed and reached the 4th control point ECR View Point (189 kms) by 4.18 pm. Saw Partha Datta was having a camera with lens which was as long as my cycle! He looked like a pro photographer. Also Pradeep Ravinder was there and gave  me Cavin's milkshakes and something else which I forgot now. Knowing that only 16 kms left for the final destination spend some quality 15 mins resting there. 

Enjoyed my ride towards the final destination as I was feeling very happy that my dream of holding that medal from France is going to be achieved shortly. When I was nearing MGM all of a sudden a scorpio stopped few  meters before me and couple of guys got down from it. I was in a dilemma on whether did I do something bad unknowingly while riding :) On nearing them realized that one of my office colleague with his friends is returning back from Pondy (Yeah they were walking steadily :) ). Just spent less than 1 min there to inform them about my participation in an event and am at the last stretch now would explain rest in office later.

The final destination is an unmanned control point - SBI ATM @ Uthandi. I was not aware where it is so after reaching Mayajaal started enquiring people about the location of that ATM. At last one guy showed me the right place and helped me reach the destination @ 5.15 PM. Forgot to take the ATM slip as I was in a mood that I had already completed the event. Later realized and took the slip. While showing it to Anil Sharma Sir he pointed out that the time is not printed properly in that. So went again to the ATM and took a fresh slip from a different machine to be on a safer side. So officially I completed the ride @ 5.21 PM.

Called my wife first and informed her that I had completed the event successfully and thanked her for patiently helping me with my preparation.

Hired a tempo from there and boarded on top of it with my cycle to return to Just Buy Cycles in Velachery where we are supposed to hand over all the ATM slips and Brevet Card.

Tips learnt during the course of this preparation:

1. Fully charge your mobile. Before starting your ride disable Wifi and Mobile data.
2. Never try to ride between vehicles OR race with other commuters on the road. 
3. Normally people say drink before you feel thirsty. I wasn't too sure how to handle this but Partha Datta told me a much more easier version of this. Sip water / energy drink once in 15 mins irrespective of you feel thirsty or not.
4. No shame in quitting. Coming till this point by itself is an achievement and there is always a next time - If you feel the body is not able to take it call up the ride director and inform about your decision to quit.
5. Before starting the ride at home I drank atleast 2 ltrs of water. On the week before the ride I even drank more water than usual.
6. As much as possible reduce the number of breaks before the U turn point. Between 12 to 3 PM is what the heat is going to be at its peak. So my idea was to cover the maximum distance possible without stretching too much before that period. 
7. I donno whether this is right or wrong but i did it :) - Ate lots of chicken, icecream, panner, fish etc., the week before the ride.
8. May be make use of the breaks / Control points to inform your dear one's on where you are. I did that because felt they would be worried and would appreciate we proactively informing them once in a while.

Lastly a very big thanks to Kandappa sir and Partha Datta. I lost count of the number of times I had pestered them during my preparation to clear my doubts - both were very helpful and was more than willing to share notes.

Hope you enjoyed reading my experience! Happy Cycling!!

Saturday, July 14, 2012

Using template explorer to create your own code bank

Most of the Developers / DBAs I have worked with are maintaining their utility scripts in file system. When ever a script is needed they browse through that folder via SQL Server Management Studio (SSMS) and open it. 

I have personally found this method little tedious and not so productive way of doing things. I always prefer these two methods instead:

  • Creating an Utility database in the server and having all the required scripts in it
  • The other way is to organize our utility script with the help of SSMS Template explorer

Maintaining Utility DB method is self-explanatory and so in this post we would concentrate on the way to make use of Template Explorer for organizing our scripts. Let's get started.

To open template explorer from SSMS follow either of the methods:

Option 1: Click View >> Template Explorer
Option 2: Press Control + ALT + T

We would see how to utilize template explorer to organize our utility scripts and how it helps us in improving our productivity.

Creating Custom Folder

Step 1: Right click on "SQL Server Templates" and choose "New" >> "Folder"

Step 2: I am naming it as "Vadivel - TSQL Code Bank"

Organizing Utility Scripts within the folder:

Step 1: Right click on the new folder we created and choose "New" >> "Template"

Step 2: Lets create a template and name it as "Identify_Remove_DuplicateRecords"

Step 3: Right click on the new template created and choose "Edit"

Step 4: It would open a new blank query window. Paste/Write the required TSQL script and Save it.

Step 5: Repeat Step 1 to 4 until you have all your required frequently used Utility scripts added into this folder.

How to use it?

Now that we have added ALL our utility scripts within a code bank folder. Using it when required becomes very easy.

Step 1: Open a new query window
Step 2: Click on the utility script which you need from the Template explorer and "drag" it into the query window. That's it :)

I would like to add that this method is in no way a replacement to maintaining the scripts in source control. Having it added in the template explorer also as mentioned above would actually just help us improve the productivity.

If you are wondering where these scripts are getting stored. Read on.

I used SQL Server 2005 to create the folder/templates and they are available at \Microsoft SQL Server\90\Tools\Shell\Templates\Sql

Tuesday, May 01, 2012

BIGINT - Upper limit - Overflow - SQL Server

BIGINT upper limit is 2^63-1 (9,223,372,036,854,775,807). For complete reference check out this MSDN article

Recently I was asked when we use INT data type and it reaches its limit what do we do? The following is the error message we would see when it reaches its upper limit.

Arithmetic overflow error converting IDENTITY to data type int.
Arithmetic overflow occurred.

Though there are multiple solutions, one of the option for us is to change the datatype to BIGINT.

The person who asked me wasn't satisfied with this answer. He was worried is this a permanent solution? Won't BIGINT also overflow / reach its limits sooner or later?

Obviously BIGINT would also reach its limit but it would take really LOTS of years + millions of transactions per second for it. Actually I wouldn't bother about it at all for the reasons explained below.

Let's take few examples and see how many years will it take for BIGINT to reach its upper limit in a table:

(A) Considering only positive numbers, Max limit of BIGINT = 9,223,372,036,854,775,807
(B) Number of Seconds in a year = 31,536,000

Assume there are 50,000 records inserted per second into the table. Then the number of years it would take to reach the BIGINT max limit is:

9,223,372,036,854,775,807 / 31,536,000 / 50,000 = 5,849,424 years

If we inserted 1 lakh records per second into the table then it would take 2,924,712 yrs
If we inserted 1 million (1000000) records per second into the table then it would take 292,471 yrs
If we inserted 10 million (10000000) records per second into the table then it would take 29,247 yrs
If we inserted 100 million records per second into the table then it would take 2,925 yrs
If we inserted 1000 million records per second into the table then it would take 292 yrs

By this we would have understood that it would take extremely lots of years to reach the max limit of BIGINT. May be end of world would be earlier than this :) Atleast I have not seen (or) heard of any application which has exceeded the BIGINT's max limit as of now. Please feel free to let me know if you have seen any.

By the way, if you are wondering how we calculated the number of seconds in a year.
It is just 365 days * 24 hours * 60 minutes * 60 seconds = 31,536,000 seconds.

Monday, April 30, 2012

Capture Deprecated SQL Server code with SQL Profiler

While migrating your application from one version of SQL Server to another have you ever wondered how to identify the deprecated features in the new version? Manually going through hundreds of scripts is going to be tedious and time consuming. I am a lazy coder myself and would be interested only in an automated solution :)

Until SQL Server 2005 we had only one way to identify it that is by making use of SQL Server Profiler. From SQL Server 2008 onwards we can make use of Extended Events as well.

In this post lets see how to make use of SQL Server Profiler to identify the deprecated SQL Server code.

Step 1: Open a SQL Server Instance and find out the session ID by executing the following script. This would come handy in SQL Profiler to filter out only information coming from this session.


Step 2: Open your SQL Server Profiler.

Click on "Event Selections" tab and choose "Deprecation" event.

Deprecation Announcement: Occurs when you use a feature that will be removed from future version of SQL Server, but will NOT be removed from the next major release of SQL Server.

Deprecation Final Support: Occurs when you use a feature that will be removed from the next major release of SQL Server.

Next click on "Column Filters" and set SPID filter to 61 (or what ever number you got in Step 1)

Step 3: Now lets go back to the window where we ran SELECT @@SPID and create some sample scripts which contains deprecated commands in it.

Some random scripts to demonstrate how deprecated code can be captured using SQL Server Profiler


--Here TEXT, IMAGE are deprecated
CREATE TABLE tblDeprecationLocator
Sno INT,
Remarks TEXT,
Profilepic IMAGE

--This is deprecated. Better alternative is to use ALTER INDEX
DBCC DBREINDEX('tblDeprecationLocator')

--Using hints without WITH keyword is deprecated. It should be WITH (NOLOCK)
SELECT * FROM tblDeprecationLocator (NOLOCK)

USE Master
--here Truncate_only option is deprecated

Now when we execute these scripts SQL Profiler would capture all the deprecated code and provide appropriate message as shown below.

1. The TEXT, NTEXT, and IMAGE data types will be removed in a future version of SQL Server. Avoid using them in new development work, and plan to modify applications that currently use them. Use the varchar(max), nvarchar(max), and varbinary(max) data types instead.

2. DBCC DBREINDEX will be removed in a future version of SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use it. Use ALTER INDEX instead.

3. Specifying table hints without using a WITH keyword is a deprecated feature and will be removed in a future version.

4. BACKUP LOG WITH TRUNCATE_ONLY or WITH NO_LOG is deprecated. The simple recovery model should be used to automatically truncate the transaction log.

In the next post we would see how to make use of Extended Events in SQL Server 2008.


For greatest longevity of your applications, avoid using features that cause the deprecation announcement event class (or) the deprecation final support event class.