#ruby-lang - Sat 7 Apr 2007 between 00:19 and 00:52



actionLoganCapaldo wants for teferi to make a comment about parsing xml with regexp
LoganCapaldowants for teferi to make a comment about parsing xml with regexp
s/wants/waits
pergesuLoganCapaldo: awesome, thanks
apeiroswell, the script says 280 possible distributions, 35 out of them red is surrounded by blue
pstickne_hold on, let me crank something out...
hypnos22pergesu: please don't parse XML with a regex
pergesuhypnos22: I know what I'm doing here, thanks
but in case you have any better ideas...
apeirosoh, wait...
bg
errr,bg
hypnos22use an xml parsing library. rexml or libxml
easier...possibly quicker
how long is "long"
pergesuI've got a long XML document that I'm parsing, I just use Hash.from_xml to do it. However I need to maintain the order, and hashes obviously don't do that. So I'm getting all the titles first, and then after I create the hash, I turn it into an array, ordering them by the titles that I originally got
apeiroshah, and then it suddenly was 1 out of 7
http://pastie.caboo.se/52254 exceptionally cheap
but hey, we got the power and premature optimization isn't :)
(combinations.length is 40320 as expected before the uniq!)
pstickne_apeiros, http://pastie.caboo.se/52255 # I get ~14%
apeiros14% == 1/7.0 :-p
but interesting approach :D
actionapeiros does the lobster dance
apeirosdoes the lobster dance
probability still keeps surprising me. I only asked that stupid question here because I thought 1/7 of a chance is way to high
hal_9000i suppose you know the birthday paradox
apeirossure enough :)
that's pretty surprising too
hal_9000until you understand it
i always thought of it in terms of throwing darts at a calendar
pstickne_apeiros, I thought so too when you original said it! :)
apeirospstickne_, well, I'm happy that my approach was correct. that surprised me a bit too tbh ;-)
in case anybody wonders, I just wanted to know how often I'd start not surrounded by enemies in wheel of war (starcraft) ;-)
cdcarteri have a question about the flip flop operator. the truth table for it in the form of a,b, a..b has the line [false, true, true]. this would lead one to believe that false..true is true, but "p 1 if false..true doesn't print
pstickne_huh?
Ruby has ..?
(except for range)
cdcarterhttp://pastie.caboo.se/52256
yea
its the flip/flop an old perlism i just found
apeirosyes, and it is a total bitch

Page: 2 9 16 23 30 37 44 

IrcArchive