Friday, December 13, 2013


Poorly written programs are one of the greatest bothers. I myself wrote one such program apparently with a query which ran good the first time, but stubbornly refused to budge the second time. Now I am sure there would have been a mistake on my part, something which I overlooked, but what followed this has been well a nightmare (literally) as I spent a whole 6 hours trying to figure out a solution.

So, like any other programmer, I looked up google. Randomly, I had an idea to dump all my result set into a CSV, and then upload the CSV to MySql. Not as easy as it sounds. My table had 30000 entries, should have taken anything from 10 to 30 minutes to upload it through the in-built MySql utility.

But lady luck it seems eludes me in constant perpetuity.

The utility made my MySql Workbench crash after running for 30 minutes. Twice.

So, I began to look for more ways to upload/convert csv data to MySql. Now, what I found next was smart and nice, but essentially crude.

For instance, there are 8 different columns in my table. I opened the CSV file in MS-Excel, and wrote a formula to combine the data from the 8 cells into a well formatted SQL insert statement.

And, voila! I now have 30000 insert statements running in batches of 100. I believe it will take around 30 minutes to execute, but my MySql Workbench isn't crashing, and more importantly I am getting some work done.

I hear there's some research going on self-correcting programs, or where you specify just the algorithm and the IDE generates a program for you, but I fear that it will put programmers like me out of jobs, and there will be a state of anarchy, as that will also be the day, when the machines rise against the humans. Though I am quite curious, as to whether it will end up like The Matrix or the Terminator!

 

 

Thursday, September 5, 2013


Science is one tough lady for a person to love. She is not only difficult, but treacherous- She will leave you when you need her the most. However, for most part, She is fun to be with. Eager to lead you on an adventure if and when you discover her. The affair for itself is oddly amusing- open for the world to know, and extremely secretive where only You and your Lady know the intricate details. More people have died loving her, than lovers in a conventional romantic relationship. They have fixated and spent maybe an entirety of a lifetime exploring just a single part of her. So much so for foreplay.

While at times frustratingly quiet, for it speaks without words. The universality of it transcends our life in perhaps every possible way.

Einstein once said that that the biggest mystery and perhaps the funniest thing about that mystery is that we are trying to figure out something of what we ourselves are a part of. It’s quite a simple an observation. Delving into the depths of it, it is maybe the most beautiful thing I have ever come across. Literally.

I am not a morning person, unless I have some business or lectures to attend to in the morning. I find mornings very unproductive. Everyone is busy with their lives. Going to jobs they do not love, working for people they do not like, speaking what they do not believe in, talking what is certainly not what they are thinking of.

Nights on the other hand, are quiet. Calm. Serene. Listening to violin, cello, piano or any piece of classical music, away from home, alone, taking in the cool wind is oddly overwhelming.

It has been about three months since I last updated. I scribbled- typed basically a lot of random notes and stuff. None of it makes sense. Why does it have to? Why does it always have to make sense? Why can’t we embrace the chaos? Maybe the biggest problem is that we try to make sense of chaos. That is the problem.

The problem is not chaos, but the way we look at it. In mathematics, either it’s a linear system or a non-linear system. Why the binary? Why not accept something for what it is rather than for what we are trying to project it as?

What is life’s greatest mystery that we are yet to uncover?

I was watching Person of Interest, a TV series that I never heard of and a friend suggested it quite recently. A character Mr Finch says, “I am hiding in plain sight Mr Reese, I am there for all to see, only nobody notices me”.

What secrets of the Universe lay hidden in plain sight? What is most apparent, yet no one has uncovered it? Is it still there, or has it been lost over centuries of squabbling over the trivial, or our own selfish need have made us so blind to what has been the obvious?

Run away. Ran far. Run till you can breathe no more, feel your legs will fall off. Run till there’s a searing pain in your stomach. Run till you can think of nothing else. Your mind is blank. That.
Just that.

Thursday, June 20, 2013

A Visit to the Doctor!


People often recall their first dentist appointments of their childhood with quite a fondness. So do I. It was quite a harrying experience, well not for me but for the attending dentist and his staff, and his patients and my mother. I write it so because it so happened this way.

And so I recall my story.

One fine sunny morning, I wake up and was brushing my teeth, as all good kids and adults do every day. And I notice that my incisors which had still not fallen, the permanent ones were beginning to grow over the old ones. I found it quite funny as now I would have a double set of incisors, an anomaly which at the moment was quite hilarious to me.

Laughing all the way, I tell my Dad about it. And his expressions I imagine because I can’t remember must have changed from curious to serious. As it still does every time he examines me. Doctors have this funny habit. But yeah, so cometh my mother next and she too had her time putting me under her scanner.

It was decided that the very same day, we would go over to the dentist and get the deed done. Now my milky incisors didn’t have any intention to come out just because they were of inconvenience and they had to be pulled out. My mother to some extent and my dear sister in every possible way tried to tell me that it was going to be painful. I somehow managed to not listen to everything that was being said, and I was quite forward looking to what the dentist really looked like. As such till that time I had never visited any other doctor. For all the world, doctor still equals “my dad”.

The clinic had a weird smell, I didn’t like it. But there were quite an awful lot of magazines lying on the table in the waiting area- Reader’s Digest, India Today, M. Oh yes! I still remember, I think at that age it was all about looking up the illustrations but it still felt good. The names were quite familiar, especially Reader’s Digest. I had quite a time for the next 20 minutes sifting through them. My mother I believe was nervously looking at my prelude to such a visit.

Our turn came. The doctor greeted us both warmly; it’s again quite amusing how every doctor knows every other doctor in the area. Engineers for instance have a penchant for living in an ignorant bliss. So I sat down in his large comfy chair. And he peered down my mouth with his weird looking strap-on his head. I still don’t know what they call that. But it was interesting all the same.

Now this is where from where onwards, things start going down the road where in I didn’t feel comfortable. The doctor took my mother aside and planned some conspiracy. He called his assistant, well one was already there. And prepared a syringe which was really bigger than any other I had seen. Even at that age I was familiar having quite used to being around them, that is when I was not at the receiving end.
So now the dentist wants me to open my mouth again and I see from the corner of my eyes the syringe coming closer. Bang! The mouth shuts like trap. I had had enough of the amusement and wanted out. I knew that syringes hurt. They used to hurt a lot when it was my backside and the mouth wasn’t going to “not hurt at all” as the doctor promised. I had seen enough. Now I don’t exactly remember how he prised my mouth open but my mother still recalls that it took his 3 assistants, the doctor himself and my mother included to hold me long enough for the doctor to give me a local anaesthesia and pull out my teeth at the same time. And imagine if you can, I created such a ruckus that some of the patients who were in the waiting area were actually kind of curious to the events unfolding inside as one or two of them were trying to look through the semi-transparent glass wall that separated the two cabins! My mother still recalls how the doctor had broken into a terrible sweat!

Now having the deed done and my mouth feeling numb, I was quite not myself as the anaesthesia and the screaming had me feeling tired and sleepy. My mother promised me ice cream, and that is the last I remember of that visit.

Years later, when I visit the same dentist again for getting a cavity filled. The first thing that he asks me is whether I would be screaming again!

Tuesday, June 11, 2013

Windows never ceases to Amaze!


These past few days I have been working towards my scholarly paper which hopefully will culminate into a thesis. The problem at hand requires me to implement a system. I will not talk anything about the system itself, but rather the programming part. Programming furiously, I had designed a system ground up after reading a paper on the same. It was a tough task, more so on the GNU C++ compiler, which is rather strict in adherence to some technical specifications- more specifically the ways I could call an object constructor and initialise the object.

It was a little irritating at first, but I like programming and it only required a minor change in my style. Plus I really had no other option than to oblige. Majbuuri ka naam Mahatma Gandhi.

While compiling the program, though it seldom happens with me, but this time it happened big. The dreaded word “Segmentation Fault” appeared on the gnome-terminal. Now, since I was using an older version of Linux the debugger plugins simply won’t install. Attaching the gdb manually is a little too mundane for me, plus the extra code I would have to write would only have bloated the program and given more headaches. What to do?

At time like this when faith in Linux is shaken, I always look towards Saint Bill Gates. Windows to the rescue!

Now the funny part happens, I fired up Orwell Dev C++, and put all the critical variables in the watch stack. But every time I compiled and ran my program, somehow the IDE would crash every time, without any sufficient explanation.  There had to be one. I double checked by writing a dummy “Hello World” program, the compiler install was intact. There had to be another reason.

And then one of those Eureka moment happened, when realisation dawns upon you.

Windows have a feature of DEP (Dynamic Execution Prevention), which when translated into English means, whenever a program tries to access memory locations other than its own, the Windows OS shuts down the program as a potential malware which could cause harm. Due to Segmentation Fault, my program was accessing memory locations which were out of bounds, hence the sudden IDE crash.

Sometimes I forget how amazing Windows OS is. But moments like these remind me why it’s still the most popular. Speaking of Windows, I recently and finally acquired Windows Phone 8. A proper review of my phone Lumia 720 shall soon follow. But in one word it is simply beautiful.

Tuesday, April 30, 2013

How does Modern Healthcare touch lives?


Healthcare in today’s time has become a fundamental right in most countries. Most governments are increasing their allocation of the budget in providing it to the society. Coming from a family where being a doctor is a tradition, I am the black sheep who is “the engineer”! My father often tells me about the times when there weren’t so many diagnostics lab available as there are today, and testing for symptoms and diagnosing them was a challenge. All this has changed now.

I remember the time I first heard about Apollo Hospitals. It was almost 15 years back. My late grandfather had then suffered a coronary stroke. It was a difficult day for all of us. I for one only knew that Baba was ill and it was something to do with his heart. My father, who’s a doctor, had a decision to make, as to where Baba was to be hospitalised. A decision that he didn’t take long to make- Apollo Hospital was (and still is) the best when it comes to private medical healthcare. They were one of the first hospitals in India to offer coronary bypass surgery.

And there we went. I was obviously left at home. But when I asked, my Dad tried his best to explain the situation as to what Baba had and how the surgery would be done. It was complicated. I can still only imagine the complexity and the risks associated with such a procedure.

A cardiac arrest is caused by cholesterol deposition on the walls of the arteries. Due to this deposition there’s congestion and reduced blood flow, which causes the heart to go into overdrive to maintain proper circulation. The bypass surgery consists of grafting of veins or arteries from other parts of the body, usually the legs and bypassing the congestion, thus improving circulation.

I still remember seeing Baba’s stiches when he came home, they were scary.

Today, yet again Apollo is a pioneer with the introduction of Minimally Invasive Coronary Artery Surgery. A fast and elegant approach, where only a 4 cm incision is made. There is no cutting of bones and only some muscle damage is done. Recuperation time is not only faster, but with better results than the traditional surgery. You can read more about it here.

I remember watching those old movies, how every time, whenever something serious happened to the actor or someone usually the mother/father of the actor, how they would show that they went to US for surgery because help wasn’t available locally. No more. And I believe it’s no longer shown because as it’s no longer relevant to the Indian sub-context. India now boasts of one of the best medical healthcare facilities and practices. All this is possible with continued efforts of Apollo Hospitals. They were here first, the rest simply followed.

Coming back to the title, “How does Modern Healthcare touch lives?” – Because it matters. It certainly made a difference to mine, after all it brought my Baba back home healthy.

I normally refrain from writing blog entries for contests and promotions, but this time it was personal. This entry is a part of IndiBlogger- Apollo Hospital initiative.

You can read more about Apollo Hospitals here: http://www.apollohospitals.com/cutting-edge.php

 

 

Thursday, April 4, 2013


So early morning today surfing through the tech updates, I came across two interesting things:

  • The share of the Windows phone in the market has grown by 52% with the introduction of Windows Phone 8.
  • There seems to be a growing consensus amongst people who matter and influence the industry that Nokia should consider introducing Android phones.

For the former, I would say that this success is not for Windows phone themselves, but can also be attributed to Nokia, as being privileged partners of Microsoft they have built and designed phones which are beautiful really in every detail. Other manufacturers, mainly HTC and Samsung haven’t made much progress, Samsung in particular. Samsung is in fact trying to stall Windows 8, for its own sale largely depends on the success of Android. Consider the factors, two years ago nobody even knew about Android, and Samsung’s own BADA OS had foreseeably crashed which coincided with its launch. Most people at that point considered Samsung phones in the same line today as to what the masses count the Chinese Alternative. But with Android, Samsung emerged victorious, for the first time their sloppy engineering team could concentrate only on the UI and some minor kernel tweaking, instead of building a flawed OS ground up.

Secondly, and more importantly, what is even more fascinating is the Samsung’s product cycle which also functions as a marketing strategy.
  • Build a product.
  • Package it with either the latest, or one generation older Android OS and make it upgradeable to the latest. (Can’t actually blame them for the latter as by the time these phones hit the market they sometimes lag behind because Google got ahead of them)
  • Now to stop code fragmentation as mandated and regulated by Google, mind you this exercise is not voluntary; Samsung has to deliver upgrades for 18 months. Often these updates are slow in coming, and by the time these updates come in; the update is in itself obsolete. And Google is still getting further and further in the race.
  • Announce a new product with almost the same specification, and the cycle repeats.

The inherent flaw in this cycle, is that by announcing new designs by the end of every month from pocket standard issues to the giant slates which are supposed to be portable phones but I really wonder how will they will ever fit into my pockets, the market is flooded by so many phones, that a user feels he has the power of choice. But what an average user fails to realise is that there is no standardisation of hardware designs and with it the cost margins. Talking to a friend recently who was searching for a phone, the most difficult task was narrowing down the choices, because they all looked the same. The reviews are no help either. For the uninitiated, they can be the worst nightmare. As the experience of the Android OS is different with every manufacturer and depends on the kind of hardware it is packed with. This in turn has flooded the market with locally manufactured units, which in majority are substandard and lacking even in the minimum hardware, and there aren’t any hard specifications for the hardware. The cheap phones are laggy and sometimes buggy to the point where the camera doesn’t work, the screen is unresponsive etc. And when it comes to Samsung, the occasional trickle of updates stop because by the time the support team got together to deliver the updates for every handset, the 18 months were up.

Consider the case of Windows Phone. Microsoft laid down hard specifications with regards to minimum hardware. This not only ensures that the Windows experience stays constant irrespective of the manufacturer and that updates are compatible throughout but in turn also solves the problem of code fragmentation. Problem solved. A seemingly huge problem which should never have existed in the first place has been solved just like that.

I have rambled on and on. My point being, that instead of building more phones and distributing resources to small teams, maybe manufacturers should start concentrating their resources and make phones for a price band- High end exciting, high end partially exciting, high-mid end, mid end, and low end. This strategy seems to be working in the case of Nokia Lumia (920, 820, 720, 620, 520), now if you re-read the previous sentence again, and it makes more sense. The result of this strategy would be that existing phones would be supported for a longer time, vastly reduce the cost of designing and producing new phones & setting up exclusive support teams for discrete models. However following this strategy is very hard for Android manufacturers as it will lead to admission of liability, when clearly their market relies on the hype of a model refresh every 6 months.

For those who crave stability there’s always Apple and Microsoft to the rescue.

This is now I come to the second point, if Nokia were to ever consider Android. Against the general opinion, I believe it will fail.

 

Disclaimer: I have bashed Samsung long enough, and I admit no liability. If you feel offended, or your business has been affected by this post, I feel honoured and complimented. This post is not open to debate. Any legal action is subject to my personal jurisdiction only, and in that case you lose the motion, and hence the trial.

Friday, February 8, 2013

The Missing Puzzle Piece

You often aspire for a lot of things-not necessarily materialistic; love, friendship, relationships. It’s like a constant search hardwired in your DNA. Everything and anything that you see around, things that appear to be perfect, things that are almost perfect, except for that one missing piece which fits into the symmetry of nature. You would admire it, maybe even acquire it, settling on a compromise, hoping that with time you’ll learn to do deal with it and the almost perfect will transcend into the perfect. But a little ways down the road, you’ll realise, that the missing piece of the puzzle was not missing, but it never was there, and is something that cannot be done without. For the puzzle is still incomplete, and there’s no fun in that. For all that is there to admire, but for that void, the nothingness, that empty space, is all that you’ll ever see and yearn to fill. Every now and then, maybe you would look at the puzzle, distracted by the sense of beauty that allured you once, you’ld be happy enough so much as to forget about the void. But the negative force generated by that void, is sufficiently great enough to overcome that happiness eventually [1]. The love, the happiness will eventually descend into the nothingness. And the puzzle will crumble into a million pieces eventually.
You’ll feel angry, and sad that it had to happen this way, but maybe someday maybe you’ll remember it with no regrets, and only the happen moments will flash before your eyes, and that it was fun. Life is oddly ironical this way.
I often surmise these thoughts with this quote from one my favourite books, Gone with the Wind:
 

"I was never one to patiently pick up broken fragments and glue them together and tell myself that the mended whole was as good as new. What is broken is broken--and I’d rather remember it as it was at its best than mend it and see the broken places as long as I lived."

 
   
 
[1] This a practical physics result and has been verified experimentally. For any body which is perfectly symmetrical such as a hollow sphere, the integral force exerted at the centre by that missing piece is equal to the force exerted by the remaining body. It’s amazing how much physics actually holds true to aspects of life which otherwise can’t be quantified due to the absolute vagueness of idea.
 

Monday, February 4, 2013

What Would I Do Without You??


Being on your own, something I came to terms with long ago. Last few days, I have been thinking about various things- how things could have been and...
It’s been all over me to the extent of driving me to tormented crazy.

In times like this, the only solace I find is in music. Was watching How I Met Your Mother season 8 episode 14, and there’s this song in the end which was playing. And I took to the lyrics. It’s been playing over on repeat since then.

It’s amazing how you can take to a song and forget about everything else as if it never existed.

 
Sometimes I wake up with the sadness
Other days it feels like madness
Oh…what would I do without you?

When colours turn to shades of grey
With the weight of the world at the end of the day
Oh…what would I do without you?

A decade goes by without a warning
And there’s still a kindness in your eyes
Amidst the questions and the worries
A peace of mind, always takes me by surprise.

I feel like I’m walking with eyes as blind
As a man without a lantern in a coal mine
Oh…what would I do without you?

My imagination gets the best of me
And I’m trying to hide lost at sea
Oh…what would I do without you?

The difference between what I've said and done
And you’re still standing by my side
A guilty soul and a worried mind
I will never make it, if I’m on my own

So you’ve got the morning, I’ve got midnight
You are patient, I’m always on time
Oh…what would I do without you?

You’ve got your sunshine, I’ve got rainclouds
You’ve got hope, I’ve got my doubts

Oh…what would I do without you?
Oh…what would I do without you?
Oh…what would I do without you?
 
 

Monday, January 21, 2013

Book Review: Once Upon the Tracks of Mumbai



So one fine day, as I was checking my emails, I received a message from the author Rishi Vohra, requesting a book review. The title sounded cheesy (too much Bollywood like), I had never heard of the author before, and frankly I was sceptical as I thought it was most probably a spam mail.

I however, was proved wrong.

I started reading the book, and I was in for a joy read!

Balwant Srivastav aka Babloo- the protagonist of the story. His world is divided into Him (his alter ego), Vandana (the love of his life) and the Others (‘they’). ‘They’ call him autistic, schizophrenic, psychotic. Neglected as a child, misunderstood by his own. He has nothing but his love for Vandana.

Vandana- the beauty of the Railway Colony, the one who everybody yearns for. What does she want? She wants to fly out to USA. The place where all her dreams can come true.

Sikander- the antagonist, the cable guy, the philanderer. The villain. The one who almost got away.

And then there is the Rail Man- the hero of the Mumbai railway tracks. The fearless one, who has nothing to lose, but what can he possibly gain?

Together their lives are intertwined. The author weaves a beautiful tale and sets it against the dynamic backdrop of Mumbai. The book is well researched and written in a simple, lucid manner. The characters are well developed, and complex emotions portrayed in a way you can truly relate.

The book is a reflection of the Indian middle class, and their survival. It picks on various issues here and then- sexual harassment, corruption, the stagnating bureaucratic system to name a few.

The book is a must read!

To know more about the author, visit www.rishivohra.com .


The book is also available for order at flipkart.com.