Wait… But… Why?

I don’t always subscribe to blogs..

But when its about nicely written articles about science, technology and all the cool things that I usually want to read about, but couldn’t, I am like:


I have become a fan of http://waitbutwhy.com/ just after reading an article about Elon Musk and one about Fermi Paradox


Programmer Zen

Just read this quote and I loved it:

A beginning programmer writes her programs like an ant builds her hill, one piece at a time, without thought for the bigger structure. Her programs will be like loose sand. They may stand for a while, but growing too big they fall apart.

Realizing this problem, the programmer will start to spend a lot of time thinking about structure. Her programs will be rigidly structured, like rock sculptures. They are solid, but when they must change, violence must be done to them.

The master programmer knows when to apply structure and when to leave things in their simple form. Her programs are like clay, solid yet malleable.

— Master Yuan-Ma, The Book of Programming

Authenticating using Facebook

I had figured out how to authenticate users using Facebook a couple of months back. But I didn’t document it, and so yesterday I again wasted my time figuring it out. So here is the brain dumb so that I won’t waste my time again at the time of need. 🙂

Prerequisite: Create an app using Facebook Developer account and create the necessary App ID and App Secret keys.

If you are testing out your app and you are running it locally, the site URL should be something like http://localhost:8090/

At the client side:

Asking for permission and login:

  • Use the SDK provided by facebook
  • I am assuming Javascript SDK is used. Inspect the response returned.
    • Send the authResponse.accessToken and authResponse.userID to the server for authentication.

At the server side:


  • Verify the user by calling the Facebook Graph API:



    "data": {
        "app_id": "1234",
        "application": "testapp",
        "expires_at": 1426158000,
        "is_valid": true,
        "scopes": [
        "user_id": "111112223333"

  • input_token is the authResponse.accessToken we obtained as a result of the login process from Facebook.
    access_token is the App Token. It can either be generated as mentioned in this link. Or instead of generating we can use the concatenated form: {app_id} + ‘|’ + {app_secret}. I have used this second form above.
  • Verify the JSON obtained and check whether “is_valid” == True and “user_id” == authResponse.userID to make sure user is a valid one.
  • The authResponse.userID returned can be used to identify the user and used instead of username to lookup users.

Using the Graph API:

Suppose we want to obtain the user’s email Id at the server side:
Call the API as follows:

Again Agastyakoodam !

When I completed the Agastyakoodam trek two years back, I had decided to visit this awesome place again. It happened this year about two months back.

This time it was a group of 6 friends, including me. We were very much fortunate to get the entry permit on the first day of the trekking season. This gave us the forest in a much more pristine and virgin form. Because, as people start coming forest loses its glory!

There is not much to write as I have already explained about the trek in my previous blog entry. But I’ll highlight the differences that happened this year.

This year onwards, permit is being sanctioned online by the Kerala Forest Department. This saved us a lot of hassle and we got the permit for the first day itself(the season started on Jan 15th this time).

We started on January 15 and completed the trek in 3 days, unlike the last time where we did it in 2 days. The result? We enjoyed the trek much more. It was a relaxed trek and we enjoyed it to the core. We took ample photos and videos too, something we couldn’t so last time because of time constraints :). I would recommend everyone to complete the trek in 3 days.

This time our gang was in a uniform (except one – he could make it only at the last moment, and so couldn’t have the luxury of being in our uniform). See our uniform for yourself. Bhakti exploding 😀


In fact, the forest warden in the base camp told us seeing our uniform that we had immense Bhakti inside us 😀 Little did he know that it was just a show off. Any way, this uniform was one of our best decisions. Trekking wearing this attire was the most comfortable thing!

So here is the trip in short – we started on Jan 15th morning at about 11:30 (we reached their late) and reached the base camp by 6 PM. The next morning we started the ascend to the peak at about 7 in the morning. This time since we were not at all in a hurry, we took enough time in enjoying each step ;). We reached the top at 2 PM! (thats’s too late by any standard, they want you to start the downward trek by 2:45PM max). Unlike last time, it was not at all windy, also it was too hot at the top. We started the downward journey by 2:30PM and reached the base camp by about 5:30PM (ya, downward journey was completed pretty quickly). We rested off the night. Next day morning, our departure was delayed by unexpected rains. So we could only start by 9 AM. We reached forest outpost by about 3:30PM. And thus our trek was done.

We had tracked our journey with GPS. I’ll update this post once I get the track details from my friend.

Keep Travelling 🙂 Enjoy the world. 🙂 Don’t disturb what’s left off the forest and don’t leave any traces 🙂


“മനുഷ്യരെ രക്ഷിക്കേണ്ടത് ദൈവമാണ്. അല്ലാതെ ദൈവത്തെ രക്ഷിക്കേണ്ടത് മനുഷ്യരല്ല. ദൈവത്തെ മനുഷ്യൻ രക്ഷിക്കേണ്ടി വരുമ്പോൾ ദൈവത്തിന്റെ വിലയിടിയുന്നു.” – അങ്കമാലി മറക്കാമോ? – P.J.Antony

P.J. Antony writes that people were fooled into taking part in the Liberation Struggle (Vimochanasamaram) by the Church, the Congress party and everyone else (Uncle Sam’s CIA??) who were afraid of the Communist party getting their first foothold in India

Another NoSQL to the kitty

Graph database is a great tool for mapping and traversing data with relationships. But doesn’t RDBMS have relationships – one-to-one, many-to-one etc? Why should we go for graphs?
Its simple! Graph databases are best suited for those cases in which a graph comes to our mind instead of a table!
I finished the online course on Neo4J two days back. Its a really simple graph database, and a great starting point to experiment graph databases.

Now the NoSql databases I am familiar with are HBase(tried it about a year back), Redis and Neo4J.

Read and explore stuffs outside your domain. Happy coding 🙂

Jackson JSON and Dynamic JSON creation

FasterXML Jackson is a great tool for converting objects to/from POJOs.

Its a great tool when we know the structure of JSON beforehand. But what if we don’t know that? In that case we can use a Map<String, Object> to store the unknown objects. Below two links provide useful info:



Happy Coding 🙂