« Back to channel list

#ruby - 13 August 2018

« Back 1 day Forward 1 day »
[00:02:59] blood: Radar: node.has_elements? -> !node.element_children.empty? for REXML -> Nokogiri
[00:03:08] blood: cant find anything else in API
[00:03:19] blood: that look right?
[00:10:51] havenwood: %w[fee fi fo fum].tap { |a| next if a.empty?; a.delete_at a.each_with_index.min.last }
[00:19:53] \void: has joined #ruby
[00:28:50] this_dude: has joined #ruby
[00:29:06] this_dude: wow i couldnt get the nickserv to identify me for the longest time...weird...anyways im back
[00:29:48] Radar: how do we know it's the real you?
[00:29:59] this_dude: the chat log isnt showing anything..anything hppen while i was gone
[00:30:36] havenwood: this_dude: a few of us solved the problem in ways we like but we don't want to spoil it for you ;-D
[00:30:36] Radar: this_dude: it's been quiet
[00:31:19] GodFather: has joined #ruby
[00:31:22] this_dude: I just not got the chanserv welcome message lol..i think my tether signal is weak
[00:32:07] baweaver: food time, off I go.
[00:34:45] this_dude: about to start my exam after i finish playing theQ..have fun eating
[00:36:11] blood: given the following XML using Nokogiri: https://gist.github.com/bloodmc/ea92142b8b0f83f3ef15a1915cb7aee6 , @document.xpath(xpath) finds nothing. Any idea?
[00:36:19] blood: This is without namespaces
[00:36:33] blood: oh forgot the xpath again
[00:36:58] blood: xpath '/weblogic-web-app/session-descriptor'
[00:38:11] blood: oh it is working nm, something else is wrong
[00:49:58] this_dude: well i hit a roadblock on my exam
[00:50:25] mroutis: what went wrong, this_dude ?
[00:50:47] this_dude: i need to take a dna strand
[00:50:54] this_dude: i.e. ACCGGGTTTT
[00:51:01] this_dude: reverse it, and then return the complement
[00:51:16] Radar: What's the complement supposed to look like?
[00:51:30] this_dude: https://dpaste.de/TAqK#L2
[00:51:32] this_dude: this is what i have
[00:51:42] this_dude: basiclly a==t and c==g
[00:52:19] this_dude: idk whats wrong w my code but its just returning what i put in
[00:53:09] this_dude: i fixed it to .reverse.split but now i cant get it to replace the letters
[00:53:41] this_dude: and i only have 5 minutes left for this question
[00:53:44] Radar: this_dude: your code works for me
[00:54:07] Radar: Well, for a single letter it did
[00:54:17] Radar: https://gist.github.com/radar/1224544117441edc495544e2ea93e865
[00:54:26] GodFather: has joined #ruby
[00:54:47] this_dude: so it passed that minitest?
[00:56:03] Radar: No, it failed.
[00:56:10] Radar: You might not be splitting correctly.
[00:56:17] Radar: > "AAATTT".split
[00:56:19] Radar: >> "AAATTT".split
[00:56:20] ruby[bot]: Radar: # => ["AAATTT"] (https://eval.in/1046895)
[00:56:26] Radar: That's probably not what you want todo.
[00:57:27] mroutis: try using "puts" on your code, so you can debug what's going on with your variables; +1 if you use `binding.pry` or `byebug`
[00:58:00] this_dude: it worked when i changed it from .reverse.split to .reverse.chars
[00:58:47] Radar: this_dude: >> "AAA AAA".split
[00:58:54] Radar: because split splits by default on sapces
[00:59:56] this_dude: http://prntscr.com/khu96p
[00:59:59] this_dude: next question
[01:04:55] this_dude: ok i know how to do it basiclly except
[01:05:00] this_dude: it was .chars for a strsing
[01:05:15] this_dude: how do i do the exact same thing for a number
[01:08:10] chouhoulis: has joined #ruby
[01:08:31] this_dude: num.to_s.chars
[01:10:32] Radar: this_dude: num.digits
[01:10:49] this_dude: its fine i did it the long way with that^
[01:11:05] Radar: >> 123.digits
[01:11:11] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:11:13] Radar: >> 123.digits
[01:11:14] this_dude: im glad i finished that last one so fast
[01:11:18] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:11:22] Radar: ruby[bot]: go have a lie down plz
[01:11:23] this_dude: this final one is crazy complicated
[01:11:24] this_dude: http://prntscr.com/khubtz
[01:12:24] this_dude: this one is gonna screw me..idk how to write the string[i] when given multiple strings
[01:13:44] this_dude: what is the total sum of a-z.ord?
[01:14:07] Radar: this_dude: how would you find out if "this is a sentence" contained the letter a?
[01:14:34] Radar: this_dude: because if you can find that out, then you can also check for b, c, d, etc.
[01:14:50] Radar: Finding out if it contains a is a small step towards solving this problem
[01:14:57] this_dude: im gonna try to write this to just add the .ord value of each string and if its equal to the sum of all letters a-z print true else false
[01:15:42] Radar: ok, sure.
[01:15:55] this_dude: but idk what the sum of a-z is
[01:16:03] Radar: [11:14:07] <Radar> this_dude: how would you find out if "this is a sentence" contained the letter a?
[01:16:06] this_dude: >> (a..z).ord.sum
[01:16:07] ruby[bot]: this_dude: # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/1046898)
[01:16:08] Radar: this_dude: You asked for hints and I'm dropping them.
[01:16:25] this_dude: >> ("a".."z").ord.sum
[01:16:31] ruby[bot]: this_dude: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:16:42] Radar: this_dude: plz stop obsessing about .ord. It is not the answer.
[01:17:21] this_dude: i=0 while i < string.length if string[i]=="a" return true else false end i+=1 end
[01:18:38] this_dude: 2847 is the sum of the alphabet
[01:18:42] Radar: this_dude: is there a shorter way
[01:18:51] Radar: this_dude: Maybe there's a way to check if a string INCLUDES a particular substring?
[01:19:26] this_dude: if there is its a method im unfamiliar with...like .scan or something
[01:20:36] this_dude: the fact that input is a number of strings, and then the strings is messing me up
[01:20:55] this_dude: because they only start the function as def isPangram(strings)
[01:21:09] this_dude: so idk where its gonna put the number of strings
[01:21:24] rootsudo: has joined #ruby
[01:22:25] Radar: So what's strings then?
[01:22:31] Radar: Can you get it to output what they are?
[01:23:43] this_dude: the test code inputs this 4 we promptly judged antique ivory buckles for the next prize we promptly judged antique ivory buckles for the prizes the quick brown fox jumps over the lazy dog the quick brown fox jump over the lazy dog
[01:23:50] this_dude: http://prntscr.com/khuetd
[01:24:01] this_dude: sorry didnt mean to past that text....thts what it inputs^
[01:24:12] this_dude: i only have 15 mins left omg
[01:26:32] this_dude: dude im gonna fail hahaha
[01:26:38] this_dude: i have no idea how to do this
[01:27:48] mroutis: this_dude, a string is just "an array of characters" in C, right?
[01:28:03] this_dude: 10 minutes ahahaha
[01:28:24] mroutis: so, you want to know if those characters are the whole alphabet, isn't it?
[01:28:37] this_dude: this is what i have
[01:28:37] this_dude: https://dpaste.de/4fwR
[01:29:25] mroutis: how did you solved the countHoles one? can't you take some inspiration from there?
[01:29:46] mr_rich101: has joined #ruby
[01:29:47] this_dude: that was easy
[01:30:11] this_dude: https://dpaste.de/ker7
[01:30:23] mroutis: so this is
[01:30:30] this_dude: the problem with this one is i dont understand why the test input is a number and then random strings
[01:31:37] mroutis: the input is "an array of strings"
[01:32:00] this_dude: MY CODE ISNT GIVING ANY OUTPUT I DONT UNDERSTAND WHY
[01:32:02] this_dude: im freaking out
[01:32:04] mroutis: and you need to return 0 or 1 for each of those strings, testing if they are pangram
[01:32:45] mroutis: ['a', 'abcdefghijklmnopqrstwxyz'] #=> [0,1]
[01:33:06] this_dude: omg please hurry im literally about to cry
[01:34:01] this_dude: https://dpaste.de/eHWE
[01:34:05] this_dude: why isnt this doing anything?!
[01:34:08] mroutis: now, do you understand why the input is an array of strings? and what you must output?
[01:35:06] mroutis: why are you adding your strings?
[01:35:08] mroutis: strings.sum
[01:35:22] this_dude: I dont get it
[01:35:32] this_dude: and my brain freaking out isnt helping
[01:35:41] mroutis: dude, you are doing ['a', 'abcdefghijklmnopqrstwxyz'].sum
[01:35:49] Radar: Still obsessing about ord and summing the characters I see.
[01:35:56] Radar: Hopefully this failure will be a great lesson.
[01:36:01] this_dude: SO WHAT DO I DO
[01:36:08] Radar: I told you twice.
[01:36:09] this_dude: ITS NOT A LESSON ITS RUINING MY LIFE
[01:36:12] Radar: [11:18:51] <Radar> this_dude: Maybe there's a way to check if a string INCLUDES a particular substring?
[01:36:15] Radar: [11:16:03] <Radar> [11:14:07] <Radar> this_dude: how would you find out if "this is a sentence" contained the letter a?
[01:36:15] this_dude: so WHAT DO I DO
[01:36:37] Radar: >> "this is a sentence".include?("a")
[01:36:42] Radar: >> "this is a sentence".include?("b")
[01:36:43] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:36:44] ruby[bot]: Radar: # => false (https://eval.in/1046899)
[01:36:44] Radar: ruby[bot]: don't you fail me now
[01:36:56] Radar: Ok, so now that we've got that, what if we wanted to check a range of letters?
[01:37:20] Radar: ("a".."z").<what> { |c| string.include?(c) }
[01:37:44] this_dude: if string.include("a".."z")==true puts 1 else puts 0
[01:37:51] this_dude: dude one minute
[01:37:53] this_dude: omg omg omg
[01:38:02] Radar: Nobody will give you the answer. It's not our test.
[01:38:26] mroutis: if a string include a range? mhm I don't think that works
[01:38:30] this_dude: this was my last chance
[01:39:07] Radar: and now you can never ever try again?
[01:39:25] Radar: for all time?
[01:39:37] this_dude: i failed the admission req
[01:39:42] Radar: Welp. Time to find something else to do then.
[01:39:45] Radar: >> ("a".."z").all? { |c| string.include?(c) }
[01:39:46] ruby[bot]: Radar: # => undefined local variable or method `string' for main:Object ...check link for more (https://eval.in/1046901)
[01:39:57] Radar: >> string = "the quick brown fox jumps over the lazy dog"; ("a".."z").all? { |c| string.include?(c) }
[01:39:58] ruby[bot]: Radar: # => true (https://eval.in/1046902)
[01:40:15] Radar: >> strings = ["the quick brown fox jumps over the lazy dog"]; strings.all? { |s| ("a".."z").all? { |c| string.include?(c) } }
[01:40:17] ruby[bot]: Radar: # => undefined local variable or method `string' for main:Object ...check link for more (https://eval.in/1046903)
[01:40:20] this_dude: idk how to use those kind of codes
[01:40:23] Radar: >> strings = ["the quick brown fox jumps over the lazy dog"]; strings.all? { |s| ("a".."z").all? { |c| s.include?(c) } }
[01:40:26] this_dude: and i shouldnt have needed it for the exam
[01:40:28] Radar: Time you learned. You would've passeed.
[01:40:28] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:40:37] this_dude: there should be a way to do it the long way
[01:40:49] Radar: this_dude: I am going to tell you one. final. time.
[01:40:58] Radar: Nobody writes Ruby like you're saying they should write Ruby.
[01:41:08] this_dude: NO. that info wasnt in the resources given and they specifically said i only need what they gave me
[01:41:11] Radar: Now that you've failed _three separate times_ it is time you learned the right way. Spend a month doing that. Then apply again.
[01:41:23] Radar: And if you can't apply _there_ then there are plenty of other places to apply to.
[01:41:55] this_dude: just because you dont agree with the way they wanted me to code my answers doesnt mean i shouldnt code them how im told
[01:42:55] this_dude: im soooo frustrated rn
[01:43:12] this_dude: why cant you understand that i needed to know how to do it the long way
[01:43:50] ruby[bot]: +qqq $a:this_dude this_dude!*@* *!*@gateway/web/freenode/ip.172.56.40.214
[01:43:58] Radar: Ok, time out for 1hr.
[01:45:01] Radar: Why can't you understand that your code would work if you did it the short way too?
[01:45:18] Radar: https://gist.github.com/radar/15c5c97971946ac5bc9699b76574495e <- the long way
[01:48:51] apeiros: has joined #ruby
[01:53:24] this_dude: has left #ruby: ()
[01:53:39] mroutis: has joined #ruby
[01:59:29] mroutis: has joined #ruby
[02:01:33] blood: Radar: https://github.com/Areson/xml_fragment/blob/master/lib/puppet/provider/xml_fragment/xml_fragment.rb#L54 https://github.com/Areson/xml_fragment/blob/master/lib/puppet/util/xml_file.rb#L89
[02:01:40] blood: any idea how i convert this to Nokogiri?
[02:02:54] fmcgeough: has joined #ruby
[02:03:02] blood: @document.root.elements.delete_all("session-descriptor/cookie-name/*[not(@Puppet::Util::XmlFile.Managed)]")
[02:03:18] blood: basically deleting anything that doesnt have that attribute
[02:03:33] ruby[bot]: -qqq $a:this_dude this_dude!*@* *!*@gateway/web/freenode/ip.172.56.40.214
[02:03:49] blood: I know I can just loop through each node and handle it but wondering if there was a shorter way like it is done in this repo
[02:09:17] gheegh: has joined #ruby
[02:14:51] apeiros: has joined #ruby
[02:35:43] tty: has joined #ruby
[02:39:33] arescorpio: has joined #ruby
[02:40:55] apeiros: has joined #ruby
[02:43:51] maryo: has joined #ruby
[02:47:30] blood: got it all working in Nokogiri =)
[02:54:53] fmcgeough: has joined #ruby
[02:57:35] rootsudo: has joined #ruby
[03:04:26] alfiemax: has joined #ruby
[03:06:13] aniarya82: has joined #ruby
[03:06:56] apeiros: has joined #ruby
[03:09:04] Radar: blood: congrats :)
[03:11:13] gix: has joined #ruby
[03:12:04] braincrash: has joined #ruby
[03:18:12] _whitelogger: has joined #ruby
[03:33:32] z3uS: has joined #ruby
[03:33:56] apeiros: has joined #ruby
[03:40:52] blood: Radar: thanks, im just having trouble with generating xml files properly.
[03:41:07] blood: files that do not exist
[03:44:53] mrush: has joined #ruby
[03:45:57] blood: @document = Nokogiri::XML::Builder.new(:encoding => 'UTF-8').to_xml , shouldn't this work for an empty xml document
[03:47:21] s2013: has joined #ruby
[03:48:25] mrush: is there a way to set a default string encoding for an entire script
[03:48:26] s2013: has joined #ruby
[03:49:11] mrush: i think i need to override the default
[03:50:21] mrush: encoding for the string class
[03:58:52] c_h_s: has joined #ruby
[04:06:32] herbmillerjr: has joined #ruby
[04:07:56] apeiros: has joined #ruby
[04:15:44] DTZUZO: has joined #ruby
[04:27:27] mroutis: has joined #ruby
[04:29:03] kapil___: has joined #ruby
[04:33:25] mojtaba: has joined #ruby
[04:37:58] s2013: has joined #ruby
[04:48:38] mozzarella: has joined #ruby
[04:55:17] mrush: can i manually place a gem into c:\ruby192\lib\
[04:57:47] ryuteki: has joined #ruby
[04:58:41] mrush: in python you just drop libraries into c:\python\Lib\
[05:08:13] duderonomy: has joined #ruby
[05:08:25] p4p0l0: has joined #ruby
[05:13:49] aufi: has joined #ruby
[05:27:07] apeiros: has joined #ruby
[05:27:50] agent_white: has joined #ruby
[05:29:45] dellavg: has joined #ruby
[05:37:05] apeiros: has joined #ruby
[05:44:44] dionysus69: has joined #ruby
[05:51:52] varesa_: has joined #ruby
[06:00:18] Freshnuts: has joined #ruby
[06:02:25] Freshnuts: has joined #ruby
[06:05:30] Freshnuts: has joined #ruby
[06:13:22] apeiros: has joined #ruby
[06:31:37] apeiros: has joined #ruby
[06:48:36] dionysus69: has joined #ruby
[07:00:48] Emmanuel_Chanel: has joined #ruby
[07:08:33] p4p0l0: has joined #ruby
[07:09:22] burgestrand: has joined #ruby
[07:15:05] asphyxia: has joined #ruby
[07:21:20] clemens3: has joined #ruby
[07:23:22] mroutis: has joined #ruby
[07:31:47] ferhaty: has joined #ruby
[07:33:46] dellavg: has joined #ruby
[07:44:43] Dbugger: has joined #ruby
[07:56:54] mikecmpbll: has joined #ruby
[07:57:57] Some-body_: has joined #ruby
[07:58:56] c0ncealed2: has joined #ruby
[08:06:32] alex``: has joined #ruby
[08:08:39] mikecmpbll: has joined #ruby
[08:11:30] asphyxia: hi guys, if I have a function outside of the main program, calling an integer variable that I use later on in the program, how can I declare it as an integer in the global function?
[08:12:11] asphyxia: Because currently I get told that it's undefined
[08:12:35] asphyxia: e.g. in another language I would say myValue: Integer
[08:14:18] tbuehlmann: can you gist what you have?
[08:17:58] asphyxia: https://pastebin.com/7PdtJTYS
[08:17:59] ruby[bot]: asphyxia: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[08:18:29] asphyxia: oh so that's what you meant by gist I thought meant it as an expression of speech haha
[08:24:54] tbuehlmann: okay, and what exactly is the error you're getting?
[08:26:22] tbuehlmann: your calculate_age method uses year_born, but the method doesn't know about it. so you could simply have a second method parameter for that and call the method like calculate_age(prompt, year_born)
[08:28:47] asphyxia: so I don't need to declare the data type in that function?
[08:29:45] asphyxia: I'm very new to ruby, sorry if that seems like a silly question
[08:32:27] lxsameer: has joined #ruby
[08:32:57] wildermind: has joined #ruby
[08:40:33] erratic: has joined #ruby
[08:44:03] psychicist__: has joined #ruby
[08:50:17] Beams: has joined #ruby
[08:54:46] conta: has joined #ruby
[08:56:40] tristanp: has joined #ruby
[09:00:28] yokel: has joined #ruby
[09:02:40] asphyxia: As Ruby is dynamically typed, it does not require
[09:02:43] asphyxia: type information on parameters and return values
[09:03:06] asphyxia: 1/2 hr later
[09:05:52] tbuehlmann: right, you can't do that
[09:10:28] reber: has joined #ruby
[09:16:11] moei: has joined #ruby
[09:33:23] claudiuinberlin: has joined #ruby
[09:36:31] Beams: has joined #ruby
[09:38:11] teclator: has joined #ruby
[09:45:48] gregf_: has joined #ruby
[09:46:12] Emmanuel_Chanel: has joined #ruby
[10:11:10] alfiemax: has joined #ruby
[10:13:40] dellavg: has joined #ruby
[10:14:44] dellavg: has joined #ruby
[10:24:49] Pip: has joined #ruby
[10:32:56] amelliaa: has joined #ruby
[10:50:14] mikecmpbll: has joined #ruby
[10:55:50] sticaz: has joined #ruby
[10:56:05] aufi: has joined #ruby
[10:58:13] tristanp: has joined #ruby
[10:59:54] Beams: has joined #ruby
[11:00:50] mikecmpbll: has joined #ruby
[11:06:03] burgestrand: has joined #ruby
[11:06:32] gheegh: has joined #ruby
[11:14:10] snickers: has joined #ruby
[11:16:27] dionysus70: has joined #ruby
[11:20:12] Beams: has joined #ruby
[11:22:39] Tempesta: has joined #ruby
[11:25:23] cabotto: has joined #ruby
[11:40:48] mondz: has joined #ruby
[11:44:14] augcesar: has joined #ruby
[11:46:05] alfiemax_: has joined #ruby
[11:47:34] AJA4350: has joined #ruby
[11:51:30] alex``: has joined #ruby
[11:55:01] DTZUZO: has joined #ruby
[12:04:47] mistergibson: has joined #ruby
[12:04:47] fmcgeough: has joined #ruby
[12:05:11] tristanp: has joined #ruby
[12:50:11] vondruch: has joined #ruby
[12:50:29] KeyJoo: has joined #ruby
[12:56:12] KeyJoo: has joined #ruby
[13:08:42] fmartingr: has joined #ruby
[13:09:41] fmcgeough: has joined #ruby
[13:10:15] conta1: has joined #ruby
[13:12:51] jcalla: has joined #ruby
[13:20:24] conta1: has joined #ruby
[13:22:35] bmurt: has joined #ruby
[13:26:35] c0ncealed2: has joined #ruby
[13:29:56] ricer2: has joined #ruby
[13:32:02] alex``: has joined #ruby
[13:33:18] GodFather: has joined #ruby
[13:34:48] mojtaba: has joined #ruby
[13:35:10] fmcgeough: has joined #ruby
[13:37:11] burgestrand: has joined #ruby
[13:40:30] aupadhye: has joined #ruby
[13:43:26] akaiiro: has joined #ruby
[13:44:16] dellavg: has joined #ruby
[13:44:44] gheegh: has joined #ruby
[13:47:24] gnufied: has joined #ruby
[13:47:59] marius: has joined #ruby
[13:51:41] akaiiro: has joined #ruby
[13:55:42] mojtaba: has joined #ruby
[14:00:44] Inline: has joined #ruby
[14:02:21] burgestrand: has joined #ruby
[14:03:07] Rapture: has joined #ruby
[14:03:08] mikecmpb_: has joined #ruby
[14:04:55] bijan_: has joined #ruby
[14:06:10] kapil___: has joined #ruby
[14:06:53] croberts: has joined #ruby
[14:08:18] EXCHGR: has joined #ruby
[14:11:37] duderonomy: has joined #ruby
[14:16:07] blood: has joined #ruby
[14:17:09] blood: https://dpaste.de/o7bO I'm trying to have each node be a child of previous in xml but not sure how to do this when I use `xml.send`.
[14:17:42] blood: Ideally i would like to just pass an xpath that is created in XML without having to iterate through each node
[14:18:05] blood: Also, this is for a new XML file that does not exist
[14:20:01] apeiros: so `nodes = %w[foo bar baz]` should become <foo><bar><baz></foo></bar></baz>
[14:20:28] blood: yup exactly
[14:20:35] blood: but is there no way to just specify a complete xpath?
[14:20:36] apeiros: you'd use recursion for that
[14:20:46] apeiros: I'm not aware of any
[14:20:50] blood: right but in the builder it needs to be within the block
[14:21:00] blood: so how would i do that in ruby?
[14:21:02] apeiros: you can recurse even with a block
[14:21:42] blood: I'm using recurse within the root block but not sure how to create a block as I go through
[14:23:02] blood: Only other thing I can think of to make this easier is to just generate an XML with root node then use xpath to insert everything else
[14:27:00] apeiros: there are probably nicer ways, but I'm currently working on something else, so maybe this will at least help you: https://dpaste.de/BaG2
[14:32:22] yo61: has joined #ruby
[14:39:09] blood: worked perfect, thanks again
[14:41:08] s2013: has joined #ruby
[14:42:29] gr33n7007h1: has joined #ruby
[14:47:33] bmurt: has joined #ruby
[14:54:11] mojtaba: has joined #ruby
[15:02:02] apeiros_: has joined #ruby
[15:08:53] mojtaba: has joined #ruby
[15:18:12] ogres: has joined #ruby
[15:28:13] rippa: has joined #ruby
[15:28:14] apeiros_: has joined #ruby
[15:29:18] dbrandon: has joined #ruby
[15:33:51] dviola: has joined #ruby
[15:36:01] alfiemax: has joined #ruby
[15:36:35] mroutis: has joined #ruby
[15:37:23] chouhoulis: has joined #ruby
[15:37:43] hotpancakes: has joined #ruby
[15:40:17] polishdub: has joined #ruby
[15:43:44] r29v: has joined #ruby
[15:44:46] gheegh: has joined #ruby
[15:53:31] s2013: has joined #ruby
[15:57:43] Emmanuel_Chanel: has joined #ruby
[16:05:03] mojtaba: has joined #ruby
[16:10:53] raulp: has joined #ruby
[16:15:20] dionysus69: has joined #ruby
[16:16:06] dionysus69: has joined #ruby
[16:17:06] chrisseaton: has joined #ruby
[16:18:47] sanscoeur: has joined #ruby
[16:24:33] jcarl43: has joined #ruby
[16:38:41] cthulchu: has joined #ruby
[16:41:58] Eiam: has joined #ruby
[16:51:53] s2013: has joined #ruby
[17:03:37] lxsameer: has joined #ruby
[17:03:55] gheegh: has joined #ruby
[17:11:39] sameerynho: has joined #ruby
[17:14:27] dellavg: has joined #ruby
[17:26:46] postmodern: has joined #ruby
[17:27:55] hotpancakes: has joined #ruby
[17:29:23] hotpancakes: has joined #ruby
[17:36:04] mroutis: join #nixos
[17:37:02] mroutis: ACTION ashamed
[17:37:33] mroutis: not promoting, my pinky couldn't reach the slash :/
[17:37:44] apeiros_: as you should be. everybody knows it's šŸ„–join
[17:38:01] s2013: has joined #ruby
[17:39:28] catsed: has joined #ruby
[17:39:35] mozzarel1: has joined #ruby
[17:39:42] postmodern_: has joined #ruby
[17:41:36] mroutis: has joined #ruby
[17:42:14] mroutis: apeiros_: what kind of black magic was that! didn't know about <tab>
[17:45:07] Axsuul: has joined #ruby
[17:48:13] cagomez: has joined #ruby
[17:48:40] timmow: has joined #ruby
[17:49:56] baweaver: Playing with ideas for a future talk, scale from 1 to 5, with 1 being no interest and 5 being in love with the ideas, what do you make of this one: https://twitter.com/keystonelemur/status/1028901018921185280
[17:51:03] baweaver: apeiros_: _might_ have been watching too much Archer and Baccano.
[17:53:38] cthulchu: I missed out
[17:53:46] cthulchu: no idea what the idea was
[17:54:16] cthulchu: also debugging in Ruby is very-very easy
[17:54:20] cthulchu: try debugging in asm
[17:55:05] baweaver: Mind, the target audience is newbies.
[17:55:27] mroutis: unfair comparison, everything in assembly is hard
[17:55:32] cthulchu: oh, well, the cartoons would be really good for kids
[17:55:40] baweaver: Meaning that it very well may not be easy for them.
[17:55:50] havenwood: baweaver: 5, but I'm a a sucker for investigations!
[17:55:54] cthulchu: mroutis, the point was everything in Ruby is easy :)
[17:56:02] havenwood: baweaver: What do you call an alligator in a vest?
[17:56:14] baweaver: investigator
[17:56:16] apeiros_: baweaver: given how "dick tracey" the tracy lends itself to "trace", I'm amused you didn't use something in that direction as a name (tho, I guess dick tracy isn't really "noir")
[17:56:32] gheegh: has joined #ruby
[17:56:44] s2013: has joined #ruby
[17:56:45] havenwood: Point Tracey, the TracePointer.
[17:57:05] baweaver: You can't pay me enough to get on stage and say dick tracey though
[17:58:15] baweaver: The idea is to make stories to cover basic concepts, and maybe a few advanced ones.
[17:58:30] alfiemax: has joined #ruby
[17:58:35] mroutis: baweaver: 5 (not target audience, tho it would be awesome that beginners understand how to debug/understand what's going on with their code)
[17:58:42] KevinSjoberg: has joined #ruby
[17:59:41] mroutis: it could help to reduce the frustration at the start of their learning curve
[17:59:47] baweaver: Other ideas include "The Pattern Matching Express" (===, patterns, western), "The Most RSpectacular Show on Earth!" (testing, circus)
[18:01:11] baweaver: "It's a Jungle Out There" (refactoring, Madagascar)
[18:03:56] baweaver: "Professor When" (logging, monitoring, investigations)
[18:05:16] bijan_: has joined #ruby
[18:07:55] Caerus: idĀ“d watch it for sure
[18:08:15] Caerus: saw the slides for the one you just did. CouldnĀ“t find the actual talk though
[18:10:25] gigetoo: has joined #ruby
[18:16:23] baweaver: It's not out yet.
[18:16:37] baweaver: Remember the talk only happened about a week and a half ago
[18:17:25] Freshnuts: has joined #ruby
[18:18:28] jenrzzz: has joined #ruby
[18:21:30] baweaver: Hrm. Na, "Professor When" may make a good Git talk. Screwing around with timelines and such
[18:24:51] bsamorim: has joined #ruby
[18:28:10] bsamorim: Hi, given MRI's GIL, do I have to use synchronization mechanisms such as locks for sharing an array between two threads? My case is a bit more specific: the threads would just push/pop to/from the array, respectively. The order in which the push and pops would actually be executed would be irrelevant - I just wanted to know if they could be considered atomic.
[18:29:37] bsamorim: Please interpret "MRI" as "Most popular ruby interpreter for > 2.0 rubies"
[18:34:11] wildermind: has joined #ruby
[18:34:43] apeiros: bsamorim: yes
[18:34:57] bsamorim: apeiros: k, thx
[18:34:59] apeiros: bsamorim: GIL does not magically remove race conditions for shared resources.
[18:35:55] bsamorim: apeiros: it doesn't, but it certainly helps to enable these operations to be thread-safe by default
[18:36:01] bsamorim: they are in python, for instance
[18:36:07] bsamorim: *in CPython
[18:36:22] apeiros: thread-safe is a word most people sadly completely misunderstand.
[18:36:23] orbyt_: has joined #ruby
[18:36:56] bsamorim: apeiros: it isn't really a formal concept ;)
[18:37:33] bsamorim: I explained what I meant by thread-safe in the first message's last sentence
[18:37:51] apeiros: I'm not sure it really isn't. I have an understanding of what it is supposed to be, but never bothered with looking up whether there's a formal definition for that.
[18:38:33] apeiros: anyway, amending what I previously wrote: if you're only using push & pop and don't mind which item is actually popped, and pop occasionally returning nil (depending on how your threads use the array it's a possibility), then you don't need to synchronize.
[18:38:58] bsamorim: apeiros: that's fine by me...thanks!
[18:39:28] apeiros: but honestly, you still should. atomic behavior of push/pop is not guaranteed.
[18:40:42] bsamorim: apeiros: k, thanks!
[18:40:49] apeiros: <3 pry-doc's ability to dig into C sources
[18:45:47] agent_white: has joined #ruby
[18:51:41] reber__: has joined #ruby
[18:54:06] akaiiro: has joined #ruby
[19:10:29] konsolebox: has joined #ruby
[19:12:23] Emmanuel_Chanel: has joined #ruby
[19:14:15] mroutis: has joined #ruby
[19:17:34] adambeynon_: has joined #ruby
[19:17:41] skmp_: has joined #ruby
[19:17:56] seanh_: has joined #ruby
[19:17:58] tycoon177_: has joined #ruby
[19:18:00] cttttt_: has joined #ruby
[19:18:14] KnownSyntax_: has joined #ruby
[19:18:20] BuildTheRobots_: has joined #ruby
[19:19:48] LenPayne_: has joined #ruby
[19:19:52] tjbp_: has joined #ruby
[19:20:22] mnem: has joined #ruby
[19:24:01] xMopx-: has joined #ruby
[19:24:12] hotpancakes: has joined #ruby
[19:27:29] ujjain: has joined #ruby
[19:30:23] dinfuehr: has joined #ruby
[19:30:41] drbrain: has joined #ruby
[19:34:21] Samian: has joined #ruby
[19:34:22] Samian: Anyone here use a company wiki at work? My company uses team services and we have a office 365 subscription, so we could host a wiki through those things, but they're both slow. SO I'm looking for alternatives
[19:35:38] clemens3: has joined #ruby
[19:42:30] AndroidKitKat: has joined #ruby
[19:43:31] canton7: we've used gollum with success before
[19:50:16] havenwood: Samian: https://www.ruby-toolbox.com/categories/wiki_apps.html
[19:54:40] orbyt_: has joined #ruby
[19:57:27] fmcgeough: has joined #ruby
[20:01:24] sanscoeur: has joined #ruby
[20:04:42] Puffball: has joined #ruby
[20:07:52] DLSteve_: has joined #ruby
[20:11:06] sonOfRa: Crossposting from #rubyonrails since it's not specific: Can anyone explain to me this really odd behaviour? https://gist.github.com/sonOfRa/0ea3af35ff2cfaf301f860f717569497
[20:11:59] sonOfRa: Essentially, once any block is entered, user (or any variable that gets assigned user, or any of its contents) becomes nil
[20:12:15] baweaver: instance_eval of some sort I'd guess.
[20:12:22] baweaver: where's connect defined?
[20:12:23] apeiros: why do you use abort instead of e.g. p?
[20:12:29] apeiros: baweaver: user is an lvar, though
[20:12:36] sonOfRa: needed a quick way to print it out to the screen in rails
[20:12:36] apeiros: so a method shouldn't be able to shadow it
[20:13:00] apeiros: sonOfRa: use p twice instead of abort. otherwise we're not sure the context is the same
[20:13:21] apeiros: you can use something like `puts "="*100` if you want to highlight it in the output
[20:14:03] apeiros: sonOfRa: also, you write "This fails because user is suddenly nil" - please provide the exact error. you wouldn't be the first to misrepresent an exception.
[20:14:34] sonOfRa: NoMethodError (undefined method `dn' for nil:NilClass): is the actual error
[20:15:07] baweaver: Is this called once, or multiple times?
[20:15:31] sonOfRa: With p it seems to be now called multiple times, actually, and I don't quite see why (yet)
[20:15:34] baweaver: because I'd bet a nil user got passed into another call somehow if it is called multiple times.
[20:15:49] baweaver: hence apeiros's context mention above.
[20:15:55] apeiros: yeah, hence abort = bad for figuring stuff :)
[20:16:09] apeiros: so first call you have a user, and any subsequent call you don't
[20:16:23] sonOfRa: gist is updated with the update. Interesting. I wonder where the user went
[20:16:59] apeiros: yeah, so it gets called twice. and second call with a nil arg.
[20:16:59] sonOfRa: Left some of the old to-be-refactored code in there
[20:17:13] sonOfRa: Thanks for the hint, this would have taken ages with the abort way
[20:17:25] apeiros: and don't do `p user.inspect`, just `p user`
[20:17:29] apeiros: p already invokes inspect.
[20:18:01] sonOfRa: Been a while since I last touched this project, and it's the only ruby thing I've ever done
[20:18:15] sonOfRa: Removing the old code did the trick
[20:18:17] apeiros: which btw. means you can do handy stuff like: `p some_label: some_value, some_other_label: some_other_value`
[20:20:04] dviola: has joined #ruby
[20:20:54] Eiam_: has joined #ruby
[20:22:17] rootsudo: has joined #ruby
[20:23:38] Puffball: has joined #ruby
[20:50:02] hotpancakes: has joined #ruby
[21:01:00] sanscoeur: has joined #ruby
[21:09:32] mojtaba: has joined #ruby
[21:11:02] gheegh: has joined #ruby
[21:12:45] GodFather: has joined #ruby
[21:20:12] tty: has joined #ruby
[21:25:02] dreamthese: has joined #ruby
[21:27:40] nicesignal: has joined #ruby
[21:33:25] beowuff: has joined #ruby
[21:43:32] dviola: has joined #ruby
[21:48:41] patr0clus: has joined #ruby
[21:51:38] exchgr`: has joined #ruby
[21:53:26] hotpancakes: has joined #ruby
[22:02:02] sanscoeur: has joined #ruby
[22:03:15] orbyt_: has joined #ruby
[22:06:11] nfk: has joined #ruby
[22:11:47] alfiemax: has joined #ruby
[22:12:35] beowuff: has joined #ruby
[22:40:00] Chew: has joined #ruby
[23:03:47] Some-body_: has joined #ruby
[23:06:18] apeiros: has joined #ruby
[23:09:17] patr0clus: has joined #ruby
[23:15:29] orbyt_: has joined #ruby
[23:27:55] Some-body_: has joined #ruby
[23:30:11] rfoust: has joined #ruby
[23:31:21] apeiros: has joined #ruby
[23:32:33] herbmillerjr: has joined #ruby
[23:37:03] herbmillerjr: has joined #ruby
[23:45:54] thy0: has joined #ruby
[23:46:44] DarthGan-: has joined #ruby
[23:50:05] thy0_: has joined #ruby