fosky has quit [Remote host closed the connection]
tonni has quit [Ping timeout: 245 seconds]
dr_bob has joined #ruby-lang
<postmodern>
is there a rack middleware that can log full requests to a file?
wallerdev has quit [Quit: wallerdev]
<postmodern>
wait CommonLogger
<MouseTheLuckyDog>
Shouldn't Array#delete be Array#delete!
skade has joined #ruby-lang
<yorickpeterse>
morning
tonni has joined #ruby-lang
<drbrain>
MouseTheLuckyDog: no
seoaqua has joined #ruby-lang
<MouseTheLuckyDog>
drbrain, Why not?
<erikh>
drbrain: I just got 42k reqs/s with a 20 line go program :P
<drbrain>
MouseTheLuckyDog: the ! means "this method modifies the receiver, unlike the non-bang version"
<erikh>
craaaaazy
<drbrain>
erikh: nice
kgrz has quit [Ping timeout: 268 seconds]
srbaker has quit [Ping timeout: 268 seconds]
fsvehla has joined #ruby-lang
dhruvasagar has joined #ruby-lang
srbaker has joined #ruby-lang
<canton7>
drbrain, common misconception. The ! actually means "this is one of a pair of methods with the same name, and this is the one that has perhaps the most unexpected results". The mutation thing is common, but there are loads of examples ! being used for non-mutators in the stdlib and elsewhere
<drbrain>
canton7: elsewhere doesn't count
SqREL has joined #ruby-lang
<drbrain>
canton7: and I besides a few outliers, I don't see any obvious non-mutators in stdlib
<drbrain>
core lib, none
<apeiros>
matz said it himself that "!" just means "be careful"
<MouseTheLuckyDog>
drbrain, bur Array#delete does modify the receiver.
<MouseTheLuckyDog>
s/bur/but/
<xuser>
butt
<drbrain>
MouseTheLuckyDog: and?
<Mon_Ouie>
But there's no non-mutating version of #delete
<xuser>
erikh: ruby wins
<canton7>
drbrain, also, look at almost any of the top google results for "ruby bang method"
<apeiros>
so the nitpicky explanation is: ! means "be careful", with ! and non-! present that usually means ! is in-place, non-! returns a modified copy. no ! does not imply "not mutating".
<erikh>
don't feed the trolls
<xuser>
erikh: I wish Go had Ruby web ecosystem :)
<drbrain>
canton7: considering I see my website as the second link (pointing to dblack's website) you can now consider me an authority in this matter
mytrile has joined #ruby-lang
<canton7>
drbrain, and your quote agrees with what I'm saying. So I'm failing to see where the confusing lies
<canton7>
confusion
<erikh>
xuser: I'm just learning something new, not playing the comparison game.
<drbrain>
ok
<erikh>
and it's exciting and fun
<erikh>
that's all :)
<erikh>
drbrain: btw, the new tomb raider is not really sexist and not bad at all
<erikh>
I was really suprised
<erikh>
it's basically like if lara croft lived the last 45 minutes of "Predator" over and over again
<drbrain>
erikh: ha!
<xuser>
erikh: yeah, I know, just that it would be cool, but its getting there
krohrbaugh has joined #ruby-lang
<wnd>
Sorry to keep spamming about this, but I'll give it one more try: 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.
<erikh>
wnd: how are you running it?
<erikh>
oh, I see.
<wnd>
ruby foo.rb /tmp/xyzzy
<erikh>
this is linxu?
<erikh>
or unix of some sort
<erikh>
stderr is character buffered
<wnd>
ah, sorry, that's indeed relevant. linux.
<erikh>
stdout is line buffered
krohrbaugh has quit [Read error: Operation timed out]
<erikh>
you can change this with stty, IIRC
<erikh>
or... maybe I have that backwards. I always forget.
<erikh>
but I'd guess the non-blocking reads are messing with you
<erikh>
have you tried doing this with Process.spawn and IO.pipe?
<wnd>
I understand the difference character and line bufferent streams, but I still don't quite get this though. Why would the stream not be flushed when the process has already finished (according to Process.wait)?
<seoaqua>
is there an easy way to connect to SQL Server with ruby?
<erikh>
wnd: flush happens on characters for one and lines for the other
<erikh>
I think stderr is the line buffered one now that I think about it.
<erikh>
let me consult the googles
<erikh>
nope, stderr is unbuffered -- stdout is line-buffered.
<erikh>
wait -- EIO is only related to files, right?
<erikh>
don't you want EINVAL or stdin.eof?
benlovell has joined #ruby-lang
<erikh>
seoaqua: there's tinytds for rails folks
<wnd>
quite honestly, I wasn't exactly sure what I wanted when I wrote that, so much of that code is unfortunately based on trial and error
<seoaqua>
erikh, thanks i'll look into that
<erikh>
yeah, it honestly seems like confusing code
<wnd>
bah, work priority override. thanks for your help, though.
<erikh>
wnd: look at Process.spawn. srsly.
<erikh>
you can do all this quite literally in a single line of code
<erikh>
if I'm fully understanding what you're doing here.
<erikh>
well, two lines. You'll want IO.pipe too.
judofyr has joined #ruby-lang
megha has joined #ruby-lang
Nisstyre-laptop has quit [Ping timeout: 272 seconds]
kgrz has joined #ruby-lang
scrr_ has quit [Quit: leaving]
gnufied has joined #ruby-lang
jbsan has quit [Quit: jbsan]
tonni has quit [Remote host closed the connection]
<wnd>
erikh, will do
rolfb has joined #ruby-lang
blacktulip has joined #ruby-lang
mbj has quit [Ping timeout: 276 seconds]
r0bgleeson has joined #ruby-lang
charliesome has joined #ruby-lang
stardiviner has joined #ruby-lang
<wnd>
As for background, this abomination was born when I wanted to download an rtmp stream (using flvstreamer), but the server would issue pause requests every few seconds without ever sending resume. Workaround was to restart flvstreamer and detect pauses in that read loop. Timeout option in flvstreamer would produce broken file, and rtmpdump would create a broken file ten times the size.
<erikh>
hmm
<erikh>
that's a lovely feature
<erikh>
also good lord man, the things some men will do for porn
<wnd>
of course the right solution would be to hack flvstreamer, but somehow I ended up writing ruby code instead
znake has joined #ruby-lang
<wnd>
actually, this one is for national tv channel
<apeiros>
hm, can I comment on that bug? I'd like to add weight to it (not sure I can, but I will mention that I'm one of the, if not the most active person on irc for 8 years straight, and hence do have some experience)
<charliesome>
apeiros: if you have a redmine account then go for it
<mbmike>
ok on the road to some pretty code here folks :) .. one more Q.. I have multiple files that define several classes grouped in one module. Assuming this (multiple files) is ok, where to you put your comments for the module?
<charliesome>
if you don't, make one! :p
<apeiros>
ah, I see, I need to sign-up or sign-on first. let me check that when I'm back from work (in ~7h, feel free to poke me should I forget)
<charliesome>
mbmike: i like arranging my files according to the class heirarchy
<charliesome>
mbmike: so Foo::Bar would be in foo/bar.rb
<charliesome>
and Foo would be in foo.rb
<apeiros>
mbmike: what charliesome said is the ruby convention
<mbmike>
yep nice, thats what I have, if you have Foo::Bar in foo/bar.rb and Foo::BarBaz in foo/bar_baz.rb where do you put your comments for the Foo module ?
<apeiros>
personally I'd prefer Foo/BarBaz.rb, but since that's no convention at all…
<apeiros>
mbmike: in the primary definition of foo, that'd be foo.rb
<charliesome>
mbmike: you'd put the comments for Foo in foo.rb
<judofyr>
apeiros: oh yes, I would also prefer Foo/BarBaz.rb. makes everything so much easier.
<apeiros>
judofyr: hurray! somebody who agrees with me on that :D
<mbmike>
ah ok, got it .. thanks.
<charliesome>
judofyr: :|
<apeiros>
making everything easier would precisely be the reason for it
<apeiros>
<3 that prenda law ruling :D
<judofyr>
Perl: the class Foo::BarBaz is stored in Foo/BarBaz.pm and you can install it from CPAN with `cpanm Foo::BarBaz`. in Ruby: it's stored in foo/bar_baz.rb or foo/barbaz.rb or foo.rb, the gem name is "foo" or "foo-bar" or who the fuck knows.
<charliesome>
i wonder if it makes the wheels less efficient
<apeiros>
learned a new word: spoked
<charliesome>
because some of your energy goes into them flexing
<judofyr>
charliesome: well, doesn't all suspension do that?
<charliesome>
judofyr: what am i? a physicist?
<judofyr>
but yeah, I wonder how this compares to spoked wheels
benlovell has quit [Ping timeout: 268 seconds]
<judofyr>
(energy-wise)
<judofyr>
oh yeah, it gives you a "Smooth ride"
<judofyr>
interesting: "Smooth ride: The pedalling cadence is slightly different when you ride loopwheels, because the springs release energy more evenly. This makes for a very smooth easy ride."
<jxie>
is there any hook so whenever an array literal created the hook get invoked?
vbatts has quit [Quit: WeeChat 0.3.6]
<injekt>
what
<yorickpeterse>
jxie: no
<jxie>
urrr..
rlng928 has joined #ruby-lang
<jxie>
or, I found a lot of T_ARRAY created and GCed during a request, now I want to track down where these arrays come from
srbaker has quit [Quit: Computer has gone to sleep.]
<jxie>
any suggestions?
<injekt>
rbprof?
JohnBat26|3 has joined #ruby-lang
<yorickpeterse>
MRI doesn't provide very good tools for this, at least not to get the locations of objects
mikestok has joined #ruby-lang
<yorickpeterse>
ruby-prof and the likes can show you total amounts and such, but not where it comes from
<yorickpeterse>
You'd probably have to hack the corresponding C code for it
elia has quit [Read error: Connection reset by peer]
<injekt>
what about rbtrace?
pskosinski has joined #ruby-lang
elia has joined #ruby-lang
<injekt>
I guess it still cant give you line numbers
adambeynon has joined #ruby-lang
<yorickpeterse>
never knew of rbtrace
<injekt>
everything tmm1 built is awesome
<yorickpeterse>
met him once two years ago (I think), pretty cool guy
<yorickpeterse>
at least from what I remember
<jxie>
I tried ruby-prof, rb_line_profiler and perftools.rb, haven't found a way to trace object yet
<jxie>
tmm1 is awesome +1. most tools I use are created by him
rlng928 has quit [Quit: Page closed]
<jxie>
maybe I should check jruby
Caius has quit [Quit: ""]
<jxie>
will give rbtrace a try, thanks
rulng42 has joined #ruby-lang
Caius has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
vbatts|work has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 264 seconds]
JohnBat26|3 has quit [Ping timeout: 276 seconds]
seoaqua has quit [Ping timeout: 248 seconds]
breakingthings has joined #ruby-lang
JohnBat26 has joined #ruby-lang
rulng42 has quit [Quit: Page closed]
vbatts|work has quit [Quit: MeSoChatty 0.3.8]
JohnBat26|2 has joined #ruby-lang
vbatts|work has joined #ruby-lang
wallerdev has joined #ruby-lang
r0bgleeson has joined #ruby-lang
mahna has joined #ruby-lang
scampbell has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 248 seconds]
<mahna>
Hello, I'm getting an uninitialized constant error when trying to catch a particular exception, but it appears to be defined. Can anybody take a look at this simple example? https://gist.github.com/anonymous/5532383
jvrmaia has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 255 seconds]
JohnBat26 has joined #ruby-lang
JohnBat26|2 has quit [Ping timeout: 276 seconds]
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
krohrbaugh has joined #ruby-lang
jsullivandigs has quit [Read error: Connection reset by peer]
jsullivandigs has joined #ruby-lang
someguy has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
alessio_rocco has quit [Ping timeout: 255 seconds]
alessio_rocco has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 268 seconds]
cordax has joined #ruby-lang
Asher1 has joined #ruby-lang
<mahna>
Basically the gist shows two simple error classes defined in the same module, but only one responds to defined? (the other doesn't and in my original code gives me an "uninitialized constant" error).
Asher has quit [Read error: Connection reset by peer]
schaerli has joined #ruby-lang
JohnBat26 has quit [Read error: Connection timed out]
<lupine>
fascinating
jxie has quit [Quit: leaving]
<lupine>
mahna, certainly in 1.8.7, when I create an instance of Ox::InvalidPath, all of a sudden, defined? starts recognising Ox:ParseError
<lupine>
ho hum, and now I can't get it to break
benlovel1 has joined #ruby-lang
<mahna>
@lupine: Thanks, trying to get to the same place and understand the implications of that (not there yet ;).
<mahna>
(1.9.3)
jxie has joined #ruby-lang
<MouseTheLuckyDog>
Is there a way to require a ruby file in the local directory that does not have an extension?
ikrima has quit [Quit: Computer has gone to sleep.]
mucker has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
<MouseTheLuckyDog>
load does work though I would rather use require, require and require_relative do not work. An strace reveals that locally it tries to locate file.rb and file.so but not file.
<MouseTheLuckyDog>
The funny thing is that it looks like in every other directory and there are a ton it tries to retrieve file.rb,file.so and file.
mistym has quit [Remote host closed the connection]
singpolyma has quit [Remote host closed the connection]
singpolyma has joined #ruby-lang
jovy88 has joined #ruby-lang
stardiviner has quit [Remote host closed the connection]
gnufied has joined #ruby-lang
gnufied has quit [Client Quit]
gnufied has joined #ruby-lang
<tarruda>
dbussink: that seems nice, thanks
schaerli has quit [Remote host closed the connection]
asunderland has joined #ruby-lang
adambeynon has quit [Quit: Computer has gone to sleep.]
yknot_ has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
nXqd has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby-lang
yknot_ has quit [Client Quit]
io_syl has joined #ruby-lang
nXqd has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
jvrmaia has quit [Remote host closed the connection]
wesside_ has joined #ruby-lang
bzalasky has joined #ruby-lang
nXqd has quit [Ping timeout: 268 seconds]
nXqd has joined #ruby-lang
rwk1 has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
benlovel1 has joined #ruby-lang
robbin_ has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
benlovel1 has quit [Ping timeout: 258 seconds]
Asher1 has quit [Read error: Connection reset by peer]
carloslopes has quit [Ping timeout: 268 seconds]
rwk1 has quit [Ping timeout: 245 seconds]
Asher has joined #ruby-lang
adambeynon has joined #ruby-lang
Asher1 has joined #ruby-lang
imperator has joined #ruby-lang
Asher has quit [Ping timeout: 245 seconds]
<imperator>
good morning
sduckett has joined #ruby-lang
someguy has quit [Quit: Page closed]
TheNotary has joined #ruby-lang
benlovell has quit [Ping timeout: 246 seconds]
DomKM has joined #ruby-lang
carloslopes has joined #ruby-lang
<dr_bob>
good afternoon
<injekt>
good aftermorn
sduckett has quit [Ping timeout: 248 seconds]
krohrbaugh has joined #ruby-lang
pkrnj has joined #ruby-lang
krohrbaugh has quit [Client Quit]
krohrbaugh has joined #ruby-lang
ddfreyne has quit [Excess Flood]
ddfreyne has joined #ruby-lang
cupakromer has joined #ruby-lang
apeiros has joined #ruby-lang
skade has quit [Ping timeout: 245 seconds]
skade has joined #ruby-lang
mucker has quit [Quit: Lost terminal]
mucker has joined #ruby-lang
workmad3 has quit [Ping timeout: 268 seconds]
<tarruda>
any easy way to completely disable ruby signal handling? I'm embedding ruby in an application that uses libev(which also emits events for signals), and it segfaults everytime the app receives one
<eam>
probably rfc 354, though it appears it leaves the method of translation entirely open-ended
<eam>
but *generally* "text" functions would do things like turn \n sequences into \r\n or \r when going between, say, unix / windows / mac / vms / etc
<eam>
though it appears unicode encoding wouldn't necessarily be out of scope, of course it didn't exist back then
djbender_ has quit [Quit: leaving]
<eam>
yoshie902a: check out III.B Data Representation and Storage
<eam>
ASCII -> EBDIC
<eam>
I've only used ASCII based operating systems so I guess I'm not familiar with those transformations
pkrnj has joined #ruby-lang
<eam>
"Multics stores NVT-ASCII as four 9-bit characters in a 36-bit word."
<rickhull>
hipsters...
<eam>
unicode ;-)
brianpWins has quit [Quit: brianpWins]
ikrima has quit [Quit: Computer has gone to sleep.]
<eam>
the paragraph underneath, about transfering binary data between systems with non-byte-width architectures is horrifying
tomzx_mac has joined #ruby-lang
brianpWins has joined #ruby-lang
mbj has quit [Ping timeout: 246 seconds]
<yoshie902a>
eam: great, this has been a great help!
<yoshie902a>
eam: thank you so much for the assistance
<yoshie902a>
eam: I'm not very familiar about rf.'s, but what does the number 354 vs 959 etc mean?
<zenspider>
just which rfc it is
ryez has joined #ruby-lang
<yoshie902a>
zenspider: like a version number?
<rickhull>
like an id, more or less sequential. there are many of them
<zenspider>
yoshie902a: no. there are many different rfcs
<zenspider>
they're numbered
<rickhull>
rfc X covers a different subject than rfc Y
<yoshie902a>
got it. thanks!
<rickhull>
request for comment. it's part of the process of how internet standards are formed
<zenspider>
rickhull: unless X == Y :P
<rickhull>
>.<
<zenspider>
and still, not true... there's like 4-5 RFCs for imap
<rickhull>
which one banishes pedantry from the internet :p
<zenspider>
that was never ratified
<darix>
zenspider: that already includes all imap extensions?