28 Apr

Configure WAMP (Apache) to work on a custom/non default port


While I was guiding a colleague of mine to install a WAMP server on a windows XP machine and faced this small configuration issue which I thought would have a straightforward fix.

Seems that there isn’t, at least not for the situation I had so I found the hard way to do it. And decided to write a post explaining it since there wasn’t a good article anywhere already for doing it.

Situation: Install Apache to work on a non default (non port 80) port since we already have IIS on port 80.

This post here by Matthew Phillips explains how to configure the httpd.conf file to make Apache listen on a custom port (say 8080). (He blasts IIS for follies which I don’t really agree with, that is not really the point in discussion here 🙂 )

But that doesn’t closely solve our problem since we just modified the Apache’s configuration file and that WAMP is still unaware of the change.

Trying to Install the Apache service from WAMP now still gives the error:

 

The next step after that would be to tell WAMP in its scripts to actually test the custom port (8080) and proceed to install apache. That we do in two files in the Scripts directory located in the WAMP install path.

Edit the following files in notepad:

  1. testPort.php
  2. testPortForInstall.php

In the above files, replace 80 with your custom port number (8080). For me, it was present in 3 places in each file. Save and close the files and restart your Wampmanager and try removing/installing the service now and it should work.

However, there still is the option “Test port 80” under the Services menu in Apache and other links that open up Localhost and phpMyAdmin in the browser that still point to port 80.

 This menu option text is populated from the file Wampmanager.ini and which in turn is refreshed from the wampmanager.tpl each time the Wampmanager.exe is started. The menu item captions are populated from the various language files in the lang folder. The actual actions that are performed are in the wampmanager.tpl file. Just update this file to open the correct URL upon clicking Localhost or phpMyAdmin links. Look for the [Menu.Left] section.

To update the captions, you will have to edit the appropriate language file – find the variable name used in the wampmanager.tpl file for the specific item and look for the caption setting for this variable in the language file and change it accordingly.

For ex.: To change the caption of the item “Test port 80”, I checked that wampmanager.tpl uses a variable called w_testPort80 to populate this value. I opened up the lang\english.lang file and looked for this variable name and changed the string caption.

Restart Wampmanager and Voila!

Disclaimer: The changes mentioned in this post are to customize the work environment for a development machine and any such changes on production servers or internet facing servers should be made with more caution. But then that’s a rare situation to run your website on a non 80 port, isn’t it?

I am using WAMP version 2.0.

12 Aug

DO NOT DRINK AND DRIVER! Seriously..

Found this awesome warning near the EPIP entrance in Whitefield.

I even asked an innocent Policeman sitting inside the chowki to stand out of the booth so I can take the pic. He believed I was from the Press and that I am reporting the pathetic state of the footpath to a news agency.

Only then did I realize the pathetic state of the footpath. 😛

I could not tell him that I am a lame software engineer just out to have some fun so I carried his assumption forward and told him that im a journo for Bangalore Mirror. Ya rite!

07 Aug

jQuery, jQuery UI, ASP.NET Web Services and SharePoint for Feed Syndication using Argotic Framework

Okay, so I recently completed building an end to end  Feed Viewer Web Part for SharePoint 2007.

I used jQuery for AJAX calls and DOM manipulation.

jQuery UI for creating Tabs and a ‘custom’ Accordion control

ASP.NET Web Services

Argotic Syndication Framework  to get, aggregate and generate feeds. (This free library is real cool stuff. Let me add a Web 2.0 style banner in cheers to it!) RSS Can

‘No Server Code’ User Control to load the Feed Viewer entirely using JavaScript code.

WSPBuilder to code, build and package my web part, lists and the custom Web Service into SharePoint.

While building this, I faced a lot of technical issues and built workarounds on them to finally roll it out successfully.

Let me foreach over the issues and workarounds.

1. ASP.NET Web Service does not accept an AJAX Call using a GET Request. Also, it does not honor the AJAX request if the content type is not explicitly specified as contentType: “application/json” in your AJAX call.

So you can right away throw the jQuery AJAX methods – get(), post() and getJSON() methods out of the window when your server side is an ASP.NET Web Service. Why – How can you explicitly specify the content type using these methods?

So we are left with the low level $.ajax jQuery call (its actually pretty neat to be called low level.) and here is a sample code snippet:

Read about this restriction from The Gu. So that leaves us with another crippling limitation – We cannot make a cross site/domain (XSS) jsonp call to our web service. (Coz jsonp can be used only with GET requests and not POST.) SO this means our web service will have to be hosted within SharePoint’s domain itself and not on a separate web application even on the same server so that our jQuery web part can make a call to it.

Another headbanger: If you want to simply display SharePoint data on a web page (outside SharePoint) through this web service, then you will have to enable forms authentication on your SharePoint site or do a Windows Authentication Handshake before making this web service call. Not getting into that detail as its a very rare case of implementation.

Read more in detail about making jQuery calls to ASP.NET AJAX Web Services here. Thanks Dave for such a wonderful series!

Did I mention that the plain vanilla ASP.NET 2.0 Web Service is not capable of handling scripted requests (as in from JavaScript). Yes, that’s true. You either need to install the AJAX Extensions 1.0 for ASP.NET 2.0 or upgrade your .NET Framework to 3.0 or 3.5. Then you will be able to add the following tag to your web service class to make it accessible via scripted calls:

There is of course more to making your service and web site AJAX enabled. Discover options to AJAX enable an existing web service here. Neat video.

Best workaround for these problems: Use WCF! Works with GET; ContentType not restricted to json; REST support using UriTemplates and more. I tried this too but since upgrading to .NET 3.5 on the production server was a little too much to ask for this, I stuck to Web Services. If you are giving WCF a trial, might I also suggest the OOB Syndication Framework support in WCF. (Might help if your clients are against using open source plugins such as Argotic in their production environments.) It has support for RSS and ATOM as well as a Generic Syndication format which one can extend/override and use as you wish.

Now to the UI:

jQuery UI is a neat framework which provides OOB Javascript Tab controls complete with CSS themes (choose your theme and download the CSS). It also provides a neat ICON sheet with different colour overlays for different UI states. Check it out too.

View jQuery UI Demos here.

There are tabs and accordions available OOB for me to use. This was all I needed for my feed viewer web part. The root categories would be the tabs, sub-categories would be placed into accordion panels. Alas, I was too happy too early. jQuery UI is great, no doubt. But when it comes to nesting one control in another, it fails miserably. Maybe it wasn’t built for it but it surely made my life difficult just when I was thinking things were going smooth.

So I used the tabs from the UI. Then wrote my own jQuery code to create an accordion control which would load feed data from a SharePoint list on expanding. Of course, I made use of the library’s CSS classes for the accordion – active, inactive states etc.

My final UI looks like this:

Of course, how can I forget my friendly jQuery Plug-ins: jFeed and Pager

Now over to the server.

On the Server I needed a Web Service which my Web Part would call:

1. Get a category hierarchy for my tabs and accordions to render. I chose to send an xml string with sub-categories nested under categories in the xml with important data such as CategoryId which I hid into hidden fields in the accordion.

2. Get an aggregated feed data on a per category basis once user expanded a certain sub-category panel. This would require me to send information such as CategoryId, PageNo and pageSize to the web service via an Ajax call.

My Web Service method signature was like this:

image_thumb[21]

and my AJAX call looks like this:

  TIP: To ensure that my web part is configurable, I need to allow the user/admin to configure the parameters such as List Names, Service URLs etc. Now since all my functionality is on the client, I needed to make sure that any Web Browsable Property I create gets added as a hidden input control to the Web Part controls so that my jQuery can pick it up. Remember to add a unique class name to the hidden control and not to use the ID to identify the control in jQuery, since ASP.NET adds its own additional meta characters to uniquely ID server controls but maintains class names as they are.

Next was a simple task to reference the Argotic Library in my web service and do the needful. The Argotic library is available in both .NET 2.0 assemblies as well as .NET 3.5 assemblies. It provides abstraction to fetch feeds, aggregate them and create new feeds and save them to XmlReader streams. Pretty neat stuff.

Now since I was using a jQuery plug-in that accepted either ATOM or RSS feed data and converted them to html, I only needed to aggregate multiple feeds into one Feed object on the server and then save the contents into a stream to return to my client. The plug-in would then parse the xml for available fields and generate appropriate HTML. I needed only the title and link to the item so I modified the feed a little to render only items I need.

And the majority of my functionality is done. Now remained to enhance it to make the Paging work, add a refresh button which would refresh the feed data and set an auto timer for it to refresh it automatically every 5 minutes and the likes.

I added all my JS code to a User Control. Created a WSP Builder Project and created a Web Part that would load this control and also add appropriate Web Properties. Added features to package my dependent SharePoint Lists and their instances and also a feature to deploy my custom web service to SharePoint and add my dlls to the GAC.

Read about deploying lists and list instance using features and solutions on André Vala’s blog. This is the blog series I have referred the most till date. Thanks André!

Read about hosting a Custom Web Service in SharePoint: newbie tutorial | msdn walkthrough

It was a thoroughly enlightening experience building this web part. Adios for now!

19 Jun

No Entry Load on Mutual Funds from 18th June, 2009

SEBI has scrapped the Entry Load that is levied on investors investing in Mutual Funds. Now if an investor invests Rs.100 to purchase the units of XYZ Mutual Fund, all of that amount will go to purchasing units of the fund and no deduction will be made towards Entry Load.

Last year SEBI had passed a regulation to the effect that frees investors from the entry load on Mutual Funds if they invested directly without the help of a broker/intermediary. However, since most mutual fund schemes are confusing and the application forms are difficult to fill and submit directly to the mutual fund house, the majority of investors hardly found this move bringing them any joy. They would usually end up going through a broker and getting slapped with an entry load ranging from 2.25% to 3% of their investment, most of which is usually paid out the the broker/distributor in the form of commission. This means a loss of Rs.30 on every Rs.1000 you invest, right at the time of purchase.

From 18th June, 2009, SEBI has removed the concept of Entry Load on mutual funds, irrespective of whether you invest directly to the mutual fund house or go through a broker. This move may bring some cheer to investors but there is always a clause one has to watch out for in such rulings. And here is the catch. You have to pay a commission to the broker if you choose to invest through him. SEBI has issued in its statement that the investor will choose the amount of commission payable to the distributor. How this is supposed to work and what are the benchmarks for such a commission are unclear as yet but most brokers may choose to not accept any commission at all to keep up with competition and act as advisors to investors. All in all, a good move with respect to the investor in these troubled times. The markets are down in the dumps and are predicted to remain so for at least another year with marginal improvement. Hence investing in an Equity Mutual Fund through SIP is the best bet at present. Note that Mutual Funds only provide best returns in long term (over 3 yrs).

More: 1 2 3

05 Apr

Setting up PKS – Podcasting Kit for SharePoint Pt.1


When I first heard of , I wondered whether this is really gonna be of so much use, especially in the world of SharePoint. I mean, who would want to setup a site like YouTube on a SharePoint server?

Even today people would raise such questions but I am actually amazed at the number of client requests that I am coming across who want a site in their SharePoint intranet/blog/public website where they can simply upload a video and others can watch it plus have some additional social networking features such as rating and commenting a video, viewing the video publishers bio, tagging videos and searching based on keywords, show a thumbnail of every video uploaded etc. Imagine if you had to built such a site on SharePoint yourself? And for those who are still unaware, is the solution for the above requirement and it provides even more features and configuration options.

Having made a couple of installations of recently, I do admit that its not really just double clicking an .msi and you are ready. But the effort spent configuring it is well worth it if you have the requirement. I would say you need about 2 person days to set it up from scratch by following the quick installation guide that comes with the package, leaving configuration of search which would need another day and of course customizing the UI based on your needs would take its own time. PKS comes with its own masterpage and most likely you would want to change that so the portal look and feel is consistent with the rest of your site. And the amount of customization you need decides time needed for your UI trimming but my guess is it should not take more than a couple of days. So you can have a Podcast Publishing Site up and running in about one work week. The effort saving and the value it adds to your website is just amazing. Have you tried video marketing with the products you make? I suggest this is a good time for that since print ads and ads on the telly probably don’t reach out to the customer bracket you want to approach and also what better way to sell your product by showcasing it on your own website without additional cost – directly to the person who has come there in search of it. When you do decide for that, go for .

So what does have – Insider tips:

  • installs a few pages, lists and some web parts on your SharePoint site when you run the setup.
  • stores the videos you upload to a network file share and not the SharePoint database so it wont overload your content DB.
  • offers features for Video Rating, Commenting, Viewing the Podcaster’s information, Reporting features on videos uploaded/viewed/downloaded etc, Automated thumbnail generation on video upload, integrated video conversion to compatible format, mobile/zune/iPod/RSS support, tag clouds, search videos using tags, progressive playback of videos using etc.
  • Documentation for is exhaustive, clear and precise which makes the setup experience extremely smooth and also empowers you to extend it. There are video tutorials too! In fact its so good, I really wonder why any one would actually read this blog post.
  • It needs MOSS 2007. Won’t work on WSS 3.0.
  • is needed for to work. Thumbnail generation, duration detection and encoding to Silverlight are all done using that integrated into the PKS site.
  • There is still a bug in the thumbnail generation process for videos which are initially not in compatible format but are converted using Expression Encoder. The thumbnail wont get generated in this case as the application that queues videos for encoding tries to generate a thumbnail first and encode later. Hope this gets rectified soon.

Tomorrow I will cover the basic steps in configuring a simple PKS site. But the real resource is on the site itself.

23 Mar

BE Computer Science / Information Science Fresher Interview/Written Test Tips and Topics


I was asked by a friend of mine to help his cousin who is doing his BE in Computer Science for placements and I jotted down a lengthy email regarding what topics he should be concentrating on. Then when I read that email myself, I thought – "Hey this can go beyond a mail and help more people too. So here it is:


Short intro to my interview experience to give you a context on my ability: I have taken Siemens, TCS, Sapient and CTS interviews as a fresher. Among these, Siemens and TCS were in my 5th Sem (on campus) and Sapient and CTS were post 8th Sem (off campus). I did not clear the written round in Siemens. I got offers from TCS (did not join due to low pay, relocation to Kolkata and 2 year bond), CTS (rejected offer since I had Sapient already whose pay was better) and Sapient(opted for the offer due to their friendly HR and now very happy with that decision).

My Profile

College: RNSIT, Channasandra, Bangalore

University: Visweswaraya Technological University

Branch: Information Science and Engineering

Batch – 2002 – 2006


So now to our business:

For freshers in their 3rd year and those just out of college, the following are the most important topics quizzed on:

General Topic: Aptitude:

This is a common section in most written tests and constitutes atleast half of the weightage of your test score. Good books to practice from would be RS Aggarwal and also Shakuntala Devi’s Puzzles (my fav.). Instead of trying to practice solving more and more problems, try to solve a couple of generic ones in each topic in R  S Aggarwal and understand the methodology and the thought process of solving such problems. If possible, also devise your own algorithm/logic to solve the problem. The questions will never be directly from the book so practicing every problem in the book still would not guarantee your clearing the test. 

In the test, dont concentrate on solving max. number of problems. Concentrate more on getting all the questions you attempt correct. That will fetch you more marks than attempting 90% of the questions and getting most of them wrong due to silly mistakes made in a hurry to complete the paper. For example, in my college, in the Siemens paper-> There were 50 questions in the Aptitude section to be answered in 60 minutes (3 marks for each right answer, -1 for each wrong). Imagining to answer all 50 (right or wrong) is just a farce. Instead one should attempt to get all the questions he attempts right. The highest score in that test (in aptitude) was 16. Which is effectively just 6 answers right and two wrong of the attempted 8 questions (of a total of 50 questions!!). Simple to beat if I look back today. Think about it, all you would need is to get 10 out of those 50 questions right to top the college, and you have 60 minutes to do it (6 minutes per question!). Easy right!

Tech/Software Sections:

  • SQL – Writing simple SQL statements to select data from a table given a condition.

-> Theory based questions too are common – like the Types of Joins – Outer Join, Left and Right Outer Joins, Inner Joins etc, Normalisation – 5 levels of normalisation – What are they and how are they important for good database design. Good book to refer for this would be the prescribed syllabus book. 

  • C++ – Most important. Would be asked to explain object orientation concepts such as Polymorphism, Inheritance, encapsulation etc and how it can all be achieved in C++. Syntax for virtual functions are also common questions. Would be asked to write small programs such as generate fibonacci series, replace a character in a string without using any inbuilt string functions etc. An interview tip would be to explain concepts with as many real world examples as possible. For example, instead of explaining inheritance in text book fashion as to say one class inherits functionality from its parent class, you could explain to the interviewer with a real world example say a Car class as the base class having turn, stop and start as primary implementations and then classes that inherit from it could be Ford,Hyundai etc. which inherit the base functions plus add their own and override on existing functions as well (if necessary, to say Hyundai i20 has ABS brakes so it has its own custom Stop function) to make custom implementations. Now that would convince the interviewer that you have understood the concept rather than just mugging up the text book.

  • Data Structures: Important to understand all types of queues, linked list etc. Most common questions are -> Reverse a linked list, Traverse a linked list, sort a linked list etc. Merits and Demerits of each type of data structure -> Arrays, Stacks, Queues, Linked Lists.

  • Algorithms: Sorting algorithms are most common written round questions. Either direct or indirect. Binary search, quick sort, string search etc. Common problems such as Travelling Sales Person, Towers of Hanoi etc are also common. Techniques to determine the complexity of an algorithm may be asked too – like determining Oh, Omega and Theta of a particular algorithm.

  • Computer Networks: Would be a crucial subject if applying for companies such as CISCO, HP etc. Hot Topics: OSI Layer, TCP/IP model, Routing algorithms *** (very important) and types of network discovery.

  • Operating Systems: Crucial subject for companies that build low level system programs such as Symbian, Intel etc. Hot topics: Processor Scheduling, Memory Management and Page File Swapping techniques. Deadlocks – what, detection, avoidance and resolution, semaphores and other locking principles.

  • Java: Since most universities cover Java in the end of 3rd year and placements usually happen before that, on campus interview dont focus much on Java. However, for off campus and post 8th Sem interviews, Java is a must (unless you are a MS guy like me and would rather stick to C# in which case proficiency in C# and .NET are required) There wouldn’t be very detailed questions on Java or C# for freshers and basic knowledge should be sufficient. If you do your 8th Sem project in Java or C#, it would be more than sufficient for you. So wisely choose your 8th Sem project. It could make up your career. And please please please implement your own project in your own code. Don’t download the code and showcase it. Your project is your portfolio in all the interviews you will face and your academic project will be the only project where you will implement end to end (all tiers) so this is a very important part of your career – to implement your own idea into a project and deliver it.

Apart from this, there may be certain niche areas that specialized companies may ask for but being strong in the above topics should get you through 98% of all interviews as a fresher.

Do post any questions you may have as a comment and I will get back to you.

Cheers

Sreenath

https://sreenath.net

27 Jan

Slumdog Piracy


I went to the theater to watch the most talked about movie in recent times. At Rs.180 a ticket, on the premiere weekend, I’d say it was a steal. The movie is worth a watch. Its worth every bit of the hype and I just cant stop talking good about it.The cinematography, music and editing are perfect. If this movie doesn’t win an Oscar for cinematography atleast, then I’d surely love to watch the movie that ousted this one. I met a few friends that evening and all of them had already seen the movie. It was the premiere weekend. But I wasn’t surprised. I’d got the downloaded movie on my pen drive too, about three days ago. The movie was available for download since long. Now for those who don’t know what Piracy is, this is it!

Freida Pinto in Slumdog Millionaire

There is a line in the movie – “You wanted to see the real India. Well, this is it!”. I guess this is it. A movie that is making us proud the world over is being downloaded by people far from the slums, and maybe closer to that Million without having to sit in the hot seat. 2 things I want to clarify: I download and watch movies too. I accept that. But for a movie that’s running in the theaters, one that’s making news world over, one that’s got 10 Oscar nominations, I would definitely want to watch it in the theater. That’s a given. The effect of watching a movie in the theater is an experience in its own, be it any movie. The sound, the ambience and the whole surroundings and the time you dedicate to just watch the movie and nothing else.

Go watch the movie in the theater. I heard from many sources that Slumdog Millionaire isn’t good at all. You may be right. You have the right to your tastes. I don’t deny that right. But have you seen the movie in the theater? No! Then you ain’t got no right to talk about how good or bad it is. Go to the theater, watch it and if you still cant like it, nobody is forcing you to accept that you liked it. Go tell the world.

Avoid Piracy! I don’t give a damn about asking you to buy original DVD’s and stuff. I want people to have a better experience with their movies which you will never have in a 14 inch laptop with mono speakers or even with a 42 inch Samsung LCD HDTV and the best Bose surround system. Trust me. The theater is better any day!

And movies like Slumdog and the encouragement it’s getting from the film makers just inspires me!

17 Dec

Google SMS Channels – The next thing in Socializing


There may be a dozen hundred providers providing the same feature as Google does, but when Google comes into the picture, they always take the market away from the others.

Google India Labs has recently launched SMS Channels. Apart from all the things it promises to do, this is what it means the most to me: Form SMS groups – much like the yahoo or Google groups. Only now, its accessible via the web as well as through a simple SMS which is a 10 digit mobile number. All facilities are available both on the web as well as via an SMS from your phone.

Creation

Create your own SMS Channel via the web here. Once created, you are provided a link which you can IM/email to your other members to invite them to the group. You can also invite them yourself by providing their phone numbers on the group page. Each invited member is sent an SMS asking him to respond to accept the invitation. To accept, simply reply to the message as ON <channel name> . You can also invite others to a group via SMS – simply send invite <channel name> <phone number> as an SMS to 9870807070. You can also accept invitations online by logging to your Google account and verify your phone number as the specified on the website and go to your My Channels tab to accept the invite.

You can be the only one posting messages to the group or you can allow all members to post. You can allow anyone to subscribe or only those that you invite.

Usage

You can visit the SMS channel page by logging into your Google account at : http://labs.google.co.in/smschannels. Then use the text box provided to send an SMS to the entire group. As long as incoming messages are free, no one will get charged for this. To send a message to the entire group from your cell phone, send the message as send <channel_name> <message> to 9870807070. Standard messaging rates will apply. For me, guess this is not a local number, hence I am being charged Rs. 0.50 per SMS instead of the regular Rs. 0.02. Each SMS you send is counted and charged as a single message by your service provider even though it is sent to multiple recipients by Google.

I have created a few channels for close groups of friends. Just send a message to the number above and it reaches everyone instantly, where ever they are in the country. Ain’t it a real benefit if you got friends across the country? And how much does Google charge you for this great service? Now read that question again. Google and charge? Not a penny. Its absolutely free!

Other Features

Now for the more advertised features: An SMS Channel can be tied to blogger URL and updates on the blog are sent to the subscribers via SMS. Similarly to a Google group. Even Google news via just Keywords. But the most important one for most people I am sure is that you can tie it up to any damn RSS/ATOM feed across the web!!! Every message posted can be viewed online on the Channel page so you actually don’t lose track of what’s happening even if you delete a message from your cell phone.

Last I saw there was a group called Live Cricket Score and also a group called IT-Freshers Jobs! Getting an idea of the huge benefit this feature is? There are thousands of groups already and tens of thousands of subscribers hooked on to them. The mobile revolution is here I presume.

Read more here: http://labs.google.co.in/smschannels/help

Google SMS Channels URL: http://labs.google.co.in/smschannels/browse

01 May

Kodachadri Trip


Sreenath

Date: March 1 – March 3, 2008

Places Visited (in order of visit)

  • Shimoga
  • Sigandur
  • Nettur
  • Kollur
  • Kodachadri
  • Kaup
  • Mangalore

No. of People: 8

Best Season to Visit: Post monsoon – July-Sept

Transport:

Bangalore – Shimoga : KSRTC Volvo – Online Booking (various other modes of transport are also available)

Shimoga – Sigandur : Local bus (to Nettur) -110 km – 3 hrs – Includes a ferry ride across Linganmakki lake – The bus comes in the ferry to continue with onward journey to Nettur. Sigandur is first stop after the ferry ride.

Sigandur – Nettur : Local bus – 25 km – mud road

Nettur – Kollur : Jeep – Rs. 450 for 6 people – 22 km. (Bus is also available)

Sigandur Temple

  Kollur – Kodachadri : Nataraja service (Trek) – 9 km – 4-5 hours. (Jeeps available –    Rs.1300 per one way trip, capacity – 6-8 people)

  Kodachadri  – Kollur : Jeep – Rs. 1300 (Negotiable till Rs.1100) – Very bad roads – not advisable for people with back bone problems or slip discs

Kollur – Kapu : Local Bus – 2.5 – 3 hr journey – Nominal fare – fairly frequent busses available

Kapu – Mangalore : Local Express bus – 1.5 hour journey

Ferry ride from Sagara to Sigandur

Mangalore – Bangalore : KSRTC Volvo (online booking) – Other buses at lower rates available without booking as well.

Food & Accomodation

Sigandur : Temple provides free rooms – no furnishings. Few mats available, clean. We used the toilets and the bathrooms which had cold water (freezing literally), rested for a few hours, visited the temple, had lunch at a local hotel.

Kollur : First night halt – Guest house was booked from Bangalore – via phone. Many guest houses available – RNS Guest house etc. Mobile phone connectivity – Only available for BSNL and Reliance for now. Food at the guest house – decent enough (Poori’s were rather awesome). Free lunch and dinner is also provided at the temple for devotees. We dined there that night which hosted a speacial Rathothsava.

Kodachadri – Guest house on hill top – booked via phone – food is prepared at the guest house (we did not try food here as it was mostly non-veg and drinks)  – cell phone connectivity – nil. Water and electricity – scarce. Generator runs for about 3 hours every evening. A temple near the guest house also prepares food for a nominal price – decent meals. Accomodation was decent – all 6 people preferred to stay in one room(hall rather). Since electricity is a problem, taking candles and powerful torches is advised. Also would need torches for visiting the sunrise and sunset points as no lights are available (and the sun is either still not in the mood to shed his light on the world or he has finished his day’s work and is napping)

Panorama view from Kodachadri

Places & Tour Guide

        We reached Shimoga from Bangalore which was a 6 hour journey. From Shimoga, we boarded a local bus heading towards Nettur to go to Sigandur. The ride includes a ferry ride across linganmakki lake in which the bus and other vehicles too hop on. We continued the bus journey after the ferry ride and hopped off at Sigandur. Sigandur is famous for its temple. Free rooms, toilets and bathrooms are provided at the temple. We freshened up there, visited the temple, rested for an hour or so, had lunch at the only hotel available there. Food was bearable but the hygene concious may find it hard to digest.

Playing in the stream at Kollur

We then boarded a bus to Nettur. From Nettur, buses & jeeps are available to go to Kollur. Since we had to wait a long time for the next bus, we hired a jeep which took us to Kollur in a jiffy for Rs. 450 – a 22km journey – decent price for 8 people one would say. At Kollur, we went directly to the guest house we had booked and got our rooms. Rooms were decent and toilets were pretty clean. Mosquitoes may be a problem, hence carrying coils is recommended. A small stream flows through Kollur where we spent the evening spashing in the water.

We visited the mookambike temple, which Kollur is famous for. Mobile connectivity is available only for BSNL and Reliance for now. Hence we made calls to our homes from STD booths. We had dinner at the temple which was excellent for all of us. There was a special Rathothsava (chariot pulling) also on the night we visited the place. We went back to our rooms for the night and woke up at 7 AM, cleaned up, packed all our luggage into one room, checked out the other room, had breakfast in the guest house cafeteria ( me and DJ downed 6 plates of pooris each!) and hired a jeep to drop us to the trekking start point.

Flagging of the trek

Thus started our 9km trek to the Kodachadri hill top. We were here in the wrong season. What should have been a cool walk in lush green meadows turned out to be a sweaty tiring trek in hot sun through sun dried brown tall grass and dry paths. What should effectively be climbed in less than 5 hours took us more than 8 hours – thanks to the girls!

There was a beautiful stream from where cool sweet water gushed out from stone a wee bit away from the trek path. The guys climbed down and had their fill of this nectar. The girls however, were advised to give this a miss. The trek was fun, full of story telling, singing and enjoying the scenery. We had to reach the hill top before sunset at any cost. When we realised that we were lagging, we sped up and started going up real fast. We reached a small temple and had lunch there. The guest house was a hundred yards from there. We dumped whatever we carried in the guest house and made a beeline to the hilltop which was another kilometer from there.

Kodachadri Trek

Kodachadri Top

Quiet evening by the campfire

Vegetation on the trek route

Sunset from Kodachadri Top

We made our way back to the guest house, thanks to few other visitors who had thoughtfully brought torches with them. Otherwise we would surely have gotten lost on the hillside that night. We settled in the room for sometime. It was hot and we thought we will spend some time sitting under the stars outside. It was a beautiful night sky there. I spent time telling Mrudula stories about the cosmos, black holes, comets and parallel universes etc. The place slowly became crowded with shady people having drinks and non-veg food and we were a little perturbed at that. Thus we moved down to the temple and had dinner prepared there. Then we came back to the room, locked ourselves up, played some games and few of us took bath in the cold water. The toilet didnt have a light, hence we resorted to candle light baths! There were strange crawling caterpillars on the sink and on the bathroom floor which scared the girls and they did not enter the bathroom.

We had to get up early to watch the sunrise. We trekked to another point for it in pitch black darkness, fearing snakes, insects and other creatures in the dense forest. But it was well worth the effort.

Sunrise at Kodachadri Top

After enjoying the sunrise thoroughly, we climbed down, packed our bags and hired a jeep to take us down. The road is so bad that it has to be a jeep to take that road. If you were thinking of bringing your car since a jeep can go, plan for a one way trip for your car only! We reached Kollur and went back to our room in the guest house. Since we had only one room now, we all cramped onto the same bed. We made plans for the evening to go to Kapu beach and enjoy the evening before we go to Mangalore to board our bus to Bangalore and the drudge of a life we have in the city.

Lighthouse at Kaup

Being the biggest water and sea fan in the gang, I had to take a dip in the sea even if it meant I dont have a change of clothes till I reach Bangalore. And that was what happened. Sat with wet undies all the way to Bangalore. Hope the KSRTC wont sue me for making their volvo seats wet! We had good fun at the Kapu beach and had to hurry to the Managlore bus stand in the end.  And luckily for us, it was a bus and it was waiting for us, while we ended up 15 minutes after its scheduled departure time.

After that, all I remember was I was in the office track meeting the next morning. Ciao!

More photos at : Kodachadri Trip

04 Jan

JavaScript Hacks: Add days to a date

If you were googling for a method to add a few days to a given date in JavaScript, you may be running up a blind alley.

As I painfully learnt that there is a simple way to accomplish this. If you are asking what’s so complex about that, here’s how: Subtract 10 days from the current date. Simply put, find today’s date (day of month as in Date().getDate()), subtract 10 from it. If that is less than 0, wrap around the date to the previous month after finding out the number of days in the previous month. Now if the month was January, wrap around to the previous year. etc.. Simple!!

Now that’s a tad bit too much of coding logic for something as simple as that. There has got to be a much simpler way. Isn’t there a dateAdd or dateSub kinda function? Oops.. Sorry. Gotta write that yourself.

But here’s the catch. JavaScript is foolish enough if we know how to outsmart it with its own Date() constructor.

The Date() object has a constructor that accepts parameters in the following format:

var someDate = new Date(iYear, iMonth, iDay);

Now here’s how we subtract 10 days from today’s date:

var today = new Date(); //Get today’s date

var interval = -10; //Setting the interval as a variable to show its applicability

var tenDaysPrior = new Date(today.getYear(), today.getMonth(), today.getDate()-0+interval);

document.write(tenDaysPrior);

And voila! No need to worry about wrapping across months or years or even bother about the number of days in any month. You could even add/subtract months/years in the same fashion. Try adding 60 days to current date. Works?

Another tip as I head off to bed, to find the number of days in any given month, here is a one liner:

var daysInMonth = new Date(iYear, iMonth-0+1, 0).getDate();

Two points to note:

– The Date object’s month runs from 0 through 11. So January would be 0, June would be 5 and December 11. The reason I am adding 1 to iMonth above is not to correct that but to infact get the 0th day of the next month, which automatically rolls back to the previous month’s last day.

Eg: To find the number of days in Feb 2008, we simply find the 0th day of March 2008. Remember that the month number of March is 2 (which coincides with our real world month number of February). I’ll let you use your brains to code that line.

– If you are wondering why I am subtracting 0 in my expressions, remember that JavaScript is not strongly typed. So to avoid ending up 1+1 with 11, I use the -0 to make sure that JavaScript treats them as numbers and not strings. One could also use *1 or /1 to the same effect.

Cheers!