The Ryan School Tragedy and Human Apathy

The horrifying incident which happened in Ryan International School last week has caught the attention of entire country.

(A student of 2nd grade ‘Pradyumn’ was murdered by a bus conductor after a molestation attempt)

Parents are in shock, school management is silent, politicians are calculating opportunities and media is simply unstoppable.
Demonstrations have started against the management and parents have asked for CBI probe.

News anchors reached on the spot, diligently showed the pictures of blood rotting on the floor and the walls and heavy debate is happening on what went wrong.

Interestingly, ( or rather shockingly ), most of these analysts have quickly reached the eventual conclusion that it was a flaw in the formal security setup that resulted in this murder. The so-called guidelines have not been followed thoroughly and also, the guidelines are not enough. We need more guidelines, more thorough background check-ups, tighter government and a national list of sex-offenders.

Rewind a few weeks earlier and exactly same demands were presented when Dera Sachha Sauda followers rampaged Haryana (with ~30 people dead). We need bulletproof security, vigilant government, diligent police, etc, etc.

Rewind a few weeks more earlier and exactly same questions were raised when the heartening Gorakhpur hospital tragedy happened. Government failure, Infra mismanagement etc, etc.

I am sorry but I find each and every one of these speculations, rather insufficient, superficial and digressive.

Yes, security, infrastructure, diligence are functional and practical needs to be met with blood and sweat. But can they ever be enough?

How many CCTVs can the government put, how many schools, routes, vehicles can they cover and where?

How many people can we profile? Drivers, Maids, Relatives, Neighbors, Parents !! ?

When the entire society has become inhuman, is it a problem of infrastructural deficiency anymore?

Instead of getting lost in the deluge of arguments, proofs, media dare, guidelines, etc, we have to regain our focus on our daily selves and ask the truly relevant questions.

So, what is the root cause of all these incidences? Isn’t it the gradual ‘desensitization’ of entire society?

We are searching for solutions without even trying to understand the problem here.

Murder of an innocent child out of someone’s perversion is a serious psychological challenge that life has thrown on society, a wake up call, and we are simply fooling ourselves by placing all the onus on security and governments.

We need to find out the reason for this disease of desensitization, which is spreading like epidemic in entire human consciousness.

Why one human being thinks that he can go over the board and use another human being for his/her selfish perversions? We need to understand this unnatural damage that is taking place in all human relationships, this daily violence which we are ignoring and accepting as norm everywhere – call it road rage, domestic violence, human trade, war, nationalism or by any other name.

Is this our true eventual human nature which is showing up slowly or have we moved away from our true nature of love & compassion ?

Why are we becoming so insensitive to everything and everyone around us. Isn’t this insensitivity itself a form of ‘death’, a murder ?

Are we running away from a thorough discussion because we ourselves have contributed to these perversions?

We need to find out for ourselves, aren’t we also, in our own capacity, responsible for this insensitivity when we become selfish, greedy, corrupt and individualistic ?

Isn’t it the overly sensational life that each and everyone of us is seeking that is making our mind mechanical and lifeless, insensitive?

Be it violent cinema, pornography, consumerism, power or greed, everything that we are touching is destroying us in one way or another.

This immense problem of human insensitivity can never be solved by sentimentality, candle marches and media blabber nor can we put this responsibility on  structures like governments, politicians and societies which are simply our own reflections and equally inhuman. it is our daily problem and we have to be very serious about it.
We have to learn the very art of balancing between sensible and sensational living, what is human and inhuman, recognising are we hurting the human dignity by our actions?

And the very first step to go into it is to recognize and accept that these incidents are not formal, structural or  security failures but clear “psychological issues“.

Then we have to understand the nature of “relationship” that each human being should have or not have with each other and what is creating this isolation and indifference?
Then we need to also understand what is “human dignity” and reject each and every action that treads on it.

We have to reject societal norms which create divides between human beings, organized religions and authorities which are making zombies out of us by prescribing us the right way of living and preventing us from true enquiries into our minds, thoughts and actions.

I am no intellectual nor I have any interest in any kid of moral policing. But, I don’t believe any person looking to understand and solve this mess can afford to bypass these obvious complexities, which are fundamental to various crimes and insane, neurotic behaviors.

We are spending lot of energy in speculations and utopian (bulletproof security?) solutions but what is fundamental, the core issue is still untouched.
Instead of applying all this mechanical and reactionary intelligence of analysis, blame, statistics and stupidity, we have to awaken a deeper intelligence in us which is comprehensive, capable, factual and truly logical (which encompasses human dignity). And I believe, it is the most urgent need.

Otherwise, we are just waiting for one calamity after another.

If my reasons are looking impractical and absurd, I want to know what is the alternative? Either we can go on living like we are, or we can change. A change, which is not one more absurd jump from one solution to another but rather an awakening, arising our of self-knowledge and self-awareness.


How to respond to Violence?

Often, in our daily life, we come across this challenge of violence, where we end up making a choice on how to react in the face of violence.
Should we react violently (i.e tit for tat) or should we respond with (Gandhian) non-violence.

How will I respond if someone behaves with me violently? Should I also be violent?

I think the answer to that question purely depends upon my current psychological conditioning. If I am a violent person, that is I am conditioned into violence by society, peers and various theories, I will respond violently, if I am rather meek, I may chose the route to run, if I am confused, I can respond eitherwise.

The often made mistake here is to look for yes or no kind of answers.

We try to get to the answer to this highly complex question by reading theories, looking towards authorities, ways of society (parents, neighbors etc) and use what we best connect with. I think this whole process of coming towards the answer to above question is an unproductive exercise and whatever conclusion we derive (be or not be violent) is not going to hold strong as it is unintelligent. Any answer which comes out of verbal/analytica intelligence can never meet a challenge which is deeply psychological. The clarity required should come from inside directly.

Instead, a more prominent question should be – what to do in the episodes between Violence?

All of us also go through times when we don’t face lot of violence (as an individual or entity). What we do during this interval is going to have very deep impact on the further events of violence and how we handle them.

Should we keep preparing ourselves to face the eventual violence by others by strengthening us more and more?
Develop more defend and attack capabilities?
Develop communities of like-minded and like-biased people?
Keep analyzing all the war stories – good and bad, heroes and villains?
Keep taking sides?

Or, there is something else that we can do?

I think, in the episodes of piece we should try to get a very very close understanding of violence, not theories but direct psychological clarity, which will automatically take care of future decisions on how to act when faced with violence

What is violence psychologically?
Are the people against whom we act violently any different from us? If both we & them are equally unsettled by violence, won’t discussions make more sense?
How does the violence affect (Human) Dignity?
What is inside us that craves violence?
How did we feel when we were a victim of violence and would I like to subject someone else to similar crisis?
Is my violence natural or am I conditioned by society into accepting violence? Am I violence by very nature (by very birth) or people around me have systematically de-sensitized me into being violent?
Do I have any clarity firsthand or am I only acting second-hand as what I am being told/directed by various leaders, organisations etc?
Do I even realise that I am being violent when I am being rude, sarcastic, dominating, ambitious etc?
Am I violent out of need or greed?
Do I feel insecure which make me violent?

Violence is essentially a disturbance, which directly hurts the dignity of the victim. Whether it happens in the name of discipline, or whether it happens in the name of self-defense, whether it happens in very close relationships (husband-wife, parents-children) or far-off relationships( states, countries), whether it is physical or subtle, the marks of violence have left the whole of humanity only with tears and pain.

Unless, we realise this, we will keep becoming both perpetrators and victims to violence.

If we keep acting out of our shallow self interests, whether in the name of identity, language power, politics, nationalism, language, power, greed, we may have all the justifications behind us based on our religion, spiritualities, history, etc but we are still going to be confused and shallow.

There is only one yardstick that we can use to weigh all our actions – Human Dignity

And that is the only guiding light in this mad and confused world. We need to understand what human dignity is and preserve it at all costs which requires giving serious attention and self-knowledge. Without that we are very very dangerous beings.

LOGIC – A Fresh Look


We are undergoing an immense confusion and chaos in our daily life. Chaos, in our thoughts, in our society, relationships, nationalism, identities, religious life.

This confusion results into a painful disturbance causing colossal conflicts in our mind, desensitising us, leaving us with no energy and sensitivity, depriving us of love and compensation, which are essential for a comprehensive living.

Confusion breeds more confusion and we end up chasing illusionary ideas, ideals & ideologies hoping that they will help us get clarity of thought and provide us a stability, individualy, as well as, as a society. This immediately makes us a bait in the hands of manipualtive, conditioned people who start selling us illusions in the name of holiness & religion, power control, money and what not.

Herein, I am trying to start a discussion on some of these topics, which I believe, can help all of us in taking better decisions, see the difference between a fact and an illusions.

Let us start the discussion with an important topic – LOGIC

The topic of LOGIC is important in itself, as we generally take actions or are driven to action by others, based on the logical appeal of an idea or an ideology. Herein, we will try to cover some aspects of LOGIC, by going a bit deeper into its construction, contextual implications and the various psychological ramifications of logic.

We will not go into various theoretical establishments on Logic but rather apply our own selves and see how far we can go.

What is Logic?

Or rather, When can we say we are being Logical?

A Logical movement, is essentially a movement, in which thought is comprehensively able to put all the pieces of a puzzle together. That is, When thought evaluates an idea or an action as being Fact driven, Unbiased and Unconditioned, Aligned with the intented goal, probably we can say that the idea or action seems Logical.

Example – Is Secularism logical way of living?

To answer the above question, we need to answer these questions.

  • Can secularism, factually, leads to its intended goals? Respect, peace & acceptance for all religions?
  • Historically, has secualrism created everlasting peace?
  • Is secularism a natural way of living or have we adopted it out of conditioning? That is, have we adopted it effortlessly, without any intelligence because our constitution, schools and various establishments have taught us about secualarism or do we actually see the truth of peace through secularism directly?

I will try to answer the above questions later, but I hope you got the idea and intent of the discussion.

Going through various stories, incidents and articles on internet everyday, I believe, we all came across various discussions and comments from people, who believe, they are logical in their approach and still, everything around us seems illogical.

Next, let us go around some of the “patterns” commonly used by people to claim logical-ness of their views/statements.

Transactional logic
1) Transactional Logic
If an idea has both cause and effect highlighted, we readily take it to be logical.
Example –
i. “ Global warming is increasing resulting in reduced rains  Bangalore year by year ” (That simple?)
ii. “ You committed atrocious acts in your last life and hence you are suffering now ”  (Any proofs?)
iii. “ I worked hard, hence got success ” (Luck? Silver Spoons?)
2) Grammatical Logic  (Arguing for the sake of arguing)
Sometimes, people say something which is just syntactically correct and expect it to be taken as logical.
Examples –
Boss : “You are late for cooking.” Servant: “My dishes are always perfect” (any relation?)
3) Storytelling Logic (Danger)
Just because some one puts an effort to create an end to end story around an idea or ideology, does not mean that the story is logical. Psychologically, we are very susceptible to giving up our defenses and adopt an idea, if it is presented as a story in the form of a movie, book, novel, presentation, or sometimes just a one-liner
i.  All children bedtime stories.
ii. Mein Kamph – The presentation of Jews as inferior race compared to Aryans through maze of arguments
iii. History Stories – Various stories presented in epic books like Mahabharata etc, with projected heroes & villains. our acceptance of heroes, morality & authority etc is instant.


Psychological Logic
– Punishment
Appeals to someones innate sense of insecurity and forces him to act out of fear rather than need or true alignment of values. Taught all the way through schools.
– Ideology / Mass support based logic
Democracy/ Communism / Religious dogmas. Taking advantage of confusion of people at large, new ideas and ideologies are presented as a logical alternative. The complexity of ideas and authoritative attitudes of people fool people into believing into the veracity of ideologies.
– Imitation
Example based logic. My father did something and got success. So, should/would

Emotional logic:
This kind of logic generally takes advantage of the fact that psychological constructs like Pride and Attachment have daily acceptance in people and meet with minimum backlash. However, it is time that instead of accepting an ideas as logical because it safeguards our pride and respect, we should first go deeper into the concepts like pride, respect and attachment and find out if these construct are in line with basic human values and dignity or we accept them simply out of social and physiological conditionings
– Pride
– Respect
– Identity Consciousness
– Attachment

Sensational logic
– violence – revenge/ragging – In the heat of anger, revenge seems most logical way out. But is it?


Our ego (which is a set of thoughts out of control) tries hard to switch off all logical buttons by making us unaware / incomprehensive / gratifications/sensations  and other innumerable tricks.

How to know if you are being illogical?
By Motive : If there is a bias, a motive behind accepting an idea as logical, where motive can be any self-centred activity or construct – insecurity, greed, fear, etc – then probably we are not being truly logical
Mind without Heart : If an idea is purely a materialistic movement (like punishment) which does not take human dignity into account, that is an idea which does not give compassion any chance, then that idea or ideology is only a business deal, and hence illogical. Guiding Factor for logic has to be “Dignity”, which we will cover in a later article

Obviously illogical
– beliefs
– superstitions
– actions out of insecurity

How to be watchful?
If the proponents of logic exhibit below tactics, I believe, the logical aspect of an idea has to be carefully evaluated:
– Incessant rationalizations
– Hiding behind quotes from books and authorities
– Refraining from discussing compassion

What is True Logic and can it ever surface?
For True Logic to appear, we need to give up our conditionings, biases, self-interests and apply our human side – love and compassion

Our small case study – Secularism

I briefly mentioned above about Secualrism. Let us try to see what secularism consists of and whether it is feasible.

Secularism essentially states – Respect (and tolerate) beliefs from other religions and expressions of those beliefs.

A belief is essentially an idea which can not be proven. By its very definition, harnessing beliefs is a dangerous exercise. Why? Because it can grow in any direction. Since, evidence and proof of belief is not required, any supposed authority can issue a belief-based statement as a fact and expect it to be accepted. Considering the endless imaginary powers of human beings, books after books can be written and have been written on ways to reach God, behave, morality and what not !!

God is a male figure, Heaven and Hell, Stories in Puranans etc……..

The ony way out of this intricate mess is : To not have any beliefs

Which means, we should understand why we have so many beliefs & superstitions. The answer essentially lies in : Insecurity

if we reach the above conclusion, I think we will also find a way to get over it without creating beliefs after beliefs.

To accept expressions of belief by others (Secularism) may be a stop-gap arrangement, but it is “illogical” and a failure-in-waiting inspite of all the efforts put by constitution, governments etc. Because acceptance has limits. I may find it unacceptable if someone builds structures of prayers (temples, mosques etc), another may fina it unacceptable if someone chants prayers from otherreligions and another may find it unacceptable if his children just come know about other religions.

Beliefs, by very definition, are designed to clash. Whether they are relgious beliefs, ideological beliefs or philosophical beliefs.

An intelligent man can solve the problem of beliefs only by giving beliefs up completely. And that would be the most LOGICAL thing

What do you think?

Note: This article is work in progress and will be updated


Retry decorator with whitelisted exceptions in Python

Wondering how to retry a function in python, even if it complains with exceptions?

I created a retry decorator which will help a function get called multiple times even if a set of exceptions are thrown.

The decorator will

  • Catch the exceptions if thrown and retry the function
  • Introduce a delay specified between successive calls
  • Eventually (after the last retry), throw the exception if the function keeps on throwing the exception after multiple retries

Scenarios – This decorator can come handy if you are trying to write some kind of file downloader form certain api where read/connect timeouts may occur.


Here it is:

def retry(exceptions, delay=0, times=2):
    A decorator for retrying a function call with a specified delay in case of a set of exceptions

    Parameter List
    :param exceptions:  A tuple of all exceptions that need to be caught for retry
                                        e.g. retry(exception_list = (Timeout, Readtimeout))
    :param delay: Amount of delay (seconds) needed between successive retries.
    :param times: no of times the function should be retried

    def outer_wrapper(function):
        def inner_wrapper(*args, **kwargs):
            final_excep = None  
            for counter in xrange(times):
                if counter > 0:
                final_excep = None
                    value = function(*args, **kwargs)
                    return value
                except (exceptions) as e:
                    final_excep = e
                    pass #or log it

            if final_excep is not None:
                raise final_excep
        return inner_wrapper
    return outer_wrapper
@retry(exceptions=(TimeoutError, ConnectTimeoutError), delay=0, times=3)
def download_gd_file():

#Note – The exception names above are symbolic 🙂

Hope you find it useful 😀

How we talk – Analysis

All of us talk.

Some of us talk more, some of us talk less.

Out talks contain words (some numbers) organized in some grammatically sensible arrangement.

So, what does it take to understand the triggers of our talks, and what exactly would be required to build, lets say, a perfect chatbot, which can talk on its own.

Let us pull down, from perfect chatbot, to semi-perfect chatbot.

By semi-perfect, I imply an chatbot which can actually talk without looking completely foolish, but it may not be correct factually.

So, if I ask the robot:

Me: Whats up?

The robot may reply:

Robot: I am swimming

Obviously, the chatbot is lying. Actually, he is just uttering anything.

The main point is what does it take to build a bot that, inspite of all its deficiencies, can still make some sense?

I am partly inspired by Her

Let us analyze 🙂

Chat transcript (fake)

P 1 : How are you doing?

P 2 : I am doing fine.

P 1 : So, where are you these days?

P 2: I am in Bangalore?

P 1: Which company are you working in?

P 2: I am working in Cisco

P 1: How is work?

P 2: Work is good. I am looking for change though. Let me forward my resume to you. You are working in Microsoft, right? Btw, I am now working in Sales.


The above chat is pretty common kind of chat. But question is how it begins, and where it starts.

How does P 1 know how to start the talk?

He could have said so many things like :

  • Good morning
  • Hey dude
  • Long time

So, what made him chose the sentence “how are you doing?”

So, there is an implicit context here.

Probably, P 1 met P 2 after a long time, so, he wanted to catch up with P 2, and so he asked him the above question.

Also, P 1 wanted to start the talk with a correct statement for which his mind is “trained”. The correct statements to start a talk are generally greetings like “Good Morning” or questions “Whats up”, “How are you doing?”

Also, it is quiet easy to see that different kind of people will stick with different kind of statements to begin a talk. Something they get comfortable with, and find that useful.

Important point to note here is : P 1 did not manually sort all the words that he knew and combined them to create the above statement.

He just knew that statement upfront, because he has seen many people use that statement and he has practised it so many times.

So, essentially, P1 has lot of ready-made statements in his mind which he could have used. What he did is , he just found out the correct templated based on the context and used it. We generally never try to come up with something completely new in conversations. In writing, we may do, but in conversations (where time to think is limited), we generally tend to chose the correct template and fill it. This, in my mind, is the major difference between, writing and talking.

Though, it can be argued that writing is also heavily template based, but I hope you see ths point here.

The contexts which P 1 would have used to come with the above template would be like:

  • Time-gap between P1 and P2
  • State of conversation (beginning, middle, end)
  • Closeness between P1 and P2 (level of formality that they need to maintain)

So, this is what we are doing, while initiating a talk:

  • Decide which template to use to begin talking based on contexts
  • Use the template and fill it appropriately with correct data (comprised of facts and contexts)

Let me details the 2nd point a bit more.

Once P1 decides on the template he wants to use, he needs to fill it appropriately, with correct grammar (conversational grammar), facts, and contexts.

Examples :

Template 1: Hey <Person>, <Status Question>

Filling : Hey John, How are you doing?

The mind can dynamically form templates based on past experiences of statements. The complete mechanism in which mind works to convert a statement into temlate and then back to another statement is, out of scope for ths blog, but lets keep it simple.

Our brain has a database of past sentences which have contexts tagged with them.

Our brain finds the appropriate sentence based on correct context, practices (frequency of usage of those templates and their success) and fills them.

Anatomy of a template:

The usable template basically consists of lot of “fill in the blanks”.

These blanks are dynamically filled.

These blanks can be filled with:

  • Names (person,location,thing)
  • Facts (working in Cisco)
  • Contexts (Gender,Location,Interaction History)

The template itself can be of various types like:

  • Greeting (Hello Sir)
  • Assertion  (Our company is doing fantastic in Machine Learning)
  • Interrogation (Would you like to buy the software for NLP? )

1) Interrogation Template:

Hi <GenderBasedAddress>, <ContextualQuestion>

Hi Sir, <Context=ProductEnquiry,Question>

Hi Sir, <Context=Product:iphone6,about:usage;   Question: Have you used <product>>

Hi Sir, Have you used Iphone6 ?

2) Assetion Template:

I <Fact>

I <WorkRelatedFact>

I <VerbTemplate Context:Work><Company>

I work in <Company>

I work in Cisco

Needless to say, the generalization of contexts is a very very heavy exercise and it can require excessive amount of memory and training to come up with all possible grammatical constructs, correct templates out of them etc.

But, at current times, where memory and speed are enromous, above problem can be solved to a good extent.

But the most difficult issue would be: Identification of all applicable contexts.

This is where human brain with all its learning powers, sensory and cognitive perceptions, can never be paralleled by a machine, which is why no artificial intelligence would be able to create the perfect chatbot.

But for fun, lets say, we want to create an intelligent chatbot, what can we do? Given the ruthlessness of human beings :D, if we want to spend sometime talking to a pretty chatbot, what all will it take to create one, which may not be perfect, but which can atleast surprise us by saying things we didn’t expect.

How to create a good friendly chatbot:

I think we can do the following:

  1. Create the above templatisation (fill-in-the-blank) model
  2. Train a computer with lots and lots and lots of conversations. So, it can create enormous number of templates. (This is again limited by the fact that there is no public dump of conversations on internet anywhere 🙁 concerning the privacy issues involved. The best that can be done probably is to train the bot using all the chats that you have done yourself).
  3. Use randomness effectively.
  4. Reduce Randomness

On the 3rd point (Use Randomness), what it means, if the computer finds multiple templates, program it to randomly select one.

If it does not find a fact, program it to fill a random fact.

E.G. Template is : I love <Noun>

And the program does not know which noun to fil in the above template.

Find a random noun (from list of places,persons), and fill above template

So, it may fill like. “I love Jamaica” !

So, the chat may go like:

P 1 : Which food do you love?

Bot : I love Jamaica

Weird but fun!!

On fourth point (Reduce randomness), following tricks can be applied.

Program the computer to link various facts, phrases and contexts.

Now this step can be extensively memory burning.

But if done correctly, you may be able to do something like:

Get all nouns which are linked with Food.

And the program may return list of food items.

And the chat all of a sudden may look more interesting..!!

P 1 : Which food do you love?

Bot : I love Chinese

Well, the last step (reduce randomness) is much easier said than done, but nonethless possible.

All the while, while analyzing P1, we forgot to notice P2, who also contrubuted a lot.

What I am saying is, in a conversation, 2 people are present (generally), which is important.

The converstaions generally go like this ->

p1 : Statement 1

p2 : Statement 2 (Response to Statement 1)

P1: Statement 3 = Change the topic (If uncomfortable with Statement 2 😀 )

P2 : Statement 4 (Response to Statement 3 or Change the topic again)

So, in a conversation, all statements are essentialy a response to earlier statement or they start something new (or partially new).

This concept is essential to understand and create a good autobot.

The computer needs to understand which kind of Response-template is correct for a given Statement-Template

Change-The-Topic or Start-A-New-Topic is again something which computers would find hard to do. But, we can again use semi-randomness here. Essentially, we can program the computer to just select a random topic (from list of topics) , find a random template, and fill the template using words/phrases related to the topic.

Wow ! It will be weird but exceptional fun !!

Tools : The main tools and resources that we can use here are :

  • NLP tools like OpenNLP to derive the templates
  • Statistical Regression Models to validate which templates get more success
  • Dictionary to autofill phrases with correct words
  • A database for storing linked facts and the contexts in which they are linked
  • Randomness

For simplification, a chat context may be defined to comprise of

  • Person Attributes (Gender,Name,Height etc)
  • Environment (Time, Location, Weather)
  • Facts in Triples : (Subj Pred Obj -> John eats Banana, iphone related-to phone)

P.S. – I am planning to make a chatbot sometimes in future, for fun.

P.S.2 – All views mentioned in above post are my own and if someone wants to use them, please contact me !

hey !!

Hello Friends

I am Pradeep Mishra.

A startup enthusiast, with deep interest in new cutting-edge technologies.

I am particularly interested in areas of  relevance, machine learning, shopping and statistical inference.

I have spent considerable amount of time on both web and mobile app based products.

I am starting this blog for publishing my views and technical articles, and learn from all of you in the process.

You can also follow me on twitter

Lets roll !!