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
bryancp has joined #ruby-lang
m3nd3s has joined #ruby-lang
gsav has joined #ruby-lang
virunga has joined #ruby-lang
heftig has joined #ruby-lang
gregf has joined #ruby-lang
Sailias has joined #ruby-lang
boxmo has joined #ruby-lang
leonL_ has joined #ruby-lang
thone_ has joined #ruby-lang
bryancp has joined #ruby-lang
justinxreese has joined #ruby-lang
leonL has joined #ruby-lang
achiu has joined #ruby-lang
Indian has joined #ruby-lang
dhruvasagar has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
mikeric has joined #ruby-lang
<andrewvos> burgestrand: Dude that was cool. Thanks
FACEFOX has joined #ruby-lang
seanstickle has joined #ruby-lang
vlixes has quit ["ERC Version 5.3 (IRC client for Emacs)"]
imperator has quit ["Leaving"]
empity has joined #ruby-lang
wmoxam has joined #ruby-lang
brianpWins has joined #ruby-lang
slackstation has joined #ruby-lang
wallerdev has joined #ruby-lang
slimfit has joined #ruby-lang
tenderlove has joined #ruby-lang
heppy_ has joined #ruby-lang
slyphon has joined #ruby-lang
nofxx has joined #ruby-lang
mikeric has joined #ruby-lang
havenn_ has joined #ruby-lang
wallerdev has joined #ruby-lang
zwevans has joined #ruby-lang
achiu has joined #ruby-lang
achiu has joined #ruby-lang
Avanine has joined #ruby-lang
kurko_ has joined #ruby-lang
kurko__ has joined #ruby-lang
shtirlic_ has joined #ruby-lang
mighty_max has joined #ruby-lang
srbaker has joined #ruby-lang
igotnolegs has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
Luxx_ has joined #ruby-lang
seoaqua has joined #ruby-lang
tonesfrommars has joined #ruby-lang
mikeric has joined #ruby-lang
Sailias has joined #ruby-lang
kurko_ has joined #ruby-lang
Joeysomo has joined #ruby-lang
kurko__ has joined #ruby-lang
<petercooper> github going crazy for anyone else?
<petercooper> getting raw HTTP headers and crud everywhere
Joeysomo has joined #ruby-lang
<srbartlett> petercooper: same here
<petercooper> switched to a diff browser that's not logged in and it looks OK
QoQOoO has joined #ruby-lang
woollyams has joined #ruby-lang
csherin has joined #ruby-lang
unixabg has quit [#ruby-lang]
Jade has joined #ruby-lang
Giddeon has joined #ruby-lang
boxmo has joined #ruby-lang
coreydaley has joined #ruby-lang
m3nd3s has joined #ruby-lang
wmoxam has joined #ruby-lang
QoQOoO1 has joined #ruby-lang
acyed has joined #ruby-lang
wyhaines has joined #ruby-lang
vpamulap has joined #ruby-lang
QoQOoO has joined #ruby-lang
brownies has joined #ruby-lang
Hensley has joined #ruby-lang
cdnz has joined #ruby-lang
rushed has joined #ruby-lang
heppy has joined #ruby-lang
ryanf has joined #ruby-lang
srbaker has joined #ruby-lang
FACEFOX has joined #ruby-lang
jimmy has joined #ruby-lang
tenderlove has joined #ruby-lang
srbaker has joined #ruby-lang
dr0id has joined #ruby-lang
sdeobald_ has joined #ruby-lang
woollyams has joined #ruby-lang
rippa has joined #ruby-lang
<erikh> pfffffft
<lianj> silent fart?
<dominikh> that wasn't very silent
nofxxx has joined #ruby-lang
boxmo1 has joined #ruby-lang
<erikh> I've conditioned you all. ha ha!
<deryldoucette> erikh: do you run jruby?
<deryldoucette> if you do can you throw your machine this command? rvm install jruby --1.9 && rvm use jruby && rvm docs generate all
<deryldoucette> gist me the docs portion please?
<deryldoucette> don't need it if you're < 8m, just a conf that it was that short
dhruvasagar has joined #ruby-lang
mighty_max has quit ["Leaving"]
<erikh> my god
<erikh> reddit thanks for reminding me SO QUICKLY why I don't read you
<erikh> deryldoucette: I don't typically, but I don't mind doing that. one minute.
<deryldoucette> erikh: thank you
<erikh> whiskey in the .jar-o
<deryldoucette> it *might* take a LOT longer than that, thats the issue i'm currently tracking. can't figure out the issue, so the more i get, hopefully the more it points to a *serious* fuckup on my machine.
<erikh> I'm on a pretty fast machine here
<deryldoucette> mpapis, remear, headius, and yellow5 are workin on it too
<erikh> but you're probably right.
<erikh> what are you seeing?
<erikh> ... should I do this in a vm?
<deryldoucette> yeah me too. 2.3GHz quad-core with 8GB RAM and STILL seeing > 2h docs build times with 1 out of 3 builds needing a kill -9
<erikh> ah
<deryldoucette> yeah just for your own machine's sanity heheh
<erikh> did you install the latest rdoc before you ran it?
<deryldoucette> yeah
<erikh> rdoc 3.x is a *lot* faster.
<deryldoucette> oh 3.x??
<deryldoucette> hold on
<erikh> drbrain: ^5 to that btw
<deryldoucette> yeah rdoc 3.12
<erikh> throwing this in the mix just to be certain; gem install rdoc
G-REY has joined #ruby-lang
<erikh> ok
<deryldoucette> ooo ooo
<erikh> deryldoucette: are you on a mac?
<deryldoucette> dude, java -version please?
<deryldoucette> yeah
<deryldoucette> 2011 mbp
<erikh> hit ^T while the docs are building
<erikh> it might help you.
<erikh> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b)
<deryldoucette> I'll have to kick that to you. idk java and oits commands very well. load: 2.69 cmd: java 40670 waiting 94.63u 3.01s
<erikh> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
<deryldoucette> yeah i JUST went to 1.7
<deryldoucette> but thats what i WAS at and was getting 2h+ doc buidls
<erikh> it's waiting
<deryldoucette> and having to kill the task
<erikh> hrm
<deryldoucette> ok now THAT was wierd
<erikh> I remember seeing this before with rdoc, but I don't remember when
<deryldoucette> sec
<deryldoucette> I'm running: rvm install jruby --1.9 && rvm use jruby && rvm docs generate all
<erikh> is it during ri or rdoc generation
<deryldoucette> the FIRST build after i upgraded java took like 20s
<deryldoucette> bit THIS build (#2) is taking freakin forever
G-REY has quit [#ruby-lang]
gokul has joined #ruby-lang
<erikh> just finished
<deryldoucette> goddamn it
<deryldoucette> wtf is going on??
<erikh> I can time it if you'd like
<deryldoucette> please?
<erikh> want me to upgrade java?
<deryldoucette> can you do one with each?
<erikh> sure
<deryldoucette> i'm really starting to think its rdoc and not rvm OR jruby
<erikh> bbiam, going to smoke
<deryldoucette> np :) mee too
<erikh> well, i'm on a SSD here
<deryldoucette> SATA here but it shouldn't be a 2 freakin hour build either way
<erikh> on an 8 core (after hyperthreading) i7 with about 6G of ram free.
<deryldoucette> yea same except I got 8GB RAM
<erikh> but yes, I agree
<deryldoucette> 2.3GHz quad core?
<erikh> are you heavy into swap?
<deryldoucette> no
<erikh> ok, i'll try with java 7 after this
<erikh> back in 5
macmartine has joined #ruby-lang
<deryldoucette> MemRegions: 44551 total, 4358M resident, 142M private, 985M shared. PhysMem: 1425M wired, 4507M active, 2150M inactive, 8082M used, 101M free.
<deryldoucette> VM: 352G vsize, 1091M framework vsize, 10377478(0) pageins, 392282(0) pageouts. Networks: packets: 23092211/21G in, 16239046/2827M out.
<deryldoucette> but WOW does it jack my load levels
<deryldoucette> Load Avg: 2.85, 2.56, 1.85 CPU usage: 14.48% user, 3.3% sys, 82.47% idle SharedLibs: 400K resident, 0B data, 0B linkedit.
<deryldoucette> erikh: when you get the chance..
<deryldoucette> for count in {1,2,3,4,5}; do 'rvm reinstall jruby && rvm use jruby && rvm docs generate all'; done
<deryldoucette> WOW
<deryldoucette> load: 2.22 cmd: java 40670 waiting 547.78u 5.67s
mikkelb has joined #ruby-lang
<deryldoucette> erikh: my last doc build has been going since you left. and my fans are going NUTS
<erikh> ( rvm reinstall jruby --1.9 && rvm use jruby && gem install rdoc && rvm docs ) 247.21s user 24.66s system 171% cpu 2:38.53 total
<deryldoucette> still building or did it end?
<erikh> it finished
<deryldoucette> i'm seriously thinking this is a java issue
<erikh> that was the total runtime
<erikh> gonna try java 7 now
<deryldoucette> load: 2.40 cmd: java 40670 waiting 799.49u 6.17s
<deryldoucette> mine is STILl running
<erikh> uh. sorry to be so dumb
<erikh> where do I get java 7?
<deryldoucette> oh sec. killed the page hehe gimme a sec to check cache
<deryldoucette> gotta do the friggin radio button crapola to get it
<deryldoucette> for the license agreement
<erikh> yep
<erikh> standard oracle.
<erikh> I plan on doing some clojure shit soon anyhow so this'll probably be a good thing
<shevy> where is the enthusiasm!!!
<erikh> deryldoucette: have you tried on linux?
<deryldoucette> lol
<deryldoucette> erikh: no
<erikh> also what jruby? I was installing 1.6.6
<deryldoucette> thats next if this proves to be an issue
<deryldoucette> well an issue for java not just mac
<deryldoucette> 1.6.7 in 1.9 mode
<erikh> ok
<erikh> after I get 7 installed, I'll rvm get stable after the first run
<deryldoucette> yeah thats what i am on
<deryldoucette> 1.6.7 in 1.9 mode. if you get a build that completes fast, do another one immediately
kp666 has joined #ruby-lang
<deryldoucette> for count in {1,2,3,4,5}; do 'rvm reinstall jruby && rvm use jruby && rvm docs generate all'; done
<erikh> god damnit
<deryldoucette> see if any of those take friggin nightmarishly long
<erikh> did oracle install this in /opt or something retarded?
<deryldoucette> no you have to click on the pkg
<erikh> I did.
<erikh> I installed it.
<deryldoucette> installs to /usr/bin
<deryldoucette> ∴ which java
<deryldoucette> /usr/bin/java
<shevy> you sound happy
<deryldoucette> bit you do have to go under Utilities and then drag the jdk 1.7 to the TOP of the list
<deryldoucette> then open a new terminal and then: java -version
<erikh> right
<deryldoucette> java version "1.7.0_04-ea"
<deryldoucette> Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b15)
<deryldoucette> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b16, mixed mode)
<erikh> oh
<erikh> I see
<deryldoucette> shevy: i'm always happy when I got a bug like this to sink my teeth into :)
<deryldoucette> aggravating to hell and back but OH so much fun! :)
<deryldoucette> means i'm not totally nuts :)
<deryldoucette> close to it, but not all the way there yet. :-)
<shevy> damn you are one happy code monkey, I would have already picked up a bat and would have crushed things in my surroundings!
wshaddix has joined #ruby-lang
<deryldoucette> hehehe i was close earlier :)
<erikh> ok, 1.6.6 with java 7 running
<deryldoucette> i stepped away and said I'll be damned if a piece of digital CRAP gets the best of ME :)
<erikh> hey
<erikh> I spew digital crap in here all the time
<erikh> I take offense tot hat
<deryldoucette> lol
<deryldoucette> and for the record... THIS crap is why I don't code in java!
<erikh> java's a fine system
<erikh> if you walked away from every platform because of a few bugs, you'll find yourself with nothing to work on eventually
<deryldoucette> it might be, but these kinds of issues just blow my friggin mind
<erikh> ( rvm reinstall jruby --1.9 && rvm use jruby && gem install rdoc && rvm docs ) 248.24s user 26.33s system 164% cpu 2:46.60 total
<erikh> that's with jruby 1.6.6 and java 7
<erikh> Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b15)
<deryldoucette> wtf
<erikh> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b16, mixed mode)
<erikh> one sec
<erikh> gonna upgrade rvm
<deryldoucette> and with 1.7?
<deryldoucette> ok
<deryldoucette> yeah rvm get head && rvm get stable && rvm reload
<erikh> fwiw I'm running 1.10.2 atm
<erikh> I'm not 'getting head'
<deryldoucette> then reinstall jruby to build against 1.7 and then rerun the rvm docs generate all
<deryldoucette> lol
<erikh> I've throttled more workstations getting the head of rvm than anything else lately.
<deryldoucette> no no
<deryldoucette> rvm get head && rvm get stable
<erikh> right
<deryldoucette> that will back you down to stable
<erikh> I'll just get stable :)
<erikh> 1.10.3 now
<deryldoucette> ok
<erikh> running 1.6.7 install now
<deryldoucette> oh did you do rvm instal jruby --1.9 ?
<deryldoucette> trying to find out if its a 1.9 mode issue or *java* itself
<erikh> sure
<erikh> that's why I'm helping by bisecting
<erikh> if this works great, it's probably your machine :)
<erikh> so load average is much higher now
<deryldoucette> yeah thats what I'm praying it is
<erikh> noticablyy so
<deryldoucette> thats FAR easier to explain
Nisstyre has joined #ruby-lang
<erikh> dtruss looks interesting
<erikh> I think I might have found it
<erikh> looks like some threading shiz
<deryldoucette> ooooo
<erikh> yeah this is all memory barrier code
<deryldoucette> do tell! :)
<erikh> *probably* thread-related
<erikh> it's just looping
Tearan has joined #ruby-lang
<erikh> nothing exciting, but busy looping
<deryldoucette> can ya gist for me? (preface it with probably or potentially statements. I might have to show headius)
<erikh> yeah
<erikh> oh nevermind it just started going
<erikh> maybe it was just cpu time?
<erikh> here, let me tee some of this and then I'll gist it
<deryldoucette> ok
<erikh> this is definitely taking a lot longer though
<erikh> I'll go have a smoke, and it's probably too big for a gist but I'll put it somewhere you guys can get it.
<deryldoucette> wooT!
<deryldoucette> at least you're getting closer to where I'm sitting
<erikh> it may not be useful
<deryldoucette> yeah i need one too, plus a beeer
<deryldoucette> erikh: seriously, i'd rather this come out that I'm jsut a dumb ass and did somethign stupid than it being an actual issue
<deryldoucette> so whatever it takes on your end to figure out if tis just a freaky thing or something real, I'm willing to sit tight for
<erikh> no, it's definitely looking like something is taking way too long in the CPU department
<erikh> it calls mprotect a billion times for about 2 minutes straight, then it writes out a file
<deryldoucette> cool, then i might not have to put away the weed and the beer and become celibate :)
<WillMars_> If I have a large hash, and I have an array of keys that are in that hash - what would be the most elegant way of getting the subset of my hash that corresponds to my array of keys?
<erikh> deryldoucette: anyhow, smoke now, gzip -> server in a few minutes.
<erikh> I'll get you a link when I've done that.
<deryldoucette> erikh: rockin! :)
<WillMars_> I can do it with some clunky iterators, but I'm hoping for something pretty
mephux has joined #ruby-lang
mikeric has joined #ruby-lang
<erikh> deryldoucette: take notes
<deryldoucette> sec
<erikh> is the gist of lsof against the process running rdoc
<erikh> http://hollensbe.org/dtruss-1.6.7.log.gz is the dtruss (syscall trace) log
<erikh> rvm is 1.10.3
<erikh> java is:
<erikh> oh shit
<erikh> I never restarted teh shell
<deryldoucette> do i have you permission to pass this on to headius?
<erikh> yep, this isn't java 7 at all
<erikh> explains the lsof output
<erikh> yes
<erikh> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b)
<erikh> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
<erikh> that's what hit it
<erikh> on rvm 1.10.3
<deryldoucette> ok lemme do some email magic real quick
<erikh> remember, 1.10.2 and 1.6.6 in 1.9 mode worked fine
<erikh> on that build of java
<deryldoucette> and the fact its 1.6 is fine. thats what originally caused me grief
<deryldoucette> ok
<deryldoucette> i'll make sure to point that out
<erikh> notice that I'm still on java 6 up there
<deryldoucette> yeah i did
<erikh> lsof will confirm that.
<erikh> ok
<deryldoucette> i had initial success with 1.7, it was with the next set of builds that it acted like it did with 1.6
<erikh> anyhow, HTH, and i'll be around for another hour or two if headius wants to drop in and chat some more
<deryldoucette> which you're showing as well.
<deryldoucette> got ya. he's been quiet since i last tweeted him so he might hav ehit the rack. idk
<erikh> I doubt I can do anything else to help, he's the java whiz
<deryldoucette> yeah he's FAR ahead of me.
<erikh> well that guy (judging from his feed) goes to like 800 conferences a year
<deryldoucette> heheh
<erikh> so I imagine he has his fair share of sleep woes
<deryldoucette> yeah generally when he tells me i'm off in lala land i tend to listen :)
<erikh> he's good people
<shevy> wat
pankajdoharey has joined #ruby-lang
<erikh> anyhow, let me know if you need anything else from me
<shevy> sex!
<erikh> I'm pretty sure I've got a repro ready to fire if you need it.
<deryldoucette> not a problem. thanks for delving in as far as you have. greatly appreciated
Joeysomo has joined #ruby-lang
headius has joined #ruby-lang
pankajdoharey has quit [#ruby-lang]
<deryldoucette> he tweeted back. think he's joining here
<deryldoucette> headius: not sure if you've been monitoring or not
<headius> :)
<headius> no
<deryldoucette> hehe
<erikh> I just profiled it with dtruss and dumped lsof on it
<headius> watching DS9 and drinking one of enebo's homebrews
<deryldoucette> i'm not at your level, but i've been asking others to look into it as well. erikh took the time to go through it for me on his end. would you be willing to see the gz and the gist?
<headius> sure
<deryldoucette> love that damned show! :)
<headius> sounds like something's just busted
<headius> yeah, I never watch DS9 when it was on
<headius> watched
<headius> so finally starting it on netflix
<deryldoucette> yeah but i'm not sure where. i was thinking it was rdoc but now i'm thoroughly confused
<headius> well one thought that occurs is that it's hitting the default memory cap
<erikh> it seems to be related to 1.10.3 rvm or 1.6.7 jruby. tried with other combinations
<headius> that can often cause it to perform extremely slowly, if if finishes at all
<erikh> it was doing a lot of memory barrier work in the dtruss
<deryldoucette> for a bit of background, both of us hav edone this on 1.6, and i did it on 1.7 BUT i've had several folks tell me on twitter they get the docs built and done in 8m or less
<deryldoucette> so not sure where to go to debug this at this point. this is well beyond my personal pay greade :)
<deryldoucette> err grade
<erikh> hollensbe.org/dtruss-1.6.7.log.gz
<erikh> maybe it helps!
<deryldoucette> headius: one thing i did notice... the FIRST execution under both 1.6 AND 1.6 finished in record time. like < 2m. but subsequent executions .. WOW what a difference
<headius> do you know what the process size what?
<deryldoucette> i still have one execution going
<headius> er
<headius> what=was
<deryldoucette> load: 6.60 cmd: java 40670 waiting 11536.37u 27.44s
ascarter has joined #ruby-lang
<deryldoucette> not on my end headius. sorry :/
<headius> yeah, looks like it's memory
* deryldoucette screams at his fans to stfu up :)
<headius> try passing JAVA_OPTS=-Xmx1024M
<headius> env
<headius> hopefully rvm won't prevent env from propagating
<deryldoucette> sec. kill the hung and try it again?
<headius> it looks like it's stuck trying to GC endlessly
<deryldoucette> headius: see msg
<deryldoucette> i sent it that way just because i didnt sanitize my env
<deryldoucette> redoing the rvm docs generate all right now
<headius> hmm
<headius> ok
<deryldoucette> my rvm is 1.10.3 and my java is java version "1.7.0_04-ea"
<deryldoucette> Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b15)
<deryldoucette> Java HotSpot(TM) 64-Bit Server VM (build 23.0-b16, mixed mode)
<deryldoucette> the *same* problem with both 1.6 and 1.7. I'll revert to 1.6 if you need me to
<deryldoucette> load: 3.39 cmd: java 41272 waiting 164.46u 4.90s
woollyams has joined #ruby-lang
<headius> hmm
<headius> rdoc generation isn't using any native ext, is it?
<deryldoucette> not that i know of
<erikh> json maybe?
<erikh> hold on a sec, I have a lsof gist of the running proc
<headius> looks ok
<erikh> re-running with the mem tweak exported
<deryldoucette> mine's still hung even with the export
<headius> ok
<headius> get a thread dump
<headius> ctrl+\
<headius> then a memory histogram
<deryldoucette> ^\/Users/me/.rvm/scripts/docs: line 63: 41271 Quit: 3 ( builtin cd "${rvm_src_path}/$rvm_docs_ruby_string/"; rvm_log "Generating ri documentation, be aware that this could take a *long* time, and depends heavily on your system resources..."; rvm_log "( Errors will be logged to ${rvm_log_path}/$rvm_docs_ruby_string/docs.log )"; rdoc -a --ri-site > /dev/null 2>> ${rvm_log_path}/$rvm_docs_ruby_string/docs.log )
<headius> jmap -histo <pid>
<deryldoucette> that last i don't know how to do
<deryldoucette> oh heheh sec
<headius> memory dumps ok
<mikkelb> deryldoucette: shut the *FUCK* up
<headius> ctrl+\ to get a thread dump, got that?
<headius> wow, that's confusing
<deryldoucette> damn it taht was the sub process
<deryldoucette> give me a sec
<deryldoucette> mikkelb: yo dude, i was ASKED for this so piss off. I'm doing exactly what he asked for.
<erikh> ignore him
<deryldoucette> go back to #rubyonrails and harrass them there
<headius> funny :)
<deryldoucette> yea i will
<mikkelb> deryldoucette: i just see you dissing people in #rubyonrails so why should you be treated like royalty here
<mikkelb> saying shit like "ooh im so bad, wait till you see how bad i can really be" type of bullshit
jorgenpt has joined #ruby-lang
necromancer has joined #ruby-lang
<deryldoucette> headius: sorry i have you originally the subprocess of the jmap, this one is the parent: https://gist.github.com/d7f806a7f45912944116
<headius> ahhh
<deryldoucette> as for the c+\ thats what i gave earlier, but here it is again
<headius> joni
<muzone> mikkelb: yeah i've seen him do that
<headius> well there's a god chance this is an encoding or regexp thing
<headius> good
<headius> try it with master
<headius> there's a lot of fixes there
<deryldoucette> thats the c+\
<headius> erikh: yeah, looks very much like an encoding/regexp bug
<headius> I wouldn't expect it to ever return, if that's the case...is that what you're seeing?
<headius> it should go away and never come back
ryanf_ has joined #ruby-lang
<devn> headius: howdy
<headius> devn: hello
<mikkelb> deryldoucette should go away and never come back
* devn snickers
<erikh> zenspider: you around?
<erikh> deryldoucette: that's what I used to make ctrl+\
<erikh> work
<mikkelb> erikh: you haven't seen him outside.. oh i see
<mikkelb> he's your "personal friend"
<mikkelb> well alright then
<shevy> what friend
<deryldoucette> mikkelb: and muzone no, you guys make effort, use your grey matter and actually put effort into what you're doing I leave you alone. Like this here, I KNOW i'm not ANYWHERE near as good or capable as headius or erikh but you see me putting in every single bit of effort I can into this. I'll GLADLY be told I am being an idiot in this by headius. Why? because I put EFFORT in. I took MY time to chase down a problem whether of my own making ...
<deryldoucette> ... or of the project's that I work on. you guys do that in there instead expecting a friggin handout all the time, and you'll get the SAME level of treatment.
<erikh> jesus
<deryldoucette> now leave it alone and let us work
<headius> I'd say to try master
dr0id has joined #ruby-lang
<shevy> knife fight!
<erikh> headius: I'll give it a shot
<mikkelb> say what?
<shevy> what
<headius> if you can reduce this, it would be great, but master's going to be JRuby 1.7 preview or RC for JRubyConf in May
<erikh> deryldoucette: ignore them. they're attention starved and you're feeding them.
<mikkelb> deryldoucette: nobody's interested in reading that shit
<deryldoucette> erikh: sorry. you are right
<devn> headius: You replied to me on Twitter like I was party to the JVM biggotry, was that a CC or were you under the impression I agreed with dude who posts messages on Twitter?
<headius> this only happens in 1.9 mode too, right?
<deryldoucette> headius: right
<headius> yah
<headius> pretty sure it's a regexp/encoding bug, and it's almost certainly fixed on master
<headius> there have been multiple similar hangs
<devn> hm
<erikh> ok, building -head now
<devn> +=1
<headius> we fixed a bunch for 1.6.7, but there's a ton more work on master
beawesomeinstead has joined #ruby-lang
<erikh> gonna step away for 5 minutes.
<deryldoucette> ahh yeah i did the rvm get jruby --1.9 for the install
<deryldoucette> that pulls the head iiirc
<devn> deryldoucette: what os? vers of rvm?
<deryldoucette> lemme look at rvm_path/config/db
<headius> I don't think that will do head without jruby-head
<headius> in any case, master should say 1.7.0-dev
<headius> or 1.7.0.dev
<devn> headius: yeah you're right
<deryldoucette> headius: you're right. it pulls 1.6.7 tag
<deryldoucette> headius: you want me to pull head?
<devn> is that a euphemism?
<headius> yes
<headius> heh
<deryldoucette> ok sec
<headius> I always snicker when I say "rvm get head"
<deryldoucette> hehe me too
<deryldoucette> wayne and i have a running commentary on that <snicker>
<devn> i had to explain to a group of 25-30 year olds that "you needed to rvm get head"
mrb_bk has joined #ruby-lang
<deryldoucette> headius: on -head do i hav eto throw in the --1.9 or is that default now?
<headius> head is 1.9 by default
<devn> i dont think you need the --1.9
<deryldoucette> ok
dominikh has joined #ruby-lang
<devn> heh i forget headius is in here
<headius> not for much longer :)
<deryldoucette> doh!
<devn> "i think that......."
<devn> < headius> this is how you do it
<headius> I'm pretty confident this is encoding+regexp, which means it will work on master
<devn> "this might be how you do it"
<deryldoucette> headius: cool
<headius> which means I can go back to beer and DS9
<deryldoucette> @ant cext
<deryldoucette> err s/@/#/
<devn> headius: what's up with the jvm biggotry?
<deryldoucette> headius: sorry to pull you in. this was just a bit.. odd
<headius> I've had to deal with it for 6 years, but it has improved
<headius> I can't really blame people for hating oracle...they're easy to hate
<deryldoucette> its on the default gemsets
<devn> headius: yeah, it's weird. these communities that claim to be all love and art
krzyhoo has joined #ruby-lang
<devn> they are filled with rage against the things they don't particularly find beautiful
<devn> it's supreme irony
<devn> not "they" -- many, many aren't
<headius> I'm a rubinius fan too, but it's frustrating sometimes...like people like it solely because they don't want to like jruby
<headius> anyway...nothing new :)
<shevy> hehe
<deryldoucette> ok running rvm docs generate all now
<erikh> hrm
<erikh> -head still looks like it's failing
<deryldoucette> yeah same
<erikh> let me see if I can get the thread dump
<headius> then we would need to escalate this
<devn> headius: *nod*, but i feel it's getting to a point where it's *obvious*
<devn> bytecode optimization, rbx, maglev, yarv
<devn> there
<shevy> devn I love beauty! and ugliness makes me angry, I can't help it :(
<devn> there's not really a competitor against the jvm
<headius> I'm going to try to do a good survey of ruby VMs at rubyconf india
<devn> in terms of tooling, support, extension, etc.
<shevy> I see perl code and I get all violent
<erikh> actually, I think this is rvm.
<headius> deryldoucette: that seems to be the parent process or something
<devn> at one point in my life i would have been violent about java
<erikh> let me get a fresh checkout of the source manually and take rvm out of the equation.
<deryldoucette> cripes
<devn> i was militant anti-java when i was younger
<devn> but it's just craziness these days. it has so much money behind it. it's well-established. more libraries than any other language.
<deryldoucette> headius: ok, single CTL+\ gives me: https://gist.github.com/e79a2ab255218f43840d
<deryldoucette> the other one was the 2nd (took 2 to kill it)
<erikh> deryl that's a parent process
<headius> deryldoucette: still no good :)
<erikh> it's not java.
x0F_ has joined #ruby-lang
<headius> it should be a series of java stack traces
<erikh> I'll get you something in a minute -- taking rvm out of this.
<deryldoucette> k what am i doing wrong then?
<erikh> deryldoucette: I'll explain in a few minutes
<headius> if you guys can get something that runs without rvm, something I can run against a local build, I can take it from there
<erikh> basically, it has to do with rvm ... right
<devn> headius: are you coming to madison ruby again?
<deryldoucette> headius: perfect
<krzyhoo> wow...a lot is goin on here
<krzyhoo> :)
<headius> devn: when is it? I probably could, it's only a few hours away
<devn> headius: sorry to distract -- i have no tact lol
<headius> nah
<headius> that's IRC
<devn> headius: http://madisonruby.org/
<deryldoucette> headius: i'll work with erik. got an email we should send to? so you can deal with this tomorrow and get back to your beer and DS9 :)
<headius> it was a great time last year
<deryldoucette> msg of course :)
<headius> just file a bug at bugs.jruby.org
JohnBat26 has joined #ruby-lang
<headius> I'll see it
<devn> headius: i was so busy setting stuff up and what-not that i didnt even get a chance to meet you
<erikh> thanks.
<deryldoucette> oh, perfect will do
<devn> you gotta come back
<devn> CFP, brother.
<deryldoucette> headius: thanks for the stop in
<devn> :D
<headius> august...the only month that's not absurd for scheduling
<headius> yeah, I could definitely go
<headius> I'll mention it to the wife
<headius> we were thinking of spending august in EU maybe
<devn> yeah man, just submit something. i will *buy you cheese*
<headius> but dunno
<deryldoucette> wish i could say that. we got so many birthdays packed into aug, sept, and oct its a frickin nightmare hehehj
<headius> the cheese thing was great
<headius> I never had a chance to get to a cheese store though
<devn> lol, "the cheese store"
<headius> just beer stores...we found a bunch of madison brews we liked
<devn> im borderline embarassed by the idea of that
<deryldoucette> shows you how addicted to my beer i am. i read that as the beer store
<headius> heheh
<deryldoucette> (Im in canada)
<devn> hahah
<headius> madison is great...cheese and beer
<headius> ok, I'm out for now...will try to come to madison
<devn> well hey man, jim and jen know how to throw a conference. last year with martin dosh. a very cool after party
<deryldoucette> headius: ever tried Carling Beer?
<erikh> fwiw looks like head is working fine
<erikh> it's building ri at least.
<headius> erikh: oh, that's good news
<deryldoucette> brit brew., pretty good for a midline beer actually
<headius> I'll let you guys sort out the situation
<deryldoucette> erikh: oooo
<erikh> heh
<erikh> night.
<headius> deryldoucette: yeah, not bad for a macro
<devn> headius: yeah just buzz jim and let him know you want to stop up -- would be great to have you
<deryldoucette> night headius thanks for the stop in
<deryldoucette> yeah not bad at all
<headius> devn: cool, ok
<deryldoucette> erikh: that external to rvm?
<devn> cheers
<erikh> deryldoucette: yes
<erikh> fresh checkout of jruby
<headius> ok
<deryldoucette> ok, i'll have to pull and build seperately
<headius> nite
<deryldoucette> good to know!
<deryldoucette> night
<erikh> murphy's fucking law
<erikh> ... it just froze
<deryldoucette> thansk you two for the effort on this. now, to figure out how to track down WHAT is causing the issue
<deryldoucette> HAHAHA
<deryldoucette> damn murphy
<erikh> oh, no, it's just taking forever now
neoesque has joined #ruby-lang
* erikh will let it run
<deryldoucette> wow jus twhen i thought we'd gotten away free!
<erikh> definitely giving the fans a workout though
<erikh> anyhow, this is a little more than I expected to do
<deryldoucette> how come i couldn't be named scott and get away free so often!
<erikh> I'm going to call it here.
<deryldoucette> yeah thats fine. thank you for the effort you put in
<deryldoucette> I'll talk with wayne and michal and see what we can dig up
<erikh> I don't think this is related to rvm.
<erikh> I think this is, like headius said, related to a regexp bug in 1.6.7
<deryldoucette> you're still doing this under 1.6 java hen?
<deryldoucette> err then
<erikh> yes
<deryldoucette> ok
<erikh> I can try in 7 if you want.
<deryldoucette> gives us a starting point
<erikh> but I really need to do something else soon
<deryldoucette> if you could. if not cause you got other shit to do i understand
<deryldoucette> i so didn't expect it to go this deep
<erikh> eh
<erikh> we all learn something when it does
<deryldoucette> hehe true
<erikh> so. ctrl+\ fires off a signal (probably segv?) to a process.
<erikh> now, rvm runs as a part of the shell and fires off *child processes* which actually run javaa
<erikh> so when you issued ctrl+\, you issued it to rvm.
<deryldoucette> well headius got into it, and while we're not ENTIRELY sure that its not RVM, its SERIOUSLY looking like a regexp issue in JAVA 1.6
<erikh> *not* java.
<deryldoucette> damn
<erikh> it works similarly to how ^T works
<deryldoucette> wow, iTerm2 just took a serious turn south
<erikh> only ^T sends the INFO signal
<erikh> haha
<erikh> it does that.
<deryldoucette> i was on wayne's channel and somehow when I hit enter it came back here
<erikh> try hitting ^L
<deryldoucette> it just sits there
<erikh> anyhow, do you understand why that ctrl+\ wasn't working now?
savage- has joined #ruby-lang
<deryldoucette> no actually
<deryldoucette> oh wait
<erikh> ok, what don't you understand about it?
<deryldoucette> i just looked back over the backscroll real fast
<deryldoucette> yeah now i do
<deryldoucette> i missed the sending to rvm not java line
beawesomeinstead has joined #ruby-lang
mikeric has joined #ruby-lang
<erikh> anyhow, for the record you needed to do something like this
<deryldoucette> i'll make sure everyone knows that too when i talk to the two of them tomorrow
<deryldoucette> thanks for pointing that out. that didn't even come close to dawning on me
<erikh> they're aware of it
<deryldoucette> oh you spoke to them?
<erikh> that gist above is the actual java program run with 'exec', which makes it the parent process
necromancer has joined #ruby-lang
<erikh> no, I just know the rvm hackers know what a subshell is
<deryldoucette> well i do as well, i just missed your line ;p
<erikh> fair enough
<erikh> but that's why your ctrl+\ wasn't working.
<deryldoucette> got ya
<erikh> run it like above, and it works.
<deryldoucette> ok
<deryldoucette> again, thanks for the time and effort.
<deryldoucette> now, go do what ya gotta do :) me, i gotta rescue 3 beers from the freezer before they freeze
<erikh> I require coffee.
<deryldoucette> thats the morning for me. 2 pots and i'm good
gianlucadv has joined #ruby-lang
<deryldoucette> anyways, 0223am. polishing off these beers and then off to bed. later all
<deryldoucette> thanks &
pp01bit has joined #ruby-lang
mrb_bk has joined #ruby-lang
twittard has joined #ruby-lang
QoQOoO has joined #ruby-lang
fukushim_ has joined #ruby-lang
nebbie has joined #ruby-lang
Xzyx987X has joined #ruby-lang
Zespre_ has joined #ruby-lang
Utkarsh_ has joined #ruby-lang
twittard_ has joined #ruby-lang
weeb1e_ has joined #ruby-lang
neilc has joined #ruby-lang
kke_ has joined #ruby-lang
deadbea7 has joined #ruby-lang
skyjumper has joined #ruby-lang
ahf has joined #ruby-lang
hrnt has joined #ruby-lang
bnagy has joined #ruby-lang
tomb has joined #ruby-lang
noodl has joined #ruby-lang
crankharder has joined #ruby-lang
d3vic3 has joined #ruby-lang
WillMarshall has joined #ruby-lang
spuk has joined #ruby-lang
DEac- has joined #ruby-lang
corsican has joined #ruby-lang
fvollero has joined #ruby-lang
matti has joined #ruby-lang
indeterminate has joined #ruby-lang
zigidias has joined #ruby-lang
yxhuvud has joined #ruby-lang
Giddeon has joined #ruby-lang
dominikh has joined #ruby-lang
FACEFOX has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
lucas has joined #ruby-lang
Kuukunen has joined #ruby-lang
jxie has joined #ruby-lang
valeri_ufo has joined #ruby-lang
dhruvasagar has joined #ruby-lang
ioga_wrk has joined #ruby-lang
owen1 has joined #ruby-lang
dabradley has joined #ruby-lang
yorickpeterse has joined #ruby-lang
vbatts has joined #ruby-lang
machine1 has joined #ruby-lang
conceal_rs has joined #ruby-lang
EvilJStoker has joined #ruby-lang
krz has joined #ruby-lang
dkannan has joined #ruby-lang
abuiles has joined #ruby-lang
duckinator has joined #ruby-lang
FACEFOX has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has joined #ruby-lang
jimmyy111 has joined #ruby-lang
sora_h has joined #ruby-lang
alindeman has joined #ruby-lang
frangiz has joined #ruby-lang
jimmyy111 has joined #ruby-lang
sdeobald_ has joined #ruby-lang
nazty has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
nofxx has joined #ruby-lang
A124 has joined #ruby-lang
sdeobald__ has joined #ruby-lang
msch has joined #ruby-lang
mytrile has joined #ruby-lang
msch has joined #ruby-lang
nignaztic has joined #ruby-lang
nebbie`` has joined #ruby-lang
el-byped has joined #ruby-lang
FACEFOX has joined #ruby-lang
FiXato has joined #ruby-lang
Taranis has joined #ruby-lang
vbatts has joined #ruby-lang
FACEFOX has joined #ruby-lang
tonesfrommars has joined #ruby-lang
dc5ala has joined #ruby-lang
tonesfrommars has joined #ruby-lang
jxie_ has joined #ruby-lang
sdeobald_ has joined #ruby-lang
robbyoconnor has joined #ruby-lang
solars has joined #ruby-lang
machine1 has joined #ruby-lang
manojhans has joined #ruby-lang
FACEFOX has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
rushed has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
Fullmoon has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
sym- has joined #ruby-lang
alim has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
roadkith has joined #ruby-lang
dr0id has joined #ruby-lang
zmack has joined #ruby-lang
machine1 has joined #ruby-lang
QoQOoO has joined #ruby-lang
mephux has joined #ruby-lang
Karmaon has joined #ruby-lang
tekin has joined #ruby-lang
nazty has joined #ruby-lang
nofxx has joined #ruby-lang
uniqanomaly has joined #ruby-lang
gnufied has joined #ruby-lang
machine1 has joined #ruby-lang
woollyams has joined #ruby-lang
gokul has joined #ruby-lang
apeiros_ has joined #ruby-lang
stepnem has joined #ruby-lang
toretore has joined #ruby-lang
adambeynon has joined #ruby-lang
sandbags has joined #ruby-lang
FACEFOX has joined #ruby-lang
wyhaines has joined #ruby-lang
aza_kibou has joined #ruby-lang
workmad3 has joined #ruby-lang
futurechimp has joined #ruby-lang
spuk has joined #ruby-lang
hackeron has joined #ruby-lang
riginding has joined #ruby-lang
alim has joined #ruby-lang
Fullmoon has joined #ruby-lang
r0bby has joined #ruby-lang
tekin has joined #ruby-lang
futurechimp has joined #ruby-lang
byped has joined #ruby-lang
flatliner has joined #ruby-lang
dagobah has joined #ruby-lang
bougyman has joined #ruby-lang
gnufied has joined #ruby-lang
ahs3- has joined #ruby-lang
zmack_ has joined #ruby-lang
anekos_ has joined #ruby-lang
nazty has joined #ruby-lang
vbatts has joined #ruby-lang
EvilJStoker has joined #ruby-lang
tommyvyo has joined #ruby-lang
Y_Ichiro has joined #ruby-lang
MouseTheLuckyDog has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
jwollert has joined #ruby-lang
VladGh has joined #ruby-lang
alexkane has joined #ruby-lang
chris2 has joined #ruby-lang
yellow5 has joined #ruby-lang
adgar has joined #ruby-lang
whitequark has joined #ruby-lang
injekt has joined #ruby-lang
FACEFOX has joined #ruby-lang
ohsix has joined #ruby-lang
tommyvyo has joined #ruby-lang
francisfish has joined #ruby-lang
mitchty has joined #ruby-lang
FACEFOX has joined #ruby-lang
beiter has joined #ruby-lang
FACEFOX has joined #ruby-lang
lupine_85 has joined #ruby-lang
<andrewvos> and?
<andrewvos> And what??
namnoi38 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
judofyr has joined #ruby-lang
Guedes has joined #ruby-lang
lorenzo has joined #ruby-lang
<workmad3> heh :)
achiu has joined #ruby-lang
zmack_ has joined #ruby-lang
Joeysomo has joined #ruby-lang
Fullmoon has joined #ruby-lang
seoaqua has joined #ruby-lang
ankurgel has joined #ruby-lang
seanstickle has joined #ruby-lang
burgestrand has joined #ruby-lang
rolfb has joined #ruby-lang
jasiek has joined #ruby-lang
QoQOoO has joined #ruby-lang
d3vic3 has joined #ruby-lang
<shevy> will the girls like me if I write a lot of ruby code?
<shevy> or should I switch to python
<workmad3> shevy: girls love a guy who can write SPL: http://shakespearelang.sourceforge.net/report/shakespeare/
<shevy> well
<shevy> I would not mind a programming language that would be like prosa or poetry
<shevy> or even better
<shevy> to write ONLY documentation and have things run from that
<shevy> but I guess there would be so many rules to follow that it would be no fun :(
<workmad3> I came across a system that would let you do that sort of thing once
<workmad3> it basically swapped around the 'normal' process of write code with doc comments that get extracted to write docs with code comments that get extracted
<burgestrand> Sounds similar to literate-styled programming.
<burgestrand> It’d be like writing a markdown document, only all code blocks is what the code actually consist of.
virunga has joined #ruby-lang
<shevy> hmm
<shevy> I like markdown so far
<workmad3> burgestrand: that's the one, literate programming
<burgestrand> Haskell has a mode for it, called literate haskell: http://www.haskell.org/haskellwiki/Literate_programming
yalue has joined #ruby-lang
<burgestrand> I never was a big fan of it, I find it’s easy to become too verbose. :p
<shevy> my brain is still dead
<shevy> instance variable are always visible right? I mean instance_variable_get will always work when that ivar exists
Joeysomo has joined #ruby-lang
<workmad3> shevy: unless someone has pissed around with instance_variable_get
<shevy> yeah
Joeysomo has joined #ruby-lang
rohit has joined #ruby-lang
toertore has joined #ruby-lang
mark_locklear has joined #ruby-lang
Bwild has joined #ruby-lang
ramonmaruko has joined #ruby-lang
m3nd3s has joined #ruby-lang
Arsen7 has joined #ruby-lang
Skoot7 has joined #ruby-lang
stephenp has joined #ruby-lang
verto has joined #ruby-lang
seanstickle has joined #ruby-lang
m3nd3s has joined #ruby-lang
ankurgel has joined #ruby-lang
solars has joined #ruby-lang
gianlucadv has joined #ruby-lang
deryldoucette has joined #ruby-lang
m3nd3s has joined #ruby-lang
slyphon has joined #ruby-lang
ankurgel has joined #ruby-lang
enebo has joined #ruby-lang
canton7 has joined #ruby-lang
Mchl has joined #ruby-lang
coreydaley has joined #ruby-lang
JEG2 has joined #ruby-lang
nacengineer has joined #ruby-lang
pw_ has joined #ruby-lang
beiter has joined #ruby-lang
malev has joined #ruby-lang
<beiter> Hi there, here is my problem: https://gist.github.com/2028772 . It's about text extraction between to texts
bglusman has joined #ruby-lang
francisfish has joined #ruby-lang
<lianj> do you pay in bitcoins?
Faris has joined #ruby-lang
<andrewvos> beiter: nokogiri
justinxreese has joined #ruby-lang
Sailias has joined #ruby-lang
sbabiy has joined #ruby-lang
sbabiy has joined #ruby-lang
<beiter> It's a parser like hpricot ?
<andrewvos> beiter: nokogiri
<lianj> andrewvos: and how would you easily get the contents in this case then?
wallerdev has joined #ruby-lang
<andrewvos> lianj: Well, it seems like the problem is actually that he/she is using regex on html.
malev has joined #ruby-lang
<andrewvos> lianj: Hence the array of evil
<beiter> actually i parse an html file with hpricot
<lianj> for something small and dirty, regex can work fine. but yea, im a huge fan of nokogiri for anything xml too
slyphon has joined #ruby-lang
sbabiy_ has joined #ruby-lang
slyphon_ has joined #ruby-lang
<beiter> just another question, what is a good data structure to represent a homepage navigation
Austin__ has joined #ruby-lang
tomzx has joined #ruby-lang
QoQOoO has joined #ruby-lang
<canton7> beiter, personally I've found an ordered flat list, with each element assigned an indent, works very well
Indian has joined #ruby-lang
krz has joined #ruby-lang
ankurgel has joined #ruby-lang
mssola has joined #ruby-lang
igaiga has joined #ruby-lang
Arsen7 has joined #ruby-lang
aroop has joined #ruby-lang
jxie has joined #ruby-lang
mistym has joined #ruby-lang
workmad3 has joined #ruby-lang
Hensley has joined #ruby-lang
dous has joined #ruby-lang
joast has joined #ruby-lang
wmoxam has joined #ruby-lang
Nowaker has joined #ruby-lang
Tukeke has joined #ruby-lang
<ankurgel> Sorting words in a string by increasing order of their(word's) length. Made http://ideone.com/mIQJ3 . Please to suggest some improvements I can make there.
<apeiros_> ankurgel: Hash.new --> {}
<apeiros_> other than that - string.split.uniq.sort_by { |word| word.length }
<apeiros_> you may also not be happy with using just split(), as e.g. punctuation will then be part of a word
<apeiros_> like: "he said: 'hello!'" --> ["he", "said:", "'hello!'"]
<ankurgel> I can use gsub!(/\W/,'') for that.
<ankurgel> but that is the iteration part bothering me there.
<apeiros_> ankurgel: that'd remove the spaces too ;-)
<ankurgel> apeiros_: trying that. :)
<ankurgel> oh yes. Then gsub!(/[^a-z ]/,'')
<tobiasvl> but there are no spaces at the end, hopefully? :)
<ankurgel> before that I can do downcase.
<apeiros_> string.scan(/\b\p{Word}+\b/).uniq.sort_by { |word| word.length }
<apeiros_> you may also want to use downcase before scanning, or even Unicode.downcase.
<apeiros_> you can also use a different quantifier than +, if you want to enforce minimal word length
<ankurgel> apeiros_: Oh! I didn't need hash there!
<ankurgel> Thanks, apeiros_ ! Trying that out in my irb. :)
<apeiros_> so my final solution would be: require 'unicode'; Unicode.downcase(string).scan(/\b\p{Word}+\b/).uniq.sort_by { |word| word.length }
<apeiros_> (requires the unicode gem)
<ankurgel> also, quick question. Which method I can use to generate random number from a given array?
<apeiros_> see Array#sample
<ankurgel> ok
ezkl has joined #ruby-lang
<ankurgel> worked!
dv310p3r has joined #ruby-lang
pw_ has joined #ruby-lang
Joeysomo has joined #ruby-lang
S2kx has joined #ruby-lang
Joeysomo has joined #ruby-lang
slyphon has joined #ruby-lang
rippa has joined #ruby-lang
cdnz has joined #ruby-lang
<workmad3> apeiros_: or, on 1.9, .sort_by(&:length) (which I think makes it more readable :) )
stef_204 has joined #ruby-lang
Skif has joined #ruby-lang
rolfb has joined #ruby-lang
ezkl has joined #ruby-lang
Tukeke has quit ["
ascarter has joined #ruby-lang
scampbell has joined #ruby-lang
achiu has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dejongge has joined #ruby-lang
riffraff has joined #ruby-lang
divins_ has joined #ruby-lang
headius has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
matti has joined #ruby-lang
heppy has joined #ruby-lang
wyhaines has joined #ruby-lang
shtirlic has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
gnufied1 has joined #ruby-lang
wyhaines has joined #ruby-lang
m3nd3s has joined #ruby-lang
bryancp has joined #ruby-lang
sbabiy has joined #ruby-lang
zmack has joined #ruby-lang
butchanton has joined #ruby-lang
lsegal has joined #ruby-lang
Teddy2steper has joined #ruby-lang
rdavila has joined #ruby-lang
H2H has joined #ruby-lang
srbaker has joined #ruby-lang
achiu has joined #ruby-lang
adambeynon has joined #ruby-lang
RickHull has joined #ruby-lang
RickHull has joined #ruby-lang
dfr|mac has joined #ruby-lang
heppy has joined #ruby-lang
Fullmoon has joined #ruby-lang
burns180 has joined #ruby-lang
io_syl has joined #ruby-lang
heppy_ has joined #ruby-lang
flak has joined #ruby-lang
Tearan has joined #ruby-lang
spinagon has joined #ruby-lang
bryancp has joined #ruby-lang
gnufied has joined #ruby-lang
gnufied has joined #ruby-lang
Nisstyre has joined #ruby-lang
dfr|mac_ has joined #ruby-lang
phlipper has joined #ruby-lang
<shevy> cool
<shevy> never saw Unicode before
<matti> LOL
pbjorklund has joined #ruby-lang
empity has joined #ruby-lang
<RickHull> sometimes, when i'm deep in the zone, I start to *see* the unicode
<andrewvos> RickHull: I don't even see the unicode. All I see is blonde, brunette, red-head.
<RickHull> I can't describe it, like catching a fleeting glimpse of the ghost in the machine
<RickHull> imagine the best parts of Hackers and Tron mixed with the Unix interface from Jurassic Park
<RickHull> andrewvos: oh yeah, and The Matrix ;)
bougyman has joined #ruby-lang
heppy has joined #ruby-lang
mrsolo has joined #ruby-lang
brianpWins has joined #ruby-lang
darkf has joined #ruby-lang
achiu has joined #ruby-lang
dejongge has joined #ruby-lang
burgestrand has joined #ruby-lang
r0bby has joined #ruby-lang
JEG2 has joined #ruby-lang
Pip has joined #ruby-lang
Pip has joined #ruby-lang
<Defusal> wow ok
<Defusal> im not quite sure of what to make of this one...
<Defusal> active_support/dependencies.rb:479:in `load_missing_constant': SourceServer is not missing constant Rcon! (ArgumentError)
<Defusal> how can it try load a missing constant if its not missing? i didn't even know ActiveSupport tries to load missing constants
rorymckinley has joined #ruby-lang
SuperTa__ has joined #ruby-lang
Nss has joined #ruby-lang
<lsegal> Defusal #rubyonrails
<Defusal> lsegal, i'm not using rails
<lsegal> but AS is maintained by that project
<Defusal> but its fine
<Defusal> i assume it is because the constant was removed from the module, but there was still a reference to it
<Defusal> that depending module should have been reloaded my my modular core, so its my fault
<Defusal> it's just a strange exception which i've never seen before
publicvoid__ has joined #ruby-lang
<lsegal> my point was, #rubyonrails could better explain why/when that exception gets raised, and what exactly "is not missing" means in that context
<lsegal> cause yea, it sounds weird
<Defusal> yup
<Defusal> lsegal: thing is, in my experience #ror is usually full of clueless users spamming questions, with few answers, let alone people who know the internals of the framework. and so i stand a better chance getting an answer in here from people who actually know about ruby than even having my question read in there
pvh has joined #ruby-lang
<wmoxam> lol
<apeiros_> how very surprising
<wmoxam> Defusal: often true, but not always
<Defusal> wmoxam, of course not always true, but out of the times i've joined there over the past few years, i think that has been the case about 98% of the time
<wmoxam> I mean, how dare those noobs ask their trivial questions?
<wmoxam> shame on them
<wmoxam> and their kind
<Defusal> keep in mind, i would not ask a trivial question to begin with
<apeiros_> wmoxam: I think it's rather a shame that those noob questions rarely get answered well…
<Defusal> indeed
<wmoxam> apeiros_: noobs try to help other noobs
<wmoxam> which is nice of them
<Defusal> yeah
<apeiros_> that's not the part I find shameful about :)
<wmoxam> but the problem is the volume of questions
<Defusal> which is better than nothing i guess
<Defusal> exactly wmoxam, combined with the percentage of them which could be answered in 30 seconds with google
<wmoxam> the quality of the questions asked is generally low, and it's like pulling teeth to get the information needed to answer the question
<Defusal> that too :(
rdavila has joined #ruby-lang
<Defusal> i don't suppose anyone here has experience with a recent version of HighCharts and dynamically adding data?
<Defusal> i know its a long shot, but i probably stand a better chance of finding someone here than any other channel :P
twittard has joined #ruby-lang
virunga has joined #ruby-lang
krzyhoo has joined #ruby-lang
<krzyhoo> is it possible to do something like this?
<krzyhoo> @keytype = values.shift.nil? ? "NONE" : values.shift
<krzyhoo> where obviously the second values shift should not shift
<krzyhoo> i bet there is a sexy way to pull this one off
<Defusal> lol
<Defusal> @keytype = values.shift || 'NONE'
marcostoledo has joined #ruby-lang
<spinagon> that would fail on false
<spinagon> though
<RickHull> depends if false is a legitimate value
<Defusal> yeah, i assumed it is not since you're using a string 'NONE'
<krzyhoo> it is not :)
<Defusal> if it can be false, then that seems a little dodgy
<krzyhoo> thanks mate
<krzyhoo> w2orks like a charm
<Defusal> np
<erikh> yeah, they could come in here and spam eventmachine questions instead :P
vpamulap has joined #ruby-lang
<Defusal> erikh, i have eventmachine questions :P
<Defusal> well not really, no one else can help with my issue, i just have to find time to do a lot of testing and pinpoint the issue :/
<Defusal> either way, this channel also stands a better chance of responding to EM questions than #eventmachine erikh
<yxhuvud> defusal: it may help to always refer to a moule the same way. ie always do the full module::class instea of referring to the class by only name inside the module in question
Nisstyre has joined #ruby-lang
headius has joined #ruby-lang
<Defusal> yxhuvud, dont worry about that, i'm guessing i broke some part of my modular cores automatic dependency handling when i made some changes in the last day
nofxx has joined #ruby-lang
mrsolo has joined #ruby-lang
gray has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
dejongge has joined #ruby-lang
verto has joined #ruby-lang
tommyvyo has joined #ruby-lang
tekin has joined #ruby-lang
benanne has joined #ruby-lang
TuxmAL has joined #ruby-lang
<krzyhoo> wtf is eventmachine?? :)
<bougyman> it's an async library for io
<Defusal> goodness, i guess i shouldn't be quite so surprised people don't know about EM
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
thrcka has joined #ruby-lang
zmack has joined #ruby-lang
postmodern has joined #ruby-lang
TuxmAL has quit [#ruby-lang]
tekin has joined #ruby-lang
empity has joined #ruby-lang
havenn has joined #ruby-lang
gray has joined #ruby-lang
futurechimp has joined #ruby-lang
<krzyhoo> guys a whole different question now
<krzyhoo> i could use a clue on best practice here
<krzyhoo> i have a class, lets call ot Attribute which describes atributes from a database
<krzyhoo> dbatabase_type, attribute_type, attr_length etc.
<krzyhoo> now there is a different software, called Informatica Powercenter
<krzyhoo> which uses generic names for attribute types
<krzyhoo> so db2's varchar, oracle's varchar2 mysql's text etc all become "string"
<krzyhoo> i have a yaml file which is a mapping> dbtypes to informatica types
alerticus has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
<krzyhoo> should i create a class instance
<krzyhoo> where i have both types: database and infa?
<krzyhoo> or should i refrain from doing so?
<krzyhoo> info: source for creating an instance is a simple csv file
<RickHull> i can't make a coherent problem / question out of this info
<krzyhoo> well RickHull: it all comes down to this
<krzyhoo> this yaml file has to be turned into a hash whcih i use to map the types
<krzyhoo> should i create this hash in mz class as class variable
<krzyhoo> or should i refrain from doing so?
<RickHull> I've got this painting of a woman, and it has a frame, and you have to walk through a glass pyramid to view it. Should I make her smile?
<Defusal> i couldn't agree more
curtism has joined #ruby-lang
<krzyhoo> this was a best practice question though
<krzyhoo> appreciate your help guys :)
<RickHull> heh, no offense. i just can't understand the basic situation
<RickHull> your actual question is clear enough
<Defusal> yeah, same here :/
<Defusal> argh, im not having a good night
<krzyhoo> well... since it is clear what's the problem guys??
<krzyhoo> :/
<Defusal> instead of solving issues, i just keep finding more
<Defusal> krzyhoo, try condensing everything you said into a single concise sentence
<krzyhoo> ok
<krzyhoo> how about that
gix has joined #ruby-lang
<krzyhoo> how do i create a class variable the moment the first instance of this class is created and never again?
darkf has joined #ruby-lang
<Asher> a class instance variable you mean?
<Asher> just set it in the body of your class
<krzyhoo> clas variable
<krzyhoo> \@@
<Asher> class SomeClass ; @class_instance_var = :value ; end
<Asher> avoid class variables
<krzyhoo> @@
<Asher> they only exist to hurt your soul
<apeiros_> and to sneak up behind you
<shevy> and cut off your d...
ayoub has joined #ruby-lang
<krzyhoo> Asher: and apeiros_ ans shevy: ok, than how should i solve another issue of mine
<krzyhoo> without them bitchas
<krzyhoo> example
<krzyhoo> have 20 rows in my csv file desribing to tables
<krzyhoo> 10 rows table a and ten rows table b
<rue> krzyhoo: Classes are objects, too. Objects can have instance variables.
<krzyhoo> i need to calculate an offset of the attribute length
<krzyhoo> which resets once the table name changes
<krzyhoo> how else if not with a class variable
<Defusal> krzyhoo, an instance variable on the class level
<krzyhoo> Defusal: wtf is that :)
<krzyhoo> honest to got
<krzyhoo> have no idea
pzol has joined #ruby-lang
<Defusal> class Foo; @bar = true; def self.class_method; @bar end end
<krzyhoo> all i know are @ and @@'s
<krzyhoo> aaaaaaaa
<Defusal> you just use an instance variable, @ on the class level
<krzyhoo> so that's how you call it :)
<Defusal> i guess its not possible to remove rack middleware
<apeiros_> just apply enough force
<krzyhoo> but how it differs (technicall) from a class variable?
<apeiros_> it doesn't suck
<apeiros_> I know, not a very technical description of the difference
<krzyhoo> we have an academic amog us
<Defusal> i realized, after not thinking my actions through, that using "use Rack::Session::Cookie" a second time in a subclassed application actually adds another rack session to it, which breaks the session completely
<krzyhoo> since i am just a beginner
<Defusal> krz
<Asher> when you set a class variable there is 1 variable for that class and every subclass
<Asher> so @@class_var in SomeClass is _the same variable_ in SomeSubClass < SomeClass
<krzyhoo> ok
<krzyhoo> so this is simply a best practice
<krzyhoo> and I SHOULD DO IT LIKE THIS
<krzyhoo> but...
<krzyhoo> structlyy technically speaking
<Asher> class var is very rarely what you want
<Asher> if ever
<Asher> i've never seen a good use for it
<Asher> i'll acknowledge the possibility it exists and i just haven't encountered it yet
<Asher> but i'm not expecting to come across it either
rolfb has joined #ruby-lang
<krzyhoo> it doesn't differ in it's role from a class var
<krzyhoo> ok
<erikh> class vars are usually used in instances
Hakon|mbp has joined #ruby-lang
<Asher> in ruby "a class var" = @@some_var
<erikh> class instance vars usually stay on the class.
<Asher> a "class instance var" is a normal instance var (@var) used in an instance of a class
<erikh> I guess "stay on the class" is confusing but this topic frequently is for people new to ruby
<tonesfrommars> Right, usage is the same, just happens that the instance is a class.
<apeiros_> krzyhoo: not an academic, only a pedant
<erikh> I farted, guys
<krzyhoo> i fucking need to digest that
<erikh> (and gals)
<tonesfrommars> erikh: congratulations
* apeiros_ hands erikh a medal
<erikh> yay
<apeiros_> is farting a side effect of procrastination?
<erikh> yes.
<apeiros_> oh
<apeiros_> that explains a lot
<tonesfrommars> i think IRC is a side effect of procrastination. :-)
<apeiros_> no
<apeiros_> IRC is the main cause for
<apeiros_> if you remove facebook and irc, procrastination magically disappears
<apeiros_> in other news, there have been sightings of unicorns dancing on rainbows
<rolfb> apeiros_: are you sure?
<apeiros_> of course
<apeiros_> but about what?
<rolfb> i have aim, skype and msn to keep me occupied too
ankurgel has joined #ruby-lang
<rolfb> "if you remove facebook and irc, procrastination magically disappears"
<rolfb> :)
<erikh> oh screw that, I'd totally find something else to do
<Asher> irc helps me keep focused by having a peripheral distraction
<Asher> that way i don't go elsewhere to get distracted
<erikh> I'm just in context switching hell today
<apeiros_> rolfb: I'm just as sure about that as those other news about the unicorns…
<krzyhoo> Defusal: in your example, how do i modify the @bar
<krzyhoo> or get it's value?
<Asher> erikh - you end up checking out cascading-configuration?
<apeiros_> erikh: time to switch context with beer?
<erikh> Asher: not yet. it's still tabbed though
<erikh> apeiros_: it's not even 1pm here yet, heh
<Asher> cool
<apeiros_> erikh: that's a poor excuse
<erikh> Asher: I didn't get much done last weekend, I blame mass effect 3
<Asher> make sure you use the most recent one whenever you do
<rolfb> apeiros_: ah
<krzyhoo> neverminf
<krzyhoo> :)
<krzyhoo> stupid me
* apeiros_ converted #ruby-lang to #totally-OT
<erikh> hehe
<krzyhoo> stupid me
apeiros_ was kicked from #ruby-lang by apeiros_ [stop that OT talk, duh!]
apeiros_ has joined #ruby-lang
darkf has joined #ruby-lang
<apeiros_> yeah, sorry apeiros_, I'll not to it again, I promise…
ankurgel has quit [#ruby-lang]
<krzyhoo> anyone care to explain? why do languages have features no one should use??
<krzyhoo> please...abyone...?
<krzyhoo> anyone
<Asher> course of development
<Asher> stuff gets added and it remains b/c it's always been there
<erikh> they're not useless
<krzyhoo> kinda like guys and tits?
<erikh> they're just not very useful
<erikh> yes, exactly.
<rue> Class variables are shared among the entire inheritance hierarchy, subclasses don't get their own copies.
<rue> Oh, backscroll…
<Asher> class variables seem to me like a function created for people who are wary about actually committing to principles of encapsulation
<krzyhoo> ok
<krzyhoo> thanks guys
<krzyhoo> gotat scram
<krzyhoo> but the chatw was an eye opener :)
<krzyhoo> so ruby is like perl :)
<Asher> like perl?
<Asher> what got you to that conclusion?
bryancp has joined #ruby-lang
coreydaley has joined #ruby-lang
<krzyhoo> fucking my and no our
<krzyhoo> :)
pzol has quit ["Sayonara!"]
<gray> hi, folks! http://pastie.org/3588201
<gray> answer pls
asdaf has joined #ruby-lang
asdaf has quit [#ruby-lang]
ascarter has joined #ruby-lang
<apeiros_> gray: the proc is returned by the method. when you use .call on that returned proc, the argument you pass to .call is passed to that proc.
<epitron> Asher: well, rubies and pearls are both pretty
<epitron> perls aren't, unfortuantely
<Asher> hehe
dfr|mac has joined #ruby-lang
ascarter has joined #ruby-lang
<gray> apeiros_: understand, thanks.
justinmcp has joined #ruby-lang
Jake232 has joined #ruby-lang
marcostoledo has joined #ruby-lang
virunga_ has joined #ruby-lang
<gray> guys, how you use ruby? what you develop (if not secret)
<gray> you are web developers? and use ruby on rails? or you write server apps?
solars has joined #ruby-lang
<gray> in what cases ruby popular?
<RickHull> I write clients and servers for black box testing
<RickHull> writing automated scripts against the client library
<gray> And what tasks ruby was created for? I am new in Ruby. And i know now very popular Ruby on Rails
<RickHull> ruby was created for developer happiness
<RickHull> whatever you choose to develop
<gray> RickHull: :)
<mistym> It works too!
<gray> RickHull: yes, i feel it)
<Jake232> Am I really missing something, or is there no easy way to generate a string of length N, which contains upper + lowercase letters and number
<Jake232> easily
<Jake232> All the online solutions seem bizare
l0st1 has joined #ruby-lang
<RickHull> (1..N).to_a.map { |i| pool.rand }.join
<RickHull> define your pool, e.g. ascii alphas and numerics
robbyoconnor has joined #ruby-lang
cored has joined #ruby-lang
cored has joined #ruby-lang
<Jake232> I can't help but feel there should be a simple 1 liner for this though
<RickHull> scratch that itch
<RickHull> make it happen
robbyoconnor has joined #ruby-lang
<Jake232> This works, but I'm not sure its the best wa
<Jake232> (1..16).collect { (i = Kernel.rand(62); i += ((i < 10) ? 48 : ((i < 36) ? 55 : 61 ))).chr }.join
looopy has joined #ruby-lang
<Jake232> 16 being N
<RickHull> it's not the best way. too many magic numbers
malev_ has joined #ruby-lang
<RickHull> also you are doing all these calculations on each map iteration
<Jake232> Thats what I figured
<RickHull> it's probably better to define the pool first, then select from it randomly. that's what I posted
<Jake232> Maybe I'm overthinking it, and two lines really doesnt hurt
<Jake232> but I just know theres likely an efficient one liner
<Jake232> I guess I'll let it slide ;)
<cored> hello
<rue> Jake232: Use a Range in rand
<mistym> pool = ('a'..'z').to_a+('A'..'Z').to_a+('0'..'9').to_a; n.times.collect { pool.sample }.join
<RickHull> mistym: i like :)
<RickHull> rue: is it one contiguous range?
<shevy> what is pool there?
<shevy> ph
<shevy> I mean
<shevy> oh
<RickHull> i keep mine at 6.7
Swimming_Bird has joined #ruby-lang
<rue> RickHull: No, just in general
<RickHull> faster than sampling i imagine
<rue> Wait, now I confused myself. Meh.
<Jake232> Maybe I just take for granted how simple ruby makes things, but this just seems an awful way
robbyoconnor has joined #ruby-lang
<Jake232> for a simple thing
<RickHull> Jake232: the code maps pretty closely to the concept
mrsolo has joined #ruby-lang
<RickHull> i.e. it's as simple as the concept you are describing
<Jake232> it does, but I'm suprised there isnt a built in Random method
<Jake232> that takes an array of choices
<Jake232> is what I guess I'm saying
<RickHull> you mean, sampling an array?
<mistym> That's what pool.sample in my example was doing.
<Jake232> I mean like
<Jake232> Random.multiple(Array,10), 10 being the amount of items to return. It seems like it would be a useful function.
robbyoconnor has joined #ruby-lang
<RickHull> you can define that function in you own module
<RickHull> and go to town with it :)
<Jake232> I can, but for the amount of times I'm going to use it, it really isn't worth it
<TTilus> `pwgen -N 1`
<RickHull> ah, there's a the rub, no?
<RickHull> here you are with a very specific concern, but you would not add to your own library to make it "easier"
<RickHull> neither did Ruby
<Jake232> Thats because of the hassle / effort I'd have of including it
<Jake232> in every project though
<RickHull> ruby makes it very simple to compose using its primary abstractions :)
slyphon has joined #ruby-lang
<RickHull> it's ultimately a judgment call, as to how many "helper" methods the core or stdlib should have. i don't mind the judgment, here
robbyoconnor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
RickHull has quit [#ruby-lang]
slyphon has joined #ruby-lang
MDmalLION has joined #ruby-lang
robbyoconnor has joined #ruby-lang
nofxx has joined #ruby-lang
<TTilus> Jake232: if not pwgen, then maybe something like https://github.com/docunext/ruby-password or maybe just SecureRandom.hex(8)
ascarter has joined #ruby-lang
<rue> There's Facets
<dominikh> yuck
ascarter has joined #ruby-lang
<shevy> as long as facets remains a community driven project, so long will it be largely irrelevant as barely anyone will adopt it
<dominikh> good thing that, seeing how facets is a bloated collection of horrible extensions
<drbrain> shevy: facets seems driven by a community of one
<shevy> hehe
<yxhuvud> well are there not parts of facets that has been incorporated in other stuff?
virunga has joined #ruby-lang
<shevy> dunno, probably people handpick what is useful for them in their own projects and ignore the rest
<yxhuvud> I may remember wrongly, but wasn't Symbol#to_proc from there originally?
<shevy> absolutely no idea
r0bby has joined #ruby-lang
<drbrain> yxhuvud: probably not
petercooper has joined #ruby-lang
ylluminate has joined #ruby-lang
sre-su has joined #ruby-lang
r0bby has joined #ruby-lang
srbartlett has joined #ruby-lang
<yxhuvud> drbrain: oldest reference I can find is from pragdave who blaim extensions.rubyforge. Dunno if that is the same as facets.
<drbrain> yxhuvud: facets was calibre
sre-su has quit [#ruby-lang]
r0bby_ has joined #ruby-lang
verto has joined #ruby-lang
r0bby_ has joined #ruby-lang
MDmalLION has joined #ruby-lang
MDmalLION has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
MDmalLION has joined #ruby-lang
r0bby_ has joined #ruby-lang
[dmp] has joined #ruby-lang
[dmp] has joined #ruby-lang
Indian has joined #ruby-lang
<shevy> anyone happens to know whether it is possible to get a list of USB devices attached in a windows machine via ruby? i.e. my script needs to find out whether someone is connected on D: E: F: and so on
<shevy> whether *something
<shevy> not someone
<drbrain> shevy: imperator probably has a package for that
<shevy> okay
<drbrain> if not, you can use WIN32API (or whatever it is called these days) after poking around on MSDN for a bit
<petercooper> Not that it helps but my hunch on that question, at least, is "yes"
r0bby_ has joined #ruby-lang
r0bby_ has joined #ruby-lang
<petercooper> At least, if it's available in a system library, etc, since even in the worst case scenario you could FFI to it.
H2H has joined #ruby-lang
MDmalLION has joined #ruby-lang
<petercooper> shevy: Re-reading that question.. it sounds like you want to specifically find USB mass storage devices and get their equivalent drive letter?
<shevy> petercooper yeah!
<petercooper> Was only asking because I suspect it might be possible to approach from the other direction too
<shevy> my scripts work on linux with "fdisk -l" and automatically find out where something is mounted, now I am trying to make them work on windows too
<petercooper> that is, rather than querying the USB system.. something in a file API to identify the source for a certain drive letter
<shevy> hmm
<petercooper> I've found some code to do it, but might take a bit of pondering to think how to call it from Ruby..
<petercooper> From IronRuby it'd be easy, but no idea how to interface with a .NET API from standard Ruby
<petercooper> We just need a Windows API god to swoop in and sprinkle fairy dust around the place.
shtirli__ has joined #ruby-lang
Boohbah has joined #ruby-lang
verto_ has joined #ruby-lang
ezkl has joined #ruby-lang
ezkl has joined #ruby-lang
woollyams has joined #ruby-lang
dhoss has joined #ruby-lang
r0bby_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
FACEFOX has joined #ruby-lang
<rue> petercooper: You might try imperator
<petercooper> It's shevy with the issue but seems like a good idea.
<rue> Oh, late again
<shevy> yeah I will catch him when he gets online
<petercooper> I'm not quick enough for Stack Overflow which is why I lurk here instead ;-)
<petercooper> If you want a really answer, put it on Stack Overflow. In 30 seconds, blam. You'll have an answer. Not necessarily one that works, mind you..
robbyoconnor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
t has joined #ruby-lang
woollyams has joined #ruby-lang
robbyoconnor has joined #ruby-lang
dfr|mac has joined #ruby-lang
Jake232 has joined #ruby-lang
gregf has joined #ruby-lang
robbyoconnor has joined #ruby-lang
bglusman has joined #ruby-lang
Carnage\ has joined #ruby-lang
<Asher> is there a good way to get a lambda from a block?
<Asher> rather than a proc
davpoind has joined #ruby-lang
justinxreese has joined #ruby-lang
<Boohbah> is_positive = lambda {|x| x > 0 }
<Boohbah> succ = ->(x){ x+1 }
<Asher> was that to me?
<apeiros_> Asher: lambda(&block) ?
<Asher> nope that doesn't seem to work
<apeiros_> hrm, no, doesn't seem to
<apeiros_> given that the two differ, that's a shame, really…
<drbrain> def extract_block(&block) block; end; extract_block { some_block }
<drbrain> … having & in your method argument converts a block to a proc/lambda
<apeiros_> drbrain: no, proc & lambda differ
<drbrain> blocks aren't exactly proc/lambda though
<Asher> i want a lambda specifically so that i can use return
<apeiros_> ruby converts to proc with &
<petercooper> do you very specifically want to use return? or could you just use 'next'?
<Asher> i would like to use return
<Asher> i mean a proc will do the same implicitly
<Asher> but it would be nice to be able to use return b/c i find it far more legible
<Asher> particularly given the context
<petercooper> oh my
<petercooper> someone asked this on SO once: o
<petercooper> check out that solution, hehe
<Asher> there is internal C api to convert them (it's just a boolean value in the struct) but it's not exposed
<Asher> as far as i know
<Asher> wow that's retarded
<Asher> as a solution
<petercooper> I'm guessing you're doing something like.. foo { return bar } someplace, and you want foo to call that block as if it were a lambda
<Asher> yea
<Asher> i guess the answer is i have to define it as a method somewhere
<Asher> if i want to use return
<Asher> if it's already a proc
<petercooper> converting to a method and back again is def funny :)
rue_XIV has joined #ruby-lang
WillMars_ has joined #ruby-lang
<Asher> what's worst about that solution
<Asher> is that it actually works
tr-808_ has joined #ruby-lang
tr-808 has joined #ruby-lang
naz has joined #ruby-lang
igaiga has joined #ruby-lang
<WillMars_> Does Ruby 1.8.7 contain anything like Hash.select in 1.9.3?
<petercooper> it also has Hash#select
agib has joined #ruby-lang
<petercooper> the only difference being it gives you an array of arrays instead of a new hash
<petercooper> but you can use Hash[] to fix that.
L0rdShrek has joined #ruby-lang
<Asher> it doesn't give you keys tho does it?
<petercooper> horribly contrived example: Hash[{ :a => 10, :b => 20 }.select { |k, v| k == :a }] # => { :a => 10 }
mccraig has joined #ruby-lang
<petercooper> (of course, your predicate would be much more useful in real life ;-))
<apeiros_> or you can use reject with a !
srbartlett has joined #ruby-lang
<Asher> boohbah - in 1.8.7 i mean
<petercooper> it's like a stream of non-sequiturs :)
vpamulap has joined #ruby-lang
<petercooper> asher: It does, but in nested array style.
<Asher> ah ok
beawesomeinstead has joined #ruby-lang
<petercooper> { 'abc' => 3, 'ab' => 2, 'cd' => 2 }.select { |k, v| k.length == 2 } # => [["cd", 2], ["ab", 2]]
akahn has joined #ruby-lang
<petercooper> (on 1.8.7)
cesario has joined #ruby-lang
<petercooper> hehe
wyhaines_ has joined #ruby-lang
justinmcp has joined #ruby-lang
cldwalker has joined #ruby-lang
pvh has joined #ruby-lang
nofxx has joined #ruby-lang
marcostoledo has joined #ruby-lang
<Asher> it's so annoying that method_missing can't cause an exception to be raised at the point method_missing was called
<apeiros_> o0
* petercooper thinks..
<apeiros_> it's just the backtrace that differs, no?
<apeiros_> so all you'd have to do is fiddle with the backtrace
<apeiros_> I'd hate you for it, though
<Asher> hmmm so you're saying create the exception myself then edit the backtrace array?
<apeiros_> (fiddling with backtraces is EVIL, don't do it)
<Asher> why would you hate me for it
<Asher> i just want the backtrace to show where the method was called that is missing
<apeiros_> because you will fuck it up
<drbrain> Asher: I would hate you for it
<petercooper> it's no more hateful than breaking return semantics.. but no less either ;-P
<apeiros_> and you'll make debugging more difficult
<workmad3> Asher: the backtrace for a normal method_missing call looks correct to me
<Asher> but the method was missing… it shouldn't throw the error in method missing
<drbrain> if you need to change return semantics… use return!
<drbrain> from the return_bang gem!
<workmad3> Asher: it's only if there's an overridden method_missing that method_missing appears on the backtrace
dkannan has joined #ruby-lang
<Asher> right
<Asher> i have a method missing method
<Asher> but it doesn't always handle missing methods
<Asher> so if methods are actually missing
<Asher> then i want it to act like there was no method missing error in the middle
slyphon has joined #ruby-lang
<workmad3> Asher: I'd regard this as correct behaviour... there *are* methods there, they could be part of the problem
abuiles has joined #ruby-lang
<Asher> but you call super in method missing to get the exception - it raises the exception b/c there is no method to handle it in the super method
<Asher> *shrug*
<Asher> it definitely wastes my time debugging
<petercooper> heh, thought I'd see if defining and using respond_to_missing? properly would help, but alas no.
<workmad3> Asher: and if I had a method I was sure method_missing was meant to handle but it wasn't, and I didn't see my method_missing on the backtrace, I'd go potty wondering why my method_missing wasn't being called
<workmad3> Asher: but hey, you could clean up the backtrace if you wanted ;)
Joeysomo has joined #ruby-lang
<Asher> it just seems like i should be able to do so
<Asher> if my code works properly then end users shouldn't be seeing it from their errors
<workmad3> Asher: and you can do so
<workmad3> Asher: but it's a big assumption that your code is working properly ;)
<workmad3> Asher: and therefore a big assumption that your code has no place in the backtrace for an error
denysonique__ has joined #ruby-lang
looopy has joined #ruby-lang
<Asher> ok so exception does actually have set_backtrace for this
<dominikh> reminds me of my library that hid itself from the backtrace because it "couldn't possibly be wrong"..
<workmad3> Asher: yup... which is why we were saying you can do it... but it's not generally regarded as good style
<dominikh> it was fun trying to debug a bug in my library some months later
wyhaines has joined #ruby-lang
<Asher> well i can arrange it so that it only edits the backtrace in the condition it calls super, in which case i already know the method is missing
<workmad3> Asher: what you could do is make it optional for your library to appear in backtraces though... something that a library user can turn off if they want less noisy backtraces, but turn on if they think it's in your library
<Asher> hm yeah that's a good call
Skif has joined #ruby-lang
<petercooper> e.set_backtrace(e.backtrace[1..-1]) .. sexy
mrchrisadams has joined #ruby-lang
<petercooper> ooh actually, just e.backtrace.shift seems to do the trick.
<Asher> yup!
<workmad3> as long as you remember to do it all up the chain :)
<petercooper> surprised it lets you play directly on the array like that, but seems to work
<zenspider> hoe 2.16.1 released
<petercooper> e.backtrace.push "dhh"
<zenspider> yay for arrays
nine2five has joined #ruby-lang
<nine2five> Hey there !
<petercooper> it's a way to make a livin
nine2five has quit [#ruby-lang]
wyhaines has joined #ruby-lang
savage- has joined #ruby-lang
<zenspider> image_science 1.2.2 released
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
nofxxx has joined #ruby-lang
achiu1 has joined #ruby-lang
FiXato has joined #ruby-lang
nofxx has joined #ruby-lang
CoverSlide has joined #ruby-lang
slyphon has joined #ruby-lang
Joeysomo has joined #ruby-lang
tran4 has joined #ruby-lang
<tran4> I'm a senior CS undergrad. I applied to a company for co-op and intern positions: http://pastebin.com/LdAH6eaZ Are they good? no reply from company yet but got a call from a recruiter for the same position. shuold i talk to him if I want the position? his ad has $14/hr listed. I live with my parents and they want me to get some work experience this summer. I havent had many replies for my applications so far.
shevy has joined #ruby-lang
<erikh> GP is a pretty big company.
<erikh> that doesn't mean anything else... you'll find shit and gold from the smallest startups to the largest corporations
<erikh> if I were you, I'd be asking them the questions you'd ask us