ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
thinkdevcode has joined #ruby-lang
jbsan has quit [Quit: JB.. OUT!]
jbsan has joined #ruby-lang
<zenspider> rawr
wyhaines has quit [Remote host closed the connection]
jgomez has joined #ruby-lang
hackeron has quit [Ping timeout: 260 seconds]
lcdhoffman has joined #ruby-lang
Madis has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0/20120830123745]]
irleif has quit [Quit: Computer has gone to sleep.]
ChadStudmuffin has joined #ruby-lang
* zenspider winks at ChadStudmuffin
hackeron has joined #ruby-lang
ChadStudmuffin has left #ruby-lang [#ruby-lang]
justinmc_ has quit [Ping timeout: 265 seconds]
justinmcp has joined #ruby-lang
apeiros_ has joined #ruby-lang
<zenspider> hahaha! my plan worked!
nitti has joined #ruby-lang
thinkdevcode has quit [Remote host closed the connection]
Averna has joined #ruby-lang
nitti has quit [Ping timeout: 244 seconds]
slyphon has joined #ruby-lang
wyhaines has joined #ruby-lang
apeiros_ has quit [Ping timeout: 260 seconds]
perryh has quit [Excess Flood]
<tdy> say i have something like this:
<tdy> "(%2d,%2d)" % [x,y]
<tdy> but i want the %2d to change to %4d for four-digit numbers, %8d for eight-digits, etc
<tdy> any clean way to do this?
<tdy> i don't want to zeropad for smaller numbers.. just adjust the width in a variable manner
<drbrain> tdy: you can do that too
perryh has joined #ruby-lang
<drbrain> tdy: "(%2$*1$d)" % [2, 5] # => "( 5)"
<tdy> oh wait.. looks like this works "(%#{width}d,%#{width}d" % [x,y]
<drbrain> tdy: "(%2$*1$d)" % [8, 5] # "( 5)"
<tdy> ohh
<drbrain> "(%2$*1$d, %3$*1$d)" % [2, 5, 6] # => "( 5, 6)"
<drbrain> (width comes first)
jgomez has quit [Ping timeout: 248 seconds]
<drbrain> you can also use a hash, which is much easier to read...
<tdy> is this $*1$ called anything in particular?
rcassidy has quit [Ping timeout: 240 seconds]
<drbrain> tdy: maybe "absolute argument reference"
<drbrain> I'm looking at the table in `ri sprintf'
<tdy> ok thanks
<drbrain> hrm, looks like you can't do named arguments with named widths
<Spaceghostc2c> zenspider: I wrote a better singleton than the one in stdlib. I should be putting it online soon.
<Spaceghostc2c> I'll bother you again when I've pushed it.
<zenspider> oh please DO bother me again...
<Spaceghostc2c> zenspider: Will do. It'll be the highlight of my day. That's really sad though. Whatever.
<zenspider> tdy: personally I like your interpolated way better. I think it reads well
philiphale has left #ruby-lang [#ruby-lang]
flebel has quit [Excess Flood]
<tdy> zenspider: yea, i'm just reading to find out what the %2$*1$d thing even means
<tdy> just for future reference
Axsuul has joined #ruby-lang
flebel has joined #ruby-lang
<drbrain> tdy: %2$ is "use the second argument", * is "use the next argument reference as field width", 1$ is "the first argument", d is "decimal"
<tdy> ohh it's 3 things.. i was seeing it as %2$ and *1$
<zenspider> I think this is cleaner: "%*d" % [width, n]
<tdy> i only got got to the (digit)$ part in ri
<zenspider> there's no need to use the numbers w/o getting ugly
<tdy> oh that's nice too
<zenspider> but I still prefer "%#{width}d" % n
<drbrain> zenspider: then you need "%*d,%*d" % [width, x, width, y]
<zenspider> yes, you do... and that's infinitely clearer than your bullshit
<zenspider> the format stuff is too flexible, if anything
<zenspider> I assume you can mix in 0 and other flags if you want as well... %0*d
<tdy> yep 0 and - work at least
<tdy> thanks all
dhruvasagar has quit [Ping timeout: 245 seconds]
nertzy has joined #ruby-lang
toretore has quit [Quit: Leaving]
jbsan has quit [Quit: JB.. OUT!]
zomgbie_ has quit [Ping timeout: 252 seconds]
sailias has joined #ruby-lang
sailias has quit [Client Quit]
wyhaines has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
havenn has joined #ruby-lang
shtirlic has quit [Remote host closed the connection]
ryanlecompte has quit [Remote host closed the connection]
skipper has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
skipper is now known as Guest16243
<matti> ;]
therod has quit [Quit: Leaving...]
senekis has quit [Remote host closed the connection]
Nisstyre has quit [Ping timeout: 240 seconds]
Guest16243 has quit [Ping timeout: 252 seconds]
havenn has quit [Remote host closed the connection]
<erikh> maybe i'm misunderstanding something, isn't "variable width padding" another way of saying "no padding"?
ChadStudmuffin has joined #ruby-lang
<tdy> yea i realized i didn't explain it well
lsegal has joined #ruby-lang
<drbrain> variable => vary the
<tdy> i also shouldn't have said "change it to %4d if it's a four-digit number"
<tdy> b/c in that case, it's literally no padding
zomgbie has joined #ruby-lang
<erikh> that's exactly where my head went
<erikh> %d # bam, "variable width padding"
<erikh> :P
<tdy> heh
nitti has joined #ruby-lang
wyhaines has joined #ruby-lang
cranej has joined #ruby-lang
__butch__ has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
nitti has quit [Ping timeout: 268 seconds]
havenn has joined #ruby-lang
ryanf has joined #ruby-lang
zomgbie has quit [Read error: Operation timed out]
VGoff_afk is now known as VGoff
Bwild has quit [Ping timeout: 252 seconds]
Boohbah_ has quit [Changing host]
Boohbah_ has joined #ruby-lang
Boohbah_ has joined #ruby-lang
Boohbah_ is now known as Boohbah
havenn has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
flebel has quit [Excess Flood]
flebel has joined #ruby-lang
hakunin has joined #ruby-lang
therod has joined #ruby-lang
enebo has joined #ruby-lang
therod has quit [Ping timeout: 244 seconds]
zomgbie has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
sush24 has quit [Quit: This computer has gone to sleep]
zomgbie has quit [Ping timeout: 268 seconds]
bfreeman has joined #ruby-lang
Oloryn_lt2 has quit [Quit: Leaving.]
krohrbaugh has joined #ruby-lang
justinseiter has joined #ruby-lang
lcdhoffman has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
Caius has quit [Ping timeout: 252 seconds]
hinbody has quit [Ping timeout: 252 seconds]
therod has joined #ruby-lang
hinbody has joined #ruby-lang
alvaro_o has quit [Quit: Ex-Chat]
lcdhoffman has quit [Quit: lcdhoffman]
nitti has joined #ruby-lang
stardiviner has joined #ruby-lang
therod has quit [Ping timeout: 272 seconds]
Caius has joined #ruby-lang
thone_ has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
nitti has quit [Ping timeout: 240 seconds]
krohrbaugh has joined #ruby-lang
thone has quit [Ping timeout: 255 seconds]
brianpWins has quit [Quit: brianpWins]
Nisstyre has joined #ruby-lang
justinseiter has quit [Ping timeout: 255 seconds]
swarley has quit [Ping timeout: 260 seconds]
zomgbie has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
rdavila has quit [Quit: rdavila]
zomgbie has quit [Ping timeout: 244 seconds]
nettsundere has quit [Remote host closed the connection]
justinmcp has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 245 seconds]
areil has joined #ruby-lang
ttilley has quit [Quit: ttilley]
therod has joined #ruby-lang
wyhaines_ has joined #ruby-lang
wyhaines has quit [Read error: Connection reset by peer]
cosah has joined #ruby-lang
nitti has joined #ruby-lang
sush24 has joined #ruby-lang
nertzy has quit [Quit: This computer has gone to sleep]
therod has quit [Ping timeout: 244 seconds]
nitti has quit [Ping timeout: 276 seconds]
gus has joined #ruby-lang
gus has quit [Client Quit]
hakunin has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
enebo has quit [Quit: enebo]
lcdhoffman has quit [Quit: lcdhoffman]
Bwild has joined #ruby-lang
zomgbie has joined #ruby-lang
thinkdevcode has joined #ruby-lang
hakunin has joined #ruby-lang
dmwuw has joined #ruby-lang
zomgbie has quit [Ping timeout: 255 seconds]
jgomez has joined #ruby-lang
amirinator has joined #ruby-lang
ryanf has quit [Quit: leaving]
postmodern has quit [Ping timeout: 276 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
therod has joined #ruby-lang
postmodern has joined #ruby-lang
__butch__ has joined #ruby-lang
nitti has joined #ruby-lang
__butch__ has quit [Remote host closed the connection]
therod has quit [Ping timeout: 244 seconds]
nitti has quit [Ping timeout: 244 seconds]
burgestrand has quit [Quit: Leaving.]
burgestrand has joined #ruby-lang
burgestrand has quit [Ping timeout: 272 seconds]
hakunin has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
cranej has quit [Ping timeout: 245 seconds]
mistym has quit [Remote host closed the connection]
macmartine has joined #ruby-lang
zomgbie has joined #ruby-lang
zomgbie has quit [Ping timeout: 268 seconds]
roadt` has joined #ruby-lang
roadt` has left #ruby-lang [#ruby-lang]
roadt` has joined #ruby-lang
burgestrand has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
therod has joined #ruby-lang
nitti has joined #ruby-lang
bluepojo has quit [Ping timeout: 246 seconds]
therod has quit [Ping timeout: 256 seconds]
nitti has quit [Ping timeout: 244 seconds]
ttilley has joined #ruby-lang
chendo has quit [Ping timeout: 260 seconds]
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
justinmcp has joined #ruby-lang
yxhuvud has joined #ruby-lang
apeiros_ has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
macmartine has quit [Quit: Computer has gone to sleep.]
ryanf has joined #ruby-lang
zomgbie has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
zomgbie has quit [Ping timeout: 255 seconds]
thatdutchguy has quit [Remote host closed the connection]
jxie_ has quit [Quit: leaving]
thatdutchguy has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 268 seconds]
thinkdevcode has quit [Remote host closed the connection]
thatdutchguy has quit [Ping timeout: 245 seconds]
sent-hil has joined #ruby-lang
<sent-hil> how do you implement a trampoline in ruby?
<sent-hil> the one blog post i found gives me stackoverflow error
sent-hil has quit [Remote host closed the connection]
therod has joined #ruby-lang
jgomez has quit [Remote host closed the connection]
nitti has joined #ruby-lang
therod has quit [Ping timeout: 244 seconds]
nitti has quit [Ping timeout: 244 seconds]
lun_ has joined #ruby-lang
dr_bob has joined #ruby-lang
mytrile has joined #ruby-lang
krz has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
ruurd has joined #ruby-lang
mfn has quit [Read error: Operation timed out]
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
mfn has joined #ruby-lang
zomgbie has joined #ruby-lang
rippa has joined #ruby-lang
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
zomgbie has quit [Ping timeout: 252 seconds]
ezkl has joined #ruby-lang
Bwild has quit [Read error: Operation timed out]
jarib has quit [Excess Flood]
JohnBat26 has joined #ruby-lang
sush24 has joined #ruby-lang
jarib has joined #ruby-lang
dmwuw has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 260 seconds]
<randym> sandbags: ping
Bwild has joined #ruby-lang
Bwild has quit [Ping timeout: 272 seconds]
therod has joined #ruby-lang
nitti has joined #ruby-lang
Assurbanipal has joined #ruby-lang
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
nitti has quit [Ping timeout: 244 seconds]
therod has quit [Ping timeout: 256 seconds]
rippa has quit [Ping timeout: 246 seconds]
stiang has joined #ruby-lang
benanne has joined #ruby-lang
<sandbags> randym: hi there, you must have eyes like a hawk
<zenspider> rawr
dhruvasagar has joined #ruby-lang
<yorickpeterse> Morning
<randym> nah, just lucky
<sandbags> randym: thanks for getting back to me
<randym> sandbags: no worries. What can I do for you?
<sandbags> i was having an issue with putting images into a spreadsheet, never having looked at VBA before (and by god!!!) but I did finally manage to get it to work modulo
<sandbags> the fact that it only links them, it doesn't embed them
<sandbags> i was looking at maybe using your lib to generate me the spreadsheet
<sandbags> since it seemed a good deal easier than figuring out excel macros
<sandbags> only cost me 1/8th of my soul
<randym> dear god yes....
<randym> if you are writing excel from Ruby, Ive got you covered, and it'll be good for your soul
<sandbags> well this is, hopefully, a one-off exercise
<sandbags> i might have to do it again if it doesn't work
<sandbags> and will def use your lib
<sandbags> the problem is that the images are linked, not embedded
<sandbags> seems even moving the spreadsheet (& linked images) to a new folder breaks the links!
<sandbags> which is the kind of insanity only MS can provide
<sandbags> so my solution is the spreadsheet, the macro to link the images, and a button to run it
ryanf has quit [Quit: leaving]
<sandbags> and sort it out the other end
<sandbags> what a pile of shit!!
<randym> I hope you are getting paid a huge amount of money for those hoops your jumping through.
<sandbags> such is my hope
dc5ala has joined #ruby-lang
hakunin has joined #ruby-lang
goshakkk has joined #ruby-lang
Assurbanipal has quit [Quit: Konversation terminated!]
robotmay has joined #ruby-lang
mars__ has joined #ruby-lang
brianpWins has joined #ruby-lang
runeb has joined #ruby-lang
blacktulip has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
justinmcp has quit [Remote host closed the connection]
zomgbie has joined #ruby-lang
gnufied has joined #ruby-lang
krz has quit [Ping timeout: 272 seconds]
Axsuul has quit [Ping timeout: 245 seconds]
justinmcp has joined #ruby-lang
Assurbanipal has joined #ruby-lang
zomgbie has quit [Ping timeout: 252 seconds]
valeri_ufo has quit [Quit: ...]
sush24 has quit [Quit: This computer has gone to sleep]
robotmay has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
robotmay has joined #ruby-lang
valeri_ufo has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
krz has joined #ruby-lang
rue|w has joined #ruby-lang
irleif has joined #ruby-lang
romeroabelleira has joined #ruby-lang
joast has quit [Ping timeout: 240 seconds]
therod has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
therod has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby-lang
stiang has quit [Quit: stiang]
futurechimp has joined #ruby-lang
shtirlic has joined #ruby-lang
apeiros_ has joined #ruby-lang
zomgbie has joined #ruby-lang
Madis has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
justinmcp has quit [Remote host closed the connection]
JohnBat26 has quit [Remote host closed the connection]
zz_chrismcg is now known as chrismcg
workmad3 has joined #ruby-lang
JohnBat26 has joined #ruby-lang
JohnBat26 has quit [Client Quit]
vlad_starkov has joined #ruby-lang
toretore has joined #ruby-lang
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
JohnBat26 has joined #ruby-lang
fsvehla has joined #ruby-lang
earthquake has quit [Quit: earthquake]
therod has joined #ruby-lang
sepp2k has joined #ruby-lang
kohgpat has joined #ruby-lang
kohgpat has quit [Client Quit]
nitti has joined #ruby-lang
runeb has quit [Remote host closed the connection]
runeb has joined #ruby-lang
nitti has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Remote host closed the connection]
davidw has joined #ruby-lang
<davidw> how would you spec out a test for a file.write failing?
Bwild has joined #ruby-lang
vlad_starkov has joined #ruby-lang
aflynn_ has quit [Quit: Ex-Chat]
pbjorklund has quit [Remote host closed the connection]
cultureulterior has joined #ruby-lang
rolfb has joined #ruby-lang
stiang has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
benanne has quit [Quit: kbai]
irleif has quit [Quit: Computer has gone to sleep.]
burgestrand has joined #ruby-lang
irleif has joined #ruby-lang
burgestrand has quit [Ping timeout: 276 seconds]
mars__ has quit [Quit: Leaving]
cosah has quit [Remote host closed the connection]
drbrain has quit [Read error: Connection reset by peer]
drbrain has joined #ruby-lang
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
justinseiter has joined #ruby-lang
<whitequark> davidw: mock it, probably
<whitequark> through I don't see much value in such a test in most cases.
<davidw> whitequark, s3fs
<whitequark> what conditions are you trying to simulate? I can think of two, I/O failure and no free space
<whitequark> ahh.
<whitequark> FUSE, right?
<davidw> yeah
<whitequark> my advice: don't use it. FUSE failure modes are awful.
nitti has joined #ruby-lang
<davidw> http://code.google.com/p/s3fs/wiki/FuseOverAmazon <- "Important Limitations"
<whitequark> your app will block on I/O
<whitequark> and it will block really hard if something is not responding
<davidw> whitequark, we're not terribly happy with it, but it's up in production... we'd need to rewrite to utilize something else to write to s3 directly
<whitequark> davidw: exactly
<whitequark> see, if you lose connectivity, your app will block forever. you couldn't even kill it with SIGKILL
<whitequark> because SIGKILL does not interrupt I/O
<whitequark> this is why you don't use s3fs/sshfs/whatever
Averna has quit [Quit: Leaving.]
<whitequark> POSIX filesystem abstraction just isn't suited for network operations.
<davidw> whitequark, it has actually worked fairly well so far, all things considered
<davidw> but yeah, we're coming to the conclusion that it's time to replace it
nitti has quit [Ping timeout: 244 seconds]
<whitequark> davidw: depends on your location
<whitequark> moscow, for example, has very bad connectivity with s3 for some reason. you won't have any luck putting anything over 200mb
<whitequark> and even with that, 1/10 operations will ECONNRESET
<davidw> it's an EC2 instance
<davidw> so it's pretty close
<zenspider> rawr
<whitequark> should be fine then, yeah
<whitequark> zenspider: are you a lion?
banisterfiend has joined #ruby-lang
<zenspider> something like that
justinseiter has quit [Remote host closed the connection]
<zenspider> making good progress on ruby_parser.
<whitequark> good to know!
<whitequark> I've already modified my infrastructure to work with both melbourne and RP, btw.
areil has quit [Ping timeout: 244 seconds]
<soahccc> What will happen if I extend a module via Module.send(:extend, OtherModule) to classes already included or extended it?
<zenspider> how you call something doesn't change what it does
<zenspider> and you can answer that question very easily in about 10 lines of example code
<banisterfiend> zenspider: what's up
<zenspider> not much... just overhauling ruby_parser
<zenspider> trying to get to beta
<zenspider> and I think this was the last big change for it
<zenspider> odd... DNS... my network is totally toast, but irc keeps going. *shrug*
<zenspider> just did about 1800 lines o' diff and made things a lot cleaner and more covered
<clocKwize> if its your dns then existing connections and cached dns entries are fine?
<clocKwize> inc irc..
<zenspider> assuming that's all it is... sure
<banisterfiend> zenspider: nice, i'm using ruby_parser to find me method definitions, but is there a way to get the corresponding line number in the file where the method definition appears?
<zenspider> just ask the sexp for the line
<soahccc> zenspider: My conclusion of my testing is that you can't inject functionality to modules just directly override it (if you mentioned me)
<whitequark> zenspider: I guess you've meant "idempotent"
<banisterfiend> zenspider: awesome! is it pretty reliable on 1.9 code now?
<zenspider> banisterfiend: its... alpha... soooo... no
<zenspider> whitequark: ??
Mon_Ouie has joined #ruby-lang
justinmcp has joined #ruby-lang
<banisterfiend> Mon_Ouie: 'alut
<Mon_Ouie> 'alut
<zenspider> you ppl talk funny... speak ruby like god intended
<injekt> heh
<whitequark> zenspider: #extend and #include are idempotent
<zenspider> what does that have to do with anything? also, not really... #included/#extended is triggered so extra side effects are possible... tho I have yet to abuse that.
<zenspider> OOOH. no. I was commenting on using #send vs calling directly not changing how a method works.
vlad_starkov has joined #ruby-lang
earthquake has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 244 seconds]
postmodern has quit [Quit: Leaving]
nitti has joined #ruby-lang
shtirlic has quit [Remote host closed the connection]
nitti has quit [Ping timeout: 244 seconds]
banisterfiend has quit [Remote host closed the connection]
karel has joined #ruby-lang
karel is now known as Guest62844
cultureulterior_ has joined #ruby-lang
therod has quit [Quit: Leaving...]
cultureulterior has quit [Ping timeout: 244 seconds]
futurechimp has quit [Quit: Leaving]
Guest62844 has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/2012101000]]
postmodern has joined #ruby-lang
postmodern has quit [Quit: Leaving]
karel_ has joined #ruby-lang
<whitequark> zenspider: Idempotence ( /ˌaɪdɨmˈpoʊtəns/ eye-dəm-poh-təns) is the property of certain operations in mathematics and computer science, that they can be applied multiple times without changing the result beyond the initial application.
Assurbanipal has quit [Quit: Konversation terminated!]
<whitequark> except for the fact that #include mutates the class, it adheres to this definition. and the definition does not cover mutation.
<whitequark> that is, the callbacks are triggered once, just like the mutation of ancestrance chain itself
<whitequark> oh, disregard what I said, they are not.
<whitequark> through I have no idea who would actually want that.
carloslopes has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
karel_ has quit [Quit: Konversation terminated!]
karel_ has joined #ruby-lang
<zenspider> I know what the fucking word means...
therod has joined #ruby-lang
<zenspider> and it is again irrelevant to anything previously mentioned above
<zenspider> btw... I just closed several of your tickets on ruby_parser...
<zenspider> aaand it is 5am... laters
tsou has quit [Quit: leaving]
<zenspider> ruby_parser 3.0.0.a10 released
<andrewvos> Umm, the heroku gem is now deprecated?
<andrewvos> And I have to install a .pkg :/
therod has quit [Ping timeout: 264 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
justinram has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
<zenspider> ok. sleep. for reals
fsvehla has joined #ruby-lang
fsvehla has quit [Client Quit]
justinmcp has joined #ruby-lang
nitti has joined #ruby-lang
benanne has joined #ruby-lang
<andrewvos> Is mperham in here?
nitti has quit [Ping timeout: 244 seconds]
mwjcomputing has joined #ruby-lang
robotmay has quit [Ping timeout: 244 seconds]
gix has quit [Ping timeout: 256 seconds]
robotmay has joined #ruby-lang
lemon__ has joined #ruby-lang
lemon__ has quit [Client Quit]
gix has joined #ruby-lang
chrismcg is now known as zz_chrismcg
richo has joined #ruby-lang
therod has joined #ruby-lang
<richo> keys = rb_funcall(_envp, rb_intern("keys"), 0); # This returns an RArray of the values in my hash.. am I doing soemthing stupid? As a secondary question, is there a better way to get all the keys in a hash?
justinmcp has quit [Ping timeout: 245 seconds]
codefyre has joined #ruby-lang
Bwild has quit [Ping timeout: 268 seconds]
therod has quit [Ping timeout: 255 seconds]
codefyre has quit [Quit: Leaving]
justinmcp has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 244 seconds]
shtirlic has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
justinmcp has quit [Ping timeout: 244 seconds]
voker57 has quit [Ping timeout: 252 seconds]
Uranio has joined #ruby-lang
mistym has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
charliesome has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
justinmcp has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
cantonic_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
mistym has quit [Remote host closed the connection]
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
robotmay_ has joined #ruby-lang
Bwild has joined #ruby-lang
slyphon has joined #ruby-lang
robotmay has quit [Ping timeout: 240 seconds]
lun_ has quit [Remote host closed the connection]
ruurd has quit [Quit: Leaving...]
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
nitti has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
goshakkk has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
nitti has quit [Ping timeout: 240 seconds]
Mon_Ouie has joined #ruby-lang
cldwalker_ has joined #ruby-lang
justinra_ has joined #ruby-lang
justinram has quit [Read error: Connection reset by peer]
slyphon has quit [Ping timeout: 245 seconds]
mmealling has quit [Quit: Leaving.]
lcdhoffman has joined #ruby-lang
justinra_ has quit [Read error: Connection reset by peer]
justinram has joined #ruby-lang
robotmay has joined #ruby-lang
robotmay_ has quit [Ping timeout: 246 seconds]
gsav has quit [Read error: Connection reset by peer]
justinram has quit [Read error: Connection reset by peer]
justinram has joined #ruby-lang
sailias has joined #ruby-lang
therod has joined #ruby-lang
karel_ has quit [Ping timeout: 276 seconds]
robotmay has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby-lang
zomgbie has quit [Ping timeout: 260 seconds]
therod has quit [Ping timeout: 244 seconds]
robotmay has joined #ruby-lang
mwjcomputing has quit [Quit: Leaving]
retro|cz has joined #ruby-lang
irleif has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
outoftime has joined #ruby-lang
robotmay_ has joined #ruby-lang
Uranio has quit [Quit: WeeChat 0.3.8]
rippa has joined #ruby-lang
richo has quit [Quit: laterz, norbs.]
robotmay has quit [Ping timeout: 240 seconds]
joast has joined #ruby-lang
robotmay_ has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
robotmay has joined #ruby-lang
cultureulterior_ has quit [Quit: cultureulterior_]
romeroabelleira has quit [Remote host closed the connection]
cultureulterior has joined #ruby-lang
stiang has quit [Quit: stiang]
cultureulterior_ has joined #ruby-lang
cultureulterior has quit [Read error: Connection reset by peer]
justinram has quit [Remote host closed the connection]
rue|w has quit [Remote host closed the connection]
gnufied has quit [Quit: Leaving.]
slyphon has joined #ruby-lang
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
therod has joined #ruby-lang
nitti has joined #ruby-lang
mmealling has joined #ruby-lang
gnufied has joined #ruby-lang
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
coryf has joined #ruby-lang
bastilian has joined #ruby-lang
zomgbie has joined #ruby-lang
Serial_Killer_C has joined #ruby-lang
lun_ has joined #ruby-lang
zomgbie has quit [Read error: Operation timed out]
mwjcomputing has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
lcdhoffman has quit [Quit: lcdhoffman]
flebel has quit [Excess Flood]
flebel has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
<manveru> transcript? or at least a tl;dr?
<totallymike> Not unless you subscribe, unfortunately. It's worth the four minutes it takes to watch though.
lcdhoffman has joined #ruby-lang
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
karel_ has joined #ruby-lang
<totallymike> It's basically about how to use singleton objects as immutable constant objects when you don't need state, and Avdi demonstrates it in the context of a short Conway's Game of Life simulator.
<totallymike> Avdi Grimm is an excellent dude; his work is worth supporting.
karel_ has quit [Client Quit]
blazes816 has quit [Quit: blazes816]
karel_ has joined #ruby-lang
clocKwize has quit [Remote host closed the connection]
ddfreyne has quit [Excess Flood]
krohrbaugh has quit [Quit: Leaving.]
ddfreyne has joined #ruby-lang
irleif has quit [Quit: Computer has gone to sleep.]
apeiros_ has quit [Remote host closed the connection]
<manveru> heh, i know him
lun_ has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 255 seconds]
senekis has joined #ruby-lang
<manveru> oh well, that was a waste of time :(
sepp2k has quit [Read error: Connection reset by peer]
<manveru> and he didn't even show singleton.rb
<injekt> I assumed that was the point behind it, too
lun_ has joined #ruby-lang
<manveru> or module_function
cschwartz has quit [Ping timeout: 276 seconds]
<totallymike> I thought it was pretty good
<totallymike> it's a four minute video, and it expresses its message clearly
dhruvasagar has quit [Ping timeout: 260 seconds]
<totallymike> It's not about preventing multiple objects of a class from being created, it's about using a singleton as a sort of value, like true or false or nil
<manveru> totallymike: don't get me wrong, i think it's good, just not interesting if you've done ruby a lot :)
<totallymike> Fair. I've only been doing Ruby for a few months, and I'm still absorbing as much as I can about Ruby OO best practices, so I'm into things like RubyTapas and DestroyAllSoftware and such
<manveru> my idiom for that would be: alive = Object.new{ def x; end }.new
<manveru> sorry, .new too much
cultureulterior_ has quit [Quit: cultureulterior_]
<totallymike> That's how he starts off in the video, isn't it?
chimkan has joined #ruby-lang
<manveru> >> alive = Class.new{ def to_s; 'hi'; end; }.new
cultureulterior has joined #ruby-lang
<manveru> => hi
<manveru> i even get that wrong :)
<manveru> but yeah, same thing all around
<manveru> however, if you use the first one, you can do DEAD_CELL.class.new
<totallymike> yeah
senekis has quit [Read error: Connection reset by peer]
<totallymike> However you're not killing anyone if you do that, just wasting memory.
<manveru> for a class instance without state?
<totallymike> right
bastilian has quit [Quit: Linkinus - http://linkinus.com]
cultureulterior has quit [Ping timeout: 245 seconds]
mikeneedshelp has joined #ruby-lang
<totallymike> if my understanding is correct (often it isn't)
jarib has quit [Excess Flood]
carloslopes has joined #ruby-lang
rdavila has joined #ruby-lang
jarib has joined #ruby-lang
<totallymike> As opposed to, say, a singleton that is stateful where it's a singleton because there MUST be only one of them, in which case if you go and force another to exist, you're introducing bugs
rue|w has joined #ruby-lang
anachronistic has joined #ruby-lang
<akahn> where should I look for mkmf.log when compiling native extensions fails? mkmf.log
rue|w has quit [Ping timeout: 260 seconds]
<manveru> find . -name mkmf.log
<darix> manveru: i bet he forgot to mention "while installing a gem"
<darix> so it is: calling "gem env" -> take gem paths -> look into $(gempath)/gems/gemname-version/ext/
<darix> something like that
carloslopes has quit [Ping timeout: 252 seconds]
enebo has joined #ruby-lang
<akahn> thanks
senekis has joined #ruby-lang
<akahn> apparently this server doesn't have `patch`. d'oh
robotmay has quit [Remote host closed the connection]
zomgbie has joined #ruby-lang
nignaztic has joined #ruby-lang
dfanjul has joined #ruby-lang
areil has joined #ruby-lang
nazty has quit [Ping timeout: 256 seconds]
romeroabelleira has joined #ruby-lang
zomgbie has quit [Ping timeout: 240 seconds]
<darix> why would a gem call "patch"?
<darix> o.O
therod has quit [Quit: Leaving...]
alvaro_o has joined #ruby-lang
gsav has joined #ruby-lang
cultureulterior has joined #ruby-lang
cultureulterior has quit [Client Quit]
ruskie has quit [Excess Flood]
gsav has quit [Read error: Connection reset by peer]
cultureulterior has joined #ruby-lang
fsvehla has joined #ruby-lang
Uranio has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
shtirlic has quit [Remote host closed the connection]
cultureulterior_ has joined #ruby-lang
thatdutchguy has joined #ruby-lang
GarethAdams has quit [Quit: Leaving...]
cultureulterior has quit [Ping timeout: 245 seconds]
romeroabelleira has quit [Remote host closed the connection]
ruskie has joined #ruby-lang
zomgbie has joined #ruby-lang
sush24 has joined #ruby-lang
VGoff is now known as VGoff_afk
fsvehla has quit [Quit: fsvehla]
dfanjul has quit [Ping timeout: 264 seconds]
th_ has left #ruby-lang [#ruby-lang]
<Uranio> if exist JRuby, I guest that cuold be a ruby for cellphones
wallerdev has joined #ruby-lang
krohrbaugh has joined #ruby-lang
havenn has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
Serial_Killer_C has joined #ruby-lang
nitti has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
nitti has joined #ruby-lang
irleif has joined #ruby-lang
goshakkk has joined #ruby-lang
runeb has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
Taranis has left #ruby-lang [#ruby-lang]
ryanlecompte has joined #ruby-lang
ruskie has quit [Excess Flood]
havenn_ has joined #ruby-lang
blazes816 has joined #ruby-lang
adambeynon has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
roadt` has quit [Ping timeout: 244 seconds]
<whitequark> Uranio: ruboto
<Uranio> humm.. android only.. well.. is something at less
<whitequark> j2me is too constrained anyway
<whitequark> not that anyone still uses it.
TheMoonMaster has quit [Ping timeout: 245 seconds]
<Uranio> whitequark: and ruboto is writed on j2me?
amirinat_ has joined #ruby-lang
amirinator has quit [Ping timeout: 272 seconds]
apeiros_ has quit [Remote host closed the connection]
rhizmoe has joined #ruby-lang
nignaztic has quit [Read error: Operation timed out]
TheMoonMaster has joined #ruby-lang
toertore has joined #ruby-lang
jxie has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
savage- has joined #ruby-lang
mbr has quit [Read error: Operation timed out]
x0F_ is now known as x0F
mbr has joined #ruby-lang
toretore has quit [Ping timeout: 256 seconds]
dRbiG has quit [Ping timeout: 256 seconds]
ryanlecompte has quit [Read error: Operation timed out]
dRbiG has joined #ruby-lang
apeiros_ has joined #ruby-lang
adityamenon has joined #ruby-lang
adityamenon has left #ruby-lang [#ruby-lang]
ruby-lang234 has joined #ruby-lang
nazty has joined #ruby-lang
ruskie has joined #ruby-lang
rdavila has quit [Quit: rdavila]
wiremaster has joined #ruby-lang
<wiremaster> hello everyone
<wiremaster> I am just getting started with RoR, and I am going to install Ruby on my Debian Squeeze
<wiremaster> I read on S.Overflow that installing via Debian's packages is obsolete
Serial_Killer_C has quit [Remote host closed the connection]
<wiremaster> but apparently ruby 1.9.3 is available from aptitude
<wiremaster> that appears to be the most recent version, can I just use that?
ruby-lang234 has quit [Ping timeout: 245 seconds]
<zzak> wiremaster: i would say rvm is probably the easiest way to avoid any problems, http://rvm.io also the people in #rvm on freenode are very helpful
<wiremaster> okay, thanks zzak, I'll use rvm
Serial_Killer_C has joined #ruby-lang
__butch__ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
runeb has joined #ruby-lang
thinkdevcode has joined #ruby-lang
davidw has quit [Read error: Operation timed out]
__butch__ has quit [Client Quit]
<matti> Hey zzak
<apeiros_> wiremaster: I wouldn't wonder if aptitude still had 1.9.3-p0 which is already a year old already. I wouldn't wonder either if they stayed on it for another 2 years… iow: apts track record wrt ruby is rather horrible
gearaholic has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
<wiremaster> ohkay
irleif has quit [Quit: Computer has gone to sleep.]
carloslopes has joined #ruby-lang
<wiremaster> ...why are Ruby version numbers so small, when actually large parts of the language change, apparently?
runeb has quit [Ping timeout: 240 seconds]
sailias has quit [Quit: Leaving.]
<wiremaster> ten years old... and only 1.9.3? I'm merely curious, no negative vibes at all
<wmoxam> ten years old?
<wmoxam> 1.0 was released in 1996 ;)
benanne has quit [Quit: kbai]
<wiremaster> ah, sorry, should have read the wiki, says Ruby appeared in 1995
rolfb has quit [Quit: Linkinus - http://linkinus.com]
<apeiros_> wiremaster: matz did a good job with the first version
<apeiros_> there aren't too many changes on the syntax or other core mechanics
<ddfreyne> yeah, considering language design is quite hard :)
mrsolo has joined #ruby-lang
<wiremaster> okay, so it has remained stable... I guess I should get competent enough to read the changelogs in order to understand what really changed..
__butch__ has joined #ruby-lang
gsav has joined #ruby-lang
lun_ has quit [Remote host closed the connection]
<wiremaster> that was pretty simple, one command to install ruby
<wiremaster> thanks rvm
icooba has quit [Quit: Computer has gone to sleep.]
gsav has quit [Client Quit]
karel_ has quit [Quit: Konversation terminated!]
areil has quit [Remote host closed the connection]
rippa has joined #ruby-lang
robotmay has joined #ruby-lang
codefyre has joined #ruby-lang
richo has joined #ruby-lang
gokul has joined #ruby-lang
<richo> Is it normal to expect sigprocmask to not do anything inside a ruby process, even though there are no references to it in the source?
gsav has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
Oloryn_lt2 has quit [Client Quit]
workmad3 has quit [Ping timeout: 264 seconds]
codefyre has quit [Quit: Leaving]
goshakkk has quit [Quit: Computer has gone to sleep.]
robotmay has quit [Remote host closed the connection]
havenn_ has quit [Remote host closed the connection]
Oloryn_lt2 has joined #ruby-lang
goshakkk has joined #ruby-lang
Oloryn_lt2 has quit [Client Quit]
Mon_Ouie has quit [Ping timeout: 244 seconds]
zeedre has joined #ruby-lang
geopet has joined #ruby-lang
zeedre has quit [Client Quit]
wiremaster has left #ruby-lang ["Leaving"]
zeedre has joined #ruby-lang
mistym is now known as mistym_lunch
gearaholic has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
<zeedre> Total neeb here. Can someone tell me what I'm doing wrong here : http://pastie.org/5119911. Should take about 2 seconds.
khaase has quit [Ping timeout: 245 seconds]
carloslopes has joined #ruby-lang
khaase has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 255 seconds]
sailias has joined #ruby-lang
<richo> you're setting an instance variable in the class
<richo> which is almost certainly not what you want
<richo> if you want to set a variable in all isntances, it should def initialize; @v = "Thing"; end
<richo> also, you're interpolatingn the symbol itself when you probably want the variable
<zeedre> o, its cause I'm not in the initialize method??
<zeedre> flagelating now. yup, I should have h not :here. ok.
chimkan has quit [Quit: chimkan]
<zeedre> tks richo
<richo> np
<zeedre> ok, for the real thing. in rails. I want an applicaiton wide variable sensitive to dev/prod/test. I found config/environments/development.db. I added config.test = "hi" but I can't seem to figure out how to access it in a controller. Any tips?
<steveklabnik> zeedre: that's not how you do that. make a constant in an initializer
<steveklabnik> or in the env file
<steveklabnik> but not by doing config.test
Carnage\ has joined #ruby-lang
<zeedre> Hmm, it talks about it up front in http://guides.rubyonrails.org/configuring.html. Looking at initializers now.
<steveklabnik> initailzers don't take env into account, i missed that part of your sentence
<steveklabnik> config.* is a way to configure componenets of rails
<steveklabnik> not configure your app itself
<zeedre> rereading it too. yup. i see that now how its for the built in stuff.
<apeiros_> hello mr. retwitter :-)
Axsuul has joined #ruby-lang
<gokul> Hello, I am new to ruby, read first few chapters of pickaxe book. Can somebody suggest an app i should be programming now ?
thinkdevcode has quit [Remote host closed the connection]
<zeedre> Hmm, so is there no easy way to do config based on env without switches or ifs?
fsvehla has joined #ruby-lang
<steveklabnik> zeedre: just define a constant in the environmen files
<steveklabnik> add FOO=whatever to config/environments/development.rb
<steveklabnik> add FOO=whatever2 to config/environments/test.rb
<steveklabnik> done
cultureulterior_ has quit [Quit: cultureulterior_]
ddd has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
Oloryn_lt2 has quit [Client Quit]
<zeedre> constants are just so. . . inflexible. If I were to try to mimick the structure in there for my task by writing config.test. How would I acccess it in a controller?
<steveklabnik> ha
<steveklabnik> constants are totally flexible in ruby
<steveklabnik> ;)
<apeiros_> sadly
joast has quit [Ping timeout: 260 seconds]
* apeiros_ still thinks that warning should be replaced with an exception being raised
<steveklabnik> meh
<steveklabnik> it is useful at times
<apeiros_> you still have const_set
<apeiros_> if you really really want to
<apeiros_> but my experience with warnings is - nobody reads them.
<steveklabnik> we're actively removing warnings in rails
<steveklabnik> actually
<steveklabnik> anyway, zeedre, these questions are better asked in #rubyonrails
* zzak digs up an old commit
<zeedre> haha. yup. im a total newb. Hmm. thats interesting. aha, another chat. Ill go there. Any quick answer to using the conf.test var in a controller?
nitti has quit [Remote host closed the connection]
<zzak> const_set is the shit
ddd has quit [Quit: Leaving.]
ddd has joined #ruby-lang
ddd has quit [Quit: Leaving.]
ddd has joined #ruby-lang
thinkdevcode has joined #ruby-lang
Bwild has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby-lang
gokul has quit [Quit: Leaving]
voker57 has quit [Read error: Connection reset by peer]
chimkan_ has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 264 seconds]
chimkan_ has quit [Quit: chimkan_]
scampbell has joined #ruby-lang
runeb has joined #ruby-lang
mistym_lunch is now known as mistym
amirinat_ has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby-lang
amirinator has joined #ruby-lang
_Mon_Ouie_ has left #ruby-lang [#ruby-lang]
Mon_Ouie has joined #ruby-lang
mattsgarrison has quit [Remote host closed the connection]
shtirlic has joined #ruby-lang
headius has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
amirinat_ has joined #ruby-lang
amirinator has quit [Ping timeout: 240 seconds]
chimkan has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 252 seconds]
filipechagas has joined #ruby-lang
dhruvasagar has joined #ruby-lang
ivanoats has joined #ruby-lang
filipechagas has quit [Remote host closed the connection]
ivanoats has quit [Remote host closed the connection]
filipechagas has joined #ruby-lang
bluepojo has joined #ruby-lang
runeb has quit [Remote host closed the connection]
nitti has joined #ruby-lang
burgestrand has joined #ruby-lang
freedrull has joined #ruby-lang
davidw has joined #ruby-lang
Bwild has joined #ruby-lang
davidw is now known as Guest22795
Guest22795 has left #ruby-lang [#ruby-lang]
intellitech has quit [Quit: Leaving]
dhruvasagar has quit [Ping timeout: 272 seconds]
<pdm> I was thinking about subclassing OpenStruct so that any updates to the structure would auto save out to a yaml file (ala yaml/store, but easier), how would you detect though if any of the stores objects, be it hashes, arrays, strings, were updated though? since OpenStruct itself wouldn't receive the push or == method calls
ridders24 has joined #ruby-lang
bluepojo has quit [Quit: Leaving.]
<Mon_Ouie> I wouldn't. I would call a #save method manually or I would modify the record object, not by mutating its attributes, but by calling methods on the record directly.
filipechagas has quit [Quit: Leaving]
runeb has joined #ruby-lang
<Mon_Ouie> i.e. use foo.push_value over foo.values.push
dhruvasagar has joined #ruby-lang
<pdm> I like the #save idea
lcdhoffman has joined #ruby-lang
<pdm> that still provides simpler interface than yaml/store provides
mwjcomputing has quit [Quit: Leaving]
bluepojo has joined #ruby-lang
nitti has quit [Ping timeout: 252 seconds]
enebo has quit [Quit: enebo]
lcdhoffman has quit [Quit: lcdhoffman]
nitti has joined #ruby-lang
nitti_ has joined #ruby-lang
ddd has quit [Remote host closed the connection]
nitti has quit [Ping timeout: 245 seconds]
ddd has joined #ruby-lang
joast has joined #ruby-lang
nitti_ has quit [Remote host closed the connection]
nitti_ has joined #ruby-lang
headius has quit [Quit: headius]
<ridders24> when using json parse, how do I specify what I want to extract from the data?
enebo has joined #ruby-lang
sepp2k has joined #ruby-lang
runeb has quit [Remote host closed the connection]
Kingy has joined #ruby-lang
runeb has joined #ruby-lang
CaptainJet has joined #ruby-lang
spinagon has joined #ruby-lang
rippa has quit [Read error: Connection reset by peer]
nitti has joined #ruby-lang
runeb has quit [Remote host closed the connection]
tsou has joined #ruby-lang
Taranis has joined #ruby-lang
nitti_ has quit [Ping timeout: 245 seconds]
Taranis has left #ruby-lang [#ruby-lang]
nitti_ has joined #ruby-lang
<apeiros_> ridders24: JSON parse doesn't extract. it parses. it'll parse the whole string you give it.
nitti__ has joined #ruby-lang
nitti__ has quit [Remote host closed the connection]
nitti__ has joined #ruby-lang
spinagon has quit [Ping timeout: 260 seconds]
<ridders24> apeiros: my script currently outputs a webpage, I want to parse the data to find specific info, and then just output that instead. Thats what I was trying to say
<ridders24> new to parsing, still trying to get to grips with it
<apeiros_> ridders24: well, after you parsed it, you can do whatever you want with the data you get back
<apeiros_> you get back ordinary ruby objects
nitti has quit [Ping timeout: 252 seconds]
nitti_ has quit [Ping timeout: 240 seconds]
<ridders24> apeiros: heres the bit of data in interested in ,"id_str":"225226860248842240","text, but all i want in the numeric value as that changes. but the info by its side, helps find the value in the overall data
<ridders24> how do i tell ruby that
<apeiros_> ridders24: yeah, without any context, no way to tell
<apeiros_> you can't just grab a small bit out of context and expect people to magically know the context themselves…
<mistym> ridders24: The JSON gets you arrays and hashes. Do you know how to access content from those?
<ridders24> mistym: hi im trying to progress further on from last time, so still have the code you helped me with. currently im able to get an output using json.parse
<ridders24> sorry if i struggle to understand this guys
<mistym> ridders24: Are you familiar with how to get content that's in an array or a hahs?
<mistym> *hash
<ridders24> no
<ridders24> im stuck on that
runeb has joined #ruby-lang
<mistym> OK. Well, that's a pretty common feature in ruby (and other programming languages). Something you'll use a lot.
sandbags has quit [Remote host closed the connection]
verbad has joined #ruby-lang
verbad has quit [Client Quit]
runeb has quit [Remote host closed the connection]
anachronistic has quit [Quit: anachronistic]
justinmcp has joined #ruby-lang
justinram has joined #ruby-lang
<mistym> ridders24: I'd recommend reading up on a good introductory ruby book - it'll give you a lot of the tools you'll use regularly for stuff like this.
<ridders24> mistym: thanks I will do this, but I also like to learn by trial and error. I appear to getting an error of unexpected token: http://pastie.org/5120656
amirinat_ has quit [Remote host closed the connection]
<mistym> ridders24: JSON.parse takes data which has been serialized in JSON format and turns it into ruby objects. "id_str" is not JSON.
<apeiros_> what's up today with people giving like no information at all and expecting help
dabradley has quit [Ping timeout: 245 seconds]
<apeiros_> ridders24: if you have an error, and you want help, *PASTE THE DAMN ERROR*
<mistym> You want to parse the Twitter API response first, and then access content from that.
<apeiros_> srsly, isn't that self evident?
verbad has joined #ruby-lang
<apeiros_> also, ID is a constant. use id instead, that's a local variable (first letter being uppercase means the variable is a constant)
verbad has left #ruby-lang [#ruby-lang]
<ridders24> ok ta
icooba has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 248 seconds]
sailias has quit [Quit: Leaving.]
carloslopes has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
postmodern has joined #ruby-lang
__butch__ has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
runeb has joined #ruby-lang
__butch__ has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
scampbell has quit [Quit: Ex-Chat]
<mistym> I'm making an ffi extension which translates bitmasks into named options. Which is less icky, returning a boolean hash {:foo => true, :bar => false}, or an array of present options [:foo]?
goshakkk has quit [Quit: Computer has gone to sleep.]
<drbrain> the Hash is a better conceptual mapping
<mistym> Good, that was my first instinct. I'll keep that.
<drbrain> bit flags don't have an implied order
<mistym> True.
krz has quit [Quit: krz]
<mistym> Thanks!
<mistym> Now to see if I can write a finalizer for this object-oriented wrapper that doesn't have unexpected bugs. Yay!
therod has joined #ruby-lang
runeb has quit [Ping timeout: 252 seconds]
justinmcp has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
Dreamer3 has joined #ruby-lang
<mistym> I don't suppose there's a decent way to a) test the finalizer does what it's supposed to, and b) actually works, is there? a) I can do by calling the class method on its own, but I'm not so sure about b)
ridders24 has quit [Read error: Connection reset by peer]
ridders24 has joined #ruby-lang
Schafro has joined #ruby-lang
runeb has joined #ruby-lang
runeb has quit [Remote host closed the connection]
Carnage\ has quit []
swarley has joined #ruby-lang
Kingy has quit [Quit: Leaving]
headius has joined #ruby-lang
<whitequark> mistym: but why are you writing an ffi ext for that?
<whitequark> as per finalizers, GC.start should work on MRI.
<drbrain> last I checked, GC.start wouldn't necessarily run finalizers
<mistym> whitequark: That's tangential, sorry. The ffi ext isn't the part with the finalizer.
<mistym> I wrote the ffi ext to help with part of a C lib wrapper. (I'm probably going to extract it from my main code.)
perryh has quit [Excess Flood]
<mistym> The finalizer's for the high-level API based on the C lib, since FFI pointers have to be explicitly freed by whatever interface the C library provides.
<mistym> They won't be freed by MRI GC.
icooba has quit [Quit: Computer has gone to sleep.]
<mistym> </tl;dr>
Schafro has quit [Quit: Leaving]
perryh has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
jarib has quit [Excess Flood]
Schafro has joined #ruby-lang
jarib has joined #ruby-lang
therod has quit [Quit: Leaving...]
geopet is now known as geopet_
<apeiros_> d'aw, föck, I lost my js benchmark :(
geopet_ is now known as geopet
<apeiros_> (or it's on my work laptop which is - accidentally - at work…)
swarley has quit [Ping timeout: 240 seconds]
<TTilus> you accidentally have tools at work to do your work? :)
<apeiros_> accidentally, yes
<apeiros_> I'm at home now
<TTilus> i gather
<apeiros_> well, hardest part was rolling stddev, but I think if I got that right once, I'll get it right again :)
geopet has left #ruby-lang [#ruby-lang]
<TTilus> math is nice
<TTilus> floating point arithmetics make things ugly
shtirlic has quit [Remote host closed the connection]
<apeiros_> yeah, but this doesn't need to be very precise
<apeiros_> I just try to avoid imprecision by going to very high numbers, thus rolling stddev
<TTilus> getting something right the second time is usually way faster
<apeiros_> not if you're watching sc2 at the same time :-D
geopet has joined #ruby-lang
<TTilus> yes, avoiding sums of numers of very different scale (say summing up shitload of small numbers) helps alot
<TTilus> sc2 might slow things down abit :)
<mistym> So, my `rake test` task is aborting mysteriously. I take it my finalizer isn't working.
Uranio has quit [Quit: WeeChat 0.3.8]
swarley has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<apeiros_> well, with stddev it's products iirc, not sums, so it grows quicker
<apeiros_> faster
<TTilus> do i remember totally wrong or do the tests actually run using at_exit?
<apeiros_> in Test::Unit I think they did, yes, at least in the autorunner
<TTilus> apeiros_: product is luckily not sensitive to the scale differences
<drbrain> TTilus: minutest also uses at_exit
slyphon has joined #ruby-lang
<TTilus> could it be that finalizers would be interfering somehow with test runner
<TTilus> ...in mistym's case
<drbrain> it's unlikely
<TTilus> iirc rspec uses at_exit too
macmartine has joined #ruby-lang
<drbrain> it's very difficult to get finalizers to run when you want to
<TTilus> thats what ive been told
<drbrain> the only guaranteed time they get run that I know of is at process shutdown which happens after all the at_exits have run
<TTilus> ah, they are separate stages
<drbrain> yeah
eo has joined #ruby-lang
<TTilus> at_exits and finalizers
<mistym> Hm. So I'm not even testing my finalizer, and still my tests are aborting. Must be some bug here.
Dreamer3 has quit [Quit: Computer has gone to sleep.]
eo has quit [Remote host closed the connection]
swarley has quit [Read error: Operation timed out]
<mistym> Is something wrong with this? http://pastebin.com/1AZn2LPN
ryanf has joined #ruby-lang
nettsundere has joined #ruby-lang
nitti has joined #ruby-lang
workmad3 has joined #ruby-lang
<drbrain> mistym: that looks perfect
nitti has quit [Remote host closed the connection]
<mistym> Hm. Wonder why my tests are aborting then? I'm using minitest/autorun.
slyphon has quit [Ping timeout: 245 seconds]
nitti__ has quit [Ping timeout: 276 seconds]
<drbrain> if they're aborting I don't think it's a finalizer issue
mikeneedshelp has quit [Read error: Connection reset by peer]
mmealling has quit [Quit: Leaving.]
<mistym> No, it's got to be that. Adding finalizers to the two classes is the only change since the last commit, and my tests ran then.
<drbrain> do you get any message when it aborts?
<mistym> Yeah, here's the backtrace: http://pastebin.com/g4pYg8PE
<mistym> (Please ignore the username.)
mikeneedshelp has joined #ruby-lang
<drbrain> try running the test directly, ruby -Ilib:test test/fasttrack_test.rb -v # or whichever
<drbrain> probably even ruby -d
<mistym> Hm, lots of "file not found" failures. The before steps aren't run when running it directly?
justinmcp has joined #ruby-lang
<drbrain> does rake need to set stuff up before you run a test?
benanne has joined #ruby-lang
<mistym> There's a before {} step in that file which creates a temporary directory and copies files there.
slyphon has joined #ruby-lang
<drbrain> that would run before that test even run individually
justinram has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
<mistym> https://github.com/mistydemeo/fasttrack/tree/finalizer - Here's the branch with finalizers added. Looks like something's wrong with the way I'm constructing the paths to test data.
headius has quit [Quit: headius]
vlad_starkov has quit [Ping timeout: 264 seconds]
Schafro has quit [Ping timeout: 245 seconds]
slyphon has quit [Ping timeout: 245 seconds]
thinkdevcode has quit [Remote host closed the connection]
runeb has joined #ruby-lang
enebo has quit [Ping timeout: 246 seconds]
<drbrain> mistym: when I try to run the tests I get "cannot load such file -- exempi/namespaces (LoadError)"
Dreamer3 has joined #ruby-lang
<mistym> drbrain: Oh, right. It depends on another gem - https://github.com/mistydemeo/exempi (low-level wrapper) and a C library, also named exempi. Sorry.
slyphon has joined #ruby-lang
<drbrain> mistym: I don't see a before { } in test/fasttrack_test.rb, though
chimkan has quit [Quit: chimkan]
<mistym> drbrain: That only has one test. The bulk are in file_test.rb and xmp_test.rb, which do have before { }
<drbrain> ok
bluepojo has quit [Remote host closed the connection]
runeb has quit [Ping timeout: 255 seconds]
<drbrain> too many rabbit holes for me, there's now exempi in brew ☹
<mistym> Sure there is ;) When was the last time you brew updated?
<mistym> Anyway, yeah. Too many deps to be convenient. Sorry!
<drbrain> two weeks ago, probably
<drbrain> ugh, I don't have the bandwidth to download boost, it's crawling ☹
* jaimef hunts for a shorter way to pull the first letter off a string instead of "string".split('')[0]
<CaptainJet> you could always try, you know... "string"[0]
<mistym> boost :( I like how even when you're getting a binary it can take forever, much less building from source.
macmartine has quit [Quit: Computer has gone to sleep.]
<drbrain> mistym: sorry, I can't try running it ☹
<mistym> No worries, thanks for trying!
<mistym> Boost! (╯°□°)╯︵ ┻━┻
<drbrain> mistym: if your tests are just aborting, though, it makes me think the problem is deeper
<drbrain> minitest tries hard to return useful information
<mistym> drbrain: Yeah. I suspect this isn't a new problem so much as exposing a problem that was already there.
<mistym> Is there anything that *looks* bad in my tests?
CaptainJet has quit []
justinmcp has quit [Remote host closed the connection]
<drbrain> I don't see anything unusual
Oloryn_lt2 has joined #ruby-lang
ridders24 has quit [Quit: Leaving]
Serial_Killer_C has quit [Remote host closed the connection]
Sundown has joined #ruby-lang
<mistym> That's good, anyway. Thanks.
outoftime has quit [Quit: Leaving]
Kingy has joined #ruby-lang
mistym has quit [Remote host closed the connection]
Sundown has quit [Quit: leaving]
blacktulip has quit [Remote host closed the connection]
slyphon has quit [Ping timeout: 245 seconds]
mikeneedshelp has quit [Ping timeout: 248 seconds]
Sundown has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
gsav_ has joined #ruby-lang
Sundown has quit [Client Quit]
Sundown has joined #ruby-lang
Sundown has quit [Client Quit]
gsav has quit [Ping timeout: 255 seconds]
sepp2k has quit [Ping timeout: 240 seconds]
Sundown has joined #ruby-lang
gsav_ has quit [Ping timeout: 268 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
bluepojo has joined #ruby-lang
Sundown has quit [Quit: leaving]
geopet has left #ruby-lang [#ruby-lang]
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
mistym has joined #ruby-lang
mrsolo has quit [Quit: Leaving]
toertore has quit [Quit: Leaving]
Mon_Ouie has quit [Ping timeout: 240 seconds]
enebo has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
slyphon has joined #ruby-lang
perryh has quit [Excess Flood]
davidbalbert is now known as davidbalbert_awa
perryh has joined #ruby-lang
davidbalbert_awa is now known as davidbalber_away
davidbalber_away is now known as davidbalber|away
alvaro_o has quit [Quit: Ex-Chat]
davidbalber|away is now known as davidbalbert
davidbalbert is now known as davidbalber|away
davidbalber|away is now known as davidbalbert
m3nd3s has joined #ruby-lang
alvaro_o has joined #ruby-lang
crunk has joined #ruby-lang
crunk has quit [Remote host closed the connection]
crunk has joined #ruby-lang
crunk has quit [Remote host closed the connection]
crunk has joined #ruby-lang
Nisstyre-laptop has quit [Read error: Operation timed out]
sailias has joined #ruby-lang
GarethAdams has joined #ruby-lang
crunk has quit [Client Quit]
crunk has joined #ruby-lang
ChadStudmuffin has quit [Ping timeout: 245 seconds]
ChadStudmuffin has joined #ruby-lang
Serial_Killer_C has joined #ruby-lang
sailias has quit [Quit: Leaving.]
<andrewvos> I have some zero bye jpegs :( :(
__butch__ has quit [Quit: Leaving.]
flowerpot has joined #ruby-lang
crunk has quit [Quit: crunk]
coryf has quit [Remote host closed the connection]