« Back to channel list

#ruby - 17 October 2017

« Back 1 day Forward 1 day »
[00:00:38] jrabe: has joined #ruby
[00:05:39] serhart: has joined #ruby
[00:12:31] Cohedrin_: has joined #ruby
[00:12:41] hinbody: has joined #ruby
[00:13:21] workmad3: has joined #ruby
[00:16:46] __Yiota: has joined #ruby
[00:18:49] ap4y: has joined #ruby
[00:25:24] FooMunki: has joined #ruby
[00:32:23] twosevenzero: has joined #ruby
[00:35:05] serhart: has joined #ruby
[00:44:44] dc3: has joined #ruby
[00:46:05] Cohedrin_: has joined #ruby
[00:46:53] jenrzzz: has joined #ruby
[00:47:00] weaksauce: has joined #ruby
[00:57:04] kiswe: has joined #ruby
[00:57:05] kiswe: has left #ruby: ()
[01:06:59] cagomez: has joined #ruby
[01:07:49] cagomez: has joined #ruby
[01:08:25] cagomez: has joined #ruby
[01:10:54] mson: has joined #ruby
[01:16:36] GodFather: has joined #ruby
[01:19:59] vikaton: has joined #ruby
[01:22:20] ResidentBiscuit: has joined #ruby
[01:24:54] bmurt: has joined #ruby
[01:29:38] xuanrui: has joined #ruby
[01:31:19] rexb0t: has joined #ruby
[01:31:30] Cohedrin_: has joined #ruby
[01:32:19] hays: has joined #ruby
[01:32:25] d^sh_: has joined #ruby
[01:33:53] serhart: has joined #ruby
[01:33:54] hays: ok, I've writing basically a diff function between two dicts, where the return value is a report of what items are different. the dict is pretty heterogeneous--it has strings, ints, floats, dicts of strings, ints and floats.. and because of this right now i have a huge block of repetetive code where i check each item individually. im trying to figure out how to structure this so i am less repetetive
[01:34:26] yCrazyEdd: has joined #ruby
[01:37:15] fullstack: has joined #ruby
[01:37:17] hays: here's a basic idea of the structure https://bpaste.net/show/cd7c477bad40
[01:38:08] serhart: has joined #ruby
[01:38:48] hays: some things i have to convert to string, some things are nested.. its just at that level of difficulty where im not sure how to generalize
[01:48:19] ta: has joined #ruby
[01:53:10] serhart_: has joined #ruby
[01:53:50] whippythellama: has joined #ruby
[01:55:50] s2013: has joined #ruby
[02:00:25] dnewkerk: has joined #ruby
[02:00:41] veeti: has joined #ruby
[02:05:23] serhart: has joined #ruby
[02:06:12] raynold: has joined #ruby
[02:12:13] chopin: has joined #ruby
[02:14:06] workmad3: has joined #ruby
[02:16:19] jenrzzz: has joined #ruby
[02:16:29] hays: has joined #ruby
[02:17:49] kapil___: has joined #ruby
[02:18:29] chopin: has joined #ruby
[02:22:25] ap4y: has joined #ruby
[02:25:06] astrobunny: has joined #ruby
[02:27:49] chouhoul_: has joined #ruby
[02:31:17] eckhardt: has joined #ruby
[02:32:06] RenatoSilva: has joined #ruby
[02:33:35] serhart_: has joined #ruby
[02:36:16] RenatoSilva: has left #ruby: ("http://renatosilva.net")
[02:38:07] miah: has joined #ruby
[02:39:00] uneeb: has joined #ruby
[02:39:55] guardianx: has joined #ruby
[02:41:46] kenichi: has joined #ruby
[02:41:52] naquad: has joined #ruby
[02:42:12] rt: has joined #ruby
[02:42:56] tris: has joined #ruby
[02:43:35] Technodrome: has joined #ruby
[02:46:42] workmad3: has joined #ruby
[02:51:10] _whitelogger: has joined #ruby
[02:51:10] serhart_: has joined #ruby
[02:56:07] soifr: has joined #ruby
[02:56:08] soifr: has left #ruby: ()
[02:58:40] serhart: has joined #ruby
[02:59:31] ozcanesen: has joined #ruby
[03:00:01] Cohedrin_: has joined #ruby
[03:00:37] amevaash: has joined #ruby
[03:00:37] amevaash: has left #ruby: ()
[03:01:55] ta: has joined #ruby
[03:03:05] alnewkirk: has joined #ruby
[03:03:12] odroi: has joined #ruby
[03:03:12] odroi: has left #ruby: ()
[03:08:55] etoigh: has joined #ruby
[03:08:55] etoigh: has left #ruby: ()
[03:11:22] gix: has joined #ruby
[03:12:18] igheeph: has joined #ruby
[03:12:19] igheeph: has left #ruby: ()
[03:17:08] cagmz_: has joined #ruby
[03:20:53] uZiel: has joined #ruby
[03:23:13] ogres: has joined #ruby
[03:25:54] Technaton: has joined #ruby
[03:26:33] truenito: has joined #ruby
[03:28:13] howdoi: has joined #ruby
[03:36:01] Cohedrin_: has joined #ruby
[03:38:05] jenrzzz: has joined #ruby
[03:38:57] Cohedrin_: has joined #ruby
[03:41:11] eghaoquof: has joined #ruby
[03:41:11] eghaoquof: has left #ruby: ()
[03:42:50] s2013: has joined #ruby
[03:46:12] jphase: has joined #ruby
[03:47:07] nyuszika7h: has joined #ruby
[03:55:38] __Yiota: has joined #ruby
[03:57:54] elcontrastador: has joined #ruby
[03:59:11] orbyt_: has joined #ruby
[04:04:05] redondos: has joined #ruby
[04:04:05] redondos: has joined #ruby
[04:07:41] tamouse__: has joined #ruby
[04:09:45] Devalo: has joined #ruby
[04:10:21] ta: has joined #ruby
[04:15:08] Cohedrin_: has joined #ruby
[04:16:53] zautomata1: has joined #ruby
[04:18:52] soyeomul: has joined #ruby
[04:21:21] tamouse__: has joined #ruby
[04:21:23] xuanrui: has joined #ruby
[04:27:34] Cohedrin_: has joined #ruby
[04:27:43] conta: has joined #ruby
[04:32:16] corporatus: has joined #ruby
[04:32:32] Dimik: has joined #ruby
[04:34:21] ta: has joined #ruby
[04:37:59] cdg: has joined #ruby
[04:39:10] eckhardt: has joined #ruby
[04:43:53] cosimo_: has joined #ruby
[04:46:19] jinie: has joined #ruby
[04:47:30] workmad3: has joined #ruby
[04:47:40] cosmo: has left #ruby: ()
[04:54:49] cosimou: has joined #ruby
[04:57:24] ta: has joined #ruby
[05:01:21] alex``: has joined #ruby
[05:02:40] elcontrastador: has joined #ruby
[05:14:29] ta: has joined #ruby
[05:14:51] jrheaton: has joined #ruby
[05:18:10] matthewd: hays: You might want to consider https://github.com/liufengyun/hashdiff
[05:18:17] NightMonkey: has joined #ruby
[05:22:07] latemus: has joined #ruby
[05:22:51] latemus: how do i bringan external module such as mysql into the scope of my program. require 'mysql' is not doing it
[05:23:49] jenrzzz: has joined #ruby
[05:27:06] matthewd: latemus: What are you doing, and what's not working?
[05:28:37] enterprisey: has joined #ruby
[05:29:08] latemus: matthewd: i'm writing a script to learn how to connect to a mysql database, and im getting an error 'cannot load such file -- mysql (LoadError)'
[05:29:37] matthewd: Are you following a tutorial or something?
[05:29:40] latemus: is it a third-party packagage, like ruby-mysql or something
[05:29:47] matthewd: mysql is a gem you need to install first, yes
[05:29:55] latemus: yeah matthewd i am.
[05:30:09] matthewd: But note mysql2 is more popular these days
[05:30:29] latemus: okay, thanks. i think my question is, once i install the gem will require just work
[05:30:42] matthewd: If the tutorial is old enough, it might tell you to `gem install mysql` (and then yes, the require will just work)
[05:31:08] matthewd: Something more modern should recommend using bundler, so you'd add `gem "mysql"` to your Gemfile, then `bundle install`
[05:31:13] latemus: matthewd: that's good to know, i'll definitely use mysql2 instead, i've been wondering if what i was using was the ruby equivalent of the mysql php extensions (obsoleted by mysqli)
[05:32:20] latemus: matthewd: i could stand to learn abount bundle, i dont understand it
[05:32:35] latemus: but i used it with rails a while back
[05:32:48] latemus: i guess i assumed it was a railsism
[05:33:12] latemus: like activerecord
[05:33:16] matthewd: The short version is that `gem` on its own will install gems globally, and then ruby will use them as needed -- by default, by just activating the latest version of whatever gem provides the file you're trying to require
[05:33:57] matthewd: Bundler is a wrapper that uses a local Gemfile to track which gems are used by the current project, and automatically load a coherent (and consistent) set of versions
[05:34:10] latemus: i love ruby but it bothers me to install things outside my OS's package manager
[05:34:20] ur5us: has joined #ruby
[05:34:37] latemus: Okay bundler will be useful
[05:36:03] latemus: Thx matthewd
[05:36:20] matthewd: By default bundler still installs the gems globally and is just picky about which ones it uses, because that's most convenient for most people, especially if they have multiple projects with similar deps
[05:36:38] jgt: has joined #ruby
[05:36:49] ur5us: has joined #ruby
[05:36:50] matthewd: But it can also be told to install the gems entirely inside a subdirectory of the project, if that feels like less of a package management violation
[05:37:04] latemus: Yes that feels much better
[05:38:49] latemus: Seems more portable also
[05:39:39] matthewd: The point of the Gemfile (and Gemfile.lock) is that you don't need to portably move around the actual gem contents, just the list of specific versions required
[05:41:18] latemus: Do gems include any documentation on their use?
[05:41:24] biberu: has joined #ruby
[05:41:42] latemus: I noticed that typing help in irb is extremely useful. Somehow i had not learned about that
[05:42:14] latemus: And didn't ruby forge shutdown or was that something else?
[05:43:51] matthewd: Yes, rubyforge shut down some time ago
[05:44:35] ta: has joined #ruby
[05:52:03] anisha: has joined #ruby
[05:53:01] DTZUZU2: has joined #ruby
[05:54:56] Qiong`: has joined #ruby
[06:01:37] rippa: has joined #ruby
[06:06:52] ta: has joined #ruby
[06:08:30] ta: has joined #ruby
[06:12:48] jphase: has joined #ruby
[06:21:47] dionysus69: has joined #ruby
[06:22:06] DTZUZU2: has joined #ruby
[06:23:05] conta1: has joined #ruby
[06:27:46] NightMonkey: has joined #ruby
[06:28:09] zarubin1: has joined #ruby
[06:29:02] tvw: has joined #ruby
[06:30:42] Qiong`: has joined #ruby
[06:35:35] Antiarc: has joined #ruby
[06:38:39] baweaver: More fun :D - https://medium.com/@baweaver/reducing-enumerable-sorting-and-state-a336e098693d
[06:38:55] jenrzzz: has joined #ruby
[06:38:55] jenrzzz: has joined #ruby
[06:44:30] anisha: has joined #ruby
[06:46:00] andikr: has joined #ruby
[06:48:10] workmad3: has joined #ruby
[06:48:56] mjolnird: has joined #ruby
[06:49:52] jgt: has joined #ruby
[06:53:58] djbkd: has joined #ruby
[06:54:55] govg: has joined #ruby
[06:55:43] TomyWork: has joined #ruby
[07:03:12] tristanp: has joined #ruby
[07:04:10] hs366: has joined #ruby
[07:06:27] truenito: has joined #ruby
[07:08:57] mark_66: has joined #ruby
[07:09:54] idiocrash: has joined #ruby
[07:10:13] Megamos: has joined #ruby
[07:10:33] kies: has joined #ruby
[07:10:38] guardianx: has joined #ruby
[07:13:13] claudiuinberlin: has joined #ruby
[07:13:14] burgestrand: has joined #ruby
[07:15:50] ta: has joined #ruby
[07:17:36] Silthias1: has joined #ruby
[07:23:09] rgr: has joined #ruby
[07:24:13] DoubleMalt: has joined #ruby
[07:27:16] aufi: has joined #ruby
[07:28:33] BubonicPestilenc: has joined #ruby
[07:29:58] sysvalve: has joined #ruby
[07:30:26] rabajaj: has joined #ruby
[07:34:48] fmcgeough: has joined #ruby
[07:39:35] kliq: has joined #ruby
[07:40:20] whippythellama: has joined #ruby
[07:41:35] Mia: has joined #ruby
[07:41:35] Mia: has joined #ruby
[07:43:45] sniffer: has joined #ruby
[07:53:25] DanielI: has joined #ruby
[07:53:26] DanielI: has joined #ruby
[08:02:05] roshanavand: has joined #ruby
[08:03:09] guardianx: has joined #ruby
[08:04:47] sysvalve: has joined #ruby
[08:07:09] gusrub: has joined #ruby
[08:07:57] fumk: has joined #ruby
[08:10:05] quobo: has joined #ruby
[08:10:36] anas: has joined #ruby
[08:16:14] burgestrand: has joined #ruby
[08:17:24] Silthias: has joined #ruby
[08:18:20] mim1k: has joined #ruby
[08:20:20] anisha: has joined #ruby
[08:21:49] ramfjord: has joined #ruby
[08:28:41] kassav_: has joined #ruby
[08:30:33] jgt: has joined #ruby
[08:31:56] guille-moe: has joined #ruby
[08:36:12] djbjd: has joined #ruby
[08:37:26] marr: has joined #ruby
[08:38:30] cdg: has joined #ruby
[08:39:23] jan4: has joined #ruby
[08:42:36] mim1k: has joined #ruby
[08:45:22] ur5us: has joined #ruby
[08:48:54] workmad3: has joined #ruby
[08:50:21] kassav__: has joined #ruby
[08:51:19] Beams: has joined #ruby
[08:54:46] lxsameer: has joined #ruby
[08:58:55] guardianx: has joined #ruby
[09:01:23] dhollin3: has joined #ruby
[09:18:27] enterprisey: has joined #ruby
[09:22:50] erlend: has joined #ruby
[09:27:35] b100s: has joined #ruby
[09:28:10] b100s: what's wring with second example? why ther re only 2 elems? expected all three http://paste.org.ru/?fektyg
[09:29:53] Megamos: has joined #ruby
[09:31:06] jan41: has joined #ruby
[09:31:52] matthewd: b100s: The second argument isn't an index
[09:32:20] jan41: has joined #ruby
[09:33:25] b100s: matthewd, why? there is syntax which allow me to say left and right border of indexes like [0..2]
[09:33:26] jan41: has joined #ruby
[09:34:02] b100s: matthewd, https://ruby-doc.org/core-2.2.0/Array.html#class-Array-label-Accessing+Elements
[09:34:14] b100s: arr[2, 3] #=> [3, 4, 5]
[09:34:38] matthewd: I'm not sure what you're asking
[09:34:57] matthewd: Yes, that documentation matches the behaviour you're seeing
[09:35:06] alnewkirk: has joined #ruby
[09:35:08] tobiasvl: [0..2] is not inclusive. 0 and 1 are returned, not 2
[09:35:28] tobiasvl: other way around...
[09:36:47] tobiasvl: thought the second example was ...
[09:37:07] tobiasvl: which one are you asking about? you asked about the syntax [0..2] but you're asking about [0,2]?
[09:37:56] b100s: tobiasvl, yes, [0,2] actually all array; but i've gotten only 2 elems
[09:38:04] matthewd: >> (0..20).to_a[7..9]
[09:38:05] ruby[bot]: matthewd: # => [7, 8, 9] (https://eval.in/881422)
[09:38:06] b100s: need all using syntax [0,2]
[09:38:11] matthewd: >> (0..20).to_a[7, 3]
[09:38:12] ruby[bot]: matthewd: # => [7, 8, 9] (https://eval.in/881423)
[09:38:16] matthewd: Does that help?
[09:38:18] elomatreb: arr[0, 2] means "two elements starting from index 0"
[09:39:03] elomatreb: arr[0..2] means "all indices in the (inclusive) range 0..2 (0, 1, 2)"
[09:39:16] b100s: sorry, thanks; yes, my wrong
[09:39:18] b100s: pair of arguments (start and length)
[09:43:44] Serpent7776: has joined #ruby
[09:43:45] Serpent: has joined #ruby
[09:43:46] _Serpent_: has joined #ruby
[09:54:13] paranoicsan: has joined #ruby
[09:57:36] fizzycola: 0...2 is exclusive of 2.
[09:59:26] fullstack: has joined #ruby
[10:00:39] huyderman: has joined #ruby
[10:15:12] alnewkirk: has joined #ruby
[10:15:56] Technodrome: has joined #ruby
[10:21:52] yxhuvud: has joined #ruby
[10:22:05] ramfjord: has joined #ruby
[10:22:43] tobiasvl: as _why said: "Think of it as an accordion which has been squeezed down for carrying. (Sure, you can build a great sense of self-worth by carrying around an unfolded accordion, but sometimes a person needs to wallow in self-doubt, carefully concealing the squeeze-box.) The parentheses are the handles on the sides of a smaller, handheld accordion. The dots are the chain, keeping the folds tightly closed.
[10:22:49] tobiasvl: Normally, only two dots are used. If a third dot ...
[10:22:52] tobiasvl: ... is used, the last value in the range is excluded. When you see that third dot, imagine opening the accordion slightly. Just enough to let one note from its chamber. The note is that end value. We’ll let the sky eat it."
[10:29:30] ur5us: has joined #ruby
[10:38:27] ldnunes: has joined #ruby
[10:46:40] kliq: has joined #ruby
[10:51:38] Technodrome: has joined #ruby
[10:58:37] jgt: has joined #ruby
[11:02:07] jphase: has joined #ruby
[11:04:14] kliq: has joined #ruby
[11:06:06] tristanp: has joined #ruby
[11:07:21] Prutheus: has joined #ruby
[11:08:55] Prutheus: Hello. I have following array: ["Dema", "Cdl3BlackCrows", "Acos", "Price ROCR", "Volume ROCR", "24hr Volume"] I want to sort it so, that the first element is "24hr Volume", second is "Volume ROCR", third is "Price ROCR" and the others are sorted by alphabet after these 3
[11:09:01] Prutheus: how to do this?
[11:09:51] rob_: prutheus: Array#sort
[11:10:33] elomatreb: Are the exceptional (non-alphabetic) elements static or dynamic in some way?
[11:13:20] Prutheus: rob_: yes but i don't know how to use it
[11:13:24] Prutheus: elomatreb: what do you mean?
[11:14:29] elomatreb: Are the the elements always "24hr Volume", "Volume ROCR", etc., or do they change? Because if they are static you can just remove them from the array before sorting, then add them back to the front again
[11:15:18] Prutheus: yes okay that would be a possible solution, but i thought i can write a custom sort function (block) which can handle that?
[11:15:23] Prutheus: yes, they are static
[11:16:20] elomatreb: You *can*, but it's probably cleaner (more obvious) the way I described
[11:17:01] Prutheus: elomatreb: ok, but could you laos show me a possible sorting block? just for interest
[11:17:03] elomatreb: Because that's what you're doing - You sort the array alphabetically, but also want some elements breaking that ordering
[11:18:41] bha1: has joined #ruby
[11:19:09] apparition: has joined #ruby
[11:19:52] bha1: Hi. I have a list called dates, which has multiple dates some of which may be duplicate. I was a sorted unique list. Which is more efficient? `dates.uniq.sort` or `dates.sort.uniq` ?
[11:22:24] matthewd: bha1: You could measure it, but I'd expect the first one
[11:25:26] alfiemax: has joined #ruby
[11:34:32] sepp2k: has joined #ruby
[11:37:02] raynold: has joined #ruby
[11:37:42] cdg: has joined #ruby
[11:44:49] alibby: has joined #ruby
[11:45:01] alibby: has left #ruby: ()
[11:47:21] kliq: has joined #ruby
[11:49:48] tcopeland: has joined #ruby
[11:58:43] InfinityFye: has joined #ruby
[11:59:17] shinnya: has joined #ruby
[11:59:20] dupondje: has joined #ruby
[11:59:49] dupondje: https://rubygems.org/gems/activesupport/versions/3.2.22.5 => Then I try to install => gem install activesupport -v=3.2.22.5 => concurrent-ruby requires Ruby version >= 1.9.3.
[12:00:00] kassav_: has joined #ruby
[12:00:00] dupondje: but why does it try to install concurrent-ruby? its not listed as dependency there?
[12:00:04] synthroid: has joined #ruby
[12:00:12] fullstack: has joined #ruby
[12:00:15] alfiemax: has joined #ruby
[12:02:23] simmaniac: has joined #ruby
[12:04:52] Qiong``: has joined #ruby
[12:06:54] dupondje: # gem dependency activesupport -v=3.2.22.5
[12:06:56] dupondje: Gem activesupport-3.2.22.5
[12:06:58] dupondje: i18n (~> 0.6, >= 0.6.4, runtime)
[12:07:00] dupondje: multi_json (~> 1.0, runtime)
[12:07:21] dupondje: and i18n (0.6.11) & multi_json (1.12.2) are installed. So it should just install no?
[12:07:21] fullstack: has joined #ruby
[12:08:47] matthewd: dupondje: I recall seeing something weird about a concurrent-ruby dep appearing unexpectedly before
[12:09:43] matthewd: dupondje: Are you using the latest rubygems? (And are you using bundler?)
[12:10:41] dupondje: rubygems-1.3.7-5.el6.noarch => centos 6 rubygems :)
[12:10:45] veeti: has joined #ruby
[12:11:13] charliesome: has joined #ruby
[12:11:46] matthewd: I'd try bundler for a little more explicit control
[12:17:26] encounter_ekamba: has joined #ruby
[12:18:32] Megamos: has joined #ruby
[12:19:17] ramfjord: has joined #ruby
[12:19:57] someuser_: has joined #ruby
[12:20:37] Emmanuel_Chanel: has joined #ruby
[12:23:09] ShalokShalom_: has joined #ruby
[12:24:23] bha11: has joined #ruby
[12:32:18] bha11: has left #ruby: ()
[12:36:36] Technodrome: has joined #ruby
[12:37:14] Macaveli: has joined #ruby
[12:37:55] Bish: there should be a shortcut for .select { |x| x[:shortcut] }
[12:48:09] matthewd: Bish: There is in Rails :)
[12:57:50] nowhere_man: has joined #ruby
[12:58:29] jphase: has joined #ruby
[12:59:04] john__: has joined #ruby
[13:00:37] Bish: mahlon: how does that look?
[13:00:39] Macaveli: has joined #ruby
[13:00:40] dminuoso: Bish: It's trivial if you just make a lens helper function.
[13:00:58] Bish: that word i only hard in haskell
[13:01:18] dminuoso: Bish: def at(sym); -> (e) { e[sym] }; end; .select(&at(:shortcut))
[13:01:24] Macaveli: has joined #ruby
[13:02:30] Bish: that'd be a lens?
[13:02:39] dminuoso: Bish: at creates a lens, yes.
[13:02:50] dminuoso: Not in the real haskell sense, but its close enough
[13:02:50] Bish: i mean is is the same thing as the haskelleers talk about?
[13:02:55] dminuoso: Bish: Conceptually, yes.
[13:02:58] Bish: thought i grasp it
[13:03:06] Bish: well thats easy.
[13:03:13] Bish: but i was rather searching for something like
[13:03:19] Bish: &:h_shortcut
[13:03:25] Bish: i know.. that is ambigious
[13:03:30] dminuoso: Bish: that also constructs a lens so-to-speak :)
[13:03:38] encounter_ekamba: has joined #ruby
[13:03:44] Bish: but maybe &&:shortcut, &?:shortcut
[13:03:45] dminuoso: It's equivalent to Ramda's R.prop('h_shortcut')
[13:03:55] Bish: the fuck is ramda
[13:04:53] milardovich: has joined #ruby
[13:05:33] dminuoso: Bish: A few days ago I came up with this concept: class Integer; def to_proc() ->(e) { e[self] }; end; end
[13:06:21] Bish: [1,2,3].instance_eval(&1)
[13:06:24] Bish: :D or what
[13:06:52] dminuoso: >> class Integer; def to_proc() ->(e) { e[self] }; end; end; [[1,2],[3,4],[5,6]].map(&0)
[13:06:54] ruby[bot]: dminuoso: # => [1, 3, 5] (https://eval.in/881627)
[13:07:01] Psybur: has joined #ruby
[13:07:02] dminuoso: Bish: The reason it's sexy is when you define Proc#* as function composition, you can do something like &0 * &:foo
[13:07:05] Bish: hilarious
[13:07:59] Bish: how would &0 * &:foo look like
[13:08:25] dminuoso: Bish: thing when you want to conceptualize the access pattern as a function: obj.foo[0]
[13:08:36] dminuoso: or perhaps obj.foo.bar[0]
[13:08:49] dminuoso: then it becomes &0 * &:bar * &:foo
[13:09:14] Bish: i should become a haskell monk
[13:09:36] encounter_ekamba: has joined #ruby
[13:11:54] dminuoso: Bish: A lens combines a reader *and* a writer function into a composable object.
[13:12:20] cdg: has joined #ruby
[13:12:40] dminuoso: Though it's part of a more general concept called optics
[13:13:07] mson: has joined #ruby
[13:15:45] alnewkirk: has joined #ruby
[13:16:39] GodFather: has joined #ruby
[13:20:45] zehbax: has joined #ruby
[13:20:58] dminuoso: Bish: https://eval.in/881640
[13:21:11] dminuoso: It's really simple :)
[13:22:07] skotchpine: has joined #ruby
[13:23:46] Bish: yeah i understand that.. but those are justs shortcuts
[13:23:51] Bish: didnt you say something about writing?
[13:23:59] Bish: ahh, wait i get it... what.
[13:24:05] Bish: thats cool.
[13:24:20] Bish: you get a language that way, kinda.
[13:25:11] matthewd: Bish: The Rails method is .pluck(:shortcut)
[13:25:22] Bish: .. horrible name
[13:26:40] dminuoso: Bish: The language you are referring to is called "functional programming" :-)
[13:27:05] skotchpine: has joined #ruby
[13:27:46] Bish: well, yes i know that, but this particular case of using * "overloading"
[13:27:49] Bish: for that gives u ruby. kinda.
[13:27:57] Bish: gives u a language * in ruby
[13:28:07] Bish: would be super useful when having the user define stuff
[13:28:18] dminuoso: Bish: One of the most fundamental building blocks of functional programming is composing two functions.
[13:28:38] Bish: when starting my current project, i was scared of "letting the user program"
[13:28:42] Bish: horrified*
[13:28:54] simmaniac: has joined #ruby
[13:28:57] Bish: now i did it several times.. its still terrifying but somehow works
[13:29:10] Bish: dminuoso: i read alot about functional programming, wish i had the brain capacity
[13:29:12] dminuoso: Bish: In Mathematics you denote this as f ∘ g, in haskell you write f . g
[13:29:20] dminuoso: So it's just logical to find a way to do this as short and concise in Ruby.
[13:29:31] Bish: ? wouldnt you just write
[13:29:40] DLSteve: has joined #ruby
[13:29:47] dminuoso: No that's something else, that's applying c to the function b.
[13:29:55] Bish: oh, really?
[13:29:59] dminuoso: composition is constructing a chain of functions, where the output of one is piped to the next.
[13:30:01] Bish: whats the differene?
[13:30:22] Bish: guessing . is just a infix function chaining them?
[13:30:27] dminuoso: Yes precisely.
[13:30:30] Bish: so i could do the same with parenthesis?
[13:30:48] dminuoso: The point is you construct a new function that is not yet called.
[13:31:04] dminuoso: i.e.: def compose(a, b); ->(*args) { a(b(*args)) }
[13:31:08] Bish: yeah i get it, but thats true for everything in haskell
[13:31:09] dminuoso: i.e.: def compose(a, b); ->(*args) { a(b(*args)) }; end
[13:31:29] Bish: hm, thats what i meant whent alking about the brain capacity
[13:31:30] dminuoso: Bish: the point is to construct a new function from two functions.
[13:31:38] Bish: i understand what youre saying.. i dont grasp it completely
[13:31:58] Bish: i mean, i know about functors, which implies having function as parameters
[13:32:10] dminuoso: Not really :P
[13:32:29] dminuoso: Accepting functions as parameters is called higher order functions.
[13:32:39] dminuoso: Functors are.. well anything where .map makes sense on.
[13:32:41] Bish: well.. functors always need those, dont they?
[13:32:49] Bish: ahh, i see.
[13:32:53] rfoust: has joined #ruby
[13:32:55] Bish: i remember map being the functor
[13:33:07] dminuoso: Bish: Well it's rather the type + map
[13:33:13] Genya: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[13:33:13] dminuoso: those two are a functor.
[13:33:17] dminuoso: it's a pair :)
[13:33:25] dminuoso: So Array + map is a functor.
[13:33:28] charliesome: has joined #ruby
[13:33:39] dminuoso: Or (Tree, map)
[13:34:47] Bish: reverse . sort is equivalent to \x -> reverse (sort x)
[13:34:54] Bish: isn't that what i meant?
[13:34:54] dminuoso: Yes precisely.
[13:35:02] Bish: with parenthesis
[13:35:07] duckpuppy: has joined #ruby
[13:35:16] dminuoso: Bish: If that's what you meant then nevermind.
[13:35:27] dminuoso: Bish: But you also need that lambda surrounding it :)
[13:35:28] Bish: cool!, so there is no difference
[13:35:37] Bish: that lambda is -> ?
[13:35:50] dminuoso: is equivalent to rubys: -> (x) { ... }
[13:35:51] Bish: what does it do in haskell?
[13:35:56] Bish: just anonymous function?
[13:36:09] Bish: so no difference at all, it just doesnt have a name?
[13:36:22] Bish: for what do i need it for ?
[13:36:26] Bish: in that case
[13:36:39] dminuoso: Bish: The idea is to not call a function.
[13:36:49] bmurt: has joined #ruby
[13:36:57] Bish: well, do functions ever get called in functional languages?
[13:37:08] Bish: i mean.. arent they all evaluated like a huge ass cascade
[13:37:20] Bish: if they language is completely pure.. there is only that option..
[13:37:23] dminuoso: Bish: https://gist.github.com/anonymous/317d55b30f25e7258baddf3978f41b54
[13:37:32] dminuoso: The point is to construct a new function from other functions.
[13:37:46] dminuoso: By chaining them together. But chaining does not invoke them.
[13:38:01] Bish: i understand that
[13:38:05] Bish: but i dont understand why
[13:38:12] Bish: f x = g h x
[13:38:14] Bish: doesnt do that
[13:38:19] dminuoso: Bish: Yes it does that exactly.
[13:38:37] Bish: but f = g h
[13:38:42] dminuoso: f x = g h x ≡ f = \x -> g h x
[13:38:43] Bish: because it would just give h to g
[13:39:36] dminuoso: Bish: f x = ... is syntax sugar for: f = \x -> ...
[13:39:51] dminuoso: well its a bit more actually, since it also allows you to do things like pattern matching
[13:40:33] Bish: i started to read a haskell book, thats why i know the syntax
[13:40:40] Bish: f y = ... had pattern matching too
[13:40:43] Bish: if i remember correclty?
[13:41:01] dminuoso: sure if you do: f (x:xs) = ... for example
[13:41:04] sunrunner20: has joined #ruby
[13:41:25] dminuoso: Bish: at any rate, the concept of composing functions is the same that you write methods in imperative ruby style.
[13:41:45] dminuoso: Bish: it encapsulates the notion that when you have: "first to a. then b. then c" you can put that whole thing into a single function.
[13:42:14] ramfjord: has joined #ruby
[13:42:17] Bish: yeh i get it, my problems of understanding lie deeper ^^
[13:42:41] skotchpine: has joined #ruby
[13:43:35] dminuoso: It doesn't require you to become a haskell expert though. If you are comfortable with JavaScript, you can use this to study functional programming too.
[13:44:15] dminuoso: After a while you may even notice that Ruby has lots of these ideas incorporated in not-immediately-obvious ways.
[13:46:14] dnoda: has joined #ruby
[13:46:45] dminuoso: Enumerable is packed with pure functional ideas for example. :)
[13:46:45] fmcgeough: has joined #ruby
[13:47:00] jrafanie: has joined #ruby
[13:47:08] encounter_ekamba: has joined #ruby
[13:47:40] Sylario: has joined #ruby
[13:47:52] dnoda: has left #ruby: ()
[13:48:56] ShekharReddy: has joined #ruby
[13:52:59] dnoda: has joined #ruby
[13:53:15] kobain: has joined #ruby
[13:53:20] jinie: has joined #ruby
[13:54:46] burgestrand: has joined #ruby
[13:59:11] alfiemax_: has joined #ruby
[14:01:43] jamesaxl: has joined #ruby
[14:03:52] polishdub: has joined #ruby
[14:04:14] sysvalve: has joined #ruby
[14:05:18] phate408: has joined #ruby
[14:06:24] bmurt: has joined #ruby
[14:11:54] jrafanie: has joined #ruby
[14:14:09] bmurt: has joined #ruby
[14:16:09] jrheaton: has joined #ruby
[14:21:20] ResidentBiscuit: has joined #ruby
[14:21:40] Rapture: has joined #ruby
[14:21:45] ResidentBiscuit: has joined #ruby
[14:22:28] __Yiota: has joined #ruby
[14:24:00] workmad3: has joined #ruby
[14:27:45] Technodrome: has joined #ruby
[14:27:54] tristanp: has joined #ruby
[14:29:53] Bish: dminuoso: i get that, but pure functional ideas wont let you have the full spectrum on what is cool about that
[14:30:05] Bish: starting with fukin STM
[14:30:10] Bish: i would kill to have something like that
[14:30:14] Bish: or even HTM that is
[14:30:33] Bish: well technicially htm could bring stm-like features everyhwere.. not sure though
[14:30:54] dc3: has joined #ruby
[14:31:18] jrheaton: has joined #ruby
[14:35:18] bmurt: has joined #ruby
[14:39:52] eaxxae: has joined #ruby
[14:43:46] alfiemax: has joined #ruby
[14:45:46] mtkd: has joined #ruby
[14:51:01] renfri: has joined #ruby
[14:54:43] fumk: has joined #ruby
[14:58:39] cdg: has joined #ruby
[14:58:51] TheDracle: has joined #ruby
[15:00:22] gusrub: has joined #ruby
[15:03:58] Macaveli: has joined #ruby
[15:04:27] guacamole: has joined #ruby
[15:09:30] bruno-: has joined #ruby
[15:20:06] elcontrastador: has joined #ruby
[15:20:24] gizmore: has joined #ruby
[15:22:22] d10n-work: has joined #ruby
[15:23:06] dminuoso: Bish: Lack of side effects lets you reason about code much more strongly. In fact the notion that values can "change" ("mutability") is generally poor.
[15:23:38] dminuoso: Bish: I realized this the first time I tried to debug a bison generated parser (which is basically a big huge freaking state machine).
[15:23:58] dminuoso: Writing or debugging handcrafted recursive descent parsers is a different thing entirely.
[15:24:06] Qiong```: has joined #ruby
[15:26:18] orbyt_: has joined #ruby
[15:27:27] dinfuehr: has joined #ruby
[15:27:28] cagomez: has joined #ruby
[15:34:59] jobewan: has joined #ruby
[15:36:07] synthroid: has joined #ruby
[15:39:18] TheDracle: has joined #ruby
[15:43:58] alfiemax: has joined #ruby
[15:50:33] uZiel: has joined #ruby
[15:52:09] dionysus69: has joined #ruby
[16:01:42] mim1k: has joined #ruby
[16:01:59] Cohedrin_: has joined #ruby
[16:02:27] Junaos: has joined #ruby
[16:03:33] tolerablyjake: has joined #ruby
[16:12:07] veeti: has joined #ruby
[16:12:46] guacamole: has joined #ruby
[16:12:51] TomyLobo2: has joined #ruby
[16:16:02] jaruga: has joined #ruby
[16:17:51] s2013: has joined #ruby
[16:18:18] cschneid_: has joined #ruby
[16:21:32] shinnya: has joined #ruby
[16:24:38] workmad3: has joined #ruby
[16:25:21] lacour: has joined #ruby
[16:34:47] guacamole: has joined #ruby
[16:40:02] chouhoulis: has joined #ruby
[16:40:49] arup_r: has joined #ruby
[16:41:00] chouhoul_: has joined #ruby
[16:41:04] arup_r: Any idea why am I am getting syntax error https://gist.github.com/aruprakshit/acebb9e1c81cb5bc74e15fa27db7c9fb ? I am on 2.4.2
[16:42:11] chouhoul_: has joined #ruby
[16:43:11] chouhoul_: has joined #ruby
[16:43:24] tbuehlmann: why's there a space in `playlist_items_list_by_playlist_id (`?
[16:44:12] chouhoul_: has joined #ruby
[16:44:32] swills: has joined #ruby
[16:45:15] skotchpine: looks like a syntax error
[16:45:23] chouhoulis: has joined #ruby
[16:45:27] swills_: has joined #ruby
[16:46:26] chouhoul_: has joined #ruby
[16:47:27] veeti: has joined #ruby
[16:47:32] chouhoul_: has joined #ruby
[16:47:52] [Butch]: has joined #ruby
[16:48:36] chouhoul_: has joined #ruby
[16:49:12] arup_r: thanks. that is it. Eye was not able to catch that.. so needed another pairs of eyes :D
[16:49:41] chouhoul_: has joined #ruby
[16:50:24] __Yiota: has joined #ruby
[16:50:51] chouhoulis: has joined #ruby
[16:51:53] chouhoul_: has joined #ruby
[16:52:06] ltem: has joined #ruby
[16:53:04] chouhoul_: has joined #ruby
[16:54:11] chouhoul_: has joined #ruby
[16:55:14] chouhoul_: has joined #ruby
[16:56:23] chouhoulis: has joined #ruby
[16:57:04] nikivi: has joined #ruby
[16:57:27] chouhoul_: has joined #ruby
[16:58:28] chouhoul_: has joined #ruby
[16:59:34] chouhoul_: has joined #ruby
[17:00:39] chouhoul_: has joined #ruby
[17:00:47] selim: has joined #ruby
[17:01:42] chouhoulis: has joined #ruby
[17:02:31] dc3: has joined #ruby
[17:02:49] chouhoul_: has joined #ruby
[17:03:56] chouhoul_: has joined #ruby
[17:05:07] chouhoul_: has joined #ruby
[17:06:09] chouhoul_: has joined #ruby
[17:07:15] chouhoulis: has joined #ruby
[17:08:17] chouhoul_: has joined #ruby
[17:09:22] chouhoul_: has joined #ruby
[17:10:29] chouhoul_: has joined #ruby
[17:11:03] guacamole: has joined #ruby
[17:11:40] chouhoulis: has joined #ruby
[17:12:40] chouhoul_: has joined #ruby
[17:13:27] code_zombie: has joined #ruby
[17:13:45] chouhoul_: has joined #ruby
[17:14:51] chouhoul_: has joined #ruby
[17:15:14] goyox86: has joined #ruby
[17:15:59] chouhoul_: has joined #ruby
[17:16:31] chouhoulis: has joined #ruby
[17:16:39] ta: has joined #ruby
[17:20:17] hahuang65: has joined #ruby
[17:20:51] synthroid: has joined #ruby
[17:23:28] mjuszczak: has joined #ruby
[17:26:04] jamesaxl: has joined #ruby
[17:27:55] jrheaton: has joined #ruby
[17:29:16] alfiemax: has joined #ruby
[17:29:37] jrafanie: has joined #ruby
[17:31:02] xuanrui: has joined #ruby
[17:31:32] ldnunes: has joined #ruby
[17:32:35] imode: has joined #ruby
[17:34:47] jphase: has joined #ruby
[17:34:47] ivanskie: has joined #ruby
[17:39:01] Psybur: has joined #ruby
[17:41:37] kies: has joined #ruby
[17:44:35] Macaveli: has joined #ruby
[17:45:49] guacamole: has joined #ruby
[17:45:58] cagomez: has joined #ruby
[17:47:32] uZiel: has joined #ruby
[17:48:41] goyox86: has joined #ruby
[17:49:14] weaksauce: has joined #ruby
[17:52:04] Cohedrin_: has joined #ruby
[17:59:28] claudiuinberlin: has joined #ruby
[18:01:26] snath: has joined #ruby
[18:01:47] snath: has left #ruby: ()
[18:02:20] skre: has joined #ruby
[18:03:11] ForeignBiscuit: has joined #ruby
[18:03:38] bmurt: has joined #ruby
[18:05:14] mostlybadfly: has joined #ruby
[18:05:33] Technodrome: has joined #ruby
[18:06:35] JR042444__: has joined #ruby
[18:07:29] enterprisey: has joined #ruby
[18:08:51] veeti: has joined #ruby
[18:08:58] uZiel: has joined #ruby
[18:09:30] tolerablyjake: has joined #ruby
[18:11:34] ForeignBiscuit: has joined #ruby
[18:13:21] ResidentBiscuit: has joined #ruby
[18:13:59] Puffball_: has joined #ruby
[18:17:40] DTZUZU2: has joined #ruby
[18:17:43] ramfjord: has joined #ruby
[18:18:33] claudiuinberlin: has joined #ruby
[18:18:43] __Yiota: has joined #ruby
[18:21:50] SeepingN: has joined #ruby
[18:23:19] Technodrome: has joined #ruby
[18:25:23] workmad3: has joined #ruby
[18:30:03] ur5us: has joined #ruby
[18:30:31] chouhoul_: has joined #ruby
[18:30:48] Joufflu: has joined #ruby
[18:33:20] rabajaj: has joined #ruby
[18:33:23] mjuszczak: has joined #ruby
[18:34:18] mjuszczak: has joined #ruby
[18:35:26] synthroid: has joined #ruby
[18:36:00] __Yiota: has joined #ruby
[18:41:01] LoRez: has joined #ruby
[18:41:20] guacamole: has joined #ruby
[18:44:16] Guest97372: has joined #ruby
[18:46:16] goyox86: has joined #ruby
[18:47:18] SegFaultAX: has joined #ruby
[18:54:18] TheDracle: has joined #ruby
[18:55:34] Technodrome: has joined #ruby
[18:56:34] 3NAABQA8W: has joined #ruby
[18:57:04] ta: has joined #ruby
[18:57:49] Dimik: has joined #ruby
[19:04:16] cagomez: has joined #ruby
[19:05:26] ResidentBiscuit: has joined #ruby
[19:05:36] cliq: has joined #ruby
[19:06:40] claudiuinberlin: has joined #ruby
[19:07:39] _sfiguser: has joined #ruby
[19:08:40] ramfjord: has joined #ruby
[19:08:53] nopolitica: has joined #ruby
[19:09:25] kliq: has joined #ruby
[19:09:32] conta: has joined #ruby
[19:16:01] ta: has joined #ruby
[19:16:23] marxarelli: has joined #ruby
[19:16:26] jenrzzz: has joined #ruby
[19:16:26] jenrzzz: has joined #ruby
[19:19:25] ta: has joined #ruby
[19:22:03] guacamole: has joined #ruby
[19:22:31] ltem: has joined #ruby
[19:22:43] blackmesa: has joined #ruby
[19:23:00] chouhoulis: has joined #ruby
[19:23:41] swirlsMD: has joined #ruby
[19:24:12] swirlsMD: Howdy folks, wondering if anyone had some tricks / tips on how to supress output while running Rake?
[19:24:58] havenwood: swirlsMD: redirect output to /dev/null
[19:25:38] swirlsMD: havenwood: Not a bad thought, will that work for when Rake outputs its commands?
[19:25:43] havenwood: swirlsMD: or `$stdout` and `$stderr` to /dev/null
[19:25:56] swirlsMD: havenwood: trying to prevent some creds from getting posted
[19:26:44] havenwood: swirlsMD: for example, try: rails -h > /dev/null 2>&1
[19:26:59] swirlsMD: havenwood: Will do, thanks!
[19:27:09] ur5us: has joined #ruby
[19:27:27] jrheaton: has joined #ruby
[19:28:25] claudiuinberlin: has joined #ruby
[19:31:28] swirlsMD: havenwood: How about when using 'sh' in the rakefile itself? Or should I just avoid using 'sh'
[19:32:20] havenwood: swirlsMD: Here's an example of redirecting stdout to /dev/null then back again to what it was:
[19:32:23] havenwood: dev_null = File.open File::NULL, 'w'; $stdout = dev_null; puts 'hi'; $stdout = STDOUT; dev_null.close
[19:32:45] cschneid_: has joined #ruby
[19:33:10] gix: has joined #ruby
[19:33:17] swirlsMD: havenwood: cooool, much thanks
[19:33:18] havenwood: swirlsMD: i'm not sure i follow about sh
[19:33:29] matthewd: You should probably avoid using 'sh' in a way that reveals secrets, at least
[19:33:31] GodFather: has joined #ruby
[19:34:06] matthewd: Because that implies said secrets are also visible as parameters to the subprocess while it's running
[19:34:25] swirlsMD: havenwood: Agree, found a stack post about using sh for shelling out in a rake. We're doing weird stuff
[19:34:41] swirlsMD: matthewd: Totally agree, trying to keep them out
[19:35:34] swirlsMD: I guess the question should be, what is best practice for shelling out when using rake?
[19:35:40] jamesaxl: has joined #ruby
[19:35:40] ramfjord: has joined #ruby
[19:36:01] matthewd: We might be able to help more if you shift up a layer, and describe what you're trying to do at a higher level
[19:36:23] swirlsMD: Certainly, its kind of muddy, so don't judge too harshly.
[19:36:30] matthewd: The best practice to run shell commands from rake is to use the #sh helper; that's what it's there for. But it sounds like you have some other constraints.
[19:36:40] swirlsMD: Working with another team on a build pipeline. They've standardized on using make or rake files to run tasks
[19:36:42] swirlsMD: We opted for rake
[19:36:53] swirlsMD: Some of the tasks we need to run are around docker or terraform
[19:37:01] swirlsMD: Of which, a few of those needs creds
[19:37:26] swirlsMD: Trying to come up with a way to essentially have rake run a terraform plan/apply (which needs AWS creds)
[19:37:36] swirlsMD: Hence the "trying supress output question"
[19:37:46] bmurt: has joined #ruby
[19:38:05] swirlsMD: has joined #ruby
[19:38:20] swirlsMD: and back, thanks computer.
[19:38:22] matthewd: Can you pass them via environment variables instead?
[19:38:34] swirlsMD: Potentially, its a bit of a debate on that front
[19:39:04] swirlsMD: Ultimately we will use Vault to handle the creds, but currently thats not ready, we are trying to work around it
[19:39:22] matthewd: Putting secrets in command line arguments is generally a bad idea, regardless of whether the command is being logged by rake
[19:40:24] jenrzzz: has joined #ruby
[19:40:24] jenrzzz: has joined #ruby
[19:40:28] matthewd: But I guess it depends on your threat model -- if you're *only* concerned about shoulder-surfing, and you trust that no-one will run `ps` while this command is executing, then maybe you're okay
[19:41:48] ledestin: has joined #ruby
[19:41:53] swirlsMD: matthewd: good points, since were iterating, first part is keeping out of output (since that gets logged somewhere...) Ideally we will have a better solution for this
[19:42:02] swirlsMD: Appreciate the responses, very helpful
[19:44:10] matthewd: At a glance, it sounds like you can `sh('your', 'command', 'here', verbose: false)`
[19:45:06] postmodern: has joined #ruby
[19:46:19] mson: has joined #ruby
[19:47:18] hahuang65: has joined #ruby
[19:47:41] goyox86: has joined #ruby
[19:49:58] jgt: has joined #ruby
[19:53:31] cschneid_: has joined #ruby
[19:53:31] nowhere_man: has joined #ruby
[19:55:41] ramfjord: has joined #ruby
[19:58:00] imode: has joined #ruby
[19:58:47] goyox86: has joined #ruby
[19:59:41] eckhardt: has joined #ruby
[20:01:02] gr33n7007h: has joined #ruby
[20:02:13] gusrub: has joined #ruby
[20:02:51] goyox86: has joined #ruby
[20:03:30] charliesome: has joined #ruby
[20:05:30] zacts: if I author a ruby gem, what license is conventional for it?
[20:05:33] cschneid_: has joined #ruby
[20:05:39] zacts: 'same terms as ruby' or something like that?
[20:05:46] rob_: has left #ruby: ()
[20:05:55] PaulCapestany: has joined #ruby
[20:07:41] ramfjord: has joined #ruby
[20:08:11] matthewd: I think `bundle gem` suggests it, actually
[20:08:16] zacts: ok, thanks :-)
[20:08:39] oded: has joined #ruby
[20:11:28] cdg: has joined #ruby
[20:11:37] ahrs: has joined #ruby
[20:13:03] cdg_: has joined #ruby
[20:13:42] bperry_: has joined #ruby
[20:14:16] bperry_: hi, i'm looking for an equivalent ruby class (probably in the openssl wrapper) for this RSAPublicNumbers class from the python code
[20:14:19] bperry_: https://github.com/jpf/okta-jwks-to-pem/blob/master/jwks_to_pem.py#L43
[20:14:42] bperry_: I am being given a modulus and an exponent for a public key in a non-standard way
[20:15:06] bperry_: I would like to use the OpenSSL::PKey:RSA class but it only accepts PEM/DER format certs
[20:15:31] bperry_: I know the two numbers that make up the public key though
[20:16:47] s2013: has joined #ruby
[20:18:53] swirlsMD: has joined #ruby
[20:18:55] bperry_: it's a stupid problem that I get the two numbers in a non-standard format instead of a regular cert but I have zero power over that :/
[20:20:46] bperry_: https://stackoverflow.com/questions/46121275/ruby-rsa-from-exponent-and-modulus-strings
[20:21:18] ramfjord: has joined #ruby
[20:26:09] workmad3: has joined #ruby
[20:26:41] goyox86: has joined #ruby
[20:27:43] murosai: has joined #ruby
[20:28:38] murosai: how can i iterate over the fields of a dictionary in the same order they were specified in code?
[20:29:09] elomatreb: If by dictionary you mean hash you can just use each, Ruby hashes are enumerated in the order the keys were inserted
[20:29:40] cagomez: has joined #ruby
[20:30:55] charliesome_: has joined #ruby
[20:32:22] bmurt: has joined #ruby
[20:33:06] charliesome: has joined #ruby
[20:33:11] murosai: what i actually want to do is add the values of the hash separated by '+' sign, like hash[:key1] '+' + hash[:key2], i suspect there is more elegant way to do this
[20:33:48] murosai: like string.join(hash.values(), '+') or something
[20:34:02] matthewd: Yeah; hash.values.join("+")
[20:36:06] murosai: and values also list values always in same order?
[20:36:15] murosai: order of insertion
[20:40:44] xuanrui: has joined #ruby
[20:46:14] mjuszczak: has joined #ruby
[20:47:07] john__: has joined #ruby
[20:48:32] __Yiota: has joined #ruby
[20:49:56] hahuang65: has joined #ruby
[20:50:42] jenrzzz: has joined #ruby
[20:50:42] jenrzzz: has joined #ruby
[20:52:00] charliesome_: has joined #ruby
[20:53:11] jgt: has joined #ruby
[20:54:25] larcara: has joined #ruby
[20:58:44] lagweezle: Is there an equivalent Ruby-ism to Python's "if thing in collection:" or "if substring in string:" statement/check ?
[21:00:22] Pierreb: has joined #ruby
[21:02:26] jenrzzz: has joined #ruby
[21:02:26] jenrzzz: has joined #ruby
[21:02:57] elomatreb: lagweezle: collection/string.include?(thing)
[21:03:34] lagweezle: Oh. Yeah. Duh. :facepalms: Thank you, elomatreb!
[21:03:39] elomatreb: But you'll often see regex operations for the substring check as well
[21:03:51] Technodrome: has joined #ruby
[21:04:02] RavinduL: has joined #ruby
[21:04:12] lagweezle: Noooow I just have to remember what the hell I was doing that prompted the question. >.<
[21:06:37] bmurt: has joined #ruby
[21:06:58] jamesaxl: has joined #ruby
[21:10:37] RavinduL: has left #ruby: ("KTHXBAI")
[21:13:03] jamesaxl: has joined #ruby
[21:13:31] ozcanesen: has joined #ruby
[21:14:48] dviola: has joined #ruby
[21:15:15] kapil___: has joined #ruby
[21:15:22] mtkd: has joined #ruby
[21:16:10] whippythellama: has joined #ruby
[21:16:46] guacamole: has joined #ruby
[21:23:16] Immune: has joined #ruby
[21:23:33] ta: has joined #ruby
[21:24:00] jamesaxl: has joined #ruby
[21:27:08] FrostCandy: has joined #ruby
[21:27:59] ta: has joined #ruby
[21:30:09] nofxx: has joined #ruby
[21:32:56] sepp2k: has joined #ruby
[21:33:57] mim1k: has joined #ruby
[21:36:09] kus_ubuntui686: has joined #ruby
[21:39:02] xuanrui: has joined #ruby
[21:39:09] swirlsMD: has joined #ruby
[21:40:27] nopolitica: has joined #ruby
[21:42:08] Rapture: has joined #ruby
[21:43:16] chopin: has joined #ruby
[21:43:36] jamesaxl: has joined #ruby
[21:44:30] ozcanesen: has joined #ruby
[21:48:07] badrsahla: has joined #ruby
[21:54:53] ramfjord: has joined #ruby
[21:55:36] rhyselsmore: has joined #ruby
[21:55:48] serhart: has joined #ruby
[22:00:37] minimalism: has joined #ruby
[22:02:33] baweaver: Why is it that Array doesn't have a === defined? Array#include? makes sense.
[22:04:28] serhart: has joined #ruby
[22:05:57] goyox86_: has joined #ruby
[22:05:58] orbyt_: has joined #ruby
[22:06:04] elomatreb: You can sort of get that in case statements by splatting an array, fwiw
[22:11:28] badrsahla: has joined #ruby
[22:12:42] jphase: has joined #ruby
[22:13:07] cagomez: If I want to execute a lambda or proc inside a method, does it matter which I use if I won't use `return`?
[22:17:14] serhart: has joined #ruby
[22:22:10] hahuang65: has joined #ruby
[22:23:51] mjuszczak: has joined #ruby
[22:25:32] whippythellama: has joined #ruby
[22:25:36] mjuszczak: has joined #ruby
[22:26:45] workmad3: has joined #ruby
[22:37:09] havenwood: cagomez: lambda has strict arity with it's arguments, you have to pass the number of arguments that it expects
[22:37:23] havenwood: proc will let you just do it wrong and proceed
[22:37:43] havenwood: *most* lambdas have strict arity, I should say
[22:37:49] ramfjord: has joined #ruby
[22:38:21] Hien: has joined #ruby
[22:38:43] swirlsMD: has joined #ruby
[22:38:44] bperry_: has left #ruby: ()
[22:41:07] badrsahla: has joined #ruby
[22:43:29] havenwood: and a proc can have strict arity: https://bugs.ruby-lang.org/issues/12671
[22:43:39] ramfjord: has joined #ruby
[22:45:37] havenwood: I guess it's much easier to make a proc that checks its arguments than a lambda that doesn't.
[22:46:06] havenwood: cagmz_: But no, it doesn't really matter.
[22:46:53] havenwood: Since lambdas are stricter with arguments by default and don't have block-absorbing magic, I typically use them.
[22:47:25] tcopeland: has joined #ruby
[22:50:29] zehbax: has joined #ruby
[22:54:00] guacamole: has joined #ruby
[22:55:27] cagomez: has joined #ruby
[22:58:50] hahuang65: has joined #ruby
[22:59:14] postmodern: has joined #ruby
[23:02:21] jphase: has joined #ruby
[23:03:58] zapata: has joined #ruby
[23:04:05] badrsahla: has joined #ruby
[23:05:31] thinkpad: has joined #ruby
[23:05:48] cdg: has joined #ruby
[23:06:23] AndBobsYourUncle: has joined #ruby
[23:09:14] postmodern: has joined #ruby
[23:09:38] Technodrome: has joined #ruby
[23:11:44] Megamos: has joined #ruby
[23:12:02] cagomez: havenwood: can I pass a function around like so: Proc.new { myFunc } and pass it different variables in other classes?
[23:20:13] badrsahla: has joined #ruby
[23:26:24] badrsahla: has joined #ruby
[23:26:33] jgt: has joined #ruby
[23:26:43] cschneid_: has joined #ruby
[23:34:29] mim1k: has joined #ruby
[23:36:55] dkam: has joined #ruby
[23:37:13] basket: has joined #ruby
[23:38:18] dkam: I'm trying to Marshal.load some data - but I get an error: TypeError: incompatible marshal file format (can't be read) ; format version 4.8 required; 99.111 given.
[23:39:05] dkam: That's from the same system that created the dump
[23:40:15] shinnya: has joined #ruby
[23:40:24] dkam: has joined #ruby
[23:41:59] techn1cs: has joined #ruby
[23:43:04] jinie: has joined #ruby
[23:44:40] ramfjord: has joined #ruby
[23:44:53] Cohedrin_: has joined #ruby
[23:46:16] phlebas_: has joined #ruby
[23:48:09] ghormoon: has joined #ruby
[23:50:32] ramfjord: has joined #ruby
[23:53:19] whippythellama: has joined #ruby
[23:55:52] ramfjord: has joined #ruby