<PaulePanter>
manveru: No, only between the two array elements.
<manveru>
so many questions :)
<PaulePanter>
The first place should be an element from W, and the second from M.
<PaulePanter>
lupine: I don’t see how.
<manveru>
then just use map
<hanmac>
PaulePanter: he wants pairs, so doing W.product(M) ... then he wants combinations of 4 pairs ... so combination(4) ... that is a Enumerator, so he probably wants to_a
<lupine>
(W + M).combination(2) ?
<manveru>
W.map{|w| M.map{|m| [w,m] }}
<lupine>
ah, I guess that's not quite right
<PaulePanter>
lupine: No. [a, b] is not allowed in there.
<PaulePanter>
manveru: That’s also not it.
* PaulePanter
is sorry for apparently being unable to explain.
<havenwood>
izaakf: If you'd like to use someone else's implementation in Ruby try the unique_permutation gem.
jenrzzz has quit [Ping timeout: 264 seconds]
jhack has quit [Quit: jhack]
skweek has joined #ruby
jhack has joined #ruby
camilasann has quit [Remote host closed the connection]
DTZUZU has joined #ruby
jhack has quit [Client Quit]
braincrash has joined #ruby
<havenwood>
izaakf: Or you could modify it more specifically for your purposes.
enterprisey has joined #ruby
lmc has joined #ruby
brendan- has joined #ruby
benlieb has joined #ruby
<havenwood>
izaakf: Improve your algorithm before even considering a multithreaded or multiprocess approach.
benlieb has quit [Client Quit]
cdg has quit [Remote host closed the connection]
<havenwood>
izaakf: I think you mentioned the other day that you're on Windows with CRuby, which precludes both forking (Windows) and multiple threads using the processor at the same time (CRuby global VM lock).
lmc has quit [Ping timeout: 260 seconds]
<havenwood>
izaakf: So gems like Parallel will be no help.
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
izaakf: You can use JRuby on Windows if you want parallel processing with threads.
benlieb has joined #ruby
<havenwood>
izaakf: Take a look at the unique_permutation gem implementation. It's just a few lines of Ruby. Then consider how you might change it slightly to achieve your goal.
Jackneill has quit [Read error: Connection timed out]
Jackneill has joined #ruby
xaviergmail has quit [Ping timeout: 260 seconds]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Jackneill has quit [Max SendQ exceeded]
mase-chatter has quit [Quit: Leaving]
bronson has joined #ruby
Azure has joined #ruby
jallen123 has joined #ruby
AHemlocksLie has left #ruby [#ruby]
bronson has quit [Ping timeout: 252 seconds]
benlieb has quit [Quit: benlieb]
jenrzzz has joined #ruby
nankyokusei has joined #ruby
shayan_ has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nankyokusei has quit [Ping timeout: 256 seconds]
<izaakf>
havenwood: Thanks so much. I was just having dinner will try it now
Channel6 has joined #ruby
Azure has joined #ruby
jshjsh has quit [Ping timeout: 248 seconds]
last_staff has joined #ruby
banisterfiend has quit [Ping timeout: 252 seconds]
testuser1 has quit [Quit: Leaving.]
testuser1 has joined #ruby
testuser1 has quit [Client Quit]
thoolihan has quit [Ping timeout: 260 seconds]
testuser1 has joined #ruby
Mr_Pancake has quit [Ping timeout: 268 seconds]
testuser1 has quit [Client Quit]
testuser1 has joined #ruby
JoshS has joined #ruby
testuser1 has quit [Client Quit]
Mr_Pancake has joined #ruby
jshjsh has joined #ruby
shayan_ has quit [Quit: shayan_]
shayan_ has joined #ruby
<izaakf>
havenwood: The permutation gem seems to be just as slow as the standard permutation method unfortunately :(
jallen123 has quit [Remote host closed the connection]
polysics has quit [Read error: Connection reset by peer]
polysics has joined #ruby
jallen123 has quit [Ping timeout: 258 seconds]
polysics has quit [Read error: Connection reset by peer]
polysics_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
polysics_ has quit [Read error: Connection reset by peer]
polysics has joined #ruby
pawnbox has joined #ruby
polysics has quit [Read error: Connection reset by peer]
pawnbox has quit [Remote host closed the connection]
polysics has joined #ruby
GGMethos has quit [Ping timeout: 258 seconds]
pawnbox has joined #ruby
<havenwood>
izaakf: Give me a minute and I'll give it a stab.
<izaakf>
havenwood: Thanks a lot. Finding it frustrating
frozengeek_ has joined #ruby
harai has quit [Ping timeout: 260 seconds]
polysics has quit [Ping timeout: 268 seconds]
Guest20511 has quit [K-Lined]
conta has quit [Ping timeout: 252 seconds]
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enyo has joined #ruby
Azure has joined #ruby
jallen12_ has quit [Remote host closed the connection]
jallen123 has joined #ruby
sarbs has quit [Read error: Connection reset by peer]
azby has joined #ruby
enyo has quit [Ping timeout: 264 seconds]
gajus has quit [Quit: Connection closed for inactivity]
harfangk has joined #ruby
jallen123 has quit [Ping timeout: 245 seconds]
porfa has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
<Mon_Ouie>
What's the size of the arrays that you're computing the premutations of?
bronson has joined #ruby
sarbs has joined #ruby
JoshS has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has quit [Ping timeout: 258 seconds]
GGMethos has joined #ruby
aidalgol has joined #ruby
jshjsh has quit [Ping timeout: 258 seconds]
harai has joined #ruby
<azby>
I receive 300K(on one processor and because of Linux networking stack) packets over UDP socket. I need to receive all these packets, parse them, and store them somewhere. The length of received data is around 1500 bytes. EventMachine seems the right choice since it's a high scalable application. What's the right way to parse data received(receive_data) in handler associated to EventMachine? I mean how can I have work thread that upon receive of data
<azby>
in received_data, work thread parse data?
jenrzzz has quit [Ping timeout: 252 seconds]
deank has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
Azure has joined #ruby
LoneHerm_ has joined #ruby
jallen123 has joined #ruby
jallen123 has quit [Remote host closed the connection]
Pupeno has joined #ruby
jallen123 has joined #ruby
<porfa>
Hey my Rubedo gansters… Happy new year for y’all!
LoneHerm_ has quit [Ping timeout: 258 seconds]
montanonic has joined #ruby
jallen123 has quit [Ping timeout: 245 seconds]
harai has quit [Ping timeout: 256 seconds]
jshjsh has joined #ruby
Pupeno has quit [Ping timeout: 264 seconds]
DoctorMo_ has joined #ruby
JoshS has quit [Ping timeout: 248 seconds]
<DoctorMo_>
having a fucky problem with class variables: https://gist.github.com/PeteMichaud/805b42d8d5c4e4c5674b5e7fdb65b6ff -- I'm making a person model that has traits, and the traits that are generated sometimes have prereqs. In the example linked above, I'm trying to generate an Adult Height trait, which depends on a different trait called Gender. When I call my `prereq` method, the class variable is nil for reasons I ca
<DoctorMo_>
n't figure out
xen0fon1 has joined #ruby
xen0fon has quit [Ping timeout: 248 seconds]
xen0fon1 is now known as xen0fon
hotpancakes has quit [Remote host closed the connection]
moei has quit [Quit: Leaving...]
<Mon_Ouie>
You don't use class variables anywhere in the code that you linked
<Mon_Ouie>
@_prereqs is an instance variable, on an object which happens to be a class. Those are different from class variables e.g. @@_prereqs.
jshjsh has quit [Ping timeout: 268 seconds]
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
<Mon_Ouie>
And here the problem seems to be that you expect the Module#extended hook is not called for Trait::AdultHeight, which is not the case
Vile` has quit [Ping timeout: 245 seconds]
<Mon_Ouie>
(Trait::Base's @_prereq is [] after the call to extend, but Trait::AdultHeight's @_prereq is nil)
<Mon_Ouie>
You could just define def prereqs; @_prereqs ||= []; end to avoid needing the extended hook altogether
<izaakf>
Mon_Ouie: however long the users string is factorial
<DoctorMo_>
yeah, I think you're right, I thought extend would work for Trait::AdultHeight
JoshS has joined #ruby
gheegh has joined #ruby
matp_ has joined #ruby
matp has quit [Ping timeout: 245 seconds]
polysics has joined #ruby
last_staff has quit [Quit: last_staff]
<DoctorMo_>
ok, got it working now, thanks so much for your help Mon_Ouie :)
matp_ has quit [Read error: Connection reset by peer]
polysics has quit [Read error: Connection reset by peer]
<havenwood>
izaakf: I got distracted and have to leave now but it seems to be about twice as fast in Crystal-lang for ten characters: "ten chars!".chars.each_permutation.uniq.map(&.join).group_by(&.[0])
polysics has joined #ruby
sarbs has quit [Read error: Connection reset by peer]
skweek has quit [Ping timeout: 260 seconds]
<havenwood>
izaakf: I'll try more ways when I have some time!
jallen123 has joined #ruby
jsyoo5b has joined #ruby
polysics has quit [Ping timeout: 264 seconds]
shayan_ has quit [Quit: shayan_]
matp has joined #ruby
ruid has quit [Ping timeout: 246 seconds]
polysics has joined #ruby
camilasan has joined #ruby
sarbs has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.6]
azby has quit [Ping timeout: 268 seconds]
maloik has quit [Remote host closed the connection]
maloik48 has joined #ruby
shayan_ has joined #ruby
montanonic has quit [Ping timeout: 258 seconds]
|ifei5g00d has joined #ruby
<Yonk_>
Anyone here really good with the pg_search gem?
<Yonk_>
I have User with many locations. I am querying against name and location but I want it only to return the matching location but the user with all of it's locations.
_whitelogger has joined #ruby
jallen123 has quit [Remote host closed the connection]
jeffreylevesque has joined #ruby
camilasan has quit [Remote host closed the connection]
jallen123 has joined #ruby
arian__ has joined #ruby
bronson has joined #ruby
<arian__>
hey guys i have a great idea who is good with perl here?
LoneHerm_ has joined #ruby
<tobiasvl>
arian__: probably better to just state your idea, or question, or whatever it is
<tobiasvl>
and then someone will answer if they can
<arian__>
im trying to start the first website that deals with connecting with people
Sanctus has joined #ruby
<tobiasvl>
web 2.0
<arian__>
like adding friends, talking to people online things like that
<tobiasvl>
sounds great
<tobiasvl>
innovative
<tobiasvl>
revolutionary
<arian__>
thanks man im from india so sorry for my english
chino has joined #ruby
camilasan has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
reverberations has quit [Ping timeout: 268 seconds]
jallen123 has quit [Remote host closed the connection]
enterprisey has quit [Remote host closed the connection]
<arian__>
tobiasvl you don't seem that bright i just looked on google and found facebook
<tobiasvl>
;)
<arian__>
why would u lie to me
<arian__>
im just trying to learn english and here you are slowing me down #alllivesmatter
nankyokusei has joined #ruby
<tobiasvl>
learning sarcasm is a big part of learning a language
<arian__>
so did you know i was being sarcastic when i asked who was good with perl in a different chatroom?
pytuger has joined #ruby
<Mon_Ouie>
Facetiousness is not sarcasm
nankyokusei has quit [Ping timeout: 258 seconds]
<pytuger>
with python, they have 'pip' where I can 'pip install python_module' is there equivalent with ruby for installing modules?
<arian__>
its not like their synonyms
<Mon_Ouie>
pytuger: Yes, it is called `gem', and is part of the standard library.
dnicole has quit []
<pytuger>
Mon_Ouie, thanks
dnicole has joined #ruby
<arian__>
treating serious issues with deliberately inappropriate humor; theres the definition for it; so you're basically saying that I was discussing "a serious issue" such as when i was sarcastic about starting the next facebook, and that my humor was "innapropriate"; go back to school kid using big words doesn't make you
<arian__>
seem intelligent
al2o3-cr has joined #ruby
ledestin has joined #ruby
ledestin has quit [Client Quit]
ledestin has joined #ruby
<Yonk_>
O_o
toretore has joined #ruby
arian__ is now known as bibblue
<bibblue>
what r u guys talkin boot
<reaVer>
HAPPY NEW YEAR!!!
<tobiasvl>
happy new year!
<tobiasvl>
thick fog here, can't see any fireworks. rip
<pytuger>
make fireworks your screensaver
<bibblue>
happy new year!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!y!!!!!!!!a!!!!!!!!stu!!!!!!!!!!!!!!!!!!!!pid!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!c!!!!!!!!!!!!!!!!!!!!!!!!!!!!u!!!!!!!!!!!!!!!!!!!!!!!!!!n!!!!!!!!!!!!!!!!!!!!!!!!t!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!s!!!!!!!!!!!!
<tobiasvl>
bibblue: that's not very nice
<Mon_Ouie>
!ban bibblue Happy new year
shayan_ was kicked from #ruby by ruby[bot] [Happy new year]
bibblue was kicked from #ruby by ruby[bot] [Happy new year]
<pytuger>
Mon_Ouie: Thanks
agit0 has quit [Quit: zzzZZZ….]
cgibsonmm has joined #ruby
cgibsonmm has quit [Client Quit]
enyo has joined #ruby
frozengeek_ has quit [Quit: frozengeek_]
jsyoo5b has quit [Remote host closed the connection]
newbie1 has joined #ruby
jsyoo5b has joined #ruby
jsyoo5b has quit [Client Quit]
enyo has quit [Ping timeout: 246 seconds]
saneax-_-|AFK is now known as saneax
QualityAddict has quit [Ping timeout: 248 seconds]
foption has joined #ruby
agit0 has joined #ruby
_sfiguser has quit [Quit: Leaving]
agit0 has quit [Client Quit]
dnicole has quit [Remote host closed the connection]
DoctorMo_ has quit [Remote host closed the connection]
montanonic has joined #ruby
dar123 has quit [Read error: Connection reset by peer]
bronson has joined #ruby
unreal has quit [Read error: Connection reset by peer]