#perl - Sun 18 Feb 2007 between 22:22 and 22:30



rmaherm, man
bennymackeval: @foo = 1 .. 10; grep { $_ == 2 } ? 'yes' : 'no'
buubotbennymack: Error: Search pattern not terminated or ternary operator parsed as search pattern at eval line 1.
bennymackeval: @foo = 1 .. 10; grep { $_ == 2 } @foo ? 'yes' : 'no'
buubotbennymack: 0
rmahhaha
bennymackdam
pavum...
rmahpav, if the list is ordered, do a binary search
that'll be O(log N) instead of O(n)
merlyn"Toliet Seat Secrets" :)
pav - that's a fAQ
rmaheau de secrete au toilette?
thoratfrom perlfaq4, "How can I tell whether a certain element is contained in a list or array?"
pavthats to small a problem to write binary search just for that ;)
merlynyes
go read that
rmahoui
merlynfor short lists, grep is quick, List::Utils::first is quicker
rmahpav, maybe the list is 100,000 elements and already sorted
merlynfor long lists used repeatedly, hashes are faster
rmahhow the hell should any of us know?
pavoh it really is a faq... sorry about that then
merlynfor long sorted list, binary search is reasonably fast
if it's all integers, a bit vector might work well
with the vec() function
thoratmaybe the perlfaqs should have more descriptive names
merlynmaybe more people need to know about the faqs
and read through the TOC weekly
thorathehe
rmahmaybe people shouldn't be asking CompSci 101 questions
merlynmaybe we're already doing everything we can. :)
maybe I should have gone to TJ this weekend. :)
rmahhell, HS level questions
merlynI was teaching programming in high school
we used an ASR-33 uppercase only with 110 baud modem connection to the server located 50 miles away
our "offline storage" was paper tape
... snow ... both ways ... up hill ...
Teratogenwas it an HP-2000?
merlynHP2100 front and back processor

Page: 3 10 17 24 31 38 45 52 59 66 73 80 

IrcArchive