« Back to channel list

#ruby - 16 September 2015

« Back 1 day Forward 1 day »
[00:00:13] hahuang65: has joined #ruby
[00:00:18] beauby: I may have misunderstood but it seemed from the above discussion that I didn't have much of a choice for the try since `constants.includes?` won't play nice with autoloading
[00:02:14] solocshaw: has joined #ruby
[00:03:04] leat1: has joined #ruby
[00:03:07] Ox0dea: beauby: Having #lookup_chain return actual classes rather than strings a la Module#nesting would be an improvement.
[00:03:33] Ox0dea: From there, you'd probably be able to define #lookup in terms of #reduce and #const_get, which would be more performant than starting from the top each time through.
[00:04:01] RazorX: has joined #ruby
[00:04:31] Ox0dea: Also, check that your rescuing Exception hasn't resulted in the smiting of any nearby creatures.
[00:04:46] Ox0dea: #const_get can only ever raise NameError, I'd imagine.
[00:05:13] vikaton: has joined #ruby
[00:06:23] mclee_: has joined #ruby
[00:06:45] RazorX: has joined #ruby
[00:06:47] zapho53: has joined #ruby
[00:06:57] Ox0dea: https://eval.in/434009
[00:07:46] zapho53: has left #ruby: ()
[00:07:50] beauby: Ox0dea: Cool, thanks for the suggestions!
[00:07:54] drbrain: it can raise LoadError
[00:08:34] drbrain: when an autoload file is missing
[00:09:15] jokke: has joined #ruby
[00:10:02] webguynow: has joined #ruby
[00:10:11] beauby: Ox0dea: In order to map the strings to constants I still have to use Kernel.const_get, or is there another way?
[00:10:23] beauby: drbrain: Oh right, good to know
[00:11:22] jokke-: has joined #ruby
[00:12:40] Ox0dea: beauby: You've got easy access to the class/module from which you want to start searching, no?
[00:13:36] charliesome: has joined #ruby
[00:13:58] beauby: Ox0dea: I do
[00:14:16] workmad3: has joined #ruby
[00:15:07] sgambino: has joined #ruby
[00:15:36] pwnd_nfsw: has joined #ruby
[00:16:34] sufyan``: has joined #ruby
[00:16:35] tejasmanohar: has joined #ruby
[00:16:54] amclain_: has joined #ruby
[00:16:54] matled-: has joined #ruby
[00:17:02] cvtsx1: has joined #ruby
[00:17:11] dravine_: has joined #ruby
[00:17:20] `derpy: has joined #ruby
[00:17:26] Pisuke: has joined #ruby
[00:17:56] Sdwrage_: has joined #ruby
[00:18:08] mkosaki_: has joined #ruby
[00:18:27] opensource_ninj1: has joined #ruby
[00:18:33] beauby: Ox0dea: How about https://gist.github.com/beauby/f8ddb8b99228ad131a2d (comment)?
[00:18:50] beauby: (it uses ActiveSupport's constantize)
[00:19:16] sepp2k1: has joined #ruby
[00:19:25] eregon_: has joined #ruby
[00:19:34] ghoti_: has joined #ruby
[00:19:41] beauby: which probably is totally unnecessary actually
[00:19:52] HashNuke_: has joined #ruby
[00:19:58] colstrom_: has joined #ruby
[00:20:16] prosody_: has joined #ruby
[00:20:43] nizmow-: has joined #ruby
[00:20:47] jxie: has joined #ruby
[00:20:48] ipstatic_: has joined #ruby
[00:20:56] Fraeon: has joined #ruby
[00:20:58] scpike_: has joined #ruby
[00:21:05] petersaints_: has joined #ruby
[00:21:08] izzol2: has joined #ruby
[00:21:12] sonne_: has joined #ruby
[00:21:17] totimkop1: has joined #ruby
[00:21:26] shortdudey123_: has joined #ruby
[00:21:27] bier_: has joined #ruby
[00:21:41] A124: has joined #ruby
[00:21:41] Ox0dea: beauby: Ah, sorry; forgot you're trying to do it the other way round. Building the array to search with ActiveSupport's Module#parent seems the way to go.
[00:21:41] A124: has joined #ruby
[00:21:48] mhenrixon_: has joined #ruby
[00:21:56] jidar_: has joined #ruby
[00:22:06] pocketpr1: has joined #ruby
[00:22:24] farn: has joined #ruby
[00:22:30] Ox0dea: That's fair.
[00:22:30] romain_t: has joined #ruby
[00:22:44] alexUaN: has joined #ruby
[00:22:51] Ropeney: has joined #ruby
[00:23:05] beauby: Ox0dea: The problem with AS#parent is that there is no class version afaik
[00:23:18] Ox0dea: beauby: Classes are modules.
[00:23:26] jidar: has joined #ruby
[00:23:38] jgt: has joined #ruby
[00:24:08] pocketprotector: has joined #ruby
[00:24:13] mordocai: has joined #ruby
[00:24:20] M-Kodo: has joined #ruby
[00:24:26] beauby: Ox0dea: Oh, right. Then I might very well have been looking for #parent all along
[00:24:32] Ox0dea: I think so. :)
[00:24:47] cirera: has joined #ruby
[00:25:14] michael_imac: has joined #ruby
[00:25:54] radgeRayden: has joined #ruby
[00:26:26] northfurr: has joined #ruby
[00:26:53] solocshaw: has joined #ruby
[00:26:58] beauby: Cool, thanks for the help Ox0dea
[00:27:18] eggoez: has joined #ruby
[00:27:38] beauby: Wait, no, actually parent does not cut it
[00:27:55] AccordsLTN: has joined #ruby
[00:27:57] borkdude_: has joined #ruby
[00:28:03] djbkd: has joined #ruby
[00:29:34] dorei: is there a way i could smt like attr_reader :delete?
[00:30:16] _MiW: has joined #ruby
[00:30:38] harryk_: has joined #ruby
[00:30:39] DanKnox_: has joined #ruby
[00:31:03] jgt: has joined #ruby
[00:31:14] thang_: has joined #ruby
[00:31:25] bubuntu: has joined #ruby
[00:31:26] abyss__: has joined #ruby
[00:31:29] hackeron_: has joined #ruby
[00:31:30] livcd_: has joined #ruby
[00:31:32] zm1: has joined #ruby
[00:31:33] Skelz0r_: has joined #ruby
[00:31:44] musl_: has joined #ruby
[00:31:45] cvtsx1: has joined #ruby
[00:32:17] programm1: has joined #ruby
[00:32:36] [H]unt3r: has joined #ruby
[00:32:40] Esya|: has joined #ruby
[00:32:42] gs: has joined #ruby
[00:33:00] troyreadyy: has joined #ruby
[00:33:07] hostess_: has joined #ruby
[00:33:11] neektza_: has joined #ruby
[00:33:40] dede__: has joined #ruby
[00:34:31] mhenrixon: has joined #ruby
[00:34:39] frankS2_: has joined #ruby
[00:35:08] uber_: has joined #ruby
[00:35:40] twistedpixels_: has joined #ruby
[00:36:07] prasselpikachu_: has joined #ruby
[00:36:11] jhass|off: has joined #ruby
[00:36:12] jalcine: has joined #ruby
[00:36:14] TvL: has joined #ruby
[00:36:20] shmilan: has joined #ruby
[00:36:23] arian0n: has joined #ruby
[00:36:32] ddv: has joined #ruby
[00:36:38] veduardo: has joined #ruby
[00:37:38] siaW: has joined #ruby
[00:37:43] zion__: has joined #ruby
[00:37:48] DEac-: has joined #ruby
[00:37:52] bspar: has joined #ruby
[00:37:53] LiquidInsect: has joined #ruby
[00:37:58] trbss: has joined #ruby
[00:38:07] noodle: has joined #ruby
[00:38:13] pragmatism: delete is reserved.
[00:38:16] mclee_: has joined #ruby
[00:39:16] Ox0dea: has joined #ruby
[00:39:26] xnr: has joined #ruby
[00:40:02] Ox0dea: beauby: Hm?
[00:40:14] musicmatze: has joined #ruby
[00:40:30] cball: has joined #ruby
[00:40:46] chouhoulis: has joined #ruby
[00:41:01] Oog: has joined #ruby
[00:41:13] Guest13124: has joined #ruby
[00:41:50] moss: has joined #ruby
[00:42:30] podman: has joined #ruby
[00:42:30] Nanuq: has joined #ruby
[00:42:30] null__: has joined #ruby
[00:42:30] romain_t: has joined #ruby
[00:42:30] cookiez: has joined #ruby
[00:42:30] niko: has joined #ruby
[00:42:32] podman: has joined #ruby
[00:42:39] cjk101010: has joined #ruby
[00:42:39] goncalo: has joined #ruby
[00:42:39] unsymbol: has joined #ruby
[00:42:39] A124: has joined #ruby
[00:42:39] rcvalle: has joined #ruby
[00:42:39] nofxx: has joined #ruby
[00:42:39] mahlon: has joined #ruby
[00:42:58] null__: has joined #ruby
[00:43:02] unsymbol: has joined #ruby
[00:43:14] Trieste: has joined #ruby
[00:43:36] an0ma1y: has joined #ruby
[00:43:42] ckinniburgh_: has joined #ruby
[00:44:26] cajone: has joined #ruby
[00:44:37] NeverDie: has joined #ruby
[00:44:41] dorei: pragmatism: i'm wondering about it ending in '?', is there a way to use attr_reader to define a getter method ending in'?' ?
[00:45:16] Ox0dea: dorei: No, because instance variables can't end with '?'.
[00:45:35] juanpablo_: has joined #ruby
[00:45:48] Ox0dea: Hasn't this come up before?
[00:45:52] zion__: has left #ruby: ()
[00:46:33] Ox0dea: Rolling your own #attr_reader is trivial if you absolutely need this, mind.
[00:46:46] dorei: i'm aware about instance variables , i was just hopping that attr_reader could just use an instance variable without the trailing ?
[00:46:47] bspar: has left #ruby: ("HEEEEEEELP")
[00:46:53] segmond: has joined #ruby
[00:47:07] dorei: no way, that would be overengineering :p
[00:47:25] papercode: has joined #ruby
[00:47:45] Ox0dea: Then you're out of "luck", for some strange definition of the term.
[00:49:52] eam: >> instance_variable_set '@??', "you're not the boss of me"
[00:49:53] ruboto: eam # => "you're not the boss of me" (https://eval.in/434062)
[00:49:59] Ox0dea: beauby: That you basically want to "detach" children from the hierarchy is what muddies the water here.
[00:50:12] dorei: spanish questionmark :D
[00:50:45] Ox0dea: >> @?? = 42 # Ruby supports fancy identifiers, eam.
[00:50:49] ruboto: Ox0dea # => 42 (https://eval.in/434064)
[00:50:49] CustosL1men: has joined #ruby
[00:51:03] dorei: does it support emoji in ivars too? :D
[00:51:08] Ox0dea: Yes, of course.
[00:51:15] Ox0dea: There are many languages which do so.
[00:51:25] eam: Ox0dea: I guess I didn't need to dance around it
[00:51:28] Ox0dea: Indeed not.
[00:51:42] eam: fun idea I had: put the entire method documentation in the method name
[00:51:51] eam: that way your method is never out of sync with the docs
[00:51:52] dorei: so, only mysql fucked it up with utf, having different type for 3bytes utf and 4bytes utf
[00:53:24] Hamled: is there a ruby one liner for something like my_str = ""; if (other_str.empty?) my_str = "prefix" + other_str;
[00:53:50] Hamled: or just the most idiomatic way to do that I guess
[00:54:02] siemprefresco: has joined #ruby
[00:54:13] totimkop1: has left #ruby: ()
[00:55:03] eam: other_str.empty? ? "" : "prefix" + other_str
[00:55:09] siaW: has joined #ruby
[00:55:13] goodcodeguy: has joined #ruby
[00:55:14] Ox0dea: Hamled: It's not entirely clear what you're going for there. You want `my_str` to remain empty if `other_str` isn't?
[00:55:31] BlackCoyote: has joined #ruby
[00:55:38] eam: assuming ternary operators don't get you strung up by your thumbs in your circle of technical people
[00:55:53] Hamled: Ox0dea, oh sorry I meant .present
[00:56:03] Hamled: hmmm yeah I forget ruby has the ternary
[00:56:09] JDiPierro: has joined #ruby
[00:56:13] Hamled: it's so... it feels too ugly for ruby :P
[00:57:01] failshell: has joined #ruby
[00:57:03] jsaak: has joined #ruby
[00:57:34] saddad: has joined #ruby
[00:57:53] Ox0dea: Hamled: Such sweet innocence. :P
[00:57:57] Ox0dea: Bless you.
[00:58:27] Hamled: well okay, I should say something closer to, it feels too ugly for what I would like ruby to be :)
[00:58:54] Ox0dea: Ruby comfortably occupies either end of the spectrum.
[00:59:01] elfuego: has joined #ruby
[00:59:08] nettoweb: has joined #ruby
[01:00:05] dasher00: has joined #ruby
[01:00:33] Ox0dea: Hamled: May I show you something?
[01:01:22] Ox0dea: Are you familiar with FizzBuzz? ;)
[01:05:31] jalcine: has left #ruby: ("I'm out.")
[01:05:36] Ox0dea: Hamled: Well, never mind. I shouldn't spoil your perception of Ruby's beauty.
[01:05:54] Ox0dea: If you don't like the ternary operator, you might prefer interpolating a post-conditional?
[01:06:09] Ox0dea: >> "#{'4' if true}2"
[01:06:10] ruboto: Ox0dea # => "42" (https://eval.in/434070)
[01:09:18] bigmac: has joined #ruby
[01:09:20] powpie: has joined #ruby
[01:10:04] Hamled: Ox0dea, the thing I am getting with the ternary is that if the interpolated post-conditional is false, the entire string ends up as empty
[01:12:13] Ox0dea: Hamled: Ah, right. Yeah, ternary's ideal, then. :/
[01:12:35] dorei: is there a way to create an immutable hash? other than encapsulating the hash in a class and forwarding only methods that dont mutate it
[01:12:37] Ox0dea: `foo? ?` just rubs me the wrong way.
[01:12:48] trbss: has left #ruby: ()
[01:12:52] Ox0dea: dorei: Freeze it?
[01:13:15] dorei: that's an interesting idea :) probably it'll be the first i'll use freeze :)
[01:13:21] dorei: first time
[01:13:56] Ox0dea: Be advised that it'll be a shallow freeze.
[01:14:13] Ox0dea: Mutable keys and values will remain so.
[01:14:31] Ox0dea: You probably don't have any mutable keys, though.
[01:16:18] boynt: has joined #ruby
[01:17:42] boynt: has left #ruby: ()
[01:19:17] keen__________21: has joined #ruby
[01:19:28] JDiPierro: has joined #ruby
[01:19:57] jsaak: has joined #ruby
[01:25:14] Guest5: has joined #ruby
[01:26:56] leat1: has joined #ruby
[01:29:21] drewvanstone: has joined #ruby
[01:30:28] lampshades: has joined #ruby
[01:31:34] phutchins: has joined #ruby
[01:33:12] grenierm: has joined #ruby
[01:33:54] havenwood: has joined #ruby
[01:34:17] ferz_: has joined #ruby
[01:34:35] jenrzzz: has joined #ruby
[01:35:42] tjbiddle: has joined #ruby
[01:37:09] jgt: has joined #ruby
[01:39:27] chipotle: has joined #ruby
[01:40:29] beast: has joined #ruby
[01:42:22] ledestin: has joined #ruby
[01:42:58] unholycrab: has joined #ruby
[01:46:01] aaeron: has joined #ruby
[01:46:19] cajone: has joined #ruby
[01:48:03] tkuchiki: has joined #ruby
[01:48:58] urbanmonk: has joined #ruby
[01:49:46] bigmac: has left #ruby: ()
[01:49:46] bigmac: has joined #ruby
[01:49:47] luckyme: has joined #ruby
[01:50:08] bigmac: has left #ruby: ()
[01:51:05] chipotle_: has joined #ruby
[01:56:55] iamninja: has joined #ruby
[01:57:10] goodcodeguy: has joined #ruby
[01:57:58] CustosL1men: has joined #ruby
[02:01:30] tjbiddle: has joined #ruby
[02:02:35] amoeba`: has joined #ruby
[02:03:00] workmad3: has joined #ruby
[02:04:14] chipotle: has joined #ruby
[02:04:42] dravine_: has joined #ruby
[02:06:06] choke: has joined #ruby
[02:07:19] havenwood: has joined #ruby
[02:09:25] A124: has joined #ruby
[02:10:05] towski_: has joined #ruby
[02:12:18] drewvanstone: has joined #ruby
[02:13:08] horsecowdog: has joined #ruby
[02:17:11] Maletor: has joined #ruby
[02:17:18] drewvanstone: has joined #ruby
[02:17:32] c_nick: has joined #ruby
[02:18:59] siempref_: has joined #ruby
[02:20:31] gambl0re: has joined #ruby
[02:22:38] slackbotgz: has joined #ruby
[02:23:22] goncalo_: has joined #ruby
[02:24:24] an0ma1y-: has joined #ruby
[02:24:50] howdoicomputer: has joined #ruby
[02:25:32] tmtwd: has joined #ruby
[02:27:27] baweaver: has joined #ruby
[02:27:43] unsymbol_: has joined #ruby
[02:27:53] failshell: has joined #ruby
[02:29:14] mahlon: has joined #ruby
[02:30:18] romain_t: has joined #ruby
[02:30:22] nofxx: has joined #ruby
[02:30:22] nofxx: has joined #ruby
[02:31:09] karapetyan: has joined #ruby
[02:33:59] A124: has joined #ruby
[02:33:59] cjk101010: has joined #ruby
[02:34:00] juanpablo_: has joined #ruby
[02:34:18] podman: has joined #ruby
[02:34:18] Nanuq: has joined #ruby
[02:34:18] null__: has joined #ruby
[02:34:29] cookiez: has joined #ruby
[02:34:48] chipotle_: has joined #ruby
[02:34:53] Trieste: has joined #ruby
[02:35:40] CustosL1men: has joined #ruby
[02:35:47] Guest37749: has joined #ruby
[02:35:54] howdoicomputer: has joined #ruby
[02:36:09] ecksit: has joined #ruby
[02:36:35] xcesariox: has joined #ruby
[02:37:18] rcs: has joined #ruby
[02:37:21] leat1: has joined #ruby
[02:38:28] shakes: has joined #ruby
[02:39:03] cantaberry: has joined #ruby
[02:40:56] c_nick: Need a regex for capturing -1.114e-12234 in a string .. I tried with \b[+-]*\d+[.]\d+[eE]*[+-]*\d+\b but is there a better way to do it?
[02:41:26] EminenceHC: has joined #ruby
[02:43:19] jgt: has joined #ruby
[02:43:43] stardiviner: has joined #ruby
[02:45:07] Rubie: has joined #ruby
[02:46:01] jxv: has joined #ruby
[02:46:41] tjbiddle: has joined #ruby
[02:46:50] Ox0dea: c_nick: Are you sure you need to do this?
[02:47:23] ruboto: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[02:49:58] Lovich: has joined #ruby
[02:50:10] webguynow: has joined #ruby
[02:51:48] zapata: has joined #ruby
[02:53:28] rgb-one: has joined #ruby
[02:53:30] inteq: has joined #ruby
[02:53:39] chipotle: has joined #ruby
[02:53:41] ngscheurich: has joined #ruby
[02:54:05] Rubie: has joined #ruby
[02:55:20] Oog: has joined #ruby
[02:58:07] iateadonut: has joined #ruby
[02:59:29] c_nick: has joined #ruby
[02:59:46] c_nick: Hi sorry I got disconnected couldn't read any message
[03:00:24] mrtomme: has joined #ruby
[03:00:47] eam: c_nick: the best way is to tokenize on whitespace and use something like Float("1.2")
[03:00:53] gener1c_: has joined #ruby
[03:01:01] Ox0dea: eam: What's whitespace got to do with it?
[03:01:17] eam: I'm assuming it's delimiting the number :)
[03:01:57] eam: if that's not the case then bounds get tricky
[03:02:17] Ox0dea: >> Float(' -1.114e-12234 ') rescue :invalid # c_nick, eam
[03:02:18] ruboto: Ox0dea # => -0.0 (https://eval.in/434094)
[03:02:55] Ox0dea: c_nick: If you don't actually need to parse out the constituent parts, the conventionally wise approach is presented above.
[03:03:13] eam: yeah, I say tokenize on whitespace because while whitespace is OK inside Float(), other stuff won't be
[03:03:18] eam: so you'll have to tokenize on *something*
[03:03:52] bmurt: has joined #ruby
[03:04:00] havenwood: >> Rational('-1.114e-12234')
[03:04:00] baweaver: c_nick: ?xy
[03:04:01] Ox0dea: Shit, I completely misinterpreted c_nick's question.
[03:04:01] ruboto: havenwood # => (-557/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ...check link for more (https://eval.in/434095)
[03:04:05] eam: >> Float('dunno, maybe the data looks like -1.114e-12 or something')
[03:04:06] ruboto: eam # => invalid value for Float(): "dunno, maybe the data looks like -1.114e-12 or something" (ArgumentError ...check link for more (https://eval.in/434096)
[03:04:14] Ox0dea: eam: Yeah, I missed that bit.
[03:04:50] c_nick: >Float(' 1.23456 ')
[03:05:01] c_nick: >>Float(' 1.23456 ')
[03:05:02] ruboto: c_nick # => 1.23456 (https://eval.in/434097)
[03:05:06] eam: >> Rational(22/7)
[03:05:06] ruboto: eam # => (3/1) (https://eval.in/434098)
[03:05:22] eam: *chuckle*
[03:05:48] baweaver: >> 'har har i can word -1.114e-12234 something'.split.map { |w| Float(w) rescue nil }.compact
[03:05:49] ruboto: baweaver # => [-0.0] (https://eval.in/434099)
[03:06:09] c_nick: e-12234 is massive so 0.0 is ok
[03:06:22] baweaver: something like that
[03:06:26] chipotle_: has joined #ruby
[03:06:26] Ox0dea: s/massive/infinitesimal/
[03:06:34] eam: it's both, oddly enough
[03:07:50] c_nick: essentially what i need to do is parse a file, if i find any floating point values (viz. 1.234 1.23e-1234) then i need to process that (viz. truncate to 2 floating points)
[03:08:11] c_nick: so v.gsub!(/\b[+-]*\d+[.]\d+[eE]*.\d+\b/){|o| "%0.2f"%o}
[03:08:31] c_nick: v is everything from the file
[03:09:18] braincrash: has joined #ruby
[03:09:23] eam: c_nick: are they whitespace delimited?
[03:09:26] baweaver: >> 'har har 1.234 i can word -1.114e-12234 something'.split.map { |w| "%0.2f" % Float(w) rescue nil }.compact
[03:09:27] ruboto: baweaver # => ["1.23", "-0.00"] (https://eval.in/434100)
[03:09:30] eam: or can the numbers be embedded in words?
[03:09:36] eam: like abc123def
[03:09:39] baweaver: former is easy
[03:09:52] c_nick: eam: yes Hi I am C_nick 1.2345
[03:09:53] eam: the latter can be ambiguous depending on your allowable syntax for floats
[03:10:05] eam: c_nick: great, in that case definitely do something like what baweaver suggested
[03:10:13] eam: split on \s+
[03:10:19] eam: test each word for Float()
[03:10:31] Ox0dea: c_nick: Your file just has floating point numbers sprinkled all over the place?
[03:10:34] baweaver: not exactly clean per-se to use rescue, but then again there's not much of a better way.
[03:10:40] eam: it'll raise if the string isn't a Float()
[03:10:48] eam: you'll get the same float parser ruby uses
[03:11:04] c_nick: Ox0dea: not really zero or more floats
[03:11:46] chipotle: has joined #ruby
[03:11:51] c_nick: what does compact do /
[03:12:16] Ox0dea: c_nick: I mean to ask whether there isn't some more concrete structure to the thing, such that you might avoid processing every single "word".
[03:12:31] c_nick: oh ok .. so he is removing nil from the array which he gets through map
[03:14:05] webguynow: has joined #ruby
[03:14:15] c_nick: Ox0dea: i am afraid not really
[03:14:40] Ox0dea: c_nick: Was this file generated by Satan?
[03:14:58] c_nick: Ox0dea: lol
[03:15:09] c_nick: Ox0dea: https://eval.in/private/6fb0506e1c6cb7 This is what I wrote
[03:15:25] ruboto: Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
[03:15:38] choke: has joined #ruby
[03:15:49] chipotle_: has joined #ruby
[03:16:13] c_nick: Ideally they are just numbers output from the function
[03:16:16] Gnomethrower: has joined #ruby
[03:17:28] c_nick: so not really any fakes there.. if you really want the exact same thing that here is a sample GetBondStaticData: 1.56238, GetTenors: 5.1298, Currency: USD
[03:18:11] arescorpio: has joined #ruby
[03:18:17] niko: has joined #ruby
[03:18:35] chipotle: has joined #ruby
[03:18:38] c_nick: GetBondStaticData: 1.4E2, GetTenors: 5.1298, Currency: USD
[03:19:49] Rubie: has joined #ruby
[03:19:53] Ox0dea: c_nick: That's the "more concrete structure" I asked you about.
[03:20:08] c_nick: Ox0dea: this is for one file
[03:20:18] c_nick: but i cannot do file wise.. it should work independent
[03:20:28] c_nick: other files wont follow same order
[03:21:04] siemprefresco: has joined #ruby
[03:21:05] c_nick: Eg.3:- 1.23#1.21#4.52
[03:21:07] eam: c_nick: it's a reasonable thing - I wrote something similar once to be used like `cat`
[03:21:13] webguynow: has joined #ruby
[03:21:21] eam: and it'd take numbers and make them "human readable"
[03:21:25] eam: and/or color them
[03:21:34] eam: cat some_file | human_numbers
[03:21:40] Ox0dea: eam: Like numfmt(1)?
[03:21:58] eam: never heard of numfmt
[03:22:49] eam: ah yeah kinda
[03:22:58] eam: but way more DWIM-ish
[03:23:11] eam: and very loose on accepting input and figuring stuff out
[03:23:19] dopamean_: has joined #ruby
[03:24:07] c_nick: eam: cool
[03:24:12] chipotle: has joined #ruby
[03:26:37] havenwood: c_nick: if there was say a "42" would that be a Float `42.00`?
[03:27:02] pontiki: has joined #ruby
[03:27:42] havenwood: Oops, I said that badly.
[03:28:26] havenwood: c_nick: so there must be a period?
[03:28:31] bb010g: has joined #ruby
[03:28:32] c_nick: havenwood: Need to truncate the number beyond 8 decimal point
[03:28:41] eam: havenwood: oh good point, you'd want to test a series of number parsers
[03:28:46] havenwood: c_nick: ah, but an integer alone would count?
[03:28:48] c_nick: havenwood: yes
[03:29:02] Ox0dea: >> '%02g' % 42 # c_nick, eam, havenwood
[03:29:03] ruboto: Ox0dea # => "42" (https://eval.in/434103)
[03:29:11] mary5030: has joined #ruby
[03:29:12] Ox0dea: It's gonna be okay, gals.
[03:29:26] havenwood: c_nick: For fun: scan /[-+]?\d+(?:\.\d+)?(?:e[-+]?\d+)?/i
[03:29:58] mwlang: has joined #ruby
[03:30:13] MichaelSmith: has joined #ruby
[03:30:26] webguynow: has joined #ruby
[03:30:47] eam: >> %w{1 1.0 batman 1e2}.map {|word| Integer(word) rescue Float(word) rescue :invalid }
[03:30:48] ruboto: eam # => [1, 1.0, :invalid, 100.0] (https://eval.in/434105)
[03:31:16] eam: now, here's the real twist: Do you accept stuff like Infinity or NaN
[03:32:05] c_nick: i forgot what ?: was for
[03:32:19] havenwood: c_nick: non-capture group
[03:32:29] havenwood: c_nick: no backreference
[03:32:31] eam: hm, that's interesting, Integer() accepts -0 and turns it into 0
[03:32:43] eam: shouldn't Integer reject -0 and leave it for Float?
[03:32:46] c_nick: eam: shouldn't be an issue no ?
[03:33:03] eam: well, Integer doesn't have -0
[03:33:06] eam: Float does, though
[03:33:30] eam: I'm not sure how I feel about that
[03:33:49] eam: you could argue the cast is appropriate, but then why doesn't Integer("1.0") work
[03:34:01] eam: I think it's a bug
[03:34:12] darkf: has joined #ruby
[03:34:25] eam: excessively pedantic, just the way I like 'em
[03:34:27] baweaver: https://github.com/baweaver/lexigrapher this sounds a lot like lexigrapher
[03:34:32] baweaver: though it only tells you what it is
[03:34:41] baweaver: I should fix that as that's not too useful...
[03:34:50] c_nick: havenwood: so (?:\.\d+)? means zero or one dont capture
[03:34:54] duggiefresh: has joined #ruby
[03:35:27] havenwood: c_nick: a decimal point and one or more digits, or not - and yeah, no backreference
[03:36:01] Ox0dea: Optional, uncaptured fractional part.
[03:36:41] shmilan: has joined #ruby
[03:37:36] Ox0dea: havenwood: No real need to bother with captures here, though?
[03:38:06] chipotle_: has joined #ruby
[03:38:17] Ox0dea: gsub(foo) { |m|
[03:38:23] Ox0dea: gsub(foo) { |m| '%02g' % m }
[03:38:46] Eiam_: has joined #ruby
[03:39:31] havenwood: Ox0dea: Ah, I'm watching zombies... is the goal to replace stuff inline with formatted?
[03:39:59] havenwood: That makes sense now that you mention.
[03:41:06] Ox0dea: havenwood: Yep, that was c_nick's stated intent.
[03:41:35] Ox0dea: He went from wanting 2 decimal places to 8 at some point, though.
[03:42:28] dima_: has joined #ruby
[03:42:42] gix: has joined #ruby
[03:43:16] fersur3: has joined #ruby
[03:43:33] havenwood: >> 'GetBondStaticData: 1.4E2, GetTenors: 5.1298, Currency: USD, STUFF! -1.23e-1234'.gsub(/[-+]?\d+(?:\.\d+)?(?:e[-+]?\d+)?/i) { |m| '%08g' % m }
[03:43:34] tmtwd: has joined #ruby
[03:43:34] ruboto: havenwood # => "GetBondStaticData: 00000140, GetTenors: 005.1298, Currency: USD, STUFF! -0000000" (https://eval.in/434109)
[03:43:43] tmtwd: has left #ruby: ()
[03:44:03] tmtwd_: has joined #ruby
[03:44:07] jgt: has joined #ruby
[03:46:35] Ox0dea: Ah, no, that's my oops; should be '%.8g'.
[03:46:52] pawnbox: has joined #ruby
[03:47:51] Ox0dea: baweaver: Lexigrapher accepts "fale" as a valid gender. :P
[03:48:04] baweaver: 2 years ago
[03:48:14] baweaver: I don't pretend to remember what all I wrote there :P
[03:49:12] Ox0dea: Yeah, that's fair.
[03:49:24] Ox0dea: Kudos for accepting "" there, though.
[03:49:30] havenwood: >> 'GetBondStaticData: 1.4E2, GetTenors: 5.123456789, Currency: USD, STUFF! -1.23e-1234'.gsub(/[-+]?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?/) { |m| '%.8g' % m }
[03:49:31] ruboto: havenwood # => "GetBondStaticData: 140, GetTenors: 5.1234568, Currency: USD, STUFF! -0" (https://eval.in/434110)
[03:50:16] Ox0dea: !queue havenwood > c_nick
[03:50:19] havenwood: For a requisite Regexp solution (I usually prefer the requisite non-Regexp solution).
[03:50:46] wldcordeiro_: has joined #ruby
[03:51:02] pawnbox: has joined #ruby
[03:51:05] roxtrongo: has joined #ruby
[03:51:15] Ox0dea: We shall say nothing of storing currency in floats.
[03:51:27] pontiki: stop :'''(
[03:51:48] workmad3: has joined #ruby
[03:51:56] pontiki: it's one of the things i have to put up with on this project
[03:52:16] Ox0dea: ObjectSpace.each_object(Float).map! { |f| f * 100 }
[03:53:24] webguynow: has joined #ruby
[03:56:15] Rubie: has joined #ruby
[03:56:56] jenrzzz: has joined #ruby
[03:57:26] pontiki: hopefully, one more week, then i get a new project
[03:57:46] pontiki: it's still fix a bug, uncover two more :(
[03:58:32] yardenbar: has joined #ruby
[03:58:36] chipotle: has joined #ruby
[03:59:00] mary5030: has joined #ruby
[03:59:24] Ox0dea: The dragon has n+1 heads; it is known.
[03:59:46] Ox0dea: havenwood: That was for you. ;)
[04:00:30] havenwood: Ox0dea: Haha
[04:00:55] webguynow: has joined #ruby
[04:00:57] havenwood: ObjectSpace.each_object(Float).map(&:abs)
[04:02:54] nickofferman: has joined #ruby
[04:03:22] havenwood: >> 10.times.map { ObjectSpace.each_object(Float).map(&:abs).size }
[04:03:24] ruboto: havenwood # => /tmp/execpad-960939e5b553/source-960939e5b553:4:in `write': can't modify frozen NoMemoryError (Runti ...check link for more (https://eval.in/434111)
[04:04:09] havenwood: >> 5.times.map { ObjectSpace.each_object(Float).map(&:abs).size }
[04:04:10] ruboto: havenwood # => [14, 28, 56, 112, 224] (https://eval.in/434112)
[04:04:12] pawnbox_: has joined #ruby
[04:04:14] dima_: has joined #ruby
[04:04:33] Ox0dea: >> [*ObjectSpace.each_object].sample 3
[04:04:34] ruboto: Ox0dea # => [" s.name = \"rake\"\n", "STATIC", "UNDEF_HEX_CHARREF"] (https://eval.in/434113)
[04:04:35] rbennacer: has joined #ruby
[04:04:42] luckyme: has joined #ruby
[04:05:16] Ox0dea: Well, that wasn't half as exciting as it might've been.
[04:05:44] seitensei: has joined #ruby
[04:08:20] webguynow: has joined #ruby
[04:08:40] charliesome: has joined #ruby
[04:09:30] petricore: has joined #ruby
[04:17:08] yfeldblum: has joined #ruby
[04:19:51] grenierm: has joined #ruby
[04:20:16] mices: has joined #ruby
[04:22:02] mices: https://gist.github.com/anonymous/e35d049d8fe17f3dd659 https://gist.github.com/anonymous/62c8d04a9ec3f6f66c32
[04:22:44] juanpablo_: has joined #ruby
[04:24:30] mices: anyone can help me with that
[04:24:40] mices: i got kicked from rails
[04:25:40] webguynow: has joined #ruby
[04:25:58] aaeron: has joined #ruby
[04:27:41] aaeron1: has joined #ruby
[04:27:58] System42: has joined #ruby
[04:29:15] rgb-one: I have a question outlined in a gist I would appreciate some assistance with, https://gist.github.com/rgb-one/4cb2b2d2fc1a31f693b1. Thanks :)
[04:30:28] brnpcn: has joined #ruby
[04:30:36] mices: has joined #ruby
[04:34:04] Rubie: has joined #ruby
[04:34:11] Ox0dea: &ri Array#product @rgb-one
[04:34:13] havenwood: rgb-one: Do you know how to turn the Hash into an Array of just its values?
[04:34:25] agent_white: has joined #ruby
[04:34:40] Ox0dea: >> %i[a b c].product [1, 2, 3] # rgb-one
[04:34:41] ruboto: Ox0dea # => [[:a, 1], [:a, 2], [:a, 3], [:b, 1], [:b, 2], [:b, 3], [:c, 1], [:c, 2], [:c, 3]] (https://eval.in/434118)
[04:35:29] leswerve: has joined #ruby
[04:36:15] Ox0dea: >> %w'A a @ 4'.product(%w'B b 8 }', %w'C C < ( [ {').size # rgb-one
[04:36:16] ruboto: Ox0dea # => 96 (https://eval.in/434119)
[04:36:45] last_staff: has joined #ruby
[04:36:51] webguynow: has joined #ruby
[04:37:12] havenwood: mices: You can make a single Gist with multiple files. Save files with filenames for syntax highlighting and to add context. Adding comments or even a markdown file that present the full context of your problem will greatly improve the response you get.
[04:37:16] Ox0dea: rgb-one: Is this for l33tspeak generation or profanity filtration?
[04:37:26] havenwood: mices: Do take time to read: https://github.com/radar/guides/blob/master/using-gist.markdown
[04:37:37] tjbiddle: has joined #ruby
[04:37:50] tkuchiki: has joined #ruby
[04:38:58] baweaver: mices: you were kicked for not listening. Use Heroku
[04:39:16] baweaver: a lot of us are on both channels.
[04:39:50] havenwood: Options -Indexes
[04:41:52] Synthbread: has joined #ruby
[04:43:38] tejasmanohar: has joined #ruby
[04:43:46] mary5030: has joined #ruby
[04:45:16] chipotle: has joined #ruby
[04:46:31] baweaver: but more honestly mices, I would take that as time to work on this by yourself. If you crossed enough people in Rails to get kicked, chances are it won't work out much better here.
[04:46:31] Guest5: has joined #ruby
[04:48:57] mary5030: has joined #ruby
[04:49:07] havenwood: mices: Working on Nginx now? Spend time to better present your questions if you're getting rebuffed. Also be sure to think about the most appropriate channel to ask your question. I think earlier you were asking Apache questions in #RubyOnRails instead of the #httpd channel and now you seem to be asking Nginx questions in #ruby instead of the #nginx channel.
[04:49:26] iamninja: has joined #ruby
[04:49:38] havenwood: mices: You'll find a better receptions and answers in the on-topic channel.
[04:50:55] webguynow: has joined #ruby
[04:51:02] Oog: has joined #ruby
[04:51:31] havenwood: mices: Quick responses to questions after a well-formed Gist are smiled-upon.
[04:52:21] fedexo: has joined #ruby
[04:52:27] havenwood: mices: Just a reminder, but PMing users in #ruby without asking first is against the rules: http://ruby-community.com/pages/user_rules
[04:52:36] mary5030_: has joined #ruby
[04:53:49] cvtsx: has joined #ruby
[04:54:54] crdpink: has joined #ruby
[04:55:07] mary5030: has joined #ruby
[04:55:42] webguynow: has joined #ruby
[04:55:44] krz: has joined #ruby
[04:57:04] jas02: has joined #ruby
[04:58:44] havenwood: mices: Are you doing this just to learn or do you need to get something deployed in production?
[04:59:02] Rubie: has joined #ruby
[04:59:06] msankhala: has joined #ruby
[05:00:34] pawnbox: has joined #ruby
[05:01:01] skade: has joined #ruby
[05:01:36] jhooker: has joined #ruby
[05:03:04] webguynow: has joined #ruby
[05:04:00] CustosL1men: has joined #ruby
[05:05:48] wldcordeiro_: has joined #ruby
[05:05:50] astrobunny: has joined #ruby
[05:06:12] bruno-: has joined #ruby
[05:06:31] Oog: has joined #ruby
[05:08:09] System42: has left #ruby: ("Leaving")
[05:08:48] godfat: has left #ruby: ()
[05:09:37] kgirthofer: has joined #ruby
[05:11:27] failshell: has joined #ruby
[05:11:46] pawnbox: has joined #ruby
[05:12:21] romain_t: has joined #ruby
[05:13:16] sdfgsdfg: has joined #ruby
[05:13:30] pawnbox: has joined #ruby
[05:15:42] ecksit: has joined #ruby
[05:19:55] n008f4g_: has joined #ruby
[05:20:56] wldcordeiro_: has joined #ruby
[05:21:12] lkba: has joined #ruby
[05:23:48] astrobunny: has joined #ruby
[05:25:51] howdoicomputer: has joined #ruby
[05:27:23] dhjondoh: has joined #ruby
[05:31:18] codenapper: has joined #ruby
[05:35:03] dhjondoh1: has joined #ruby
[05:36:57] dionysus69: has joined #ruby
[05:37:17] webguynow: has joined #ruby
[05:40:29] aganov: has joined #ruby
[05:40:35] workmad3: has joined #ruby
[05:40:49] rickmasta: has joined #ruby
[05:41:19] beast: has joined #ruby
[05:42:37] lsmola: has joined #ruby
[05:43:37] rushed: has joined #ruby
[05:44:05] yardenbar: has joined #ruby
[05:45:21] konsolebox: has joined #ruby
[05:47:42] ElSif: has joined #ruby
[05:47:46] ramfjord: has joined #ruby
[05:51:23] webguynow: has joined #ruby
[05:52:22] ChasedSpade: has joined #ruby
[05:52:31] jxv: has joined #ruby
[05:53:23] astrobunny: has joined #ruby
[05:58:26] duncannz: has joined #ruby
[05:59:22] tagrudev: has joined #ruby
[05:59:44] jgt: has joined #ruby
[06:00:59] krz: has joined #ruby
[06:02:45] mordocai: has joined #ruby
[06:03:37] solars: has joined #ruby
[06:03:53] rakm: has joined #ruby
[06:04:11] Rurik: has joined #ruby
[06:04:11] Rurik: has joined #ruby
[06:05:41] mary5030: has joined #ruby
[06:05:53] webguynow: has joined #ruby
[06:10:59] eGGsha: has joined #ruby
[06:11:29] juanpablo_: has joined #ruby
[06:14:53] hayricicek: has joined #ruby
[06:16:29] webguynow: has joined #ruby
[06:16:53] mistermocha: has joined #ruby
[06:18:40] khebbie: has joined #ruby
[06:19:18] edenc: has joined #ruby
[06:19:32] xcesariox: has joined #ruby
[06:20:13] Nightmare: has joined #ruby
[06:20:13] LBRapid: has joined #ruby
[06:20:22] twohlix: has joined #ruby
[06:21:41] leat1: has joined #ruby
[06:22:06] xcesariox: has joined #ruby
[06:22:12] Alina-malina: has joined #ruby
[06:22:20] dumdedum: has joined #ruby
[06:22:52] ndrei: has joined #ruby
[06:23:09] ReK2: has joined #ruby
[06:23:09] ReK2: has joined #ruby
[06:25:53] Olipro: has joined #ruby
[06:28:23] rgb-one: I have a question outlined in a gist I would appreciate some assistance with, https://gist.github.com/rgb-one/4cb2b2d2fc1a31f693b1. Thanks :)
[06:31:18] monoprotic: Array#product would help
[06:31:33] baweaver: rgb-one: you already asked
[06:31:37] baweaver: and were answered above
[06:31:58] rgb-one: baweaver: Ah, I fell asleep so didn't see the answer
[06:32:10] rgb-one: monoprotic: Intersting
[06:32:36] baweaver: Ox0dea already mentioned it above, scroll back a ways or check the logs on channel join
[06:33:03] symm-: has joined #ruby
[06:33:59] dhjondoh1: has joined #ruby
[06:34:28] webguynow: has joined #ruby
[06:34:31] codecop: has joined #ruby
[06:35:18] krz: has joined #ruby
[06:36:05] mordocai: has joined #ruby
[06:36:14] arup_r: has joined #ruby
[06:36:16] symm-: has joined #ruby
[06:39:29] rgb-one: havenwood: In response to your question: "rgb-one: Do you know how to turn the Hash into an Array of just its values?" would `hash.each do |h|; puts h[1]; end` be adequate?
[06:40:02] bluOxigen: has joined #ruby
[06:42:10] duncannz: has joined #ruby
[06:42:11] Macaveli: has joined #ruby
[06:43:09] duncannz: has joined #ruby
[06:43:19] karapetyan: has joined #ruby
[06:44:03] karapetyan: has joined #ruby
[06:44:09] duncannz: has joined #ruby
[06:45:06] darkhex: has joined #ruby
[06:46:06] howdoicomputer: has joined #ruby
[06:46:27] rgb-one: Ox0dea: Neither of those are my main reason but the application does employ l33tspeak
[06:46:29] certainty: rgb-one: well Hash#values would do
[06:46:39] pawnbox_: has joined #ruby
[06:48:23] skullcrasher: has joined #ruby
[06:48:56] howdoi: has joined #ruby
[06:49:28] jgt: has joined #ruby
[06:49:47] leat1: has joined #ruby
[06:50:18] iamninja: has joined #ruby
[06:50:57] ndrei_: has joined #ruby
[06:51:05] howdoi: in haml i'm doing something like var data = #{data}; that will expand all the contents of data is there any way to set a JS variable without exposing it in the source ?
[06:51:13] howdoi: ACTION is not sure if this is the right channle
[06:53:00] Guest32: has joined #ruby
[06:53:35] firstdayonthejob: has joined #ruby
[06:54:22] aswen: has joined #ruby
[06:54:35] Balzrael: has joined #ruby
[06:56:42] CustosL1men: has joined #ruby
[06:58:06] rgb-one: certainty: Indeed it does :)
[06:58:34] burgestrand: has joined #ruby
[06:58:56] chuy: has joined #ruby
[06:59:52] burgestrand: has joined #ruby
[07:00:16] greenarrow: has joined #ruby
[07:01:02] Guest32: has joined #ruby
[07:01:53] BLuEGoD: I'm trying to add a rack middleware to capture all StandardError Exceptions similar to stackoverflow.com/q/14790380 - However, exceptions are still been thrown down the stack in other call(env) method. Any clues as to what's going on? I'm using Thin as a web server and trying to avoid it to exit everytime an Exception is thrown...
[07:02:31] webguynow: has joined #ruby
[07:03:20] amstrad: has joined #ruby
[07:03:52] UtkarshRay: has joined #ruby
[07:07:26] webguynow: has joined #ruby
[07:08:38] SCHAAP137: has joined #ruby
[07:10:48] mordocai: has joined #ruby
[07:12:18] failshell: has joined #ruby
[07:17:25] infoget: has joined #ruby
[07:17:42] howdoicomputer: has joined #ruby
[07:18:51] andikr: has joined #ruby
[07:19:18] spacemud: has joined #ruby
[07:19:39] infoget: has left #ruby: ()
[07:20:29] moeabdol: has joined #ruby
[07:22:47] pawnbox: has joined #ruby
[07:23:30] renderful: has joined #ruby
[07:24:45] Trieste: has joined #ruby
[07:24:57] ReK2: has joined #ruby
[07:24:57] eGGsha: has joined #ruby
[07:24:57] astrobunny: has joined #ruby
[07:24:57] luckyme: has joined #ruby
[07:24:57] A124: has joined #ruby
[07:24:57] cjk101010: has joined #ruby
[07:25:23] khebbie: has joined #ruby
[07:25:23] solars: has joined #ruby
[07:25:23] tagrudev: has joined #ruby
[07:25:23] Oog: has joined #ruby
[07:25:23] mices: has joined #ruby
[07:25:23] iateadonut: has joined #ruby
[07:25:23] cookiez: has joined #ruby
[07:25:23] Nanuq: has joined #ruby
[07:25:23] null__: has joined #ruby
[07:26:02] webguynow: has joined #ruby
[07:27:09] tatsuo: has joined #ruby
[07:27:15] tuor: has joined #ruby
[07:28:22] terlar: has joined #ruby
[07:29:03] lampshades: has joined #ruby
[07:29:19] workmad3: has joined #ruby
[07:29:33] pawnbox_: has joined #ruby
[07:29:58] ta: has joined #ruby
[07:30:18] leat1: has joined #ruby
[07:33:16] tjbiddle: has joined #ruby
[07:33:31] webguynow: has joined #ruby
[07:33:39] tuor: hi, code: https://gist.github.com/anonymous/e8e67cc91e932aaf2f00
[07:36:25] tuor: It's about read_config_file. The file exists but the code l130 isn't run. I tryed to start pry and include the class. I created a instance of it and called the method but config_file is still an empty Hash.
[07:37:03] tuor: I don't get any syntax error. Now I just don't know how to find out what is going wrong...
[07:38:15] tuor: What I want with this method (if it's not clear): read a YAML file and create a ruby hash object wich contains (for the moment) only one key
[07:38:54] tuor: key: 'blacklist' value: [ 'sting 1', 'sting 2' ]
[07:39:21] tuor: I hope it's understandable. ;)
[07:41:06] workmad3: has joined #ruby
[07:42:41] konsolebox: has joined #ruby
[07:43:23] webguynow: has joined #ruby
[07:43:25] lulzmachine: has joined #ruby
[07:43:31] Pupeno: has joined #ruby
[07:45:15] tkuchiki: has joined #ruby
[07:45:35] burgestrand: has joined #ruby
[07:45:57] tuor: I tried it "manualy" in pry there it works: https://gist.github.com/anonymous/41124d7df7a451886c2a
[07:46:18] k3asd`: has joined #ruby
[07:47:39] karapetyan: has joined #ruby
[07:48:04] certainty: tuor: so if you replace l130 with binding.pry and put what is on l130 now on l131 and run the thing it stops and opens the pry repl?
[07:49:47] karapetyan: has joined #ruby
[07:52:15] BLuEGoD: is there a way to prevent thin to exit when an exception is thrown in a rack app?
[07:53:46] tuor: certainty, no it doesn't.
[07:54:19] certainty: tuor: well then the file doesn't exist
[07:56:38] tuor: certainty, I did it so (just for not speaking of different thing): https://gist.github.com/anonymous/e00d3493020555a20458
[07:58:12] sufyan```: has joined #ruby
[07:59:11] Polysics: has joined #ruby
[07:59:33] tobiasvl: what's the cleanest way to combine a ||= with += I wonder
[07:59:43] tobiasvl: or something like ||<<
[07:59:47] TheHodge: has joined #ruby
[07:59:50] Hounddog: has joined #ruby
[08:00:00] x-light: has joined #ruby
[08:00:00] senayar: has joined #ruby
[08:00:00] senayar: has joined #ruby
[08:00:09] certainty: tuor: yepp. That's it. If it doesn't stop there, then it means that File.exists? returned false, which means that stat on the given config_file_name failed
[08:00:13] juanpablo_: has joined #ruby
[08:00:59] skade: has joined #ruby
[08:03:20] shredding: has joined #ruby
[08:04:40] webguynow: has joined #ruby
[08:05:20] Kedare: has joined #ruby
[08:05:47] anisha: has joined #ruby
[08:05:49] tuor: certainty, hmm ok. I tried this: https://gist.github.com/anonymous/8d9f7a13be0bfaef9f10
[08:06:17] tuor: This doesn't start pry but prints the 'file exists'.
[08:06:49] tuor: so there is a prblem with my @config_file_name
[08:06:59] tuor: I'll search a little bit. Thx certainty
[08:07:37] lampshades: has joined #ruby
[08:08:40] krisquigley: has joined #ruby
[08:08:47] tomaz_b: has joined #ruby
[08:09:25] certainty: tuor: yepp just put a binding.pry right before File.exists?(...)
[08:09:36] certainty: then you can check the value of config_file_name at that point
[08:10:05] khebbie: has joined #ruby
[08:13:14] CustosL1men: has joined #ruby
[08:13:40] tuor: hmm. @config_file_name is an empty string... I have to find why.
[08:13:52] ndrei: has joined #ruby
[08:16:34] bayed: has joined #ruby
[08:16:48] tuor: ah found. Man it's not the problem of the class. It's the script using it which gives an empty string as the second argument.
[08:17:14] webguynow: has joined #ruby
[08:17:27] certainty: there you go
[08:18:35] flughafen: moin certainty !
[08:18:48] jgt1: has joined #ruby
[08:19:13] allomov: has joined #ruby
[08:20:47] burgestrand: has joined #ruby
[08:22:12] webguynow: has joined #ruby
[08:22:44] gwendall: has joined #ruby
[08:24:14] Zai00: has joined #ruby
[08:27:59] Pupeno: has joined #ruby
[08:28:06] MALAZIJSKIJ_BOEI: has joined #ruby
[08:28:27] lkba_: has joined #ruby
[08:30:19] dmolina: has joined #ruby
[08:32:20] sn0wb1rd: has joined #ruby
[08:34:00] Macaveli: has joined #ruby
[08:34:03] gregf_: has joined #ruby
[08:35:38] leat1: has joined #ruby
[08:36:00] marr: has joined #ruby
[08:37:22] CustosL1men: has joined #ruby
[08:39:19] rdark: has joined #ruby
[08:39:41] shevy: ready for takeoff flughafen?
[08:39:51] flughafen: yes shevy !
[08:40:16] flughafen: shevy: apparently some part of BER is in use while schoenefeld is in repair?
[08:40:23] goncalo_: has left #ruby: ()
[08:40:37] certainty: flughafen: for real?
[08:40:53] leat1: has joined #ruby
[08:40:55] certainty: crazy stuff
[08:40:59] goncalo: has joined #ruby
[08:41:53] atmosx_: has joined #ruby
[08:42:10] flughafen: let me find the article. i miight have totally misread it now and let everybody's hopesdown
[08:44:05] [k-: has joined #ruby
[08:44:14] atmosx_laptop: has joined #ruby
[08:44:41] adaedra: I have no hopes, so you can't have let mine down
[08:45:06] webguynow: has joined #ruby
[08:45:18] certainty: all hope is gone
[08:45:46] The_Ball: has joined #ruby
[08:47:21] adaedra: No hopes, only code now
[08:47:25] adaedra: hi atmosx_laptop
[08:47:34] flughafen: There is only Zuul
[08:49:54] cvtsx: has joined #ruby
[08:49:57] f4cl3y: has joined #ruby
[08:51:06] iamninja: has joined #ruby
[08:51:53] Stan: has joined #ruby
[08:52:29] jhass: -qo $~a jhass
[08:52:46] mr_dev: has joined #ruby
[08:54:10] Mia: has joined #ruby
[08:54:15] mr_dev: has left #ruby: ()
[08:54:26] ndrei: has joined #ruby
[08:55:55] sonOfRa: has joined #ruby
[08:56:17] webguynow: has joined #ruby
[08:56:30] chouhoulis: has joined #ruby
[08:57:18] siaW: has joined #ruby
[09:00:14] tvw: has joined #ruby
[09:00:14] Igorshp: has joined #ruby
[09:01:36] mr_dev: has joined #ruby
[09:03:47] allomov: has joined #ruby
[09:03:58] wldcordeiro_: has joined #ruby
[09:07:11] khebbie: has joined #ruby
[09:09:06] webguynow: has joined #ruby
[09:10:33] shevy: flughafen lol
[09:10:33] blarghlarghl: has joined #ruby
[09:11:12] merlinp: has joined #ruby
[09:11:59] blarghlarghl: Hello everyone. I have, say 4-5 forks going, each with a set of forks within it. I want each outer fork to Process.waitall, but only on its own inner forks, not on any parallel process forks. Does Process.waitall do that?
[09:13:05] arup_r: has joined #ruby
[09:13:06] failshell: has joined #ruby
[09:13:43] workmad3: has joined #ruby
[09:13:55] xnr: has joined #ruby
[09:14:44] joshmyers: has joined #ruby
[09:15:00] joshmyers: Hey, whats the difference between raise_error and raise_exception?
[09:15:24] apeiros: joshmyers: neither is in ruby, so what are you talking about?
[09:15:36] maloik: I'm guessing it's the rspec thing
[09:15:38] joshmyers: sorry, it's an rspec matcher
[09:16:01] moeabdol: has joined #ruby
[09:17:04] cornerman: has joined #ruby
[09:17:43] maloik: their docs seem to say they're functionally interchangeable
[09:18:22] certainty: really how difficult is it to look that up on your own
[09:18:33] certainty: it took us a few seconds
[09:18:56] certainty: that sounded grumpier than it was supposed to
[09:18:57] joshmyers: I did and I came up with the same answer, was wondering if there are conventions of using one over the other.
[09:19:01] joshmyers: yes it did.
[09:20:30] certainty: it's about having the choice to pick one that fits best. I'm not aware of conventions.
[09:21:02] burgestrand: has joined #ruby
[09:21:11] certainty: i first thought that one might only make sure that a subclass of StandardError was raised but apparently it's not the case
[09:22:37] pawnbox: has joined #ruby
[09:22:54] webguynow: has joined #ruby
[09:23:24] bruno-: has joined #ruby
[09:23:31] Gnomethrower: has joined #ruby
[09:23:38] joshmyers: ok cool, thanks.....
[09:23:46] timonv: has joined #ruby
[09:23:50] joshmyers: still not sure which would make either 'fit best'
[09:23:50] CloCkWeRX: has left #ruby: ()
[09:24:32] jhass: blarghlarghl: I'd expect so, but easy enough to hammer out a small script and verify?
[09:25:26] jhass: raise_error is less typing, so
[09:26:11] moeabdol: has joined #ruby
[09:28:02] webguynow: has joined #ruby
[09:28:49] ddv: has joined #ruby
[09:29:26] xfbs: has joined #ruby
[09:34:06] voker57: has joined #ruby
[09:34:21] emilkarl: has joined #ruby
[09:34:36] solocshaw: has joined #ruby
[09:35:01] solocshaw: has joined #ruby
[09:41:58] youngbaks: has joined #ruby
[09:42:35] dhjondoh: has joined #ruby
[09:42:36] x-light: has joined #ruby
[09:43:33] rgb-one: When executing `puts [1, 2, 3].product(["a", "b", "c"], ["x", "y", "z"], ["q","w", "e"])`, how can I repersent the result such that the different combinations are outputed line by line instead of the each individual character?
[09:45:01] rgb-one: So 1, a, x, q will be on line 1, 1, a, x, w, line 2 etc.
[09:45:14] shevy: dunno, did you try require 'pp'; pp [1, 2, 3].product(["a", "b", "c"], ["x", "y", "z"], ["q","w", "e"]) yet?
[09:45:37] rgb-one: what is pp?
[09:46:10] rgb-one: I will give it a try
[09:47:15] zerolith: has joined #ruby
[09:47:28] shevy: *pretty :)
[09:47:40] rgb-one: shevy: Indeed friend it worked
[09:47:52] shevy: there is also awesome print if you want colours... but I found it overkill
[09:48:58] juanpablo_: has joined #ruby
[09:48:59] shevy: is there a collective word for these three elements: directory, file, symlink? I need to add a colourize-method and I need to give it a name... directories, files and symlinks will be colourized differently but I need to name an aggregate method... "def colorize(input)" isn't a good name...
[09:49:53] suchness: has joined #ruby
[09:50:26] slayerjain: has joined #ruby
[09:53:46] stamina: has joined #ruby
[09:55:52] SebastianThorn: shevy: ye, it didnt really look right :P
[09:56:12] alex88: has joined #ruby
[09:56:40] SebastianThorn: shevy: "everything is a file"
[09:57:48] SebastianThorn: i'd use file, type or filetype?
[09:58:18] adaedra: shevy: node
[09:58:57] shevy: node sounds good
[09:59:17] Kallis: has joined #ruby
[09:59:38] beast_: has joined #ruby
[09:59:45] samuel02: has joined #ruby
[10:00:35] Kallis: has joined #ruby
[10:00:51] xfbs: has joined #ruby
[10:01:56] araujo: has joined #ruby
[10:03:14] Rurik: has joined #ruby
[10:03:39] webguynow: has joined #ruby
[10:03:44] Asher: has joined #ruby
[10:03:47] allomov: has joined #ruby
[10:08:19] Igorshp: has joined #ruby
[10:08:41] webguynow: has joined #ruby
[10:10:59] moeabdol: in rspec 3 I have an array containint heterogeneous objects
[10:11:19] moeabdol: I want to test the existance of a an object in the array so I
[10:11:57] moeabdol: expect(my_array).to include(instance_of(class))
[10:12:03] mprelude: has joined #ruby
[10:12:06] Asher-: has joined #ruby
[10:12:29] moeabdol: it works! but I wonder if this is a neat way to do this, and wither there is a matcher that is already made for such an expectation?
[10:12:56] Asher: has joined #ruby
[10:13:06] r_baron: has joined #ruby
[10:13:25] webguynow: has joined #ruby
[10:13:32] DeniseM: has joined #ruby
[10:15:10] Rurik: has joined #ruby
[10:16:10] cvtsx: has joined #ruby
[10:20:22] rickmasta: has joined #ruby
[10:22:32] tatsuo: has joined #ruby
[10:22:44] CustosL1men: has joined #ruby
[10:23:06] SCHAAP137: has joined #ruby
[10:24:08] c0m0: has joined #ruby
[10:26:15] Igorshp: has joined #ruby
[10:26:42] nettoweb: has joined #ruby
[10:29:14] khebbie: has joined #ruby
[10:32:09] kjhsdf: has joined #ruby
[10:32:42] leat: has joined #ruby
[10:33:12] leat: has joined #ruby
[10:33:41] webguynow: has joined #ruby
[10:35:13] hayricicek: has joined #ruby
[10:35:48] heidar: has joined #ruby
[10:37:09] DeniseM: has left #ruby: ("Leaving")
[10:38:03] webguynow: has joined #ruby
[10:39:10] stardiviner: has joined #ruby
[10:39:36] phutchins: has joined #ruby
[10:40:10] marr: has joined #ruby
[10:41:35] lkba: has joined #ruby
[10:43:18] shevy: webkitgtk-source takes much longer to compile than firefox-source ... :(
[10:43:21] leat: has joined #ruby
[10:44:24] apt-get: has joined #ruby
[10:44:39] darix: shevy: try libreoffice next ;)
[10:45:09] bweston92: has joined #ruby
[10:46:19] darix: adaedra: libreoffice needs 30+GB disk space to compile now 8)
[10:47:07] darix: and probably 6+hours
[10:49:17] firstdayonthejob: has joined #ruby
[10:52:08] iamninja: has joined #ruby
[10:53:28] leat: has joined #ruby
[10:54:09] rodfersou: has joined #ruby
[10:55:47] webguynow: has joined #ruby
[10:59:28] shevy: qt takes less time :D
[10:59:31] karapetyan: has joined #ruby
[10:59:33] shevy: libreoffice takes more
[10:59:49] shevy: the odd thing is that firefox source has like 140mb, webkitgtk like 13mb as .tar.xz
[11:00:33] lxsameer: has joined #ruby
[11:00:40] pawnbox: has joined #ruby
[11:00:49] last_staff: has joined #ruby
[11:01:06] shevy: ruby, python and perl take almost the same time to compile, go very easily
[11:01:25] shevy: the only strange part about ruby is the rdoc-installation step, that seems to take a really long time
[11:01:40] shevy: mruby compiles almost instantly :D
[11:02:15] khebbie: has joined #ruby
[11:02:40] workmad3: shevy: yeah, ri and rdoc both take ages to generate :(
[11:03:01] webguynow: has joined #ruby
[11:03:05] shevy: ok ... "almost instantly" was exaggerated... took 27 seconds here
[11:03:36] shevy: mruby-master/test/t/float.rb:201:17: ambiguous first argument; put parentheses or even spaces
[11:04:55] sdothum: has joined #ruby
[11:05:35] tvw: has joined #ruby
[11:06:23] shevy: bin/mruby seems to make use of ncurses ... libncursesw.so.5 => /usr/lib/libncursesw.so.5
[11:07:32] cache_over_mem: has joined #ruby
[11:07:49] cache_over_mem: guys i know you guys are always doing stuff better than me
[11:08:06] shevy: cache_over_mem you do this deliberately :>
[11:08:11] cache_over_mem: but i just found out that you can .reduce(:&) for intersections of an array of arrays
[11:08:21] shevy: gateway ;)
[11:10:02] miguelff: has joined #ruby
[11:10:03] jas02: has joined #ruby
[11:10:15] chills42: has joined #ruby
[11:10:54] chills42: has joined #ruby
[11:11:08] burgestrand: has joined #ruby
[11:11:20] Rubie: has joined #ruby
[11:12:25] pawnbox: has joined #ruby
[11:13:38] failshell: has joined #ruby
[11:13:43] Hrorek: has joined #ruby
[11:14:02] jschoolcraft: has joined #ruby
[11:14:08] bazbing80: has joined #ruby
[11:14:42] Hrorek: has joined #ruby
[11:14:44] FernandoBasso: has joined #ruby
[11:16:02] Hrorek: has joined #ruby
[11:16:57] Rubie: has joined #ruby
[11:17:32] yorickpeterse: cache_over_mem: as in:
[11:17:34] ruboto: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[11:18:03] pandaant: has joined #ruby
[11:18:38] cache_over_mem: https://www.youtube.com/watch?v=BtWrljX9HRA
[11:19:00] Rurik: has joined #ruby
[11:19:00] Rurik: has joined #ruby
[11:19:19] yorickpeterse: cache_over_mem: I suggest you take the suggestion and honor it
[11:19:32] yorickpeterse: This has nothing to do with freedom of speech
[11:19:43] cache_over_mem: yorick, you know how shit you are? you bring nothing to perl as you bring nothing to ruby
[11:19:47] krisquigley: has joined #ruby
[11:19:52] cache_over_mem: neither do i, but i dont whine along the way
[11:20:22] yorickpeterse: I don't really have to bring anything to Perl, I care little for a dying language
[11:20:35] yorickpeterse: I also care little for 12 year olds, so enjoy the /ignore
[11:20:36] certainty: now that escalated quickly
[11:20:43] cache_over_mem: yeah i just looked at your GH, you're not who i was thinking of, but all the same
[11:21:08] cache_over_mem: you're the guy who managed to turn a simple XML parser into a career
[11:21:19] adaedra: Here we go again
[11:21:41] yorickpeterse: honestly if the first response somebody has "MY FREEDOM OF SPEECH" that just clearly shows how they're missing the point so massively
[11:21:47] yorickpeterse: There's no point in argueing with people like that
[11:22:11] cih: has joined #ruby
[11:23:00] yorickpeterse: also somebody just give me +o so I can pre-emptively ban everybody :P
[11:23:10] cache_over_mem: thats like shooting somebody in an argument and then saying 'Oh what, no rebuttal? You're just whining about being shot'
[11:23:12] suchness: I blame ruboto.
[11:23:37] suchness: And I blame people who use it to sidetrack the channel from ruby.
[11:24:11] adaedra: If you want this channel to discuss ruby issues, you can drag this discussion to -offtopic. It's here for this exact purpose.
[11:24:41] cache_over_mem: thats exactly the opposite of how it should work
[11:25:21] phutchins: has joined #ruby
[11:26:00] xfbs: has joined #ruby
[11:27:23] elperdut: has joined #ruby
[11:28:05] da3mian: has joined #ruby
[11:28:07] zerolith: has left #ruby: ("Leaving")
[11:28:42] shevy: certainty nah it did not escalate really, the moment he used the words "guys" twice in the same sentence upon starting, along with being a gateway user was a dead-give away :)
[11:28:44] syath: has joined #ruby
[11:28:44] yorickpeterse: Hm, I should start a collection of responses ?guys triggers
[11:28:52] shevy: cache_over_mem get a real job man, don't be a vampire
[11:29:17] Igorshp: has joined #ruby
[11:29:50] cache_over_mem: lol i probably make more than you, ya know. but you're welcome to not invite me to your special snowflake banquet :(((
[11:30:31] shevy: cache_over_mem ah what do you work?
[11:30:40] cache_over_mem: linux administration
[11:30:54] shevy: you joined #windows* the other day
[11:30:56] cache_over_mem: leading the charge to write less sh and perl and more ruby
[11:31:23] suchness: Are you guys really going to devolve this discussion into personal attacks?
[11:31:36] shevy: you are using the word guys as well :(
[11:31:36] adaedra: shevy: tbf, I'm on channels not related to my work at all.
[11:31:39] cache_over_mem: havent even touched a windows box for more than 5 years. always on my chromebook or crouton'ing centOS
[11:32:20] jas02: has joined #ruby
[11:32:35] shevy: adaedra windows?
[11:32:41] certainty: adaedra: heresy
[11:32:48] adaedra: shevy: no.
[11:33:13] shevy: I think I joined #windows perhaps 3 or 4 times in 10 years, usually related to singular questions
[11:34:08] but3k4: has joined #ruby
[11:34:10] bruno-: has joined #ruby
[11:34:19] leat: has joined #ruby
[11:34:26] cache_over_mem: I joined ##linux many moons ago and they showed me how to boot linux, and i didnt realize that i couldnt 'turn it off' and i ended up making a career out of it somehow
[11:34:50] Igorshp: has joined #ruby
[11:34:52] Rurik: has joined #ruby
[11:35:19] Klumben: has joined #ruby
[11:35:36] certainty: as the world turns. Sounds good
[11:35:58] evrial: has left #ruby: ()
[11:36:18] cih_: has joined #ruby
[11:37:43] juanpablo_: has joined #ruby
[11:37:46] shevy: Does anyone of you have a statically compiled ruby?
[11:38:46] kidoz: has joined #ruby
[11:39:14] shevy: My dream combination will be static busybox, static ruby... and then dietlibc!
[11:39:41] hadrig: has joined #ruby
[11:39:46] cache_over_mem: RubyMotion can do it I think
[11:39:53] yorickpeterse: shevy: you mean Crystal?
[11:40:11] certainty: shevy: you dream of this stuff?
[11:40:17] cache_over_mem: http://www.slideshare.net/LaurentSansonetti/inside-rubymotion-llvm
[11:40:23] webguynow: has joined #ruby
[11:40:28] headius: I wouldn't really consider RubyMotion to be ruby
[11:40:32] pontiki: has joined #ruby
[11:40:35] hadrig: has joined #ruby
[11:40:48] headius: rather a statically-analyzable subset of ruby
[11:41:19] shevy: yorickpeterse well crystal lacks a few things that I love, aliasing methods for instance. It may be the secondary option after ruby
[11:41:42] shevy: and I am a past hello-world noob when it comes to crystal
[11:41:44] certainty: crystal, for me, always has the association to crystal meth
[11:42:12] shevy: you must think about rocks instead certainty
[11:42:21] shevy: gems, diamonds, ruby, perl, shards
[11:42:27] certainty: yeah i try. still
[11:42:50] cache_over_mem: shevy, Julia is worth a look. lisp macros, OOP, native asm-dumpable code, really cool
[11:42:55] shevy: certainty actually I more dream of auto-generating organisms but that seems either costly or technically difficult
[11:42:59] certainty: ACTION should research crystal some day
[11:43:09] cache_over_mem: less rubyish and more luaish
[11:43:16] shevy: one thing that confused me with crystal so far is... the binaries seem huge
[11:43:25] cache_over_mem: he hasnt done tree shaking yet
[11:43:30] cache_over_mem: itll get done soon
[11:43:42] jas02: has joined #ruby
[11:43:52] shevy: that was similar to nim ... the hello world example also was big, even after stripping
[11:44:17] cache_over_mem: its the whole world tho
[11:45:22] charliesome: has joined #ruby
[11:45:57] [k-_: has joined #ruby
[11:49:52] hadrig: has joined #ruby
[11:49:57] jhass: shevy: I think --release mode shaves off a few bytes, but since we link against a bunch of stuff (gc, unwind, libc at the minimum) that's already like half a meg from the tables and stuff apparently
[11:50:26] ldnunes: has joined #ruby
[11:50:49] Zai00: has joined #ruby
[11:51:51] jhass: idk, still better than Go I think :P
[11:52:09] charliesome: has joined #ruby
[11:52:55] dionysus69: has joined #ruby
[11:53:13] mices: has joined #ruby
[11:53:14] alem0lars: has joined #ruby
[11:53:37] mices: has joined #ruby
[11:53:48] johnhamelink: has joined #ruby
[11:53:51] certainty: jhass: am i correct that you can't use the entire language inside a macro method?
[11:53:59] dasher00: has joined #ruby
[11:54:02] certainty: in crystal that I mean
[11:54:22] ndrei: has joined #ruby
[11:54:54] jhass: yes and no, the macro language, that is the part that is evaluated at compile time is quite distinct, more like a template language with AST access if you so will
[11:55:01] yorickpeterse: jhass: not sure if I'd call Crystal better than Go at this point
[11:55:04] jhass: the result of that "template" is fed back into the parser
[11:55:16] jhass: yorickpeterse: just talking about binary size
[11:55:18] pwnd_nfsw: has joined #ruby
[11:55:44] jdawgaz: has joined #ruby
[11:55:49] mices: anyone can help me with rails/nginx
[11:55:53] certainty: jhass: yeah that's how i've pictured it. thanks. A bit unfortunate if you ask me to have two languages basically but there may be some good reasons
[11:56:26] elperdut: has joined #ruby
[11:56:27] Outlastsheep: has joined #ruby
[11:56:36] certainty: interesting language though
[11:57:00] certainty: i'll read more about it before i judge further
[11:57:11] cih: has joined #ruby
[11:57:11] jhass: certainty: the main reason is practically, you'd have to either shell out to a new compiler process all the time (and spawning a process is slow) or reimplement an interpreter for the language in parallel. But it also gives a nice visual distinction between runtime and compile time code
[11:58:19] arup_r: What I will ask here now is not direct Ruby, but related.
[11:58:34] jhass: arup_r: /msg alis help
[11:58:39] mices: cache_over_men: there's no such channel and i'm banned from #rubyonrails for asking for help
[11:58:42] certainty: jhass: alright. Scheme for example (at least the syntax-rules system) doesn't use the full language either. The reason there is hygiene though
[11:58:44] iamninja: has joined #ruby
[11:58:49] arup_r: What is the point of duplicating a method. What is the concept behind it... http://api.rubyonrails.org/classes/Method.html#method-i-duplicable-3F
[11:59:14] shevy: arup_r don't know it but one possibility may be that you can change one method, and retain the old original behaviour from the other one?
[11:59:23] Silex: mices: "banned for asking for help" that sounds very unlikely
[11:59:38] aswen: has joined #ruby
[11:59:48] mices: Silex: stfu
[11:59:56] shevy: they mean in regards to .dup
[12:00:06] pontiki: morning o/
[12:00:11] certainty: pontiki: \o
[12:00:16] arup_r: I never saw a `.dup` on methods
[12:00:20] greenarrow: has joined #ruby
[12:00:25] Silex: ok I just read the backlog, apparently "asking for help" means annoying people with passenger/puma questions and continuing when told to stop
[12:00:42] shevy: ah, you can use .dup for a real copy, e. g. variable = ARGV.first.to_s.dup
[12:00:53] shevy: http://ruby-doc.org/core-2.2.3/Object.html#method-i-dup
[12:00:56] solars: has joined #ruby
[12:01:05] mices: Silex: stfu
[12:01:08] jhass: Silex: more ignoring advice given and repeating the initial (misguided) question instead, from what I've gathered
[12:01:11] shevy: that does away with tainted input!
[12:01:17] mices: piece-a-sh*t
[12:01:20] jhass: mices: watch your languages, see the rules
[12:01:28] Silex: jhass: yeah, and after being helped for like 30 minutes
[12:01:28] jhass: *language
[12:01:37] mices: i don't like people harrassing me
[12:01:41] arup_r: shevy: I know .dup .. Asking what is the point of duping a MethodObject
[12:01:50] jhass: mices: /help ignore
[12:01:55] shevy: arup_r aha, I see. good question... I don't think I have seen that before either
[12:02:04] arup_r: I am not able to imagine a good example on it
[12:02:08] shevy: me neither
[12:02:28] arup_r: This Rails guys do.. anything if Ruby supports :D
[12:02:57] jhass: arup_r: I could picture it as an alternative to alias_method_chain
[12:03:02] cantaberry: has joined #ruby
[12:04:25] arup_r: jhass: you are always awesome! .. Can you throw an example ? About the usefulness of the duplication a MethodObject .. I just want to see an useful example. Something ofcourse is there.. That is why the method is there.. but no example, that is bad! :/
[12:05:03] shevy: but jhass didn't write rails!
[12:05:03] radgeRayden: has joined #ruby
[12:05:09] arup_r: jhass: `alias_method_chain` dups a method or delegates it
[12:05:17] jhass: arup_r: eh, it does not support duplicating a method at all
[12:05:33] jhass: arup_r: google alias_method_chain, there should be *tons* of blogs explaining its purpose
[12:05:51] burgestrand: More or less you rename the original method, overwrite it, and then call the original (if needed) with the new name.
[12:06:14] shevy: see arup_r!
[12:06:20] goodcodeguy: has joined #ruby
[12:06:22] jhass: arup_r: Method#duplicable? is just added by rails to facilitate duck typing upon that property, whether what you got at hand is duplicable or not, it's probably just there for completeness
[12:06:25] [k-_: it's like inheritance and super, but better
[12:06:28] jhass: arup_r: it always returns false
[12:07:07] dhjondoh: has joined #ruby
[12:07:17] burgestrand: Nowadays there's #prepend to allow something similar without renaming the original method. In the past you could also do a hack where you get a method handle to the old method, and bind the handle runtime and call afterwards.
[12:07:37] krisquigley: has joined #ruby
[12:08:08] certainty: you mean by aliasing the old method?
[12:08:09] JDiPierro: has joined #ruby
[12:08:19] Igorshp: has joined #ruby
[12:08:25] shevy: oh yeah I have seen that old trick a lot, to reference to the old one, then change the copy
[12:08:38] certainty: i never thought about it as a hack
[12:08:48] certainty: i may have to think harder :)
[12:09:02] [k-_: one of the reasons why people do this is to avoid doing expensive computations twice
[12:09:17] jhass: [k-_: is that so? got an example?
[12:09:24] wald0: has joined #ruby
[12:09:27] [k-_: you know, those method caches
[12:09:36] jhass: who talked about method caches?
[12:09:42] [k-_: i don't have an example though, unless javascript and stuff
[12:09:53] mices: can anyone help me get my rails app working with nginx
[12:09:54] jhass: besides that term is usually used to refer to the method lookup caches
[12:10:09] [k-_: yes, i meant that i think
[12:10:25] jhass: no, I don't think so, it's a interpreter/VM internal largely
[12:10:55] [k-_: no, i mean caching the results of the computation
[12:10:58] [k-_: memoizing
[12:11:07] [k-_: for reuse later
[12:11:15] rbennacer: has joined #ruby
[12:11:17] jhass: yup, that's not what's usually meant by method caches
[12:11:29] [k-_: and those lookup table things
[12:11:30] jhass: that's just called memoization
[12:12:05] jhass: method caches are a memoization technique of course, but one used by the VM/interpreter, not user code
[12:12:10] Polysics: has joined #ruby
[12:12:17] certainty: you most likely don't memoize by replacing the method with one that just returns the result because your memoized results might depend on the arguments
[12:12:20] [k-_: sometimes i just | - o - - - - x - - - - - - | miss the spot
[12:13:16] dionysus69: has joined #ruby
[12:13:38] burgestrand: Here's an example of the four methods I mentioned: https://repl.it/BI5H
[12:13:44] [k-_: certainty: if there is a cache miss (the arguments are not considered the same), the old method is called with the new arguments and the result is also stored in the cache
[12:14:01] [k-_: s/miss (the/miss (when the/
[12:14:15] burgestrand: arup_r: ^ ??? none of those use Method#dup though.
[12:14:32] failshell: has joined #ruby
[12:14:49] burgestrand: And actually, you can't dup Method. :)
[12:14:58] arup_r: Burgestrand: Thank you very much! .. I am looking at it
[12:15:04] burgestrand: >> method(:puts).dup
[12:15:05] ruboto: Burgestrand # => allocator undefined for Method (TypeError) ...check link for more (https://eval.in/434334)
[12:15:10] certainty: [k-_: yeah exactly. That's why the implementation has to stay the same. It just does the lookup every time to see if there is a cached result
[12:15:23] certainty: btw. that's a good example for the blurry line between data and code
[12:16:07] failshell: has joined #ruby
[12:16:11] certainty: the computation is turned into a table lookup
[12:18:59] [k-_: memory in exchange for speed
[12:20:09] [k-_: well, you need somewhere to store those results!
[12:20:25] certainty: yeah but why C?
[12:20:27] [k-_: and those algorithms arent going to run any faster!
[12:20:41] [k-_: that would be up to shevy to explain
[12:20:58] rbennacer: has joined #ruby
[12:24:27] k3asd`: has joined #ruby
[12:24:47] arup_r: Burgestrand: I am still on prepend method.. reading it.. to understand what the method does
[12:25:52] burgestrand: arup_r: prepend is a relatively new feature of Ruby, it's similar to include, but instead of putting the module behind of the ancestor tree (MyModule -> MyClass), it puts it in front (MyClass -> MyModule)
[12:26:26] xfbs: has joined #ruby
[12:26:56] [k-_: your arrows confuse @???@
[12:27:20] shevy: certainty in exchange for speed!!! C is fast!!!!!!!!!!
[12:27:39] elfuego: has joined #ruby
[12:27:51] jhass: >> module M; end; class Include; include M; end; class Prepend; prepend M; end; [Include.ancestors, Prepend.ancestors]
[12:27:51] pontiki: not enough bangs
[12:27:52] ruboto: jhass # => [[Include, M, Object, Kernel, BasicObject], [M, Prepend, Object, Kernel, BasicObject]] (https://eval.in/434335)
[12:27:55] certainty: shevy: hmm xD
[12:28:25] Oog: has joined #ruby
[12:30:28] dhjondoh: has joined #ruby
[12:30:33] victortyau: has joined #ruby
[12:31:16] krz: has joined #ruby
[12:31:33] Igorshp: has joined #ruby
[12:32:22] gwendall: has joined #ruby
[12:34:17] andrewvos: has joined #ruby
[12:36:16] ndrei: has joined #ruby
[12:36:24] elperdut: has joined #ruby
[12:39:13] arup_r: Burgestrand: got your example
[12:39:28] burgestrand: arup_r: nice :)
[12:39:35] AndyRyanSmith: has joined #ruby
[12:41:38] dasher00: has joined #ruby
[12:42:26] Balzrael: has joined #ruby
[12:42:51] khebbie: has joined #ruby
[12:44:01] jhooker: has joined #ruby
[12:45:15] goodcodeguy: has joined #ruby
[12:45:16] bestbrents_: has joined #ruby
[12:46:50] hahuang61: has joined #ruby
[12:47:18] EasyCo: has joined #ruby
[12:47:36] sepp2k: has joined #ruby
[12:47:51] jordanm: has joined #ruby
[12:47:55] sgambino: has joined #ruby
[12:48:08] crdpink2: has joined #ruby
[12:49:24] linuxboytoo: has joined #ruby
[12:49:36] wookiehangover: has joined #ruby
[12:49:58] ckinniburgh_: has joined #ruby
[12:50:03] decoponio: has joined #ruby
[12:50:12] nullwarp: has joined #ruby
[12:51:15] dstarh: has joined #ruby
[12:51:29] jimeh: has joined #ruby
[12:52:00] tcopeland: has joined #ruby
[12:52:05] nibbo: has joined #ruby
[12:52:05] [k-_: welcome!
[12:52:41] universa1: has joined #ruby
[12:52:42] linc01n: has joined #ruby
[12:52:46] fgo: has joined #ruby
[12:53:28] juanpablo_: has joined #ruby
[12:53:43] sfr^: has joined #ruby
[12:53:43] sfr^: has joined #ruby
[12:56:47] Sdwrage_: has joined #ruby
[12:57:28] mary5030: has joined #ruby
[12:57:32] startupality: has joined #ruby
[12:57:52] lokulin: has joined #ruby
[12:58:20] mices: has left #ruby: ()
[12:59:10] dionysus69: has joined #ruby
[13:00:02] s00pcan: has joined #ruby
[13:00:23] sankaber: has joined #ruby
[13:00:46] mary5030: has joined #ruby
[13:01:11] AndyRyanSmith: has joined #ruby
[13:02:09] yashinbasement: has joined #ruby
[13:02:34] bmurt: has joined #ruby
[13:04:15] AndyRyanSmith: has joined #ruby
[13:05:29] tuor: New general question: is it "good"/"ok"/"bad" to use methods to acces and set object variables? Should i have this for all my object variables? (like this: https://gist.github.com/anonymous/2b7e1b224cd04057315f)
[13:06:02] tuor: and use in the same class only the methods and don't acces directly the variable with @myvar
[13:06:34] [k-_: it's bad practice to expose all your instance variables
[13:06:52] [k-_: and use @myvar, it tells ruby, and everyone else that you are accessing an instance variable
[13:06:55] [k-_: also, it's faster
[13:07:35] tuor: [k-_, Ah ok. So only use accessors if it's needed from outside?
[13:08:13] freerobby: has joined #ruby
[13:08:16] bruno-: has joined #ruby
[13:08:23] jhass: tuor: I kinda flip that on a per class bases. For example if the class has "magical" accessors, that is ones that do things behind the scenes like keeping some related state consistent I usually use the accessors for all public attributes and sometimes even define a couple private ones. If it's a read only class (no setters/writers) I tend to use ivars all the way
[13:08:47] [k-_: use your judgement. Is it better to expose your Social Security Number for other people to handle or do you keep it to yourself and handle it yourself
[13:08:59] jhass: I think you can't derive a dogmatic rule, but you should keep it consistent on a per class basis at last
[13:09:43] tuor: jhass, ok.
[13:09:49] tuor: [k-_, ok.
[13:09:53] mjmac: has joined #ruby
[13:10:25] JDiPierro: has joined #ruby
[13:10:33] hadrig: has joined #ruby
[13:11:18] karapetyan: has joined #ruby
[13:12:00] platzhirsch: has joined #ruby
[13:12:21] xfbs: has joined #ruby
[13:12:39] tuor: So what I do in the class is up to me, so long I do it the same in the complete class. I give accessors if needed.
[13:13:17] miguelff: has joined #ruby
[13:13:37] [k-_: practise encapsulation
[13:14:17] [k-_: state is kept within a single object, not all around the world
[13:15:25] ndrei: has joined #ruby
[13:15:25] shevy: [k-_ ur face is a state!
[13:15:45] sfr^: has joined #ruby
[13:16:14] universa1: has joined #ruby
[13:16:15] linc01n: has joined #ruby
[13:16:21] [k-_: ACTION sets expression to "D:"
[13:20:25] webguynow: has joined #ruby
[13:20:41] sankaber: has joined #ruby
[13:20:41] charliesome: has joined #ruby
[13:21:41] Igorshp: has joined #ruby
[13:21:47] riffraff: has joined #ruby
[13:21:54] kobain: has joined #ruby
[13:22:09] megagigawatt: has joined #ruby
[13:22:11] xfbs: has joined #ruby
[13:22:13] ndrei: has joined #ruby
[13:23:18] Swappticon: has joined #ruby
[13:24:32] arup_r: [k-_: I got now what you were talking about regarding the Memoization after reading http://gshutler.com/2013/04/ruby-2-module-prepend/ . Yes the alias_method and #prepend does the same thing -- "Memoization" ... Indeed!!
[13:25:12] shevy: do you people recommend the use of () when we use "if condition and some_other_condition" ? for instance: if (array[0] == 'x') and (array[1] =~ /^\d+$/) versus if array[0] == 'x' and array[1] =~ /^\d+$/
[13:25:13] arup_r: They do cache the result of a method.. and lower the response time or whatever time you call it!
[13:25:20] khebbie: has joined #ruby
[13:25:46] arup_r: shevy: Don't use () unless you are getting Syntax error from Ruby
[13:25:53] arup_r: I follow this
[13:27:03] arup_r: In nutshell `||=` is the HERO of the story. it seems so
[13:27:06] AndyRyanSmith: has joined #ruby
[13:27:16] jgpawletko: has joined #ruby
[13:28:16] dima__: has joined #ruby
[13:28:20] [k-_: shevy: parentheses are noise
[13:28:26] nettoweb: has joined #ruby
[13:28:27] [k-_: no one uses them in ifs
[13:28:42] [k-_: unless they run into precedence issues
[13:29:19] null__: has joined #ruby
[13:29:26] null__: has joined #ruby
[13:30:30] nibbo: has joined #ruby
[13:30:31] aaeron: has joined #ruby
[13:32:10] atmosx_laptop: has joined #ruby
[13:32:16] aaeron1: has joined #ruby
[13:32:34] havenwood: has joined #ruby
[13:32:36] JoshL: has joined #ruby
[13:34:20] whippythellama: has joined #ruby
[13:35:54] bruno-: has joined #ruby
[13:37:11] arian0n: hey, what's the difference between "class Foo::Bar; end" and "class Foo; class Bar; end; end"?
[13:37:24] WajidKagzi: has joined #ruby
[13:37:37] momomomomo: has joined #ruby
[13:37:40] WajidKagzi: is there a slack for this channel?
[13:38:00] rbennacer: has joined #ruby
[13:38:35] [k-_: arian0n: the first requires class/module Foo to be defined first somewhere
[13:38:42] hadrig: has joined #ruby
[13:38:52] miguelff: has left #ruby: ()
[13:39:06] [k-_: arian0n: the second one either defines Foo or reopens Foo, so you wont run into errors
[13:40:07] tkuchiki: has joined #ruby
[13:40:19] c0m0: has joined #ruby
[13:40:22] vipaca: has joined #ruby
[13:40:34] momomomomo: lol is there a slack for an open IRC channel
[13:40:46] apeiros: arian0n: also within class Foo::Bar the constant lookup is different than within class Foo; class Bar
[13:40:47] tkuchiki_: has joined #ruby
[13:41:34] apeiros: arian0n: compare:
[13:41:36] apeiros: >> module Foo; A = 1; end; module Foo; class Bar; A; end; end
[13:41:37] ruboto: apeiros # => 1 (https://eval.in/434363)
[13:41:41] apeiros: >> module Foo; A = 1; end; class Foo::Bar; A; end
[13:41:42] ruboto: apeiros # => uninitialized constant Foo::Bar::A (NameError) ...check link for more (https://eval.in/434364)
[13:41:52] JDiPierro: has joined #ruby
[13:42:02] tagrudev: has joined #ruby
[13:42:35] rickmasta: has joined #ruby
[13:43:03] codenapper: has joined #ruby
[13:45:30] radgeRayden: has joined #ruby
[13:45:40] Igorshp: has joined #ruby
[13:46:20] Tuxero: has joined #ruby
[13:48:55] p0wn3d_: has joined #ruby
[13:49:49] EXID123: has joined #ruby
[13:49:51] xaxisx: has joined #ruby
[13:50:26] msankhala: has joined #ruby
[13:50:41] felixr: has joined #ruby
[13:51:03] Igorshp: has joined #ruby
[13:51:10] alexUaN: has joined #ruby
[13:51:14] Tuxero: has joined #ruby
[13:51:22] umgrosscol: has joined #ruby
[13:52:08] ozz: has joined #ruby
[13:53:34] timonv: has joined #ruby
[13:53:35] codenapp_: has joined #ruby
[13:53:46] leksster: has joined #ruby
[13:54:13] juanpablo_: has joined #ruby
[13:55:12] leat1: has joined #ruby
[13:55:36] mices: has joined #ruby
[13:55:37] apt-get: has joined #ruby
[13:55:49] mices: anyone can help with this please http://stackoverflow.com/questions/32608781/how-do-i-get-my-rails-app-working-with-nginx-and-passenger
[13:56:23] nettoweb: has joined #ruby
[13:57:00] JoshL: has joined #ruby
[13:58:03] webguynow: has joined #ruby
[13:58:33] jgt1: has joined #ruby
[13:58:43] timonv: has joined #ruby
[14:00:16] timonv: has joined #ruby
[14:00:50] _hadrig_: has joined #ruby
[14:02:51] apeiros: I love people who ask questions and part immediately??? (15:56 mices has left IRC ())
[14:03:11] tobiasvl: I ignore parts
[14:03:24] tobiasvl: so sometimes I spend time on helping people who are long gone
[14:04:09] mr_dev: has left #ruby: ()
[14:05:24] leat1: has joined #ruby
[14:05:45] Ox0dea: tobiasvl: https://github.com/lifeforms/irssi-smartfilter
[14:06:32] apt-get: has joined #ruby
[14:06:54] nateberkopec: has joined #ruby
[14:07:02] tobiasvl: Ox0dea: niiiiiiice
[14:07:07] Ox0dea: [k-_oyaanisqatsi!
[14:07:26] Ox0dea: tobiasvl: I'll refrain from pointing out that that feature is in WeeChat out of the box. :P
[14:08:34] karapetyan: has joined #ruby
[14:08:48] pawnbox: has joined #ruby
[14:09:32] Ox0dea: [k-_: Have you seen Koyaanisqatsi?
[14:09:35] apt-get_: has joined #ruby
[14:10:01] [k-_: are you saying that im unbalanced? :(
[14:10:11] [k-_: and that english is in a horrible mess?
[14:10:31] Ox0dea: [k-_: No? You've just been on about global warming and the like as of late.
[14:10:31] [k-_: and a deeper meaning relating to english is in a horrible mess?
[14:10:34] bigbadbear: has joined #ruby
[14:10:45] Ox0dea: The film has virtually nothing to do with the English language.
[14:10:57] jgpawletko: has joined #ruby
[14:11:02] Illusioneer: has joined #ruby
[14:11:21] tobiasvl: literally nothing.
[14:11:26] mary5030: has joined #ruby
[14:11:26] [k-_: Reggio explained the lack of dialogue by stating "it's not for lack of love of the language that these films have no words. It's because, from my point of view, our language is in a state of vast humiliation.
[14:11:43] Ox0dea: Wow, much suchness.
[14:11:57] Ox0dea: Many "you're not wrong".
[14:12:24] vondruch: has joined #ruby
[14:12:36] [k-_: such suchness would be alliteration
[14:12:53] [k-_: Also, stop global warming, today!
[14:14:22] beauby: has joined #ruby
[14:14:25] Pupeno: has joined #ruby
[14:14:29] juanpablo_: has joined #ruby
[14:15:41] leat1: has joined #ruby
[14:16:05] jas02: has joined #ruby
[14:17:12] miguelff: has joined #ruby
[14:17:15] bentanweihao: has joined #ruby
[14:18:53] jas02: has joined #ruby
[14:19:55] jhass: apeiros: ignore mices, complete help vampire, got a +b from #RubyOnRails from it
[14:20:03] hashrocket: has joined #ruby
[14:20:23] baroquebobcat: has joined #ruby
[14:22:04] chills42: has joined #ruby
[14:22:11] towski_: has joined #ruby
[14:22:27] CHVNX: has left #ruby: (":)")
[14:23:53] Oog: has joined #ruby
[14:24:15] apeiros: jhass: yeah, I remembered baweaver complaining. I was actually quite curios :)
[14:25:10] adaedra: ACTION pokes the channel
[14:25:24] vipaca: has joined #ruby
[14:25:51] MichaelSmith: has joined #ruby
[14:27:47] jhass: ACTION imagines 1000 people poking adaedra back
[14:28:24] SenpaiSilver_: has joined #ruby
[14:29:59] adaedra: How horrifying
[14:30:18] jdawgaz: has joined #ruby
[14:30:26] Igorshp: has joined #ruby
[14:31:00] pawnbox: has joined #ruby
[14:31:01] SenpaiSilver_: has joined #ruby
[14:31:41] Lovich: will any of you non-gender-specific people help me with something
[14:33:22] adaedra: ACTION tries its new mind-reading powers to guess what is the problem
[14:33:37] Ox0dea: adaedra: http://i.imgur.com/Pi0MvmO.png
[14:33:40] Ox0dea: The problem is a lie.
[14:33:59] kies^: has joined #ruby
[14:34:07] adaedra: People do that?
[14:34:13] adaedra: Go to the internet and just tell lies?
[14:34:18] dionysus69: has joined #ruby
[14:34:48] [k-: indeed they do
[14:35:04] Lovich: ive used gender neutral pronouns
[14:35:08] Lovich: no need to get up in arms
[14:35:41] adaedra: Lovich: yet it miss an important thing: a question.
[14:35:58] Lovich: how do i do that thing in ruby
[14:36:04] havenwood: !ban Lovich !P trolling
[14:36:07] ChanServ: +b Lovich!*@*
[14:36:07] ChanServ: ChanServ kicked Lovich: trolling
[14:36:23] adaedra: hi havenwood
[14:36:33] SenpaiSilver: has joined #ruby
[14:36:54] havenwood: adaedra: good mornin'
[14:38:11] burgestrand: has joined #ruby
[14:38:39] TheHodge: has joined #ruby
[14:39:07] anjen: has joined #ruby
[14:39:43] adaedra: My mind powers are broken. :(
[14:40:04] [k-_: dont u use a crystal ball
[14:40:20] havenwood: Some of us do.
[14:40:31] adaedra: No, I use a ruby ball.
[14:40:41] webguynow: has joined #ruby
[14:42:07] Ox0dea: [k-_: Tell me how finishing SICP will make me a Legilimens.
[14:42:13] dopamean_: has joined #ruby
[14:42:20] [k-_: define SICP
[14:42:21] nateberkopec: has joined #ruby
[14:42:26] [k-_: define Legilimens
[14:42:39] Ox0dea: A Legilimens is somebody who can read minds.
[14:42:49] Ox0dea: Like Professor Snake.
[14:42:53] adaedra: So wise, Ox0dea
[14:43:58] Ox0dea: [k-_: There is a wizard using a crystal ball as his compiler on the cover of *Structure and Interpretation of Computer Programs*.
[14:44:04] adaedra: Wait, "Professor Snake"?
[14:44:13] cgfbee: has joined #ruby
[14:44:15] cfloare: has joined #ruby
[14:44:46] krz: has joined #ruby
[14:44:59] [k-_: i probably was supposed to read that
[14:45:02] yorickpeterse: SNAAAAAAAAAAAKEEEEEE
[14:45:09] [k-_: a scheme book?
[14:45:18] [k-_: yes, i was supposed to read some scheme books
[14:45:30] Ox0dea: [k-_: That it uses Scheme is largely immaterial.
[14:45:38] jhass: adaedra: rollings k key probably was broken due to typing her name too often so she went for p
[14:46:16] Ox0dea: Well, at least misspelling it "Rolling" will get people to pronounce it correctly.
[14:46:41] [k-_: rho-lings
[14:46:49] [k-_: roll-ings
[14:46:50] uris: has joined #ruby
[14:47:01] adaedra: Even if I know it more by the name "Rogue", but whatever
[14:47:16] adaedra: Time for lessons
[14:47:28] centrx: has joined #ruby
[14:48:05] rippa: has joined #ruby
[14:48:19] Pupeno: has joined #ruby
[14:48:20] yorickpeterse: adaedra: (???? ???? ????) lessons eh?
[14:48:32] webguynow: has joined #ruby
[14:48:32] [k-_: ??\_(???)_/??
[14:48:35] redondo: has joined #ruby
[14:49:11] khebbie: has joined #ruby
[14:49:13] Ox0dea: Kono otoko.
[14:50:00] shevy: Katana Pyjama.
[14:50:25] Ox0dea: Esta chico.
[14:50:41] mary5030: has joined #ruby
[14:50:55] codeurge: has joined #ruby
[14:50:55] shevy: would it not be este chico and esta chica?
[14:51:23] polishdub: has joined #ruby
[14:51:27] Ox0dea: It would not.
[14:52:03] luksaur: has joined #ruby
[14:52:22] Ox0dea: Scratch that; you're totally right.
[14:52:31] Ox0dea: "This" is an adjective. :/
[14:52:47] EminenceHC: has joined #ruby
[14:52:48] Ox0dea: In "this guy", anyhow.
[14:52:53] bruno-: has joined #ruby
[14:53:43] Ox0dea: Gracias, Se??or Esqueleto.
[14:54:15] shevy: \o/ 20 years after school I still remember spanish
[14:54:37] yorickpeterse: you had spanish classes when you were 1?
[14:54:42] shevy: but everyone uses english anyway
[14:54:48] kies^: has joined #ruby
[14:54:58] shevy: yorickpeterse don't you dutch people learn how to count!
[14:55:00] platzhirsch: yorickpeterse: drop the silly emoticon
[14:55:13] shevy: you only learn dam building and muay thai :(
[14:55:23] yorickpeterse: platzhirsch: NEVAR
[14:55:35] Zarthus: has joined #ruby
[14:55:35] yorickpeterse: shevy: nfi how old you are so no idea
[14:55:50] yorickpeterse: but I can assure you we do learn how to count
[14:55:54] yorickpeterse: 1, 2, 5, 42, etc
[14:57:04] shevy: past a certain age it is very impolite to ask for the age
[14:57:13] yorickpeterse: wow you're that old?
[14:57:13] tjohnson: has joined #ruby
[14:57:18] Ox0dea: yorickpeterse: https://oeis.org/search?q=1%2C2%2C5%2C42
[14:57:25] dorei: has joined #ruby
[14:57:29] chouhoulis: has joined #ruby
[14:57:38] yorickpeterse: Ox0dea: totally planned that
[14:59:57] inteq: has joined #ruby
[15:03:10] krisquigley: has joined #ruby
[15:03:33] r_baron: has joined #ruby
[15:03:55] xet7: has joined #ruby
[15:05:37] cschneid_: has joined #ruby
[15:06:18] arup_r: has joined #ruby
[15:06:34] dionysus69: has joined #ruby
[15:06:52] krisquig_: has joined #ruby
[15:08:43] r_baron: has joined #ruby
[15:10:02] allcentury: has joined #ruby
[15:10:58] karapetyan: has joined #ruby
[15:11:38] shmilan: has joined #ruby
[15:11:44] baroquebobcat: has joined #ruby
[15:11:56] [k-_: 2,9,42,42,5
[15:12:06] bazbing80: could someone explain how a module can provide a method but not contain it? And how would I find the class that does contain said method? https://gist.github.com/anonymous/ed7fced52dbde5cd36f9
[15:12:40] Igorshp: has joined #ruby
[15:12:46] burgestrand: bazbing80: for one you want to look at instance_methods, not methods.
[15:12:56] [k-_: Ox0dea: https://oeis.org/search?q=2%2C6%2C1%2C6%2C6%2C5&sort=&language=&go=Search
[15:13:14] burgestrand: There's ways to conceal the true implementation of things, one is by using method_missing.
[15:13:14] [k-_: that's the number of sequences oeis contains!
[15:13:38] burgestrand: (but people like me will be slightly sad because it's useful to look at the source of something)
[15:14:08] bazbing80: Burgestrand: I know, right?!
[15:14:44] burgestrand: pry usually is good at finding the source of a method.
[15:14:59] bazbing80: the good folks at rpsec have also split rspec into multiple gems so c-tags is now utterly useless in finding out how it all works x/
[15:15:14] bazbing80: Burgestrand: ah yes, heard good thinks about pry
[15:15:15] karapetyan: has joined #ruby
[15:16:23] Ox0dea: >> Array.instance_method(:reduce).owner # bazbing80
[15:16:24] ruboto: Ox0dea # => Enumerable (https://eval.in/434412)
[15:16:44] adaedra: yorickpeterse: yes, lessons for driver license. Exiting, uh?
[15:17:12] karapetyan: hi there can anyone offer algorithm?
[15:17:19] Ox0dea: adaedra: You should not exit the motor vehicle while it is in motion.
[15:17:19] leat1: has joined #ruby
[15:17:34] adaedra: Ox0dea: so wise
[15:17:52] elfuego: has joined #ruby
[15:17:53] karapetyan: 1 1 1 1 1 - input data )
[15:18:04] [k-_: so, you want to show all the intermediatary steps?
[15:18:26] Ox0dea: karapetyan: How did you get from `2 2 1` to `3 1 1`?
[15:18:34] [k-_: how on earth does 2 2 1 become 3 1 1 though
[15:18:39] [k-_: Ox0dea: we think alike!
[15:18:50] Ox0dea: I'll phone the authorities.
[15:19:24] [k-_: Ox0dea: do you think this can be done with a scanl?
[15:19:26] karapetyan: = 3, 1 ,1, 1
[15:19:37] [k-_: karapetyan: no, you are subtracting 1 from 2
[15:19:42] [k-_: and shifting it to 3
[15:19:47] [k-_: which makes no sense
[15:19:50] Ox0dea: [k-_: That's exactly what scanl is for, right?
[15:20:16] [k-_: Ox0dea: it keeps a running total though, so not really like this sort of doing the small additions first
[15:20:30] Ox0dea: Well, the running "total" could be a list.
[15:20:55] [k-_: the running total is a list...
[15:21:31] araujo: has joined #ruby
[15:21:41] karapetyan: [k-_: don't understand. If i substract 1 from 2 there will be -1 ?
[15:22:08] Ox0dea: >> 2 - 1 # karapetyan
[15:22:09] ruboto: Ox0dea # => 1 (https://eval.in/434417)
[15:22:16] Ox0dea: [k-_: fibs = scanl (+) 0 (1:fibs)
[15:22:20] Ox0dea: That's my exposure to scanl. :P
[15:22:28] gregf_: >> >> ("1" * 5).split(//).map(&:to_i).reduce(:+)
[15:22:29] ruboto: gregf_ # => /tmp/execpad-6427eadade28/source-6427eadade28:2: syntax error, unexpected >> ...check link for more (https://eval.in/434419)
[15:22:33] CustosL1men: has joined #ruby
[15:22:39] gregf_: >> ("1" * 5).split(//).map(&:to_i).reduce(:+)
[15:22:40] ruboto: gregf_ # => 5 (https://eval.in/434420)
[15:22:53] yeticry: has joined #ruby
[15:23:05] Ox0dea: gregf_: #chars is a thing.
[15:23:22] gregf_: >>("1" * 5).chars.map(&:to_i).reduce(:+)
[15:23:23] ruboto: gregf_ # => 5 (https://eval.in/434423)
[15:23:38] momomomomo: has joined #ruby
[15:23:41] Ox0dea: gregf_: You realize you're not actually addressing karapetyan's problem?
[15:23:49] Luun: has joined #ruby
[15:23:55] gregf_: Ox0dea: i know ;)
[15:24:14] karapetyan: so, i ve got next code%
[15:24:21] Ox0dea: gregf_: So that was just noise for noise's sake?
[15:24:22] gregf_: Ox0dea: that algorithm looks suspicious :|
[15:24:25] Rubie: has joined #ruby
[15:24:46] [k-_: 2 2 1 ??? (2+1) (2-1) 1 ??? 3 1 1
[15:25:08] [k-_: but it does not make sense why you transfer the one to the other
[15:25:29] [k-_: i would expect 2 3 ??? 5 or 4 1 ??? 5
[15:25:40] karapetyan: https://gist.github.com/karapetyan/db089784a385de94ecf7
[15:25:55] bazbing80: Burgestrand: just wondering, how can a module be already initialized when you call it?
[15:26:17] gregf_: the calculation changes based on something like even and odd numbers in the set?
[15:26:50] burgestrand: bazbing80: What do you mean?
[15:27:05] karapetyan: i have a probably bad idea make overcoded version. Where i will have duplicates, store it in hash, and then make uniq! but it's probably not best solution.
[15:27:18] gregf_: if ( even ){ (n+n+1) 1 ) } else { n+1 n-1 1 }
[15:27:39] [k-_: Ox0dea: tell me what's wrong with the given code link above
[15:27:57] Ox0dea: [k-_: karapetyan's Gist?
[15:28:08] karapetyan: Ox0dea: yes.
[15:28:13] karapetyan: already sent it ^^
[15:28:23] webguynow: has joined #ruby
[15:28:32] [k-_: gregf: wouldn't 2 1 1 1 ??? 3 1 1 then?
[15:28:46] Ox0dea: [k-_: I suspect ?xy.
[15:28:54] karapetyan: [k-_: oh, there comment: if i make decomposition for 5 there will never be 2 + 2 + 1 in this case
[15:28:58] David27: has joined #ruby
[15:29:04] [k-_: it's the rabbit problem!
[15:29:05] radgeRayden_: has joined #ruby
[15:29:11] bazbing80: Burgestrand: I worked it out, no worries :P thanks again
[15:29:47] [k-_: karapetyan: gist the whole process of adding again
[15:29:53] [k-_: we are confuzzled
[15:30:05] Ox0dea: [k-_: This one? http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibrab.html
[15:30:18] dopamean_: has joined #ruby
[15:30:26] gregf_: karapetyan: how did you reach the conclusion that thats how the result's derived?
[15:31:01] [k-_: Ox0dea: no, that is different from his problem
[15:31:05] karapetyan: ok, give me a time to finish that version and i show you example there i can see troubles in output
[15:31:11] ta: has joined #ruby
[15:31:34] araujo: has joined #ruby
[15:31:41] wildlander: has joined #ruby
[15:31:45] Ox0dea: [k-_: I can't find anything else called The Rabbit Problem.
[15:32:12] gregf_: [2, 3, 4, 5].map{ |x| tot = 1; while ( x > 1 ); tot *= x; x-=1;end; tot } <= fibonacci?
[15:32:25] wildlander: has joined #ruby
[15:32:48] Ox0dea: gregf_: That's (really bad) factorial, no?
[15:33:01] gregf_: oops; sorry fact ;)
[15:33:08] jhass: platzhirsch: more like hirschkatze then?
[15:33:20] Ox0dea: >> [2,3,4,5].map { |n| (1..n).reduce :* } # This is how we do factorial in Ruby, gregf_.
[15:33:21] ruboto: Ox0dea # => [2, 6, 24, 120] (https://eval.in/434437)
[15:33:24] [k-_: Ox0dea: Rabbit.new
[15:33:35] Ox0dea: [k-_: Carrot.hide!
[15:33:38] [k-_: Ox0dea: https://gist.github.com/SkyBirdSoar/91f3f6587277cf713c9e
[15:33:39] gregf_: Ox0dea: timtoady ;)
[15:33:47] Ox0dea: gregf_: But not really this time.
[15:33:55] Ox0dea: gregf_: Keep your explicit while loops to yourself.
[15:34:07] [k-_: maybe that's what he is trying to do
[15:34:23] Ox0dea: [k-_: So 5 = 4?
[15:34:27] freerobby: has joined #ruby
[15:34:32] [k-_: that was an accident
[15:34:40] Spami: has joined #ruby
[15:35:21] dopamean1: has joined #ruby
[15:35:26] adaedra: def 5; 4; end
[15:35:30] JDiPierro: has joined #ruby
[15:35:35] shevy: is this legal
[15:35:44] Ox0dea: Semantically, but not syntactically.
[15:35:48] JDiPierro: has joined #ruby
[15:35:53] webguynow: has joined #ruby
[15:36:02] Ox0dea: >> define_method(?5) { 4 }; send ?5
[15:36:03] ruboto: Ox0dea # => 4 (https://eval.in/434438)
[15:36:17] Ox0dea: You asked.
[15:36:31] shevy: didn't you dislike ? there
[15:36:45] [k-_: according to this magazine, this is called number theory
[15:36:55] [k-_: number partitioning
[15:37:16] [k-_: https://en.wikipedia.org/wiki/Partition_(number_theory)
[15:37:19] gregf_: [2, 3, 4, 5].map { |x| arr= [1,1]; while x > arr.first; arr<<arr[-1]+arr[-2];x-=1;end; p arr } <== fibo ^^ Ox0dea its ugly i know :/
[15:37:21] AndyRyanSmith: has joined #ruby
[15:37:25] [k-_: wikipedia agrees
[15:37:31] shevy: I wrote wikipedia!
[15:37:40] [k-_: keep your ugly loops to yourself
[15:37:48] [k-_: ruby is a high level language!
[15:37:57] shevy: gregf_ they don't like your while :(
[15:38:02] adaedra: if only we could have high level discussions.
[15:38:14] [k-_: ?rimshot
[15:38:14] ruboto: Badum-Tshh! https://www.youtube.com/watch?v=oShTJ90fC34
[15:39:47] [k-_: who uses a while in a map anyway
[15:39:55] Ox0dea: Monsters.
[15:40:12] gregf_: [k-_: i dont ;). just bored writing java ;)
[15:40:32] Alina-malina: has joined #ruby
[15:40:39] VeryBewitching: has joined #ruby
[15:40:44] blackjid: has joined #ruby
[15:42:23] Papierkorb: My attempt: 10.times.each_with_object([1, 1]){|_, arr| arr << arr[-1] + arr[-2]}
[15:42:25] [k-_: fibo 0 = 0; fibo 1 = 0; fibo !n = fibo (n-2) + fibo (n-1)
[15:42:28] livathinos: has joined #ruby
[15:42:34] [k-_: that is what high level people do!
[15:42:42] gregf_: ooo recursion++
[15:42:43] [k-_: fibo starts with 0!
[15:43:06] [k-_: fibo 0 = 0 is a hack, sadly
[15:43:10] Macaveli: has joined #ruby
[15:43:46] ivanf: has joined #ruby
[15:44:10] araujo: has joined #ruby
[15:44:10] araujo: has joined #ruby
[15:44:38] andyrs: has joined #ruby
[15:44:38] _aeris_: has joined #ruby
[15:44:44] xcesariox: has joined #ruby
[15:45:28] Ox0dea: Don't breathe this: https://eval.in/434440
[15:45:48] bentanweihao: has joined #ruby
[15:46:09] Macaveli: has joined #ruby
[15:46:50] baroquebobcat: has joined #ruby
[15:47:03] [k-_: high level code!
[15:47:08] [k-_: good job, Ox0dea
[15:47:30] pietr0: has joined #ruby
[15:48:05] [k-_: not to mention it is lazily generated
[15:48:16] [k-_: and serves as a lookup table
[15:48:22] [k-_: imagine all the benefits!
[15:48:29] Ox0dea: There's a much better way to do that, though.
[15:48:51] gregf_: has joined #ruby
[15:48:51] Ox0dea: I just like that you can open the singleton class of something you just assigned.
[15:49:27] SlenderMan: has joined #ruby
[15:49:43] [k-_: provide an example
[15:49:47] Ox0dea: See above?
[15:49:51] IceyEC: has joined #ruby
[15:50:02] neanderslob: has joined #ruby
[15:50:04] Ox0dea: `def fib.next` defines the #next method in fib's singleton class.
[15:50:17] NeverDie: has joined #ruby
[15:50:35] [k-_: i meant, the much better way
[15:50:59] Ox0dea: Oh, Hash.new with a fancy default_proc.
[15:52:21] Sou|cutter: Ox0dea: that is neat :)
[15:52:45] Ox0dea: Sou|cutter: Best to forget what you saw, honestly. :P
[15:53:36] Papierkorb: https://eval.in/434449 ?
[15:53:44] Sou|cutter: well I wouldn't USE that, maybe ever, but still neat
[15:54:08] Tingo1983: has joined #ruby
[15:54:51] pawnbox: has joined #ruby
[15:55:56] [k-_: we have already seen that
[15:56:08] jdawgaz: has joined #ruby
[15:56:12] Ox0dea: >> fib = Hash.new { |h, k| h[k] = k < 2 ? k : h[k - 2] + h[k - 1] }; [fib[10], fib] # [k-_
[15:56:13] ruboto: Ox0dea # => [55, {0=>0, 1=>1, 2=>1, 3=>2, 4=>3, 5=>5, 6=>8, 7=>13, 8=>21, 9=>34, 10=>55}] (https://eval.in/434451)
[15:56:30] shevy: when [k-_ and Ox0dea are online at the same time, ruby code will become very obscure quickly
[15:56:59] [k-_: it's interesting how 1+2+3+4+5+6+7+8+9+10=55 as well
[15:57:14] [k-_: and the 10th term of the fib sequence is 55
[15:57:20] Ox0dea: S' gotta be aliems.
[15:57:51] pontiki: has joined #ruby
[15:57:53] dionysus69: has joined #ruby
[15:58:17] nettoweb: has joined #ruby
[15:58:44] ghosTzin: has joined #ruby
[15:59:21] Alayde: has joined #ruby
[16:00:04] amclain: has joined #ruby
[16:00:10] towski_: has joined #ruby
[16:00:22] webguynow: has joined #ruby
[16:01:51] EminenceHC: has joined #ruby
[16:02:53] skullcrasher: has joined #ruby
[16:03:14] Rubie: has joined #ruby
[16:03:15] Ox0dea: [3] pry(main)> 100000.times.select { |n| fib[n] == fac[n] }
[16:03:28] shevy: poor thread
[16:03:34] Ox0dea: Shame. Even with both memoized. :/
[16:03:53] codeurge: has joined #ruby
[16:03:57] dionysus69: has joined #ruby
[16:04:22] [k-_: 100000 is a bit big...
[16:04:31] Ox0dea: >> 100000.odd?
[16:04:32] ruboto: Ox0dea # => false (https://eval.in/434454)
[16:05:07] hyanW: has joined #ruby
[16:05:12] Ox0dea: I like the part where I thought I correctly read what you said before I cleared the buffer.
[16:05:46] jxv: has joined #ruby
[16:05:47] shinnya: has joined #ruby
[16:06:02] Ox0dea: [k-_: It only holds for n = 1. :/
[16:06:44] Ox0dea: We need to contact the folks that operate Tianhe-2.
[16:06:47] gregf_: has joined #ruby
[16:07:09] kies^: has joined #ruby
[16:07:17] webguynow: has joined #ruby
[16:07:31] Ox0dea: Or just a numberologizer.
[16:08:10] [k-_: try summation
[16:08:23] Ox0dea: It grows too slowly.
[16:08:25] agent_white: has joined #ruby
[16:08:26] casadei_: has joined #ruby
[16:08:29] Ox0dea: And of course factorial grows much too quickly.
[16:08:55] Ox0dea: What would * and + name their child?
[16:09:02] youngbaks: has joined #ruby
[16:09:43] havenwood: has joined #ruby
[16:09:47] mleung: has joined #ruby
[16:09:59] tobiasvl: starsterisk
[16:10:03] havenwood: Splatiplus Maximus
[16:10:12] Ox0dea: tobiasvl: Bit redundant?
[16:10:21] tobiasvl: uh yeah. that was dumb
[16:10:30] tobiasvl: but splatiplus, now that's genius
[16:10:48] Ox0dea: It's quite good.
[16:11:47] youngbaks: has joined #ruby
[16:12:11] dionysus69: has joined #ruby
[16:12:41] elperdut: has joined #ruby
[16:14:03] atomical: has joined #ruby
[16:16:36] codenapper: has joined #ruby
[16:16:53] Rubie: has joined #ruby
[16:17:07] baweaver: has joined #ruby
[16:17:11] yardenbar: has joined #ruby
[16:17:24] [k-_: it would be **
[16:17:35] dionysus69: has joined #ruby
[16:18:29] Ox0dea: [k-_: I was more asking what's the "middle ground" between addition and multiplication.
[16:18:48] dfockler: has joined #ruby
[16:20:32] [k-_: 6 + 6 = 12; 6 * 6 = 36; (36 + 12)/2 = 24; 2 + 4 = 6
[16:20:45] [k-_: i have successfully won the internet
[16:21:14] luckyme: has joined #ruby
[16:21:29] WajidKagzi: Interview question
[16:21:42] WajidKagzi: Divide numbers without using modulo operator in ruby
[16:21:43] [k-_: 7 + 7 = 14; 7 * 7 = 49; (14 + 49) / 2 = 31; 3 + 1 = 4; 4 + 3 = 7
[16:21:48] [k-_: i win it again!
[16:21:51] bricker: has joined #ruby
[16:22:11] [k-_: WajidKagzi: 5.fdiv 5
[16:22:16] [k-_: >> 5.fdiv 5
[16:22:17] ruboto: [k-_ # => 1.0 (https://eval.in/434469)
[16:22:24] havenwood: WajidKagzi: I don't ever use module to divide. You want modulo without using modulo?
[16:22:35] havenwood: s/module/modulo
[16:22:45] havenwood: WajidKagzi: Say more about the task?
[16:22:58] havenwood: >> 5.modulo 2
[16:22:59] ruboto: havenwood # => 1 (https://eval.in/434470)
[16:23:03] havenwood: ^ no modulo operator
[16:24:04] felixrsmith: has joined #ruby
[16:24:09] bluOxigen: has joined #ruby
[16:24:11] senayar: has joined #ruby
[16:24:11] senayar: has joined #ruby
[16:24:12] havenwood: I suppose if you get help with the interview question it's more likely you'll seek help with other problems.
[16:24:21] [k-_: wouldn't dividing be some sort of bit shift
[16:24:35] Ox0dea: [k-_: Only division by powers of 2.
[16:24:38] havenwood: WajidKagzi: Assuming you're allowed to ask, say more about what you want to do. Example inputs with expected output would help.
[16:24:53] Ox0dea: WajidKagzi: You're aware that multiplication is just repeated addition, I trust?
[16:25:05] Ox0dea: By that logic, division is just ___.
[16:25:20] [k-_: repeated negation! /s
[16:25:43] rakm: has joined #ruby
[16:26:17] Zarthus: Ox0dea: adding negative values to eachother?
[16:26:22] EminenceHC: has joined #ruby
[16:26:28] dfockler: All math is just addition!
[16:26:32] Zarthus: minus itself is also just repeated addition ;)
[16:26:37] dorei: division is repeated substruction :p
[16:26:47] dfockler: substraction is addition negated
[16:26:54] dorei: ie repeated additiion :)
[16:26:57] bluOxigen: has joined #ruby
[16:27:03] [k-_: division is * x^-1
[16:27:12] spider-mario: has joined #ruby
[16:27:38] Ox0dea: I'm pretty sure everything is just concatenation.
[16:28:12] weemsledeux: has joined #ruby
[16:28:19] dfockler: all atoms are just taking and receiving electrons
[16:28:22] scottschecter: has joined #ruby
[16:28:22] dionysus69: has joined #ruby
[16:28:28] Ox0dea: dfockler: Too high-level.
[16:28:42] dfockler: or low-level
[16:28:49] havenwood: Maybe we should add cat to un.rb...
[16:28:57] saltsa: has joined #ruby
[16:28:59] Ox0dea: Odd it's not in there already.
[16:29:08] Ox0dea: Run, cat, run!
[16:29:22] havenwood: I'd like to be able to: ruby -run cat
[16:29:27] Ox0dea: See above.
[16:29:45] pontiki: alias cat='echo "**NOPE**"'
[16:31:00] cih: has joined #ruby
[16:31:51] havenwood: pontiki: On OX X: alias cat="unalias cat && echo \"=^.^=\" && say --voice=\"Pipe Organ\" \"$(yes meow | head -n 33)\""
[16:32:33] havenwood: I think I'll do that at work today when someone steps away. Leave no trace!
[16:33:14] pontiki: i'mma try that
[16:33:24] clebrun: has joined #ruby
[16:33:30] dopamean_: has joined #ruby
[16:33:43] NeverDie: has joined #ruby
[16:33:54] FernandoBasso: has joined #ruby
[16:34:11] krz: has joined #ruby
[16:35:11] rakm: has joined #ruby
[16:35:18] pontiki: need more pipe organ
[16:35:24] havenwood: pontiki: And right after a which cat: /bin/cat
[16:36:28] havenwood: pontiki: Wiping it further from history is probably a bad idea since I don't actually want freaking out and drive formatting. :P
[16:36:35] rehat: has joined #ruby
[16:36:50] WajidKagzi: havewood: yes it is repeated addition
[16:37:17] WajidKagzi: but there would be some cases (negative) numbers that i dont want to deal with
[16:37:30] havenwood: WajidKagzi: So repeated subtraction until when?
[16:37:47] WajidKagzi: i was thinking of doing with shift operators
[16:38:02] WajidKagzi: the methods i define in my object have to cover all edge cases
[16:38:06] miguelff: has joined #ruby
[16:38:12] WajidKagzi: it was a question i was asked in one of my interviews.
[16:38:27] pontiki: what was your answer?
[16:38:29] WajidKagzi: i used the repeated addition and subtraction but didnt cover the edge cases.
[16:38:41] ngscheurich: has joined #ruby
[16:38:56] Ox0dea: WajidKagzi: What edge cases?
[16:39:02] WajidKagzi: negative integers
[16:39:11] Ox0dea: Those aren't edge cases.
[16:39:28] Ox0dea: They're not corner cases either.
[16:39:49] petricore: has joined #ruby
[16:39:53] clebrun: how do you update a single hash value and have it return the whole mutated hash? for example, have foo[:bar] = 1 return { bar: 1 } with the rest of foo.
[16:39:59] WajidKagzi: well suffice it to say i didnt get hired, hehe
[16:40:04] pontiki: you find yourself in a circular room. go to the corner.
[16:40:05] Ox0dea: clebrun: Use the #tap method.
[16:40:13] WajidKagzi: how would you go about it 0x0dea
[16:40:40] clebrun: 0x0dea: thanks, I'll look into it
[16:40:57] paulcsmith: has joined #ruby
[16:41:18] SCHAAP137: has joined #ruby
[16:41:45] chipotle: has joined #ruby
[16:42:05] ndrei: has joined #ruby
[16:42:18] fantazo: has joined #ruby
[16:43:04] shevy: hey he called you 0x0dea :)
[16:43:08] clebrun: i'll put it up here if I work it out
[16:43:23] casadei_: has joined #ruby
[16:43:24] clebrun: foo.tap { |self| self[:baz] = 1 }
[16:43:50] amoeba`: has left #ruby: ()
[16:44:10] clebrun: sneaky sneaky. just reinstalled irssi and for some reason tab completion for names isn't working
[16:44:15] clebrun: just assumed it was 0x
[16:44:37] Ox0dea: clebrun: It would be if it were permitted. Sorry for the confusion.
[16:44:57] clebrun: it's all good, thanks for the tip
[16:45:04] amargherio: has joined #ruby
[16:45:20] Ox0dea: WajidKagzi: Do you promise you're not trying to cheat on your homework?
[16:45:34] clebrun: btw just in case anyone else wants to use this, I'm using this to mutate hashes for testing.
[16:45:44] shevy: mutant hashes!
[16:46:04] clebrun: so fixture = factory.tap { |self| insert_incorrect_data(self) }
[16:46:26] clebrun: having that on 2 lines bugged the sh*t out of me
[16:47:04] Ox0dea: clebrun: Best not to use `self` as a variable name, mind.
[16:47:11] dorei: clebrun: aint hashes mutable by default?
[16:47:16] Rurik: has joined #ruby
[16:47:29] howdoicomputer: has joined #ruby
[16:47:39] tkuchiki: has joined #ruby
[16:47:41] Ox0dea: dorei: Yes, but clebrun wants to do his mutating on a single line.
[16:47:47] dorei: why 'in' is a keyword in ruby? :(
[16:47:54] amoeba`: has joined #ruby
[16:47:54] Ox0dea: dorei: `for i in (1..10)`
[16:48:07] dorei: is anyone using for? :O
[16:48:19] clebrun: Ox0dea: normally wouldn't, but for illustrative purposes
[16:48:27] Ox0dea: clebrun: Hm?
[16:48:36] dorei: in is a really good name for variables, now i have to resort to names as _in or input
[16:49:53] clebrun: Ox0dea: use self as a var
[16:50:15] crimsonskies: has joined #ruby
[16:50:32] crimsonskies: what do you remember about math?
[16:50:39] Ox0dea: clebrun: Well, because `self` tends to mean something very different in Ruby, and you oughtn't shadow it needlessly.
[16:51:24] nettoweb: has joined #ruby
[16:52:00] marius: has joined #ruby
[16:52:40] clebrun: Ox0dea: true, true
[16:52:58] clebrun: crimsonskies: almost nothing except that 2+2=5 and I love big brother
[16:53:01] Ox0dea: clebrun: It's unlikely to bite you in so limited a scope as a block, but probably best avoided nonetheless.
[16:54:41] clebrun: O also that might be confusing because your dealing with self inside a block, so wouldn't self be tap anyway?
[16:54:59] clebrun: Ox0dea: tab completion ^
[16:55:06] WajidKagzi: hahaha OxOdea
[16:55:22] Ox0dea: WajidKagzi: I think you probably are. :P
[16:55:39] WajidKagzi: nah im a junior dev learning my ways around emberjs
[16:55:42] Ox0dea: WajidKagzi: You wish you were trying to cheat on your homework?
[16:55:53] WajidKagzi: i wish i was still in high school
[16:56:01] n008f4g_: has joined #ruby
[16:56:22] webguynow: has joined #ruby
[16:56:44] lkba: has joined #ruby
[16:56:49] eam: WajidKagzi: no problem, go to a community college
[16:57:10] clebrun: not greendale tho
[16:57:10] gregf_: Ox0dea: and a guy :/. i thought g**s? was kinda banned on here :/
[16:58:17] saddad: has joined #ruby
[16:58:26] WajidKagzi: i will figure it out on my own
[16:59:03] gregf_: WajidKagzi: whats your actual question tho'?
[16:59:37] Igorshp: has joined #ruby
[16:59:41] Ox0dea: WajidKagzi: https://eval.in/434487
[16:59:52] karapetyan: has joined #ruby
[16:59:55] fostertheweb: has joined #ruby
[17:00:16] dionysus69: has joined #ruby
[17:01:11] Tuxero: has joined #ruby
[17:01:15] [Butch]: has joined #ruby
[17:01:35] [k-: he called you OxOdea!
[17:01:42] [k-: that's as invalid as it gets
[17:01:54] gregf_: Ox0dea: how can you use while?
[17:02:00] Jardayn: has joined #ruby
[17:02:05] [k-: ACTION emergency rescues Ox0dea
[17:02:12] Ox0dea: Danke, [k-.
[17:03:21] [k-: gregf_, in this case, that was not exclusion, unless Ox0dea doesn't think of himself as a guy
[17:03:28] [k-: that would be mislabelling then
[17:03:43] krisquigley: has joined #ruby
[17:03:57] Ox0dea: WajidKagzi: Do you understand how it works?
[17:04:00] ramfjord: has joined #ruby
[17:05:37] skade: has joined #ruby
[17:06:20] khebbie: has joined #ruby
[17:06:49] moeabdol: in rspec3 how to check if two arrays have the same elements in the same order?
[17:07:04] Rurik: has joined #ruby
[17:07:04] Rurik: has joined #ruby
[17:07:30] shadoi: has joined #ruby
[17:07:38] leat1: has joined #ruby
[17:08:33] Ox0dea: moeabdol: That's how equality is defined for Arrays.
[17:08:35] Guest50: has joined #ruby
[17:09:38] moeabdol: Ox0dea: so i simple expect(array1).to eq(array2)
[17:10:28] webguynow: has joined #ruby
[17:11:20] FernandoBasso1: has joined #ruby
[17:12:03] karapetyan: has joined #ruby
[17:12:47] prestorium: has joined #ruby
[17:13:18] gwendall: has joined #ruby
[17:13:36] devoldmx: has joined #ruby
[17:15:30] WajidKagzi: has joined #ruby
[17:15:38] chipotle_: has joined #ruby
[17:16:42] karapetyan: has joined #ruby
[17:16:51] podman: has joined #ruby
[17:17:07] Ox0dea: WajidKagzi: Please confirm that you have learned.
[17:17:22] mhib: has joined #ruby
[17:17:43] Ox0dea: Clear conscience (Y/n)?
[17:17:43] leat1: has joined #ruby
[17:18:13] dmolina: has joined #ruby
[17:23:46] Hanmac: has joined #ruby
[17:23:53] greenarrow: has joined #ruby
[17:24:32] webguynow: has joined #ruby
[17:25:43] ndrei: has joined #ruby
[17:27:40] chipotle: has joined #ruby
[17:27:52] cisco: has joined #ruby
[17:28:13] towski_: has joined #ruby
[17:28:30] andyrs: has joined #ruby
[17:29:27] EminenceHC: has joined #ruby
[17:30:01] andyrs: has joined #ruby
[17:31:06] ht__: has joined #ruby
[17:32:10] postmodern: has joined #ruby
[17:33:25] cvtsx: has joined #ruby
[17:34:19] amargherio: has joined #ruby
[17:35:28] WajidKagzi: thnk you 0x0dae
[17:35:49] aswen: has joined #ruby
[17:35:52] BlackCoyote: has joined #ruby
[17:35:52] da3mian: has joined #ruby
[17:36:06] shevy: thanks OxOdea
[17:36:13] siemprefresco: has joined #ruby
[17:36:40] i: has joined #ruby
[17:38:42] Butch128: has joined #ruby
[17:38:50] Butch128: has left #ruby: ()
[17:39:04] Butch128: has joined #ruby
[17:39:21] DanielI: has joined #ruby
[17:39:22] karapetyan: has joined #ruby
[17:40:16] Butch128: There is a function call in activerecord... .order(mycol: :desc) - if i wanted to call with these parameters dynamically.. how would I do this? .order(myvar: myvar2) doesn't work
[17:40:58] adaedra: .order ({ myvar => myvar2 })
[17:41:06] Butch128: ahh, is that all it is? a hash?
[17:41:22] s2013: has joined #ruby
[17:41:37] adaedra: yep, you're actually using a syntaxic sugar for generating a hash
[17:41:50] Ox0dea: And adaedra showed you how to salt it.
[17:41:57] adaedra: also, forget the silly space I added before the (
[17:42:03] Ox0dea: And the curly braces.
[17:42:40] adaedra: Ox0dea: hungry?
[17:43:10] Ox0dea: adaedra: Superfluous curly braces are syntactic salt, I think.
[17:43:41] adaedra: I don't know why I thought them to be compulsory there
[17:44:56] Ox0dea: In your defense, that the final argument can be an implicit Hash is a little strange.
[17:45:04] Ox0dea: Might even be unique to Ruby?
[17:45:44] adaedra: it's nice to use, but yes, a bit strange indeed
[17:45:47] kobain: has joined #ruby
[17:46:00] cvtsx1: has joined #ruby
[17:46:04] adaedra: and now that you can mix them with labelled parameters...
[17:46:31] EminenceHC: has joined #ruby
[17:48:15] petricore: has joined #ruby
[17:48:21] senayar: has joined #ruby
[17:48:36] nateberkopec: has joined #ruby
[17:48:47] senayar: has joined #ruby
[17:48:52] aaeron: has joined #ruby
[17:53:36] drewvanstone: has joined #ruby
[17:55:07] Beoran: has joined #ruby
[17:56:25] cvtsx: has joined #ruby
[17:58:11] mhib: has joined #ruby
[17:58:21] havenwood: has joined #ruby
[17:59:05] dionysus69: has joined #ruby
[17:59:17] siemprefresco: has joined #ruby
[18:01:06] webguynow: has joined #ruby
[18:01:49] nofxx: has joined #ruby
[18:02:52] s2013: has joined #ruby
[18:03:40] shevy: keep it simple people
[18:06:47] cvtsx1: has joined #ruby
[18:07:00] pwnd_nfsw: has joined #ruby
[18:09:20] pipework: Keep it, simple people.
[18:09:38] jhn: has joined #ruby
[18:09:40] shevy: http://redmonk.com/sogrady/2015/07/01/language-rankings-6-15/
[18:10:05] allomov: has joined #ruby
[18:10:17] aaeron: has joined #ruby
[18:10:52] shevy: ruby ranks fifth \o/
[18:10:59] havenwood: has joined #ruby
[18:10:59] karapetyan: shevy: ruby was higher befre?
[18:12:02] shevy: don't think so
[18:12:13] sixty4k_: has joined #ruby
[18:12:16] shevy: it has ranked higher on github before but that was when it had less competition among github and github-based projects
[18:13:34] karapetyan: shevy: ok :) well, than it's good news. More ruby - projects mean more job for ruby developers :) And if developer can write on ruby it's one more reason to be happy)
[18:13:45] ramfjord: has joined #ruby
[18:14:38] baweaver: has joined #ruby
[18:14:44] Maletor: has joined #ruby
[18:15:31] shevy: php ranks before ruby
[18:15:59] joshyjosh_: has joined #ruby
[18:16:18] Butch128: php... my day job... ruby... my fun (job)
[18:16:40] Butch128: no hate is strong... i do not enjoy using it
[18:16:53] tobiasvl: i hate php too
[18:16:55] Musashi007: has joined #ruby
[18:17:01] joshyjosh_: Ruby not that good career wise?
[18:17:05] tobiasvl: installed python flask on my webserver and broke routing to my old php site
[18:17:08] tobiasvl: I could probably fix it
[18:17:16] howdoicomputer: has joined #ruby
[18:17:17] tobiasvl: I'll just scrap it all
[18:17:22] Butch128: naw, tons of headhunters contact for ruby... but none pay the same
[18:17:23] miah: lets keep php hate in #ruby-offtopic
[18:17:31] Zai00: has joined #ruby
[18:17:58] sampc: has joined #ruby
[18:18:05] miah: you can trash ruby there too
[18:18:38] shevy: this is another nice graph: http://blog.codeeval.com/codeevalblog/2015#.VfmwWs89MWM=
[18:18:54] shevy: I don't know why python exploded
[18:19:52] Ox0dea: It's being taught in schools.
[18:20:27] eam: and rhel
[18:20:45] shevy: what are the rhel people doing? using python?
[18:21:07] joshyjosh_: scratch that googled it
[18:21:16] centrx: yeah everyone knows PHP rulez
[18:21:45] Lumio: has joined #ruby
[18:21:52] WajidKagzi: has joined #ruby
[18:22:10] wmoxam: meh, you can get shit done with pretty much anything. Just use what you enjoy and forget about what everyone else uses :p
[18:22:52] shevy: perl is declining wmoxam
[18:23:27] eam: shevy: in relative or absolute terms?
[18:23:33] JoshyJosh: has joined #ruby
[18:23:38] cih: has joined #ruby
[18:23:39] eam: I don't think *any* language is declining in absolute terms
[18:23:43] wmoxam: shevy: meh
[18:23:52] wmoxam: people get stuff done with it
[18:24:02] shevy: eam yeah, absolute is hard to say, but relatively for sure
[18:24:05] wmoxam: and some really enjoy it. Yay!
[18:24:15] pragmatism: has joined #ruby
[18:24:29] The_Phoenix: has joined #ruby
[18:24:35] yfeldblum: has joined #ruby
[18:24:39] nofxx: github is getting flooded with Go too nowdays
[18:24:54] nofxx: never touched
[18:25:24] chipotle: has joined #ruby
[18:25:40] shevy: I guess we'll have to wait with Go until something really big is written in it
[18:27:58] symm-: has joined #ruby
[18:28:55] joshyjosh_: where would one go for rake error questions? Been doing the "Learn Ruby the Hard Way" guide adn been having trouble with testing code.
[18:30:43] banjara: has joined #ruby
[18:30:43] freezevee: has joined #ruby
[18:31:12] shinnya: has joined #ruby
[18:31:16] dopie: has joined #ruby
[18:31:32] WajidKagzi: has joined #ruby
[18:32:47] beauby: has joined #ruby
[18:33:42] ruby-lang600: has joined #ruby
[18:34:36] shevy: joshyjosh_ you could try here, not everyone knows a lot about rake though
[18:35:44] nofxx: shevy, which is sad, rake is so nice. Could have more love.
[18:37:50] dorei: i have this alias for bash, alias rake='bundle exec `which rake`'
[18:37:54] aaeron: has joined #ruby
[18:37:56] ruby-lang600: could anyone spare a couple of minutes to help me out please?
[18:38:05] chipotle: has joined #ruby
[18:38:17] s2013: has joined #ruby
[18:38:21] nofxx: dorei, add ruby bin on your LOAD_PATH
[18:38:40] nofxx: dorei, ~/.gem/ruby/x.x.x/bin
[18:38:56] dorei: hmm, which rake isnt needed
[18:39:03] nofxx: ruby-lang600, just ask
[18:39:11] dorei: i'm removing the which from my alis
[18:39:30] nofxx: dorei, yup, will be not. That actually won't work anyways. (if it's not on your load_path)
[18:39:49] ruby-lang600: just a brief context: today i enrolled myself in a startup incubation program
[18:39:51] tomaz_b: has joined #ruby
[18:39:59] ruby-lang600: and I have 11 weeks to develop a web application
[18:40:07] ruby-lang600: which I intend to do in RoR
[18:40:15] kirun: has joined #ruby
[18:40:16] dorei: nofxx: i'm using rvm, so if it's not in my load_path, then something is wrong
[18:40:24] ruby-lang600: I started this monday and have been struggling to get the basics the last 3 days
[18:40:48] ruby-lang600: I can already perform basic tasks like getting input from users, parsing info and storing in database
[18:41:05] ruby-lang600: but for the rest of the week I would like to give some attention to the layout
[18:41:13] ruby-lang600: i have no experience in bootstrap
[18:41:14] Zai00: has joined #ruby
[18:41:27] ruby-lang600: and i am in doubt whether to buy a bootstrap theme and go from there
[18:41:35] Drager: has left #ruby: ()
[18:41:36] nofxx: dorei, Ah can't help, sorry. Don't use and recommend against rvm.
[18:41:58] ruby-lang600: i found one template which i really like but doesn't user LESS or SSAS
[18:42:10] dorei: nofxx: rvm is awesome :)
[18:42:30] ruby-lang600: so my first question is where should i start to grasp into the basics of building the web front for my app?
[18:42:52] nofxx: dorei, the software might be. The reason to use it nil.
[18:43:44] nofxx: ruby-lang600, not sure right channel here. More like backend talk here. Anyways, there's plenty of css2sass converters
[18:44:30] havenwood: has joined #ruby
[18:45:01] krisquigley: has joined #ruby
[18:45:07] ruby-lang600: which channel should i go for some assistance?
[18:45:22] ruby-lang600: i just installed colloquy so..
[18:45:24] segfalt: has joined #ruby
[18:45:49] nofxx: Good question. Dunno what's the css channel on freenode. ruby-lang600 check the channel search
[18:46:13] Musashi007: has joined #ruby
[18:46:44] aaeron: has joined #ruby
[18:46:58] jas02: has joined #ruby
[18:47:01] xfbs: has joined #ruby
[18:47:18] otacon-: has joined #ruby
[18:47:27] sampc: has joined #ruby
[18:48:10] andyrs: has joined #ruby
[18:48:42] Rurik: has joined #ruby
[18:48:47] Rurik: has joined #ruby
[18:49:44] jahpereira: has joined #ruby
[18:50:33] jahpereira: could someone spare a couple of minutes to give me a hand?
[18:50:52] jahpereira: i have been learning ruby for the last couple of days
[18:51:04] Guest50: has joined #ruby
[18:51:08] jahpereira: and now i am struggling to get the front end of my web app
[18:51:12] wasamasa: we're all waiting for the actual question
[18:51:17] jahpereira: but have no clue where to start
[18:51:24] jahpereira: i have no experience in bootstrap
[18:51:44] jahpereira: with bootstrap*
[18:51:57] jdawgaz: has joined #ruby
[18:52:16] jahpereira: so my question is whether u recommend me to buy an existing bootstrap template and try to glue it to my controllers (already did some stuff there)
[18:52:41] jahpereira: or how should i start to understand how bootstrap templates (or others) work with ruby?
[18:53:00] urubuz: has joined #ruby
[18:54:41] jgt1: how do I access an instance variable of a parent class?
[18:54:47] wasamasa: err, jahpereira
[18:54:54] wasamasa: jahpereira: you can buy bootstrap templates?
[18:55:16] jahpereira: you mean if i have financial conditions to do that
[18:55:32] Ox0dea: jgt1: foo.superclass.instance_variable_get, but there's no way that's what you actually want.
[18:55:49] wasamasa: jahpereira: no, I did assume so far that you download bootstrap to not have to pay for pretty decent base styling
[18:55:51] shortdudey123: has joined #ruby
[18:55:57] wasamasa: jahpereira: so this sounds very foreign to me
[18:55:58] jgt1: Ox0dea: yeah, that doesn't sound right
[18:56:22] Ox0dea: jgt1: Are you sure you want to muck about in some other object's instance variables?
[18:56:38] jahpereira: i saw some examples which used bootstrap
[18:56:39] ndrei: has joined #ruby
[18:56:43] jgt1: I *think* so???
[18:56:57] jahpereira: for example this tempalte: https://wrapbootstrap.com/theme/velonic-admin-dashboard-frontend-WB0R9B09G
[18:57:25] wasamasa: jahpereira: I did never use anything else than their stock templates
[18:58:10] jahpereira: like these ones? http://www.bootstrapzero.com/templates/stock
[18:58:40] tylerflint: has joined #ruby
[18:58:52] tylerflint: has left #ruby: ()
[18:58:53] wasamasa: no, these: http://themes.getbootstrap.com/
[18:59:12] wasamasa: or rather, just the default one
[18:59:31] wasamasa: you know, the one you get when hitting the download button on http://getbootstrap.com/
[18:59:34] jahpereira: these are free?
[18:59:54] jahpereira: oh they aren't
[18:59:58] jahpereira: just clicked on one
[19:00:05] wasamasa: I did just notice their other themes aren't free either
[19:00:31] xfbs: has joined #ruby
[19:00:32] wasamasa: so, if you don't want to design yourself or shell out some money, the default theme is pretty fine to get something basic going
[19:00:37] Pupeno: has joined #ruby
[19:00:47] wasamasa: heck, it shouldn't matter at all if you're learning
[19:01:02] SOLDIERz: has joined #ruby
[19:01:13] wasamasa: so, your question was about where to start?
[19:01:37] siemprefresco: has joined #ruby
[19:01:38] Rurik: has joined #ruby
[19:02:04] nofxx: has joined #ruby
[19:02:28] Igorshp: has joined #ruby
[19:02:59] wasamasa: well, set up your application, add the css and js to wherever it belongs, tweak the views to make use of the css classes and js blingbling
[19:03:11] wasamasa: you shouldn't spend most of your time with this
[19:03:24] shortdudey123: has joined #ruby
[19:03:28] jackjackdripper: has joined #ruby
[19:04:09] bruno-: has joined #ruby
[19:04:59] jahpereira: sorry for the delay
[19:05:10] jahpereira: actually the second link i shared had free tempaltes
[19:05:16] jahpereira: just got a cool navigation bar
[19:05:19] shortdudey123: has joined #ruby
[19:05:43] jackjackdripper: has joined #ruby
[19:05:58] platzhirsch: has left #ruby: ()
[19:06:11] xfbs: has joined #ruby
[19:06:40] aaeron: has joined #ruby
[19:07:04] jahpereira: but reading the readme file donest give my any clue that this can be used with rails
[19:08:09] khebbie: has joined #ruby
[19:08:25] miguelff: has joined #ruby
[19:09:56] chipotle: has joined #ruby
[19:09:58] wasamasa: I'd be concerned if it couldn't
[19:10:00] youngbaks: has joined #ruby
[19:10:23] wasamasa: apparently you're pretty new to this
[19:10:31] BLuEGoD: has joined #ruby
[19:10:43] wasamasa: web development covers quite a lot of bases, so please don't forget practicing the basics of everything
[19:14:19] WajidKagzi: has joined #ruby
[19:14:52] elperdut: has joined #ruby
[19:15:43] jahpereira: just rusty that???s all
[19:15:53] jahpereira: last time i worked with a MVC framework
[19:16:00] jahpereira: was 7 years ago with cake php
[19:16:55] pipework: Did it make you fat and give you diabetes?
[19:16:59] dfockler: has joined #ruby
[19:17:09] wasamasa: I've met quite a few PHP folks who had to relearn everything they thought they knew about web development
[19:17:13] wasamasa: always funny
[19:17:29] wasamasa: "What do you mean, you can write code that doesn't make your eyes bleed?"
[19:17:56] jahpereira: yoep, ruby seems quite intuitibe
[19:17:59] adaedra: "What do you mean, you don't need to install Apache to run an application"
[19:18:27] pipework: "How do I set up ruby with apache?" "Don't. A+ easy"
[19:18:46] wasamasa: well, it's less intuitive and more that you actually have a chance of just taking any rails project and customizing it to fulfil that pet peeve you've got
[19:18:50] wasamasa: it's an amazing feeling
[19:19:04] jhooker: has joined #ruby
[19:19:26] wasamasa: if I tried doing that with wordpress, oh well, better not
[19:19:31] ChanServ: -b irreverant!*@*
[19:19:51] beauby: has joined #ruby
[19:19:57] jahpereira: i will try railsforzombies for the next couple of hours
[19:20:01] jahpereira: to relax a bit
[19:20:01] weemsledeux: has joined #ruby
[19:20:08] pipework: jahpereira: Ruby also isn't riddled with preserving backwards compatible security problems.
[19:20:08] shaman42_: lets not argue about what programming language is the best, every language has it uses.
[19:20:13] wasamasa: jahpereira: try the rails channel, too
[19:20:21] Ox0dea: shaman42_: When should I use brainfuck?
[19:20:24] pipework: shaman42_: Some are just best left to the trash bin.
[19:20:34] pipework: Ox0dea: When 90% of your keyboard doesn't work.
[19:20:35] shevy: ruby is best
[19:20:36] jahpereira: thank you @wasamasa
[19:20:36] wasamasa: Ox0dea: design of cutting edge compilers/interpreters
[19:20:37] shaman42_: for example php, best is when you were in 2003
[19:20:46] wasamasa: Ox0dea: I wish I was kidding
[19:20:48] Ox0dea: Well, shit. That's two decent answers.
[19:20:54] Ox0dea: wasamasa: Nah, it actually makes sense.
[19:21:13] wasamasa: Ox0dea: I've seen two blog posts on the topic and it was nice that you could comprehend them for a change
[19:21:17] baweaver: has joined #ruby
[19:21:17] pipework: Brainfuck++ is nice if you need networking and only have your 10-digit keypad handy
[19:22:16] Ox0dea: http://calmerthanyouare.org/2015/01/07/optimizing-brainfuck.html
[19:22:24] Ox0dea: wasamasa: That's one of the ones you had in mind, I imagine?
[19:22:30] wasamasa: Ox0dea: no, that's the third one
[19:22:44] wasamasa: Ox0dea: http://www.wilfred.me.uk/blog/2015/08/29/an-optimising-bf-compiler/
[19:22:58] foobar121: has joined #ruby
[19:23:06] Ox0dea: Ah, that's one very specific to brainfuck, though.
[19:23:11] Ox0dea: The one I linked goes into IR and whatnot.
[19:23:13] wasamasa: and http://nickdesaulniers.github.io/blog/2015/05/25/interpreter-compiler-jit/
[19:23:58] Ox0dea: This one looks really good.
[19:24:21] chipotle: has joined #ruby
[19:24:47] foobar121: So I found a job description that requires the ideal candidate to be able to process tens of billions of "combinations" per second. Am I living under a rock or is this impossible?
[19:25:08] pipework: foobar121: I think they just mean someone with a brain that functions.
[19:25:10] platzhirsch: has joined #ruby
[19:25:19] wasamasa: ACTION gasps
[19:25:53] joshyjosh_: friggin a gotta get that brain process-o-meter
[19:26:03] foobar121: I was assuming they meant "be able to write a program that does this", not "be able to do this with your brain"
[19:26:12] skade: has joined #ruby
[19:26:23] foobar121: but even so, i'm pretty sure the fastest processor in the world is only like 8.5Ghz
[19:26:33] shevy: >> x = 'abc'; x.lchop
[19:26:35] ruboto: shevy # => undefined method `lchop' for "abc":String (NoMethodError) ...check link for more (https://eval.in/434532)
[19:26:45] Ox0dea: shevy: You want #ltrim there.
[19:26:45] shevy: hmm... we have .chop; do we have a method that chops on the left side?
[19:26:56] joshyjosh_: aight i got that rake error:
[19:26:57] joshyjosh_: Command failed with status (1): [ruby -I"lib:tests" "/home/[username]/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb" "tests/test_NAME.rb" ]
[19:27:00] Ox0dea: shevy: #lstrip.
[19:27:02] jenrzzz: has joined #ruby
[19:27:12] Ox0dea: Mind, #chop and #strip do different things.
[19:27:36] shevy: I was so excited when .lchop worked in irb... then I realized, I added it :(
[19:27:52] Ox0dea: You need to remove a newline from the left...?
[19:28:17] Ox0dea: Oh, sorry; I'm thinking of #chomp.
[19:28:21] shevy: nah, just chop off leading characters; I have a lot of code where I do things like: x[0,1] == '' if x[0,0] == 'A'
[19:28:36] shevy: and other code like: x[0,0] = 'abc' - the latter ones I can replace via .prepend
[19:28:40] Ox0dea: But... all of these methods take an argument.
[19:28:55] siemprefresco: has joined #ruby
[19:29:26] shevy: I even used to have things like: x[-'abc'.size,'abc'.size'] == 'abc' or something like that... until I found out that we have .start_with? and .end_with?
[19:29:27] kadoppe: has joined #ruby
[19:30:19] Ox0dea: That reminds me of using [min, foo, max].sort[1] to clamp.
[19:32:07] EminenceHC: has joined #ruby
[19:33:13] gix: has joined #ruby
[19:33:42] dc_: has joined #ruby
[19:35:57] bougyman: has joined #ruby
[19:36:20] apt-get: has joined #ruby
[19:36:30] isabelle: has joined #ruby
[19:37:44] wasamasa: Ox0dea: wat
[19:38:04] radgeRayden: has joined #ruby
[19:38:40] Ox0dea: wasamasa: For limiting a value to some range?
[19:38:47] cih: has joined #ruby
[19:39:48] Zai00: has joined #ruby
[19:39:56] wasamasa: Ox0dea: you didn't, like, uh
[19:40:06] wasamasa: >> x = 0.5; [1, [0, x].max].min
[19:40:07] ruboto: wasamasa # => 0.5 (https://eval.in/434533)
[19:40:25] Ox0dea: That's pretty unpleasant, in my opinion.
[19:40:30] Ox0dea: >> [0, 1, 0.5].sort[1]
[19:40:31] ruboto: Ox0dea # => 0.5 (https://eval.in/434534)
[19:40:45] jas02: has joined #ruby
[19:41:51] rakm: has joined #ruby
[19:42:15] WajidKagzi: has joined #ruby
[19:42:33] davedev24: has joined #ruby
[19:42:43] s2013: has joined #ruby
[19:42:55] zoo-zed: has joined #ruby
[19:43:49] wasamasa: Ox0dea: you CPU cycles waster!
[19:43:54] havenwood: has joined #ruby
[19:43:57] Ox0dea: Y'got me.
[19:44:10] Ox0dea: Ruby's sort is pretty heavily optimized, for what that's worth.
[19:45:01] wasamasa: I doubt you can beat two comparisons with it
[19:45:17] wasamasa: anyways, I didn't think of that way of solving it
[19:45:31] andyrs: has joined #ruby
[19:45:39] x-light: has joined #ruby
[19:46:11] blackmesa: has joined #ruby
[19:46:22] chipotle: has joined #ruby
[19:46:39] nettoweb: has joined #ruby
[19:47:10] eosinx: has joined #ruby
[19:47:51] miguelff: has joined #ruby
[19:48:22] sgambino: has joined #ruby
[19:49:35] tkuchiki: has joined #ruby
[19:50:09] casadei_: has joined #ruby
[19:50:10] opensource_ninja: has joined #ruby
[19:50:20] aaeron: has joined #ruby
[19:52:10] Ox0dea: http://i.imgur.com/0E0y5H6.png
[19:52:42] jamesaxl: has joined #ruby
[19:52:54] karapetyan: has joined #ruby
[19:54:20] Jackneill: has joined #ruby
[19:55:27] Ox0dea: "Modern miracle" would be an insult to their ops team.
[19:56:08] platzhirsch: Anyone here who's working for Facebook by any chance?
[19:56:30] wasamasa: anyone working at facebook would be too busy to answer
[19:56:49] wasamasa: if anything, you'll get recruited if you don't go at them yourself
[19:57:14] Ox0dea: I think SPJ interacts with #haskell now and again.
[19:57:15] wasamasa: ACTION almost got recruited for an internship in hamburg
[19:57:38] Eddieh_: has joined #ruby
[19:57:47] shevy: for facebook?
[19:58:32] EminenceHC: has joined #ruby
[19:58:48] platzhirsch: what? No, this is not about recuriting/recuritment
[19:58:54] WajidKagzi: has joined #ruby
[19:59:01] xfbs: has joined #ruby
[19:59:06] havenn: has joined #ruby
[19:59:25] Coldblackice: has joined #ruby
[20:00:09] baweaver: has joined #ruby
[20:00:15] hahuang65: has joined #ruby
[20:01:36] jhooker: has joined #ruby
[20:02:59] aaeron: has joined #ruby
[20:03:37] chills42_: has joined #ruby
[20:03:37] wasamasa: ACTION yawns
[20:03:44] allomov: has joined #ruby
[20:05:06] voltalio: has joined #ruby
[20:07:47] chipotle: has joined #ruby
[20:07:56] joshyjosh_: any tips on getting internships?
[20:08:47] havenn: >> 'tips'.intern
[20:08:48] ruboto: havenn # => :tips (https://eval.in/434570)
[20:08:56] cornerma1: has joined #ruby
[20:09:26] radgeRayden: has joined #ruby
[20:09:26] havenn: joshyjosh_: Where are you looking? In-person or remote or either?
[20:09:26] mikelodeon: has joined #ruby
[20:09:55] krz: has joined #ruby
[20:11:33] xfbs: has joined #ruby
[20:11:36] pipework: joshyjosh_: Almost invariably, be really charismatic, quick to say that you don't know but can know in short order, and to have github projects.
[20:11:46] s2013: has joined #ruby
[20:12:17] jhooker: has joined #ruby
[20:12:30] joshyjosh_: id go for either, but prefer local, kinda see how a dev team works.
[20:13:04] joshyjosh_: hmm, should get some projects going for github. need something other than a to-do list
[20:13:12] postmodern: has joined #ruby
[20:13:23] eam: joshyjosh_: contribute to someone else's project, something people would recognize in an interview
[20:13:24] ytti: starting is PITA
[20:13:34] eam: if you can't think of anything to add/fix, write docs
[20:13:39] ytti: should make some personal rules
[20:13:45] ytti: that every day you write code for 1h
[20:13:52] ytti: no exceptions
[20:14:13] eam: well, no uncaught exceptions
[20:15:35] t3rm: has joined #ruby
[20:15:50] miguelff: has joined #ruby
[20:16:08] joshyjosh_: kidna am doing the 1 hour+ a day code thing. Problem is i've been diving alot into books and not into projects themselves. Guess next big thing is getting to better grips with github.
[20:16:33] Oka: has joined #ruby
[20:18:55] rickmasta: has joined #ruby
[20:19:13] zero_drool: has joined #ruby
[20:19:14] havenn: joshyjosh_: Where is local for you?
[20:19:35] joshyjosh_: Slovenia, Ljubljana
[20:19:57] moeabdol1: has joined #ruby
[20:20:04] rakm: has joined #ruby
[20:20:08] joshyjosh_: could travel round the country a bit though
[20:20:25] tejasmanohar: has joined #ruby
[20:20:55] EminenceHC: has joined #ruby
[20:21:12] n_blownapart: has joined #ruby
[20:23:14] gp5st: has joined #ruby
[20:23:57] sampc: has left #ruby: ("Saliendo")
[20:24:27] gp5st: is there a well-known dataframes implementation like R's or Pandas (Python)?
[20:24:56] sepp2k: has joined #ruby
[20:25:05] nateberkopec: has joined #ruby
[20:25:15] gp5st: (I know libraries exist, but I don't know how common, stable, or well-used they are)
[20:26:24] Ox0dea: gp5st: https://github.com/v0dro/daru appears to be the most active.
[20:26:53] gp5st: Ox0dea: thanks
[20:26:56] Ox0dea: Sure thing.
[20:27:16] Ox0dea: That the usage documentation is in IPython notebooks is disheartening.
[20:28:38] diegoviola: has joined #ruby
[20:29:55] momomomomo: has joined #ruby
[20:30:05] chipotle: has joined #ruby
[20:31:53] gp5st: I've recently started using ipython and it's quite nice
[20:32:48] Butch128: has left #ruby: ()
[20:32:51] twodayslate: has joined #ruby
[20:33:08] gp5st: sadly Ruby and I lost our passion when I was hired to work on a rails app that made me cry. I would like to spend some time to see what's changed, as this was at the 1.8-1.9 era
[20:33:10] twodayslate: does alias_method run no matter what?
[20:33:50] Ox0dea: twodayslate: What do you suppose might stop it from doing so?
[20:34:16] twodayslate: if I have an if statement surround it Ox0dea
[20:34:17] WajidKagzi: has joined #ruby
[20:34:59] renderful: has joined #ruby
[20:35:16] Ox0dea: twodayslate: Nothing runs in the conditional branch that doesn't get taken.
[20:35:19] sixty4k_: has joined #ruby
[20:36:19] chipotle: has joined #ruby
[20:36:21] twodayslate: how do I prevent alias_method from running twice?
[20:36:33] Ox0dea: You shouldn't have to bother?
[20:36:54] dfockler: has joined #ruby
[20:37:33] sixty4k_: has joined #ruby
[20:38:17] twodayslate: it appears to be. works the first time file is loaded, then when loaded again I get a stack level too deep error
[20:38:23] twodayslate: will continue to investigate
[20:38:57] eam: interestingly "Nothing runs in the conditional branch that doesn't get taken." means you can create local variables without assigning to them
[20:39:19] Ox0dea: >> destroy the universe and other bad things if false
[20:39:20] ruboto: Ox0dea # => nil (https://eval.in/434606)
[20:39:44] eam: >> x = 1 if false; x.inspect
[20:39:45] ruboto: eam # => "nil" (https://eval.in/434608)
[20:40:16] Ox0dea: >> x = local_variables
[20:40:17] ruboto: Ox0dea # => [:x] (https://eval.in/434609)
[20:40:43] eam: ruby *ought* to scope conditional blocks
[20:41:18] eam: like this:
[20:41:22] eam: >> def myif(cond) if cond; yield; end; end; myif(false) { x = 1 }; puts x.inspect
[20:41:23] ruboto: eam # => undefined local variable or method `x' for main:Object (NameError) ...check link for more (https://eval.in/434617)
[20:41:39] eam: probably part of ruby's terrible history re: scope
[20:42:09] pabs: has joined #ruby
[20:42:28] eam: most reasonable languages have proper blocks for conditionals, with the potential for locals scoped to them
[20:42:43] gregf: has joined #ruby
[20:44:35] EminenceHC: has joined #ruby
[20:45:00] BraddPitt: sorry, its my alias for switching windows in irssi
[20:45:00] based_pdev: has joined #ruby
[20:45:47] Ox0dea: BraddPitt: You should tell irssi not to let you send messages like that.
[20:46:02] krisquigley: has joined #ruby
[20:46:25] chrisja: has joined #ruby
[20:47:54] chipotle: has joined #ruby
[20:49:10] BraddPitt: but what if someone asks me what my alias for switching windows in irssi is?
[20:51:34] zacts: has joined #ruby
[20:51:34] zacts: has joined #ruby
[20:51:57] tvw: has joined #ruby
[20:51:58] darix: eam the x used to leak in the past
[20:52:00] darix: but not anymore
[20:52:49] Melpaws: has joined #ruby
[20:53:32] momomomomo: has joined #ruby
[20:53:35] nik_-_: has joined #ruby
[20:55:55] Igorshp: has joined #ruby
[20:56:20] symm-: has joined #ruby
[20:56:58] Illusioneer: has joined #ruby
[20:58:20] ellisTAA: has joined #ruby
[20:58:34] sp4rrow: has joined #ruby
[20:59:38] gregf: has joined #ruby
[21:02:28] A124_: has joined #ruby
[21:02:59] A124: has joined #ruby
[21:03:54] aaeron: has joined #ruby
[21:04:07] apt-get: has joined #ruby
[21:05:22] nanoz: has joined #ruby
[21:06:00] drewvans1one: has joined #ruby
[21:06:04] JDiPierro: has joined #ruby
[21:06:07] WajidKagzi: has joined #ruby
[21:07:38] gregf: has joined #ruby
[21:09:45] neanderslob: has joined #ruby
[21:10:35] eam: darix: I think you mean a block argument used to leak ala x = 5; [10].each { |x| } # x used to be 10, now is 5
[21:10:55] eam: now it shadows -- but in conditionals there's no different scope at all
[21:11:05] RobertBirnie: has joined #ruby
[21:11:15] eam: whereas in C, any braces carves out a new set of locals on the stack
[21:11:22] eam: (or perl, or most other langauges)
[21:12:12] elfuego: has joined #ruby
[21:12:22] WajidKagzi: has joined #ruby
[21:12:23] eam: eg if (0) { int x; } // x doesn't exist in the outer scope
[21:12:55] eam: because { and } are referring to points on the stack
[21:13:05] yfeldblum: has joined #ruby
[21:15:06] jhn: has joined #ruby
[21:15:14] solocshaw: has joined #ruby
[21:15:41] solocshaw: has joined #ruby
[21:16:15] Maletor: has joined #ruby
[21:16:29] howdoico1: has joined #ruby
[21:16:42] casadei_: has joined #ruby
[21:17:02] musl: has joined #ruby
[21:17:41] weemsledeux: has joined #ruby
[21:21:53] cih: has joined #ruby
[21:22:41] k3asd`: has joined #ruby
[21:22:48] nettoweb: has joined #ruby
[21:23:05] Guest50: has joined #ruby
[21:25:45] chipotle: has joined #ruby
[21:27:00] peterhu: has joined #ruby
[21:28:43] ndrei: has joined #ruby
[21:29:33] FernandoBasso: has joined #ruby
[21:30:33] diegoviola: has joined #ruby
[21:30:54] wryfi: has joined #ruby
[21:31:29] wryfi: i'm trying to install slanger with chruby, an everything seems fine until i try to run slanger
[21:31:33] wryfi: then i get
[21:31:55] wryfi: ~/.rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError)
[21:32:07] linux_dr: has joined #ruby
[21:32:08] chipotle: has joined #ruby
[21:32:13] wryfi: can anybody point me in a direction?
[21:32:28] pipework: I'm always a fan of Northwest.
[21:32:42] linux_dr: any chance there???s a standard Ruby idiom equivilant to this: (a.class == Array) ? a : ((a == nil) ? [] : [ a ]) ?
[21:33:09] linux_dr: sounds a bit like the opposite of splat.
[21:33:41] dfockler: wryfi: do you have bundler installed?
[21:34:08] pipework: linux_dr: Array(a)
[21:34:08] wryfi: perhaps that is the problem
[21:34:22] aaeron: has joined #ruby
[21:34:38] wryfi: dfockler: yup, that was it. duh.
[21:34:44] linux_dr: pipework: thanks
[21:34:49] dfockler: wryfi: no worries, done that myself a few times
[21:34:50] wryfi: surprised it didn't get pulled in when i did gem install slanger
[21:35:14] Ox0dea: linux_dr: Also [*a] if that's more your style.
[21:35:17] krisquigley: has joined #ruby
[21:35:18] Kallis: has joined #ruby
[21:35:20] dfockler: wryfi: it's usually not a good idea for gems to require bundler
[21:36:10] ndrei: has joined #ruby
[21:36:13] linux_dr: Ox0dea: and that will work even if a isn???t an Array?
[21:36:32] opensource_ninja: has joined #ruby
[21:36:33] Kallis: has joined #ruby
[21:36:34] pipework: linux_dr: Try
[21:36:35] shmilan: has joined #ruby
[21:36:54] chipotle: has joined #ruby
[21:37:41] baweaver: has joined #ruby
[21:37:51] dfockler: pipework: That's dumb, not sure why I said that, maybe I was thinking of rubygems
[21:37:56] Zai00: has joined #ruby
[21:38:09] pipework: dfockler: You're such a tease. :p
[21:38:27] dfockler: Just teasing :P
[21:40:52] dopamean_: has joined #ruby
[21:43:14] sp4rrow: has joined #ruby
[21:43:37] tkuchiki: has joined #ruby
[21:44:33] ndrei: has joined #ruby
[21:45:10] freerobby: has joined #ruby
[21:47:22] s2013: has joined #ruby
[21:47:57] rbennacer: has joined #ruby
[21:48:07] solocshaw1: has joined #ruby
[21:49:05] eam: this is super weird:
[21:49:10] eam: >> x = *1; y = [*1]; x == y
[21:49:11] ruboto: eam # => true (https://eval.in/434631)
[21:50:23] davedev24: has joined #ruby
[21:50:48] Ox0dea: >> [*[*[*1]]]
[21:50:49] ruboto: Ox0dea # => [1] (https://eval.in/434632)
[21:51:03] Ox0dea: >> [*1, *nil, *[2, 3], 4=>5]
[21:51:04] ruboto: Ox0dea # => [1, 2, 3, {4=>5}] (https://eval.in/434633)
[21:51:39] pipework: Ox0dea is a deconstructionist
[21:52:01] dfockler: dat ruby array syntax
[21:52:22] eam: perl's list context is more clear :(
[21:52:29] dfockler: >> x = *"Hello there"
[21:52:30] ruboto: dfockler # => ["Hello there"] (https://eval.in/434634)
[21:52:40] northfurr: has joined #ruby
[21:53:01] eam: it's also weird that the rvalue is a syntax error if expressed as its own statement
[21:53:11] ruboto: eam # => /tmp/execpad-1fa7b97bdddd/source-1fa7b97bdddd:2: syntax error, unexpected '\n', expecting :: or '[' ...check link for more (https://eval.in/434635)
[21:53:27] eam: in what other languages is such a thing true?
[21:54:12] eam: I can't think of any C rvalue expressions which are errors when expressed alone
[21:55:04] dfockler: >> y = *(2..10) #nice for building an array
[21:55:05] ruboto: dfockler # => [2, 3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/434636)
[21:55:14] Ox0dea: >> [*1..10] # arguably nicer
[21:55:15] ruboto: Ox0dea # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/434637)
[21:55:24] dfockler: although you can just use the range like an enumerable
[21:55:37] pipework: >> (1..10).to_a
[21:55:38] ruboto: pipework # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/434638)
[21:56:06] pipework: Would be fun to see a silly benchmark of all those things.
[21:56:08] Ox0dea: >> [Enumerable.instance_methods.size, Array.instance_methods.size] # dfockler
[21:56:09] ruboto: Ox0dea # => [51, 172] (https://eval.in/434639)
[21:56:11] eam: what's the least ugly way to turn a Hash into a flat Array?
[21:56:22] pipework: eam: #to_a.flatten
[21:56:29] eam: that's super ugly though
[21:56:37] eam: (like, in terms of efficiency)
[21:56:38] pipework: I'm not sure what you're saying.
[21:56:45] Ox0dea: >> {1=>2, 3=>4}.flatten
[21:56:46] ruboto: Ox0dea # => [1, 2, 3, 4] (https://eval.in/434640)
[21:56:51] pipework: ah just flatten works
[21:56:58] eam: aha, Hash has one (I assume it doesn't suck?)
[21:57:01] Ox0dea: >> Hash < Enumerable
[21:57:02] ruboto: Ox0dea # => true (https://eval.in/434641)
[21:57:22] eam: I hope Hash implements that
[21:57:24] xfbs: has joined #ruby
[21:57:34] Ox0dea: >> {}.method(:flatten).owner
[21:57:35] ruboto: Ox0dea # => Hash (https://eval.in/434642)
[21:57:39] naftilos76: has joined #ruby
[21:57:45] eam: perfect
[21:58:30] cj: has left #ruby: ()
[21:58:51] Ox0dea: It's raining {fel,can}ids.
[21:59:13] dfockler: Is felids a word?
[21:59:49] Ox0dea: Latin never really died.
[22:00:30] dfockler: Ox0dea: thanks for leading me to discover the Method class :)
[22:00:41] minimalism: has joined #ruby
[22:01:17] jenrzzz_: has joined #ruby
[22:01:50] drewvanstone: has joined #ruby
[22:02:15] mary5030: has joined #ruby
[22:02:58] MasterPiece: has joined #ruby
[22:03:07] otisZart: has joined #ruby
[22:04:50] Beoran: has joined #ruby
[22:04:50] nkts: has joined #ruby
[22:05:38] Ox0dea: dfockler: Sure thing. :)
[22:05:49] Ox0dea: I trust you took note of that massive disparity in method counts back there?
[22:06:55] Ox0dea: Eh, you did say that you can use Ranges like Enumerables, not Arrays, so never mind.
[22:07:27] xfbs: has joined #ruby
[22:07:38] Ox0dea: That Range doesn't have #product bites me now and again.
[22:07:42] cschneid_: are there guides out there for writing & using the ruby internals for a gem? I'm looking at stackprof and would like to make it thread-aware. But that would mean understanding much more of the internals of the ruby vm
[22:07:56] Azure: has joined #ruby
[22:08:51] Ox0dea: cschneid_: Ruby Under a Microscope.
[22:09:18] cschneid_: Ox0dea: that'd help me understand the current vm? and hence understand how threading happens & how I can exploit it to get what I want? :)
[22:09:32] Ox0dea: cschneid_: It's a deep dive into many of MRI's internals, yes.
[22:10:09] dima_: has joined #ruby
[22:11:58] rickmasta: has joined #ruby
[22:16:30] chipotle: has joined #ruby
[22:18:04] ndrei: has joined #ruby
[22:18:05] s2013: has joined #ruby
[22:18:20] baweaver: has joined #ruby
[22:19:28] Hrorek: has joined #ruby
[22:19:34] drewvanstone: has joined #ruby
[22:20:11] beauby: has joined #ruby
[22:20:20] ndrei: has joined #ruby
[22:21:19] havenwood: has joined #ruby
[22:22:40] petricore: has joined #ruby
[22:22:51] Rurik: has joined #ruby
[22:24:49] gwendall: has joined #ruby
[22:25:35] ndrei: has joined #ruby
[22:29:01] s2013: has joined #ruby
[22:32:57] ndrei: has joined #ruby
[22:34:10] jenrzzz: has joined #ruby
[22:36:24] karapetyan: has joined #ruby
[22:37:37] drewvanstone: has joined #ruby
[22:37:39] northfurr: has joined #ruby
[22:42:30] chipotle: has joined #ruby
[22:44:15] jackjackdripper: I'm trying to maintain indentation by using string = q{} is there a way i can insert a variable inside {}?
[22:44:40] xaxisx: has joined #ruby
[22:44:47] PaulCapestany: has joined #ruby
[22:46:17] shevy: >> x = 'lala'; %w( abc def ghi #{x} )
[22:46:18] ruboto: shevy # => ["abc", "def", "ghi", "\#{x}"] (https://eval.in/434667)
[22:46:42] shevy: >> x = 'lala'; %W( abc def ghi #{x} )
[22:46:43] ruboto: shevy # => ["abc", "def", "ghi", "lala"] (https://eval.in/434668)
[22:46:51] shevy: jackjackdripper ^^^ perhaps it works for q and Q
[22:47:37] jackjackdripper: looks like it works with %Q
[22:48:07] theery: has joined #ruby
[22:48:25] momon: has joined #ruby
[22:48:26] Ox0dea: >> %'#{1 + 2}'
[22:48:27] ruboto: Ox0dea # => "3" (https://eval.in/434669)
[22:49:26] Ox0dea: >> %Q{} == %{} # jackjackdripper: For reference.
[22:49:27] ruboto: Ox0dea # => true (https://eval.in/434670)
[22:49:47] momon: has joined #ruby
[22:51:20] Ox0dea: You almost certainly don't even need any of them; plain-ol' double-quoted strings are allowed to span multiple lines.
[22:52:56] Ox0dea: % strings are for when you don't want to bother choosing which style of quotes to escape.
[22:54:29] duncannz: has joined #ruby
[22:54:52] phutchins: has joined #ruby
[22:54:55] jackjackdripper: that's exactly why i'm doing it :) a quick script to generate json file for multiple hostnames
[22:55:39] allcentury: has joined #ruby
[22:56:06] Ox0dea: jackjackdripper: https://eval.in/434671
[22:56:46] Lady_Aleena: has joined #ruby
[22:56:50] Lady_Aleena: has left #ruby: ("Leaving")
[22:56:57] shevy: a regex /foo/ has an encoding?
[22:57:14] rodfersou: has joined #ruby
[22:57:15] Ox0dea: shevy: Shouldn't it?
[22:57:17] blackjid: has joined #ruby
[22:57:40] Ox0dea: >> [/foo/, /foo/e].map(&:encoding)
[22:57:41] ruboto: Ox0dea # => [#<Encoding:US-ASCII>, #<Encoding:EUC-JP>] (https://eval.in/434673)
[22:58:08] shevy: I have set this: # Encoding: ISO-8859-1
[22:58:23] shevy: in the file, for test, I do this:
[22:58:24] shevy: puts REGEX
[22:58:35] shevy: and in the next line I create a string like this:
[22:58:41] shevy: puts 'hi there'.encoding.to_s
[22:58:48] shevy: and I get:
[22:58:48] shevy: ISO-8859-1
[22:58:52] shevy: so now I am confused
[22:59:22] shevy: does the encoding of a regex matter?
[22:59:30] Ox0dea: It certainly can.
[22:59:43] Ox0dea: Invalid byte sequences and the like.
[22:59:48] momon: Hi. Is there any gem that can do uploading video directly to youtube through web form?
[22:59:55] atomical: has joined #ruby
[23:00:08] shevy: Ox0dea from your example I assume, I could add an instructions to the // regex?
[23:00:17] juanpablo_: has joined #ruby
[23:00:19] Ox0dea: shevy: Hm?
[23:00:20] iateadonut: has joined #ruby
[23:00:23] Ox0dea: >> /foo/u.encoding
[23:00:24] ruboto: Ox0dea # => #<Encoding:UTF-8> (https://eval.in/434674)
[23:00:49] burgestrand: has joined #ruby
[23:00:57] chipotle: has joined #ruby
[23:01:41] blackjid: has joined #ruby
[23:02:15] shevy: >> /abc/m.encoding == /abc/i.encoding
[23:02:16] ruboto: shevy # => true (https://eval.in/434675)
[23:02:28] siaW: has joined #ruby
[23:02:59] Ox0dea: shevy: Those flags aren't related to encoding.
[23:03:04] Alayde: has joined #ruby
[23:03:10] Ox0dea: 'm' is multiline, 'i' is case-insensitive.
[23:03:46] dfockler: momon: https://github.com/kylejginavan/youtube_it Might look into this
[23:04:01] dfockler: it's kind of old though
[23:04:03] siaW: any help with this? google can???t help me on this one. very simple https://gist.github.com/siaw23/1b4ae905cd19293d1e56
[23:04:45] tockitj: has joined #ruby
[23:04:56] pragmatism: Why don't you just truncate the string instead?
[23:05:05] pragmatism: The modulo you're doing there is hella weird.
[23:05:06] ndrei: has joined #ruby
[23:05:16] eam: it's not modulo, it's printf interpolation
[23:05:20] eam: sprintf
[23:05:45] pragmatism: hha sorry, didn't quite read it.
[23:05:52] pragmatism: What do you want, "1.99"?
[23:05:53] ej89: has joined #ruby
[23:05:58] eam: % does everything, it's the amazing character
[23:06:01] x-light: has joined #ruby
[23:06:11] pragmatism: Just like === or <=>
[23:06:21] siaW: pragmatism: yes. i want $1.99
[23:06:22] tockitj: since ruby is dynamic language - does it make sense to check for parameter types in method body
[23:06:23] ej89: Hello! I have a question about redefining module methods.
[23:06:26] eam: siaw: that's waht you'll want to google, btw - printf formatting rules
[23:06:38] ej89: I'm trying to re-implement the Enumerable API for a class project.
[23:06:39] Ox0dea: pragmatism: Both of those operators serve exactly one purpose; what're you on about?
[23:06:49] shevy: tockitj if you have to handle user input sure
[23:06:53] tockitj: i know about duck principle.. but yet testing for number of methods could be more work than just testing for class
[23:06:56] ej89: However, for whatever reason, after the first re-defined method, all the others are being ignored.
[23:07:20] Ox0dea: ej89: Post code?
[23:07:20] dorei: shevy: type checking is really painful in ruby
[23:07:27] eam: siaw: I think rounding is built into printf - what you'll probably want to do is truncate your number before giving it to printf
[23:07:28] bentanweihao: has joined #ruby
[23:07:36] tockitj: shevy, user input? i am thinking about something like static-like typing for parameters
[23:07:37] ej89: That is, my test cases (which exercise all the Enumerable API methods) are always calling the library implementations...except for the first redefined method, which *does* call my method.
[23:07:39] Ox0dea: siaw: Even better, don't use floating point for money.
[23:07:46] ej89: 0x0dea: just a sec...
[23:07:48] Ox0dea: tockitj: Wrong language.
[23:07:59] siaW: Ox0dea: what should i use? BigDecimal?
[23:08:01] pragmatism: Ox0dea huh? === is defined on a per-class basis.
[23:08:12] Ox0dea: pragmatism: Yes, but it's only used for case equality.
[23:08:22] dorei: >> h = {a: 5, b: 6} ; h.instance_eval { undef :[] }; h[:a]
[23:08:23] ruboto: dorei # => undefined method `[]' for {:a=>5, :b=>6}:Hash (NoMethodError) ...check link for more (https://eval.in/434676)
[23:08:27] dfockler: If you want a statically typed language you shouldn't use ruby
[23:08:47] shevy: tockitj static typing for parameters? how would this work in ruby?
[23:08:52] tockitj: dfockler, who said I want statically typed language
[23:09:05] dfockler: "static-like typing for parameters"
[23:09:08] tockitj: shevy, i am wondering about that too
[23:09:16] metalic: has joined #ruby
[23:09:24] CloCkWeRX: has joined #ruby
[23:09:32] shevy: you can raise exceptions when input is not of an expected class
[23:09:32] CloCkWeRX: has left #ruby: ()
[23:09:34] ej89: @0x0dea: here's my code: http://pastebin.com/rcP0J4jr
[23:09:35] ruboto: ej89, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/7e9907ed99138b5ae550
[23:09:35] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:09:36] tockitj: dfockler, for method parameters.. anything could be passed to method
[23:09:38] eam: >> % %%%%%%% %%%% % %%%%% %%%% # pragmatism, this is for you
[23:09:39] ruboto: eam # => "%" (https://eval.in/434677)
[23:09:49] dorei: shevy: that's not enough though
[23:09:58] pragmatism: hahahaha eam thanks :P
[23:10:01] ej89: @0x0dea: here's my code: https://gist.github.com/7e9907ed99138b5ae550
[23:10:10] tockitj: dfockler, you want method to behave correctly even if it is handling bad input, right?
[23:10:35] ej89: @0x0dea: it includes two .rb files. The first is my implementation of Enumerable (right now it just contains two methods). The second contains unit tests for all the Enumerable methods.
[23:10:43] shevy: for a moment I confused dorei with dfockler :)
[23:10:51] tockitj: breaking arbitrarily just because passed object does not respond to given message is problem - you want to raise argument exception in that case, no?
[23:11:22] shevy: dunno, I rarely need to raise exceptions
[23:11:32] Ox0dea: tockitj: https://eval.in/434678
[23:11:48] Ox0dea: Look near the bottom for the demonstration of what's going on.
[23:11:53] tockitj: shevy, that is bad programming no?
[23:11:56] Ox0dea: We *can* overload methods in Ruby, but we really ought not to.
[23:12:28] ej89: The first redefined method (.all?) is working fine in the unit tests - I can confirm that my version of .all? is being called by the unit test. (The test fails when I switch the true to false.)
[23:12:42] p0wn3d_: has joined #ruby
[23:12:48] ej89: But the second one, .any?, isn't called - instead, the unit test is apparently calling the library version.
[23:12:49] dorei: ruby is so open to monkey patching that you can never make assumptions about how a class behaves
[23:12:51] tockitj: Ox0dea, i do not see point of that snippet
[23:13:11] ej89: I can't see what I did differently between the two...
[23:13:12] tockitj: dorei, that is plain silly
[23:13:12] EminenceHC: has joined #ruby
[23:13:23] bruno-: has joined #ruby
[23:13:26] tockitj: and please do not assume that i do not understand what monkey patching is
[23:13:31] dfockler: >> (1.9999 * 100).floor / 100.0 #this is gross
[23:13:31] ej89: I had some more substantial code in .any? earlier, but it wasn't working, so I changed to to simply "return true" to see if I could get it working at all.
[23:13:32] ruboto: dfockler # => 1.99 (https://eval.in/434679)
[23:13:40] dorei: >> h = {a: 5, b: 6} ; h.instance_eval { undef :[] }; h[:a]
[23:13:41] ruboto: dorei # => undefined method `[]' for {:a=>5, :b=>6}:Hash (NoMethodError) ...check link for more (https://eval.in/434680)
[23:13:56] shevy: tockitj I dunno, is it?
[23:13:59] dorei: tockitj: h is an instance of Hash but does it behave like a hash?
[23:14:08] tockitj: shevy, yep it is
[23:14:14] shevy: tockitj why?
[23:14:16] r_baron: has joined #ruby
[23:14:25] elfuego: has joined #ruby
[23:14:35] tockitj: i am not here to teach programming shevy
[23:14:45] shevy: you claimed it is bad programming
[23:14:56] shevy: you provided no reason
[23:15:26] tockitj: you see no problem with the fact that you are not raising any exceptions in pure oo language?
[23:15:38] Ox0dea: ej89: https://eval.in/434684
[23:15:43] Ox0dea: ej89: The problem must surely be in your test code.
[23:15:45] momon: dflocker: I thought support for client api v2 is already dropped by google
[23:15:45] shevy: what problem
[23:15:51] ej89: @0x0dea: thanks, looking at it now...
[23:16:14] pipework: No @ needed, this ain't twitter.
[23:16:18] dfockler: momon: That gem is hasn't been updated in a while, so it is probably behind google's api
[23:16:20] Ox0dea: ej89: Ah! I figured it out.
[23:16:35] ej89: pipework: thanks, I thought that would highlight the name for the recipient. Guess not. :-)
[23:16:42] ej89: 0x0dea: yeah?
[23:16:44] Ox0dea: >> [[].method(:any?).owner, [].method(:all?).owner] # ej89
[23:16:45] ruboto: Ox0dea # => [Array, Enumerable] (https://eval.in/434685)
[23:16:49] Ox0dea: Not sure why that is, though.
[23:17:05] Ox0dea: Array gets its #all? method from Enumerable, but #any? is optimized specifically for Arrays.
[23:17:24] pushpak: has joined #ruby
[23:17:47] ej89: Ah, I see. So I need to separately override #any?
[23:17:54] tockitj: dorei, i know ruby feels comfortable with any object that quacks like a duck - but are you just going to take a given object and assume that it full fills arbitrary non-specified conditions
[23:17:55] shevy: Ox0dea do you happen to know if a regex can have another encoding than US_ASCII?
[23:18:03] tockitj: that can be derived only from code itself
[23:18:05] Ox0dea: shevy: We've already established that?
[23:18:26] Ox0dea: >> [/foo/e.encoding, /foo/u.encoding] # shevy
[23:18:27] ruboto: Ox0dea # => [#<Encoding:EUC-JP>, #<Encoding:UTF-8>] (https://eval.in/434686)
[23:18:46] shevy: but we have more encodings than these
[23:18:52] Ox0dea: Many, many more.
[23:19:03] shevy: I could not find a switch for ISO-8859-1 :(
[23:19:04] dorei: Ox0dea: on ruby 2.1.1 it returns [Enumerable, Enumerable]
[23:19:07] ej89: 0x0dea: Is there an easy way to undefine every method in Enumerable (even those that are overridden) so that my implementation will be called?
[23:19:19] Ox0dea: ej89: How come you don't just name yours differently?
[23:19:29] shevy: guess I'll file a feature request at the bugtracker
[23:19:32] ej89: 0x0dea: That's the next thing I was going to try. :-)
[23:19:33] drbrain: ej89: Module#prepend?
[23:19:39] ej89: I just wanted to see if there was an easier way first.
[23:19:51] ej89: drbrain: looking up Module#prepend now!
[23:20:01] Ox0dea: ej89: What could be easier than just not naming yours Enumerable? :/
[23:20:36] Ox0dea: >> s = 'foo'; [s.encoding, Regexp.new(s).encoding] # shevy
[23:20:37] ruboto: Ox0dea # => [#<Encoding:UTF-8>, #<Encoding:US-ASCII>] (https://eval.in/434691)
[23:20:46] Ox0dea: Not sure if that's a "bug", per se.
[23:20:51] ej89: 0x0dea: Well, the unit tests were originally written to use Enumerable (to test the tests)...the idea is to use my Enumerable implementations as a drop-in replacement. If that's possible, that is.
[23:21:18] tockitj: ej89, why are you replacing Enumerable?
[23:21:38] ej89: tockitj: It's for a class assignment. I'm supposed to re-implement most of Enumerable's public API functions.
[23:21:54] shevy: Ox0dea hmm oh... you mean it is possible via Regexp.new(), rather than the // regex literal?
[23:22:01] tockitj: ook? simply implement them in your own mixin
[23:22:12] Ox0dea: shevy: Right.
[23:22:33] chino_: has joined #ruby
[23:22:46] tockitj: ej89, assignment is certainly not to *replace* Enumerable - I can assure you that
[23:23:25] tockitj: though it is not hard to do either.. you can just go through ObjectSpace find objects that inherit Enumerable and include your own mixin on top of them
[23:23:26] shevy: people have strange ideas when it comes to unicode: https://bugs.ruby-lang.org/issues/11530
[23:23:43] ej89: tockitj: Right...my thinking there was that it would make it easier to test, by avoiding having to manually change all the method calls in my unit tests from ".some_method" to ".my_some_method".
[23:23:46] chino_: is there any debugging tools that can hook into an *existing* ruby process to perhaps analyze the heap or inject some code so you can debug it?
[23:23:55] Ox0dea: >> s = 'foo'.encode('ISO-8859-1'); [Regexp.new(s).encoding, Regexp.new(s, 16).encoding] # shevy
[23:23:56] ruboto: Ox0dea # => [#<Encoding:US-ASCII>, #<Encoding:ISO-8859-1>] (https://eval.in/434693)
[23:24:05] tockitj: ej89, why are you changing method names? just change mixin name
[23:24:10] davedev24: has joined #ruby
[23:24:16] ej89: tockitj: Oh, how do you do that?
[23:24:22] shevy: Ox0dea now I am confused
[23:24:23] tockitj: how long have you been working with ruby ej89 ?
[23:24:38] ej89: tockitj: About a week. This class is my first exposure to Ruby. :-)
[23:24:41] shevy: so regexes by default attempt to prefer US-ASCII?
[23:24:42] baroquebobcat: has joined #ruby
[23:24:52] ej89: tockitj: :-)
[23:25:00] tockitj: i am not best person to talk to in that case
[23:25:02] Ox0dea: shevy: Seems so. It's not the worst choice?
[23:25:08] petricore: has joined #ruby
[23:25:34] Ox0dea: chino_: Sounds pretty masochistic.
[23:25:36] ej89: tockitj: No problem. Appreciate the help nonetheless!
[23:25:41] shevy: no idea, I didn't know that there could be differences in encoding, I thought that the # Encoding line would help there but it seems as if they only are valid for string objects in that file
[23:25:50] tockitj: good luck! be persistent! :)
[23:26:19] chipotle: has joined #ruby
[23:26:27] Ox0dea: >> Regexp.new('', 16).encoding # shevy: Last one. :P
[23:26:28] ruboto: Ox0dea # => #<Encoding:UTF-8> (https://eval.in/434694)
[23:26:37] ej89: tockitj: Thanks! So far I'm enjoying the language a lot...though it definitely takes some getting used to coming from a mostly C++ world! :-)
[23:26:47] shevy: nope, I am confused
[23:26:56] tockitj: ruby is a great language
[23:27:05] shevy: suddenly we are at UTF-8
[23:27:42] Pupeno: has joined #ruby
[23:27:42] Pupeno: has joined #ruby
[23:28:40] Ox0dea: You can tell Regexp.new to use the encoding of the constructing String.
[23:28:42] drewvanstone: has joined #ruby
[23:29:00] snockerton: has joined #ruby
[23:29:21] tejasmanohar: has joined #ruby
[23:29:23] Ox0dea: Which, ceteris paribus, would be the encoding you specified in the magic comment.
[23:30:01] snockerton: this is odd - how come when i start pry in certain directories, it can't load any gems?
[23:30:26] drbrain: shevy: this seems to be the list of regexp encodings: https://gist.github.com/drbrain/e96992ba4a6de7905879
[23:31:15] shevy: emacs_mule.c:OnigEncodingDefine(emacs_mule, Emacs_Mule)
[23:31:43] Ox0dea: drbrain: Any insight as to why there isn't just an 'f' flag for doing what Regexp::FIXEDENCODING does?
[23:32:40] BraddPitt: an initialization vector can safely be posted to the public, right?
[23:32:44] drbrain: Ox0dea: I haven't poked that much at Regexp
[23:32:56] BraddPitt: someome knowing your encryption IV won't gain any advantage into cracking your crypto?
[23:33:32] Ox0dea: BraddPitt: Just make sure it's duper-random.
[23:33:47] BraddPitt: I'm just using OpenSSL stdlib random generator
[23:33:52] BraddPitt: which (it claims) is random enough
[23:33:56] baweaver: has joined #ruby
[23:34:52] s00pcan: has joined #ruby
[23:36:05] tockitj: Ox0dea, Ova is nice hack - I have not read it carefully first time
[23:36:29] Ox0dea: tockitj: It's brittle as hell by dint of relying on RubyVM::InstructionSequence, but it was fun nonetheless.
[23:37:12] BraddPitt: Ox0dea this means that the user needs to remember both the password and the IV they used if they wish to decrypt, right?
[23:37:27] ixti: has joined #ruby
[23:37:40] baweaver: has joined #ruby
[23:37:41] Ox0dea: BraddPitt: Are your users laymen?
[23:37:46] Ox0dea: *laypeople
[23:37:48] tockitj: i like the way ruby can surprise
[23:38:36] BraddPitt: in what sense, Ox0dea
[23:38:37] baweaver: ACTION gives thumbs up to Ox0dea
[23:38:38] BraddPitt: they are developers
[23:39:50] Ox0dea: BraddPitt: Well, it depends on what exactly you're doing, but no, remembering the IV isn't strictly necessary.
[23:40:01] Ox0dea: Especially given that it can be derived, should the need arise.
[23:40:18] Ox0dea: baweaver: I should've caught myself.
[23:40:38] Yzguy: has joined #ruby
[23:40:42] ej89: has left #ruby: ()
[23:40:59] cajone: has joined #ruby
[23:41:00] Ox0dea: tockitj: Are you familiar with FizzBuzz? ;)
[23:41:14] Ox0dea: (I'm not gonna do it.)
[23:41:28] Ox0dea: > i like the way ruby can surprise
[23:41:31] Ox0dea: Tempted as hell, though.
[23:41:52] EminenceHC: has joined #ruby
[23:42:05] BraddPitt: Ox0dea I'm reading the ruby OpenSSL docs and it says >A new, random IV should be created for every encryption of data
[23:42:46] Igorshp: has joined #ruby
[23:43:13] [ace]: BraddPitt: IV is fine to be stored with the ciphertext, commonly as the first block
[23:43:33] baroquebobcat: has joined #ruby
[23:43:37] WillAmes: has joined #ruby
[23:43:39] tockitj: Ox0dea, haha
[23:43:44] [ace]: and yes, every time you encrypt you should use a different IV or you lose the benefit of having an IV
[23:44:50] BraddPitt: I guess my problem is that now the user needs to remember both password and the IV used to encrypt their data (unless I use a stream cipher)
[23:45:07] BraddPitt: I may have a way around this
[23:45:29] [ace]: BraddPitt: put it with the ciphertext
[23:45:35] [ace]: then you don't have that problem
[23:45:46] Ox0dea: Or salt the seed.
[23:46:34] BraddPitt: append it to the resulting ciphertext you mean [ace] ?
[23:46:41] BraddPitt: or prepend, whatever
[23:47:53] [ace]: https://encrypted.google.com/search?num=100&q=prepend%20iv%20to%20ciphertext
[23:48:10] baroquebobcat: has joined #ruby
[23:48:41] aa10ll: has joined #ruby
[23:49:21] BraddPitt: ah, thanks for answering what was to be my follow up question
[23:49:25] BraddPitt: thank you both [ace] and Ox0dea
[23:49:44] luckyme: has joined #ruby
[23:51:06] zenspider: shevy: you get things squared away?
[23:52:47] but3k4: has joined #ruby
[23:55:05] SCHAAP137: has joined #ruby
[23:55:59] malconis: has joined #ruby
[23:56:02] baweaver: has joined #ruby
[23:57:15] sp4rrow: has joined #ruby
[23:59:10] tcopeland: has joined #ruby
[23:59:30] howdoico1: has joined #ruby