Showing posts with label ctrl-c-ctrl-v. Show all posts
Showing posts with label ctrl-c-ctrl-v. Show all posts

July 12, 2012

Why giving up anger and forgiveness is important... for nobody but YOU!

Came across this very interesting post and thought to collect few of the quotes mentioned over there:

  1. Remember that we are all doing the best we can at the time. - Diane Paul
  2. I know that I need to forgive someone, not for their benefit, but for my own peace of mind. Don’t do it for them, do it for you! - Cathryn Kent
  3. You remember why you love them. Love is about forgiveness.- Holly Chapman
  4. Give up on all hope of a better past. - Matt Child
  5. Forgiveness comes easy when you know that what people say or do is about them, it’s not about you. - Kim Kings
  6. “Hating someone is drinking poison and expecting the other person to die from it.”
  7. The stupid neither forgive nor forget; the naïve forgive and forget; the wise forgive but do not forget. – Thomas Szasz
  8. True forgiveness is not an action after the fact, it is an attitude with which you enter each moment. – David Ridge
  9. A lack of trust is sometimes simply recognizing another’s limitations – Rose Sweet
I loved #1, #5 and #7 above. 

March 01, 2012

Thoughts of the day

1. Observe the environment and the people around you. How they reach to things that you do.
2. Network with people who don't look, think, act or dress like you. Talking with opposites inevitably sparks new ideas, new insights and ultimately corrects a course, individual or societal.
3. Experiment with the world by personally trying out new things, taking stuff apart or doing things differently that you've been repetitively doing day in and day out.
4. Ask more questions. Question the world with inquiries that provokes the status quo, that get under the hood of a situation, that open unexpected new directions that never emerged before. "Question the unquestionable" and see what kind of drift surfaces. Then of course correct and keep the ship from sinking.

December 12, 2009

Quote of the day...

"I do my thing and you do yours. I am not in this world to live up to your expectations, and you are not in this world to live up to mine. You are you and I am I, and if by chance we find each other, then it is beautiful. If not, it can't be helped." - Frederick Perls

October 12, 2009

Thought of the day...

Stolen from Ghai's fb post, but it was worth it:

"We don’t get a chance to do that many things, and every one should be really excellent. Because this is our life. Life is brief, and then you die, you know? And we’ve all chosen to do this with our lives. So it better be damn good. It better be worth it." - Steve Jobs

Regex Pattern for Validating Email addresses

Interesting post here talks about how complex RFC 822 is, that defines a valid email address. But thankfully the guy found a simpler pattern from msdn and modified it to put more restriction on the regex; here it goes:-

"^([\w]+)(([-\.][\w]+)?)*@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"

However this pattern fails to approve email ids like "mygroup+subscribe@mygroups.com" which is a common pattern used by listserv email lists. There are few more cases when email bots send you emails containing reply to addresses like "mygroup+confirm-23EWEJEW233@mygroups.com" where you reply and using the session id "23EWEJEW233", your a/c is activated or something. Writely (now Google docs) uses a similar pattern allowing you to upload documents through emails; their email ids are of type "xyz+pqr-12345678901234567890-SDWEPO23@prod.writely.com"

To verify if a value is passing through this perl regex filter, i used the following command:
echo [candidate_value]|grep -P [pattern]
and then checking "echo $?", if its 0, the pattern matches, else it failed. Actually if the pattern matches, you will see the [candidate_value] printed as well.

Turns out adding support for '+' as additional symbol was the only thing required. The modified regex looks exactly the same, except one character "+" added in the sequence.

"^([\w]+)(([-\.\+][\w]+)?)*@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
For ex:
  1. echo "abc.pp@fjdsf.sdsd.dsdsds.com"|grep -P "^([\w]+)(([-\.\+][\w]+)?)*@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
    passes the regex
  2. echo   "abc.@fjdsf.sdsd.dsdsds.com"|grep -P "^([\w]+)(([-\.\+][\w]+)?)*@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
    fails the regex
  3. echo "xyz+pqr-12345678901234567890-SDWEPO23@prod.writely.com"|grep -P "^([\w]+)(([-\.\+][\w]+)?)*@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
    passes the regex

July 29, 2009

Thought of the day...

All work and no play, makes Jack a dull boy;
All play and no work, makes Jack a mere toy!

June 06, 2009

Enjoy your coffee

A group of alumni, highly established in their careers got together to visit old university professor. Conversations soon turned into complaints about stress in work and life.

Offering his guests coffee, professor went to the kitchen and brought a large pot of coffee and assortment of cups - porcelain, plastic, glass, crystal. Some plain looking, some expensive and some exquisite, telling them to help themselves to hot coffee.

When all the students had a cup of coffee in hand professor said - If you noticed, all the nice looking expensive cups were taken up leaving behind the plain and cheap ones. It is normal for you to want only the best for yourself But that is the source of your problem and stress.

What all of you wanted was coffee, not the cup, but you consciously went for the best cup and were eying each other's cup.

Now if life is coffee, then jobs, money and position in society are the cups. They are just tools to hold Life, but the quality of Life doesn’t change. Sometimes by concentrating only on the cup we fail to enjoy the coffee in it.

So don’t let the cups drive you... enjoy the coffee instead!