« Back to channel list

#ruby - 30 October 2017

« Back 1 day Forward 1 day »
[00:08:08] guardianx: has joined #ruby
[00:11:06] edwardly: has joined #ruby
[00:11:07] edwardly: has joined #ruby
[00:15:25] enterprisey: has joined #ruby
[00:26:40] alfiemax: has joined #ruby
[00:30:12] guardianx: has left #ruby: ()
[00:31:01] Jameser: has joined #ruby
[00:37:16] workmad3: has joined #ruby
[00:41:45] jrafanie: has joined #ruby
[00:41:46] hahuang65: has joined #ruby
[00:41:50] ahrs: has joined #ruby
[00:47:23] triston: has joined #ruby
[00:49:23] cschneid_: has joined #ruby
[00:49:43] cschneid_: has joined #ruby
[00:49:56] jxv: has joined #ruby
[00:51:55] ogres: has joined #ruby
[00:52:31] cschneid_: has joined #ruby
[00:52:31] PaulCapestany: has joined #ruby
[00:53:46] CrazyEddy: has joined #ruby
[00:58:10] moei: has joined #ruby
[01:01:14] orbyt_: has joined #ruby
[01:02:08] cdg: has joined #ruby
[01:09:02] sepp2k1: has joined #ruby
[01:13:07] cschneid_: has joined #ruby
[01:13:41] oetjenj: has joined #ruby
[01:30:26] kapil___: has joined #ruby
[01:35:36] bmurt: has joined #ruby
[01:40:07] Azure: has joined #ruby
[01:40:16] oetjenj: has joined #ruby
[01:44:54] QualityAddict: has joined #ruby
[01:47:01] hahuang65: has joined #ruby
[01:47:32] uneeb: has joined #ruby
[01:54:23] enterprisey: has joined #ruby
[02:03:55] gizmore: has joined #ruby
[02:05:02] astrobunny: has joined #ruby
[02:08:24] guardianx: has joined #ruby
[02:11:13] DTZUZO: has joined #ruby
[02:11:37] csk157: has joined #ruby
[02:12:27] houhoulis: has joined #ruby
[02:13:00] d^sh: has joined #ruby
[02:19:49] enterprisey: has joined #ruby
[02:28:24] jxv: has joined #ruby
[02:29:04] tastytf: has joined #ruby
[02:32:13] cdg: has joined #ruby
[02:36:19] cschneid_: has joined #ruby
[02:38:00] workmad3: has joined #ruby
[02:44:00] alfiemax: has joined #ruby
[02:49:26] cdg: has joined #ruby
[02:50:14] benjen: has joined #ruby
[02:57:10] _whitelogger: has joined #ruby
[03:00:08] cadillac_: has joined #ruby
[03:01:09] Immune: has joined #ruby
[03:01:15] alfiemax: has joined #ruby
[03:03:53] alfiemax_: has joined #ruby
[03:09:58] jottr: has joined #ruby
[03:10:08] cschneid_: has joined #ruby
[03:17:44] DebianUser_: has joined #ruby
[03:20:17] guacamole: has joined #ruby
[03:24:31] Cyrus: has joined #ruby
[03:24:59] alex``: has joined #ruby
[03:28:28] ap4y: has joined #ruby
[03:30:02] apeiros: has joined #ruby
[03:32:42] jxv: has joined #ruby
[03:34:18] uZiel_: has joined #ruby
[03:34:35] Sightes: has joined #ruby
[03:36:05] apeiros: has joined #ruby
[03:51:23] apeiros: has joined #ruby
[03:53:05] uZiel: has joined #ruby
[03:53:37] uZiel: has joined #ruby
[03:59:45] Technodrome: has joined #ruby
[04:07:01] skinkitten_: has joined #ruby
[04:07:26] CrazyEddy: has joined #ruby
[04:10:18] apeiros: has joined #ruby
[04:13:01] csk157: has joined #ruby
[04:21:36] apeiros: has joined #ruby
[04:38:38] workmad3: has joined #ruby
[04:41:30] ShekharReddy: has joined #ruby
[04:59:45] duderonomy: has joined #ruby
[05:02:06] knight33: has joined #ruby
[05:02:09] Technodrome: has joined #ruby
[05:11:52] jottr: has joined #ruby
[05:13:26] csk157: has joined #ruby
[05:16:09] cdg: has joined #ruby
[05:16:13] tastytf: has joined #ruby
[05:21:00] patrick_f: has joined #ruby
[05:23:33] patrick_f: has left #ruby: ()
[05:23:34] apeiros: has joined #ruby
[05:24:57] Technodrome: has joined #ruby
[05:26:13] s2013: has joined #ruby
[05:30:02] faces: has joined #ruby
[05:30:54] dinfuehr: has joined #ruby
[05:39:23] nicesignal: has joined #ruby
[05:40:25] k3rn31: has joined #ruby
[05:40:44] enterprisey: has joined #ruby
[05:41:34] anisha: has joined #ruby
[05:43:48] cschneid_: has joined #ruby
[05:44:36] aupadhye: has joined #ruby
[05:48:59] apeiros: has joined #ruby
[05:51:19] rabajaj: has joined #ruby
[05:53:37] ta: has joined #ruby
[05:54:09] aldodelgado: has joined #ruby
[05:57:37] govg: has joined #ruby
[05:57:52] apeiros: has joined #ruby
[05:58:05] mkroman: has joined #ruby
[06:04:22] dionysus69: has joined #ruby
[06:06:12] apeiros: has joined #ruby
[06:11:26] alfiemax: has joined #ruby
[06:11:45] Heph_: has joined #ruby
[06:14:29] alfiemax: has joined #ruby
[06:15:57] alex``: has joined #ruby
[06:19:06] banisterfiend: has joined #ruby
[06:24:40] Heph_: has joined #ruby
[06:29:12] quobo: has joined #ruby
[06:32:26] mjolnird: has joined #ruby
[06:33:16] zautomata: has joined #ruby
[06:34:49] banisterfiend: has joined #ruby
[06:42:08] biberu: has joined #ruby
[06:45:19] apeiros: has joined #ruby
[06:46:18] Defenestrate: has joined #ruby
[06:46:19] Defenestrate: has joined #ruby
[06:47:10] EXCHGR: has joined #ruby
[06:48:21] Technodrome: has joined #ruby
[07:00:38] michael1: has joined #ruby
[07:02:09] apeiros: has joined #ruby
[07:04:03] djbkd: has joined #ruby
[07:04:44] alfiemax_: has joined #ruby
[07:08:06] djbkd_: has joined #ruby
[07:08:21] csk157: has joined #ruby
[07:10:53] robnester: has joined #ruby
[07:12:26] reber: has joined #ruby
[07:12:43] jottr: has joined #ruby
[07:14:33] [[thufir]]: has joined #ruby
[07:15:39] astrobunny: has joined #ruby
[07:16:30] mikecmpbll: has joined #ruby
[07:16:59] snickers: has joined #ruby
[07:21:56] sneep: has joined #ruby
[07:22:13] milardovich: has joined #ruby
[07:23:04] sneep: Anyone going to Ruby World Conference in Matsue?
[07:23:26] alfiemax: has joined #ruby
[07:28:55] sneep: I'll be there. Mostly because I live in Matsue though
[07:31:02] apeiros: has joined #ruby
[07:32:41] djbkd: has joined #ruby
[07:35:22] aufi: has joined #ruby
[07:35:39] conta: has joined #ruby
[07:39:57] volix: has joined #ruby
[07:42:47] ur5us: has joined #ruby
[07:43:37] ur5us: has joined #ruby
[07:45:13] Technodrome: has joined #ruby
[07:45:15] astrobunny: has joined #ruby
[07:45:58] EXCHGR: has joined #ruby
[07:48:13] mark_66: has joined #ruby
[07:55:50] uZiel: has joined #ruby
[07:56:52] apeiros: has joined #ruby
[07:59:47] milardovich: has joined #ruby
[08:01:28] Technodrome: has joined #ruby
[08:08:05] doublemalt_: has joined #ruby
[08:09:40] csk157: has joined #ruby
[08:11:15] apeiros: has joined #ruby
[08:11:30] sysvalve: has joined #ruby
[08:14:31] ta: has joined #ruby
[08:16:25] cdg: has joined #ruby
[08:16:57] Sembei: has joined #ruby
[08:28:19] cschneid_: has joined #ruby
[08:29:33] jenrzzz: has joined #ruby
[08:29:34] jenrzzz: has joined #ruby
[08:29:47] dionysus69: what's are ways I can deduce what exceptions might happen on an operation?
[08:30:12] dionysus69: say I have json parse Net get, if net gets nil it will be an error I know, but which one specifically is there a smart/short way to know?
[08:32:49] matthewd: dionysus69: Not really
[08:32:53] burgestrand: has joined #ruby
[08:33:59] dionysus69: JSON(Net::HTTP.get(URI.parse("uri"))["key"] rescue nil
[08:34:52] oetjenj: has joined #ruby
[08:35:59] vondruch: has joined #ruby
[08:36:04] dionysus69: rubocop tells me not to use inline rescue nil
[08:36:16] dionysus69: just curious why, I am avoiding just one potential failure here
[08:37:41] vondruch: has joined #ruby
[08:38:05] jottr: has joined #ruby
[08:40:06] workmad3: has joined #ruby
[08:42:23] CrazyEddy: has joined #ruby
[08:49:05] atmosx: has joined #ruby
[08:49:56] matthewd: dionysus69: There are a lot of things that could go wrong in that expression, and you're rescuing all of them
[08:50:51] marr: has joined #ruby
[08:51:10] dionysus69: ok I got it thanks :)
[08:51:11] matthewd: dionysus69: That's not necessarily a bad thing to do -- but I think rubocop's opinion is that if you're going to do that, it's worth a begin/rescue/end block, and not just an afterthought on the end of the line
[08:52:14] postmodern: has joined #ruby
[08:54:27] tomphp: has joined #ruby
[08:55:10] dminuoso: Also keep in mind, that by using `rescue nil` you are effectively forced to check whether what you have gotten is nil anyway.
[08:55:24] dminuoso: And suddenly error handling has turned into nil handling, hiding whats going on.
[08:55:45] dminuoso: I'd rather have `begin; rescue; end` than a sudden myriad of &.
[08:56:18] waveprop: i wrote a method called .str_or_regexp? which returs true if called on a string and false if called on a regexp. if self is niether string or regexp, i want to raise an error. Would it be better to just test twice, with .is_a? string and .is_a? regexp ?
[08:57:46] dminuoso: waveprop: https://gist.github.com/dminuoso/86c6175030d480c29a4d5da0e33911e0
[08:58:02] matthewd: waveprop: You said method and 'called on', but if that were true, the default behaviour would give you an error
[08:58:11] dminuoso: waveprop: Though it smells a bit. How do you intend to use this?
[08:59:13] shinnya: has joined #ruby
[09:03:47] MyMind: has joined #ruby
[09:08:19] mikecmpbll: has joined #ruby
[09:08:43] tomphp_: has joined #ruby
[09:10:37] csk157: has joined #ruby
[09:11:37] guille-moe: has joined #ruby
[09:13:56] claudiuinberlin: has joined #ruby
[09:24:07] guardianx: has joined #ruby
[09:29:50] Stan: has joined #ruby
[09:30:42] vondruch: has joined #ruby
[09:32:02] apeiros: has joined #ruby
[09:32:10] dhollinger: has joined #ruby
[09:32:54] cabotto: has joined #ruby
[09:38:15] waveprop: im implementing input validation
[09:41:14] Stan: has joined #ruby
[09:46:23] waveprop: matthewd: that's what i was trying to determine, thx
[09:47:47] matthewd: waveprop: That sounds like a pretty bad/surprising method name for the behaviour you described, fwiw
[09:48:19] milardovich: has joined #ruby
[09:48:37] apeiros: has joined #ruby
[09:51:40] guardianx: has joined #ruby
[09:52:23] jaruga: has joined #ruby
[09:52:44] Beams: has joined #ruby
[10:03:05] jottr: has joined #ruby
[10:04:55] Serpent7776: has joined #ruby
[10:05:13] _cabotto: has joined #ruby
[10:06:23] apeiros: has joined #ruby
[10:08:38] FahmeF: has joined #ruby
[10:12:51] CrazyEddy: has joined #ruby
[10:13:07] FahmeF_: has joined #ruby
[10:15:03] banisterfiend: has joined #ruby
[10:21:54] jottr: has joined #ruby
[10:22:35] cadillac_: has joined #ruby
[10:23:18] apeiros: has joined #ruby
[10:26:13] FahmeF: has joined #ruby
[10:26:37] zanoni: has joined #ruby
[10:28:01] FahmeF_: has joined #ruby
[10:30:48] apeiros: has joined #ruby
[10:37:58] kristofferR: has joined #ruby
[10:39:16] lxsameer: has joined #ruby
[10:40:49] workmad3: has joined #ruby
[10:44:14] milardovich: has joined #ruby
[10:45:09] oetjenj: has joined #ruby
[10:45:33] cabotto: has joined #ruby
[10:48:09] milardovich: has joined #ruby
[10:49:29] TomyWork: has joined #ruby
[10:51:55] apeiros: has joined #ruby
[10:52:00] banisterfiend: has joined #ruby
[10:52:36] vondruch: has joined #ruby
[10:53:45] workmad3: has joined #ruby
[10:54:28] rahul_bajaj: has joined #ruby
[10:55:09] nowhere_man: has joined #ruby
[10:55:34] Nahra: has joined #ruby
[10:57:10] mn3m: has joined #ruby
[10:57:12] Technodrome: has joined #ruby
[10:57:32] ldnunes: has joined #ruby
[10:58:45] apeiros: has joined #ruby
[11:02:42] cdg: has joined #ruby
[11:06:45] blackmesa: has joined #ruby
[11:10:50] Mia: has joined #ruby
[11:11:30] csk157: has joined #ruby
[11:12:27] blackmesa: has joined #ruby
[11:12:49] jottr: has joined #ruby
[11:18:06] tvw: has joined #ruby
[11:20:38] banisterfiend: has joined #ruby
[11:22:37] apeiros: has joined #ruby
[11:31:44] coderphive: has joined #ruby
[11:39:09] catphish: has joined #ruby
[11:39:33] catphish: is there a use case for rescue/else? i just found it and it seems absurd
[11:42:31] halt: has joined #ruby
[11:43:15] apeiros: has joined #ruby
[11:43:20] canton7: catphish, sure. When you want to do "try operation A. If it succeeds, do operation B. If it fails, do this recovery. If operation B fails, don't try and recover"
[11:44:09] canton7: you could just put operations A and B in the same block with the same 'rescue' statements, but then A's error handling also applies to B
[11:44:21] catphish: ah i see, makes sense if you're rescuing everything and don't want another wrapper
[11:44:52] moei: has joined #ruby
[11:47:29] tcopeland: has joined #ruby
[11:48:01] cgfbee: has joined #ruby
[11:48:03] sionronin: has joined #ruby
[11:56:11] jphase: has joined #ruby
[11:59:27] jphase_: has joined #ruby
[12:00:58] synthroid: has joined #ruby
[12:04:16] apeiros: has joined #ruby
[12:05:04] apparition: has joined #ruby
[12:05:57] skawa: has joined #ruby
[12:07:52] skawa: i want to install ruby 2.2.6, but rbenv doesn't show that it can install that version. it shows that i can install 2.2.2 and 2.3.0-dev
[12:08:09] skawa: it actually shows 2.3.0-dev as being the latest. it should be showing at least 2.4.0, yea ?
[12:08:31] skawa: brew upgrade ruby-build doesn't change the list of available versions at all
[12:08:32] jphase: has joined #ruby
[12:09:22] matthewd: skawa: My guess would be you have ruby-build installed locally in ~/.rbenv, and that's being used in preference to the brew installed version
[12:09:35] jphase_: has joined #ruby
[12:10:10] huyderman: has joined #ruby
[12:10:28] bmurt: has joined #ruby
[12:11:51] skawa: matthewd: its possible. i have no idea how to delete the non-brew copy, if that is the case. https://gist.github.com/anonymous/e027b66c15f2054a4512a092350c9c21
[12:12:32] matthewd: Oh, you have ruby-build HEAD installed, not a released version
[12:12:34] csk157: has joined #ruby
[12:13:17] matthewd: brew upgrade won't automatically get a newer revision of HEAD, IIRC.. you have to force it
[12:13:29] brendan-: has joined #ruby
[12:14:00] apeiros: has joined #ruby
[12:14:02] coderphive: has joined #ruby
[12:14:33] matthewd: (or just uninstall it and go back to numbered releases, assuming whatever you went to head for is now published)
[12:15:20] alnewkirk: has joined #ruby
[12:16:07] charliesome: has joined #ruby
[12:16:15] jphase: has joined #ruby
[12:17:19] jenrzzz: has joined #ruby
[12:17:20] jenrzzz: has joined #ruby
[12:17:59] skawa: matthewd: that's better. thanks
[12:18:50] rabajaj: has joined #ruby
[12:27:43] conta: has joined #ruby
[12:28:04] gnufied: has joined #ruby
[12:28:30] apeiros: has joined #ruby
[12:28:45] cschneid_: has joined #ruby
[12:32:35] mson: has joined #ruby
[12:33:08] banisterfiend: has joined #ruby
[12:35:37] nertzy2: has joined #ruby
[12:37:25] cadillac_: has joined #ruby
[12:37:54] tlaxkit: has joined #ruby
[12:38:12] apeiros: has joined #ruby
[12:48:20] shinnya: has joined #ruby
[12:48:58] milardovich: has joined #ruby
[12:52:59] jottr: has joined #ruby
[12:54:17] Psybur: has joined #ruby
[12:56:43] jphase: has joined #ruby
[12:57:01] TvL2386_: has joined #ruby
[12:58:13] jphase: has joined #ruby
[12:59:09] cdg: has joined #ruby
[12:59:14] apeiros: has joined #ruby
[13:02:47] s2013: has joined #ruby
[13:04:02] s2013: has joined #ruby
[13:07:23] Hexafox[I]: has joined #ruby
[13:07:39] nertzy3: has joined #ruby
[13:08:21] Hexafox[I]: Ruby has basic multithreading support right? I was just wondering if it would be possible to create a new thread, put it in an infinite loop and have it sleep for a few minutes after each loop run.
[13:09:15] dminuoso: Hexafox[I]: Ruby has not just basic multithreading support, it has full native threads.
[13:09:16] Jameser: has joined #ruby
[13:09:21] dminuoso: With just a little twist called the GVL.
[13:09:36] dminuoso: Which essentially gives you concurrency, but not necessarily parallelism.
[13:09:38] matthewd: Hexafox[I]: Yes, you can do that.
[13:10:15] Hexafox[I]: dminuoso, What does that mean?
[13:10:56] ledestin: has joined #ruby
[13:11:25] dminuoso: Hexafox[I]: It's generally not possible for two threads to be executing ruby code at the same time. If you just need the behavior of two threads overlapping, you're good. If you mean to process data in parallel, you have to either use processes or JRuby.
[13:12:14] cdg: has joined #ruby
[13:14:02] jordanm: has joined #ruby
[13:15:37] rabajaj: has joined #ruby
[13:17:17] knightblader: has joined #ruby
[13:17:34] Hexafox[I]: The threads will hardly be doing anything, I just want one watching a chat room for messages and anther one grabbing a RSS feed every few minutes.
[13:18:15] Hexafox[I]: So if I sleep one the other one can continue uninterrupted?
[13:18:48] dminuoso: Absolutely yes.
[13:23:10] alfiemax: has joined #ruby
[13:23:15] knight33: has joined #ruby
[13:23:45] burgestrand: has joined #ruby
[13:24:11] alfiemax_: has joined #ruby
[13:25:13] matthewd: They'll run concurrently even without any explicit sleeping
[13:28:59] hexchat_: has joined #ruby
[13:29:36] Sightes: has joined #ruby
[13:30:28] impermanence13: has joined #ruby
[13:31:41] impermanence13: What is the ruby way to iterate over a string char-by-char and mutate specific chars on match? Are there particular String functions I should use?
[13:32:44] havenwood: impermanence13: It depends on what you're doing. What's the mutation? Look at #gsub, #tr and #each_char/#map/#join.
[13:32:45] matthewd: impermanence13: What do you want to do?
[13:32:56] thomasv314: has joined #ruby
[13:33:11] mtkd: .map { |x| new_char if x == match_char }
[13:33:15] mtkd: something like that?
[13:33:31] sepp2k: has joined #ruby
[13:33:32] impermanence13: yes. multiple different chars.
[13:34:08] mtkd: maybe map with a case else?
[13:34:10] impermanence13: I am asking because I guess I would just iterate over the string against a case statement. But then I wondered if there were some nice wrapper methods Ruby offered to do so.
[13:34:40] matthewd: As havenwood said, there are a lot of related-but-distinct options. You'll need to be more specific about what your string / replacements look like for more idiomatic advice.
[13:35:21] mtkd: looks like .gsub takes multiple
[13:35:42] impermanence13: matthewd: one sec.
[13:37:32] impermanence13: "GGCTTAA" => "CCGAAU" so G => C, C => G, T => A, A => U. That's it. I know how I would do it, but was just curious if there was a sexy Ruby way, honestly. Maybe gsub...
[13:38:24] impermanence13: But see, that's why I want to ask...because in this case...it's almost like just using plain iteration and a case is all that would happening under the hood anyway
[13:38:28] DLSteve: has joined #ruby
[13:38:42] duckpuppy: has joined #ruby
[13:38:59] havenwood: >> 'GATTACO'.tr 'GCTA', 'CGAU'
[13:39:00] ruby[bot]: havenwood: # => "CUAAUGO" (https://eval.in/889474)
[13:39:37] havenwood: impermanence13: Use #tr.
[13:40:21] impermanence13: havenwood: it has to be char-by-char though, because it has to apply to any possible sequence of As, Ts, Gs and Cs.
[13:40:32] havenwood: Hexafox[I]: Or if you want to manually transfer back and forth, you could also use Fibers.
[13:41:03] havenwood: impermanence13: How is #tr not char by char? Show an example of its shortcoming?
[13:41:54] impermanence13: Hexafox[I]: I guess it is. I'll try that and gsub.
[13:41:54] elomatreb: tr is a bit unintuitive, it replaces the character from the first list with the character at that index in the second list
[13:42:18] impermanence13: elomatreb: yeah...I though it was looking for a substring.
[13:42:58] impermanence13: as usual havenwood is exactly right, sorry.
[13:42:58] GodFather: has joined #ruby
[13:43:12] chouhoulis: has joined #ruby
[13:43:25] impermanence13: tr is *exactly* the type of method that prompted me to ask my question in the first place.
[13:43:43] havenwood: Hexafox[I]: e.g.: chat_room = Fiber.new { loop { sleep 1; puts 'chatting'; Fiber.yield } }; rss_feed = Fiber.new { loop { sleep 1; puts 'rss fed'; chat_room.resume } }; rss_feed.resume
[13:44:06] matthewd: impermanence13: Right -- and thus the need for a specific question: it's a perfect method.. for a fairly narrow use case
[13:45:52] elomatreb: The main benefit of the built-in methods like #tr over manual iteration is that the former are implemented in native C, and thus usually much faster than the manual iterator code would be, even if it does the same in concept
[13:47:16] jrafanie: has joined #ruby
[13:47:45] Rapture: has joined #ruby
[13:47:49] impermanence13: elomatreb: ha, see that's why I thought to come here and ask. bc that was mainly what was on my mind.
[13:48:17] impermanence13: tr is literally exactly what I was looking for, dang.
[13:50:47] impermanence13: small tangent: is there a way to require two classes from one module in one "require" line?
[13:52:00] elomatreb: If you really want you can do something like `%w[module/class1 module/class2].each {|c| require c }`
[13:52:09] danielglh: has joined #ruby
[13:52:22] elomatreb: But usually people just have the two lines, or require the entire module
[13:53:22] Hexafox[I]: what does it mean when a class has both the methods `run()` and `self.run()`? Which one gets used?
[13:54:12] elomatreb: The first one is an instance method, the latter a class/module method
[13:54:42] elomatreb: I.e. `Class.new.run` is the first, `Class.run` is the second
[13:55:36] Hexafox[I]: Never heard of an instance method before. Will have to look that up. But yeah that matches exactly how it's used in this code.
[13:58:33] milardovich: has joined #ruby
[13:59:40] alfiemax: has joined #ruby
[14:00:55] johno84: has joined #ruby
[14:01:59] impermanence13: What is the best way to check if a string is made up of only a specific set of characters? in other words, I need to check if a string only contains As, Ts, Cs and Gs. If not then "false
[14:02:21] eb0t: has joined #ruby
[14:02:22] impermanence13: I think maybe there is a slick way I can use tr?
[14:03:05] ccooke: You're probably best off using a regex
[14:03:24] havenwood: impermanence13: What version of Ruby?
[14:04:47] ccooke: impermanence13: when you say "best way", what are you trying to optimise for? Speed? Readability? Maintainability?
[14:05:24] havenwood: impermanence13: 'bacon'.match? Regexp.union 'a', 'b', 'c'
[14:05:57] matthewd: havenwood: "only"
[14:06:17] havenwood: >> %w[a b c].any? { |char| 'bacon'.include? char }
[14:06:18] ruby[bot]: havenwood: # => true (https://eval.in/889489)
[14:06:19] tsglove: has joined #ruby
[14:06:27] havenwood: matthewd: Oops!
[14:07:06] havenwood: impermanence13: I did "any" not "only".
[14:08:13] cschneid_: has joined #ruby
[14:08:58] cschneid_: has joined #ruby
[14:09:12] eb0t: has joined #ruby
[14:09:14] elomatreb: .match?(/\A[ATCG]*\z/) would be another way
[14:09:24] havenwood: impermanence13: 'bacon'.match? /\A[abc]+\z/
[14:09:26] ccooke: I'd use a + there
[14:09:45] elomatreb: If you want to not match the empty string, yeah
[14:09:46] havenwood: I dunno, but my record for having read the question is bad.
[14:09:50] havenwood: ACTION goes in search of coffee
[14:11:42] apeiros: has joined #ruby
[14:12:51] jrafanie: has joined #ruby
[14:13:32] vondruch: has joined #ruby
[14:13:37] csk157: has joined #ruby
[14:17:14] catphish: has left #ruby: ("Leaving")
[14:17:55] swills: has joined #ruby
[14:17:55] swills: has joined #ruby
[14:18:03] dionysus69: has joined #ruby
[14:20:24] jenrzzz: has joined #ruby
[14:20:24] jenrzzz: has joined #ruby
[14:23:39] troys: has joined #ruby
[14:24:10] ResidentBiscuit: has joined #ruby
[14:25:16] apeiros: has joined #ruby
[14:25:37] hs366: has joined #ruby
[14:26:41] tsglove2: has joined #ruby
[14:28:59] jokke: i'm having a weird problem: i have a gem listed in my gemfile and it installs just fine with bundle
[14:29:22] jokke: however: when i try to run bundle exec anything it complains about the gem missing
[14:29:29] impermanence13: has joined #ruby
[14:29:42] jokke: could not find gem bson-4.2.2 in any of the sources
[14:29:49] thomasv314: has joined #ruby
[14:30:31] jokke: i've set BUNDLE_PATH to be relative to the Gemfile (vendor/bundle)
[14:30:39] milardovich: has joined #ruby
[14:30:47] jokke: any ideas what might be going wrong
[14:32:23] apeiros: has joined #ruby
[14:33:12] matthewd: jokke: Maybe compare `ruby -v`, `gem env`, and `bundle env`?
[14:34:13] tristanp: has joined #ruby
[14:34:49] Caius: has joined #ruby
[14:34:49] Caius: has joined #ruby
[14:36:42] Technodrome: has joined #ruby
[14:37:54] TvL2386: has joined #ruby
[14:39:06] jokke: ruby -v: 2.4.2-p198, gem env: https://paste.marcusmichaely.com/dAcYJ/, bundle env: https://paste.marcusmichaely.com/BZ9jgi/
[14:39:12] jokke: matthewd: ^
[14:39:15] banisterfiend: has joined #ruby
[14:41:53] FahmeF: has joined #ruby
[14:43:35] jokke: anything weird there?
[14:45:13] beccamorgan: has joined #ruby
[14:46:47] synthroid: has joined #ruby
[14:47:01] matthewd: Nothing obvious to me.. but I don't have much experience with disable_shared_gems / vendoring, sorry
[14:48:01] milardovich: has joined #ruby
[14:49:02] jrafanie: has joined #ruby
[14:50:05] tsglove3: has joined #ruby
[14:53:41] ski7777: has joined #ruby
[14:59:02] milardovich: has joined #ruby
[14:59:49] hhffppff: has joined #ruby
[15:00:53] apeiros: has joined #ruby
[15:01:14] mostlybadfly: has joined #ruby
[15:03:25] milardovich: has joined #ruby
[15:03:30] michael1: has joined #ruby
[15:03:31] milardovich: has joined #ruby
[15:03:32] TvL2386_: has joined #ruby
[15:04:19] thomasv314: has joined #ruby
[15:04:31] jrafanie_: has joined #ruby
[15:04:48] knight33: has joined #ruby
[15:05:49] chouhoulis: has joined #ruby
[15:05:57] houhoulis: has joined #ruby
[15:06:21] tlaxkit: has joined #ruby
[15:06:31] hhffppff: has joined #ruby
[15:07:04] guacamole: has joined #ruby
[15:09:43] milardovich: has joined #ruby
[15:09:51] milardovich: has joined #ruby
[15:10:15] apeiros: has joined #ruby
[15:16:54] bruno-: has joined #ruby
[15:18:47] rippa: has joined #ruby
[15:19:27] milardovich: has joined #ruby
[15:19:33] polishdub: has joined #ruby
[15:19:36] jokke: matthewd: okay, super weird
[15:19:42] milardovich: has joined #ruby
[15:19:43] jokke: if i remove .ruby-version everything works
[15:19:49] jokke: and rbenv uses system ruby
[15:19:53] jokke: which is also 2.4.2
[15:21:24] danielglh: has joined #ruby
[15:21:33] vipaca: has joined #ruby
[15:23:01] danielglh: has joined #ruby
[15:23:24] apeiros: has joined #ruby
[15:23:59] my-nick: has joined #ruby
[15:24:47] alan_w: has joined #ruby
[15:24:52] danielglh: has joined #ruby
[15:24:53] alan_w: has left #ruby: ()
[15:25:03] whippythellama: has joined #ruby
[15:25:47] tsglove3: has joined #ruby
[15:26:29] tsglove3: has joined #ruby
[15:26:41] vipaca: has joined #ruby
[15:26:59] danielglh: has joined #ruby
[15:27:59] tsglove2: has joined #ruby
[15:28:16] danielglh: has joined #ruby
[15:32:27] tsglove3: has joined #ruby
[15:33:01] oleo: has joined #ruby
[15:35:38] tsglove3: has joined #ruby
[15:37:11] tsglove2: has joined #ruby
[15:41:26] milardovich: has joined #ruby
[15:41:34] synthroid: has joined #ruby
[15:41:46] danielglh: has joined #ruby
[15:45:11] milardovich: has joined #ruby
[15:47:55] guacamole: has joined #ruby
[15:49:47] apeiros: has joined #ruby
[15:50:17] milardovich: has joined #ruby
[15:51:36] uZiel: has joined #ruby
[15:51:38] alnewkirk: has joined #ruby
[15:53:57] DTZUZO: has joined #ruby
[15:54:11] milardovich: has joined #ruby
[15:58:54] tsglove3: has joined #ruby
[16:00:58] apeiros: has joined #ruby
[16:03:20] lexruee: has joined #ruby
[16:03:58] [Butch]: has joined #ruby
[16:04:10] marxarelli: has joined #ruby
[16:07:16] [Butch]: has joined #ruby
[16:08:48] byte512: has joined #ruby
[16:10:05] cagomez: has joined #ruby
[16:10:10] allcentury: has joined #ruby
[16:11:05] cagomez: can I define a method with a question mark in a `tap block`? something like obj.tap { |o| o.active? = true }
[16:12:13] dminuoso: cagomez: What do you mean by "define" ?
[16:12:17] guacamole: has joined #ruby
[16:12:52] impermanence13: has joined #ruby
[16:13:22] cagomez: dminuoso: for example, `obj` can't receive obj.active? . I'd like to add the `active?` method onto obj. It's an openstruct, if that matters
[16:13:25] apeiros: has joined #ruby
[16:13:39] br0d1n: has joined #ruby
[16:13:56] dminuoso: cagomez: You absolutely can. Do you want the method as a singleton method for that object, or the entire class?
[16:14:24] cagomez: dminuoso: I'm using it in an rspec so I don't think it matters? either one is fine
[16:14:39] dminuoso: cagomez: Then define a singleton method. You probably have done this many times in fact. :-)
[16:14:46] dminuoso: Remember how you do "class methods" ?
[16:15:01] Papierkorb: cagomez: Are you actually looking to add a mock on your class?
[16:15:04] csk157: has joined #ruby
[16:15:06] Papierkorb: (Or your instance)
[16:15:09] dminuoso: Oh well, there's that of course.
[16:15:23] dminuoso: But lets at least teach how to do singleton methods, then you teach him the right way in rspec :P
[16:15:59] raynold: has joined #ruby
[16:16:08] vipaca: has joined #ruby
[16:16:39] imode: has joined #ruby
[16:16:42] knight33: has joined #ruby
[16:18:00] cagomez: so this is what I have and what I'd like to achieve: https://hastebin.com/gopedoruvo.rb
[16:18:27] bruno-: has joined #ruby
[16:19:27] jxv: has joined #ruby
[16:19:54] dminuoso: cagomez: Two things. Please use the . on the next line, if you want to use multiple lines for chaining
[16:20:06] dminuoso: Secondly, you can use []= to set an identifier ending in ?
[16:20:17] impermanence: has joined #ruby
[16:20:52] dminuoso: Also note that this does not *define a method*
[16:21:54] eblip: has joined #ruby
[16:21:57] cagomez: dminuoso: 1) sorry, that's the way my rubocop is setup. i thought that was convention. 2) what is the syntax or docs for this? Ive never seen that before 3) what is this doing? I just want to return a simple value
[16:22:26] jenrzzz: has joined #ruby
[16:22:26] jenrzzz: has joined #ruby
[16:22:53] cagomez: got #2 down :)
[16:22:54] dminuoso: cagomez: https://gist.github.com/dminuoso/76bcf294847504612e08f6109333a765 these two would be common styles.
[16:23:17] cagomez: ah i see, much better
[16:23:40] cdg: has joined #ruby
[16:23:49] dminuoso: I use the first if foo itself is a method, and the second if foo is some lvar object.
[16:26:04] dminuoso: cagomez: as for 2) and 3)
[16:26:09] dminuoso: &ri OpenStruct#[]=
[16:26:10] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/ostruct/rdoc/OpenStruct.html#method-i-5B-5D-3D
[16:26:55] apeiros: has joined #ruby
[16:27:14] cagomez: is `member` = `atribute` = `property`?
[16:28:26] dminuoso: cagomez: Seems like OpenStruct uses all these three synonymously.
[16:28:34] dminuoso: It also sometimes uses `field`
[16:29:19] matthewd: > Please use the . on the next line, if you want to use multiple lines for chaining
[16:29:22] cagomez: interesting. I usually use Javascript so all these terms are starting to mesh together
[16:29:33] matthewd: Looks like JavaScript to me :/
[16:29:50] dminuoso: matthewd: https://gist.github.com/dminuoso/bd85f7fe0a75cfdb56b5e069aff91df9 are you telling me this is in any way better?
[16:30:20] Papierkorb: Leading dots all the way
[16:30:26] matthewd: With an indent on the second line, and hopefully putting it across three lines, yes
[16:30:50] matthewd: For one thing, (IIRC?) it won't break if you insert a comment
[16:30:54] dminuoso: "putting it across three lines" ?
[16:31:05] dminuoso: You mean this? https://gist.github.com/dminuoso/bd85f7fe0a75cfdb56b5e069aff91df9
[16:31:47] matthewd: https://gist.github.com/matthewd/1c15432eedc54ca353d4ad5813526dd2
[16:32:24] uZiel: has joined #ruby
[16:33:21] dminuoso: matthewd: I never knew there was an opposing school of thought.
[16:33:48] matthewd: https://gist.github.com/matthewd/becab1bdc97f319daeb26d95cd0177c8
[16:34:26] tsglove2: has joined #ruby
[16:36:48] matthewd: I think I mostly just dislike the ambiguity, being unable to tell whether the expression ends on the line I'm looking at
[16:37:16] matthewd: i.e., the same reason I'm pro-semicolons in JS
[16:38:09] dminuoso: matthewd: Well to me the indention on the next line gives an immediate visual clue. Looking at discussions on the ruby style guides there seem to be a bunch of arguments for both sides.
[16:38:45] dminuoso: But I can see the benefit of being able to comment in between.
[16:39:12] dminuoso: Though I do think if you have the need to comment in between that, there might be something questionable about your code.
[16:39:38] dminuoso: But I do mean this as a smell that could entirely be justified.
[16:39:38] orbyt_: has joined #ruby
[16:39:40] cdg_: has joined #ruby
[16:42:10] eckhardt: has joined #ruby
[16:42:10] matthewd: Personally I'd generally avoid chaining enough for it to matter... but the new-hotness wisdom seems to be that if your method is more than a single chain of calls, you're basically drowning kittens -- at that point, comments do seem potentially relevant
[16:43:21] vipaca: has joined #ruby
[16:44:09] apeiros: has joined #ruby
[16:44:15] dminuoso: ACTION looks at https://gist.github.com/dminuoso/ddca6ada4f5cb7eb65f9f21902a04788
[16:44:52] dminuoso: This style has become quite predominant in my code ever since I started Haskell..
[16:45:19] blackmesa: has joined #ruby
[16:45:20] Papierkorb: dminuoso: I didn't need haskell to do it basically like that *hides*
[16:45:27] Papierkorb: No really, how else would one do that?
[16:45:31] matthewd: The rest I can live with, but the camelcase is killing me :P
[16:45:56] dminuoso: matthewd: Heh, I've seen you making these remarks about my code a few times now. ;-)
[16:46:03] dminuoso: Call it JS/Haskellism
[16:46:12] dminuoso: Just cant help it :(
[16:46:51] matthewd: I'd complain just as much about JS with underscores, if that's any consolation ;)
[16:46:59] alnewkirk: has joined #ruby
[16:47:35] matthewd: It's the fact that core/stdlib methods are spelled one way and app methods are the other, that gets me
[16:47:46] dminuoso: matthewd: For a while this was a serious problem when I started writing a React frontend with a transparent middleware that baked the JSON:API data from the rails into redux.
[16:48:04] dminuoso: matthewd: It basically infested JS with Rails world underscores from attributes.
[16:48:29] dminuoso: You had this user(1).email_address shenanigans everywhere. :(
[16:49:03] dminuoso: Or I did rather.
[16:49:21] matthewd: Yeah. In my head-canon, JSON is JS and should therefore be camelcase, just as HTML/XML should be kebab-case. But all that translation can be problematic too.
[16:49:49] guacamole: has joined #ruby
[16:51:19] dminuoso: matthewd: I think to a degree the reason to avoid underscores in Haskell stems from the fact that there's so many operators, so apart from "'" which is mathematically well understood to just read "a prime" for "a'", characters have meaning.
[16:51:45] dminuoso: But then again just like in Ruby identifiers can have UTF8 characters...
[16:52:39] matthewd: Isn't the Haskell stdlib camelcase?
[16:52:46] dminuoso: matthewd: yup.
[16:53:02] dviola: has joined #ruby
[16:53:10] dminuoso: Though they make liberal usage of things like foo = ..., foo' = ..., foo'' = ...
[16:53:10] matthewd: Right, so that's what you should use too™
[16:56:05] hahuang65: has joined #ruby
[16:57:11] Immune: has joined #ruby
[16:57:50] apeiros: has joined #ruby
[17:00:42] alfiemax: has joined #ruby
[17:01:51] tsglove3: has joined #ruby
[17:02:28] LocaMocha: has joined #ruby
[17:04:01] cdg: has joined #ruby
[17:07:05] conta: has joined #ruby
[17:07:37] SeepingN: has joined #ruby
[17:07:52] ldnunes: has joined #ruby
[17:09:36] Technodrome: has joined #ruby
[17:10:21] tsglove2: has joined #ruby
[17:13:10] tomphp: has joined #ruby
[17:15:49] csk157: has joined #ruby
[17:19:04] APag96: has joined #ruby
[17:19:05] ledestin: has joined #ruby
[17:22:10] alex``: has joined #ruby
[17:22:51] tsglove3: has joined #ruby
[17:23:26] guacamole: has joined #ruby
[17:24:01] APag96: Hello all! I'm having some issues with making HTTP requests. I'm trying to change the 'host' header for the request. This would be useful in making requests to vhosts that don't have DNS set up. In this code, I'm requesting the 'test.com' vhost on 192.241.XX.XX Here's my code: https://pastebin.com/Fn76R3Yi I'm running 'nc -l 80' on the IP and see that the 'Host' header is '192.241.XX.XX' and not 'test.com', like it should be. Thanks f
[17:24:03] ruby[bot]: APag96: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/85a44bb7ae96451412b7080183bb4c4f
[17:24:05] ruby[bot]: APag96: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[17:26:45] banisterfiend: has joined #ruby
[17:27:56] anisha: has joined #ruby
[17:28:04] enterprisey: has joined #ruby
[17:29:49] troulouliou_dev: has joined #ruby
[17:30:35] blackmesa: has joined #ruby
[17:31:49] banisterfiend: has joined #ruby
[17:32:23] jaequery: has joined #ruby
[17:33:04] postmodern: has joined #ruby
[17:34:04] minimalism: has joined #ruby
[17:37:12] jrafanie: has joined #ruby
[17:38:31] milardovich: has joined #ruby
[17:39:28] sspreitz: has joined #ruby
[17:40:00] RougeR: has joined #ruby
[17:41:13] alfiemax: has joined #ruby
[17:43:12] ldnunes: has joined #ruby
[17:44:13] Quentinius: has joined #ruby
[17:45:37] TvL2386: has joined #ruby
[17:48:12] tsglove2: has joined #ruby
[17:50:12] tsglove2: has joined #ruby
[17:51:08] helpa: has joined #ruby
[17:54:20] tsglove3: has joined #ruby
[17:58:43] alfiemax: has joined #ruby
[18:00:03] cagomez: has joined #ruby
[18:04:52] ams__: has joined #ruby
[18:05:30] milardovich: has joined #ruby
[18:08:31] orbyt_: has joined #ruby
[18:10:09] troulouliou_dev: has joined #ruby
[18:16:07] banisterfiend: anyone here familiar with autotools?
[18:16:18] cdg: has joined #ruby
[18:16:38] cdg: has joined #ruby
[18:17:55] mikecmpbll: has joined #ruby
[18:19:23] nofxx: has joined #ruby
[18:19:50] s2013: has joined #ruby
[18:20:56] dminuoso: banisterfiend: Might I also suggest #osdev ?
[18:21:03] dminuoso: Some of them are autotools users.
[18:21:31] dostoyevsky: Too many interesting channels...
[18:22:00] jxv: has joined #ruby
[18:22:24] conta1: has joined #ruby
[18:22:43] imode: has joined #ruby
[18:24:12] jenrzzz: has joined #ruby
[18:24:13] jenrzzz: has joined #ruby
[18:27:54] dionysus69: has joined #ruby
[18:28:55] goyox86_: has joined #ruby
[18:30:26] alnewkirk: has joined #ruby
[18:33:19] tsglove2: has joined #ruby
[18:35:32] mostlybadfly: has joined #ruby
[18:36:20] tomphp: has joined #ruby
[18:37:35] alfiemax: has joined #ruby
[18:37:53] mn3m: has joined #ruby
[18:37:54] guacamole: has joined #ruby
[18:38:39] tomphp: has joined #ruby
[18:38:58] tsglove3: has joined #ruby
[18:40:05] milardovich: has joined #ruby
[18:40:24] blackmesa1: has joined #ruby
[18:45:46] FrostCandy: has joined #ruby
[18:45:59] csk157: has joined #ruby
[18:49:47] guacamole: has joined #ruby
[18:52:38] waveprop: has joined #ruby
[18:54:13] alnewkirk: has joined #ruby
[18:55:39] knightblader: has joined #ruby
[18:56:04] NikolausK: has joined #ruby
[19:01:58] d5sx43: has joined #ruby
[19:03:53] ElDoggo: has joined #ruby
[19:05:04] Nahra: has joined #ruby
[19:05:59] ltem: has joined #ruby
[19:06:03] jrafanie: has joined #ruby
[19:07:08] gheegh: has joined #ruby
[19:09:10] dionysus69: has joined #ruby
[19:10:44] tomphp: has joined #ruby
[19:11:02] knight33: has joined #ruby
[19:11:47] jaequery: has joined #ruby
[19:12:27] Quentinius: has joined #ruby
[19:12:32] jaequery: has joined #ruby
[19:13:22] jaequery: has joined #ruby
[19:14:15] jaequery: has joined #ruby
[19:15:00] jaequery: has joined #ruby
[19:20:51] tsglove3: has joined #ruby
[19:21:53] jenrzzz: has joined #ruby
[19:23:06] infernix: has joined #ruby
[19:23:14] shinnya: has joined #ruby
[19:25:32] knight33: has joined #ruby
[19:25:46] milardovich: has joined #ruby
[19:27:43] Dimik: has joined #ruby
[19:29:05] whippythellama: has joined #ruby
[19:31:19] tomphp: has joined #ruby
[19:31:59] jenrzzz_: has joined #ruby
[19:32:27] s2013: has joined #ruby
[19:33:03] ta: has joined #ruby
[19:33:26] jrafanie: has joined #ruby
[19:33:29] dinfuehr: has joined #ruby
[19:36:49] alnewkirk: has joined #ruby
[19:41:26] cdg: has joined #ruby
[19:42:13] ur5us: has joined #ruby
[19:47:57] goyox86_: has joined #ruby
[19:48:45] guacamole: has joined #ruby
[19:53:55] alnewkir1: has joined #ruby
[19:54:09] synthroid: has joined #ruby
[19:54:48] vipaca: has joined #ruby
[19:57:37] bitcycle: has joined #ruby
[19:59:51] tsglove2: has joined #ruby
[20:04:12] nowhere_man: has joined #ruby
[20:10:24] troulouliou_dev: has joined #ruby
[20:12:47] guacamole: has joined #ruby
[20:17:57] MrBusiness: has joined #ruby
[20:19:20] houhoulis: has joined #ruby
[20:19:56] php_newbie: has joined #ruby
[20:20:51] php_newbie: Hello there, I'm a php developer starting to learn ruby, I have stumble upon RVM and rubyenv
[20:20:53] hahuang65: has joined #ruby
[20:22:08] matthewd: php_newbie: This channel generally recommends rbenv or chruby, over RVM, if that's your question
[20:22:16] php_newbie: Just tuo understand what's the most idiomatic way to manage the installation of a ruby interpeter? It seems like RVM should not be a tool i would have on production server, and I use to create my environment trougth containerization
[20:22:45] cagomez: has joined #ruby
[20:23:29] php_newbie: what does effectively rubyenv gives the user?
[20:24:12] matthewd: Production choices vary.. some use system ruby, if their OS is sufficiently up to date; others use ruby-build or ruby-install (the part of rbenv/chruby, respectively, that actually gets it onto your machine); still others do use a full version manager in production, even inside a container
[20:25:35] matthewd: A version manager ensures you're using the same ruby version in your development environment and in production, and gives you the ability to easily change that, either for upgrades, or to work with an older version if that's what your production app is using.
[20:25:54] php_newbie: ok please understand I don't come from an ecosystem with a native env definition tool, how is the ruby community reacting to containers? Why prefer a ruby env instead of of a container with the ruby interpeter?
[20:26:26] apeiros: version managers existed before containers. some people just stuck with them. some move on to containers. some mix.
[20:26:47] php_newbie: If i would have start I would have been set up a container with a ruby interpeter
[20:27:53] mn3m: has joined #ruby
[20:27:56] php_newbie: So just to understand If I moove to Ruby and start to work on Ruby project would I be like found developers using containers or the sentiment is to stuck with ruby env?
[20:28:53] matthewd: Personally, I think containers are a valuable option for production, but for local development, I prefer the flexibility of working on bare metal -- the isolation a container provides can occasionally get in the way, and IME it provides few advantages to make up for that (again, in development)
[20:29:17] RickHull: has joined #ruby
[20:29:27] php_newbie: Containers are almost bare metal
[20:29:32] matthewd: I'd say container-based development environments are also somewhat popular, though. Just not my cup of tea.
[20:29:44] Papierkorb: php_newbie: You also have to consider that for many, using bare ruby (with or without a version manager) have served many well for over a decade
[20:30:05] RickHull: havenwood (etc) - I'm looking for some guidance with Matrix and Vector from stdlib
[20:30:11] selim: has joined #ruby
[20:30:23] php_newbie: for my point of view I do not care about what to use, I care about what community use, because software is more about people than code
[20:30:59] RickHull: specifically: https://github.com/rickhull/simplex/blob/modernize/lib/simplex.rb -- why does Vector not allow []= and why does this lib want to do that?
[20:31:00] apeiros: I think at this point, version managers are more widely used. but I think that's mostly due to masses moving slowly.
[20:31:05] php_newbie: so I tend to adhere to comunity sentiment
[20:31:24] RickHull: also, where @a is an array of Vectors, is this more naturally represented as a Matrix?
[20:31:26] Papierkorb: php_newbie: It's just infinitely easier to interact with the actual software without having to mess with docker (or w/e) while dev'ing. Being able to write "bundle exec pry" will just work and have the environment you know: That of your host. On production, use whatever suits you best: If that's containers, use them!
[20:31:27] apeiros: RickHull: probably matrix.rb considers vectors to be immutable.
[20:31:36] RickHull: and are Vectors actually doing something useful in this lib?
[20:31:52] RickHull: apeiros: so why might this lib be wanting to mutate?
[20:31:54] matthewd: If you want to go with the currently-more-popular choice, I'd say go with a local version manager and run ruby locally. If you have container-based experience and would prefer to go that way, you won't be super unusual.
[20:32:01] RickHull: is there a more canonical procedure?
[20:32:03] apeiros: RickHull: because the dev was lazy?
[20:32:21] RickHull: i wonder why choose Vector at all
[20:32:57] php_newbie: Acutally I'm playing around with RVM and simple bare metal env
[20:33:15] php_newbie: where I will be able how to configure everything on its full potential
[20:33:18] apeiros: RickHull: the standard way is to create a new vector with the modified values
[20:33:24] php_newbie: I will moove to containerization
[20:33:32] apeiros: and it probably uses a vector because it needs vector calculations
[20:33:52] tsglove3: has joined #ruby
[20:34:02] apeiros: though I'm not seeing any at a glance
[20:34:07] RickHull: here is where the vector mutation happens: https://github.com/rickhull/simplex/blob/modernize/lib/simplex.rb#L113
[20:34:13] RickHull: i think arrays suffice here
[20:34:21] RickHull: but I'd be interested in a performance benefit
[20:34:27] RickHull: and playing by the rules
[20:34:27] Immune: has joined #ruby
[20:34:38] php_newbie: thanks to all, for informations
[20:34:40] ur5us: has joined #ruby
[20:35:20] RickHull: i'm wondering if using a Matrix can speed things up or express them more naturally
[20:35:41] RickHull: but I'm very much a matrix novice and also to simplex and linear programming
[20:35:48] RickHull: so this is kind of a deep dive exercise
[20:36:02] apeiros: RickHull: vector isn't native, so there isn't any.
[20:36:24] apeiros: neither is matrix. at least they weren't in 1.9. haven't checked since. but I doubt they are now.
[20:36:27] RickHull: i'd be interested in more natural expression as long as there is no performance regression
[20:36:48] RickHull: i think either mutable arrays or immutable Vector / Matrix
[20:37:08] RickHull: i'll start with the first but not sure how fruitful the latter approach would be
[20:38:13] apeiros: 21:31 RickHull: also, where @a is an array of Vectors, is this more naturally represented as a Matrix?
[20:38:21] cschneid_: has joined #ruby
[20:38:23] apeiros: re ^: if all vectors have the same length, yes
[20:38:45] RickHull: i have to enforce this with raise
[20:39:03] cschneid_: has joined #ruby
[20:39:03] apeiros: and I'm pretty sure the formal description of whatever solver this is uses matrix too to describe the process.
[20:39:19] apeiros: that doesn't mean matrix.rb is the ideal way to solve it in ruby.
[20:39:20] jottr: has joined #ruby
[20:39:39] RickHull: i'm going to add some benchmarks and s/Vector/Array/
[20:40:19] RickHull: and then investigate the Matrix portion. seems like a good application for numpy
[20:40:58] havenwood: That reminds me, there's an exercism problem named "matrix.rb" that can be solved with the stdlib "matrix.rb": http://exercism.io/submissions/13bf325853cc44f7bd42c64bd2d9e5a9
[20:41:01] apeiros: certainly is the kind of problems numpy is strong in. not sure how well narray is developed in ruby.
[20:41:24] havenwood: haha, epitron upvoted it
[20:41:34] havenwood: this is not the solution you are looking for...
[20:41:42] RickHull: havenwood: what is the point of this?
[20:42:13] havenwood: RickHull: Just silliness. I was annoyed they stomped on a stdlib namespace so I unstomped it and used it.
[20:42:18] ozcanesen: has joined #ruby
[20:42:50] havenwood: I like Matrix.
[20:43:02] RickHull: i still haven't unpacked Fibonacci.matrix
[20:43:06] apeiros: havenwood: :D
[20:43:07] RickHull: it's just magic(tm) for now
[20:43:11] havenwood: RickHull: :-)
[20:43:25] ur5us_: has joined #ruby
[20:45:05] ur5us: has joined #ruby
[20:46:02] tsglove2: has joined #ruby
[20:46:13] ur5us_: has joined #ruby
[20:47:49] cadillac_: has joined #ruby
[20:47:52] zer0python: anyone in here have experience with axlsx?
[20:48:11] rirc_BE17: has joined #ruby
[20:50:06] zer0python: I'm following an example for creating a pivot table where they do pivot_table.data = [{:ref => "Member ID", :subtotal => "count"}]. I basically am doing the same thing but using more applicable values to what I'm working on, but I'm getting this validation error that says {:ref => "...", :subtotal => "count"} must be [String]
[20:52:40] Immune: has joined #ruby
[20:52:47] cdg: has joined #ruby
[20:52:57] workmad3: has joined #ruby
[20:54:07] cdg: has joined #ruby
[20:55:58] enterprisey: has joined #ruby
[21:02:17] cadillac_: has joined #ruby
[21:04:45] allcentury: has joined #ruby
[21:06:36] troulouliou_dev: has joined #ruby
[21:06:54] chmurifree: has joined #ruby
[21:07:01] guacamole: has joined #ruby
[21:07:16] ap4y: has joined #ruby
[21:08:45] dminuoso: zer0python: What part about that error escapes you?
[21:09:15] dminuoso: zer0python: Oh, perhaps the phrasing might be weird. [String] reads to be: Array of strings. ;-)
[21:09:16] zer0python: the part where I'm doing the same thing as the example and the example works
[21:09:21] zer0python: that's what escapes me
[21:09:27] dminuoso: zer0python: gist your code and the example
[21:09:44] zer0python: can't gist my code
[21:09:48] dminuoso: zer0python: make a testcase.
[21:09:56] ruby[bot]: If you cannot share your code, we cannot help you. Create a complete, executable example that you can share and that reproduces your issue, or hire a consultant.
[21:10:48] cdg_: has joined #ruby
[21:11:15] RickHull: it's always a good exercise to distill your buggy behavior to minimal example
[21:11:18] zer0python: dminuoso: yeah I get it. Was hoping for an expert though.
[21:11:27] RickHull: half the time you find the bug is on your side :)
[21:11:28] zer0python: dminuoso: don't concern yourself with it, I'll figure it out.
[21:11:52] dminuoso: zer0python: We dont have crystal balls. No expert can predict what you did wrong without seeing your code.
[21:11:57] dminuoso: But suit yourself.
[21:12:52] RickHull: ACTION has ruby balls
[21:13:10] zenspider: zer0python: was hoping for a psychic expert?
[21:13:13] zer0python: dminuoso: I am literally doing the same thing as the example, only different fields.
[21:13:26] zer0python: and the example is just the pivottable example you can find on google.
[21:13:33] RickHull: zer0python: if you can distill it to a working example, paste that example
[21:13:37] RickHull: or file an issue with the project
[21:13:54] dminuoso: If you cant produce code that exhibits the problem, I doubt very much they will bother.
[21:15:19] zenspider: how is it you can't paste us an example if this is "just the example" and "you can find on google"???
[21:15:24] zenspider: this smells bad
[21:18:39] dminuoso: zer0python: Based on the code, it appears that the array around [String] rather means "any of". So it would follow that you are not always passing in strings.
[21:20:29] dminuoso: zenspider: in particular this validation is applied to the values of the hash. so some values in your hash are not strings.
[21:21:02] dminuoso: But what do I know. Perhaps an expert will pop up.
[21:21:09] baweaver: ACTION wanders in
[21:21:22] baweaver: ACTION wanders back out
[21:22:26] setient: does anyone here do unit testing on rails without relying on a database or whatnot?
[21:22:37] setient: you know, actual unit testing of the ruby code
[21:22:51] allcentury: has joined #ruby
[21:23:12] baweaver: though you probably want #RubyOnRails
[21:23:18] dminuoso: baweaver: so much effort.
[21:23:18] zenspider: "actual"? as in... if there's a db involved it isn't real testing?
[21:23:20] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[21:23:37] dminuoso: dminuoso. making fun of baweaver since 2016.
[21:24:52] zenspider: some do... check out corey haines and... um... the destroy all software guy. both have given talks on it
[21:24:54] guacamole: has joined #ruby
[21:25:01] setient: thank you baweaver
[21:25:01] zenspider: gary bernhart
[21:25:29] setient: thanks dminuoso
[21:25:40] zenspider: but if my tests are fast enough w/ a db, I'm not going to put effort into removing it
[21:26:07] baweaver: most of it is just using factory_girl poorly honestly
[21:26:08] baweaver: or factory_bot now I guess
[21:26:43] dminuoso: baweaver: That refactoring was so painful, I was so close to just rm -rf spec/
[21:26:44] zenspider: hah! was it renamed finally?
[21:26:47] jenrzzz: has joined #ruby
[21:26:47] jenrzzz: has joined #ruby
[21:27:05] baweaver: Looks like it
[21:27:11] dminuoso: I can barely write a spec without at least getting an uninitialized const error.
[21:27:21] dminuoso: FactoryGirl. That muscle memory is burned in.
[21:27:32] guacamole: has joined #ruby
[21:28:02] zenspider: I never saw the point in those libs
[21:28:51] ta: has joined #ruby
[21:28:56] dminuoso: zenspider: It's somewhat useful if you use traits to quickly construct a hierarchy of objects.
[21:30:19] zenspider: def is my factory framework
[21:31:15] dminuoso: as in keyword_def?
[21:32:40] milardovich: has joined #ruby
[21:33:31] GodFather: has joined #ruby
[21:40:29] weaksauce: has joined #ruby
[21:41:31] raynold: has joined #ruby
[21:42:48] Puffball: has joined #ruby
[21:42:56] guacamole: has joined #ruby
[21:45:29] ruby[bot]: -b *!*@x590f844c.dyn.telefonica.de$#ruby-banned
[21:49:50] nadir: has joined #ruby
[21:52:05] beerich: has joined #ruby
[21:52:13] claudiuinberlin: has joined #ruby
[21:59:55] tcopeland: has joined #ruby
[22:01:07] ahrs: has joined #ruby
[22:01:13] beerich: Anybody available for a novice chat on modules?
[22:04:06] jrafanie: has joined #ruby
[22:05:20] beerich: Trying to get my head around how to do this. I have two files, where one uses require_relative to a file that has a module in it, and a plain methods for tests
[22:05:47] beerich: I set a variable (instance, as I'm in Sinatra) to the outside method, and it works
[22:06:01] beerich: the Module variable set, gives me an ISE
[22:06:20] beerich: I need to use `include Modulename` correct?
[22:06:27] beerich: even though I've required it?
[22:07:02] jphase: has joined #ruby
[22:08:05] dminuoso: beerich: `require` is basically just `execute that file` (with the constraint that it will only execute any file once)
[22:08:19] beerich: https://pastebin.com/nShiUQV9
[22:08:21] ruby[bot]: beerich: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/60687d9819c7658e5d5d50fad28e9481
[22:08:21] ruby[bot]: beerich: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[22:08:36] beerich: ok then lol
[22:08:42] alnewkirk: has joined #ruby
[22:09:04] dminuoso: beerich: what is "ISE" ?
[22:09:13] beerich: Internal Server Error
[22:09:26] beerich: https://gist.github.com/anonymous/60687d9819c7658e5d5d50fad28e9481
[22:10:07] sarbs: has joined #ruby
[22:10:08] dminuoso: Oh I see what you mean.
[22:10:20] beerich: the outer methods demonstrates the file is read and things are fine
[22:11:04] dminuoso: beerich: My opinion is, get a good book.
[22:11:18] beerich: hah they're all going in different directions
[22:11:33] dminuoso: Perhaps you are in need of a good book recommendation then.
[22:12:10] jenrzzz: has joined #ruby
[22:12:10] jenrzzz: has joined #ruby
[22:13:17] baweaver: There's a book list in the channel topic
[22:13:47] baweaver: Though generally I like Eloquent Ruby for people who have programmed a bit before in another language.
[22:14:34] beerich: ya modules are new to me.
[22:14:46] beerich: been in another language for years
[22:14:51] beerich: ok thanks for the guidance
[22:15:17] dminuoso: Eloquent Ruby is frequently recommended and highly praised. I can't speak for the quality itself, but I've heard only good things.
[22:15:25] baweaver: Eloquent Ruby is entirely how to Ruby like a Rubyist
[22:18:32] sammi`: has joined #ruby
[22:18:34] conta2: has joined #ruby
[22:19:19] charliesome: has joined #ruby
[22:21:10] dminuoso: ACTION thinks that second Ruby should be lowercase.
[22:21:53] baweaver: I choose to capitalize on the opportunity
[22:22:16] dminuoso: But your opportunity was not capitalized?
[22:23:34] baweaver: you win this round
[22:24:53] cadillac_: has joined #ruby
[22:24:56] baweaver: in any case there are normally a few of us around at most hours if you have questions beerich, so ask away
[22:24:59] mn3m: has joined #ruby
[22:25:18] beerich: thanks, I appreciate it. I'll be chasing up some texts
[22:26:54] jenrzzz: has joined #ruby
[22:26:54] jenrzzz: has joined #ruby
[22:27:05] orbyt_: has joined #ruby
[22:32:49] alnewkirk: has joined #ruby
[22:36:03] darkmorph: has joined #ruby
[22:37:02] sarbs: has joined #ruby
[22:39:14] Nicmavr: has joined #ruby
[22:41:19] jenrzzz: has joined #ruby
[22:44:16] goyox86_: has joined #ruby
[22:47:10] guacamole: has joined #ruby
[22:48:45] tsglove2: has joined #ruby
[22:51:06] milardovich: has joined #ruby
[22:52:45] jphase: has joined #ruby
[22:53:26] tomphp: has joined #ruby
[22:53:38] workmad3: has joined #ruby
[22:53:44] cagomez: has joined #ruby
[22:56:19] milardovich: has joined #ruby
[23:02:00] jphase: has joined #ruby
[23:03:22] milardovich: has joined #ruby
[23:04:20] jenrzzz: has joined #ruby
[23:04:20] jenrzzz: has joined #ruby
[23:04:22] cagomez: has joined #ruby
[23:04:58] tcopeland: has joined #ruby
[23:06:27] dstrunk: has joined #ruby
[23:06:31] thinkpad: has joined #ruby
[23:08:56] orbyt_: has joined #ruby
[23:10:22] jphase: has joined #ruby
[23:12:48] goyox86_: has joined #ruby
[23:13:41] knight33: has joined #ruby
[23:14:41] jphase: has joined #ruby
[23:15:22] darkmorph: has joined #ruby
[23:15:24] ElDoggo: has joined #ruby
[23:21:38] cagomez: has joined #ruby
[23:21:45] mtkd: has joined #ruby
[23:22:20] cagomez: has joined #ruby
[23:22:39] cschneid_: has joined #ruby
[23:25:35] csk157: has joined #ruby
[23:26:24] guardianx: has joined #ruby
[23:26:50] rhyselsmore: has joined #ruby
[23:34:31] mkroman: has joined #ruby
[23:34:42] mkroman: has joined #ruby
[23:46:12] cdg: has joined #ruby
[23:46:35] mkroman: has joined #ruby
[23:48:07] tvw: has joined #ruby
[23:50:35] Technodrome: has joined #ruby
[23:56:10] dalitom: has joined #ruby
[23:57:13] dalitom: can you guys please help me
[23:57:29] dalitom: how can I split this string
[23:57:30] dalitom: string = "/home/eail\r\n/home/dtomic/"
[23:57:45] baweaver: define split
[23:58:07] baweaver: what have you tried?
[23:58:30] dalitom: to create array ... arry = ["/home/eail", "/home/dtomic/"]
[23:58:36] baweaver: I'd assume you mean by \r\n
[23:58:47] baweaver: What have you tried?
[23:59:00] dalitom: split("\r\n")
[23:59:09] baweaver: and what did it give you?
[23:59:49] dalitom: I am tired :(