phaul

Activity Graph

Page 1 of 9 | Next »

2018-11-19

[08:33:12] phaul: has joined #ruby-offtopic
[08:33:12] phaul: has joined #ruby
[18:57:36] phaul: exciting draw in the world chess championship today!
[18:57:51] phaul: as opposed to boring draw...
[19:00:19] phaul: &list timeout
[19:01:03] phaul: &ri Object#timeout
[19:05:50] phaul: pretty far from it. but I play chess online every 2-3 days
[19:06:09] phaul: so you could say regularily
[19:06:29] phaul: also havenwood is a player we played once
[19:08:45] phaul: s/regularily/regularly/. it felt strange, but I couldnt put my finger on why.. I left the UK 4 weeks ago and I'm already strugglinh with English :)
[19:12:39] phaul: al2o3-cr: with some practise you could Im sure improve. The thing is it's a scale from 800 - 2800 ELO strength and we are all somewhere on that scale. Don't play games with ppl 200 above you or you will lose for sure. But we can all climb up on that scale with practise
[19:16:07] phaul: silly is relative.. that's my point. You need to find opponents matching your strength. Most chess players have players 1000 points above and 1000 point below them. That's fine. Even grand masters suck big time among the top 10 of the world..
[19:27:50] phaul: if it's any consolation computers (strongPCs not super computers) these days are about 3400 ELO with strongest humans are about 2800. We all lost

2018-11-18

[00:38:34] phaul: Ping timeout: 272 seconds
[08:33:36] phaul: has joined #ruby-offtopic
[08:33:36] phaul: has joined #ruby
[12:55:14] phaul: hi kapil____
[17:49:51] phaul: ah, good old ((void*)0) :)
[17:50:06] phaul: so glad those days are behind me :)
[18:01:00] phaul: now .. that's what you call enlightenment
[19:24:59] phaul: jordila: make it something - anyting that would make it run past syntax errors. change __ to any object you like: 1, 'a', nil, [13] etc. then run it again and observe.
[19:35:32] phaul: did you get different output? What did it say?
[19:37:58] phaul: yeah. that should get you further
[19:38:45] phaul: always read what it says. and try to make sense of it..
[20:10:25] phaul: jordila: 'NoMethodError' is different from NoMethodError. Notice the 'marks'.
[20:11:47] phaul: one is a constant pointing to some object. Typically a class or module, but sometimes, something else. The other with single quotes is a string
[20:13:43] phaul: NoMethodError is a class in this case which denotes the error of method on object is non-existent
[20:13:50] phaul: &ri NoMethodError
[21:23:26] phaul: there aretwo distinct things in play. scope nesting and inheritance
[21:23:48] phaul: :: separates nesting. and it's independent of inheritance
[21:24:01] phaul: &ri nesting
[21:25:17] phaul: I'm not sure if you referred to inheritance at all, but basename sounded like base class...
[21:26:34] phaul: you could get #nesting.last ?
[21:27:00] phaul: not sure if it always does whatyou need..
[21:33:07] phaul: nchambers: actually it doesn't do what you need. nm, sorry, I don't know better way than what you said...
[21:42:35] phaul: also there is a gotcha with the difference between module A; module B; end; end; vs module A::B; end; #nesting shows that these are different, I did some writeup of what I found here https://github.com/phaul/ruby_101/blob/master/content/book.md#lexical-scope-nesting
[22:14:04] phaul: Ping timeout: 252 seconds
[22:21:22] phaul: has joined #ruby
[22:21:23] phaul: has joined #ruby-offtopic
[23:01:52] phaul: Ping timeout: 272 seconds

2018-11-17

[10:04:59] phaul: has joined #ruby
[10:05:00] phaul: has joined #ruby-offtopic
[22:12:46] phaul: it's the 3 way compare returns -1, 0, 1 for less than equal or greater than
[22:13:00] phaul: useful to implement Comparable
[22:13:07] phaul: &ri Comparable
[22:15:54] phaul: sometimes you see this trick: [:equal, :greater, :less][5 <=> 3] # => :greater
[22:16:34] phaul: &>> [:equal, :greater, :less][5 <=> 3]
[22:17:56] phaul: it's abusing the -1 index of the array...
[22:18:18] phaul: I saw it on codewars once..
[22:42:50] phaul: &>> [*0..1_000_000].last
[22:43:27] phaul: probably that's as slow as with or without the bsearch :)
[22:45:49] phaul: I was just saying the bot times out for all..
[22:45:59] phaul: and that's not bsearch's fault
[22:48:32] phaul: binary chpping is faster, I never disputed that, quite the contrary
[22:52:11] phaul: yesterday I failed to predict how Hash behaves in terms of perfomance so I'm already losing this game, btw did you see that? I'm still buffled why Hash behaves like the way it does...
[22:53:28] phaul: why is Hash#first signifacntly slower than ~ 1.5x times than pulling the first elem by key?
[22:54:43] phaul: makes 0 sense. but that's the way it does ( did not confirm myself )
[22:56:54] phaul: I have pry. why?
[23:03:31] phaul: al2o3-cr: I have been using pry, I know it. I prefer gvim with rbtools when I can use it, by also use pry for a repl..
[23:05:57] phaul: this still doesn't explain why Hash works like that, but I guess one would have to profile MRI to get an actual answer
[23:06:32] phaul: still really counter intuitive to me
[23:08:12] phaul: I know hash has some tricks to make small sizes faster. but the example was like 1000 element Hash. I don't expect 1000 element hash key lookup to beat #first. but still it does.
[23:10:04] phaul: maybe it's just that Enumerable #first is cr*p that Hash is including and creates temporary objects and such
[23:31:39] phaul: as far as ruby goes those are completely different things. One does not mean the other would work
[23:31:56] phaul: what library framework are you using
[23:34:40] phaul: Ruby the language is much more flexible. I don't know anything about chef. the first invokes [] method on obj and thatcould do anything. The second invokes attribute? method on obj and thatcould do anyting

2018-11-16

[00:00:00] phaul: &>> print [?\\, ?/] * ?o ; raise 'hell'
[00:00:22] phaul: argh.. never mind ..
[01:22:41] phaul: Ping timeout: 268 seconds
[07:56:42] phaul: has joined #ruby
[07:56:43] phaul: has joined #ruby-offtopic
[10:54:04] phaul: I expect Hash#first to be actually faster
[10:54:37] phaul: &>> {a:1, b:2}.first
[10:56:42] phaul: That's becasue the enumeration doesn't have to deal with the key lookups at all, it just walks the entries by the link pointers. That's how Hash is Enumerable. But I'm speculating, and I don't actually know the implementation in detail
[10:57:18] phaul: what's not that fast?
[10:57:38] phaul: key lookup or first?
[11:03:12] phaul: vasilakisfil: isn't :aaa the last key?
[11:16:33] phaul: &ri Regexp#~ grr12314
[11:16:59] phaul: https://ruby-doc.org/core-2.5.1/Regexp.html#method-i-~, grr12314
[11:28:08] phaul: (right at the bottom of the page)
[13:18:26] phaul: >>& Hash[[:ru, :en].each_with_index.entries]
[13:18:42] phaul: &>> Hash[[:ru, :en].each_with_index.entries]
[15:50:33] phaul: Quit: bye
[16:03:12] phaul: has joined #ruby-offtopic
[16:03:12] phaul: has joined #ruby
[22:15:28] phaul: Ping timeout: 246 seconds
[22:35:44] phaul: has joined #ruby
[22:35:45] phaul: has joined #ruby-offtopic
[23:05:16] phaul: Ping timeout: 272 seconds

2018-11-15

[06:44:06] phaul: has joined #ruby-offtopic
[06:44:06] phaul: has joined #ruby
[17:23:07] phaul: Ping timeout: 240 seconds
[19:42:46] phaul: has joined #ruby-offtopic
[19:42:46] phaul: has joined #ruby
[19:55:48] phaul: hiya dminuoso
[19:58:14] phaul: what happened? you disappeared for a while
[22:43:31] phaul: how about super.tap { |foo| return foo if foo }
[22:59:50] phaul: or... super&.tap { |foo| return foo }
[23:58:28] phaul: &>> print [?\\, ?/] * ?o

2018-11-14

[08:35:16] phaul: has joined #ruby-offtopic
[08:35:16] phaul: has joined #ruby
[15:57:05] phaul: loop { loop { some_code_here; nuke_earth } } # then some_code_here will run only once
[15:58:09] phaul: pff then I have a bug
[16:12:18] phaul: ?xy, LinuxKnight
[16:17:31] phaul: jhass: sorry, what's sansing?
[16:22:20] phaul: TIL << 'sans'; # thanks jhass
[16:33:57] phaul: too much js today
[17:25:01] phaul: Ping timeout: 260 seconds
[19:36:28] phaul: has joined #ruby-offtopic
[19:36:28] phaul: has joined #ruby
[21:42:16] phaul: Ping timeout: 260 seconds

2018-11-13

[00:50:24] phaul: Ping timeout: 244 seconds
[07:34:30] phaul: has joined #ruby-offtopic
[07:34:30] phaul: has joined #ruby
[17:33:46] phaul: Ping timeout: 244 seconds
[19:20:28] phaul: has joined #ruby-offtopic
[19:20:28] phaul: has joined #ruby
[22:07:27] phaul: Ping timeout: 240 seconds

2018-11-12

[07:57:07] phaul: has joined #ruby-offtopic
[07:57:07] phaul: has joined #ruby
[08:25:41] phaul: it looks exactly like receiver . :symbol, I wonder if that will cause some confusion. with the lexer reading in .: I wonder why new operator rather then accepting symbols as method names in the parser..
[08:27:17] phaul: *rather than
[08:30:36] phaul: yeah I do like what it gives us.
[08:32:27] phaul: probably this way you can't do this: receiver.:"sym#{'bol'}"
[12:52:40] phaul: LinuxKnight: that's valid ruby you posted.
[12:54:05] phaul: &>> opts = {addon_disk_count: 3}; (1..opts[:addon_disk_count]).each do |i|; p i; end
[12:55:18] phaul: please try to rephrase your question, or are there any errors you are getting?

2018-11-11

[08:15:56] phaul: has joined #ruby
[08:15:57] phaul: has joined #ruby-offtopic
[19:43:34] phaul: ACTION yawns
[21:06:29] phaul: Ping timeout: 268 seconds

2018-11-10

[08:30:11] phaul: has joined #ruby-offtopic
[08:30:11] phaul: has joined #ruby
[13:28:23] phaul: Ping timeout: 245 seconds
[13:51:15] phaul: has joined #ruby-offtopic
[13:51:15] phaul: has joined #ruby
[17:41:25] phaul: yesterday started a bit more exciting
[23:07:33] phaul: Ping timeout: 245 seconds

2018-11-09

[07:30:16] phaul: has joined #ruby
[07:30:17] phaul: has joined #ruby-offtopic
[10:15:26] phaul: marz_d`ghostman: sometimes. My main rule of thumb is that it has to produce sensible description of the test when all fragments (descibe, context, it, expect) are pasted
[10:19:23] phaul: altough subjects are scoped in describe
[10:19:38] phaul: -although ^^
[10:22:23] phaul: you can tell rspec which example to run on the command line, then it runs a single example
[10:23:53] phaul: otherwise RSpec runs all examples. There are further options to track and retry only last failing example for instance
[10:34:20] phaul: random rambling: I think the `context' concept in rspec is broken. it's just an alias to describe afaik, but to me a context is much more. A context is like a concern to a class, we should be able to mix in any number and combination of contexts, in a flat manner, not deep embeding them into each other..
[10:35:01] phaul: but.. ppl are already think rspec is complex enough and hard to understand as it is :)
[10:46:25] phaul: hi Daneel
[10:46:55] phaul: &list captures
[10:47:29] phaul: which one do you need?
[10:48:37] phaul: Bish: use &>> to route it to rubydoc
[10:49:20] phaul: &>> Integer === Integer
[10:51:36] phaul: Daneel: you have to require 'open3'
[10:53:07] phaul: &ri Module#===, Bish
[10:53:54] phaul: Bish: logic behind it is to write case 1 ; when Integer then ..
[10:54:29] phaul: === does not imply ==
[10:58:44] phaul: Daneel: please paste the full error log you get
[11:06:41] phaul: hm, in this case it's the other way. == does not imply === either.
[11:24:21] phaul: Daneel: ?
[11:48:52] phaul: Bish: I did a bit of background research, and I came to the conclusion that I agree with you. === is semantically broken, because Object implements it and makes a promise that == implies ===. Then overriding implementations completely disregard super
[12:52:31] phaul: np. important thing is that you get it working ;)
[13:10:17] phaul: yeah, it breaks polymorphism. Class is almost like an Object but not quite. The way out is not to define === for Object, but then you get NoMethod === errors from case statements, which can also be confusing for someone who just starts off with ruby
[14:19:28] phaul: https://www.chess.com/article/view/world-chess-championship-2018-carlsen-caruana#when
[14:19:48] phaul: #excitingtimes
[14:37:03] phaul: Lol Your Capitalize Lock Is On.
[15:46:53] phaul: Tohm3: are you in here for the most polite troll award :D
[17:43:09] phaul: Ping timeout: 268 seconds
[18:50:20] phaul: has joined #ruby-offtopic
[18:50:20] phaul: has joined #ruby
[22:06:10] phaul: just finished watching the 7hr game.. I feel like my brain is melted
[22:07:20] phaul: havenwood: are you following the carlsen-caruana match?
[22:07:44] phaul: you didnt miss much
[22:08:12] phaul: with ~100 rook moves
[22:08:14] phaul: shuffling
[22:35:53] phaul: ah, so this is basically a brainfuck interpreter
[22:38:19] phaul: sort of.. some subset of it. It cant do loops
[22:41:35] phaul: hm. manipulating the data tape is an issue :(
[22:44:26] phaul: isn't that just good for positioning the head? like move to absolute offset
[22:44:54] phaul: yeah. it would have been cool :)
[23:48:34] phaul: Ping timeout: 246 seconds

2018-11-08

[00:23:36] phaul: Ping timeout: 252 seconds
[00:24:25] phaul: has joined #ruby-offtopic
[00:24:25] phaul: has joined #ruby
[00:29:36] phaul: Ping timeout: 272 seconds
[08:24:09] phaul: has joined #ruby-offtopic
[08:24:09] phaul: has joined #ruby
[10:34:24] phaul: Cork: I'm no packspert, but I don't think so. You can't tel what to pack to, you can only tell what to pack from. (exceptions apply)
[11:38:08] phaul: I would store Job in Task
[11:39:27] phaul: then Job can implement Job things.. single responsibility principle
[11:40:47] phaul: Altough this is a bit vague at this moment to form a design, but that's my immediate first reaction
[11:42:28] phaul: on the other hand just for the sake of argument passing I wouldn't introduce new types. Only if they are actual proper types of the design
[11:43:33] phaul: so either 1. Task.new(name: name, type: type) or if Job exists anyway Task.new(job: job)
[11:59:43] phaul: marz_d`ghostman: you need to think about whether you already have Job and Task class. what's the diffrence between them. Is Task an extended version of Job? => inheritance. Does Task contain Jobs => delegate. Is Job needed at all or always have Tasks. Is name & type the sole attributes of Job and if not is there an intersection between Tasks & Jobs that's yet to be discovered as a new type
[13:44:38] phaul: Quit: bye
[13:44:50] phaul: has joined #ruby-offtopic
[13:44:50] phaul: has joined #ruby
[13:50:28] phaul: Quit: bye
[13:50:43] phaul: has joined #ruby-offtopic
[13:50:43] phaul: has joined #ruby
[14:02:03] phaul: *.net *.split
[14:25:21] phaul: has joined #ruby
[14:25:22] phaul: has joined #ruby-offtopic
[18:33:53] phaul: al2o3-cr: the code is from ruby[bot] so everything works the same way, ast>> asm>> tok>> and versions. 20>> 21>>. It's all a bit of a hack, and I had to hammer it into rubydoc, but it runs for now
[18:35:35] phaul: havenwood: thanks
[20:40:55] phaul: the value under :filters key is an Array. Arrays don't have a merge method
[20:41:06] phaul: &list merge
[20:41:23] phaul: &list Array#merge
[20:42:46] phaul: but with this representation this becomes easier : { "Company" => 17 , "foo" => "123", "bar" => "123" }
[20:43:01] phaul: then it's a hash and you can merge
[20:47:33] phaul: &>> { "Company" => "17", "foo" => "123", "bar" => "123" }.merge("Company" => "111")
[21:30:07] phaul: :) nah it's all for the karma .
[22:34:16] phaul: Ping timeout: 264 seconds

2018-11-07

[17:02:42] phaul: has joined #ruby
[17:02:43] phaul: has joined #ruby-offtopic
[17:08:10] phaul: Ping timeout: 268 seconds
[20:34:16] phaul: has joined #ruby-offtopic
[20:34:16] phaul: has joined #ruby
[21:43:54] phaul: ebl fwiw I cannot reproduce it on 2.5.3
[21:44:41] phaul: ["Password", "Email"].sort # => ["Email", "Password"]
[22:02:19] phaul: ebl: yes.
[22:02:56] phaul: ebl: you can play with carc.in with all the versions... to narrow it down
[22:03:06] phaul: when it was introduced and fixed
[22:31:09] phaul: tbh. I could just quickly move the functionality into rubydoc... even if temporarily
[22:34:43] phaul: if its behind a different command they wont even step on each others feet
[22:36:18] phaul: yeah I don't want to start a mutiny :)
[22:36:32] phaul: also don't want to do it behind apeiros's back
[22:39:59] phaul: ok, I'll put something together tomorrow
[22:40:35] phaul: let's keep the rubydoc prefix of &
[22:44:22] phaul: the one you showed me

2018-11-06

[00:02:37] phaul: Ping timeout: 246 seconds
[06:19:09] phaul: has joined #ruby-offtopic
[06:19:09] phaul: has joined #ruby
[22:45:09] phaul: Ping timeout: 244 seconds

2018-11-05

[14:48:15] phaul: has joined #ruby-offtopic
[14:48:15] phaul: has joined #ruby
[15:51:21] phaul: Ping timeout: 244 seconds
[22:44:26] phaul: has joined #ruby-offtopic
[22:44:26] phaul: has joined #ruby