baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: 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!
<havenwood> mememeIAMMEE: The patterns `Hash.new(0)` and `Hash.new { |h, k| h[k] = []` are the most common other than a simple Hash literal `{}`.
chouhoulis has joined #ruby
<havenwood> mememeIAMMEE: Just know that if you lookup a Hash key that doesn't exist, it'll be `nil` by default.
<mememeIAMMEE> So would Hash.new(0) make the hash dynamic by default?
<havenwood> >> Hash.new(0)[:example]
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood> >> Hash.new(0)[:example]
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood> the bot is donw
<havenwood> Hash.new(0)[:example] #=> 0
<mememeIAMMEE> You mean dumb
<havenwood> h = Hash.new 0; h[:example] += 2; h[:example] #=> 2
<havenwood> mememeIAMMEE: ^ it's a pattern for zero as the default value for an undefined key
<havenwood> mememeIAMMEE: the same for an Array isn't what people usually want, Hash.new([])
<havenwood> mememeIAMMEE: because that Array is the value for *every* key, that exact Array, not a new one for each missing key
za1b1tsu has quit [Ping timeout: 246 seconds]
<havenwood> this makes a *fresh* Array for each default key value: Hash.new { |h, k| h[k] = [] }
<havenwood> mememeIAMMEE: But yeah, you don't have to use default Hash values. You can just ensure they're something there before shoveling if you prefer..
<havenwood> {}[:no_default] #=> nil
<havenwood> {}[:no_default] += 1 #!> ERROR
<havenwood> Hash.new(0)[:default] += 1 #=> 1
<havenwood> mememeIAMMEE: make sense?
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
<mememeIAMMEE> Um
<mememeIAMMEE> Kind of but
<mememeIAMMEE> does Hash.new { |h, k| h[k] = [] } not create a lot of empty keys?
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<havenwood> >> h = Hash.new { |h, k| h[k] = [] }; h.default_proc
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<mememeIAMMEE> I can effectively use it in my code now, but I do not have a full understanding of it.
<havenwood> mememeIAMMEE: That block is setting the default proc for a missing key.
<havenwood> => #<Proc:...>
<havenwood> >> h = Hash.new { |h, k| h[k] = [] }; h # see, it's empty
<mememeIAMMEE> What does proc mean
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<mememeIAMMEE> Hash.new { |h, k| h[k] = [] }
<mememeIAMMEE> Hash.new { |h, k| h[k] = [] };
<havenwood> #=> {}
<mememeIAMMEE> Oh, I see. Ill brb at work, must act busy for a minute.
<havenwood> mememeIAMMEE: A proc is like a little function object that encloses the context. I'd not worry about it for your interview.
<havenwood> >> >> add_one = proc { |n| n + 1 }; add_one.call 42 # mememeIAMMEE this is a proc
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
chouhoulis has quit [Ping timeout: 245 seconds]
<havenwood> #=> 42
<havenwood> #=> 43
<havenwood> I gotta stop using the bot.
<havenwood> mememeIAMMEE: Procs are neat. Come back and ask the channel when you have time!
chouhoulis has joined #ruby
bhaak has joined #ruby
DTZUZO has joined #ruby
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 244 seconds]
GodFather_ has quit [Ping timeout: 252 seconds]
gnufied has quit [Ping timeout: 264 seconds]
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<mememeIAMMEE> Almost done
chouhoulis has quit [Ping timeout: 244 seconds]
chouhoulis has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
AKPWD has quit [Quit: じゃね。]
AKPWD has joined #ruby
chouhoulis has joined #ruby
<mememeIAMMEE> I have returned
<mememeIAMMEE> Actually wait, I think I want coffee.
cagomez has quit [Remote host closed the connection]
AJA4350 has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 272 seconds]
chouhoulis has joined #ruby
orbyt_ has joined #ruby
<mememeIAMMEE> Now I'm back, with coffee. So havenwood are you still here?
<mememeIAMMEE> Alright, can somebody explain procs to me? I hear they are neat.
chouhoulis has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
ramfjord has quit [Ping timeout: 252 seconds]
chouhoulis has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
pablo_ has quit [Quit: Leaving]
brandoncc has joined #ruby
za1b1tsu has joined #ruby
ZzZombo has joined #ruby
gnufied has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
endofline has quit [*.net *.split]
fribmendes has quit [*.net *.split]
shoogz has quit [*.net *.split]
funnel has quit [*.net *.split]
woodruffw has quit [*.net *.split]
jordanm has quit [*.net *.split]
mikkel- has quit [*.net *.split]
khomesh24 has quit [*.net *.split]
cyclonis has quit [*.net *.split]
Exagone313 has quit [*.net *.split]
Miron has quit [*.net *.split]
varesa has quit [*.net *.split]
cpallares has quit [*.net *.split]
c0san0stra has quit [*.net *.split]
Biohazard has quit [*.net *.split]
maxvaillancourt1 has quit [*.net *.split]
jidar has quit [*.net *.split]
gsingh93 has quit [*.net *.split]
phage has quit [*.net *.split]
veloutin has quit [*.net *.split]
KramerC has quit [*.net *.split]
Ameisen has quit [*.net *.split]
patteh has quit [*.net *.split]
larissa has quit [*.net *.split]
tris has quit [*.net *.split]
Guest50286 has quit [*.net *.split]
iooner has quit [*.net *.split]
Guest46016 has quit [*.net *.split]
KramerC_ has joined #ruby
stan has quit [Write error: Connection reset by peer]
KramerC_ is now known as KramerC
Miron_ has joined #ruby
phage has joined #ruby
apeiros has quit [Ping timeout: 272 seconds]
swistak35 has joined #ruby
Guest48993 has joined #ruby
fribmendes has joined #ruby
gsingh93 has joined #ruby
woodruffw has joined #ruby
cpallares has joined #ruby
khomesh24 has joined #ruby
c0san0stra has joined #ruby
Exagone313 has joined #ruby
endofline has joined #ruby
shoogz- has joined #ruby
lxsameer has joined #ruby
jcalla has quit [Ping timeout: 244 seconds]
lxsameer has quit [Ping timeout: 264 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shoogz- is now known as shoogz
varesa has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
<mememeIAMMEE> Is there a more efficient method of doing this?
<mememeIAMMEE> def last_digit(int) int.to_s.chars.to_a[-1].to_i end
\void has quit [Quit: So long, and thanks for all the fish.]
<mememeIAMMEE> https://dpaste.de/2NXx
<mememeIAMMEE> It was the first idea that came to mind.. Dunno how efficient converting back and forth 3 times is though
<al2o3-cr> mememeIAMMEE: int.digits.first
<mememeIAMMEE> first?
<mememeIAMMEE> But im looking for last?
ZzZombo has quit [Remote host closed the connection]
ramfjord has joined #ruby
<al2o3-cr> Integer#digits returns an array of integers in reverse order.
apeiros has joined #ruby
<mememeIAMMEE> How could I convert the int to_a in normal order?
<mememeIAMMEE> int.to_a doesn't seem to work
orbyt_ has joined #ruby
<al2o3-cr> mememeIAMMEE: why do you want it in normal order?
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mememeIAMMEE> I'm just trying to shovel a lot of information before interview, just in case i need it.
<mememeIAMMEE> Never used Ruby, trying to learn it in 3 days
<mememeIAMMEE> Actually 4, even better :)
<mememeIAMMEE> Lunch break, be back.
Freshnuts has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pskosinski has quit [Ping timeout: 252 seconds]
pskosinski has joined #ruby
za1b1tsu has joined #ruby
cpruitt has joined #ruby
jottr has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
cpruitt has quit [Ping timeout: 252 seconds]
jottr has quit [Ping timeout: 244 seconds]
esrse has joined #ruby
jcalla has joined #ruby
justizin has joined #ruby
orbyt_ has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
herbmillerjr has quit [Ping timeout: 252 seconds]
herbmillerjr has joined #ruby
kotepillar_ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
cpruitt has joined #ruby
cpruitt has quit [Ping timeout: 244 seconds]
arooni has quit [*.net *.split]
duckpuppy has quit [*.net *.split]
vutral|kali has quit [*.net *.split]
JasonO has quit [*.net *.split]
Raboo has quit [*.net *.split]
leafyleong has quit [*.net *.split]
jsrtr has quit [*.net *.split]
Raboo_ has joined #ruby
Raboo_ is now known as Raboo
arescorpio has joined #ruby
kotepillar_ has quit [Quit: kotepillar_]
arooni has joined #ruby
kotepillar_ has joined #ruby
duckpuppy has joined #ruby
braincrash has quit [Quit: bye bye]
lxsameer has joined #ruby
JasonO has joined #ruby
dan64 has joined #ruby
braincrash has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
mememeIAMMEE has quit [Quit: Page closed]
dan64 has quit [Ping timeout: 246 seconds]
Tempesta has quit [Ping timeout: 244 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sigyn has joined #ruby
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amelliaa has joined #ruby
ramfjord has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
im0nde has quit [Ping timeout: 252 seconds]
duderonomy has joined #ruby
za1b1tsu has quit [Ping timeout: 245 seconds]
dan64 has joined #ruby
dviola has joined #ruby
im0nde has joined #ruby
thy0 has quit [Quit: TTFN]
jottr has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
agent_white has quit [Quit: brb]
donofrio has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 2.2]
cpruitt has joined #ruby
cpruitt has quit [Ping timeout: 246 seconds]
cpruitt has joined #ruby
tristanp has joined #ruby
agent_white has joined #ruby
agent_white has quit [Client Quit]
agent_white has joined #ruby
Ameisen has joined #ruby
cpruitt has quit [Ping timeout: 272 seconds]
tristanp has quit [Remote host closed the connection]
dellavg_ has joined #ruby
za1b1tsu has joined #ruby
dellavg_ has quit [Ping timeout: 240 seconds]
cpruitt has joined #ruby
fredlinhares has quit [Quit: WeeChat 1.4]
brandoncc has joined #ruby
cpruitt has quit [Ping timeout: 244 seconds]
sauvin has joined #ruby
tristanp has joined #ruby
tristanp has quit [Ping timeout: 240 seconds]
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 252 seconds]
reber has joined #ruby
amelliaa has quit [Quit: -]
brandoncc has joined #ruby
brandoncc has quit [Client Quit]
brandoncc has joined #ruby
Sigyn has left #ruby ["Leaving the channel (no spam or action taken for 30 days.) /invite Sigyn #ruby again if needed"]
dan64 has quit [Quit: ZNC - http://znc.in]
dan64 has joined #ruby
kapil___ has joined #ruby
BTRE has quit [Remote host closed the connection]
cpruitt has joined #ruby
Inline has quit [Quit: Leaving]
cpruitt has quit [Ping timeout: 252 seconds]
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
arescorpio has quit [Quit: Leaving.]
brandoncc has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 272 seconds]
aupadhye has joined #ruby
cpruitt has joined #ruby
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tristanp has joined #ruby
akem__ has quit [Ping timeout: 240 seconds]
snickers has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
tristanp has quit [Ping timeout: 245 seconds]
cpruitt has quit [Ping timeout: 252 seconds]
agent_white has quit [Quit: night]
scottj has quit [Quit: leaving]
MoritaShinobu has joined #ruby
madhatter has quit [Remote host closed the connection]
Dark_Arc has quit [Quit: ZNC 1.6.5 - http://znc.in]
madhatter has joined #ruby
aufi has joined #ruby
za1b1tsu has quit [Ping timeout: 245 seconds]
cgfbee has quit [Remote host closed the connection]
<marz_d`ghostman> apeiros: Why can I declare a module, a method inside it and invoke the inject(:+) method directly? I though I need to include Enumerable first? https://gist.github.com/marzdgzmn/e804d65ca37bc98684c912803d9df0c7
cd has quit [Quit: cd]
asphyxia has joined #ruby
cpruitt has joined #ruby
clemens3_ has quit [Ping timeout: 244 seconds]
aufi has quit [Ping timeout: 264 seconds]
cpruitt has quit [Ping timeout: 252 seconds]
jottr has joined #ruby
Tempesta has joined #ruby
cpruitt has joined #ruby
za1b1tsu has joined #ruby
yohji has joined #ruby
Dark_Arc has joined #ruby
cpruitt has quit [Ping timeout: 252 seconds]
johnny56 has quit [Ping timeout: 272 seconds]
sysvalve has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
postmodern has quit [Quit: Leaving]
za1b1tsu has joined #ruby
aufi has joined #ruby
esrse has quit [Ping timeout: 244 seconds]
za1b1tsu has quit [Ping timeout: 252 seconds]
cpruitt has joined #ruby
akem has joined #ruby
za1b1tsu has joined #ruby
akem has quit [Client Quit]
c0ncealed2 has quit [Remote host closed the connection]
cpruitt has quit [Ping timeout: 246 seconds]
c0ncealed2 has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
cgfbee has joined #ruby
jcalla has quit [Ping timeout: 264 seconds]
kotepillar_ has quit [Quit: kotepillar_]
lxsameer has joined #ruby
johnny56 has joined #ruby
cpruitt has joined #ruby
cpruitt has quit [Ping timeout: 250 seconds]
RougeR has joined #ruby
Tempesta has quit [Remote host closed the connection]
agit0 has joined #ruby
<NL3limin4t0r_afk> marz_d`ghostman: I guess it depends where you include your module. If Enumerable is already included this works without issues.
NL3limin4t0r_afk is now known as NL3limin4t0r
<NL3limin4t0r> Otherwise an exception will be raised.
<NL3limin4t0r> >> module Sumable; def sum; inject(:+); end; end; class Foo; include Sumable; end; Foo.new.sum
<ruby[bot]> NL3limin4t0r: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
Beams has joined #ruby
<NL3limin4t0r> #=> NoMethodError: undefined method `inject' for #<Foo:0x00556e3c944238>
za1b1tsu has quit [Ping timeout: 245 seconds]
* NL3limin4t0r sighs
<NL3limin4t0r> ruby[bot] has a lot of issues lately
ShekharReddy has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
za1b1tsu has joined #ruby
hogetaro has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
cgfbee has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
cgfbee has joined #ruby
Tuor has joined #ruby
chichou has joined #ruby
cgfbee has quit [Read error: No route to host]
graphene has quit [Read error: Connection reset by peer]
graphene has joined #ruby
code_zombie has quit [Quit: Leaving]
Freshnuts has quit [Quit: Leaving]
cgfbee has joined #ruby
aupadhye has quit [Ping timeout: 264 seconds]
leitz has joined #ruby
ams__ has joined #ruby
vqrs has quit [Ping timeout: 240 seconds]
aupadhye has joined #ruby
vqrs has joined #ruby
elphe has joined #ruby
Cork has quit [Ping timeout: 250 seconds]
tristanp has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
tristanp has quit [Ping timeout: 252 seconds]
charlielor has joined #ruby
charlielor has quit [Client Quit]
charlielor has joined #ruby
charlielor has quit [Client Quit]
cgfbee has quit [Ping timeout: 252 seconds]
elphe has joined #ruby
cgfbee has joined #ruby
charlielor has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
aupadhye has quit [Quit: Leaving]
jammanbo has joined #ruby
<jammanbo> Is there anyone using the Grape gem that can point me to an example of an endpoint that serves both JSON and HTML?
ChrisBr has quit [Ping timeout: 250 seconds]
trif has quit [Ping timeout: 272 seconds]
aupadhye has joined #ruby
ShekharReddy has quit [Quit: Connection closed for inactivity]
apeiros has quit [Remote host closed the connection]
DTZUZO has joined #ruby
vqrs has quit [Ping timeout: 252 seconds]
ChrisBr has joined #ruby
vqrs has joined #ruby
paraxial has joined #ruby
AJA4350 has joined #ruby
sonOfRa has quit [Remote host closed the connection]
sonOfRa has joined #ruby
apeiros has joined #ruby
chihhsin has quit [Quit: leaving]
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
paraxial has joined #ruby
Cork has joined #ruby
apeiros has quit [Remote host closed the connection]
hogetaro has quit [Quit: Leaving...]
heinrich5991 has quit [Quit: quit.]
elphe has joined #ruby
charlielor has quit [Quit: charlielor]
heinrich5991 has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
cpruitt has joined #ruby
p0s1x has joined #ruby
p0s1x has quit [Client Quit]
charlielor has joined #ruby
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
cpruitt has quit [Ping timeout: 245 seconds]
charlielor has left #ruby [#ruby]
<Yxhuvud> not me. the more experience I get with grape the more I prefer pure rails
RougeR has quit [Ping timeout: 252 seconds]
ciro has quit [Quit: WeeChat 2.2]
<jammanbo> I think I just figured it out. The formatters are defined per endpoint *I think*, so you can just `present` your object and if you've defined both a :json and a :html formatter, the appropriate one will be used.
elphe has joined #ruby
<jammanbo> But, yes I agree, Rails API looks increasingly like it would have been the better choice.
<jammanbo> I feel bad for saying that. Grape is great. Lots of love to the developers. It's just a steep curve.
elphe has quit [Ping timeout: 246 seconds]
paraxial has joined #ruby
bhaak has quit [Ping timeout: 245 seconds]
za1b1tsu has quit [Ping timeout: 245 seconds]
za1b1tsu has joined #ruby
RougeR has joined #ruby
Cork has quit [Ping timeout: 252 seconds]
Cork has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
elphe has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
Sina_ is now known as Sina
za1b1tsu has joined #ruby
marz_d`ghostman has quit [Ping timeout: 246 seconds]
cpruitt has joined #ruby
elphe has joined #ruby
cpruitt has quit [Ping timeout: 250 seconds]
elphe has quit [Ping timeout: 252 seconds]
cpruitt has joined #ruby
<leitz> Don't feel bad; accept that some tools are better for some jobs. We all have picked up the wrong tool at times. Like Perl. :P
cpruitt has quit [Ping timeout: 244 seconds]
RougeR has quit [Ping timeout: 264 seconds]
cpruitt has joined #ruby
aufi_ has joined #ruby
cpruitt has quit [Ping timeout: 240 seconds]
aufi has quit [Ping timeout: 264 seconds]
cpruitt has joined #ruby
cpruitt has quit [Remote host closed the connection]
vqrs has quit [Ping timeout: 240 seconds]
cpruitt has joined #ruby
thejs has joined #ruby
RougeR has joined #ruby
bmurt has joined #ruby
vqrs has joined #ruby
jammanbo has quit [Quit: Page closed]
AndreYuhai has joined #ruby
thy0 has joined #ruby
<AndreYuhai> Hello, does an instance object get garbage collected when I assign something else to the same variable which was holding the referred object before? Or how does this works? Any sources?
apeiros has joined #ruby
apeiros__ has joined #ruby
snickers has quit [Ping timeout: 252 seconds]
apeiros has quit [Ping timeout: 240 seconds]
<tbuehlmann> AndreYuhai: yup, it gets GCed if it's not referenced anymore
<al2o3-cr> >> arr = [1,2,3]; arr_mem = arr.object_id; arr = "foo"; ObjectSpace._id2ref arr_mem
<AndreYuhai> tbuehlmann: Thank you. ^^ I was wondering whether it would take so much memory because I instantiate an object a lot of times but always assigning it to the same variable.
<ruby[bot]> al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<al2o3-cr> >> arr = [1,2,3]; arr_mem = arr.object_id; arr = "foo"; ObjectSpace._id2ref arr_mem
<ruby[bot]> al2o3-cr: # => [1, 2, 3] (https://eval.in/1057599)
<al2o3-cr> >> arr = [1,2,3]; arr_mem = arr.object_id; arr = "foo"; GC.start; ObjectSpace._id2ref arr_mem rescue $!
<ruby[bot]> al2o3-cr: # => [1, 2, 3] (https://eval.in/1057600)
<al2o3-cr> #=> #<RangeError: 0x00002adc74b53558 is recycled object>
<AndreYuhai> al2o3-cr: well looks like we don't even need to call it. I guess?
<al2o3-cr> not really.
ua_ has joined #ruby
<AndreYuhai> al2o3-cr: Thank you for the example. :)
<al2o3-cr> AndreYuhai: np ;)
elphe has joined #ruby
simmaniac has joined #ruby
sysvalve has quit [Ping timeout: 245 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Quit: ZNC 1.7.1+deb2 - https://znc.in]
elphe has quit [Ping timeout: 252 seconds]
levifig has quit [Ping timeout: 272 seconds]
audy has quit [Ping timeout: 272 seconds]
noodle has quit [Quit: /quit]
RougeR has quit [Ping timeout: 272 seconds]
ChrisBr has quit [Ping timeout: 272 seconds]
sticaz has quit [Ping timeout: 272 seconds]
sagax has quit [Ping timeout: 272 seconds]
Sp4rKy has quit [Ping timeout: 272 seconds]
sticaz has joined #ruby
RougeR has joined #ruby
ChrisBr has joined #ruby
leafyleong has joined #ruby
Sp4rKy has joined #ruby
bmurt has joined #ruby
asphyxia has quit [Ping timeout: 272 seconds]
noodle has joined #ruby
sysvalve has joined #ruby
redlegion has quit [Quit: Fuck this, I'm out.]
elphe has joined #ruby
simmaniac has quit [Ping timeout: 240 seconds]
DarthGandalf has quit [Ping timeout: 240 seconds]
Rapture has joined #ruby
DarthGandalf has joined #ruby
amelliaa has joined #ruby
<apeiros__> AndreYuhai: to elaborate a bit on tbuehlmann's response: it *can* get GCed from the moment it is not referenced anymore. but how immediate that is depends on a number of factors. that's also why finalizers are usually a bad idea.
apeiros__ is now known as apeiros
ZzZombo has joined #ruby
<AndreYuhai> apeiros: What factors for example?
maufart__ has joined #ruby
<apeiros> depends on the gc, and I'm not fully up to date with ruby's progress on its mark & sweep gc
<apeiros> but f.ex. it's afaik split in young and old generations
aufi_ has quit [Ping timeout: 246 seconds]
<havenwood> tricolor now!
<apeiros> so an object which existed for a long time already will take longer to be actually collected
discopatrick has joined #ruby
<apeiros> hah, good, I see I can just refer to havenwood for this :)
<apeiros> havenwood: tricolor? so they can't use a "simple" bitmap field anymore for marking?
<apeiros> that's the one optimization I remember well since that allowed *nix' COW fork to work in a meaningful way :)
<apeiros> I also seem to remember something like "arenas" being used for the implementation of the generations?
* apeiros notices that he's reeeeally fuzzy by now on how ruby 2.5 or even 2.6's gc actually works :-(
<havenwood> apeiros: trying to find a good writeup, because i don't recall the details
<havenwood> this was the generational one in 2.2: https://blog.heroku.com/incremental-gc
<AndreYuhai> havenwood: Thanks!
<apeiros> do you know, does yorick implement his inko in rust now?
<havenwood> AndreYuhai: Tenderlove gave a good talk: https://www.youtube.com/watch?v=r0UjXixkBV8
<apeiros> hm, 2014, I think there have been quite a bit of changes since then, no?
<havenwood> apeiros: yes, totally
<AndreYuhai> havenwood: I will watch that too. Thank you.
<havenwood> the mruby GC actually has great docs: https://github.com/mruby/mruby/blob/master/src/gc.c#L22-L94
<havenwood> i'm _fairly_ sure i'm not just thinking of mruby's GC ;-P
<apeiros> I hope I get around to learn rust properly in my 3 month timeout next year. if so, I'll have another go at my toy programming language.
<apeiros> the alternative would be to try it again in ruby, targeting WASM & bootstrapping
<havenwood> remarkably hard to find anything about modern Ruby GC
<havenwood> i know it's tri-color, but there's nothing written about it ¯\_(ツ)_/¯
<apeiros> :-/
<apeiros> ruby.secrets
<apeiros> maybe we need a 2nd edition of ruby under the microscope :)
<havenwood> apeiros: i said that to Shaughnessy a few weeks ago at Fog City Ruby :-)
amelliaa has quit [Quit: -]
herbmillerjr has quit [Quit: Konversation terminated!]
<apeiros> author of the 1st edition I presume?
<havenwood> yup
<apeiros> I think that'd be the first CS related book in a long time I'd actually buy.
<apeiros> back in the 1st edition I don't think I'd have learned much. but now I don't really have time to keep up :(
aupadhye has quit [Quit: Leaving]
aupadhye has joined #ruby
<havenwood> took me a while, but found an actual reference to Ruby's tri-color GC!: https://youtu.be/r0UjXixkBV8?t=1342
<havenwood> AndreYuhai: ^
<apeiros> oh, youtube. can't watch at work :(
<apeiros> but still, thanks havenwood!
<AndreYuhai> havenwood: Yeap, got it! :)
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 250 seconds]
chouhoulis has joined #ruby
maufart__ has quit [Remote host closed the connection]
aupadhye has quit [Quit: Leaving]
Tuor has quit [Quit: Konversation terminated!]
<leitz> havenwood, I finally got my tests running after that minor refactor you suggested.
<leitz> Still have issues to fix, but mentally processing apeiros' comment about the mixin module. May need another refactor to use a Builder.
graphene has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
<leitz> I still need to understand the issue more, though.
AndreYuhai has quit [Ping timeout: 252 seconds]
graphene has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
<havenwood> leitz: nice
<leitz> Yeah, you say that now...wait till I start hitting you with questions. ;)
chichou has quit [Ping timeout: 264 seconds]
TheNet has joined #ruby
<apeiros> leitz: maybe just don't hit with questions? be more gentle ;-D
<apeiros> eh, that might come off wrong. I meant to play on the word "hit"
jidar has joined #ruby
Miron_ is now known as Miron
<leitz> apeiros, beats "hit on", since I think havenwood and I have Significant Others that might get concerned. :)
bhaak has joined #ruby
beefjoe has joined #ruby
yohji has quit [Remote host closed the connection]
jcarl43 has joined #ruby
jcarl43 has quit [Client Quit]
sysvalve has quit [Quit: Leaving]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
BTRE has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
beefjoe has quit [Ping timeout: 272 seconds]
graphene has quit [Remote host closed the connection]
sanscoeur has joined #ruby
graphene has joined #ruby
[Butch] has joined #ruby
dviola has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
jdawgaz has joined #ruby
Dbugger has joined #ruby
orbyt_ has joined #ruby
krawchyk has joined #ruby
Puffball has joined #ruby
jcarl43 has joined #ruby
sagax has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 240 seconds]
RougeR has quit [Ping timeout: 264 seconds]
bmurt has joined #ruby
jdawgaz has quit [Remote host closed the connection]
lxsameer has joined #ruby
jdawgaz has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk has quit [Ping timeout: 244 seconds]
bmurt has quit [Client Quit]
Beams has quit [Quit: .]
orbyt_ has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
lxsameer has quit [Ping timeout: 240 seconds]
Inline has joined #ruby
Inline has quit [Read error: Connection reset by peer]
dviola has quit [Quit: WeeChat 2.2]
graphene has quit [Remote host closed the connection]
Inline has joined #ruby
graphene has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
apeiros has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 240 seconds]
desperek has joined #ruby
lxsameer has joined #ruby
lytol_ has joined #ruby
eckhardt has joined #ruby
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 250 seconds]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
za1b1tsu has joined #ruby
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
lxsameer has joined #ruby
blood has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 272 seconds]
<blood> I can
<blood> I can't get my ruby program to execute a command file properly : https://gist.github.com/bloodmc/965be762adf4f36072f14252e5a23c4e Any ideas?
<blood> Nothing is ever written to log.txt
graphene has quit [Remote host closed the connection]
<blood> when using system, the same issue occurs
lxsameer has quit [Ping timeout: 272 seconds]
graphene has joined #ruby
eckhardt has joined #ruby
apeiros has quit [Remote host closed the connection]
lxsameer has joined #ruby
<NL3limin4t0r> blood: Is log.txt created? If the file is made by you try to remove it and run the script again to ensure that it at least can locate/create the file.
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<blood> NL3limin4t0r: if i move the write line before the call to my cmd, it creates it
jdawgaz has joined #ruby
<blood> for some reason calling the cmd just gets stuck there and never returns
lxsameer has quit [Ping timeout: 272 seconds]
resnik2 has joined #ruby
graphene has quit [Remote host closed the connection]
MoritaShinobu has quit [Quit: Leaving]
<resnik2> >> @n = 0; 20.times.map { Thread.start { 10000.times { @n += 1 } }}.each(&:join); puts @n
<ruby[bot]> resnik2: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
graphene has joined #ruby
<resnik2> Can anyone tell me why there isn't a race condition on +=?
duderonomy has joined #ruby
<baweaver> resnik2
<baweaver> gah, enter key
<resnik2> good answer.
<baweaver> So....
<baweaver> How far down that rabbit hole do you want? :D
chouhoulis has quit [Remote host closed the connection]
<resnik2> I don't understand why the timer thread doesn't kick in and suspend the currently running thread
lxsameer has joined #ruby
apeiros has joined #ruby
<NL3limin4t0r> blood: Does your console command return when ran in a standard cmd terminal?
<baweaver> Because the very succinct answer is Associative operations
<baweaver> 1 + 2 + 3 == 1 + (2 + 3). You could apply them in any order
kwerle has joined #ruby
<baweaver> It's distributable as well because of the presence of an empty value, known as identity, defined by a type and a binary operation.
kwerle has quit [Client Quit]
<baweaver> Or, more simply, plus and 0
<resnik2> baweaver, are you replying to me?
<baweaver> 0 + 1 == 1 + 0 == 1
<baweaver> You asked why there isn't a race condition
furrymcgee has joined #ruby
<blood> NL3limin4t0r: good point it does not. However, the cmd is never being executed as it should be writing to another log file indicating it is running. If i execute the cmd manually, the log is updated as expected.
<resnik2> yes, I asked why the native thread doesn't switch to the other ruby thread in the middle of retrieaval / set operation
<blood> basically the cmd starts a weblogic process and eventually enters a running state
<resnik2> in MRI, obviously.
<baweaver> Technically there is a race condition, but because plus behaves in an associative manner you're not going to notice it
<baweaver> Try it with - or /
nfk has joined #ruby
<baweaver> No matter what order you add or multiply numbers in, you'll get the same result
lxsameer has quit [Ping timeout: 244 seconds]
apeiros has quit [Ping timeout: 264 seconds]
<baweaver> If you want to see the order execution, use the block arg for times and output that.
<baweaver> @n = 0; 20.times.map { |t| p t; Thread.start { 10000.times { @n += 1 } }; p t }.each(&:join); puts @n
<nfk> tk's virtual event handling is driving me up the wall with the absolute lack of ruby specific documentation and none of tcl or python results i can google being of much use
chouhoulis has joined #ruby
apeiros has joined #ruby
<resnik2> I think I'm not getting it. Thread #1 -> GET(@n) -> 0 -> +1 <CONTEXT SWITCH> -> SET @n=1. Thread#2 -> GET(@n) -> 0 -> +1 -> SET @n=1. <CONTEXT SWITCH>
elphe has joined #ruby
<resnik2> already lost 1
<nfk> i got to the point of being able to call the handler (which is a bit ugly but whatever) but then the program gets a TypeError of all things...
* baweaver wanders off to make an example
<resnik2> >> require 'thread'; @n = 10000; 10.times.map { Thread.start { 1000.times { @n -= 1 } }}.each(&:join); puts @n
<ruby[bot]> resnik2: # => (https://eval.in/1057690)
<NL3limin4t0r> blood: Hmm, that's strange. Are you sure you point to the right direction? You could test if using backticks instead of using Open3 helps.
<NL3limin4t0r> eg. result = `your cmd command here`
lxsameer has joined #ruby
<blood> I just tried executing 'dir' and same result
<blood> ok let me try that
<NL3limin4t0r> You might need to escape backslashes
apeiros has quit [Ping timeout: 246 seconds]
apeiros has joined #ruby
chouhoulis has quit [Ping timeout: 272 seconds]
<furrymcgee> n a ruby script there is a error in the line: public :eof?
<resnik2> I don't care about execution order, all I care why is total correct
<baweaver> furrymcgee: you'll have to share a bit more than that.
<furrymcgee> ./makeref:194:in `public': undefined method `eof?' for class `TokenStream'
<baweaver> TokenStream doesn't have an eof? method
lxsameer has quit [Ping timeout: 252 seconds]
<blood> N3limin4t0r: same issue happens. Any debugging I can turn on to see what is happening?
<furrymcgee> the next line is def eof?
<apeiros> furrymcgee: the method has to be defined
<baweaver> gotta run, train is getting to the station
<apeiros> you can't mark a method which isn't yet defined as public/protected/private
<blood> I'm using ruby 2.4.4p296 (2018-03-28 revision 63013) [x64-mingw32]
<blood> if that helps
<NL3limin4t0r> blood: There is the "byebug" gem.
<apeiros> furrymcgee: also, unless you inherit from a class where eof? is private, there's no point really in doing `public :your_method`
chouhoulis has joined #ruby
<NL3limin4t0r> Once installed you can place `byebug` in your file (after require 'byebug')
<NL3limin4t0r> Execution will stop on that line
<blood> very nice, let me try that
<blood> hrmm, doesn't work for mingw32, it fails during install
<resnik2> >> @n = 50000; 50.times.map { Thread.start { 1000.times { @n -= 1 } }}.each(&:join); puts @n
<ruby[bot]> resnik2: # => (https://eval.in/1057702)
lxsameer has joined #ruby
<apeiros> resnik2: no threads in ruboto (eval.in restricts that)
<resnik2> still not getting what's stopping currently running thread from being "suspended" in the middle of GET/SET -= op
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Ping timeout: 252 seconds]
<NL3limin4t0r> blood: Hmm, can't help you with the install. I'm currenty in my Ubuntu environment.
<apeiros> resnik2: re your original question: there is a race condition in that code.
<apeiros> resnik2: it's just that race conditions don't always trigger
SeepingN has joined #ruby
<NL3limin4t0r> blood: https://stackoverflow.com/questions/3955688/how-do-i-debug-ruby-scripts might be worth a look. I guess the main question now is why aren't shell commands not executing. It might be due to the fact that you are running ruby on windows tbh.
jdawgaz has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
<resnik2> loop { @n = 50000; 50.times.map { Thread.start { 1000.times { @n -= 1 } }}.each(&:join); puts :FINALLY unless 0 == @n }
<NL3limin4t0r> I'm guessing the command is send to a mingw32 shell instead.
<resnik2> it seems the answer is NEVER on mri.
vutral|kali has joined #ruby
<nfk> is it just me or virtual event in ruby/tk handling is not working as it's supposed to?
<apeiros> it's quite possible that newer rubies don't schedule other threads between +=/-= in certain cases (e.g. numeric receiver), in that case you'd indeed not have a race condition.
<nfk> *virtual event handling
lxsameer has joined #ruby
dellavg_ has joined #ruby
<apeiros> but relying on that would be relying on an implementation detail. the code is not correct.
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 252 seconds]
<NL3limin4t0r> I once read an article somewhere about this exact issue, comparing MRI and JRuby. However I currently can't seem to find it.
lxsameer has joined #ruby
<NL3limin4t0r> Point is that the code breaks when running it in JRuby if you coun't on it being thread safe (which it obviously isn't).
<NL3limin4t0r> count*
nowhere_man has quit [Ping timeout: 252 seconds]
<resnik2> apeiros, yeah, something's strange going on there, but it also works fine on 1.9, so I guess something's tricky with ruby scheduler. The whole thing popped up when I was conducting Mutex#synchronize benchmarks.
VeryBewitching has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
<resnik2> And those were needed because somehow I've got a feeling hiredis is doing bad job of multithreading in mri
<VeryBewitching> Hey folks, I'm trying to find a way to undefine a method in a module, not really getting anywhere; in a test environment I'd like the Service method redefined, how would I go about removing the original? https://gist.github.com/bewitchingme/3e7a75e05dc5a57641908c47567572c7
tdy has joined #ruby
<VeryBewitching> Oddly, simply redefining it has no effect to the test, it simply uses the original definition
cd has joined #ruby
<blood> NL3limin4t0r: so i got it installed but it doesn't seem to be doing anything
<VeryBewitching> I've tried undef_method and remove_method in the module, to no effect.
<blood> ok im able to use `byebug rubyfile.rb`
<blood> let me dig further
<NL3limin4t0r> resnik2: This might be intresting https://dev.to/enether/rubys-gil-in-a-nutshell
lxsameer has joined #ruby
snuz has joined #ruby
<NL3limin4t0r> blood: You should be able to call `byebug` inside your script to set a breakpoint you can build ruby logic around it if you want `byebug if false` will never break your code.
<NL3limin4t0r> The most important commants are `c` to continue until the next break point, `n` to execute the next statement and `s` to step into a method of the current line.
thejs has quit [Ping timeout: 250 seconds]
<NL3limin4t0r> and obviously `exit` and `help`
<blood> so running `c` in byebug will go to next `byebug` command i have in my rb file?
<blood> byebug creates a breakpoint ?
<NL3limin4t0r> yep
<blood> ok when i use `c` it just runs for a few more seconds then exits
<blood> yet i have multiple byebug's
lxsameer has quit [Ping timeout: 252 seconds]
<blood> shall i post the entire rb file?
<NL3limin4t0r> sure, create a gist or use https://dpaste.de/
<blood> i removed the byebug's
<headius> NL3limin4t0r: you can't rely on that code in MRI either because it doesn't treat the -= as atomic either
<VeryBewitching> resnik2: Ooh, imma try that, thanks :D
eckhardt has joined #ruby
<VeryBewitching> resnik2: Nope, still complains it can't find the method.
lxsameer has joined #ruby
<VeryBewitching> It's not an instance method of the module, it's a method on the module itself, I think that trips it up a bit
<resnik2> you asked to remove the method, that's what I did. You want to define a method?
<VeryBewitching> def self.Service; end
<VeryBewitching> I'm trying to redefine that method for a test.
<VeryBewitching> So I'm not making calls to the target webservice, but to a mock
<VeryBewitching> Just redefining it has no effect, it continues to use the original in the app.
sauvin has quit [Remote host closed the connection]
<VeryBewitching> So I was trying to remove the original and define it, not having much luck.
<resnik2> self.define_singleton_method :Service, { puts :see }
xfbs has joined #ruby
snuz has quit [Ping timeout: 252 seconds]
<resnik2> VeryBewitching, I'd say you've got everything right, look elsewhere.
clemens3_ has joined #ruby
<VeryBewitching> It might be the order the files are being auto loaded; I'd considered that too
leafyleong has quit [Ping timeout: 246 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
leafyleong has joined #ruby
snuz has joined #ruby
<VeryBewitching> resnik2: Thanks for your time :)
govg has quit [Ping timeout: 246 seconds]
xfbs has quit [Quit: afk]
xfbs has joined #ruby
lxsameer has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
dviola has joined #ruby
lxsameer has joined #ruby
<nfk> i would very much like to hear from someone who knows ruby/tk on how to get virtual event handling working
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 252 seconds]
xfbs has quit [Quit: afk]
Fusl has quit [Read error: Connection reset by peer]
Fusl has joined #ruby
xfbs has joined #ruby
lxsameer has joined #ruby
xfbs has quit [Client Quit]
snuz has quit [Quit: WeeChat 2.2]
lxsameer has quit [Ping timeout: 264 seconds]
agent_white has joined #ruby
resnik2 has quit [Quit: Leaving]
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
<leitz> Okay havenwood, I told you I'd be back with questions. https://github.com/makhidkarun/ftl_chargen/blob/builder_01/lib/ftl_chargen/builder.rb#L20
<leitz> The error is: builder.rb:20:in `generate_upp': undefined method `[]=' for #<FTLChargen::Character:0x0000563c9b8a2c48> (NoMethodError)
<leitz> But Character has an attr_accessor for upp.
lxsameer has joined #ruby
<leitz> What am I missing?
thejs has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
za1b1tsu has joined #ruby
lxsameer has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
sameerynho has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
xfbs has joined #ruby
xfbs has quit [Client Quit]
lxsameer has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
eam has joined #ruby
Nicmavr has joined #ruby
<leitz> Okay...figured that one out.
lxsameer has quit [Ping timeout: 272 seconds]
xfbs has joined #ruby
graphene has quit [Remote host closed the connection]
discopatrick has quit [Quit: Connection closed for inactivity]
cek has joined #ruby
cek has left #ruby [#ruby]
graphene has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has joined #ruby
xfbs has quit [Quit: afk]
dellavg_ has quit [Ping timeout: 252 seconds]
xfbs has joined #ruby
blood has quit [Quit: Page closed]
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
llua has joined #ruby
xfbs has quit [Quit: afk]
jdawgaz has joined #ruby
VeryBewitching has quit [Quit: Konversation terminated!]
xfbs has joined #ruby
xfbs has quit [Client Quit]
xfbs has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
brandoncc has joined #ruby
xfbs has quit [Quit: afk]
xfbs has joined #ruby
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
xfbs has quit [Quit: afk]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cats has quit [Ping timeout: 252 seconds]
RougeR has joined #ruby
yohji has joined #ruby
<zenspider> rawr
<zenspider> leitz: what did you figure out?
cats has joined #ruby
clemens3_ has quit [Ping timeout: 246 seconds]
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xfbs has joined #ruby
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
<baweaver> havenwood: do you remember where that Ruby list comprehension gist was?
<havenwood> baweaver: this one or was it another?: https://gist.github.com/postmodern/605891
graphene has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 2.2]
graphene has joined #ruby
<baweaver> I think so
<baweaver> We should comment it up later for kicks
<baweaver> There it was!
<zenspider> for non-predicate version, this seems huge
<zenspider> >> a = [(1..5),(1..4),(1..3)].map(&:to_a); a.first.product(*a[1..-1])
<ruby[bot]> zenspider: # => [[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 2, 1], [1, 2, 2], [1, 2, 3], [1, 3, 1], [1, 3, 2], [1, 3, 3], ...check link for more (https://eval.in/1057740)
desperek has quit [Quit: xoxo]
lxsameer has joined #ruby
reber has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 272 seconds]
ivanskie has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
tpendragon has quit [Remote host closed the connection]
cats has quit [Ping timeout: 252 seconds]
akem has joined #ruby
thejs has quit [Remote host closed the connection]
sticaz has quit [Ping timeout: 245 seconds]
yohji has quit [Remote host closed the connection]
thy0 has quit [Ping timeout: 244 seconds]
thy0 has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
kapil___ has quit [Quit: Connection closed for inactivity]
thy0 has quit [Ping timeout: 272 seconds]
<leitz> zenspider, me being confused on setting an object's attribute.
<leitz> Sometimes I'm a little slow...
<leitz> Well, storm is finally almost here. Will be shutting down in a bit. hopefully we don't wash away.
Giruvagen has joined #ruby
Azure has quit [Ping timeout: 244 seconds]
cpruitt has quit [Remote host closed the connection]
xfbs has quit [Quit: afk]
cpruitt has joined #ruby
Azure has joined #ruby
xfbs has joined #ruby
nowhere_man has joined #ruby
cats has joined #ruby
thy0 has joined #ruby
xfbs has quit [Client Quit]
cpruitt has quit [Ping timeout: 246 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has quit [Quit: Leaving]
jdawgaz has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
sanscoeur has quit [Ping timeout: 272 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has quit [Quit: Oops.]
postmodern has joined #ruby
lxsameer has joined #ruby
beowuff has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
jdawgaz has joined #ruby
tdy has quit [Ping timeout: 272 seconds]
lxsameer has quit [Ping timeout: 252 seconds]
sameerynho has quit [Ping timeout: 244 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]