Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: min and mindex

by kcott (Abbot)
on Nov 09, 2012 at 06:13 UTC ( #1003072=note: print w/ replies, xml ) Need Help??


in reply to Re: min and mindex
in thread min and mindex

++ I like your thinking, jaredor!

So, what's the rules of this drinking game? No doubt I lost points when I failed to utter the incantantion "Schwartzian transform" while coding:

my $min_pos = ( sort { $a->[0] <=> $b->[0] } map { [$_ => ++$pos] } @array1 )[0]; # do useful stuff print ... $array2[$min_pos->[1]]

OK, I've downed a large Scotch. Your turn. :-)

-- Ken


Comment on Re^2: min and mindex
Download Code
Re^3: min and mindex
by jaredor (Deacon) on Nov 10, 2012 at 03:02 UTC

    Wait, what?!

    *I* don't get to drink because you didn't say the magic words, but *you* do? I need to rethink the rules to this game....

    ... but then it is a technical fault that I didn't grok that at the core of your masterful schooling on question posting, problem analysis and solution testing was The Schwartzian ... so okay, I owe you a point or a pint, whichever you prefer.

    Actually, you caught me in a minor sin, since I think "reduce" (++tinita) would be what I would use for the problem as stated (sort of like spinning a log on a lathe to get a toothpick). So I posted an answer which wasn't a great answer for the question, but allowed me to be a wee bit cheeky for my own amusement.

    The "drinking game" is just something I do to keep myself engaged with the site content and is just a variant of what some people do to keep awake in meetings: See if you can predict a response. Successful prediction? Assess whether it was necessary or gratuitous. Gratuitous? Point! Take a drink. For PM my rubric is

    1. Is the answer not wrong, but not quite right?
    2. Could the answer have been relatively easy to demonstrate with code, but wasn't?
    3. Does the answer seem to be more of an homage to the hive mind rather than a sincere effort to educate or illuminate?

    (Now you see why I felt compelled to add working code to my snarky comment.)

    This game is not for everyone: According to a thread I read a while back, sundialsvc4 would have destroyed BrowserUK's liver years ago. ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003072]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-07-30 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls