apeiros changed the topic of #ruby-lang to: Ruby 1.9.3-p374: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
outoftime has quit [Quit: Leaving]
sulo has quit [Ping timeout: 256 seconds]
ruskie has joined #ruby-lang
b1rkh0ff has quit [Read error: Connection reset by peer]
Rarrikins_i_v has quit [Ping timeout: 244 seconds]
Rarrikins has joined #ruby-lang
headius has joined #ruby-lang
publicvoid has joined #ruby-lang
tenderlove has joined #ruby-lang
postmodern has joined #ruby-lang
chimkan has quit [Quit: chimkan]
mrbloo has joined #ruby-lang
datanoise has quit [Ping timeout: 252 seconds]
jtoy has quit [Quit: jtoy]
Rarrikins_j has joined #ruby-lang
Rarrikins has quit [Ping timeout: 245 seconds]
Rarrikins_j_s has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
ryanv-raptor has joined #ruby-lang
blaines has joined #ruby-lang
Rarrikins_j has quit [Ping timeout: 245 seconds]
Rarrikins_j_s_h has joined #ruby-lang
Rarrikins_j_s_h has quit [Remote host closed the connection]
Rarrikins_j_s has quit [Ping timeout: 252 seconds]
blaines has left #ruby-lang [#ruby-lang]
robbyoconnor has quit [Ping timeout: 245 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
scollier has quit [Quit: Ex-Chat]
havenwood has quit [Remote host closed the connection]
therod has joined #ruby-lang
dous has joined #ruby-lang
dous has quit [Changing host]
dous has joined #ruby-lang
cirenyc has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
dous_ has joined #ruby-lang
zhul_mechanos has quit [Quit: zhul_mechanos]
therod has quit [Ping timeout: 256 seconds]
marr has quit [Ping timeout: 255 seconds]
dous has quit [Ping timeout: 248 seconds]
robotmay has quit [Ping timeout: 276 seconds]
datanoise has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
blaines has joined #ruby-lang
akahn has joined #ruby-lang
robbyoconnor has joined #ruby-lang
bantic has quit [Quit: bantic]
datanoise has quit [Ping timeout: 246 seconds]
_tockitj has quit [Ping timeout: 255 seconds]
blaines has left #ruby-lang [#ruby-lang]
rsl has quit [Quit: Computer has gone to sleep.]
<reactormonk> zenspider, you don't like gnuplot? ^^
dous_ has quit [Ping timeout: 244 seconds]
mrbloo has quit [Quit: mrbloo]
ryanv-raptor has left #ruby-lang [#ruby-lang]
therod has joined #ruby-lang
robotmay has joined #ruby-lang
tomzx_mac has joined #ruby-lang
ddv has quit [Ping timeout: 240 seconds]
chendo has quit [Ping timeout: 252 seconds]
ddv has joined #ruby-lang
robotmay has quit [Ping timeout: 276 seconds]
chendo_ has joined #ruby-lang
megha has quit [Ping timeout: 264 seconds]
therod has quit [Ping timeout: 245 seconds]
robotmay has joined #ruby-lang
datanoise has joined #ruby-lang
robotmay has quit [Read error: Connection reset by peer]
chendo_ has quit [Ping timeout: 252 seconds]
chendo_ has joined #ruby-lang
dustint has joined #ruby-lang
<zenspider> reactormonk: if they add alpha blending I'll switch back because I have a lot of old software that used it to good effect
<zenspider> honestly, the google visualization api is a HUGE step up from the POS google charts they originally released... but fuck does their doco suck
<reactormonk> zenspider, alpha blending?
mjio has quit []
banisterfiend has quit [Ping timeout: 252 seconds]
harper_ has joined #ruby-lang
harper_ has quit [Client Quit]
lcdhoffman has quit [Quit: lcdhoffman]
chendo_ has quit [Ping timeout: 252 seconds]
carloslopes has joined #ruby-lang
<hakunin> hi folks, could someone explain why ruby 1.9.3p327 is being crazy? or am i crazy
<hakunin> or minitest
<hakunin> echo "require 'minitest/autorun'; class FooTest < MiniTest::Unit::TestCase; def test_foo; assert_equal('0x0', '0x1') end end" > foo.rb
<hakunin> ruby foo.rb
<hakunin> wtf is this
chendo_ has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
mrsolo has quit [Quit: Leaving]
linc01n has quit [Quit: ZNC - http://znc.in]
unlikely_monkey has joined #ruby-lang
megha has joined #ruby-lang
<hakunin> Ryan, you are probably the most qualified to explain this, if you have a moment I'd appreciate
linc01n has joined #ruby-lang
chimkan has joined #ruby-lang
mrbloo has joined #ruby-lang
imajes has quit [Excess Flood]
<hakunin> zenspider: sorry for pinging you, curiousity is killing me
richardburton has joined #ruby-lang
imajes has joined #ruby-lang
linc01n has quit [Quit: ZNC - http://znc.in]
alvaro_o has quit [Quit: Ex-Chat]
linc01n has joined #ruby-lang
<hakunin> (wrong repo, but point remains)
<zenspider> hakunin: catching up
<zenspider> hakunin: yup. that's the reason why
<zenspider> it's so that inspects on generic objects don't fail because of the object id
<zenspider> ruby -e 'p Object.new'
sn0wb1rd has quit [Quit: sn0wb1rd]
richardburton has quit [Ping timeout: 246 seconds]
<hakunin> zenspider: was going to submit issue, but they're disabled on github
<zenspider> no they're not
<zenspider> you're looking at the wrong place
<zenspider> seattlerb/minitest
<zenspider> or you're not logged in?
<hakunin> zenspider: damn i was still looking at that repo, you're right
<zenspider> :P
<hakunin> zenspider: great, will submit
<zenspider> so... you can either override mu_pp_for_diff in your testcase, or you can change the regexp to require the hex string be at least 4 chars or something
<zenspider> that method IS meant to be overridden as needed
<zenspider> (file anyways... this is a doco issue)
<hakunin> zenspider: hm, baffled me when asserting on snippets of imagemagick commands :) +"-size 400xXXXXXX tile:granite: -brightness-contrast 38x-33 -blur 0xXXXXXX.5"
<hakunin> zenspider: it does that to any substring with 0x...
<zenspider> ew. yeah
<zenspider> needs a word break at the beginning too
<zenspider> that sucks. never thought of that
robbyoconnor has quit [Ping timeout: 272 seconds]
drbrain has quit [Remote host closed the connection]
mwjcomputing has joined #ruby-lang
<hakunin> submitted
<zenspider> thanks
<hakunin> thank you, minitest is great
mjio has joined #ruby-lang
jtoy has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
sn0wb1rd has joined #ruby-lang
mercwithamouth has joined #ruby-lang
headius has quit [Quit: headius]
headius has joined #ruby-lang
headius has quit [Client Quit]
sepp2k has joined #ruby-lang
innohero has joined #ruby-lang
lcdhoffman has joined #ruby-lang
therod has joined #ruby-lang
therod has quit [Ping timeout: 248 seconds]
RubyHead has quit [Remote host closed the connection]
powershellyoda has joined #ruby-lang
banisterfiend has joined #ruby-lang
mwjcomputing has quit [Ping timeout: 244 seconds]
powershellyoda has quit [Client Quit]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
mwjcomputing has joined #ruby-lang
banisterfiend is now known as banister`sleep
towski has quit [Remote host closed the connection]
gregmore_ has joined #ruby-lang
richardburton has joined #ruby-lang
gregmore_ has quit [Ping timeout: 252 seconds]
richardburton has quit [Ping timeout: 244 seconds]
io_syl has quit [Ping timeout: 252 seconds]
mrbloo has quit [Quit: mrbloo]
cirenyc has quit [Quit: Leaving...]
bzalasky has joined #ruby-lang
chimkan has quit [Quit: chimkan]
banister`sleep has quit [Ping timeout: 248 seconds]
mercwithamouth has quit [Ping timeout: 245 seconds]
bzalasky has quit [Remote host closed the connection]
drbrain has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
bzalasky has joined #ruby-lang
Axsuul has quit [Ping timeout: 255 seconds]
megha has quit [Quit: WeeChat 0.4.0]
cirenyc has joined #ruby-lang
gjaldon has joined #ruby-lang
carloslopes has joined #ruby-lang
chimkan has joined #ruby-lang
therod has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 272 seconds]
neocoin has joined #ruby-lang
drbrain has quit [Remote host closed the connection]
therod has quit [Ping timeout: 276 seconds]
drbrain has joined #ruby-lang
innohero has left #ruby-lang [#ruby-lang]
krz has joined #ruby-lang
mwjcomputing has quit [Quit: Leaving]
mrsolo has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
mrsolo has quit [Quit: Leaving]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
Kallikanzarid has quit [Remote host closed the connection]
brianpWins has joined #ruby-lang
datanoise has quit [Ping timeout: 272 seconds]
peppyheppy_ has joined #ruby-lang
richardburton has joined #ruby-lang
peppyheppy has quit [Ping timeout: 252 seconds]
peppyheppy_ has quit [Ping timeout: 244 seconds]
richardburton has quit [Ping timeout: 252 seconds]
herpless is now known as herpless_
herpless_ is now known as herpless
io_syl has joined #ruby-lang
chendo_ has quit [Ping timeout: 252 seconds]
chimkan_ has joined #ruby-lang
justincampbell has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
chendo_ has joined #ruby-lang
chimkan has quit [Ping timeout: 248 seconds]
chimkan_ is now known as chimkan
chimkan has left #ruby-lang [#ruby-lang]
jtoy has quit [Quit: jtoy]
breakingthings has joined #ruby-lang
<breakingthings> Anyone around familiar with threads I can ask some conceptual stuff to?
chimkan has joined #ruby-lang
jonahR has joined #ruby-lang
mercwithamouth has joined #ruby-lang
<shachaf> breakingthings: You're probably best off just asking your questions.
<breakingthings> shachaf: I've not been having much luck getting someone to actually reply more than one line that way so far. :d
<shachaf> What if someone is somewhat familiar and volunteers to help you, and then it turns out they don't know enough to answer your questions? Then they'll feel bad.
<shachaf> No one wants to feel bad.
datanoise has joined #ruby-lang
chimkan has quit [Ping timeout: 248 seconds]
chimkan__ has joined #ruby-lang
Guest____ has joined #ruby-lang
datanoise has quit [Read error: Operation timed out]
<zenspider> breakingthings: just ask
<zenspider> type it into a text editor to save it for the next room in case we don't answer :P
AntiTyping has joined #ruby-lang
* breakingthings shrugs
<breakingthings> I'm creating an IRC bot and trying to create a thread that will run a loop on TCPSocket#readline
<breakingthings> I'm trying to come up with a way to structure my application in such a way that will allow me to… I guess pass the data from that thread back to the main thread so that the application can react to it? I'm not really sure how to phrase this.
chimkan has joined #ruby-lang
Guest____ has quit [Ping timeout: 276 seconds]
chimkan__ has quit [Ping timeout: 272 seconds]
dustint has quit [Quit: Leaving]
stonerfish has joined #ruby-lang
richardburton has joined #ruby-lang
Guest____ has joined #ruby-lang
brook has joined #ruby-lang
richardburton has quit [Ping timeout: 276 seconds]
esad has left #ruby-lang ["["Textual IRC Client: www.textualapp.com"]"]
brook has quit []
ddd has joined #ruby-lang
ddd is now known as Guest71081
wallerdev has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
Bosox20051 has quit [Quit: Leaving]
unlikely_monkey has quit [Remote host closed the connection]
Guest71081 is now known as ddd
Guest____ has quit [Read error: Connection reset by peer]
dcwu has joined #ruby-lang
chendo_ has quit [Ping timeout: 252 seconds]
chendo_ has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
robbyoconnor has joined #ruby-lang
Bearproof has joined #ruby-lang
Guest____ has joined #ruby-lang
brianpWins has joined #ruby-lang
chimkan has quit [Ping timeout: 240 seconds]
cirenyc has quit [Quit: Leaving...]
therod has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
peppyheppy has joined #ruby-lang
therod has quit [Ping timeout: 246 seconds]
dvorak_ has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 276 seconds]
dvorak has quit [Ping timeout: 252 seconds]
Bearproof has quit [Quit: Leaving.]
ryanf has quit [Quit: leaving]
dvorak_ has quit [Ping timeout: 264 seconds]
dvorak has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
mistym has quit [Remote host closed the connection]
havenn has joined #ruby-lang
Guest____ has quit [Quit: Computer has gone to sleep.]
datanoise has joined #ruby-lang
chendo_ has quit [Ping timeout: 264 seconds]
Vektur has quit []
bluepojo has quit [Ping timeout: 248 seconds]
<TTilus> breakingthings: package your data to message objects maybe and use a simple queue
chendo_ has joined #ruby-lang
<TTilus> breakingthings: an array that you push and shift works fine as a queue
<TTilus> breakingthings: plan string might just be good enough message object :)
richardburton has joined #ruby-lang
cirenyc has joined #ruby-lang
Guest__ has joined #ruby-lang
<TTilus> breakingthings: why do you need it threaded, why not make it evented?
bzalasky has joined #ruby-lang
richardburton has quit [Ping timeout: 255 seconds]
fsvehla has joined #ruby-lang
savagecroc has joined #ruby-lang
<savagecroc> hi guys
<savagecroc> i want to let people that use one of my applications write code
<savagecroc> that can interface with our software
<savagecroc> what's a good way of doing it so it's totally sandboxed
<savagecroc> one idea i had was, let them run javascript and use a headless browser to execute the javascript
agile has joined #ruby-lang
ryanf has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 246 seconds]
cirenyc has quit [Ping timeout: 276 seconds]
Guest__ has quit [Quit: Computer has gone to sleep.]
tomzx_mac has joined #ruby-lang
torrieri has joined #ruby-lang
kentos_ has joined #ruby-lang
blacktulip has joined #ruby-lang
sepp2k has quit [Remote host closed the connection]
cirenyc has joined #ruby-lang
tomzx_mac has quit [Read error: Operation timed out]
tonni has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
mjio has quit []
datanoise has quit [Ping timeout: 264 seconds]
towski has joined #ruby-lang
<shachaf> Is there a standard library way of looping forever with an index?
<shachaf> Like 0.upto(∞) {|i| ... }
<shachaf> "loop" doesn't keep an index.
kentos_ has quit [Quit: Leaving]
richardburton has joined #ruby-lang
ramonmaruko has quit [Read error: Connection reset by peer]
tonni has joined #ruby-lang
ramonmaruko has joined #ruby-lang
jonahR has quit [Quit: jonahR]
<Mon_Ouie> Replace ∞ with Float::INFINITY
richardburton has quit [Ping timeout: 256 seconds]
<shachaf> Floats are awful. :-(
<Mon_Ouie> It still iterates over integers
<shachaf> Sure.
<shachaf> I'd rather use this loop_with_index that I just wrote than that, though. :-)
<Mon_Ouie> Oh, you don't need to write it now that I think of it…
<Mon_Ouie> loop.with_index { |i| … }
<shachaf> Ah, that's better.
<shachaf> Thanks!
<shachaf> Only a single-character change.
<Mon_Ouie> Oh, nvm, it's more like |_, i|
<shachaf> fg
<shachaf> Er.
<shachaf> Right.
<Mon_Ouie> Because the first argument is supposed to be the object yielded by the Enumerator, which in this case is nothing (nil)
<shachaf> Still better than defining my own function.
chendo_ has quit [Ping timeout: 252 seconds]
AntiTyping has quit [Quit: AntiTyping]
srbaker has joined #ruby-lang
cirenyc has quit [Ping timeout: 240 seconds]
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
datanoise has joined #ruby-lang
rippa has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
stonerfish has quit [Quit: Leaving.]
breakingthings has quit [Ping timeout: 248 seconds]
srbaker has quit [Ping timeout: 256 seconds]
ramonmaruko has quit [Read error: Connection reset by peer]
thufir_ has joined #ruby-lang
Guest__ has joined #ruby-lang
ramonmaruko has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 272 seconds]
nXqd has joined #ruby-lang
datanoise has quit [Ping timeout: 256 seconds]
Guest__ has quit [Ping timeout: 276 seconds]
jperry2_ has quit [Read error: Connection reset by peer]
jperry2 has joined #ruby-lang
blazes816 has quit [Quit: blazes816]
cirenyc has joined #ruby-lang
Guest__ has joined #ruby-lang
dr_bob has joined #ruby-lang
chendo_ has quit [Ping timeout: 240 seconds]
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
cirenyc has quit [Ping timeout: 244 seconds]
dhruvasagar has joined #ruby-lang
richardburton has joined #ruby-lang
gjaldon has quit [Read error: Connection reset by peer]
gjaldon has joined #ruby-lang
richardburton has quit [Ping timeout: 255 seconds]
<zenspider> why in the fuck would you want an infinite enumerator with index?!?
tonni has quit [Remote host closed the connection]
zmack has joined #ruby-lang
mercwithamouth has joined #ruby-lang
solars has joined #ruby-lang
<injekt> so you can count how silly it is
nickname000 has quit [Quit: Page closed]
chekcmate has joined #ruby-lang
<savagecroc> hey
<savagecroc> i want users of my application to be able to write their own code
<chekcmate> moin all
<shachaf> zenspider: I want to figure out the smallest value that has some complicated property.
fsvehla has quit [Quit: fsvehla]
<shachaf> This is probably an awkward way to do it. What'd be less awkward?
<savagecroc> and have it run within a sandbox.. any idea of a good way of doing it? i'd prefer ruby, but one way is i could let them do it in javascript.. and run that in a headless browser on the server
fsvehla has joined #ruby-lang
<manveru> savagecroc: you could try something like http://www.iron.io/worker (disclaimer: i worked there)
<savagecroc> manveru: with your coding skills :) i'd trust anything you'd suggest
<savagecroc> looks excellent
<savagecroc> but my solution has to work without access to an internet connection
havenn has quit [Remote host closed the connection]
<manveru> well, you could use something like lxc or bsd jails for lightweight sandboxing
<savagecroc> i'll check it out.. or do you think just doing the headless browser solution might be a lot easier? sandboxing for free
<manveru> well, you don't need a browser for that
<manveru> unless you need the DOM
<savagecroc> nah don't need dom
<savagecroc> oh yeah.. run it directly in V8
<savagecroc> hmm it might be a good idea
<savagecroc> because UI mods have to be done in JS anyway
<manveru> just don't use node, that'd give them ways out :)
<savagecroc> yeah i've got a rails backend, with various ruby processes
towski has quit [Remote host closed the connection]
<savagecroc> i was thinking the JS can just communicate through an internal API
<savagecroc> i.e. they give us the JS
<savagecroc> we run it through a testing app, to make sure it doesn't use up too much CPU / actually works
<savagecroc> if it passes that, then we save it and let them run it
<manveru> with API you mean stdin/stdout?
<manveru> also on linux you can use cgroups to limit resources
<savagecroc> nah.. to controllers
<savagecroc> doesn't need to do any file operations
<savagecroc> oh actually.. nah it's more like functions
<manveru> yeah, but you need to limit the amount of memory or they can trigger OOM
<savagecroc> i.e. so you might have one called calculate grade. function calculate_grade(grade_object)
<savagecroc> so ruby would convert the object into json.. call the function.. get the respons
<savagecroc> in V8 i could run them on separate processes.. ohhh
tonni has joined #ruby-lang
<savagecroc> even on a separate machine
<savagecroc> yeah.. have a box just dedicated to user scripts
<savagecroc> and then write the app so they can all die and only subsections of the application stop working
swav_ has quit [Remote host closed the connection]
thisboy has joined #ruby-lang
<thisboy> Hello!
mars777 has joined #ruby-lang
<mars777> Hello I have a rails question.
<mars777> Can someone review my code
<thisboy> How was it I randomly shuffled lines with Ruby?
shtirlic has joined #ruby-lang
<thisboy> I got a text file with some lines whose order I wanna randomize
cirenyc has joined #ruby-lang
<mars777> I want to know if this is correct
<manveru> mars777: maybe try #rubyonrails
<mars777> I would but there not very friendly
<mars777> lol
<manveru> ok, good luck :)
<manveru> thisboy: sort -R input.txt > output.txt
<mars777> i hope someone could help me on here before i go there
<mars777> =D
<mars777> :)
<mars777> that would be good
<thisboy> manveru: I've tried that with both FreeBSD and Cygwin but it doesn't seem to randomize
<thisboy> I had this cool Ruby oneliner but I seem to have lost it
cirenyc has quit [Ping timeout: 276 seconds]
<manveru> ruby -e 'p File.open("output.txt", "w+"){|o| o.write(File.readlines("input.txt").shuffle) }'
<manveru> something like that, as long as you have enough RAM
shtirlic has quit [Ping timeout: 248 seconds]
<thisboy> sweet
<thisboy> a lot prettier than my previous oneliner for sure
<manveru> i guess sort -R is a GNU addition
<yorickpeterse> Morning
tbuehlmann has joined #ruby-lang
<thisboy> yup
<thisboy> manveru: one thing though, with that oneliner
<thisboy> lorem
<thisboy> ipsum
<thisboy> becomes: ["lorem\r\n", "dolor\r\n"]
<manveru> i doubt that
<thisboy> err
<injekt> :D
<thisboy> ["lorem\r\n", "ipsum\r\n"] :)
<manveru> well, it's random
<manveru> so original order is possible
dcwu has quit [Quit: Leaving.]
<manveru> and with only two lines there's a 50/50 chance :)
<thisboy> any way to get rid of the square brackets, quotes and \r\n's though?
<manveru> huh?
<thisboy> yup id include more lines but didnt wanna flood the channel
peppyheppy has quit [Quit: peppyheppy]
<manveru> are you sure you use the same code?
<injekt> yeah that write will call to_s on the array which in 1.9 is inspect
<manveru> omg
<thisboy> yeah pretty sure
<manveru> i was testing with rbx 1.8
<manveru> my bad
<thisboy> basically what i wanna do is randomize these lines of html http://jsfiddle.net/bwx2w/
<thisboy> cool
<injekt> .shuffle.join("\n")
<manveru> no, just join
<manveru> it ahs newlines already
<injekt> ah yes
<thisboy> true
<thisboy> oh weeeeeeeeeeee :P
ryanf has quit [Quit: leaving]
<injekt> I hope your input files dont get too large
<thisboy> thanks a lot guys
<thisboy> nah no worries :D
<thisboy> hehe
toretore has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
swav has joined #ruby-lang
richardburton has joined #ruby-lang
jxie has quit [Quit: leaving]
shtirlic has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 272 seconds]
gnufied has joined #ruby-lang
maxmanders has joined #ruby-lang
kentos has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby-lang
richardburton has quit [Ping timeout: 245 seconds]
peppyheppy has joined #ruby-lang
idkazuma has joined #ruby-lang
marr has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
jbsan_ has joined #ruby-lang
jbsan has quit [Ping timeout: 260 seconds]
jbsan_ is now known as jbsan
neocoin has quit [Remote host closed the connection]
jbsan has quit [Read error: Connection reset by peer]
jbsan has joined #ruby-lang
ruurd has joined #ruby-lang
swav has quit [Ping timeout: 276 seconds]
socialcoder has joined #ruby-lang
<socialcoder> what is the difference between ARGV and ARGV[0]
<socialcoder> when I give ARGV[0], the script works
<socialcoder> when I remove [0], IT SAYS CANNOT CONVERT ARRAYS INTO STRING
<socialcoder> ooops...sorry for caps
<socialcoder> also, if I put ARGV.first...works perfectly
<socialcoder> any help appreciated
|Vargas| has quit [Quit: ...]
neocoin has joined #ruby-lang
datanoise has joined #ruby-lang
<socialcoder> Dr.Brain, you sleeping? :)
peppyheppy has quit [Quit: peppyheppy]
<tbuehlmann> socialcoder, ARGV is an array. ARGV[0] and ARGV.first represent the first element of that array
io_syl has joined #ruby-lang
<socialcoder> true, but by default shudnt ARGv refer to the first element?
<workmad3> socialcoder: no, why should it?
<workmad3> socialcoder: it's an array
<socialcoder> I see...I guess I misunderstood
<socialcoder> I thought if there was one element just ARGV was enough
<workmad3> nope, it's always an array
<socialcoder> right, gotcha
<workmad3> otherwise you'd need to do special-case handling for 1 argument vs several, in order to not crash out
<socialcoder> thx
datanoise has quit [Ping timeout: 245 seconds]
<socialcoder> and that I guess is not recommended
vlad_starkov has joined #ruby-lang
thufir_ has quit [Quit: Leaving.]
therod has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
crudson has joined #ruby-lang
crudson1 has quit [Ping timeout: 256 seconds]
therod has quit [Ping timeout: 252 seconds]
savagecroc has quit [Remote host closed the connection]
io_syl has quit [Quit: Computer has gone to sleep.]
cirenyc has joined #ruby-lang
mars777 has quit [Quit: mars777]
wudofyr_ has quit [Remote host closed the connection]
wudofyr_ has joined #ruby-lang
cirenyc has quit [Ping timeout: 272 seconds]
chendo_ has quit [Ping timeout: 252 seconds]
<zenspider> shachaf: depends on what you're trying to solve... your approach sounds very brute force. there might be a better way, but I dunno what the problem is yet
chendo_ has joined #ruby-lang
robotmay has joined #ruby-lang
<shachaf> zenspider: This is throwaway code. The goal is to find the smallest N that satisfies some property.
<shachaf> Earlier I thought that I might have to keep some state between iterations, but it turns out that not.
<shachaf> Anyway this just a translation of the way I'd do it in Haskell, which is filtering an infinite list. :-)
<zenspider> what's the property?
<shachaf> Oh, wait, I got it mixed up. I am keeping state. The other thing was a different function.
<shachaf> I'm extracting bytes one at a time from an oracle function until I fail to extract bytes.
robotmay has quit [Ping timeout: 272 seconds]
Guest__ has quit [Quit: Computer has gone to sleep.]
swav has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
<zenspider> still curious about that smallest N problem... :D
<zenspider> sounds like possibly interesting number theory problem
richardburton has joined #ruby-lang
<zenspider> bbl
rippa has quit [Read error: Connection reset by peer]
<shachaf> I got mixed up there.
richardburton has quit [Ping timeout: 248 seconds]
rippa has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
wizonesolutions has quit [Quit: No Ping reply in 180 seconds.]
rippa has quit [Ping timeout: 240 seconds]
judofyr has joined #ruby-lang
jxie has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
robotmay has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
chendo_ has quit [Ping timeout: 252 seconds]
Guest__ has joined #ruby-lang
wizonesolutions has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo_ has quit [Ping timeout: 252 seconds]
torrieri has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
chendo_ has joined #ruby-lang
thisirs has joined #ruby-lang
kcassidy has joined #ruby-lang
therod has joined #ruby-lang
cirenyc has joined #ruby-lang
torrieri has quit [Ping timeout: 245 seconds]
nkr has joined #ruby-lang
cirenyc has quit [Ping timeout: 252 seconds]
<socialcoder> if I want to print out a specific line, and then a specific line...what method touse
<socialcoder> I used readline, but it didnt help
<socialcoder> like f.readline
<injekt> socialcoder: you'll need to be a little more specific
<injekt> "if I want to print out a specific line, and then a specific line"
<judofyr> what makes it specific?
<socialcoder> I mean
<socialcoder> say from a text file
<socialcoder> whichhas 10 lines
<socialcoder> or ten sentences
<socialcoder> I want to print to command line line 2
<socialcoder> then line 5
<socialcoder> then like 1
<socialcoder> how do I do it
<injekt> can you keep your questions on single lines, this is painful
<injekt> and store them as an array then use indexes to print what you want, ie: lines = File.readlines('file.txt'); puts lines[2]; puts lines[5] etc
idkazuma has joined #ruby-lang
<zenspider> course those are lines 3 and 6... but whatever. :P
<socialcoder> do u mind showing me an example at http://gist.github.com
<socialcoder> Please
<injekt> I knew someone would say it zenspider
<socialcoder> I can that way store it
blacktulip has quit [Remote host closed the connection]
<injekt> socialcoder: i just showed you
<zenspider> he DID just show you
<injekt> that's all the code you need
<socialcoder> I see
<socialcoder> Thank you
<injekt> zenspider: go to bed
<socialcoder> I asked for gist, because I always get those indentations wrong
adambeynon has joined #ruby-lang
<socialcoder> but, no problem. thanks
<injekt> socialcoder: if you get indentation wrong then the best thing is for you to write stuff yourself and not copy+paste
<zenspider> injekt: I should. but brain isn't done yet
blacktulip has joined #ruby-lang
<injekt> socialcoder: so you can learn to correct your indentation
<injekt> zenspider: I know the feeling
<socialcoder> right
<socialcoder> ok
<injekt> I just ate so much porridge, i feel huge
<Paradox> morning
<Paradox> injekt, what kind of porridge
<Paradox> plain
<Paradox> or with yummy things like blueberries
<injekt> Paradox: na i ran out of cool stuff so this just has some honey on it
<Paradox> aw
<Paradox> i eat oatmeal every morning
<Paradox> put it in a crock pot the night before
<injekt> :D
<Paradox> let it simmer for 8 hours with some cream and milk in it
<Paradox> could use half and half but w/e
<injekt> wow 8 hours simmering
<Paradox> then in the morning, i throw some rasins and blueberries in
<Paradox> its awesomely good
<injekt> dem sum cooked oats yo
<Paradox> its gotten me through this winter
<injekt> i have raisins, that's a great idea
<Paradox> which is the coldest in memory
<Paradox> tip for rasins
<Paradox> soak them in brandy
<Paradox> or rum
<Paradox> they get big and plump
<injekt> you piss head
<Paradox> like in a pudding!
<rue> Mm rum
blacktulip has quit [Ping timeout: 240 seconds]
<Paradox> …
<injekt> ruem
<Paradox> anyone know if unicorn will ever gain support for SSEs?
sush24 has joined #ruby-lang
<rue> Rum and raisins, the breakfast of champions
<Paradox> i wanna use actioncontroller live
<Paradox> but dont want to switch 9 production apps to rainbows
<Paradox> or puma
blacktulip has joined #ruby-lang
<injekt> you want to use live in 9 production apps?
<Paradox> well no, but the manager wants it in the pipeline for them eventually
<injekt> I use thin
<Paradox> in production?
<injekt> yup
<injekt> thin is awesome in production
<manveru> you do know that thin isn't fashionable anymore? :)
<Paradox> didnt think it had the concurrency
<manveru> lol
<injekt> manveru: that's ok neither am i
<Paradox> manveru, next he's going to say use mongrel
<manveru> i use webrick, but it's ok
<Paradox> i use pow for development
<Paradox> and unicorn for production
<injekt> I have unicorn on some production apps
<injekt> thin for all work apps
<Paradox> pow+powder gem=bliss
nXqd_ has joined #ruby-lang
<Paradox> git clone railsproject; powder link; powder open
<injekt> heh
<manveru> wtf is powder?
<injekt> git clone railsproject; ln -s $(pwd) ~/.pow; open http://railsproject.dev
<injekt> manveru: a wrapper for controlling pow
<injekt> settings symlinks, restarting, opening in browser etc
<Paradox> manveru, gem that provides a nice wrapper around pow
<manveru> and pow is that osx only server_
<Paradox> yeah
<manveru> ok, no wonder i've never heard about it
<injekt> you must have heard of it you just got it right
<injekt> :D
<manveru> about pow, yeah, but not powder :)
<injekt> oic
<Paradox> i gotta say i'm a fan of puma's site
<Paradox> its gorgeous
<manveru> i need to know about pow in order to filter everything labeled pow as "not useful"
nXqd has quit [Ping timeout: 248 seconds]
<injekt> :)
<Paradox> its a lot like my early vision for my current portfolio
<injekt> wow unicorn/rainbows memory consumption is phat
<manveru> and not sure puma is really that stable yet
<Paradox> its not
<Paradox> thats why i dont use it
<Paradox> but damn is their site pretty
<Paradox> see…this is why i got into ruby in the first place
<Paradox> thats a site
<Paradox> for a WEB SERVER
<injekt> because of the pretty websites? oO
<Paradox> injekt, yes
<Paradox> im very visual
<injekt> have you seen ruby-doc ruby-lang and partners?
<manveru> people do the darnest things
<Paradox> rdoc.info
<injekt> they make me want to vomit
<injekt> meh yard
<Paradox> <3 yard
gjaldon has joined #ruby-lang
<manveru> rdoc is out of fashion too
<injekt> if rdoc is out of fashion, so is yard by now
<injekt> hey man, dont you mock cpan! everything else SUCKS compared to cpan
<Paradox> i like keeping yard installed because i can pull up docs on my local gems, without having to bulk up on rdoc files
<injekt> (ok maybe not their website design)
<Paradox> lol
<Paradox> that last one is just a bad joke
<darix> Paradox: did you finally get the backing for your claim what is not stable about puma? like what problems you ran into?
<Paradox> darix, no, and i've never used it
<Paradox> i dont think i've ever made that claim
<Paradox> i've just heard it ad nauseum
<darix> you did a few days ago
<darix> and wanted to ask your friends about it
<Paradox> oh, i may have been delirious at the time
<Paradox> i had a fever of 102ºF last week
<Paradox> it broke monday
<darix> and learn metric system ffs :p
<Paradox> i'll have to play with it
therod has quit [Quit: Leaving...]
<Paradox> darix, farenheight is used in medical the world over
<injekt> fahrenheit*
<Paradox> w/e
<manveru> not at any hospital i've been to :P
<Paradox> really
<Paradox> guess i was mislead on that as well
<Paradox> stupid lying international exchange med students
<workmad3> it's not used in the UK
<injekt> probably not in eu
<workmad3> dunno about the rest of the world
<Paradox> workmad3, the UK uses stones though
<manveru> i just remember 100°F is the temperature of the armpit of the wife of fahrenheit
<injekt> yes we do
<injekt> and we are proud of our stones
<Paradox> bunch of stoners
<darix> i have yet to see a doctor who tells me my temperature in fahrenheit
<workmad3> Paradox: not at the doctors anymore :(
<workmad3> that's all kilograms now :'(
<manveru> workmad3: welcome in the future
* darix throws stones at injekt
<injekt> weights in gyms etc have always been measured in kg here though
<injekt> it's only really our body weight we've always used stone for
<Paradox> darix, dont throw stones at inkjet
<workmad3> which is really depressing... suddenly your weight is a number about 5 times bigger
<Paradox> thats a good way to need a new printer
<manveru> just measure in tons then
<Paradox> angstroms
<workmad3> manveru: woo! I'm down to 1!!!
<Paradox> bah fuck it, newtons
<manveru> lol
<Paradox> thats all a scale measures anyway
<workmad3> Paradox: but I want to know my mass, not my weight :P
<Paradox> measuring actual mass is difficult
<manveru> measure in mol then
<Paradox> lets use cubits
<manveru> or cubic micrometers
<Paradox> bah
<workmad3> Paradox: I like to give fuel efficiency ratings in rods per hogshead
<Paradox> workmad3, i give it in hectares to a can of kerosene
<manveru> sorry, mg/mm³
<manveru> that says nothing about your total though
<workmad3> Paradox: but that's silly... hectares are a unit of area, not distance, and a can isn't a standard unit :P
<workmad3> manveru: well, if you give the overall density of a person, and couple that with their volume, then they should be able to work out their mass :)
<Paradox> workmad3, its a simpsons quote
s1n4 has joined #ruby-lang
<Paradox> sigh, now i need to go buy more toner
<Paradox> off to the monoprice mobile
<workmad3> Paradox: it wouldn't surprise me if farenheit is used more in medical centres across the world though... it is a scale more suited for medical use
<Paradox> ugh
<Paradox> fml
<Paradox> black toner on backorder
<Paradox> oh great
<Paradox> discontinued and replaced by a version $10 more expensive
<Paradox> ah well, guess i cant bitch about the price too much
<Paradox> its $100 cheaper than normal
sush24 has quit [Quit: This computer has gone to sleep]
gnufied has quit [Quit: Leaving.]
therod has joined #ruby-lang
sush24 has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
<Paradox> During a leisurely night drive, The Aquabats save a group of partying beachgoers from a gang of laser-blasting mummies. Making a hasty retreat in their Battletram, with the mummies in hot pursuit on motorcycles, the band continues the party on board, where Ricky falls smitten with a fellow party guest, unaware she's actually a three-headed siren in disguise bent on destroying everyone in sight.
<Paradox> erm
sulo has joined #ruby-lang
datanoise has joined #ruby-lang
dr_bob has joined #ruby-lang
sheerun has quit [Quit: ZNC - http://znc.in]
gnufied has joined #ruby-lang
llakey has quit [Ping timeout: 255 seconds]
<zzak> early bird gets his slides done the day of his presentation?
datanoise has quit [Ping timeout: 256 seconds]
llakey has joined #ruby-lang
banister`sleep has joined #ruby-lang
carloslopes has joined #ruby-lang
<injekt> :D
cultureulterior_ has joined #ruby-lang
torrieri has joined #ruby-lang
workmad3 has quit [Quit: Lost terminal]
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby-lang
lun_ has joined #ruby-lang
torrieri has quit [Ping timeout: 255 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
idkazuma has quit [Remote host closed the connection]
<zzak> is the phrase "too many chiefs and not enough indians" offensive?
Bearproof has joined #ruby-lang
<andrewvos> I guess
<andrewvos> To some at least
nguerin has quit [Remote host closed the connection]
<zzak> yeah
<zzak> does "too many chefs, not enough cooks" translate?
megha has joined #ruby-lang
Bearproof has quit [Quit: Leaving.]
setmeaway has quit [Quit: Leaving]
<zzak> google suggested too many cocks not enough hens
<zzak> i think ill pass on that one
<andrewvos> too many managers, not enough employees?
kristofferrr has joined #ruby-lang
innohero has joined #ruby-lang
emocakes has joined #ruby-lang
<injekt> too many kings, not enough pawns
dr_bob has quit [Quit: Leaving.]
<zzak> pawns is too demeaning
<zzak> trying to encourage hard work
<zzak> managers/employees has too many syllables
<zzak> haha
<injekt> too many captains, not enough sailors
goatish_mound has joined #ruby-lang
<zzak> thatll do
dr_bob has joined #ruby-lang
<matti> zzak: ;]
<zzak> makes it sound like were going on an adventure
spuk has quit [Ping timeout: 256 seconds]
<injekt> :D
<matti> ;p
torrieri has joined #ruby-lang
nguerin has joined #ruby-lang
imajes has quit [Excess Flood]
vlad_starkov has quit [Remote host closed the connection]
goatish_mound is now known as rsl
imajes has joined #ruby-lang
_tockitj has joined #ruby-lang
jxie has quit [Quit: leaving]
torrieri has quit [Ping timeout: 252 seconds]
retro|cz has joined #ruby-lang
krz has quit [Quit: krz]
richardburton has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
ioga_wrk has quit [Ping timeout: 248 seconds]
Banistergalaxy has joined #ruby-lang
AndChat| has quit [Ping timeout: 256 seconds]
<thisboy> wait wait
<thisboy> yall forgot too many pyramids not enough pharaos :D
<thisboy> my personal favorite :)
<thisboy> on that note im off to build my first pyramid
<thisboy> thanks again !! ~
ruurd has quit [Quit: Leaving...]
Bearproof has joined #ruby-lang
MaddinXx has joined #ruby-lang
banister`sleep has quit [Remote host closed the connection]
Bearproof has quit [Client Quit]
banister`sleep has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 264 seconds]
Banistergalaxy has joined #ruby-lang
dustint has joined #ruby-lang
<chekcmate> guys, what's the best way to break out of a do loop?
<tbuehlmann> have you tried `break`?
<chekcmate> not yet, wanted to ask first
<tbuehlmann> the other way around is better
<tbuehlmann> not always, but often
v1p has joined #ruby-lang
banister`sleep has quit [Read error: Connection reset by peer]
megha has quit [Read error: Connection reset by peer]
<chekcmate> tbuehlmann: I know, but the past few questions I did not ask here ended with "is it good like that?" -> "well, you CAN do it better like that: ..."
<chekcmate> so going with the best solution from beginning was my aim here ^^
<tbuehlmann> well, yeah, that's ruby
<tbuehlmann> and programming
mrbloo has joined #ruby-lang
<chekcmate> heh, yea :)
<chekcmate> anyways, thanks
<tbuehlmann> let tests pass, refactor later
<tbuehlmann> :)
richardburton has quit [Quit: Leaving.]
mrbloo has quit [Client Quit]
<chekcmate> TOO PUMPED TOO WAIT
<chekcmate> wait
<chekcmate> *to
soahccc_________ has quit [Remote host closed the connection]
<chekcmate> too pumped to think!
<chekcmate> tbuehlmann: alright, break actually breaks my other loops too ._.
<chekcmate> why's that?
soahccc has joined #ruby-lang
<chekcmate> I thought it just breaks the current loop
<ddfreyne> chekcmate: break only breaks out of the innermost loop
<chekcmate> ah yea it does
<chekcmate> hm.. sec
v1p has quit [Ping timeout: 272 seconds]
banister`sleep has joined #ruby-lang
<chekcmate> ha
<chekcmate> i didnt even need break
<chekcmate> I can just leave that case empty
sush24 has joined #ruby-lang
<chekcmate> when ddfreyne.include?("error"); #
sush24 has quit [Client Quit]
<soahccc> Is there some sort of ruby manifesting like rails' asset pipeline manifests for normal ruby? Sound odd I know but I finally need a single ruby file but don't want to develop it in one file... I could make a hackish solution (I guess there is no non-hackish one) but maybe someone got the same problem (I know about a script which creates a single file but this is a packer and have to unpack something before it can run).
thillux has joined #ruby-lang
<judofyr> soahccc: you can use Sprockets outside of Rails
<judofyr> soahccc: it's not very easy/elegant though
<soahccc> judofyr: with ruby? :)
<judofyr> soahccc: yes, Sprockets is just a regular Ruby library
glebm has joined #ruby-lang
torrieri has joined #ruby-lang
<soahccc> To clarify: I virtually want something which I can run on a file which then recursively go through require's and replace it with the corresponding contents of it
dhruvasagar has quit [Read error: Operation timed out]
<soahccc> That would be my hack.ish solution :)
<tbuehlmann> like `load`?
<judofyr> oh
<judofyr> soahccc: sorry. I misunderstood
<soahccc> judofyr: I wasn't clear enough I think, it's an unusual question though I guess.
<judofyr> soahccc: it's called a fatpacker in the Perl world
<judofyr> soahccc: it *should* be quite simple to make.
<chekcmate> what's the corresponding content to a require?
<chekcmate> I want to understand
<soahccc> judofyr: The script does not run without it's environment which for it has to be a single file. So I could introduce a custom require format to reduce the needed effort
<soahccc> chekcmate: the contents of the file you require and yes this doesn't apply generally as it is more the behaviour of load
torrieri has quit [Ping timeout: 248 seconds]
Uranio has joined #ruby-lang
<chekcmate> soahccc: dynamic require?
<chekcmate> (I'm still a beginner, it's just curiosity)
idkazuma has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
<judofyr> soahccc: can't you just do: def pack(name) puts File.read(name + '.rb') end
<judofyr> soahccc: then: pack('foo'); pack('foo/bar'); pack('foo/baz')
megha has joined #ruby-lang
<soahccc> chekcmate: requiring isn't the problem, the problem is that I want to develop in a normal manner (separate files) but then run a script which bundles all related files into a single one. This is a uncommon problem and very specific to my use case I suppose.
<chekcmate> ahhh
<chekcmate> yes, that sounds uncommon, heh
<soahccc> judofyr: yeah I thought I just use something like #= some/file/in/project and then write a little regex to pack it all together.
sush24 has joined #ruby-lang
<soahccc> Just if you're interested why I need that: I found a connector from (j)ruby to the minecraft bukkit API and I would like to play a bit with some mathematics to generate structures and so on. The normal java process is that you finally bundle your things into a .jar archive. The connector expects an .rb file and therefore I would like to bundle it finally.
jperry2 has quit [Remote host closed the connection]
Stilo has joined #ruby-lang
banister`sleep has quit [Read error: Connection reset by peer]
v1p has joined #ruby-lang
nXqd_ has quit [Quit: leaving]
imajes has quit [Excess Flood]
nXqd has joined #ruby-lang
banister_ has joined #ruby-lang
imajes has joined #ruby-lang
mistym has joined #ruby-lang
banister_ has quit [Read error: Connection reset by peer]
tonni has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
banisterfiend has joined #ruby-lang
<socialcoder> how to save a user input in command line to a text file
jtoy has joined #ruby-lang
<banisterfiend> socialcoder: figure it out yourself
<socialcoder> ok
<socialcoder> thanks fiend
<banisterfiend> if it sounded like a specific question rather than just "how do i write my app?" i'd be more willing to help
<banisterfiend> but hta'ts like 10 questions bundled into one
<socialcoder> I thought it was specific
vlad_starkov has quit [Ping timeout: 264 seconds]
<socialcoder> i want to take in user input
<socialcoder> like say login name password
<socialcoder> store it in a external text file
<banisterfiend> how far have you got? do you know how to get user input yet?
<socialcoder> gets.chomp
<banisterfiend> socialcoder: look up the docs for File.write and/or File.open
<banisterfiend> it'll tell you everything you need
<socialcoder> if I am using a specific text file, then I am guessing ARGV and STDIN.gets
<socialcoder> ok
carloslopes has quit [Remote host closed the connection]
__BigO__ has joined #ruby-lang
yeltzooo has quit [Ping timeout: 255 seconds]
<injekt> socialcoder: do you have a book or anything you're learning from? This is pretty basic Ruby
yeltzooo has joined #ruby-lang
<socialcoder> Learn Ruby The Hard Way
<socialcoder> it is not very detailed
<injekt> yeah that's a terrible resource
<injekt> corundum: books?
<corundum> books is "The Ruby Programming Language", "Eloquent Ruby", "Programming Ruby 1.9” (‘Pickaxe’) or see http://ruby-doc.org/bookstore/
<judofyr> injekt: terrible?
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<socialcoder> terrible?
<injekt> judofyr: I think so yeah, or at least when it first came out (ported from python) it had way too much python-esque code in it
sailias has joined #ruby-lang
<ddfreyne> that makes sense :)
<ddfreyne> I don't even remember how I learnt Ruby...
<injekt> I used the original pickaxe (which I now believe is also a bad example for newbies) :D
kith_ has joined #ruby-lang
<injekt> then moved to the ruby way
<injekt> which I liked
<judofyr> I also started with pickaxe (the 1st)
<socialcoder> then what is a good resource at the moment
<injekt> socialcoder: #
<injekt> oO
<injekt> in fact, chris vines thing might be useful for you
<injekt> pine*
<socialcoder> chris vines?
<socialcoder> ah
<injekt> socialcoder: http://pine.fm/LearnToProgram/
<injekt> go through that :)
jrafanie has joined #ruby-lang
<injekt> it's great for beginners
<socialcoder> and its learn by doing approach?
<gjaldon> socialcoder: yes
<gjaldon> socialcoder: that's a great book. i started out with that and really enjoyed it
chendo_ has quit [Ping timeout: 252 seconds]
kith has quit [Ping timeout: 252 seconds]
<socialcoder> wow, its got only 11 chapters
<gjaldon> socialcoder: injekt is right to suggest that. i'd recommend it too :)
<socialcoder> excluding the installation, only 10
<injekt> zzak: good luck for later and have fun!
chendo_ has joined #ruby-lang
<soahccc> injekt: Was ruby your first language?
<injekt> soahccc: no
jtoy_ has joined #ruby-lang
<injekt> soahccc: perl, java, c, others, ruby in that order
<lianj> so a roundtrip from perl to modern perl
<injekt> :D
<injekt> well apart from ruby I still writes lots of perl, and some go
<injekt> and haskell if I was to feel nerdy
<socialcoder> this book really looks interesting
<socialcoder> even though its 10 chapters
<socialcoder> content looks heavy on each chapter
<socialcoder> long chapters
<socialcoder> lots of explanation
<injekt> cool, now go read it
<socialcoder> ok Master
<socialcoder> ;)
<soahccc> well okay. I wish I would be able to code compiling languages. I switched from PHP and used those Switcherreferences :) I think it was a bad decision. I got so used to ruby syntax that I get annoyed when trying C or something
<injekt> oh i forgot about php, that came before perl
<injekt> times I prefer to forget
jtoy has quit [Ping timeout: 248 seconds]
jtoy_ is now known as jtoy
<yorickpeterse> PHP?
<ddfreyne> Ew PHP
<injekt> soahccc: I dont do much C anymore, I stopped teaching it about 9 months ago, I wouldn't feel bad for not knowing languages like that if you're happy with ruby/others
<yorickpeterse> injekt: zomg, you knew the C?
<soahccc> injekt: I'm really happy and I'm able to find ways to do a lot with ruby it never was build for. However sometime I wish I could do more fancy stuff :)
setmeaway has joined #ruby-lang
<darix> injekt: maybe we need something like coffeescript for C ;p
<injekt> yorickpeterse: I've probably written more C code than ruby code :(
<injekt> soahccc: like what?
vlad_sta_ has quit [Read error: Connection reset by peer]
<lianj> soahccc: fancy like what?
<injekt> darix: you mean Go? :D
vlad_starkov has joined #ruby-lang
<darix> injekt: still too many {} :p
<injekt> lianj: faster again, c'mon man
<yorickpeterse> darix: Vala, Haxe, etc
<injekt> darix: heh yeah
<lianj> injekt: :| i should just give up
<injekt> lianj: then it wouldn't be fun :(
<soahccc> Well for example modding existing applications and such things. Things like hooking into system specific things
<lianj> hehe true
torrieri has joined #ruby-lang
<injekt> soahccc: maybe you should give writing a ruby c ext a go
<lianj> or ruby + ffi is a powerful combination
<soahccc> And GUI stuff apart from WEB (yeah I know there are some things but they're limited usually or require things like WinAPI or Objective C knowledge
<ddfreyne> <3 Go
<darix> soahccc: well you could see how far you can get with FFI
<injekt> ddfreyne: +1
<darix> also for gtk you could wrap around the gobject introspection stuff
<darix> if i recall correctly there are python bindings using that.
<chekcmate> hm... number.abs * "test" <= I thought this works?
<injekt> chekcmate: number * string makes no sense
marr has quit [Read error: Connection reset by peer]
<injekt> string * number does
<chekcmate> AH
<chekcmate> AH
<chekcmate> AH
<injekt> exactly
<lianj> darix: https://github.com/mvz/ruby-gir-ffi can be nice for gobject stuff
<chekcmate> thanks injekt
tonni has joined #ruby-lang
<darix> so there you go
<soahccc> injekt: Well I sometimes try to give a language like C another go but usually I get demotivated to fast I suppose. Never get something useful to run. It's hard for me to learn "from scratch" I usually learned languages by modifying other applications in the first place :)
torrieri has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby-lang
Aiur has joined #ruby-lang
jrafanie has quit [Quit: jrafanie]
poga has joined #ruby-lang
carloslopes has joined #ruby-lang
cirenyc has joined #ruby-lang
<chekcmate> injekt: you know xpath, right?
<injekt> chekcmate: i do
<chekcmate> and you also know the function "inspect object" in chromium
<chekcmate> where you can right-click and "Copy XPATH" is possible
<injekt> in dev tools?
<injekt> yeah
<chekcmate> something like //*[@id="result_0"]/h3/a/span comes out
<injekt> yup
<chekcmate> I can't use this directly with nokogiris doc.xpath, can I?
<injekt> yes
<chekcmate> I can?
<chekcmate> hm..
v1p has quit [Ping timeout: 255 seconds]
<injekt> yup
<chekcmate> it somehow does not for me
<injekt> what's the xpath?
mrbloo has joined #ruby-lang
<chekcmate> the one I posted
<chekcmate> doc.xpath("//*[@id='result_0']/h3/a/span").each do |link| puts link end
<injekt> can you paste the html?
<chekcmate> it's amazon :)
<chekcmate> when you search for something it's the first result
<chekcmate> e.g.
jxie has joined #ruby-lang
<chekcmate> <span class="lrg bold">Canon CanoScan LIDE 210 Scanner</span> <= that would be it
<injekt> ah yes
<injekt> you want to fetch all those link texts?
<chekcmate> no, just the first one, result_0
<injekt> oh
<injekt> doc.at_xpath('//span[@class="lrg bold"]')
<chekcmate> .each is wrong
<darix> i wonder if amazon has an api for things like this
<chekcmate> it has
<judofyr> why not use CSS selectors?
<chekcmate> I'm just tinkering around with nokogiri though
kristofferrr has quit [Quit: ❤]
<chekcmate> haven't heard of it :)
<judofyr> doc.at('span.lrg.bold') looks nicer
v1p has joined #ruby-lang
<chekcmate> but but but
<chekcmate> you modified the xpath
<injekt> yes
<injekt> because chromes xpath copy sucks
<chekcmate> oh......
<chekcmate> I didn't know
<injekt> the wildcard crap is not necessary
<injekt> and yeah css selectors might be nicer as judofyr says, I'm just a sucker for xpath
<darix> good thing that nokogiri can convert between the 2 :p
<chekcmate> ^^
<chekcmate> alright, I'll take a look, big thanks!
carloslopes has quit [Ping timeout: 244 seconds]
G________ has joined #ruby-lang
G________ has quit [Client Quit]
jgv has joined #ruby-lang
sailias1 has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
jonahR has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
tomzx_mac has joined #ruby-lang
<chekcmate> RAAAR!
scampbell has joined #ruby-lang
ddd has quit [Ping timeout: 245 seconds]
Aiur has quit [Quit: Computer has gone to sleep.]
<chekcmate> it doesn't work at all
<chekcmate> my doc is filled, nothing comes out of xpath or css though... :(
<injekt> chekcmate: huh?
mistym has quit [Remote host closed the connection]
<chekcmate> injekt: there's no output at all ^^
<injekt> chekcmate: can you paste the code?
<chekcmate> yes
<darix> chekcmate: require 'pry' -> put binding.pry at the place you want to debug
<darix> happy tinkering
<chekcmate> that sounds really neat!
<chekcmate> thanks darix
<chekcmate> injekt: http://pastie.org/5963418
banisterfiend has joined #ruby-lang
<injekt> chekcmate: that's invalid xpath
<injekt> need quotes around the class
<injekt> @class='lrg bold'
<chekcmate> is used them the other way round
<chekcmate> can I do "//span[@class='lrg bold']" instead of '//span[@class="lrg bold"]' ?
<injekt> sure
<lianj> maybe its added via ajaxy responses
banisterfiend has quit [Remote host closed the connection]
<lianj> p doc.to_html.match(/lrg bold/) => nil
<darix> so that headless webkit thing needs to be used?
unlikely_monkey has joined #ruby-lang
thillux_ has joined #ruby-lang
thillux has quit [Ping timeout: 246 seconds]
<chekcmate> lianj: um, does that mean it won't work that way?
<injekt> I dont think it's that
<lianj> injekt: i do
<injekt> lianj: the links are all there
<lianj> if you just curl it they are there? i only see them in chromium
<chekcmate> ah so the href above the node I want is not visible?
unlikely_monkey has quit [Remote host closed the connection]
outoftime has joined #ruby-lang
<injekt> the markup must be altered after page load, but the results are there
sailias1 has quit [Quit: Leaving.]
sailias has joined #ruby-lang
<lianj> injekt: ah youre right
gnufied has quit [Quit: Leaving.]
<lianj> injekt: amazon just trolled us
wyhaines has joined #ruby-lang
<chekcmate> User-Agent.. uhuu?
<lianj> trolled us pretty hard, fuckers
<injekt> ;)
<chekcmate> that was all planned, lianj heh
<chekcmate> awesome, thanks
<chekcmate> but that only goes for amazon in that case, right?
<injekt> what?
<injekt> also you could drop div[id^=result]
<chekcmate> User-Agent is only needed at "special sites"?
<injekt> doc.css('.productTitle a') is fine
Banistergalaxy has quit [Ping timeout: 248 seconds]
<injekt> chekcmate: im not using User-Agent it sends the ruby one
chimkan has joined #ruby-lang
<chekcmate> oops, I meant lianj
<injekt> but any website can alter data depending on the user-agent
<injekt> and yes it's more popular with major websites
<injekt> google does it, for example
<chekcmate> I see.. is that very usual?
<injekt> only on larger websites who care about you scraping them
<injekt> if I were you though, I would always send a valid user-agent
<injekt> that is, spoof it
<darix> chekcmate: if you want to make more than just scraping one page. checkout mechanize
tonni has quit [Ping timeout: 272 seconds]
<chekcmate> alright :)
<injekt> yeah mechanize taps into nokogiri too
<injekt> agent.get(url).parser.xpath('...')
Bearproof has joined #ruby-lang
<chekcmate> again, many ways to rome!
<darix> and mechanize makes it nice to programatically drive the webapp
<darix> like filling out forms and such
<chekcmate> niceeee
<injekt> and it uses net-http-persistent which is majorly fast on successive requests
bantic has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
torrieri has joined #ruby-lang
mistym has joined #ruby-lang
tonni has joined #ruby-lang
<chekcmate> ahh... finally everythign works like a charme, awesome*10
<chekcmate> not 10*awesome!
<injekt> awesome*10!
<chekcmate> awesome**10 !
g0bl1n has joined #ruby-lang
<lianj> injekt: but you can verify that it works when not sending the ruby useragent right?
gnufied has joined #ruby-lang
gustavnils has joined #ruby-lang
<injekt> lianj: looks like it
torrieri has quit [Ping timeout: 245 seconds]
<lianj> ok
<injekt> with stuff like this i would always spoof the agent
<lianj> ack, i usually habe a list of agents to do Agents.sample on each of them
<lianj> true still same ip, but hey
io_syl has joined #ruby-lang
<injekt> yeah if I using mech I usually do the same with Mechanize::AGENT_ALIASES
<chekcmate> so injekts method worked
<injekt> \o/
<chekcmate> I tried the one lianj posted too, but it stays nil then
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
enebo has joined #ruby-lang
nguerin has quit [Remote host closed the connection]
dabradley has quit [Ping timeout: 256 seconds]
nguerin has joined #ruby-lang
tonni has quit [Remote host closed the connection]
wicked_shell has joined #ruby-lang
<injekt> heh
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
<yorickpeterse> lol wat
<injekt> "Someone posted rubygems.org's config/*.yml to pastie. Didn't include the S3 bucket secret key, but going to reset everything anyway."
richardburton has joined #ruby-lang
<yorickpeterse> How did they get it?
tomzx_mac has quit [Ping timeout: 245 seconds]
<tpope> probably a braindead contributor
<tpope> oh, no, the article actually explains it
<yorickpeterse> Which one?
methods has joined #ruby-lang
marr has joined #ruby-lang
chimkan has quit [Quit: chimkan]
<chekcmate> aw... nokogiri + open-uri != umlauts ._.
methods has left #ruby-lang [#ruby-lang]
<judofyr> chekcmate: you probably need to do a .force_encoding("UTF-8")
<chekcmate> I tried doc.encoding = "UTF-8"
<chekcmate> and #Encoding: UTF-8
<chekcmate> and WIN32OLE.codepage = WIN32OLE::CP_UTF8
<chekcmate> doc.force_encoding I will try
<judofyr> chekcmate: not on doc, but on the string you get from open-uri. before you parse it with Nokogiri
<chekcmate> oh alright
<chekcmate> yea, I already got undefined method `force_encoding=' for #<Nokogiri::HTML::Document:0x2ea5038> hehe
gregmoreno has joined #ruby-lang
<chekcmate> judofyr: the only string before nokogiri is the url...?
chimkan_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<chekcmate> The only thing force_encoding does in 1.9 is that it changes the encoding field of the string, it does not actually modify the string's bytes. :(
<injekt> chekcmate: no, nokogiri does .read() on the IO object open returns
<injekt> string = open(url).read
<chekcmate> I don't read
<chekcmate> I just open
<injekt> string.force_encoding('UTF-8')
sush24 has quit [Quit: This computer has gone to sleep]
<injekt> doc = Nokogiri.HTML(string)
<injekt> chekcmate: right, Nokogiri calls .read
<chekcmate> ah, so I have to split
<injekt> Nokogiri does this: obj.respond_to?(:read) obj.read else obj
<injekt> no
<injekt> wait 'split' meaning separate the open and doc? yes
<chekcmate> yes
<chekcmate> pardon
richardburton has quit [Quit: Leaving.]
<injekt> it's to support duck typing, so you can do Nokogiri.HTML File.new('foo.html') rather than having to pass a string :)
<chekcmate> ok
gregmoreno has quit [Remote host closed the connection]
<chekcmate> lulz
<chekcmate> invalid byte sequence in UTF-8
sulo has quit [Remote host closed the connection]
<injekt> is this amazon/
<chekcmate> yeeees ^^
<injekt> what's the url?
<chekcmate> http://www.amazon.de/s/ref=nb_sb_noss?__mk_de_DE=ÅMÅZÕÑ&url=search-alias%3Daps&field-keywords=für
<injekt> what ruby version are you using?
<chekcmate> ruby 1.9.3p374
<injekt> and this is with the same code as before?
<chekcmate> yes sir
<chekcmate> I just added your suggestion
rins has joined #ruby-lang
<chekcmate> it also works until some umlaut comes
<injekt> did you add # coding: utf-8 to the top of your file?
<injekt> that's the issue
torrieri has joined #ruby-lang
<chekcmate> yes, ofc
<chekcmate> #Encoding: UTF-8
<chekcmate> right at the beginning
Swimming_Bird has joined #ruby-lang
<injekt> and you still get "invalid multibyte char" ?
<chekcmate> invalid byte sequence in UTF-8
<chekcmate> yep
* chekcmate is no fan of umlauts...
torrieri has quit [Client Quit]
<injekt> mmm Omelette
<chekcmate> injekt: let's stop it here for today, I want to head home, heh
<injekt> right-o
<chekcmate> I'll take a look at it when my head is clear again, if I don't get it after that, I'll come crying again :)
<chekcmate> have a nice day, bye bye
<injekt> cya
chekcmate has quit [Quit: Page closed]
bradland has joined #ruby-lang
carloslopes has joined #ruby-lang
jrafanie has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
mercwithamouth has joined #ruby-lang
dabradley has joined #ruby-lang
imajes has quit [Excess Flood]
JohnBat26 has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
imajes has joined #ruby-lang
marr has quit []
v1p has quit [Ping timeout: 276 seconds]
richardburton has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
vlad_starkov has quit [Remote host closed the connection]
KelebekUsr1 has joined #ruby-lang
sulo has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
KelebekUsr1 has quit [Ping timeout: 240 seconds]
torrieri has joined #ruby-lang
nXqd has quit [Ping timeout: 252 seconds]
nXqd has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
megha is now known as firewall
sulo has quit [Ping timeout: 256 seconds]
torrieri has quit [Ping timeout: 248 seconds]
solars has quit [Ping timeout: 252 seconds]
jrafanie has quit [Quit: jrafanie]
gnufied has joined #ruby-lang
wallerdev has joined #ruby-lang
JonnieCache has joined #ruby-lang
sailias has quit [Read error: Connection reset by peer]
zmack has quit [Remote host closed the connection]
sailias has joined #ruby-lang
lun_ has quit [Remote host closed the connection]
poga has quit [Remote host closed the connection]
jbsan has quit [Quit: jbsan]
sailias1 has joined #ruby-lang
sailias has quit [Quit: Leaving.]
torrieri has joined #ruby-lang
torrieri has quit [Read error: Connection reset by peer]
torrieri_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
g0bl1n has quit [Quit: g0bl1n]
sush24 has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
socialcoder has quit []
blazes816 has joined #ruby-lang
mrbloo has quit [Quit: mrbloo]
datanoise has joined #ruby-lang
torrieri_ has quit [Quit: Leaving...]
fookr has joined #ruby-lang
judofyr has quit [Remote host closed the connection]
idkazuma has quit [Remote host closed the connection]
MaddinXx has quit [Remote host closed the connection]
MaddinXx_ has joined #ruby-lang
Nisstyre-laptop has quit [Ping timeout: 264 seconds]
Kuifje has joined #ruby-lang
Kuifje has quit [Changing host]
Kuifje has joined #ruby-lang
s1n4 has quit [Quit: leaving]
MaddinXx_ has quit [Read error: Connection reset by peer]
mephux has quit [Excess Flood]
MaddinXx_ has joined #ruby-lang
thisirs has quit [Read error: Connection reset by peer]
grough has joined #ruby-lang
kentos has joined #ruby-lang
mephux has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
wicked_shell has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 276 seconds]
krohrbaugh has joined #ruby-lang
zhul_mechanos has joined #ruby-lang
alvaro_o has joined #ruby-lang
rippa has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
peppyheppy has joined #ruby-lang
Uranio has quit [Quit: while you reading this, a kitty dies]
cirenyc has quit [Quit: Leaving...]
dr_bob has joined #ruby-lang
zhul_mechanos_ has joined #ruby-lang
soypirate has joined #ruby-lang
gregmore_ has joined #ruby-lang
zhul_mechanos has quit [Ping timeout: 248 seconds]
zhul_mechanos_ is now known as zhul_mechanos
letch_ has joined #ruby-lang
mtparet has joined #ruby-lang
torrieri has joined #ruby-lang
gregmore_ has quit [Client Quit]
gregmoreno has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
andreal has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
bzb has joined #ruby-lang
torrieri has quit [Ping timeout: 252 seconds]
__BigO__ has quit [Remote host closed the connection]
gouthamgandhi has joined #ruby-lang
gouthamgandhi has quit [Client Quit]
gjaldon has quit [Remote host closed the connection]
__BigO__ has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
datanois1 has joined #ruby-lang
bradland_ has joined #ruby-lang
bradland has quit [Read error: Connection reset by peer]
bradland_ is now known as bradland
datanoise has quit [Read error: Connection reset by peer]
__butch__ has joined #ruby-lang
mrbloo has joined #ruby-lang
grough has quit [Quit: Computer has gone to sleep.]
swav has quit [Remote host closed the connection]
__BigO__ has quit [Remote host closed the connection]
therod has quit [Quit: Leaving...]
brianpWins has joined #ruby-lang
__BigO__ has joined #ruby-lang
dr_bob has quit [Read error: Connection reset by peer]
alexkira has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
kcassidy has left #ruby-lang [#ruby-lang]
gregmoreno has quit [Ping timeout: 244 seconds]
JohnBat26 has joined #ruby-lang
shtirlic has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
chekcmate has joined #ruby-lang
<chekcmate> you guys you guys!
<chekcmate> why is doc.css("...") not the same as doc.css("...").first?
gregmoreno has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
<mistym> chekcmate: (Assuming you're talking about Nokogiri) Because doc.css("...") returns a Nokogiri::XML::NodeSet object, which is an iterable set of objects. doc.css("...").first returns the first item in that NodeSet.
<chekcmate> ahh
<chekcmate> that sucks
<injekt> why?
<chekcmate> so all my following, based on the possibillity of obj.text wont work
<injekt> there's at_css
<chekcmate> no
srbaker has joined #ruby-lang
<chekcmate> it's as mistym said
<injekt> I know
<injekt> and im saying there's an at_css
<mistym> and #at_css(foo) is the same as #css(foo).first
__butch__ has quit [Remote host closed the connection]
<chekcmate> ok, thanks ^^ you even posted that earlier
<injekt> right, except it stops at the first node found
<injekt> kinda like #find
<chekcmate> actually better using that, understood sir
<chekcmate> but how can I get my loved .text back? :(
<chekcmate> to_s?
<chekcmate> uh that works
<chekcmate> ah
srbaker has quit [Client Quit]
<injekt> huh? at_css('...').text ?
<chekcmate> no
<chekcmate> no
<chekcmate> err yea, that's what i'd like
<injekt> no no yes?
maxmanders has quit [Quit: Computer has gone to sleep.]
<chekcmate> hah, shouldnt have tested that vodka my friend brought from moscow
<chekcmate> does that work?
<chekcmate> at_css('...').text
<injekt> yes at_css returns an XML::Node which has the i-method text
<chekcmate> naw doesnt :(
<mistym> When you program on vodka sometimes you don't end up with the code you set out to write
<chekcmate> it's not that bad yet
<chekcmate> maybe
<chekcmate> yay, fixed it
<chekcmate> time for more wodka! cheerio folks!
chekcmate has quit [Quit: Page closed]
robotmay has quit [Ping timeout: 276 seconds]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
jtoy has quit [Quit: jtoy]
vlad_starkov has quit [Remote host closed the connection]
io_syl has quit [Ping timeout: 248 seconds]
robotmay has joined #ruby-lang
towski has joined #ruby-lang
ioga_wrk has joined #ruby-lang
io_syl has joined #ruby-lang
robotmay has quit [Ping timeout: 248 seconds]
alexkira has left #ruby-lang [#ruby-lang]
retro|cz has quit [Ping timeout: 272 seconds]
jgv has quit [Quit: Computer has gone to sleep.]
Uranio has joined #ruby-lang
<injekt> willy wodka
robotmay has joined #ruby-lang
mrsolo has joined #ruby-lang
LanceHaig has left #ruby-lang ["Leaving"]
<yorickpeterse> and the drunkard factory
torrieri has joined #ruby-lang
cultureulterior_ has quit [Quit: cultureulterior_]
tonni has joined #ruby-lang
<injekt> definitely a new movie idea
<injekt> I like the nerds in space one too, though
<injekt> i guess that's been done before
torrieri has quit [Ping timeout: 264 seconds]
rwilcox has joined #ruby-lang
glebm has joined #ruby-lang
chendo_ has quit [Ping timeout: 252 seconds]
<yorickpeterse> Drunken Inkjets In Space: they can take his rubies but they will never take his love of interpretive dance
<yorickpeterse> that sounded better in my head
jtoy has joined #ruby-lang
<injekt> i dunno it sounded pretty good in mine too
torrieri has joined #ruby-lang
richardburton has quit [Quit: Leaving.]
wallerdev has quit [Quit: wallerdev]
torrieri has quit [Client Quit]
_tockitj has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
glebm has joined #ruby-lang
letch_ has left #ruby-lang [#ruby-lang]
jbsan has joined #ruby-lang
setmeaway has quit [Quit: Leaving]
jbsan has quit [Quit: jbsan]
srbaker has joined #ruby-lang
Stilo has joined #ruby-lang
mytrile has joined #ruby-lang
<Uranio> could Observe use for manage events
<Uranio> ?
shtirlic has joined #ruby-lang
jgv has joined #ruby-lang
tbuehlmann has joined #ruby-lang
sn0wb1rd has left #ruby-lang [#ruby-lang]
mistym is now known as mistym_lunch
shtirlic has quit [Ping timeout: 252 seconds]
torrieri has joined #ruby-lang
lupine has quit [Quit: If you see this, my dogfood was poisoned]
cyndis has quit [Ping timeout: 252 seconds]
cyndis has joined #ruby-lang
lupine has joined #ruby-lang
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
torrieri has quit [Ping timeout: 276 seconds]
shtirlic has joined #ruby-lang
tenderlove has joined #ruby-lang
rwilcox has quit [Ping timeout: 248 seconds]
lupine has quit [Quit: If you see this, my dogfood was poisoned]
techlife has quit [Read error: Connection reset by peer]
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
headius has joined #ruby-lang
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
publicvoid has quit [Remote host closed the connection]
techlife has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
chendo_ has joined #ruby-lang
lupine has joined #ruby-lang
Bearproof has quit [Quit: Leaving.]
sush24 has joined #ruby-lang
robotmay_ has joined #ruby-lang
robotmay has quit [Ping timeout: 255 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
<zzak> injekt: thanks dood
Swimming_Bird has joined #ruby-lang
swav has joined #ruby-lang
robotmay has joined #ruby-lang
swav has quit [Remote host closed the connection]
robotmay_ has quit [Ping timeout: 260 seconds]
soypirate has quit [Quit: Leaving]
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
Guest__ has quit [Quit: Computer has gone to sleep.]
Weems has quit [Read error: Connection reset by peer]
banisterfiend has quit [Remote host closed the connection]
bluepojo has joined #ruby-lang
fookr has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby-lang
lun_ has joined #ruby-lang
Stereo_ has joined #ruby-lang
benanne has joined #ruby-lang
Bearproof has joined #ruby-lang
mtparet has quit [Ping timeout: 244 seconds]
ddv has quit [Changing host]
ddv has joined #ruby-lang
toretore has quit [Quit: Leaving]
Uranio has quit [Quit: while you reading this, a kitty dies]
peppyheppy_ has joined #ruby-lang
rippa has quit [Ping timeout: 240 seconds]
sailias1 has quit [Ping timeout: 276 seconds]
peppyheppy has quit [Ping timeout: 244 seconds]
mytrile has quit [Remote host closed the connection]
peppyheppy_ is now known as peppyheppy
tbuehlmann has quit [Remote host closed the connection]
havenn has joined #ruby-lang
mistym_lunch is now known as mistym
lun_ has quit [Read error: Connection reset by peer]
lun_ has joined #ruby-lang
chendo_ has quit [Ping timeout: 244 seconds]
s0ber has quit [Read error: Connection reset by peer]
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
s0ber has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
nkr has quit [Quit: Linkinus - http://linkinus.com]
peppyheppy has quit [Quit: peppyheppy]
ruurd has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 256 seconds]
peppyheppy has joined #ruby-lang
peppyheppy_ has joined #ruby-lang
ryanv-raptor has joined #ruby-lang
Stereo_ has quit [Remote host closed the connection]
peppyheppy has quit [Ping timeout: 248 seconds]
peppyheppy_ is now known as peppyheppy
s1n4 has joined #ruby-lang
vlad_starkov has joined #ruby-lang
s1n4 has quit [Ping timeout: 255 seconds]
<injekt> wow heroku disables ruby deploys
s1n4 has joined #ruby-lang
<canton7> hmm?
vlad_starkov has quit [Remote host closed the connection]
<canton7> ah, temporary!
<havenn> canton7: Just 50,667 gems to verify. I gotta read up on gem signing.
mytrile has joined #ruby-lang
<canton7> I use my own buildpack anyway...
<canton7> heh, yeah maybe
bluepojo_ has joined #ruby-lang
peppyheppy has quit [Quit: peppyheppy]
bluepojo has quit [Quit: Leaving.]
bluepojo_ has left #ruby-lang [#ruby-lang]
bluepojo has joined #ruby-lang
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
benanne has quit [Ping timeout: 246 seconds]
mytrile has quit [Remote host closed the connection]
totallymike has quit [Read error: Operation timed out]
Stilo has joined #ruby-lang
totallymike has joined #ruby-lang
jrafanie has joined #ruby-lang
MaddinXx_ has quit [Remote host closed the connection]
forrest has joined #ruby-lang
peppyheppy has joined #ruby-lang
mercwithamouth has joined #ruby-lang
chendo_ has quit [Ping timeout: 252 seconds]
totallymike has quit [Ping timeout: 256 seconds]
grough has joined #ruby-lang
peppyheppy has quit [Client Quit]
carloslopes has quit [Remote host closed the connection]
chendo_ has joined #ruby-lang
vgoff has quit [Ping timeout: 245 seconds]
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
totallymike has joined #ruby-lang
benanne has joined #ruby-lang
vgoff has joined #ruby-lang
torrieri has joined #ruby-lang
jbsan has joined #ruby-lang
peppyheppy has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<yorickpeterse> Ugh, Ripper is annoying sometimes
jonahR has quit [Quit: jonahR]
gustavnils has quit [Quit: Textual IRC Client: www.textualapp.com]
tenderlove has joined #ruby-lang
tenderlo_ has joined #ruby-lang
zmack has joined #ruby-lang
therod has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 246 seconds]
cirenyc has joined #ruby-lang
nguerin has quit [Remote host closed the connection]
tenderlove has quit [Ping timeout: 240 seconds]
mjolk has joined #ruby-lang
vlad_starkov has joined #ruby-lang
tonni has quit [Remote host closed the connection]
<yorickpeterse> whitequark: https://github.com/rubinius/melbourne/commit/a975e6d3ad7d3ec2342375a828874535f71d7bc6 maybe, just maybe we'll have a new melbourne at some point
<yorickpeterse> I just hope it can be run on non rbx implementations
mytrile has joined #ruby-lang
mephux has quit [Excess Flood]
blacktulip has quit [Remote host closed the connection]
mephux has joined #ruby-lang
shtirlic_ has joined #ruby-lang
<yorickpeterse> Ripper.sexp('return 10, 20') # => [:return, [:args_add_block, [...., false]]] shit like this is what I hate about Ripper
<whitequark> yorickpeterse: melbourne = cext.
<whitequark> the less cexts we have, the better
shtirlic has quit [Ping timeout: 264 seconds]
<yorickpeterse> hrm
<injekt> that code hurts my face
<yorickpeterse> god damn it, that means I'm stuck with fucking Ripper for longer than I hoped for
<injekt> yorickpeterse: what for?
<yorickpeterse> My linter
<injekt> ah
soypirate has joined #ruby-lang
<zenspider> new melbourne! hahaha
torrieri has quit [Quit: Leaving...]
<whitequark> yorickpeterse: maybe I finish my Ragel update of RP soon
<whitequark> Ragel 7 will probably have way more sane (and faster) Ruby codegen
<yorickpeterse> that would be great, right now I just keep bumping into issues with Ripper's output and inconsistencies
<whitequark> well I've got in touch with the Ragel author. R6.7 codegen is truly horrible both in performance and readability
nguerin has joined #ruby-lang
<yorickpeterse> When is Ragel 7 going to be out?
<whitequark> yorickpeterse: dunno, probably several months. Shouldn't bother you as RP redistributes the compiled lexer.
<andrewvos> Anyone know of something that allows you to use vcr but for another language? Basically it would just take all requests and either proxy them or respond with the vcr cached version.
<yorickpeterse> whitequark: true but if the code generation/performance is terrible then I do care
<whitequark> yorickpeterse: the current one is ~3x slower than old regexp lexer on my tests
<whitequark> and I already know how to improve it (I think)
<yorickpeterse> 3x slower as in 300 ms instead of 100 or 3 seconds instead of 1?
<andrewvos> pls to sen teh codes thx
<yorickpeterse> I want my linter to (at some point) be able to do it's work in less than a second
<yorickpeterse> * its
thone has joined #ruby-lang
<whitequark> yorickpeterse: zenspider claims that RP is twice as slow as MRI+PT: https://github.com/seattlerb/ruby_parser
tonni has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile has quit [Read error: Connection reset by peer]
mytrile has joined #ruby-lang
<yorickpeterse> I can't use RP
thone_ has quit [Ping timeout: 245 seconds]
<yorickpeterse> otherwise I would
<andrewvos> hallp
zmack has quit [Remote host closed the connection]
<whitequark> yorickpeterse: I meant that by transitivity, RP+Ragel would be six times as slow as MRI.
<whitequark> in the current form.
<yorickpeterse> hmm
therod has quit [Quit: Leaving...]
<andrewvos> Every time I see whitequark talk I have to google something :/
firewall is now known as megha
<zenspider> whitequark: ?? your lexer is 3x slower than mine?!? that seems unpossible
<zenspider> or did I misunderstand something?
<whitequark> zenspider: roughly 3x slower, yes.
<whitequark> what surprises you here?
<zzak> i am soo nerved up
<drbrain> zzak: you'll be fine!
<zzak> i want to change my title
<zzak> "ruby: or why i love eric hodel"
torrieri has joined #ruby-lang
<zzak> drbrain: is gems fixed now?
<drbrain> zzak: we're verifying checksums
nguerin has quit [Remote host closed the connection]
<zenspider> whitequark: I thought ragel would generate faster code than my horrible crap
baba_bubba has joined #ruby-lang
<whitequark> zenspider: but it processes the character one-by-one
<whitequark> *characters
<whitequark> it's basically a huge case in a loop
thillux_ has quit [Remote host closed the connection]
<whitequark> the main reason your current lexer is as fast as it is (and I admit it's pretty fast) is that Oniguruma is
jrafanie has quit [Quit: jrafanie]
fsvehla has quit [Quit: fsvehla]
<whitequark> zenspider: plus ragel knows nothing about strings; it's an FSM which dispatches on numbers. So I have to feed it something like (chars[i] & 0x7f) as input.
havenn has quit [Remote host closed the connection]
torrieri has quit [Quit: Linkinus - http://linkinus.com]
<whitequark> I'm actually somewhat surprised it's only 3x slower. I do have some ideas about optimizing that, though.
torrieri has joined #ruby-lang
<tpope> :q
<tpope> erp
havenn has joined #ruby-lang
mrbloo has quit [Quit: mrbloo]
maxmanders has joined #ruby-lang
havenn has quit [Ping timeout: 276 seconds]
jonahR has joined #ruby-lang
ilyam has joined #ruby-lang
ilyam has quit [Remote host closed the connection]
tenderlo_ has quit [Remote host closed the connection]
therod has joined #ruby-lang
ilyam has joined #ruby-lang
havenn has joined #ruby-lang
nXqd has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
idkazuma has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
jrafanie has joined #ruby-lang
<zenspider> I thought regexp ranges were greedy?!?
<zenspider> I have test failures because it is only slurping up the minimum
scampbell has quit [Quit: Leaving]
<zzak> i wonder if i should live commit this: https://github.com/ruby/ruby/pull/243
<Kuifje> + is greedy
<Kuifje> unless you add a question mark, like so: +?
<whitequark> ("."*10) =~ /(.{0,5})/; $1
<whitequark> => "....."
<whitequark> they are
lun_ has quit [Ping timeout: 252 seconds]
lun_ has joined #ruby-lang
sduckett has joined #ruby-lang
grough has quit [Quit: Computer has gone to sleep.]
soypirate has quit [Quit: Leaving]
headius has quit [Quit: headius]
andreal has quit [Quit: Leaving]
mytrile has quit [Remote host closed the connection]
KINGSABRI has joined #ruby-lang
<KINGSABRI> hi
dustint has quit [Ping timeout: 272 seconds]
<KINGSABRI> plz I need to read binary file and convert it to hex string,,
ruurd has quit [Quit: Leaving...]
Mon_Ouie has quit [Ping timeout: 272 seconds]
<whitequark> File.read('foo', 'rb').each_byte.map { |b| "%02x" % b }.join
<whitequark> KINGSABRI: ^
<zenspider> I've got set of strange failures for {4,12} but not for +
<zenspider> idgi
<lianj> File.read('foo', 'rb').unpack("H*")[0]
ruurd has joined #ruby-lang
<KINGSABRI> whitequark, TypeError: can't convert String into Integer
chendo_ is now known as chendo
<KINGSABRI> what "%02x" % b means ?
<whitequark> KINGSABRI: strange, because it works for me. RUBY_VERSION?
<zenspider> ah. I was truncating and hiding my truncation from myself. :(
<KINGSABRI> 1.9.3
<whitequark> KINGSABRI: sorry, File.read('foo', mode: 'rb').each_byte.map { |b| "%02x" % b }.join
Bearproof has left #ruby-lang [#ruby-lang]
<KINGSABRI> whitequark, works fine
<KINGSABRI> but I didn't understand "%02x" % b
<whitequark> KINGSABRI: check doc on printf/sprintf
<whitequark> this is equivalent to b.to_s(16).rjust(2, '0'), but shorter
ilyam has quit [Ping timeout: 276 seconds]
cirenyc has quit [Quit: Leaving...]
<lianj> KINGSABRI: use unpack.
<whitequark> oh right. File.read(...).unpack("H*")
__BigO__ has quit [Remote host closed the connection]
<whitequark> actually, the result of #unpack and #each_byte#map differ by one byte
<whitequark> wtf
<whitequark> the begin and the end are identical
thufir_ has joined #ruby-lang
jonahR has quit [Quit: jonahR]
wallerdev has joined #ruby-lang
jtoy has quit [Quit: jtoy]
<andrewvos> Whoa what happened to rubygems today? Linkie?
__BigO__ has joined #ruby-lang
<andrewvos> I'm guessing someone uploaded a gem with a yaml that executed code?
<mistym> andrewvos: Yeah.
<KINGSABRI> andrewvos, omg :(
<andrewvos> mistym: Saw that but there isn't really a proper explanation there?
<andrewvos> That question mark is probably overkill.
<lianj> wallerdev: they shouldnt differ, but unpack is the real thing, as in faster because its the c function
<lianj> eh KINGSABRI
<lianj> wallerdev: sorry
<andrewvos> mistym: I see. thanks
<andrewvos> mistym: Seems kind of obvious. Wonder why this took so long to find? This is with a very old yaml parser right?
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
<mistym> andrewvos: With Psych, apparently.
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby-lang
forrest has quit [Quit: Leaving]
mjolk has quit [Quit: This computer has gone to sleep]
<andrewvos> mistym: Interesting. Pretty sure at some point in my life I released a site into production that accepted yaml as input, and did something with it :?
<andrewvos> :/
<andrewvos> I am not a clever man.
<KINGSABRI> thank whitequark and lianj for your help :)
__BigO__ has quit [Remote host closed the connection]
<andrewvos> Stuff like this sucks. Makes ruby look bad, when half the programmers in the world are like "lol isn't ruby just some scripting language"
<andrewvos> are already like*
mistym has quit [Remote host closed the connection]
<lianj> everyone likes rubydramas
mjio has joined #ruby-lang
<andrewvos> lianj: Yeah, except the people that maintain rubygems.org :)
lun__ has joined #ruby-lang
ilyam has joined #ruby-lang
lun_ has quit [Read error: Connection reset by peer]
<lianj> they do good work so this may sound rude, but if it was known for a week and the yaml issue was know even longer, no reason to cry and fall out of heaven now
jonahR has joined #ruby-lang
Kuifje has quit [Ping timeout: 256 seconds]
<andrewvos> lianj: Not sure what you mean?
swav has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
<rue> Isn’t that the same exploit that went against Rails, basically?
<andrewvos> I think so.
enebo has quit [Quit: enebo]
chendo has quit [Ping timeout: 252 seconds]
maxmanders has joined #ruby-lang
jonahR has quit [Ping timeout: 276 seconds]
rins has quit [Ping timeout: 248 seconds]
thufir_ has quit [Remote host closed the connection]
jrafanie has quit [Quit: jrafanie]
<andrewvos> So what's the fix for something like this? Disable support for "!ruby" in yaml?
KINGSABRI has quit [Quit: Leaving]
kith_ is now known as kith
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
outoftime has quit [Quit: Leaving]
postmodern has quit [Quit: Leaving]
postmodern has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
<rue> Stop using YAML?
<andrewvos> rue: <3
Banistergalaxy has quit [Ping timeout: 256 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
<manveru> rue: +1
<lianj> and stop using f'ing [module_]eval to create to monkey patch your objects
<andrewvos> I did always dislike yaml.
<tpope> yeah, I kinda feel like yaml should be relegated to the history books
<tpope> we have json now
<havenn> tpope: If JSON subset supports the datatypes you're serializing...
<andrewvos> But wasn't the issue with the json parser?
Banistergalaxy has joined #ruby-lang
<tpope> I've never seen someone use yaml that way
<lianj> yea, json has no symbols. and stuff like .with_indifferent_access makes me puke
<drbrain> andrewvos: that was a separate issue
<tpope> well not never, but certainly not used that way in a public api
<andrewvos> drbrain: Oh okay. So json is also out to get us :(
<tpope> oh god, symbols in yaml are disgusting
<andrewvos> tpope: I'm not even going to look. I've seen enough pain today.
<tpope> don't make me put ":foo:" in a config file you lazy piece of shit
<bougyman> do it
<bougyman> :foo:
<tpope> the fact you use symbols is an implementation detial
<tpope> no reason a json parser couldn't symbolize keys anyways
<manveru> mem leaks
<lianj> tpope: dont make me type h['foo'] and my cpu process that string lookup instead of symbols
<tpope> okay not a general purpose parser
<tpope> but a config file loader could
<andrewvos> Wait, I may have asked this before, but tpope are you the plugin maker?
<tpope> yes
<tpope> lianj I hope you're joking
<andrewvos> tpope: You make my life good every day. Thanks.
<drbrain> if your input keys are strings, converting them to symbols for a hash lookup is slower than using the string for hash lookup
<manveru> if you really use it all the time, put it into a struct
MSU has quit [Read error: Connection reset by peer]
<tpope> andrewvos cheers
<andrewvos> drbrain: And what's more, symbols don't even translate well in other programming languages?
<drbrain> you've converted one hash lookup (string in hash) into two (string in system symbol hash, symbol in hash)
ruurd has quit [Quit: Leaving...]
JMcAfreak has quit [Remote host closed the connection]
ddd has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<lianj> if you load the symbol yaml once and do lots of lookups on it isnt there a benefit? besides the part that i like to write f[:key]
<tpope> config files are written many times, code once
<tpope> that's a terrible tradeoff
<drbrain> lianj: when you have symbols as keys in your hash and symbols as user input, yes
<andrewvos> I never get the point of extracting stuff into yaml really. Ruby is a pretty good language for storing configuration.
<drbrain> but allowing symbols as user input is usually a bad idea
shtirlic_ has quit [Remote host closed the connection]
<andrewvos> Unless of course you need to let third parties configure stuff.
<lianj> drbrain: yep
<andrewvos> And not expect them to post your shit to pastie.
headius has joined #ruby-lang
<lianj> hehe rails symbolize_keys can be a slow death of oom, no?
postmodern has quit [Quit: Leaving]
aef has joined #ruby-lang
itsmeduncan has joined #ruby-lang
kain has quit [Ping timeout: 252 seconds]
maxmanders has joined #ruby-lang
srbaker has joined #ruby-lang
bantic has quit [Quit: bantic]
emocakes has quit [Quit: emocakes]
torrieri has quit [Quit: Leaving...]
chendo_ has quit [Ping timeout: 260 seconds]
kain has joined #ruby-lang
ilyam has quit [Remote host closed the connection]
ilyam has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 248 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
lun__ has quit [Ping timeout: 244 seconds]
kain has quit [Read error: Connection reset by peer]
kain has joined #ruby-lang