Glorious Terrible War

As Arjuna looked through the corner of his eyes, he spotted Karna’s chariot ravaging through the battlefield. This was his chance to glory, all his life he had trained for this moment. Today, he will fight Karna, his arch-rival, the ultimate warrior, and a noble enemy. Stories will be written, and songs will be sung about his victory over Karna. And even if it does not go in his favor, the doors of heaven will be open! All the deities will welcome him as he died a noble death on the battlefield. As he approached Karna, a shower of arrows greeted him. He also started shooting arrows with exceptional speed and precision. All the great warriors and common foot-soldiers alike stopped fighting to watch this ultimate dual. Even the gods showed up to see this belle of death and glory. With tremendous skill, Karna would strike down all his arrows, as does he. But he is just a bit better than Karna. Amid this deadly dance, he saw an opportunity. He loaded his finest arrow, pulled the string of his might bow Gandiva to his ears–in this moment of excellence, he even forgot about the glory and the songs through the ages–and let the arrow go. It traveled like a beam of light, like a fish in the water, quick and nimble, it pierced through Karna’s shiny armor. Karna looked him in the eyes for the last time, not with enmity, but with friendly respect as he had beat him fair on the battlefield. He also gave a friendly nod, as Karna took his last breath. The soldiers cheered in a roar, and all the mighty warriors applauded, even the gods admired his skills. Ages will remember him for this moment!

And he woke up from his daydream. Karna’s chariot is in front of him, stuck in the mud. Karna is on the ground, desperately trying to get the wheel out of the mud. His clothes and his armor covered in filth. Sri Krishna, Arjuna’s Sarathi, tells him, “Shoot Arjuna! This is your chance.” “But he is unarmed,” his voice cracked. “This is not the time for pondering, Arjuna. Think about the thousands of Pandava soldiers he will kill. What if he kills one of your brothers? “. He took out an arrow, reluctantly and with shame. The arrow stuck Karna and open a large wound on his torso. Red blood started to flow, mixing with the dirt. Karna tried to stop the bleeding with his hands but in vain. The mighty Karna lay dead on the ground, covered in dirt, his eyes wide open with anger. But for Arjuna, it was he who was covered in filth. Filth and shame. He did not feel like a great warrior but a murderer. 

He felt like running away, leaving the war behind, never to touch a bow again. But as he saw around, soldiers hacking each other, beating the downed men to death, charioted warriors killing foot-soldiers by the dozens, blood and screams of the wounded. The rush of battle ran through his veins. He was no worse than the ones fighting around; he alone was not a murderer. And if it is in his destiny, like his son Abhimanyu, he will also see his day of glory. He raised his bow and engaged again in the Glorious Terrible War.

Note: Recently, I stumbled upon Jeff Wright’s excellent podcast on the Trojan War. One of the episodes in the podcast is titled Glorious Terrible War, where he talks about how Homer in The Iliad sings about the glory of war but does not shy away from showing it’s terror. I realized the Mahabharat also does the same and it served as the inspiration for this post. The killing of Karna exposes the terrible nature of war, but in the hearts and minds of the warriors, the hope of glory still endures.

Wars of our Time – War in Afghanistan (Not the one you think)

In December 1979, the Soviet Union launched an invasion on Afghanistan or, more precisely, on the Mujahideen rebels in Afghanistan. The Soviet intervention was mostly to support the communist lead government of Afghanistan. The Soviet operation was not the start of a war, per se. But in response to the civil war that was ravaging the country for the last 18 months — ever since the communist government took control of the country — a war that the Afghan government was not winning. However, this intervention will bring international “attention” to this poor land-locked country and will have some long-lasting effects on world diplomacy.

Big Brother is Watching (and supplying arms)

With the Soviets in Afghanistan, it was not long before the United States got interested. They just wanted to do whatever they can do to make life miserable for the Soviets. Pakistan supported the Mujahideen rebel groups ever since their inception, and now the United States was supporting Pakistan. This was a beautiful arrangement for the United States because, with all the arms they provided, the Mujahideen groups were giving real tough time to the Soviets. Although the Soviets were largely successful with their campaigns, in a war like this, the longer the war drags, the more they would get defeated, and defeated they were. In 1985 they gave up and pulled the army back from Afghanistan. This war — apparently a Jihad against atheist and progressive Soviets-also attracted a bunch of fighters/financiers/warlords from all over the world, one such individual was Osama Bin Laden.

Check out this awesome video by Feature History for more details

The Mess

The Soviets left, but the war did not. The Soviets were merely aiding the Afghan government if you remember, and now the government had to fight without their direct support. They backed the government with material for a while. However, with the collapse of the Soviet Union, the aid dried up, and soon the Mujahideen groups took control of most of Afghanistan by 1992. This might seem like the end of the war, for better or for worse. However, as they were deciding on how to share the power among themselves, there were disagreements. Most groups under the leadership of Rabbani and Massoud agreed to share power, but Hekmatyar and his Pakistan backed militia wanted Kabul for themselves, and a new war commence. By 1996 a new group of militia called Taliban, also backed by Pakistan, emerged as the strongest force. Soon they conquered Kabul. Massoud and his supporters, often called the Northern Alliance, were facing tough odds.

What About the War?

On September 9, 2001, Massoud was assassinated by Taliban fighters disguised as journalists. With their leader gone, defeat was imminent for Northern Alliance. Two days later — 7000 miles away, in a world completely different from the barren hills of Afghanistan — something happened. As tragic and terrible as war. Soon a new military will join the fight, with drones and Kevlar vests and aircraft careers.

As for war, war will continue.

Sources:

  1. https://en.wikipedia.org/wiki/Soviet%E2%80%93Afghan_War
  2. https://en.wikipedia.org/wiki/Afghan_Civil_War_(1992%E2%80%931996)

My take on ‘Pity the Nation’

Note: Last night when I read the stories that vandals protesting the film ‘Padmavaat’ hurled stones at a school bus with children and that multiplex association is succumbing to the demands of such goons, I had a mix of emotion, the strongest of them being anger. All I could think was the first line of the classic poem, ‘Pity the nation’, by Khalil Gibran. I took that first line and tried to put some words of my own with both tribute and apology to the great poet#.

 

Pity the Nation
Pity the nation that acclaims the bully as a hero*
Pity the nation whose valor is in hurling stones at children
Pity the nation where opinions are enforced by muscle

Pity the nation whose statesman is a fox*,
leader a wolf, people sheep and journalist a puppet
Pity the nation where pen is tied but sword is rampant

Pity the nation where sage is silenced and conman listened
Pity the nation where bigotry is called culture and xenophobia a virtue,
And streets are burned for selfish gains

Pity the nation where children sleep unfed,
Where rich are always the righteous and trickster is called genius
Pity the nation which tries to find happiness in numbers on a billboard

Pity the nation whose most valued asset is phantom pride
Pity the nation who raises not its voice except to oppress the weak,
And kneels not except the enemy is strong

Pity the nation which is indulged in past,
Whose facts come from story books,
Where minds are rarely ignited,
What prevails is apathy and what’s missing is a spine

Pity the nation which has lost its freedom before finding it ever

– Ks

# Apparently, I am not the first one to do so. Human beings much greater than me has also taken such liberty, most notably Lawrence Ferlinghetti, which is a relief.

* From original poem by Khalil Gibran

Extra Comments
As one can see this work is cynical in nature also very clear to anyone with a right palate would be the utter lack of beauty and subtlety. The fact is that I don’t know poetry and creating something beautiful was not my purpose. As for subtlety, this work is not born from ecstasy or love, or agony or anything that you might want to be subtle about. This is work of anger I let it be like that. Moreover, I don’t deem it necessary in the time of moral crisis. Even though it’s born out of recent events in India, and the state of modern day India in mind, what it says does not apply only to India, but any nation who exabits such qualities or a subset of such qualities. Lastly, even though devoid of beauty, lacking subtlety and born out of anger, I hope the reader will connect with the feeling that drives it and will see it as more than a rant.

Installing Zeppelin notebook on Windows 10

Currently, Apache Zeppelin is the preferred notebook for Spark. It also offers a wide variety of other interpreters,  markdown, and good visualization, which makes it a great tool for your Spark or general Big Data project. However, from y personal experience I have found that installing Zeppelin on Windows machine can be a bit complicated and somewhat frustrating. The official document says that you only need Java installed and Java Home for Zeppelin to work, even on Windows.  However, it looks like a white lie to me. Mostly I have noticed that with those steps only you will see the following error message with Saprk interpreter.

java.lang.NullPointerException
at org.apache.zeppelin.spark.Utils.invokeMethod(Utils.java:38)

Null Pointer Exception

NullPointerException, thou mighty bitch

Here is a guide of steps that worked for me and my friend on Windows 10. I am not claiming that it will definitely work for you or that skipping any of the steps will definitely not work. But, it was exactly those steps that worked for both of us, nothing less.

1. Install Java and set Java Home environment variable. This is a pretty standard procedure and people have been doing it since forever. (A recent hieroglyph found in Egypt describes how people used to do that in ancient Egypt).

2. Download Zeppelin notebook from here and extract (using 7-zip or other) it to your local machine. Avoid ‘C:\Program Files’ as the directory, if you don’t want to mess with admin privileges. I simply chose plain C:, but ‘C:\users\<username>’ is also fine.

3. Download Hadoop 2.7.x from here. Download binary, not source. Extract it to your machine, Again avoid ‘Program Files’.

4. Download ‘winutils.exe’ from here. Paste it in ‘<your-hadoop-directory>\bin’.

5. Set environment variable ‘HADOOP_HOME’ and point it to your Hadoop directory. Your final settings in environment variable should look like this.

Environment variables settings

Your Environment variables should look like this

6. Go to Zeppelin-directory\bin and start Zeppelin by launching ‘zeppelin.cmd’

7.

a. Once inside zeppelin click on the menu on top right corner and select ‘interpreter’ as shown in the image.

Select Interpreter

Select Interpreter

b. Scroll down to Spark section and click on edit (pencil icon). Set the last variable ‘zeppelin.spark.useHiveContext’ to ‘false’

Select edit

Set useHiveContext to false

Set useHiveContext to false

C. Click on save button.

8. Now create a new notebook (or use the spark tutorial notebook). Save interpreter setting, keep Spark as default. Run the code ‘sc.version’. Viola, if you have not sinned too much in past you will see the following output.

It should show your Spark Version

It should show your Spark Version

Group assignments

Group assignments and projects are highly regarded in academia, they are supposed to develop team work in students and that kind of untrue shit. But let’s see how an actual academic team project goes on. Like animal groups, project group also has an Alpha and a Beta. However, it also has a bunch of gammas depending on the team size. Unlike, animals where Alpha dominates and Betas follow. This human group has a more complicated chain of command. If you ever worked in a group project you have probably experienced following scenarios.

First, let’s see who is who

Alpha – The guy who does 80% of the work

Beta – The guy who at least tries.

Gammas – All other who basically don’t give shit

  1. Alpha quickly takes control, but says in a Google CEO fashion that ‘I don’t want to decide topic, let’s all propose an idea and we will have a discussion to choose the best one.’
  2. Beta knows that his idea is not going to be accepted, but still does a halfhearted effort come up with some idea. And the Gammas, well they (paste the last four words from their description here)
  3. A group meeting is called and canceled multiple times before finally a fruitless meeting is conducted.
  4. And guess who’s idea is finalized? Yup, you are right.
  5. Everyone is assigned responsibilities, which all know don’t mean shit.
  6. As his proposal is finalized Alpha is both excited and obliged to work, and starts working in total isolation from the team. Beta, now somewhat relieved moves to even more passive role. And the Gammas say that they are reviewing literature, my ass.
  7. Alpha gives Beta some work and after working for a week, when he reports to Alpha that he is done, this is what Alpha says, “Actually, I changed the system flow, now we don’t need that shit anymore. Did I forget to tell you? Anyway, you learned something. Yes, you did forget to tell me and this ‘something’ was literally the last entry in my ‘things to learn’ list.
  8. Alpha gives Beta another work and when it’s done, reveals that he has (secretly) completed the work on his own already.
  9. Gammas start skipping meetings giving strange and/or unbelievable reasons. I am locked in the apartment, my hand hurts, my roommate is coming back from his day job and I must be there to cordially receive him.
  10. More fruitless meetings, where Gammas say weird and irrelevant things which are overlooked and not corrected mostly because of laziness (and to avoid awkward conversations). These meetings are moot anyway as Alpha is doing almost everything, but are still held with good ‘esprit de corps’.
  11. The deadline for first deliverables come close and Alpha first time in his life tries to give some minor work to a Gamma only to realize that Gamma doesn’t even have a remote idea about what’s going on.
  12. Programming starts where one of the Gamma says, “Dude, you have forgotten a semicolon there. Not there, little up, up, you went too up, down.” “Thanks, asshole, you think you are a great service. But you know what, the compiler would have given the line number.”
  13. One of the Gamma uploads some random shit to GitHub repository as his ‘contribution’, which stays there until the very last moment until someone (Alpha or Beta) notices it.
  14. Failed attempts to make Gammas do easy task like writing less important sections of the report are made.
  15. Alpha assigns even easier tasks to Gamma. “Okay, the code is ready can run it on cloud and check the results.”. The Gamma replies, “Let’s have a meeting”. I don’t want to have a meeting, mofo. Just run the f**king code.
  16. Alpha realizes that he has done almost everything and Gamma has done almost nothing. He starts assigning ridicules tasks to Gammas, only to feel better. “Okay, I have completed the 10 page final report in LaTeX , can you convert it to PDF?” This time Gamma does ‘the job’ successfully.
  17. On the day of presentation Beta and Gammas are carefully given minor topics, so they don’t get caught. Almost every question is answered by Alpha.
  18. While preparing the final report Mr. Asshole, whose only contribution is a failed effort to format LaTeX, says that ‘Let’s keep names in alphabetical order’ — Mr. Douchebag agrees.

 

Note: He is to read as he or she. I generally randomize the use, but for this post it proved difficult.

Something about airplanes

Airplanes! One of the coolest stuff in the world. It’s a common trend that when we are young we aspire to be a pilot and as we grow up we forget how cool a passenger jet is and take it as a mundane object. I don’t remember whether becoming a pilot was there for a considerable time in my agenda as a child, but I very clearly remember that as an 11-year old I was totally captivated by the Boeing 747-200* that took me from Chhatrapati Shivaji airport in Mumbai to Charles de Gaulle airport in Paris. And even now, after tens of journeys in these magnificent machines, I am still excited about the prospect of boarding an aircraft, takeoff, traveling almost at speed of sound (80%) and finally landing. And I hope I will continue to do so for rest of my life. However, now as an engineer and a ‘scientist in progress’ it would have been better if I could have learned a little bit about the technical aspects of flight while flying. And guess who comes in to picture, ‘Panasonic Avionics’ fitted in the brand new Boeing 777-300ER of Kuwait Airways (it’s not that easy to guess, I know). Avionics are the electronics related to aviation, thus Aviation + Electronics =  Avionics. Now, this Boeing 777 in which I traveled had the facility to see flight related data in the in-flight entertainment screen. I could see on my screen the speed of the aircraft, altitude (height), vertical speed, pitch and roll, direction and some other data updated almost live. Apart from that the live feed from the bottom and the front camera of the aircraft. On my entire trip, I had the pleasure of witnessing 5 takeoffs and 5 landings and I was glued to that screen during each one of them. This actually was a wonderful experience and learned something about the flight.

Boeing 777

Boeing 777 has the most powerful jet engines in the world.

About JFK-ADI-JFK and Boeing 777

As I said during my recent trip back to India, I traveled in Boeing 777-300ER (300 suggests longer hull and ER stands for extended range). This gorgeous aircraft was introduced in 1994 and will soon outsell the famous Boeing 747 ‘Jumbo jet’. It’s not quite as big as 747, but still quite large. It can accommodate about 350 passengers in three class seating and more than 400 in a two-class arrangement. However, the most exciting thing about 777 is that it’s powered by two GE90 turbofan jet engines, each of them produces more power than Titanic and is the most powerful jet engine in the world. And yes, it’s twin jet means powered by only two jet engines rather than four, which is quite exceptional for its size.

Airbus A380

The mighty beast that didn’t last

About A380

I have traveled in many of the popular passenger jets. In the small segment (technically narrow-body), a couple of times in Boeing 737 and a myriad of times Airbus A320 variants (Indigo’s entire fleet is of A320s). In the larger ones (wide-body), Boeing 747, Boeing 777 and probably Airbus A340. I am still to experience the next generation of aircrafts, Airbus A350 XWB and Boeing 787. But the one I am most excited about is none other than Airbus A380 ‘Superjumbo’, the largest passenger jet in the world. I plan to seize the earliest opportunity I get to get on board the ‘Superjumbo’. I had been reading about its development as a teen and was pretty excited about how it would revolutionize commercial aviation. Today, a decade later, it makes me sad to know that A380 is commercially a failure. With Airbus reducing the production to just one per month starting from 2018, the fate of this gigantic beast seems to be grounded forever.

 

*Might be 747-400. I remember it as 747-200, and however confident (and proud) I am about my memory, statistically 400 seems more likely.

Something About Alan Turing

Alan Turing

Alan Turing

Some time ago when I watched ‘Imitation Game’ the film based on the life of computer legend Alan Turing I was emotionally overwhelmed. But first, let’s begin with the basics. Who was Alan Turing? What did he do? Turing was a mathematician and a cryptanalyst. And he did as the movie says something that ‘No one ever imagined’. Turing was the lead the team at Bletchley park to crack Enigma, the cipher* used by Axis forces and which was considered impossible to crack. He did so by the means of a machine with several rotating barrels. When everyone was trying to decrypt it manually, he realized that only a machine will be able to beat a machine and he created ‘Bombe’, the machine that changed the course of Second World War. It is no exaggeration to say that cracking enigma shortened the war by at least two years and saved lives of millions. Turing was one of the very first human beings who were able to see the importance of an intelligent machine. Turing was surely ahead of time, he created the Turing Machine, which is the predecessor of the modern computer. At the time when computer science was still incipient, he imagined machines as intelligent as humans. For that, he proposed a test now called the Turing test from which the movie ‘Imitation game’ derives its name. In the Turing test a person sitting in a room converse by the means of typing, to either another person or a machine sitting in another room. He does not know whether he is conversing with a person or a machine and he has to determine it at the end of the test. If he is able to identify the machine, the test fails and so does the AI system. On the other hand, if the judge is unable to distinguish the machine from the human, the test is a success. This remains the ultimate test for AI systems even today, where a computer has to imitate the human. However, sadly he was never celebrated for what he did during his lifetime, which unfortunately was short because of the cruelty and stupidity of the society. His work at Bletchley Park which saved millions of life was a top secret and was classified. For all his services he was met with total ungratefulness from the part of society. He was charged with indecency as he was a homosexual and being one was a crime at that time. After the prosecution, he was offered imprisonment or chemical castration to ‘cure’ him. He chose not to go to the prison, two years later he was found dead in his apartment, most probably by poisoning himself. This is what the world gave him in return. It is an irony that, slaying millions of life on the name of war is not ‘indecency’ but a very personal, totally harmless predilection is ‘indecency’. In the year 2014, the queen issued a royal pardon to Alan Turing, conceding that what the law did with him was wrong. Today, the most prestigious prize in computer science is called Turing prize, also considered as Noble prize of computing world. But none of this gives justice to Alan Turing and the cruel game society played with him.

GATEs always open for me

Maybe doors shut on me, but GATEs always open!!

gate 2016 scorecard

I know it’s not an extraordinary score and is nothing to brag about. But, in my defense, I was unprepared. I had only a month to prepare, that also along with a job. I appeared in GATE only for fun, but still, it matters to me. Still rank of 1190 out of 108 thousand candidates is not bad. For, it’s my way to express my love for computer science.

Denial and Ostrich Algorithm

A few days ago, my friend and I were discussing denial. What is denial? Denial, if you don’t know, is completely avoiding a situation or ignoring the inevitable and believing that it is not there. Now, what do you think about denial? Obviously, you will think that it is not a trait worth cultivating. But what if I told you that in many situations utter and unreasonable denial is the best strategy by far, constantly ignoring the inevitable like it will never happen. Surprised? Well you should, as from the very beginning we are told to tackle problems upfront and never to avoid it and it is the right decision in most cases, but unfortunately not all.

Can you think of one case where denial is the best strategy? In fact, the best one is essential for our function and embedded so well in our psyche that it is hard to identify it. Any guess? Well, it is the denial of death. Without denial, every man (and woman) on the earth will be thinking about death, which is inevitable, and what to do about it. The reason we don’t do that and are able to engage in perfunctory activities is that we are constantly ignoring that fact. We know we are going to die, but most of the time in our subconscious we like to believe that we will leave forever. This denial lets us function, discover, invent and succeed.

Many of you may find the example of death too extreme, as death is inevitable and it does not seem that we can solve it ever (don’t confuse the denial of death here with the desire of elongated life, with fear of death it doesn’t matter whether you die in a year, hundred years, thousand years or at the doom of mankind). But what about the problems which are very much evitable and can be avoided with careful planning? Is it ever better to avoid them? Matter of fact, it is in some cases, and that brings us to Ostrich Algorithm.

Ostrich burying its head in the sand

This is a good strategy, Seriously!

Ostrich Algorithm is more of an approach than an actual algorithm as it suggests doing nothing. It is the most popular approach for tackling deadlock* in many computer systems. The name is derived from the bird ‘Ostrich’ which is believed (however, wrongly) to bury its head in sand when a threat approaches. (Actually, the poor bird is checking its eggs, which it lays under the ground; when it buries its head as you might have seen in many pictures). In Ostrich approach of deadlock prevention, the computer assumes that deadlock will never occur, although it may very well occur and can crash the system. However, in most of the computer system, the chance of such deadlock is negligible, while constantly checking for deadlocks and preventing them can slow the system down. People don’t care if their computer crashes, once a year and they had to press the reset button. For most of us, system crashes multiple times in a year and mostly not due to deadlock. However, the same cannot be told for ‘Nuclear Reactor Controller’, their reliability take place over performance and ingenious deadlock prevention techniques must be used.

After all his discussion, if you still don’t want to believe that in many cases denial is good, then you are in the state of denial; but if that encourages you to tackle any problem upfront and makes you enthusiastic, remain in that denial, for denial is good.

*In computer science deadlock refers to the situation where two processes are waiting for resources held by each other. E.g.  process A is holding resource x and waiting for resource y, while process B is holding y and waiting for x. Both the processes are stuck in a perpetual waiting. This also applies to more than two processes.

1 2 3