ramesh was here

pallikara's programming + politics + philosophy potpourri

Friday, March 24, 2006

 

Programming Ruby: The Pragmatic Programmer's Guide

Programming Ruby: The Pragmatic Programmer's Guide:

"a hash by default returns nil when indexed by a key it doesn't contain. Normally this is convenient, as nil means false when used in conditional expressions. Sometimes you'll want to change this default. For example, if you're using a hash to count the number of times each key occurs, it's convenient to have the default value be zero. This is easily done by specifying a default value when you create a new, empty hash.

histogram = Hash.new(0)
histogram['key1'] » 0
histogram['key1'] = histogram['key1'] + 1
histogram['key1'] » 1"

Thursday, March 23, 2006

 

A lesson to all employees who work with rude customers

Indeed, an award should go to the Virgin Airlines gate attendant in Sydney some
months ago for being smart and funny, while making her point, when confronted
with a passenger who probably deserved to fly as cargo.

A crowded Virgin flight was cancelled after Virgin's 767s had been Withdrawn
from service. A single attendant was re-booking a long line of inconvenienced
travellers. Suddenly an angry passenger pushed his way to the desk. He slapped
his ticket down on the counter and said, "I HAVE to be on this flight and it
HAS to be FIRST CLASS".

The attendant replied, "I'm sorry, sir. I'll be happy to try to help you, but
I've got to help these people first, and I'm sure we'll be able to work
something out."

The passenger was unimpressed. He asked loudly, so that the passengers behind
him could hear, "DO YOU HAVE ANY IDEA WHO I AM?"

Without hesitating, the attendant smiled and grabbed her public address
microphone: "May I have your attention please, may I have your attention
please," she began - her voice heard clearly throughout the terminal. "We have
a passenger here at Gate 14 WHO DOES NOT KNOW WHO HE IS. If anyone can help him
find his identity, please come to Gate 14."

With the folks behind him in line laughing hysterically, the man glared At the
Virgin attendant, gritted his teeth and said, "F... You!"

Without flinching, she smiled and said, "I'm sorry, sir, but you'll have to get
in line for that too."

Wednesday, March 08, 2006

 

Joel on Software

Joel on Software: ". We also have one of those RSS thingamajiggies. If you don't know what that is, consider yourself lucky."

Archives

March 2006   May 2006   July 2006   August 2006   September 2006   October 2006   November 2006   January 2007   February 2007   March 2007   April 2007   May 2007   July 2007   August 2007   September 2007   October 2007   November 2007   December 2007   February 2008   March 2008  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]