| Eridius | that should work fine basically, you want to know if the intersection is non-empty |
| roob | ok |
| Eridius | and it's late, so I screwed up the subtraction hehe that tells you if one includes something the other *doesn't* not quite what you want :P ary1 + ary2 - (ary1 - ary2) - (ary2 - ary1) but that just looks kinda confusing |
| roob | it's getting very mathematical, still wrapping my head around it haha, "very mathematical" just goes to show how good I was in school |
| Eridius | if you want to require 'set' you could do not Set.new(ary1).intersection(Set.new(ary2)).empty? |
| roob | Ok |
| ph8 | how can i find the current time? i'd actually like to do something like md5 the current time and take a substr but that's the first step :p |
| Eridius | Time.new why? md5 + substr sounds like a bad idea. what are you trying to do? |
| ph8 | i just need a random alphanum string of ~8 chars |
| Eridius | for what purpose? |
| ph8 | I'm connecting a bot to IRC, if there's no password set for the PASS command - i just want to use a random one since one is necessary |
| Eridius | read the first 8 chars from /dev/random |
| ph8 | cunning |
| Eridius | granted, that won't be ASCII |
| ph8 | might not be accepted by the server then though? |
| Eridius | it is 5:39 AM so excuse my not-well-thought-out suggestions ;) |
| ph8 | i could use a while loop with a range and a random select |
| Eridius | ewww |
| ph8 | idd or i suppose i could just use [a...f] since i don't think it needs to be random especially |
| Eridius | (1..8).collect { (('a'..'z').to_a + ('A'..'Z').to_a)[rand(52)] }.join (1..8).collect { (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a)[rand(62)] }.join |
| ph8 | sexy |
| Eridius | :) |
| ph8 | what's the 62 in rand() do? |
| Eridius | it's the upper bound |