#ruby-lang - Tue 17 Apr 2007 between 07:35 and 07:49



Eridiusthat should work fine
basically, you want to know if the intersection is non-empty
roobok
Eridiusand 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
roobit's getting very mathematical, still wrapping my head around it
haha, "very mathematical" just goes to show how good I was in school
Eridiusif you want to require 'set'
you could do not Set.new(ary1).intersection(Set.new(ary2)).empty?
roobOk
ph8how 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
EridiusTime.new
why?
md5 + substr sounds like a bad idea. what are you trying to do?
ph8i just need a random alphanum string of ~8 chars
Eridiusfor what purpose?
ph8I'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
Eridiusread the first 8 chars from /dev/random
ph8cunning
Eridiusgranted, that won't be ASCII
ph8might not be accepted by the server then though?
Eridiusit is 5:39 AM so excuse my not-well-thought-out suggestions ;)
ph8i could use a while loop with a range and a random select
Eridiusewww
ph8idd
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
ph8sexy
Eridius:)
ph8what's the 62 in rand() do?
Eridiusit's the upper bound

Page: 2 9 16 23 30 37 44 

IrcArchive