Sunday, November 29, 2015


Many times I decide I will not do something for e.g. say browsing HN when I'm working on something. I will even do it with great success that day. Then the next day, I accidentally open the website. I just innocently click an link and start reading. That follows another and by the time I know it, I would have wasted a lot of time clicking and reading whatever I find interesting. And when look back how it happened, it always comes back to the point that I was doing it without thinking mindlessly.

Sometimes I catch myself about to do this, and I can stop myself thinking about why I didn't want to do it in the first place. And this gives me glimmer of hope that if I'm more mindful of what I'm doing, I will be able to really able to pull it off. 

What is mindfulness?  It is being fully aware of the present moment and knowing why and what you're doing. It is being fully present in what you're doing at that moment. If you are fully present, you are aware of your thoughts and it is easy to just acknowledge the distracting thought and leave it instead of reacting to that thought. Actually all life  is only in the now, but we forget it most of the time.  

How can you be mindful? You can do few simple things to live mindfully. Put all your senses in what your'e doing. It is not as easy and that because our minds are simply distracted. So how do you overcome those distractions and live in the present moment ? As everything else, it has to be practiced and developed. Sages and teachers have faced this problem eons ago and were able to design and perfect a method to practice mindfulness. That method is meditation. There are many different ways of meditation practice. One simple way is to put your attention on your breath. Any time your attention wanders off your breath, simply realize it and bring your attention back to the breath without judging. But how do you know if you have totally wandered off and don't even know that ? You can try counting your breaths and that will give you another anchor to return back your attention to your breath each time you count. The more you practice this, the better your power to stay focused will increase and you can start becoming more mindful. 

If you are new to meditation, you can download the headspace app. It will guide you through the meditation process. 

Being mindful not only increases your focus. It will help you overcome something you do mindlessly, whether it is getting angry quickly or being negative on yourself. If you give your mind some space to relax and be present lot of stuff that take your attention mindlessly can be freed to be put to use on stuff you want to put your attention on.

Any one person's reality is ultimately wherever they choose to focus their attention and time on. I stole this line from Ben Thomson. So if you can deliberately choose what you focus on, you can make that thing a reality.

Monday, July 27, 2015

Thoughts on Hinduism

In the role of organized religion, I argued that religion 

  • gives us hope about problems we cannot solve ourselves.
  • provides some social mores to stop society for degrading
  • Provides a set of common cultural values, rituals and expected conduct.

Initially I argued a reasonably intelligent man can form his own beliefs but I realized that it is not everyone's interest and not everyone has the patience to think through all the beliefs and understand them and religion provides some sensible defaults which people can follow. 

In Why I prefer to be an atheist, I argued against the beliefs that we are born with some karma and we need to work towards attaining moksha and stuff like that. 

In my evolving understanding of it, it seems that whatever is being said in Hindu philosophy has two layers to it. 

On the outer layer it just lays down some cultural values, rituals and expected conduct so that people can live their lives without much confrontation. Historically when these communication methods were not available, religion was one of the way in which law and order was maintained in the society. So some of the customs and rituals were created and used which were suited to that time. Even the karma philosophy was created to create the feeling that being good will bring outcomes and being bad (sins) will create negative outcomes and exaggerated it saying if you do something bad, it will haunt you for multiple incarnations. 

But for a discerning mind, there is an inner layer of the philosophy which was always available to the learned. I particularly like the 'Tat twam asi' principle which says 'You are that' where that refers to God or divine. It doesn't constrain us with the Karma philosophy or anything else. It says that you have divinity in you. You have all that is needed at this time. It is upto you to recognize this and live accordingly. This is the central tenet of the 'Advaita' philosophy expounded by Sri Shankaracharya.

So previously I was looking at the different philosophies literally and was only looking at the outer layer and now I also see the inner layer about the truth that was already known and evident but only available to the discerning mind. 

So a lot of customs and rituals we follow were mostly created for the times they were created for. It is for us to examine those rituals and decide what to keep and what to ignore. 

It would have been great to know why a custom was created and how it has morphed into. But unfortunately most of our history is not written as we didn't good means of writing and storing info. The writings on leaves didn't survive our tropical climate. Lacking good means of communication and writing all they could do was to create poems for people to remember and spread it orally and that is what is available today. Sure someone who created something might have known why he created it, but not everyone has the patience to understand why it was created and the creator might not have had the patience/time to explain it to everyone, so it might have been reduced finally to just a rule to follow. 

Now the customs we follow have become like puzzles for us to figure out the reason for that and thats really interesting to me.. 
Thanks to Balaji Viswanathan on Quora for sharing his excellent thoughts on Hinduism 
He writes more eloquently than me and trust me, you wont be disappointed.

Start with this

Monday, March 23, 2015


Drona was teaching archery to Pandavas and Kauravas. There was bird on top of which of which the eye was to be shot. He asked everyone what they were seeing and they
replied like they were seeing a the sky, the tree, the branches, moving leaves, the bird on which the branch was sitting etc. Only Arjuna replied that he was
seeing only the eye of the bird. It seemed like a impossible tale for me as I thought it was impossible to see only the eye of the bird without seeing the other things
surrounding it.

Only now I understood that it was a lesson about focus. It is not seeing but the ability  to look. The ability to ignore extraneous details and to just focus on
what is important. To be able to really see only what we want to see. To be able to say no to other interesting things vying for our attention. The narrower the focus
the easier it is to hit the target.

Monday, March 2, 2015

Blogs I follow and enjoy

Just wanted to quickly point you to some blogs I read and enjoy which you might like too...

Recently I discovered the blog of Cal Newport, who is extremely productive, completed his Phd, wrote three books, maintains a popular blog at and eagerly shares his productivity tips.

A must read:

After these there are other blogs I read and have thought provoking posts.. you can sample them to see if you like..

Wednesday, January 28, 2015

Learning Scala

I am taking the 'Principles of Functional Programming in Scala' taught by the creators of Scala programming language Dr Martin Odersky.

It is a really good introduction of functional programming and its advantages compared to imperative programming. It is really good and check the course here if you get time.

But the course goes too fast without teaching much Scala so it is not a great introduction to Scala. So I am learning the syntax and doing some practice. I will share my learnings in the blog here.

Thursday, April 17, 2014

This Week I Learnt - 2

Ok. I am posting this after two weeks of the first one. But had a lot of work and couldn't find time for this.
So without much further ado, here are the learnings of the past two weeks.

1. Create a project with Gradle
I attended a training called - 'Agile Development With Scrum' and the trainer said if we are really following scrum, we should be doing atleast three things.
1. Daily Scrum Meeting
2. Test Driven Development
3. Continuous Integration.
Though we have heard things so many times, sometimes hearing it just one more time clicks (Tipping Point) and we are pushed into action. So I wanted to do
Test Driven Development. For that, a good build process becomes essential. So I surveyed the build tools available in the market. There are Apache Ant, Maven, Gradle,
Buildr and SBT (Scala). And the Spring team, for whom I have a lot of respect and who eased the development in Java, have started using Gradle. It added a lot of
momentum to Gradle. The syntax of Gradle is a seperate DSL (domain specific Language) written in Groovy and it is very concise compared to Maven. I decided to give it
a try and set it up for a web project. The dependency management is very easy and it can use both Maven and Ivy libraries.

Advantages: Very less work compared to Ant. Adding "apply plugin 'java'" to the build file will magically add all java related tasks like compile,build,jar,test etc to the build file
Very concise compared to maven. No big XML files.

Disadvantages: Not many plugins available. I used the jettyRun command which has options for automatic deployment by scanning the project for changes, but it is not working well.
It seems the tomcat plugin overcomes this problems. But I have to say I am a convert to Gradle. It makes dependency management lot lot easier and a first step to TDD.
Definitely going to use Gradle for the coming projects.

2. One-On-One Manager tools:
I don't remember how I came across this, but I learnt that using weekly scheduled one on one's with all the direct reports is one of the best ways to work together
and better with the team. The important things to remember are that it is an employees meeting rather than managers meeting. So employee should set the agenda.
The key to a good one-on-one meeting is the understanding that it is the employee’s meeting rather than the manager’s meeting. This is the free-form meeting for all the pressing issues, brilliant ideas and chronic frustrations that do not fit neatly into status reports, email and other less personal and intimate mechanisms.

If you like structured agendas, then the employee should set the agenda… During the meeting, since it’s the employee’s meeting, the manager should do 10% of the talking and 90% of the listening… While it’s not the manager’s job to set the agenda or do the talking, the manager should try to draw the key issues out of the employee. The more introverted the employee, the more important this becomes.

Some questions that I’ve found to be very effective in one-on-ones:
If we could improve in any way, how would we do it?
What’s the No. 1 problem with our organization?
Why? What’s not fun about working here?
 Who is really kicking ass in the company?
 Who do you admire?
 If you were me, what changes would you make?
 What don’t you like about the product?
 What’s the biggest opportunity that we’re missing out on?
 What are we not doing that we should be doing?
 Are you happy working here?

3. PostGIS Installation on Amazon Ec2
I tried to install PostGIS on Amazon Linux AMI Ec2 instance but couldn't do it. All the forums seems to say that it is better to use Redhat or Ubuntu instance.

4. Trying to get a video to play using JAVA.
Currently I am just writing out the response using a servlet, but this way there is no way to seek through the file. It seems we need to allow for range queries for it to work. There is solution here by Java Guru Balusc Simply wondering why there is no framework level solution for this.  [OSS]

Monday, March 24, 2014

This Week I Learned - Week 1

I read a lot of stuff daily and sometimes I don't remember what I read after some time. So in order to remember them and review them, I would like to note them down in my blog and share them.

These might be useful to others too.

1: Older Developer Problem: I read about a developer who is out of work as he is older and the same work can be done by other younger developers at fraction of the cost and the technologies he has learned have become old. In India, most of the developers grow into the managerial responsibilities after some time, it does makes sense to keep in mind the things we can do to avoid the older developer problem if we wish to continue in the developer path. There is an excellent answer in Quora about always being fresh.

2: Comparison of Javascript Frameworks: There are lot of javascript frameworks coming up for creating single page/multipage javascript applications. While planning to build an application, I came across this comparison of Angular JS, Backbone JS and Ember JS. There are important differences between each of the apps. Angular JS is very adaptable and guides developers to write testable code often. Backbone JS doesn't do a lot of handholding and is used to write single page apps. Ember JS is the biggest library but it does provide lot of support for common use cases like back button support which are anyway required in an application.

3: MicroServices Architecture: Martin Fowler talks about new kind of application architecture called Microservice architecture. Spring Framework is also going forward in this direction.

The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data.
 Here I do see the advantages of this kind of architecture. It is easy to use different technologies for different parts of the application and it would be possible to make changes quickly as everything is decoupled. I am not sure how we can decouple data. Till date, in all the applications I have created, one database contains lot of data related to users and it spans multiple functionalities. How can we split that data without duplicating the user information at each place ?

4: Spring Boot and other projects: Spring 4 release brought a new framework called Spring Boot which is used to quickly start a spring project. It helps to quickly get up and running with applications ala Rails. I have tried that and it works well to start up a web application. But it is too early to see how easy it is to configure or change the defaults included in the template project. It uses Groovy internally to decorate the classes so that developers need not write boilerplate code.

5: Devops with Chef & Vagrant: To get over the problem of long time for development machine setup, there is a solution called Vagrant. This tool can be used to automate the setup of a development machine. You can specify the configuration of the machine, the software needed to be installed, etc and Vagrant will setup the machine and get it available as a VM with a single command. Vagrant Up. I think this kind of single command setup will help a lot if  a lot of AWS instances are required to be created. It will be easily to replicate the setup with one command. I am looking into this and still have to setup.

6: AWS Reference Architectures: Initially when I wanted to deploy an application to cloud, this reference architectures would have helped a lot.

7: The Importance of Finishing : A parable about a guy jumping on to new things without completing the old ones.

8: The End of Average: (Atleast in the Winner Takes All Market) : In media and things that require our attention, it is going to be the end of average as the reach of the best is practically everyone. So everyone will only refer to the best, so the average ones will not be needed.  .

Note: I want to introduce a tool to manage and organize everything. I use a free tool called trello for that. Trello is the fastest, easiest way to organize anything, from your day-to-day work, to a favorite side project, to your greatest life plans. You can give it a try here and I'm sure you will like it too.