Tim Pease
5/21/2009 7:18:00 PM
On Thu, May 21, 2009 at 1:03 PM, Tim Pease <tim.pease@gmail.com> wrote:
> On Thu, May 21, 2009 at 9:42 AM, pat eyler <pat.eyler@gmail.com> wrote:
>>> On May 20, 2009, Gregory Brown wrote:
>>> > On Wed, May 20, 2009, Juan Zanos <juan_zanos@talkhouse.com> wrote:
>>
>>> > So you have better designs compared to those who seek further concise=
ness in
>>> > a language. =C2=A0If only those folks of poor ability could design so=
well as
>>> > you.
>>
>>> That's right. =C2=A0 I'm pretty awesome. =C2=A0 Maybe RubyTalk can thro=
w a party
>>> in honor of me!
>>
>>
>> I say we do it. =C2=A0We should all celebrate Greg's awesomeness. =C2=A0=
Wherever you
>> are, take 5 minutes to party wildly and think of Greg.
>>
>
> =E2=9E=99 cat party.rb
>
> class Party
> =C2=A0@@styles =3D [
> =C2=A0 =C2=A0'Party, Greg, Party!!',
> =C2=A0 =C2=A0'Dance, Greg, Dance!!',
> =C2=A0 =C2=A0'Woot!!!',
> =C2=A0 =C2=A0'Wild Dancing Greg Party!',
> =C2=A0 =C2=A0'--< Chunky Bacon >--'
> =C2=A0]
>
> =C2=A0def for_greg
> =C2=A0 =C2=A0puts @@styles.at(rand(@@styles.length))
> =C2=A0end
>
> =C2=A0def party( time )
> =C2=A0 =C2=A0start =3D Time.now
> =C2=A0 =C2=A0Thread.new {
> =C2=A0 =C2=A0 =C2=A0loop {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0self.for_greg
> =C2=A0 =C2=A0 =C2=A0 =C2=A0break if Time.now-start >=3D time
> =C2=A0 =C2=A0 =C2=A0}
> =C2=A0 =C2=A0}
> =C2=A0end
> end
>
>
> 300.times {
> =C2=A0unless fork
> =C2=A0 =C2=A0Party.new.party(1)
> =C2=A0end
> }
>
> Process.waitall
>
> puts %q(That's right. I'm pretty awesome. Maybe RubyTalk can throw a
> party in honor of me!)
>
>
Hmmm ... I just created an infinitely spawning script! Need an exit!
after the "Party.new.party(1)" line; otherwise each forked child will
drop through back into the 300.times loop and start the process all
over again.
<sigh>
My efforts at humor are wrought with bugs. More coffee is needed.
TwP