Java code example

Here is a Java code snippet.

int N = Integer.parseInt(f.readLine());
String johnString = f.readLine();
String masterString = f.readLine();

int[] johnKeys = Integer.parseInt(johnString.split(" ")[0]),
Integer.parseInt(johnString.split(" ")[1]),
Integer.parseInt(johnString.split(" ")[2])};
int[] masterKeys = Integer.parseInt(masterString.split(" ")[0]),
Integer.parseInt(masterString.split(" ")[1]),
Integer.parseInt(masterString.split(" ")[2]);
Advertisements
Posted in Uncategorized | Leave a comment

धर्म रक्षति रक्षितः (Dharma protects those who protects dharma)

I like Bhante Henepola Gunaratana and his discourses. One day I saw this:

I have no doubt this is absolutely true. Yesterday I came across another site which quotes the same (धर्मं रक्षति रक्षितः) from the मनुस्मृति.

It’s true that all the masters are saying the same thing. I don’t think it’s coincidence or repeats.  There are some fundamental rules to this universe and no matter how many century passes by they seems to hold true. Why else the same thing that is said thousands of year ago is said again in the current generation.

 

Posted in Uncategorized | Leave a comment

Python code example

Here is a Python code snippet.

 
indentCount = 0 
textChars = [] 
suffixChars = [] 
# convert the line into a list of characters 
# and feed the list to the ReadAhead generator 
chars = ReadAhead(list(line)) 
c = chars.next() 
# get first while c and c == INDENT_CHAR: 
# process indent characters 
indentCount += 1 
c = chars.next() 
while c and c != SYMBOL: 
# process text characters textChars.append(c) 
c = chars.next() 
if c and c == SYMBOL: 
c = chars.next() 
# read past the SYMBOL while c: 
# process suffix characters 
suffixChars.append(c) c = chars.next() 
Posted in Uncategorized | Leave a comment

Posted in Uncategorized | Leave a comment

Culture – One of the most important document came out of valley area (Netflix)

This document is viewed some 3 million times. It describes how Netflix instills culture among their employees. It’s a little long but definitely worth checking out.

Posted in Uncategorized | Leave a comment

The story of a sign

Posted in Uncategorized | Leave a comment

A few characterstics of lucky people

I got this in a junk mail, surprisingly it’s not junk at all. Deep insight. My favorite sentences:

1. “Lucky people are more relaxed and open, and therefore see what is there rather than just what they are looking for.”

2. “The happiest people in the world are not those who have no problems, but those who learn to live with things that are less than perfect.”

I set out to examine luck, 10 years ago. Why are some people always in the right place at the right time, while others consistently experience ill fortune? I placed advertisements in national newspapers asking for people who felt consistently lucky or unlucky to contact me.

Hundreds of extraordinary men and women volunteered for my research and over the years, have been interviewed by me. I have monitored their lives and had them take part in experiments. The results reveal that although these people have almost no insight into the causes of their luck, their thoughts and behaviour are responsible for much of their good and bad fortune. Take the case of seemingly chance opportunities. Lucky people consistently encounter such opportunities, whereas unlucky people do not.

I carried out a simple experiment to discover whether this was due to differences in their ability to spot such opportunities. I gave both lucky and unlucky people a newspaper, and asked them to look through it and tell me how many photographs were inside. I had secretly placed a large message halfway through the newspaper saying: ‘Tell the experimenter you have seen this and win $50’.

This message took up half of the page and was written in type that was more than two inches high. It was staring everyone straight in the face, but the unlucky people tended to miss it and the lucky people tended to spot it.

Unlucky people are generally more tense than lucky people, and this anxiety disrupts their ability to notice the unexpected.

As a result, they miss opportunities because they are too focused on looking for something else. They go to parties intent on finding their perfect partner and so miss opportunities to make good friends. They look through newspapers determined to find certain types of job advertisements and miss other types of jobs.

Lucky people are more relaxed and open, and therefore see what is there rather than just what they are looking for. My research eventually revealed that lucky people generate good fortune via four principles. They are skilled at creating and noticing chance opportunities, make lucky decisions by listening to their intuition, create self-fulfilling prophesies via positive expectations, and adopt a resilient attitude that transforms bad luck into good.

I wondered towards the end of the work, whether these principles could be used to create good luck. I asked a group of volunteers to spend a month carrying out exercises designed to help them think and behave like a lucky person. Dramatic results! These exercises helped them spot chance opportunities, listen to their intuition, expect to be lucky, and be more resilient to bad luck. One month later, the volunteers returned and described what had happened. The results were dramatic: 80 per cent of people were now happier, more satisfied with their lives and, perhaps most important of all, luckier.

The lucky people had become even luckier and the unlucky had become lucky. Finally, i had found the elusive ‘luck factor’. Here are four top tips for becoming lucky:

1) Listen to your gut instincts ^ they are normally right.

2) Be open to new experiences and breaking your normal routine.

3) Spend a few moments each day remembering things that went well.

4) Visualise yourself being lucky before an important meeting or telephone call.

Have a Lucky day and work for it.

The happiest people in the world are not those who have no problems, but those who learn to live with things that are less than perfect

Posted in Uncategorized | Leave a comment

Khwajaji – a beautiful sufi song

Sufi is a rather under advertised religious tradition. At least I don’t see much organizations for such traditions. I am not sure why that is so. They pray to god to make themselves the beloved. The sufi whirls (towards the end of the song) is very symbolic too. If you notice they have one hand up in the air and another towards ground. What that signifies is they have open heart to anything that god present to them (the hand towards heaven) and they also have open heart toward anything that is taken away from them (the hand towards ground). They just want to be like a conduit for the cosmic play.

Well that’s quite hard practice isn’t it? How can we not feel angry when the boss comes and screams at us or the other driver cuts in front of us right (accept everything that god throws at us) or when we loose our job or house or heck we don’t get our favorite dinner (accept everything that god takes from us). God seems quite unfair that he demand such high order from us right? We all have gone through these quite familiar feelings multiple times and learned nothing. A song probably will not change anything. But who knows!

Posted in Uncategorized | 1 Comment

Ganesh Chaturthi

On occasion of Lord Ganesh Chaturthi I went to one of friend’s house and they sang a very beautiful Aaarti. Lord Ganesh is the embodiment of the supreme reality. He constantly gives us gently nudges (thru the pleasures and pains of life) to move forward and achieve THAT which is humanely impossible. Lord Ganesha is called with many names with affection:

Devadeva: Lord of all lords.
Ganapati: He is the lord or captain of all the gana (workforce/devotee of Lord Shiva).
Vighnaraja: He is the lord of obstacles, he creates/maintains/destroys all obstacles to teach us to go towards that supreme reality.
Gajanana: Elephant lord. This is very symbolic. In scriptures it was depicted that Lord Shiva cut the original head and it was replaced by elephant head. Sounds cruel that a father cut his own son’s head. But Lord Shiva is all merciful. What he did was he destroyed the head full of ego and replaced with egoless head which is pure consciousness.
Vakratunda: Elephant trunk lord. The trunk symbolizes “Aum”, which is the most potent pointer to the eternal reality.
Musikvahana: Well he actually rides a mouse. This is very symbolic as well. The mouse symbolizes our ego. If you had ever encountered it then you would know how powerful it can be. It can sweep you like a over flowing river, it can burn you to ashes, it can drown you in the most deepest part of ocean. Try going against it and you can feel it’s power and here our beloved sweet lord rides it. How powerful and humble he is!

Jai Dev Jai Dev

Posted in Uncategorized | Leave a comment

Life is like a cup of coffee

Posted in Uncategorized | Leave a comment