apeiros_ changed the topic of #ruby-lang to: Ruby 2.0.0-p0: http://ruby-lang.org (Ruby 1.9.3-p392) || Paste >3 lines of text on http://gist.github.com
KU0N has quit [Quit: Linkinus - http://linkinus.com]
sepp2k1 has quit [Remote host closed the connection]
zachlatt_ is now known as zachlatta
guiambros has joined #ruby-lang
Asher has quit [Quit: Leaving.]
Squarepy has joined #ruby-lang
oneirophren has quit [Ping timeout: 256 seconds]
agarie_ has joined #ruby-lang
agarie has quit [Ping timeout: 276 seconds]
athaeryn has joined #ruby-lang
pskosinski has quit [Remote host closed the connection]
athaeryn has quit [Remote host closed the connection]
arubin has quit [Quit: Textual IRC Client: www.textualapp.com]
vlad_starkov has joined #ruby-lang
TheNotary has quit [Ping timeout: 245 seconds]
Averna has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
pskosinski has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
banisterfiend is now known as banister`sleep
TheNotary has joined #ruby-lang
guiambros has quit [Ping timeout: 272 seconds]
guiambros has joined #ruby-lang
marr has quit [Ping timeout: 264 seconds]
woollyams has joined #ruby-lang
kain has quit [Quit: exit]
postmodern has joined #ruby-lang
mistym has quit [Remote host closed the connection]
Squarepy has quit [Remote host closed the connection]
sduckett has quit [Ping timeout: 246 seconds]
kgrz has joined #ruby-lang
Asher has joined #ruby-lang
Domon has joined #ruby-lang
fosky_ has joined #ruby-lang
mjio has joined #ruby-lang
richardjortega has joined #ruby-lang
fosky has quit [Ping timeout: 268 seconds]
retro|cz has joined #ruby-lang
vlad_starkov has joined #ruby-lang
krohrbaugh has joined #ruby-lang
athaeryn has joined #ruby-lang
asunderland has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 276 seconds]
djwonk has joined #ruby-lang
savagecroc has joined #ruby-lang
<savagecroc> hey.. i'm getting a password prompt from a remote server and i'd like a way of sending it a password
<savagecroc> i'm using Net:SSH
<savagecroc> there was a ruby library to deal with ssh
<savagecroc> called like open4 or something like that?
<savagecroc> anyone remember the name?
lcdhoffman has quit [Quit: lcdhoffman]
Banistergalaxy has quit [Ping timeout: 252 seconds]
Banistergalaxy has joined #ruby-lang
idkazuma has joined #ruby-lang
io_syl has joined #ruby-lang
woollyams has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
krohrbaugh has quit [Quit: Leaving.]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
fosky_ has left #ruby-lang [#ruby-lang]
pskosinski has quit [Quit: pskosinski]
<zzak> yorickpeterse: congrats
krz has joined #ruby-lang
kgrz has quit [Ping timeout: 255 seconds]
richardjortega has quit [Quit: richardjortega]
ryanf has joined #ruby-lang
erpuds has quit [Quit: erpuds]
KM has joined #ruby-lang
dettoaltrimenti has quit [Ping timeout: 264 seconds]
dettoaltrimenti has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
breakingthings has quit []
savagecroc has quit [Remote host closed the connection]
asunderland has quit [Ping timeout: 272 seconds]
glebm has quit [Quit: Computer has gone to sleep.]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Client Quit]
kain has joined #ruby-lang
asunderland has joined #ruby-lang
jovy88 has quit [Read error: Connection reset by peer]
jovy88 has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
athaeryn has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
rippa has joined #ruby-lang
idkazuma has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 240 seconds]
arubin has joined #ruby-lang
asunderland has quit [Ping timeout: 256 seconds]
woollyams has joined #ruby-lang
Guest99994 has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
Guest99994 has quit [Killed (idoru (Spam is off topic on freenode.))]
guiambros has quit [Ping timeout: 264 seconds]
guiambros has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
idkazuma has joined #ruby-lang
mistym has quit [Remote host closed the connection]
idkazuma has quit [Ping timeout: 272 seconds]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
mistym has quit [Remote host closed the connection]
seydar has joined #ruby-lang
<seydar> i have a question that is unrelated to ruby and technically is homework. i am prepared for your hatemail
<amerine> seydar: Just ask your questions, friend.
<seydar> i have a TCP protocol for a server and a client. each transaction contains the user/pass, a session number (the session number is stable, users can have many sessions open), and a sequence number that is increasing
<seydar> the sequence number is clearly to prevent against replay attacks
<seydar> but what purpose would a session id serve if you already know the user who's sending it?
<seydar> like, in any TCP connection
<seydar> what's the purpose of having a user/pass and a session id?
vlad_starkov has joined #ruby-lang
athaeryn has joined #ruby-lang
arubin has quit [Quit: Textual IRC Client: www.textualapp.com]
willw000 has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Ping timeout: 252 seconds]
willw000 has quit [Client Quit]
divout has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
willw00 has joined #ruby-lang
idkazuma has joined #ruby-lang
bzalasky has joined #ruby-lang
<seydar> tough crowd, tough crowd
seydar has quit [Quit: leaving]
<willw00> Hello all, so I have rvm installed, and rvm list shows 1.9.3 as current and default, but ruby -v in terminal shows 1.8.7, how can i actually use 1.9.3?
cordax has joined #ruby-lang
<willw00> Also, I've just registered, are my messages going through?
symm- has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
spike|spiegel has quit [Quit: WeeChat 0.4.0]
bothra has quit [Read error: Connection reset by peer]
bothra has joined #ruby-lang
woollyams has joined #ruby-lang
spike|spiegel has joined #ruby-lang
willw00 has quit [Quit: Leaving]
mucker has quit [Quit: leaving]
divout has quit [Remote host closed the connection]
<rue> Yes
woollyams has quit [Quit: Computer has gone to sleep.]
noop has joined #ruby-lang
blacktulip has joined #ruby-lang
woollyams has joined #ruby-lang
DomKM has quit [Quit: Leaving.]
kgrz has joined #ruby-lang
vlad_starkov has joined #ruby-lang
divout has joined #ruby-lang
oneirophren has joined #ruby-lang
smt has joined #ruby-lang
smt has left #ruby-lang [#ruby-lang]
fsvehla has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 248 seconds]
nXqd has quit [Ping timeout: 264 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
kgrz has quit [Quit: Computer has gone to sleep.]
krz has quit [Ping timeout: 252 seconds]
Domon has quit [Remote host closed the connection]
nXqd has joined #ruby-lang
Domon has joined #ruby-lang
symm- has quit [Ping timeout: 252 seconds]
nXqd has quit [Remote host closed the connection]
yawniek_ has quit [Quit: WeeChat 0.4.0]
nertzy3 has joined #ruby-lang
nertzy2 has quit [Ping timeout: 252 seconds]
Mon_Ouie has quit [Ping timeout: 272 seconds]
My_Hearing has joined #ruby-lang
rippa has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 258 seconds]
workmad3 has joined #ruby-lang
athaeryn has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
krz has joined #ruby-lang
mucker has joined #ruby-lang
krz has quit [Remote host closed the connection]
krz has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
workmad3 has quit [Ping timeout: 272 seconds]
glebm has joined #ruby-lang
krz has quit [Client Quit]
JohnBat26 has joined #ruby-lang
krz has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
kgrz has joined #ruby-lang
solars has joined #ruby-lang
rippa has quit [Ping timeout: 240 seconds]
Domon has quit [Remote host closed the connection]
Cope has joined #ruby-lang
My_Hearing has quit [Ping timeout: 272 seconds]
_Mon_Ouie_ has joined #ruby-lang
Domon has joined #ruby-lang
francisfish has joined #ruby-lang
glebm has quit [Ping timeout: 248 seconds]
glebm has joined #ruby-lang
dr_bob has joined #ruby-lang
benlovell has joined #ruby-lang
poga has quit [Ping timeout: 245 seconds]
vmoravec has joined #ruby-lang
dhruvasagar has joined #ruby-lang
swav has quit [Remote host closed the connection]
kgrz has quit [Ping timeout: 252 seconds]
mitchty has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby-lang
benlovell has quit [Quit: benlovell]
mitchty has joined #ruby-lang
skade has joined #ruby-lang
cordax has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
skade has quit [Client Quit]
mrfelix has joined #ruby-lang
mrfelix has quit [Client Quit]
benlovell has joined #ruby-lang
judofyr has joined #ruby-lang
mjio has quit []
xxaM has quit [Ping timeout: 260 seconds]
snafoo has joined #ruby-lang
TheNotary has quit [Read error: Operation timed out]
<snafoo> sigh
vlad_starkov has quit [Remote host closed the connection]
<snafoo> if ruby gets one regex match, does it still return an array with the single match in it
glebm has quit [Quit: Computer has gone to sleep.]
joshH2 has quit [Ping timeout: 272 seconds]
<manveru> snafoo: with what method? '(
<snafoo> one sec, i think i just figured it out T_T
<snafoo> with // method
<snafoo> if that makes sense
<snafoo> :S
<manveru> "foo"[/o/] == "o"
gnufied has joined #ruby-lang
<snafoo> well actually, here's what im doing
<snafoo> page = item.to_html.scan(/<td><a id="ctl00_PlaceHolderMain_CommonQuestionsDisplayEditModePanel_Search_lvRegisterRecordsList_ctrl.*_IndNameHyperlink" href="(.+?)">.*<\/a><\/td>/)
<manveru> holy
<manveru> moly
<snafoo> yeah i know T_T
<manveru> why not nokogiri?
<matti> manveru: ;]
<matti> manveru: Ohai
<snafoo> wont install on this machine for some reason :S
<Cope> snafoo: what manveru said
<matti> manveru: Tell me, do you miss food from combini?
<manveru> you have no libxml2 and libxslt installed?
<manveru> matti: not much
<matti> manveru: I came back from Japan recently back to the UK, and I miss nice and cheap combini food.
<manveru> i like that you can get some soba at 4 in the morning
<snafoo> im not sure i have it on my other computer working fine
<snafoo> not on this one though
<manveru> well, what is the error?
<matti> manveru: :)
<snafoo> well i'm trying to open that url that i parse, "page"
swygue has quit [Remote host closed the connection]
<snafoo> pp = URI.parse(page).read()
<manveru> when installing nokogiri
<snafoo> Oh
<manveru> also pp is the method for pretty inspect :)
<snafoo> hmm?
<manveru> matti: you missing nothing else? :P
<matti> manveru: I miss my girlfriend ;]
<manveru> she stays there?
<matti> manveru: Kaori had to stay in Japan, as her visa expired.
mbj has joined #ruby-lang
glebm has joined #ruby-lang
<matti> manveru: Yeah ;/
<manveru> :(
<manveru> my friend also had a gf during his stay named kaori...
kgrz has joined #ruby-lang
<matti> manveru: I was interviewing with Rakuten and got all the way to the final interview.
<manveru> she was pretty mental tho
<snafoo> Actually yeah libxml2 is missing
<manveru> omg
<matti> manveru: But when they asked me to read Mikitani's books and write essays on them.
<manveru> if you want any advice, don't work at rakuten :P
<matti> manveru: I snapped and told them to GTFO.
<matti> manveru: Yeah, precisely.
<manveru> they are one of the worst companies around
<matti> manveru: In my case Kaori is quite a nice person :P Not very mental ;]
<matti> manveru: She used to study in the UK, and that is how we meet.
<manveru> aye, it's a common name :)
<matti> She is from Sendai.
<matti> I went to visit her family house.
<matti> Her father did not liked me ;p
TheNotary has joined #ruby-lang
<matti> But, he barely cares about her too. Apparently, still unhappy as he has two girls and always wanted to have a boy.
<matti> Her mom is awesome ;p Talks a lot.
fsvehla has joined #ruby-lang
<manveru> when i met my wifes father he was late stage alzheimer already :(
<manveru> so he didn't even know wtf was going on
<matti> ;/
<manveru> anw, i'm glad because he probably would have kicked me out of the door otherwise :)
<matti> Hahah
<matti> manveru: Kaori and I have common friend who is currently working in Germany.
<matti> manveru: We might be visiting Anna-san in summer, so if you are still in .de then you are invited for a dinner ;]
<manveru> well, .de is big... i assume that is berlin or something?
<matti> I think so.
woollyams has quit [Ping timeout: 276 seconds]
<matti> Or Munich.
<matti> Not sure, actually.
<matti> Does not matter, .de has nice train system too.
<manveru> snafoo: you found it?
<snafoo> Yeah, I don't know if I'll be able to get it to work since i dont have admin on this pc
<manveru> yeah... but not sure i wanna sit in the train for 16h for a dinner :)
<yorickpeterse> morning
<manveru> moin
<manveru> snafoo: ok, what about hpricot?
<ddfreyne> I'm moving to Berlin in three weeks! :D
<ddfreyne> It's so damn close now
<manveru> i wanna move there too :|
<snafoo> yeah im trying to use that, but i've basically ended up with convulted mess of some xpath searching and some regex matching
<Cope> I'm going to Berlin in 3 weeks :)
<gnufied> ddfreyne: where are you moving to btw?
<gnufied> (don't tell if you wouldn't want to!)
<matti> manveru: Haha
<yorickpeterse> ddfreyne will be selling bockwurst in Berlin
<matti> manveru: I may come over ;p
<matti> manveru: We shall see ;]
glebm has quit [Ping timeout: 252 seconds]
<ddfreyne> gnufied: working for SoundCloud in Berlin
<ddfreyne> It'll be my first Ruby job :D
<gnufied> yay, sounds awesome.
<ddfreyne> (not exclusively Ruby)
<gnufied> bunch of my friends are in thoughtbot office in Sweden
<snafoo> So would that regex before be returning an array, because it wont let me open it T_T
nXqd has joined #ruby-lang
<ddfreyne> gnufied: Where do you live?
<gnufied> I am in Bangalore
io_syl has joined #ruby-lang
glebm has joined #ruby-lang
<gnufied> trying to bootstrap a startup more or less.
<yorickpeterse> oh jesus, moar magic variables being discussed in ruby-core
<ddfreyne> yorickpeterse: WAT
swav has joined #ruby-lang
idkazuma has joined #ruby-lang
<yorickpeterse> http://www.ruby-forum.com/topic/4412935#1107187 unless $! already existed
idkazuma has quit [Remote host closed the connection]
<manveru> it does
<manveru> last exception
<yorickpeterse> ah
<yorickpeterse> then nevermind
<manveru> xi ~ % ruby -e 'a rescue p $!.class' 10:10:21
<manveru> NameError
<manveru> argh
<manveru> damn prompt ^^;
joshH2 has joined #ruby-lang
joshH3 has joined #ruby-lang
joshH3 has quit [Read error: Connection reset by peer]
joshH3 has joined #ruby-lang
joshH3 has quit [Read error: Connection reset by peer]
joshH3 has joined #ruby-lang
mbj has quit [Ping timeout: 268 seconds]
joshH3 has quit [Read error: Connection reset by peer]
jxie has quit [Ping timeout: 256 seconds]
joshH3 has joined #ruby-lang
joshH2 has quit [Ping timeout: 256 seconds]
<yorickpeterse> >> begin; raise; rescue; p $!.class; end
<yorickpeterse> eval-in_: HEY GET YOUR STUFF TOGETHER
fsvehla has quit [Read error: Connection reset by peer]
<ddfreyne> eval-in says no
<snafoo> open-uri.rb:36:in `open': no implicit conversion of Ar
<snafoo> ray into String (TypeError)
<snafoo> open-uri.rb:36:in `open': no implicit conversion of Ar
<snafoo> ray into String (TypeError)
<snafoo> oops
<snafoo> hmm
<snafoo> any idea why i get this when trying to open a URL I parsed with regex?
Banistergalaxy has quit [Ping timeout: 240 seconds]
Banistergalaxy has joined #ruby-lang
<yorickpeterse> Put your code in a pastebin first
<yorickpeterse> or what's relevant of it
fsvehla has joined #ruby-lang
<snafoo> i know, i know, its brutal to look at
<snafoo> -___
skade has joined #ruby-lang
<snafoo> src = open(page).read() is the error
glebm has quit [Ping timeout: 276 seconds]
<amerine> snafoo: String#scan returns an array.
<drbrain> ↑
<snafoo> I've tried grabbing the first element, but that doesn't help either ;;
<drbrain> and, why don't you use XPath instead of a regular expression?
<snafoo> src = open(page[0]).read() like that? ;(
<amerine> ↑
<snafoo> I'm not sure how to go about getting the data I need with xpath T_T Too much of a noob
<manveru> he can't install nokogiri or hpricot for some reason
alessio_rocco has joined #ruby-lang
glebm has joined #ruby-lang
<amerine> snafoo: I'm going to hazard a guess that page is an empty array, hence drbrain suggestion of using XPath.
gnufied has quit [Quit: Leaving.]
<drbrain> snafoo: or use =~ or match instead of scan
<manveru> just using String#[] would be enough i hope :)
<drbrain> or ↑
<snafoo> I have hpricot manveru, I used it somewhat, but then couldn't figure out how to get exactly to the elements I needed, so I just used regex for the rest :(
gnufied has joined #ruby-lang
<snafoo> Which I know is atrocious :P
joshH3 has quit [Read error: Connection timed out]
rippa has joined #ruby-lang
joshH3 has joined #ruby-lang
Domon has quit [Remote host closed the connection]
joshH3 has quit [Read error: Connection reset by peer]
joshH3 has joined #ruby-lang
joshH3 has quit [Read error: Connection reset by peer]
joshH3 has joined #ruby-lang
noop_ has joined #ruby-lang
noop has quit [Ping timeout: 256 seconds]
fsvehla has quit [Read error: Connection reset by peer]
agarie_ has quit [Remote host closed the connection]
agarie has joined #ruby-lang
agarie has quit [Client Quit]
fsvehla has joined #ruby-lang
<snafoo> Hmm, ok so using hpricot
<snafoo> mypage = item.search("//*[@id=\"ctl00_PlaceHolderMain_CommonQuestionsDisplayEditModePanel_Search_lvRegisterRecordsList_ctrl0_IndNameHyperlink\"]")
glebm has quit [Ping timeout: 252 seconds]
<snafoo> return the blocks of html, how do i go about getting the URL from that?
Domon has joined #ruby-lang
glebm has joined #ruby-lang
kain_ has joined #ruby-lang
kain has quit [Ping timeout: 245 seconds]
joshH3 has quit [Read error: Connection timed out]
joshH3 has joined #ruby-lang
fsvehla has quit [Read error: Connection reset by peer]
mbj has joined #ruby-lang
skade has quit [Read error: Operation timed out]
vlad_starkov has joined #ruby-lang
fsvehla has joined #ruby-lang
<dr_bob> Depends on where they sit, snafoo. Could be "//*[@id=\"ctl00_PlaceHolderMain_CommonQuestionsDisplayEditModePanel_Search_lvRegisterRecordsList_ctrl0_IndNameHyperlink\"]//a/@href"
runeb has joined #ruby-lang
<snafoo> Hrmm, ok thanks dr_bob
<snafoo> Do you know if it's possible to have wildcards in xpath?
<snafoo> Like...
<snafoo> "//*[@id=\"ctl00_PlaceHolderMain_CommonQuestionsDisplayEditModePanel_Search_lvRegisterRecordsList_ctrl.*_IndNameHyperlink\"]//a/@href"
<snafoo> -after the ctrl-
vlad_starkov has quit [Ping timeout: 268 seconds]
krz has quit [Quit: krz]
krz has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
Averna has quit [Quit: Leaving.]
charliesome has joined #ruby-lang
kgrz has quit [Ping timeout: 245 seconds]
skade has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
fsvehla has quit [Read error: Connection reset by peer]
joshH3 has quit [Read error: Connection timed out]
marr has joined #ruby-lang
joshH3 has joined #ruby-lang
joshH4 has joined #ruby-lang
glebm has joined #ruby-lang
joshH4 has quit [Read error: Connection reset by peer]
fsvehla has joined #ruby-lang
joshH4 has joined #ruby-lang
joshH4 has quit [Read error: Connection reset by peer]
<dr_bob> snafoo: you would need to use contains() or some other XPath function.
joshH4 has joined #ruby-lang
joshH4 has quit [Read error: Connection reset by peer]
<spike|spiegel> w3fools!!!
joshH4 has joined #ruby-lang
joshH3 has quit [Ping timeout: 252 seconds]
<dr_bob> Or loop for "custom functions" here: http://nokogiri.org/Nokogiri/XML/Node.html snafoo
adambeynon has joined #ruby-lang
joshH5 has joined #ruby-lang
judofyr has quit [Remote host closed the connection]
joshH6 has joined #ruby-lang
joshH6 has quit [Read error: Connection reset by peer]
joshH6 has joined #ruby-lang
joshH4 has quit [Ping timeout: 256 seconds]
fsvehla has quit [Read error: Connection reset by peer]
joshH5 has quit [Ping timeout: 256 seconds]
fsvehla has joined #ruby-lang
woollyams has joined #ruby-lang
vlad_starkov has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
fsvehla has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 258 seconds]
GarethAdams has joined #ruby-lang
fsvehla has joined #ruby-lang
dhruvasagar has joined #ruby-lang
nibbo_ has quit [Ping timeout: 276 seconds]
nibbo has joined #ruby-lang
bizdak has quit [Remote host closed the connection]
fsvehla has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby-lang
fsvehla has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
idkazuma has joined #ruby-lang
woollyams has quit [Ping timeout: 255 seconds]
woollyams has joined #ruby-lang
oneirophren has quit [Ping timeout: 256 seconds]
antbody has quit [Quit: ZNC - http://znc.in]
fsvehla has quit [Read error: Connection reset by peer]
ikrima has quit [Quit: Computer has gone to sleep.]
woollyams has quit [Quit: Computer has gone to sleep.]
Guu has joined #ruby-lang
Guu has left #ruby-lang [#ruby-lang]
glebm has quit [Ping timeout: 256 seconds]
fsvehla has joined #ruby-lang
woollyams has joined #ruby-lang
glebm has joined #ruby-lang
bart_ has joined #ruby-lang
jxie has joined #ruby-lang
* yorickpeterse has an evil idea to prevent people from fucking up $LOAD_PATH
<yorickpeterse> lets see if it actually works
<ddfreyne> $LOAD_PATH.freeze?
<ddfreyne> spike|spiegel: awesome nick :)
<yorickpeterse> Array#<< is an alias for Array#push right?
<yorickpeterse> hm wtf, they're different methods
<yorickpeterse> otherwise my hack works
kgrz has joined #ruby-lang
bart_ has quit [Client Quit]
barttenbrinke has joined #ruby-lang
fsvehla has quit [Read error: Connection reset by peer]
<yorickpeterse> http://eval.in/17940 there we go
barttenbrinke has quit [Client Quit]
barttenbrinke has joined #ruby-lang
dhruvasagar has quit [Quit: Lost terminal]
barttenbrinke has quit [Client Quit]
barttenbrinke has joined #ruby-lang
dhruvasagar has joined #ruby-lang
fsvehla has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<barttenbrinke> Does anybody know how I can solve this in Ruby 1.9? : URI.decode("test%ED").gsub('test', '')
woollyams has quit [Quit: Computer has gone to sleep.]
<barttenbrinke> I know I can force the encoding, but I'd like to retain the data
<yorickpeterse> eh, solve as in?
<whitequark> barttenbrinke: look at the source of my Rack::UTF8Sanitizer: http://whitequark.org/blog/2013/03/05/rack-utf8sanitizer/
<whitequark> it does exactly that
maxmanders has joined #ruby-lang
xxaM has joined #ruby-lang
noop_ has quit [Ping timeout: 252 seconds]
barttenbrinke has quit [Remote host closed the connection]
glebm has quit [Ping timeout: 245 seconds]
glebm has joined #ruby-lang
woollyams has joined #ruby-lang
Cope has quit [Quit: Lost terminal]
joshH6 has quit [Quit: Nettalk6 - www.ntalk.de]
toretore has joined #ruby-lang
marr has quit [Ping timeout: 268 seconds]
fsvehla has quit [Read error: Connection reset by peer]
<spike|spiegel> ddfreyne: thanks
<injekt> yorickpeterse: $LOADED_FEATURES.freeze
<injekt> yorickpeterse: also yeah push accepts multiple arguments
<injekt> oh that was ddfreyne
noop_ has joined #ruby-lang
fsvehla has joined #ruby-lang
ammar_ has joined #ruby-lang
ammar_ has left #ruby-lang [#ruby-lang]
mikestok has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
Domon has quit [Remote host closed the connection]
fsvehla has quit [Read error: Connection reset by peer]
ammar_ has joined #ruby-lang
ammar_ has left #ruby-lang [#ruby-lang]
fsvehla has joined #ruby-lang
<dr_bob> yorickpeterse: why not $:.freeze?
glebm has joined #ruby-lang
barttenbrinke has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
barttenbrinke has joined #ruby-lang
marr has joined #ruby-lang
skade has quit [Read error: Operation timed out]
skade has joined #ruby-lang
<barttenbrinke> yorickpeterse: I want to get the i into a UTF8 string
<yorickpeterse> injekt: oh, that could work too
<yorickpeterse> but I prefer annoying error messages
robbyoconnor has quit [Ping timeout: 252 seconds]
<barttenbrinke> whitequark .. wow that looks like all kinds of nasty :)
laneoneform has joined #ruby-lang
laneoneform has left #ruby-lang [#ruby-lang]
<barttenbrinke> The UTF8Sanitizer doesn't decode the %ED to i for me..
justinmcp_ has quit []
francisfish has quit [Remote host closed the connection]
justinmcp has joined #ruby-lang
io_syl has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
<whitequark> barttenbrinke: well...
<whitequark> >> 0xED.chr
<yorickpeterse> whitequark: bot is borken
<yorickpeterse> charliesome doesn't know how to code, etc
<charliesome> fark
woollyams has quit [Quit: Computer has gone to sleep.]
<dhruvasagar> Hi guys, I wrote a simply command line utility in ruby that loops through directories and does some stuff, but when I press ^C during processing, it doesn't stop, it just skips current directory and continues...I want to quit the program if I press ^C
eval-in_ has quit [Remote host closed the connection]
<dhruvasagar> I am trying to rescue Interrupt, but it is just not doing anything...
<dhruvasagar> any help
eval-in has joined #ruby-lang
<charliesome> >> 0xed.chr
<eval-in> charliesome => "\xED" (http://eval.in/17945)
<charliesome> whitequark ^
<whitequark> barttenbrinke: ^
<whitequark> 0xED is not "i"
<yorickpeterse> dhruvasagar: give Signal.trap() a try
<charliesome> it might be one of them funny i chars
<snafoo> hello, i have an xpath question
<charliesome> >> 0xED.chr("utf-8")
<eval-in> charliesome => "í" (http://eval.in/17946)
<yorickpeterse> trap 'INT' in particular if I remember the signal name correctly
<whitequark> dhruvasagar: um, just re-raise Interrupt
<snafoo> When I do puts item.search("//td/a/@href"), it returns the link text, but not the URL? Why is that?
<whitequark> rescue Interrupt;
<whitequark> raise
<barttenbrinke> whitequark, no, it is í
<whitequark> barttenbrinke: ok, but not UTF-8 i
<dhruvasagar> whitequark: it's not even rescueing...I want to 'exit', but it doesn't
<whitequark> ì
<charliesome> barttenbrinke: 0xed is í in iso-8859-1
<yorickpeterse> snafoo: a[@href]
<whitequark> shit how do I type that
<yorickpeterse> Though my xpath is rusty
<charliesome> barttenbrinke: but you're using a 'UTF8Sanitizer'
<dhruvasagar> yorickpeterse: where should I place Signal.trap(), before , after or duging my processing code ?
<yorickpeterse> before
<yorickpeterse> since it's a loop it will otherwise block it
<barttenbrinke> charliesome I want transform "%ED" into "í"
<barttenbrinke> In ruby 1.9
<dhruvasagar> yorickpeterse: how is Signal.trap different from Kernel.trap ?, I tried with trap, but it didn't do anything either. I used >trap('INT') { exit }. but it didn't do anything
<charliesome> barttenbrinke: why?
<snafoo> hmmm, yorickpeterse, that return the entire <a> tag :S
<charliesome> barttenbrinke: is your input guaranteed to be in iso-8859-1?
<yorickpeterse> dhruvasagar: err, I think they're an alias to be exact
<yorickpeterse> snafoo: what library are you using, Nokogiri?
<barttenbrinke> Charliesome: no
idkazuma has quit [Remote host closed the connection]
<charliesome> barttenbrinke: what encoding is it in?
<snafoo> hpricot
<yorickpeterse> heh
<dhruvasagar> yorickpeterse: ok, is my example trap('INT') not correct then ?
pcboy__ has quit [Ping timeout: 256 seconds]
glebm has joined #ruby-lang
<yorickpeterse> dhruvasagar: not sure, paste the rest of the code (or what's relevant of it) in a pastebin
<barttenbrinke> charliesome: It's a user posted URL.. to that means it --should-- be 8859, but that it could be something elese
sush24 has joined #ruby-lang
<charliesome> barttenbrinke: do you have control over the form the user comes from?
<dhruvasagar> yorickpeterse: https://gist.github.com/dhruvasagar/5481048
<barttenbrinke> charliesome: No.. in this case it is a google referer (the user came from google.com/search?q=SOMESTRING_CONTAINING%ED
<charliesome> bummer
<charliesome> you *could* do something like this...
<yorickpeterse> dhruvasagar: does process() do anything that could potentially block the operation?>
<snafoo> bleh, xpath makes my head want to explode
glebm has quit [Read error: Connection reset by peer]
<charliesome> barttenbrinke: http://eval.in/17947
<charliesome> that's a bit nasty, but it may be a necessary evil in your case
<dhruvasagar> yorickpeterse: https://gist.github.com/dhruvasagar/5481060
<dhruvasagar> yorickpeterse: yes, since I am calling system in it.
alessio_rocco has quit [Ping timeout: 252 seconds]
<barttenbrinke> charliesome: this is workable :)
TvL2386 has joined #ruby-lang
glebm has joined #ruby-lang
<barttenbrinke> charliesome: thanks... how does rails fix this anyway? By forcing utf-8 with the check?
<charliesome> barttenbrinke: rails puts 'accept-charset="UTF-8"' on the form
<charliesome> which sets the form to utf-8 on non-IE browsers
<yorickpeterse> dhruvasagar: http://pastie.org/7737249 an example
<charliesome> the checkmark is to force some versions of IE to actually post the form in utf-8
fsvehla has quit [Read error: Connection reset by peer]
marr has quit []
pcboy_ has joined #ruby-lang
vlad_sta_ has quit [Remote host closed the connection]
<dhruvasagar> yorickpeterse: I tried rescuing as well, it doesn't seem to stop :/
idkazuma has joined #ruby-lang
<TvL2386> Hi guys, I'm playing with Savon (SOAP library). The wsdl operations show I can call method :get_version, but when I do that, Savon says: /usr/local/rvm/gems/ruby-2.0.0-p0/gems/savon-2.1.0/lib/savon/response.rb:70:in `raise_soap_and_http_errors!': (SOAP-ENV:Client) Unknown method "{urn:iControl}:get_version" (Savon::SOAPFault). I'm connecting to a F5 iControl webservice to manage loadbalancers
<yorickpeterse> TvL2386: please don't paste errors/code directly in this channel, it's much easier to read when pasted in a pastebin
<yorickpeterse> e.g. gist.github.com
<barttenbrinke> charliesome , yeah so they don't ever have to deal with it
<yorickpeterse> dhruvasagar: hm, then I'm not sure what's going on
fsvehla has joined #ruby-lang
sduckett has joined #ruby-lang
<dhruvasagar> yorickpeterse: :(, ok thanks for trying
countdigi has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
<TvL2386> I know it's not very friendly, been messing with this for quite some time now and I'm frustrated...
<TvL2386> not an excuse though :-)
<yorickpeterse> it's just an FYI :)
glebm has joined #ruby-lang
<yorickpeterse> also, a method name with {herp:der}:foo looks a bit weird, even for SOAP
idkazuma has quit [Remote host closed the connection]
<TvL2386> yorickpeterse, yeah it looks weird to me too. Almost as if I should wrap something on a higher level saying we live in namespace iControl or something... My lack of soap knowledge is biting me here
mikestok has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<TvL2386> There's this iControl gem (https://github.com/magec/icontrol), but it's 2 years old and is using a very old Savon version... I'm trying to get this into a Rails project which depends on a newer version of Savon... So I cannot use, and don't want to use something that old.
<darix> whitequark yorickpeterse: with all the tools around parsing ruby and analyzing it. can the libraries be used to determine if there are unused gems listed in a Gemfile?
<whitequark> darix: no
<whitequark> well, yes*
<whitequark> *if your testsuite is good enough, you can remove gems one by one and check if it fails.
<whitequark> I bet you can trivially write a script to do that.
<TvL2386> yorickpeterse, found it! For this particular request, I should initialize my Savon client with: ":namespace => 'urn:iControl:LocalLB/Pool',". Now it works
<andrewvos> Aww man are you using savon?
<andrewvos> That was rhetorical
<whitequark> savon is awesome
<andrewvos> But I feel for you man
<TvL2386> please please please enlighten me
runeb has quit [Remote host closed the connection]
<whitequark> it's about as good as you can get if you *have* to use soap
<TvL2386> I have to use soap
<andrewvos> Can you quit your job?
<TvL2386> lol
<TvL2386> who can't?
<andrewvos> Well some people are too scared, so a lot of people ;)
<yorickpeterse> andrewvos: shut it Hamilton
<TvL2386> as long as a new one pops up fast :)
<yorickpeterse> darix: in theory, yes
krz has quit [Quit: krz]
<darix> yorickpeterse: but?
<andrewvos> yorickpeterse: I think you mean "Hammond"
<TvL2386> Well, I'm a network engineer, trying to automate an F5 loadbalancer... it uses a SOAP interface
<andrewvos> A load balancer with a soap interface?
<andrewvos> For reallio?
<TvL2386> F5 & Citrix Netscaler both use SOAP
<injekt> oh mine
<TvL2386> it's not that weird andrewvos
<injekt> oh my*
<injekt> how did I mix up my and mine
<injekt> that is the question
<andrewvos> TvL2386: It is to me! I guess you're stuck with savon then
<yorickpeterse> darix: they don't exist yet
<darix> injekt: because you can?
<yorickpeterse> andrewvos: whatever
<injekt> darix: damn straight!
<andrewvos> injekt: mein god
<yorickpeterse> andrewvos: cars are not my interest
<TvL2386> Well... At least soap is an improvement over the expect scripts used for Cisco in my opinion :)
<TvL2386> but I'd rather have a REST interface...
<andrewvos> TvL2386: What problems you having with Savon then?
<snafoo> Any idea why I get
<snafoo> realtyscrape.rb:34:in `block in <main>': undefined method `attributes' for nil:N
<snafoo> ilClass (NoMethodError)
<snafoo> from puts item.search("//td/a").attributes['href']
<TvL2386> andrewvos, it's fixed now, it seems I should have used a namespace
<snafoo> this is so annoying -_--
banister`sleep has quit [Remote host closed the connection]
<TvL2386> andrewvos, my noobyness on the subject bit me
<andrewvos> snafoo: What gem are you using?
<injekt> snafoo: because item.search returned nil?
<snafoo> hpricot
fsvehla has quit [Read error: Connection reset by peer]
<injekt> use nokogiri
<andrewvos> Yeah
<snafoo> but it most definitly does have a href element
<injekt> snafoo: but //td/a found nothing, that's the issue
<snafoo> I can't T_T no admin on this machine and it doesnt have the libs nokogiri needs
<injekt> in nokogiri that would return a nodeset
<snafoo> but when i output just puts item.search("//td/a")
<snafoo> it returns the entire <a> tag, with href elements
<injekt> maybe because hpricot
tarruda has joined #ruby-lang
<injekt> snafoo: anyway Elements#attributes makes no sense
<injekt> you need to fetch the first element
<injekt> Hpricot("<tr><td><a href='foo'>bar</a></td></tr>").search("//tr/td/a").first.attributes['href']
<injekt> => "foo"
fsvehla has joined #ruby-lang
<injekt> or use .at
<injekt> Hpricot("<tr><td><a href='foo'>bar</a></td></tr>").at("//tr/td/a")[:href]
<injekt> => "foo"
<spike|spiegel> charliesome: thanks for ruby-core:54687 :)
<snafoo> hmmm
<charliesome> spike|spiegel: working on a patch right now
<spike|spiegel> cool
<snafoo> puts item.at("//td/a")[:href]
divout has quit [Remote host closed the connection]
<snafoo> still gives me a undefined method error
<snafoo> :|
<whitequark> please, stop using hpricot already
<injekt> snafoo: that's because it's nil
<whitequark> nokogiri
<snafoo> i can't install it whitequark :(
<injekt> the thing is, you can do this fine with hpricot, the problem is at is not finding anything, so it's nil
<injekt> you'd have the same problem in nokogiri
<spike|spiegel> snafoo: can't install is not an excuse.. why?
<snafoo> I don't understand why though, because when i output just the <a> tag it shows the href element in there T_T
<snafoo> spike|spiegel: Don't have admin, nor the correct libs
wallerdev has joined #ruby-lang
<injekt> snafoo: so: puts item.at("//td/a")
<injekt> works?
<snafoo> sec
<snafoo> yeah it returns the entire <a> tag
<injekt> and puts item.at("//td/a")[:href] does what?
woollyams has joined #ruby-lang
<snafoo> realtyscrape.rb:34:in `block in <main>': undefined method `[]' for nil:NilClass
<snafoo> (NoMethodError)
<injekt> lol
<snafoo> ;S
<bougyman> item.at{"//td/a").class
<injekt> rogue { !
<bougyman> what is it?
sduckett has quit [Ping timeout: 246 seconds]
dhruvasa1ar has joined #ruby-lang
idkazuma has joined #ruby-lang
<snafoo> Hpricot::Elem
<bougyman> that's nuts.
<snafoo> is what that returns 0_0
<injekt> then the world is broken
<yorickpeterse> isn't hpricot dead anyway?
_Mon_Ouie_ has quit [Ping timeout: 260 seconds]
<spike|spiegel> llooooooong dead
<bougyman> he's missing libxslt and doesn't have root, yorickpeterse
<injekt> not long dead
<snafoo> bleh
<yorickpeterse> agh
<yorickpeterse> * ah
<injekt> but yeah, definitely nokogiri
glebm has quit [Ping timeout: 252 seconds]
<spike|spiegel> not maintained for more than 1 year == long dead. no?
<snafoo> its gonna be a long night..
<bougyman> no, that could just mean done, spike|spiegel
<injekt> I thought it had pushes to master less than 6 months ago
_Mon_Ouie_ has joined #ruby-lang
<injekt> I dunno, I haven't used it for years now
ritek has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 264 seconds]
<spike|spiegel> bougyman: only very few libs ever get to that stage
<bougyman> spike|spiegel: agreed
dabradley has quit [Ping timeout: 272 seconds]
alessio_rocco has joined #ruby-lang
<yorickpeterse> "After years of lack of a proper maintainer for one of why's jewels, it has been decided to finally close the book on hpricot. Most users have migrated to alternatives and there is simply no time or energy to continue with the current codebase."
fsvehla has quit [Read error: Connection reset by peer]
<yorickpeterse> From the READM
<yorickpeterse> * README
_Mon_Ouie_ has left #ruby-lang [#ruby-lang]
Mon_Ouie has joined #ruby-lang
fsvehla has joined #ruby-lang
dabradley has joined #ruby-lang
<yorickpeterse> jesus christ, ActiveRecord's API is so dumb for common stuff
<yorickpeterse> Herp.where('foo LIKE ?', 'GETOUT')
<yorickpeterse> arel tiem I suppose
alessio_rocco has quit [Ping timeout: 248 seconds]
wallerdev has quit [Quit: wallerdev]
alessio_rocco has joined #ruby-lang
<yorickpeterse> also holy shit, Nightwish, I haven't listened to this in years
yalue has joined #ruby-lang
<yorickpeterse> (completely related to Ruby)
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
tms has joined #ruby-lang
tms has left #ruby-lang [#ruby-lang]
swav has quit [Read error: No route to host]
swav has joined #ruby-lang
voker57 has quit [Ping timeout: 255 seconds]
GeissT has quit [Quit: MillBroChat AdIRC User]
divout has joined #ruby-lang
judofyr has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
banister`sleep has joined #ruby-lang
glebm has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 256 seconds]
adambeynon has joined #ruby-lang
workmad3 has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
lele|2 has joined #ruby-lang
lele|2 has quit [Client Quit]
sepp2k has joined #ruby-lang
retro|cz has quit [Read error: Connection reset by peer]
barttenbrinke has joined #ruby-lang
beiter has joined #ruby-lang
<injekt> why is that dumb?
<yorickpeterse> I expected something so common to have a slightly nicer API
<yorickpeterse> one that doesn't have the pitfall of "Oh herp derp Rails will take care of escaping data"
<yorickpeterse> "BUT IT DOESN'T!"
<injekt> iirc 4.0 has a like method on relations
<yorickpeterse> hmm
<yorickpeterse> Ah well, that would be nice
<injekt> but I like the current api personally
<judofyr> well, even Sequel doesn't have an escapable LIKE-method
<injekt> nope
<whitequark> yorickpeterse: <3 nightwish.
<whitequark> re like.
<injekt> it's not easily done
<yorickpeterse> whitequark: meh, it's ok-ish
<whitequark> where('foo like ?', bar) ?
<yorickpeterse> Though I can only listen to metal once/twice a day
<yorickpeterse> err, week
<judofyr> whitequark: if you're okay with people using % as wildcard, yes
* whitequark once listened to the same nightwish playlist for a good month
<whitequark> judofyr: ah, that's your problem... I see
<yorickpeterse> whitequark: to give you an idea, I normally listen to anything from jazz to house and from breakbeat to hip hop
<yorickpeterse> oooooh shit, Sonata Arctica. I like this playlist
<yorickpeterse> Highschool goth period all over again
<whitequark> hehe
* whitequark idly waits while 20G of assets download to his notebook
<whitequark> migrating from paperclip to carrierwave. sucks.
<judofyr> huh. so carrierwave is the new shit now.
<whitequark> judofyr: it's much better than paperclip
<yorickpeterse> so far my verdict on carrierwave is "acceptable"
<yorickpeterse> <insert grumpy cat picture>
<whitequark> yeah ^
<whitequark> I have not encountered a file upload solution which is good but carrierwave is ok.
fsvehla has quit [Read error: Connection reset by peer]
<yorickpeterse> http://i.imgur.com/Gr8DL.gif basically this
Banistergalaxy has joined #ruby-lang
<whitequark> what's with all the sudden grumpycat love
<yorickpeterse> it's a cat, what more do you need?
Cope has joined #ruby-lang
<injekt> less cat
<judofyr> ... | cat | less
<whitequark> cat x | foo is better than foo < x
<whitequark> because you can think linearly, from left to right, in terms of pipeline
<judofyr> whitequark: I agree
<whitequark> cat file | xsel -b
<whitequark> etc.
vlad_starkov has joined #ruby-lang
noop_ has quit [Ping timeout: 260 seconds]
thebastl has joined #ruby-lang
wallerdev has joined #ruby-lang
fsvehla has joined #ruby-lang
<ddfreyne> whitequark: Yeah I prefer cat x | blah too tbh
tarruda has quit [Ping timeout: 260 seconds]
<yorickpeterse> I prefer cat | more
glebm has quit [Ping timeout: 245 seconds]
workmad3 has quit [Ping timeout: 255 seconds]
glebm has joined #ruby-lang
<yorickpeterse> JASHHDLHJKASHDL I HATE BOILERPLATE TESTS
<yorickpeterse> pending 'implement or delete this' # THEN WHY IS IT THERE IN THE FIRST PLACE?
<whitequark> yorickpeterse: y u using more
<whitequark> it's inconvenient as fuck
vlad_starkov has quit [Ping timeout: 264 seconds]
<yorickpeterse> ...
<yorickpeterse> it was a joke
<GarethAdams> more or less
lguardiola has joined #ruby-lang
<yorickpeterse> zing
mbj has quit [Quit: Lost terminal]
agile has quit [Remote host closed the connection]
maxmanders has quit [Quit: Computer has gone to sleep.]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
thebastl has quit [Remote host closed the connection]
fbernier has joined #ruby-lang
vlad_starkov has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
idkazuma has joined #ruby-lang
jvrmaia has joined #ruby-lang
fsvehla has quit [Read error: Connection reset by peer]
voker57 has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
idkazuma has quit [Ping timeout: 264 seconds]
GarethAdams|Work has joined #ruby-lang
GarethAdams has quit [Disconnected by services]
GarethAdams|Work is now known as GarethAdams
fsvehla has joined #ruby-lang
idkazuma has joined #ruby-lang
glebm has quit [Ping timeout: 246 seconds]
tarruda has joined #ruby-lang
glebm has joined #ruby-lang
skaczor has joined #ruby-lang
vlad_starkov has joined #ruby-lang
noop_ has joined #ruby-lang
mistym has quit [Remote host closed the connection]
runeb has joined #ruby-lang
runeb is now known as Guest38143
Guest38143 has quit [Read error: Connection reset by peer]
runeb_ has joined #ruby-lang
runeb_ is now known as runeb
glebm has quit [Ping timeout: 258 seconds]
dustint has joined #ruby-lang
ezkl has joined #ruby-lang
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
tarruda has quit [Quit: leaving]
postmodern has quit [Quit: Leaving]
glebm has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
fsvehla has quit [Read error: Connection reset by peer]
idkazuma has quit [Remote host closed the connection]
idkazuma has joined #ruby-lang
maxmanders has joined #ruby-lang
fsvehla has joined #ruby-lang
fsvehla has quit [Client Quit]
breakingthings has joined #ruby-lang
tarruda has joined #ruby-lang
idkazuma has quit [Ping timeout: 258 seconds]
banister`sleep has quit [Read error: Connection reset by peer]
tarruda has quit [Client Quit]
tarruda has joined #ruby-lang
<snafoo> would
<snafoo> phone = personal.scan(/<th class="pieIE">Phone:<\/th>\s*<td>(.*)<\/td>/) or nil
<snafoo> set phone to nil if a match wasnt found?
<judofyr> snafoo: scan always returns an array
tarruda has quit [Client Quit]
<judofyr> snafoo: if you want a single match you can String#[]: person[/<th class="pieIE">Phone:<\/th>\s*<td>(.*)<\/td>/, 1]
<snafoo> oh
<snafoo> ah :D
<judofyr> snafoo: see the documentation for String#[] :)
<judofyr> ri String#[]
<manveru> still on that?
<snafoo> im close to killing myself manveru T_T
<zzak> good morning!
<manveru> srsly?
barttenbrinke has joined #ruby-lang
<injekt> looks like you want a html parser
<injekt> yeah ima be that guy
Uranio has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
<injekt> so I'm attempting to code standing up today
<ericwood> Nokogiri or gtfo ;p
<zzak> hows that working for you?
<injekt> results so far: my back is killing me
<injekt> zzak: I have troubles with my back
<zzak> injekt: looks like you need a new back parser
<injekt> zzak: sitting nor standing helps, but at least I was used to sitting before
<ericwood> injekt: you have to get one of those padded mat things to cushion yourself
<injekt> hah
vlad_starkov has quit [Ping timeout: 260 seconds]
<injekt> ericwood: whilst standing up? oO
<zzak> yeah
<ericwood> yeah
<zzak> standing on solid ground is terrible for your back
<zzak> need padding under your feet
<ericwood> it's a regulation thing for jobs where you're standing all day
<injekt> I didn't even think of that
<zzak> even just a small piece of carpet
<zzak> anything to cushion the blow
<injekt> great idea, I'm standing on tiles right now
<ericwood> lol
<ericwood> welltheresyourproblem
<injekt> and I have no socks on
<injekt> learn to life injekt
glebm has quit [Ping timeout: 245 seconds]
<zzak> inkjet!
<injekt> lrn2lyfinkjet
tarruda has joined #ruby-lang
tarruda has quit [Client Quit]
<zzak> that's like my kitch, has linoleum tiles
<zzak> ontop of plywood floor i think lol
francisfish has joined #ruby-lang
<zzak> anyways, try doing the dishes for 15-20 minutes and your back is trashed
<injekt> I think I need a raised platform too, I think this is a little low for me :/
<injekt> hah nice
<ericwood> I wish my office had me up against a wall so I could try the whole standing desk thing
<ericwood> y'all are a buncha old people :P
<injekt> yeah that hurts my back too, the problem is I'm quite tall and my kitchen sideboard is kinda.. not
<zzak> i put a little 3x2 piece of carpet down and its much nicer
<zzak> injekt: yeah you dont want to hunch over
<injekt> I'm standing on a towel now and it's helped a lot already
<zzak> stand up straight
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
<injekt> zzak: yeah that's my worry, need to find something to prop this laptop up
glebm has joined #ruby-lang
<injekt> solved
<injekt> !
<injekt> baha
wmoxam has joined #ruby-lang
<yorickpeterse> in which Yorick discovers that ActiveRecord (somehow) hijacks Array#count and in turn doesn't work with non saved objects
<yorickpeterse> injekt: what the shit
<judofyr> yorickpeterse: assoiations returns Array proxies
<yorickpeterse> don't tell me you're coding in the bathroom
<yorickpeterse> judofyr: #class returns Array
sailias has joined #ruby-lang
<injekt> you keep your whisk in the bathroom?
<zzak> injekt: easy access to the fridge
<judofyr> yorickpeterse: with a method_missing that delegates to #to_a
<injekt> yorickpeterse: it's a proxy class, not an array
<injekt> zzak: :D
<ericwood> ActiveRecord is basically made of magic :|
<yorickpeterse> injekt: wat
<injekt> yorickpeterse: yup :(
<yorickpeterse> then why the fuck is the name "Array"
<zzak> yorickpeterse: its clearly the kitchen
<injekt> yorickpeterse: because fuck you
<yorickpeterse> who's bathroom is this anyway
<yorickpeterse> and why is there a towel on the floor in a place that makes no sense
<injekt> its my kitchen
<yorickpeterse> oh
<injekt> because learn 2 backlog
<ericwood> injekt: why the kitchen?
runeb has quit [Remote host closed the connection]
<yorickpeterse> injekt: learn to face
<zzak> so he can eat all the time
<injekt> ericwood: my tv is in the lounge
<injekt> and because of what zzak said
<ericwood> so work in the lounge!
<zzak> sounds comfy
<injekt> ^
<injekt> ericwood: also the kitchen worktop is high
<ericwood> like you
<injekt> quite
<ericwood> hence the need for quick access to snacks >.>
<ericwood> <.<
<injekt> I have nothing in the lounge tall enough
<injekt> :(
<yorickpeterse> what inkjet is trying to say is that he's too poor to buy a desk
<injekt> I haven't had a desk for a year
* yorickpeterse is guilty to coding in the bathroom himself
<injekt> yorickpeterse: toilet coding does not count
<yorickpeterse> why not? :<
<zzak> im going to build a fridgedesk
<yorickpeterse> it's quite productive actually
<zzak> omg
<ericwood> I'm going to build a keggerator desk
<zzak> theres a recent SNL skit about the bathroom desk
<zzak> ive gotta find it now
chrismar035 has joined #ruby-lang
<yorickpeterse> my bathroom is tiny, probably doesn't fit
<ericwood> part desk, part keggerator, all 100% bad idea
<injekt> a bathroom desk
<injekt> what in the
chrismar035 has quit [Client Quit]
<injekt> ok i dont know if being close to the fridge is really better than being close to the tv
<injekt> zzak: can't watch
<injekt> stupid 'murica
<injekt> stupid hulu
<ericwood> stupid hulu
<ericwood> the only site I know of where the paid version STILL shows you ads!
<injekt> haha
<injekt> apart from gmail
<yorickpeterse> hey, I have an idea
<yorickpeterse> lets compare bathrooms (like that one time we compared spoons and forks)
<yorickpeterse> clean ones that is
<injekt> um
<injekt> ok
<yorickpeterse> haha
glebm has quit [Ping timeout: 240 seconds]
TvL2386 has quit [Quit: Ex-Chat]
vlad_starkov has joined #ruby-lang
<yorickpeterse> ok fuck that, Facebook doesn't load my photos
mbj has joined #ruby-lang
<ericwood> I'd join in on these shenanigans, but I am at the office
<yorickpeterse> ericwood: take a photo of the office bathroom
<yorickpeterse> injekt: fuck you, you have an actual tub
<injekt> tbh I prefer my living room
glebm has joined #ruby-lang
<yorickpeterse> also wth, why does this photo load from the right to the left
<zzak> injekt: nice
<injekt> lol @ that being a bra on the chair
<injekt> oops
<ericwood> yorickpeterse: because he's british
<yorickpeterse> injekt: is it yours?
<injekt> um
cod3r has joined #ruby-lang
<injekt> only on weekends
<yorickpeterse> haha
vlad_sta_ has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
<injekt> im waiting for a nice time to execute those penguins too, my gf loves them
tarruda has joined #ruby-lang
voker57 has quit [Ping timeout: 258 seconds]
<yorickpeterse> get a cat, tell her the cat ripped them apart
<yorickpeterse> it's a win win: you get rid of the penguins *and* get a cat
<ericwood> or just adopt a dog
<ericwood> way better
<injekt> I dont like cats
<injekt> I'll get a dog when I move from here
<judofyr> or you can do yorickpeterse's trick, but with a hooker
<zzak> banned
<injekt> judofyr: :D
<injekt> zzak: meh they're ok I guess, but I find them boring, compared to dogs
<ericwood> dogs are just fun
<zzak> injekt: even my kitty bores you? :(
<injekt> zzak: your kitty is the HUGE one right?
<yorickpeterse> judofyr: I have a hooker?
<yorickpeterse> or had
vlad_sta_ has quit [Read error: Connection reset by peer]
<judofyr> yorickpeterse: huh? I was talking about your cat-trick, just s/cat/hooker/
<zzak> hes big
<yorickpeterse> oh
<yorickpeterse> I already have a cat
<injekt> zzak: he looks cool
<injekt> yorickpeterse: dude
<yorickpeterse> injekt: dudette
<injekt> yorickpeterse is very slow today
maxmanders has quit [Ping timeout: 256 seconds]
<yorickpeterse> I didn't use a hooker to get my cat :<
<zzak> injekt: gee thanks :/
<yorickpeterse> I adopted him together with my ex
<injekt> zzak: lol :D
<injekt> zzak: that's about as excited i get about cats
<injekt> zzak: but I do like huge cats, or asshole cats
<injekt> which I guess is most of them
<zzak> my kitty will rip your face off
<injekt> see that kind of cat I could like
thebastl has joined #ruby-lang
totallymike has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
thebastl has quit [Remote host closed the connection]
malev has joined #ruby-lang
lcdhoffman has joined #ruby-lang
<zzak> injekt: check your email
<yorickpeterse> hey gais
<yorickpeterse> apparently we're on this Twitter thing
<yorickpeterse> some lee jarvis Twittered about us
<injekt> whozat
<injekt> zzak: checking
<injekt> zzak: haha your cat is awesome
vlad_starkov has joined #ruby-lang
<zzak> haha
<judofyr> the mapping between IRC-, Twitter- and GitHub-nicknames always confuses me
<judofyr> and location
<ericwood> that's why I just use my real name for everything
<injekt> yeah inkjet was taken on twitter
<yorickpeterse> zzak: why does your cat not have a website?
<judofyr> that's why I use my fake name for everythign
<judofyr> inkjet?
<yorickpeterse> judofyr: yeah, but you're a famous Twitter hacker now
<injekt> judofru?
<injekt> fuck
<injekt> damn u being close to the y
<ericwood> Gorbypuff is the best cat
vlad_sta_ has joined #ruby-lang
<judofyr> judofur
<zzak> yorickpeterse: i made him one but he ate it
<zzak> judofyr: but you still dont follow me :(
* yorickpeterse is guilty to having a website for his cat and having it hooked up to an IRC bot
<judofyr> zzak: who are you again?
<injekt> wow
<judofyr> (on Twitter)
<injekt> judofyr: _zzak
<zzak> im that one
<injekt> I should have done _inkjet right
<injekt> instead of my real name which no one knows
<yorickpeterse> __injekt
<yorickpeterse> errr, __injekt__
<injekt> yorickpeterse: HERP DERP SHOULDNT THAT BE __INJEKT__
<yorickpeterse> errr, inkjet
<yorickpeterse> it's a Python spoof, not a Ruby one
<yorickpeterse> ok enough, back to work for me
<judofyr> zzak: hm... where are you located again? U.S. somewhere, right?
<zzak> vermont
glebm has quit [Ping timeout: 240 seconds]
<judofyr> vermont, yes, I knew that
<injekt> I should use the username I use for my website which I have github/twitter etc already for
<snafoo> Anyone know why the code at the top wont match against the text at the bottom? https://gist.github.com/anonymous/aa938df2688e63ad6305
vlad_starkov has quit [Ping timeout: 245 seconds]
carloslopes has joined #ruby-lang
<zzak> judofyr: <3
<judofyr> snafoo: try multi-line regex: /…/m
<injekt> snafoo: you need the /m
<injekt> blah
vlad_sta_ has quit [Read error: No route to host]
<injekt> slow trigger today
<injekt> i think it's all this standing up
swygue has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<zzak> all the blood is pooling at your toes
<injekt> I find myself leaning and putting more pressure on a single foot
glebm has joined #ruby-lang
<injekt> I dont think this posture is good
dustint has quit [Quit: Leaving]
mistym has quit [Remote host closed the connection]
dustint has joined #ruby-lang
<zzak> i once paired with someone who would code in bed
<zzak> they had a monitor arm next to their bed and would lay down to code
<injekt> haah I did that when I was like 14
<injekt> oh wow ok I didn't do that
<ericwood> screw that, it'll ruin your sleep
<ericwood> you have to separate bed from work...
<zzak> haha
<zzak> i think he slept at his desk
<injekt> :D
<zzak> i think im less productive when im comfortable
swygue has quit [Ping timeout: 276 seconds]
adambeynon has quit [Quit: Computer has gone to sleep.]
<injekt> I certainly am
<injekt> hence today :(
<snafoo> Hrm, now it's going to the last </tr>
barttenbrinke has joined #ruby-lang
<wnd> snafoo, having dealt with this just earlier today, also check your input doesn't have unexpected non-breakable spaces (e.g. \xc2\xa0)
dhruvasa1ar has quit [Ping timeout: 240 seconds]
<ericwood> is this HTML + regex?!
<injekt> ericwood: we've tried
<ericwood> :(
<wnd> what could possibly go wrong?-)
<injekt> snafoo: honestly,use a html parser
<injekt> it's for parsing html
<injekt> regexp is not
<ericwood> lol I beat you to it
<snafoo> This is the only field i need ;_; the last one lol
<injekt> im so slow today
<ericwood> but seriously, it's worth adding an extra dep
<yorickpeterse> "I know what I'll do, I'll use a regular expression for HTML!" - No sane person, ever
<ericwood> you can get so much weird non-standard markup
<wnd> just to cover my back, I use nokogiri but that doesn't help with nbsp when I want to massage Node#text
<ericwood> I know Word generates some *awesome* HTML
<ericwood> hmmm, yeah, whitespace and nokogiri don't go together well...
<ericwood> what's the task, again?
<ericwood> I was dealing with whitespace and nokogiri not long ago...
adambeynon has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
sduckett has joined #ruby-lang
malev has quit [Remote host closed the connection]
glebm has quit [Ping timeout: 260 seconds]
glebm has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
<injekt> who wrote eval-in?
tomzx_mac has joined #ruby-lang
<judofyr> injekt: charliesome
<gnufied> I thought whitequark has been maintaining it?
<gnufied> oh
<gnufied> I stand corrected!
outoftime has joined #ruby-lang
<judofyr> see the "Contact" link: http://eval.in/
<injekt> ah thought it was just the website charliesome wrote
<injekt> judofyr: right
<judofyr> also, it has Slash
<injekt> judofyr: I meant the bot itself
wyhaines has joined #ruby-lang
sduckett has quit [Ping timeout: 272 seconds]
<judofyr> injekt: ah, I think the bot is also Charliesome
<injekt> judofyr: ah ok thanks
<ericwood> I thought Charliesome is a robot
<gnufied> judofyr: surely you don't imply charliesome is a bot
<judofyr> gnufied: he's sitting there and copy-pasting every request
<judofyr> >> p :right_charlie
<eval-in> judofyr => :right_charlie ... (http://eval.in/17981)
<injekt> oh he's fast
<gnufied> written in node.js probably. *sigh*
<injekt> not if charlie wrote it
<judofyr> hm? the bot is cinch
<judofyr> whois it
<yorickpeterse> So a common thing I do in AR is something like the following: `SomeModel.select(:id).map(&:id)`. The problem is that this creates SomeModel instances only to throw them away again. Is there a more efficient way of doing this?
<gnufied> (I was kidding!)
Matip has joined #ruby-lang
<Matip> Hello guys
<yorickpeterse> (even though each instance only has an id attribute)
<gnufied> SomeModel.pluck
<injekt> yorickpeterse: pluck
<gnufied> yorickpeterse: &
<injekt> omg
<yorickpeterse> oh sweet
<yorickpeterse> ta
<Matip> is there a bitwise not operator?
<judofyr> ~
<Matip> like in 0b111100 == ¬0b000011
<Matip> no, ~ is ones complement, which is not the same
<judofyr> ah, right
<Matip> > 0b111100 == ~0b000011
<Matip> => false
<Matip> I can't believe ruby doesn't have a "not" bitwise operator O_O
<Matip> it's one of the most basic functions when you have to manipulate binary data
<gnufied> first stackoverflow result will help, but you are right
<gnufied> we use ruby for Web stuff.
<gnufied> :-)
<judofyr> Matip: what about 0b111111 - X?
<judofyr> err
<judofyr> xor
<injekt> zzak: I made it about 2 hours
<Matip> gnufied, there's no excuse to not have a not operator >_>
<Matip> ruby is not using "¬" symbol, it could have been the bitwise not!!
<gnufied> how would I type that?
<gnufied> I don't think that will fly
<gnufied> C as well does not have a bitwise NOT operator, IIRC
<gnufied> having said that, if you feel strongly about it. open a ticket for ruby-core.
<Mon_Ouie> Then again, Ruby doesn't ≠, ×, or λ either
<Matip> Mon_Ouie, what do you mean?
<Mon_Ouie> That Ruby doesn't use any non-ASCII character at all
wesside has joined #ruby-lang
<zzak> injekt: before buying a cat?
<injekt> zzak: :D
<ddfreyne> There's no bitwise operator not in Ruby? Weird, it never occurred to me
<ericwood> wat r bits?
<ericwood> r tey like strings?
io_syl has quit [Quit: Computer has gone to sleep.]
<ericwood> ;)
<ericwood> please don't hurt me
<Matip> ok, so how are we supposed to implement it?
<yorickpeterse> ericwood: yeah but they're webscale
<ericwood> noice
v0yager has quit [Ping timeout: 256 seconds]
thebastl has joined #ruby-lang
fragamus has joined #ruby-lang
v0yager has joined #ruby-lang
runeb has joined #ruby-lang
kgrz has joined #ruby-lang
<Mon_Ouie> How about judofyr's way? You do need to specify how many bits you want.
thebastl has quit [Remote host closed the connection]
spinky has joined #ruby-lang
glebm has quit [Ping timeout: 252 seconds]
runeb has quit [Ping timeout: 276 seconds]
rwk1 has quit [Remote host closed the connection]
<rippa> ddfreyne: ~
<rippa> oh, wait
rippa has left #ruby-lang ["Candleja~"]
glebm has joined #ruby-lang
face has quit [Ping timeout: 260 seconds]
runeb has joined #ruby-lang
face has joined #ruby-lang
maxmanders has joined #ruby-lang
robbyoconnor has joined #ruby-lang
GarethAdams|Work has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
MartynKeigher2 has quit [Quit: http://www.martynkeigher.com]
mbj_ has joined #ruby-lang
mbj has quit [Ping timeout: 264 seconds]
mbj_ is now known as mbj
GarethAdams has quit [Ping timeout: 248 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
MartynKeigher has joined #ruby-lang
ikrima has joined #ruby-lang
gnufied has joined #ruby-lang
<wnd> Obviously I don't understand standard streams well enough to really understand why this works the way it does: https://gist.github.com/wnd/79c9e8b4bb9d4d6482ff . Takes filename as argument, creates/overwrites it. Comment line 13 to see expected behaviour.
malev has joined #ruby-lang
ikrima has quit [Client Quit]
glebm has quit [Ping timeout: 256 seconds]
cod3r has quit [Ping timeout: 246 seconds]
glebm has joined #ruby-lang
rippa has joined #ruby-lang
<wnd> related to that, tell me it's a bad idea to PTY.spawn(foo){|out, err, pid| Process.kill(pid); Process.wait(pid)} instead of out, err, pid = PTY.spawn(foo) ...
io_syl has joined #ruby-lang
g0bl1n has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
<zzak> injekt: you use homebrew right?
glebm has quit [Ping timeout: 246 seconds]
kogent has quit [Quit: kogent]
lcdhoffman has quit [Quit: lcdhoffman]
<zzak> nvm i think i found it
kogent has joined #ruby-lang
<zzak> i didnt have homebrew bin and sbin in my path :/
glebm has joined #ruby-lang
wesside has quit [Quit: Ice cream truck!]
Axsuul has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
thebastl has joined #ruby-lang
rwk1 has joined #ruby-lang
thebastl has quit [Remote host closed the connection]
vlad_st__ has joined #ruby-lang
thebastl has joined #ruby-lang
vlad_starkov has quit [Read error: No route to host]
asunderland has joined #ruby-lang
glebm has quit [Ping timeout: 264 seconds]
tonni has quit [Remote host closed the connection]
vlad_sta_ has quit [Ping timeout: 264 seconds]
<injekt> zzak: I do
judofyr has quit [Remote host closed the connection]
<injekt> hah
<yorickpeterse> def self.delete_all; raise "Dont use delete_all"; end
<yorickpeterse> lol
tarruda has quit [Ping timeout: 264 seconds]
<yorickpeterse> (I found this Gem)
<zzak> injekt: still not building tho, i get permissions errors too
<zzak> and openssl and readline errors
cod3r has joined #ruby-lang
glebm has joined #ruby-lang
rwk1 has quit [Ping timeout: 258 seconds]
face has quit [Ping timeout: 240 seconds]
spinky has quit [Ping timeout: 245 seconds]
MaddinXx has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
<snafoo> rooar
<snafoo> does hpricot not support standard xpath or something -_______-
face has joined #ruby-lang
nXqd has quit [Ping timeout: 245 seconds]
runeb has quit [Remote host closed the connection]
nXqd has joined #ruby-lang
thebastl has quit [Remote host closed the connection]
GarethAdams has joined #ruby-lang
Matip has quit [Read error: Connection reset by peer]
benlovell has quit [Ping timeout: 246 seconds]
spinky has joined #ruby-lang
Matip has joined #ruby-lang
glebm has quit [Ping timeout: 240 seconds]
glebm has joined #ruby-lang
toretore is now known as Guest34542
barttenbrinke has joined #ruby-lang
GarethAdams|Work has quit [Ping timeout: 260 seconds]
nXqd has quit [Ping timeout: 264 seconds]
Quatrerwin has quit [Remote host closed the connection]
barttenbrinke has quit [Read error: Connection reset by peer]
nXqd has joined #ruby-lang
Guest34542 is now known as toretore
havenwood has joined #ruby-lang
Guedes has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
glebm has quit [Read error: Connection reset by peer]
dr_bob has quit [Quit: Leaving.]
glebm has joined #ruby-lang
DomKM has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
rwk1 has joined #ruby-lang
adambeynon has joined #ruby-lang
bzalasky has joined #ruby-lang
mistym has joined #ruby-lang
athaeryn has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<snafoo> hmmm
JohnBat26 has quit [Ping timeout: 256 seconds]
<snafoo> Anyone know why this xpath would only be recognizing up to the 6th tr
<snafoo> /*[@id="ctl00_PlaceHolderMain_Search_plnIndividualDetails"]/table/tbody/tr[8]/td
ndrst has quit [Ping timeout: 246 seconds]
<snafoo> like, it just stops seeing any tr after tr[6]
<snafoo> -___-
mixandgo has joined #ruby-lang
rwk1 has quit [Ping timeout: 264 seconds]
erpuds has joined #ruby-lang
<rippa> maybe html is borked?
<injekt> snafoo: you're using obsolete software, you can't expect ideal results
thebastl has joined #ruby-lang
<snafoo> Yeah, but it can't be _that_ obsolete can it?
glebm has quit [Ping timeout: 264 seconds]
glebm has joined #ruby-lang
<injekt> snafoo: who knows? the last release was jan 2012 and the library never hit version 1 anyway
<snafoo> sigh..
<snafoo> is there anyway to instal libxml2 on windows without admin access?
<snafoo> this is literally the last part i need to finish, driving me insane, regexp wont parse this part either for god knows why
<snafoo> -___-
thebastl has quit [Remote host closed the connection]
<injekt> I haven't used windows for about 5 years now, but I'm gonna guess no
bzalasky has quit [Remote host closed the connection]
glebm has quit [Ping timeout: 276 seconds]
skaczor has quit [Quit: leaving]
glebm has joined #ruby-lang
kogent has quit [Quit: kogent]
snarfmason has joined #ruby-lang
guiambros has quit [Ping timeout: 272 seconds]
<snafoo> wow
<snafoo> im retarded
<snafoo> so for some reason, when im reading the HTML, the 'business address' field isn't being pulled down
jovy88 has quit [Read error: Connection reset by peer]
<snafoo> Why on earth is that happening..
jovy88 has joined #ruby-lang
<manveru> maybe inserted by js?
justinram has joined #ruby-lang
<snafoo> dont think so
<snafoo> my first thought was maybe it was because i had no useragent or something, but.. nope
headius has joined #ruby-lang
g0bl1n has quit [Quit: g0bl1n]
<snafoo> holy crap
<snafoo> im so dumb
<snafoo> :(
tylersmith has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
fragamus has quit [Quit: Computer has gone to sleep.]
enebo has joined #ruby-lang
glebm has joined #ruby-lang
djwonk has quit [Quit: djwonk]
retro|cz has joined #ruby-lang
<zzak> ruby 2.1.0dev (2013-04-28 trunk 40515) [x86_64-darwin12.3.0]
<zzak> with working openssl, readline, and zlib
<zzak> but they aren't linked
<zzak> whatever, it still works i guess
swygue has joined #ruby-lang
swygue has quit [Read error: No route to host]
swygue has joined #ruby-lang
spinky has quit [Ping timeout: 255 seconds]
spinky has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
swygue has quit [Ping timeout: 260 seconds]
runeb has joined #ruby-lang
<snafoo> It's complete! Time to sleep!
snafoo has quit [Quit: Leaving]
enebo has quit [Read error: Connection reset by peer]
Squarepy has joined #ruby-lang
enebo has joined #ruby-lang
runeb has quit [Ping timeout: 256 seconds]
tonni has joined #ruby-lang
willw00 has joined #ruby-lang
setmeaway has quit [Ping timeout: 245 seconds]
srbaker has joined #ruby-lang
benlovell has joined #ruby-lang
wyhaines has quit [Read error: Connection reset by peer]
swav has quit [Remote host closed the connection]
wyhaines has joined #ruby-lang
dfdf has joined #ruby-lang
dc5ala has joined #ruby-lang
<dfdf> Greetings from peggy.torservers.net..
glebm has quit [Ping timeout: 258 seconds]
glebm has joined #ruby-lang
ikrima has joined #ruby-lang
mrsolo has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
glebm has quit [Ping timeout: 255 seconds]
glebm has joined #ruby-lang
erpuds has quit [Quit: erpuds]
ndrst has joined #ruby-lang
marr has joined #ruby-lang
marr has quit [Client Quit]
robbyoconnor has quit [Max SendQ exceeded]
robbyoconnor has joined #ruby-lang
emacs-usr has joined #ruby-lang
marr has joined #ruby-lang
jxpx777 has joined #ruby-lang
dr_bob has joined #ruby-lang
fragamus has joined #ruby-lang
pskosinski has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
rsl has quit [Read error: Operation timed out]
thebastl has joined #ruby-lang
marr has quit []
rsl has joined #ruby-lang
asunderland has quit [Ping timeout: 260 seconds]
beiter has quit [Quit: beiter]
<TheNotary> I love tor
glebm has quit [Ping timeout: 240 seconds]
<TheNotary> kinda slugish sometimes though
<TheNotary> =/
skade has joined #ruby-lang
cored has quit [Ping timeout: 264 seconds]
glebm has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
pcboy_ has quit [Quit: leaving]
pcboy_ has joined #ruby-lang
alessio_rocco has quit [Remote host closed the connection]
tarruda has joined #ruby-lang
dhruvasagar has joined #ruby-lang
workmad3 has joined #ruby-lang
drakkhen has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
glebm has quit [Ping timeout: 252 seconds]
beiter has joined #ruby-lang
blacktulip has joined #ruby-lang
glebm has joined #ruby-lang
jvrmaia has quit [Remote host closed the connection]
beiter has quit [Client Quit]
beiter has joined #ruby-lang
ahf has quit [Ping timeout: 258 seconds]
ahf has joined #ruby-lang
ahf has quit [Changing host]
ahf has joined #ruby-lang
calvinsbiz has joined #ruby-lang
erpuds has joined #ruby-lang
kogent has joined #ruby-lang
calvinsbiz has quit [Client Quit]
symm- has joined #ruby-lang
spinky has quit [Remote host closed the connection]
calvinsbiz has joined #ruby-lang
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Uranio has quit [Quit: while you reading this, a kitty dies]
dr_bob has quit [Quit: Leaving.]
wesside has joined #ruby-lang
xcombelle has joined #ruby-lang
Matip has quit [Quit: Leaving]
tbuehlmann has quit [Remote host closed the connection]
fragamus has quit [Quit: Computer has gone to sleep.]
brianpWins has joined #ruby-lang
randallagordon has quit [Ping timeout: 248 seconds]
calvinsbiz has quit [Quit: calvinsbiz]
calvinsbiz has joined #ruby-lang
randallagordon has joined #ruby-lang
calvinsbiz has quit [Client Quit]
spinky has joined #ruby-lang
asunderland has joined #ruby-lang
swygue has joined #ruby-lang
t_ has quit [Ping timeout: 252 seconds]
<andrewvos> yorickpeterse: haha nice
lele has quit [Ping timeout: 246 seconds]
willw00 has quit [Remote host closed the connection]
<spike|spiegel> is he talking to day? uughhh
glebm has quit [Ping timeout: 246 seconds]
spinky has quit [Ping timeout: 245 seconds]
dfdf has quit [Remote host closed the connection]
<ndrst> haha nice
<ndrst> anyone of you guys at the eurucamp 2013?
lele has joined #ruby-lang
<andrewvos> ndrst: stop copying me!
t_ has joined #ruby-lang
workmad3 has quit [Ping timeout: 264 seconds]
<ndrst> andrewvos: did I?
glebm has joined #ruby-lang
workmad3 has joined #ruby-lang
GarethAdams has quit [Quit: Leaving...]
skade has quit [Quit: Computer has gone to sleep.]
<andrewvos> Word for word you plagiariser
<ndrst> I need proof to feel guilty!
<andrewvos> Read up
<yorickpeterse> andrewvos: I'm sorry Mr Hammond but your statement does not exactly hold ground
<yorickpeterse> what proof have you that ndrst should be convicted of plagiarism and scumbaggery?
<ndrst> I guess just wild shots, cowboy style?
workmad3 has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby-lang
vlad_st__ has quit [Remote host closed the connection]
glebm has quit [Ping timeout: 256 seconds]
rolfb has joined #ruby-lang
glebm has joined #ruby-lang
marr has joined #ruby-lang
sandbags has joined #ruby-lang
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
joevandyk has joined #ruby-lang
<joevandyk> d = "04/28/13 11:00pm"; puts DateTime.strptime(d, "%m/%d/%y %h:%M%p") gives me an invalid date error.
<joevandyk> any ideas?
swav has joined #ruby-lang
<joevandyk> oh
<joevandyk> nm
tarruda has quit [Quit: leaving]
robbyoconnor has quit [Ping timeout: 252 seconds]
rwk1 has joined #ruby-lang
benlovell has quit [Ping timeout: 256 seconds]
mbj has quit [Ping timeout: 260 seconds]
<spike|spiegel> yeah :D get a rubber duck
rwk1 has quit [Ping timeout: 264 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
cored has quit [Ping timeout: 256 seconds]
xtristan has joined #ruby-lang
xtristan is now known as Guest45642
Guest45642 has quit [Client Quit]
dhruvasagar has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
jkline has joined #ruby-lang
<ndrst> so explain andrewvos!
barttenbrinke has joined #ruby-lang
emacs-usr has quit [Ping timeout: 256 seconds]
<yorickpeterse> I hereby declare andrewvos a scumbag. Court dismissed
divout has quit [Quit: Leaving.]
glebm has quit [Ping timeout: 260 seconds]
mbj has joined #ruby-lang
glebm has joined #ruby-lang
Karql has quit [Read error: Operation timed out]
ndrst has quit [Read error: Operation timed out]
ndrst has joined #ruby-lang
mucker has quit [Quit: leaving]
Aloysius1 has joined #ruby-lang
<Aloysius1> Hello! I'm building a server in Ruby to receive a URL-encoded POST and trying to figure out the simplest approach. I know I could use Rails or Sinatra but was wondering if there was anything simpler yet.
tarruda has joined #ruby-lang
<yorickpeterse> The lowest level you can go (without re-inventing everything) is raw Rack
<Aloysius1> Thank you. Don't really want "low" so much as "light", if you know what I mean.
<yorickpeterse> Sinatra is probably your best bet, it's more pleasant to work with than raw Rack
<Aloysius1> OK. Thank you very much.
<yorickpeterse> np
adambeynon has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
justinra_ has joined #ruby-lang
xcombelle has quit [Remote host closed the connection]
justinram has quit [Ping timeout: 260 seconds]
alessio_rocco has joined #ruby-lang
<cored> hi
<cored> I have a doubt
<cored> I'm getting a nil pointer exception on this code https://gist.github.com/cored/4b911a94fbbf6c1e7781
<cored> line 10
mucker has joined #ruby-lang
<injekt> cored: what's the actual exception?
sepp2k has quit [Ping timeout: 252 seconds]
<cored> test.rb:11:in `block (2 levels) in <main>': undefined method `+' for nil:NilClass (NoMethodError)
Squarepy has quit [Remote host closed the connection]
<yorickpeterse> cored: that's because #split() doesn't always return values
dhruvasagar has joined #ruby-lang
<cored> do you want to see the trace?
<cored> hm
<cored> got it
<yorickpeterse> if it doesn't match anything it returns `[]`. In a mass assignment that would mean the variables are also set to nil
<yorickpeterse> so bascially you get `start, finish = []` which translates to `start = nil; finish = nil`
<cored> I see
<yorickpeterse> interesting enough the error should then be for #to_i and friends
<injekt> that's why it should still work
<injekt> because nil.to_i is 0
<yorickpeterse> oh?
cmckni3 has joined #ruby-lang
<yorickpeterse> hm, TIL
<yorickpeterse> that's kinda...silly but ok
<spike|spiegel> use Integer
<spike|spiegel> Integer(nil) blow up your face
<yorickpeterse> ah yes, Ruby, where you have two different things (or more) to basically represent the same
tarruda has quit [Remote host closed the connection]
<injekt> you know doing an if in reduce is probably bad
<yorickpeterse> also not really sure why Integer is a method
<injekt> line 11 will return nil
<cored> injekt: ?
<cored> injekt: why is this bad?
<cored> injekt: as you can notice I just want to count all the palindromes in a given range
<injekt> reduce(x).class != x.class is bad imo
<injekt> right
<injekt> so you build a range, turn it into an array, build another array, then run reduce on it
<injekt> why complicate it?
barttenbrinke has quit [Remote host closed the connection]
<injekt> (start.to_i..finish.to_i).each { |x| count += 1 if x.is_palindrome? }
<cored> hm
<injekt> maybe im missing something here
<injekt> but your code just seems to be doing way too much for very little
<cored> I see
<cored> over complicated it's seems
<injekt> right
<injekt> KISS
<yorickpeterse> it should be an extraction, not an invention
<yorickpeterse> basecamp
* yorickpeterse runs
<injekt> <insert dhh quote here>
<cored> :-/
<cored> weird
<cored> is stil running
<injekt> huh?
<cored> yes
<cored> I switched the loop to use yours
<cored> still running
dc5ala has quit [Ping timeout: 252 seconds]
glebm has quit [Read error: Connection reset by peer]
<cored> test.rb:10:in `block (2 levels) in <main>': undefined method `+' for 235952..696834:Range (NoMethodError)
<cored> got new error
thebastl has quit [Remote host closed the connection]
thebastl has joined #ruby-lang
glebm has joined #ruby-lang
<injekt> cored: with what code?
alessio_rocco has quit [Ping timeout: 260 seconds]
mucker has quit [Quit: Lost terminal]
sumhelp has joined #ruby-lang
<cored> mine
<cored> wait
<injekt> that's not helpful
<cored> there you go
<cored> omit the assignment to count
<cored> I remove that
<injekt> what's in your seed.txt?
<cored> and that was the problem
<cored> the problem was the assignment I did not see it I saw it now
<cored> the script is running
vlad_starkov has joined #ruby-lang
<injekt> oh right yeah
<cored> I'm trying to get it running as fast as possible
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
<injekt> maybe you're using the wrong language
<cored> :-)
<cored> this is for educational purpose only
<cored> I saw a Pytohn version running in under a second
skade has joined #ruby-lang
lguardiola has quit [Read error: Connection reset by peer]
<injekt> make sure you use File.open('seed.txt') { |f| f.each_line do |line| ...
kgrz has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<injekt> File.readlines reads the entire file into memory and into an array
jovy88 has quit [Read error: Connection reset by peer]
rwk1 has joined #ruby-lang
<injekt> you also have n.to_s twice
<cored> I see
<injekt> the readlines wont make much difference if it's a small file, but it's always worth knowing
<injekt> what's the contents of your file?
jovy88 has joined #ruby-lang
rolfb has quit [Quit: Linkinus - http://linkinus.com]
kgrz has joined #ruby-lang
sumhelp has quit [Quit: Leaving]
lguardiola has joined #ruby-lang
ndrst has quit [Ping timeout: 264 seconds]
<injekt> cored: also you dont need to cast to an integer (really) so something like this would work: (start..finish).each { |x| count += 1 if x.reverse == x }
ndrst has joined #ruby-lang
rwk1 has quit [Ping timeout: 264 seconds]
glebm has quit [Ping timeout: 256 seconds]
skade has quit [Quit: Textual IRC Client: www.textualapp.com]
<cored> hm
intellitech has quit [Ping timeout: 258 seconds]
<cored> injekt: let me check
<cored> injekt: the file is kinda big, but the problem with it, I think are the range
srbaker has quit [Quit: Computer has gone to sleep.]
glebm has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
<injekt> I dont think you'll write it to be faster than that, unless anyone wants to chime in and surprise me
<cored> he
erpuds has quit [Quit: erpuds]
DomKM has quit [Quit: Leaving.]
<cored> I really don't know why is taking so long
<cored> I remove a bunch of lines from the file
<injekt> because ruby
yfeldblum has quit [Ping timeout: 245 seconds]
<injekt> again, can you paste the file contents?
s0ber_ has joined #ruby-lang
<cored> sure
<cored> wait
vlad_starkov has quit [Ping timeout: 245 seconds]
<cored> there you go
<injekt> woah those are some ranges
<injekt> you have that running in under a second in python? oO
<injekt> I think something is amiss there
s0ber has quit [Ping timeout: 248 seconds]
s0ber_ is now known as s0ber
<cored> injekt: I will show you the code
<cored> wait
<cored> there you go
<cored> that's the one under a second using PyPy
workmad3 has quit [Ping timeout: 260 seconds]
<cored> 2.89 using Python 2
<injekt> uh using pypy
<cored> still running with Ruby :-)
<cored> yes, with PyPy
<cored> we don't have an equivalent, on Ruby world, right?
<yorickpeterse> yes we do
<yorickpeterse> Rubinius
<cored> ok
<injekt> yeah runs in about 2 seconds in normal python
erpuds has joined #ruby-lang
<cored> I'm using Ruby 1.9.3
<cored> still running
<injekt> almost hit 3 minutes in Ruby 2.0
<yorickpeterse> mind you, Ruby isn't really the best language when dealing with calculations like these
<injekt> something must be wrong though, I wouldn't usually use ruby for this but being this much slower than python? wut
<cored> yorickpeterse: oh, yes I know this is just an experiment
<cored> yes
<yorickpeterse> Probably a bit of a chicken-egg problem: Ruby isn't optimized for it because nobody uses it for it, but nobody uses it for it becaues it isn't optimized
<injekt> maybe ~100% slower
<yorickpeterse> also MRI
<yorickpeterse> http://www.reddit.com/r/ruby/comments/1ctab6/ruby_is_too_slow_for_programming_competitions/c9k74c3 shows a difference between MRI and Rbx for a similar contest
willw00 has joined #ruby-lang
<injekt> meh I killed my ruby one
<yorickpeterse> Should write it in Go
<yorickpeterse> basecamp
* yorickpeterse runs again
srbaker has joined #ruby-lang
<injekt> i have it in go too
<yorickpeterse> From now on I'll end every sentence with the word Basecamp.
<cored> I'm running it with rbx now
<injekt> cored: you should write actual equivalent code in both languages and then discuss
<cored> but I just hit ctrl+c with 1.9.3
<injekt> because that code isn't equivalent
<cored> hm
beiter has quit [Quit: beiter]
<cored> I wasn't the one that did the other code
<injekt> worryingly I can't speed up the ruby one, but I can speed up the python one a lot
<cored> but yes, you probably right, there is another Python version which is slower than the one I show you
<cored> you can speed up the Python one
<injekt> no im saying the python one is even faster than you think
<cored> more ?
<injekt> yes
<injekt> the code is not optimized
intellitech has joined #ruby-lang
intellitech has joined #ruby-lang
intellitech has quit [Changing host]
<cored> and why is that?
<cored> oh I see
<injekt> do you write python?
<cored> not really
<cored> I have minial experience with it
intellitech_ has joined #ruby-lang
intellitech_ has joined #ruby-lang
intellitech_ has quit [Changing host]
intellitech has quit [Read error: Connection reset by peer]
intellitech_ is now known as intellitech
vlad_sta_ has quit [Remote host closed the connection]
glebm has quit [Ping timeout: 268 seconds]
vlad_starkov has joined #ruby-lang
yfeldblum has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
glebm has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 245 seconds]
intellitech has quit [Quit: intellitech]
DomKM has joined #ruby-lang
<injekt> yeah it's certainly not doing the same thing
intellitech has joined #ruby-lang
intellitech has quit [Changing host]
intellitech has joined #ruby-lang
<injekt> takes 17 seconds in perl
g0bl1n has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
ndrst has quit [Ping timeout: 246 seconds]
ndrst has joined #ruby-lang
<whitequark> yorickpeterse: ruby isn't optimized for calculations because it's next to impossible to optimize it for calculations
<whitequark> thing #0 you do if you wanna use your language as a (predictable) calculator: make it statically typed.
<whitequark> after that it would still be somewhat slow but it can be helped
lcdhoffman has joined #ruby-lang
<injekt> whitequark: can you see any perf improvements I could make to my code? funnily enough whilst I know ruby will be an order of magnitude slower than most languages, if perl does it in ~17 seconds, I'd expect ruby to do it inl ess than 5 minutes
<chris2> i read "make is" and was really confused :)
<whitequark> injekt: repost the link please
<yorickpeterse> whitequark: that would hold true if it wasn't for Python being a lot faster
<whitequark> yorickpeterse: hm... I think I have mistaken the context
<injekt> whitequark: this was my answer to cored's problem https://gist.github.com/injekt/9dd892ae82d82041092f
<yorickpeterse> ah
carloslopes has quit [Remote host closed the connection]
<yorickpeterse> same holds true there, I believe Python was also faster
thebastl has quit [Remote host closed the connection]
<cored> injekt: for soem weird reason, your version is still running
<injekt> whitequark: same code in python supposedly ran in less than 2 seconds (but I dont think it's the same code), same code in perl (i just wrote it) runs in 17 seconds
<injekt> whitequark: I killed the ruby process at about 5 minutes
<cored> injekt: if you used the seed file I sent you, then you will notice that all the lines ends with \n
<whitequark> injekt: input data?
<cored> does this still applies, (start..finish) without doing the casting to number?
<injekt> cored: that's fine
<chris2> but slower
emacs-usr has joined #ruby-lang
<cored> injekt: with ("1".."2\n")
<chris2> hmm. maybe not.
<cored> does that work?
<injekt> cored: can you post the input file for whitequark
<whitequark> injekt: and same code in python/perl.
<cored> injekt: wait
<injekt> whitequark: the python code isn't the same but I dont want to rewrite it because I cant stand python
<cored> there you go
<whitequark> injekt: show me so I can compare the underlying operations
benanne has joined #ruby-lang
<injekt> whitequark: cored posted this as a python version https://gist.github.com/hminaya/5481553
rippa has quit [Ping timeout: 240 seconds]
ikrima has quit [Ping timeout: 252 seconds]
<injekt> I just deleted the perl version but it was something like https://gist.github.com/injekt/7409179f92646cb6d40d
<whitequark> injekt: you understand that your ruby code is doing a completely different thing than the python one right
<injekt> whitequark: yes, see me above comments about the python one
<injekt> like I said, it's not the same
<whitequark> it has *different semantics*
<injekt> whitequark: cored got the python code from somewhere else
emacs-usr has quit [Ping timeout: 245 seconds]
<injekt> right
<injekt> but the perl version should be the same
<whitequark> dumb ruby version finished in 55s for me
<injekt> oO
<injekt> I killed it at 5 minutes
<whitequark> python at 1.4s, interesting
<whitequark> injekt: not yours, yours is bullshit
<injekt> whitequark: what dumb ruby version?
<cored> injekt: that's why this is weird, this version
<injekt> whitequark: 1 minute has almost passed
glebm has quit [Ping timeout: 256 seconds]
<injekt> whitequark: this does the exact same thing as my version before I altered it and moved to integer casting
<injekt> so it's no different...
<cored> I don't get why same version take so long
<whitequark> wat?
<cored> in my machine and also injekt's
<whitequark> there is no integer casting here
<whitequark> there is integer casting in my version
<cored> whitequark: I have the integer casting in my version
<injekt> whitequark: right that's what I'm saying, the gist before that had integer casting
<injekt> whitequark: that is, I have both, and the integer one is hitting 2 minutes now
<cored> that's the version I have
robbyoconnor has joined #ruby-lang
glebm has joined #ruby-lang
forrest has joined #ruby-lang
<whitequark> wait
<whitequark> while hi >= lo
<whitequark> well, the answer is simple
<injekt> that could work
<cored> whitequark: ?
<whitequark> the algorithm in python version is different and performs way less work
<whitequark> *of course* it's faster
<cored> what happen with the while hi >= lo
vlad_starkov has joined #ruby-lang
mbj_ has joined #ruby-lang
<injekt> whitequark: sure but that's still blazing fast
glebm has quit [Read error: Connection reset by peer]
mbj has quit [Ping timeout: 245 seconds]
sepp2k has joined #ruby-lang
vlad_sta_ has quit [Ping timeout: 264 seconds]
<cored> it took 1 minute and 40 seconds with rbx
mixandgo has quit [Quit: mixandgo]
<whitequark> injekt: what?
<whitequark> don't performing work is obviously faster than performing it. the algorithm is vastly different. check by yourself if you don't believe
<whitequark> oh yes, you'd need to actually read the python source ;)
<injekt> whitequark: uh..
<injekt> I read the python source, I'm not disagreeing with you, I'm saying it's fast and that it's still way faster than ruby would be given the same algorithm
glebm has joined #ruby-lang
<bougyman> hrm.
<whitequark> injekt: did you actually implement the same algorithm as in python in ruby?
<bougyman> i know I've done this before, but I'm having a brainfart.
<bougyman> how to get the owner of a file or directory as username, not uid.
<bougyman> File.stat gives uid
<whitequark> bougyman: require 'etc'
maxmanders has joined #ruby-lang
<whitequark> it's there. somewhere inside
<bougyman> whitequark: YES, i remember now.
<bougyman> thanks for the kick in the noggin
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<injekt> whitequark: nope, that's why I said "it's still way faster than ruby would be" rather than "it's still way faster than ruby is"
<injekt> it's an assumption, but I'll take my chances on it being fairly accurate
<whitequark> injekt: then your claim does not have a base
<whitequark> I see no reason for it to be true
<injekt> sure it has a base
Mon_Ouie has quit [Read error: Operation timed out]
<injekt> ruby is slower than python as these kind of things (usually). Again, it's an assumption, that's enough for me. If this was a problem I was trying to solve I would put more time and effort into it
<yorickpeterse> gimme a few minutes and I'll port the python code 1:1
<whitequark> yorickpeterse: please do
sailias has quit [Ping timeout: 256 seconds]
<yorickpeterse> heh, Python's reverse syntax looks ugly
<yorickpeterse> [::-1]
<whitequark> also ugh global functions ;(
voker57 has quit [Ping timeout: 256 seconds]
<whitequark> they fixed that in p3 somewhat I heard
<injekt> they did?
<injekt> I thought they just moved some keywords for functions
<whitequark> injekt: I'm not exactly a python guy you know
<injekt> I don't write it anymore, I wrote a lot a few years ago
<yorickpeterse> what the hell: max(...herp derp...)[1]
<yorickpeterse> oh wait, it's pushing an array
<injekt> yorickpeterse: yeah I thought it was doing a min/max on the flattened range and only calculating that at first
<yorickpeterse> what was the Ruby equilivant of `if __file__ == 'main'` again?
<yorickpeterse> err, __name__
<yorickpeterse> __lol__
<injekt> if $0 == __FILE__
<yorickpeterse> ta
<yorickpeterse> i for r in ranges for i in r
<yorickpeterse> who the fuck writes that shit
<injekt> because map
<injekt> oh flatten
<injekt> hahaha
<yorickpeterse> how the fuck do I read that, (i for (r in ranges for (i in r))) ?
mixandgo has joined #ruby-lang
mixandgo has quit [Client Quit]
<injekt> you dont read it
<yorickpeterse> don't see why you need it anyway, my "ranges" is already flat
<yorickpeterse> oh derp, again it's pushing arrays
<yorickpeterse> fucking in-efficient as hell
<injekt> :)
<yorickpeterse> why the hell is it doing that, jesus
<yorickpeterse> Feels like somebody was like "HERP DERP SINGLE LINE ENUMERABLES"
<whitequark> rofl
<yorickpeterse> but ugh, I'll copy it for the sake of 1:1
<yorickpeterse> wtf
<yorickpeterse> it uses a double enumerable variable pair (or whatever you call them) for something that only has single pair values
retro|cz has quit [Ping timeout: 260 seconds]
<yorickpeterse> unless I"m again misreading it (more likely)
<yorickpeterse> * I'm
<cored> hahaha
<whitequark> python.
<yorickpeterse> oh what the fuck, Python apparently does some magic (I think) that when you do this:
<yorickpeterse> [int(i) for i in line.split()]
<yorickpeterse> it will basically do this:
<yorickpeterse> [split_value_1, split_value_2]
<yorickpeterse> at least based on the output
<whitequark> wat
<whitequark> it's ruby's line.split.map(&:to_i)
<yorickpeterse> oh right, in that case I had my variable in the wrong place
<yorickpeterse> (one block too deep)
<cored> this Ruby version run's in 1:06 minutes
joshH6 has joined #ruby-lang
<injekt> uh
benanne has quit [Quit: kbai]
<injekt> you dont want reduce for this
<cored> why not?
joshH6 has quit [Read error: Connection reset by peer]
<yorickpeterse> sow
<yorickpeterse> * slow
<injekt> :/ @ file.reduce
joshH6 has joined #ruby-lang
<injekt> I see a hanging file descriptor :D
<cored> ok
<cored> injekt: hehe :-)
joshH6 has quit [Read error: Connection reset by peer]
lcdhoffman has quit [Quit: lcdhoffman]
swygue has quit [Ping timeout: 268 seconds]
spuk has quit [Remote host closed the connection]
joshH6 has joined #ruby-lang
joshH6 has quit [Read error: Connection reset by peer]
joshH6 has joined #ruby-lang
<yorickpeterse> there we go
joshH7 has joined #ruby-lang
<yorickpeterse> 2.17 seconds
<yorickpeterse> suck it
voker57 has joined #ruby-lang
<whitequark> injekt: ^ not "way slower"
swygue has joined #ruby-lang
<cored> yorickpeterse: Ruby?
<whitequark> yorickpeterse: how long for python version on your machine?
<yorickpeterse> cored: yes
<injekt> whitequark: um what? the ruby version is +1 minute for me
<cored> yorickpeterse: cool
<whitequark> injekt: the ACTUAL ruby version, yorickpeterse's one
joshH8 has joined #ruby-lang
<yorickpeterse> whitequark: Python 2 does it in 1.4
<yorickpeterse> python 3 complains about syntax errors
<injekt> oh ruby = 2.17 python = 1.4?
<injekt> not bad
<yorickpeterse> let me gist this
<injekt> that surprises me
<whitequark> yorickpeterse: can you also remove the nested array shit?
joshH8 has quit [Read error: Connection reset by peer]
<whitequark> I wonder how much that wins you
joshH8 has joined #ruby-lang
fosky has joined #ruby-lang
<yorickpeterse> whitequark: yeah that's next
joshH6 has quit [Ping timeout: 256 seconds]
joshH8 has quit [Read error: Connection reset by peer]
havenwood has quit [Remote host closed the connection]
<yorickpeterse> tried to keep it as close to the Python pos
blacktulip has quit [Remote host closed the connection]
<yorickpeterse> output also is the same as far as I can tell
joshH8 has joined #ruby-lang
joshH7 has quit [Ping timeout: 256 seconds]
<whitequark> diff it!
<injekt> that doesn't do the same thing as the original ruby one though does it? that was my original question, that the ruby one had the correct results, the python one did something 'different'
maxmanders has quit [Ping timeout: 252 seconds]
<yorickpeterse> Ruby 2 does it in about the same time
sebasoga has joined #ruby-lang
retro|cz has joined #ruby-lang
<yorickpeterse> injekt: No idea, but it does do the exact same as the Python code
<injekt> yorickpeterse: yeah, nice work
glebm has quit [Ping timeout: 248 seconds]
<yorickpeterse> time to refactor this cunt
<injekt> I'd like to port the original ruby one 1:1 to python
joshH8 has quit [Read error: Connection reset by peer]
joshH8 has joined #ruby-lang
<injekt> because if that does the exact same thing as the original ruby one, that shit is f'ing crazy
TheNotary has quit [Remote host closed the connection]
<injekt> being over 1 minute quicker with like 300% more code more loops and more objects
joshH8 has quit [Read error: Connection reset by peer]
glebm has joined #ruby-lang
joshH8 has joined #ruby-lang
wmoxam has quit [Ping timeout: 268 seconds]
willw00 has quit [Remote host closed the connection]
joshH8 has quit [Read error: Connection reset by peer]
joshH8 has joined #ruby-lang
sebasoga has quit [Remote host closed the connection]
sebasoga has joined #ruby-lang
r0bgleeson has quit [Ping timeout: 252 seconds]
<cored> I don't see the need for the closet_higher
joshH9 has joined #ruby-lang
joshH9 has quit [Read error: Connection reset by peer]
<whitequark> injekt: I'm not sure if you're drunk or just trolling us
<yorickpeterse> the fuck does it even do
joshH9 has joined #ruby-lang
<yorickpeterse> like, my semi-useless-coding-competition-skills are next to worthless but this is a whole new level
<cored> yorickpeterse: probably the guy who wrote it, is a genius
<yorickpeterse> heh, I wonder if I can speed things up by buffering console output
<yorickpeterse> MICRO OPTIMIZATIONS GO
<manveru> no :P
<manveru> there is almost no output anyway
joshH10 has joined #ruby-lang
<yorickpeterse> hm no, doesn't seem to make a difference other than making Tmux a bit happier
joshH8 has quit [Ping timeout: 256 seconds]
joshH10 has quit [Read error: Connection reset by peer]
sebasoga has quit [Ping timeout: 264 seconds]
joshH10 has joined #ruby-lang
<yorickpeterse> so in closest_higher there's this:
sebasoga has joined #ruby-lang
<yorickpeterse> if (target - value) < 0
<yorickpeterse> isn't that basically the same as `if value > target`?
<yorickpeterse> hm, lets see
mbj_ has quit [Ping timeout: 264 seconds]
joshH11 has joined #ruby-lang
<manveru> i'd say so...
ikrima has joined #ruby-lang
joshH9 has quit [Ping timeout: 256 seconds]
<yorickpeterse> seems to be the case based on the output
<cored> yorickpeterse: exactly the same
joshH11 has quit [Read error: Connection reset by peer]
<cored> yorickpeterse: don't know why this guy did all this, really
<manveru> still no idea what the closests stuff is
<yorickpeterse> probably not an actual Python programmer
<cored> yorickpeterse: he works a web dev for a Python firm :-)
<yorickpeterse> manveru: apparently takes the next closest value...I think
joshH11 has joined #ruby-lang
<cored> yorickpeterse: and he have like 2 and a half years working there
<yorickpeterse> cored: then I feel sorry for his co-workers
<cored> yorickpeterse: :-)
<injekt> whitequark: :-)
<yorickpeterse> the day a co-worker of mine writes this is the day I get a donkey hat and make them wear it
<cored> yorickpeterse: the funny thing about this, is that he implements the fastest implementation for this problem
<yorickpeterse> pretty sure you can do it faster
<manveru> i wish i undestood the problem :P
<yorickpeterse> Removing the need of Arrays/Tuples can save you some time probably, or at least memory
<cored> yorickpeterse: there are version in PHP/Javascript/Ruby and I think there's one in Java and the guy who is writting this serie of educational thing for a developers group is saying that the Python version is the fastest
<yorickpeterse> manveru: idea is to turn 10 into 01 and check if it's the same
<yorickpeterse> so a numeric palindrome
<whitequark> did he warm up the JVM?
<whitequark> I'm sure he didn.t
<yorickpeterse> fuck the JVM, use Go
<whitequark> yorickpeterse: fuck you.
joshH11 has quit [Read error: Connection reset by peer]
<yorickpeterse> hahaha
<cored> whitequark: warn up?
<injekt> use go ON the JVM!
<yorickpeterse> or maybe ~Rust
joshH10 has quit [Ping timeout: 256 seconds]
<manveru> well, i know palindromes, just not why this is all so complicated
<whitequark> cored: JVM has adaptive optimization
<cored> whitequark: interesting
<yorickpeterse> cored: put it this way, looking at the file, what's the idea of it?
<whitequark> cored: basically it observes how your code runs and then compiles it with that profiling info
<cored> whitequark: did not know that
<yorickpeterse> cored: do you just compare the stuff on the same line?
joshH11 has joined #ruby-lang
<whitequark> cored: so you need to run the loop, like, 20k times and THEN measure the perf
sebasoga has quit [Ping timeout: 252 seconds]
<cored> yorickpeterse: you mean the problem?
joshH11 has quit [Read error: Connection reset by peer]
<whitequark> JVM is optimized for very long-running processes... there's a reason it's a server tech
<manveru> because sun wanted to sell servers?
<cored> whitequark: interesting
<manveru> and their plugin never warmed up fast enough :P
joshH11 has joined #ruby-lang
sebasoga has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 245 seconds]
<yorickpeterse> aha
glebm has quit [Read error: Connection reset by peer]
<yorickpeterse> So closest_higher finds the next higher value that's the closest to it
<yorickpeterse> fuck this shit, I'll use a sort for that
<yorickpeterse> cored: yeah
<whitequark> surprisingly
<cored> yorickpeterse: yes, basically
<cored> yorickpeterse: I don't know how is this implementation better than the one injekt wrote
joshH12 has joined #ruby-lang
<cored> yorickpeterse: this code looks ugly and my Python is very basic
<injekt> they are completely different
<cored> injekt: yours and his?
<injekt> cored: yes
joshH12 has quit [Read error: Connection reset by peer]
fn_ has joined #ruby-lang
joshH12 has joined #ruby-lang
<yorickpeterse> hahahaha, my version of closest_higher is so much better
<yorickpeterse> not sure if it's actually faster though
joshH12 has quit [Read error: Connection reset by peer]
<yorickpeterse> http://pastie.org/7739915 this at least makes some sense
<injekt> im confused with what this does in comparison to the original, its so much more complicated
* yorickpeterse feels smug about himself
joshH12 has joined #ruby-lang
<yorickpeterse> oh shit wait, this doesn't work if there are even higher values but with a different range
<yorickpeterse> hmpf
sebasoga has quit [Ping timeout: 272 seconds]
joshH12 has quit [Read error: Connection reset by peer]
joshH11 has quit [Ping timeout: 256 seconds]
symm- has quit [Ping timeout: 276 seconds]
breakingthings has quit []
joshH12 has joined #ruby-lang
glebm has joined #ruby-lang
sebasoga has joined #ruby-lang
joshH12 has quit [Read error: Connection reset by peer]
joshH12 has joined #ruby-lang
<injekt> time to sleep away my troubles
sebasoga has quit [Read error: Connection reset by peer]
joshH12 has quit [Read error: Connection reset by peer]
rwk1 has joined #ruby-lang
sebasoga has joined #ruby-lang
joshH12 has joined #ruby-lang
glebm_ has joined #ruby-lang
joshH12 has quit [Read error: Connection reset by peer]
thone_ has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
joshH12 has joined #ruby-lang
ikrima has quit [Ping timeout: 256 seconds]
sebasoga has joined #ruby-lang
robbyoconnor has joined #ruby-lang
<cored> the guy who started with this questions wrote this version in Ruby https://gist.github.com/hminaya/5482289
glebm has quit [Ping timeout: 264 seconds]
<cored> he saids it's runs in 38 seconds in jRuby and in 50 seconds in Ruby 2.0
ikrima has joined #ruby-lang
<injekt> yes that one does what my original code does
<yorickpeterse> "muestra" wtf
rwk1 has quit [Ping timeout: 260 seconds]
thone has quit [Ping timeout: 272 seconds]
<injekt> except with a while instead of range
<yorickpeterse> also, that code looks vastly different in what it does
fn_ has quit [Remote host closed the connection]
<yorickpeterse> wait
<injekt> yorickpeterse: that was my point
<yorickpeterse> cored: is the task only to count palindromes?
<injekt> dude :(
<yorickpeterse> Because if so then this Python code is fucking over the top
<cored> yorickpeterse: yes
<yorickpeterse> ...
<cored> yorickpeterse: you have a file
<yorickpeterse> JESUS
<injekt> uh
<cored> wait
<injekt> finallu
<injekt> finally*
<injekt> now i can sleep better
<cored> you have a file which two numbers '11111 111111' in each line you have to take that line and in that range find and count all the palindromes
<yorickpeterse> injekt: start by turning off your computer
<cored> injekt: ?
<cored> yorickpeterse: that's the entire problem
sebasoga has quit [Ping timeout: 272 seconds]
<injekt> cored: ive spent the last hour trying to explain what yorickpeterse has just noticed
<cored> injekt: :-)
<yorickpeterse> cored: Ah, so basically `if left == right.reverse; count += 1; end`?
<injekt> yorickpeterse: phone :D
<cored> yes
<yorickpeterse> srsly
<cored> hm
<cored> no wait
sebasoga has joined #ruby-lang
<yorickpeterse> just link me to the darn page of it
<injekt> no
<cored> left..right).each { count }
<yorickpeterse> I AR CONFUS
<yorickpeterse> basecamp
<injekt> range left to right, count palindromes
yorickpeterse is now known as yorick-basecamp
<yorick-basecamp> better
<injekt> turbolinks
<cored> yorick-basecamp: what?
forrest has quit [Quit: Leaving]
<cored> why basecamp
yorick-basecamp is now known as basecamp-turboli
<cored> ?
<basecamp-turboli> damn it
<cored> :-/
* cored hopes this is an internal joke
<basecamp-turboli> cored: Rails conf talk by dhh, he kept mentioning Basecamp
<injekt> sounds like an italian dish
basecamp-turboli is now known as yorickpeterse
<cored> basecamp-turboli: oh ok :-)
<yorickpeterse> injekt: hahaha
<cored> hehehe
<injekt> eat them turbolis
<cored> well he is a very good sales man
<yorickpeterse> so yeah, link to challenge plox
<injekt> real talk, sleep. Good night
<yorickpeterse> injekt: basecamp
<injekt> yorickpeterse: turbo russion doll basecamp cache
<andrewvos> basecamp?
<yorickpeterse> injekt: concerns
glebm_ has quit [Ping timeout: 260 seconds]
sebasoga_ has joined #ruby-lang
sebasoga has quit [Ping timeout: 256 seconds]
pskosinski has quit [Remote host closed the connection]
sebasoga_ has quit [Read error: Connection reset by peer]
erikh has joined #ruby-lang
<yorickpeterse> cored: still waiting for the link
<cored> yorickpeterse: there's none
<erikh> hello friends, I just want to download a file with a ruby library that does not have a C extension. any recommendations?
pskosinski has joined #ruby-lang
sebasoga has joined #ruby-lang
glebm has joined #ruby-lang
<cored> yorickpeterse: I mean this is a problem from an spanish blog, I can give you the site if you like
<erikh> rest-client doesn't seem to have this functionality, and I don't really look forward to doing the Net::HTTP dance
<cored> yorickpeterse: is that ok?
<andrewvos> erikh: HTTParty?
<andrewvos> erikh: (Oh and HELLO!)
<erikh> andrewvos: that uses curl doens't it?
<erikh> also hi :)
<andrewvos> erikh: It uses Net::HTTP
<yorickpeterse> cored: I can't read Spanish. In that case, which value on the line is the palindrome?
<yorickpeterse> Left or right?
mistym has quit [Remote host closed the connection]
<erikh> andrewvos: ok, i'm peeking
<andrewvos> Long time no see erikh you alight?
<andrewvos> alright*
<erikh> eh, times have been better but yeah, mostly
<erikh> you?
<andrewvos> erikh: Yeah not bad :)
<erikh> great!
<andrewvos> erikh: Did you ever quit smoking?
<erikh> nope
<erikh> hah
<erikh> I've tried to quit smoking at least 15 times
<andrewvos> Oh well :(
<andrewvos> I'm smoking the electronic things only now
<erikh> yeah, I'll try again soon
<erikh> nice dude
<cored> yorickpeterse: I can show you code so you will know exactly what does the program should do
<andrewvos> It has worked out okay
<yorickpeterse> cored: if it's not retarded code, sure
<cored> yorickpeterse: you have to check and count the palindrome in the range between left..right
<erikh> well, they're a lot better for you,t hat's for sure.
<cored> yorickpeterse: :-)
<cored> yorickpeterse: If it's retarded just let me know, that's a good way for me to learn
<yorickpeterse> ooh right
<yorickpeterse> I thought you had to literally compare left to right
<andrewvos> erikh: Yeah, just need to quit them now too
malev has quit [Ping timeout: 258 seconds]
glebm has quit [Read error: Connection reset by peer]
swygue has quit [Ping timeout: 260 seconds]
<yorickpeterse> I should've paid more attention during math in high school
<yorickpeterse> instead of trying to h4x0r my calculator or drawing stuff
<cored> yorickpeterse: what for?
<zenspider> brute force? that's... wrong
<yorickpeterse> for stuff like this
<whitequark> yorickpeterse: not that it'd help you
<andrewvos> cored: You doing Project Euler?
<yorickpeterse> whitequark: it would give a bit better idea of how to abuse the various operators and such for this
<erikh> andrewvos: do you know where tthere are any docs for this thing?
<yorickpeterse> I'm seeing some examples using the modulo operator for this
<erikh> even the "linked" documentation is not really documentation
<andrewvos> erikh: For HTTParty? Hmmm, not sure
<whitequark> erikh: just use Net::HTTP
<whitequark> it's not that hard, honestly
<erikh> whitequark: I don't want to do the dance where I have to do a bunch of stream reading to copy a file
<erikh> and handle all the errant HTTP bullshit
<erikh> Which Net::HTTP has no problem making your problem
<cored> andrewvos: nop
<erikh> andrewvos: that's goign to buffer the whole thing in ram
<erikh> my file is half a gig
<cored> yorickpeterse: I don't think this is a mth problem
<andrewvos> erikh: Oh shit
<erikh> right
<andrewvos> erikh: Why not curl then?
<whitequark> erikh: oh, streaming... right, net::http doesn't make that convenient
<andrewvos> Probably some eventmachiney thing :(
<erikh> exactly
<andrewvos> erikh: ^
glebm has joined #ruby-lang
<erikh> yeah, I was hoping to avoid EM because of the C needs
<yorickpeterse> cored: partially it is, at least when not going down the route of String#reverse
<erikh> this is going to have to be jruby-capable
<erikh> I could write something, but shit, I figured someone had solved this already
<cored> yorickpeterse: let me try it to see if it's faster
<andrewvos> cored: Are you trying to make that code faster?
<zenspider> anyone here know how to run the rails tests and force it to only use sqlite3?
<yorickpeterse> zenspider: in a Rails app or an engine?
<zenspider> in rails itself
<yorickpeterse> in both cases it depends on the database.yml, but in an engine you'll find it in spec/dummy/config or test/dummy/config
<zenspider> I'm testing rails against minitest5
<yorickpeterse> define a group called "test" in it
<yorickpeterse> (similar to development, etc)
<yorickpeterse> adapter should be sqlite3 I believe
<cored> andrewvos: yes
<yorickpeterse> cored: the amount of code kinda defeats the purpose of using the purely number based way
ikrima has quit [Ping timeout: 272 seconds]
<yorickpeterse> it also uses a while loop which isn't going to be faster
<cored> yorickpeterse: saw it now
<andrewvos> cored: Well reversing the string is sure to slow things down
<yorickpeterse> well yeah
<andrewvos> Maybe check if the first digit is the same as the last digit first?
<yorickpeterse> doesn't work
dustint has quit [Ping timeout: 264 seconds]
<yorickpeterse> e.g. 112 is not the same as 201
ikrima has joined #ruby-lang
<andrewvos> Huh?
<andrewvos> I mean to speed things up
<andrewvos> If it's the same, then reverse
setmeaway has joined #ruby-lang
<yorickpeterse> cored: also this: https://gist.github.com/hminaya/5482289 takes forever
<andrewvos> cored: Where is the seed.txt?
<yorickpeterse> andrewvos: see my gist earlier
<zenspider> it doesn't even make sense to iterate over every number. at LEAST go up by 10s
<yorickpeterse> (the one I created)
<yorickpeterse> zenspider: well, not just 10s
<zenspider> but honestly, using strings at all is the wrong way to go.
<zenspider> yes, 10s, match the ones place to the top digit and then go up by 10s
<cored> andrewvos: wait
athaeryn has quit [Remote host closed the connection]
<zenspider> otherwise you're wasting 90% of your time on stuff that is obviously not palindromic
<zenspider> but generating palindromes will always be faster than testing for palindromes
<cored> zenspider: you mean only n % 10 == 0
<cored> ?
<erikh> it should be able to be easy to flip bitwise
<zenspider> I recently wanted to find all 9 digit palindromic primes.
<zenspider> in mathematica it is a beautiful 1 liner: a09 = Range[0, 9]; a19 = Range[1, 9]; Select[Map[FromDigits@Join[Reverse@Rest@#, #] &, Tuples[{a09, a09, a09, a09, a19}]], PrimeQ]
<yorickpeterse> "beatiful"
<zenspider> cored: no, not == 0. == whatever the top digit is
<erikh> bleh. I guess I get to write this, then
<cored> zenspider: got it
<erikh> back when I have another annoyance to inflict upon you all :)
<erikh> enjoy
erikh has left #ruby-lang ["Linkinus - http://linkinus.com"]
<cored> is there a way to do something like this in ruby https://gist.github.com/orodriguez/5207964c9d89c01ae443
<blowmage> zenspider: all the rails tests, or just the activerecord tests?
outoftime has quit [Quit: Leaving]
<zenspider> blowmage: I was hoping to do all the rails tests
<zenspider> I'm writing a top level task to do the right thing
asunderland has quit [Ping timeout: 264 seconds]
<blowmage> prolly safest, the rails testing tasks are a bit of a mess imo
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
glebm has quit [Read error: Connection reset by peer]
<yorickpeterse> andrewvos: ta, stealing this
<andrewvos> zenspider was right, as usual
<zenspider> blowmage: so I'm learning
<blowmage> not a ghetto at all!
<andrewvos> yorickpeterse: What for?
<yorickpeterse> andrewvos: so I can see much faster it is
<zenspider> omakase damnit
<zenspider> or something
<yorickpeterse> BASECAMP
mistym has quit [Remote host closed the connection]
<zenspider> so I'm doing the baseline now then I'll get it running against my patches
<zenspider> I don't think I'm far off from getting a mostly clean run
<andrewvos> Why are people saying basecamp and talking about rails I feel like i'm taking crazy pills
* yorickpeterse is writing tests for ffs
<zenspider> I AM getting crazy errors, like JSON returning different date formats?
<zenspider> what' sup wit hthat
<yorickpeterse> andrewvos: Railsconf
<zenspider> andrewvos: I'm trying to get minitest proven against rails so I can get MT5 out before rails does another RC
<zenspider> If I can, we can get rails flipped to MT5 before they release
erpuds has quit [Quit: erpuds]
<andrewvos> Ooh
<blowmage> yay!
<andrewvos> zenspider: Nice
<andrewvos> zenspider: +1
* blowmage gets emotional thinking about it
<whitequark> nice indeed
<andrewvos> Calm down little guy
Asher has quit [Quit: Leaving.]
<yorickpeterse> palindromes are not inventions, they are extractions
<andrewvos> yorickpeterse: Are you at railsconf?
<yorickpeterse> no
<cored> andrewvos: the only downside is that, is using another loop
<yorickpeterse> I'm at home on a couch
<zenspider> blowmage: at this point, with tenderlove in PDX, it is a fairly big if
<cored> andrewvos: are you sure that's faster ?
ruurd has joined #ruby-lang
<andrewvos> cored: Nope
glebm has joined #ruby-lang
<andrewvos> cored: Let's find out...
<cored> andrewvos: testing it
intellitech_ has joined #ruby-lang
intellitech_ has quit [Changing host]
intellitech_ has joined #ruby-lang
<yorickpeterse> we should write a C extension for this
<yorickpeterse> so that it is webscale
<andrewvos> yorickpeterse: We should write a basecamp extension for this
<yorickpeterse> using turbolinks
<andrewvos> yorickpeterse: And the asset pipeline
<zenspider> is this palindrome thing just in response to that "python is 10x faster" bs from last week?
<yorickpeterse> DAMN IT
<yorickpeterse> About to say that
<andrewvos> yorickpeterse: YOU LOSE
intellitech has quit [Read error: Connection reset by peer]
intellitech_ is now known as intellitech
<yorickpeterse> zenspider: not sure, we kinda lost track. Somebody here wrote some Ruby version that took ages, I ported some Python code 1:1 that ran in about 2,5s
<yorickpeterse> (Python code in about 1,4 or so)
<zenspider> so yes. because the original code was horrifically bad
<yorickpeterse> yup
solars has quit [Ping timeout: 268 seconds]
<cored> yorickpeterse: did you refactor the Python code or what?
<yorickpeterse> No, I gave up
<cored> yorickpeterse: :-)
<yorickpeterse> because it's massively overkill right from the start
<cored> zenspider: well that gist also is pretty ugly code
<cored> :-P
<cored> andrewvos: ran a little bit faster
<andrewvos> I thinkt the string approach may be faster :/
<whitequark> how so
<andrewvos> Well, from my simple test it seems faster
<yorickpeterse> zenspider: regarding your suggestion of using the modulo operator, where you said "highest number", do you mean the highest value of the range (to iterate)
<yorickpeterse> + ?
<andrewvos> whitequark: Benchmark.measure
<andrewvos> whitequark: err...
glebm has quit [Ping timeout: 245 seconds]
<cored> andrewvos: is not
<cored> andrewvos: the one with the calculation is faster I test it
<yorickpeterse> strings are faster on MRI
<andrewvos> Yeah pretty much all the time
<andrewvos> lols
idkazuma has joined #ruby-lang
<cored> oh
<cored> I'm using 2.0
havenwood has joined #ruby-lang
<yorickpeterse> on Rbx numbers are *much* faster though
<yorickpeterse> as in, strings take 2,4 seconds and numbers only take 0,36
wmoxam has joined #ruby-lang
glebm has joined #ruby-lang
sepp2k1 has joined #ruby-lang
<andrewvos> Wow
<andrewvos> Today I learned
<andrewvos> zenspider: halp!
<yorickpeterse> MRI is shit for numbers
sepp2k has quit [Ping timeout: 256 seconds]
<andrewvos> That's it I'm switching to go
<yorickpeterse> lol
<yorickpeterse> Basecamp
srbaker has quit [Quit: Computer has gone to sleep.]
rwk1 has joined #ruby-lang
agarie has joined #ruby-lang
<andrewvos> yorickpeterse: Dude try that code in jruby it's slow as fuck
<yorickpeterse> warm up the JVM nerd
<yorickpeterse> you have to rub it and whisper tender words to it
<zenspider> so what's the largest number in seeds.txt?
<yorickpeterse> "tonight. you"
<cored> yorickpeterse: I got the part on Basecamp, but what is happening now with Go ?
<yorickpeterse> cored: it's the new hipster language people use for everything these days
<yorickpeterse> and god forbid something being slower than it
sailias has joined #ruby-lang
<cored> yorickpeterse: everything?
<yorickpeterse> zenspider: Not sure, but you compare it to that? Hmm
rwk1 has quit [Ping timeout: 268 seconds]
<zenspider> takes me .7 seconds to generate all palindromes from 0 to 10^12 - 1
<zenspider> on ruby 1.8
<andrewvos> Interesting
<zenspider> .365s for ruby 2
<zenspider> at then all you need to do is a range test
<headius> andrewvos: what code is slow?
lcdhoffman has joined #ruby-lang
<andrewvos> headius: Welp it just went over 500M and crashed
<headius> jruby seems to be much faster than 1.9
<yorickpeterse> lawl
<andrewvos> headius: I'm using 1.6.7
<andrewvos> So, uhh yeah. Pretty old
<andrewvos> (don't ask)
<headius> well, it's not slow in JRuby 1.7
<yorickpeterse> meh screw this, back to My First Programming language
<andrewvos> headius: This is the offending code https://gist.github.com/AndrewVos/5485460
<andrewvos> headius: Yeah will try it again on 1.7+
<yorickpeterse> andrewvos: y u no use Benchmark.bmbm
<andrewvos> yorickpeterse: Cause I don't know what tha tis
<andrewvos> that is*
<headius> JRuby's fastest compared to mri and rbx here
<headius> second version runs in 0.14s on JRuby compared to 0.45 in mri and rbx
vlad_starkov has quit [Remote host closed the connection]
<andrewvos> Hmm, still slow for me on 1.7
<andrewvos> I think my JDK is a bit weir
<yorickpeterse> andrewvos: http://pastie.org/7740159
<zenspider> moot point because the argorithm is slow
<headius> yeah dunno...it shouldn't use much memory for that either, but you could try bumping up max with -J-Xmx1024M
baba has joined #ruby-lang
cod3r has quit [Ping timeout: 245 seconds]
<andrewvos> zenspider: How so?
<headius> if it's still slow I think something's borked
charliesome has joined #ruby-lang
<andrewvos> headius: I'm pretty sure something is borked
<headius> fair enough
<andrewvos> My environment has become exotic
<yorickpeterse> meh bed tiem, taters
<andrewvos> peace yorickpeterse
<andrewvos> dream of basecamps
<zenspider> andrewvos: change 9000000 to 99,999,999,999 and tell me how long it takes
<zenspider> err... s/,/_/g
ruurd has quit [Quit: Leaving...]
<andrewvos> zenspider: Seriously?
<zenspider> seriously
<zenspider> I've ran it thrice since asking
<andrewvos> zenspider: I'm guessing "forever"
<andrewvos> Oh wo
<andrewvos> w
<andrewvos> zenspider: Do you mean MRI or jruby?
<zenspider> MRI
<andrewvos> I had to kill -9 that ^
<andrewvos> ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.2.1]
woollyams has joined #ruby-lang
<andrewvos> I'll try p362
<joevandyk> is there a way to get the location of the file that required the current file? so if file_a.rb requires file_b.rb, can file_b.rb find the location of file_a.rb?
<charliesome> joevandyk: take a look at caller perhaps
<charliesome> joevandyk: that sounds like a dodgy thing to do though
srbaker has joined #ruby-lang
rwk1 has joined #ruby-lang
<andrewvos> zenspider: Nah still slow. Not sure what box you're running this code on, or just trolling me
<andrewvos> if you're*
<zenspider> andrewvos: my POINT is that your code is slow.
<andrewvos> I assumed you were running the same code
Asher has joined #ruby-lang
<zenspider> I said "moot point because the argorithm is slow", you responded "How so?", so I told you to run on a bigger range
<andrewvos> Yeah. Should have guessed
<andrewvos> How did you optimise it?
sailias has quit [Quit: Leaving.]
<zenspider> the premise is wrong. you're testing every number from 1 to n. generating tons of garbage, and not even skipping things you KNOW can't be palindromes.
<andrewvos> zenspider: The reason I'm generating the numbers upfront is because I was trying to get some sort of benchmark. But yeah
<andrewvos> How would you know a number can't be a palindrome?
idkazuma has quit [Remote host closed the connection]
srbaker has quit [Quit: Computer has gone to sleep.]
justinra_ has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
srbaker has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
maxmanders has joined #ruby-lang
maxmanders has quit [Client Quit]
vlad_starkov has joined #ruby-lang
<zenspider> andrewvos: you're NOT generating the numbers up front. you're FILTERING the numbers up front
intellitech has quit [Quit: intellitech]
<zenspider> 1.8s to do 0 to 9_999_999_999_999, and most of that is prolly GC for me
zachlatta has quit [Remote host closed the connection]
<zenspider> ramps up pretty fast
glebm has joined #ruby-lang
dettoaltrimenti has quit [Ping timeout: 272 seconds]
dettoaltrimenti has joined #ruby-lang
<zenspider> 15 seconds to do 0 to 999_999_999_999_999
<charliesome> zenspider: whats your algorithm
djwonk has joined #ruby-lang
malev has joined #ruby-lang
glebm has quit [Read error: Connection reset by peer]
maxmanders has joined #ruby-lang
maxmanders has quit [Client Quit]
headius has quit [Quit: headius]
vlad_starkov has quit [Ping timeout: 272 seconds]
<zenspider> charliesome: generate all the palindromes
glebm has joined #ruby-lang
intellitech has joined #ruby-lang
intellitech has quit [Changing host]
intellitech has joined #ruby-lang
postmodern has joined #ruby-lang
idkazuma has joined #ruby-lang
<cored> zenspider: so you generated all the palindromes and then match it with the one in the list?
erpuds has joined #ruby-lang
<zenspider> cored: that's the idea. I don't have the list but that part is easy
<cored> interesting
<zenspider> what's the biggest number in the list?
glebm has quit [Read error: Connection reset by peer]
<cored> zenspider: wait
kogent has quit [Quit: kogent]
<zenspider> waiting
brianpWins has quit [Quit: brianpWins]
baba has quit [Quit: WeeChat 0.4.0]