« Back to channel list

#ruby-offtopic - 10 August 2018

« Back 1 day Forward 1 day »
[00:00:39] al2o3-cr: baweaver: it must be a misunderstanding.
[00:07:12] al2o3-cr: baweaver: no hard feelings, i'm wondering how i've bugged you?
[00:07:37] baweaver: Hm? Na, I meant am I being too harsh in regards to this_dude
[00:08:28] baweaver: so not related to you at all al2o3-cr
[00:08:37] baweaver: More of am I being too harsh in how I'm responding to them.
[00:09:12] al2o3-cr: baweaver: wow, took that totally the wrong way hehe
[00:09:38] baweaver: Well that clears that up
[00:09:59] al2o3-cr: baweaver: and no, like havenwood said asking for help *during* THEE test.
[00:10:26] baweaver: If they were smart they wouldn't mention it was the test
[00:14:47] al2o3-cr: about as much use as an ash tray on a motorbike
[00:15:21] al2o3-cr: and that's not their ruby.
[00:35:56] havenwood: al2o3-cr: I guess: scan(/\h\h/).map(&:hex)
[00:40:29] al2o3-cr: havenwood: yeah, i had enum_for(:scan, /\h{2}/).map &:hex #just to see if they knew the diff.
[00:41:08] al2o3-cr: because i don't know if they're trolling or not.
[01:04:35] havenwood: al2o3-cr: maybe it's an "is divisible by a whole number" thing and they're confused?
[01:04:48] havenwood: i refuse to read these images! hah
[01:05:19] al2o3-cr: iirc they couldn't use Math.sqrt or n ** 1/2.0
[01:06:04] al2o3-cr: havenwood: it's definitely squared numbers
[01:06:35] havenwood: so why are they bothering with modulo?
[01:06:45] havenwood: ¯\_(ツ)_/¯
[01:07:51] havenwood: i guess that's one way
[01:09:01] al2o3-cr: i can't find it now, something like max_num return the sum of perfect sqrs < max
[01:13:47] havenwood: you could check if prime_division has any ending in 2
[01:17:06] al2o3-cr: havenwood: you could use this path ofc
[01:25:45] al2o3-cr: havenwood: sorry about that, i thought they were referring to perfect squares.
[01:26:09] Radar: can't tell if this_dude is trolling
[02:44:15] al2o3-cr: >> "WUBIWUBHATEWUBWUBMYSELFWUB".gsub(/(WUB)+/, 32.chr).strip
[02:44:16] ruby[bot]: al2o3-cr: # => "I HATE MYSELF" (https://eval.in/1046212)
[02:44:35] al2o3-cr: >> "WUBIWUBHATEWUBWUBMYSELFWUB".scan(/([^WUB]+)/).join 32.chr
[02:44:36] ruby[bot]: al2o3-cr: # => "I HATE MYSELF" (https://eval.in/1046213)
[02:44:40] Radar: y u no squeeze
[02:45:14] al2o3-cr: easy peezy lemon squeezy ;)
[02:45:38] al2o3-cr: Radar: show me
[02:45:53] mroutis: my IQ just raised +20 points just by reading that, al2o3-cr
[02:46:01] Radar: ' '.squeeze(' ')
[02:46:07] Radar: ' '.squeeze(' ')
[02:47:30] al2o3-cr: still can't get squeeze to work.
[02:48:07] Radar: >> "WUBIWUBHATEWUBWUBMYSELFWUB".gsub("WUB", " ").squeeze(' ').strip
[02:48:09] ruby[bot]: Radar: # => "I HATE MYSELF" (https://eval.in/1046214)
[02:48:46] al2o3-cr: ah, ffs yeah +1 Radar
[02:49:11] Radar: It's my main squeeze
[02:50:17] al2o3-cr: they'll be back and probably with a different Q.
[02:50:26] Radar: absolutely.
[02:50:33] al2o3-cr: totally not in regard to this ha
[02:50:39] Radar: "omg I got stuck" <- every time they get stuck
[02:50:43] Radar: welcome to programming bruv
[02:51:04] baweaver: I'll at least grant that they're learning decently quickly
[02:51:42] al2o3-cr: what is with all the while loops?
[02:52:01] baweaver: they were told that blocks and enumerable functions weren't needed
[02:52:24] al2o3-cr: roger that, but this is code wars.
[02:52:53] baweaver: they think they need to do that to pass
[02:52:57] al2o3-cr: yeah, most likely
[02:58:44] baweaver: these problems overall have been fairly easy though
[03:00:34] al2o3-cr: it's only easy if you know the solution ;)
[03:00:42] al2o3-cr: >> "i hate myself".bytes.each_with_object('') { |b, s| s << b ^= 32 }.gsub /\0/, 32.chr
[03:00:43] ruby[bot]: al2o3-cr: # => "I HATE MYSELF" (https://eval.in/1046216)
[03:03:01] mroutis: are you all grinding codewars XP?
[03:04:49] Radar: No, not yet. but I am thinking this might be a good thing for my juniors to practice. The exercism exercises are good too.
[03:05:59] al2o3-cr: i did a few katas
[03:18:27] baweaver: I think I was around 4
[03:18:35] baweaver: then it got tedious and I lost patience.
[03:19:02] al2o3-cr: baweaver: same here
[03:19:21] al2o3-cr: baweaver: check this for a kata 4
[03:19:32] baweaver: It's like I don't get paid for these
[03:19:33] baweaver: so why bother?
[03:19:51] baweaver: https://www.codewars.com/users/baweaver
[03:20:00] al2o3-cr: convert ip address to a 32 bit integer.
[03:20:19] al2o3-cr: baweaver: yep.
[03:21:07] baweaver: ip.split.map { |s| s.to_i.to_s(2) }.join.to_i(2) # ish, probably backwards
[03:21:33] baweaver: well, split on .
[03:22:08] baweaver: >> '10.0.0.1'.split('.').map { |s| s.to_i.to_s(2) }.join.to_i(2)
[03:22:09] ruby[bot]: baweaver: # => 81 (https://eval.in/1046223)
[03:22:36] al2o3-cr: baweaver: na, an integer
[03:22:55] baweaver: I meant on the segments
[03:23:51] al2o3-cr: my solution was; ip.split(?.).map(&:to_i).pack('C4').unpack1(?N)
[03:24:05] baweaver: >> 0.to_s(2).rjust(8, '0')
[03:24:11] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[03:24:13] baweaver: >> 0.to_s(2).rjust(8, '0')
[03:24:19] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[03:24:32] baweaver: I don't really know much about packing
[03:24:37] baweaver: So not the first tool I grab
[03:25:28] al2o3-cr: think as 'C' as unsigned char in C
[03:26:18] al2o3-cr: N is a 32 unsigned integer but network order (big endien)
[03:27:32] baweaver: So memorizing all those danged byte charts in College may be good for something
[03:28:50] al2o3-cr: baweaver: pack/unpack is only really usefull for lower level stuff.
[03:29:23] al2o3-cr: you rarely ever need it.
[03:29:49] baweaver: https://www.codewars.com/kata/the-boolean-order/train/ruby
[05:05:24] eckhardt: has joined #ruby-offtopic
[05:33:25] apeiros: has joined #ruby-offtopic
[07:25:51] mikecmpbll: has joined #ruby-offtopic
[07:36:48] burgestrand: has joined #ruby-offtopic
[07:50:11] mikecmpbll: has joined #ruby-offtopic
[10:11:52] apeiros: has joined #ruby-offtopic
[11:47:07] burgestrand: has joined #ruby-offtopic
[14:02:39] burgestrand: has joined #ruby-offtopic
[14:38:53] burgestrand: has joined #ruby-offtopic
[15:33:25] apeiros_: has joined #ruby-offtopic
[15:45:03] mroutis: has joined #ruby-offtopic
[15:58:59] apeiros_: has joined #ruby-offtopic
[16:11:59] apeiros_: has joined #ruby-offtopic
[17:15:46] mikecmpbll: has joined #ruby-offtopic
[18:01:28] mroutis: has joined #ruby-offtopic
[19:51:34] eam: has joined #ruby-offtopic
[19:55:04] mroutis: has joined #ruby-offtopic
[20:30:24] eckhardt_: has joined #ruby-offtopic
[21:57:37] mroutis: has joined #ruby-offtopic