Thejesh GN

A Blog, A Website and A container for all my views with excerpts from technology, travel, films, india, photography, kannada, friends and other interests. I am Thejesh GN. Friends call me Thej

Archive for February, 2011

From Java to Python

Posted by Thejesh GN On February - 22 - 2011

If I remember properly I haven’t learnt any new language in last three years. All I had done was learning more libraries in Java, PHP and JavaScript. Partly because I was not interested in learning completely new language and its ecosystem. Also because there was no need. All my bread and butter work was done in Java. I have been using Java for like ten years now. All I needed to do was add more libraries and frameworks. I was in comfortable position. For everything else (my basic web hacking) there was PHP. For fun there was JavaScript. So as you see there was no place for new language.

Slow start
Last year when I went on sabbatical. I also planned to learn something new. But then new language wasn’t on my priority list. So I didn’t :)

Tipping Point
Sale of Sun to Oracle happened. That was the trigger and tipping point. I could somehow never associate myself with Oracle. All of a sudden this cool geek company was part of big business Oracle. Now I wanted a language which has its roots in FOSS and is developer oriented.

Languages considered
I started looking for a new language. The final list of languages were Ruby, Python and Scala.

The one
I was in search of a language

  • Rooted in Free and Open Source ideology
  • Clean and easy to learn
  • Lots of libraries
  • OOP support
  • Can be used both for system level programming and web development
  • Preferably scripting language
  • Cross platform
  • Community support


Python satisfied everything. So it was Python.

End of Java?
Not really. Though I might use it only on Android platform!

The new beginning
Once I was sure of Python, the rest were easy. On my default platform Linux (Ubuntu), I use Scribes as my editor. On windows I use Notepad++.

Version Confusion
Of course there was a confusion of learning Python 2.7 or 3. But then I was learning and not implementing so chose shiny new Python 3.

Books to begin
Didn’t have to buy any books. Used A Byte of Python
and Dive into Python heavily. Also used Python wiki.

So here I am with a new language, exploring new world. Its been great until now and I expect the same in future.

Stage-3: Riding to Rohtang pass

Posted by Thejesh GN On February - 13 - 2011

This is one of our toughest rides not just physically but psychologically too. But I should also say it was the best and most beautiful track to ride on. This post is going to be long with lots of pictures. Fill your coffee mug.

When we reached Manali it was already very cold. Upon that we had a bad news waiting for us. Roads to Rohtang was closed due to heavy snowing. People around were not very hopeful about next day too :(
We woke up early next day but it was very very cold. We couldn’t move out until 8. None of us had experience in riding in cold weather. So I wore five layers of clothings and had heavy breakfast before actually starting.

Rohtang is just 57kms from Manali. Its just the nature of the road and weather makes it difficult to reach. To our luck it had not snowed much last night and we had bright sun early in the morning. Just 7/8 kilometers in to the ride, we could see visible changes in our surroundings.

Bright sun, blue skies and clear roads. We were enjoying our roads. I was not really sure about the weather, so started clicking from the word go.
Read the rest of this entry »

Batch transliterating names into Kannada using Google API

Posted by Thejesh GN On February - 4 - 2011

Some times work at Janaagraha throws awesome challenges. Like as part of BEST project we are cleaning up voters list. Voters list in Karnataka will have names in both English and Kannada, Most of the volunteers have filled up only in English and hence we were left with transliterating names into Kannada. I was thinking about automating it. After all transliterating is not as complex as translation, right? Wrong. Its difficult to write one specially when there are so many spelling variations in English for the same name in Kannada.
Like for example both Sreenivas and Srinivas are ಶ್ರೀನಿವಾಸ್ in Kannnada. I found Google transliteration does that pretty well. But they have only Javascript APIs for web pages but nothing for server side code.

But Google worked and I found a non-public API of Google Transliteration API which gives JSON output for a given english input. Cooked up API in PHP to clean up JSON and give an array of results. Code is github for obvious reasons.
Using

$kn = transliterate("thejesh,ramesh,
 uthara,shreenivasa,reddy");
print $kn[0];

Probable drawbacks:
1. Its a non-public API provided by Google. Not sure when they will block it.
2. As of now it can transliterate only 5 words at a time
3. No information about API rate limiting. So be on the safer side.

Let me know what do you think.

1by2coffee – Voice from Egypt – Iman Bibars

Posted by Thejesh GN On February - 3 - 2011

Vibha helped me to get in touch with Iman Bibars ( I am extremely sorry for mispronouncing your name) who works with Ashoka.org in Egypt. In this ten minute telephone interview we talk about situation in Egypt, expectations of people of Egypt from rest of the world, mainly India. And of course is internet back?
Cup 14 – Voice from Egypt – Iman Bibars

Thanks a lot for your time Iman.

PS: Of course I am not the best interviewer in the world, I am still learning.
Read the rest of this entry »