Thursday, 16 October 2014

Love Jihad

Swami Gulagulaananda quoted:
"Expecting the world to treat you fairly because you are a good person is a little like expecting a lion to not eat you because you are a vegetarian"

While the original quote is "...expecting a bull not to attack you..." but I like the lion one better.

Highly recommended reading - Aavarana - The Veil

It takes all sorts to make a world is an old proverb. There are all kinds of people out there - Good, well behaved, polite, smart asses, witty, dull, dumb, arrogant, cruel, sadistic, masochistic, sadomasochistic and so on.

Then there is a second proverb - Birds of the same feather flock together. We typically see these examples right from our childhood and college. The smart ones hang out together and topics of discussion are studies or study related. People call them nerds. Then there are a group of sports-guys and studs who ace in the field but flunk in exams. It's very rare that you see people from both groups hang out together socially because they want to. People gravitate towards others of the same kind. When this happens, your mindsets are all alike. However, it is very rare that a person of one mindset understands where the other comes from.

I have already written a post saying that one cannot judge another based singularly on your experiences with him because you have no idea about the kind of situations he went through to become what he is - You can find it here. I see a lot of people who make this fundamental fallacy. But this is not a post about judging people - It is about judging situations.

Let me start off by telling you a short story - An eminent Indian journalist is seen talking to a group of people in a major American city. Suddenly, he is seen in a scuffle with one of the men there. Someone records a video and posts it on Twitter saying that Rajdeep Sardesai manhandled by Modi Bhakts. Immediately people spring into action. Modi Bhakts they say... Is this the Acche Din we were promised, they say. Modi and his supporters are all fascist, they say. The Indian hyperactive media does immediately takes a holier than thou stance and starts objecting to such crass behaviour.

A little later, a slightly longer video is released that shows Rajdeep Sardesai provoking the man, calling him abusive names and it was Rajdeep who initiated the brawl. The point here is to not judge who is right or wrong, but to simply illustrate that one must not rush into conclusions because situations are often a lot more complex than what appears at the outset.

I write this point singularly to talk about Love Jihad - With the recent post by Saif Ali Khan who, I must admit has written well, doing rounds, a lot of people seem to be trivialising the issue. They think Love Jihad is a silly concoction created by the RSS. In reality, they say, we are all Indians and we are diverse. These restrictions and claims are suffocating. Love Jihad is not real... The people who talk about it in this way are no idiots - They are well meaning people. But they are the kind of people who are like nerds of the college who hang out with other nerds. In their circle of nerds, there is no guy who gets beaten up by his girlfriend's rowdy ex, because there is no girlfriend to start off with. So the concept of getting beaten up by someone for dating someone simply does not exist in their world. So they do not understand why people beat one another up for a girl - It's absolutely absurd...

But what you find absurd is still a reality of life - To others, to whom the problems really do exist, you sound like the pretentious Mary Antoinette who infamously said - "If the peasants don't have bread, let them eat cake" - because you are trivialising a problem that doesn't affect you. There are real problems out there - Have you actually been on the ground? Have you actually done thorough research? Or are you just sitting in an air conditioned room and running a couple of Google searches and doing armchair debates?

Problems on the ground are a lot different from perceived problems. When we wrote software for our warehouse, we wrote it with good intent. On actually going to the warehouse we realised what colossal mistakes we had made in some aspects of our design, because our perception and reality were completely different.

Think about it - Everybody wants peace - The problem is with our definition of peace... Even the terrorists in the middle East want peace, they just want to establish a peaceful Dar ul islam in the world. Aurangazeb was a peaceful guy according to his Muslim subjects. The problem is with perception - and of sides. I love the line from James Bond movie - One country's terrorist is another country's freedom fighter. While people bombing Kashmir are terrorists for us, they are fighting to free it from India's evil clutches. Isn't it the same in Israel and Palestine? Each one believes they are right and fighting for rightness and righteousness.

Love Jihad wouldn't have been a problem if people who were marrying across faiths said - Hey, you maintain your faith and I shall maintain mine. There wouldn't have been problems if they said - Hey, let us teach our children both our philosophies, you go out and experience the world and decide for yourself what you want to follow. If people were as nice as Saif Ali Khan claims to be, there would have been people sitting lazily around smoking pot and farting rainbows. The harsh reality is something entirely different. So next time, before shooting your mouth off on areas that you don't understand - Don't! Research topics a lot better...

Highly recommended reading - Aavarana - The Veil

Friday, 10 October 2014

Where do you draw the line?

Swami Gulagulaananda said:
"Sugar has carbon is not a debatable statement. Red is the best colour is..."

With the explosive growth of social networks where you don't need to have conversations face to face, combined with the anonymity of the internet, people are no longer scared to post their opinions out there. I am sorry, did I say post? I meant vehemently shove it on others.

But opinions are different from facts. Sugar has carbon is not a debatable statement. Red is the best colour is...

When something is illegal, the value of the product increases by a large amount. The Chinese "medicine" black market is responsible for the deaths of elephants and tigers in large numbers. Poaching is illegal, but the reward is so great that the punishment doesn't seem to deter poachers. Recently I read a post where people were talking about elephant poaching and how difficult it is to control it. The post continues to debate if ivory trade should be legalised. The argument  here being that if legalised, one need not have to kill elephants. You can perhaps have some kind of government regulated formal structure.

While this may seem to be a viable solution, one wonders how one arrives at what needs to be legalised when we are unable to control its growth. The simplest examples for these are prostitution and drugs. There is a perennial market for sex, considering prostitution is the world's oldest profession, and one might think that if a woman is interested to make some money and a man is alright with shelling out some money in exchange for "services",  there should be no problem. He is giving her a job and receiving a "job". Now I am sure one group of people completely disagrees with this argument calling it immoral while another agrees with this - Yes, look at the more stable and developed Western countries, I mean, look at Netherlands. It is legalised and there are no problems. They have so many benefits, protection (more ways than one) arranged by the government etc. The police know where brothels are, customers don't have to worry about getting secretly videoed, prostitutes don't have to worry about weird people, etc.  So should we legalise it? How do you decide?

But if you think it should be legalised, let us continue down that road and see what happens next, at the risk of slippery-slope fallacy. One of the other "stable and developed Western country" Denmark allows for animal brothels. You see, now we are at a tricky place - We cannot say if the animals are ok with human sex, but the owners say that the animal craves sex - and now the question is, should you say this is ok or not? Would you say this amounts to animal abuse? Would this make you to sign petitions? Clearly you have two sides for this as well... How do you decide?

Don't you think the same logic can be applied to drugs as well? We know people take drugs, we know there is a huge underground market out there. One might consider tightening the screws (requires man power) further to make it so difficult to obtain illegal substances that the prices keep getting jacked up further until a point where it no longer becomes viable to buy and sell drugs. The other solution, of course, is to legalise it because we are unable to keep it in check. Imagine a store from which drugs can be purchased - There is continuous police protection, each person has a unique card with magnetic strip and we know when he purchased drugs, which drugs and in what quantities. Quantity regulation to prevent overdose deaths, etc. can be attempted. But this will get opposition, because drugs will ruin lives, you say. But why? What if we put up sign boards that say "Don't do drugs - they ruin your life" etc. just like for cigarettes? People know the ill effects of cigarettes but that doesn't prevent smokers from purchasing them. People know alcohol messes with your liver and your brain and yet we allow alcohol purchase - when we are fully aware that it is the main reason why so many lower class people cannot grow - their income is always directed towards liquor purchase and husbands become abusive wife beaters. And yet, we legalise some things and not others... How do you decide?

Let's move on to modern Indian's poster-boy problem - You guessed it, homosexuality. Section 377 is a draconian, stupid stupid (yeah, I used it twice) rule. Why should homosexuality be legalised? Because homosexuality is natural - One cannot help if one is born gay or not. So if one is born gay, what can he do? By introducing such draconian laws, we are going back to the middle ages. Agreed - Everyone should be happy. But let's continue looking at other natural things while we are at it. It's a well known evolutionary fact that female animals pick the strongest male in a bid to guarantee survival of its offspring while males tend to have sex with multiple partners in a bid to increase chances of getting its genes through to the next generation. So infidelity is hardwired into males. So then should we say extra-marital affairs is natural and the idea of marriage where someone is bound to one person is unnatural and unnecessary? How do you decide?

Speaking of women, the next poster-boy problem is women empowerment - Again, I am all for it. But the methods picked by people are rather odd. On one hand, I hear people shouting against caste based reservations. On the other, I hear people supporting women's reservations. How can you say both? The idea of stealing college seats and jobs from a meritorious person seems outlandish on one hand but seems to not dissuade you on the other? So it is ok for a meritorious boy to not get a seat in a college because of women empowerment? BMTC buses have the first half seats designated as reserved seats for women - but the other half is open to both men and women. How's that fair? While I am primarily opposing reservation, wouldn't it be fair to say that the first half is reserved for women and the last half for men? A lot of our solutions are knee-jerk reactions. Girls are not sent to school because their parents have to save money for dowry (making them feel that having a girl child is a problem, resulting in female infanticide or raising illiterate daughters) I understand why you want to make it free. But don't you think consistency is important? Isn't this discrimination where boys' families have to pay and girls' families don't have to? The ultimate goal is to not have discrimination, isn't it? And don't tell me we don't have enough money - The cost of education for a kid in a year is so low that it might cost you your one pizza...

Rightness and wrongness are simply decided by the number of people who agree with you. Nothing in this world is a constant - A lot of people believed the world is flat - that doesn't make it true.

Arranged marriage and love marriage both have their advantages - Neither is perfect. It is the people who make the difference... So if you don't like arranged marriages, go marry someone you like. If it doesn't work for you, it doesn't work for YOU. Stop generalising everything, stop calling arranged marriages as a stupid idea, stop calling it backward. Again, mind you, I am not advocating either of this... I am just saying - Don't judge. Do what you think is good for you. If you don't want to marry, don't...

Everyone is entitled to opinions - it is when you start shoving it down others' throats that I find annoying. Problems are far more complex than we think, and we cannot solve problems in isolation because the same reasoning can be used elsewhere. Think about it...

With more and more people saying "Freedom of Expression" for everything, be it refusing to stand for the national anthem or saying abusive things against a religion, one finds it extremely difficult to judge what is right and what is wrong - because in the end, opinions are just opinions. So again, where do you draw the line? If I find a religion violent and say it, should people pounce on me or should it be condoned as freedom of expression? If I make fun of someone who died, is that ok? It could be bad manners... But if I spread lies and bring disrepute to someone through slander, I can be jailed... Should I be jailed? Isn't that still freedom of expression? How do you decide?

Then there is another group of people which believes anything factual that can hurt someone's sentiments should be avoided - To a certain extent, one may agree with that. To call an ugly person ugly is rude. We have to abide by the Social Contract. But, we cannot use that as a blanket rule. If your child is misbehaving, you will need to teach her some manners. If that child starts crying, it doesn't mean that you made a mistake. You had to do what had to be done. To stand up for what is right is your Dharma. The problem, as illustrated above, is deciding what is right - for rightness itself becomes subjective.

There can be differences of opinions with neither being correct - So to force YOUR moral compass on someone else is completely wrong.

To summarise - Believe in what you want to believe - Quit shoving your opinions down others throats - In the words of some guy "That may be your moral compass, but what good is it for me?"

Related Posts:
Of Liberals & Bullshittery

Friday, 3 October 2014

The Demon Cave

Swami Gulagulaananda reminded:
"As you sow, so shalt you reap"

Kumar turned around to look at his friend. "So what do you think? Should we do it?" Suresh, lying on his back, seemed to be completely oblivious to the question. Staring at the leaves of the peepal tree under which they rested, he seemed to be lost in thoughts. "Well?" persisted Kumar. "Let's wait till Shyam gets here" he replied. "Oh good, Shyam is here" said Kumar seeming relieved. He wanted to get done with it. He had been waiting for this for a while now, and he was glad that there was finally company.

"Fine morning today", said Shyam cheerily as he approached his friends. "What are you both up to?" Just as Kumar got ready to respond "Actually...", Suresh casually interjected "We are thinking of going to the Antarangaasura cave" Shyam looked a little scared. "Isn't that cave haunted?" he asked worried. "We are in the 21st century. Are you really scared of bally ghosts?" asked Suresh grinning. Something about the grin piqued Shyam. "Alright, alright. I was just testing if you wimps were going to be namby-pamby later" Suresh suddenly sat upright "Ok, it' settled then, let's go", he said. "What, now?" asked Shyam. "Well, it's still early in the morning. We should reach there before the sun is high in the sky", reasoned Kumar.

The trio made their way towards the cave that was supposed to be the home of the asura Antarangaasura. The three young men lived in a peaceful village nestled amidst several hills, one of which was the home of a demon who was said to kill anyone who dared enter his home. After a couple of hours, they stood at the mouth of the cave. The continuous strong wind was the only source of sound in that area. The frightened men looked at one another and gulped. Nobody had dared to venture into the cave. The asura spared nobody. But they were not those who believed in folklore. They were born in the age of space and science.

"Alright Shyam, lead the way" said Suresh. "Why me? Why not you? Don't tell me you are scared" protested Shyam. "I am only testing you" replied Suresh trying to grin bravely, but his fake grin fooled nobody. Kumar gathered courage and said "Alright, I will lead, you follow" Speaking thus, he switched on his torch. The others followed suit and slowly walked into complete darkness, only illuminated by their torches.

They had to walk only for five minutes when they came across what seemed to be large boxes and some human skeletons around. "Chests? What are these chests doing here? They seem to be old. Several centuries old. And whose skeletons are those?" Shyam went closer and asked his friends to illuminate the boxes while he tried to open. The lid wouldn't budge. He grunted and exerted all his strength and the box seemed to offer some leeway. Suddenly it opened and they couldn't believe what they saw inside the box. It was filled with gold - coins and ornaments and pearls and precious gemstones

The trio stared at the chest wide eyed, unable to believe their luck. They opened the other chests one after another and found all of them filled with gems. "Unbelievable. So much wealth. We don't have to work for the rest of our lives. Actually, I don't think anyone in the generations to come in my family will have to work" said Kumar excitedly. "Yes, let's quickly split this wealth into three parts. And let's do it before anyone else gets to know about this" said Shyam greedily. "Oh what's the hurry. Nobody has come into this cave for so many years. Nobody will dare to even come into this cave. Tell you what, I will go get lunch from the restaurant. Let's split the wealth after I get back" said Suresh on his way out. "Alright, fine, go get your stupid lunch. I am going split the wealth right now. I can't wait another minute" said Shyam.

A couple of minutes later, Shyam turned towards Kumar and said "The gold isn't going to distribute itself you know. Why don't you help me here? You look so dazed, look at you. What's the matter?" Kumar looked at Shyam, his eyes gleaming in the latter's torchlight. "I am just thinking of a way to increase our share" "Increase our share? How? Don't tell me you are going to invest it" said Shyam. "No such thing. I am just thinking of the share that has to go to Suresh. That guy is so bossy. He keeps ordering us around all the time. You remember how he gets us to do work all the time and takes credit for it, right?" Shyam recollected all the times that Suresh had stolen credit for their combined work. Suresh would talk and charm people and get credit for work that was done by Shyam and Kumar. "That's right. Even now, we are the ones stuck in this dingy dark cave while he is probably out there flirting with that restaurant owner's daughter. But how do we get him to opt out?" asked Shyam. Kumar turned around and said menacingly. "We outnumber him, two to one. Nobody knows we are here. Nobody will suspect that he would come here. Nobody else comes here anyway. I say we get rid of him here." Ordinarily mild mannered, Shyam would have never thought of murder but the sight of so much gold and the fact that it would go to that arrogant Suresh angered him. "You are right, nobody will find him. Alright, you stand over there with that rock. When he comes hit him on his head" he suggested.

A few hours later, Suresh walked back into the cave carrying lunch for his friends. Seeing Shyam from a distance he said "Oye Shyam, I can't believe you are not done splitting the wealth. I have been gone for quite some time, you know!" said Suresh loudly. "Yeah yeah, there is so much money here, it is going to take longer. My hands are aching too. Come join me" Shyam shouted back, trying to control his anger. "Work? Me? I just climbed this stupid hill again and am exhausted. Where is Kuma--" *thud* Before Suresh could understand why his skull was cracked, he had collapsed, bleeding profusely. Shyam came running towards him and hit him again on his head, to make sure he was dead. "Come on, let's drag his body deeper within the cave" suggested Shyam. "Nah, leave him there. It's not like anybody is going to come here. Well well, I am famished. Let's have some lunch" smiled Kumar. "Oops, I completely forgot" replied Shyam as he picked up the packet of food brought by Suresh.

They settled in a corner and saw that Suresh had brought delicious food. The duo wolfed down the meal quickly and got back to splitting Suresh's wealth. Less than ten minutes had passed when Shyam complained of drowsiness. And then he collapsed. Before Kumar could react, he collapsed too. Little had they known that their friend Suresh had poisoned their food to take all the wealth for himself. And thus the asura Antarangaasura had devoured all those who had dared to enter his home...

--
This is a story I had read as a child. Although, I did choose Antarangaasura as the asura's name because antaranga = internal, and asura = demon

Saturday, 26 July 2014

My discussion with an ISKCON devotee

Swami Gulagulaananda said:
"They argued over Schrodinger's cat and on opening the box saw a rock in it..."

Dasa looked at me in disbelief. "Are you saying there is no God?" he asked. "I didn't say there is no God. I said that I don't think that God looks like a person" I replied. "Why not? What according to you is God?" he asked. "I am not sure. But I don't like the idea of a personal god. To me, the idea of God has to be intellectually stimulating. For instance, the idea of Brahman as God is something I'd like to pursue. Like energy, perhaps. That which is subtle, with no characteristics, present in everything... Maybe energy. Or many something like string theory with all the subtle vibrations. But the idea of someone who can give curses is something I'd not subscribe to" I replied.

"That's Mayavada philosophy", spluttered Dasa, "Are you saying Krishna is not God?" I smiled at him and quoted the first 3 stanzas of the Bhagavad Gita's 12th chapter where Krisha Himself said that you can follow either path and it will eventually lead to the same truth. "How does it matter which path we follow? Does it not lead to truth in the end?" I asked. "Well, I guess you will eventually realise that Mayavada philosophy leads to my philosophy" replied Dasa. I got a little irritated at this point. Dasa is an ardent follower of ISKCON. I don't think much of ISKCON because I believe they are very much along the lines of christian missionaries in that they believe only one path exists and everything else is wrong. A topic like religion and God are more abstract with no single correct answer... as yet... let me elaborate on this later.

"Or maybe you will come to my path. Why do you think your path is the right path? Don't you think it is like a Software API with the actual implementation being hidden, abstracted from us? You can call the same services from whatever language you are using..." I tried to give an analogy. "To hell with software. You are saying that you don't know the absolute truth and this path leads to understanding. I am saying I already *know* the absolute truth" he argued ferociously. "How can you possibly know the absolute truth? The entire pursuit is to understand the truth, is it not?" He enacted eating and said "Srila Vyasdev has already told you that this is how you eat" and then moved his arm around the back of his neck and brought it to his mouth and said "and this is how you are trying to eat. When he has clearly told that Krishna is God, how can you argue otherwise?" he asked. "And what makes you think Vyasa is correct?" I asked. "Well, Srila Vyasdev formally wrote what has been coming through generations before him. He says so himself" he replied.

I rolled my eyes at this "And you don't think he could have lied? He wrote something himself and said something himself. Ok, tell me this, do you think Harry Potter exists? Do you think there is Hogwarts and platform 9 3/4 in London?" I asked. "Absolutely not!" he retorted. "Why not?" I asked. "Well, because it is fiction, it was written by someone with imagination" he replied. "But how do you know it does exist? It has been written down by someone too. You are saying it is not real because J K Rowling is a contemporary. But if someone a thousand years later reads it, how is it any different from Vyasa's scriptures?" I asked, trying to needle him. "Are you comparing our holy scriptures to Harry Potter?" he asked irritated. "Well, why not? Both are written, both are talking about things you have not seen nor experienced yourself personally. Vyasa's statements are a lot better than your planet of cows, Golokavrindavana", I said.

"Oh? So are you saying that there is no heaven and hell?" Dasa asked incredulously. "Don't you think that the idea of heaven and hell is created to keep people in check?" I asked. "What do you mean?" he asked. I explained thus - "It is well known, the carrot and stick theory. If you tell a person that if he does a series of actions he gets a reward but doing another series of actions results in punishment, people are more inclined to do things that result in rewards. It is common sense, that incentives work. If there are two men who like the same girl and assuming now 'law of land' does not exist, one of the men will probably kill the other man in a fight. The man who died is probably weaker physically but extremely talented and can do things that can benefit mankind in general. His death on the other hand results in nothing worthwhile in the grand scheme of things. However, if I create an elaborate story of heaven and hell and create a set of rules that doing these things will take you to heaven and doing these other things will take you to hell, the incentives will definitely drive you to do things that give you heaven...

"The only requirement here is that the set of people who formulate these elaborate 'rules' are wise in that they know what results in overall good for mankind and what results in downward spiral for mankind (unlike 72 virgin thing). That will drive people who are otherwise without foresight to follow rules." Dasa was not convinced "So you are saying that there are no rewards for good behaviour and no punishments for bad behaviour? How do you explain that some people are born in well to do families and others are born in poor families? Why are some afflicted by disease while others are disease-free?" I knew Dasa was throwing the Karmic philosophy at me. "It's all chance" I replied. "Chance? What do you mean chance?" he asked. "Chance, as in probability. Where a man is born is just a random chance. It's like rolling dice. Whether you get one or six cannot be determined. It's just fate or luck that you are born here or there, and is not driven by your actions. Immunity through heredity is also chance..." I explained.

Dasa began to froth - "So you are saying that there is no driver to do good things. We should just do whatever it is that comes to mind, because if rewards or punishments are chance like dice, why should I even do good things?" I raised my eyes "I already explained that earlier. If you can see the bigger picture, doing good things results in overall development of the world. Doing bad things results in overall destruction of the world. If you help people out, they will help you out too. Good brings good. Bad brings bad... Isn't that Karma? Why does it have to go across life spans?" "But if it is all chance, why is anything good or bad? Who decides what's good or what's bad?" he asked. "That's an excellent question. The answer is society. What's good and what's bad is nothing but a collective decision by everyone. Murder is considered bad because over 90% people believe that it is bad. If over 90% people don't see anything wrong with murder, it will no longer remain a sin or a crime. After all, laws work only because we, a majority of people, believe that this is how things should work. Wise people in the past decided that a certain set of things would lead to development and progress of society and a certain other things would lead to destruction. They formulated them and bound them to heaven and hell"

"Tell me this, do you believe in soul?" I asked him. "Yes, of course I do" he replied. "How many souls are there in this body?" I asked, pointing to myself. "There is only one soul" he replied. "How many souls are in your body?" "Only one..." "So are you saying there is only one soul in a body?" I asked. He thought for a moment and replied "Yes, the soul is required for animation, and only one soul is present per body" he replied. "Alright, how many souls are in a dog?" I asked "Only one!" he said, growing impatient. "How many in a fish?" "One". "Great! Now tell me this, how many souls are present in a starfish?" I asked. "One!" he said. "Ok, but if I cut a starfish's arm, the starfish grows another arm but the arm that was cut develops into a new starfish. If that's the case, what happened in terms of souls? Explain that to me..." I asked. Dasa hesitated for a moment and replied "A soul entered into the arm after it got cut" he replied, though not convinced himself "Are you sure? Do you find that intellectually satisfying?" I asked. Dasa said "Yes, why not?"

"Fair enough... Now tell me, a lizard has a soul too, right?" I asked. "Yes" "But when I step on a lizard's tail, it splits its tail from its body and scurries away. Now the tail itself continues to wiggle for some time and eventually stops... dies... Now explain it to me soul-wise. Do you think the lizard's tail has a soul?" I asked him. "Well, no, of course not" he answered. "According to you, soul is needed for animation. So it *has* to have soul, right?" I asked. "Yes, then maybe a soul entered into the tail, stayed for some time and then left..." he answered, but he was not sure of his answers now.

Facts are facts and we have to acknowledge them, whether you like it or not, because truth is absolute and immutable. You cannot have multiple versions of a fact. For instance, if I say that water is made up of hydrogen and oxygen, then it is an absolute statement... Truth. Fact. Now, the reason for that statement is that there have been numerous experiments with water, splitting into individual components and then proving that the individual components are hydrogen and oxygen. There is a process involved. If you don't believe that Hydrogen and Oxygen make up water, then you are free to prove otherwise...

Religion and spirituality should have a goal. There is no point in following something if there is no goal. The pursuit of religion is for those who seek to know what the ultimate truth is... However, following something shouldn't occlude your mind to facts and truth. If your religion preaches that the earth is in the centre and that the sun goes around, then it is wrong. We know it for a fact. You cannot quote scriptures for that anymore...

There are many complex aspects in the universe, such as life and origins of universe that have still not been explained by pure science. Many people are interested in its pursuit. But what I find amusing is people scoffing at religion simply because they think it is wrong. You cannot say something is wrong if you don't know the right answer. That's like trying to guess if Schrodinger's cat is alive or dead without opening it. People who are pro-religion or pro-science are always telling cat is dead or cat is alive and shouting that the other is wrong while the fact remains that neither knows whether Schrodinger actually put a cat inside the box or not. The correct answer is still out there. If you are right, prove it. People of religion cannot speak in abstract terms and say you are right because what cannot be proved or verified holds no value. I can say I am Batman who fights crime too... But nobody will believe me for they seem like empty words. People of science cannot scoff at the religious for you don't know the truth either. And for all the rationality you claim to have, you should be able to keeo your mind open to that as a possible path to pursue till you find what the right answer is and cannot reject it outright

To summarise, nobody knows squat, everyone argues and people are waging wars in the name of religion. Now that is profound foolishness

Comments from Facebook

Phalgun Guduthur:
Surprising that I finally agree with you on something.

Swathi Sharma:
^ me too.... "To summarise, nobody knows squat, everyone argues and people are waging wars in the name of religion. Now that is profound foolishness" ... but yet Hare Krishna 

Prajwal Sudarshan:
Not Bad Nik..Proud of you. This was not the same person whom i had the conversation with a couple of months ago  good going!

Deepthi Shetty:
Very well written article, Nikhil! 
But one question if I may ask - were you serious on your opinion about karma here or was it just for argument's sake?

Nikhil Baliga:
Prajwal Sudarshan Le nanna magane. It's always been the same. I just like to play a lot of devils advocate :P

Chiranth Ashok:
Something has changed in you. I loved your arguments. I have had similar beliefs for a long time now.

Nikhil Baliga:
Chiranth Ashok Nothing has changed :P wth...

Deepthi Shetty What's your opinion?

Prajwal Sudarshan:
If you say so maga..why were you talking to the dude then?post break up spirituality eh? 

Deepthi Shetty:
Just read your next comment. You were playing the devil's advocate I guess 

Nikhil Baliga: 
:) 

Narayan Jalan:
Got to discover 72 and starfish things in it. ty 

Tejas Dinkar:
Spot on. I've read quite a few of Prabhupadha's shorter books, and basically ISKCON is Christianity with Christ replaced with Krishna.

For example, the play they put on in ISKCON features a man who is a sinner. As he is dying, he calls out to his son, who he named Krishna. After he dies, someone comes to take him to hell. But then Krishna (the god) comes down, and says that as his last words were "Krishna", he will be taken to heaven instead. (this was in 2001, things may have changed since then)

Ganesh Shivaram:
Nikhil Baliga I seriously miss a "super like" button on Facebook. Very well written blog. God and religion are two very complex concepts to explain. Religion for me is a set of ideologies which some feel is right and some feel is wrong. To prove their righteousness people wage war against each other and tag its outcome in the name of religion. I really liked ur concept of karma and its outcome and also your 90% :10% explanation on good vs bad. Even though I liked your analogy on harry potter vs mahabharata, I somehow feel very hard to accept that human ideas/creativity can comeup with kind of teachings inscribed in baghavadgita. It is lot more than a story ( which I am sure u know better than me ). This thought makes me believe that god (krishna) can also exist in the form of a human as described in mahabharata.

Suneel Thummala:
Haha you still remember that play Tejas Dinkar? Nothin like a good old fashioned animatronic indoctrination field trip.

Tejas Dinkar:
Suneel Thummala yeah, that was a crazy play! But I thought it was with puppets :P

Sriranga Chidambara:
Attempts to fit all that's happening around you into one grand theory has so far failed miserably. The only thing I am interested to know from ISKCON fellows is answer to this one question - how do you make such delicious khara pongal? :)

Shantanu Tushar:
Damn, I had a similar discussion with a ISKCON guy, should've turned that into a blog as well :P

Krishna to Nikhil : hush hush, don't tell 'em I'm a lie yet

Saturday, 10 May 2014

Monkey-Wrench: Ultimate Customisation Extension

Swami Nikhilaananda said:
"The simplest of changes become extremely difficult without the right tools"

Monkey-Wrench is a Chrome extension that I built along with Mayur Kataria and Parin Kataria.

The extension allows you to use custom CSS and run custom JavaScript on any website

Overview

There have been numerous instances when we are unhappy with the way some of our favourite sites look like. For instance, Twitter's UI became an eye-sore recently. You might be a good designer or might know a good designer and may want to apply your own styling to make the site look more appealing. How do you go about doing that?

Simple! Just install Monkey-Wrench extension from here. Right click on the extension icon and click on Options. This takes you to the Projects page. Click on New Project, and provide your style and scripts. Click on Run Automatically. That's it!

Non Developers

Non-Developers can also make use of Monkey-Wrench by using our Recipe Bazaar - A repository of scripts shared by the community. Just browse through the scripts and install it to your browser, all from within the extension itself.

Developers & Community

While Monkey-Wrench is very simple to use, we have attached a simple help document to get you started. Click on the ? icon at the top right.

If you are a good designer or developer or have written a very useful piece of code that you would like to share, you can share it right from within the extension to our recipe bazaar. Others can then install it and use it. Alternately, you can also export and import scripts.

With external JS and CSS support, you can use CDNs (like jQuery, font awesome or Google Fonts) as well. The scripts will loaded in the order you provide. Make sure the dependent scripts come lower

What's next?

We intend to improve the recipe bazaar to enable ratings, screenshots, etc. We are currently working on this. If you like the extension or would like to provide feedback, please send an email to baliganikhil  @ gmail.com - Spread the word

Simple Demo





Developers:

@gulagulaananda

Monday, 28 April 2014

Why I don't like Muslims

Swami Gulagulaananda said:
"I call a spade a spade"

If you came to this post by reading the title - You are one of the following:
  • You are seething with anger, wondering what nonsense is written in this post. You are getting worked up and aching to fire up some comments calling me an insensitive bigot, communal and what not. You are also readying some choice expletives
  • You have adopted a holier than thou attitude and are ready to give me advice on how we should all live together happily or throw words such as "I did not expect this from you"
  • You secretly don't like Muslims and are here to read what I have got to say
  • You are still unbiased and are simply curious to read what is in this post
Once you have put yourself in one of those groups, continue reading... Let me clarify at the outset that I just wanted you to realise that we all belong to one of those categories. But tell me, is what I have said here wrong in any way? Isn't it my prerogative to dislike someone or a group of people? And telling it openly like this is freedom of expression, is it not? You have no say in this matter. Why is disliking a group of people wrong? And why is saying it out loud wrong? Are you beginning to hate me now?

And no, I don't dislike Muslims. I have some good friends and colleagues who are Muslims, some who I even look up to. But I would like you to read on because I want to take you through this post. As you read, you will encounter several suggestions or opinions, think of them as thought experiments and not bigoted suggestions. Therefore, for the rest of this post, drop all sense of morality and sentiments and read it strictly with an objective mindset. If you are unable to do it, please discontinue reading.

The elections of 2014 have brought out several hues of the Indian fabric. I noticed a pattern in the elections - What initially started as Narendra Modi vs Rahul Gandhi vs Arvind Kejriwal, soon metamorphosed into Modi vs Anti Modi. I started seeing several patterns and trends. When asked why you don't support Modi, their opinion has always been the same - "He is communal". And no, this is not a post that is going to "debunk myths" about Modi. Rather, I am more interested in discussing bias in the minds of people.

I noticed that people dislike others because of their personalities. Some even openly call names. I find it ludicrous to watch Congress spokespersons addressing Narendra Modi as Shri Narendra Modiji immediately following it with calling him the devil incarnate. So if we are allowed to openly dislike people, hate people and openly call them names, why are we not allowed to, for example, dislike an entire community? Remember, to dislike a community is different from differentiating a community. You are still agitated, I understand, but please bear with me.

I was asked to not say "Blacks" or "Chinese" out loud on a visit to the USA. I said, alright, what should I call them? African Americans is the accepted term? No! Don't say anything out loud, you will be considered racist. What? Why can't I say Chinese out loud? My friend even deleted a comment of mine that said something about Chinese because a Chinese guy was in his thread. My comment wasn't even derogatory, it merely mentioned a fact. Why? Why are we scared to say some things out loud? What's with all this political correctness? Remember, these were factual statements, nothing offensive. An example would be - Local trains in Mumbai are overcrowded.

But people refuse to say some things in public, or even accept them. Like IITs and IIMs. If you call an IITian or a person from an IIM incompetent, it feels like a great sin has been committed. Say something against a religion and you might even be killed. Try convincing about the possibility of existence of God to an atheist and you will be called superstitious. Try convincing about the absence of God to a devout person and he will call you a lost soul. And the media knows about this - Very often, I see headlines on Times of India like - "Dalit girl raped". When you read the actual article, the rape has got nothing to do with the girl being Dalit. However, people get outraged because there is a connotation that she got raped because she is Dalit. This is the way we think.

You are constantly judged by highly opinionated people around you. The other day, I wrote a post asking if homosexuality is natural. One guy went berserk over it, called me a bigot and many names. Why? Am I not allowed to question touchy topics? You can call me a bigot if I refuse to admit someone to a college for being gay or refusing to hire someone for being gay. Would you call me a bigot for not talking to a gay person or not wanting my son to be gay? Think very carefully about how you are approaching this. And no, I don't have issues with anyone being gay, but think about it very carefully. If someone doesn't like his/her son to be gay, would you call him bigoted? If someone doesn't want someone's son or daughter to marry a Hindu or Muslim or Christian, does that make him bigoted?

I don't see what all the fuss about Modi's refusal to wear a skull cap was about. If someone asked me to wear a skull cap, I would refuse too. I once offered a Muslim friend of mine some prasad, and he refused to accept it. I asked him why and he simply nodded his head. I didn't force him, I didn't think he was being anti-Hindu. He wasn't comfortable with it just like I wouldn't be comfortable accepting Christ into my heart or wearing a skull cap. It's not my tradition, to each his own. If you are comfortable, great. But you should not judge someone else. How can you? Why can't people do what they want to or reject what they don't want to? Isn't it a free country? People can probably understand this in the technical sense, yes, Modi could technically reject the cap - but they linked it to him hating Muslims. Why?

The problem with most of us is our inability to think beyond the first layer. Very often, I see people (many Hindus included) calling RSS a saffron terror organisation. Highly communal, you say. Frankly, my dear friend, I would like to ask you a question. Beyond, perhaps, knowing the full form of the organisation, the "fact" that they are a pro-Hindu Muslim-hating Gandhi-killing group of long-shorts wearing people, what else do you know about the RSS? If you know five salient points about them and you still hate them, you probably have a valid reason to hate them. But it is highly unlikely that you know even one point beyond what I have already mentioned. We are all people with preconceived notions who don't research topics.

Let us pause here for a moment and take a quick detour. Facebook, Google and other companies that provide ads for marketing allow you to choose age groups, gender, location etc. to target advertisements. For example, if you are selling digital watches for men and ship only within India, there is no point in showing that ad to a 60 year old woman in California. How do companies ensure targeting happens? They profile everyone. Profiling is very useful to minimise areas and allow targeting to happen successfully. Now let's get back...

I have observed an equivalent of white guilt developing in India among Hindus. For some reason, people are very hesitant to say certain things against Muslims.  I am willing to bet at least 90% of terror attacks are by Muslims. If you don't agree, pull out all terror attacks in the last 15 years, and read the names of the people. They are invariably Muslims. You might be quick to jump out and say "What about Saffron terror? What about Godhra?" That's part of the 10% that includes white supremacists (irrelevant to India) and other attacks. But you have to admit that most of the terror attacks are by Muslims. Now, if you look at the kinds of people who get recruited for terror attacks, they are always the same kinds - Muslim youth, poor, brain-washed - If I can convince someone that their family will be taken care of very well and they are on a holy mission, they will be willing to go to any length. This is how Pakistani terrorists were recruited apparently. If you are already aware of the kind of people who are susceptible to such brain-washing, why can't we use profiling to narrow down possible recruits? But the very idea of people getting discriminated brings out an outrage among people.

If a strictly vegetarian Brahmin family doesn't want to rent out a house to a non-vegetarian Muslim family, is this discrimination against Muslims or discrimination against non-vegetarians? If this family gave the house out for rent to a non-vegetarian Hindu family, then should the Muslims say that they were discriminated against? If the family gives the house for rent to a vegetarian Hindu family, can the non-vegetarian Hindu family say they were discriminated against? The family is allowed to give their house out for rent to whomsoever they please. If you think this is unfair, you should read this post by Sandeep.

Another interesting point to think about it is, why is it that among so many religions like Jainism, Buddhism, Sikhism, etc. the so called issues with "minorities" and so called "secularism issues" is always with Muslims? Several friends of mine on Facebook who are Muslims are sharing photos that are attacking Hinduism, sharing quotes of that moron Zakir Naik - Why? I also see people commenting on various Facebook pages that Shariah law needs to be brought into India and that that is the only solution to all problems.

To summarise, empowered by my freedom of expression, I should be allowed to say whatever it is that I want to say. I don't want to live in an Islamist country like Saudi Arabia where women can't drive and are supposed to wear Burkhas. German chancellor Angela Merkel and UK Prime Minister David Cameron have called their countries Christian. Saudi Arabia, Iran, Pakistan and others are strongly Muslim countries. I want to call India a Hindu country where every other religion is welcome to stay and live with us. Hindus are very tolerant and India will remain a secular Hindu state with no discrimination against any community. Remember, this kind of diversity is possible in India because of tolerance of Hindus. This is my opinion. Vande Mataram, Jai Hind!

Do you believe in secularism?
A lot of people think saying that you are secular is fashionable. If you believe in secularism, you should believe in the following:
  • India should have uniform civil code - same set of laws apply to every citizen, no matter what religion, caste or whatever other differentiating factor you can find. One rule for all
  • Say no to reservations and quotas. You are cheating the bright minds by giving seats and jobs to less deserving people simply because they belong to some caste or religion
  • We need to control population to prevent loss of resources and prevent demographic seige. This needs to be enforced by the government.
  • And spread this openly. It is not okay to believe in something and being quiet about it. True secularism is only when you truly believe everyone is equal and ensure that everyone thinks that way.
Do you think I took freedom of expression too far?
Freedom of Expression - Here's my post that is directly against this one and says you should not say whatever you want to and exercise restraint.

Think I am a bigoted idiot?
Read this story - In my opinion, everyone can easily live together happily if everyone minds their own business. Here's a very inspiring story - A true story about how unity in diversity


Comments from Facebook

Ashok Tripathi:
Hmm.. You will get more brickbats then bouquets for this..

Raveesh Mayya:
Good post Baliga.. I too feel disgusted to think that saying "I'm a Hindu" has been equated to saying "I'm communal"..

Nikhil Baliga:
That's precisely my grouse. Somehow I am made to feel like it is wrong to be Hindu. And I am screwed if I am a Hindu Brahmin boy

Ashok Tripathi:
Screwed royally Hindu Brhamin Boy - you are ancestors are single handedly responsible for all the catastrophes in planet s history from extinction of Dinos to ************************** 

Prashanth Raghu:
Although I do not agree with all the points, I like the fact that you say what's in your mind. Not many people do that. Amazing frank free flow of thoughts.

Prashanth Harshangi:
Baliga- do you like the concept in school where every student had to wear uniform?

Soujanya S Purohit:
Good one!!

Sharath AS:
Just when you were giving an example of Dalit girl being raped!
https://www.facebook.com/photo.php?fbid=10152090554608061&set=p.10152090554608061&type=1

Manohar Kanyady:
People or Govt need to be really matured to act upon it to solve the so called communal tag

Gurudatha Pai: 
Dawkins asks a similar question in some interview about "The God Delusion"!

Dolly Singh:
Nice post nik.. In my opinion there s nothing bad in speaking loud your thoughts. And no one should judge. But it is something like you are calling a blind person blind. It might be offending to them. So if any bitter truth is not helping any one then better to avoid speaking it.

Karan Sharma:
Nikhil Baliga: fair post man. Just a couple of points. 
1) Sorry to hear that you have friends who listen to Zakir Naik. In spite of the moron he is, he serves a very important role. He is the sole Muslim rationalist preacher (if such a thing exists) who doesnt want to kill/murder rest of the world..
2) You mentioned profiling. I'm with you on the fact that nothing wrong in calling a spade a spade. Because thats what it is. The problem lies with what you do with that profiling and the connotations that go with religious and racial profiling. You cannot deny the historical baggage that we all carry.. Whites are sorry they f*cked browns and blacks. Hindus are sorry they f*cked Muslims(and other minorities). Men are sorry they f*cked (not literaly) women historically. Brahmins are sorry they f*cked dalits. 
So basically we live in a world of apologists and not being one lands you in trouble.

Karthik Rangarajan:
"Free speech is not speech you agree with, uttered by someone you admire. It's speech that you find stupid, selfish, dangerous, uninformed or threatening, spoken and sponsored by someone you despise, fear or ridicule. Free speech is unpopular, contentious and sometimes ugly. It reflects a tolerance for differences. If everyone agreed on all things, we wouldn't need it."

(Source here)

First of all, very well written article, my friend. When I looked at the title, I knew it would be an interesting take on things. I expected some hyperbole, and a few flawed arguments. I'm happy that there was very little hyperbole, and almost no flaws in your method of arguing.

So if we are allowed to openly dislike people, hate people and openly call them names, why are we not allowed to, for example, dislike an entire community?

There is a pretty big difference between you or me disliking people/community, and people in power doing so. However, I see your argument, and I agree with the point you're making. As long as your dislike is personal, doesn't affect a third-party negatively, and you do not force others to think your way, you are entitled to have your views.

What? Why can't I say Chinese out loud? My friend even deleted a comment of mine that said something about Chinese because a Chinese guy was in his thread.

This is hyper sensitiveness and bullshittery. I call my Chinese friends Chinese to their face. I call my black friends black, or in more professional settings, African Americans. I call friends from the south hillbillies. As long as there is no malice in what you're saying, and you're saying it with the best of intentions, it really doesn't matter. However, do note that "blackies", "chinkies", etc. are derogatory terms.

If you call an IITian or a person from an IIM incompetent, it feels like a great sin has been committed.

More bullshittery.

Would you call me a bigot for not talking to a gay person or not wanting my son to be gay?

Yes for the first one, no for the second. You are, at the end of the day, making the person feel unwelcome or unwanted. Bigotry has nothing to do with power. You're judging a person because he is different from you, and that, my friend, is the very definition of bigotry.

But why do I saw no for the second one? Because not wanting your son to be gay is perfectly natural. You want your son to meet the expectations you have of him. Now, if you force him to be gay by sending him to a "correctional" school, then you're not just bigoted, but you're cruel and insensitive.

If a strictly vegetarian Brahmin family doesn't want to rent out a house to a non-vegetarian Muslim family, is this discrimination against Muslims or discrimination against non-vegetarians? If this family gave the house out for rent to a non-vegetarian Hindu family, then should the Muslims say that they were discriminated against? If the family gives the house for rent to a vegetarian Hindu family, can the non-vegetarian Hindu family say they were discriminated against? 

Since this is their house, they are free to rent it out to whoever they feel can best maintain their house. The argument for discrimination doesn't even come in here. Unlike in the US, private housing in India does not have to follow equal opportunity laws. (although I am unsure if this is the case in the US either)

Here's one qualm I have with the methodology of argument - you're saying since you have the freedom of expression, you're allowed to state them. However, if your only defense to stating your arguments IS your freedom of expression, then you're argument is on its last crutches. (I do see that you aren't saying that - just a minor comment)

I want to call India a Hindu country where every other religion is welcome to stay and live with us. Hindus are very tolerant and India will remain a secular Hindu state with no discrimination against any community. Remember, this kind of diversity is possible in India because of tolerance of Hindus.

This argument I have many problems with. It might be another part of your thought experiment, but a country cannot be identified by a religion. I have a problem with US Government identifying the country as a Christian state, the Indian government identifying it as a Hindu state, etc. There must always be a separation of religion and state. It is vital for a government to function rationally.

Why do I believe so strongly about this?

You're asking people to think rationally about one thing there is very little rationality about: religion (and/or race). Arguments about these are always going to be heated, mindless, and overdrawn because people believe so passionately that what they think must be the absolute truth. I appreciate your thought experiment and attempts to bring rationality as well as have an open conversation - but religion is not at all rational. Not when we're saying age old texts translated uncounted number of times should be made into laws, that our women must be judged according to it, etc.

But Freedom of Expression! I can say whatever I want!

You can, sure. My government cannot. They absolutely cannot say "we tolerate other religions here because we're Hindus, and we're tolerant." That's giving a pedestal to one religion, and saying the other religions exist in the state because we're so nice and tolerant, and not because they have equal right to stay there since they're citizens with the same, exact rights.

On the other hand, I do agree about the uniform civil code. Secularism isn't about treating one religion better than another, apologizing for what our ancestors might have done oppressing other castes and/or religions, or handling everything with baby gloves. Its about treating all people equally, like they are all citizens of the country, without discrimination, with the same, exact laws. THAT is what is being called as communalism now by the left-leaning parties, and that is utter bullshit. It is high time the country developed a uniform civil code, with merit based reservations versus caste based ones.

Sorry, this was almost as long as a blog post. I rarely participate in these debates for this very reason - most people don't have the patience to read what I have to say, or get bored half way through. :)

Well written article, all the way around. You've done a great job at being unbiased in spite of your strong beliefs in a certain direction.



Sunday, 27 April 2014

Writing games in JavaScript

Swami Nikhilaananda said:
"All work and no play makes Gulagulaananda a dull old man... well duller"

With every passing day, I am beginning to like JavaScript more and more. JavaScript is very easy to learn and with one language, you can write front-end applications, back-end scripts, run servers and even write mobile apps for Android, iOS, Tizen etc. I think that's incredible!

I have written a couple of simple games with JavaScript and thought I should write a post about one of them. So, let's have a look at a simple game I wrote, called Crates.

The objective of the game is simple. There is a "hero", a character you control with the keyboard arrows. There are some crates and some targets (golden balls). The goal is to cover all targets with the crates. The hero can push a single crate but never pull one. Only one crate can be pushed at a time. A crate that is against the wall or another crate cannot be pushed. So it gets tricky when you push crates to some corner.

The game is a clone of the classic 'Box World' that I had played long ago in school. I just wrote this one in JS as an exercise. Let's dissect and see how it was written. I would really appreciate it if you can leave some suggestions at the end.



You can play the game here and find  the source on Github here. (This game isn't really well written, it was written in a great hurry. But the concepts in this post are sound, and I would like you to look at it, rather than the source code of crates. I would recommend looking at the source code of MemBlock instead.)

Everything is a matrix
One of the main reasons I loved Matlab in college was that everything was a matrix. It was like some deep philosophical thing - everything is Brahman. An image can be represented as a matrix, with each point being a number in the matrix and the value being the intensity. RGB frames in colour images are three matrices, all within one matrix. Sound can be represented as a matrix. Basically, everything is a matrix.

Keeping that in mind, I like to see games as matrices. If a particular cell has 0, it translates to a wall. If a cell has 1, it translates to grass. If it is 4, it translates to the hero, and so on. So a simple matrix like this represents a hero standing with grass on one side and a wall on the other:
[0, 4, 1]

Next, we have to use some syntactic sugar. What this means is that, we don't want to use numbers like 0, 1 etc. in our code to make comparisons. While you might understand this while writing code, you will never understand it a month later. Imagine seeing this piece of code:
if (matrix[i][j] == 3)

What's 3? Therefore, let's define variables like:
var WALL = 0;
So that we can make comparisons like:
if (matrix[i][j] == WALL)
you will know what you are doing.

Models and Views?
Once we have defined what each number in a matrix means, we have to write a very important function - a rendering function. This function essentially translates changes in the matrix to changes on screen. What does this mean? This is exactly along the lines of MVC, where the matrix is your model, and the graphics you see on the screen is the view. Changing the matrix behind the scenes changes the model, but someone has to change the view. So you have two options here - Either use some kind of an MVC framework that does this automatically for you, such as AngularJS, etc. (which in my opinion, is an overkill for simple games) or write your own rendering function.

Personally, I write my own simple functions for rendering - I call it draw_map(). The draw_map function simply reads the matrix and draws the map, period. In this function, you can represent the numbers by some graphics. Keep all your images in some folder called assets.

Let's move (on)
Next, we need to be able to read input from the user - Just bind keypress or keydown event to the document or window, check if the input key is one among the ones that you want. Otherwise, simply discard it. Again, use some syntactic sugar for key codes.
var LEFT_ARROW = 37;
var RIGHT_ARROW = 39;
var UP_ARROW = 38;
var DOWN_ARROW = 40;
The fact that JavaScript is an event based language makes it great for games!
Logic
Then comes the important part of the game - The logic. Depending on the key code, check if the move is valid by validating it against the matrix. If it is valid, change the matrix and call the draw map function. If it is not valid, either reject it, or indicate it to the user with a subtle 'invalid move'. Always remember that all changes should be made only to the matrix and no DOM changes should be made whatsoever. So, if you want to increase or decrease points, do it by altering the variable. But the actual display of the score on screen should be done by the rendering function.

What next?
That's it! You are done with the game. However, games such as these are only as fun as the number of levels in it. You can build only as many levels. To take it to the next level, would be to create a simple game world creator so that your users can design levels and share it with others. The game designer uses the same rendering function, and with some small alterations, a lot of code can be reused. Ensure that the user can play and test out the games she has created. Once that is done, and the game gets validated, enable upload and sharing of the game. Check out Crate's "Create a world" section. It allows you to create worlds and test it, but the publish feature as of now is not linked to any backend servers for persistence. It instead simply spits out a matrix when you "Return to game design" that you can mail to me.

Can this be improved further?
The answer, according to me, is a resounding yes. A lot of games can be made using this matrix concept, and there are a lot of similarities among these games. The ability to create worlds, uploading and reading games created by others can be the same across games. So, it should be possible to create some kind of a game framework around this. If anyone is interested in building this with me, please let me know.

Many games such as pacman, NumArrange (uses AngularJS), MemBlock use matrices. Think of other games that can be built using matrices

The other way of building a game would be using classes and objects. Perhaps there will be another post about that.

Recommended Posts
I would like to highly recommend by friend Niyaz's post on how to write a chess game in JavaScript - I think he uses the same method.

Thursday, 13 March 2014

Company, Politics and The Human Body

Swami Gulagulaananda said:
"You can't negotiate with, threaten or blackmail a person who has nothing to lose"

If you observe, you'll see several similarities between a company and the human body. Just like organ systems, you have teams. And just like complicated interactions among organ systems, you have interactions among teams. All these interactions need to happen very smoothly. The final objective is the survival and growth of the overall entity - The company or the body.

I remember an old story, perhaps from Aesop's Fables - Where all the organs fight among themselves. The heart says it is the greatest, for it helps pump blood all over the place. Without blood, what can you do? The stomach says that it is the greatest, for it digests food and gives energy. Without energy, the heart cannot pump. The limbs say they are the greatest, for they get food - without which you can't digest. The brain says that it is the greatest for making all of this possible, and so on. They all get angry and decide to stop working. The man dies... And along with him, they all do too. The moral of the story is simple. Every one of those organs are important, and every one of those organs are interdependent. Even if one fails, the major entity fails.

Companies are exactly like that - Every team is equally important for the smooth working of the organisation. If one of them fails, then the major entity works. Therefore, it becomes important that everybody works for the success of the entity.

You are often asked not to exercise after eating food. Why do you think that is? Blood is an important resource, but the body has only a certain amount of blood. When you run, your muscles need blood to be supplied to it. When your food is getting digested, blood needs to be supplied to it. If you have two operations at the same time, and a limited resource, one of the two systems will fail - Either you get muscle cramps or you will vomit. Either case, there is damage. It is the same with companies - You cannot drive resources beyond a certain point - It leads to issues.

Another point about companies that everyone needs to remember, is that it is nobody's personal fiefdom. Everybody's goal should be similar, betterment of the organisation, for only that will improve everyone's position even within. The same is the case about a country. If politicians treat their areas as their personal fiefdom, the country will never prosper.

All employees work for one or more of the following

  • Salary - obvious reason, and want it to grow continuously
  • Position - so that there is a sense of growth
  • Self worth - They appreciate themselves and feel they are contributing
  • Recognition - They feel good when others appreciate them
A person who does not get at least one of the above four will start showing tendencies of changing jobs. A person who doesn't get any of the above four will definitely quit.

If you make a person do something against his will, he will begin to treat his work like a job - where it simply becomes a task for him to complete and get done with. He will stop being passionate and you will notice a growing sense of frustration in him. This is especially true with creative teams where any attempts to stifle creativity will result in absurdly poor outputs.

If clear lines of hierarchy are not marked, there is a tendency for interference. Imagine the lungs digesting food. You instinctively know that it will not result in anything good. If these things are not clearly defined, especially at times when there is a growing sense of resentment, things will begin to snowball. These are all subtle things that are happening around you all the time, and you will begin to see them clearly with every passing day if you stop and pay some attention.

I believe that start ups should etch these thoughts into their core. Start ups are organisations where teams should work smoothly together. If at any point of time people forget that and try to intimidate others by marking people in "cc" and think that this is going to get things done, they ought to be thoroughly reprimanded for these actions, for it is against the very principle of a start up - A start up is an organisation where people will work very hard to get things done because they want to do a good job at the end of the day, not because they are scared.

To summarise, the more ego you have, lesser the respect you get. People might smile on your face, but all that is just that - smile in front of you. Don't take bullshit and don't give bullshit. Work to deliver the best possible output. And mind your business. Do this well, and you will be rewarded. You should... Otherwise, there are plenty of other companies out there and plenty of other people out there. Good luck...

You might also like to read:

Monday, 10 March 2014

Of approach to problems

Swami Gulagulaananda said:
"Think like a child"

The problem with most techies is that we tend to seek out tech solutions for all problems. I don't blame technologists for this - I think this is a general problem. Just to explain in a clearer fashion, here is an old story I had read a long time back.

There was a soap factory that had large machines that would do everything end to end - from manufacturing soaps, to making bars of them and putting them in boxes. They would run over conveyor belts. Now it so happened that occasionally there would be one empty box that would slip into the lot and that would create problems - You can't sell an empty box. Now where was this error? And how would you exactly debug and fix this? I actually asked this question to a bunch of people and typically you would approach this like a tech issue - Probably some counter was wrong, or try to figure out and see if there is a pattern in the empty boxes - that would give you a clue. How did the company resolve this? They kept a table fan close to the conveyor belt - All the empty boxes would get blown away by the wind and the boxes with soap were too heavy to get blown away...

I am sure you would appreciate the simplicity of the solution. Surely some of you might scoff at it saying that it is not really resolving the "main issue" - But I would like to ask you - is solving the original bug really the main issue? Of course, this solution looks like a hack - But it is effectively solving the problem and at the end of the day, that's what we want. The empty soap boxes are not really a waste. It's cheaper and faster. I think that's what we should try to aim at rather than being purists of sorts.

I was thinking of this lately because of what happened at work recently. We have a bunch of barcode readers which are attached to tablets. It so happens that tablets work with one input device at a time. That means, if you have a barcode reader attached, your native keyboard gets disabled. Which is fine, you might think - the problem is, at times, some barcodes don't get scanned. So if that happens, you have to type it manually. But there's no keyboard remember? So what do you do? You detach the scanner, type in manually and reattach the scanner. But when this happens once in every few minutes, the performance drops greatly. Plus, you risk ruining your USB to micro USB adapter.

What's the solution to this problem? My approach to this problem was to create our own keyboard as a replacement. Next to the textbox, a small keyboard icon is placed. You scan normally - and in the event your barcode doesn't get read, you tap on the icon and our own keyboard appears instead of the custom keyboard. You type in and voila! You are done!

As part of this idea, I wrote a small piece of code called ngKeyboard that you can check out here.

When I told this to my boss, he said that the problem could have been resolved by making barcodes bigger. Now this is where the difference in thought comes - You see, in my approach, the problem statement of the barcode being of a particular size was frozen and I was trying to bring about a solution to fix  the issue. The barcode size could have been altered as well - but I didn't think in that direction. This is what happens to most of us. We assume many things.

In fact, my friend was trying to automate a printer setting to make something appear a certain size. He was trying to figure out how to get around browser settings. The solution finally was to adjust our own data instead. We forget the simplest solutions because we tend to apply tech all the time.

And this happens all the time - In fact, my car keeps losing air in the two tyres on the left. The right ones are about 30 (max being 32) but the left ones reach 17-18 all the time. I wondered why that happens. I thought, do I try to avoid potholes and don't let my end go over them while not caring much about the other side because it doesn't affect anyone that much? I was talking about this to my colleague and he asked me - What if someone is releasing air from the tyres? It so happens that there are some miscreants who are letting air out of tyres near my office. Data insufficiency?

The more we learn, the more we try to fit something that we see around around things that we already know. If I ask you why something happened, you will try to explain it with things that you already know. It's great that way - If you don't know something for a fact, you will still try to explain it by extrapolating, maybe... But, in a way, that limits our abilities to think in a radically different way. The other day, I was talking to my friend about how creative children are, because  they don't care about feasibility. How do you fix parking problems? Tie them to floating balloons and they will float in the air - This way of thinking will be completely disregarded by adults. Not feasible, you would say. Too expensive, you would say or anything else. The more you learn, the more experience you gain, the less willing you will be to venture out into the unknown. Our approaches begin to show heavy bias - Like tech people tend to think everything in terms of tech. I am reminded of Bohr's barometer story in this regard.

To summarise, before solving a problem, make sure you think more widely than the problem statement itself - because very often, a solution can be much simpler if you look at it from a little further behind. And don't get biased by technology or any other field - That will help you think in a much clearer way. Lastly, think like a child - You will see that your imagination will let you come up with more awesome things than you think you are capable of.