Skip to content

Instantly share code, notes, and snippets.

View ajainarayanan's full-sized avatar
💭
💻 🕙 🦄

Ajai ajainarayanan

💭
💻 🕙 🦄
View GitHub Profile
const fetchMachine = Machine({
id: 'Program Control',
initial: 'STOPPED',
context: {
retries: 0,
},
states: {
LOADING: {
on: {
RUN: 'RUNNING',
@ajainarayanan
ajainarayanan / BLOG.md
Last active January 2, 2019 03:41
2017ish + 2018 Retrospective

Half of 2017 and the year of 2018 might be the most memorable years of my life (or at least so far). It has been a year where a LOT happened both on professional and personal side of our lives. A lot of ups and downs some I will revisit from the future to see how I handled things and some I will never want to.

Pre Sahasra

2017 ended with a depressing note for us after losing our daughter. There were some complication in the pregnancy and ultimately we lost our daughter at the end of 2017. It was a very grueling time where we had to wait patiently for things to turn out right but at the end heartbroken to see it happen otherwise. We were 21 weeks into the pregnancy when we lost her. We tried entering a phase of

@ajainarayanan
ajainarayanan / BLOG.md
Created February 26, 2018 06:09
A Wish!

originally wrote this on Nov11-2017

He was a simple cobbler sitting on the sides of the street, along with all the sewage and dust, living about his life as happily as he can, oblivious to his surroundings and the world. He firmly believed the more he knows the more he needs to worry about things around him. He believed Ignorance to be pure bliss and lived by it. It was till that day he started realizing he has a unique super power he has ever known. He would start to become the person as soon he wears their shoes.

For a blissful cobbler ignorant about his world, he started becoming a little adventurous. One day he would be a taxi driver, going to places he could only imagine, with no one batting an eye and the other day he would become a tourist gaining all the unworthy attention from everyone surrounding him. For a person sitting next to the road mending shoes, attention and travel soon satiated. He wanted to up his game.

@ajainarayanan
ajainarayanan / BLOG.md
Created October 6, 2017 08:33
Que Sera Sera

Nandhu was walking on the street, deserted, void of beggars, chai-walas and late-night drunken kids sleeping on their section of the street, close to his own mind, void of any life. Traces of life were removed from him when his boss came up to him and said those cold words - you are taking a sabbatical. Work defined most of nandhu, at least to him. His general thought process, unlike any bachelor in his prime youth, was about his work all the time. He wanted to be the greatest journalist ever from his country, trying to get into the minds of his readers and stay there for eternity. Nandhu was good at his words and knew to use his keyboard but was inept at politics. He was about to cover the most romantic times of politics going on in his state, merger of two opposing political parties apparently for the welfare of people. Nandhu knew what the merger was about and got his facts and numbers in place for spinning out his theory to give a perspective to his readers about the reality he is seeing. Nandhu's stroll

@ajainarayanan
ajainarayanan / BLOG.md
Last active February 26, 2018 06:14
Thud Thud Thud

Jim heard the loud bang on his door as they all huddled in their parent’s room on seeing the violent situation going on in the house behind them. Natalie, the beautiful, strode towards the door while Jim, the bold, stopped her from opening it.

She let out a shriek of anger. Donald interfered while Melissa was trying to pull Natalie out of that struggle. She was concerned for the physical wellness of her daughter considering Jim’s capricious behavior with her in the past. Natalie knew who it was at the door, for she has been watching the house in her backyard shrink to nothing when it started developing factions inside of it, workers in the house demanding basic rights, while owners or officially the masters of the house showing all signs of hostility towards such requests. She would often ask her father as to what is basic human rights for which she dearly got the answer: "its deserving things based on one’s luck dear". She would give a quizzical look to her father every time he says the word luck. Its a wor

@ajainarayanan
ajainarayanan / BLOG.md
Last active October 13, 2017 15:40
To Toss a Coin

originally posted on Jan 24, 2015

Chapter - 1 : The ironical tycoon

He watched the liquid gold flow below his feet in a hot refinery on a scorching day, more like in the middle of a day at his work. For a place and climate his attire was utterly irrelevant and made him alien among people standing next to him, his acolytes, assistants, sycophants, bootlickers and one honest soul. As he held the cash flow statement for the quarter he gave a wary look at the ceiling of his refinery as it left out a gust of smoke on the air. His oil corporation has been facing serious competition which is having a detrimental effect on the price of oil. As he walked through the plant with one ear on a phone he furrowed his eye brows as he ended his call. He could not ascertain whether Mr.Abdallah Salem el-Badri is really going to help him or is really digging his grave along with his oil corporation. The one honest soul sheds an ironical smile visualizing the repercussions of his boss' actions. A cyclone starts inside his

@ajainarayanan
ajainarayanan / BLOG.md
Last active October 17, 2017 04:56
Inheritance in Javascript

Originally posted on Sep 3, 2014

Today there was an interesting solution to the most basic problem in the javascript world.

The problem was to explain how inheritance works in javascript Javascript being pure object oriented language (In its true sense. Objects are first class citizens and there is no concept of 'classes'), the fundamental part of any class in javascript is two things.

  • prototype property.
@ajainarayanan
ajainarayanan / BLOG.md
Last active October 6, 2017 08:02
Characteristics Equations - Part 2

Originally posted on Jul 16, 2014

Its about the characteristics/recurrence (although these two equations are subtly different in mathematical basis they are interchangeable. I know I am contradicting myself with my previous journal but this is just a trivial message that we need to remember about recurrence equations) equations that we derived for the problem of quick sort and we wanted to reduce the equation such that its just a function of the input i.e., to eliminate the time function from the right side of the equation.

There are three ways in solving a recurrence equation.

@ajainarayanan
ajainarayanan / BLOG.md
Last active October 6, 2017 08:03
Double Entendre

Originally posted on Jul 15, 2014

CoverPhoto

It was a pleasant sunny day with flowers howling exhilarating slogans to every kid who pass them on early mornings with at most reluctance and angst owing to the rise of a self-luminescent huge ball of energy. It could be compared to a goat being taken to kitchen to be made into an eatable. Education has always been the route cause for almost every stress related disease that a kid could get. One of the funniest things is that after every stressful day, kids are allowed to vent out their emotions for the

@ajainarayanan
ajainarayanan / BLOG.md
Last active October 6, 2017 08:04
Recurrence Equation - An Intro

Originally posted on Jul 15, 2014

We had discussions about starting off with the topic of algorithms and discussing about mathematical background for the same.

We had planned in discussing about characteristic equation.

What is a characteristics equation?

Its the mathematical representation of a problem. Generally we may encounter (almost all the time) a problem that