07 5 / 2013

At HasGeek we decided to spend part of summer in McleodGanj. This trip’s main focus was to code and enjoy beauteous mcleodganj surrounding.

Trip

We(Kiran, Supreeth, Haris, Praseetha, me) started from Bangalore 13, April, 2013 and returned on 1, May, 2013. I have uploaded the photos in FaceBook, notes of food items I had in the trip, list of places visited in McleodGanj.

Following is the breakup of the trip cost.

13, April 10:00PM, Yeshwantpur Railway Station, Bangalore,

  • Dinner : 60
  • Taxi fare: 50 
  • Train Ticket cost: 1750

14, April - In Train crossing central India

  • Breakfast: 40
  • lunch: 100
  • Dinner: 80
  • Ice Cream: 20

15, April: Delhi

Jama Masjid

  • Breakfast: 50
  • Metro Smartcard: 100
  • Rickshaw fare: 10
  • lunch : 150
  • Icecream: 85
  • Dinner: 85
  • Evening we started to Mcleodganj in Ac Volvo.
  • Bus fare: 800

16, April: First day in mcleodganj

  • Breakfast: 50 
  • Tea: 15
  • Dinner: 160
  • Snacks (like biscuit, chocolate): 110

17, April: Small trek to air jaldi office in the evening

  • Breakfast: 50
  • Butter Tea: 15
  • Lunch: 90
  • Ginger Honey lemon tea: 50
  • Dinner: 170

18, April: Evening walk to St.John’s Church

  • Breakfast: 65
  • Lunch: 70
  • Dinner: 180
  • Yak Yak Tshirt: 200
  • Coffee: 100

19, April: Walk to Bhagsu waterfalls

Supreeth flying

  • Breakfast: 60
  • Dinner: 200
  • Three pin holder: 80
  • Cheese potato omlette: 50
  • Pani Puri: 30

20, April: Work at leisure

  • Breakfast: 60
  • Lunch: 140
  • Dinner: 155

21, April: Walking to Dalai Lama Temple

  • Breakfast: 160
  • Lunch : 240
  • Complete Hindi Book: 350

22, April - Trek to Triund

Triund

  • Breakfast: 60
  • Snickers: 80
  • Lunch: 90
  • Tea: 30
  • Snacks: 75
  • Gloves: 250
  • Dinner: 130
  • Coffee: 40
  • Stay: 150 ( We stayed in a hut in Triund)
  • Snacks: 28

23, April - Trek to SnowLine, walk back to McleodGanj

Mountains in Snow Line

  • Breakfast - 110
  • Coffee: 40
  • Lunch: 130
  • Snacks: 26
  • Dinner: 370 ( We had Exactly Dinner in Out Of Blue)
  • Taxi: 30

24, April - Relax

  • Breakfast: 100
  • Lunch: 285
  • Dinner: 250

25, April - Climbing Down to Dharmasala

  • Breakfast: 62
  • Laundry: 60
  • Mcleodganj stay(9 days): 2160

26, April - Leaving to Delhi in the evening

  • Dharmasala Stay: 500
  • Taxi: 110
  • Bus Fare(Dharmasala to Delhi): 800

27, April - Attending BarCamp

  • Metro card recharge: 100
  • Vad Pav, snacks: 400

28, April - Trip to Taj Mahal

  • Filter Coffee: 20
  • Lunch: 240
  • Gulfi ice: 10
  • Travel: 300
  • Taj Mahal car parking: 50
  • Dinner(basically chaats): 120
  • Agra fort + Taja Mahal Ticket fare: 40

29, April - Last day in Delhi

  • Lunch: 432
  • Iron man 3 Movie: 100 
  • chaat: 30
  • Dinner: 300

30, April - Marching back to home

  • Train fare: 2150 (Inclusive of food)

1, May - Home

  • Tips: 100
  • cab: 100
  • Bus Ticket fare: 13
  • Breakfast: 35

Total Cost: 16736(My Budget was 15000). It is worth the money.

Work progress

During the trip I was working on Hacknight, sent 9 pull requests, 6 merged to master, 3 pending for approval. Added 647 LOC and removed 110 LOC. We worked out of Cafe, room with data cards, phone internet without any high speed wifi connection. For first 4 days, I was unable to work because of my bad internet data card.

Kiran made better progress, was able to hold his github streak.

Note

  • Amount expressed is in Indian Rupees.
  • In Delhi we got accodomation in friends place and food too.
  • We shared two rooms in Mcleodganj, so it was cheap.
  • We tasted Italian, Tibetian, Indian, Japanese, Korean, Israeli, French etc …
  • Butter tea is my favourite of the trip.
  • Dogs were synonymous to cafe.

Hope to visit the place again.

13 4 / 2013

Everybody must have known about Six Senses first reference is found in Tamil literature Tholkappiyam.

ஒன்று அறிவதுவே உற்று அறிவதுவே
இரண்டு அறிவதுவே அதனொடு நாவே
மூன்று அறிவதுவே அவற்றொடு மூக்கே
நான்கு அறிவதுவே அவற்றொடு கண்ணே
ஐந்து அறிவதுவே அவற்றொடு செவியே
ஆறு அறிவதுவே அவற்றொடு மனனே
நேரிதின் உணர்ந்தோர் நெறிப்படுத்தினரே
நூல் – தொல்காப்பியம்
அதிகாரம் – பொருளதிகாரம்
திணை – மரபியல்

4varinote - Tamil and Omtamil - English has detailed explanation on this.

13 4 / 2013

I was working on Hgtv feature, syncing slides and videos, when video is viewed slide changes automatically. Seems easy but guess what someone has to take pain to watch entire video and collect the details about timings of the video and slide number . Then pass on the info to presentz.js which syncs video and slides.

Iframe

If you look into source code how slide show and video is inserted, it is iframe. All videos are from youtube, slides are from speakerdeck, slideshare. Now to sync video and slide, I need to fetch the slide number and current time of video. Youtube has js api, which was easy to figure, but speakerdeck and slideshare inserts images into iframe. When next button is clicked image is changed. If I can access DOM I am done, but unfortunately you cannot access the DOM of an Iframe for a Cross Origin Request. I found this info after one whole day of tinkering and trying all answers in stackoverflow. Then I looked into presentz JS how it handles slide changing. Speakerdeck receives postMessage, it accepts nextSlide, previousSlide, goToSlide messages. Once speakerdeck processed the messages and sends message to originator, and the received message has to be processed(window.addEventListener). Before figuring above messages I was brute forcing to get figure out how to get current slide. Once I figured it only accepts three message, then it was easy. Below is the code.

    var receiveMessage = function(event){
    var data;
    if (event.origin.indexOf("speakerdeck.com") === -1){
      if (event.origin.indexOf("slideshare.net") === -1){
        return;
      }
    }
    data = $.parseJSON(event.data);
    if (data[1]) {
      slideno = data[1].number;
    }};

Then register event listener

window.addEventListener("message", receiveMessage, false);

Then slideshare was bit out of track. Slideshare had js api which requires swfobject and swfobject_playerapi. Then it was bit easier still took me some time to figure out missing swfobject_playerapi is required.

It took me five days to finally get this feature and pull is ready.

Learning:

  • I learned coffeescript.
  • Parsing DOM of Iframe is not possible for CORS.
  • postMessage

This feature was so far the hardest one.

Root Cause

The root cause for this problem, is my **Ass u mption **. I was trying to use presentz.js to get current slide and video player timings.

31 3 / 2013

I live in 5th floor, my table is near window. I spent saturday by watching 3 documentaries and 1 tamil movie Sindhu Bhairavi, yes no single line of code. Once I am done with movie it was 00:30 AM, now stepped into the balcony was mesmerized by breeze. I felt like a poet and casual thoughts.

Yes breeze indeed brought a new thought seed from distant place, “How about coding from balcony”. No second thought, cleaned, set up done. All ready now. Truly great to sit in bean bag hearing Tamil song with laptop, random stray dog barking, car sound and cool breeze.

All set to code :-)

26 3 / 2013

கற்றது கைமண் அளவு, கல்லாதது உலகளவு - ஔவையார்.

Yes, you must have read this is tamil text book in standard 1. Now this is translated into english and referenced in NASA. From NASA - Cosmic Questions Exhibit

What we have learned
Is like a handful of earth;
What we have yet to learn
Is like the whole world
    - Auvaiyar, 4th C poet, India  

Wikipedia has an article about Avvai paatti.

26 3 / 2013

Hacker School is a three-month, full-time school in New York for becoming a better programmer for free, but stay, travels is yours.

I have no idea how much it will cost for travel from India, stay, food, internet, transit so I asked the question in Quora. I got pretty good answers.

Then I started do my lame math.

Monthly Expense(USD)

 Rent = 1000
 Phone = 80
 Transit = 100
 Internet = 40
 Electricity = 40
 Food = 250
 Snacks = 100
 Outing = 120
 Misc = 100

Total = 1830.

So let me round to 2000 USD for safety.

If I am right I need to pay advance for Room, let me add one month rent to total expense. 7000 USD now.

Two way flight will cost 60000 INR, 10000 INR for Visa. Assuming 1 USD to 55.0, 70000 INR = 1272.73 USD.

7000 USD is 385000 INR. So total money required for me is 455000 INR.

Q: How long will take to save so much money ? A: 30 months to 36 months.

So after 3 years these USD to INR must be higher and US food pricing, rent must be increased at least by 2% to 5%. So it will be 7350 USD.

By guess 1 USD will be 60 INR in 2015. 7350 * 60 = 441000, Wow to spend 3 months in Hacker School I need to save money for 3 years.

Will my interest hold up ?

Time and Tide waits for none.

25 3 / 2013

Now Python code can be evaluated using Client side Javascript with the help of empythoned project. empythoned uses emscripten which convert LLVM bitcode to javascript.

What is empythoned?

Empythoned is project which has converted CPython to javascript. I have created a demo project to test how to use empythoned, have a look.

16 3 / 2013

Python supports parallel assignment like

>>> lang, version = "python", 2.7
>>> print lang, version
python 2.7

values are assigned to each variable without any issues.

>>> x, y, z = 1, 2, x + y
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined

First python tries to evaluate x + y expression. Since x, y is defined in same line, python is unable to access the variable x and y, so NameError is raised.

>>> x, y = 1, 2
>>> z, a = x + y, 65
>>> print x, a
1 65

In above code x, y is referenced before so x + y is evaluated and the value is assigned to z.

So don’t assign the values in same line and use it in expression

04 3 / 2013

Most of my time in Facebook is spent on reading status by FanPage, Brand Page, Other Pages. So I decided to unlike all the pages who hasn’t updated for a while. The problem with facebook is page updates gets higher priority in the user feed than friends feed. The page feeds are well prepared, informative, curated, catchy. As a result users interaction is concentrated more on page feeds than on user feeds. This effects makes me to come back. I stop scrolling once I hit the viewed content. 

I haven’t used FB Graph api. I have added analysis of my own fb activity to my todo list.  

01 3 / 2013