<erikh>
drbrain: oh, hey. did you get a chance to read that blog?
<drbrain>
erikh: yes, I was going to tweet a link to it tomorrow
<drbrain>
erikh: good stuff!
<erikh>
oh! very cool. I wanted to make sure it was correct
<Wardrop>
All makes sense now, thanks
<erikh>
there's more coming, I just need to get some energy to write it
saarinen has joined #ruby-lang
<woollyams>
On the subject of enumerables, I've been re-inventing the wheel. Feedback welcome. https://github.com/mdub/lazily
saarinen has quit [Client Quit]
<drbrain>
woollyams: I think the Enumerator::Lazy prototype was written in ruby
stamina has quit [Ping timeout: 245 seconds]
<drbrain>
woollyams: you can probably dig it out of the ruby tracker (or ruby-core list) to compare
arubin has quit [Ping timeout: 246 seconds]
<woollyams>
drbrain: Yeah, so is the one in "backports". Everything is based on Enumerator though. IMHO laziness shouldn't be conflated with external iteration.
<drbrain>
woollyams: I haven't implemented a laziness library, but it seems that using external iteration can make it easier
<drbrain>
but yeah, agreed
Raynes has quit [Ping timeout: 252 seconds]
tomzx_mac has joined #ruby-lang
bothra has quit [Ping timeout: 252 seconds]
bothra has joined #ruby-lang
Raynes has joined #ruby-lang
postmodern has quit [Read error: Operation timed out]
tomzx_mac_ has quit [Ping timeout: 268 seconds]
ikrima has joined #ruby-lang
sepp2k1 has quit [Read error: Connection reset by peer]
singpolyma has quit [Ping timeout: 252 seconds]
singpolyma has joined #ruby-lang
tomzx_mac_ has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 256 seconds]
fn has joined #ruby-lang
fn is now known as Guest74460
scottschecter has joined #ruby-lang
bradland has joined #ruby-lang
s4muel has quit [Ping timeout: 246 seconds]
konr is now known as konr-rebooting
malign has quit [Ping timeout: 248 seconds]
konr-rebooting has quit [Remote host closed the connection]
malign has joined #ruby-lang
spinky has quit [Remote host closed the connection]
spinky has joined #ruby-lang
redyellowgreen has joined #ruby-lang
tylersmith has quit [Remote host closed the connection]
<bradland>
yep, that'll give you the shorter of the two stack traces once it fails
<erikh>
include Net? ewwwww
<bradland>
yeah, that's really unnecessary. i copied this from a reporter in a google group
<bradland>
it's part of his larger app
<bradland>
although not sure if he's using more of Net elsewhere
tylersmith has quit [Ping timeout: 264 seconds]
<erikh>
np, just giving you crap.
<erikh>
:)
<bradland>
ninja edit :)
<bradland>
good catch actually. i bet that will cut down `info variables` in gdb by a few hundred lines haha
<erikh>
transfer's going
<erikh>
did it over the network
<erikh>
not sure why but hey
<bradland>
i did localhost, but i'm not sure it's any faster
<bradland>
because of the 64K reads size limit
<erikh>
nah, i'm saturating the wifi here
tsion has joined #ruby-lang
<erikh>
too slooooow. restarting on the box I made the file on
<bradland>
haha, yeah, wifi would kill me
<erikh>
yeah I was not having a smart moment
<bradland>
it takes a solid 5 mins over loopback
<bradland>
SSD helps
<erikh>
yeah, it's on a SSD
<erikh>
back in a few
arubin has joined #ruby-lang
hackeron has quit [Ping timeout: 240 seconds]
rsync has joined #ruby-lang
<erikh>
interesting
<erikh>
bradland: it's at 4294049792
hackeron has joined #ruby-lang
scottschecter has quit [Ping timeout: 264 seconds]
<erikh>
but it's stuck
<bradland>
yep
<bradland>
that's exactly where i get to as well
<bradland>
the math works out really interesting
<erikh>
let me make sure I'm on openssl 1.0 here
<erikh>
just to be sure i'm not repeating what you've already found
<bradland>
k
<bradland>
are you on OS X?
<bradland>
don't send SIGINT just yet
rwk1 has quit [Remote host closed the connection]
singpolyma has quit [Read error: Connection reset by peer]
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
singpolyma has joined #ruby-lang
<havenwood>
woollyams: Love the #lazily.in_threads(n) syntax for spinning up a thread pool! Very cool. Why do you use #collect though, I thought #map had won? :P
lcdhoffman has quit [Quit: lcdhoffman]
<bradland>
trying with a 1 byte read size... guess i'll find out the exact break point :)
nertzy3 has joined #ruby-lang
<erikh>
bradland: oh, i already did
<erikh>
stepping through the response code now, trying to find out if there's just a sftp response that net-sftp isn't handling
<erikh>
e.g., "go away net-sftp" and it tries to select anyhow
<bradland>
ah, i see
<bradland>
so with 1 byte, it still hung at exactly 4294049792 ?
dankest has quit [Quit: Leaving...]
<erikh>
it did? I didn't try
<bradland>
sry, when you said you already did, i thought you meant the 1 byte read size
<bradland>
but you meant SIGINT
<erikh>
yes
<erikh>
sorry
nertzy2 has quit [Ping timeout: 245 seconds]
<erikh>
the default in the code is 32k, fwiw.
<erikh>
back in a minute
bzalasky has joined #ruby-lang
redyellowgreen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<erikh>
awesome it's giving me a whole lotta nothin'
<erikh>
time to hack the gem
tylersmith has joined #ruby-lang
redyellowgreen has joined #ruby-lang
<bradland>
gem slaya!
lsegal has joined #ruby-lang
nathanstitt has joined #ruby-lang
scottschecter has joined #ruby-lang
<erikh>
does yours actually terminate?
<erikh>
reason I'm asking is because I have a heartbeat set up in my ssh config
<erikh>
wondering if that's what's keeping mine around
<erikh>
bradland: ^
<bradland>
no, mine hangs
<bradland>
i don't get a stack trace until i send SIGINT
tylersmith has quit [Remote host closed the connection]
<bradland>
i've run it with debugger to dig around a bit
<erikh>
k
<erikh>
the select has no timeout
<erikh>
so that's not very surprising
<bradland>
but rdb pukes when it hangs
<erikh>
rdb?
<erikh>
not familiar.
<bradland>
rubydebug console
<erikh>
ahh
<bradland>
i've run it with ruby -rdebug sftp.rb
<erikh>
argh
<erikh>
nothing still
<erikh>
more hacking
<bradland>
but i can't get a console once it hangs
headius has joined #ruby-lang
<bradland>
i've managed to attach gdb though
<woollyams>
havenwood: I vacillate between #collect and #map. I do like the symmetry of collect/detect/select/reject, though.
<erikh>
bradland: yeah, because it's stuck waiting on i/o
<erikh>
select is a syscall
<erikh>
"have fun with that", etc.
<bradland>
hahaha, yeah
<erikh>
dumping packet data now
<erikh>
we'll see if anything turns up
<bradland>
i like of had a feeling that's where i ended up
tomzx_mac_ has quit [Ping timeout: 245 seconds]
<bradland>
*kind of
jovy88_ has quit [Read error: Connection reset by peer]
<bradland>
so it could be that it's hanging on the select, but nothing has actually died inside Ruby. it's that the remote end has stopped sending data.
<erikh>
that's exactly what's happening
<erikh>
best I can tell
jovy88_ has joined #ruby-lang
<erikh>
it's given a status like "go away" or something else net-scp isn't handling
<erikh>
trying to find out what that code is now
havenwood has quit [Remote host closed the connection]
<erikh>
def process(wait=nil, &block)
<erikh>
wait is the value used for the timeout
<erikh>
(yay)
<bradland>
yeah... wait forever. gee thx.
<bradland>
seems that should be some kind of sensible timeout, or at least an opt
bzalasky has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 264 seconds]
headius has quit [Quit: headius]
sent_hil_ has left #ruby-lang [#ruby-lang]
bzalasky has joined #ruby-lang
cstrahan has joined #ruby-lang
Guest22432 has left #ruby-lang [#ruby-lang]
redyellowgreen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<erikh>
it is
<erikh>
Net::SFTP just doesn't use it
<erikh>
it's from Net::SSH
<bradland>
ah
<erikh>
I've adjusted it to see if letting it timeout changes anything, running again
<erikh>
thanks for the fun problem :)
<bradland>
hahaha :) seriously
Domon has joined #ruby-lang
<bradland>
i just ran a test with Transmit (an SFTP client)
<bradland>
blazing fast
rwk1 has joined #ruby-lang
vlad_starkov has joined #ruby-lang
MouseTheLuckyDog has joined #ruby-lang
<MouseTheLuckyDog>
drbrain--you here?
<drbrain>
MouseTheLuckyDog: hi
<drbrain>
what's up?
<MouseTheLuckyDog>
What version of ruby are you using?
<drbrain>
ruby 2.0.0p0
<MouseTheLuckyDog>
Hmmm. You remember that problem from last week?
<drbrain>
no, which?
vlad_starkov has quit [Ping timeout: 264 seconds]
cofin has quit [Quit: cofin]
<erikh>
bradland: gonna do one last test -- seems I didn't get fully propogated with the timeout
<erikh>
this should either spin hard or abort properly
rwk1 has quit [Ping timeout: 246 seconds]
<MouseTheLuckyDog>
http://pastie.org/7820795#1,13-14,24, you can replace the trace command with irb and lose the straces.
<erikh>
I need to go after this though
<erikh>
big week for the rest of it, job interviews
<bradland>
yeah, my battery is dying
<drbrain>
MouseTheLuckyDog: oh, yes
<drbrain>
MouseTheLuckyDog: I ran it, but didn't see any odd behavior
<erikh>
bradland: yeah, it's spinning
nlv has joined #ruby-lang
<drbrain>
I used my arrow keys and some regular keys in irb
<erikh>
bradland: sorry -- I need to stop for now
<bradland>
erikh: thx for the help
<bradland>
these are good ideas
<erikh>
np. your problem is very likely a response coming back that net-scp is not handling properly
<MouseTheLuckyDog>
It looks like read_nonblock sets Fcntl::O_NONBLOCK on stdin. I found the place in the source. But it doesn't unset it when an EAGAIN exception is thrown. But that's in 1.9 so they probably fixed it by 2.
<bradland>
SCP doesn't do >4GB apparently
<bradland>
but SFTP "does"
<bradland>
these are great leads
<bradland>
thanks a bunch!
<MouseTheLuckyDog>
So I guess it's not worth finding the place in the code where it is unset.
<erikh>
yeah, that's interesting
bradland has quit [Quit: bradland]
<MouseTheLuckyDog>
bradland:what platforms?
<drbrain>
MouseTheLuckyDog: it may not be unset
<drbrain>
in 2.0 eihter
<drbrain>
either
<MouseTheLuckyDog>
I don't think OS/X and Linux would behave differently in the two cases.
breakingthings has quit [Quit: breakingthings]
<MouseTheLuckyDog>
Or to put it another way, if it's not unset in OS/X and that's the way it's behaving then OS/X is broken.
<drbrain>
perhaps
bzalasky has quit [Remote host closed the connection]
cofin has joined #ruby-lang
<drbrain>
I admit I don't know if non-blocking mode is inherited by child processes or not
dhruvasagar has joined #ruby-lang
malign has quit [Ping timeout: 276 seconds]
robbyoconnor has joined #ruby-lang
jsullivandigs has joined #ruby-lang
robbyoconnor has quit [Remote host closed the connection]
bizdak has quit [Remote host closed the connection]
krz has joined #ruby-lang
headius has joined #ruby-lang
malign_ has joined #ruby-lang
tylersmith has joined #ruby-lang
senaxfz has joined #ruby-lang
krombr has joined #ruby-lang
malign_ is now known as malign
cstrahan has quit [Ping timeout: 248 seconds]
tylersmith has quit [Ping timeout: 268 seconds]
dankest has joined #ruby-lang
matti has quit [Ping timeout: 246 seconds]
havenwood has joined #ruby-lang
postmodern has quit [Ping timeout: 256 seconds]
JpC0utur3 has joined #ruby-lang
havenwood has quit [Ping timeout: 256 seconds]
lguardiola has quit [Ping timeout: 264 seconds]
senaxfz has left #ruby-lang ["back in a bit"]
hachiya_ has left #ruby-lang [#ruby-lang]
hachiya has joined #ruby-lang
scottschecter has quit [Ping timeout: 268 seconds]
rwk1 has joined #ruby-lang
scottschecter has joined #ruby-lang
rwk1 has quit [Ping timeout: 256 seconds]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Client Quit]
krombr has quit [Remote host closed the connection]
cofin has quit [Quit: cofin]
nivanson_ has joined #ruby-lang
nivanson has quit [Read error: Connection reset by peer]
chessguy has quit [Remote host closed the connection]
rwk1 has quit [Remote host closed the connection]
rwk1 has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
tylersmith has quit [Remote host closed the connection]
zmack has joined #ruby-lang
zmack has quit [Remote host closed the connection]
malign has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby-lang
malign has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
vlad_starkov has quit [Ping timeout: 264 seconds]
nlv_ has joined #ruby-lang
malign_ has joined #ruby-lang
malign has quit [Ping timeout: 264 seconds]
aemeredith has quit [Remote host closed the connection]
nlv has quit [Ping timeout: 268 seconds]
nathanstitt has joined #ruby-lang
aemeredith has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 256 seconds]
rippa has joined #ruby-lang
malign_ has quit [Ping timeout: 264 seconds]
krohrbaugh has quit [Quit: Leaving.]
dhruvasagar has joined #ruby-lang
krohrbaugh has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
GeissT has quit [Quit: AdiIRC is updating to v1.9.0 Beta Build (120513) 32 Bit]
GeissT has joined #ruby-lang
krombr has joined #ruby-lang
dkannan has quit [Quit: dkannan]
mistym has quit [Remote host closed the connection]
krombr has quit [Client Quit]
malign has joined #ruby-lang
JpC0utur3 has quit [Ping timeout: 256 seconds]
chrishunt has quit [Quit: ZzZzZz...]
__butch__ has joined #ruby-lang
rippa has quit [Ping timeout: 240 seconds]
krohrbaugh has quit [Quit: Leaving.]
nivanson_ has quit [Read error: Connection reset by peer]
DomKM1 has joined #ruby-lang
nivanson has joined #ruby-lang
mksm has joined #ruby-lang
DomKM has quit [Read error: Connection reset by peer]
wudofyr_ has quit [Ping timeout: 246 seconds]
wudofyr_ has joined #ruby-lang
Raynes has quit [Ping timeout: 246 seconds]
Guest47114 has quit [Changing host]
Guest47114 has joined #ruby-lang
Guest47114 has joined #ruby-lang
Guest47114 is now known as Boohbah
crudson has joined #ruby-lang
mjio has quit [Ping timeout: 268 seconds]
mjio has joined #ruby-lang
Raynes has joined #ruby-lang
sailias has joined #ruby-lang
saarinen has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
44UAABGVN has quit [*.net *.split]
closer has quit [*.net *.split]
nivanson has quit [Read error: Connection reset by peer]
nivanson_ has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
matti has joined #ruby-lang
matti has quit [Changing host]
matti has joined #ruby-lang
sailias has quit [Quit: Leaving.]
tylersmith has joined #ruby-lang
krohrbaugh has joined #ruby-lang
tylersmith has quit [Ping timeout: 268 seconds]
jovy88_ has quit [Read error: Connection reset by peer]
jovy88_ has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
ikrima has joined #ruby-lang
Nisstyre-laptop has quit [Quit: Leaving]
__butch__ has quit [Quit: Leaving.]
justinmburrous has quit [Remote host closed the connection]
symm- has joined #ruby-lang
scottschecter has quit [Ping timeout: 246 seconds]
headius has quit [Quit: headius]
aemeredith has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
tsion has quit [Quit: Leaving]
Nisstyre-laptop has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
krohrbaugh has quit [Quit: Leaving.]
dkannan has joined #ruby-lang
scottschecter has joined #ruby-lang
apeiros has joined #ruby-lang
DomKM1 has quit [Quit: Leaving.]
symm- has quit [Ping timeout: 248 seconds]
aemeredith has joined #ruby-lang
lethan has joined #ruby-lang
lethan has left #ruby-lang [#ruby-lang]
aemeredith has quit [Read error: Connection reset by peer]
aemeredith has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
dr_bob has joined #ruby-lang
vlad_starkov has joined #ruby-lang
ikrima has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Ping timeout: 276 seconds]
noop_ has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby-lang
woollyams has quit [Ping timeout: 256 seconds]
ikrima has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 245 seconds]
dkannan has quit [Ping timeout: 245 seconds]
dkannan has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
aemeredith has quit [Remote host closed the connection]
JohnBat26 has joined #ruby-lang
rippa has joined #ruby-lang
tbuehlmann has joined #ruby-lang
brianpWins has joined #ruby-lang
apeiros has joined #ruby-lang
mjio has quit []
judofyr has joined #ruby-lang
nlv_ has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
flak has joined #ruby-lang
rippa has quit [Read error: Connection reset by peer]
flak is now known as Guest14455
somasonic has joined #ruby-lang
<somasonic>
hi
<somasonic>
i have a class and for each child of that class I need a unique ID - is class variables a good way to do this? (@id == @@id; @@id = @@id + 1)?
rwk1 has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
somasonic was kicked from #ruby-lang by apeiros [when you cross-post, you are required to state that fact]
somasonic has joined #ruby-lang
stamina has joined #ruby-lang
<judofyr>
somasonic: depends. do you subclass that class?
<somasonic>
yes
<somasonic>
all objects that need an ID will be a subclass
<judofyr>
somasonic: ah, that was what you meant by "child". well, a class variable is shared across the whole hierarchy so that could work.
<judofyr>
somasonic: although I generally try to avoid them.
<somasonic>
judofyr: do you have a better idea?
Quatrerwin has quit [Remote host closed the connection]
<somasonic>
judofyr: that seems better for what i want.
<somasonic>
judofyr: thanks, i always come here because I know there is a way to do what I want cleanly and I just don't know about it yet :P
<judofyr>
somasonic: it's probably more flexible too (in case you want to tweak it a bit)
dhruvasagar has joined #ruby-lang
44UAABGVN has joined #ruby-lang
closer has joined #ruby-lang
solars has joined #ruby-lang
<somasonic>
judofyr: thanks again for this. the ID I need is actually a bit of complex stringwork, and this way allows me to do it cleanly and automatically without the subclass ever seeing the code
<judofyr>
somasonic: great :)
pencilk has joined #ruby-lang
<yorickpeterse>
morning
mbj has joined #ruby-lang
krohrbaugh has joined #ruby-lang
dezasseis has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 268 seconds]
rwk1_ has joined #ruby-lang
pipework has quit [Ping timeout: 256 seconds]
rwk1 has quit [Ping timeout: 264 seconds]
mucker has joined #ruby-lang
pipework has joined #ruby-lang
<somasonic>
judofyr: when did += 1 get added to ruby?
<somasonic>
has that always been there?
<judofyr>
somasonic: since forever
<somasonic>
fucks sake
<judofyr>
somasonic: it's just ++ that hasn't been there
<somasonic>
judofyr: for some reason i'd thought until now it was nonexistant in ruby
<judofyr>
which is a very nice way to create a counter
rsync has quit [Ping timeout: 264 seconds]
<corecode>
why is class << self; def foo; ...; end preferred over def self.foo ...?
<judofyr>
corecode: it's not. mostly a matter of taste.
<corecode>
two schools of thought?
<judofyr>
I try to avoid `class << self; def foo; ...; end` because it adds another level of indention
<corecode>
oh i wish there were macros
<judofyr>
we can make that happen
<tbuehlmann>
rails even wants you to use class << self
gnufied has joined #ruby-lang
<somasonic>
what's a good way to make an int into a str with leading 0s where str.len == 3 (i.e. 1 => "001")
rwk1_ has quit [Remote host closed the connection]
<judofyr>
somasonic: rjust
<judofyr>
>> 1.to_s.rjust('0', 3)
<eval-in>
judofyr => /tmp/execpad-a3febba0550e/source-a3febba0550e:2:in `rjust': no implicit conversion of String into Integer (TypeError) ... (http://eval.in/29340)
sush24 has quit [Quit: This computer has gone to sleep]
floyd2_ has joined #ruby-lang
gnufied has joined #ruby-lang
<gnufied>
yorickpeterse: ActiveRecord can be a royal pain if you are namespacing model classes
<yorickpeterse>
yeah tell me about it
saarinen has quit [Quit: saarinen]
mytrile has joined #ruby-lang
<gnufied>
there is isolate_namespace
rwk1 has quit [Ping timeout: 276 seconds]
<gnufied>
mainly used in Rails engines/gems
<gnufied>
but see if it can be useful. just a wild thought. :-)
<yorickpeterse>
this is in a Rails engine
<gnufied>
oh, okay.
<gnufied>
look for isolate_namespace then
<yorickpeterse>
I know what it does and it doesn't solve my problem
<gnufied>
:/
<yorickpeterse>
the problem is that AR validates association objects by class names
<yorickpeterse>
which is beyond stupid in a duck typed language
krohrbaugh has joined #ruby-lang
<gnufied>
it is.
<gnufied>
so association validations all fail? interesting
jsullivandigs has quit [Ping timeout: 256 seconds]
jaimef has quit [Ping timeout: 256 seconds]
floyd2 has quit [Ping timeout: 256 seconds]
<yorickpeterse>
So basically I have two version of model X, a global one and a namespaced one
<yorickpeterse>
the latter provides some extra methods
<yorickpeterse>
the problem is that AR uses the global X whereas I'm passing the namespaced one
<yorickpeterse>
I already solved it by using `::X` in my code, but it's super confusing and prone to errors
glebm has joined #ruby-lang
jaimef_ has joined #ruby-lang
<judofyr>
I think that's a nice summary of Rails: "it's super confusing and prone to errors" :)
<yorickpeterse>
it's fine as long as you keep riding on the bike with training wheels on the perfect straight path it provides
<yorickpeterse>
The moment you deviate from that you basically crash into everything along the road
vlad_starkov has quit [Remote host closed the connection]
krohrbaugh has quit [Ping timeout: 268 seconds]
<yorickpeterse>
then when you've almost reached your destination somebody hits you in the face with a frying pan
<lianj>
do people write big ruby webapps without rails, what do they use? sinatra, ramaze or pure rack?
<yorickpeterse>
I'd say 85% of it would be Rails
<yorickpeterse>
APIs are done in Sinatra, a small minority probably uses Padrino/Ramaze
<yorickpeterse>
(still haven't looked at Padrino myself)
<gnufied>
Grape is pertty popular for APIs as well.
<judofyr>
I'm actually using Camping when I need to throw something up quickly
<gnufied>
I have deployed at least 7 grape API apps at my consultancy
<gnufied>
but they are basically still using ActiveRecord fwiw
<gnufied>
or Mongoid
<gnufied>
(for web scale)
<lianj>
for quick and small i like sinatra, for something bigger a rack middleware stack with maybe some sinatra::base inside. but haven't done a /huge/ projekt that way
mytrile has quit [Remote host closed the connection]
<gnufied>
for quick and smell, i prefer PHP
<lianj>
gtfo
<gnufied>
:-)
rolfb has joined #ruby-lang
jxie_ has quit [Quit: leaving]
noop_ has joined #ruby-lang
<yorickpeterse>
famous last words
<injekt>
I have a sinatra app that's been running for over 650 days receiving ~2m hits a day pretty nicely
<yorickpeterse>
a hello world app? :>
<injekt>
it's a json api
<lianj>
for small things i mean not many routes, not slow/unused apps
nlv has joined #ruby-lang
<gnufied>
injekt: but what it does? don't kill us with suspence
<judofyr>
lianj: have you tried Padrino?
<judofyr>
it seems to be Sinatra for bigger apps
<lianj>
nope, first time i hear about it :D
<injekt>
gnufied: it serves an api for an iphone app
<injekt>
that's fairly popular
jxie has joined #ruby-lang
<injekt>
but unfortunately, I can't tell you which one because nda
<gnufied>
I get it.
<gnufied>
no love for #ruby-lang anymore
<injekt>
well 'which one' makes it seem like it's THAT popular, it's not
<judofyr>
injekt: what? you mean it isn't Angry Birds?
brianpWins has quit [Quit: brianpWins]
stardiviner has joined #ruby-lang
<injekt>
judofyr: haha
<yorickpeterse>
injekt: is it an app for the Saudi arabian gov?
<lianj>
hm, from first sight i don't see the benefit of padrinorb
<lianj>
yorickpeterse: perl6 dev blog
<injekt>
yorickpeterse: maybe
<judofyr>
lianj: I haven't used it so I don't know
<injekt>
lianj: me either, and you have to gem install everything to run it
<yorickpeterse>
lianj: eh?
<lianj>
nvm
<injekt>
does Gavin Kistner (Phrogz) idle here? I thought he did
<andrewvos>
He used to
<gnufied>
there was blink and there was teferi. blink used to maintain/contribute to camping for awhile.
<gnufied>
not sure where she disappeared!
<gnufied>
*offtopic*
rwk1 has joined #ruby-lang
vlad_starkov has joined #ruby-lang
rwk1 has quit [Ping timeout: 245 seconds]
sandbags has joined #ruby-lang
sandbags has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
thone_ has joined #ruby-lang
jovy88_ has quit [Read error: Connection reset by peer]
jovy88_ has joined #ruby-lang
thone has quit [Read error: Operation timed out]
barttenbrinke has quit [Remote host closed the connection]
<yorickpeterse>
"undefined method `eject' for ..." heh
<apeiros>
yorickpeterse.eject ?
alessio_rocco has joined #ruby-lang
<yorickpeterse>
I mistyped reject
krombr has joined #ruby-lang
44UAABGVN is now known as chendo_
kgrz has joined #ruby-lang
<malign>
Winter is coming because of it.
mbj has joined #ruby-lang
<somasonic>
judofyr: ping
dezasseis has quit [Read error: Connection reset by peer]
dezasseis1 has joined #ruby-lang
dezasseis has joined #ruby-lang
dezasseis1 has quit [Read error: Connection reset by peer]
barttenbrinke has joined #ruby-lang
nlv has quit [Remote host closed the connection]
<andrewvos>
yorickpeterse.reject? #=> true
toretore has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
krombr has quit [Quit: krombr]
<matti>
.
rwk1 has joined #ruby-lang
halibut has quit [Read error: No route to host]
mucker has quit [Quit: leaving]
rwk1_ has joined #ruby-lang
rwk1 has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
<judofyr>
somasonic: pong
<somasonic>
judofyr: figured it out all on my own for once, thx tho
vlad_starkov has joined #ruby-lang
<judofyr>
somasonic: nice
elia has joined #ruby-lang
dankest has quit [Read error: Connection reset by peer]
<whitequark>
(btw, you can subclass Numeric... just not Integer.)
<injekt>
yeah yeah
<whitequark>
corecode: a bit slow... but I finally figured out how exactly do I want to compose code with automatic and manual memory management
<whitequark>
which is pretty good :)
spinky has quit [Read error: Connection reset by peer]
khalua_ has joined #ruby-lang
crudson1 has joined #ruby-lang
apeiros_ has joined #ruby-lang
judofyr_ has joined #ruby-lang
voker57__ has joined #ruby-lang
malign_ has joined #ruby-lang
floyd2 has joined #ruby-lang
nertzy2 has joined #ruby-lang
<corecode>
cool
retro|cz has quit [Ping timeout: 245 seconds]
carloslopes has quit [Remote host closed the connection]
dr_bob has joined #ruby-lang
mistym_ has joined #ruby-lang
<whitequark>
injekt: hey, slop fails to parse the following correctly
bzalasky has joined #ruby-lang
<whitequark>
-LEe 'foo'
<whitequark>
I'd expect it to have the same effect as -L -E -e 'foo'
havenn_ has joined #ruby-lang
Kabaka has quit [*.net *.split]
bedouin has quit [*.net *.split]
elia has quit [*.net *.split]
_elia is now known as elia
<yorickpeterse>
I'm reaching this point where I'm going to buy a shovel and hit people with it
<yorickpeterse>
however, this time I'll do my best not to tell my boss I'm going to hit him first
<yorickpeterse>
I don't think I can get away with that a second time
<whitequark>
lol
<injekt>
whitequark: -abc flags are ambiguous so slop provides config options to disambiguate between -a -b -c and -abc, that said I still think your case won't work for either option. Could you open an issue and I'll fix it this eve?
nertzy3 has quit [Ping timeout: 256 seconds]
<whitequark>
injekt: wait, how is -abc ambiguous if you use --foo for long opts?
<injekt>
whitequark: because slop supports people who want to use -foo for long opts too, but it defaults to separating them
bzalasky has quit [Remote host closed the connection]
barttenbrinke has quit [Remote host closed the connection]
wudofyr__ has joined #ruby-lang
bothra has joined #ruby-lang
bothra has quit [Read error: Connection reset by peer]
duty2 has joined #ruby-lang
mouse_ has joined #ruby-lang
bothra has joined #ruby-lang
scampbell has joined #ruby-lang
kvs has quit [Ping timeout: 246 seconds]
Squarepy has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
kvs has joined #ruby-lang
bzalasky has joined #ruby-lang
Squarepy has joined #ruby-lang
alessio_rocco has quit [Read error: Connection reset by peer]
alessio_rocco has joined #ruby-lang
judofyr_ has quit [Remote host closed the connection]
<whitequark>
hey folks
erpuds has joined #ruby-lang
<yorickpeterse>
what
<ericwood>
yo
<ericwood>
today I am teaching interns how to ruby
<whitequark>
what would be the most efficient way (it is a hot spot) to: 1) extract positions of \n's from a String 2) find the nearest preceding \n given a position
<whitequark>
3) select n'th line from a string
* ericwood
opens up the string docs
<yorickpeterse>
split it by \n ?
<yorickpeterse>
Then count the length of each segment, add 1 and you have the position
<ericwood>
for 2 you should do a substring and then an index()
<whitequark>
yorickpeterse: I'd like to avoid storing both the split string and unsplit one
<yorickpeterse>
finding the nearest in that case would be a matter of selecting the previous element
<whitequark>
and storing unsplit string is more important.
gnufied has joined #ruby-lang
cofin has joined #ruby-lang
<injekt>
whitequark: fixed, found another bug though which I intend to fix, then I'll throw out a bugfix release
<whitequark>
injekt: wow that was fast
<injekt>
:P
<zzak>
what is a ruby
<injekt>
zzak: u r
vlad_starkov has joined #ruby-lang
carloslopes has joined #ruby-lang
kgrz has quit [Ping timeout: 276 seconds]
<zzak>
no u
rebelcan has joined #ruby-lang
wasnotrice has joined #ruby-lang
dankest has joined #ruby-lang
<injekt>
whitequark: pushed 3.4.5
vlad_starkov has quit [Ping timeout: 246 seconds]
<whitequark>
whoever created a method with name attr_accessible which you are expected to use in the context where attr_accessor is also valid
<whitequark>
must be shot
anonymuse has joined #ruby-lang
<ericwood>
attr_accessible is a rails thing, isn't it?
<ericwood>
to avoid mass-assignment vulns
<injekt>
ya
<ericwood>
whitelisting update shiznit
<ericwood>
I think it's a perfectly valid name
JohnBat26 has quit [Ping timeout: 248 seconds]
<apeiros_>
attr_accessible is logic in the wrong domain…
<whitequark>
ericwood: I just confused one with the another several times in a row
<whitequark>
due to the similar name
<ericwood>
pebkac
<ericwood>
;)
<apeiros_>
models became the new logic dump. everything happens there.
<ericwood>
I practice "fat models, fat controllers, and fat views"
<injekt>
heh my editor doesn't highlight anything rails-y but does highlight attr_accessor that's the only way I can quickly see differences
<apeiros_>
attr_accessible iirc is dead in rails4 anyway.
<ericwood>
models are *supposed* to be where teh logic goes
<injekt>
I dont think it's dead is it? just replaced for doing mass assignment via the controller
<injekt>
maybe I'm wrong though
<apeiros_>
ericwood: it's not a models business to know which user can access what attribute of it. sorry. that's just bullshit.
carloslopes has quit [Ping timeout: 256 seconds]
<apeiros_>
the whole collusion of validation and models is shit too.
<ericwood>
apeiros_: I'm just talking about which attributes can be mass-assigned
<ericwood>
not user stuff
<apeiros_>
guess what
<apeiros_>
that's connected to users
<injekt>
I think all the above stuff is the job of the controller
* ericwood
shrugs, doesn't have super strong opinions and doesn't belong in the conversation
Guest35350 has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<apeiros_>
that's why you can define attr_accessible as: "foo"
flak has joined #ruby-lang
<apeiros_>
because some users (admins e.g.) sometimes can mass-assign
<apeiros_>
which is when it should start to become obvious that it's a stupid idea to deal with it that way.
<apeiros_>
anyway, gotta catch the train.
vlad_starkov has joined #ruby-lang
flak is now known as Guest34966
<injekt>
choo choo
<ericwood>
choo choo muthafucka
spinky has joined #ruby-lang
carloslopes has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
jvrmaia has quit [Remote host closed the connection]
jxie has joined #ruby-lang
Swimmin__ has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Ping timeout: 276 seconds]
io_syl has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
tylersmith has joined #ruby-lang
mistym_ has left #ruby-lang [#ruby-lang]
mistym has joined #ruby-lang
<erikh>
fatty on rails
_elia has joined #ruby-lang
tylersmith has quit [Ping timeout: 252 seconds]
Swimming_Bird has joined #ruby-lang
<whitequark>
hm, iterating a string via while and string[index] is marginally slower than #each_char even on cruby
gnufied has joined #ruby-lang
<erikh>
has to convert the integer
<whitequark>
huh
<erikh>
s[] likely is a C call, no? each_char can do it all in C just yielding the character
elia_ has joined #ruby-lang
elia has quit [Ping timeout: 248 seconds]
elia_ is now known as elia
<erikh>
with s[], you need to do an i, and increment it, and then s[i] will require i to be converted to a native C type
<erikh>
presuming that's how the loop looks. am I missing something here?
_elia has quit [Read error: Operation timed out]
<whitequark>
erikh: kinda
<whitequark>
ruby has fixnums... integers are VALUEs, i.e. fit in the native pointer and aren't heap allocated
<whitequark>
well, small integers.
<whitequark>
however, earlier (in 1.8 times), invoking closures was kinda slow
<whitequark>
I'm delighted to learn it isn't anymore.
alessio_rocco has quit [Remote host closed the connection]
banister`tv has joined #ruby-lang
utkanos has joined #ruby-lang
elia has quit [Read error: Connection reset by peer]
elia has joined #ruby-lang
matti has joined #ruby-lang
matti has quit [Changing host]
matti has joined #ruby-lang
<utkanos>
hi there, somewhat new to ruby and hopefully a quick formatting question that is plaguing me currently. I am needing to print out some data that contains ascii characters that do not translate to normal characters and puts seems to be interpreting it literally, causing erratic garbage characters, etc to come out.
<erikh>
ok, interview time
<erikh>
ttfn
<utkanos>
I am packing the output to Hex encoded string, it appears fine when manually called, but when run through a loop and using puts, its garbling the data
__butch__ has joined #ruby-lang
sono_ has joined #ruby-lang
<utkanos>
its type is string already, I want to find some way to print the literal output instead of it being interpreted
nyuszika7h has quit [Read error: Operation timed out]
machuga is now known as machuga|away
benlovell has quit [Ping timeout: 252 seconds]
spectra has joined #ruby-lang
benlovell has joined #ruby-lang
<andrewvos>
erikh: Are you going to Go offline?
<andrewvos>
erikh: Sorry
matti has quit [Ping timeout: 252 seconds]
<andrewvos>
erikh: Erm, what do you think of Go? I haven't really researched it but just noticed it's not JVM so am kinda interested.
matti has joined #ruby-lang
matti has joined #ruby-lang
holgerno has joined #ruby-lang
holgerno has quit [Client Quit]
matti has quit [Ping timeout: 248 seconds]
cwd1 has joined #ruby-lang
enebo has quit [Quit: enebo]
sono_ has left #ruby-lang [#ruby-lang]
machuga|away is now known as machuga
saarinen has joined #ruby-lang
forrest has joined #ruby-lang
scampbell has joined #ruby-lang
cwd1 has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 246 seconds]
headius has quit [Quit: headius]
<yorickpeterse>
whitequark: question: I need a name for a data container that will contain info such as variables, method calls and all that limited to a certain scope (e.g. a method body)
<yorickpeterse>
would "Context" be a decent name for such a data container?
swav has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 248 seconds]
jxpx777 has joined #ruby-lang
workmad3 has joined #ruby-lang
fsvehla has joined #ruby-lang
<whitequark>
yorickpeterse: Scope.
<yorickpeterse>
I'm not sure which I like better
<yorickpeterse>
both are basically the same
JpC0utur3 has joined #ruby-lang
<yorickpeterse>
also god damn it, I really need to find somebody who's just as crazy as I am so I can rubberduck with said person
<yorickpeterse>
(close by that is)
<whitequark>
you're not crazy
whitequark is now known as shrieker
<yorickpeterse>
heh
* shrieker
shrieks
shrieker is now known as whitequark
S1kx has joined #ruby-lang
<yorickpeterse>
interesting enough there's a guy I work with at $WORK (he works part time for us once in a while) who's bascially me but 10 years older
<yorickpeterse>
as in, at some point he even had the same t-shirt
<whitequark>
10-year-older you or you, but 10 year older?
<yorickpeterse>
and he also walks around socks while drinking tea
<yorickpeterse>
whitequark: 10 year older than I am
<yorickpeterse>
he's around 30 or so
<yorickpeterse>
* on socks
<whitequark>
as in
<whitequark>
does he have 10 years more valuable experience and generally more wise, or just older
<yorickpeterse>
AS IN AGE DAMN IT
<whitequark>
not sure why I suddenly wanted to ask this
<whitequark>
ok
<injekt>
...
<whitequark>
inkjet: wat?
<injekt>
what has become of this channel
<yorickpeterse>
injekt: mind your own business brit bieber
<whitequark>
shriekers
<yorickpeterse>
bbieber, ha
<injekt>
yorickpeterse: I HAVE SHORT HAIR
<yorickpeterse>
more like bruv-bieber
<yorickpeterse>
amirite?
<injekt>
more like gtfo
<yorickpeterse>
hm, I should get a camera and record myself coding
<yorickpeterse>
that would be pretty fucking hilarious to watch
<injekt>
oO
<yorickpeterse>
given I have music playing that is
<whitequark>
(insert obscene analogy here)
<yorickpeterse>
haha
<injekt>
yeah not sure i'd wanna watch that
<injekt>
maybe I should do it and play bieber in the background
<yorickpeterse>
whitequark: just imagine me singing along with nightwish's escapist
<yorickpeterse>
and "drumming"
<injekt>
uh "drumming" D:
<whitequark>
haha nightwish
<whitequark>
also wtf travis
<yorickpeterse>
sadly I can't exactly reach high tones
<whitequark>
why did all of my 1.8 builds have failed to connect to github
dezasseis has left #ruby-lang [#ruby-lang]
tbuehlmann has quit [Remote host closed the connection]
<yorickpeterse>
Ok next question: do I call the code that creates method definitions and all that VirtualMachine or Environment?
<yorickpeterse>
it's not entirely a VM but I like the name
<yorickpeterse>
and it makes more sense than Environment
<whitequark>
s,VirtualMachine,PartialEvaluator,
<whitequark>
because that is what you have there
<yorickpeterse>
meh
<whitequark>
Environment is a different shit
__butch__ has quit [Quit: Leaving.]
<whitequark>
Environment would contain your local variables... in your case, its responsibilities are already taken care of by Scope (if I understand you correctly)
nyuszika7h has joined #ruby-lang
<whitequark>
damn it's HOT here
<yorickpeterse>
Scope was just an idea, not sure if I actually need a new class for it since I already have Definition::RubyObject and Definition::RubyMethod
<apeiros>
I don't think ruby is supposed to figure whether foo/bar and foo/baz are the same file or not
<apeiros>
so if foo/bar is a symlink of foo/baz, that's still two different files to ruby
vlad_starkov has joined #ruby-lang
tdy has quit [Ping timeout: 245 seconds]
<injekt>
yup
<cout>
when I implemented something like require_relative back in the ruby 1.6 days, I had it resolve symlinks, but I think ruby 1.9 is actually right to not do so
anonymuse has joined #ruby-lang
pipework has quit [Remote host closed the connection]
totallymike has quit [Quit: WeeChat 0.4.0]
benlovell has quit [Ping timeout: 256 seconds]
<kstone>
I agree that ruby on a whole should not resolve symlinks but during the require phase why shouldn't require be using the canonical paths to avoid as many double requires as possible?
barttenbrinke has quit [Remote host closed the connection]
<workmad3>
why are you symlinking your code all over the place? :/
vlad_starkov has quit [Ping timeout: 260 seconds]
<kstone>
only vendored gem directories to make bundle install a bit faster
nathanstitt has quit [Quit: I growing sleepy]
justinmburrous has joined #ruby-lang
enebo has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
redyellowgreen has joined #ruby-lang
nathanstitt has joined #ruby-lang
pr0ton has joined #ruby-lang
TheNotary has quit [Quit: Leaving]
pskosinski has quit [Remote host closed the connection]
scottschecter has quit [Ping timeout: 256 seconds]
sush24 has joined #ruby-lang
jovy88_ has quit [Read error: Connection reset by peer]
jovy88_ has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
jmeeuwen has quit [Ping timeout: 264 seconds]
malign has quit [Ping timeout: 276 seconds]
zommi has quit [Remote host closed the connection]
Paradox has quit [Read error: Connection reset by peer]
<drbrain>
injekt: pong
<malign>
:(
DarkBushido has joined #ruby-lang
<injekt>
drbrain: t'was regarding the discussion we just had
<drbrain>
ok!
_dabradley has left #ruby-lang [#ruby-lang]
Paradox has joined #ruby-lang
io_syl has quit [Ping timeout: 252 seconds]
voker57__ has quit [Read error: Connection reset by peer]
benlovell has quit [Ping timeout: 256 seconds]
io_syl has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
krohrbaugh has quit [Read error: Connection reset by peer]
krohrbaugh1 has joined #ruby-lang
pr0ton has joined #ruby-lang
swygue has quit [Ping timeout: 264 seconds]
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
sailias1 has quit [Quit: Leaving.]
krohrbaugh1 has quit [Ping timeout: 246 seconds]
krohrbaugh has joined #ruby-lang
mucker has quit [Quit: leaving]
r0bby has joined #ruby-lang
vlad_starkov has joined #ruby-lang
gianlucadv has quit [Ping timeout: 260 seconds]
blacktulip has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 248 seconds]
redyellowgreen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<injekt>
drbrain: are you happy for me to deprecate 1.8 in the next 2.x release of mechanize?
<drbrain>
injekt: yes
<drbrain>
1.8.7 reaches EOL for security fixes in six weeks
<injekt>
great :)
<injekt>
yup
s0ber_ has joined #ruby-lang
rygood has joined #ruby-lang
redyellowgreen has joined #ruby-lang
s0ber has quit [Ping timeout: 256 seconds]
matti has quit [Ping timeout: 246 seconds]
s0ber_ is now known as s0ber
jvrmaia has quit [Remote host closed the connection]
redyellowgreen has quit [Client Quit]
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
carloslopes has quit [Remote host closed the connection]
<darix>
drbrain: nooooooooooo
machuga is now known as machuga|away
<darix>
drbrain: i think going EOL upstream and actually stopped being shipped will be a large difference.
<drbrain>
darix: yeah
<darix>
it will take quiet a bit until the rhel/sles releases with 1.8 in them go EOL
khalua_ has quit [Remote host closed the connection]
<darix>
you dont want to know how long i backported to 1.4!
<drbrain>
darix: but I sure am getting tired of writing "on ruby 1.9+ I could write (two words) but this works on 1.8.7" followed by a five lines of a backwards compatible implementation
<drbrain>
darix: ha!
yalue has quit [Quit: Leaving]
<darix>
drbrain: just 5 lines? then i dont understand all the hot air:p
<drbrain>
darix: it's harshing on my good vibes, man!
<darix>
if 1.9 would be a drop in replacement for 1.8 ... updating would be so much easier
<whitequark>
bonus points for the implementation actually not being completely compatible on some weird edge cases
<whitequark>
darix: well, 2.0 is
<whitequark>
(for 1.9)
<darix>
nice... that wont solve the show stopper from 1.8 -> newer
bcardarella has left #ruby-lang [#ruby-lang]
<andrewvos>
erikh: Great blog entry (gem activation)
chessguy has quit [Remote host closed the connection]
pr0ton has joined #ruby-lang
sandbags has quit [Remote host closed the connection]