al2o3-cr

Activity Graph

Page 1 of 59 | Next »

2019-01-18

[12:02:37] al2o3-cr: Quit: WeeChat 2.3
[12:06:00] al2o3-cr: has joined #ruby-offtopic
[12:06:00] al2o3-cr: has joined #ruby
[12:36:39] al2o3-cr: phaul: why is it parsing like this? pp Ripper.sexp(%q`testing `testing`)
[12:37:42] al2o3-cr: &>> require'ripper'; Ripper.sexp("`testing`")
[12:38:01] al2o3-cr: i don't understand.
[12:40:48] al2o3-cr: &>> Ripper.sexp(%(testing `testing`))
[12:40:58] al2o3-cr: &>> require'ripper';Ripper.sexp(%(testing `testing`))
[12:44:34] al2o3-cr: that explains why. ;)
[12:54:54] al2o3-cr: yeah, i see that.
[12:57:39] al2o3-cr: how about with %x()
[12:59:49] al2o3-cr: yeah, true.
[13:22:12] al2o3-cr: phaul: sub(s, '\\\`')
[13:33:07] al2o3-cr: &>> s = "`"; puts s.sub(s, '\\\`')
[13:35:59] al2o3-cr: and probably change the delimiters to %q to make it less confusing.
[13:37:43] al2o3-cr: phaul: you can also use String#dump for that instead of requiring json.
[13:40:52] al2o3-cr: ah, thought it was directly on a string.
[13:54:52] al2o3-cr: phaul: yay, but wouldn't just changing the delimiters to %q be easier :P
[13:55:27] al2o3-cr: yeah but you're using %q``
[13:55:52] al2o3-cr: it could be %q() %q|| %q** anything but `
[13:59:11] al2o3-cr: phaul: oh, i see now why you're doing it this way.
[14:02:51] al2o3-cr: RougeR: foo.singleton_class.prepend Bar
[14:11:41] al2o3-cr: RougeR: your way also works.
[15:28:59] al2o3-cr: well i never knew scrypt was in openssl.
[15:33:27] al2o3-cr: &list scrypt
[15:33:43] al2o3-cr: i tell you what that is a handy bot.

2019-01-17

[13:07:06] al2o3-cr: Quit: WeeChat 2.3
[13:10:42] al2o3-cr: has joined #ruby-offtopic
[13:10:42] al2o3-cr: has joined #ruby

2019-01-16

[21:24:13] al2o3-cr: ponzii: yeah.
[21:28:07] al2o3-cr: &>> self.class
[21:29:09] al2o3-cr: ponzii: yeah, ok.
[21:48:32] al2o3-cr: doesn't matter in that instance but whatever.
[21:49:05] al2o3-cr: SeepingN: it doesnn't
[21:52:30] al2o3-cr: SeepingN: you might be thinking of bitwise left shift.
[21:52:44] al2o3-cr: it's a method call.
[21:55:01] al2o3-cr: devil_tux: just do what is readable.
[22:00:16] al2o3-cr: leftylink: wrong.
[22:05:51] al2o3-cr: phaul: obviously not.
[22:06:27] al2o3-cr: leftylink: i should of read your answer more clearly ;(
[22:08:22] al2o3-cr: leftylink: it still understandable. it was me flashing through it ;)
[22:09:04] al2o3-cr: still, @instance could of been anything.
[22:10:06] al2o3-cr: phaul: i generally do.
[22:17:21] al2o3-cr: it's ruby do whatever you like :P
[22:19:00] al2o3-cr: Hoffman: `a = [1,2,3,4]; a << a.shift' is that worthy?
[22:20:23] al2o3-cr: is that a bang?
[22:22:24] al2o3-cr: Hoffman: nm. ponzii
[22:26:05] al2o3-cr: Hoffman: never args only objects.
[22:26:27] al2o3-cr: Hoffman: no booleans in Ruby.
[22:28:07] al2o3-cr: C as 0 or 1
[22:29:10] al2o3-cr: no, no booleans
[22:29:58] al2o3-cr: Hoffman: ruby as baboons, only.
[22:31:00] al2o3-cr: phaul: no, baboons only.
[22:34:09] al2o3-cr: oh, and lemurs ;)
[22:35:16] al2o3-cr: &>> true == false # baboons
[22:35:41] al2o3-cr: so there you go Baboons.
[22:46:05] al2o3-cr: ACTION is hanging out with a baboon
[22:59:05] al2o3-cr: phaul: true.
[22:59:41] al2o3-cr: it raises as it should do.
[23:01:14] al2o3-cr: phaul: i think they were simply implying if @instance was nil.
[23:03:20] al2o3-cr: or any other object for that matter that doesn't respond to #<<
[23:04:29] al2o3-cr: &>> :foo << :bar
[23:24:36] al2o3-cr: require 'fiddle'; include Fiddle; r = (1..10); include Fiddle; [16,24].zip([rand(100).__id__, rand(100).__id__]).each { |b, v| Pointer[dlwrap r][b] = v }; r
[23:24:47] al2o3-cr: &>> require 'fiddle'; include Fiddle; r = (1..10); include Fiddle; [16,24].zip([rand(100).__id__, rand(100).__id__]).each { |b, v| Pointer[dlwrap r][b] = v }; r
[23:26:45] al2o3-cr: havenwood: based on your snippet :)
[23:27:26] al2o3-cr: Hoffman: requiring the lib, then including the module.
[23:28:07] al2o3-cr: oh, shit so i do :(
[23:31:06] al2o3-cr: first 16 bytes are always RBasic.
[23:32:22] al2o3-cr: so doing obj.object_id is where it is memory.
[23:33:07] al2o3-cr: anyway i'm watching snooker now ;)
[23:36:43] al2o3-cr: selby or ronnie for sure.
[23:40:02] al2o3-cr: phaul: the talent these days are unblievable.
[23:46:22] al2o3-cr: havenwood: good!
[23:46:57] al2o3-cr: selby is awesome!!
[23:53:32] al2o3-cr: &>> require'fiddle'; a = {}; Fiddle::Pointer[Fiddle.dlwrap a].to_s == Fiddle::Pointer[a.object_id<<1].to_s
[23:56:31] al2o3-cr: 133 break, magnificient

2019-01-15

[00:35:59] al2o3-cr: phaul: take me with you phaul ;)
[04:15:11] al2o3-cr: &>> require 'net/http/status'; Net::HTTP::STATUS_CODES[200]
[04:16:15] al2o3-cr: &>> require 'net/http/status'; Net::HTTP::STATUS_CODES[404]
[04:18:30] al2o3-cr: baweaver: to_h now :)
[04:19:04] al2o3-cr: require 'net/http/status'; [200, 404, 418, 503].to_h { |code| [code, Net::HTTP::STATUS_CODES[code]] }
[04:19:11] al2o3-cr: &>> require 'net/http/status'; [200, 404, 418, 503].to_h { |code| [code, Net::HTTP::STATUS_CODES[code]] }
[20:21:15] al2o3-cr: hope all is well with apeiros.
[20:31:50] al2o3-cr: yeah, not been active for a while now.

2019-01-14

[23:14:16] al2o3-cr: jabowa: DateTime.parse('Mon, 14 Jan 2019 14:59:00 -0500').iso8601
[23:16:51] al2o3-cr: Class.new.method ?
[23:21:15] al2o3-cr: leftylink: why are you using ruby -e?
[23:24:18] al2o3-cr: yusuke endoh is a god!
[23:25:50] al2o3-cr: that quine with about god knows how many languages. just WOW!
[23:35:21] al2o3-cr: phaul: yeah, i was just be nosey looking through your repo for rubydoc ;)
[23:47:46] al2o3-cr: Quit: WeeChat 2.3
[23:51:40] al2o3-cr: has joined #ruby-offtopic
[23:51:40] al2o3-cr: has joined #ruby

2019-01-13

[00:00:09] al2o3-cr: sometimes eval.in works others not.
[00:01:15] al2o3-cr: i was going to try something then, now i've forgot :/
[00:05:09] al2o3-cr: >> [1,2,3].map { |n, @a = 5| }
[00:05:15] al2o3-cr: 18>> [1,2,3].map { |n, @a = 5| }
[00:06:27] al2o3-cr: i'm sure you could pass instance variables to blocks but i could be wrong.
[00:31:11] al2o3-cr: baweaver: check this out
[00:31:18] al2o3-cr: &>> def add(x,y) x + y end; TracePoint.trace(:call) { |tp| tp.self.method(tp.method_id).parameters.each { |_, p| tp.binding.local_variable_set(p, rand(100)) if tp.method_id == :add } }; add 10, 20
[00:31:34] al2o3-cr: &>> def add(x,y) x + y end; TracePoint.trace(:call) { |tp| tp.self.method(tp.method_id).parameters.each { |_, p| tp.binding.local_variable_set(p, rand(100)) if tp.method_id == :add } }; add 10, 20
[00:35:45] al2o3-cr: put that in some rails app lol ;)
[00:46:13] al2o3-cr: which reads better out of these two:
[00:46:21] al2o3-cr: "foo\v\tbar\n baz".chars.any? &/\p{Space}/.method(:match?)
[00:46:31] al2o3-cr: !"foo\v\tbar\n baz".scan(/\p{Space}/).empty?
[00:53:47] al2o3-cr: havenwood: nice!
[00:54:18] al2o3-cr: ah, jeez yeah.
[00:55:14] al2o3-cr: i forgot it takes an object
[00:56:12] al2o3-cr: &>> [1,2.1,4.5,"d",:i].grep Float
[00:57:10] al2o3-cr: phaul: that is Class
[00:57:54] al2o3-cr: &>> [Float].grep Class
[01:09:52] al2o3-cr: phaul: true for totally immutable objects.
[01:16:21] al2o3-cr: arrays hold reference ranges don't
[01:17:24] al2o3-cr: it's MRI internal strings and arrays are funcky.
[01:20:15] al2o3-cr: yeah it works on eql?
[01:22:13] al2o3-cr: equal? sorry.
[01:27:46] al2o3-cr: baweaver: nothing wrong with constants (if thats what they are constants)
[01:29:12] al2o3-cr: i'd say it slower at an educated guess.
[01:31:09] al2o3-cr: oh yeah, not saying that.
[01:35:50] al2o3-cr: baweaver: you've got more gems than the queen ;)
[01:37:34] al2o3-cr: i need to write a gem.
[01:40:07] al2o3-cr: i was half way into a gem "around argon2 key div"
[01:40:57] al2o3-cr: then guess what someone beat me to it :)
[01:43:03] al2o3-cr: just a simple one for db no secret key (otherwise i'd have to wrap it) and though nah.
[01:44:13] al2o3-cr: anyways a poll, what is everyones favourite gem?
[01:44:32] al2o3-cr: mine is packetfu.
[01:46:32] al2o3-cr: oh, i forgot, nokogiri.
[01:49:05] al2o3-cr: top five in order: packetfu, nokogiri, pry, spaghetti, bolognese.
[01:53:53] al2o3-cr: TheBrayn: no, i'm being daft. pasta was on my mind ;)
[01:54:52] al2o3-cr: should be a gem namely pecorino though.
[02:03:32] al2o3-cr: phaul: are you using parslet for rubydoc?
[21:51:04] al2o3-cr: Quit: WeeChat 2.3
[21:54:29] al2o3-cr: has joined #ruby-offtopic
[21:54:29] al2o3-cr: has joined #ruby

2019-01-12

[00:10:39] al2o3-cr: Rich_Morin_: Have you tried using String#scrub ?
[00:12:32] al2o3-cr: &>> "foo\xffbar\xfebaz\xfd".scrub('')
[00:13:02] al2o3-cr: wtf, that works.
[00:14:10] al2o3-cr: &>> "foo\xffbar\xfebaz\xfd".force_encoding('utf-8').scrub('')
[00:15:45] al2o3-cr: &>> "foo\xff".b.gsub /\xff/n, ''
[00:17:24] al2o3-cr: encode to binary then use n modifier.
[00:20:49] al2o3-cr: why they don't mention that in the Regex docs i'm uncertain.
[00:21:12] al2o3-cr: nvm. they do ;)
[00:28:38] al2o3-cr: &>> "".encoding
[22:55:03] al2o3-cr: bash: printf "%0s\n" "test."{a..f}.{1..6}".com"
[22:58:25] al2o3-cr: yeah, `printf "%s\n" test.{a..f}.{1..6}.com`
[22:59:09] al2o3-cr: now, how to implement brace expansion.
[23:03:35] al2o3-cr: baweaver: sure.
[23:15:58] al2o3-cr: baweaver: you won't, ruby doesn't have brace expansion :P
[23:17:49] al2o3-cr: baweaver: cool, i'd like to see this ;)
[23:25:45] al2o3-cr: &>> (?a..?f).zip(1..6).map { |x| "test.#{x.join('.')}.com" }
[23:27:03] al2o3-cr: &>> [*?a..?f].product([*1..6]).map { |x| "test.#{x.join('.')}.com" }
[23:32:21] al2o3-cr: it could work i suppose. could cause confusion.
[23:35:44] al2o3-cr: &>> (?a..?f).flat_map { |x| (1..6).map { |y| "test.#{x}.#{y}.com" } }
[23:37:27] al2o3-cr: then n level loops haha :)
[23:38:42] al2o3-cr: baweaver: i see what your trying to implement :)
[23:39:44] al2o3-cr: of course. (but inject) hehe
[23:40:17] al2o3-cr: but yeay what canton7 said.
[23:48:30] al2o3-cr: TracePoints API is pretty sound tbh.
[23:49:58] al2o3-cr: it pretty simple enough compared to set_trace
[23:51:39] al2o3-cr: baweaver: C method Ruby method how to differenciate?
[23:52:44] al2o3-cr: A lot of consideration as been put into TracePoint.
[23:53:38] al2o3-cr: baweaver: i see your intention though.
[23:54:56] al2o3-cr: haha, most of your stuff is good though!
[23:55:52] al2o3-cr: bacon butty or an orange, i'd take the bacon butty :P
[23:57:37] al2o3-cr: &18>> "foo"
[23:57:55] al2o3-cr: &1.8>> "foo"
[23:58:47] al2o3-cr: hint hint to jhass to upgrade to 2.6 ;)

2019-01-11

[18:20:30] al2o3-cr: then what would use for integer division // ?
[21:20:30] al2o3-cr: https://banisterfiend.wordpress.com/2010/11/06/behavior-of-yield-in-define_method/ this explains why.
[21:24:59] al2o3-cr: &>> def ping; define_singleton_method(:pong) { yield } end; ping { "ping" }; pong { "pong" }

2019-01-10

[00:57:17] al2o3-cr: Quit: WeeChat 2.3
[01:01:00] al2o3-cr: has joined #ruby-offtopic
[01:01:00] al2o3-cr: has joined #ruby

2019-01-09

[16:48:25] al2o3-cr: Ping timeout: 246 seconds
[22:44:20] al2o3-cr: has joined #ruby
[22:44:21] al2o3-cr: has joined #ruby-offtopic

2019-01-08

[12:22:58] al2o3-cr: include a class in a class
[12:23:26] al2o3-cr: &>> require 'fiddle'; include Fiddle; X = Class.new { define_method(:ru) { __callee__.to_s << "by" } }; Pointer[dlwrap X][0,16] = Pointer[dlwrap Module.new][0,16]; Class.new { include X }.new.ru
[12:25:59] al2o3-cr: hello, phaul :)
[12:28:31] al2o3-cr: the possibilities are endless :P
[12:36:25] al2o3-cr: Linuus_: i'd just set $VERBOSE = nil
[12:36:53] al2o3-cr: they're only warnings after all.
[13:06:10] al2o3-cr: TheBrayn: Enumerable#to_h
[13:09:09] al2o3-cr: &ri Enumerable#to_h TheBrayn
[13:27:10] al2o3-cr: TheBrayn: yes.
[14:23:18] al2o3-cr: Swyper: change yield_with_args to block.call(*args)
[14:23:39] al2o3-cr: or bloc in your case.
[14:26:03] al2o3-cr: Swyper: bloc.call(*args) not bloc.call(args)
[14:26:42] al2o3-cr: otherwise you're passing an array
[14:30:55] al2o3-cr: Swyper: what is this for?
[14:35:07] al2o3-cr: Swyper: go for it then and good luck ;)
[14:48:59] al2o3-cr: Swyper: no.
[14:49:46] al2o3-cr: you're calling Kernel#select wrap 1..num in parantheses
[14:53:03] al2o3-cr: Swyper: np, but don't just wizz through these, take some time to understand what you are doing and what is going wrong.
[14:56:17] al2o3-cr: yeah, generally NoMethodError indicates obj foo doesn't respond to method bar.
[14:57:24] al2o3-cr: you're getting that error because Kernel is included in Object.
[20:02:54] al2o3-cr: does IO.copy_stream use sendfile(2) copy_file_range(2) or splice(2)
[20:31:56] al2o3-cr: aha, ifdefs on copy_file_range and sendfile.

2019-01-07

[12:12:01] al2o3-cr: jlebrech: got an example?
[12:13:04] al2o3-cr: jlebrech: example input expected output?
[14:17:01] al2o3-cr: catphish: https://gist.github.com/gr33n7007h/a85f0213cfdb9a5a716105c347e9d460

2019-01-06

[08:39:55] al2o3-cr: Quit: WeeChat 2.3
[16:52:53] al2o3-cr: has joined #ruby-offtopic
[16:52:53] al2o3-cr: has joined #ruby

2019-01-04

[06:09:13] al2o3-cr: has joined #ruby-offtopic
[06:09:13] al2o3-cr: has joined #ruby
[06:12:53] al2o3-cr: &>> nh = {a:{b:{c:{d:{e:42}}}}}; hold = []; Marshal.load Marshal.dump(nh), -> v { hold << v; v }; hold.each &:freeze
[06:34:54] al2o3-cr: &>> nh = {a:{b:{c:{d:{e:42}}}}}; hold = []; Marshal.load Marshal.dump(nh), -> v { hold << v; v}; hold.each &:freeze; hold.map &:frozen?
[06:47:18] al2o3-cr: &>> Marshal.load Marshal.dump({a:114, b:117, c:98, d:121}), -> v { p v.chr if Integer === v }
[06:47:39] al2o3-cr: ok, i'll stop now :p

2019-01-03

[08:15:22] al2o3-cr: Quit: WeeChat 2.3

2019-01-02

[05:30:30] al2o3-cr: has joined #ruby
[05:30:31] al2o3-cr: has joined #ruby-offtopic
[08:31:33] al2o3-cr: Quit: WeeChat 2.3
[12:00:19] al2o3-cr: has joined #ruby-offtopic
[12:00:19] al2o3-cr: has joined #ruby
[13:59:02] al2o3-cr: Quit: WeeChat 2.3
[14:06:31] al2o3-cr: has joined #ruby-offtopic
[14:06:31] al2o3-cr: has joined #ruby
[15:21:10] al2o3-cr: Quit: WeeChat 2.3
[15:30:14] al2o3-cr: has joined #ruby-offtopic
[15:30:14] al2o3-cr: has joined #ruby