The Facebook parents

India is in a growth phase like how the US economy was in the 80s. The US parents during the boom were called baby boomers. 
The Indian parents who are in their 35s to 45s of today are the equivalent of the baby boomer generation. Thankfully the school admission process is so competitive – it has scared them into not making a boom of the baby kind. 
Let me coin these parents the “Facebook parents” as they are all chained to their smartphones and Facebook. Of late whatsapp has become quite popular but whatsapp is owned by Facebook – so this term can still stand a scrutiny by future historians. 
They are economically successful and better off than their parent’s generation. Most would have started their career drawing a salary their parents would have retired at. 
Would have visited a few countries for work or for pleasure. Would have a car or two or an unnecessarily powerful bike which they use for grocery errands. Would have a heavy EMI too. 
Like any good biologist – let me classify these species into a few categories. 
The Chinese moms.
I read a post in huffington post years ago on how Chinese moms bring up their kids. The article starts pretty negative showing the Chinese moms in poor light how they push their kids into hours of practice. However the article concluded with a positive spin showing how the kids shine later -without some hitlering these lazy kids would have never picked up the difficult fine arts. 
Armed with this article for justification these Chinese moms ( and dads ) can be found on weekends dragging their kids from one class or tournament to another – bribing their kids with chips or ice cream or a visit to the gaming arcade in a nearby mall.
They turn up in annual sports day events with their DSLRs to capture the finish in highdef video and get into arguments with the poor fatigued over worked and underpaid school sports teachers why their kid should have had a podium finish. 
The spiritual parents

Having hit a ceiling at their career, life becomes monotonous. No more challenges. More meetings at work. The upward climb is blocked with too many VPs. 

They start following spiritual accounts in facebook and you can see them sharing deep quotes on Buddha or Osho or Sri Sri or Sadhguru. 

You can find them taking off days together to go on spiritual retreats and  sit in silence. They come back all divine and do not get into fights at work – for a few days. 

They do not get angry with their kids or push them too hard and believe their karma will run ( or ruin ) them and let fate run its course. They do however show the path and enrol them in various classes but if the kid throws tantrums and starts feigning fever and stomach ache to avoid classes, the spiritual parents pull them out and believe the class will find them at the right time. 
The Bruce lee parents
These parents use the same technique their parents had applied – which is no technique. 
Bruce lee when asked what his technique was he said he had no technique and that was his technique. 
In the previous generation, either because of economic reasons or lack of will or too many kids to handle – they let these grow up by themselves. Never enrolled them in any extra curriculars or used the enrollment forms for removing the extra foam while shaving. And their kids – the current Facebook generation parents – turned out to be alright as they were self made and believe it will all work out in the end. They apply the same technique to their kids too. 
These Bruce lee parent’s kids can now be found chilling in the apartment parking lot playing their self made games or practicing dance moves by themselves and generally having a good time. 
So what kind of parent are you?

Agile and Spiritualism

Ahemm..first my apologies for tying a camel’s tail to a pony’s tail – this post is akin to that. Totally 2 unrelated disciplines being compared 🙂

Agile – as you know is what we use to create kickass products.

Spiritualism is to me the exploration of the Why? – Why are we happy, or sad. Why did we come on earth, why we die?

I practise Agile at work, and explore Spiritualism constantly in all things.

During one of my meditations it hit me – A developer practising Agile, and what Spirituality teaches us are so common.

The Now

Our mind is like a pendulum. It either swings to the past – oh I did this, said this, he spoke rudely to me that day, I missed giving a good repartee .. or swings to the future – oh what will happen if I don’t file my tax returns, what if I confront my colleague tomorrow.. it goes on and on – swinging back and forth. And when the pendulum hits the Now – it is where happiness is – pure unblemished joy. It stays for a fleeting second.. and then goes on to dwell in the past or future – leaving the joy as a memory.

We try to get to the now.. and hang on to it – and it is a lifetime’s effort to get there – and then you get enlightened… perhaps.

When I first heard of a “Story” – in the Agile context – I was told to focus on that story alone while developing. Not to worry about the future stories in the pipeline, or the changes in requirement that might or might not come, or what the nearby developer pair is working upon. Focus on just your story, and do a great job on it. Everything will turn out to be just right.

As a developer, as you focus on just the story ( with a little cross-eye on an open ended design ) the outcome will be 100% Bug free and your story will sail to QA complete effortlessly.. and then you hit God Mode in your team.

The Now is your Story.

Death & Failure

As you get more spiritual you get more comfortable with Death – the big end. Because you know it is not the end, but the beginning of another adventure. You will be tossing out all that you earned, and will have to start all over again. However some of the intelligence you acquired – will come to help in the next adventure. Dejavu, Gut instinct, Karma are all that.

There is a parallel in Agile as well. It taught me to scrap everything I had worked, and start from scratch if there is a need – Agile is comfortable with change and does not crib ( unlike giving a big Change Requirement Document and a bill ) My backyard has many dead bodies – some unfinished abandoned projects and some code, some perfectly working stuff.. but had to be archived and might never get opened again. However, someday it will all come to use. Even if the Story I worked on never gets to production or the project fails to see the light of the day – the learnings are enormous.

Most of the good discipline I picked are from failures – either from my own handiwork, or watching other developers mess up.

Celebrate Death & Failure!

Discipline

One can read as much as you want on Spiritual books, or listen to all the lectures from Spiritual Gurus – but the real joy is in practising it – in a disciplined manner.  Only when you sit down to meditate do you experience bliss. For best results – lot many things have to be followed – like food habits, health routine, sincerity of actions, purity in thought.. Break any one of them – you get nothing in the end.

Again for an Agile project to be successful – just reading books and viewing lectures from Agile Thinkers is not sufficient – the team has to be disciplined at every step. Standups, near abstract stories, continuous builds, unit tests, automated tests, periodic showcases…. break any one of them and the project is doomed.

God speed my Agile Developer friends!

Yours Truly
The Agile Guru 🙂

Fun with Raspberry Pi

This post is a 101 Introduction to Raspberry Pi.  I will show you how to use a Raspberry Pi to create an Apple TV, Chromecast equivalent, and also read and push your home temperature to a server.

It is the best time to be a geek! There is 3G everywhere and 8MB Bandwidth at home and office. Geeks everywhere carry a super computer in their pocket now!

TBs of storage are now available for a dime. Everything is backed up realtime to the cloud. Even if you lose your device or hard drive crashes, it can all be downloaded back. Maps and GPS Accuracy is spot on. The stuff geeks have now makes James Bond look like a kid showing off in a School Science project.

And we need not deal with Windows or IE anymore. It is either Android or iOS or Ubuntu or OS X.

And then comes this Raspberry Pi to the party – from the open source hardware movement – a cute little computer – the size of a palm – which costs just Rs. 2,500 and can do a hell lot of things.

How to procure a Raspberry Pi

I got mine from Amazon.in – protocentral was the vendor. Just the raspberry pi ( motherboard, 4 USB, HDMI port, ethernet port ) will be 2,500. I also got a kit which had a SD card with the OSes, USB dongle, a breadboard, a few resistors, a capacitor and a power supply (which blew off). Also ordered a DHT11 a temperature and humidity sensor – it is 99Rs. It all came to Rs.5000.

Raspberry Pi or Arduino?

Just like the yin-yangs of vi emacs, android iOS, raspberry pi also has a yang – it is this Arduino. While Raspberry Pi is from UK, Arduino is from Italy. From what I learnt Raspberry Pi is good for beginners – understands Python and is more general purpose and can only talk digital. Arduino needs C ( segmentation fault – thought I had broken up with you) and is more rugged and can talk analog.

Some say start your prototype on Pi, then manufacture on arduino. Might know more about this as I keep digging.

Setting up Pi

Apart from Pi you will need these things

1. A TV with HDMI input
2. A keyboard
3. Mouse
4. 8GB or more SD Cards
5. Ethernet cable, and a router ( alternative is to share wifi on laptop over ethernet port )
6. A laptop/desktop – to format SD Card

Raspbmc 

If you have a spare SD Card, format it to Fat. Then download Noobs Lite – Network Install Only – http://www.raspberrypi.org/downloads/, unzip and copy the entire folder contents into the root of the SD Card.

Boot the Pi with the SD Card, and it will show an option with a few OSes.  Choose Raspbmc – this is
the XBMC port and turns your Tv into a Smart Tv.

Here you will have to connect your Pi to the router through the ethernet port – so it can download the OS ( around 700MB ). The setup is entirely automatic and does not ask for any configuration. The default user account is pi and password is raspberry.

There are so many Add-ons and settings that are available – like a Youtube Add-on, or a subtitles Add-on for Movies. There is also a free XBMC Remote app on iOS and Android  with which you can connect to the Pi to control TV.

Raspbian

This is a regular light weight debian port. Works quite well in the puny pi. You can get another SD Card and install Raspbian ( same steps as raspbmc above ) – so you can swap the 2 sdcards.   There is also a multi boot option so you can boot into Raspbmc or Raspbian or more. I did not try this.

Say Hi to GPIO

GPIO – General Purpose Input Output. This is where things get interesting. There are 8 pins which can either send a 5V voltage, or receive a signal.

I wired the DHT 11 – Temperature and Humidity sensor to the Pi and was able to read the settings. Was quite easy.

1. The circuit layout I got here : https://chrisbaume.wordpress.com/2013/02/10/beer-monitoring/. Looks scary – but it is actually a very simple circuit. My skills are not that great, just followed the circuit to the T and it worked at the first try.

2. Get the Adafruit drivers and see if you can read the sensor.

git clone git://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git .

cd Adafruit_DHT_Driver #go to the folder where DHT driver is present

Adafruit_DHT 11 14 #11 is for DHT11 sensor, 14 is the Pin I used

If you get temp and hum in output with numbers, then the circuit is working fine. Sometimes it will not give any reading, and a hex error will show up.

3. Next is to push this to a server. Again it is super easy.

First – create an account at thingspeak.com and get a key.

I created a shell script which will call this python script with the temperature as argument. Then this script will post the readings to thingspeak.

Shell Script :
#!/bin/sh
SCRIPT=”/home/pi/playground/Adafruit_DHT_Driver/Adafruit_DHT 11 14″
TEMPERATURE=`$SCRIPT | grep “Temp” | awk -F ” ” ‘{print $3}’`
echo “$TEMPERATURE”
HITTHING=”/home/pi/playground/mycode/kandivali_temp $TEMPERATURE  “
THINGSPEAK=`$HITTHING`

Python Script :

#! /usr/bin/python
import datetime
import logging
import time
import httplib, urllib
import sys

# The feed id and API key that is needed
thingSpeakKey = “getyourownkey”
tempvar=”nil” 
for arg in sys.argv:
 tempvar = arg
if (tempvar != ‘/home/pi/playground/mycode/kandivali_temp’):
 print “Updating ThingSpeak “, time.strftime(“%A, %B %d at %H:%M:%S”) 

 params = urllib.urlencode({‘field1’: tempvar, ‘key’:thingSpeakKey})
 headers = {“Content-type”: “application/x-www-form-urlencoded”, “Accept”: “text/plain”}
 conn = httplib.HTTPConnection(“api.thingspeak.com:80”)
 conn.request(“POST”, “/update”, params, headers)
 response = conn.getresponse()
 print “Thingspeak Response:”, response.status, response.reason

 if (response.reason != ‘OK’):
  print “Problem, “, response.status, response.reason

Here are a few readings I got – https://thingspeak.com/channels/25022

Next step would be to merge the shell script with Python ( still learning ), and run this as a cron job every 3 minutes or so.

The above concept is “Hello World” equivalent of Internet of Things. I can connect to any sensor, and   when things go bad – ( lets say the temperature starts spiking ), can send a notification on a phone to someone. The possibilities are infinite.

Some Gotchas

* Pi is configured to UK Locale by default. When you hit Shift 2 ( to get the @ symbol ) you will get a Pound symbol – and so on. It is annoying. Just go to /etc/default/keyboard and set it to US and reboot.

* I connected an external Hard drive, and Pi was not detecting it. The external hard drive needed a power source before Pi could detect it.

* Pi can be connected to a USB port of the laptop. Need not  hunt for a free power slot. Figured this out after the usb power plug blew up.

* Looking at TV and typing tires the eyes. Instead set a Static DHCP IP and then ssh to pi using Putty if you are on windows  ( ssh pi@192.168.1.111, password raspberry ) and can use your laptop’s keyboard.

Happy Baking!

The Man Purse

Way back in 2000, I first heard about man purse in a Seinfeld episode and had a good laugh. Little more than a decade later,  I find myself using one. Here is me defending in the court on why I use a man purse.

Your Honour, Men needed just a few essentials those days. A purse/wallet + keys, a mobile phone + a hand kerchief and a comb on the back pocket. Real men don’t need to carry a pocket note book. They write stuff and lose it behind credit card acknowledgements.

If you were a metrosexual male then you will need a deo, a face wash, a mouth freshner, a hair gel, a hair spray, a hand sanitizer, a hand moisturiser, a sunscreen etc. – you would have dragged all these in a suitcase – and guys like you would have been husbanded soon and you will still be dragging that suitcase but with the kids diaper or the missus’s stuff. I am digressing. Back to the defence.

Some men carry a book to impress women but then it is best carried in hand – otherwise what is the point.

Then iPods came. And we could still squeeze it in along with the cell phone. And on vacation men will typically wear those cargo pants with pockets near the kneecap and can carry a point and shoot, extra 8MB memory cards and even spare batteries. Not a problem. 
Then Steve jobs re-invented the phone and for a brief time I thought – wow – now I can carry my phone, iPod, book, music, camera – all in one. Back to good old 2 pocket days. 
I was so wrong. 
With more power, comes poor battery life. While on the road, heavy GPS Usage, or even reading and responding to emails on the move would drain battery and the phone will not last even half a day. 
So had to carry a battery backup, charger, and the cable. 
Then I started using the iPad and fell in love with it. It is so convenient to respond to emails, read a book, or a magazine or play those gorgeous games.. and I could not fold it and put it inside my pocket. 
Then I saw how women were enjoying a blissful life carrying all the paraphernalia in their hand bags.   Same time I spotted hipsters carrying those smart man purses and got tempted. Perhaps I should get one too. 
After I moved to Mumbai I felt liberated. No one gave a hoot to what you were doing. All are so engrossed in inventing an excuse for arriving late for a meeting – they do not have time to glance at you and pass a judgement. 
I kept looking – most looked like a laptop bag, or the sales man tried to sell a woman’s handbag..  and finally found the one made for me in a Hi Design Store.

Now it carries a lot many things – my bike papers, keys, smart cards, reserve cash, battery backup, battery backup’s backup, iPad, headphones, balaclava, cables, mouth fresher, deo… and so many that I am almost in the territory of a metrosexual man.

It gives a sense of peace – which is hard to describe. Your honour you have to experience this bliss. When you know your phone and iPad are fully charged and you can wait forever in a mall while the missus shops, or when waiting to pick up someone from the airport – you can listen to music without worry of draining the battery, or read a book, or write a blog post – like this one.

The defence rests its case. Hope the court will forgive me for laughing at the Man purse back in 2000.

And to my Man friends, get a Man Purse – why should women have all the fun!