« Back to channel list

#ruby - 05 November 2015

« Back 1 day Forward 1 day »
[00:00:21] lemur: has joined #ruby
[00:00:50] Balllkenende: has joined #ruby
[00:02:02] tmtwd: has joined #ruby
[00:02:36] elperdut_: has joined #ruby
[00:03:07] al2o3-cr: shevy: yeah i like the graphs there
[00:03:49] al2o3-cr: shevy: rock bottom at the min (no pun intended)
[00:04:46] rickmasta: has joined #ruby
[00:05:07] CloCkWeRX: has joined #ruby
[00:05:08] BSab: has joined #ruby
[00:07:39] benlieb: has joined #ruby
[00:08:52] al2o3-cr: i am an ape man (ce ce ce ce ce ce ce) i am an ape man
[00:09:45] idefine: has joined #ruby
[00:10:01] al2o3-cr: https://www.youtube.com/watch?v=aRHqs8SffDo
[00:10:20] mistermocha: has joined #ruby
[00:10:43] Pupeno: has joined #ruby
[00:12:49] idefine: has joined #ruby
[00:13:53] harly: noice... irb: 10.1 / 100
[00:14:02] harly: what'st he best way to get what i want there? :)
[00:14:20] linduxed: has joined #ruby
[00:14:41] harly: me not having to deal with floats ofr a long time. gives 0.10099999~ instead of 0.101
[00:15:12] skade: has joined #ruby
[00:15:20] al2o3-cr: floats ain't precise
[00:15:38] harly: so what's the best way to get what i really want, which is an accurate 0.101 ?
[00:16:23] eam: >> 10.1r / 100r
[00:16:24] ruboto: eam # => (101/1000) (https://eval.in/463260)
[00:16:36] netule: you need to compare using an epsilon value
[00:16:55] Axsuul: has joined #ruby
[00:17:00] al2o3-cr: harly: bigdecimal
[00:17:26] al2o3-cr: &ri BigDecimal # harly
[00:17:27] `derpy: http://www.rubydoc.info/stdlib/bigdecimal/BigDecimal
[00:18:02] harly: cool thanks i'll read tha tup
[00:18:07] eam: bigdecimal or rational, depending on what kind of operations
[00:19:52] TheNet: has joined #ruby
[00:20:27] crdpink: has joined #ruby
[00:22:08] eam: harly: https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
[00:22:57] nietzschette: has joined #ruby
[00:23:00] harly: ty. some bedtime reading :)
[00:23:57] nietzschette: hey i have a quick question question
[00:24:01] rakm: has joined #ruby
[00:24:06] mordocai: has joined #ruby
[00:24:08] al2o3-cr: harly: best time reading
[00:24:37] al2o3-cr: ?ask nietzschette
[00:24:38] ruboto: nietzschette, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[00:25:05] jottr: has joined #ruby
[00:25:32] jericon: In my script I'm using mysql2 to retrieve a value from MySQL. It will always be a single row returned (I'm doing SELECT TO_DAYS(now());). What I want is to get the result of that query into its own variable. What is the best way to do that?
[00:26:38] harly: eam: missed your suggestion. I like that. to get it printed out as a decimal, is it best like (10.1r/100r).to_f or should I use something that doesn't involve a float?
[00:27:01] nietzschette: I have a tk app and when I bind a command to a button, it appears I am limited to commands in the global scope. Is there a way to reslove the local scope in a string?
[00:27:08] okdas: has joined #ruby
[00:27:08] okdas: has joined #ruby
[00:27:22] al2o3-cr: ?code nietzschette
[00:27:22] ruboto: nietzschette, We can't help you without your code, please post it to https://gist.github.com
[00:27:55] DEA7TH: has joined #ruby
[00:27:59] infamos: has joined #ruby
[00:28:08] ericwood: huh there's Tk ruby bindings?
[00:28:22] al2o3-cr: ericwood: yep
[00:28:22] ericwood: I used to do so much Tkinter stuff when I started out with python, it was kinda fun!
[00:28:27] ericwood: oh boy oh boy
[00:28:30] eam: harly: it depends on your use case -- the thing to keep in mind is that the number base dictates which operations can and can't be performed accurately
[00:28:37] nietzschette: https://gist.github.com/anonymous/e0b59981d3361972552e
[00:28:44] shmilan: has joined #ruby
[00:28:52] eam: harly: just like 1/3 is a repeating decimal in base 10, other values are repeating (and un-expressable without loss) in base 2
[00:28:58] RegulationD: has joined #ruby
[00:29:01] ericwood: oh my god ActiveState TCL
[00:29:08] ericwood: now there's a phrase I haven't heard in a while :o
[00:29:29] al2o3-cr: nietzschette: that semicolon should be a comma
[00:30:01] ericwood: oh my god...it works
[00:30:45] nietzschette: you see the ugly portion in the string i have to name my module, my class, and a member of my class before I even get to the funtion. is there a way to reference that function directly, or provide the scope programaticly?
[00:31:35] riotjones: has joined #ruby
[00:32:10] harly: eam: ok i get that. so if I have Rational(1.3) and I want that printed out as decimal with a precision of 3. what's the best approach? (reading through precision docs in Rational but i think that's not applicable)
[00:32:17] harly: Rational(1,3) i mean.
[00:33:07] rickmasta: has joined #ruby
[00:34:05] nietzschette: you mean, like Rational(1,3).to_f.round(3)
[00:34:16] eam: harly: probably use bigdecimal for that
[00:34:33] al2o3-cr: nietzschette: interpolate the string
[00:34:34] harly: nietzchette: yes i mean that. but i wonder if I should still avoid float and use something else.
[00:34:50] rickmasta: has joined #ruby
[00:34:51] eam: to_f will have the same rounding issues as the original expression
[00:35:10] rickmasta: has joined #ruby
[00:35:17] eam: Rational is nice if you want to represent the exact rational value
[00:35:30] eam: BigDecimal will give you more precision for actually doing the division
[00:35:39] antgel: has joined #ruby
[00:35:47] charliesome: has joined #ruby
[00:35:55] harly: eam. in this case i'm happy to stay in rational until i just want to represent the final answer.
[00:36:20] eam: you can always BigDecimal.new(some_rational)
[00:36:33] harly: eam. so just trying to fish for the best way to take the final rational, say Rationa(1,3) after all the calculations, and represeent it as a string "1.333". what .to_f.round(3) does.
[00:36:40] htmldrum: has joined #ruby
[00:36:42] harly: 0.333 of course.
[00:37:46] sankaber: has joined #ruby
[00:38:31] pdoherty: has joined #ruby
[00:38:35] eam: >> BigDecimal.new(Rational(1,3), 3)
[00:38:36] ruboto: eam # => uninitialized constant BigDecimal (NameError) ...check link for more (https://eval.in/463261)
[00:38:44] eam: >> require 'bigdecimal'; BigDecimal.new(Rational(1,3), 3)
[00:38:46] ruboto: eam # => #<BigDecimal:411864c4,'0.333E0',9(27)> (https://eval.in/463262)
[00:38:49] patdohere: has joined #ruby
[00:39:12] patdohere: has joined #ruby
[00:39:31] eam: >> require 'bigdecimal'; BigDecimal.new(Rational(1,3), 3).to_s("F")
[00:39:32] ruboto: eam # => "0.333" (https://eval.in/463263)
[00:39:41] harly: eam: great thanks. i'd gotten close, but I was missing the second argument to big decimal.
[00:39:54] csaunders: has joined #ruby
[00:40:04] tulak: has joined #ruby
[00:40:23] atomical: has joined #ruby
[00:41:00] elton: has joined #ruby
[00:41:12] to_json: has joined #ruby
[00:41:12] to_json: has joined #ruby
[00:41:52] eam: nietzschette: yes, the problem is surrounding values which can't be expressed in IEEE float
[00:42:28] eam: >> "#{10.1/100}"
[00:42:29] ruboto: eam # => "0.10099999999999999" (https://eval.in/463264)
[00:43:02] eam: >> require 'bigdecimal'; BigDecimal.new(Rational(10.1, 100), 3).to_s("F")
[00:43:03] ruboto: eam # => "0.101" (https://eval.in/463265)
[00:43:17] Balllkenende: has joined #ruby
[00:43:37] nietzschette: ah yes, I remember those problems now.
[00:43:53] eam: if you push your math into Rationals you know you won't encounter errors due to the rounding limits of the type -- and BigDecimal is the way to do the final high precision conversion
[00:43:56] harly: although. in this case small final precision probably makes it all a bit moot
[00:44:03] charliesome: has joined #ruby
[00:44:11] nietzschette: uhg math is outdated
[00:44:26] harly: >> (10.1/100).round(3)
[00:44:27] ruboto: harly # => 0.101 (https://eval.in/463266)
[00:44:42] al2o3-cr: nietzschette: nature is maths
[00:44:56] nietzschette: maths is a discription of nature
[00:45:09] nietzschette: nature is not math
[00:45:48] al2o3-cr: nietzschette: and it's description
[00:45:54] treaki: has joined #ruby
[00:46:10] nietzschette: semantics are difficult to argue
[00:47:39] devoldmx: has joined #ruby
[00:47:45] lkba_: has joined #ruby
[00:47:46] nietzschette: anyway, anybody have answers for my metaprograming prolblem?
[00:48:00] Joufflu: has joined #ruby
[00:48:07] ruboto: I don't know anything about meta
[00:48:15] charliesome: has joined #ruby
[00:49:06] Balllkenende: has joined #ruby
[00:49:28] tkuchiki: has joined #ruby
[00:50:45] harly: i get 404 on your gist nietzschette
[00:51:35] DLSteve: has joined #ruby
[00:52:14] al2o3-cr: i must be reading a totally different gist :[
[00:53:02] b3nt_pin: has joined #ruby
[00:53:05] harly: this is the one i tried to read: https://gist.github.com/anonymous/e0b59981d3361972552e
[00:54:52] nietzschette: here is a better discription
[00:54:56] nietzschette: https://gist.github.com/anonymous/e2680eff52df108703df
[00:55:45] nietzschette: the comment at the bottom: change line 4 to 12 cause i'm a nub
[00:56:12] porfa: has joined #ruby
[00:56:38] eam: nietzschette: I don't understand your question, what do you want to access?
[00:56:52] platzhirsch: has joined #ruby
[00:57:08] nettoweb: has joined #ruby
[00:57:16] nietzschette: :selection is a method
[00:57:31] nietzschette: I can't just say: command "selection"
[00:57:43] nietzschette: and i can't say: command "self.selection"
[00:58:20] nietzschette: i have to name the module and instances explicitly
[00:58:45] eam: command "#{self}.selection" ?
[00:58:50] nietzschette: however, those names can often change
[00:58:57] eam: you're building a string right
[00:59:19] mistermocha: has joined #ruby
[01:00:08] eam: >> module Goo; class Foo; "self: #{self}"; end; end
[01:00:09] ruboto: eam # => "self: Goo::Foo" (https://eval.in/463267)
[01:00:14] al2o3-cr: has joined #ruby
[01:00:16] nietzschette: and calling a function in the scope of that class's instance. the TK::Button appears to only envoke commands in global scope though
[01:00:34] rgtk: has joined #ruby
[01:00:36] s2013: has joined #ruby
[01:00:44] nietzschette: okay, lemmy try that
[01:01:05] lemur: has joined #ruby
[01:01:16] al2o3-cr: my connection is going crazy gonna say bye bye real soon to them money oriented fucks
[01:01:28] nietzschette: no, that doesn't work for some reason
[01:01:51] nietzschette: I think because i'm dealing with an instance of the class
[01:02:01] nietzschette: and not just the class as a constant
[01:02:10] al2o3-cr: an instance variable is good as a global
[01:02:40] rgtk: has joined #ruby
[01:02:50] Rollabunna: has joined #ruby
[01:03:45] al2o3-cr: can be addressed from *
[01:04:21] bubbys: has joined #ruby
[01:04:34] rgtk: has joined #ruby
[01:05:02] to_json: has joined #ruby
[01:05:03] to_json: has joined #ruby
[01:05:23] mistermocha: has joined #ruby
[01:05:48] chibs: has joined #ruby
[01:05:49] al2o3-cr: poll: emacs, vim, nano vote 0, 1, 2 respectivley # if it wasn't sent
[01:05:51] bricker: has joined #ruby
[01:06:24] rgtk: has joined #ruby
[01:07:40] djellemah_: has joined #ruby
[01:07:45] al2o3-cr: who watched the film sneakers?
[01:08:20] nietzschette: cattle mutilations are up
[01:08:23] rgtk: has joined #ruby
[01:08:55] nietzschette: 'mother' says that in sneakers
[01:09:20] al2o3-cr: no, i'm woundering if you was in it
[01:10:11] rgtk: has joined #ruby
[01:10:12] purplexed-: has joined #ruby
[01:10:12] purplexed-: has joined #ruby
[01:10:46] al2o3-cr: nietzschette: thats are german name if ever a saw one
[01:11:36] al2o3-cr: nietzschette: you are german, right?
[01:11:50] nietzschette: mine ansestors are from hartz mountains. i'm american white trash
[01:12:06] rgtk: has joined #ruby
[01:13:06] al2o3-cr: nietzschette: tut tut
[01:13:10] TheNet: has joined #ruby
[01:13:12] jubal: has joined #ruby
[01:13:55] eam: https://www.youtube.com/watch?v=myhnAZFR1po
[01:13:59] rgtk: has joined #ruby
[01:14:48] bb010g: has joined #ruby
[01:15:17] TheNet: has joined #ruby
[01:15:25] nietzschette: this vijeo is false. it should be two banjers
[01:15:37] al2o3-cr: https://www.youtube.com/watch?v=sHQ_aTjXObs
[01:15:53] rgtk: has joined #ruby
[01:16:02] zylogz80: has joined #ruby
[01:16:20] eam: never seen Deliverance?
[01:16:28] al2o3-cr: nietzschette: chill dude!
[01:17:17] infamos: has joined #ruby
[01:17:48] rgtk: has joined #ruby
[01:17:59] al2o3-cr: https://www.youtube.com/watch?v=PdiCJUysIT0 # tune
[01:17:59] nietzschette: i ain't keen on keepin' up on those new fangled pitcure radio shows
[01:18:19] Azure: has joined #ruby
[01:18:27] eam: spoiler: a second banjer arrives on scene
[01:19:54] rgtk: has joined #ruby
[01:19:59] nietzschette: https://www.youtube.com/watch?v=6X9tBHX_Fl4
[01:20:56] al2o3-cr: keep on rockin' in a free world!
[01:21:17] TheNet: has joined #ruby
[01:21:38] rgtk: has joined #ruby
[01:21:51] s2013: has joined #ruby
[01:21:53] elperdut_: has joined #ruby
[01:22:08] d34th4ck3r: has joined #ruby
[01:23:08] elperdut_: has joined #ruby
[01:23:25] gigetoo: has joined #ruby
[01:23:28] rgtk: has joined #ruby
[01:23:44] al2o3-cr: colorado rocks is a nice drink, who tasted this
[01:24:32] elperdut_: has joined #ruby
[01:25:26] rgtk: has joined #ruby
[01:26:15] hmsimha_: has joined #ruby
[01:27:18] rgtk: has joined #ruby
[01:27:36] al2o3-cr: nietzschette: https://www.youtube.com/watch?v=6X9tBHX_Fl4 # what is this?
[01:27:48] diego2: has joined #ruby
[01:29:09] rgtk: has joined #ruby
[01:29:22] nietzschette: one of those things I find difficult to rectify the existance of
[01:30:14] elton: has joined #ruby
[01:30:27] al2o3-cr: nietzschette: hahaaaaahaahaaaaahhhhaa
[01:30:29] RegulationD: has joined #ruby
[01:30:50] ekinmur: has joined #ruby
[01:31:07] rgtk: has joined #ruby
[01:32:21] riotjones: has joined #ruby
[01:32:40] willardg: has joined #ruby
[01:32:59] rgtk: has joined #ruby
[01:34:09] crdpink2: has joined #ruby
[01:34:51] rgtk: has joined #ruby
[01:34:52] charliesome: has joined #ruby
[01:36:50] rgtk: has joined #ruby
[01:37:06] nietzschette: oh well, i guess I'll just restructure some things
[01:37:09] Azure: has joined #ruby
[01:37:44] CloCkWeRX: has joined #ruby
[01:38:42] rgtk: has joined #ruby
[01:40:28] al2o3-cr: >> nietzschette i guess so
[01:40:29] ruboto: al2o3-cr # => undefined local variable or method `so' for main:Object (NameError) ...check link for more (https://eval.in/463277)
[01:40:36] rgtk: has joined #ruby
[01:41:41] roshanavand: has joined #ruby
[01:42:19] VeryBewitching: has joined #ruby
[01:42:29] rgtk: has joined #ruby
[01:42:42] al2o3-cr: wtf is main:Object
[01:42:47] jottr_: has joined #ruby
[01:43:20] nietzschette: it is everything
[01:43:37] nietzschette: the 'gobal' scope
[01:43:49] rickmasta: has joined #ruby
[01:43:52] shevy: al2o3-cr THE MOTHER OF ALL OBJECTS
[01:43:56] shevy: WHO IS UR DADDY
[01:44:03] vigintas: has joined #ruby
[01:44:09] abucha: has joined #ruby
[01:44:22] rgtk: has joined #ruby
[01:44:37] nietzschette: main is the blank, empty void await command after IRB.start
[01:44:43] al2o3-cr: >> self.singleton_class.send :undef_method, :inspect
[01:44:44] ruboto: al2o3-cr # => #<Class:#<Object:0x41fe2e3c>> (https://eval.in/463278)
[01:44:58] sankaber: has joined #ruby
[01:45:25] al2o3-cr: you know i jk right?
[01:45:50] sankaber: has joined #ruby
[01:45:51] nietzschette: i'll know when you say something funny ;p
[01:46:18] rgtk: has joined #ruby
[01:46:35] havenwood: al2o3-cr: See just: self.singleton_class
[01:47:02] reaVer: has joined #ruby
[01:47:27] al2o3-cr: havenwood: but i wanted to undefine the method whilst i was at it :P
[01:47:35] shevy: you people are evil
[01:47:56] havenwood: al2o3-cr: Note:
[01:47:57] al2o3-cr: self as singleton methods to_s and inspect
[01:47:59] havenwood: >> self.singleton_class.send :undef_method, :inspect; self
[01:48:00] ruboto: havenwood # => /tmp/execpad-0034ce16b55f/source-0034ce16b55f:1:in `p': undefined method `inspect' for #<Object:0x41 ...check link for more (https://eval.in/463279)
[01:48:08] shevy: now you did it
[01:48:10] shevy: you broke the ruby
[01:48:12] rgtk: has joined #ruby
[01:48:25] havenwood: shevy: No worries:
[01:48:28] havenwood: >> class << self; remove_method :inspect end; self
[01:48:29] ruboto: havenwood # => #<Object:0x407c2e38> (https://eval.in/463280)
[01:49:34] al2o3-cr: self.singleton_class.instance_eval { undef_method :to_s; undef_method :inspect; self }
[01:49:41] al2o3-cr: >> self.singleton_class.instance_eval { undef_method :to_s; undef_method :inspect; self }
[01:49:42] ruboto: al2o3-cr # => #<Class:#<Object:0x4068ee40>> (https://eval.in/463285)
[01:50:04] al2o3-cr: >> self.singleton_class.instance_eval { undef_method :to_s; undef_method :inspect; self.respond_to? :to_s }
[01:50:05] rgtk: has joined #ruby
[01:50:05] ruboto: al2o3-cr # => true (https://eval.in/463287)
[01:50:09] peterhu: has joined #ruby
[01:50:55] al2o3-cr: >> self.singleton_class.instance_eval { remove_method :to_s; remove_method :inspect; self.respond_to? :to_s }
[01:50:56] ruboto: al2o3-cr # => true (https://eval.in/463289)
[01:51:05] willardg: has joined #ruby
[01:51:55] elton: has joined #ruby
[01:52:00] rgtk: has joined #ruby
[01:52:21] al2o3-cr: i hate that syntax class << self
[01:52:34] zenguy_pc: has joined #ruby
[01:53:14] havenwood: al2o3-cr: Why?
[01:53:51] rgtk: has joined #ruby
[01:54:24] dopamean_: has joined #ruby
[01:54:33] rabbithole: has joined #ruby
[01:54:48] qwertme: has joined #ruby
[01:54:58] al2o3-cr: when i see it in classes it just pisses me off, why not just self.method?
[01:55:44] rgtk: has joined #ruby
[01:55:54] nietzschette: why not just method for that matter
[01:56:26] CloCkWeRX: has joined #ruby
[01:56:29] al2o3-cr: nietzschette: depends if you want an instance method or class(or a million other name) method
[01:56:38] slawrence00: has joined #ruby
[01:57:05] al2o3-cr: but all instance methods are really singleton_class methods
[01:57:38] asad_: has joined #ruby
[01:57:41] rgtk: has joined #ruby
[01:57:51] asad_: Is there an array method to perform a binary search?
[01:58:10] al2o3-cr: asad_: as in how?
[01:58:24] havenwood: asad_: Array#bsearch
[01:58:34] rgrmatt: has joined #ruby
[01:59:05] havenwood: &ri Array#bsearch
[01:59:05] `derpy: http://www.rubydoc.info/stdlib/core/Array#bsearch-instance_method
[01:59:21] nietzschette: you will need a gem if you're 1.9
[01:59:32] rgtk: has joined #ruby
[01:59:56] al2o3-cr: thinking something totally diff there then (wow) this shit is strong
[02:00:29] havenwood: But 1.9 is past end-of-life so *of course* nobody is using it anymore. :P
[02:00:45] al2o3-cr: havenwood: no one?
[02:01:05] nietzschette: but i'm obsolete so, whatev
[02:01:15] Croves: has joined #ruby
[02:01:17] rgtk: has joined #ruby
[02:01:48] baweaver: has joined #ruby
[02:01:59] tkuchiki: has joined #ruby
[02:02:42] _stu_: has joined #ruby
[02:02:52] al2o3-cr: i still use 1.8.7 @_''_@
[02:03:20] nietzschette: use does not mean use usefully
[02:03:30] jorb: has joined #ruby
[02:03:34] rgtk: has joined #ruby
[02:03:45] al2o3-cr: nietzschette: when i mean use i mean use
[02:04:30] nietzschette: I used to make vijeo games with ruby sdl and i none of them work with 2.0
[02:04:46] juanpablo__: has joined #ruby
[02:05:00] al2o3-cr: nietzschette: when you say vijeo is that what i think it means
[02:05:14] rgtk: has joined #ruby
[02:06:07] havenwood: al2o3-cr: Stop using 1.8. Live in the now!
[02:06:23] nietzschette: it means i'm mildly retarted about spelling and so i try to fail as spectacularly as possible
[02:06:45] havenwood: nietzschette: https://github.com/zenspider/graphics#readme
[02:07:07] rgtk: has joined #ruby
[02:07:15] al2o3-cr: havenwood: i'm a vegetarian too, no i'm just kidding :p
[02:07:24] havenwood: al2o3-cr: phew
[02:07:34] al2o3-cr: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
[02:07:48] al2o3-cr: 4.2.5-1-ARCH
[02:07:52] bryanray_: has joined #ruby
[02:08:13] nietzschette: i remember talking to zenspider about this a long time ago. it appears to be working, eh?
[02:08:19] bruno-: has joined #ruby
[02:08:22] al2o3-cr: nietzschette: take no offence
[02:09:01] rgtk: has joined #ruby
[02:09:13] arescorpio: has joined #ruby
[02:09:55] ellisTAA: has joined #ruby
[02:10:58] rgtk: has joined #ruby
[02:12:40] asad_: how do refinements work in ruby > 2.0?
[02:12:49] rgtk: has joined #ruby
[02:13:02] swgillespie: has joined #ruby
[02:14:08] al2o3-cr: asad_: create a module create you refinement then include wherever
[02:14:25] al2o3-cr: except Object
[02:14:45] rgtk: has joined #ruby
[02:15:29] willardg: has joined #ruby
[02:15:33] Musashi007: has joined #ruby
[02:15:42] havenwood: asad, oh, left?
[02:16:05] radgeRayden_: has joined #ruby
[02:16:39] rgtk: has joined #ruby
[02:16:52] platzhirsch: has left #ruby: ()
[02:18:34] rgtk: has joined #ruby
[02:20:27] rgtk: has joined #ruby
[02:23:15] RobertBirnie: has joined #ruby
[02:23:18] blue_deref: has joined #ruby
[02:25:48] CloCkWeRX: has joined #ruby
[02:25:51] hxegon: has joined #ruby
[02:26:15] bruce_lee2: has joined #ruby
[02:26:23] abucha_: has joined #ruby
[02:26:27] bruce_lee: has joined #ruby
[02:26:45] rgtk: has joined #ruby
[02:26:51] al2o3-cr: havenwood: what gcc you got
[02:28:08] havenwood: al2o3-cr: All of them.
[02:28:24] al2o3-cr: what the lastest 5.2.0?
[02:29:04] adaoraul: has joined #ruby
[02:30:08] havenwood: al2o3-cr: Seems at the moment 5.2 on OS X and 4.8 on FreeBSD.
[02:30:12] charliesome: has joined #ruby
[02:30:25] havenwood: al2o3-cr: Or :P Apple LLVM version 7.0.0 (clang-700.1.76)
[02:31:28] al2o3-cr: you play about with free?
[02:32:29] willardg: has joined #ruby
[02:32:48] al2o3-cr: havenwood: can i ask are macbooks worth it?
[02:33:09] al2o3-cr: 13" versions
[02:33:09] riotjones: has joined #ruby
[02:33:10] havenwood: al2o3-cr: I'm about to relocate, but yeah good computers.
[02:33:21] havenwood: al2o3-cr: rMBP you mean? Or Macbook?
[02:33:30] havenwood: (Which isn't 13".)
[02:33:42] al2o3-cr: no retina in 13"?
[02:33:52] havenwood: al2o3-cr: There is, but not Macbook.
[02:34:01] havenwood: al2o3-cr: Very solid, you'll love it.
[02:34:21] blackmesa: has joined #ruby
[02:34:32] havenwood: al2o3-cr: Macbook is retina but not very burly (tiny with no fans or moving parts at all).
[02:34:52] al2o3-cr: thinking between dell xps 13 or mac 13
[02:35:15] havenwood: al2o3-cr: 13" rMBP is quite nice.
[02:35:22] al2o3-cr: last time i had a mac was a mac mini :p
[02:36:49] inteq: has joined #ruby
[02:37:36] Musashi007: has joined #ruby
[02:37:57] al2o3-cr: havenwood: when i mac mini i mean one of these http://thumbs.dreamstime.com/z/apple-macintosh-128k-19134615.jpg
[02:38:31] Vile`: has joined #ruby
[02:39:02] al2o3-cr: havenwood: isn't osx built on openBSD
[02:39:57] rgtk: has joined #ruby
[02:40:19] eam: anyone here good with ffi?
[02:40:59] kies^: has joined #ruby
[02:41:23] mdih: has joined #ruby
[02:41:56] rgtk: has joined #ruby
[02:42:00] al2o3-cr: that is a thing of beauty http://www.laptopmag.com/images/uploads/4348/g/dell-xps-13-2015-g04.jpg but RAM is integrated :(
[02:42:26] mdih: has joined #ruby
[02:43:32] mdih: has joined #ruby
[02:44:19] al2o3-cr: eam: use fiddle
[02:44:31] eam: is fiddle the new hotness?
[02:44:40] mdih: has joined #ruby
[02:44:41] al2o3-cr: probably not
[02:44:55] al2o3-cr: stdlib though
[02:45:01] eam: already using ffi
[02:45:19] s2013: has joined #ruby
[02:45:54] mdih: has joined #ruby
[02:45:55] rgtk: has joined #ruby
[02:46:05] eam: usb device driver
[02:46:13] RegulationD: has joined #ruby
[02:46:38] al2o3-cr: ah, i remember you talking about that
[02:46:49] colegatron: has joined #ruby
[02:47:16] bnagy: eam: I have done a lot of ffi
[02:47:32] al2o3-cr: wasn't it this https://github.com/larskanis/libusb
[02:47:35] bnagy: not sure if that counts as 'good' until I hear the question :)
[02:47:44] hxegon: has joined #ruby
[02:47:48] eam: I'll cross post from their sleepy channe:
[02:47:51] eam: buf = Thing.read; struct = MyFFIStruct.new FFI::MemoryPointer.from_string buf # is this the best / most efficient way to perform what in C might be read(f, &my_struct, sizeof(my_struct)) ?
[02:48:02] rgtk: has joined #ruby
[02:48:19] eam: al2o3-cr: yeah I'm using that
[02:48:24] devoldmx: has joined #ruby
[02:49:54] cmoney: has joined #ruby
[02:50:03] eam: Thing in this case is a usb handle
[02:50:31] Bloomer: has joined #ruby
[02:50:35] eam: wondering specifically about a clean string/buf -> struct path
[02:50:39] bnagy: eam: pretty much, afaik
[02:50:46] eam: it seems to be working well
[02:50:49] bnagy: you can use FFI::Pointer or MemoryPointer
[02:51:01] eam: what's the difference?
[02:51:02] bnagy: but if you're starting with a string that's certainly what I'd do
[02:51:27] bnagy: FFI::Pointer comes from Other Stuff eg things return em
[02:51:52] leafybas_: has joined #ruby
[02:52:02] freerobby: has joined #ruby
[02:52:27] s2013: has joined #ruby
[02:52:28] Axsuul: has joined #ruby
[02:52:38] babblebre: has joined #ruby
[02:53:20] al2o3-cr: whats a pointer
[02:53:29] Axsuul: has joined #ruby
[02:53:41] moeabdol: has joined #ruby
[02:53:48] bnagy: I guess you could avoid the intermediate buf variable, but I probably wouldn't :)
[02:53:49] baweaver: has joined #ruby
[02:53:51] eam: al2o3-cr: an integer that points to a location of memory
[02:54:17] eam: bnagy: makes sense :)
[02:54:50] Axsuul: has joined #ruby
[02:55:02] eam: now I have a method that given a descriptor and a FFI::Struct class will read 'em off the wire
[02:55:05] eam: seems to be working ok
[02:55:35] al2o3-cr: int foo = 1; int_ptr = &foo; <-- ?
[02:55:59] rgrmatt: has joined #ruby
[02:56:14] eam: and then *int_ptr = 5 # changes the memory location of foo, so foo == 5
[02:56:21] al2o3-cr: so whats the difference between `*` and `&`
[02:56:28] rgtk: has joined #ruby
[02:56:31] rbennacer: has joined #ruby
[02:56:40] eam: & is address-of, * is points-to
[02:56:43] bnagy: direction
[02:56:50] willardg: has joined #ruby
[02:57:28] al2o3-cr: whats the difference between struct and typedef?
[02:58:51] roxtrongo: has joined #ruby
[02:59:15] juanpablo__: has joined #ruby
[02:59:27] Kero: has joined #ruby
[02:59:28] eam: al2o3-cr: a struct is an ordered layout of variables in memory with names, like a ruby class with no methods or a hash (but with a different layout)
[02:59:33] eam: a typedef is essentially an alias
[03:00:22] ESpiney: has joined #ruby
[03:00:25] eam: typedef int magic_number; magic_number foo; # foo is an int
[03:00:25] al2o3-cr: eam: ok awesome
[03:00:32] Pupeno: has joined #ruby
[03:03:44] Rollabunna: has joined #ruby
[03:03:47] simplyia_: has joined #ruby
[03:04:34] al2o3-cr: so eam this is valid char *foo[] = "ksjdkj";
[03:05:11] eam: just char *foo = "ksjdkj";
[03:05:16] eam: in C, a double quoted string is a pointer
[03:05:42] eam: in fact,this is valid C: "asdf"[2] or this: 2["asdf"] -- they're the same thing
[03:06:10] al2o3-cr: eam: why though?
[03:06:10] rgrmatt: has joined #ruby
[03:06:17] eam: x[y] is just shorthand for *(x + y)
[03:06:58] swgillespie: has joined #ruby
[03:07:07] eam: if you have char *foo = "abcd"; and "abcd" is at memory location 1000, then it means *(1001) is the byte 'b'
[03:07:25] eam: which is foo[1], or 1000 + 1
[03:07:45] al2o3-cr: eam: so a char is one byte?
[03:08:12] eam: generally (not sure if always on all platforms?)
[03:08:32] al2o3-cr: should be upto 64bits
[03:08:50] eam: a C char isn't a unicode character
[03:09:03] bruno-: has joined #ruby
[03:09:04] eam: C doesn't have a concept of character datatypes
[03:09:12] krz: has joined #ruby
[03:09:44] rgtk: has joined #ruby
[03:09:44] eam: wikipedia says POSIX guarantees char = 8 bits
[03:09:50] eam: other platforms might differ
[03:10:10] eam: most of the datatypes have a minimum size, but no max
[03:10:39] eam: which is why stuff like int can grow to larger values on new architectures
[03:11:26] al2o3-cr: but a double on 32bit is 4 64bit 8?
[03:12:04] al2o3-cr: eam: have you tried overflowing the stack on 64bit arch?
[03:12:08] Axsuul: has joined #ruby
[03:13:28] eam: double is a floating point type
[03:13:52] rgtk_: has joined #ruby
[03:13:59] eam: on most systems it's a standard size
[03:14:18] eam: floating point is unrelated to the integer size, or pointer size
[03:14:36] al2o3-cr: eam: correct
[03:15:25] EminenceHC: has joined #ruby
[03:16:14] mistermocha: has joined #ruby
[03:16:32] rgrmatt: has joined #ruby
[03:21:09] dopamean_: has joined #ruby
[03:21:47] bryanray: has joined #ruby
[03:22:31] tjbiddle: has joined #ruby
[03:22:37] rgtk: has joined #ruby
[03:22:50] al2o3-cr: eam: you know assembly ia32/
[03:23:00] al2o3-cr: eam: you know assembly ia32/64
[03:25:56] nopolitica: has joined #ruby
[03:27:19] favadi: has joined #ruby
[03:29:47] DiCablo: has joined #ruby
[03:31:14] rgtk: has joined #ruby
[03:31:31] kp666_: has joined #ruby
[03:33:59] riotjones: has joined #ruby
[03:34:01] mistermocha: has joined #ruby
[03:34:49] al2o3-cr: >> "bonfire lollies all around " * 9
[03:34:50] ruboto: al2o3-cr # => "bonfire lollies all around bonfire lollies all around bonfire lollies all around bonfire lollies al ...check link for more (https://eval.in/463354)
[03:34:58] axsuul_: has joined #ruby
[03:35:17] havenwood: ruboto: No spamming!
[03:35:46] sdothum: has joined #ruby
[03:36:05] havenwood: ?cookie ruboto
[03:36:05] ruboto: ruboto, here's your cookie: ????
[03:36:20] blackmesa: has joined #ruby
[03:36:22] axsuul_: has joined #ruby
[03:36:30] al2o3-cr: havenwood: how to add ?
[03:37:42] havenwood: >> '>' * 2 << ':)'
[03:37:43] ruboto: havenwood # => ">>:)" (https://eval.in/463355)
[03:37:48] al2o3-cr: havenwood: how to add ?to ruboto?
[03:38:56] al2o3-cr: >> @nil.frozen?
[03:38:57] ruboto: al2o3-cr # => true (https://eval.in/463356)
[03:39:22] al2o3-cr: havenwood: how to add?
[03:40:26] havenwood: al2o3-cr: You'd have to have the ruboto commit bit to add commands proper but I think you can add facts.
[03:40:36] mistermocha: has joined #ruby
[03:40:36] yfeldblum: has joined #ruby
[03:41:13] hxegon: has joined #ruby
[03:41:26] al2o3-cr: havenwood: syntax?
[03:41:36] al2o3-cr: to add facts that is
[03:41:37] havenwood: al2o3-cr: !fact (add |mk) LABEL TEXT
[03:41:41] Axsuul: has joined #ruby
[03:41:55] al2o3-cr: havenwood: and can you also remove?
[03:42:03] havenwood: al!fact (remove | rm) LABEL
[03:42:39] purplexed-: has joined #ruby
[03:42:40] purplexed-: has joined #ruby
[03:43:39] tigarcia: has joined #ruby
[03:44:16] mistermocha: has joined #ruby
[03:46:47] rabbithole: has joined #ruby
[03:47:34] havenwood: al2o3-cr: In any case, #ruby-community is a good place to discuss new facts or commands. Or changes to the current ones. Etc.
[03:48:12] nateberkopec: has joined #ruby
[03:50:19] al2o3-cr: has joined #ruby
[03:50:27] ruboto: I don't know anything about gambling
[03:50:33] al2o3-cr: !fact add gambling give it up cowboy!!!
[03:51:07] al2o3-cr: auth == nimble ;(
[03:51:12] havenwood: al2o3-cr: Seems to be restricted or need approval.
[03:51:22] havenwood: al2o3-cr: gambling give it up cowboy!!!
[03:51:52] al2o3-cr: havenwood: yeah got disconnected, didn't mean to send so many if they went through
[03:53:21] zenguy_pc: has joined #ruby
[03:53:44] Feyn: has joined #ruby
[03:54:06] mloy: has left #ruby: ("Leaving")
[03:54:30] diegoaguilar: has joined #ruby
[03:55:09] al2o3-cr: havenwood: how come?
[03:56:09] baweaver: has joined #ruby
[03:56:26] al2o3-cr: havenwood: how'd ya get privs?
[03:57:20] havenwood: al2o3-cr: I'm an OP. The #ruby-community channel is probably the best place to discuss ruboto to keep #ruby for Ruby questions.
[03:57:59] al2o3-cr: havenwood: Ok, thank you havenwood
[03:58:10] havenwood: al2o3-cr: No prob
[03:58:55] yfeldblum: has joined #ruby
[03:59:09] arup_r: has joined #ruby
[04:02:55] hectorsq: has joined #ruby
[04:04:41] neanderslob__: has joined #ruby
[04:05:52] rickmasta: has joined #ruby
[04:06:06] ellisTAA: has joined #ruby
[04:08:41] Oatmeal: has joined #ruby
[04:09:18] chibs: has joined #ruby
[04:10:08] bruno-: has joined #ruby
[04:10:17] idefine: has joined #ruby
[04:10:22] jdawgaz: has joined #ruby
[04:10:49] conail: has joined #ruby
[04:15:55] BSab: has joined #ruby
[04:17:22] braincrash: has joined #ruby
[04:17:23] astrobun_: has joined #ruby
[04:17:33] OS-18454: has joined #ruby
[04:18:40] gix: has joined #ruby
[04:19:15] rehat: has joined #ruby
[04:19:26] CloCkWeRX: has joined #ruby
[04:19:59] ss_much: has joined #ruby
[04:20:34] cmoney: has joined #ruby
[04:20:42] fedexo: has joined #ruby
[04:22:17] Eiam_: has joined #ruby
[04:23:21] treaki_: has joined #ruby
[04:25:15] swgillespie: has joined #ruby
[04:28:50] dopamean_: has joined #ruby
[04:31:05] nopolitica: has joined #ruby
[04:31:40] shinenelson: has joined #ruby
[04:32:22] swgillespie: has joined #ruby
[04:33:03] darkf: has joined #ruby
[04:33:45] yfeldblum: has joined #ruby
[04:34:05] hxegon_: has joined #ruby
[04:34:46] riotjones: has joined #ruby
[04:34:47] mistermocha: has joined #ruby
[04:35:02] opensource_ninja: has joined #ruby
[04:37:08] blackmesa: has joined #ruby
[04:37:10] sgambino: has joined #ruby
[04:37:11] infamos: has joined #ruby
[04:40:52] s2013: has joined #ruby
[04:41:43] lubarch: has joined #ruby
[04:42:55] _djbkd: has joined #ruby
[04:43:31] cmoney: has joined #ruby
[04:47:02] RegulationD: has joined #ruby
[04:48:00] juanpablo__: has joined #ruby
[04:49:00] nateberkopec: has joined #ruby
[04:49:09] devoldmx: has joined #ruby
[04:49:50] tigarcia: has joined #ruby
[04:50:32] rakm: has joined #ruby
[04:50:53] moeabdol: has joined #ruby
[04:52:10] cmoney: has joined #ruby
[04:55:21] cmoney: has joined #ruby
[04:55:55] dopamean_: has joined #ruby
[04:56:42] Guest97: has joined #ruby
[04:59:28] macs1: has joined #ruby
[05:00:57] Pupeno: has joined #ruby
[05:01:22] d34th4ck3r: has joined #ruby
[05:02:29] qwertme: has joined #ruby
[05:02:40] eam: al2o3-cr: yes
[05:03:51] cmoney: has joined #ruby
[05:04:07] rbennacer: has joined #ruby
[05:04:38] Rollabunna: has joined #ruby
[05:05:10] dolemite_: has joined #ruby
[05:05:21] dolemite_: can i use ruby to make gaems?
[05:05:32] al2o3-cr: dolemite_: gosu
[05:07:25] dolemite_: has left #ruby: ("Leaving")
[05:10:26] devoldmx: has joined #ruby
[05:10:26] chibs: has joined #ruby
[05:11:16] bruno-: has joined #ruby
[05:11:57] newmanships: has joined #ruby
[05:12:08] cmoney: has joined #ruby
[05:13:26] mistermocha: has joined #ruby
[05:13:34] mndoci: has joined #ruby
[05:16:24] cmoneylulz: has joined #ruby
[05:16:57] baweaver: has joined #ruby
[05:17:26] iateadonut: has joined #ruby
[05:17:44] mallu: has joined #ruby
[05:17:58] rabbitho1e: has joined #ruby
[05:19:12] Tarellel_: has joined #ruby
[05:19:34] asianMike: has joined #ruby
[05:20:27] vigintas: has joined #ruby
[05:21:40] skade: has joined #ruby
[05:22:04] mallu: I'm learning Ruby and can someone please tell me why this doesnt work?http://pastebin.com/gUm25Gc4
[05:22:05] ruboto: mallu, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/689871c86da58f3c71f1
[05:22:05] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[05:23:13] mallu: https://gist.github.com/anonymous/689871c86da58f3c71f1 Trying to return the elements that are present exactly once in the array.
[05:23:14] al2o3-cr: mallu: just do [Array]#uniq
[05:23:44] mallu: al2o3-cr: I don't wat 2 and 3 to appear
[05:24:09] al2o3-cr: mallu: How do you mean?
[05:24:40] mallu: Given [1,2,2,3,3,4,5], the method should return [1,4,5]
[05:24:59] al2o3-cr: >> [1,2,2,3,3,4,5].uniq
[05:25:00] ruboto: al2o3-cr # => [1, 2, 3, 4, 5] (https://eval.in/463410)
[05:25:38] al2o3-cr: >> [1,2,2,3,3,4,5].values_at(0,5,-1)
[05:25:39] ruboto: al2o3-cr # => [1, 4, 5] (https://eval.in/463411)
[05:26:10] al2o3-cr: mallu: But that's prolly not what you want
[05:26:28] localredhead: has joined #ruby
[05:26:35] mallu: no thats not what I want...
[05:26:38] baweaver: has joined #ruby
[05:26:56] al2o3-cr: mallu: explain more
[05:27:03] Rinzlit: has joined #ruby
[05:27:04] mallu: the method should work for any given array
[05:27:32] al2o3-cr: mallu: Well, that depends on alot of factors
[05:28:13] al2o3-cr: mallu: size of the array, datatype etc
[05:28:22] s2013: has joined #ruby
[05:29:18] tigarcia: has joined #ruby
[05:29:33] mallu: for example the method should return correct arrays for non_duplicated_values([1,1,5,7,7]) and non_duplicated_values([2,3,6,6])
[05:30:15] al2o3-cr: mallu: Can you show you code?
[05:30:35] mallu: al2o3-cr: https://gist.github.com/anonymous/689871c86da58f3c71f1
[05:33:13] moeabdol: has joined #ruby
[05:33:19] al2o3-cr: mallu: and what should be the return value?
[05:33:57] mallu: my code is returning an empty array
[05:34:16] al2o3-cr: mallu: give me sec
[05:35:00] Tarellel: has joined #ruby
[05:35:14] Ropeney: mallu, dont you want > 1?
[05:35:34] riotjones: has joined #ruby
[05:36:11] Ropeney: nvm didnt read above
[05:36:13] mallu: Ropeney: Actually I wanted <= 1
[05:36:17] mallu: thank you
[05:36:21] mallu: that worked
[05:37:08] mallu: BTW if you care this would also work... just in case if you are curious def non_duplicated_values(values) values.find_all { |x| values.count(x) == 1 } end
[05:37:09] Helheim: has joined #ruby
[05:37:52] blackmesa: has joined #ruby
[05:38:13] Axsuul: has joined #ruby
[05:39:04] Axsuul: has joined #ruby
[05:39:17] haraoka: has joined #ruby
[05:39:55] sanjayu: has joined #ruby
[05:40:58] nopolitica: has joined #ruby
[05:41:51] al2o3-cr: mallu: there's a totally better way than this but, you know
[05:41:59] al2o3-cr: >> [1,2,2,3,3,4,5].chunk(&:itself).select { |x, y| y.size == 1 }.flatten(2).uniq
[05:42:00] ruboto: al2o3-cr # => [1, 4, 5] (https://eval.in/463437)
[05:42:24] cacam9621: has joined #ruby
[05:42:25] mallu: ok thanks
[05:42:43] purplexed-: has joined #ruby
[05:43:18] al2o3-cr: o? cacam9621
[05:43:21] bryanray: has joined #ruby
[05:43:30] benlieb: has joined #ruby
[05:44:08] d34th4ck3r: has joined #ruby
[05:46:30] al2o3-cr: cacam9621: How may we help you?
[05:46:58] Musashi007: has joined #ruby
[05:49:44] nateberkopec: has joined #ruby
[05:51:46] voltagex: has left #ruby: ("WeeChat 1.3")
[05:52:44] mistermocha: has joined #ruby
[05:54:17] zenguy_pc: has joined #ruby
[05:55:17] Axsuul: has joined #ruby
[05:56:13] mleung: has joined #ruby
[06:00:12] tigarcia: has joined #ruby
[06:01:38] roxtrongo: has joined #ruby
[06:02:01] Oatmeal: has joined #ruby
[06:02:26] mistermocha: has joined #ruby
[06:03:47] haxrbyte: has joined #ruby
[06:04:32] htmldrum: has joined #ruby
[06:05:43] haxrbyte_: has joined #ruby
[06:06:21] favadi: has joined #ruby
[06:07:35] infamos: has joined #ruby
[06:09:32] dionysus69: has joined #ruby
[06:11:09] hxegon: has joined #ruby
[06:12:15] al2o3-cr: has joined #ruby
[06:12:39] tigarcia: has joined #ruby
[06:12:50] bruno-: has joined #ruby
[06:13:41] NeverTired: has joined #ruby
[06:13:50] krz: has joined #ruby
[06:15:40] tkuchiki: has joined #ruby
[06:15:59] c0dedead: has joined #ruby
[06:16:18] drizzle: has joined #ruby
[06:18:48] c0dedead: I tried asking this in #rubyonrails but did not get a response. How do I combine an ActiveRecord_Relation and an ActiveRecord_AssociationRelation so that I end up with a single relation which holds all of data from both relations?
[06:20:03] neanderslob: has joined #ruby
[06:20:13] newmanships: has joined #ruby
[06:21:16] BSab: has joined #ruby
[06:22:41] chibs: has joined #ruby
[06:25:23] haxrbyte: has joined #ruby
[06:25:37] last_staff: has joined #ruby
[06:27:20] moeabdol: has joined #ruby
[06:28:29] tenderlo_: has joined #ruby
[06:28:29] mndoci: has joined #ruby
[06:32:22] User458764: has joined #ruby
[06:35:32] dopamean_: has joined #ruby
[06:35:35] ruurd: has joined #ruby
[06:36:22] riotjones: has joined #ruby
[06:36:46] juanpablo__: has joined #ruby
[06:37:38] yardenbar: has joined #ruby
[06:38:39] blackmesa: has joined #ruby
[06:38:42] tagrudev: has joined #ruby
[06:38:52] dhjondoh: has joined #ruby
[06:39:44] hxegon_: has joined #ruby
[06:41:22] porfa: has joined #ruby
[06:43:53] moeabdol: has joined #ruby
[06:44:13] agit0: has joined #ruby
[06:45:23] Musashi007: has joined #ruby
[06:47:51] trosborn: has joined #ruby
[06:48:38] swgillespie: has joined #ruby
[06:50:29] nateberkopec: has joined #ruby
[06:50:52] nopolitica: has joined #ruby
[06:56:56] kiddorails: has joined #ruby
[06:58:48] dhjondoh: has joined #ruby
[06:59:33] Pupp3tm4st3r: has joined #ruby
[07:00:19] genpaku: has joined #ruby
[07:00:44] Pupp3tm4_: has joined #ruby
[07:01:20] infamos: has joined #ruby
[07:01:26] abucha: has joined #ruby
[07:02:20] skade: has joined #ruby
[07:04:13] CloCkWeRX: has joined #ruby
[07:05:29] Rollabunna: has joined #ruby
[07:08:16] baweaver: has joined #ruby
[07:08:33] vigintas: has joined #ruby
[07:08:34] acke: has joined #ruby
[07:12:15] swgillespie: has joined #ruby
[07:12:56] User458764: has joined #ruby
[07:13:18] beast: has joined #ruby
[07:17:42] simplyianm: has joined #ruby
[07:18:41] GeissT: has joined #ruby
[07:19:44] djbkd_: has joined #ruby
[07:20:40] lsmola: has joined #ruby
[07:22:43] jas02: has joined #ruby
[07:23:44] predator117: has joined #ruby
[07:24:52] rabbithole: has joined #ruby
[07:26:00] al2o3-cr: has joined #ruby
[07:26:01] GeissT_: has joined #ruby
[07:28:04] joonty: has joined #ruby
[07:28:22] c0dedead: has joined #ruby
[07:30:11] tvw: has joined #ruby
[07:30:26] karapetyan: has joined #ruby
[07:30:31] charliesome: has joined #ruby
[07:35:36] firstdayonthejob: has joined #ruby
[07:37:13] riotjones: has joined #ruby
[07:39:19] blackmesa: has joined #ruby
[07:39:35] yeticry: has joined #ruby
[07:39:53] DoubleMalt: has joined #ruby
[07:43:32] porfa: has joined #ruby
[07:44:41] codecop: has joined #ruby
[07:45:09] GeissT: has joined #ruby
[07:46:30] bricker: has joined #ruby
[07:47:16] ruurd: has joined #ruby
[07:48:33] davedev24: has joined #ruby
[07:51:16] nateberkopec: has joined #ruby
[07:52:42] colegatron: has joined #ruby
[07:54:28] Spami: has joined #ruby
[07:54:42] zenguy_pc: has joined #ruby
[08:01:33] segmond: has joined #ruby
[08:02:06] futilegames: has joined #ruby
[08:02:40] TomyWork: has joined #ruby
[08:03:16] roxtrongo: has joined #ruby
[08:04:35] neanderslob: has joined #ruby
[08:09:16] baweaver: has joined #ruby
[08:10:29] ibouvousaime: has joined #ruby
[08:15:49] terlar: has joined #ruby
[08:16:33] devoldmx: has joined #ruby
[08:16:37] krzkrz: has joined #ruby
[08:16:58] riffraff: has joined #ruby
[08:20:05] rattatmatt: has joined #ruby
[08:20:59] davedev24: has joined #ruby
[08:22:20] d34th4ck3r: has joined #ruby
[08:22:40] Polysics: has joined #ruby
[08:24:06] ibouvousaime: has joined #ruby
[08:25:06] blaxter: has joined #ruby
[08:25:31] juanpablo__: has joined #ruby
[08:25:56] timonv: has joined #ruby
[08:26:24] nopolitica: has joined #ruby
[08:29:01] solars: has joined #ruby
[08:29:36] SCHAAP137: has joined #ruby
[08:29:51] Pupeno: has joined #ruby
[08:30:54] mgorbach: has joined #ruby
[08:31:16] kalusn: has joined #ruby
[08:31:47] rgtk: has joined #ruby
[08:31:55] troulouliou_div2: has joined #ruby
[08:32:22] charliesome: has joined #ruby
[08:33:07] bmalum: has joined #ruby
[08:33:12] ruurd: has joined #ruby
[08:34:13] nettoweb: has joined #ruby
[08:34:22] lipoqil: has joined #ruby
[08:38:00] riotjones: has joined #ruby
[08:40:14] blackmesa: has joined #ruby
[08:41:21] vigintas: has joined #ruby
[08:42:23] sebstrax: has joined #ruby
[08:43:05] shredding: has joined #ruby
[08:46:16] Guest10035: has joined #ruby
[08:47:52] tomaz_b: has joined #ruby
[08:48:07] neanderslob: has joined #ruby
[08:48:55] darkf_: has joined #ruby
[08:49:17] bruno-: has joined #ruby
[08:49:23] riffraff_: has joined #ruby
[08:49:46] tomaz_b: hi... i have one newbie question and would really appreciate some help. i need so solve something with ruby. can someone suggest/direct/show me link/tutorial/something that would show me how to sign XML programmably with certficate.
[08:50:16] tomaz_b: i found some (quite old) gems.
[08:50:28] tomaz_b: what would you use today?
[08:51:14] kimegede: has joined #ruby
[08:51:20] roshanavand: has joined #ruby
[08:51:34] an0ma1y: has joined #ruby
[08:51:59] nateberkopec: has joined #ruby
[08:52:36] roshanav_: has joined #ruby
[08:53:05] aufi: has joined #ruby
[08:53:17] qiukun: has joined #ruby
[08:54:58] yfeldblum: has joined #ruby
[08:55:06] shevy: hey undeadra
[08:55:07] camilasan: has joined #ruby
[08:55:26] senayar: has joined #ruby
[08:56:32] karapetyan: has joined #ruby
[08:56:52] relix: has joined #ruby
[08:58:07] TheHodge: has joined #ruby
[08:59:05] krzkrz: has joined #ruby
[08:59:15] platzhirsch: has joined #ruby
[09:00:08] mikecmpbll: has joined #ruby
[09:00:34] karapetyan: has joined #ruby
[09:01:33] blueOxigen: has left #ruby: ()
[09:02:18] startupality: has joined #ruby
[09:02:32] Caius: has joined #ruby
[09:02:32] trajing: has joined #ruby
[09:02:32] atom3: has joined #ruby
[09:02:37] pusewicz: has joined #ruby
[09:02:46] Caius: has joined #ruby
[09:03:15] marr: has joined #ruby
[09:03:45] qiukun: has joined #ruby
[09:04:18] karapetyan: has joined #ruby
[09:04:38] purplexed-: has joined #ruby
[09:04:38] purplexed-: has joined #ruby
[09:06:25] Rollabunna: has joined #ruby
[09:08:46] musashi: has joined #ruby
[09:09:20] musashi: I'm not sure this is the best place for this but can I ask you guys how I would write a regex that would match with "o/" and not "\o/"
[09:10:12] baweaver: has joined #ruby
[09:10:31] adac: has joined #ruby
[09:10:45] tobiasvl: musashi: negative lookbehind
[09:12:36] tobiasvl: musashi: you can use something called a "negative lookbehind" to achieve that
[09:12:44] tobiasvl: '\o/'.match(/(?<!\\)o\//)
[09:12:46] tobiasvl: >> '\o/'.match(/(?<!\\)o\//)
[09:12:47] ruboto: tobiasvl # => nil (https://eval.in/463565)
[09:12:54] tobiasvl: >> 'o/'.match(/(?<!\\)o\//)
[09:12:55] ruboto: tobiasvl # => #<MatchData "o/"> (https://eval.in/463566)
[09:13:20] blaxter: has joined #ruby
[09:13:34] tobiasvl: the (?<!\\) is the negative lookbehind group
[09:13:43] xfbs: has joined #ruby
[09:13:44] kashyap: has left #ruby: ()
[09:14:04] musashi: searching. thank you
[09:14:26] rgtk: has joined #ruby
[09:14:42] tomphp: has joined #ruby
[09:19:49] tulak: has joined #ruby
[09:20:04] qiukun: has joined #ruby
[09:20:27] Stan: has joined #ruby
[09:20:42] agit0: has joined #ruby
[09:20:58] tulak_: has joined #ruby
[09:22:10] nfk|laptop: has joined #ruby
[09:22:54] bubuntu: has joined #ruby
[09:23:06] chibs: has joined #ruby
[09:24:54] abucha_: has joined #ruby
[09:25:59] Peg-leg: has joined #ruby
[09:26:39] teclator: has joined #ruby
[09:27:49] ta: has joined #ruby
[09:27:59] voker57: has joined #ruby
[09:28:24] rabbithole: has joined #ruby
[09:28:37] bnizzle: has joined #ruby
[09:29:59] astrobun_: has joined #ruby
[09:31:39] lukaszes: has joined #ruby
[09:31:53] roshanavand: has joined #ruby
[09:32:06] charliesome: has joined #ruby
[09:33:21] aps: running "bundle" command gives me following error. What could be wrong here?
[09:33:22] aps: <internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)
[09:34:38] adaedra: do you have requires in your Gemfile?
[09:35:17] bubuntu: has joined #ruby
[09:35:20] aps: adaedra: this is happening even when there's no gemfile
[09:36:18] adaedra: ah. what's your OS?
[09:36:20] nopolitica: has joined #ruby
[09:36:25] diegobiavati: has joined #ruby
[09:36:40] aps: adaedra: Amazon Linux (CentOS)
[09:36:50] jgt1: has joined #ruby
[09:37:01] adaedra: CentOS... what ruby version?
[09:37:43] tvw: has joined #ruby
[09:38:15] aps: adaedra: 2.2.2 (installed via ruby-build)
[09:38:48] riotjones: has joined #ruby
[09:39:25] jgt1: has joined #ruby
[09:40:47] arup_r: has joined #ruby
[09:41:00] aps: adaedra: please suggest me something for this - "What is the best way to install a particular ruby version system-wide?"
[09:41:00] blackmesa: has joined #ruby
[09:41:39] aps: catch is: this is a CI agent machine, it can't choose env via shell. It needs binaries in path
[09:41:42] lukaszes: has joined #ruby
[09:42:28] adaedra: best is suggestive.
[09:42:55] adaedra: You know what CentOS version your OS is based on?
[09:43:38] aps: adaedra: not really
[09:43:39] lukaszes: has joined #ruby
[09:43:41] adaedra: Because you have this for 6/7 which can be an alternative https://www.softwarecollections.org/en/scls/rhscl/rh-ruby22/
[09:44:05] aps: adaedra: thanks, I'll try this
[09:44:37] platzhirsch: has joined #ruby
[09:44:55] sdfgsdfg: has joined #ruby
[09:47:14] lxsameer: has joined #ruby
[09:48:14] porfa: has joined #ruby
[09:48:35] htmldrum: has joined #ruby
[09:50:20] bruno-: has joined #ruby
[09:50:41] adaedra: TIL bundler has a bitbucket: option.
[09:52:38] qiukun: has joined #ruby
[09:55:36] leafybas_: has joined #ruby
[09:56:36] ta: has joined #ruby
[09:56:36] leafybas_: has joined #ruby
[09:58:17] bweston92: has joined #ruby
[09:58:21] Xeago: has joined #ruby
[10:00:53] kramsee_: has joined #ruby
[10:02:37] Rollabunna: has joined #ruby
[10:05:35] lukaszes: has joined #ruby
[10:05:56] blackmesa: has joined #ruby
[10:06:39] astrobun_: has joined #ruby
[10:06:53] rdark: has joined #ruby
[10:08:08] bruno-_: has joined #ruby
[10:09:06] adaedra: I don't see what you mean.
[10:09:24] nkts: has joined #ruby
[10:09:24] apeiros: but that's so painfully obvious
[10:11:02] Balllkenende: has joined #ruby
[10:13:14] bruno-_: has joined #ruby
[10:14:05] nfk|laptop: has joined #ruby
[10:14:15] juanpablo__: has joined #ruby
[10:16:02] agit0: has joined #ruby
[10:16:08] curses: has joined #ruby
[10:17:18] devoldmx: has joined #ruby
[10:17:34] gregf_: has joined #ruby
[10:18:02] rodfersou: has joined #ruby
[10:21:16] sonOfRa: has joined #ruby
[10:21:22] krzkrz: has joined #ruby
[10:21:28] DEA7TH: has joined #ruby
[10:22:42] suchness: has joined #ruby
[10:22:59] CalydOn: has joined #ruby
[10:25:05] sgambino: has joined #ruby
[10:25:35] nateberkopec: has joined #ruby
[10:25:58] chthon: has joined #ruby
[10:26:24] jgt1: has joined #ruby
[10:27:56] ruby-lang410: has joined #ruby
[10:28:35] ibouvousaime: has joined #ruby
[10:29:21] ruby-lang410: http://pastebin.com/rvicQPNA ........ This code is accepting the test string ... not sure why :(
[10:29:21] ruboto: ruby-lang410, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/555775dd148477baa1d9
[10:29:21] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[10:31:57] ruby-lang410: https://gist.github.com/555775dd148477baa1d9 ........ This code is accepting the test string ... not sure why :(
[10:32:20] roshanavand: has joined #ruby
[10:32:55] roshanavand: has joined #ruby
[10:33:20] SenpaiSilver: has joined #ruby
[10:35:38] roshanavand: has joined #ruby
[10:36:31] ruby-lang410: https://gist.github.com/555775dd148477baa1d9 ........ This code is accepting the test string ... not sure why :(
[10:37:14] ldnunes: has joined #ruby
[10:39:27] canton7: ruby-lang410, you're being caught out by too little escaping and too much interpolation
[10:39:33] izzol: I have an API in sinatra, and I need to have a fast nice fronted to it. What is the best for this? :-)
[10:39:36] riotjones: has joined #ruby
[10:39:45] canton7: ruby-lang410, example... Test_String.scan(/...\....\....\..../) works fine
[10:40:14] canton7: ruby-lang410, similarly, Regex_Pattern = '...\....\....\....' and Regex_Pattern = "...\\....\\....\\...." are fine
[10:42:05] ruby-lang410: canton7: Thank you verymuch ... I just changed " " to ' ' and it worked?? ... However I am still confused why :/
[10:42:59] ruby-lang410: canton7: Any suggestions on what to google to know more about this
[10:43:15] canton7: ruby-lang410, within " ", \ acts as an escape character. so ruby sees "\.", and goes "ok, he's escaping a period - but that's not an escape sequence, so I'll just insert a period"
[10:43:27] canton7: ... so you lose the backslash before you get near the #scan method call
[10:43:27] DoubleMalt: has joined #ruby
[10:44:13] canton7: within ' ' there is no escaping, so this doesn't happen. likewise "\\." means ruby goes "ok, he's escaping.. a backslash. which results in a backslash. next, there's a period..."
[10:44:54] ruby-lang410: canton7: OMG ... this so valuable knowledge!! ... Thank you so much !! ... May god bless you :)
[10:45:50] roshanavand: has joined #ruby
[10:48:29] darthdeus: has left #ruby: ()
[10:48:48] otiasogirdor: has joined #ruby
[10:48:49] kramsee: has joined #ruby
[10:49:17] RegulationD: has joined #ruby
[10:49:38] blackmesa: has joined #ruby
[10:51:15] Gooddaytoyousir: has joined #ruby
[10:53:02] matp: has joined #ruby
[10:53:59] Xeago: has joined #ruby
[10:55:57] cek: Hi. Wondering why native exts are being put in extensions/x86_64-linux/2.1.0/gem/ext.so ? Or is that a temp compile dir?
[10:56:32] krzkrz: has joined #ruby
[10:56:40] cek: i see it's being loaded from gems/$gem/lib/ext.so and not from that location
[11:01:05] sepp2k: has joined #ruby
[11:01:55] dhjondoh: has joined #ruby
[11:03:05] porfa: has joined #ruby
[11:03:28] ErhardtMundt: has joined #ruby
[11:03:43] marr: has joined #ruby
[11:04:10] but3k4: has joined #ruby
[11:04:51] ErhardtMundt: I have a problem with ruby
[11:05:02] ErhardtMundt: well, ruby on rails, precisely
[11:05:18] ErhardtMundt: the solution might be trivial
[11:05:32] ErhardtMundt: anyway, I pass a JSON to a rails controller
[11:05:51] ErhardtMundt: and I don't know why on Earth an array becomes an hash
[11:05:57] ErhardtMundt: with index as keys
[11:06:02] mr_blue: has joined #ruby
[11:06:04] ErhardtMundt: it's driving me crazy
[11:06:58] ErhardtMundt: is there anything I can do to tell the deserializer to behave as one would expect?
[11:07:18] adaedra: If it's rails, it's with #rubyonrails that you should see.
[11:07:24] sross07: has joined #ruby
[11:07:40] ErhardtMundt: thanks adaedra
[11:10:34] favadi: has joined #ruby
[11:11:16] stamina: has joined #ruby
[11:12:13] Brock: has joined #ruby
[11:12:31] lipoqil: has joined #ruby
[11:12:59] baweaver: has joined #ruby
[11:13:07] prestorium: has joined #ruby
[11:13:44] leafybas_: has joined #ruby
[11:14:38] AlexRussia: has joined #ruby
[11:15:49] giuseppesolinas: has joined #ruby
[11:16:00] giuseppesolinas_: has joined #ruby
[11:17:17] Moblin: has joined #ruby
[11:17:41] qiukun: has joined #ruby
[11:20:27] rickmasta: has joined #ruby
[11:22:45] giuseppesolinas_: has left #ruby: ("Leaving")
[11:24:19] chibs: has joined #ruby
[11:24:56] klingeldraht: has joined #ruby
[11:26:24] ErhardtMundt: has left #ruby: ()
[11:29:34] bluOxigen: has joined #ruby
[11:29:40] User458764: has joined #ruby
[11:30:40] elperdut_: has joined #ruby
[11:33:42] Gooddaytoyousir: has joined #ruby
[11:34:53] blueOxigen: has joined #ruby
[11:37:11] colorisco: has joined #ruby
[11:37:57] s00pcan: has joined #ruby
[11:40:00] karapetyan: has joined #ruby
[11:40:20] riotjones: has joined #ruby
[11:41:21] riotjones: has joined #ruby
[11:43:42] u3DyxaH_4aTap: has joined #ruby
[11:44:05] charliesome: has joined #ruby
[11:45:03] juanpablo__: has joined #ruby
[11:48:17] qiukun: has joined #ruby
[11:49:13] idefine: has joined #ruby
[11:49:45] krzkrz: has joined #ruby
[11:52:53] lubarch: has joined #ruby
[11:55:15] roshanavand: has joined #ruby
[11:56:55] juanpablo__: has joined #ruby
[12:01:36] bruno-: has joined #ruby
[12:01:49] Xeago: has joined #ruby
[12:02:57] jmonreal: has joined #ruby
[12:06:05] tulak: has joined #ruby
[12:06:46] dhjondoh: has joined #ruby
[12:08:48] porfa: has joined #ruby
[12:09:48] s00pcan: has joined #ruby
[12:13:54] WillAmes: has joined #ruby
[12:14:10] baweaver: has joined #ruby
[12:14:21] nateberkopec: has joined #ruby
[12:15:15] sdothum: has joined #ruby
[12:15:25] bmalum: has joined #ruby
[12:15:53] arup_r: has joined #ruby
[12:16:18] newbsduser: has joined #ruby
[12:16:27] newbsduser: hello, i want to generate raw http packets with ethernet header.. i want to inject these packets specific interface. for instance: eth3. how can i do that with ruby? if u advise me a tutorial or library name i ll be glad
[12:18:04] devoldmx: has joined #ruby
[12:18:17] mooru: has joined #ruby
[12:19:26] sluukkonen: has joined #ruby
[12:20:22] weckl: has joined #ruby
[12:22:44] solars: has joined #ruby
[12:23:11] karapetyan: has joined #ruby
[12:23:30] CVirus: has joined #ruby
[12:23:31] ta: has joined #ruby
[12:23:40] CVirus: has left #ruby: ("Leaving")
[12:24:05] ta: has joined #ruby
[12:26:07] mikecmpb_: has joined #ruby
[12:26:47] favadi: has joined #ruby
[12:27:15] Mon_Ouie: has joined #ruby
[12:28:53] avril14th: has joined #ruby
[12:30:38] solocshaw: has joined #ruby
[12:31:04] roshanavand: has joined #ruby
[12:33:27] jgt1: has joined #ruby
[12:37:19] stamina: has joined #ruby
[12:37:38] BSab: has joined #ruby
[12:38:12] gigetoo: has joined #ruby
[12:39:09] elperdut_: has joined #ruby
[12:40:13] donske: has joined #ruby
[12:40:25] nateberkopec: has joined #ruby
[12:40:33] blackmesa: has joined #ruby
[12:42:08] riotjones: has joined #ruby
[12:43:11] build22_: has joined #ruby
[12:43:46] moeabdol: has joined #ruby
[12:43:51] duckpuppy: has joined #ruby
[12:44:19] solocshaw: has joined #ruby
[12:46:26] Xeago: has joined #ruby
[12:48:55] Aswebb_: has joined #ruby
[12:49:00] karapetyan: has joined #ruby
[12:49:49] Icey: has joined #ruby
[12:49:52] roshanavand: has joined #ruby
[12:51:00] wsewolod: has joined #ruby
[12:51:43] Icey: has joined #ruby
[12:52:43] karapetyan: has joined #ruby
[12:53:54] Balllkenende: has joined #ruby
[12:54:23] karapetyan: has joined #ruby
[12:54:27] bruno-: has joined #ruby
[12:56:42] lukaszes: has joined #ruby
[12:56:50] tkuchiki: has joined #ruby
[12:57:13] tulak: has joined #ruby
[12:59:25] subscope: has joined #ruby
[13:01:51] codecop: has joined #ruby
[13:01:51] tkuchiki: has joined #ruby
[13:02:03] rob_: newbsduser: look at socket library
[13:03:58] prestorium: has joined #ruby
[13:04:17] roshanavand: has joined #ruby
[13:05:50] synthroid: has joined #ruby
[13:06:19] rabbithole: has joined #ruby
[13:07:27] astrobun_: has joined #ruby
[13:08:03] yorickpeterse: Socket doesn't let you inject packets into any interfaces
[13:11:13] shredding: has joined #ruby
[13:12:16] shevy: it sounds non-trivial what newbsduser wants to do
[13:12:23] gigetoo: has joined #ruby
[13:12:48] favadi: has joined #ruby
[13:15:01] dANO-: has joined #ruby
[13:15:33] Balllkenende: has joined #ruby
[13:19:03] adaedra: that's low level (and requires root under Linux, afaik)
[13:23:19] atomical: has joined #ruby
[13:23:57] ghoti: has joined #ruby
[13:24:13] Icey: has joined #ruby
[13:24:39] sgambino: has joined #ruby
[13:24:42] Moblin: Is there a ruby method that inherently puts a number to a string with commas?
[13:24:58] Icey: has joined #ruby
[13:24:59] chibs: has joined #ruby
[13:25:48] momomomomo: has joined #ruby
[13:25:49] treehug88: has joined #ruby
[13:26:11] apeiros: Ebok: asking a question and then changing nick ain't smart.
[13:26:23] joonty: has joined #ruby
[13:26:37] Ebok: I only noticed it was the backup nick after asking
[13:27:03] apeiros: I don't really know what you're asking for either, though :)
[13:27:05] ghr: Ebok you could look at using the one from Rails http://api.rubyonrails.org/v3.2.22/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_delimiter
[13:27:07] jdawgaz: has joined #ruby
[13:27:44] Ebok: ghr that makes something I read yesterday make so much more sense.
[13:27:49] Jardayn: has joined #ruby
[13:30:24] gusTester: has joined #ruby
[13:30:26] ghr: awesome :)
[13:33:18] skweek: has joined #ruby
[13:33:27] antgel: has joined #ruby
[13:34:11] nkts_: has joined #ruby
[13:36:26] ruboto: I don't know anything about commify
[13:36:34] apeiros: !fact add commify https://gist.github.com/apeiros/9d3c8b1fcff9d1769569
[13:36:35] ruboto: apeiros, I will remember that commify is https://gist.github.com/apeiros/9d3c8b1fcff9d1769569
[13:36:56] apeiros: Ebok: ^ might also be useful
[13:39:04] shevy: 363665.localize # => "363,665"
[13:39:24] freerobby: has joined #ruby
[13:39:58] pl1ght: has joined #ruby
[13:40:15] mary5030: has joined #ruby
[13:41:12] apeiros: updated to include `places` arg: -1234.56.localize(thousands: "'", decimal: ",", places: 4) # => "-1'234,5600"
[13:41:14] karapetyan: has joined #ruby
[13:41:22] apeiros: better naming of arguments welcome :)
[13:42:33] Balllkenende: has joined #ruby
[13:42:39] juanpablo__: has joined #ruby
[13:42:47] _stu_: has joined #ruby
[13:42:55] riotjones: has joined #ruby
[13:43:22] Ebok: that regex ... take the first number, looking forward at three numbers, and put a "," there. I like it ^^
[13:44:06] mary5030: has joined #ruby
[13:45:45] apeiros: that one's actually stolen. iirc from zenspider
[13:45:52] gusTester: has left #ruby: ()
[13:46:00] solocshaw1: has joined #ruby
[13:46:20] Ebok: Im mostly happy to be able to read that regex tbh. I'm just starting to come to terms with lookforward lookback
[13:46:31] _blizzy_: has joined #ruby
[13:46:48] apeiros: lookaround is the umbrella term ;-)
[13:46:51] roshanavand: has joined #ruby
[13:47:33] bryanray: has joined #ruby
[13:47:45] mikecmpb_: if i have a module with some behaviour, is there a good pattern for being able to overwrite some default values that the module uses from the class which includes it?
[13:48:01] Xeago: has joined #ruby
[13:48:18] mikecmpb_: i've extracted some password reset code out into a module and i want to have a default password expiry but allow that to be changed by the class which includes the module, not sure what approach to take.
[13:48:30] apeiros: mikecmpb_: define them as methods
[13:48:37] apeiros: including class can then just define those methods itself
[13:48:46] jhass: constant resolution should win as well
[13:49:05] karapetyan: has joined #ruby
[13:49:16] apeiros: I usually prefer methods as they allow logic too. but granted, not always actually.
[13:49:18] mikecmpbll: jhass: how could that work?
[13:49:34] abucha: has joined #ruby
[13:49:59] jhass: >> module Foo; X = 1; def x; X; end; end; class A; X = 2; include Foo; end; class B; include Foo; end; [A.new.x, B.new.x]
[13:50:00] ruboto: jhass # => [1, 1] (https://eval.in/463711)
[13:50:11] jhass: >> module Foo; X = 1; def x; self.class::X; end; end; class A; X = 2; include Foo; end; class B; include Foo; end; [A.new.x, B.new.x]
[13:50:12] ruboto: jhass # => [2, 1] (https://eval.in/463712)
[13:50:13] Pupp3tm4st3r: has joined #ruby
[13:50:21] erbesharat: has joined #ruby
[13:50:22] jhass: weird, I thought the first case works
[13:50:29] apeiros: >> module Adder; def value; base + summand; end; def base; 0; end; def summand: 10; end; end; class FutureYear; include Adder; def base; Time.now.year; end; end; FutureYear.new.value
[13:50:30] ruboto: apeiros # => /tmp/execpad-dbeb92f3a286/source-dbeb92f3a286:2: syntax error, unexpected ':', expecting ';' or '\n' ...check link for more (https://eval.in/463713)
[13:50:31] dstarh: has joined #ruby
[13:50:37] markfletcher: has joined #ruby
[13:50:41] apeiros: with constant you need self::
[13:50:44] apeiros: or self.class::
[13:51:00] apeiros: >> module Adder; def value; base + summand; end; def base; 0; end; def summand; 10; end; end; class FutureYear; include Adder; def base; Time.now.year; end; end; FutureYear.new.value
[13:51:01] ruboto: apeiros # => 2025 (https://eval.in/463714)
[13:51:08] diegoaguilar: has joined #ruby
[13:51:12] apeiros: there. accidentally a :
[13:51:35] apeiros: meh, /me late. jhass already corrected himself :)
[13:52:18] Fire-Dragon-DoL: has joined #ruby
[13:54:04] diegoaguilar: has joined #ruby
[13:55:21] mikecmpbll: apeiros, jhass: excellent, thank you both!
[13:55:42] mikecmpbll: i thought i'd get some redefining constant error if i did that, for some reason.
[13:55:58] jdawgaz: has joined #ruby
[13:56:01] jhass: nah, those are really two separate constants in their own namespaces
[13:56:11] MuffinPimp: has joined #ruby
[13:56:17] jhass: it's just resolution that makes it work, A::X winning over Foo::X
[13:56:25] mikecmpbll: gotcha ????????
[13:57:54] colegatron: has joined #ruby
[13:58:18] dreinull75: has left #ruby: ("undefined")
[13:58:38] dionysus69: has joined #ruby
[13:58:56] al2o3-cr: has joined #ruby
[14:00:05] juanpablo__: has joined #ruby
[14:00:12] JDiPierro: has joined #ruby
[14:00:41] roshanavand: has joined #ruby
[14:00:43] Ebok: aperios: actually, while I can read it, I'm not entirely certain of the implications of this part of that gsub regex: +$, does that actually make the regex start from right to left? "+ end of line"
[14:00:52] Guest53: has joined #ruby
[14:01:13] solars: has joined #ruby
[14:02:20] jhass: Ebok: + is a quantifier, it affects the expression before it, not after
[14:02:41] jhass: .+ is any character (.), one or more times (+)
[14:02:56] zacstewart: has joined #ruby
[14:03:16] jhass: ah okay, shold've looked at the context
[14:03:34] jhass: Ebok: in this case we already have the quantifier, {3}
[14:03:41] jhass: that's three times
[14:03:49] jhass: \d is any number, so three digits
[14:04:09] apeiros: \d{3}+ is shorthand for (?:\d{3})+, so a multiple of 3
[14:04:12] Ebok: I see. so its {3}+ together
[14:04:44] jhass: wait, it's not the no backtrace thing, what was it called again?
[14:04:50] Ebok: I guess I just need to look up and read more about how 'end of line" functions
[14:05:01] apeiros: jhass: greediness?
[14:05:18] jhass: possessive
[14:05:36] apeiros: yeah, * is possessive, ? is lazy (iirc)
[14:05:36] Ebok: possessive sounds familiar
[14:05:43] jhass: non-greedy still backtraces
[14:06:07] apeiros: ah, *+ is possessive
[14:06:11] jhass: apeiros: it's a lookahead, so I have my doubts about your interpretation
[14:06:23] jhass: can't have dynamic width things there
[14:06:40] apeiros: yes, I think {m} is a special case
[14:06:45] constantinexvi: has joined #ruby
[14:06:48] apeiros: in other cases you'd have to write the (?:) out iirc
[14:06:54] apeiros: as said, that part is stolen :D
[14:06:58] jhass: {m} is a fixed width, yeah
[14:07:02] rickmasta: has joined #ruby
[14:07:18] sankaber: has joined #ruby
[14:07:18] jhass: but "\d{3}+ is shorthand for (?:\d{3})+" would make it dynamic width
[14:07:34] jhass: I think it's possessive rather, no?
[14:07:49] apeiros: was there a diff between atomic group and possessive quant?
[14:08:27] sankaber: has joined #ruby
[14:08:41] jhass: atomic group is the superset, possessive quantifiers are shorthands to certain variants
[14:08:53] agit0: has joined #ruby
[14:08:58] cdg: has joined #ruby
[14:09:07] apeiros: if it was just possessive, it wouldn't work as far as I understand. because it'd match the quantified pattern only once. i.e. {3} is the quantifier then. + is only modifying that to be possessive.
[14:09:33] jhass: "You can make a quantifier possessive by placing an extra + after it. * is greedy, *? is lazy, and *+ is possessive. ++, ?+ and {n,m}+ are all possessive as well."
[14:09:38] jhass: http://www.regular-expressions.info/possessive.html
[14:09:48] apeiros: I'm there too
[14:10:09] jhass: it might be just ignored in a lookahead
[14:10:17] apeiros: but in all those cases, the first part is what quantifies. the last char is only changing greediness between greedy, lazy and possessive
[14:11:16] Ebok: That regex page looks like fun
[14:11:18] apeiros: currently wondering whether I can come up with a case which would clear things up :)
[14:11:22] InternetFriend: has joined #ruby
[14:11:24] Ebok: Imma read it all the way through tonight
[14:11:37] jhass: well, do one million?
[14:11:40] apeiros: but actually I think I should get back to work. already squandered quite a bit :D
[14:12:11] kobain: has joined #ruby
[14:12:15] apeiros: -1234567.89.localize(thousands: "'", decimal: ",", places: 4) # => "-1'234'567,8900"
[14:12:19] apeiros: works fine with 1 million
[14:12:51] norc: has joined #ruby
[14:13:37] jhass: Regexp needs an AST printer :P
[14:13:40] Ebok: Basically the reason I asked was I was just looking at /(\d)(?=\d{3}+$)/ on Rubular, and noticed that it grabbed 45 0 00 0 000, in 450million. the last instance of 0 puts the comma after it, but then its only two 0 before the next injection, unless the comma counted. So I wasnt clear what was actually happening
[14:13:47] maikowblue: has joined #ruby
[14:14:07] karapetyan: has joined #ruby
[14:14:21] sandals: has joined #ruby
[14:14:37] Ebok: Going from right to left in this instance would be a cool trick >_>; if that was actaully happening
[14:14:50] Ebok: I mean I know the method is returning the values correctly
[14:15:14] Ebok: I suspect reading that tutorial will provide me some of the answers
[14:15:17] apeiros: jhass: yeah, that'd be really nice
[14:15:23] momomomomo: has joined #ruby
[14:15:45] umgrosscol: has joined #ruby
[14:17:27] adaedra: I had a site like that
[14:18:42] s00pcan: has joined #ruby
[14:18:46] devoldmx: has joined #ruby
[14:18:55] _blizzy_: some guy was arguing that ruby is unreadable. Im like how?
[14:18:58] ekinmur: has joined #ruby
[14:19:00] davedev24: has joined #ruby
[14:19:04] _blizzy_: it's one of the most readable languages I know of.
[14:19:14] adaedra: here it is https://www.debuggex.com/
[14:19:41] wprice: has joined #ruby
[14:20:12] apeiros: _blizzy_: ask Ox1DEA
[14:20:18] blue_deref: has joined #ruby
[14:20:25] apeiros: they've got some pretty unreadable ruby code to share :D
[14:20:45] apeiros: you can write unreadable code in almost any language
[14:21:12] apeiros: but yeah, IMO wrt common code readability, ruby is one of the most readable languages out there.
[14:21:13] blackmesa: has joined #ruby
[14:21:41] malconis: has joined #ruby
[14:22:46] jhass: it does take a bit to get used to, but then it's very readable
[14:22:51] malconis: has joined #ruby
[14:22:55] lukaszes: has joined #ruby
[14:23:07] jhass: I do remember my first impression of it being confusing too
[14:23:52] ESpiney: has joined #ruby
[14:24:16] jhass: adaedra: doesn't like our case unfortunately
[14:25:23] antgel: has joined #ruby
[14:25:48] chibs: has joined #ruby
[14:27:09] Arnvald: has joined #ruby
[14:27:53] bigmac: has joined #ruby
[14:29:10] abucha: has joined #ruby
[14:32:41] abucha_: has joined #ruby
[14:32:53] rbennacer: has joined #ruby
[14:33:01] Xeago: has joined #ruby
[14:33:01] mag42c: has joined #ruby
[14:33:06] diegoaguilar: has joined #ruby
[14:34:50] jhass: apeiros: I think it's a special case in oniguruma, similar to what Java does, expanding (?=\d{3}+$) to (?=\d{9}$|\d{6}$|\d{3}$) automatically, starting with 3**n <= remaining string length
[14:35:07] roshanavand: has joined #ruby
[14:35:09] jhass: and then iterating n down to 1
[14:35:37] apeiros: that's actually a pretty nice performance optimization
[14:36:04] favadi: has joined #ruby
[14:36:15] jhass: at least that's the only way I'm able to explain that expressions behavior to me
[14:37:10] qwertme: has joined #ruby
[14:37:11] tmtwd: has joined #ruby
[14:38:29] apeiros: I think {3} is not a quantifier in the classical sense
[14:38:34] apeiros: in that it is fixed
[14:38:45] apeiros: i.e. \d{3} is really just (?:\d\d\d)
[14:39:07] jhass: mh, no, it's \d{,m} actually
[14:39:19] jhass: well, m,m
[14:39:28] apeiros: \d{,m} is \d{0,m}
[14:39:42] jhass: yeah derped there for a sec, I meant {m,m}
[14:39:42] apeiros: and \d{3} is \d{3,3}, which is (?:\d\d\d)
[14:40:00] jhass: but your expansion would be an optimization over the general case
[14:40:02] rdark: has joined #ruby
[14:40:08] apeiros: hence I think \d{3}[+*?] is unrelated to greedy/possessive/lazy. \d{3}? would be "3 or none"
[14:40:21] apeiros: and not "lazily 3"
[14:40:32] JDiPierro: has joined #ruby
[14:40:43] apeiros: same with \d{3}*, it'd be "a multiple of 3, with factor starting at 0"
[14:41:00] Guest53: has joined #ruby
[14:41:04] tulak: has joined #ruby
[14:41:07] jhass: the Java behavior for \d{n,m}+ is take the max (m) and generate alternations of \d{m**i} with max(m**i) <= remaining string length
[14:41:44] apeiros: I'd bet that's also only true for n != m
[14:41:44] jhass: according to regular-expressions.info
[14:42:25] whippythellama: has joined #ruby
[14:42:31] jhass: and it's only doing that inside lookarounds, outside it's possessive
[14:42:35] bronson: has joined #ruby
[14:42:37] jhass: but lookarounds are already atomic
[14:43:01] adaedra: jhass: yeah, it would be even cooloer with a Ruby mode.
[14:43:36] freerobby: has joined #ruby
[14:43:56] riotjones: has joined #ruby
[14:44:41] cliffstah: has joined #ruby
[14:44:45] Rollabunna: has joined #ruby
[14:44:46] roshanavand: has joined #ruby
[14:44:52] scottymeuk: has joined #ruby
[14:45:04] euoia: has joined #ruby
[14:45:15] user083: has joined #ruby
[14:45:32] yqt: has joined #ruby
[14:45:40] DiCablo: has joined #ruby
[14:45:41] jhass: apeiros: http://www.regular-expressions.info/lookaround.html#limitbehind the paragraph starting with "Java ..."
[14:45:45] Fraeon: has joined #ruby
[14:45:47] raenk: has joined #ruby
[14:45:49] TTilus: has joined #ruby
[14:45:51] shawnacscott: has joined #ruby
[14:45:52] Peteykun: has joined #ruby
[14:45:56] julieeharshaw: has joined #ruby
[14:46:09] shadeslayer: has joined #ruby
[14:46:25] Flipez: has joined #ruby
[14:46:46] banister: has joined #ruby
[14:46:47] chrisarcand: has joined #ruby
[14:47:12] Dreamer3: has joined #ruby
[14:47:13] bluOxigen: has joined #ruby
[14:47:22] xnr: has joined #ruby
[14:47:32] ibouvousaime: has joined #ruby
[14:47:46] wlanboy: has joined #ruby
[14:47:47] abra0: has joined #ruby
[14:47:56] nopc0de: has joined #ruby
[14:47:59] brendan-: has joined #ruby
[14:48:23] diesel: has joined #ruby
[14:48:40] babblebre: has joined #ruby
[14:48:40] bruno-: has joined #ruby
[14:48:42] _aeris_: has joined #ruby
[14:48:46] acy: has joined #ruby
[14:48:49] ekem: has joined #ruby
[14:48:50] rippa: has joined #ruby
[14:48:53] Jackneill: has joined #ruby
[14:49:10] mleung: has joined #ruby
[14:49:38] RTG`: has joined #ruby
[14:49:40] zacstewart: has joined #ruby
[14:49:53] Morrolan: has joined #ruby
[14:50:05] cschneid: has joined #ruby
[14:50:09] nertzy: has joined #ruby
[14:50:38] minver: has joined #ruby
[14:51:10] theRoUS: has joined #ruby
[14:51:21] purplexed-: has left #ruby: ("Leaving")
[14:51:50] bartj3: has joined #ruby
[14:52:23] parus: has joined #ruby
[14:52:26] roshanavand: has joined #ruby
[14:52:36] atomical: has joined #ruby
[14:52:44] minver: Is it possible to raise formatted error? Same format as when using puts
[14:52:48] minver: http://pastie.org/10532068
[14:53:00] acy: has left #ruby: ("Leaving")
[14:53:51] griffindy: has joined #ruby
[14:54:09] apeiros: minver: you can create custom error classes and you can write custom rescue blocks
[14:54:33] apeiros: and ruby doesn't care what you put in the message string even with the core exception classes
[14:54:59] peitera: has joined #ruby
[14:54:59] apeiros: as for custom error classes: just inherit from StandardError (NOT from Exception!)
[14:55:16] Xeago: has joined #ruby
[14:55:25] spew: has joined #ruby
[14:55:27] shinnya: has joined #ruby
[14:55:45] CloCkWeRX: has joined #ruby
[14:57:16] p0wn3d__: has joined #ruby
[14:58:22] spleeze: has joined #ruby
[14:59:35] jgt1: has joined #ruby
[14:59:38] musou: has joined #ruby
[14:59:40] cwong_on_irc: has joined #ruby
[15:00:03] mary5030: has joined #ruby
[15:00:06] tkuchiki: has joined #ruby
[15:00:28] bruno-_: has joined #ruby
[15:01:02] minver: apeiros: Even if I have a custom error and override the message method raise() still seems to skip formatting. I want newlines and tabs in the error message
[15:04:05] RegulationD: has joined #ruby
[15:04:36] Xeago: has joined #ruby
[15:05:11] The_Phoenix: has joined #ruby
[15:05:16] minver: apeiros: nvm, thanks!
[15:07:19] polishdub: has joined #ruby
[15:07:23] shmilan: has joined #ruby
[15:08:14] kp666_: has joined #ruby
[15:08:18] abucha: has joined #ruby
[15:09:22] abucha_: has joined #ruby
[15:09:41] Xeago: has joined #ruby
[15:10:51] dhollinger: has joined #ruby
[15:11:25] jmonreal: has joined #ruby
[15:11:34] pdoherty: has joined #ruby
[15:12:11] elperdut: has joined #ruby
[15:12:15] rabbithole: has joined #ruby
[15:12:27] jmonreal: hey there folks. I am using optparse to parse the arguments of command line, but when I do not enter anything, the script does not show the help
[15:12:40] jmonreal: I was wondering what am I missing
[15:13:01] but3k4_: has joined #ruby
[15:13:25] Ebok: how do you ask a regex to look ahead for two conditions?
[15:13:29] to_json: has joined #ruby
[15:13:29] to_json: has joined #ruby
[15:13:39] elperdut: has joined #ruby
[15:13:45] Ebok: example find any letter followed by 'a' and 'b'
[15:13:53] rdark: has joined #ruby
[15:13:53] rdark: has joined #ruby
[15:14:34] Ebok: assume a and b could be anything
[15:14:47] momomomomo: has joined #ruby
[15:15:04] abucha: has joined #ruby
[15:16:35] rgtk: has joined #ruby
[15:16:49] infamos: has joined #ruby
[15:17:28] jmonreal: Ebok: you mean somehitn like DCab would match C
[15:17:33] jmonreal: or would match DC?
[15:17:50] n: has joined #ruby
[15:18:26] Ebok: I mean, lets say I had Aabc Dabc and I wanted to grab A D
[15:18:39] bluOxigen: has left #ruby: ()
[15:19:00] abucha: has joined #ruby
[15:19:35] jmonreal: Ebok: your regex would be /.*(\w{1})ab.*/
[15:19:38] Ebok: but a might be a number and b might be a series of letters. so like... A23pass...B67pass
[15:19:59] pandaant: has joined #ruby
[15:20:03] Ebok: I shouldve clarified in the same line, my bad
[15:20:22] jgt1: has joined #ruby
[15:20:24] goodcodeguy: has joined #ruby
[15:20:33] jmonreal: do you have an example Ebok
[15:20:44] Ebok: Alright, let me write one up.
[15:20:55] daivyk: has joined #ruby
[15:21:26] mordocai: has joined #ruby
[15:21:47] jmonreal: Ebok: do you know about Finite-state machine?
[15:21:54] giuseppesolinas: has joined #ruby
[15:22:10] havenwood: >> 'Aabc Dabc'.scan /.(?=ab)/
[15:22:11] ruboto: havenwood # => ["A", "D"] (https://eval.in/463751)
[15:22:13] axl_: has joined #ruby
[15:22:18] Ebok: A23W--ahasbaB45X needs to output A and B
[15:22:55] havenwood: Ebok: 23W is different than 45X. What's the rule?
[15:23:02] hxegon: has joined #ruby
[15:23:13] mercerist: has joined #ruby
[15:23:17] gregf_: >>"A23W--ahasbaB45X".scan(/(.)\d+[A-Z]+/)
[15:23:18] ruboto: gregf_ # => [["A"], ["B"]] (https://eval.in/463753)
[15:23:18] Ebok: the search considition in this case is /[A-Z](?=[0-9])/ >_>
[15:23:26] havenwood: Ebok: Any two digits followed by a capital letter, or a known list of options or?
[15:24:10] dopamean_: has joined #ruby
[15:24:18] gregf_: Ebok: if whats following A and B are dynamic, then God help you :|
[15:24:22] Ebok: gregf gave me what I needed
[15:24:29] Ebok: And yeah I know
[15:24:53] gregf_: Ebok: that was just a guess, havenwood has asked quite a valid question ;)
[15:25:19] step1step2_: has joined #ruby
[15:25:59] jmonreal: do you folks know how to tell optparse to validate the required fields?
[15:26:04] Ebok: havenwood, I dont have a specific need outside needing to be able to look ahead for multiple conditions, say, take X when its followed by anyY and Z
[15:26:10] Ebok: The answer was literally +
[15:26:58] Ebok: \d(?=[a-zA-Z]+\d) <== an example. match a number thats followed by letters and one more number
[15:27:00] freerobby: has joined #ruby
[15:27:07] solars: has joined #ruby
[15:27:39] Ebok: I'll be more clear when I ask questions in the future, sorry for the headache, thanks for the assist
[15:29:04] gregf_: >>[ /(?<foo>\d+\w+\d+)/ =~ "123foo456" ]
[15:29:05] ruboto: gregf_ # => [0] (https://eval.in/463758)
[15:29:08] freerobby1: has joined #ruby
[15:29:33] jwaldrip: has joined #ruby
[15:29:33] Ebok: faienough
[15:29:35] bryanray: has joined #ruby
[15:30:35] segfalt: has joined #ruby
[15:31:00] beauby: has joined #ruby
[15:32:11] hashpuppy: has joined #ruby
[15:32:18] millerti: has joined #ruby
[15:33:23] User458764: has joined #ruby
[15:33:35] dorei: has joined #ruby
[15:34:27] dnomyar: has joined #ruby
[15:34:29] step1step2__: has joined #ruby
[15:35:54] elperdut: has joined #ruby
[15:37:23] Pupp3tm4_: has joined #ruby
[15:37:34] Fire-Dragon-DoL: has joined #ruby
[15:37:46] tulak: has joined #ruby
[15:37:56] agit0: has joined #ruby
[15:40:46] dopamean_: has joined #ruby
[15:41:40] pu22l3r: has joined #ruby
[15:41:44] bricker: has joined #ruby
[15:41:55] but3k4: has joined #ruby
[15:42:15] karapetyan: has joined #ruby
[15:42:33] davedev24: has joined #ruby
[15:43:28] Marsupermammal: has joined #ruby
[15:44:07] asad_: has joined #ruby
[15:44:21] asad_: What sorting algorithm is implemented by Array#sort?
[15:44:38] radgeRayden_: has joined #ruby
[15:44:44] riotjones: has joined #ruby
[15:46:14] apeiros: asad_: it uses qsort
[15:46:20] matled: has joined #ruby
[15:46:24] apeiros: but don't rely on a particular implementation
[15:47:13] teclator: has joined #ruby
[15:48:17] _stu_: has joined #ruby
[15:48:39] User458764: has joined #ruby
[15:49:48] idefine: has joined #ruby
[15:51:41] slawrence00: has joined #ruby
[15:52:25] dopamean_: has joined #ruby
[15:53:05] Xeago: has joined #ruby
[15:53:17] Pupp3tm4st3r: has joined #ruby
[15:53:57] Guest53: has joined #ruby
[15:54:06] mary5030_: has joined #ruby
[15:54:40] decoponio: has joined #ruby
[15:55:11] abucha: has joined #ruby
[15:56:10] hectorsq: has joined #ruby
[15:58:04] Yzguy: has joined #ruby
[15:58:27] devoldmx: has joined #ruby
[15:59:02] mary5030: has joined #ruby
[16:00:37] wldcordeiro: has joined #ruby
[16:01:02] jgt1: has joined #ruby
[16:02:00] synthroid: has joined #ruby
[16:03:06] startupality: has joined #ruby
[16:04:14] robbyoconnor: has joined #ruby
[16:06:33] momomomomo: has joined #ruby
[16:09:16] build22: has joined #ruby
[16:09:32] idefine: has joined #ruby
[16:12:11] Ebok: can you iterate within gsub, like replace every vowel with an escalating 1 2 3 4 5. H1ll2 W3rld?
[16:12:29] bruno-: has joined #ruby
[16:12:34] Ebok: I know there are other ways to do this, I'm just wondering if gsub can do it
[16:12:46] treehug88: has joined #ruby
[16:14:26] Ebok: the other curiousity I have with gsub is when the pattern is matched, can we modify the pattern? example "hello world".gub(/[aeiou]/,pat.next) turning e into f, o into p, etc
[16:14:32] cwong_on_irc: has joined #ruby
[16:14:42] pu22l3r: Hi anyone here ever see this error: http://pastebin.com/MaccxFFR
[16:14:43] ruboto: pu22l3r, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/20e8e19131e7add28cca
[16:14:43] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[16:15:14] karapetyan: has joined #ruby
[16:15:44] platzhirsch: Pastebin is the devil
[16:15:55] Fredrich010: has joined #ruby
[16:18:20] zylogz80: has joined #ruby
[16:18:28] pu22l3r: Sorry ... I don't typically have to paste stuff too much
[16:18:38] pu22l3r: and that was the only one I could think of
[16:18:44] pu22l3r: cool that it moves it though
[16:18:50] gregf: has joined #ruby
[16:18:54] dopie: has joined #ruby
[16:18:55] Ebok: nm gsub(pattern) {|match| block } ??? new_str <-- answered my own questions
[16:19:00] roshanavand: has joined #ruby
[16:19:03] bmalum_: has joined #ruby
[16:19:19] inteq: has joined #ruby
[16:19:21] rgtk: has joined #ruby
[16:19:46] NeverDie: has joined #ruby
[16:20:09] arthurix: has joined #ruby
[16:20:36] pu22l3r: So anyone ever seen that ssl error? it's driving me nuts ...
[16:20:46] dopamean_: has joined #ruby
[16:22:36] jhass: pu22l3r: the october iso is missing certs
[16:22:51] jhass: whoops, wrong channel
[16:22:58] jhass: pu22l3r: windows?
[16:23:18] jhass: ssl error on doing what exactly?
[16:23:49] pdoherty: has joined #ruby
[16:24:01] pu22l3r: jhass: well ... it's actually a chef omnibus project ... trying to download the latest copy of openssl from openssl.org
[16:24:06] pietr0: has joined #ruby
[16:24:18] platzhirsch: so it says in my ActiveRecord::Base.connection @open_connection, wonder how I can close it
[16:24:32] jhass: pu22l3r: you gotta give a ton more context if you want any help
[16:24:35] karapetyan: has joined #ruby
[16:24:58] pu22l3r: jhass: ok sure, one sec while i post the output of what I'm running
[16:25:03] jhass: derp, haven't seen the initial gist
[16:25:49] jhass: pu22l3r: I think the easiest solution apart from using RVM on OS X was to get the curl ca bundle and use that explicitly
[16:26:13] pu22l3r: jhass: curl ca bundle ?
[16:26:18] pu22l3r: jhass: https://gist.github.com/mrcustard/45ba76bcc0cd13babf1e
[16:26:30] chibs: has joined #ruby
[16:26:47] pu22l3r: rvm on osx gives me an error when trying to update the certs ...
[16:27:00] dravine_: has joined #ruby
[16:27:04] idefine_: has joined #ruby
[16:27:06] sanjayu: has joined #ruby
[16:27:14] karapetyan: has joined #ruby
[16:27:17] syath: has joined #ruby
[16:27:33] bruno-_: has joined #ruby
[16:28:22] SleepySensei: has joined #ruby
[16:28:35] pu22l3r: jhass: https://gist.github.com/mrcustard/fed970014b612a938937
[16:29:04] jhass: rvmsudo ?
[16:29:19] atomical_: has joined #ruby
[16:29:25] bryanray: has joined #ruby
[16:29:41] pu22l3r: jhass: https://gist.github.com/mrcustard/fed970014b612a938937
[16:29:45] pu22l3r: updated it
[16:30:07] jhass: well, try using an RVM ruby
[16:30:39] jhass: currently you're using the system ruby
[16:30:40] fedexo: has joined #ruby
[16:30:45] idefine: has joined #ruby
[16:31:36] pu22l3r: ok I will try that, thanks
[16:31:49] bmalum: has joined #ruby
[16:32:06] jdawgaz: has joined #ruby
[16:32:34] dionysus69: has joined #ruby
[16:33:22] shevy: hanmac you are all famous https://github.com/ruby/ruby/blob/trunk/ChangeLog#L18
[16:33:25] rcvalle: has joined #ruby
[16:33:36] idefine: has joined #ruby
[16:34:00] NeverDie: has joined #ruby
[16:34:01] karapetyan: has joined #ruby
[16:35:46] mistermocha: has joined #ruby
[16:35:47] gigetoo: has joined #ruby
[16:36:00] b3nt_pin: has joined #ruby
[16:36:19] nfk: has joined #ruby
[16:36:54] idefine_: has joined #ruby
[16:37:41] hxegon: has joined #ruby
[16:37:54] TheNet: has joined #ruby
[16:38:10] NeverDie: has joined #ruby
[16:41:18] low-prof1: has joined #ruby
[16:42:27] bruno-_: has joined #ruby
[16:44:13] tulak: has joined #ruby
[16:44:31] karapetyan: why this don't works
[16:44:39] karapetyan: hsh[i] #=> nil
[16:44:51] karapetyan: hsh[i].to_i += 1 #=> undefined method `to_i=' for nil:NilClass
[16:45:22] riotjones: has joined #ruby
[16:45:45] drew2_: has joined #ruby
[16:45:55] zwdr: because you're calling a method on nil
[16:46:13] zwdr: since hsh[i] isnt assigned
[16:46:22] solocshaw: has joined #ruby
[16:46:23] mistermocha: has joined #ruby
[16:46:25] karapetyan: has joined #ruby
[16:48:07] mag42c_: has joined #ruby
[16:48:12] theRoUS: has joined #ruby
[16:48:50] gix-: has joined #ruby
[16:49:01] iamvery_: has joined #ruby
[16:49:24] dnomyar_: has joined #ruby
[16:49:51] hippyphysicist: has joined #ruby
[16:50:04] tercenya_: has joined #ruby
[16:50:09] segfalt``: has joined #ruby
[16:50:14] apeiros: karapetyan: to what should += assign?
[16:50:15] djbkd_: has joined #ruby
[16:50:25] Eiam: has joined #ruby
[16:50:36] karapetyan: apeiros: hsh = {}
[16:50:37] zwdr: karapetyan: you're calling a method on hsh[i], which isnt set
[16:50:40] astrobun_: has joined #ruby
[16:50:54] borodin_: has joined #ruby
[16:50:55] chinmay_dd_: has joined #ruby
[16:51:02] apeiros: karapetyan: a += b is strictly a = a + b
[16:51:05] karapetyan: and i want increment it += 1 anyway set it or not
[16:51:09] cdg_: has joined #ruby
[16:51:11] gregf_: has joined #ruby
[16:51:13] bcavileer_: has joined #ruby
[16:51:20] apeiros: so hsh[i].to_i += 1 is hsh[i].to_i = hsh[i].to_i + 1
[16:51:22] Maletor: has joined #ruby
[16:51:53] pmarreck_: has joined #ruby
[16:51:55] apeiros: hsh = Hash.new(0); hsh[i] += 1
[16:51:56] apeiros: set the default to 0
[16:52:09] apeiros: or whatever starting value "not set" should have for you. because "incrementing *not set* by one" makes no sense.
[16:52:10] karapetyan: apeiros: ok, is there another way than:? hsh[i].nil? ? hsh[i] = 1 : hsh[i] += 1
[16:52:12] Spami_: has joined #ruby
[16:52:22] Hanmac: shevy yeah i know isnt that awesome? ;P
[16:52:23] karapetyan: apeiros: ok, thanks
[16:52:27] hippyphysicist: has joined #ruby
[16:52:29] Killerkeksdose: has joined #ruby
[16:53:21] ELCALOR_: has joined #ruby
[16:53:22] ex0ns: has joined #ruby
[16:53:34] Eising_: has joined #ruby
[16:53:58] mblagden_: has joined #ruby
[16:54:06] roshanavand: has joined #ruby
[16:54:06] hippyphysicist: has joined #ruby
[16:54:09] spew_: has joined #ruby
[16:54:16] JStoker: has joined #ruby
[16:54:17] badeball_: has joined #ruby
[16:54:27] jokester: has joined #ruby
[16:54:29] lagweezl1: has joined #ruby
[16:54:32] jaredrhine_: has joined #ruby
[16:54:32] yokel_: has joined #ruby
[16:54:35] valeri_uF0: has joined #ruby
[16:54:39] mh_laaks1: has joined #ruby
[16:54:53] rdema_: has joined #ruby
[16:54:59] Lorn_: has joined #ruby
[16:55:12] jschoolcraft: has joined #ruby
[16:55:21] mistermocha: has joined #ruby
[16:55:32] netwoodle: has joined #ruby
[16:55:33] Gnubie_: has joined #ruby
[16:55:37] zenspider_: has joined #ruby
[16:55:40] halfdan_: has joined #ruby
[16:55:45] hippyphysicist: has joined #ruby
[16:55:55] htmldrum: has joined #ruby
[16:56:25] lagweezl1: has joined #ruby
[16:56:25] EminenceHC: has joined #ruby
[16:56:41] crankhar1er: has joined #ruby
[16:56:45] null__: has joined #ruby
[16:56:59] alexblom: has joined #ruby
[16:57:01] beagles: has joined #ruby
[16:57:08] Maletor: has joined #ruby
[16:57:17] janno_: has joined #ruby
[16:57:32] pocketprotector-: has joined #ruby
[16:57:57] Maletor: has joined #ruby
[16:57:57] rvchangue_: has joined #ruby
[16:58:03] heinrich5991_: has joined #ruby
[16:58:04] null__: has joined #ruby
[16:58:20] Diabolik: has joined #ruby
[16:58:23] NightMonkey_: has joined #ruby
[16:58:24] darkf_: has joined #ruby
[16:58:26] simplyianm: has joined #ruby
[16:58:50] Diabolik: has joined #ruby
[16:58:59] Meow-J: has joined #ruby
[16:58:59] NeverDie: has joined #ruby
[16:59:04] redtomahawk: has joined #ruby
[16:59:18] yosafbridge`: has joined #ruby
[16:59:19] SirCmpwn_: has joined #ruby
[16:59:20] Diabolik: has joined #ruby
[16:59:28] symm-: has joined #ruby
[17:00:10] _aeris_: has joined #ruby
[17:00:11] polishdub_: has joined #ruby
[17:00:12] retornam_: has joined #ruby
[17:00:40] Edward123: has joined #ruby
[17:01:07] snockerton: has joined #ruby
[17:01:12] greenbig-: has joined #ruby
[17:01:17] cbetta_: has joined #ruby
[17:01:18] C0deMaver1ck: has joined #ruby
[17:01:22] [Butch]: has joined #ruby
[17:01:24] hfp__work: has joined #ruby
[17:02:19] BSaboia: has joined #ruby
[17:02:32] roshanavand: has joined #ruby
[17:02:47] casadei: has joined #ruby
[17:02:52] agentmeerkat: has joined #ruby
[17:03:06] cjk101010: has joined #ruby
[17:03:16] rflot_: has joined #ruby
[17:03:25] Trieste: has joined #ruby
[17:03:46] idefine: has joined #ruby
[17:03:52] im0b_: has joined #ruby
[17:04:18] NeverDie: has joined #ruby
[17:04:41] pdoherty_: has joined #ruby
[17:04:43] danzilio_: has joined #ruby
[17:05:00] constantinexvi: has joined #ruby
[17:05:01] existensil: has joined #ruby
[17:05:14] Stan: has joined #ruby
[17:05:54] baroquebobcat: has joined #ruby
[17:05:57] SCHAAP137: has joined #ruby
[17:06:01] stevednd: has joined #ruby
[17:07:15] _aeris_: has joined #ruby
[17:07:16] CVTJNII: has joined #ruby
[17:07:22] shevy: ack, mass nick renaming
[17:07:24] bmn: has joined #ruby
[17:07:31] wldcordeiro: has joined #ruby
[17:07:41] cornerma1: has joined #ruby
[17:08:30] nibbo: has joined #ruby
[17:08:41] an0ma1y: has joined #ruby
[17:08:43] vigintas: has joined #ruby
[17:08:53] GnuYawk: has joined #ruby
[17:09:26] gregf_: shevy is now known as _shevy_ *runs*
[17:10:24] BSaboia: has joined #ruby
[17:10:36] towski_: has joined #ruby
[17:10:46] guest192123: has joined #ruby
[17:11:01] daivyk: has joined #ruby
[17:11:34] TheNet: has joined #ruby
[17:12:31] bruno-: has joined #ruby
[17:12:35] towski__: has joined #ruby
[17:12:46] frode15243: has joined #ruby
[17:12:49] Oatmeal: has joined #ruby
[17:12:54] cbetta: has joined #ruby
[17:14:22] tubuliferous: has joined #ruby
[17:14:34] tulak: has joined #ruby
[17:14:43] bricker: has joined #ruby
[17:16:13] mistermocha: has joined #ruby
[17:16:44] jmonreal: I still havent been able to use optparse and to show me the arguments when none is passed
[17:16:45] roshanavand: has joined #ruby
[17:16:48] Xeago: has joined #ruby
[17:16:56] tulak: has joined #ruby
[17:17:09] shevy: this is why nobody likes optparse!
[17:17:19] bougyman: I love optparse
[17:17:28] bougyman: and use it often
[17:17:36] Musashi007: has joined #ruby
[17:17:40] eam: I don't
[17:17:42] mahlon: has joined #ruby
[17:17:48] bougyman: I can do things with it slop doesn't allow
[17:18:20] bougyman: and I always avoid unecessary dependencies
[17:19:30] darix: jmonreal: just curious ... what would be your expected behavior
[17:19:35] rabbithole: has joined #ruby
[17:19:44] bubbys: has joined #ruby
[17:19:46] MissionCritical: has joined #ruby
[17:20:55] hxegon: has joined #ruby
[17:21:00] jmonreal: when running my script without arguments, to show me that there are arguments missing
[17:21:03] jmonreal: and show me the help
[17:21:29] ascarter: has joined #ruby
[17:21:59] atomical: has joined #ruby
[17:22:44] eam: jmonreal: how would it know you require those arguments?
[17:22:58] darix: jmonreal: if opts.someopt.nil? ; $stderr.puts "missing param" ; exit 1 ; done
[17:23:25] shevy: but he asked for optparse
[17:23:41] d5sx43: has joined #ruby
[17:23:45] shevy: it's trivial with ARGV alone :>
[17:24:15] darix: shevy: opts was my optparse instance
[17:24:44] blackmesa: has joined #ruby
[17:24:48] bubbys: has joined #ruby
[17:25:45] krzkrz: has joined #ruby
[17:26:51] shadoi: has joined #ruby
[17:27:17] jmonreal: darix: so I have to do if for each argument
[17:27:29] jmonreal: there's no module that has that by default?
[17:27:34] darix: jmonreal: atm there is no way to tell optparser "this is required"
[17:28:38] jmonreal: darix: as for the OptionParser module doc, says that there is
[17:28:50] jmonreal: http://docs.ruby-lang.org/en/2.1.0/OptionParser.html
[17:29:30] leafybas_: has joined #ruby
[17:30:55] A124: has joined #ruby
[17:31:05] jmonreal: but when running the example darix it does not seem to take the argument as required
[17:31:19] chibs: has joined #ruby
[17:32:26] wsewolod: has joined #ruby
[17:33:23] lukaszes: has joined #ruby
[17:33:57] RobertBirnie: has joined #ruby
[17:34:36] subscope: has joined #ruby
[17:35:55] cyle: has joined #ruby
[17:36:09] EminenceHC: has joined #ruby
[17:36:10] Guest53: has joined #ruby
[17:36:11] adaedra: Didn't work.
[17:37:28] cyle: Quick question: What's the point of CI servers? Just automated testing on pull requests?
[17:37:51] adaedra: Basically, automated tests on push, yes.
[17:38:05] benlieb: has joined #ruby
[17:38:07] CalydOn: has joined #ruby
[17:38:28] TheNet: does anyone know if ObjectSpace.each_object(ClassName) is sorted by object creation time?
[17:38:35] cyle: I guess it's just to keep people honest then? I always test locally before pushing.
[17:38:53] TheNet: cyle: for compiled languages it can also run builds
[17:39:03] adaedra: Keep track, test automatically, test on different platforms
[17:39:39] djbkd: has joined #ruby
[17:39:52] cyle: I should probably be doing this for my gems then
[17:40:21] adaedra: I do it to see if everything is okay in multiple ruby versions and platforms (jruby, rbx)
[17:40:42] TheNet: from my tests it seems like ObjectSpace.each_object is sorted by object creation time, but I can't find anything to verify this
[17:41:22] goodcodeguy: has joined #ruby
[17:42:05] TheNet: has joined #ruby
[17:42:17] terminalrecluse: has joined #ruby
[17:49:16] woods: has joined #ruby
[17:49:43] woods: good morning
[17:50:34] mattwildig: has joined #ruby
[17:50:55] musashi: has joined #ruby
[17:51:36] synthroid: has joined #ruby
[17:52:02] terminal_: has joined #ruby
[17:52:26] Pupp3tm4st3r: has joined #ruby
[17:52:44] mrtomme: has joined #ruby
[17:52:54] Bloomer: has joined #ruby
[17:55:03] bryanray: has joined #ruby
[17:55:28] tomphp: has joined #ruby
[17:58:06] arup_r: has joined #ruby
[17:58:14] pocketprotector: has joined #ruby
[17:58:39] karapetyan: has joined #ruby
[17:59:11] devoldmx: has joined #ruby
[17:59:31] JDiPierro: has joined #ruby
[17:59:41] slawrence00: has joined #ruby
[18:01:36] Guest53: has joined #ruby
[18:02:32] bigkevmcd: has joined #ruby
[18:02:51] cfloare: has joined #ruby
[18:02:55] d10n-work: has joined #ruby
[18:04:12] beauby: has joined #ruby
[18:04:59] codecop: has joined #ruby
[18:08:23] shevy: don't go to close to the fire
[18:09:06] woods: shevy, i never go close to the fire
[18:10:14] simplyianm: has joined #ruby
[18:10:29] idefine: has joined #ruby
[18:10:40] RegulationD: has joined #ruby
[18:11:11] slash_nick: everything you do in life, do withintent... except building fires. never build fire within tent.
[18:12:18] mistermocha: has joined #ruby
[18:12:20] skweek: has joined #ruby
[18:12:40] mostlybadfly: has joined #ruby
[18:13:04] jessemcgilallen: has joined #ruby
[18:13:40] p0wn3d__: has joined #ruby
[18:14:08] firstdayonthejob: has joined #ruby
[18:15:08] RobertBirnie: has joined #ruby
[18:15:55] shinnya: has joined #ruby
[18:17:43] mikecmpbll: has joined #ruby
[18:17:49] Musashi007: has joined #ruby
[18:19:00] bryanray: has joined #ruby
[18:19:05] ahegyi: has joined #ruby
[18:21:24] pwnd_nsfw: has joined #ruby
[18:21:35] dn5: has joined #ruby
[18:22:10] woods: I am going through the Introduction to Algorithms 3rd Edition book, and trying to implement everything in ruby, it has been a lot of fun
[18:22:40] dn5: Could anyone give me a hint why does response.body gives strange undefined chars in terminal?
[18:22:44] dn5: Is it up to encoding?
[18:23:11] zenguy_pc: has joined #ruby
[18:23:21] slash_nick: woods: is that the "CLR" text book?
[18:23:27] slash_nick: (i think there's 4 authors now)
[18:23:35] Expl0s3: has joined #ruby
[18:23:44] eam: so if this converts from a string to a struct: s = struct_class.new FFI::MemoryPointer.from_string buf
[18:23:53] nettoweb: has joined #ruby
[18:23:57] eam: is this the best way to do the reverse? s.to_ptr.read_string(struct_class.size)
[18:24:04] woods: slash_nick, I am not sure, it is this one though http://www.amazon.com/Introduction-Algorithms-3rd-Thomas-Cormen/dp/0262033844/ref=sr_1_3?s=books&ie=UTF8&qid=1446747661&sr=1-3&keywords=algorithms
[18:24:04] baweaver: has joined #ruby
[18:24:29] slash_nick: yup... CLR = Cormen Leiserson Rivest
[18:24:44] woods: That is what I figured it stood for
[18:24:47] slash_nick: woods: that's on googles list of things to read before an interview
[18:25:00] woods: Why do suppose I am reading it? :)
[18:25:08] slash_nick: woods: good luck! :)
[18:25:14] woods: slash_nick, thanks!
[18:25:28] NeverDie: has joined #ruby
[18:25:50] woods: I feel like I didn't grasp many of those concepts as well as I should have in school, so now that I have more time, I'm going back and reviewing.
[18:26:14] TheNet: has joined #ruby
[18:27:35] jackjackdripper: has joined #ruby
[18:28:15] slash_nick: woods: are you also reading programming pearls & the one on programming interviews as well?
[18:30:04] TheNet: has joined #ruby
[18:30:16] Yzguy: has joined #ruby
[18:30:18] dtordable: has joined #ruby
[18:30:18] dtordable: has joined #ruby
[18:32:23] jwaldrip: has joined #ruby
[18:32:55] jwaldrip_: has joined #ruby
[18:33:05] RegulationD: has joined #ruby
[18:33:16] momomomomo: has joined #ruby
[18:33:36] shmilan: has joined #ruby
[18:34:48] netule: has joined #ruby
[18:35:33] beauby: has joined #ruby
[18:38:10] tylerm: has joined #ruby
[18:38:48] spleeze: has joined #ruby
[18:38:58] woods: slash_nick, I don't have programming pearls, but a co-worker let me borrow "Cracking the Coding Interview"
[18:39:31] tylerm: howdy - i'm looking at allinoneruby and tar2rubyscript but not having much luck and these seem like old projects.. is there a newer approach you can recommend
[18:40:11] tylerm: i want to deploy my app and complete ruby env to another linux machine with them needing to install anything.
[18:40:25] fantazo: has joined #ruby
[18:40:44] kerunaru: has joined #ruby
[18:41:27] tylerm: going to give http://phusion.github.io/traveling-ruby/ a try.. but seems a lot of work ;)
[18:42:09] dtordable: has joined #ruby
[18:42:34] karapetyan: has joined #ruby
[18:42:34] slash_nick: woods: i was thinking of "programming interviews exposed"
[18:42:36] lemur: has joined #ruby
[18:43:00] dtordable: has joined #ruby
[18:43:07] dstarh: has joined #ruby
[18:43:27] Guest53: has joined #ruby
[18:43:39] mattwild_: has joined #ruby
[18:44:23] vigintas1: has joined #ruby
[18:44:41] TheNet: has joined #ruby
[18:44:41] tenderlove: has joined #ruby
[18:45:05] diegoaguilar: has joined #ruby
[18:45:42] zacstewart: has joined #ruby
[18:46:10] awk: has joined #ruby
[18:46:15] hackeron: has joined #ruby
[18:46:30] sevin: has joined #ruby
[18:46:40] kirun: has joined #ruby
[18:46:55] Log1x: has joined #ruby
[18:47:05] humd1ng3r: has joined #ruby
[18:47:36] Prira: has joined #ruby
[18:48:01] karapetyan: has joined #ruby
[18:48:28] User458764: has joined #ruby
[18:48:30] tulak: has joined #ruby
[18:48:40] cndiv: has joined #ruby
[18:49:35] rakm: has joined #ruby
[18:49:43] dopamean_: has joined #ruby
[18:53:25] User458764: has joined #ruby
[18:54:50] startupality: has joined #ruby
[18:55:11] Mon_Ouie: has joined #ruby
[18:56:00] idefine: has joined #ruby
[18:56:11] yxhuvud: has joined #ruby
[18:58:30] roshanavand: has joined #ruby
[18:59:00] sdothum: has joined #ruby
[19:01:44] startupality: has joined #ruby
[19:01:52] opensource_ninja: has joined #ruby
[19:03:06] th0m_: has joined #ruby
[19:03:58] jpfuentes2: has joined #ruby
[19:04:56] JDiPierro: has joined #ruby
[19:06:58] tulak: has joined #ruby
[19:08:20] tomaz_b: has joined #ruby
[19:10:35] simplyia_: has joined #ruby
[19:11:50] edj: has joined #ruby
[19:12:06] edj: can someone explain .each do?
[19:12:10] TheNet: how can I get the last instance of a class that was created?
[19:12:13] edj: or .each?
[19:12:26] edj: i dont understand what its doing and why
[19:12:36] TheNet: edj: takes a block and runs it for each item in a hash or array
[19:12:56] TheNet: so [1, 2, 3].each { |item| puts item }
[19:13:05] edj: TheNet:thanks man
[19:13:06] TheNet: puts 1 2 and 3
[19:13:26] freerobby: has joined #ruby
[19:14:21] TheNet: if you call .each on a hash each key/value pair is passed to the block, so { a_key: 'a value }.each { |key, value| puts value }
[19:14:33] TheNet: but you could really just google all this
[19:14:47] shevy: he is a webchattster so he won't google :)
[19:14:55] _blizzy_: has joined #ruby
[19:16:20] baweaver: has joined #ruby
[19:17:56] edj: I defiantly understand .each now. Thank you so much
[19:18:39] roshanavand: has joined #ruby
[19:18:52] borodin_: has joined #ruby
[19:19:14] spider-mario: has joined #ruby
[19:19:37] borodin_: how do I remove \" from a string in ruby. i.e. "This\"string" becomes "Thisstring"
[19:19:45] borodin_: tried a lot of things, nothing works
[19:20:16] TheNet: borodin_: .gsub('\', '') ?
[19:20:31] diegoaguilar: has joined #ruby
[19:20:44] TheNet: or actually .gsub('\\', '') probably
[19:20:53] havenwood: borodin_: A backslash or all the backslashes?
[19:21:37] CloCkWeRX: has joined #ruby
[19:21:48] TTilus: borodin_: how about http://pastie.org/10532655
[19:21:49] kadoppe: has joined #ruby
[19:22:57] apeiros: "foo\"string" does not contain a single backslash
[19:23:00] borodin__: has joined #ruby
[19:23:11] TTilus: borodin_: \" is a quoted double quote, i.e. what apeiros said
[19:23:21] borodin__: got kicked off
[19:23:24] apeiros: s/quoted/escaped7
[19:23:36] borodin__: TTilus I missed what you guys said
[19:23:38] TTilus: apeiros: stand corrected
[19:23:47] borodin__: the gsub('\\','') doesn't work
[19:23:47] apeiros: 20:22 apeiros: um
[19:23:47] apeiros: 20:22 apeiros: "foo\"string" does not contain a single backslash
[19:23:51] apeiros: borodin__: ^
[19:24:05] TTilus: borodin_: how about http://pastie.org/10532655
[19:24:11] apeiros: >> puts "hello \" world"
[19:24:12] ruboto: apeiros # => hello " world ...check link for more (https://eval.in/463850)
[19:24:34] dtordable: has joined #ruby
[19:24:35] borodin__: ok I see thanks
[19:24:40] QORRiE: has joined #ruby
[19:24:43] lxsameer: has joined #ruby
[19:24:45] yqt: has joined #ruby
[19:24:59] apeiros: >> 'hello " world' # alternative way to show this :)
[19:25:00] ruboto: apeiros # => "hello \" world" (https://eval.in/463851)
[19:26:39] idefine: has joined #ruby
[19:27:50] djbkd: has joined #ruby
[19:29:32] agent_white: has joined #ruby
[19:29:42] moeabdol: has joined #ruby
[19:31:16] Musashi007: has joined #ruby
[19:31:32] EminenceHC: has joined #ruby
[19:32:15] to_json: has joined #ruby
[19:32:15] to_json: has joined #ruby
[19:35:25] idefine: has joined #ruby
[19:36:13] Guest53: has joined #ruby
[19:36:25] symbol: has joined #ruby
[19:37:57] z4ph0d: has joined #ruby
[19:38:19] roxtrongo: has joined #ruby
[19:38:26] tomaz_b: hi... i am newbie in ruby ... i have to create XML, based on .xsd files. I came across soap4r and cmd tool xsd2ruby.rb. Now I got huge file full of classes and everything. But somehow ... I am not sure that I know how to build XML (actualy create one)... after instantiating some of those classes
[19:38:35] stamina: has joined #ruby
[19:38:38] tomaz_b: can someone please help/suggest me how to proceed
[19:40:36] NeverDie: has joined #ruby
[19:43:26] lemur: has joined #ruby
[19:43:41] TheNet: tomaz_b: you might want https://github.com/jimweirich/builder
[19:43:46] idefine: has joined #ruby
[19:44:33] syath: has joined #ruby
[19:45:14] |ifei5g00d: has joined #ruby
[19:45:45] baweaver: has joined #ruby
[19:45:53] dhollinger: has joined #ruby
[19:47:09] Eiam: has joined #ruby
[19:47:59] nchambers: has joined #ruby
[19:48:14] j5s7: has joined #ruby
[19:49:13] dcoy: has joined #ruby
[19:49:56] monq: has joined #ruby
[19:50:05] j5s7: has joined #ruby
[19:50:24] rippa: has joined #ruby
[19:50:35] idefine: has joined #ruby
[19:50:39] xfbs: has joined #ruby
[19:51:43] bruno-: has joined #ruby
[19:52:22] j5s7: has joined #ruby
[19:53:12] mistermocha: has joined #ruby
[19:54:37] j5s7: has joined #ruby
[19:55:12] northfurr: has joined #ruby
[19:55:45] j5s7: has joined #ruby
[19:56:30] momomomomo: has joined #ruby
[19:57:55] nettoweb: has joined #ruby
[19:58:01] aufi: has joined #ruby
[19:58:40] j5s7: has joined #ruby
[19:58:46] babblebre: has joined #ruby
[19:58:53] yfeldblum: has joined #ruby
[19:59:06] VeryBewitching: has joined #ruby
[19:59:37] tulak: has joined #ruby
[19:59:56] devoldmx: has joined #ruby
[19:59:59] diegoaguilar: has joined #ruby
[20:00:20] idefine_: has joined #ruby
[20:00:31] jobewan: has joined #ruby
[20:00:43] User458764: has joined #ruby
[20:00:58] cyle: has joined #ruby
[20:02:28] luriv: has joined #ruby
[20:03:34] ellisTAA: has joined #ruby
[20:04:00] vigintas: has joined #ruby
[20:04:01] tw1sted: has joined #ruby
[20:04:05] TheNet: is this the best way to set a class-wide variable that independent for each inheritance? https://gist.github.com/net/f13fe33096d3aaa90fac
[20:05:36] Sou|cutter: TheNet: I might take a look at ActiveSupport's class_attribute
[20:06:02] Musashi007: has joined #ruby
[20:06:05] apeiros: TheNet: class ivar. you can initialize it in self.inherited.
[20:06:40] apeiros: my pattern is usually to have a private self.initialize_class and call that via send from self.inherited.
[20:07:10] apeiros: I dislike ||= in accessors
[20:08:59] karapetyan: has joined #ruby
[20:09:32] hectorsq: has joined #ruby
[20:10:32] jorb: has joined #ruby
[20:10:44] idefine: has joined #ruby
[20:11:57] jdawgaz: has joined #ruby
[20:15:26] woods: slash_nick, sorry for the delayed response, i was out of the office, ill have to check that one out as well
[20:16:45] griffindy: has joined #ruby
[20:17:38] griffindy: has joined #ruby
[20:19:07] griffindy: has joined #ruby
[20:19:29] Coldblackice: has joined #ruby
[20:19:59] blackmesa: has joined #ruby
[20:21:30] kstuart: has joined #ruby
[20:21:40] [Butch]: has joined #ruby
[20:22:36] idefine: has joined #ruby
[20:24:12] tw1sted: has joined #ruby
[20:25:08] neanderslob: has joined #ruby
[20:26:04] skweek: has joined #ruby
[20:27:56] bruno-_: has joined #ruby
[20:32:40] arthurix_: has joined #ruby
[20:33:12] idefine: has joined #ruby
[20:34:55] mistermocha: has joined #ruby
[20:36:51] Guest53: has joined #ruby
[20:36:57] EminenceHC: has joined #ruby
[20:37:12] step1step22: has joined #ruby
[20:39:25] zotherstupidguy: has joined #ruby
[20:40:12] vdamewood: has joined #ruby
[20:40:24] zenguy_pc: has joined #ruby
[20:40:33] trosborn: has joined #ruby
[20:41:06] skade: has joined #ruby
[20:42:54] Oatmeal: has joined #ruby
[20:43:05] Ox0dea: has joined #ruby
[20:44:07] baweaver: has joined #ruby
[20:45:24] ibouvousaime: has joined #ruby
[20:45:58] stamina: has joined #ruby
[20:46:03] Ox0dea: So, you can include "Rakefile" in a gem's extension list to have your default Rake task executed post-install; this is pretty awesome, but RubyGems is mucking about with the output streams, so printing is annoying. :<
[20:46:25] Ox0dea: https://eval.in/463874 only prints "--0--", indicating that I apparently have to repurpose stdin for output, and I don't wanna do that.
[20:46:26] stannard_: has joined #ruby
[20:46:45] Ox0dea: Please adivse.
[20:48:24] lemur: has joined #ruby
[20:49:45] DEA7TH: has joined #ruby
[20:50:55] platzhirsch: has left #ruby: ()
[20:51:08] rabbithole: has joined #ruby
[20:52:14] jxs_: has joined #ruby
[20:52:25] idefine: has joined #ruby
[20:55:06] woods: has joined #ruby
[20:55:42] mistermocha: has joined #ruby
[20:55:49] ruurd: has joined #ruby
[20:56:33] tomphp: has joined #ruby
[20:56:41] TheNet: has joined #ruby
[20:57:26] diegoaguilar: has joined #ruby
[20:58:03] bruno-: has joined #ruby
[20:58:30] moeabdol: has joined #ruby
[20:59:16] duckpupp1: has joined #ruby
[20:59:31] zotherstupidguy: has joined #ruby
[21:00:19] marcosantoniocar: has joined #ruby
[21:01:14] al2o3-cr: has joined #ruby
[21:01:34] treehug88: has joined #ruby
[21:01:48] infamos: has joined #ruby
[21:02:42] cdg: has joined #ruby
[21:03:41] mozzarella: has joined #ruby
[21:05:18] arthurix: has joined #ruby
[21:05:30] idefine: has joined #ruby
[21:06:13] segfalt: has joined #ruby
[21:06:36] bricker: has joined #ruby
[21:06:49] infamos: has joined #ruby
[21:08:29] idefine: has joined #ruby
[21:09:21] baweaver: has joined #ruby
[21:09:26] NeverDie: has joined #ruby
[21:10:38] idefine: has joined #ruby
[21:11:04] momomomomo: has joined #ruby
[21:13:15] wsewolod: has joined #ruby
[21:14:19] petricore: has joined #ruby
[21:14:56] InternetFriend: has joined #ruby
[21:15:21] hxegon: has joined #ruby
[21:17:00] acke: has joined #ruby
[21:17:51] to_json: has joined #ruby
[21:17:51] to_json: has joined #ruby
[21:18:34] acke: has joined #ruby
[21:18:51] Coldblackice: has joined #ruby
[21:19:01] beauby: has joined #ruby
[21:19:18] ruurd: has joined #ruby
[21:20:28] Xeago: has joined #ruby
[21:21:08] chipotle: has joined #ruby
[21:22:04] blackmesa: has joined #ruby
[21:22:33] roshanavand: has joined #ruby
[21:23:23] User458764: has joined #ruby
[21:24:32] niftylettuce: has joined #ruby
[21:25:20] trosborn: has joined #ruby
[21:25:25] TheHodge: has joined #ruby
[21:26:03] RegulationD: has joined #ruby
[21:31:50] craysiii: has joined #ruby
[21:32:03] ruurd: has joined #ruby
[21:32:19] Hanmac: has joined #ruby
[21:33:07] nettoweb: has joined #ruby
[21:33:16] casadei_: has joined #ruby
[21:36:04] Balllkenende: has joined #ruby
[21:36:22] acke: has joined #ruby
[21:36:22] CalydOn: has joined #ruby
[21:36:43] shevy: you are losing against hanmac
[21:37:12] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L18
[21:37:15] Hanmac: shevy i am in the ruby changelog, beat that shevy ;P
[21:37:39] shevy: Ox0dea also I found this commit funny :D https://github.com/ruby/ruby/blob/trunk/ChangeLog#L38
[21:37:39] Ox0dea: shevy: If that's what you meant, I got there first?
[21:37:58] shevy: don't try Ox0dea! nobu prefers hanmac!!
[21:38:18] ruurd: has joined #ruby
[21:38:21] Ox0dea: This is all very weird.
[21:38:23] User4587_: has joined #ruby
[21:38:34] shevy: I think they like hanmac's english style
[21:38:36] shevy: it's very unique
[21:39:02] shevy: I guess the ruby changelog is much funnier than the python changelog
[21:40:37] blackmesa: has joined #ruby
[21:41:01] Ox0dea: I bet if I fixed #11655, nobu would merge it.
[21:41:06] Ox0dea: But I don't even know where to begin. :<
[21:41:23] shevy: luckily I don't know C so I could not fix anything
[21:41:24] Ox0dea: He's just gonna let it die too. :(
[21:41:35] shevy: we need matz back!
[21:41:56] CloCkWeRX: has joined #ruby
[21:42:11] edj_: has joined #ruby
[21:42:18] Ox0dea: He went on a little spree just the other day; I missed my opportunity to update #11286 while he was looking for things to chime in on.
[21:42:18] edj_: hey guys
[21:42:38] edj_: so im a little confused going through the code academy course on ruby
[21:42:59] edj_: it says i need to make this "books.sort { |firstBook, secondBook| firstBook <=> secondBook }" sort them in decending order
[21:43:13] Ox0dea: edj_: Do you understand the <=> operator?
[21:43:15] edj_: is there a way to do that without making it an if else?
[21:43:22] edj_: no i do not
[21:43:23] Ox0dea: edj_: Yes, it's extremely easy.
[21:43:43] Ox0dea: &ri Comparable#<=> @ edj_
[21:43:43] `derpy: No results
[21:44:08] goodcodeguy: has joined #ruby
[21:44:21] Ox0dea: edj_: Anyway, it's searchable name is the "spaceship" operator; look into it.
[21:44:23] jmo: has joined #ruby
[21:44:43] edj_: Ox0dea:thanks
[21:44:52] CalydOn: Hello, I'm writing a Ruby code and I have some trouble with user input . When I use gets.chomp command I can't move the cursor backward terminal (with the left arrow key) , the terminal print [ [C ^ . I wonder if someone Could help me . Thanks
[21:45:04] Ox0dea: >> [1, 2, 3].sort { |a, b| b <=> a } # edj_
[21:45:05] ruboto: Ox0dea # => [3, 2, 1] (https://eval.in/463953)
[21:45:13] Ox0dea: But really, stop to get a hold on how <=> works.
[21:45:26] edj_: OOOOOOH lmao
[21:45:26] havenwood: Ox0dea: I do like 11286. It matches my expectation and seems quite nice.
[21:45:32] edj_: thats so easy
[21:45:34] Ox0dea: CalydOn: Your Ruby was compiled without readline support.
[21:45:42] Ox0dea: havenwood: I know, right?!
[21:45:48] sshbio: has joined #ruby
[21:46:28] shevy: CalydOn you can use require 'readline'; Readline.readline(' > Prompt here', true)
[21:47:22] slash_nick: shevy: whoa i'm there too!
[21:47:22] havenwood: Ox0dea: Are there any downsides? Nothing is using the single argument arity and I'd not suspect it's a common monkey patch.
[21:47:31] slash_nick: shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L388
[21:47:34] skade: has joined #ruby
[21:47:57] donske: has joined #ruby
[21:48:13] Ox0dea: havenwood: None that come to mind, and I've thought about it hard-ish.
[21:48:29] segfalt: has joined #ruby
[21:48:57] shevy: slash_nick lol
[21:49:06] shevy: "rename tailing to trailing"
[21:49:10] shevy: is this a pun or something
[21:49:13] slash_nick: substantive, i know
[21:49:16] shevy: "put the cat on the mat"
[21:49:24] shevy: "take the dog out of the fog"
[21:49:37] slash_nick: i thought i posted this in offtopic
[21:49:39] zacstewart: has joined #ruby
[21:49:50] diegoaguilar: has joined #ruby
[21:49:55] shevy: CalydOn what did you do just now, your nick appears wrong
[21:50:37] CalydOn: nothing i just use notice command
[21:50:48] shevy: that scared the squirrel out of me
[21:51:00] Ox0dea: CalydOn: You shouldn't.
[21:51:17] shevy: CalydOn readline support is available from the official ruby tarball such as ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.2.3.tar.xz - it is in that directory in ext/readline/
[21:51:50] shevy: if you compiled from source, the makefile will try to see if you have readline + ncurses available, then the bindings will be compiled; distributions may have a readline package so you could try to use that
[21:51:52] CalydOn: why i shouldn't (i m new on irc, I made an mistake ?)
[21:52:12] Ox0dea: CalydOn: Sorry, I've inadvertently led you on a goose chase. Your Ruby was almost certainly compiled with readline, you just have to explicitly request it as shevy is explaining.
[21:52:21] nfk: has joined #ruby
[21:52:48] shevy: it depends how you obtained your ruby... perhaps you are on windows... not sure if they have readline support available by default, I assume no
[21:52:55] shevy: *depends on
[21:54:10] skcin7: has joined #ruby
[21:54:20] havenwood: Ox0dea: Yup, I like.
[21:54:26] Oatmeal: has joined #ruby
[21:55:04] ruurd: has joined #ruby
[21:55:45] agent_white: has joined #ruby
[21:55:55] CalydOn: Thanks shevy and Ox0dea it works !
[21:55:57] |ifei5g00d: has joined #ruby
[21:56:24] opensource_ninja: has joined #ruby
[21:56:34] Ox0dea: havenwood: Merci pour le +1.
[21:57:02] vigintas1: has joined #ruby
[21:57:14] trosborn: has joined #ruby
[21:58:18] simplyianm: has joined #ruby
[22:00:14] havenwood: Ox0dea: avec plaisir
[22:00:42] devoldmx: has joined #ruby
[22:00:47] radgeRayden_: has joined #ruby
[22:00:47] ruurd: has joined #ruby
[22:00:48] mattwildig: has joined #ruby
[22:01:44] ekinmur: has joined #ruby
[22:06:24] riotjones: has joined #ruby
[22:07:11] leafybas_: has joined #ruby
[22:07:35] TomPeed: has joined #ruby
[22:09:19] mary5030: has joined #ruby
[22:09:21] d10n-work: has joined #ruby
[22:10:27] dhollinger: has joined #ruby
[22:10:48] thesheff17: has joined #ruby
[22:10:51] zacstewart: has joined #ruby
[22:11:27] Ropeney: has joined #ruby
[22:11:42] Ebok: has joined #ruby
[22:12:19] infamos: has joined #ruby
[22:12:26] Musashi007: has joined #ruby
[22:14:26] C0deMaver1ck: has joined #ruby
[22:14:50] Diabolik: has joined #ruby
[22:14:57] chinmay_dd: has joined #ruby
[22:15:02] tris: has joined #ruby
[22:15:05] catbusters: has joined #ruby
[22:16:21] ruurd: has joined #ruby
[22:18:42] TheNet: has joined #ruby
[22:18:48] Oatmeal: has joined #ruby
[22:18:49] dogetime: has joined #ruby
[22:19:01] guest192123: has joined #ruby
[22:19:28] hectorsq: has joined #ruby
[22:21:06] danzilio: has joined #ruby
[22:21:17] bmalum: has joined #ruby
[22:23:14] epochwolf: has joined #ruby
[22:23:24] lukaszes: has joined #ruby
[22:23:55] _blizzy_: has joined #ruby
[22:24:19] Guest53: has joined #ruby
[22:24:22] Aasha: has joined #ruby
[22:24:39] Mia: has joined #ruby
[22:24:39] Mia: has joined #ruby
[22:25:44] ruurd: has joined #ruby
[22:26:47] cschneid: has joined #ruby
[22:26:49] DarkBushido: has joined #ruby
[22:29:53] kerunaru: has joined #ruby
[22:29:56] maxz: has joined #ruby
[22:31:03] vF3hNGxc47h8: has joined #ruby
[22:31:36] BLuEGoD: has joined #ruby
[22:31:51] sankaber: has joined #ruby
[22:33:31] pwnd_nsfw: has joined #ruby
[22:35:36] dogetime: has left #ruby: ("Leaving")
[22:35:46] GeissT: has joined #ruby
[22:37:27] Dreamer3: has joined #ruby
[22:37:53] teclator: has joined #ruby
[22:38:00] ekinmur: has joined #ruby
[22:38:30] jessemcgilallen: has joined #ruby
[22:38:56] ekinmur: has joined #ruby
[22:38:57] tsunamie: is anyone able to help me with the following guide? I did code academy now I am doing online stuff to try and get more experience
[22:39:11] tsunamie: http://ruby.bastardsbook.com/chapters/web-crawling/ is the guide I am following
[22:39:32] tsunamie: however I am trying to understand the difference between Mechanize and Nokogiri
[22:39:40] htmldrum: has joined #ruby
[22:39:44] tsunamie: how do I find out? IS there like a javadocs eqiviliant?
[22:39:53] zenguy_pc: has joined #ruby
[22:40:12] shmilan: has joined #ruby
[22:40:16] yfeldblum: has joined #ruby
[22:42:37] ellisTAA: has joined #ruby
[22:43:33] maxz: has joined #ruby
[22:44:24] Oatmeal: has joined #ruby
[22:44:42] momomomomo: has joined #ruby
[22:44:43] htmldrum: has joined #ruby
[22:45:37] lemur: has joined #ruby
[22:46:34] Ox0dea: tsunamie: Parsing XML and driving a browser are very different things.
[22:46:37] moeabdol: has joined #ruby
[22:47:29] tsunamie: sp Mechanize is for parsing XML? As I can see from nokriki I am taking in HTML as a massive string and this gem seems to have the ability to parse over it
[22:48:19] ruurd: has joined #ruby
[22:48:29] manveru: mechanize automates browsing, it clicks links, fills forms, etc
[22:48:30] Ox0dea: tsunamie: Then why would you assume Mechanize was the XML parser in my comparison?
[22:49:32] manveru: nokogiri parses and modifies xml and html using xpath, css, SAX, and other stuff
[22:49:52] tsunamie: I see, Ox0dea sorry I have only seen a few docs on MEchanize. I have read more on Nokogiri
[22:50:04] tsunamie: manveru, I nsee
[22:50:10] tsunamie: looks like I need to read more
[22:50:12] dnomyar: has joined #ruby
[22:50:21] DarkBushido: has joined #ruby
[22:50:33] manveru: just try them, they are both fun :)
[22:50:52] manveru: well, relatively speaking anyway
[22:51:33] ruby-lang498: has joined #ruby
[22:52:06] tsunamie: manveru, I feel stiupid
[22:52:56] tsunamie: manveru, the codeacademy stuff is so much simpler than these guides. like for example.
[22:53:27] exadeci: has joined #ruby
[22:53:33] tsunamie: in this guide - http://ruby.bastardsbook.com/chapters/web-crawling/ - the section of code. http://pastebin.com/v0dZJiC7
[22:53:33] ruboto: tsunamie, as I told you already, please use https://gist.github.com
[22:54:12] rob_: has left #ruby: ()
[22:54:13] A124: has joined #ruby
[22:54:13] A124: has joined #ruby
[22:54:32] tsunamie: I get it's looping throught rows. and that it looping throught rows. How ever I am currently assuming that rows is a string
[22:54:52] jinie: has joined #ruby
[22:55:35] tsunamie: and that each value is having css selector run throught them all. However I am getting stuck on the row.css("td a").map{ |a|
[22:55:36] tsunamie: a['href'] if a['href'].match("/wiki/")
[22:55:36] tsunamie: }.compact.uniq
[22:56:01] tsunamie: manveru, I am trying to understand lines 2-4
[22:56:12] johnhamelink: has joined #ruby
[22:56:22] manveru: well, what don't you understand about it?
[22:56:36] manveru: what map is? what 'td a' selects? what an href is?
[22:56:59] tsunamie: manveru, I think a better question is. IS there an eqiviliant to javadoc's for ruby. Where I can lookup methodes roles, actions and so on for specific objects?
[22:57:12] tsunamie: manveru, I think teaching me how to fish is the best way to go
[22:57:27] Azure: has joined #ruby
[22:57:34] manveru: ruby-doc usually
[22:57:53] Ox0dea: tsunamie: In your defense, that code isn't great.
[22:57:54] ruby-lang498: im trying to open a txt file, pass all data into a new array and then match the array value with hash keys and im having some trouble...
[22:57:58] jessemcgilallen: has joined #ruby
[22:58:09] ruby-lang498: some help would be appreciated...
[22:58:13] manveru: https://rubygems.org/gems/nokogiri rubygems almost always has a link to the docs
[22:58:35] ruby-lang498: warning: ive not included all code for simplification purposes, so instance variable ARE in a class...
[22:58:40] Ox0dea: tsunamie: Well, never mind; I realize they do want the href attributes themselves, not just the links for which the attribute matches.
[22:58:47] ruby-lang498: https://gist.github.com/t0code/3020bc19e2b739e85626
[22:59:18] ruurd: has joined #ruby
[22:59:28] manveru: oh nice, a savegame?
[22:59:30] nibbo: has joined #ruby
[22:59:55] tsunamie: manveru, Ox0dea thanks
[23:00:35] manveru: ruby-lang498: what's the format of that txt file?
[23:00:40] manveru: is it just one line per item?
[23:01:09] ruby-lang498: or item per line that is.
[23:01:32] tsunamie: gaaa so I am really confused now
[23:01:49] stannard: has joined #ruby
[23:01:49] djbkd: has joined #ruby
[23:02:14] netule: ruby-lang498 take a look at http://ruby-doc.org/core-2.2.2/IO.html#method-c-readlines
[23:02:29] chipotle: has joined #ruby
[23:02:35] tsunamie: http://www.nokogiri.org/tutorials/parsing_an_html_xml_document.html so what is the objects that gets created from doc = Nokogiri::HTML(open("http://www.threescompany.com/"))
[23:02:40] tsunamie: I understood it to be a string
[23:03:02] Mia: has joined #ruby
[23:03:31] EminenceHC: has joined #ruby
[23:03:40] yfeldblum: has joined #ruby
[23:03:57] tsunamie: so no, humm so doc or whatever I parse using Nokogiri::HTML is a Nokogiri documents
[23:04:00] lkba: has joined #ruby
[23:04:26] manveru: ruby-lang498: https://gist.github.com/manveru/4380e9fd4f17278931e0
[23:04:39] diegoviola: has joined #ruby
[23:05:36] manveru: ruby-lang498: most important is probably the strip, since otherwise your item lines have newlines at the end
[23:05:49] ruby-lang498: im unframiliar with strip
[23:05:59] manveru: welcome to the strip club
[23:06:20] ruby-lang498: i can google it but got a brief explanation of its use?
[23:06:36] manveru: it removes whitespace at the start and end of a string
[23:06:37] Ox0dea: &ri String#strip @ ruby-lang498
[23:06:37] `derpy: : http://www.rubydoc.info/stdlib/core/String#strip-instance_method
[23:06:51] jessemcgilallen: has joined #ruby
[23:07:06] adaedra: ACTION should look at fixing the bot.
[23:07:08] manveru: " foo\n ".strip == "foo"
[23:07:39] TomyWork: has joined #ruby
[23:10:51] kimegede: has joined #ruby
[23:11:43] northfurr: has joined #ruby
[23:12:16] Spami: has joined #ruby
[23:13:52] tsunamie: okay starting to understand that it's it's own object and not a string. http://www.nokogiri.org/tutorials/modifying_an_html_xml_document.html
[23:14:15] kerunaru: has joined #ruby
[23:14:26] mistermocha: has joined #ruby
[23:15:03] ruurd: has joined #ruby
[23:15:10] davedev24: has joined #ruby
[23:15:20] tsunamie: manveru, Ox0dea do you know how the logic for this works? row.css("td a").map?
[23:15:36] phutchins: has joined #ruby
[23:15:39] tsunamie: so I get that row is an Nokogiri::HTML object
[23:16:03] tsunamie: and that css is simply a method of that object that allows your the parse for items with that identification in the xml
[23:16:17] riotjones: has joined #ruby
[23:16:28] Ox0dea: tsunamie: Just so; #map is just a method on Enumerable that transforms the collection however you specify in the body of the block.
[23:16:32] _stu_: has joined #ruby
[23:16:33] tsunamie: however I don't understand where they got the map method from as I can't see it in the nologiri documents. So I assuming it's the method thats apart of an array
[23:16:51] Ox0dea: tsunamie: #map is a core method provided by the Enumerable module.
[23:16:59] Ox0dea: >> [1,2,3].map { |n| n + 1 } # tsunamie
[23:17:00] ruboto: Ox0dea # => [2, 3, 4] (https://eval.in/463958)
[23:17:07] Ox0dea: It's available on anything which responds to #each.
[23:17:17] radgeRayden: has joined #ruby
[23:17:27] Ox0dea: It's arguably the most used and useful method in all of Ruby.
[23:18:10] mistermocha: has joined #ruby
[23:18:24] tsunamie: Ox0dea, http://ruby-doc.org/core-2.2.3/Enumerable.html
[23:18:33] tsunamie: is that what I should be reading?
[23:18:40] Ox0dea: tsunamie: Yes, Enumerable is <3.
[23:18:42] ruby-lang498: manveru, why is it attaching a "/n" too the strings it add?
[23:19:39] radgeRayden_: has joined #ruby
[23:21:21] tsunamie: Ox0dea, so how do I know what objects I can run each on? As I understand it Nokogiri is it's own object right? Which is a gem that structures the HTML into a searchable object
[23:21:26] donske: has joined #ruby
[23:21:35] CloCkWeRX1: has joined #ruby
[23:21:35] tsunamie: so how did it know each method could be used on it?
[23:22:00] tsunamie: or how do I know what methodes can be run on a Nokogiri object? Since each is not in the docs for it
[23:22:37] ericwood: tsunamie: don't node lists include enumerable? if so you can use any method in the enumerable module (in the ruby docs)
[23:22:39] tsunamie: Ox0dea, I feel like I am missing something. A fundermental understanding. Like how actaully nokogiri is just a set of arrays/hashs
[23:22:48] apeiros: tsunamie: don't forget the ancestry
[23:22:55] simplyianm: has joined #ruby
[23:22:58] apeiros: classes inherit from other classes and include modules.
[23:23:00] ericwood: apeiros: respect your ancestors
[23:23:14] Ox0dea: has joined #ruby
[23:23:21] ericwood: tsunamie: aha I was right: http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/NodeSet
[23:23:31] ericwood: "Includes: Enumerable, Searchable"
[23:23:44] ericwood: tsunamie: http://ruby-doc.org/core-2.2.3/Enumerable.html
[23:23:56] jdawgaz: has joined #ruby
[23:24:02] apeiros: tsunamie: and you can always ask ruby from where something comes and what methods an object supports (except methods via method_missing)
[23:24:11] apeiros: see Object#respond_to? and #methods
[23:24:15] apeiros: and Method#owner
[23:24:17] Ox0dea: s/from where/whence/
[23:24:25] Ox0dea: apeiros: Why do you hate beautiful language?
[23:24:56] ericwood: I could have sworn apeiros and ruby were bffs
[23:25:03] apeiros: Ox0dea: to upset you
[23:25:05] ericwood: but, I haven't been active here in ages
[23:25:07] Ox0dea: apeiros: I knew it!
[23:25:10] dave1984: has joined #ruby
[23:25:20] apeiros: Ox0dea: we all do, teehee
[23:25:37] apeiros: ericwood: Ox0dea refers to english, not ruby ;-)
[23:25:40] tsunamie: wait okay apeiros sorry to make you spell it out for me. How do I check or find out?
[23:25:44] NeverDie: has joined #ruby
[23:25:48] haylon: has joined #ruby
[23:26:16] Ox0dea: >> Array.instance_method(:map).owner # tsunamie
[23:26:17] ruboto: Ox0dea # => Array (https://eval.in/463959)
[23:26:19] apeiros: >> {}.method(:find).owner
[23:26:21] ruboto: apeiros # => Enumerable (https://eval.in/463960)
[23:26:40] apeiros: -> the method "find" on that hash came from Enumerable
[23:26:45] Ox0dea: tsunamie: Array overrides #map for performance reasons, but many of its other methods come directly from Enumerable.
[23:27:03] Oatmeal: has joined #ruby
[23:27:04] apeiros: Ox0dea: yeah, I checked first in pry since a couple are overridden in core :)
[23:27:15] Ox0dea: Sneaky devil.
[23:27:28] Ox0dea: tsunamie: https://eval.in/463961
[23:27:52] dave1984: I'm trying to create a collection so I can group my "projects". I made a folder called _projects/, added the collection and output: true in my _config.yml, and tried looping through it with {% for project in site.projects %} <h1>{{ project.title }}</h1> {% endfor %}. But it's not finding anything. Did I miss a step?
[23:27:55] Ox0dea: Simply by defining your own #each (which should yield all your thing's elements in turn) and including Enumerable, you get >50 methods "for free".
[23:28:00] kalusn: has joined #ruby
[23:28:01] tsunamie: apeiros, so you saying if I run {}.method(:find).owner where inside the {} is the method it will show me the original owner
[23:28:10] Ox0dea: tsunamie: No, {} is a Hash literal.
[23:28:16] Ox0dea: >> {}.class
[23:28:17] ruboto: Ox0dea # => Hash (https://eval.in/463962)
[23:28:25] Ox0dea: >> Hash.include? Enumerable # tsunamie
[23:28:26] ruboto: Ox0dea # => true (https://eval.in/463963)
[23:28:32] apeiros: {} is an example of an object you want to query
[23:28:48] zenspider_: >> {}.method(:method)
[23:28:49] ruboto: zenspider_ # => #<Method: Hash(Kernel)#method> (https://eval.in/463964)
[23:28:55] apeiros: you do my_obj.method(method_i_want_to_know_where_it_comes_from).owner
[23:29:25] Ox0dea: >> require 'prime'; 1.prime? # zenspider_
[23:29:26] ruboto: Ox0dea # => false (https://eval.in/463965)
[23:30:35] shazaum_: has joined #ruby
[23:30:35] ruurd: has joined #ruby
[23:30:55] apeiros: dave1984: you missed the step of telling us what the heck you're talking about
[23:31:12] dave1984: apeiros: lol my bad, did I ever
[23:31:19] dave1984: jekyll, though I found a irc chan for it
[23:31:40] zenspider_: Ox0dea: welcome to math?
[23:32:09] Ox0dea: zenspider_: Cicadas.
[23:32:10] tsunamie: okay trying to absorb all of this, please be gental
[23:32:18] baweaver: has joined #ruby
[23:32:26] zenspider_: dave1984: I think that exact code would work fine in zenweb :)
[23:32:54] apeiros: beware, the spider lures in the zenweb
[23:32:59] zenspider_: Ox0dea: that's nice
[23:33:07] dave1984: zenspider_: are you plugging something? I have no idea what that is
[23:33:12] EminenceHC: has joined #ruby
[23:33:26] apeiros: oh, lurk, not lure
[23:33:27] tsunamie: okay does anyone know how I can run this on a command line?
[23:33:27] tsunamie: Array.instance_method(:map).owner
[23:33:30] opensource_ninja: has joined #ruby
[23:33:44] lacrymol1gy: has joined #ruby
[23:33:48] zenspider_: tsunamie: either `ruby -e 'code'` or fire up irb and do it in there
[23:33:54] Ox0dea: zenspider_: "Mind of a Hacker" was a nice listen, but 1 is composite, so you're a bad cicada.
[23:34:04] Axsuul: has joined #ruby
[23:34:05] Ox0dea: s/composite/not prime/
[23:34:22] rickmasta: has joined #ruby
[23:34:39] nateberkopec: has joined #ruby
[23:34:41] simplyianm: has joined #ruby
[23:34:43] lacrymol1gy: I've got a list with hashes, and I want to map it into a list of a certain field: [{foo: 1, bar: 2}, {foo: 3, bar: 4}].pluck(:foo) => [1, 3]
[23:34:49] lacrymol1gy: is there an idiom for this?
[23:34:52] zenspider_: again: that's nice.
[23:34:58] tsunamie: zenspider_, irb? I have cygwin and I just ran ruby -e "Array.instance_method(:map).owner"
[23:34:58] tsunamie: and it gave me nothing back
[23:35:12] zenspider_: tsunamie: you didn't ask it to print anytihng
[23:35:17] zenspider_: puts or p in front
[23:35:24] zenspider_: irb should work for you
[23:35:29] zenspider_: if it doesn't, something is wrong
[23:35:35] tmtwd: has joined #ruby
[23:36:06] axsuul_: has joined #ruby
[23:36:22] tsunamie: okay I think I am going to far for tonight
[23:36:26] tsunamie: my brain is about to explode
[23:36:27] zenspider_: lacrymol1gy: we wouldn't have a method on array specific to accessing sub-hashes. Instead, use #map: hashes.map { |h| h[:key] }
[23:36:50] zenspider_: >> [].method(:map)
[23:36:51] ruboto: zenspider_ # => #<Method: Array#map> (https://eval.in/463966)
[23:37:05] zenspider_: >> [].method(:find)
[23:37:06] ruboto: zenspider_ # => #<Method: Array(Enumerable)#find> (https://eval.in/463967)
[23:37:11] zenspider_: see the difference?
[23:37:14] rbennacer: has joined #ruby
[23:37:32] zenspider_: map is specifically on Array, where find is actually in Enumerable
[23:38:26] prasselpikachu: has joined #ruby
[23:38:32] Iacobus: has joined #ruby
[23:38:50] MiracleBlue: has joined #ruby
[23:39:39] ujjain: has joined #ruby
[23:39:39] ujjain: has joined #ruby
[23:40:59] nopolitica: has joined #ruby
[23:41:10] ruurd: has joined #ruby
[23:42:01] soloone: has joined #ruby
[23:42:36] EasyCo: has joined #ruby
[23:43:01] idefine: has joined #ruby
[23:43:42] Iacobus: has joined #ruby
[23:44:43] jobewan: has joined #ruby
[23:46:37] diegok: has joined #ruby
[23:47:13] _aeris_: has joined #ruby
[23:48:05] EminenceHC: has joined #ruby
[23:48:05] tsunamie: humm... okay I am not saying I understand fully. However I think something went in
[23:49:21] arthurix_: has joined #ruby
[23:49:29] Trieste: has joined #ruby
[23:50:27] postmodern: has joined #ruby
[23:51:16] atomical: has joined #ruby
[23:51:29] chipotle: has joined #ruby
[23:51:48] Ox0dea: tsunamie: You are experiencing the pain and confusion of attempting to run without legs.
[23:51:52] bruno-: has joined #ruby
[23:51:57] Ox0dea: Learn Ruby first.
[23:52:13] tsunamie: Ox0dea, how, I did codeacademy
[23:52:24] tsunamie: what would you sugest I do?
[23:53:23] mistermocha: has joined #ruby
[23:53:48] tsunamie: I give you an example of stuff not covered in that online course. I have looked at this guide. http://ruby.bastardsbook.com/chapters/html-parsing/, I have looked at these tutorials for http://www.nokogiri.org/tutorials/modifying_an_html_xml_document.html and I have read some of the tabs on http://www.rubydoc.info/github/sparklemotion/nokogiri
[23:54:07] TomyWork: has joined #ruby
[23:54:11] tsunamie: I can not find any where in these docs where css came from and what it does
[23:55:17] tsunamie: the closest I come is a non official giude http://ruby.bastardsbook.com/chapters/html-parsing/ which explains how to use it
[23:55:41] netule: tsunamie, .css is a method that allows you to use CSS selectors to search for elements
[23:55:56] prasselpikachu: has joined #ruby
[23:56:23] tsunamie: netule, Hi, I get that sorry. What I am trying to give myself is the tools to find that info
[23:56:28] tsunamie: in some meaning full way
[23:56:32] Ox0dea: tsunamie: Codecademy never shows you #map?
[23:56:54] idefine_: has joined #ruby
[23:57:07] tsunamie: Ox0dea, it gave me examples of map and how to use it. However that was never my problem. My problem was or the limited stuff that course covered are the absolut basics
[23:57:09] krzkrz: has joined #ruby
[23:57:26] tsunamie: it instantiated that each object has it's own set of methodes unique to processing the object itself
[23:57:49] tsunamie: It never talked about how to read docs or search for which methods were avaiable to an object or how to check hieachy
[23:57:59] mistermocha: has joined #ruby
[23:58:29] tsunamie: it just assumed you knew all the methodes avaiable to manipulating something. IT never gavce me the fishing rod and said. by the way. Here's how you work out which methodes can be used on the object you just created
[23:58:52] tsunamie: every single example just walked throught like this. Here is a string, ow you can use CAPUP bla bla bla all these methdos
[23:59:11] tsunamie: sorry ranted a bit
[23:59:33] netule: that's what references are for, though. You can hardly expect them to teach you all of the interfaces for all of the classes in Ruby
[23:59:59] Ox0dea: netule: Codecademy is not a "reference"; it advertises that it teaches the student how to use Ruby.