<stardiviner>
What is the difference between method? method! and method= ? I try to Google "Ruby method with question mark" but do not get the good answer. I hope somebody can give a link which can describe it.
<zzak>
method? is a predicate, method! is a bang (usually destructive or with side-effects), method= is a setter
gregmoreno has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
<stardiviner>
zzak: thanks.
<zzak>
np
savage- has quit [Quit: savage-]
runeb has quit [Ping timeout: 260 seconds]
mistym has quit [Read error: Connection reset by peer]
mistym has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
synthetix has joined #ruby-lang
l0st1 has quit [Quit: leaving]
<zenspider>
stardiviner: no. they're just methods names. nothing more.
<zenspider>
method= has some extra semantics associated to it. (always returns the RHS no matter what the method itself returns), but otherwise, they're just names
znz_jp has quit [Quit: kill -QUIT $$]
chrislgibson has joined #ruby-lang
znz_jp has joined #ruby-lang
<zzak>
right, i was just speaking more generally or culturally
Bosox20051 has joined #ruby-lang
<stardiviner>
zenspider: I see.
<zzak>
people typically use methods named as such
<zzak>
but ruby doesn't force you in that manner
chrislgibson has quit [Ping timeout: 246 seconds]
KA_ has joined #ruby-lang
KA_ has quit [Client Quit]
<stardiviner>
zzak: I see now, I'm writing ruby snippet for Vim. So I need a description word to differ them.
stonerfish has joined #ruby-lang
runeb has joined #ruby-lang
rekky has joined #ruby-lang
cardoni has quit [Quit: cardoni]
runeb has quit [Ping timeout: 264 seconds]
saxy has joined #ruby-lang
gregmoreno has joined #ruby-lang
saxy has quit [Ping timeout: 255 seconds]
sn0wb1rd has quit [Quit: I will be right back]
swarley has quit [Ping timeout: 252 seconds]
gregmoreno has quit [Remote host closed the connection]
rekky has quit [Quit: rekky]
aetcore has joined #ruby-lang
aetcore has quit [Client Quit]
beckettsfool has joined #ruby-lang
runeb has joined #ruby-lang
chrislgibson has joined #ruby-lang
richardjortega has quit [Quit: richardjortega]
rohit_ has joined #ruby-lang
savage- has joined #ruby-lang
charliesome has joined #ruby-lang
sepp2k has joined #ruby-lang
chrislgibson has quit [Ping timeout: 246 seconds]
Bosox20051 has quit [Quit: Leaving]
milesforrest has joined #ruby-lang
bluepojo has quit [Ping timeout: 246 seconds]
runeb has quit [Ping timeout: 246 seconds]
bfreeman has joined #ruby-lang
milesforrest is now known as milesforrest|afk
gsav has quit [Read error: Connection reset by peer]
kgrz has joined #ruby-lang
cardoni has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
mistym has quit [Remote host closed the connection]
rohit_ has quit [Ping timeout: 246 seconds]
svyatov has joined #ruby-lang
JohnBat26 has joined #ruby-lang
mistym has joined #ruby-lang
areil has quit [Remote host closed the connection]
ryanf has joined #ruby-lang
mistym has quit [Remote host closed the connection]
senekis has quit [Quit: leaving o/]
thejspr has joined #ruby-lang
gsav has joined #ruby-lang
runeb has joined #ruby-lang
gsav has quit [Ping timeout: 260 seconds]
saxy has joined #ruby-lang
saxy has quit [Remote host closed the connection]
rohit_ has joined #ruby-lang
runeb has quit [Ping timeout: 255 seconds]
synthetix has quit [Ping timeout: 246 seconds]
ryanlecompte has joined #ruby-lang
chrislgibson has joined #ruby-lang
Nisstyre_ has joined #ruby-lang
aetcore has joined #ruby-lang
chrislgibson has quit [Ping timeout: 264 seconds]
Nisstyre has quit [Read error: Operation timed out]
Nisstyre_ has quit [Read error: Connection reset by peer]
Nisstyre has joined #ruby-lang
BigO has joined #ruby-lang
Kyril has quit [Quit: Quitte]
savage- has quit [Quit: savage-]
yxhuvud has joined #ruby-lang
runeb has joined #ruby-lang
brianpWins has joined #ruby-lang
floyd2_ has quit [Ping timeout: 268 seconds]
lianj has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby-lang
runeb has quit [Ping timeout: 240 seconds]
rippa has joined #ruby-lang
retro|cz has quit [Ping timeout: 244 seconds]
BigO has quit [Remote host closed the connection]
tonni has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
ground has joined #ruby-lang
cardoni has quit [Quit: cardoni]
Aria has quit [Remote host closed the connection]
saxy has joined #ruby-lang
krohrbaugh has joined #ruby-lang
RantriX has quit [Read error: Connection reset by peer]
slaytanic has quit [Ping timeout: 260 seconds]
chrislgibson has joined #ruby-lang
saxy has quit [Ping timeout: 265 seconds]
slaytanic has joined #ruby-lang
Elico has quit [Quit: elico]
|Vargas| has joined #ruby-lang
|Vargas| has quit [Changing host]
|Vargas| has joined #ruby-lang
runeb has joined #ruby-lang
chrislgibson has quit [Ping timeout: 246 seconds]
stonerfish has quit [Quit: Leaving.]
saxy has joined #ruby-lang
havenn has joined #ruby-lang
ground has quit [Ping timeout: 252 seconds]
saxy has quit [Read error: Connection reset by peer]
saxy_ has joined #ruby-lang
saxy_ has quit [Remote host closed the connection]
rohit_ has quit [Quit: Leaving]
saxy has joined #ruby-lang
runeb has quit [Ping timeout: 240 seconds]
agile has quit [Ping timeout: 245 seconds]
saxy has quit [Ping timeout: 260 seconds]
aetcore_ has joined #ruby-lang
jarred has joined #ruby-lang
jarred has quit [Quit: jarred]
aetcore has quit [Ping timeout: 246 seconds]
k4k1_c0der has joined #ruby-lang
k4k1c0der has joined #ruby-lang
k4k1c0der has quit [Client Quit]
aetcore has joined #ruby-lang
aetcore_ has quit [Read error: Connection reset by peer]
thillux has quit [Remote host closed the connection]
qwerxy has joined #ruby-lang
runeb has joined #ruby-lang
agile has quit [Ping timeout: 246 seconds]
hinbody has joined #ruby-lang
KA_ has joined #ruby-lang
runeb has quit [Ping timeout: 256 seconds]
rue|w has joined #ruby-lang
saxy has quit [Remote host closed the connection]
cschwartz has joined #ruby-lang
robbyoconnor has quit [Quit: Konversation terminated!]
<mfn>
Using sequel, I'm construction a query like: db[:table].where('etc.etc.').select(:id, :foo).each do ... it's a big database, takes along time. Is there a way to start iteration right when the first data receives, i.e. an running an unbuffered query (I'm using the mysql adapter).
<drbrain>
mfn: so the query takes under 10ms but the row retrieval takes seconds?
ruurd has joined #ruby-lang
KnowTheLedge has quit []
<mfn>
drbrain: yes, that would describe it as well too. The query itself isn't complex, but it's a lot of data for every row. I'ld like to be able to process data as it comes in, not wait for the whole query being received. In PHP this is doable, at least for mysql, with the mysql_unbuffered_query function, hence my term unbuffered. But I realize that's different in Ruby, but don't know how or if possible.
<drbrain>
I don't know much about sequel, but you should ensure that the problem isn't missing indexes or poor query construction
<mfn>
no, it's the amount of data; I'm pretty seure.
<drbrain>
I'm pretty sure you can do this with the mysql gems directly, but I don't know if sequel gives you that capability
chrislgibson has joined #ruby-lang
unsymbol has quit [Ping timeout: 252 seconds]
robbyoconnor has joined #ruby-lang
workmad3 has joined #ruby-lang
unsymbol has joined #ruby-lang
chrislgibson has quit [Ping timeout: 246 seconds]
rolfb has joined #ruby-lang
andrewhl has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
lianj has joined #ruby-lang
lianj has joined #ruby-lang
lianj has quit [Changing host]
richardjapenga has joined #ruby-lang
<apeiros_>
hrm, the banister is away…
<rue|w>
Aww
<erikh>
mfn: how many rows?
<mfn>
erikh: not a lot, 2700. But quite some amount of data per row
<erikh>
ah
<erikh>
and you're sure execution time or network transfer isn't the bottleneck?
<erikh>
if they aren't, it's probably spending a lot of time in type coercion
<mfn>
erikh: I get the impression it waits till the complete query is there
<erikh>
which is usually a great time to throw away your favorite database abstraction layer and go directly
runeb has joined #ruby-lang
<erikh>
oh, I see. might want to hop into #sequel and ask, or step around it
<erikh>
depends on what really suits you better.
<mfn>
thanks
cyri_ has joined #ruby-lang
<erikh>
how much data per row are we talking?
<erikh>
and what kind of data?
havenn has quit [Remote host closed the connection]
moonglum has joined #ruby-lang
qwerxy has quit [Quit: offski]
<mfn>
erikh: mysql "longtext", avg. byte length is 42kb
<erikh>
just one column that way or several?
cyri_ has quit [Client Quit]
<erikh>
sorry for the 20 q's, just trying to get an idea.
<drbrain>
Just viewed rdoc's README with ri
<erikh>
oh, that's hot.
<erikh>
drbrain: does it handle markdown too?
<drbrain>
erikh: yup
<erikh>
<3
tonni has joined #ruby-lang
<erikh>
now make it read from github repositories and ln -s ri lynx
<erikh>
:P
<drbrain>
ha
<mfn>
erikh: np :) it's one column
<erikh>
is 4 out yet?
<erikh>
or is that what this is leading to?
<drbrain>
this is leading to RDoc 4
<mfn>
(I'm fetching others too but they are not big)
<erikh>
mfn: that's not too bad, it's probably something else then.
<drbrain>
RDoc 4 won't need to generate static HTML
<erikh>
if nothing else, do it with your native library just to see if that steps around it. then your guns are loaded.
<erikh>
drbrain: yeah, I remember you telling me about that.
<drbrain>
which means I needed to add pages to the ri data store
<erikh>
glad you're heading in that direction and not the other
<drbrain>
so it didn't make any sense to not add that ability to ri
<mfn>
erikh: thanks, I guess I will leave it how it is then.
<erikh>
I think I'm the last person on earth that lives in ri
<erikh>
I got mocked the other day at work
* erikh
feels old
<erikh>
drbrain: have you ever seen 'pinfo'?
brianpWins has quit [Quit: brianpWins]
<drbrain>
pno
<drbrain>
no
<erikh>
heh
<erikh>
it's an info page browser that more-or-less works like elinks or lynx
<erikh>
not an easy problem, but I think it'd be pretty cool to do something like that for ri
<drbrain>
github.com/rdoc/rdoc-browser
<drbrain>
it's not finished, though
<erikh>
you can walk the docs, highlight a reference and press right arrow to move to the reference page, etc
runeb has quit [Ping timeout: 240 seconds]
<erikh>
gonna fork that
<erikh>
call it mcrib
<erikh>
then yank the gem in a month
<erikh>
then republish it 2 years later and say "it's back"
<drbrain>
mostly because Curses::Pad doesn't exist until ruby 2.0
<erikh>
ah
<drbrain>
erikh: even better, only allow downloads from select markets
<erikh>
ooh
<erikh>
I like where this is going
<drbrain>
(in the 80's the McRib wasn't available nationwide)
<erikh>
yeah, I remember having one
<erikh>
I remember it very well
vlad_starkov has joined #ruby-lang
<erikh>
they also had something when I worked there that was this burger that was topped with teriyaki onions and cheese whiz
<erikh>
really
beckettsfool has quit [Quit: This computer has gone to sleep]
<erikh>
I mean, props to them for experimenting I guess
dc5ala has joined #ruby-lang
heftig has joined #ruby-lang
<drbrain>
McCheeseSteak?
qwerxy has joined #ruby-lang
<erikh>
that's the thing, I think it was pushed as some oriental thing
<erikh>
oh! one last quick story
<erikh>
so all the sauces, like ketchup and mustard and mayo were in these gun-like things
<erikh>
you'd pull the trigger and "plop" some ketchup would come out
<drbrain>
Dick's had the same thing for evenness
voker57 has joined #ruby-lang
<erikh>
someone there figured out the mayo gun had extremely high tension
<erikh>
so you could hit someone with a dollop of mayo from across the kitchen
<erikh>
oh yeah, and pickles get sticky when you grill them
<erikh>
so we'd grill the pickles for a few seconds and then flip them with the spatula on to the ceiling
<drbrain>
hah
agarcia has joined #ruby-lang
<erikh>
you get really creative when you're 16 at 11pm at night with no customers
KA_ has quit [Quit: KA_]
<drbrain>
when I went to the McD in Enumclaw at 11PM they were all stoned
<erikh>
hahah
<erikh>
yeah, I worked at a plaid pantry in pdx where we had a staff bong in the drinks cooler
<erikh>
pretty much anyone you talked to there from management down was permabaked
vlad_starkov has quit [Remote host closed the connection]
chrislgibson has quit [Ping timeout: 246 seconds]
villainate has joined #ruby-lang
<villainate>
i have a struct that has been encoded into a json string. JSON.parse gives me a json object, but i cant figure out how to create a struct from (for example) json_object['my_struct'].
<villainate>
json_object['my_struct'] is just a string
<villainate>
so how can i reconstruct a struct from a string?
wyhaines has quit [Read error: Connection reset by peer]
blacktulip has quit [Remote host closed the connection]
blacktulip has joined #ruby-lang
chrislgibson has joined #ruby-lang
svyatov has quit [Quit: svyatov]
svyatov has joined #ruby-lang
kurko_ has joined #ruby-lang
chrislgibson has quit [Ping timeout: 246 seconds]
horsey has joined #ruby-lang
richardjburton has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
areil has joined #ruby-lang
runeb has quit [Remote host closed the connection]
richardjburton has quit [Client Quit]
mwjcomputing has joined #ruby-lang
horsey has quit [Ping timeout: 246 seconds]
dc5ala has quit [Quit: Ex-Chat]
aetcore_ has joined #ruby-lang
aetcore_ has quit [Remote host closed the connection]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
aetcore has quit [Ping timeout: 245 seconds]
josephholsten has quit [Quit: josephholsten]
robbyoconnor has quit [Ping timeout: 252 seconds]
asaaki has joined #ruby-lang
saxy has joined #ruby-lang
richardjburton has joined #ruby-lang
saxy has quit [Ping timeout: 252 seconds]
fsvehla has quit [Quit: fsvehla]
fsvehla has joined #ruby-lang
fsvehla has quit [Client Quit]
fsvehla has joined #ruby-lang
fsvehla has quit [Client Quit]
fsvehla has joined #ruby-lang
fsvehla has left #ruby-lang [#ruby-lang]
fsvehla has joined #ruby-lang
richardjburton has quit [Quit: Computer has gone to sleep.]
m3nd3s has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
stardiviner has joined #ruby-lang
mistym has quit [Remote host closed the connection]
gix- has quit [Ping timeout: 265 seconds]
gix has joined #ruby-lang
dous has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 248 seconds]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
gjaldon has quit [Quit: Leaving]
asaaki has quit [Remote host closed the connection]
asaaki has joined #ruby-lang
ttilley has quit [Quit: ttilley]
agile has joined #ruby-lang
tonni has quit [Remote host closed the connection]
tonni has joined #ruby-lang
datanoise has joined #ruby-lang
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
stiang has joined #ruby-lang
thisirs has joined #ruby-lang
kgrz has joined #ruby-lang
wyhaines has joined #ruby-lang
wyhaines_ has quit [Read error: Connection reset by peer]
nyuszika7h has joined #ruby-lang
nyuszika7h has quit [Disconnected by services]
BigO has joined #ruby-lang
horsey has joined #ruby-lang
nyuszika7h has joined #ruby-lang
Hakon has joined #ruby-lang
rue|w has quit [Ping timeout: 246 seconds]
horsey has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby-lang
jxie has joined #ruby-lang
outoftime has joined #ruby-lang
masterkorp has left #ruby-lang ["WeeChat 0.3.2"]
mistym has quit [Remote host closed the connection]
davidbalber|away is now known as davidbalbert
kgrz has quit [Quit: Computer has gone to sleep.]
kgrz has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
gsav has joined #ruby-lang
nitti has joined #ruby-lang
floyd2 has joined #ruby-lang
floyd2 has quit [Client Quit]
floyd2 has joined #ruby-lang
ryanlecompte has quit [Remote host closed the connection]
pnbeast has quit [Quit: = Let's blow this popsicle stand.]
thillux has joined #ruby-lang
thillux has quit [Remote host closed the connection]
intellitech has quit [Quit: This computer has gone to sleep]
Nisstyre has joined #ruby-lang
strst has quit [Quit: Page closed]
KA_ has joined #ruby-lang
cultureulterior_ has quit [Quit: cultureulterior_]
workmad3 has quit [Ping timeout: 240 seconds]
Aiur has quit [Quit: Computer has gone to sleep.]
qwerxy has quit [Quit: offski]
aetcore_ has quit [Ping timeout: 240 seconds]
slyphon has joined #ruby-lang
<zenspider>
horsey: that's horrible
<horsey>
zenspider: yeah...but i do sometimes do things like this array.tap(&:pop)
<horsey>
i rarely chain things though
<zenspider>
that's also horrible
aetcore has joined #ruby-lang
<zenspider>
I have the herrington book. meh. code generation is passe
aetcore has quit [Remote host closed the connection]
aetcore has joined #ruby-lang
<horsey>
zenspider: really? why?
qwerxy has joined #ruby-lang
<zenspider>
which? code generation? see whitequark's comment. if you're generating code in a dynamic language you're doing it wrong.
Dan- has joined #ruby-lang
<rue>
Code generation as in creating actual source code
richardjortega has quit [Read error: No route to host]
richardjortega has joined #ruby-lang
slyphon has quit [Read error: Connection reset by peer]
solars has quit [Ping timeout: 248 seconds]
slyphon has joined #ruby-lang
Dan- has quit [Remote host closed the connection]
Dan- has joined #ruby-lang
aetcore_ has joined #ruby-lang
dankest has quit [Read error: Connection reset by peer]
nitti_ has quit [Remote host closed the connection]
<horsey>
zenspider: well, doesn't 'hoe' do code generation, in so far as it has templates?
herpless_ has joined #ruby-lang
herpless has quit [Read error: Connection reset by peer]
aetcore has quit [Ping timeout: 260 seconds]
gsav has quit [Ping timeout: 260 seconds]
outoftime has quit [Quit: Leaving]
davidbalbert is now known as davidbalber|away
davidbalber|away is now known as davidbalbert
aetcore_ has quit []
saxy has joined #ruby-lang
aetcore has joined #ruby-lang
havenn has joined #ruby-lang
KA_ has quit [Quit: KA_]
<zenspider>
horsey: oh please. creating a rakefile and a stubbed out impl/test is not code generation.
KA_ has joined #ruby-lang
davidbalbert is now known as davidbalber|away
davidbalber|away is now known as davidbalbert
<horsey>
zenspider: ah ok, i wasn't sure about hoe. but 'bones' def. generates code for you (assuming i know what 'code generation' is, which i dont properly, yet :P)
<drbrain>
many SOAP libraries perform code generation
davidbalbert is now known as davidbalber|away
<drbrain>
take this interface definition and turn it into classes and methods
qwerxy has quit [Quit: offski]
mistym has quit [Remote host closed the connection]
<Spaceghostc2c>
whitequark: There are some situations where just doing it at boot won't suffice. Use the lesser of two evals.
<horsey>
drbrain: so do you think learning robust code generation is a worthwhile skill?
apeiros has quit []
<drbrain>
horsey: for ruby? not really
qwerxy has joined #ruby-lang
<Spaceghostc2c>
horsey: I'd say to learn it so you can learn to not use it. My quote on it is "Always use the lesser of two evals" while preferring none at all.
<drbrain>
I worked with SOAP (via UPnP) and I metaprogrammed classes from the interface definition, I didn't generate any code
<Spaceghostc2c>
drbrain: Ah, so differentiating between the two methods?
<drbrain>
yes, the book mentioned previously is about generating files that you then use later
<Spaceghostc2c>
Ah.
<Spaceghostc2c>
Yeah, I sometimes write generators, but when I do, it's for someone else.
<Spaceghostc2c>
horsey: drbrain is right. There's metaprogramming and then there's code generation.
datanoise has quit [Ping timeout: 260 seconds]
<horsey>
Spaceghostc2c: i need to do actual code generation though, afaik, it's not really runtime stuff, it's generating .rb files
<drbrain>
freedrull: the other end hung up on you, doesn't seem to be an SSL certificate problem, you'd get a different error with words like "Certificate" in it
<Spaceghostc2c>
horsey: Yeah, there's tools for that, but it's not really a 'skill' you learn, imo.
<Spaceghostc2c>
It's a nifty timesaver you can pick up quickly.
<freedrull>
drbrain: ok
singpolyma has quit [Ping timeout: 260 seconds]
<Spaceghostc2c>
If you're up on your ruby, should take you maybe a day. Two to learn how to do nice gems with generators.
slyphon has quit [Ping timeout: 245 seconds]
<horsey>
Spaceghostc2c: well it's pretty easy just to wing it, but i'm wondering if there's any interesting patterns i could use
<Spaceghostc2c>
horsey: "Don't suck" is my personal favorite.
<drbrain>
horsey: in that case, just get the book
<drbrain>
it'll steer you around all the typical pitfalls
<Spaceghostc2c>
^
<drbrain>
(I've read it)
<eam>
is it safe to modify a Hash while iterating it?
<Harzilein>
zenspider: now i want to turn that into "<ul><li>Foo</li>\n...</ul>"
<eyda|mon>
zenspider: thank you
BigO has quit [Remote host closed the connection]
qwerxy has joined #ruby-lang
<Harzilein>
zenspider: so what i want is something that when given an array of offset/length tuples will give me an array of string slices
<zenspider>
I... no
<zenspider>
just no
<erikh>
what do p and l mean in that context?
<Harzilein>
zenspider: preferably without having to do calculations in the loop, i.e. i'm aware that i could split the original string at offset + length, subtract that from the next offset, split the tail end etc.
<Harzilein>
erikh: position and length
<erikh>
yep
<zenspider>
just no. there's no ... no.
<zenspider>
no
<zenspider>
no
<zenspider>
no
<erikh>
what zenspider just said
nitti has joined #ruby-lang
<erikh>
Harzilein: strong suggestion: find a better way to solve the problem you're solving.
<heftig>
that's a horrible way of representing xml
<Harzilein>
it's not actually xml
<Harzilein>
that is the format used in google docs
<zenspider>
EVEN BETT.... no
<Harzilein>
they start with plaintext, then list the ranges they want to format
<erikh>
you can't get a saner format out of them?
<Harzilein>
i want to parse it. it's not my idea to represent it that way
<erikh>
like... (and I can't believe I'm saying this) HTML?
<Harzilein>
erikh: i specifically want the representation they use themselves, not one that got put through some black box converter: because i can't put that one back.