From: ara.t.howard@... Date: 2006-03-01T11:35:41+09:00 Subject: Re: Your Favorite One Liner On Wed, 1 Mar 2006, Daniel Nugent wrote: > Give out your favorite one liner, what it does, and when you use it. > > For me: > > puts ARGV[rand(ARGV.size)] > > It randomly prints one of the command line options passed to it. I > typically use it to make a decision when I have no preference (or have > equal distaste) for my available options. > > For instance > > ruby -e "puts ARGV[rand(ARGVsize)]" "shoot self in head" "use Java" > > -- > -Dan Nugent > > harp:~ > cat a.rb hashify = lambda{ |*hashes| hashes.inject(accum={}){|accum,hash| accum.update hash} } a = {"k" => "v", "a" => "b"} b = {"k" => "V"} c = {"f" => "b"} p hashify[a, b, c] harp:~ > ruby a.rb {"k"=>"V", "a"=>"b", "f"=>"b"} -a -- judge your success by what you had to give up in order to get it. - h.h. the 14th dali lama