[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Fwd: Posix Pangrams (#97) - Quicksolution

James Gray

10/8/2006 4:18:00 PM

Begin forwarded message:

> From: red <red@raven.ch>
> Date: October 6, 2006 11:24:54 AM CDT
> To: submission@rubyquiz.com
> Subject: Posix Pangrams (#97) - Quicksolution
>
> Hi,
> this is my first solution to the Ruby-Quiz #97. It's not really
> optizied; neither for speed, the fewest utilities or number of
> repeated
> letters. it's just a base-implementation.
> I'll get back to this quiz later and will hopefully find a better
> solution.
>
> ----------------------------------------------------------
> class PosixPangrams
> @pool = ['admin','alias','ar','asa','at','awk',
> 'basename','batch','bc','bg',
>
> 'c99','cal','cat','cd','cflow','chgrp','chmod','chown','cksum','cmp','
> comm','command','compress','cp','crontab','csplit','ctags','cut','cxre
> f',
> 'date','dd','delta','df','diff','dirname','du',
> 'echo','ed','env','ex','expand','expr',
> 'false','fc','fg','file','find','fold','fort77','fuser',
> 'gencat','get','getconf','getopts','grep',
> 'hash','head',
> 'iconv','id','ipcrm','ipcs',
> 'jobs','join',
> 'kill',
>
> 'lex','link','ln','locale','localedef','logger','logname','lp','ls',
> 'm4','mailx','make','man','mesg','mkdir','mkfifo','more','mv',
> 'newgrp','nice','nl','nm','nohup',
> 'od',
> 'paste','patch','pathchk','pax','pr','printf','prs','ps','pwd',
>
> 'qalter','qdel','qhold','qmove','qmsg','qrerun','qrls','qselect','qsig
> ','qstat','qsub',
> 'read','renice','rm','rmdel','rmdir',
>
> 'sact','sccs','sed','sh','sleep','sort','split','strings','strip','stt
> y',
>
> 'tabs','tail','talk','tee','test','time','touch','tput','tr','true','t
> sort','tty','type',
>
> 'ulimit','umask','unalias','uname','uncompress','unexpand','unget','un
> iq','unlink','uucp','uudecode','uuencode','uustat','uux',
> 'val','vi',
> 'wait','wc','what','who','write',
> 'xargs',
> 'yacc','zcat']
> @letters = {}
> @wordcount = {}
>
> def PosixPangrams::justdoit
> @pool.each { |word|
> word.each_byte { |letters|
> letters = letters.chr
> if @letters[letters].nil?
> @letters[letters] = [word]
> else
> @letters[letters] << word if
> @letters[letters].index(word).nil?
> end
> }
> }
>
> ('a'..'z').each { |letter|
> @wordcount[letter] = @letters[letter].length
> }
>
> @wordcount = @wordcount.sort {|a,b| a[1]<=>b[1]}
>
> output = ""
> @wordcount.each { |letter|
> output += (@letters[letter[0]][rand(@letters[letter[0]].length)]
> + " ") if output.index(letter[0]).nil?
> }
>
> output.each { |word| print word + " " }
> end
> end
>
> PosixPangrams::justdoit();
> ----------------------------------------------------------
>
> Greets
> red
>
> --
> http:/... - red@raven.ch - jabber: syeo66@swissjabber.ch
> Bahnhofstrasse 14 - CH-3400 Burgdorf - Switzerland
> Phone: +41 32 511 71 18 - Mobile: +41 76 373 70 20 - skype: syeo66
> PGP-Key: http:/...public_key.asc


2 Answers

Gillard = Rudd in a frock

10/11/2012 8:13:00 PM

0

On Thu, 11 Oct 2012 14:06:39 +1100, "Farm1" <Here@there.sometimes>
wrote:

>"regn pickford" <regn@mysohl.cop.au> wrote in message
>news:50755bae$1@dnews.tpgi.com.au...
>> On Wed, 10 Oct 2012 00:16:38 -0700, bringyagrogalong wrote:
>>
>>> On September 28th 2010 Peter Slipper, the member for Fisher, was elected
>>> Deputy Speaker.
>>>
>>> This is a transcript of Tony Abbott's response at the time:
>>>
>>> "The Member for Fisher will serve as a fine complement to the Member for
>>> Scullin in the chair. I believe that the Parliament will be well- served
>>> by the team which will occupy the chair in this chamber. I congratulate
>>> the Member for Fisher, who has been a friend of mine for a very long
>>> time, who has served this Parliament in many capacities with
>>> distinction."
>>>
>>> Yep! Abbott even attended Slipper's wedding.
>>
>> Yet Slipper sold his office to Labour to get the speaker's
>> chair. They must have been real great mates ...
>
>No-one should trust Abbott to be a mate. He carries knives in both hands
>while he pats people on the back.

Did he lend one to Duck's Bum when she shoved it in Rudd's back?
>
--

Where were the same "shocked and horrified" protesters when Bob Ellis,
ALP member and speech writer for Bob "Do Nothing" Carr said this about
Duck's Bum after her father's death?

"She fled an important conference, and a meeting with Vladimir Putin,
because her father had died at 83, and fled home weeping to Adelaide.

Leaving a battlefield because of a dear one's death is not what she
lets our soldiers do. They must stay, and fight to the battle's end.
Yet she thinks she is different somehow. She is allowed her girly
tears and her time off, playing hookey from her national obligations,
her duty".

And what about this scurrilous tweet from Bowen's wife, Rebecca
Mifsud?

"Alan Jones age 71. Avergae (sic) lifespan for an Australian male age
79. Patience my pretties #auspol bahahaha"

bringyagrogalong

10/12/2012 12:29:00 AM

0

Tranny <uneducated.galah...@never finished school> prattled:
> "Farm1" <H...@there.sometimes> wrote:
> > "regn pickford" <r...@mysohl.cop.au> wrote in message
> >> bringyagrogalong wrote:
>
> >>> On September 28th 2010 Peter Slipper, the member for Fisher, was elected
> >>> Deputy Speaker.
>
> >>> This is a transcript of Tony Abbott's response at the time:
>
> >>> "The Member for Fisher will serve as a fine complement to the Member for
> >>> Scullin in the chair. I believe that the Parliament will be well- served
> >>> by the team which will occupy the chair in this chamber. I congratulate
> >>> the Member for Fisher, who has been a friend of mine for a very long
> >>> time, who has served this Parliament in many capacities with
> >>> distinction."
>
> >>> Yep! Abbott even attended Slipper's wedding.
>
> >> Yet Slipper sold his office to Labour to get the speaker's
> >> chair. They must have been real great mates ...
>
> > No-one should trust Abbott to be a mate.  He carries knives in both hands
> > while he pats people on the back.
>
> Did he lend one to Duck's Bum when she shoved it in Rudd's back?

Are you referring to the one he retrieved from Turnbull's back?

--------------

“Since the last election, Tony Abbott has been engaged in the longest
dummy-spit in Australian political history”.
- Anthony Albanese