« Back to channel list

#ruby - 02 December 2018

« Back 1 day Forward 1 day »
[00:01:30] gnufied: has joined #ruby
[00:23:24] orbyt_: has joined #ruby
[00:25:27] dbz: has joined #ruby
[00:26:31] cnsvc_: has joined #ruby
[00:27:42] akem: has joined #ruby
[00:29:47] desnudopenguino: has joined #ruby
[00:32:17] jaddison: has joined #ruby
[00:32:23] bmurt: has joined #ruby
[00:39:52] dviola: has joined #ruby
[00:40:21] white_lilies: has joined #ruby
[00:48:39] AJA4350: has joined #ruby
[00:49:43] AJA4350: has joined #ruby
[00:52:48] arescorpio: has joined #ruby
[00:54:21] dbz: has joined #ruby
[01:06:46] jamessral: has joined #ruby
[01:07:05] jamessral: anyone else doing Advent of Code 2-018?
[01:19:36] baweaver: jamessral: I might be after I get done with some prep work for some speaking engagements next week
[01:19:47] havenwood: jamessral: Is it that time already?
[01:19:49] baweaver: but feel free to post solutions if you want critiques
[01:19:52] baweaver: It's December
[01:20:07] baweaver: havenwood: I'm still adjusting to that one
[01:20:14] havenwood: baweaver: :)
[01:20:42] baweaver: Means I got some serious work to do before Wednesday
[01:22:29] gnufied: has joined #ruby
[01:22:53] jamessral: Haha yeah. Hard to believe it's December already
[01:23:08] jamessral: I just did the two for today. Figured I'd brush up on my ruby since I do mostly JS (React)
[01:23:25] jamessral: I'm sure my solutions were quite ugly, but they worked. Very scripty though
[01:24:10] baweaver: Want some Ruby fun?
[01:24:42] baweaver: My RubyConf talk just came out - https://www.youtube.com/watch?v=x3b9KlzjJNM
[01:24:42] baweaver: Filled with all forms of whimsy and fun
[01:24:52] jamessral: I'm gonna check that out right now!
[01:24:54] baweaver: Teaching reduce and functional programming with cartoon lemurs
[01:25:36] jamessral: I love both FP and Ruby shenanigans
[01:25:52] cnsvc_: has joined #ruby
[01:27:21] dbz: has joined #ruby
[01:28:25] jamessral: https://www.youtube.com/watch?v=x3b9KlzjJNM
[01:28:25] jamessral: https://www.youtube.com/watch?v=x3b9KlzjJNM
[01:28:40] jamessral: Sorry, didn't mean to paste that here, struggling with tmux XD
[01:28:57] baweaver: Had to hack mine to paste in Pry a few weeks back :P
[01:29:17] jamessral: Yeah, I need to make it easier for me to copy and paste with the system keyboard
[01:29:29] baweaver: Lemme find that real quick
[01:29:36] jamessral: *system clipboard
[01:29:50] jamessral: it's Ctrl+<prefix> [
[01:30:13] jamessral: when in copy mode, but I need to add it to the system clipboard. Right now it's just going to tmux's clipboard
[01:32:01] baweaver: https://gist.github.com/baweaver/8fe87a645be2147ec8e295690391ef0c
[01:32:51] baweaver: It wires up to pbcopy/paste, but theoretically can work in *nix as well with their utils
[01:37:15] Fusl: has joined #ruby
[01:38:10] ElFerna: has joined #ruby
[01:39:26] carbone5: has joined #ruby
[01:41:36] ua: has joined #ruby
[01:42:41] jamessral: baweaver: This reminds me very much of _why
[01:42:44] jamessral: which is a great thing
[01:42:58] baweaver: tell me when you notice Indigo's house's little secrets
[01:43:04] baweaver: watch closely the pictures in the back
[01:43:45] jamessral: chunky bacon!
[01:44:03] dbz: has joined #ruby
[01:47:13] AJA4350: has joined #ruby
[01:48:06] baweaver: jamessral: If you pay attention to the main map image you'll see Indigo fishing from a blimp and Master Branch waving hi
[01:50:28] jamessral: ha, excellent
[02:01:41] s3nd1v0g1us: has joined #ruby
[02:07:58] baweaver: jamessral: I hid all types of things in that talk, good luck finding them all :)
[02:18:36] irdr: has joined #ruby
[02:19:27] jamessral: That's what I like to hear.
[02:19:40] jamessral: Gotta hop off for tonight. Night, y'all :D
[02:21:08] AJA4350: has joined #ruby
[02:29:00] white_lilies: ruby is such a pleasure to use, I've missed it
[02:29:04] graphene: has joined #ruby
[02:30:39] thejs: has joined #ruby
[02:30:41] roshanavand: has joined #ruby
[02:31:29] Axsuul: has joined #ruby
[02:36:06] ur5us: has joined #ruby
[02:41:02] eckhardt: has joined #ruby
[02:48:26] argoneus: has joined #ruby
[02:50:01] TheNet: has joined #ruby
[02:51:32] arescorpio: has joined #ruby
[02:54:43] graphene: has joined #ruby
[03:02:15] patr0clus: has joined #ruby
[03:02:31] Fusl: has joined #ruby
[03:20:24] s3nd1v0g1us: has joined #ruby
[03:30:06] dbz: has joined #ruby
[03:30:54] akaiiro: has joined #ruby
[03:35:18] Wafficus: has joined #ruby
[03:35:29] Wafficus: hi there, what's a good beginner book for Ruby programming language?
[03:36:01] ua_: has joined #ruby
[03:37:24] cnsvc_: has joined #ruby
[03:41:03] carbone5: The Well-Grounded Rubyist
[03:42:39] hutch: has joined #ruby
[03:57:20] apparition47: has joined #ruby
[03:57:55] dbz: has joined #ruby
[04:02:34] havenwood: Or Eloquent Ruby
[04:03:26] Renich: has joined #ruby
[04:05:32] awkwords: has joined #ruby
[04:09:00] braincrash: has joined #ruby
[04:12:52] akem: has joined #ruby
[04:16:35] dbz: has joined #ruby
[04:19:52] Azure: has joined #ruby
[04:22:57] graphene: has joined #ruby
[04:30:08] dbz: has joined #ruby
[04:34:18] roshanavand1: has joined #ruby
[04:34:42] akaiiro: has joined #ruby
[04:52:07] akaiiro: has joined #ruby
[04:53:35] dbz: has joined #ruby
[04:56:17] cnsvc_: has joined #ruby
[05:05:46] dbz: has joined #ruby
[05:21:58] cnsvc_: has joined #ruby
[05:36:11] _whitelogger: has joined #ruby
[05:41:51] planigan: has joined #ruby
[05:48:12] planigan: has joined #ruby
[06:35:45] za1b1tsu: has joined #ruby
[06:40:47] eam: hello ruby friends
[06:41:08] eam: so I'm doing the advent of code and I realized that ruby doesn't seem to have a string xor operator
[06:44:01] dbz: has joined #ruby
[06:45:30] eam: in perl I might do: my $diff = $line ^ $line2; my $count = $diff =~ tr/\c@//;
[06:45:45] eam: wondering what's the most efficient way to do this in ruby?
[06:45:55] graphene: has joined #ruby
[06:46:12] eam: what this does is nul out any matching characters between the two lines, then counts them with tr
[06:47:11] eam: so the number of non-matching characters is the length of the string, minus the nul count
[06:50:32] havenwood: eam: ah, right - so something like?: class String; def xor s; bytes.zip(s.bytes).map { |a, b| (a ^ b).chr }.join end end
[06:51:44] baweaver: String xor? What would it do?
[06:52:11] baweaver: first thought is converting it to bytes and xor'ing the stream, but not sure if that's what ya mean
[06:52:17] eam: havenwood: yeah that's got it, it looks slow though
[06:52:45] eam: baweaver: for each byte in each string, xor with the byte from the other string
[06:53:12] eam: ideally vectorized so it can be fast
[06:53:36] baweaver: probably String#chars and xor the results
[06:54:05] reber: has joined #ruby
[06:54:08] baweaver: Trying to figure out what part two of day 1 is even asking
[06:54:36] baweaver: For Day One part Two?
[06:54:37] baweaver: or is this day two?
[06:54:45] havenwood: baweaver: find the only two strings that differ by a single character
[06:54:56] eam: I published all my solutions on github but they're entirely unintelligible perl muahahah
[06:56:40] havenwood: baweaver: then solution is one of those two strings, with the differing letter omitted
[06:56:50] baweaver: Ah, you're looking at day two
[06:56:57] baweaver: I was looking at part two of day _one_
[06:57:10] havenwood: Did one have a second part?
[06:57:14] baweaver: I was thinking I'm not quite that lost
[06:57:22] havenwood: I can't remember back that long ago :P
[06:57:27] havenwood: A whole day!
[06:57:34] baweaver: Leaving it alone because I can't figure out what it's even asking
[06:57:47] baweaver: First instinct on string diffing is Levenshtein distance
[06:57:54] havenwood: oh yeah - it did have a part 2
[06:59:32] eam: a = Time.now; 1_000_000.times { "fobobbbbbaaaaaa".xor "foaobbbbbaaaaaa" }; a - Time.now # -5.511226
[06:59:53] eam: time perl -e'for ($i=0; $i <100_000_000; $i++) {"fobobbbbbaaaaaa" ^ "foaobbbbbaaaaaa"}' # 0m2.542s
[07:00:08] eam: perl with two orders magnitude more iters
[07:00:15] baweaver: you got the time backwards there
[07:00:21] eam: I kinda wanna implement a fast xor for ruby strings
[07:00:23] eam: baweaver: yeah
[07:00:51] havenwood: eam: https://github.com/fny/xorcist
[07:01:34] eam: oh SNAP
[07:01:36] baweaver: havenwood: Wait, if it's finding which strings are separate by only a character what's up with the checksum bit?
[07:02:03] eam: so my time benchmark to beat for the advent day two part two is 0m0.012s
[07:02:12] baweaver: "Of these box IDs, four of them contain a letter which appears exactly twice, and three of them contain a letter which appears exactly three times. Multiplying these together produces a checksum of 4 * 3 = 12."
[07:02:38] eam: baweaver: for part one, you're finding two sums
[07:02:42] baweaver: Ah, so you're on 2.2
[07:02:42] baweaver: oi, you lot confuse me
[07:03:09] baweaver: sum of twice occurring and thrice occurring letters?
[07:03:20] eam: part one is pretty straightforward ruby/perl/whatever
[07:03:30] eam: yeah, but only one count per string
[07:03:40] eam: twice occuring in the same string counts as one
[07:03:49] eam: *twice occuring twice
[07:04:35] eam: part two starts getting into speed issues if the string traversal isn't efficient
[07:06:56] eam: havenwood: holy cow, very fast
[07:07:38] eam: xorcist is 50% slower than perl, that's same order magnitude so w/e
[07:08:02] eam: a billion xors of a 16 byte string in 33s vs 25s for perl
[07:10:42] baweaver: So part two is finding the only two strings with a distance of 1?
[07:10:43] baweaver: basically permutations?
[07:11:33] baweaver: If that's the case, I wonder if DL distance is even remotely in the same camp: https://github.com/dbalatero/levenshtein-ffi
[07:12:48] baweaver: Though to be fair it'd be overkill on calculation steps as it tries to hit on insertion, deletion, and replacement
[07:13:37] baweaver: though they're being sneaky calling it levenshtein, considering it has a transposition clause in there.
[07:14:17] baweaver: Really danged handy algo for diffing MAC addresses whenever people have been inputting things by hand and you want to find the closest thing to what they should have put in there
[07:14:27] eam: baweaver: see if you can write a solver that runs in 11ms :)
[07:14:55] baweaver: Short of breaking out Rust I probably can't
[07:15:06] havenwood: baweaver: it's damerau-levenshtein, not plain levenshtein, if it includes transposition
[07:15:15] havenwood: baweaver: this is more simple hamming distance
[07:15:18] baweaver: hence sneaky
[07:16:00] baweaver: Anyways, still have a ton of art to ream through before Wednesday so back to it I go
[07:16:05] eam: what's the fastest way to sum occurences of a byte in a string?
[07:16:42] baweaver: immediate thought is HashMap solutions
[07:17:11] eam: well just one byte, so the only state is gonna be an integer
[07:17:52] baweaver: Bit twiddling tricks?
[07:17:56] baweaver: Mask that byte
[07:18:12] eam: I wonder if it's still tr
[07:27:05] Tom-_: has joined #ruby
[07:27:25] roshanavand: has joined #ruby
[07:29:57] graphene: has joined #ruby
[07:41:30] CrazyEddy: has joined #ruby
[07:49:25] dinfuehr: has joined #ruby
[07:55:53] dinfuehr_: has joined #ruby
[07:57:15] conta: has joined #ruby
[07:58:13] Puffball: has joined #ruby
[08:01:51] dinfuehr: has joined #ruby
[08:14:13] gix: has joined #ruby
[08:17:19] akem: has joined #ruby
[08:19:18] kapil____: has joined #ruby
[08:37:04] fluxAeon: has joined #ruby
[08:37:15] cnsvc: has joined #ruby
[08:39:36] dellavg_: has joined #ruby
[08:48:59] alem0lars: has joined #ruby
[09:20:29] chouhoulis: has joined #ruby
[09:21:47] dbz: has joined #ruby
[09:45:55] conta1: has joined #ruby
[09:50:10] rippa: has joined #ruby
[09:52:00] lxsameer: has joined #ruby
[09:55:26] leftylink: has joined #ruby
[10:06:22] LinuxKnight: has joined #ruby
[10:18:57] akemot: has joined #ruby
[10:22:33] mangold: has joined #ruby
[10:23:02] akemot: has joined #ruby
[10:38:53] jetchisel: has joined #ruby
[10:41:29] roshanavand: has joined #ruby
[10:54:23] zapata: has joined #ruby
[10:55:28] phaul: has joined #ruby
[11:23:22] cnsvc: has joined #ruby
[11:26:03] peirama: has joined #ruby
[11:32:32] mangold: has joined #ruby
[11:34:41] Nicmavr: has joined #ruby
[11:40:00] hiroaki: has joined #ruby
[11:42:28] mangold: has joined #ruby
[11:43:06] ur5us: has joined #ruby
[12:00:51] al2o3-cr: has joined #ruby
[12:37:04] RougeR: has joined #ruby
[12:46:42] AJA4350: has joined #ruby
[12:50:33] cnsvc: has joined #ruby
[12:57:42] cliluw: has joined #ruby
[13:09:02] InfinityFye: has joined #ruby
[13:19:32] akemot: has joined #ruby
[13:30:36] Inline: has joined #ruby
[13:35:11] gnufied: has joined #ruby
[13:43:28] yxhuvud: has joined #ruby
[13:43:38] ur5us: has joined #ruby
[13:46:21] jetchisel: has joined #ruby
[13:51:44] cnsvc: has joined #ruby
[13:55:31] cnsvc: has joined #ruby
[13:59:37] marz_d`ghostman: In Rspec when testing a module, like Rspec.describe Foo::Bar . . . why do I get an error with let(:bar) { Bar.new() }?
[14:00:44] peirama: marz_d`ghostman:
[14:00:50] peirama: What error message are you getting?
[14:02:07] marz_d`ghostman: peirama: I have let(:bar) { subject.new(args) }, but I'm getting an error saying wrong number of arguments(given 0,expected1) even if I'm passing in an argument
[14:05:33] syndikate: has joined #ruby
[14:06:35] matthewd: has joined #ruby
[14:06:58] pistachio: has joined #ruby
[14:08:58] Ropeney: has joined #ruby
[14:15:35] KeyJoo: has joined #ruby
[14:23:33] carbone5: has joined #ruby
[14:32:26] APK: has joined #ruby
[14:39:22] akemot: has joined #ruby
[14:57:43] cnsvc: has joined #ruby
[14:59:36] Sylario: has joined #ruby
[15:01:19] dinfuehr_: has joined #ruby
[15:10:58] ua: has joined #ruby
[15:12:00] gnufied: has joined #ruby
[15:14:49] danguita: has joined #ruby
[15:17:01] hutch: has joined #ruby
[15:42:52] white_lilies: has joined #ruby
[15:56:04] carbone5: has joined #ruby
[16:10:50] jottr: has joined #ruby
[16:17:42] themsay: has joined #ruby
[16:26:00] carbone5: has joined #ruby
[16:32:09] cnsvc: has joined #ruby
[16:48:10] _whitelogger: has joined #ruby
[16:48:54] Dbugger: has joined #ruby
[17:01:57] pisculichi: has joined #ruby
[17:04:11] dinfuehr: has joined #ruby
[17:10:11] akaiiro: has joined #ruby
[17:10:15] fmccann: has joined #ruby
[17:14:59] gnufied: has joined #ruby
[17:20:40] patr0clus: has joined #ruby
[17:42:50] akemot: has joined #ruby
[17:44:22] hutch: has joined #ruby
[17:49:48] dinfuehr_: has joined #ruby
[17:52:25] akem: has joined #ruby
[17:53:01] ghormoon: has joined #ruby
[17:58:45] za1b1tsu: has joined #ruby
[17:59:56] dinfuehr: has joined #ruby
[18:01:42] jaddison: has joined #ruby
[18:02:16] cnsvc: has joined #ruby
[18:02:46] akaiiro: has joined #ruby
[18:03:19] jcarl43: has joined #ruby
[18:05:56] graphene: has joined #ruby
[18:07:54] Azure: has joined #ruby
[18:17:42] peirama: has joined #ruby
[18:20:32] peirama: has joined #ruby
[18:26:41] patr0clus: has joined #ruby
[18:27:56] graphene: has joined #ruby
[18:35:24] carbone5: has joined #ruby
[18:39:30] Fusl: has joined #ruby
[18:44:05] bak1an: has joined #ruby
[18:48:39] carbone5: has joined #ruby
[18:52:21] brandonkal: has joined #ruby
[18:57:04] fredmorcos: has joined #ruby
[19:02:57] za1b1tsu: has joined #ruby
[19:03:56] akemot: has joined #ruby
[19:05:18] ua: has joined #ruby
[19:13:47] white_lilies: has joined #ruby
[19:16:32] za1b1tsu: has joined #ruby
[19:21:10] reber: has joined #ruby
[19:22:14] jaddison: has joined #ruby
[19:31:48] cnsvc: has joined #ruby
[19:37:57] Pisuke: has joined #ruby
[19:51:49] Freshnuts: has joined #ruby
[19:52:49] chouhoulis: has joined #ruby
[19:57:55] akem: has joined #ruby
[20:00:15] blackmesa: has joined #ruby
[20:01:14] dviola: has joined #ruby
[20:03:09] DTZUZO: has joined #ruby
[20:07:27] hurricanehrndz: has joined #ruby
[20:07:39] hutch: has joined #ruby
[20:09:34] blackmesa: has joined #ruby
[20:14:56] carbone5: has joined #ruby
[20:18:15] Aqo: has joined #ruby
[20:20:24] jaddison: has joined #ruby
[20:20:54] cd: has joined #ruby
[20:21:11] gnufied: has joined #ruby
[20:24:41] orbyt_: has joined #ruby
[20:25:05] cnsvc: has joined #ruby
[20:38:35] ur5us: has joined #ruby
[20:42:45] jaddison: has joined #ruby
[20:44:10] carbone5: has joined #ruby
[21:15:25] kapil____: has joined #ruby
[21:21:43] jottr: has joined #ruby
[21:26:12] Renich: has joined #ruby
[21:30:15] Renich: has joined #ruby
[21:32:20] akem: has joined #ruby
[21:57:33] jetchisel: has joined #ruby
[21:57:57] jottr: has joined #ruby
[22:05:04] cnsvc: has joined #ruby
[22:08:33] jaddison: has joined #ruby
[22:12:36] nowhere_man: has joined #ruby
[22:14:09] jottr: has joined #ruby
[22:15:01] Nicmavr: has joined #ruby
[22:16:49] Arkantos_: has joined #ruby
[22:18:00] Arkantos_: has joined #ruby
[22:23:06] vikaton: has joined #ruby
[22:29:30] nowhere_man: has joined #ruby
[22:34:41] jottr: has joined #ruby
[22:37:00] white_lilies: has joined #ruby
[22:37:37] wolfshappen_: has joined #ruby
[22:38:25] dbz: has joined #ruby
[22:51:48] hutch: has joined #ruby
[22:58:29] twe4ked: has joined #ruby
[23:02:54] graphene: has joined #ruby
[23:12:33] jottr: has joined #ruby
[23:25:31] paulscoder: has joined #ruby
[23:25:46] hutch: has joined #ruby
[23:27:47] justinmcp: has joined #ruby
[23:35:05] justinmcp: has joined #ruby
[23:36:41] ua: has joined #ruby
[23:40:51] Sembei: has joined #ruby
[23:49:33] phaul: has joined #ruby
[23:52:25] gnufied: has joined #ruby