Friday, January 24, 2014

Mysore Trip

Visited Mysore Palace and Brindavan, two weeks back. A few years back, I had gone to Srirangapatna to see the Temple, Daria Daulat Bagh etc. So, this time, when we planned a visit, I wanted to have as minimum intersections as possible.

It turned out that we had a great time and were able to see a lot of new places through the entire day.

6:15 Start from Bangalore

7:45 Stopped for Breakfast, at Kamat Lokaruchi.  As expected, the food was great. They have introduced an unlimited breakfast buffet at Rs 120.  Did not try, as it could become heavy for a long trip. The main specialty there being the idlis baked with wrapped banana leaves! Tastes awesome!  This restaurant is on the right side of the highway, approx 55 km from MG Road, Bangalore - just after Ramanagara.

8:15 Resumed the journey after breakfast

8:45 Stopped at Doddamallur Navaneedha Krishna temple - on the way - on the left side of the highway after Channapatna (Town of Toys) The temple seemed to be a very old temple.

There are arches welcoming before each of the towns - Ramanagara - Silk Town, Channapatna - Town of Toys, Srirangapatna - Town of Temples - also there were similar welcome arches for Maddur and Mandya which I forgot.

9:15 Resumed after a very short visit to the temple
10:30 Reached Srirangapatna, decided to visit the temple first. Some of the access roads were getting repaired, so had to take quite some detours inside the town. 

11:00 Started towards Ranganthittu, for which we need to return to the highway, proceed a little and take a right. This right turn is almost like a V junction. This is similar to taking a right from hosur road towards the dairy circle road (not allowed in current traffic regulations) after the Forum junction in Bangalore. The distance would be almost about 6 or 7 km from the temple. This is the road that goes to Brindavan too.  A point that comes within 2 or 3 kms of taking a right on the high-way, where one has to take a further right, into the arch for getting into Ranganthittu.

11:30 Ranganthittu bird sanctuary is neatly maintained with beautiful parks, river : 30 ways.  Had a boat-ride to have a closer look at the birds flocking in the nearby trees. Clicked some snaps of birds (I am not a bird watcher - so do not know the names of most birds which I had taken snaps of) and crocodiles.
Entry Ticket: Rs 50 for adults, Rs 30 for camera and Rs 50 for boating

13:00 Reached Balmuri falls. To get to Balmuri falls from Ranganthittu: return, come out of the arch and take a right, the road which one would have proceeded, if not taken the right into the arch. This is the same road that goes to KRS dam (or Brindavan Gardens - both are same).  Somewhere after travelling for about 5 to 6 km, one has to take a right into a muddy road to reach Balmuri falls.  This looks similar to Kodiveri falls, though I had not been to Kodiveri falls - seen only in photos. 

No Entry Fee at Balmuri Falls

A guy got almost drowned but saved by the boatman.  Shocking, I could see his entire face completely immersed in water when the boatman pulled him out catching his vests.  He was unconscious for sometime, later opened eyes and was being rushed to the hospital



14:15 Reached Mysore, started to wait in a huge queue to get a place to eat, in Hotel Siddartha - close to Mysore bus stand

16:15 Went to the Mysore Palace - Have never seen such a crowd - Jam-packed. And the palace has a single route to take through from entry to exit - completely crowded all the time.  Palace looked magnificent, indeed!  Only after visiting, learned through Wikipedia that this is the 2nd most visited tourist-spot in India, next only to TajMahal. Missed the opportunity to see with lights on.  Before even entering the palace, had to maneuver a lot to get the car parking done, in a place covered with dry soil-dust.  At least they could have spent some and made some good parking lot.  Totally haphazard and totally unplanned!
Entry Ticket: Rs 40 for adults, Cameras and mobile phones not allowed inside
Timings: 9 to 5 pm


17:30 Reached Brindavan, what I thought should have been done at the Palace in terms of organized parking, is done here.  A huge area with markers on concrete flooring dedicated for parking. It just reminded me of the parking lot in Akshardham, New Delhi.  This is my first visit to both Mysore Palace and Brindavan.  We went in such a time where we could see the gardens and fountain day-light, twilight and night fountain lights.  Again, since it was Pongal (Makara Sankranti) time, also being a Sunday, there was heavy crowd! We had to miss the musical fountain, as it got late and an almost half-km long queue was already there, inching head-to-head.
Entry Ticket: Rs 15 for adults and Rs 30 for camera
No entry beyond 6 pm

21:30 Left Brindavans at around 7:15 pm in the night and reached back to the same Kamat Lokaruchi for night dinner.

23:45 Back to Bangalore.

Saturday, January 11, 2014

The way it was - 2013.

Needed to write a post on 2013 towards the end.  Somehow finally, managed myself today to sit and write this post!

As usual, at the beginning of every year, I am pondering on how fast the last year too has gone in a jiffy.  Moved my base from Chennai to Bangalore; shifted jobs; Helped a client in solving a problem that had been troubling them for more than a year.  Learnt a lot on and off work. Met a lot of new people and shared interesting thoughts. A new country that added to my visited-list was South Africa.  

Got my first android phone - Galaxy Grand - birth day gift from wife.  But somehow not comfortable with the 5 inch screen and weight; exchanged with my appa's Galaxy Young - for it will be much useful to him, as his regular usage involves both hands.

After 2007, re-started my car trips to Salem - for I have never driven Chennai-Bangalore or Chennai-Salem stretches to this day.

A lunch-table chit-chat turned to a very quick and memorable trip of Yercaud on one fine day at Salem.  Deepavali at Salem, family functions at Salem and Chennai helped to connect back with a lot friends and relatives.

Read a lot of books in the year which include - The Oath of Vayuputras, Outliers, Design of Everyday Things, The Lost Symbol and portions of The Man Who Knew Infinity.

Now for the new year resolution - jogging / walking daily.  I have already been following my walking course on and off for the past 2 years, just made a resolve to make it a daily habit.  Also, planning one book a month policy - started with Jaya by Devdutt Pattanaik now.

And last but not least, able to make a quick-planned trip to Tirupathi on the eve of New Year!

I hope 2014 will be even more promising, challenging and interesting.

Wish you an interesting and happy 2014!

Saturday, September 21, 2013

BangPypers September

Attended the monthly chapter of Python Bangalore (BangPypers) for the first time.  I had been a regular at the ChennaiPy meet.  But after I moved to Bangalore, this is the first Python meet I am attending.  Around 20 enthusiasts participated.

Mr. Baiju of ZeOmega hosted the event at ZeOmega office.  It was held in an unconference mode where the audiences shared their views and experiences.

When Baiju finished with introduction to Python for beginners, we realised that the speakers as per the original agenda did not turn up.  So, there was some dead time in between - we started with a brief introduction of ourselves - which turned out to be a self and Python-tools introduction and experience sharing session as well - We just had 30 min after the introduction got over - time well spent in introduction.

Got introduced to quite a few things.  Though some of which was known earlier, I am listing below all that we discussed so they serve as pointers

Django - A very popular Python web framework
Tornado - A Python Web framework for non-blocking network I/O
Mezzanine - A Django Content Management System
Jekyll - Static Site Generator (based on text input) built in Ruby
Hyde - A Python based static site generator
Gevent - A Python networking library
Silpa - Swathanthra Indian Language Processing Applications - A project with a focus of building several Indian language specific tools
Python nltk - Natural language processing Toolkit for Python
Beautiful Soup - A Python based XML / HTML parser
BuildOut - Python based build system
Jenkins - Open Source Continuous Integration Tool - See here for what is continuous integration
Python Koans - A self learning tool for Python written in Python
Learn Python The Hard Way - A much revered python tutorial
Pycassa - Python client for Apache Cassandra (a distributed dbms for big data)
Sophia - A next-gen key value DB for high loads
Leveldb - A light weight key value DB designed by Google
Lucene - Open source search software by Apache

Later, towards the end, Baiju walked us through how a distribution can be created and uploaded to PyPI (Python Package Index) via setuptools


Friday, August 30, 2013

Slidify

Recently I came across a presentation making tool in R called "Slidify", by Ramnath Vaidyanathan.  At the outset, it is impressive.  A few advantages using slidify in R
1. One can embed the R code (or even some other code) directly in the slides.
2. The R code can be executed run time when the slides are prepared  (I suppose other languages can also be executed run time with appropriate set-up)
3. The plots (and other outputs) executed in R can directly be captured in the slides.

Works seamlessly in Chrome and Firefox.

For using the "slidify" we just need 
1. An R environment with required tools installed (one can follow the procedure in slidify.org website)
2. An "Rmd" - R mark down file, where the contents and code are written into.

It has plug and play support with multiple options for
1. Framework - The look and feel, theme of the slides
2. Highlights - The code highlighting support
3. Widgets - Tools for support like equation editing, making online quiz and much more.

For equation editing, the "mathjax" tool is quite good, which is readily supported.  Additional Info:  Many of the coursera courses uses mathjax tool to render mathematical equations.  Further I remember, my Professor Jeff Leek used Slidify for his slides in his "Data Analysis" course in coursera.

Slidify makes use of two key libraries among others.
1. Knitr - This converts the R markdown files to ordinary markdown files. 
2. markdown - This R library converts the markdown files to html files.

The output will be a dynamic, interactive html file with all required support files - css, js etc.  

An off-note on a relevant topic:
Markdown (wiki) was originally conceptualized by John Gruber and Aaron Swartz in 2004.  It has been in wide use since then.


Monday, June 24, 2013

The Lion Park

Visited the Lion Park here in Johannesburg today, with a couple of my colleagues. It is about 40 km from the place I stay, Bruma.

Had no idea about the place before visiting.  Just thought it would be only lions in the zoo which we would be seeing.  On going there realized that it was a safari.  As any tourist place would have it, this too had a few souvenir shop - most of which are over-priced.  Bought the tickets for the 11:30 safari trip and roamed around the souvenir shops in the meantime.  The ticket of 270 Rand each included the Guided safari and a mini-zoo and lion cub interaction session for 2 minutes where you can go and touch the cubs and take some photos.

Started with the safari at first.  The safari van seated around 20 people. Masana, our guide and driver stopped at the first point to show us ostriches, zebras and giraffe.  With stoppage near each animals, he gave lot of information: The pattern of lines on zebra's back is unique, just like fingerprints. The female zebra has a bigger back even during the non-gestation period, in which it stores some gas which it releases to fight predators, when chased.  Zebra at a time can give birth to 2 off-springs.

The female ostrich have grey feathers and the male ostrich have black feathers. Ostriches cannot fly; but can run upto 2 km non-stop.  The eggs of ostrich are the largest of birds, very strong that it can withstand a weight of upto 20kgs.

In the same area of zebras and ostriches, stopped to see the antelopes: impala, springbucks and blazebucks. The impalas have horns only for the males whereas the other two varieties have horns for both genders.  The blaze buch has a white patch on its face, which gets developed when the buck becomes adult.

Okay, then enter the lions - into the lions camp - there are four camps (enclosed areas) for lions and one for wild dogs and one for the cheetah.

The time that we went to see the lions was actually their weekly feeding time.  The lions are fed only once a week - on Sundays 12 noon.  All lions were eagerly looking for the arrival of the feeding van.  The van came with cut pieces of cow / bull meat and distributed.  These meat are supposedly gifted by the nearby farmers in the area.

We also happened to see Letsatsi, a white lion which was the main cast in the 2010 movie "White Lion".  Because of the best performance it did in the movie, Masana told Letsatsi could not be gifted a bungalow or car, but was gifted with 6 lionesses.

A lion can have many lionesses - that is considered a family group.  In some group, there could be more than one adult male lion - but most of these adult male lions are brothers and together with their lionesses live together.  We saw such a group of white lions.  And Letsatsi had all its lionesses brown - the offspings could be pale brown or completely white - we could see both kinds savouring their meal with their mothers.  In one other group, a single brown adult male lion had 3 lionesses in the first camp and all were roaming eagerly awaiting their weekly meal.



And another surprising fact regarding lions:  The lioness discards the weak cubs - it does not take care of them.  In the park, the management takes care of the rejected cubs in a nursery.  Survival of the fittest! These cubs which are rejected by mother will never learn the art of hunting and may not survive longer if left in the wild.

Saw both cheetah and leopards.  Cheetah during safari and leopard inside the cage in zoo.  Cheetah is a muscular animal and can run at speeds of 80 to 120 km per hour - but not sustainable beyond some 200 metres or so.  The body gets heated up and it needs to slow down to cool.  So, it starts attacking the prey with full speed only if it is within the limit, otherwise it just lets go.


Cheetah has a black mark on its face which is needed for the absorpion of Vitamin D from sun light.  Cheetah hunts during the day unlike the leopards which are nocturnal and hunts during nights.  Leopards are smaller in size compared to Cheetah and can climb the trees. (Remember Bagheera in Jungle book, which is a black leopard)




The wild dogs and cheetah are fed thrice a week, unlike lions which are fed only once.  Each has its own metabolism.  And wild dogs are supposed to eat their food very fast and the lions the slowest, savouring each bite.  The lions could end up eating their portion of sunday noon meal late into the evening as well.

On returning, just before the end, a giraffe came and got its neck down into each of the vehicles and did some inspection!

After the safari, visited the mini zoo which housed leopard, cubs etc.  The zoo also featured something called cub world, where visitors can touch the small cubs of lions.

Monday, May 27, 2013

The Shiva Trilogy

So, "The Oath of the Vayuputras" is done and dusted! - the third and final book in the Shiva Trilogy series. Almost every one in my friends and contact list had read or at least bought the book and stored in their shelf to read sometime later.

Well, I started with the first book of Amish in the Shiva Trilogy series, around one year back, when I was shuttling between Delhi and Chennai for one of my consulting assignments.  At that point, already his first two books had come.

The concept behind the story is very simple, but the way it is executed is awesome.  Amish places lots of dots in the plane and connects them well and makes a nice coherent story.  

He asks a simple question "What if Lord Shiva was not a God as he was always imagined to be?  What if He was just a human being?"  And, takes us through the life of a man Shiva, who resided in Himalayas and how he ended up as a lead man for the Quest of His Time.  And what is such a quest? To destroy Evil.

Shiva is made to believe that he is the One to go after Evil.  And, who is that Evil?  Shiva takes up the journey and finds the answer himself.  In his journey, he is helped and guided by many people from a tribe of intellectual and spiritual advisors like Vasudevs to even a beggar outside a temple.

The first book sets up the the context, describes the ways of life of two main tribes Meluhans and Swadweepans (Suryavanshis and Chandravanshis) inhabited across the northern subcontinent.  The book builds up the characters of Shiva and Sati (lead protagonists) nicely.  The book introduces Naga and their unusual living, violence and an inclination for disrupting the normal lives of Meluhans.  Characters like Parvateshwar (the war-general of Meluhans), Lord of the Nagas, Ayurvati, Nandi all introduced and built-up succinctly. 

The second one, "The Secret of Nagas" explores the lives of Nagas. It introduces the readers to other regions like Branga, Panchavati (present day WB, MH respectively). It brings up and reveals some of the ugly secrets which was kept out of reach, for years by people in power.  The conversations that Shiva has with Vasudevs are interesting and have lots of deep philosophical insights.

In all these books, Shiva keeps his search for Evil, the view on what is evil keeps changing every now and then.  What considered evil, becomes not evil - it just a completely different way of leading life.  Shiva proposes many hypothesis and keeps disproving all of them, until what he finds to be the ultimate evil in the 3rd book.

The third book involves lots of battles and strategic thinking behind the wars and battles, not that these are not present in the first two books - but the first two are more philosophical than war-strategic as compared to the third.  The book gives enough hints of nuclear power being used in wars - talks about fission and fusion reactions.

Overall, there is a lot of insights and deep philosophical truths that can be derived from the books.  It is definitely not a one-time read.  Every new read will bring up some insights.

Looking forward to the second read, soon!

Friday, May 17, 2013

Automated Messages

We get messages from the banks, IRCTC, telephone bills, ecommerce sites etc on order status, payments, POS transactions, reminders etc.

Generally these messages start with two letter combination which are like LM, TD, BA, AD, MM, MD, VM, BM, BZ, BP etc

One of my friends who works as a Consultant in Telecom Business told what is the significance of these two letters.

The first letters represent the Messaging Service Provider and the second letter represent the city.  

LM - Loop Mumbai
AD - Airtel Delhi
TD - Tata Docomo Delhi 

An elaborate list here http://goo.gl/QzYBZ

Both the messaging service provider and the message receiving network charge for each such message..


Thursday, April 25, 2013

Visualization tools, Python, Ruby, Web Frameworks and more

Today I came across a tweet mentioning about Rega. Rega is an experimental project of Ruby wrapper for Vega.  Vega is a Visualization Grammar.  You can read more on Vega in this documentation.  Vega is strongly influenced by Protovis and d3.  By the way, d3 is the successor of Protovis - developed by Mike Bobstock et. al.

d3 is a javascript library for Visualization.  Some examples exhibiting the capabilities of d3 are in this Github Gallery I worked a little in d3.  Working with d3 is fun and the visualization that can be created are very cool.

Coming back to Vega, which is a Visualization Grammar - other similar grammars are Grammar of Graphics, ggplot2, Tableau's VizQL.  Tableau is a proprietary visualization software. Also there is Google Chart Tools.  You can play with these charts in Google Code's  Code Playground.  Google Chart is offered as R package googleVis which can be directly integrated from R programming language.

Recently, I had a chance to try Python.  Though, I have been a regular in Pycon talks in Chennai, I never used it much.  Perl has been my favorite for many years.  Now, I have started liking Python.  Also, I tried a few things in django, a web framework in Python - it is very powerful.  There are other web development frameworks available - Pylons (more a content management system), BottlePy, CherryPy, WebPy. Complete list here

And, there is a way you can bring in the power of d3 visualization from the django framework itself. You can explore the django-nvd3 package (which is still in beta).  D3, Vega, GoogleVis etc are relatively very new technologies.  

Also, had a chance to look into Ruby and Ruby-on-Rails.  It can one-on-one be compared to Python and Django.  There are some interesting discussions in StackOverflow discussing the pros-and-cons.  See here for a comprehensive list of Ruby web frameworks. 

Ruby (1995) interestingly is inspired by Perl, Lisp, Python etc. I am yet to try something in Ruby. The designer of Ruby Yukhiro Matsumoto works with Heroku (a PaaS - Platform as a Service company).  Probably, since Pe(a)rl was already there, some discussion went on naming the new programming language Coral or Ruby, and finally settled on Ruby. Interesting! 

Ruby site is generated by a site-generator called Jekyll, the author of Jekyll talks more about it here.

In exploring all these, came across something called CoffeeScript, which is a ease-to-program script which is compiled into a javascript. See this left to right translations of CoffeeScript and JavaScript code to see the simplicity of CoffeeScript.
With indentation for the control, iteration and function blocks, instead of the traditional braces, this looks very similar to Python. An additional info: Dropbox which initially had JavaScript code now uses CoffeeScript.

Thursday, April 11, 2013

Margin of Wins in IPL

Just got curious how the winning margins were in the all 5 editions of IPL combined (from 2008 to 2012).  So, I drew the frequency pattern (statistically speaking - histogram) for the margins in terms of both runs and wickets.  This is how it looks like:


As people expect and want, most of the matches are close contests - with the teams winning by 1-20 runs. 
In this analysis - I have not taken the tied matches into account.  And, in the chasing wins, most do so comfortably by 4 to 7 wickets to spare.

Interesting to look these completely different distributions!

Thursday, March 28, 2013

A Geometric Puzzle







Find the area enclosed by the 4 arcs in the figure (shaded in grey)

The figure is drawn as below

1. A square is drawn with side "a'

2. With the side of square as radius, 4 quadrants are drawn with centre at each of the vertices.


Wednesday, January 23, 2013

Gold Import Duty Raised!

This was the news of the day.  Import duty on gold raised from 4% to 6%.  And, just a day after that announcement, Govt. followed with another one, raising the import duty of raw gold (called Dore, an alloy of gold and silver) from 2% to 5%.   News Item in Live Mint: http://goo.gl/JWQmh

Reason: Controlling the Current Account Deficit.

What is Current Account Deficit? 
It is the amount by which the total imports exceed the total exports.  A country having current account deficit imports more (goods and services) than what it exports and owe the rest of the world from revenues generated within the country.

Why increase import duty on gold?
India imports approximately 900 tonnes of gold per year.  That is approximately 20% of Annual Gold Demand of around 4500 tonnes. (Data: World Gold Council, Demand Trends http://www.gold.org/investment/research/regular_reports/gold_demand_trends/ ).  As quoted from this article (http://goo.gl/7KXaA) of Live Mint Gold imports constituted 11.5% in India's total imports basket in 2011-12 in value terms, growing from 6.9% in 2008-9.\
This means there is a drastic increasing trend in gold consumption.  Gold does not contribute greatly to the real economy of the country - as most of gold imports are for jewelry and coins which get promptly stored in households and safety lockers.  See this article by Nilesh Shah on Indian consumers crazy appetite for gold http://goo.gl/lZA2z  He warns that if Indians stop buying gold, the gold bullion market may crash (and such a price correction may in fact be welcome)

Can I do something as a retail investor?
Yes, one can reduce the consumption of gold.  Or to put in better words - look for investment opportunities other than gold.  Because, the gold investment habit of Indian housholds is costing the country dearly in terms of widening the current account deficit.  And, Govt. of India, at this point is signalling the same to the investors.  It is up to the individual investors to take cue and act accordingly.

Wednesday, May 16, 2012

KXIP v CSK Preview

With a win against MI, now KKR is also into the final four!

Tomorrow's KXIP v CSK match may produce a third semifinalist in CSK. But, if KXIP wins, then CSK will join RCB, RR and KXIP in 20+ % chance of making it to semi-finals.  A loss for KXIP and their semi-final spot is gone for sure!

MI, RR, RCB, KXIP - all want CSK to lose!


Team Current Chance   KXIP v CSK  
    KXIP wins CSK wins No Result
DD 100.00 100.00 100.00 100.00
CSK 64.06 28.13 100.00 81.25
DC 0.00 0.00 0.00 0.00
RCB 18.75 25.00 12.50 25.00
MI 81.25 93.75 68.75 68.75
RR 21.88 25.00 18.75 25.00
KXIP 14.06 28.13 0.00 0.00
KKR 100.00 100.00 100.00 100.00
PWI 0.00 0.00 0.00 0.00

MI v KKR Preview

It is clear that CSK and RCB are least bothered about this match!  Though RCB may hope for a rare "no result" for this match, as that boost its chances of getting a semi-final spot.

RR wants KKR to win.

KXIP wants MI to win.

Team Current Chance   MI v KKR  
    MI wins KKR wins No Result
DD 100.00 100.00 100.00 100.00
CSK 64.06 64.06 64.06 64.06
DC 0.00 0.00 0.00 0.00
RCB 18.75 18.75 18.75 21.88
MI 90.63 100.00 81.25 96.88
RR 18.75 15.63 21.88 9.38
KXIP 16.41 18.75 14.06 14.06
KKR 91.41 82.81 100.00 93.75
PWI 0.00 0.00 0.00 0.00


Tuesday, May 15, 2012

DD v KXIP Preview

DD wins and they are through to the play-offs.  But, what happens to other teams with a Delhi win?

The table below looks at different results of this match and how that affects the chances of other teams to make to the semi finals.

Semifinal Chance %

Team Current Chance   DD v KXIP  
    DD wins KXIP wins No Result
DD 96.88 100.00 93.75 100.00
CSK 57.03 64.06 50.00 64.06
DC 00.00 0.00 0.00 0.00
RCB 20.31 18.75 21.88 18.75
MI 89.06 90.63 87.50 87.50
RR 17.58 18.75 16.41 16.41
KXIP 30.66 16.41 44.92 21.88
KKR 88.48 91.41 85.55 91.41
PWI 00.00 0.00 0.00 0.00

DD win improves the chances of CSK, MI, RR and KKR to get a semi-final berth.  Also, it is clear that only RCB will hope for a Kings XI's win in this match.