<zenspider>
seriously... that's umpteen levels of wtf
rationalrevolt has joined #ruby-lang
Rubennn has joined #ruby-lang
<rationalrevolt>
I'm using the sequel gem, if I want to say 'select * from posts where id in (1,2,3)' how should I code that? I'm trying DB[:posts].where([:id,post_array]) which doesnt seem to work. Although if I say DB[:posts].where([[:id,post_array]]) it gives me "SELECT * FROM `posts` WHERE (`id` IN (1, 2, 3))"
styped has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
<rationalrevolt>
am i forced to use a nested array like that?
cads has joined #ruby-lang
mistym has joined #ruby-lang
mehlah has quit [Ping timeout: 252 seconds]
bjh13 has quit [Quit: leaving]
patriciomacadden has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
cads has quit [Read error: Connection reset by peer]
woollyams has quit [Ping timeout: 252 seconds]
bjh13 has joined #ruby-lang
cads has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
cads has quit [Client Quit]
cads has joined #ruby-lang
deens has quit [Remote host closed the connection]
cads has left #ruby-lang [#ruby-lang]
mistym has quit [Remote host closed the connection]
ozkan has joined #ruby-lang
vky has quit [Ping timeout: 246 seconds]
soba has joined #ruby-lang
amerine has joined #ruby-lang
imperator has joined #ruby-lang
ozkan has quit [Ping timeout: 276 seconds]
fijimunkii has quit [Ping timeout: 245 seconds]
apeiros has quit [Remote host closed the connection]
patriciomacadden has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has joined #ruby-lang
red_menace has left #ruby-lang ["peer reset by connection"]
daikan has quit [Ping timeout: 252 seconds]
Lewix has joined #ruby-lang
patriciomacadden has joined #ruby-lang
patriciomacadden has quit [Client Quit]
thmzlt has quit []
ayumin has joined #ruby-lang
<zenspider>
rationalrevolt: did you look at the doco?
<rationalrevolt>
i think i figured it out, i can say DB[:posts].where(:id => id_array)
dik_dak has joined #ruby-lang
ayumin has quit [Ping timeout: 272 seconds]
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby-lang
BlitzBolt has joined #ruby-lang
BlitzBolt has quit [Client Quit]
<zenspider>
hoe 3.8.0 released
<zenspider>
minitest-bacon 1.0.2 released
alekst has quit [Quit: Leaving...]
ender has joined #ruby-lang
mistym has joined #ruby-lang
<zenspider>
omnifocus 2.1.3 released
dingus_khan has joined #ruby-lang
daikan has joined #ruby-lang
deens has quit [Remote host closed the connection]
<zenspider>
image_science 1.2.6 released
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
hahuang61 has quit [Ping timeout: 252 seconds]
hahuang61 has joined #ruby-lang
simi has joined #ruby-lang
hahuang61 has quit [Ping timeout: 276 seconds]
ledestin has joined #ruby-lang
rahul_j has joined #ruby-lang
daikan has quit [Remote host closed the connection]
seoaqua has joined #ruby-lang
charliesome has joined #ruby-lang
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby-lang
seoaqua has quit [Ping timeout: 245 seconds]
Barrin6 has joined #ruby-lang
seoaqua has joined #ruby-lang
CaptainJet has quit []
CaptainJet has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
rahul_j has joined #ruby-lang
seoaqua has quit [Ping timeout: 245 seconds]
dingus_khan has quit [Remote host closed the connection]
pr0ton has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
imperator has quit [Quit: Leaving]
sepp2k has quit [Read error: Connection reset by peer]
talonstriker has joined #ruby-lang
bfleischer has quit [Quit: leaving]
brianpWins has joined #ruby-lang
<talonstriker>
hi ruby-lang, I'm trying learn closures in ruby, and I'd like some help with a sytax error (here's the code snippet: http://pastebin.com/cfASDbzX)
<talonstriker>
the error is find_au.rb:12:in `dive': no block given (yield) (LocalJumpError)
danijoo has quit [Read error: Connection reset by peer]
danijoo_ has joined #ruby-lang
brianpWins has quit [Remote host closed the connection]
<talonstriker>
ok figured out that it has something to with the argument being passed, if i make it into a function with 0 arguments the code works
<talonstriker>
how do I pass in a code block into a function that also takes arguments?
danijoo_ has quit [Read error: Connection reset by peer]
seoaqua has joined #ruby-lang
danijoo has joined #ruby-lang
lsegal has joined #ruby-lang
yatish27 has joined #ruby-lang
<talonstriker>
ah nvm figured it, should have made the function prototype as `def dive(directory, &codeblock`
seoaqua has quit [Ping timeout: 246 seconds]
woollyams has joined #ruby-lang
vlad_starkov has joined #ruby-lang
mistym has quit [Remote host closed the connection]
seoaqua has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
speakingcode has joined #ruby-lang
daikan has quit [Ping timeout: 252 seconds]
CodeBunny has quit [Read error: Connection reset by peer]
ahmedelgabri has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.2]
Voker57 has quit []
mistym has quit [Remote host closed the connection]
lysw123 has quit [Ping timeout: 252 seconds]
jonahR has joined #ruby-lang
jtw has quit []
jerrytgarcia has quit [Quit: WeeChat 0.4.2]
jtw has joined #ruby-lang
Cakey has joined #ruby-lang
aqua__ has joined #ruby-lang
seoaqua has joined #ruby-lang
huma has joined #ruby-lang
mistym has joined #ruby-lang
aqua__ has quit [Ping timeout: 246 seconds]
seoaqua has quit [Ping timeout: 272 seconds]
seoaqua has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
seoaqua__ has joined #ruby-lang
seoaqua has quit [Ping timeout: 246 seconds]
rationalrevolt has left #ruby-lang ["ERC Version 5.3 (IRC client for Emacs)"]
seoaqua has joined #ruby-lang
seoaqua__ has quit [Ping timeout: 260 seconds]
RobertBirnie has joined #ruby-lang
CodeBunny has joined #ruby-lang
seoaqua has quit [Ping timeout: 245 seconds]
seoaqua has joined #ruby-lang
mykoweb_ has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
vlad_starkov has joined #ruby-lang
fijimunkii has joined #ruby-lang
mykoweb has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
seoaqua has quit [Ping timeout: 272 seconds]
seoaqua has joined #ruby-lang
ozkan has joined #ruby-lang
seoaqua_ has joined #ruby-lang
woollyams has quit [Read error: Connection reset by peer]
woollyams has joined #ruby-lang
seoaqua has quit [Ping timeout: 245 seconds]
AKASkip has joined #ruby-lang
fijimunkii has quit [Ping timeout: 276 seconds]
vlad_starkov has joined #ruby-lang
ozkan has quit [Ping timeout: 245 seconds]
seoaqua has joined #ruby-lang
fijimunkii has joined #ruby-lang
seoaqua_ has quit [Ping timeout: 245 seconds]
diegoviola has joined #ruby-lang
seoaqua has quit [Ping timeout: 246 seconds]
dingus_khan has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
daikan has joined #ruby-lang
danijoo has joined #ruby-lang
seoaqua_ has joined #ruby-lang
fijimunkii has quit [Ping timeout: 245 seconds]
daikan has quit [Ping timeout: 245 seconds]
jtw has quit []
seoaqua_ has quit [Ping timeout: 245 seconds]
seoaqua has joined #ruby-lang
Barrin6 has quit [Quit: Leaving]
naquad has quit [Ping timeout: 276 seconds]
hagabaka has quit [Quit: No Ping reply in 180 seconds.]
hagabaka has joined #ruby-lang
vadviktor_ has joined #ruby-lang
matp has quit [Ping timeout: 248 seconds]
seoaqua has quit [Ping timeout: 245 seconds]
AKASkip has quit [Ping timeout: 252 seconds]
vadviktor has quit [Ping timeout: 264 seconds]
ljarvis has quit [Ping timeout: 245 seconds]
naquad has joined #ruby-lang
ljarvis has joined #ruby-lang
toretore has joined #ruby-lang
matp has joined #ruby-lang
imperator3 has joined #ruby-lang
seoaqua_ has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
presidentbeef has joined #ruby-lang
seoaqua has joined #ruby-lang
seoaqua_ has quit [Ping timeout: 252 seconds]
jerrytgarcia has joined #ruby-lang
yfeldblum has joined #ruby-lang
h_kon has joined #ruby-lang
seoaqua_ has joined #ruby-lang
mechanicles has joined #ruby-lang
seoaqua has quit [Ping timeout: 260 seconds]
seoaqua_ has quit [Ping timeout: 248 seconds]
apeiros has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby-lang
woollyams has quit [Ping timeout: 252 seconds]
seoaqua_ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
seoaqua_ has quit [Ping timeout: 252 seconds]
zlogan has joined #ruby-lang
<speakingcode>
is there a value that can be sent to an object via #send that will make the object return itself?
seoaqua has joined #ruby-lang
amclain has quit [Quit: Leaving]
<speakingcode>
so like, x.send('field') returns x.field, can i pass something to x.send to get x back?
tylersmith has quit [Remote host closed the connection]
ozkan has joined #ruby-lang
<zenspider>
speakingcode: why??
<zenspider>
you already have x, so what's the point?
<zenspider>
you could write: class Object; def identity; self; end; end but unless you're doing some odd functional programming, again, what's the point?
<speakingcode>
well, i have a kind of special generalized 'sorting' method that will 'sort' items based on value of a field, the field being a parameter to the method, but i want to handle the case where the value of the object itself can be the value to 'sort' on (i'm not actually sorting but close enough in concept)
heftig has quit [Quit: Quitting]
seoaqua has quit [Ping timeout: 260 seconds]
<speakingcode>
so like... custom_sort([x,y,z], last_name) will sort x,y, and z b ased on their last_name field
<speakingcode>
but what if i'm passing ["john", "james", "brian"]... they don't have a field, but maybe inspect or to_s would work hmm
apeiros_ has quit [Remote host closed the connection]
<yxhuvud>
so basically you are describing #sort_by ?
apeiros has joined #ruby-lang
<speakingcode>
yxhuvud: yes but in actuality i'm not sorting, but it's conceptually similar to what i'm actually doing so easier to explain/ask that way
symm- has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 252 seconds]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arBmind has joined #ruby-lang
mykoweb has quit [Remote host closed the connection]
rsl has quit [Ping timeout: 260 seconds]
mykoweb has joined #ruby-lang
daikan has joined #ruby-lang
mechanicles has quit [Remote host closed the connection]
daikan has quit [Ping timeout: 272 seconds]
knu has quit [Ping timeout: 252 seconds]
knu has joined #ruby-lang
CodeBunny has quit [Quit: CodeBunny needs a carrot. Be back later.]
dagobah has joined #ruby-lang
<zenspider>
speakingcode: I don't do "what if". sorry.
<speakingcode>
zenspider: it's not what if. i'm not asking you to solve my application-level problem. i'm asking what can be sent to an object via send to get the value of the object itself
<zenspider>
it is a "what if" because you JUST used "what if" and I already answered your first question
<zenspider>
besides... you're defining group_by
<zenspider>
poorly. run `ri Hash.new`
<zenspider>
then run `ri Enumerable.group_by`
<speakingcode>
that's just an example. the point is it is a generic method, whose input types and the field to operate on, may vary
<speakingcode>
perhaps i want to group the objects by class, or by some other metaproperty. or perhaps i don't want to group them at all and that's just a contrieved example to demonstrate the actual question i don't know how to spell out any more plainly: what can be sent to an object, via #send, to reflect the object?
<whitequark>
speakingcode: just make your method accept a block
<whitequark>
you can then emulate your old behavior by passing &:foo (block) instead of :foo (method name)
<zenspider>
speakingcode: what the fuck did I say you should do the first time?
<whitequark>
then inside... def sort(meth) x.send(meth) end becomes def sort(&block) block.call(x) end
<zenspider>
because I answered that already
<speakingcode>
zenspider: in the first place you said monkey patch Object with a method to return itself but my question is not how to monkey patch a class w a method to return itself, it was 'is there a value that can be passed to #send that will make the object return itself
<speakingcode>
there is a stark difference between the two, though the end result is similar
<zenspider>
wow
<zenspider>
have fun with that bullshit dude.
<zenspider>
I'm done with it
<whitequark>
speakingcode: simple answer: no.
<speakingcode>
if you don't know the answer to my actual question, or if it is no, simply say so. i didn't ask for a workaround to a problem i'm not trying to solve, i didn't say hey ask me for more details and tell me how to build my application
Voker57 has joined #ruby-lang
<speakingcode>
so you brought your own frustrations upon yourself
<whitequark>
*facepalm*
AKASkip has joined #ruby-lang
imperator3 has quit [Quit: Leaving]
<speakingcode>
whitequark: thank you for the simple answer to the simple question.
dagobah has quit [Remote host closed the connection]
dagobah has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
rahul_j has quit [Quit: rahul_j]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
JoshuaPaling has joined #ruby-lang
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
<zenspider>
oh do go fuck yourself
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
tylersmith has joined #ruby-lang
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
rahul_j has joined #ruby-lang
Forgetful_Lion has joined #ruby-lang
Forgetful_Lion has quit [Read error: Connection reset by peer]
<zenspider>
can anyone recommend a _usable_, preferably mac-like, logic simulator?
mistym has quit [Remote host closed the connection]
<zenspider>
I'm trying out logic.ly and it's adobe air. ugh.
Lewix has quit [Remote host closed the connection]
<whitequark>
logic simulator?
mechanicles has joined #ruby-lang
tylersmith has quit [Ping timeout: 272 seconds]
<whitequark>
oh, I see what logic.ly does. what do you need this for?
<zenspider>
working out stuff for nand2tetris before I translate it to HDL
<whitequark>
I was going to suggest using HDL tools... verilator or, say, Xilinx ISE
<whitequark>
a combination of icarus and gtkwave works too, if you're FOSS-inclined
arBmind has quit [Ping timeout: 245 seconds]
<zenspider>
the HDL side is handled by the curriculum's software. I need graphical tools to help me sort out wirings before I go to HDL. visual thinker.
<zenspider>
ah. google's related: query is helping
daikan has joined #ruby-lang
symm- has joined #ruby-lang
d4rkr4i has joined #ruby-lang
daikan has quit [Ping timeout: 252 seconds]
heckman has joined #ruby-lang
arBmind has joined #ruby-lang
arBmind has quit [Read error: Connection reset by peer]
cursorzz has joined #ruby-lang
heckman has quit [Client Quit]
Pupeno_w has joined #ruby-lang
<zenspider>
ugh. or not.
arBmind has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
robmiller has quit [Quit: robmiller]
MrZYX|off is now known as MrZYX
heftig has joined #ruby-lang
ender has quit [Ping timeout: 245 seconds]
jstemmer has joined #ruby-lang
jonahR has quit [Quit: jonahR]
jonahR has joined #ruby-lang
jonahR has quit [Client Quit]
tbuehlmann has joined #ruby-lang
michael_mbp has quit [Excess Flood]
michael_mbp has joined #ruby-lang
Cakey has quit [Ping timeout: 272 seconds]
apeiros has joined #ruby-lang
elia has joined #ruby-lang
michd is now known as MichD
<yorickpeterse>
morning
seoaqua_ has joined #ruby-lang
Onixs_ has quit [Quit: Caught sigterm, terminating...]
<gnufied>
Morning
dingus_khan has quit []
Onixs has joined #ruby-lang
relix has joined #ruby-lang
seoaqua_ has quit [Ping timeout: 265 seconds]
seoaqua has joined #ruby-lang
kitak has quit [Remote host closed the connection]
seoaqua has quit [Ping timeout: 252 seconds]
marr has joined #ruby-lang
benlovell has joined #ruby-lang
seoaqua has joined #ruby-lang
cnivolle has joined #ruby-lang
seoaqua_ has joined #ruby-lang
seoaqua_ has quit [Client Quit]
mehlah has joined #ruby-lang
daikan has joined #ruby-lang
seoaqua has quit [Ping timeout: 248 seconds]
seoaqua has joined #ruby-lang
daikan has quit [Ping timeout: 276 seconds]
seoaqua_ has joined #ruby-lang
seoaqua has quit [Ping timeout: 265 seconds]
seoaqua_ has quit [Ping timeout: 272 seconds]
|jemc| has quit [Ping timeout: 245 seconds]
woollyams has joined #ruby-lang
seoaqua_ has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
cnivolle has joined #ruby-lang
seoaqua_ has quit [Ping timeout: 260 seconds]
mykoweb has quit [Ping timeout: 276 seconds]
seoaqua_ has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
<yorickpeterse>
heh, didn't expect that actually *lowering* timeouts would make things faster
x0f has joined #ruby-lang
<yorickpeterse>
though when you think of it it does make sense
<yorickpeterse>
less time spent waiting for shitty websites to respond
diegoviola has quit [Ping timeout: 276 seconds]
diegoviola has joined #ruby-lang
<workmad3>
yorickpeterse: in most cases, I wouldn't expect it to happen... that it did would imply that a good proportion of your requests are timing out :)
<yorickpeterse>
about 80% of our errors are timeouts
face has joined #ruby-lang
<yorickpeterse>
counting about 18000 timeouts
<yorickpeterse>
I'm still convinced there's something wrong on our end in terms of server setup
<yorickpeterse>
but it's like chasing ghosts
faces has quit [Ping timeout: 265 seconds]
<whitequark>
OVER 9000 TIMEOUTS
<workmad3>
whitequark: 2*9000 TIMEOUTS!
<yorickpeterse>
around 3900 in the last 10 minutes
<workmad3>
o.O
<yorickpeterse>
welcome to scraping
<yorickpeterse>
please take a seat next to the shitty web API
<workmad3>
are your routers rate limiting your outbound requests?
<yorickpeterse>
nfi, ask Amazon :P
<yorickpeterse>
I did quite tweaking/measuring/etc about a week ago but couldn't really find a thing that helped
<yorickpeterse>
and our instances have plenty of bandwith (1 Gbps I believe)