« Back to channel list

#ruby - 25 June 2018

« Back 1 day Forward 1 day »
[00:01:33] jrabe: has joined #ruby
[00:02:20] cschneid: has joined #ruby
[00:04:37] Guest82829: has joined #ruby
[00:10:38] karapetyan: has joined #ruby
[00:14:53] Guest82829: has joined #ruby
[00:20:00] shinnya: has joined #ruby
[00:25:07] Guest82829: has joined #ruby
[00:29:35] workmad3: has joined #ruby
[00:35:18] Guest82829: has joined #ruby
[00:37:11] roamingdog: has joined #ruby
[00:41:33] duderonomy: has joined #ruby
[00:42:41] rivalomega: has joined #ruby
[00:45:21] white_lilies: has joined #ruby
[00:45:27] Guest82829: has joined #ruby
[00:52:06] duderono_: has joined #ruby
[00:54:47] Nicmavr: has joined #ruby
[00:55:46] Guest82829: has joined #ruby
[01:05:57] Guest82829: has joined #ruby
[01:13:19] rivalome_: has joined #ruby
[01:16:11] Guest82829: has joined #ruby
[01:18:59] gizmore: has joined #ruby
[01:22:48] SeepingN: has joined #ruby
[01:26:23] Guest82829: has joined #ruby
[01:31:23] heckler: has joined #ruby
[01:33:28] duderonomy: has joined #ruby
[01:35:59] duderono_: has joined #ruby
[01:36:39] Guest82829: has joined #ruby
[01:46:52] Guest82829: has joined #ruby
[01:56:59] Guest82829: has joined #ruby
[02:07:14] Guest82829: has joined #ruby
[02:09:09] roamingdog: has joined #ruby
[02:12:26] karapetyan: has joined #ruby
[02:16:53] spencer: has joined #ruby
[02:17:30] Guest82829: has joined #ruby
[02:27:41] Guest82829: has joined #ruby
[02:29:52] workmad3: has joined #ruby
[02:38:02] Guest82829: has joined #ruby
[02:40:55] JamJam_kid: has joined #ruby
[02:48:12] Guest82829: has joined #ruby
[02:54:50] Immune: has joined #ruby
[02:55:03] Immune: has left #ruby: ()
[02:58:24] Guest82829: has joined #ruby
[03:00:17] cadillac_: has joined #ruby
[03:04:50] sspreitz: has joined #ruby
[03:08:33] Guest82829: has joined #ruby
[03:11:55] braincrash: has joined #ruby
[03:18:43] cschneid: has joined #ruby
[03:18:51] Guest82829: has joined #ruby
[03:20:18] houhoulis: has joined #ruby
[03:26:01] spencer: has joined #ruby
[03:29:16] Guest82829: has joined #ruby
[03:36:37] mrush: has joined #ruby
[03:38:35] t0xik: has joined #ruby
[03:39:18] Guest82829: has joined #ruby
[03:49:29] Guest82829: has joined #ruby
[03:53:20] raatiniemi: has joined #ruby
[03:54:42] konsolebox: has joined #ruby
[03:59:43] Guest82829: has joined #ruby
[04:05:00] mrush: has left #ruby: ()
[04:09:56] Guest82829: has joined #ruby
[04:15:18] karapetyan: has joined #ruby
[04:20:08] Guest82829: has joined #ruby
[04:22:26] za1b1tsu: has joined #ruby
[04:30:15] workmad3: has joined #ruby
[04:30:25] Guest82829: has joined #ruby
[04:40:37] Guest82829: has joined #ruby
[04:50:54] Guest82829: has joined #ruby
[04:51:57] stairmast0r: has joined #ruby
[04:53:08] solocshaw: has joined #ruby
[05:01:01] Guest82829: has joined #ruby
[05:11:17] Guest82829: has joined #ruby
[05:16:03] gigetoo: has joined #ruby
[05:20:41] nythalcrow: has joined #ruby
[05:21:28] Guest82829: has joined #ruby
[05:22:07] aspiers: has joined #ruby
[05:25:46] nythalcrow: has joined #ruby
[05:31:09] aufi: has joined #ruby
[05:31:43] Guest82829: has joined #ruby
[05:31:57] stairmast0r: has joined #ruby
[05:39:42] venmx: has joined #ruby
[05:40:59] conta: has joined #ruby
[05:41:56] Guest82829: has joined #ruby
[05:52:13] Guest82829: has joined #ruby
[05:52:30] SeepingN: has joined #ruby
[05:56:57] aupadhye: has joined #ruby
[05:57:16] suukim: has joined #ruby
[06:02:26] Guest82829: has joined #ruby
[06:03:20] cschneid: has joined #ruby
[06:03:39] pskosinski: has joined #ruby
[06:05:28] anisha: has joined #ruby
[06:05:30] apeiros: has joined #ruby
[06:06:48] anisha: has joined #ruby
[06:08:40] cschneid: has joined #ruby
[06:08:57] reber: has joined #ruby
[06:12:39] Guest82829: has joined #ruby
[06:15:20] anisha: has joined #ruby
[06:15:28] duderono_: has joined #ruby
[06:15:32] biberu: has joined #ruby
[06:16:11] TinkerT: has joined #ruby
[06:17:01] karapetyan: has joined #ruby
[06:19:25] KramerC: has joined #ruby
[06:22:46] cschneid: has joined #ruby
[06:22:49] Guest82829: has joined #ruby
[06:26:32] za1b1tsu: has joined #ruby
[06:30:31] workmad3: has joined #ruby
[06:33:01] Guest82829: has joined #ruby
[06:36:45] cschneid: has joined #ruby
[06:40:34] schleppel: has joined #ruby
[06:41:45] amar: has joined #ruby
[06:43:15] Guest82829: has joined #ruby
[06:47:23] andikr: has joined #ruby
[06:49:35] stnly4: has joined #ruby
[06:50:24] cschneid: has joined #ruby
[06:51:08] yohji: has joined #ruby
[06:53:32] Guest82829: has joined #ruby
[07:01:23] venmx: has joined #ruby
[07:03:17] sysvalve: has joined #ruby
[07:03:37] Blaguvest: has joined #ruby
[07:03:49] Guest82829: has joined #ruby
[07:04:56] cschneid: has joined #ruby
[07:07:00] burgestrand: has joined #ruby
[07:09:40] venmx: has joined #ruby
[07:10:12] claudiuinberlin: has joined #ruby
[07:13:37] alem0lars: has joined #ruby
[07:13:59] Guest82829: has joined #ruby
[07:17:35] clemens3: has joined #ruby
[07:23:42] cschneid: has joined #ruby
[07:24:29] nythalcrow: has joined #ruby
[07:28:51] Guest82829: has joined #ruby
[07:32:02] tAn: has joined #ruby
[07:33:40] cschneid: has joined #ruby
[07:35:25] p4p0l0: has joined #ruby
[07:35:50] ams__: has joined #ruby
[07:38:20] t0xik: has joined #ruby
[07:39:06] Guest82829: has joined #ruby
[07:40:40] dionysus69: has joined #ruby
[07:40:56] roamingdog: has joined #ruby
[07:41:45] roamingdog: has joined #ruby
[07:42:35] roamingdog: has joined #ruby
[07:43:20] roamingdog: has joined #ruby
[07:43:38] cadillac_: has joined #ruby
[07:44:14] lxsameer: has joined #ruby
[07:52:28] apeiros: has joined #ruby
[07:53:44] ciscam: has joined #ruby
[08:01:44] cschneid: has joined #ruby
[08:03:13] ellcs: has joined #ruby
[08:14:07] vondruch: has joined #ruby
[08:14:44] vondruch: has joined #ruby
[08:15:07] amar: has joined #ruby
[08:17:56] hph^: has joined #ruby
[08:18:20] hph^: has joined #ruby
[08:18:24] karapetyan: has joined #ruby
[08:18:44] hph^: has joined #ruby
[08:19:56] cschneid: has joined #ruby
[08:20:07] nielsk: has joined #ruby
[08:23:14] vondruch: has joined #ruby
[08:24:03] nowhereman_: has joined #ruby
[08:24:30] amar_: has joined #ruby
[08:25:17] ellcs: has joined #ruby
[08:26:26] amar_: has joined #ruby
[08:29:29] jottr_: has joined #ruby
[08:30:51] workmad3: has joined #ruby
[08:34:18] fribmendes: has joined #ruby
[08:34:31] cschneid: has joined #ruby
[08:41:07] KeyJoo: has joined #ruby
[08:47:40] bruce_lee: has joined #ruby
[08:47:40] bruce_lee: has joined #ruby
[08:49:02] vondruch: has joined #ruby
[08:55:41] suukim: has joined #ruby
[08:57:06] guille-moe: has joined #ruby
[08:59:44] wald0: has joined #ruby
[09:01:49] cabotto: has joined #ruby
[09:02:31] cschneid: has joined #ruby
[09:09:56] Beams: has joined #ruby
[09:12:39] beefjoe: has joined #ruby
[09:13:19] kryptoz: has joined #ruby
[09:13:21] ur5us: has joined #ruby
[09:13:32] rivalomega: has joined #ruby
[09:21:10] cschneid: has joined #ruby
[09:21:45] konsolebox: has joined #ruby
[09:21:57] KeyJoo: has joined #ruby
[09:27:14] TomyWork: has joined #ruby
[09:28:29] dionysus69: has joined #ruby
[09:30:39] cschneid: has joined #ruby
[09:32:20] vovs03: has joined #ruby
[09:33:23] tvw: has joined #ruby
[09:44:45] cschneid: has joined #ruby
[09:52:22] karapetyan: has joined #ruby
[09:55:47] karapetyan: has joined #ruby
[09:57:50] workmad3: has joined #ruby
[09:58:47] cschneid: has joined #ruby
[09:59:16] maiz: has joined #ruby
[10:01:58] RougeR: has joined #ruby
[10:01:59] RougeR: has joined #ruby
[10:05:14] bmurt: has joined #ruby
[10:25:57] kryptoz: has joined #ruby
[10:26:38] kryptoz: has joined #ruby
[10:28:44] apparition47: has joined #ruby
[10:33:08] Unknown2: has joined #ruby
[10:39:25] cabotto: has joined #ruby
[10:40:12] conta: has joined #ruby
[10:50:07] usuario: has joined #ruby
[10:58:01] cabotto: has joined #ruby
[10:59:49] cabotto: has joined #ruby
[11:00:13] cschneid: has joined #ruby
[11:04:10] GodFather: has joined #ruby
[11:08:27] AJA4350: has joined #ruby
[11:14:13] cschneid: has joined #ruby
[11:16:07] duderonomy: has joined #ruby
[11:17:37] nima_m: has joined #ruby
[11:20:21] nima_m_: has joined #ruby
[11:21:27] nima_m__: has joined #ruby
[11:22:52] ellcs: has joined #ruby
[11:24:33] cabotto: has joined #ruby
[11:25:33] za1b1tsu: has joined #ruby
[11:29:58] ldnunes: has joined #ruby
[11:33:09] dreamthese: has joined #ruby
[11:34:28] halbbalda: has joined #ruby
[11:36:08] nima_m_: has joined #ruby
[11:36:32] Nicmavr: has joined #ruby
[11:38:44] GodFather: has joined #ruby
[11:41:17] psychicist__: has joined #ruby
[11:47:22] cschneid: has joined #ruby
[11:48:18] dreamthese: has joined #ruby
[11:56:56] karapetyan: has joined #ruby
[11:58:22] cyberg: has joined #ruby
[12:00:54] cschneid: has joined #ruby
[12:02:27] beanish: has joined #ruby
[12:02:29] karapetyan: has joined #ruby
[12:07:05] synthroid: has joined #ruby
[12:09:59] cschneid: has joined #ruby
[12:15:00] psychicist__: has joined #ruby
[12:15:18] cschneid: has joined #ruby
[12:15:23] syndikate: Date.strptime gave me this error Exception: invalid strptime format - `%F'. I can't figure what %F is. My date to parse is of the format this "14 Jul 2018"
[12:17:05] dminuoso: apeiros: Mm Im not happy
[12:17:27] dminuoso: https://gist.github.com/dminuoso/c76e66ee8ba6e04be07e46b66d690212
[12:17:53] dminuoso: Though I guess that is as good as it will get.
[12:19:53] zautomata: has joined #ruby
[12:20:39] roamingdog: has joined #ruby
[12:23:28] fmcgeough: has joined #ruby
[12:24:22] jamesaxl: has joined #ruby
[12:27:51] konsolebox: syndikate: i'm unable to reproduce that error message. i only get 'invalid date'. perhaps show a code.
[12:28:15] cabotto: has joined #ruby
[12:28:25] syndikate: konsolebox, I am just trying it out in irb
[12:29:22] cschneid: has joined #ruby
[12:29:40] apeiros: syndikate: try a strftime with %F to see what components it is
[12:29:50] beanish: has joined #ruby
[12:30:02] apeiros: I'm sure you'll quickly figure how to rewrite %F ;-)
[12:30:15] apeiros: (it doesn't match 14 Jul 2018 btw.)
[12:32:14] syndikate: %F - The ISO 8601 date format (%Y-%m-%d)
[12:32:25] syndikate: That doesn't match what I gave
[12:32:34] syndikate: Hence my argument is wrong
[12:32:58] apeiros: ok, so your question is not what you wanted to ask for
[12:33:09] anisha_: has joined #ruby
[12:33:19] syndikate: Yeah, I think I got confused there with couple of issues
[12:33:47] apeiros: I guess the other two you can figure?
[12:36:39] syndikate: Okay, I need to clarify couple of things. If not template is passed strptime uses %F
[12:37:31] syndikate: That's correct, right?
[12:38:36] cschneid: has joined #ruby
[12:39:53] Rapture: has joined #ruby
[12:40:04] apeiros: you can ask the docs :)
[12:40:07] apeiros: Date.strptime([string='-4712-01-01'[, format='%F'[, start=Date::ITALY]]]) -> date
[12:40:16] apeiros: I'd say yes, default is %F
[12:40:25] dminuoso: Gah okay this is getting annoying now.
[12:41:17] apeiros: dminuoso: oooh, german error messages in json :D
[12:41:21] syndikate: I was looking at the source code of that method. So, my conclusion is that I was passing wrong string format.
[12:42:15] apeiros: dminuoso: .save! and rescue different exceptions? (unless I misremember)
[12:42:49] dminuoso: apeiros: these errors will eventually be transported into my React application
[12:43:10] dminuoso: The rails way of i18n is a mess and annoying to use
[12:43:16] syndikate: I should have used this Date.strptime('7 Jul 2018', "%d %b %Y")
[12:43:19] dminuoso: Besides I dont have any internationalization needs
[12:43:22] apeiros: I figured. got to disconnect for a bit now, though, since I have to make a phone call :)
[12:43:45] apeiros: more or less concur @ rails i18n being a mess.
[12:43:59] syndikate: Now, my actual problem here is that my backed expects another format and teh frontend provides another
[12:44:02] syndikate: Oh too late
[12:44:17] syndikate: Time to talk to frontenders
[12:44:20] dminuoso: 14:43 syndikate | Now, my actual problem here is that my backed expects another format and teh frontend provides another
[12:44:23] dminuoso: Why is that a problem
[12:44:44] syndikate: I have a validator send to expect a format and parsing happens with that format
[12:44:49] syndikate: Set to expect*
[12:44:58] def_jam: has joined #ruby
[12:45:43] eb0t_: has joined #ruby
[12:45:58] syndikate: I have other views providing the date in the expected format
[12:46:04] syndikate: I would prefer everything to be unique
[12:46:15] agent_white: has joined #ruby
[12:46:16] syndikate: And not add an extra case for a specific page
[12:46:23] syndikate: Hope that makes sense dminuoso
[12:47:49] nowhereman_: has joined #ruby
[12:55:33] syndikate: Okay, so how do you say this can be solved? I have some code in backend which expects Date.strptime('date_string', EXPECTED_FORMAT)
[12:55:42] syndikate: This is being used at multiple places
[12:56:01] syndikate: Hence everywhere that format is _expected_
[12:56:56] amar_: has joined #ruby
[12:57:12] InfinityFye: has joined #ruby
[12:58:35] agent_white: Mornin' folks
[12:58:51] cabotto: has joined #ruby
[13:01:13] dminuoso: syndikate: I still dont understand what your problem is.
[13:01:41] dminuoso: syndikate: You could a) force all parts to use iso8601 which will reduce headaches.
[13:01:47] dminuoso: Or b) explain what your problem is.
[13:02:05] syndikate: dminuoso, I am moving towards something similar to a. I will get to b.
[13:02:16] cschneid: has joined #ruby
[13:02:40] dminuoso: syndikate: format is a representation issue.
[13:02:48] dminuoso: Not a processing issue.
[13:03:48] conta: has joined #ruby
[13:05:41] jcalla: has joined #ruby
[13:05:51] karapetyan: has joined #ruby
[13:14:37] fmcgeough: has joined #ruby
[13:14:42] jottr_: has joined #ruby
[13:15:34] walidvb: has joined #ruby
[13:16:28] cschneid: has joined #ruby
[13:17:46] ElFerna: has joined #ruby
[13:19:07] walidvb: hey all, i'm having trouble with v8, libv8 and mini_racer using bundler
[13:19:27] walidvb: running on Mac OS X 10.13
[13:20:56] walidvb: somehow it seems i cannot get the versions to match. i have installed v8 via brew(which installed 5.1), then libv8(using gem i libv8 -v 5.3.332.38.5 -- --with-system-v8), and tried installing mini_racer the same way, which seemed to do the trick
[13:24:03] beanish: has joined #ruby
[13:24:08] walidvb: i have successfully run my rails app. I then added a gem, ran bundle again, and starting the app now gives me a Symbol not found error
[13:24:39] walidvb: if that rings a bell to anyone, would greatly appreciate some help configuring this
[13:25:49] white_lilies: has joined #ruby
[13:25:57] jcalla: has joined #ruby
[13:26:32] beefjoe: has joined #ruby
[13:29:38] bmurt: has joined #ruby
[13:29:48] jottr_: has joined #ruby
[13:30:44] soniya29: has joined #ruby
[13:34:20] cabotto: has joined #ruby
[13:34:35] soniya29_: has joined #ruby
[13:34:48] cschneid: has joined #ruby
[13:39:32] StarSeed0000: has joined #ruby
[13:41:51] Inline: has joined #ruby
[13:48:00] cschneid: has joined #ruby
[13:51:40] soniya29_: has joined #ruby
[13:51:40] soniya29: has joined #ruby
[13:52:09] havenwood: https://www.ruby-lang.org/en/news/2018/06/20/support-of-ruby-2-2-has-ended/
[13:53:22] havenwood: walidvb: What's the error? Something like? dyld: lazy symbol binding failed: Symbol not found
[13:53:57] walidvb: havenwood: was this: mini_racer Symbol not found: __ZTIN2v811ArrayBuffer9AllocatorE
[13:54:14] walidvb: i'm currently re installing, etc, so can't tell more right this second
[13:54:19] walidvb: libv8 is currently compiling
[13:56:08] zach_: has joined #ruby
[13:57:34] gnufied: has joined #ruby
[13:57:37] havenwood: walidvb: Assuming it's reproducible, it might be worth trying compiling v8 with gcc++. That was a solution for a rubyracer/v8 issue a while back: https://github.com/cowboyd/therubyracer/issues/392#issuecomment-208247513
[13:58:03] cyberg: has joined #ruby
[13:58:45] walidvb: yeah i've been through that.. worked on it 3-4 hours, for it to finally work. sprung my server, was working fine, added a gem, added an empty class, restarted my server to get access to these, it had stopped working
[13:59:02] walidvb: although i don't think running bundle would touch anything on installed gems, no?
[14:00:44] cschneid: has joined #ruby
[14:00:47] gnufied_: has joined #ruby
[14:05:24] havenwood: walidvb: it doesn't `pristine` installed gems that don't change, but dependencies will re-resolve when you add a gem.
[14:05:29] fluxAeon: has joined #ruby
[14:05:58] havenwood: walidvb: Sounds like a frustrating issue. Can you revert the Gemfile.lock and confirm it still works post-reboot?
[14:06:17] walidvb: very frustrating indeed ^^
[14:06:31] walidvb: argh in the meantime i remove libv8, is recompiling now
[14:06:46] walidvb: but i did revert and tried to run, had the same issue
[14:07:03] walidvb: seems like smth to do with the wrong versions/paths being used, i would say
[14:07:30] karapetyan: has joined #ruby
[14:07:39] walidvb: (which is running since 10 minutes, i think.. -.-)
[14:08:20] walidvb: (and bundler hasn't told me this would take time, which it usually does)
[14:12:11] kryptoz: has joined #ruby
[14:12:17] amar_: has joined #ruby
[14:22:10] karapetyan: has joined #ruby
[14:22:15] taylorzr: has joined #ruby
[14:25:46] walidvb: havenwood: it could be that i had some bundle configs when it was working, i just can't figure out exactly which
[14:26:39] sysvalve: has joined #ruby
[14:34:40] walidvb: havenwood: still here?
[14:36:21] walidvb: i'm now reinstalling everything. libv8 installs fine(--with-system-v8), but mini_racer gives me a Libv8 location not found(whether i run it with or without --with-system-v8)
[14:36:43] walidvb: btw i uninstalled and reinstalled v8 (with brew uninstall v8 && brew install v8)
[14:36:55] kryptoz: has joined #ruby
[14:39:40] amar_: has joined #ruby
[14:43:22] nowhere_man: has joined #ruby
[14:45:40] chouhoulis: has joined #ruby
[14:49:17] StarSeed0000: has joined #ruby
[14:54:38] p4p0l0: has joined #ruby
[14:55:35] cschneid: has joined #ruby
[14:58:46] chouhoulis: has joined #ruby
[14:58:51] kryptoz: has joined #ruby
[15:00:46] codymj: has joined #ruby
[15:02:23] tdy: has joined #ruby
[15:02:32] cabotto: has joined #ruby
[15:03:08] kryptoz: has joined #ruby
[15:03:28] akaiiro: has joined #ruby
[15:06:05] darix: walidvb: system libv8 and the libv8 gem can be tricky
[15:06:14] darix: as it is really picky about which versions work
[15:06:50] dbrandon: 3l10s0m3ga5
[15:07:36] darix: dbrandon: stop using my password please.
[15:09:48] walidvb: yeah is quite tricky indeed
[15:10:06] walidvb: i ended up updating both libv8 and mini_racer, seems to have done the trick
[15:10:29] walidvb: tests running fine :)
[15:10:51] walidvb: don't think i require to understand more right now ;)
[15:10:51] walidvb: thanks all for your help, appreciated!
[15:11:55] suukim: has joined #ruby
[15:20:01] chouhoulis: has joined #ruby
[15:20:42] Es0teric: has joined #ruby
[15:24:54] walidvb_: has joined #ruby
[15:28:22] p4p0l0: has joined #ruby
[15:29:58] p4p0l0: has joined #ruby
[15:30:40] weird_error: has joined #ruby
[15:32:54] p4p0l0: has joined #ruby
[15:35:36] alem0lars: has joined #ruby
[15:37:24] cagomez: has joined #ruby
[15:38:18] cagomez: has joined #ruby
[15:38:29] orbyt_: has joined #ruby
[15:42:28] kryptoz: has joined #ruby
[15:45:45] Dbugger: has joined #ruby
[15:56:11] cagomez: has joined #ruby
[16:00:31] cagomez: has joined #ruby
[16:00:36] akaiiro: has joined #ruby
[16:03:49] biberu: has joined #ruby
[16:09:39] havenwood: ljarvis: \o
[16:09:42] StarSeed0000: has joined #ruby
[16:11:25] hph^: has joined #ruby
[16:12:10] hph^: has joined #ruby
[16:12:31] hph^: has joined #ruby
[16:12:51] hph^: has joined #ruby
[16:13:14] hph^: has joined #ruby
[16:13:28] cabotto: has joined #ruby
[16:13:34] jcarl43: has joined #ruby
[16:13:36] hph^: has joined #ruby
[16:15:01] tty: has joined #ruby
[16:16:07] Mike11: has joined #ruby
[16:16:26] cabotto: has joined #ruby
[16:18:04] dviola: has joined #ruby
[16:18:49] wontruefree: has joined #ruby
[16:23:06] dionysus69: has joined #ruby
[16:23:38] nima_m: has joined #ruby
[16:29:45] crankharder: has joined #ruby
[16:31:09] claudiuinberlin: has joined #ruby
[16:32:43] nima_m: has joined #ruby
[16:33:03] cthulchu: has joined #ruby
[16:36:01] nima_m_: has joined #ruby
[16:36:11] cthulchu_: has joined #ruby
[16:36:59] roamingdog: has joined #ruby
[16:39:17] eckhardt_: has joined #ruby
[16:40:51] raynold: has joined #ruby
[16:48:06] maiz: has joined #ruby
[16:50:05] amar_: has joined #ruby
[16:53:10] [Butch]: has joined #ruby
[16:55:50] d5sx43: has joined #ruby
[16:57:42] soniya29: has joined #ruby
[16:57:46] roamingdog: has joined #ruby
[16:57:47] soniya29_: has joined #ruby
[17:02:59] nima_m: has joined #ruby
[17:04:53] cagomez: has joined #ruby
[17:05:19] claudiuinberlin: has joined #ruby
[17:06:01] biberu: has joined #ruby
[17:12:05] nima_m: has joined #ruby
[17:21:11] MichaelG: has joined #ruby
[17:21:31] gheegh: has joined #ruby
[17:22:14] sameerynho: has joined #ruby
[17:26:53] jrich523: has joined #ruby
[17:29:23] akkad: has joined #ruby
[17:29:26] roamingdog: has joined #ruby
[17:30:08] StarSeed0000: has joined #ruby
[17:30:39] roamingdog: has joined #ruby
[17:31:35] Eiam: has joined #ruby
[17:31:53] orbyt_: has joined #ruby
[17:33:56] soniya29_: has joined #ruby
[17:33:56] soniya29: has joined #ruby
[17:34:32] anjen: has joined #ruby
[17:36:15] cagomez: has joined #ruby
[17:38:03] roamingdog: has joined #ruby
[17:40:29] amar_: has joined #ruby
[17:45:24] claudiuinberlin: has joined #ruby
[17:45:36] amar_: has joined #ruby
[17:48:06] soniya29_: has joined #ruby
[17:48:06] soniya29: has joined #ruby
[17:49:21] jenrzzz: has joined #ruby
[17:49:22] jenrzzz: has joined #ruby
[17:49:22] jottr_: has joined #ruby
[17:51:43] karapetyan: has joined #ruby
[17:52:12] Lytol: has joined #ruby
[17:53:24] roamingdog: has joined #ruby
[17:54:31] amarks: has joined #ruby
[17:55:02] RougeR: has joined #ruby
[17:55:02] RougeR: has joined #ruby
[17:55:27] alem0lars: has joined #ruby
[17:55:59] patteh: has joined #ruby
[17:57:04] akkad: has joined #ruby
[18:03:55] SeepingN: has joined #ruby
[18:04:06] maiz: has joined #ruby
[18:04:28] rivalomega: has joined #ruby
[18:07:01] rivalomega: has joined #ruby
[18:07:46] rivalomega: has joined #ruby
[18:16:18] fredlinhares: has joined #ruby
[18:17:41] karapetyan: has joined #ruby
[18:19:04] cagomez: has joined #ruby
[18:27:17] cadillac_: has joined #ruby
[18:29:25] cthu|: has joined #ruby
[18:30:58] soniya29: has joined #ruby
[18:31:04] soniya29_: has joined #ruby
[18:34:42] karapetyan: has joined #ruby
[18:35:12] jenrzzz: has joined #ruby
[18:35:30] cagomez: has joined #ruby
[18:40:31] quobo: has joined #ruby
[18:40:44] amar: has joined #ruby
[18:43:09] karapetyan: has joined #ruby
[18:44:42] \void: has joined #ruby
[18:45:03] cagomez: has joined #ruby
[18:47:40] Alina-malina: has joined #ruby
[18:51:24] p4p0l0: has joined #ruby
[18:52:13] headius: havenwood: hey do you have a set of benchmarks you're seeing JRuby+Graal do really well on?
[18:52:34] headius: I'm going to be doing a talk at the JVM Language Summit on the perf improvements we're seeing with Graal *not* using Truffle
[18:53:44] anjen: has joined #ruby
[18:54:17] pankaj: has joined #ruby
[18:54:40] jenrzzz: has joined #ruby
[18:54:57] pankaj: Is their any most preferred website used by ruby users particularly to download and use html themes for free so that to be used in their projects?
[18:56:29] soniya29__: has joined #ruby
[18:56:31] clemens3: has joined #ruby
[18:56:50] dreamthese: has joined #ruby
[18:57:05] alem0lars: has joined #ruby
[18:57:46] alem0lars: has joined #ruby
[18:58:30] alem0lars: has joined #ruby
[18:59:59] cthu|: guys, can I create objects directly in a function call args?
[19:00:58] soniya29: has joined #ruby
[19:01:15] arand: has joined #ruby
[19:03:39] cthu|: obj1.method1(Regexp.new("^\s*blahblah\s*"))
[19:04:18] cthu|: I just want a way to "cast" string into regex and regex's constructor seems to do just that
[19:06:10] anjen: has joined #ruby
[19:06:30] jottr_: has joined #ruby
[19:12:38] maiz: has joined #ruby
[19:15:18] gizmore: cthu|: should work
[19:17:25] cthu|: doesn't it look wrong? I mean wrong like "you should never use variables in regex"
[19:18:13] cthu|: what if in the constructor I would check if the string or a regex is passed
[19:18:27] cthu|: and if it's a string, then I would check if it equals to the template
[19:18:47] cthu|: and if it's a regex, I'd check if it matches the template
[19:19:05] cthu|: sounds weird, but should work
[19:20:59] wontruefree: has joined #ruby
[19:21:40] _seanc_: has joined #ruby
[19:29:36] amar: has joined #ruby
[19:30:01] p4p0l0: has joined #ruby
[19:31:53] amar_: has joined #ruby
[19:39:26] cthu|: oh, so .class returns the actual class, not its name
[19:39:33] cthu|: hell this language is soo cool
[19:39:59] cthu|: feels like being a root on production
[19:41:58] cagomez: has joined #ruby
[19:42:51] conta1: has joined #ruby
[19:47:54] discopatrick: has joined #ruby
[19:49:23] Eiam: cthu|: if you cannot understand it after you've written it, it might be wrong for other reasons
[19:49:53] Eiam: doing weird shit is fun and cool until you get a bug report that you've got to sort out, and who knows what the asshole that was yourself wrote two weeks ago. I hate that jerk, always screwing me over.
[19:50:19] cthu|: we can return values from blocks, right?
[19:50:41] cthu|: I suspect I shouldn't use blocks
[19:50:51] Eiam: http://rubylearning.com/satishtalim/ruby_blocks.html
[19:52:13] cthu|: return in a block breaks the whole thin
[19:52:37] cthu|: but there still has to be a way to return from a block
[19:52:43] cthu|: this is better: https://makandracards.com/makandra/46939-ruby-a-small-summary-of-what-return-break-and-next-means-for-blocks
[19:53:31] cthu|: break does it for blocks!
[19:58:56] cthu|: ok, I don't quite understand how .select works inside
[19:59:29] Eiam: you are programming by trial and error instead of understanding
[19:59:31] cthu|: I think if the block returns true, then select puts this object in the output array
[19:59:41] cthu|: yeah, I'm trying to understand now
[20:01:00] cthu|: the block should return the object
[20:01:56] cthu|: ok, I'm done. the only thing the block will do is run my function. I can't figure how to make it work otherwise
[20:03:15] cthu|: no. I'l go have a dinner. Hope someone tells me how to do this: https://paste.ofcode.org/37RizeQpEwdPU2vVnSQnChb
[20:03:39] cthu|: I tried a few versions before
[20:04:05] Eiam: what in gods name
[20:05:24] Eiam: if you have nils in your dataset and just want to discard them, .compact it before you enumerate
[20:05:57] Eiam: no idea what dl_var_val is,
[20:08:43] Eiam: why not just combine lines 4 and 8, if either evaluates to true it'll just take the object yielded to it in your result
[20:09:56] omth: has joined #ruby
[20:17:15] foglabs: has joined #ruby
[20:17:38] taylorzr: has joined #ruby
[20:18:24] jottr_: has joined #ruby
[20:19:17] orbyt_: has joined #ruby
[20:20:37] zachk: has joined #ruby
[20:21:22] apeiros_: has joined #ruby
[20:22:04] zachk: has joined #ruby
[20:22:13] cagomez: has joined #ruby
[20:22:33] amar: has joined #ruby
[20:22:50] nowhere_man: has joined #ruby
[20:23:01] zachk: has joined #ruby
[20:28:53] rivalome_: has joined #ruby
[20:28:58] cagomez: has joined #ruby
[20:32:20] dinfuehr: has joined #ruby
[20:35:51] chouhoul_: has joined #ruby
[20:38:49] tag: has joined #ruby
[20:38:54] jenrzzz: has joined #ruby
[20:38:54] jenrzzz: has joined #ruby
[20:49:13] Mqll: has joined #ruby
[20:49:40] cagomez: has joined #ruby
[20:51:29] havenwood: cthu|: Only use #select when you're trying to filter to a subset of the collection. Use the #any? predicate method instead for this case.
[20:52:32] guille-moe: has joined #ruby
[20:52:33] cagomez: has joined #ruby
[20:53:30] Eiam: wait he only wants one result?
[20:53:37] Eiam: I thought he wanted every result that passes his two tests
[20:54:02] Eiam: and hes using the weird return true thing to flag what would already happen by default
[20:54:02] havenwood: Eiam: Appears to me to return `false` or `true`.
[20:54:32] Eiam: yeah I took that as "add this to my select 'returned' results"
[20:54:41] taylorzr: has joined #ruby
[20:55:13] Mqll: has joined #ruby
[20:55:25] havenwood: Eiam: maybe i'm the one misreading
[20:55:30] Eiam: haha now we both doubt ourselves
[20:55:32] havenwood: Eiam: I assumed: https://gist.github.com/havenwood/678f7c31f56dd885b3e81a171bd996e9
[20:55:43] havenwood: cthu|: What is your purpose!? ;-P
[20:56:12] havenwood: cthu|: Is that example ^ what you're trying to do? See if any twoquals the string or match the regexp?
[20:56:12] Eiam: havenwood: I assumed when name && dl_var_val match, add it to my select
[20:56:14] Eiam: otherwise, discard.
[20:56:27] havenwood: Eiam: Oh, I think you're right now. Haha.
[20:56:39] Eiam: like how some people write if (blah) return true instead of just writing (blah)
[20:57:21] Eiam: because they don't understand or like that the last statement "returns" in ruby and the evaluation of an if already "returns" its result without needing to force it
[20:57:24] jenrzzz: has joined #ruby
[20:57:54] Eiam: havenwood: we will remain forever in limbo until cthu| graces us with an answer.
[20:57:55] havenwood: cthu|: Amended that ^ gist with a #select example.
[20:58:25] Eiam: havenwood: I like how both do the right thing either way lol
[20:58:32] Eiam: like no code changes except for .any vs .select
[20:59:22] Eiam: havenwood: I really feel like there is a way to condense the string & regexp case into a single comparison anyway
[20:59:32] Eiam: but I was tired of fiddling with it and I hate regexp anyway
[21:00:03] karapetyan: has joined #ruby
[21:00:26] havenwood: Eiam: threequals should do the trick, right?
[21:01:53] havenwood: Eiam: It just might threequals other things. ;-O
[21:02:43] havenwood: data_layer.select { |object| object[dl_var_name].to_s === dl_var_val }
[21:03:45] cthu|: okay, I want an array of all elements that got true
[21:03:46] cthu|: but if I return true manually, I get a bool in the events var
[21:03:46] cthu|: which is weeeeird
[21:03:53] Eiam: any string that passes == will also pass =~ , no?
[21:03:53] Eiam: but many things can pass =~ and fail ==
[21:04:08] cthu|: absolutely no
[21:04:10] fluxAeon_: has joined #ruby
[21:04:19] cthu|: if you use =~ to do regex
[21:04:21] booboy: has joined #ruby
[21:04:27] havenwood: cthu|: What might it be other than a String or Regexp? Will it always be one of those two?
[21:04:45] havenwood: cthu|: events = data_layer.select { |object| object[dl_var_name].to_s === dl_var_val }
[21:04:49] cthu|: I don't mean it to be anything else
[21:04:54] spk_: has joined #ruby
[21:05:07] cthu|: === does regex matching?
[21:05:07] ptx0_: has joined #ruby
[21:05:13] apeiros_: havenwood: shouldn't that be reversed?
[21:05:14] Eiam: wait what when did ruby get ===
[21:05:22] cthu|: AND string matching
[21:05:25] havenwood: apeiros_: ew, did i invert it?
[21:05:27] Eiam: mentally I think of === as being "Javascript is broken so just use ==="
[21:05:29] apeiros_: at least from your gist I thought dl_var_val is the string/regexp switcher?
[21:05:31] Eiam: don't break my mental model
[21:05:45] havenwood: apeiros_: yeah, you're right
[21:05:47] apeiros_: Eiam: ages ago
[21:05:52] Eiam: apeiros_: damn =(
[21:05:54] Eiam: ACTION googles
[21:05:57] apeiros_: Eiam: case/when uses it and a couple of methods
[21:05:58] havenwood: cthu|: events = data_layer.select { |object| dl_var_val === object[dl_var_name].to_s }
[21:06:12] cthu|: pk, but what if I want it to be manual?
[21:06:14] apeiros: Eiam: basically, `case expr when cond` is evaluated as `cond === expr`
[21:06:16] havenwood: ACTION fails at multitasking
[21:06:30] cthu|: I want to work with select manually
[21:06:31] apeiros: cthu|: why'd you player-kill?
[21:06:39] cthu|: that was an ok
[21:06:54] havenwood: Eiam: https://medium.com/rubyinside/triple-equals-black-magic-d934936a6379
[21:06:55] amar_: has joined #ruby
[21:07:00] cthu|: apeiros, I'm actually trying to work with the code you wrote for me
[21:07:08] apeiros: ACTION runs
[21:07:09] cthu|: a week or two ago
[21:07:33] Eiam: okay its like a Set/Contains operator
[21:07:56] Eiam: apeiros: send him a bill for your hours
[21:08:01] cthu|: havenwood, can we have manual returns in select?
[21:08:09] cthu|: to manually decide what goes in and what not
[21:08:18] apeiros: cthu|: `next true` returns true from the block.
[21:08:19] havenwood: cthu|: next
[21:08:20] Eiam: ... you decide what goes in by having your expression evaluate
[21:08:35] Eiam: if its true, in it goes. if its false, out it goes
[21:08:44] cthu|: break true should do the same, guys!
[21:08:53] havenwood: cthu|: `next` goes on to the next iteration, while `break` is more breaking
[21:08:53] apeiros: cthu|: though if you can you avoid mid-construct exits. that's one kind of spaghetti code
[21:09:09] apeiros: cthu|: next and break do different things.
[21:09:14] elomatreb: Explicit next/return/break are kind of counterintuitive in Ruby
[21:09:19] apeiros: next returns from the block to the method which yields
[21:09:19] cthu|: ok, I'll try next, thanks
[21:09:20] elomatreb: Esp. in conjuction with blocks
[21:09:24] Eiam: this makes no sense
[21:09:36] apeiros: break returns from the block AND the method which yields (i.e. the method which yields never sees the return value of the block)
[21:09:46] elomatreb: >> [1, 2].select { return true } # eg
[21:09:47] ruby[bot]: elomatreb: # => unexpected return (LocalJumpError) ...check link for more (https://eval.in/1028028)
[21:09:51] cthu|: I do wanna try ===, but it feels wrong
[21:09:58] Eiam: if you are trying to select all things that match an expression, just write the expression in your block
[21:10:05] Eiam: presto, selected for the expression
[21:10:18] cthu|: elomatreb, return in the block exits the method
[21:10:20] apeiros: 🎶 if using === is wrong, I don't wanna be right 🎵
[21:10:22] Eiam: >> [1,2,3].select { |x| x.odd?}
[21:10:23] ruby[bot]: Eiam: # => [1, 3] (https://eval.in/1028029)
[21:10:32] apeiros: can we call === "triqual"?
[21:10:37] Eiam: see? everything that matched "if x == odd" was selected
[21:10:46] cthu|: I know that
[21:10:54] elomatreb: cthu|: Exactly. Which is a little counterintuitive if you assume blocks are lambdas/functions, like e.g. in Javascript
[21:10:57] Eiam: so what are you doing with this break/true stuff =0
[21:11:06] havenwood: no need for: x.odd? == true
[21:11:08] cthu|: elomatreb, right right
[21:11:09] havenwood: just: x.odd?
[21:11:16] cthu|: and yet I want a function there :(
[21:11:24] cthu|: I miss JS's callbacks :)
[21:11:24] apeiros: then call one
[21:11:26] havenwood: same with `nil`, it's already falsey
[21:11:33] cthu|: I used to call one from a block
[21:11:38] cthu|: but then was corrected
[21:11:38] apeiros: select { |x| foo(x) }
[21:12:03] apeiros: but iirc the only thing which made it worth in your case was your debugging code
[21:12:11] cthu|: by the way, objects are always passed by reference, right?
[21:12:15] cthu|: and hashes
[21:12:16] cthu|: and arrays
[21:12:17] apeiros: without the debugging code, there was little point IMO. but nothing wrong with it.
[21:12:36] cthu|: ok, thanks
[21:12:43] apeiros: cthu|: you always wanted the technically correct explanation, right?
[21:12:52] cthu|: apeiros, yes, thanks
[21:12:55] apeiros: objects are passed by copy
[21:13:00] cthu|: if next doesn't work, I'll go back to the function
[21:13:03] apeiros: but it doesn't copy the objects
[21:13:17] cthu|: it's value or reference
[21:13:22] dminuoso: ACTION finds that explanation rather confusing
[21:13:24] cthu|: I'm sure it's ref
[21:13:31] elomatreb: Ruby does have lambdas as well, btw.
[21:13:52] apeiros: dminuoso: yeah. I should invest more in making a less confusing explanation :D
[21:13:58] dminuoso: Ruby is pass-by-value, with variables being references to objects.
[21:14:00] apeiros: especially given the frequency of this question.
[21:14:02] elomatreb: >> [1, 2].select &lambda {|_| return true }
[21:14:03] ruby[bot]: elomatreb: # => [1, 2] (https://eval.in/1028034)
[21:14:09] apeiros: cthu|: ^ what dminuoso said.
[21:14:33] cthu|: that's variables
[21:14:40] cthu|: and reference with objects
[21:14:44] cthu|: like I thought
[21:14:51] cthu|: although... are hashes objects?
[21:14:58] elomatreb: Everything is an object
[21:15:05] cthu|: right, right
[21:15:10] cthu|: something's not?
[21:15:21] dminuoso: cthu|: blocks, methods and local variables are not.
[21:15:21] apeiros: but most cases which aren't, are implementation details.
[21:15:30] apeiros: variables are not objects, and ^
[21:15:44] dminuoso: Though the first two can be reified.. so.
[21:15:45] cthu|: that's it, thanks a lot, folks, love ya
[21:15:46] apeiros: you can turn blocks & methods into objects, though
[21:15:58] elomatreb: OK, "every value is an object" is more correct (and kind of what I meant)
[21:16:01] apeiros: also any implementation could choose to have those as objects all the time.
[21:16:12] apeiros: elomatreb: :D
[21:16:41] cthu|: should I avoid === for regex matching?
[21:16:48] cthu|: it looks too convenient to be true
[21:16:56] dminuoso: ACTION avoids === generally
[21:17:21] dminuoso: It just doesn't have well defined semantics.
[21:17:49] cthu|: so next works
[21:17:52] cthu|: thanks a lot for it
[21:18:00] cthu|: now I'll try to avoid next with ===
[21:18:04] elomatreb: === does all kinds of stuff depending on the left-hand side. If the LHS is a class it does instanceof checks, if it's a range it does inclusion checks, etc
[21:18:18] cthu|: woooooooooow
[21:18:21] dminuoso: Exactly. "Does all kinds of stuff" with no common theme is bad in my book.
[21:18:23] cthu|: hooooly mooole
[21:18:40] cthu|: on the left side, huh?
[21:18:47] cthu|: so the regex should be on the left
[21:18:48] apeiros: it's a method
[21:18:55] cthu|: every operation is a method
[21:19:01] elomatreb: And like any other method you can override for your own classes, e.g. there's an IP address class in the standard library that does subnet inclusion IIRC
[21:19:03] dminuoso: cthu|: Not quite.
[21:19:03] apeiros: what methods do always depends on the receiver
[21:19:11] apeiros: i.e. "left side"
[21:19:13] dminuoso: cthu|: Ruby has keywords...
[21:19:16] cthu|: dminuoso, what's not a method?
[21:19:23] apeiros: `defined?` f.ex.
[21:19:24] dminuoso: Anything that is not a method?
[21:19:32] elomatreb: Simple assignment
[21:19:36] apeiros: ternary is also an operator
[21:19:46] cthu|: got it :)
[21:19:50] apeiros: lambda otoh is a method :D
[21:20:06] dminuoso: apeiros: what does `a = ->(){}` invoke?
[21:20:15] bougyman: dminuoso: nil
[21:20:20] cthu|: what is ->
[21:20:24] cthu|: I know it penetrates
[21:20:26] apeiros: dminuoso: does it invoke something? I actually never bothered to check
[21:20:29] elomatreb: "stabby lambda" syntax
[21:20:32] dminuoso: asm>> a = ->(){}
[21:20:33] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/1028035
[21:20:37] elomatreb: Similar to arrow functions in JS
[21:20:47] dminuoso: Ah I guess it does call Kernel#lambda
[21:20:54] cthu|: I hate that concept in JS
[21:21:06] dminuoso: It's about the one redeeming feature of the language.
[21:21:15] cthu|: redeeming?
[21:21:17] cthu|: more like confusing
[21:21:56] dminuoso: ACTION pokes elomatreb
[21:22:06] elomatreb: ACTION pokes back
[21:22:14] dminuoso: Oh havenwood, so I want proper profunctor optics in Ruby.
[21:22:26] dminuoso: Taking a deep dive into lenses currently, they are a godsend in JavaScript.
[21:23:07] jottr_: has joined #ruby
[21:23:23] tty: has joined #ruby
[21:24:20] Eiam: -> and lambda aren't the same thing
[21:24:41] Eiam: swear I had some code a few months ago I wrote as lambda { blah} and later tried to convert lambda to -> and it stopped working
[21:25:00] Eiam: didn't have time to dig into what was up other than to realize they clearly aren't the same
[21:25:25] dminuoso: asm>> add = -> a, b { a + b }
[21:25:26] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/1028038
[21:25:31] dminuoso: asm>> add = lambda { |a, b| a + b }
[21:25:32] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/1028039
[21:25:54] dminuoso: Eiam: There's some freaking annoying subtle differences because Japananese reasons.
[21:26:00] agent_wh1te: has joined #ruby
[21:26:00] RougeR: coming from ruby ive forgotten how weird python functions look...
[21:26:04] RougeR: they just...trail off
[21:26:07] apeiros: Eiam: proc and lambda are not the same thing
[21:26:13] apeiros: Eiam: -> and lambda are
[21:26:19] havenwood: Eiam: Did you maybe forget to change the way the args are expressed?
[21:26:26] apeiros: lambda enforces arity (like methods), proc does not (like blocks)
[21:26:53] apeiros: RougeR: like lonesome cowboys?
[21:26:55] RougeR: return also functions differently between proc and lambda
[21:26:58] Eiam: havenwood: that may have been what it was. I did something like blah = lambda {code} then later just tried to swap it and it failed
[21:26:58] RougeR: apeiros: yes
[21:27:00] cthu|: I think using end is awkward. I would enjoy python's way
[21:27:09] cthu|: even JS's way feels better
[21:27:10] RougeR: i like end and {}
[21:27:16] apeiros: RougeR: now I have the image of lucky luke riding off in my mind.
[21:27:18] Eiam: havenwood: like how each_with_object and reduce swap around their paramaters, so annoying.
[21:27:19] RougeR: i just dont like having nothing
[21:27:25] havenwood: Eiam: Usually it's the args, since they're different. Aye.
[21:27:34] RougeR: cthu|: but in python it looks like you forgot to finish the function
[21:27:37] cthu|: indentation is something
[21:27:38] dminuoso: Eiam: dont use each_with_object and just manually zip? *shrugs*
[21:27:40] RougeR: it just trails off and then the code continues
[21:27:48] redlegion: has joined #ruby
[21:27:49] dminuoso: Eiam: Or in that case properly reduce?
[21:27:53] havenwood: apeiros: I've seen, "Name all the differences you know between a proc and a lambda" several times in Ruby interviews. A great opportunity to bring up Tennet's correspondence principle. ;-P
[21:27:59] cthu|: I hate finishing it with ends though. feels like overexplicit
[21:27:59] dminuoso: Eiam: The argument order is normal for a left fold though.
[21:28:13] Eiam: dminuoso: I don't use each_with_object at all because it didn't exist when I started Ruby and I'm used to reduce already. =p
[21:28:14] dminuoso: havenwood: one sucks, the other doesnt.
[21:28:16] cthu|: defininng funcion now right now yes defining!
[21:28:18] RougeR: ive never even made my own procs or lambdas outside of a learning exercise
[21:28:18] apeiros: havenwood: don't tell me I'd fail because I haven't even heard of that principle?
[21:28:41] RougeR: i might have some code interview soon..
[21:28:47] RougeR: i have 2 interviews tommorow
[21:28:47] apeiros: anyway, the difference between lambda and proc is 6
[21:28:52] havenwood: apeiros: haha
[21:29:13] RougeR: one is with a tiny startup
[21:29:16] Eiam: havenwood: haha my opening Ruby question is always "Explain the difference between reduce, inject, select and each on an array"
[21:29:20] RougeR: the other is a big startup
[21:29:32] havenwood: apeiros: I'd summarize the principle as, "there are reasons for a different return locale."
[21:29:46] havenwood: Yehuda wrote a post on it that I think has been lost to the sands of time.
[21:29:53] apeiros: Eiam: I hope they fail if they don't mention that inject was there first.
[21:30:24] apeiros: havenwood: "return locale" meaning where return returns to?
[21:30:28] Eiam: apeiros: its there to see if they know they are the same thing
[21:30:34] havenwood: apeiros: aye
[21:30:37] RougeR: inject = accumulator, each = iterator, select = matcher,
[21:30:40] Eiam: I've had people who clearly knew the other ones INVENT differences
[21:30:41] apeiros: Eiam: I hate that part about rubys numerous aliases
[21:30:43] dminuoso: inject = fold
[21:30:45] Eiam: thinking there *Was* a diffference
[21:30:45] RougeR: i cant remember reduce off top of head
[21:30:46] dminuoso: each = traverse
[21:30:49] dminuoso: select = uhh what is this.
[21:30:52] apeiros: Eiam: there are some methods which *seem* to be aliases but aren't.
[21:31:04] RougeR: dminuoso: iterator is a better descriptor
[21:31:06] apeiros: and due to all the aliases, you never really know whether that's such a case :(
[21:31:24] Eiam: its not a pass/fail question anyway, I'm just trying to get a ball rolling to discuss stuff.
[21:31:30] havenwood: sticklers are saying it's "Tennent’s principle of qualification", anyhoo
[21:31:42] apeiros: Eiam: anyway, to continue on my previous patter, the difference between each and reduce is of course 5
[21:31:47] RougeR: reduce and inject are the same
[21:31:59] Eiam: apeiros: not to be confused with the 6 for proc & lambda. got it, you are hired!
[21:31:59] havenwood: "Tennent’s principles are very powerful because violations of them tend to show up in the language as flaws, irregularities, unnecessary restrictions, unexpected interactions or complications, and so on."
[21:32:10] apeiros: Eiam: of course, I'm purrfect.
[21:32:18] Eiam: when can you start!
[21:32:22] Eiam: please refactor all my rubys
[21:32:36] apeiros: I can't. dminuoso has to show me haskell first.
[21:32:46] havenwood: Ah, found the article I was thinking of: https://yehudakatz.com/2012/01/10/javascript-needs-blocks/
[21:32:58] ur5us: has joined #ruby
[21:33:13] Eiam: apeiros: sounds like step into a dark alley type talk
[21:33:15] apeiros: havenwood: IMO the main grievances with JS functions/callbacks is boilerplate and binding :-/
[21:33:18] Eiam: bludgeon you with haskell and take your wallet
[21:33:27] cthu|: !!!! https://i.imgur.com/rtUPAWh.png
[21:33:36] cthu|: black magic woooorks!
[21:33:37] apeiros: Eiam: I might get eaten by a grue. I'll hold on tight to my candle.
[21:34:32] havenwood: JavaScript did get the arrow function, now all is once again right on the Internet.
[21:34:55] cthu|: I love irb
[21:35:17] cthu|: not ready to get a t-shirt yet though
[21:35:31] apeiros: havenwood: arrow function has a different binding? god, I got to reread about that then!
[21:36:21] RougeR: https://gist.github.com/CodePint/ad39157785be466bb68ddcc3c47522be
[21:36:26] RougeR: it just looks so wrong...
[21:37:11] apeiros: ACTION hands RougeR a `# end my_func`
[21:37:20] apeiros: you should try plsql
[21:37:20] RougeR: apeiros: i was seriously tempted
[21:37:29] anjen: has joined #ruby
[21:37:31] apeiros: you have to qualify all ends
[21:37:41] apeiros: as in `function foo … end foo;`
[21:37:56] apeiros: (same for `end if`, `end loop` etc.)
[21:38:04] cthu|: what's plsql?
[21:38:12] cthu|: maybe pg?
[21:38:18] apeiros: cthu|: oracle's proglang
[21:38:29] apeiros: pg has pgplsql
[21:38:38] apeiros: which tries to be compatible
[21:38:43] Eiam: I'd like for the end of functions to be backwards. dne and fi respectively
[21:38:46] cthu|: with oracle?
[21:38:51] apeiros: or largely compatible. though I think you need pg enterprise for that.
[21:39:02] cthu|: that sucks
[21:39:09] apeiros: cthu|: yes, with plsql. there's tons of legacy (and even new) code in plsql.
[21:39:11] cthu|: I didn't even know there was pg enterprise
[21:39:32] Cthulu201: has joined #ruby
[21:39:43] cthu|: is that a language one would use in stored procedures?
[21:39:51] apeiros: and triggers
[21:39:52] cthu|: ah, I see
[21:40:03] apeiros: and you absolutely don't want to write in it
[21:40:17] cthu|: I used to do it for mysql
[21:40:22] apeiros: ACTION remembers writing a basic "split" method in ~30 LOC
[21:40:24] apeiros: ACTION shudders
[21:40:25] cthu|: I hate DELIMITERS till today
[21:41:40] apeiros: havenwood: isn't yehuda part of TC39?
[21:41:47] jottr_: has joined #ruby
[21:41:56] apeiros: (that is the name of the group? or am I confusing things…?)
[21:42:01] havenwood: apeiros: I dunno!
[21:42:10] dminuoso: apeiros: Try this in Ruby:
[21:42:13] dminuoso: over (partsOf (worded . _head)) reverse "sony playstation"
[21:42:17] dminuoso: > "pony slaystation"
[21:42:54] cthu|: woooooooow
[21:42:59] Eiam: that reads like haskell
[21:43:04] Eiam: oh dminuoso ..
[21:43:10] desperek: has joined #ruby
[21:43:42] apeiros: dminuoso: I'm sure using one of baweaver's libs you could write that in less ruby 😇
[21:43:53] dminuoso: apeiros: Not with his libs.
[21:44:43] baweaver: apeiros: Yehuda is on TC39.
[21:45:00] apeiros: baweaver: yay
[21:45:47] baweaver: dminuoso: you should try this in Haskell - https://medium.com/square-corner-blog/challenge-table-of-contents-generator-c99171fde831
[21:45:52] t0xik: has joined #ruby
[21:47:26] dminuoso: baweaver: Why not.
[21:47:37] havenwood: Ooh, I see Haskell is a Tetris-complete lang: https://github.com/SamTay/tetris
[21:49:55] apeiros: somebody needs to write a proglang which is coded in tetronomicons
[21:50:06] weird_error: has joined #ruby
[21:54:50] s3krit: I think they're called tetronimos
[21:57:11] bijan_: has joined #ruby
[21:57:35] cthu|: folks, what's the meaning of ?i-mx:
[21:57:58] apeiros: s3krit: possible :D
[21:58:13] elomatreb: cthu|: In a regex? Sets mode flags, possibly for only a nesting group
[21:58:18] apeiros: cthu|: (?:) is a non-capturing group
[21:58:22] cthu|: aaaah, cool, thanks!
[21:58:28] apeiros: the stuff between ? and : says which flags are enabled and disabled
[21:58:43] apeiros: left of - is enabled, right is disabled. so this is with i flag, without mx flags
[21:58:50] cthu|: it's just I casted it into (oblivion) string and got it.
[21:58:59] cthu|: makes sense
[21:59:10] apeiros: it's the basis for how ruby allows you to construct larger regexes from smaller:
[21:59:28] apeiros: >> f = /foo/i; g = /bar#{f}/
[21:59:37] ruby[bot]: apeiros: # => /bar(?i-mx:foo)/ (https://eval.in/1028075)
[21:59:51] apeiros: so it retains the case-insensitiveness for the foo part
[21:59:58] cthu|: wooooooow
[22:00:03] cthu|: this is so cool
[22:00:06] havenwood: cthu|: so do ignore case, but don't treat a newline as a . matching char, and ignore whitespace and comments
[22:00:08] elomatreb: Check out the extended mode too, godsend tbh
[22:00:10] cthu|: not gonna use it, but it's amazing to know!
[22:00:31] apeiros: it is useful e.g. when you want to translate a BNF into a regex (think e.g. email validation)
[22:00:54] cthu|: yeh right
[22:00:55] elomatreb: .+@.+\..+ # done
[22:01:04] havenwood: A too little-known Ruby Regexp delimiter is: /o
[22:01:10] apeiros: elomatreb: lel
[22:01:25] apeiros: elomatreb: you have NO IDEA SIR, NO IDEA I TELL YOU!!!!1!elf!1!
[22:01:28] cthu|: that will match .@...
[22:01:29] havenwood: Perform interpolation only once! Without the /o it'll interpolate each time it's evaluated.
[22:01:54] elomatreb: Yeah, email matching is kind of a bad example because pretty much no matter what you do you do something wrong
[22:02:05] apeiros: elomatreb: no?
[22:02:10] apeiros: translate the BNF :)
[22:02:37] cthu|: Beautiful Non-email Form
[22:02:47] elomatreb: Then you can run into trouble with your application layer accepting email addresses, while the underlying delivery infrastructure does not
[22:02:52] apeiros: at least that's what I did. granted I adjusted it a bit since I actually don't want to allow all valid email addresses (e.g. no comments in the address please, also no newlines - yes, both exist)
[22:03:03] elomatreb: And depending on how good you log you can lose emails to oblivion
[22:03:17] apeiros: elomatreb: no. the problem is almost always the app layer.
[22:03:38] apeiros: MTAs are mostly capable of handling addresses. they usually struggle elsewhere :D
[22:03:58] apeiros: (not sure about utf-8 capab, tho, but IME that's quite good by now too)
[22:04:08] cthu|: what's MTA?
[22:04:16] dminuoso: This is an RFC compliant regex to test email addresses for validity: https://gist.github.com/dminuoso/39236f19a58ae8c3c66ad9752759a3f0
[22:04:58] elomatreb: A friend has an email address 🖕@...
[22:05:12] elomatreb: cthu|: Mail Transfer Agent
[22:05:28] elomatreb: The part of the stack that actually sends the email from your server to the destination server
[22:05:34] dminuoso: But in the end you care about deliverability, not conformity.
[22:05:54] dminuoso: Because most mail software is not RFC 822 compliant
[22:06:38] jenrzzz_: has joined #ruby
[22:06:57] AJA4350: has joined #ruby
[22:08:11] jidar: I doubt ... is a valid tld
[22:08:50] havenwood: headius: I've spotted some where JRuby+Graal definitely fly. I'll see if I can put together a few examples tonight.
[22:08:59] elomatreb: Did my bouncer swallow the emoji? It's <middle finger emoji>@, didn't want to share their email
[22:09:34] headius: havenwood: that would be great...I'm trying to show that we've got a good long future ahead of us just by leveraging Graal and making incremental improvements to JRuby
[22:09:44] headius: and also to show that Graal is great with or without Truffle
[22:11:17] jidar: elomatreb: oh, it generally depends on the terminal, lots of emoji don't show up
[22:11:35] elomatreb: It does locally for me, but I know ZNC likes to meddle with encoding
[22:12:08] apeiros: elomatreb: na, it showed just fine
[22:12:16] havenwood: Regexp is 30x faster to compile with the "o" option: https://gist.github.com/havenwood/187f5ac07ef671eb92d1d5c8f44f6664
[22:12:17] apeiros: elomatreb: but not everybody has proper fonts to see those :)
[22:12:48] havenwood: Freezing doesn't suffice either.
[22:14:07] nowhere_man: has joined #ruby
[22:15:19] headius: havenwood: yeah in that case I would assume it's basically doing nothing because there's no side-effect after initially compiling the regexp
[22:15:28] headius: graal (and truffle) are great at doing nothing
[22:15:44] Nicmavr: has joined #ruby
[22:18:37] havenwood: headius: In JRuby there doesn't seem to be as profound a difference between the two. About twice as slow instead of thirty times.
[22:18:48] havenwood: TruffleRuby doesn't optimize interpolated regexp yet.
[22:19:37] havenwood: (That benchmark is just an aside from the other convo.)
[22:20:02] headius: heh ok I wasn't sure
[22:24:57] jhack: has joined #ruby
[22:27:16] jenrzzz: has joined #ruby
[22:27:17] jenrzzz: has joined #ruby
[22:29:26] GodFather: has joined #ruby
[22:29:40] Lytol: has joined #ruby
[22:33:01] cschneid: has joined #ruby
[22:36:27] orbyt_: has joined #ruby
[22:38:18] zapata: has joined #ruby
[22:39:07] jottr_: has joined #ruby
[22:40:07] karapetyan: has joined #ruby
[22:44:27] cthu|: hey folks
[22:44:40] cthu|: how do I puts in color? :)
[22:45:13] apeiros: puts "\e[41mCOLOOOOR\e[0m"
[22:45:37] apeiros: 1 is bold, 30-39 is background, 40-49 is foreground
[22:45:48] apeiros: errr, bg & fg wrong way round :D
[22:46:33] apeiros: ; to separate multiple. e.g. \e[1;33;40m is bold yellow on black
[22:46:58] apeiros: and \e[0m resets, in case that wasn't clear.
[22:47:20] apeiros: there's a couple of gems out there to provide you with nice convenience methods for this
[22:47:28] cthu|: I saw them
[22:47:34] cthu|: but I prefer doing it raw
[22:48:07] SeepingN: I have a small file that I include when I want colors
[22:48:22] elomatreb: Windows does its own thing too, IIRC
[22:48:40] SeepingN: then I can do: puts "#{RED}This is in red #{RESET} but this is not"
[22:49:04] cschneid: has joined #ruby
[22:49:14] cthu|: this can help: http://ezprompt.net/
[22:49:40] cthu|: SeepingN, that works in Win?
[22:49:48] cthu|: like in cmd?
[22:49:53] knight33: has joined #ruby
[22:50:51] SeepingN: ain't nobody using ruby in windows!
[22:51:18] cthu|: linux made it a lot more comfy than unix
[22:51:18] shinnya: has joined #ruby
[22:51:20] cthu|: or is it bash
[22:53:08] SeepingN: well the prompt stuff is bash
[22:54:04] SeepingN: changing text colors with escape codes is via which TERMinal you have set
[22:54:10] SeepingN: and a client that understands it of course
[22:55:07] cagomez: has joined #ruby
[22:55:35] sanscoeur: has joined #ruby
[22:56:08] elomatreb: It is partially standardized, they're ANSI terminal code
[22:56:50] sanscoeur: has joined #ruby
[23:01:01] crankharder: has joined #ruby
[23:03:06] crankharder: has joined #ruby
[23:03:31] eckhardt: has joined #ruby
[23:03:59] cthu|: and how do I bold this? puts("\e[41m>>>Analytics test Failed\e[0m")
[23:06:30] cthu|: puts("\e[1m\e[41m>>>Analytics test Failed\e[0m")
[23:08:39] sanscoeur: has joined #ruby
[23:09:03] SeepingN: I have a small file of this:
[23:09:12] SeepingN: RESET ||= "\033[0m"
[23:09:12] SeepingN: RED ||= "\033[0;31;40m"; REDBG ||= "\033[0;37;41m"
[23:09:12] SeepingN: CLEAR ||= "\033[K"
[23:09:19] SeepingN: (other colors too of course)
[23:13:29] jhack: has joined #ruby
[23:14:27] sanscoeur: has joined #ruby
[23:23:55] cthu|: thanksI wonder why bash doesn't have the full rgb
[23:24:09] bijan_: has joined #ruby
[23:24:19] cthu|: like 255:255:255
[23:28:02] subroot: has joined #ruby
[23:35:58] bijan_: has joined #ruby
[23:42:55] darkhanb: has joined #ruby
[23:43:21] jhack: has joined #ruby
[23:44:33] root_: has joined #ruby
[23:44:47] root_: has joined #ruby
[23:47:14] izaac: has joined #ruby
[23:47:34] cthu|: folks folks folks!
[23:47:39] cthu|: there's to_json
[23:47:46] cthu|: but I wanna prettify it too :(
[23:49:16] cthu|: pretty_generate()!
[23:49:42] eckhardt: has joined #ruby
[23:51:04] al2o3-cr: cthu|: you can use jj for prettyfied json ;)
[23:51:14] cthu|: what's jj?
[23:51:44] al2o3-cr: try it `jj(json)`
[23:51:59] bijan_: has joined #ruby
[23:52:21] al2o3-cr: it's just a wrapper method around pretty_generate on Kernel.
[23:53:08] JamJam_kid: has joined #ruby
[23:53:14] clemens3_: has joined #ruby