al2o3-cr

Activity Graph

Page 1 of 62 | Next »

2019-03-18

[15:47:54] al2o3-cr: Quit: WeeChat 2.4
[15:52:19] al2o3-cr: has joined #ruby-offtopic
[15:52:19] al2o3-cr: has joined #ruby

2019-03-16

[09:09:04] al2o3-cr: Quit: WeeChat 2.4
[09:13:28] al2o3-cr: has joined #ruby-offtopic
[09:13:28] al2o3-cr: has joined #ruby
[18:35:28] al2o3-cr: what a miserable day :(
[18:36:27] al2o3-cr: just the weather phaul
[18:37:10] al2o3-cr: roll on summer ;)

2019-03-15

[14:37:27] al2o3-cr: KEY.rotate(n).first
[14:38:54] al2o3-cr: nah, that's slow and dumb
[16:41:41] al2o3-cr: why does this return 0..12 instead 1..13? https://carc.in/#/r/6i6j
[16:42:31] al2o3-cr: does it return back the indices?
[16:56:26] al2o3-cr: yeah, forget that. i was getting confucius.

2019-03-14

[09:02:29] al2o3-cr: Quit: WeeChat 2.4
[09:06:39] al2o3-cr: has joined #ruby-offtopic
[09:06:39] al2o3-cr: has joined #ruby
[11:55:41] al2o3-cr: he's the genius of the snooker world.
[12:40:36] al2o3-cr: sagax: bear in mind, append is variadic whilst << is not. so, if you appending multilple values use append/push as you see fit.
[16:41:11] al2o3-cr: canurabus: to_enum takes a method (defaults to :each) and variable amount of args. in your case you're passing :scan which is an instance method of String class with a regex argument.
[16:41:46] al2o3-cr: and returns an enumerator instead of an array.
[16:44:34] al2o3-cr: Regexp.last_match with give you Matchdata objects
[16:45:03] al2o3-cr: &>> "foo $ bar £ baz".to_enum(:scan, /\p{S}/).to_a
[16:45:44] al2o3-cr: &>> "foo 1 bar 2 baz".to_enum(:scan, /\d+/).to_a
[16:46:05] al2o3-cr: &>> "foo 1 bar 2 baz".to_enum(:scan, /\d+/).map { Regexp.last_match }
[16:46:51] al2o3-cr: you will do
[16:50:06] al2o3-cr: matches.map { Reg... } will just give you same Matchdata object to the size of matches array
[16:52:12] al2o3-cr: canurabus: in effect, yes.
[16:53:14] al2o3-cr: canurabus: you'll get the hang soon enough.
[16:53:36] al2o3-cr: "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/) # this returns a enumerator
[16:54:00] al2o3-cr: &>> "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/).next # next in enumerator == "1"
[16:54:13] al2o3-cr: &>> "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/).next.next # next in enumerator == "2" and so on
[16:55:01] al2o3-cr: when you map an enumerator each element in that enumerator will be processed.
[16:55:50] al2o3-cr: sequentially, i should add.
[17:07:11] al2o3-cr: exactly that.
[17:07:29] al2o3-cr: or if your using ruby < 2.6 select
[17:07:50] al2o3-cr: or find_all
[17:09:12] al2o3-cr: sagax: Array#select or Enumerable#find_all
[17:10:35] al2o3-cr: &>> [1,2,3,4].select { |n| n.even? } # filters all even numbers
[17:12:33] al2o3-cr: &>> [1,2,3,4].filter { |n| n.odd? } # filters all odd numbers ruby (2.6)
[18:54:43] al2o3-cr: &>> require 'uri'; def valid_email?(email) URI::MailTo::EMAIL_REGEXP.match? email end; valid_email? "localpart@domain.extension"
[19:27:58] al2o3-cr: gaussblurinc1: each_slice
[23:09:43] al2o3-cr: &>> x = ?y; [%q(#{x}), %Q(#{x}), *%w(#{x}), *%W(#{x}), *%i(#{x}), *%I(#{x}), %r(x), %r(#{x}), %s(x), %s(#{x})]
[23:22:39] al2o3-cr: even %x() interpolates
[23:38:38] al2o3-cr: &>> %(#{%r{#{%w(1 2 3)}}})

2019-03-13

[02:26:01] al2o3-cr: Quit: WeeChat 2.4
[02:32:19] al2o3-cr: has joined #ruby-offtopic
[02:32:19] al2o3-cr: has joined #ruby

2019-03-12

[00:31:49] al2o3-cr: &>> [[1234].pack('V'), 0x04d2]
[06:07:25] al2o3-cr: Ping timeout: 246 seconds
[06:07:27] al2o3-cr: has joined #ruby
[09:43:33] al2o3-cr: has joined #ruby-offtopic
[09:43:33] al2o3-cr: has joined #ruby
[12:01:42] al2o3-cr: Bish: just use the shit handed to you, know?
[12:03:00] al2o3-cr: and i know you know!
[12:04:17] al2o3-cr: can ruby do this, can ruby do that...
[12:06:21] al2o3-cr: this, that andtother
[12:07:10] al2o3-cr: OK! Bish...
[12:12:16] al2o3-cr: Bish: what is your language of choice?
[12:12:59] al2o3-cr: Bish: so... you use ruby?
[12:19:05] al2o3-cr: ljarvis: how good is the zen shit?
[12:21:57] al2o3-cr: ljarvis: that business?
[13:16:33] al2o3-cr: Bish: ruby is what's handed to you.
[14:46:23] al2o3-cr: dberger: never use posix shit
[14:48:03] al2o3-cr: dberger: you want to match unicode?
[14:49:30] al2o3-cr: use character properties.

2019-03-11

[12:11:29] al2o3-cr: Bish: https://spin.atomicobject.com/2017/06/28/queue-pop-with-timeout-fixed/
[23:46:07] al2o3-cr: &>> m = Mutex; m.extend(MonitorMixin); m.then { |lock| lock.synchronize { lock.synchronize { 42 } } }
[23:46:50] al2o3-cr: MonitorMixin and ConditionalVariable really need more documentation.

2019-03-08

[14:54:11] al2o3-cr: Read error: Connection reset by peer
[14:56:20] al2o3-cr: has joined #ruby
[14:56:23] al2o3-cr: has joined #ruby-offtopic

2019-03-07

[08:41:43] al2o3-cr: Tuor: use double quotes for interpolation and single quotes for everything else.
[08:42:11] al2o3-cr: thats my motto anyway.
[08:57:31] al2o3-cr: slightly, if any.
[14:53:44] al2o3-cr: true, use herestrings.
[15:53:15] al2o3-cr: Tuor: obj.is_a?
[16:22:58] al2o3-cr: &ri Object.=== Tuor
[16:23:06] al2o3-cr: &ri Module.=== Tuor
[16:23:10] al2o3-cr: &ri Module#=== Tuor
[16:33:38] al2o3-cr: &>> [Integer < Numeric, Numeric > Integer]
[19:48:21] al2o3-cr: &>> "p""i""z""z""a"
[19:57:43] al2o3-cr: oops, ljarvis is spewing now ;)
[20:02:40] al2o3-cr: &>> [%("p""i""z""z""a"), %('p''i''z''z''a')]
[20:09:44] al2o3-cr: havenwood: beatiful, you work for dominos?
[20:16:13] al2o3-cr: notZarthus: pi r squared
[20:18:58] al2o3-cr: havenwood: you is a magician :P
[20:27:27] al2o3-cr: havenwood: haha, awesome!
[20:30:07] al2o3-cr: thats made my day!
[21:02:45] al2o3-cr: &>> "ß".downcase(:fold) # if this works i'll plait saw dust
[21:20:06] al2o3-cr: &>> "ß".force_encoding('utf-16').downcase(:fold)
[21:32:36] al2o3-cr: ljarvis: self using "" ~&&= begin FANCY ;)
[21:34:15] al2o3-cr: shit pizza?
[21:34:59] al2o3-cr: i like that shit
[21:37:58] al2o3-cr: &>> !('' > "")
[21:38:15] al2o3-cr: it must be true
[22:00:30] al2o3-cr: BoomerBile: so everytime it's been a foot print?
[22:01:16] al2o3-cr: BoomerBile: a head ACHE
[22:02:36] al2o3-cr: well, 5 yrs must be ...
[22:03:39] al2o3-cr: BoomerBile: whats the project?
[22:05:37] al2o3-cr: BoomerBile: who knows?
[22:05:59] al2o3-cr: BoomerBile: neither are you!
[22:07:45] al2o3-cr: BoomerBile: you've come in here blasting
[22:08:22] al2o3-cr: baweaver: did
[22:14:44] al2o3-cr: lot of unusual traffic, coming from the same subnet.
[22:30:12] al2o3-cr: baweaver: my fault, yet again

2019-03-06

[01:04:09] al2o3-cr: Quit: WeeChat 2.4
[01:08:59] al2o3-cr: has joined #ruby-offtopic
[01:08:59] al2o3-cr: has joined #ruby
[14:34:48] al2o3-cr: merijn: https://learnxinyminutes.com/docs/ruby/
[15:19:58] al2o3-cr: i'd prefer flat_map there ;)
[15:21:25] al2o3-cr: ACTION does and hides
[19:34:26] al2o3-cr: elcontrastador: is it a file you're opening?
[19:36:56] al2o3-cr: elcontrastador: you gonna have a hard time then doing that from ruby.
[19:40:04] al2o3-cr: elcontrastador: what syscalls do you have in mind for this?
[19:40:43] al2o3-cr: oh, system calls?
[19:41:24] al2o3-cr: elcontrastador: i thought you meant syscall.
[19:42:40] al2o3-cr: yeah, i was thinking then haha
[19:43:01] al2o3-cr: yeah, no worries.
[19:51:36] al2o3-cr: makr8100: you might be better off asking in #rubyonrails if no one answers here.
[21:11:16] al2o3-cr: Ping timeout: 246 seconds
[21:12:43] al2o3-cr: has joined #ruby
[21:12:45] al2o3-cr: has joined #ruby-offtopic
[23:41:06] al2o3-cr: Quit: WeeChat 2.4
[23:45:09] al2o3-cr: has joined #ruby-offtopic
[23:45:09] al2o3-cr: has joined #ruby

2019-03-03

[00:42:39] al2o3-cr: phaul: how's the gist going?
[00:50:35] al2o3-cr: phaul: Nokogiri(open(url)).css('td').map(&:text).reject(&:empty?).join("\n").gsub(/\n\n\n/, "\n\n") then pass that to your evaluator. happy days :)
[00:50:52] al2o3-cr: don't forget to error check and shit.
[00:53:52] al2o3-cr: regex != parse
[00:54:40] al2o3-cr: phaul: oh, and have a good day!
[00:59:12] al2o3-cr: meaning regex is more than enough.
[01:06:41] al2o3-cr: overkill imo :)
[01:07:32] al2o3-cr: why? regexp matches or doesn't. simple
[01:08:14] al2o3-cr: not a chance
[01:09:42] al2o3-cr: phaul: then use YARD::Registry then some tweaks.
[01:11:10] al2o3-cr: even so, simple ruby can sort that.
[01:11:47] al2o3-cr: cool beanz :)
[01:13:28] al2o3-cr: phaul: nice :)
[01:13:54] al2o3-cr: phaul: you still sailing?
[01:17:20] al2o3-cr: phaul: does this time out; `trap(:XCPU) { abort "expired" }; Process.setrlimit(:CPU, 5, -1); loop {}`
[01:20:48] al2o3-cr: phaul: yeah, i upped the time by 3 seconds.
[01:21:27] al2o3-cr: &>> trap(:XCPU) { abort "expired" }; Process.setrlimit(:CPU, 2, -1); loop {}
[01:28:58] al2o3-cr: &>> 2**64-1 == [-1].pack('l!').unpack1('l!')
[01:29:09] al2o3-cr: &>> 2**64-1 == [-1].pack('l!').unpack1('Q')
[01:29:24] al2o3-cr: &>> 2**64-1 == [-1].pack('l!').unpack1('J')
[01:30:19] al2o3-cr: &>> [-1].pack('Q').unpack1('Q')
[01:35:21] al2o3-cr: &>> require 'fiddle'; include Fiddle; X = Class.new; Pointer[dlwrap IO][16,8] = -Pointer[dlwrap X]; IO.ancestors
[01:40:09] al2o3-cr: &>> require 'fiddle'; include Fiddle; X = Class.new; Pointer[dlwrap IO][24,8] = -Pointer[dlwrap X]; IO.ancestors

2019-03-02

[05:18:14] al2o3-cr: &>> trap(:XCPU) { abort "[TIMED OUT]" }; Process.setrlimit(:CPU, 2, -1); loop {}
[06:25:12] al2o3-cr: vdl: you could use the inifile gem
[08:57:13] al2o3-cr: Quit: WeeChat 2.4
[09:01:12] al2o3-cr: has joined #ruby-offtopic
[09:01:12] al2o3-cr: has joined #ruby
[11:13:41] al2o3-cr: phaul: what do you mean? grab the gist content and evaluate it on carc.in?
[11:14:42] al2o3-cr: oh, right, yes. that will be handy ;)
[11:16:06] al2o3-cr: sure. pretty positive carc.in is well sandboxed.
[16:22:22] al2o3-cr: &>> class Grade include Comparable; attr_reader(:grade); def initialize(grade) @grade = grade end; def <=>(other) other.grade <=> @grade end end; g1 = Grade.new('A'); g2 = Grade.new('B'); g1 > g2
[16:24:16] al2o3-cr: &>> class Grade include Comparable; attr_reader(:grade); def initialize(grade) @grade = grade end; def <=>(other) other.grade <=> @grade end end; g1 = Grade.new('A'); g2 = Grade.new('B'); g3 = Grade.new('C'); g2.between?(g3, g1)
[16:25:48] al2o3-cr: doing it this way because of lexicology.
[16:26:54] al2o3-cr: oh, hang on.
[16:27:43] al2o3-cr: ah, i think in this case it does work.
[16:28:29] al2o3-cr: no, should work for all.
[16:32:49] al2o3-cr: Darmani: ah, yeah, wasn't thinking of that.
[16:46:11] al2o3-cr: Darmani: are you sure that works as you think?
[16:47:41] al2o3-cr: A+ > A == true; B- > C == true ??
[18:52:00] al2o3-cr: canton7: what language?
[18:52:26] al2o3-cr: "I did electronics at uni, which had some programming in it"
[18:54:08] al2o3-cr: do you still practice these now?
[18:54:42] al2o3-cr: or stick to interpreted languages?
[18:55:14] al2o3-cr: oh, cool. :)
[18:56:54] al2o3-cr: that must of been a long time ago ;) jk hehe
[18:59:01] al2o3-cr: canton7: i've seen you around for like an eternity.
[19:01:53] al2o3-cr: i remember when the eval bot in here used to be named al2o3cr going back a few years now ;)
[19:09:11] al2o3-cr: yeah, hehe :)

2019-03-01

[09:38:34] al2o3-cr: Quit: WeeChat 2.4
[09:43:36] al2o3-cr: has joined #ruby-offtopic
[09:43:36] al2o3-cr: has joined #ruby
[11:01:49] al2o3-cr: Quit: WeeChat 2.4
[11:07:12] al2o3-cr: has joined #ruby-offtopic
[11:07:12] al2o3-cr: has joined #ruby
[12:26:24] al2o3-cr: Quit: WeeChat 2.4
[12:31:11] al2o3-cr: has joined #ruby-offtopic
[12:31:11] al2o3-cr: has joined #ruby

2019-02-26

[09:00:01] al2o3-cr: Quit: WeeChat 2.4
[09:03:51] al2o3-cr: has joined #ruby-offtopic
[09:03:51] al2o3-cr: has joined #ruby
[09:33:34] al2o3-cr: &>> 26 ** 8 #### so a 26 character keyspace repeated permutations of 8 ####
[09:34:09] al2o3-cr: hmmm, wonder how long this will take to find my PSK lol ;)
[10:00:42] al2o3-cr: Quit: WeeChat 2.4
[10:05:59] al2o3-cr: has joined #ruby-offtopic
[10:05:59] al2o3-cr: has joined #ruby

2019-02-25

[07:27:55] al2o3-cr: barg: byebug
[07:30:23] al2o3-cr: pry-byebug uses byebug.
[08:56:06] al2o3-cr: ntt: for that example in plain ruby; h[:nodes].map { |k,v| v.values }.map { |ipaddress:, **| ipaddress }
[09:15:40] al2o3-cr: since weechat upgraded to 2.4 it doesn't leave a space between nick when using tab completion. damn annoying.
[09:50:34] al2o3-cr: phaul: hmm, i don't have that problem with double tab, just the space issue :(
[09:55:42] al2o3-cr: phaul: /set weechat.completion.nick_completer ": "
[12:04:48] al2o3-cr: Quit: WeeChat 2.4
[12:10:33] al2o3-cr: has joined #ruby-offtopic
[12:10:33] al2o3-cr: has joined #ruby
[21:06:17] al2o3-cr: jmosco: chmod +x /usr/local/opt/kube-ps1/share/kube-ps1.sh and try again.

2019-02-24

[03:53:20] al2o3-cr: Quit: WeeChat 2.4
[03:58:28] al2o3-cr: has joined #ruby-offtopic
[03:58:28] al2o3-cr: has joined #ruby
[18:55:06] al2o3-cr: Quit: WeeChat 2.4
[19:05:32] al2o3-cr: has joined #ruby-offtopic
[19:05:32] al2o3-cr: has joined #ruby
[22:44:55] al2o3-cr: Quit: WeeChat 2.4
[22:48:08] al2o3-cr: has joined #ruby-offtopic
[22:48:08] al2o3-cr: has joined #ruby

2019-02-23

[00:24:52] al2o3-cr: &>> %w(C S L Q).map { |p| -[-1].pack('Q').send(:unpack1, p) >> 1 }
[00:31:21] al2o3-cr: &>> %w(C S L Q).map { |p| [-1].pack('Q').send(:unpack1, p) >> 1 }
[00:35:12] al2o3-cr: &>> require 'rbconfig/sizeof'; RbConfig::LIMITS.values_at(*%w(CHAR_MIN SHRT_MIN INT_MIN LONG_MIN)) == %w(C S L Q).map { |p| -[-1].pack('Q').send(:unpack1, p) >> 1 }
[00:59:42] al2o3-cr: &>> [Float::MAX].pack('D').unpack1('B*')
[01:02:50] al2o3-cr: &>> Integer::GMP_VERSION
[01:06:51] al2o3-cr: numbers are amazing!
[01:44:34] al2o3-cr: &>> require "fiddle/import"; extend Fiddle::Importer; RBasic = struct ["unsigned long flags", "unsigned long klass"]; ptr = Fiddle::Pointer[Class.__id__ << 1]; RBasic.new(ptr).flags ^= (1 << (12+0)); Class.class
[02:01:10] al2o3-cr: &>> require 'fiddle'; (Fiddle::Pointer["brexit sucks"] + 0x7).to_s
[19:36:53] al2o3-cr: Quit: WeeChat 2.4
[20:20:53] al2o3-cr: has joined #ruby-offtopic
[20:20:53] al2o3-cr: has joined #ruby

2019-02-22

[17:37:15] al2o3-cr: glad you cleared that up ;)