Friday, November 17, 2017

Zero and one

I’m your zero
And you’re the one
Stand by me
Let’s be one
Cause when I stand
Right next to you
We both make
The perfect two

It could’ve been me

Four women,
And a girl barely ten,
Scavenged for the leftovers,
Behind the butcher’s shop,
While I paid for the choicest cuts;
With banknotes, crisp and new.

It could’ve been me,
On the other side.
And for them,
Just another hot summer’s day.
While I gathered my heaven
In a ragged jute sack.

I saw a mother,
And her little child,
Wait to gather the milk,
Spilled over in the crate,
While the milk van unloaded.
And I bought an ice-cream tub.

It could have been me,
On the other side.
Facing hell each day,
While they prayed,
To keep them safe,
Till Thy kingdom come.

Didn’t pick my birth,
Couldn’t twist my fate,
Predict my health,
Or dodge all baits,
What this life gives,
We take. We make.

Yeah, it could’ve been me,
And it could’ve been you.
The privileged few
Feeling entitled to
The cards that we’ve been dealt;
Acting as if we know our bets!

The Thorn and the Rose

The Thorn and the Rose. Two creative expressions of the same plant.

While one is literally poignant, the other is elegantly convoluted.

While the elegance of one is temporal, the poignant other seeks permanence.

Indeed, its the thorn which protects the plant while the flower attracts all harm.

Yet, the flower gives the plant its name while the thorn draws disdain.

The Rose, beautiful as she is, carries within her, seeds to new life, despite being destined to die, dry.

Not every Rose may spawn another! She still remains, just as beautiful, as any other.

The Thorn has his place too. Always in attention. Weapons drawn. Ready for action.

Always in attention. Weapons drawn. Ready for action.

Always in attention. Weapons drawn. Ready for action. Sounds boring? It is.

The Rose always takes the centre stage. She swings and sways to every breeze on her way.

Oft hypnotised, a hand reaches out… but gets a finger pricked instead!

Damn! The Thorn. Yes, every Rose has its Thorn :)

The Dirt and the Tree

They kept digging up the Dirt around the old Tree,

With hoes fashioned out of it’s branches three,

They mocked its muckiness and scoffed at it’s scruffiness,

But waxed eloquent on the opulent tree,

“Mere mud! So mean! How dare it lean? And that too on this grand old beam!”

Cussing and digging till way past six, they scarce realized they were trapped in their pit!

From the empty moat they’d unwittingly built, they sensed that the Tree had begun to tilt!

Then a wind blew, the dark clouds swelled and the once-mighty tree, with a loud thud fell.

In the moments of silence that dawned in the wake, of the virulent vitriol and unbridled hate,

Mounds of Dirt gathered round and wept, as they mourned the end of their grand old friend.

(image courtesy:

Mea Culpa!

Of course, the damn oxygen cylinders are to be blamed! #guilty #gorakhpurTragedy

Life trips!

My worst foe and my best friend,
In my head they’ve made their dens,
Will I lose my mind or find my zen?
Life doesn’t answer to my pen ☺,
I don’t know why and I won’t know then 😞.
A million stories await being lent,
To a thousand journeys- a life well spent!
A hundred miles sure has its bends,
But this I know since I was ten,
A trip never started, has no tale; no end!

Thursday, November 16, 2017

API + RESTful API. An introduction. Plain and simple


From Appliance Plumbing Interface…

Imagine that you have just designed a water faucet/ tap which dispenses water only if your fingerprint matches (however strange this may sound, I believe creativity should know no bounds ;). Now, for this to be actually used in a real wash-room or a kitchen sink, it needs to have a receptacle that exactly fits the common water pipe end-point. Lets say, it needs to have the female threaded end 1/2 inch diameter pipe to couple neatly into the male threaded pipe end. In other words, this new contraption of yours needs to follow the same plumbing interface definition as the pipes it needs to work with.

…To Application Programming Interface

Now, imagine if you were more of a software dude/ dudette than a pipe-hardware one. You might design a piece of software that will allow money from your bank to flow out only if your fingerprint matches (this sounds a lot more familiar, right? :). For this widgety creation of yours to be actually used in a real banking app or website, it needs to be able to be ‘integrated’ into the money flow interface definition of the bank(s). As a developer of this new functionality, you therefore need to follow what is called as the Application Programming Interface (API) definition exposed by the banking entity that you intend your software to work with. There you are! You have been hereby introduced to APIs. Simple right?

Why API?

The advantage of defining an API is this. Once defined, and published, it opens your platform up to a limitless set of different applications by independent innovators. So you might see some developer making an app that sends money from a bank account every time someone likes her profile pic on Facebook, or another who develops an app that makes a donation to a random NGO every time you use a swear-word on twitter…I hope you get the drift. There is no limit to the variety of innovation this can spawn. And all this while you enjoy a nice cold iced lemon tea reading some news-feed on your tab.
In short, APIs decouple application use cases, innovation, revenue generation and growth from your core platform. The better defined your APIs and the partner on-boarding processes are, the more you can relax and count the beans :)
API is also important because it helps make as much sense of the options available, to the humans implementing it as it does to the machines consuming or exposing it. This is an act of fine balance.

An API once said, “I need some REST”

Lets now focus on something a bit more technical. RESTful APIs. For a start, Restful does not refer to the relaxation that I’d mentioned a short while ago. The REST in RESTful refers to REpresentational State Transfers.

From verbs…

A lot of us have come from the functional programming world. In simple terms, the interfaces defined there would correspond to the verbs that were being exposed. For instance, in a banking app, you could have an interface defined as getBalance(account) which would return the account balance for a given account. Or, sendMoney(account1, account2). Or, listAccounts(customer). These functions could also be exposed as APIs and they do something based on its input parameters. The response of the API call would be the action defined as the verb and output parameters that would provide more details on the action done.
This kind of API has one inherent problem. An API description could be really arbitrary and it would be difficult to imagine all the functionality exposed without having explicit access to the API creator’s documentation.

…To nouns

RESTful APIs are a different breed altogether. They focus a lot more on the resources or nouns, instead of verbs. For example, ‘customer’ could be a resource, ‘account’ could be another and so on. As for the actual action that you would want to take with a resource, REST simplifies it all down to a set of pre-defined verbs in the WWW HTTP definition.
When you visit, for example; the browser actually executes a GET request for the index page based on the URL (Uniform Resource Locator)
The idea (RESTful lends its origin to the doctoral thesis of a genius named Roy Fielding) is that, given these constant verbs; All that a developer needs to know is the set of objects/ nouns that he might have to deal with.
For instance, assume a simplified banking application. It may have a resource called customer or transaction or account. So, in the simplest sense, assume the base URL is https://myxyzbank. Now the base URL is like the rootdirectory for all resources (nouns). So, accessing a customer within the bank would likely be baseURL/customer.
There are a few more properties of RESTful APIs. I would only want to touch upon the fact that these API calls are also stateless. That is, a RESTful API call is in itself complete and independent of previous or future calls. In other words, the API calling entity’s state is not preserved on the server in between calls.

Singular and plural

Also noteworthy is the singular and plural use of these nouns.
While /customer/id refers to a particular customer with a given ‘id’ as its identity;
/customers/ refers to all the customers collectively.
So, executing an HTTP GET request on https://myxyzbank/customers should likely return a list of all customers within the bank, executing GET request on https://myxyzbank/customer/id would return a particular customer only. So, simple plain English “get a list of all customers in this bank” translates to an API, GET on https://myxyzbank/customers/ and the bank should spew out its long list (Of course it ain’t that simple. Security, roles, access and privileges have been excluded from the scope of this article).
Now back to the 4 main primitives and why they are pretty much sufficient for most applications.

Get, Post, Put and Delete is all you need

GET- as the name suggests would simply fetch the resource(s) identified
POST- use it when you intend to create a new resource(s) on the server
PUT- updates an existing resource on the server
DELETE- deletes the identified resource(s)
This sounds a lot like CRUD framework (Create, Read, Update, Delete) used for data storage.


Additional parameters could also be passed to and from the server along with each resource request. This data could be in different formats, the most popular and elegant one around is called JSON (Java Script Object Notation). Another excessively verbose and elaborate protocol from our good ‘ol days is XML (Extensible Markup Language).

Beauty and the beast

There is a certain sense of beauty, logic, crispness and cleanness in the structure of truly RESTful API. The sad part is that most implement it with varying degrees of RESTful-ness. To the extent that I have even seen a bank call GET /getCustomerBalance as a RESTful API! That’s a verb on verb action and totally looses the plot.

My attempt was to only provide a plain and simple outline to API and RESTful API. There is a lot more in it and the world wide web should be your best guide.
May the POST be with you!
And May is hot!
Further reading:

Restful Web APIs

My Song

Past slow streams and paddy plains,
A gentle breeze, the drizzling rain;
A blue-bird tries catch-up in vain,
To a soulful beat, my rocking train
Back ten years, my numb mind panes;
Glimpses, memories retained:
Had no money, had no pains,
No plans beyond the morrow made;
When music was the sole refrain,
And dreams my waiting soul had gained,
To love, I was not yet ordained,
Just longings that were best contained,
The sleepy city, a narrow lane,
My good 'ol car, a bunch of friends,
Driving with the rolled down panes,
Humming a tune the radio made,
In the back seat, the guitar he played,
My fingers drummed on the wheel splayed,
On a high note, our voices strained…
I still hear the tune play in my head!
A thousand miles about to end,
Round the last corner, the rail-road bends,
Draws up to the station, almost spent,
In my notebook, these words I pen:
If ask I could, something of life,
That’d be to make music in the sunshine,
'Cause when night falls and slumber stays,
I hope, somewhere, my song still plays.
(originally penned in 2015. Image: a pic I’d taken at railway station, Chengannur, Kerala)


Earth’s warmer,
People colder.
Compassion rarer,
Crimes bolder.
Love’s in a corner,
Hate running over.
Smiles fewer,
Smileys taking over.
Staying closer,
Living farther.
Bodies warmer,
Hearts colder.
Mind's younger,
Flesh older.
Change maker/
Mute observer?
Start all over/
Sweet surrender?

Chasing mirages

Waiting for the night to wake up to a dawn,For the morning mist to make dew with the lawn,To glimpse the chirping thrush, strut on the ground,As the curious squirrels, scurry around.
Simple pleasures that now are rare, less found;
Lost among chores that seem far more profound,
And honourable jobs that buy our good days,
With promises to pay big soon; Someday.
Out to change the world, make a dent, we say,
Held firm by the charms of the silicon sway,
Eyes mesmerised by our shiny screens,
Mind skips to savour the flavours in our meals.
They say, birds in the sky neither sow nor they reap,
The flowers in the garden, need no chiffon and no crepe,
Yet, they live, fly free, are more beautiful than we,
In the best of our garbs ever can be.
Midnight. It’s time again to fall asleep,
The charm of the dream still strong bitter sweet,
There are bills to pay and promises to keep,
But you hear a soul somewhere silently weep.
Then slumber arrives and the body rests,
While the universe conjures our next day’s tests,
And again we’d miss a beautiful morn,
Chasing mirages ever since we were born.

7 Post-it notes for entrepreneurs

Free, unadulterated, unsolicited, self-explanatory compilation of advises from the side-lines.
Yes, we’ve all known these all along, but still… :)
Why 7? Because 42 ;)

“Scale is over-rated, profitability is under-rated”

“Survive long enough and you will arrive soon enough”

“Your enterprise will most likey die due to the same mistakes that others did”
a.k.a. If you see a banana peel, just don’t step on it

“Get the smallest, able, agile and committed team and aim for the largest, achievable and sell-able goal”

“Net-satisfaction, net-happiness, net-worth, all are important”

“Work smart not hard/ get a life. Help others. Be kind. Stay humble”
There was a reason why mama taught these virtues :)

“You can do it :)”