mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby-lang
<drbrain>
I often write some code on one class and move it to another as the responsibilities become clear
<andrewvos>
drbrain: I have trouble with that. I don't like splitting out the tests into seperate files.
<andrewvos>
drbrain: Thought I will have to practice.
<andrewvos>
rue: Well because SR at the class level means more files. More requires etc.
<andrewvos>
rue: And I just think if we tested one large class, we might be better off.
<andrewvos>
rue: Just a thought though.
kalleth [kalleth!~trussell@intranet.cishub.co.uk] has joined #ruby-lang
fayimora [fayimora!~fayimora@109.175.187.177] has joined #ruby-lang
kalleth_ [kalleth_!~trussell@intranet.cishub.co.uk] has joined #ruby-lang
kalleth_ [kalleth_!~trussell@intranet.cishub.co.uk] has quit [#ruby-lang]
takaokouji [takaokouji!~takaokouj@nat35.mable.ne.jp] has joined #ruby-lang
queequeg1 [queequeg1!~chatzilla@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
igaiga [igaiga!~igaiga@192.244.95.101] has joined #ruby-lang
schroedinbug [schroedinbug!~schroedin@71-212-191-172.hlrn.qwest.net] has joined #ruby-lang
pabloh [pabloh!~pablo@186.22.82.39] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
mikeric [mikeric!~mike@S010600212986c312.vc.shawcable.net] has joined #ruby-lang
Weems [Weems!~the@nat.resnet.mc.edu] has joined #ruby-lang
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
publicvoid [publicvoid!~publicvoi@p4FCAECC5.dip.t-dialin.net] has joined #ruby-lang
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
looopy [looopy!~looopy@static-71-166-232-150.washdc.east.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
mattt_ [mattt_!~mattt_@24-246-2-147.cable.teksavvy.com] has joined #ruby-lang
bglusman_ [bglusman_!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
perryh [perryh!~perryh@unaffiliated/perry753] has joined #ruby-lang
mikeric [mikeric!~mike@S010600212986c312.vc.shawcable.net] has joined #ruby-lang
McTurtleNeckWith [McTurtleNeckWith!Needtoknow@66.183.230.117] has joined #ruby-lang
<McTurtleNeckWith>
Pastie: Hai there sexy pants?
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
igaiga [igaiga!~igaiga@192.244.95.101] has joined #ruby-lang
<drbrain>
McTurtleNeckWith: pastie doesn't respond well to that kind of talk
<McTurtleNeckWith>
I suppose not :(
spleeze [spleeze!~Spleeze@173-15-131-114-BusName-Philadelphia.hfc.comcastbusiness.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
<McTurtleNeckWith>
Looked at the memory usage of internet explorer. 760mb. I have 6 tabs open.
testbot2 [testbot2!~PircBot@173-25-169-137.client.mchsi.com] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
<Asher>
why would you use internet explorer
<drbrain>
shitty corporate websites
<drbrain>
I only use IE because I have to
<drbrain>
and only when I have to
eggman2001 [eggman2001!~shig@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
testbot2 [testbot2!~PircBot@173-25-169-137.client.mchsi.com] has joined #ruby-lang
testbot2 [testbot2!~PircBot@173-25-169-137.client.mchsi.com] has joined #ruby-lang
<eggman2001>
hello, anyone know how I should replace ParseDate.parsedate with in ruby 1.9?
<drbrain>
Date.parse
<eggman2001>
hmm. I'm getting a NoMethodError with that...
<erikh>
did you require 'date' ?
<erikh>
err wait
<erikh>
yar
<eggman2001>
oh wait, yeah that works now. hmm, I just typed "Date" and it worked so I assumed that it didn't have to be required
<eggman2001>
thanks
<erikh>
drbrain: Date is core?
<drbrain>
you need require 'date'
<drbrain>
at least, last I checked
<erikh>
right, for parse I understand
<drbrain>
for Time.parse you need require 'time'
<drbrain>
you need require 'date' to get Date
<drbrain>
it's in C, but not in core
<josh9>
i usually run my ruby tests like this: ruby -rawesome_print user_test.rb is there a way to run ruby with -r all the time so i won't need to specify it every time?
darix [darix!darix@nordisch.org] has joined #ruby-lang
darix [darix!darix@irssi/staff/darix] has joined #ruby-lang
<drbrain>
export RUBYOPT=-rawesome_print
<josh9>
drbrain: nice
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
Needtoknow [Needtoknow!Needtoknow@66.183.230.117] has joined #ruby-lang
robyurkowski [robyurkowski!~robyurkow@184.151.127.234] has joined #ruby-lang
eggman2001 [eggman2001!~shig@user-387hpcb.cable.mindspring.com] has quit [#ruby-lang]
plusk [plusk!~plusk@201-40-62-197.gnace703.dsl.brasiltelecom.net.br] has joined #ruby-lang
x0F_ [x0F_!~x0F@unaffiliated/x0f] has joined #ruby-lang
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
gokulnath [gokulnath!~gokulnath@115.111.177.122] has joined #ruby-lang
igaiga [igaiga!~igaiga@192.244.95.101] has joined #ruby-lang
<shevy>
say you have two small classes, that fetch user input, in a loop, via gets
<shevy>
now the first class, can call the second class. and then the user is in that loop ... and eventually he wants to exit from there
<shevy>
if that class has "exit" though, it stops completely. what I would like to have instead is that the first class (the loop of the first class) continues instead, rather than exiting
<drbrain>
use return instead of exit ?
<shevy>
oh
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
<shevy>
cool, that kinda helped, tweaked the class a little. thanks
ylluminate [ylluminate!~ylluminat@rrcs-24-123-53-166.central.biz.rr.com] has joined #ruby-lang
<ylluminate>
working on a rails app and getting a very strange "stack level too deep" on simply a test of `puts "100".to_f.to_s`
<ylluminate>
original goal was to use BigDecimal#to_f, but I was getting the same thing
<ylluminate>
so i thought i'd step back and try to hunt down the culprit
<ylluminate>
irb and rails console run these just fine, but when it's in context of the controller, it blows up probably about 90% of the time
<drbrain>
ylluminate: you'll get "stack level too deep" when you run out of stack space
<drbrain>
not on the line that is looping
<drbrain>
so if you have def a() puts "100".to_f.to_s; a; end
<drbrain>
you may run out of stack on the puts line, but the loop is a
<drbrain>
can you paste the full error to gist.github.com or wherever?
<ylluminate>
understood, you're setting up a recursive situation there
<ylluminate>
sure
takaokouji [takaokouji!~takaokouj@nat35.mable.ne.jp] has joined #ruby-lang
igaiga [igaiga!~igaiga@192.244.95.101] has joined #ruby-lang
ttilley [ttilley!~ttilley@c-98-217-122-24.hsd1.ma.comcast.net] has joined #ruby-lang
ttilley [ttilley!~ttilley@unaffiliated/lv] has joined #ruby-lang
<drbrain>
I'm stumped about how to figure out what's going on with your "100".to_f
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-244-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
<drbrain>
ylluminate: my guess is that something has replaced the default to_f with one that is giving you problems
<drbrain>
but I'm unsure of how to verify code-wise
<drbrain>
ylluminate: you could look for 'def to_f' in your source and libraries
jaafar [jaafar!~jet@adsl-76-200-166-49.dsl.pltn13.sbcglobal.net] has joined #ruby-lang
<ylluminate>
hmm
<jaafar>
Hi everyone. I'm working with SWIG, and overriding the __str__ method on some classes to make my own to_s work through C++. On Linux it works just fine, but in Windows (Visual C++) it produces unreadable garbage. Any ideas?
<drbrain>
ylluminate: but it's only "100".to_f that has the stack error, right?
<drbrain>
jaafar: breakpoint on to_s and see if it points to the right thing?
<ylluminate>
it appears so
<ylluminate>
man, my brain is fried
<drbrain>
I'd look for 'def to_f' in your code/libraries
<jaafar>
drbrain: thanks for the suggestion. do you mean through visual studio or something?
<ylluminate>
but now it's working drbrain
<ylluminate>
wtfreak
<ylluminate>
ack. worked 2 times, then 3rd time failed, then 4th reload worked
* jaafar
has never tried to debug ruby itself on windows
<drbrain>
jaafar: yeah, it's the only way I know to figure out what's going wrong
<ylluminate>
and now it's getting through into the highchart block each time and failing
<drbrain>
jaafar: are you going C(++) string to Ruby String or the other way?
<jaafar>
drbrain: the former
<jaafar>
stringstream << stringify_method then stringstream.str().c_str()
<jaafar>
I worry that the result of c_str() is no longer valid
<jaafar>
or that there is some unicodeish thing going on
<drbrain>
possibly, you might need to copy it
<drbrain>
what kind of garbage do you get
<jaafar>
but the stringstream approach appears to be the common approach, I keep finding it online
<jaafar>
um, either nothing, or some repeated graphic characters
<jaafar>
is there a sensible way for me to get a character array I can use that will be garbage collected for me later?
Marco [Marco!~marco@129.170.237.186] has joined #ruby-lang
<drbrain>
jaafar: rb_str_new() will do that
<drbrain>
it memcpy()s the pointer
<jaafar>
OK, thank you, I'll give it a try
<drbrain>
or rb_str_new_cstr if it's null-terminated
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
<ylluminate>
O.o
<ylluminate>
drbrain: found it.
<ylluminate>
many months ago a convenience to_s was added to Float in the model
<drbrain>
jaafar: you'll need to reference it from another ruby object
<ylluminate>
flip
<ylluminate>
removing that has made it work 100% of the time now
<drbrain>
so, in ruby, foo = wrapped_obj.to_s will be fine
<drbrain>
ylluminate: :D
<ylluminate>
LOL
<queequeg1>
Can I use regular expressions in rubydoctest?
<drbrain>
queequeg1: I have no idea, you should try it and let us know
<queequeg1>
I was just trying to quickly scan the docs, but I'm not getting any hope.
<queequeg1>
I will give it a try.
<jaafar>
Here's a question about embedding a Ruby interpreter: our company may want to have a sort of "slave" Ruby interpreter, that we can keep around and feed strings to eval. But it seems like Ruby wants control of the stack, somehow... is this true?
<jaafar>
is it realistic to try to initialize an interpreter and then just keep it around, dormant, until needed?
<drbrain>
jaafar: the GC needs to know the size of the stack
<drbrain>
jaafar: for 1.9, I *think* you can run the interpreter in its own thread
<drbrain>
jaafar: would that solve your problem?
<drbrain>
but, yeah, you could initialize the interpreter and let it sit
priteshjain [priteshjain!~priteshja@115.248.175.50] has joined #ruby-lang
<jaafar>
but only if it has its own thread?
<drbrain>
it doesn't need to have its own thread
<jaafar>
oh
mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
<jaafar>
I noticed the stack setup macro, and the fact that we were getting some segfaults, and thought "ah, we are corrupting its stack"
<jaafar>
let me find our testcase
<drbrain>
ruby uses the C stack
<jaafar>
right
<drbrain>
but it needs to know the top/bottom so the GC can scan for references to ruby objects
SuperTaz_work [SuperTaz_work!~supertaz_@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<drbrain>
I'm not certain of the details of embedding, ruby is not the easiest language to embed ☹
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby-lang
<jaafar>
my colleague says that after ruby_init() he can do as many rb_eval_string() calls as he likes
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
<jaafar>
but if he then calls a function that calls rb_eval_string(), bam, segfault
<jaafar>
that's what I meant when I said I thought Ruby wanted to "own" the stack
<drbrain>
yeah
<jaafar>
so that's right, then
<drbrain>
are you embedding 1.8 or 1.9?
<jaafar>
1.9
<drbrain>
I think ruby needs to be informed the the stack has grown
<drbrain>
let me look
<jaafar>
drbrain: I really appreciate the time you're taking to look this stuff up for a n00b
<drbrain>
do you return from the call point of ruby_init() ?
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
<jaafar>
eventually. well, it's main() or something like that
<jaafar>
we can arrange to do it in main
<drbrain>
I'm guessing that might help
kitallis [kitallis!~kitallis@122.172.248.47] has joined #ruby-lang
<drbrain>
I'm looking at gc.c and see ruby_init_stack() that's called from ruby_init()
<drbrain>
and it stores the stack start/end
ksinkar [ksinkar!~ksinkar@123.201.117.198] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-244-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
Weems [Weems!~the@nat.resnet.mc.edu] has joined #ruby-lang
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
<drbrain>
this is very twisty
<jaafar>
drbrain: you know, actually it looks like we are running it from main in our testcase
<jaafar>
let me give this a try
<drbrain>
hrm
<drbrain>
do you have a C backtrace of the crash?
<jaafar>
drbrain: I hope to soon. let me make sure I can reproduce it though :)
<drbrain>
hrm, I wonder if you're supposed to call ruby_init_stack() before ruby_init()
<drbrain>
main.c and eval.c both do it
<drbrain>
well, eval.c does it after ruby_init()
<drbrain>
so… maybe you need to call ruby_init_stack() before your next execution of ruby code
igaiga [igaiga!~igaiga@192.244.95.101] has joined #ruby-lang
<drbrain>
jaafar: you also called ruby_options, right?
<drbrain>
it looks like it sets up tons of stuff
<jaafar>
mm, nope!
<jaafar>
got it running. definitely segfaults. RUBY_INIT_STACK before the additional call does not help
artOfWar [artOfWar!~artofwar@108-205-201-30.lightspeed.sntcca.sbcglobal.net] has joined #ruby-lang
<jaafar>
drbrain: ha, I was just looking at that :)
<Asher>
haha
<jaafar>
Asher: you know, I've got a bunch more stuff in my code
<jaafar>
ruby_sysinit, RUBY_STACK_INIT, blah blah
dnyy_ [dnyy_!u2106@gateway/web/irccloud.com/x-uvujdvndhxqbmspk] has joined #ruby-lang
<jaafar>
are those redundant?
<Asher>
i am not sure but i can tell you that code i just shared works on its ow
<Asher>
own
<Asher>
tho it is apparently what you were already looking at, as i shared it on that thread a year ago ;)
DRCALKIN [DRCALKIN!~DROOL_AND@cpe-66-69-208-144.austin.res.rr.com] has joined #ruby-lang
y3llow_ [y3llow_!~y3llow@114-36-234-3.dynamic.hinet.net] has joined #ruby-lang
lsegal` [lsegal`!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
<drbrain>
jaafar: ruby_sysinit() and RUBY_STACK_INIT are not redundant
abuiles_ [abuiles_!u1641@gateway/web/irccloud.com/x-gpzllhwmrqglcwlo] has joined #ruby-lang
dagobah_ [dagobah_!~dagobah@84.45.53.200] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@host17-129-dynamic.54-79-r.retail.telecomitalia.it] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
<jaafar>
Asher: I don't want to use ruby_run_node(), as I want Ruby to act as a 'slave', i.e., I feed it code through rb_eval_string from time to time as I'm doing other stuff
<jaafar>
Asher: what do you think about the ruby_sysinit/RUBY_STACK_INIT? Your example doesn't have them...
<Asher>
ah i see
ozzloy_ [ozzloy_!~ozzloy@ozzloy.lifeafterking.org] has joined #ruby-lang
<Asher>
ruby_sysinit looks like it just saves the ruby initialization params
<jaafar>
drbrain: btw ruby_options doesn't seem to save me from the segfault, although it does change the results a little bit
<drbrain>
and sets up stdin/out/err if any was missing
<drbrain>
jaafar: yeah
<Asher>
is that what dln handles?
kotp [kotp!~kotp@li272-234.members.linode.com] has joined #ruby-lang
<drbrain>
Asher: fill_standard_fds()
<Asher>
i'm looking at 1.9.2 still don't see that there.. guess i should grab up to date source
<drbrain>
I'm looking at trunk from a month ago
<Asher>
yea so i assumed
Keltia [Keltia!roberto@aran.keltia.net] has joined #ruby-lang
jarib [jarib!~jarib@unaffiliated/jarib] has joined #ruby-lang
jMCg [jMCg!~hiro@static.117.115.40.188.clients.your-server.de] has joined #ruby-lang
hibariya_ [hibariya_!~quassel@www9204u.sakura.ne.jp] has joined #ruby-lang
goutham [goutham!~goutham@115.111.177.122] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
spleeze [spleeze!~Spleeze@173-15-131-114-BusName-Philadelphia.hfc.comcastbusiness.net] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
sora_h [sora_h!~sora_h@mayfield.privs.net] has joined #ruby-lang
voker57 [voker57!~voker57@kvirc/developer/Voker57] has joined #ruby-lang
kyrylo [kyrylo!~kyrylo@46.118.221.254] has joined #ruby-lang
nofxx_ [nofxx_!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
bryanl [bryanl!~bryanl@li362-49.members.linode.com] has joined #ruby-lang
kitallis-cloud [kitallis-cloud!u358@gateway/web/irccloud.com/x-frvifhlbsliaseno] has joined #ruby-lang
setmeaway [setmeaway!setmeaway3@119.201.52.190] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby-lang
comboy [comboy!~quassel@tesuji.pl] has joined #ruby-lang
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby-lang
kvs [kvs!~kvs@naboo.binarysolutions.dk] has joined #ruby-lang
andrewvos [andrewvos!~andrewvos@ec2-50-17-160-197.compute-1.amazonaws.com] has joined #ruby-lang
demeth [demeth!~leto@c83-249-208-141.bredband.comhem.se] has joined #ruby-lang
valeri_ufo [valeri_ufo!~valeri_uf@deadlink.in] has joined #ruby-lang
lake [lake!~lake@li71-228.members.linode.com] has joined #ruby-lang
Kwanasolis [Kwanasolis!~ebrodeur@ujami.net] has joined #ruby-lang
Nisstyre [Nisstyre!~yours@c-208-90-102-250.netflash.net] has joined #ruby-lang
josh9 [josh9!~oren@cpe-76-172-9-207.socal.res.rr.com] has joined #ruby-lang
jwollert [jwollert!~jwollert@rkh.im] has joined #ruby-lang
dominikh [dominikh!~dominikh@subtle/contributor/dominikh] has joined #ruby-lang
JoL1hAHN [JoL1hAHN!~nrk@unaffiliated/jol1hahn] has joined #ruby-lang
musl [musl!~mike@li44-23.members.linode.com] has joined #ruby-lang
anekos [anekos!~anekos@mail.anekos.info] has joined #ruby-lang
_rane [_rane!rane@theorycraft.org] has joined #ruby-lang
soahccc` [soahccc`!chaos@d2-1.debian-02.ppps.hosts.project-production.de] has joined #ruby-lang
epitron [epitron!~epitron@unaffiliated/epitron] has joined #ruby-lang
pabs [pabs!~pabs@ip68-98-175-235.dc.dc.cox.net] has joined #ruby-lang
Nisstyre [Nisstyre!~yours@c-208-90-102-250.netflash.net] has joined #ruby-lang
mitchty [mitchty!~mitchty@ec2-50-19-41-37.compute-1.amazonaws.com] has joined #ruby-lang
Jade [Jade!~jade@unaffiliated/jade] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
solars [solars!~solars@194.208.132.118] has joined #ruby-lang
ksinkar [ksinkar!~ksinkar@123.201.117.198] has joined #ruby-lang
andrewhl_ [andrewhl_!~andrew@out-pq-169.wireless.telus.com] has joined #ruby-lang
Bwild [Bwild!~irc@netblock-75-79-22-130.dslextreme.com] has joined #ruby-lang
mytrile [mytrile!~mytrile@94.26.28.135] has joined #ruby-lang
Pip [Pip!~Pip@host-192-146-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
neoesque [neoesque!~neoesque@210.59.147.232] has joined #ruby-lang
igaiga [igaiga!~igaiga@192.244.95.101] has joined #ruby-lang
thone [thone!~thone@g225087061.adsl.alicedsl.de] has joined #ruby-lang
priteshjain_ [priteshjain_!~priteshja@113.193.47.245] has joined #ruby-lang
Pip_ [Pip_!~Pip@unaffiliated/pip] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
igaiga [igaiga!~igaiga@192.244.95.101] has joined #ruby-lang
senj [senj!~senj@70.98.241.200] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
stepnem [stepnem!~stepnem@176.119.broadband10.iol.cz] has joined #ruby-lang
looopy [looopy!~looopy@static-71-166-232-150.washdc.east.verizon.net] has joined #ruby-lang
BitPuffin [BitPuffin!5ae51f0d@gateway/web/freenode/ip.90.229.31.13] has joined #ruby-lang
cyri_ [cyri_!~cyri_@236.200.72.86.rev.sfr.net] has joined #ruby-lang
roadkith [roadkith!~kith@unaffiliated/kith] has joined #ruby-lang
<yorickpeterse>
Morning
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
arthurlockhart [arthurlockhart!~cinch@60-242-128-8.static.tpgi.com.au] has joined #ruby-lang
heftig [heftig!~Jan@archlinux/developer/heftig] has joined #ruby-lang
bryanl [bryanl!~bryanl@li362-49.members.linode.com] has joined #ruby-lang
thrcka [thrcka!thrcka@nat/redhat/x-mzmnwgukdiqtovcp] has joined #ruby-lang
<andrewvos>
drbrain: Loving that talk. I think I'm going to put it on at works next code dojo session.
<jaafar>
That would be a two-thread system with a Ruby interpreter in one, taking commands and returning stuff, and the main thread off doing whatever it wants
<jaafar>
warning: Boost
chrismcg [chrismcg!~chrismcg@pdpc/supporter/active/chrismcg] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
toretore [toretore!~toretore@crr06-3-82-231-12-81.fbx.proxad.net] has joined #ruby-lang
zmack [zmack!~zmack@78.97.129.175] has joined #ruby-lang
stamina [stamina!~stamina@ip5452a9bc.speed.planet.nl] has joined #ruby-lang
Codif [Codif!~codif@84.120.204.160.dyn.user.ono.com] has joined #ruby-lang
jkprg [jkprg!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
mccraig [mccraig!u574@gateway/web/irccloud.com/x-rwiazxytrqjlffbw] has joined #ruby-lang
kke [kke!~kimmo@46.19.32.53] has joined #ruby-lang
<kke>
[1,2,3][4] => nil --> [1,2,3][4..5] => [] and [1,2,3][5..6] => nil, what's up with that?
<rue>
jaafar: Cool
<rue>
Have I mentioned how much I like starring gists?
<rue>
Or, the starrability thereof
<rue>
kke: For historical reasons
<rue>
kke: And you probably mean 3..4 and 4..5 respectively
<kke>
yes
<kke>
found several stack overflow threads about it
<rue>
I think it had to do with 3 being the number of elements or some nonsense like that
<andrewvos>
manveru: Which I think I like. Not sure about rest-client throwing NotFound etc.
<manveru>
i have like a hundred lines of error handling for all the stuff rest-client may raise
<andrewvos>
Mother of god.
<manveru>
just to get it into a single error hierarchy with common interfaces
<manveru>
well, the sad thing is, this is still better than Net::HTTP :P
<andrewvos>
manveru: Ye
<andrewvos>
HTTParty is a pleasure to use.
<manveru>
ok, gonna try it next time
<workmad3>
HTTParty is a lovely wrapper around Net::HTTP :)
dous [dous!~dous@unaffiliated/dous] has joined #ruby-lang
hallucinations [hallucinations!~hallucina@59.144.55.130] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
kaiwren [kaiwren!~KaiWren@122.172.248.47] has joined #ruby-lang
madsheep_ [madsheep_!~madsheep@213-238-98-38.adsl.inetia.pl] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
45PAALKSH [45PAALKSH!~quassel@49.200.16.86] has joined #ruby-lang
fayimora [fayimora!~fayimora@95.175.159.8] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-78-144-139-130.as13285.net] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby-lang
Guedes [Guedes!~guedes@189.31.65.14] has joined #ruby-lang
Guedes [Guedes!~guedes@unaffiliated/guedes] has joined #ruby-lang
jkprg_ [jkprg_!~jarda@ip-62-245-93-150.net.upcbroadband.cz] has joined #ruby-lang
rushed [rushed!~rushed@cpe-70-116-11-35.austin.res.rr.com] has quit [#ruby-lang]
AlHafoudh [AlHafoudh!~textual@85.248.11.120] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@194.209.75.58] has joined #ruby-lang
niklasb [niklasb!~codeslay0@p5B310C56.dip0.t-ipconnect.de] has joined #ruby-lang
beiter [beiter!~beiter@manz-5f74ba48.pool.mediaWays.net] has joined #ruby-lang
ajeis [ajeis!~quassel@27.107.81.15] has joined #ruby-lang
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
<shevy>
I LOVE YOU MANVERU!
* shevy
snuggles up to manveru
<manveru>
shevy: ?
<manveru>
what crime did i commit this time?
<shevy>
I dunno but you deserved it!
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
<kke>
hmmm what's this, both in 1.8.7 and 1.9.3 : h = Hash.new([]); h[:foo] << "bar"; ---> h[:foo] => ["bar"] h.keys => [] h.inspect => {} h.values => []
<workmad3>
kke: you've passed a single array through as the default value, and then h[:foo] (as a key that doesn't exist) returns the default value... which you then modify
<workmad3>
kke: however, accessing a value that doesn't exist doesn't cause it to be set in the keys
<workmad3>
kke: for a full demonstration, also have a look at 'h[:bar]' after doing your h[:foo] << "bar" ;)
stef_204 [stef_204!~kvirc@unaffiliated/stef-204/x-384198] has joined #ruby-lang
malev [malev!~malev@190.210.138.237] has joined #ruby-lang
<kke>
yeah, noticed
<kke>
so i'm modifying the array-instance that was created in ( [] )
tcurdt [tcurdt!~tcurdt@89.246.67.229] has joined #ruby-lang
bglusman [bglusman!~bglusman@pool-173-49-121-64.phlapa.fios.verizon.net] has joined #ruby-lang
<robgleeson>
Yeah, and the Array will be used every time you reference a key that doesn't exist (may not be what you want, Hash.new also accepts a block)
<robgleeson>
h[:foo] << "bar" h[:bar] << "bar"; h[:foo] # => ["bar", "bar"] … with that example
gnufied [gnufied!~gnufied@122.172.246.117] has joined #ruby-lang
<kke>
h=Hash.new{|hash, key| hash[key] = [] }
<kke>
that works
<bnagy>
well they both work
<bnagy>
you mean it behaves differently
Carmivore [Carmivore!~carmivmor@ec2-50-19-173-173.compute-1.amazonaws.com] has joined #ruby-lang
<kke>
well the first one doesn't work the way i was assuming it would
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
saLOUt_ [saLOUt_!~rriemann@77.245.32.179] has joined #ruby-lang
uncle_billy [uncle_billy!~Adium@static-224.service.govdelivery.com] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby-lang
tommyvyo_ [tommyvyo_!~tommyvyo@38.123.129.115] has joined #ruby-lang
ajeis [ajeis!~quassel@182.156.74.140] has joined #ruby-lang
ajeis___ [ajeis___!~quassel@182.156.74.181] has joined #ruby-lang
kedare [kedare!~kedare@2a01:e35:2f26:5330:4946:d488:f9bd:d8f2] has joined #ruby-lang
empity [empity!~user@mail2.xype.com] has joined #ruby-lang
FiXato [FiXato!~FiXato@fixato.net] has joined #ruby-lang
<whitequark>
hmm
<whitequark>
suppose I have this code: module AVM2::ABC; class Record < Something; UndefinedConstant; end; end
<whitequark>
which const_missing will be called?
<whitequark>
1.9.2/1.9.3
davidw [davidw!~davidw@host228-251-static.95-94-b.business.telecomitalia.it] has joined #ruby-lang
davidw [davidw!~davidw@apache/committer/davidw] has joined #ruby-lang
yfeldblum [yfeldblum!~Jay@pool-71-246-76-76.bltmmd.east.verizon.net] has joined #ruby-lang
cantbecool [cantbecool!~cantbecoo@173-15-164-136-BusName-Philadelphia.hfc.comcastbusiness.net] has joined #ruby-lang
<kke>
just a guess out of my ass, from inside towards outside
dv310p3r [dv310p3r!~dv310p3r@host-208-68-238-122.biznesshosting.net] has joined #ruby-lang
<manveru>
whitequark: Something::const_missing
<manveru>
unless you defined Record::const_missing before
jbwiv [jbwiv!~wellsj@world.timcogso.com] has joined #ruby-lang
<whitequark>
manveru: interestingly, that does not work
Sailias [Sailias!~jonathan@s72-38-77-178.static.comm.cgocable.net] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0E07B.dip0.t-ipconnect.de] has joined #ruby-lang
imajes [imajes!~imajes@is.imaj.es] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
MistyM [MistyM!~mistym@50.museumforhumanrights.com] has joined #ruby-lang
kedare [kedare!~kedare@2a01:e35:2f26:5330:e8b0:4bc0:dd3:1c4e] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
Marco [Marco!~marco@129.170.93.139] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-60-40.washdc.btas.verizon.net] has joined #ruby-lang
leonL [leonL!~leonl@CPE0024a5b652a3-CM000f21205d86.cpe.net.cable.rogers.com] has joined #ruby-lang
ramonmaruko [ramonmaruko!~marco@122.52.126.66] has joined #ruby-lang
desireco_ [desireco_!~textual@12.34.4.33] has joined #ruby-lang
mkscrg [mkscrg!~mkscrg@ool-18e4f9d6.dyn.optonline.net] has joined #ruby-lang
ascarter [ascarter!~ascarter@64.122.126.156] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-knaqqdngknchpfks] has joined #ruby-lang
ascarter_ [ascarter_!~ascarter@64.122.126.156] has joined #ruby-lang
Defusal [Defusal!DeFi@dsl-240-233-04.telkomadsl.co.za] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
fvollero [fvollero!fvollero@nat/redhat/x-kghxxjbsucooeafx] has joined #ruby-lang
RomD` [RomD`!~Roman@nrbg-4d077e0c.pool.mediaWays.net] has joined #ruby-lang
saLOUt_ [saLOUt_!~rriemann@77.245.32.179] has joined #ruby-lang
sora_h [sora_h!~sora_h@mayfield.privs.net] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
rayners [rayners!~rayners@38.102.22.194] has joined #ruby-lang
outoftime [outoftime!~mat@50.57.10.189] has joined #ruby-lang
cldwalker [cldwalker!u2984@gateway/web/irccloud.com/x-ctfgmxdqdawczpwy] has joined #ruby-lang
virunga [virunga!~virunga@151.64.22.171] has joined #ruby-lang
dfr|mac [dfr|mac!~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #ruby-lang
ajeis [ajeis!~quassel@182.156.73.114] has joined #ruby-lang
<andrewvos>
Why would this line of code: builder.use Rack::MethodOverride if method_override?
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby-lang
<andrewvos>
Be doing this: ERROR NoMethodError: undefined method `<<' for nil:NilClass
<andrewvos>
Rack app
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
<andrewvos>
Oh wait sorry not that line of code. Never mind I'm an idiot.
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
enebo [enebo!~enebo@75-168-50-253.mpls.qwest.net] has joined #ruby-lang
jbwiv [jbwiv!~wellsj@world.timcogso.com] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
zarubin [zarubin!~stas@94.27.82.120] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
mdel_ [mdel_!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby-lang
queequeg1 [queequeg1!~chatzilla@c-71-202-152-67.hsd1.ca.comcast.net] has joined #ruby-lang
Locke23rus [Locke23rus!~quassel@128-70-111-50.broadband.corbina.ru] has joined #ruby-lang
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-14-26.cable.teksavvy.com] has joined #ruby-lang
Marco [Marco!~marco@129.170.93.139] has joined #ruby-lang
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
jarrod__ [jarrod__!~jarrod@rrcs-24-153-217-133.sw.biz.rr.com] has joined #ruby-lang
Silowyi [Silowyi!~silowyi_d@99-26-202-35.lightspeed.snantx.sbcglobal.net] has joined #ruby-lang
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
nofxx [nofxx!~nofxx@177.106.59.23] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@77.245.32.179] has joined #ruby-lang
Weems [Weems!~the@nat.resnet.mc.edu] has joined #ruby-lang
Weems [Weems!~the@unaffiliated/weems] has joined #ruby-lang
arooni-mobile [arooni-mobile!~arooni-mo@189.131.116.75] has joined #ruby-lang
Skif_home [Skif_home!~Skif@72.1.92.57] has joined #ruby-lang
mark_locklear [mark_locklear!~jlocklear@ab-tech-lan-to-ab-tech-gw.ncren.net] has joined #ruby-lang
GarethAdams [GarethAdams!5189d252@pdpc/supporter/active/GarethAdams] has joined #ruby-lang
<GarethAdams>
Hi guys, I just spotted the weirdest behaviour I've seen in ruby 1.9, can anyone see if they can reproduce it? https://bugs.ruby-lang.org/issues/5871
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
frem [frem!XsKNvuBbB6@irc-1.usealice.org] has joined #ruby-lang
<Spooner>
GarethAdams: No fault for me in 1.9.3p0 (win32)
ascarter_ [ascarter_!~ascarter@209.119.253.66] has joined #ruby-lang
cschneid_ [cschneid_!~cschneid@72.1.92.57] has joined #ruby-lang
aroop [aroop!~aroop@67.139.104.203] has joined #ruby-lang
szarubin [szarubin!~stas@94.27.82.120] has joined #ruby-lang
ascarter [ascarter!~ascarter@209.119.253.66] has joined #ruby-lang
<GarethAdams>
Spooner: thanks, have had successful confirmations from other mac users so I've added your mswin info to the ticket
<Spooner>
GarethAdams: Okey.
<MistyM>
GarethAdams: Yeah, I'm seeing this on OS X too.
<MistyM>
1.9.3p0 too.
<GarethAdams>
it was definitely a WTF? moment seeing that behaviour
<MistyM>
No kidding.
<GarethAdams>
any guesses? ;)
<lianj>
same on linux
<Mon_Ouie>
I'm getting the right result in 1.9.3p0 on linux
<Mon_Ouie>
Maybe it actually has something to do with locales?
spleeze [spleeze!~Spleeze@173-15-131-114-BusName-Philadelphia.hfc.comcastbusiness.net] has joined #ruby-lang
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby-lang
ascarter [ascarter!~ascarter@74.211.208.178] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
Marco_ [Marco_!~marco@pat160.dartmouth-secure.border2-cfw.Dartmouth.EDU] has joined #ruby-lang
Marco__ [Marco__!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby-lang
whoops [whoops!u549@gateway/web/irccloud.com/x-anzzlgqwjdlghhuw] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-71-224-192-35.hsd1.pa.comcast.net] has joined #ruby-lang
JosephRuby [JosephRuby!~joseph@46.33.34.7] has joined #ruby-lang
<lianj>
GarethAdams: hehe, rubinius 1.9 head does not have this issue
<MistyM>
Oh no, they'd better get on that if they want 100% compatibility! ;)
<lianj>
^^
billy_ran_away [billy_ran_away!~billy_ran@pool-173-69-211-31.bltmmd.fios.verizon.net] has joined #ruby-lang
<Tasser>
lianj, there is rubinius 1.9?
<lianj>
rbx -X19, yes
indeterminate [indeterminate!~sei@user-3c2h3m6.cable.mindspring.com] has joined #ruby-lang
slyphon_ [slyphon_!~weechat@unaffiliated/slyphon] has joined #ruby-lang
wallerdev [wallerdev!~wallerdev@c-68-43-58-191.hsd1.mi.comcast.net] has joined #ruby-lang
<Tasser>
ah well
<Tasser>
but still no encoding iirc
dreinull [dreinull!~dreieins@217.18.70.225] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
virunga [virunga!~virunga@151.64.22.171] has joined #ruby-lang
brianpWins [brianpWins!~brianpWin@184.71.184.110] has joined #ruby-lang
skinnymuch [skinnymuch!~skinnymuc@static-173-61-113-6.cmdnnj.fios.verizon.net] has joined #ruby-lang
skinnymuch [skinnymuch!~skinnymuc@static-173-61-113-6.cmdnnj.fios.verizon.net] has quit [#ruby-lang]
boodle [boodle!~boodle@174.46.129.34] has joined #ruby-lang
boodle [boodle!~boodle@174.46.129.34] has joined #ruby-lang
Locke23rus_ [Locke23rus_!~quassel@128-70-23-199.broadband.corbina.ru] has joined #ruby-lang
amerine [amerine!~mturner@67.204.184.82] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
szarubin [szarubin!~stas@94.27.82.120] has joined #ruby-lang
CoverSlide [CoverSlide!~richard@216.2.249.50] has joined #ruby-lang
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
arooni-mobile [arooni-mobile!~arooni-mo@189.131.32.148] has joined #ruby-lang
<billy_ran_away>
Hi I'm working on a Ruby on Rails gemified plugin, I'm having trouble accessing the ActiveRecord model instance from one of the plugin's instance methods. I wrote a test and method to try and figure it out but I'm stuck.
Jake232 [Jake232!~textual@5e04f412.bb.sky.com] has joined #ruby-lang
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby-lang
Jay_Levitt [Jay_Levitt!~Jay_Levit@c-24-63-250-125.hsd1.ma.comcast.net] has joined #ruby-lang
Keva161 [Keva161!~Keva161@78.32.156.143] has joined #ruby-lang
Foxmaster [Foxmaster!~root@c-83-219-199-232.cust.bredband2.com] has joined #ruby-lang
benanne [benanne!~rijdier@ip-213-49-84-172.dsl.scarlet.be] has joined #ruby-lang
bglusman [bglusman!~bglusman@50.128.76.161] has joined #ruby-lang
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
andrewhl [andrewhl!~andrew@CPE204e7f4a94cb-CM001cea3dec2e.cpe.net.cable.rogers.com] has joined #ruby-lang
twittard [twittard!~twittard@cpe-76-169-74-39.socal.res.rr.com] has joined #ruby-lang
bglusman [bglusman!~bglusman@50.128.76.161] has joined #ruby-lang
szarubin [szarubin!~stas@94.27.82.120] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
bglusman [bglusman!~bglusman@50.128.76.161] has joined #ruby-lang
tychobrailleur [tychobrailleur!~sebastien@176.61.72.130] has joined #ruby-lang
syphar [syphar!~syphar@brln-4dbc3c16.pool.mediaWays.net] has joined #ruby-lang
arooni-mobile [arooni-mobile!~arooni-mo@189.131.32.148] has joined #ruby-lang
ylluminate [ylluminate!~ylluminat@rrcs-24-123-53-166.central.biz.rr.com] has joined #ruby-lang
<ylluminate>
normally to map 2 data points from a result to a 2d array you'd do something like this: data2_and_time_array = readings.map{|row| [row.date, row.data1.to_f] }
<ylluminate>
however in my case, if a row.data1 is -1, i need to insert nil into the array. how would you properly map that or create a block to build that array?
s_dana [s_dana!~s_dana@50.124.144.88] has joined #ruby-lang
vmatiyko [vmatiyko!~vmatiyko@178.120.60.40] has joined #ruby-lang
robotmay [robotmay!~robotmay@5ad8f1da.bb.sky.com] has joined #ruby-lang
robgleeson [robgleeson!~rob@subtle/contributor/robgleeson] has joined #ruby-lang
whatasunnyday [whatasunnyday!~sunny@64.175.137.28] has joined #ruby-lang
bglusman [bglusman!~bglusman@c-68-80-200-61.hsd1.pa.comcast.net] has joined #ruby-lang
cyri_ [cyri_!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby-lang
desireco_ [desireco_!~textual@12.34.4.33] has joined #ruby-lang
RomD [RomD!~Roman@nrbg-4d077e0c.pool.mediaWays.net] has joined #ruby-lang
<manveru>
ylluminate: put an if there
<manveru>
{|row| [row.date, row.data1.to_f] if row.data1 != -1 }
davehimself [davehimself!~davehimse@c-98-200-201-146.hsd1.tx.comcast.net] has joined #ruby-lang
davehimself [davehimself!~davehimse@c-98-200-201-146.hsd1.tx.comcast.net] has quit [#ruby-lang]
<ylluminate>
ah, right, and it will be a nil otherwise since it gets no value
<ylluminate>
however manveru, on further thought, what you gave will simply skip that element, both the date and data right?
<manveru>
ylluminate: yes
<ylluminate>
i wasn't wanting to skip it, but rather to include the date while inserting a nil
<manveru>
you said you want nil instead of the array
<manveru>
well, then put the nil inside the array
andrewhl [andrewhl!~andrew@CPE204e7f4a94cb-CM001cea3dec2e.cpe.net.cable.rogers.com] has joined #ruby-lang
<manveru>
{|row| [row.date, row.data1.to_f if row.data1 != -1] }
<ylluminate>
sorry, nil for that particular data point, not the date; right. so it would be ..
<ylluminate>
right
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
tekin [tekin!~tekin@cpc8-with5-2-0-cust208.1-4.cable.virginmedia.com] has joined #ruby-lang
<ylluminate>
well the latter is a syntax error as it's not wanting the if to follow that directly; "expecting ]"
<manveru>
hmm
kyrylo [kyrylo!~kyrylo@46.118.220.170] has joined #ruby-lang
<manveru>
oh well, then i guess it needs parenthesis
Carnage\ [Carnage\!~carnage@84-75-163-211.dclient.hispeed.ch] has joined #ruby-lang
<manveru>
{|row| [row.date, (row.data1.to_f if row.data1 != -1)] }
<ylluminate>
"expected expression" after the if
<ylluminate>
lol
<ylluminate>
got it
andrewhl [andrewhl!~andrew@CPE204e7f4a94cb-CM001cea3dec2e.cpe.net.cable.rogers.com] has joined #ruby-lang
<ylluminate>
was from working with bigdecimal, fixed it
<ylluminate>
thanks very much
<slyphon>
ARGH! RACK!
<ylluminate>
now i have a db performance issue
<slyphon>
dammit, how do i get rack to display a *text* backtrace?
outoftime [outoftime!~mat@ip-160-79-101-2.autorev.intellispace.net] has joined #ruby-lang
Yu\2 [Yu\2!~Yu@2001:638:504:f1f6:213:77ff:feb6:afb0] has joined #ruby-lang
alessio_rocco [alessio_rocco!~alessio@176.32.21.35] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-60-40.washdc.btas.verizon.net] has joined #ruby-lang
<epitron>
very carefully?
Jay_Levitt [Jay_Levitt!~Jay_Levit@c-24-63-250-125.hsd1.ma.comcast.net] has joined #ruby-lang
szarubin [szarubin!~stas@94.27.82.120] has joined #ruby-lang
<epitron>
slyphon: like, in the browser? or at the console?
<slyphon>
console
<slyphon>
i just overrode prefers_plain_text?
twittard [twittard!~twittard@wc.lax.truecarcorp.com] has joined #ruby-lang
JoelMcCracken [JoelMcCracken!~user@static-151-201-108-130.pitt.east.verizon.net] has joined #ruby-lang
vmatiyko [vmatiyko!~vmatiyko@178.120.60.40] has quit [#ruby-lang]
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
jmontross [jmontross!~Adium@static-96-236-65-137.snfcca.dsl-w.verizon.net] has joined #ruby-lang
ben [ben!~v@dslb-088-066-000-219.pools.arcor-ip.net] has quit [#ruby-lang]
zenspider [zenspider!~user@envy.zenspider.com] has joined #ruby-lang
zmack [zmack!~zmack@78.97.129.175] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-60-40.washdc.btas.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
indeterminate [indeterminate!~sei@user-3c2h3m6.cable.mindspring.com] has joined #ruby-lang
tommyvyo_ [tommyvyo_!~tommyvyo@38.123.129.115] has joined #ruby-lang
<necromancer>
what's the big deal with Rubinius anyway?
<necromancer>
what benefits does it offer vs. that of, say, MRI 1.9.3 or REE 1.8.7?
<burgestrand>
necromancer: ask in #rubinius
ascarter [ascarter!~ascarter@74.211.208.178] has joined #ruby-lang
<necromancer>
burgestrand: that makes as much sense as joining #python and asking them why python is so much better than ruby
<necromancer>
=)
<burgestrand>
necromancer: no it doesn’t
<jmontross>
everyone has their biases…. people with biases are more likely to help you when you ask such a question.
<necromancer>
that's true
<necromancer>
nah i was fucking around i just didn't know that was a channel
<jmontross>
and they have more knowledge of that domain. i dont know anything about rubinius… didn't even know it had a channel
spleeze [spleeze!~Spleeze@173-15-131-114-BusName-Philadelphia.hfc.comcastbusiness.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-45-63.a155.priv.bahnhof.se] has joined #ruby-lang
ksinkar [ksinkar!~ksinkar@115.241.157.130] has joined #ruby-lang
Marco [Marco!~marco@Marco-2.Kiewit.dartmouth.edu] has joined #ruby-lang
leonL [leonL!~leonl@199-7-156-34.eng.wind.ca] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
desireco_ [desireco_!~textual@12.34.4.33] has joined #ruby-lang
<ylluminate>
manveru: hey, on that solution earlier, turns out it is exceptionally slow. wondering how / why that's happening
szarubin [szarubin!~stas@94.27.82.120] has joined #ruby-lang
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
<ylluminate>
i initially thought it was due to having added a field to my db query, however after a bit of poking, that query only takes about half a second
<ylluminate>
and the delay comes to bear on the map function it seems
<drbrain>
"only about half a second"
* drbrain
is boggled
pigdude [pigdude!~tallen@li61-243.members.linode.com] has joined #ruby-lang
<manveru>
:)
<manveru>
ylluminate: depends on what your row object is
ozzloy [ozzloy!~ozzloy@unaffiliated/ozzloy] has joined #ruby-lang
<manveru>
if you do a query everytime date and data1 are called, then yeah... it's gonna be painfully slow
<ylluminate>
i have 2 bigdecimals (to float) and a date; 1000 rows
<ylluminate>
no, only 1 query
<manveru>
ok, and when do the dates get converted?
<Sailias>
the conversions themselves won't be slow
<ylluminate>
i wouldn't think; grabbing src for you to poke right now
<Sailias>
ylluminate, and the map won't be slow either
<manveru>
if it uses something silly like Date.parse
<ylluminate>
ah, i think i see the issue
<Sailias>
manveru, i guess it depends what ruby version he's using, 1.9 shouldn't have date issues, but 1.8.6 possibly 1.8.7 should use the date_performance gem
<ylluminate>
hang tight, seems like it was a leftover loop stepping through the readings that i didn't catch earlier and had to step away from the project for a bit.
<manveru>
heh
<manveru>
Sailias: also depends on the ORM
<ylluminate>
gah, i hate multitasking
<Sailias>
ylluminate, yes, looping over and over will cause performance problems.
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby-lang
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby-lang
<apeiros_>
dreinull: Date doesn't have time, I'd worry about that more…
<drbrain>
Date.parse loses data
<drbrain>
but, manveru's strptime is better
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<dreinull>
that's always been a frequent source of confusion for me.
<dreinull>
core and std classes with the same name
<manveru>
core only covers what it needs to answer stuff like File.mtime
<manveru>
Time.parse is a megaton of crufty spaghetti mess
floyd2 [floyd2!~floyd2@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
<drbrain>
because human time formats are a megaton of crufty spaghetti mess
<manveru>
exactly
<Asher>
that sounds like a good slogan for some time-oriented product ;)
<dreinull>
the nice thing about parse is it always works somehow.
<apeiros_>
dreinull: it's not two different classes with the same name. it's one class. stdlib just provides some additions.
<Asher>
what's the concern whether it's core/stdlib? when does that difference actually come up as relevant?
<zenspider>
manveru: so? it works
<dreinull>
apeiros_: sure, some call it monky patching :)
<dreinull>
monkey
<drbrain>
Asher: only when you forget to require 'time'
<apeiros_>
dreinull: it's not really monkey patching if you're the owner.
<Asher>
ahh gotcha
<dreinull>
apeiros_: no, that's fine with me.
<apeiros_>
dreinull: I wasn't trying to address some feeling of yours :) I wanted to point out that it is in fact not monkey patching (or I wouldn't consider it to be)
<dreinull>
apeiros_: of course not. I'd just give it a different name. Like Time-ext
<manveru>
zenspider: Time.parse bit me once too often
<apeiros_>
agreed. "Time.parse - so it works" - sometimes, yes, sometimes not. sometimes it used to work and suddenly changed…
<manveru>
well, there is no need to rely on guesses if you know the format
<manveru>
for the same reason as i'd use Float() instead of to_f if i know it must be a Float format
andrewhl [andrewhl!~andrew@24-246-14-26.cable.teksavvy.com] has joined #ruby-lang
<jorgenpt>
Is there any way to have ri use ANSI output and a pager on 1.9.x? Under 1.8.x I could use RI="-f ansi" RI_PAGER="less -R", but under 1.9.x that doesn't page
<jorgenpt>
I think ri 1.9 uses PAGER instead of RI_PAGER?
<manveru>
jorgenpt: source says it still uses RI_PAGER