havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.1, 2.5.3, 2.4.5: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
mikecmpbll has quit [Quit: inabit. zz.]
Onwarion has joined #ruby
ua has joined #ruby
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
Onwarion has quit [Ping timeout: 240 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
Onwarion has joined #ruby
sezuan has quit [Ping timeout: 259 seconds]
orbyt_ has quit [Ping timeout: 268 seconds]
jyaworski has joined #ruby
ramfjord has joined #ruby
sezuan has joined #ruby
<ramfjord> Anyone know a good library to parse strings like '500Mi' into a number of bytes?
<ramfjord> Mi, Gi, Ki are the units I need to support
tdy has quit [Ping timeout: 244 seconds]
forager has joined #ruby
orbyt_ has joined #ruby
gix has quit [Ping timeout: 244 seconds]
mr_blue has joined #ruby
<mr_blue> hi all
houhoulis has joined #ruby
<mr_blue> What the keywork 'using' means in : 'class C1; using C2; end' ?
Onwarion has quit [Ping timeout: 258 seconds]
<mr_blue> I was aware about 'include' and 'extend' but I do not find infos about 'using'
<leftylink> I think using is for a refinement
znz_jp has quit [Remote host closed the connection]
<leftylink> &>> module ArraysCanSayHello refine Array do def hello; "hello" end end end; using ArraysCanSayHello; [].hello
<rubydoc> # => "hello" (https://carc.in/#/r/6dqj)
orbyt_ has quit [Ping timeout: 245 seconds]
znz_jp has joined #ruby
tylerc has quit [Quit: Leaving]
<mr_blue> leftylink: great thank you :) I'll check you link
bmurt has joined #ruby
<mr_blue> leftylink: I there official doc about this ?
<mr_blue> s/I there/Is there/
renich has quit [Ping timeout: 258 seconds]
<leftylink> mr_blue: I'm sure there probably is. you will probably be able to find it, now that you know it is called a Refinement. It should be in the docs for versions 2.0.0 and later
AJA4351 has joined #ruby
jyaworski has quit [Ping timeout: 245 seconds]
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
<mr_blue> leftylink: yes you're right I just found it. Thank again for you time :)
orbyt_ has joined #ruby
Onwarion has joined #ruby
forager has quit [Quit: leaving]
mangold has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
tdy has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
mangold has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
faitswulff has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
duderonomy has joined #ruby
jyaworski has joined #ruby
AJA4350 has quit [Remote host closed the connection]
crankharder has joined #ruby
scapegoatee has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
Swyper has joined #ruby
<Swyper> hi
<ruby[bot]> Swyper: as I told you already, please use https://gist.github.com
<Swyper> can someone help me out
<Swyper> 01_coprime.rb:16: void value expression
<Swyper> end
tdy has quit [Ping timeout: 240 seconds]
jyaworski has quit [Ping timeout: 246 seconds]
renich has joined #ruby
orbyt_ has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
faitswulff has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
faitswulff has joined #ruby
houhoulis has quit [Remote host closed the connection]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kapil____ has quit [Quit: Connection closed for inactivity]
Swyper has joined #ruby
<Swyper> hi
<Swyper> i have alot of syntax errors
<Swyper> any tipz
Swyper has quit [Remote host closed the connection]
fluxAeon has joined #ruby
ogres has joined #ruby
jyaworski has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
Swyper has joined #ruby
<Swyper> why will no1 help me =(
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jyaworski has quit [Ping timeout: 244 seconds]
scapegoatee has quit [Quit: Leaving...]
<mozzarella> fix them
Swyper has quit [Remote host closed the connection]
blackmesa has quit [Quit: WeeChat 2.3]
crankharder has quit [Ping timeout: 250 seconds]
wolfshappen_ has quit [Ping timeout: 250 seconds]
wolfshappen has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
crankharder has joined #ruby
Swyper has joined #ruby
<Swyper> mozzarella:
<Swyper> idk how
ur5us has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 255 seconds]
v01d4lph4 has joined #ruby
<Swyper> havenwood: you on?
<baweaver> Swyper: You're on your own for syntax errors, you need to look those up.
<baweaver> What have you tried to fix your syntax errors?
\void has joined #ruby
<Swyper> baweaver: well I looked up the correct syntax and read the error message
<Swyper> the crazy part is some of the errors its showing arent even in my code
<baweaver> They are.
<baweaver> How do you write a Ruby method?
<baweaver> What's the syntax?
<Swyper> ^
<Swyper> changing line 12 to coprime? still gives me the same errors
<baweaver> Fix the indentation as a first step
<baweaver> Second, what's your method name?
<baweaver> Third, where is that method defined when you call it on 7 through 10?
<Swyper> 1) done, 2) coprime? 3) the method is defined right below the method call
<Swyper> is 3) causing the error? does a method need to be defined before its called?
<baweaver> 2: No it's not
<baweaver> 3: Yes
<baweaver> Ruby isn't that smart.
<Swyper> okay so in C iirc the options are to 1) define the method before calling it or 2) declare the method signature and define it later on, is it exactly the same for Ruby?
<Swyper> 2) so my method name is 'coprime' not 'coprime?' ?
<Swyper> if the answer to 2) is yes what does ? mean in the context of ruby
<Swyper> I have so many errors and I'm not really sure how to look them up since the errors aren't really descriptive
MyMind has joined #ruby
ByronJohnson has quit [Ping timeout: 272 seconds]
Sembei has quit [Ping timeout: 245 seconds]
Swyper has quit [Remote host closed the connection]
xlued has quit [Quit: The Lounge - https://thelounge.github.io]
Swyper has joined #ruby
<Swyper> eh
<Swyper> i got it working
<Swyper> thanks for your help baweaver
xlued has joined #ruby
Xiti` has joined #ruby
Xiti` has quit [Remote host closed the connection]
Xiti has quit [Ping timeout: 244 seconds]
faitswulff has quit [Remote host closed the connection]
SeepingN has joined #ruby
Xiti has joined #ruby
ByronJohnson has joined #ruby
Swyper has quit [Remote host closed the connection]
nadir has quit [Quit: Connection closed for inactivity]
bairyn has joined #ruby
agent_white has quit [Quit: night]
t0xik has joined #ruby
ByronJohnson has quit [Ping timeout: 250 seconds]
Swyper has joined #ruby
tdy has joined #ruby
Swyper has quit [Ping timeout: 240 seconds]
rippa has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
jyaworski has joined #ruby
jcarl43 has joined #ruby
jyaworski has quit [Ping timeout: 245 seconds]
\void has quit [Quit: So long, and thanks for all the fish.]
cd has quit [Quit: cd]
chens has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
conta has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
am0123 has joined #ruby
DTZUZO has joined #ruby
idiocrash has joined #ruby
Furai has quit [Quit: WeeChat 2.4]
Furai has joined #ruby
sauvin has joined #ruby
prestorium has joined #ruby
tdy1 has joined #ruby
aupadhye has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
mangold has joined #ruby
jyaworski has joined #ruby
maufart__ has joined #ruby
jyaworski has quit [Ping timeout: 244 seconds]
nowhere_man has quit [Ping timeout: 258 seconds]
jyaworski has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.4]
jyaworski has quit [Ping timeout: 244 seconds]
mangold has quit [Quit: This computer has gone to sleep]
Cthulu201 has quit [Remote host closed the connection]
kapil____ has joined #ruby
Cthulu201 has joined #ruby
lxsameer has joined #ruby
blackmesa has joined #ruby
clemens3_ has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
darkphnx has quit [Remote host closed the connection]
alem0lars has joined #ruby
alem0lars has quit [Ping timeout: 246 seconds]
renich has quit [Ping timeout: 240 seconds]
my1es has quit [Remote host closed the connection]
idiocrash has quit [Quit: Textual IRC Client: www.textualapp.com]
Tuor has joined #ruby
mikecmpbll has joined #ruby
tdy1 has quit [Ping timeout: 255 seconds]
<G> Having a bit of a d'oh moment, what is it in ruby terms when you do something like. method_a.dostuff.domorestuff (i.e. the .dostuff and .domorestuff)
<zenspider> G: they're either just called method calls or chained method calls... why? what's your doh moment?
am0123 has quit [Ping timeout: 258 seconds]
<G> zenspider: I was just trying to think of the best term to use while Googling :)
<zenspider> G: ask me, not google
<G> Basically, what I'm trying to do is prevent the next chained method from running, because I've already run it - this is a monkey patched method situation.
<zenspider> so, you have something like obj.a.b.c and you want #b to prevent #c from "running" ?
<G> Yeah!
<zenspider> can you explain the "why" a bit more?
<zenspider> you've monkey patched a class or object to do something custom and you want to be done in the middle?
<G> Yeah, so the background is, this is within a rails app, and more specifically ActionMailer (just so it's a little less abstract), controller calls MailerClass.send_message.deliver I've monkey patched send_message because we need to do things before and after the MailerClass actually sends the message, so the new send_message kind of looks like: dostuff, resp = orig_send_message.deliver, domorestuff, resp (where commas are linebreaks), but I'm finding .delive
reber has joined #ruby
<TheBrayn> you could use &. and return nil
<zenspider> G: the proper way to do that is to subclass, override, and use super w/ your custome prefix/suffix code around the super...
<zenspider> but... if you are already in the muck... either what TheBrayn said, or you return a dummy that doesn't respond to those chained messages
<zenspider> obj = Object.new; def obj.c; self; end; def obj.d; self; end; obj
<zenspider> I don't actually recommend creating objects like that. Create a DummyMail class, or whatever, and instantiate one. That way you're not mucking with method tables all the time
reber has quit [Remote host closed the connection]
<zenspider> does that make sense?
<G> Just trying to figure it out in my head
<zenspider> to which scenario?
<zenspider> SO CLOSE: 6339 runs, 27766 assertions, 4 failures, 19 errors, 44 skips
<G> I don't think TheBrayn's suggestion would work, because the calling controller needs the response, I think I've got to do what you've suggested. Just going to brb while I look at something real quick
<zenspider> does it need the response? generally you call mailers for side-effect, no?
<G> Need to record Message-Id's
<zenspider> also, what are you monkey patching it for? what problem are you trying to solve?
<G> The mailer service, modifies the message-id from what the application provides, AND what ActionMailer generates, but doesn't replace the Message ID in the returned response, instead it adds to the response hash, the monkey patch is to return the Message ID that was truly used by replacing the message-id
<G> I'm starting to ponder if it'd be easier to monkey patch that class, wrap around deliver!
<zenspider> I would suggest NOT changing the return type at all. Instead, store off the value you want in a side instance variable on the response object and access it in the controller
<zenspider> try to get it as simple as possible. Something like:
<zenspider> def some_monkey_patched_method; @original_msg_id = @msg_id; super; end
<zenspider> Then you can also create an accessor method or just use ivar_get to grab it in the crontroller
cnsvc_ has quit [Ping timeout: 256 seconds]
wolfshappen has quit [Ping timeout: 244 seconds]
wolfshappen_ has joined #ruby
jyaworski has joined #ruby
arup_r has joined #ruby
jyaworski has quit [Ping timeout: 250 seconds]
<G> zenspider: thanks for the help, I managed to get a solution where I didn't have to touch the controllers to get SES working right, think I'll be filing an issue on their github repo though
<zenspider> you should. thank you
themsay has joined #ruby
arup_r has quit []
am0123 has joined #ruby
blackmesa1 has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
blackmesa1 has quit [Ping timeout: 264 seconds]
ellcs has joined #ruby
xrexeon has joined #ruby
mangold has joined #ruby
conta has quit [Ping timeout: 246 seconds]
Tuor has quit [Ping timeout: 264 seconds]
laaron- has joined #ruby
conta has joined #ruby
xrexeon has quit [Remote host closed the connection]
laaron has quit [Remote host closed the connection]
am0123 has quit [Ping timeout: 245 seconds]
aqd has quit [Quit: Leaving]
jyaworski has joined #ruby
ramfjord has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
ramfjord has quit [Ping timeout: 250 seconds]
jyaworski has quit [Ping timeout: 240 seconds]
stryek has joined #ruby
jyaworski has joined #ruby
mr_blue has quit [Quit: Lost terminal]
chens has quit [Remote host closed the connection]
iMadper has joined #ruby
houhoulis has joined #ruby
Pisuke has joined #ruby
MyMind has quit [Ping timeout: 258 seconds]
jyaworski has quit [Ping timeout: 255 seconds]
arooni has quit [Ping timeout: 245 seconds]
arooni_team_b has joined #ruby
zapata_ has joined #ruby
zapata has quit [Ping timeout: 258 seconds]
houhoulis has quit []
gray_-_wolf has joined #ruby
<zenspider> Finished in 4.867713s, 1302.2543 runs/s, 5722.3998 assertions/s.
<zenspider> 6339 runs, 27855 assertions, 0 failures, 0 errors, 44 skips
<zenspider> !!!!
<darix> zenspider: that seems a bit slow *runs*
<zenspider> Pththth
<zenspider> more important (to me, currently) are the zeros
<zenspider> that was ~12 hour debugging session and rat's nest untangling
nowhere_man has joined #ruby
am0123 has joined #ruby
fribmendes has joined #ruby
rprimus_ has joined #ruby
am0123 has quit [Ping timeout: 245 seconds]
aqd has joined #ruby
AJA4350 has joined #ruby
nwradio has quit [Read error: Connection reset by peer]
nwradio has joined #ruby
am0123 has joined #ruby
faitswulff has joined #ruby
nfk has joined #ruby
blackmesa1 has joined #ruby
nowhere_man has quit [Ping timeout: 250 seconds]
blackmesa1 has quit [Ping timeout: 252 seconds]
darkphnx has joined #ruby
ogres has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
blackmesa1 has joined #ruby
jyaworski has joined #ruby
blackmesa1 has quit [Ping timeout: 264 seconds]
jyaworski has quit [Ping timeout: 250 seconds]
hightower3 has joined #ruby
<hightower3> How do I most conveniently delete [0..x] indices from array and return them as list?
<phaul> &ri Array#shift, hightower3
<hightower3> aah, fabulous
AJA4350 has quit [Ping timeout: 250 seconds]
Creatornator has joined #ruby
lucasb has joined #ruby
AJA4350 has joined #ruby
bmurt has joined #ruby
conta has quit [Ping timeout: 245 seconds]
orbyt_ has joined #ruby
Rapture has joined #ruby
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
Dbugger has joined #ruby
themsay has quit [Ping timeout: 240 seconds]
themsay has joined #ruby
maufart__ has quit [Ping timeout: 244 seconds]
jyaworski has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
Xeago_ is now known as Xeago
ramfjord has quit [Ping timeout: 255 seconds]
jyaworski has quit [Ping timeout: 268 seconds]
Creatornator has joined #ruby
conta has joined #ruby
jyaworski has joined #ruby
polishdub has joined #ruby
SeepingN has joined #ruby
blackmesa1 has joined #ruby
<ellcs> is there a better way for `1.digits.count`?
<bhaak> Math.log10(1).floor + 1
<bhaak> less mathy: 1.to_s.length
tdy1 has joined #ruby
<ellcs> thanks
agent_white has joined #ruby
<phaul> what's wrong with 1.digits.count ?
<mozzarella> it's certainly the most readable
<bhaak> it's probably also the slowest.
<mozzarella> I'm not sure
am0123 has quit [Ping timeout: 250 seconds]
<ellcs> i think digits is slower
conta has quit [Read error: Connection reset by peer]
conta has joined #ruby
jyaworski has quit [Ping timeout: 250 seconds]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
jyaworski has joined #ruby
<bhaak> puts Benchmark.measure { 10_000_000.times { 123456.digits.count } }; puts Benchmark.measure { 10_000_000.times { 123456.to_s.length } }; puts Benchmark.measure { 10_000_000.times { Math.log10(123456).floor + 1 } }
<bhaak> 5 seconds vs 3.3 seconds vs 1.2 seconds
<bhaak> I would have expected the math version to be faster
jyaworski has quit [Ping timeout: 245 seconds]
jyaworski has joined #ruby
<Zarthus_> kinda depends on how often you run the bechmark
<Zarthus_> the second and third one get kinda close to eachother
wolfshappen_ has quit [Ping timeout: 246 seconds]
conta has quit [Quit: conta]
wolfshappen has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
<hightower3> What's the best way to spawn a process and only take control of its stdin, leaving stdout/stderr as-is?
jyaworski has quit [Ping timeout: 240 seconds]
aupadhye has quit [Ping timeout: 245 seconds]
<bhaak> Zarthus_: the times are pretty stable. but running it now, I get 1.6s seconds for the to_s version
ellcs has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
cd has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dmwit> Only one of the three works on negative numbers, and the fastest one doesn't handle bignums.
prestorium has quit [Ping timeout: 268 seconds]
volkov has joined #ruby
<bhaak> the math one worksforme with bignums
<bhaak> and "working" with negative numbers is depending on what you expect. I'd say -1.to_s.length => 2 is wrong
volkov has quit [Remote host closed the connection]
cd has quit [Quit: cd]
<bougyman> hrm. I forgot something and google isn't helping me remember.
cd has joined #ruby
<bougyman> google points me here, which are just variations of what I'd already done: https://stackoverflow.com/questions/133357/how-do-you-find-the-namespace-module-name-programmatically-in-ruby-on-rails
<phaul> bougyman: There is module nesting
<phaul> and that's orthogonal to inheritance
<phaul> &ri Module.nesting
nowhere_man has joined #ruby
<bougyman> phaul: I know it is.
<phaul> you split on '::' which is what nesting is, and you also deal with ancestors, which is inheratnce. Those are completely disparate things
<bougyman> I don't think I ever mentioned inheritance. I know the difference.
<bougyman> This is just namespace nesting.
<bougyman> and I want to know the parent namespace of a class inside that module
ivanskie has joined #ruby
<bougyman> module Outer; module Inner; module SuperInner; class Foo; def my_parent; ...; end; end; end; end; end
ivanskie has quit [Client Quit]
<bougyman> I want foo's my_parent to return Outer::Inner::SuperInner
<bougyman> I mean, that's what it does, currently.
<hightower3> Why I get "wrong exec redirect action" when I try to do: input = StringIO.new; spawn(*cmdline, :in => input) ?
<hightower3> (I would like to print into 'input' to be fed into the process' stdin)
<phaul> &>> module A; module B; module C; class D; def self.x; Module.nesting.first; end; end; end; end; end; A::B::C::D.x
<rubydoc> # => A::B::C::D (https://carc.in/#/r/6dyg)
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> or Module.nesting[1] for the outer scope.
<phaul> &>> module A; module B; module C; class D; def self.x; Module.nesting[1]; end; end; end; end; end; A::B::C::D.x
<rubydoc> # => A::B::C (https://carc.in/#/r/6dyh)
JayDoubleu has joined #ruby
<phaul> bougyman: the gist did self.class.ancestors.first which confused me. can you explain what that bit of code is supposed to do?
<JayDoubleu> Hi, I am completely new to ruby. If I want to run bunch of queries on aws and cache it, should I save it to a file and check that file on each run or is there some sort of caching module/plugin available ?
Creatornator has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #ruby
\void has joined #ruby
jcarl43 has joined #ruby
<hightower3> is "a, b = b, a" atomic in MRI?
galaxie has joined #ruby
<balo> hightower3: RubyVM::InstructionSequence.compile("a = 1; b =2; a, b = b, a").disasm
prestorium has joined #ruby
<galaxie> How would I make an array out of the results of calling a method n times?
<elomatreb> You can use Integer#times with map to get this easily
<hightower3> galaxie, something as simple as results = []; 10.times do |i| results.push a_method() end ?
[Butch] has joined #ruby
<hightower3> thanks balo, nice one
<galaxie> elomatreb: And that's as fast as hightower3's suggestion?
<elomatreb> Probably equivalent or slightly faster
<balo> &>> 3.times.map { |n| "n=#{n}" }
<rubydoc> # => ["n=0", "n=1", "n=2"] (https://carc.in/#/r/6dyi)
<galaxie> elomatreb: My mind's blanking, what's it called when you pass something like &:to_s or similar?
<balo> galaxie: it's called symbol to proc :)
<elomatreb> galaxie: 0.to_s, 1.to_s, ...
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
orbyt_ has joined #ruby
mikecmpbll has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Ping timeout: 246 seconds]
prestorium has quit [Remote host closed the connection]
<phaul> &asm>> a = 1; b = 2; a, b = b, a
<rubydoc> I have disassembled your code, the result is at https://carc.in/#/r/6dyn
xrexeon has joined #ruby
prestorium has joined #ruby
<bougyman> phaul: the parent of a child class is looking for its own namespace.
<bougyman> But this method is defined in its parent class.
<bougyman> which has a different namespace.
<bougyman> Module.nesting seems to always choose the parent class's namespace.
orbyt_ has joined #ruby
olspookishmagus has quit [Quit: All for nothing]
ams__ has joined #ruby
bairyn is now known as ByronJohnson
mikecmpbll has joined #ruby
clemens3_ has quit [Ping timeout: 244 seconds]
themsay has quit [Ping timeout: 255 seconds]
<phaul> I _think_ self.class.ancestors.first is just self.class. To get the parent class there is .superclass
gix has joined #ruby
renich has joined #ruby
<phaul> that^ is until al2o3-cr arrives with Fiddle :D
jyaworski has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
KeyJoo has joined #ruby
jyaworski has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby
xrexeon has quit [Remote host closed the connection]
href has quit [Remote host closed the connection]
mikecmpbll has quit [Client Quit]
queip has quit [Quit: bye, freenode]
renich_ has joined #ruby
AJA4350 has quit [Remote host closed the connection]
renich has quit [Ping timeout: 245 seconds]
cow[moo] has joined #ruby
AJA4350 has joined #ruby
prestorium has quit [Ping timeout: 250 seconds]
renich_ is now known as renich
ua has quit [Ping timeout: 255 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ogres has quit [Quit: Connection closed for inactivity]
bambanx has joined #ruby
Creatornator has joined #ruby
orbyt_ has quit [Ping timeout: 244 seconds]
Creatornator has quit [Ping timeout: 250 seconds]
serverok has joined #ruby
ramfjord has joined #ruby
ua has joined #ruby
serverok has left #ruby [#ruby]
am0123 has joined #ruby
gray_-_wolf has quit [Quit: WeeChat 2.3]
KeyJoo has quit [Quit: KeyJoo]
orbyt_ has joined #ruby
d^sh_ has quit [Ping timeout: 244 seconds]
d^sh has joined #ruby
tdy1 is now known as tdy
jyaworski has joined #ruby
sauvin has quit [Remote host closed the connection]
ericboehs1 has quit [Quit: WeeChat 2.3]
ramfjord has quit [Ping timeout: 268 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
jyaworski has quit [Ping timeout: 250 seconds]
am0123 has quit [Remote host closed the connection]
am0123 has joined #ruby
Rapture has quit [Ping timeout: 255 seconds]
reber has joined #ruby
hightower3 has quit [Ping timeout: 244 seconds]
am0123 has quit [Ping timeout: 255 seconds]
xtsee has joined #ruby
jyaworski has joined #ruby
wilbert has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
jyaworski has quit [Ping timeout: 264 seconds]
crankhar1er has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
postmodern has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanx has quit [Ping timeout: 250 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
orbyt_ has joined #ruby
hiroaki_ has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
cnsvc_ has joined #ruby
Fernando-Basso has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
marmotini_ has joined #ruby
am0123 has joined #ruby
marmotini_ has quit [Ping timeout: 255 seconds]
am0123 has quit [Ping timeout: 244 seconds]
<zenspider> phaul: prepend can fuck up that assumption
hightower2 has joined #ruby
reber has quit [Remote host closed the connection]
ams__ has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
<phaul> zenspider: true
nwradio has quit [Read error: Connection reset by peer]
nwradio has joined #ruby
<phaul> based on what they said tho, I _think_ they wanted self.class.superclass. as they wanted parent?
<hightower2> Is there a way to start a thread and not have to join it later after it exits?
wolfshappen has quit [Ping timeout: 255 seconds]
wolfshappen_ has joined #ruby
<ramfjord> hightower2: after the process exits? All threads will be terminated. After the thread exits? Doesn't join just tell a process to wait for the threads to exit? not sure what you're trying for
<ramfjord> guys I just wrote some beautious ruby code to use ActiveModel::Validations on dynamically generated objects: https://gist.github.com/ramfjord/8903bfd6c4d9dbb0cb44866d4a52335e
<hightower2> ramfjord, yes (the latter case you describe), but isn't it that until I call join() the thread isn't garbage collected
<hightower2> I want it to be GC-ed, but without me having to call join or do any cleanup after it decides to exit
<ramfjord> Ahhh, well I don't know the internals of the GC, but i would think that as the thread finishes it would pop off it's stack, and the reference counter would be able to see that the ojects are collectible. Probably others could answer better than I though.
<ramfjord> You might be able to test this out by starting a thread which creates a big array and exits, then in the main thread sleep a second or two and call GC.start, all while monitoring the memory usage
<ramfjord> or do you already know they won't be GC'd in the thread without join?
<hightower2> ramfjord, I'm pretty sure they're not collected because the return value is still pending - no one retrieved it, and in the list of threads they are still visible even though in state DEAD or whatever
<hightower2> (whatever the exit status was)
<ramfjord> separate thread that lists dead threads and joins them :D
<hightower2> hehe :) possibly :)
moei has quit [Quit: Leaving...]
jyaworski has joined #ruby
<ramfjord> weirdly when I'm testing this locally I can't seem to reduce the process memory usage with GC.start even after I join the thread
<zenspider> hightower2: what you're describing is a bad smell
<ramfjord> yeah, possibly keeping a persistent threadpool with work units and a queue would be better, since there's probably a decent overhead to starting and stopping them
<hightower2> oh yeah, I assumed thread == a process I run in it, when in fact nothing prevents me from re-using the same thread from starting the process in a loop multiple times
<hightower2> zenspider, yeah I wasn't intending to really do it the way I asked, unless some favorable answer/option was given
jyaworski has quit [Ping timeout: 250 seconds]
akem has quit [Remote host closed the connection]
akem has joined #ruby
hiroaki_ has quit [Ping timeout: 244 seconds]
hiroaki_ has joined #ruby
polishdub has quit [Quit: leaving]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 255 seconds]
AJA4351 is now known as AJA4350
wilbert has quit [Ping timeout: 255 seconds]
zapata_ is now known as zapata
cd has quit [Remote host closed the connection]
cd has joined #ruby
ogres has joined #ruby
sameerynho has quit [Ping timeout: 244 seconds]
ericboehs has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
r3m has quit [Quit: WeeChat 2.5-dev]
r3m has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 255 seconds]
renich_ is now known as renich
jyaworski has joined #ruby