RickHull

Activity Graph

Page 1 of 37 | Next »

2018-01-03

[00:49:42] RickHull: has joined #ruby-ops
[00:49:42] RickHull: has joined #ruby
[00:49:46] RickHull: has joined #ruby-offtopic
[01:03:55] RickHull: Ping timeout: 260 seconds

2018-01-02

[04:06:34] RickHull: Quit: Page closed

2018-01-01

[02:58:03] RickHull: has joined #ruby
[02:58:05] RickHull: has joined #ruby-ops
[02:58:10] RickHull: has joined #ruby-offtopic
[04:04:04] RickHull: Quit: Page closed
[22:30:34] RickHull: has joined #ruby
[22:30:36] RickHull: has joined #ruby-ops
[22:30:39] RickHull: has joined #ruby-offtopic
[23:53:37] RickHull: capin: using backticks executes the named command
[23:53:41] RickHull: just use regular quotes

2017-12-23

[02:01:47] RickHull: it's probably a method call
[02:02:01] RickHull: resources(:users)
[20:51:36] RickHull: Quit: Page closed

2017-12-22

[00:32:21] RickHull: hays: you mean inheritance vs composition?
[00:32:29] RickHull: inheritance is a fine tool -- it's not a bad idea
[00:32:34] RickHull: but it can be misapplied
[00:32:51] RickHull: composition tends to be more flexible
[00:34:02] RickHull: where there is pushback against inheritance -- it's typically because inheritance can be overused -- it seems like the object oriented way to do things.
[00:34:23] RickHull: some problems are that: not every relationship that we are modeling matches inheritance
[00:34:54] RickHull: problems around multiple inheritance. is my table a child of furniture? or carpentry?
[00:35:12] RickHull: also, the law of demeter is very hard to satisfy
[00:35:58] RickHull: er, hm, maybe i'm not thinking of law of demeter
[00:37:14] RickHull: hays: that sounds fine -- i'd think it would be like 10 minutes of coding
[00:37:17] RickHull: got an example?
[00:41:22] RickHull: yeah, so your other paste showed you doing some output and then calling super
[00:41:46] RickHull: as long as you are faithful to the original method signature, that should be fine
[00:42:02] RickHull: it doesn't make it a good idea, but it's reasonable
[00:42:54] RickHull: generally: `def [](*args); do_stuff_with(args); super(*args); end
[00:43:41] RickHull: no, *args means all the args
[00:44:53] RickHull: i'm a bit fuzzy, but maybe `def [](*args, &blk)`
[00:45:08] RickHull: and you can call super(*args, &blk)
[00:48:05] RickHull: if what is a good idea?
[00:48:46] RickHull: as I said before, a wrapper class that inherits from the thing is totally reasonable
[00:49:12] RickHull: it doesn't make it a good idea, nor a bad idea
[00:49:30] RickHull: it depends on what you want to do with it, and if you can make the wrapper class be faithful to the original
[00:52:03] RickHull: aha, now I remember what I was thinking of. Liskov substitution principle
[00:53:44] RickHull: so, if your array subclass adheres to https://en.wikipedia.org/wiki/Liskov_substitution_principle then you should definitely be AOK
[00:54:27] RickHull: I think it's a useful principle but it's reasonable to break it sometimes
[01:01:20] RickHull: and reading above, I think it's fine to do e.g. `$stderr.puts "item is a #{item.class}"`
[01:01:47] RickHull: what is generally to be avoided is using .class directly in your logic
[01:02:20] RickHull: that is too brittle as it doesn't consider subclasses. instead use case or is_a?/kind_of?
[01:03:18] RickHull: or test responds_to?
[01:03:40] RickHull: or just go full duck typing and just call methods, and let NoMethodError indicate where the duck doesn't quack
[01:03:57] RickHull: but it's not always the case that 2 methods with the same name have the same semantics
[01:48:42] RickHull: hays: just do your thing and then super(*args)
[01:48:48] RickHull: don't literally reimplement array

2017-12-21

[17:12:27] RickHull: has joined #ruby
[17:12:29] RickHull: has joined #ruby-offtopic
[17:12:32] RickHull: has joined #ruby-ops
[17:13:06] RickHull: baweaver: sorry I missed you! I requested the lunch thing with Erica, but John came and grabbed me and he didn't know. I think he texted you midway thru lunch
[17:13:58] RickHull: I don't have your contact details -- though I can probably guess your email. you have mine -- please send me an email :)
[18:41:10] RickHull: gizmore: crystal and elixir offer ruby-like aesthetics with additional type guarantees, catching type errors before runtime
[18:42:04] RickHull: gizmore: this video is not the easiest to follow, but here is some proposal for types in ruby https://www.youtube.com/watch?v=Fjv9GxPXtck
[18:42:33] RickHull: gizmore: it's a pipe dream, I feel. ruby is fundamentally duck typed
[18:42:43] RickHull: to add powerful typing to ruby would make it not ruby
[18:43:17] RickHull: dminuoso: you get guarantees like pattern matched functions
[18:43:34] RickHull: but yes, I am not a fan of dialyzer -- last I looked
[18:43:46] RickHull: but you do get some errors at "compile time" rather than runtime
[18:44:44] RickHull: what is the programmer UX for type hints?
[18:44:56] RickHull: what are the wins?
[18:45:47] RickHull: so it's primarily about IDE stuff, not detecting errors?
[18:46:56] RickHull: the question is serious :) I like discussing things that I am fuzzy on
[18:47:12] RickHull: is that a type hint or strong typing?
[18:47:44] RickHull: i understand the wins from strong typing -- I'm a true believer
[18:47:50] RickHull: i am asking about mere type hints
[18:49:13] RickHull: is it distinct from type annotations? or would that cover strong typing as well?
[18:49:24] RickHull: i also like the idea of type inference
[18:50:21] RickHull: by strong typing, I mean that type checking occurs and where the check fails, there is an error
[18:50:27] RickHull: what is the term for that?
[18:50:48] RickHull: so ruby has types, right?
[18:51:24] RickHull: what is weak about c++ types?
[18:52:27] RickHull: in the controller, presumably
[18:52:35] RickHull: or the model, depending
[18:53:24] RickHull: xco: I like this from railsconf https://www.youtube.com/watch?v=HctYHe-YjnE
[18:54:27] RickHull: hays_: are you aware that @holding_registers is a "class instance variable" and not a normal ivar?
[18:54:32] RickHull: because of the scope where you assign it
[18:54:42] RickHull: (I think that's the case)
[18:54:54] RickHull: you would typically assign an ivar within a method definition
[18:55:32] RickHull: ok, I see -- it's that way in the gem too
[18:58:31] RickHull: hays_: I wouldn't expect that to help. I see that holding_registers is sometimes a method parameter and other times referring to the "class instance variable" (or would it be "module instance variable"?)
[18:59:07] RickHull: to me, this gem's design is confusing
[19:00:02] RickHull: hays_: I see that it's nominally an array -- why would you try to substitute a hash?
[19:01:48] RickHull: fChanX: e.g. https://github.com/rickhull?tab=repositories&q=&type=source&language=ruby
[19:07:19] RickHull: one thing that I'm confused by -- can an instance method refer (properly) to a class instance variable?
[19:07:39] RickHull: it seems to me that rmodbus wants @holding_registers to be both an ivar and a class-ivar
[19:07:48] RickHull: and i'm not sure if they correspond or are totally distinct
[19:08:09] RickHull: when referring to @holding_registers in an instance method -- I think this is only the ivar and not the class-ivar
[19:08:23] RickHull: so I'm not sure what purpose the class-ivar serves
[19:09:21] RickHull: i believe @holding_registers only refers to the class-ivar in a class context -- and so again, not sure what purpose it serves
[19:11:17] RickHull: now, it could be that modules which are mixed in -- their class-ivars might get plonked into the ivar space -- but I doubt it
[19:11:49] RickHull: my guess is that the @holding_registers class-ivar is totally useless and irrelevant
[19:12:42] RickHull: hays_: yes, that is a remote and unlikely possibility, but ruby and mixins are pretty weird so I can't rule it out
[19:13:47] RickHull: hays_: probably what you want to do is `srv.holding_registers = MyThing.new`
[19:14:23] RickHull: so it's pretty weird that rmodbus defines class instance variables
[19:14:28] RickHull: but doesn't deign to use them
[19:14:53] RickHull: that's what I thought, but it appears rmodbus didn't get the memo
[19:18:31] RickHull: git grep tells me that rmodbus's class-ivars are indeed totally useless and irrelevant
[19:18:40] RickHull: call it 90-95% certain
[19:19:49] RickHull: hays_: in that case, it is a method arg
[19:19:53] RickHull: it's not using the ivar
[19:20:03] RickHull: this gem is ... interesting
[19:20:40] RickHull: hard to say -- I'm not really interested in untangling the logic :/
[19:21:11] RickHull: but you understand the difference between a method arg and an ivar? holding_registers is effectively local to the method and does not affect the ivar
[19:22:00] RickHull: you'll have to figure out what calls #exec_req and what is passed to it
[19:24:51] RickHull: it seems silly to not just reference the ivar in the exec_req method
[19:25:00] RickHull: it also seems silly to define and never use class-ivars
[19:25:18] RickHull: i *would* expect your ivar setting to affect what is passed in
[19:25:27] RickHull: but perhaps #exec_req is called before you set your ivar
[19:27:52] RickHull: for sure -- but I always assume I'm the one who doesn't get it -- so I give lots of benefit of the doubt
[19:28:05] RickHull: I assume the code is intentional and does stuff for a reason
[19:28:39] RickHull: and I sympathize with those using the code as a reference for hacking on it, and getting confused
[19:29:50] RickHull: trial by codewars
[19:30:38] RickHull: i'm not sure this "confusion" can be detected systematically (easily)
[19:30:57] RickHull: using the same thing conceptually with the same name as class-ivar, ivar, and method arg
[19:31:38] RickHull: what's broken?
[19:32:42] RickHull: well -- it could be that it's useful to have the class-ivar, ivar, and method arg
[19:32:46] RickHull: i assumed it was
[19:32:59] RickHull: and further inspection showed it was useless and irrelevant
[19:33:03] RickHull: as far as I looked, anyway
[19:33:34] RickHull: if only we had rick-as-a-service
[19:35:08] RickHull: hays_: i'd guess your assignment is blowing away state in the old array
[19:35:28] RickHull: a slice, i think
[19:35:53] RickHull: yeah, they do more than you think
[19:36:00] RickHull: just go to the rdoc
[19:36:11] RickHull: &ri Array#[]
[19:38:29] RickHull: `def [](*args)`
[19:38:41] RickHull: aka variadic args
[19:38:57] RickHull: are you familiar with splat?
[19:39:25] RickHull: >> def foo(*args); args.map { |a| a**2 }; end; foo(1,2,3)

2017-12-17

[07:42:14] RickHull: Quit: Page closed

2017-12-16

[17:28:22] RickHull: has joined #ruby-ops
[17:28:22] RickHull: has joined #ruby
[17:28:25] RickHull: has joined #ruby-offtopic
[17:28:59] RickHull: baweaver: I'm free monday night -- got any plans?
[17:51:06] RickHull: leitz: hey! I've been busy: https://github.com/rickhull/traveller_rpg
[17:52:13] RickHull: AFAICT it's 99% accurate to actual gameplay, modulo the variety of traveller rulesets
[17:54:50] RickHull: leitz: I need to update the README regarding chargen output
[17:54:56] RickHull: but just clone master and `rake chargen`
[17:55:04] RickHull: or `HUMAN=1 rake chargen`
[17:57:05] RickHull: not just yet
[17:58:32] RickHull: dminuoso: what are the top 3 alternatives? couchdb? rethink?
[17:58:40] RickHull: if you want a flexible document thingie
[18:01:15] RickHull: <3 postgres
[18:01:53] RickHull: my last job, we had implemented a crazy flexcolumn thing in ruby to make mysql more friendly to KV style additions
[18:02:30] RickHull: I kept my distance from it and my fingers crossed... ;)
[19:17:42] RickHull: craysiii: you may need to specify the "binary gem" in the Gemfile -- but I wouldn't expect rubygems to operate much differently in this regard
[19:18:00] RickHull: or there may be a platform directive that could help
[19:18:58] RickHull: almost anyone else is better than I am with bundler -- I'm just stabbing in a somewhat educated direction ;)
[19:26:00] RickHull: Ping timeout: 260 seconds
[19:54:18] RickHull: has joined #ruby-ops
[19:54:18] RickHull: has joined #ruby
[19:54:21] RickHull: has joined #ruby-offtopic
[20:26:37] RickHull: _sfiguser: sorry, in regards to?
[20:34:56] RickHull: ah, cool :)
[20:52:13] RickHull: yep, will do :)
[20:54:06] RickHull: craysiii: what's in the binance Gemfile / Gemfile.lock ?
[20:54:31] RickHull: you can also try `gem install binance` to see what happens there
[20:56:49] RickHull: ok -- is there any different behavior with `gem install binance` ?
[21:04:47] RickHull: ha, I see -- it happens... mystery solved! xD
[21:05:07] RickHull: ty-fo-ee-us
[21:09:33] RickHull: they should call it typo-eus xD
[22:42:32] RickHull: that sounds reasonable, depending on the problem. lazy computation usually means consuming less space, and there ideally is no time tradeoff
[22:42:50] RickHull: but depending on the computation, there can be a time tradeoff

2017-12-15

[18:38:48] RickHull: zenspider: nothing important, just nostalgia about the old gang from #ruby-lang :)
[19:44:26] RickHull: Quit: Page closed

2017-12-14

[05:38:18] RickHull: don't ask me what that means, i'm not sure myself
[05:38:23] RickHull: but it's fun to think about
[05:38:43] RickHull: i've had hamburgers in europe
[05:38:55] RickHull: granted, this was 15+ years ago
[05:39:02] RickHull: but it was like "ham" "burgers"
[05:39:29] RickHull: what on earth is a fine burger shop in europe?
[05:39:40] RickHull: ooh that looks nice
[05:39:51] RickHull: i like that little chain, entrecote
[05:40:04] RickHull: the steaks and frites place
[05:40:40] RickHull: dminuoso: where are you from, Italy?
[05:41:16] RickHull: i like Italian Switzerland
[05:41:28] RickHull: I don't know much more of CH or DE
[05:41:36] RickHull: I almost did a semester at Darmstadt
[05:41:45] RickHull: so I went through there while I was touring
[05:42:04] RickHull: but not even a night there
[05:43:02] RickHull: I love the mountains, valleys, and lakes there
[05:43:25] RickHull: from the train window, and where I got off the train in Interlaken, Lugano, Lucerne
[05:43:29] RickHull: I'm sure Geneva too
[05:43:49] RickHull: I've got at least 10 solid days in Lugano
[05:44:17] RickHull: oh, Grindelwald, Gimmelwald
[05:44:35] RickHull: but -- the hamburgers everywhere were no bueno
[05:44:40] RickHull: this was circa 1999 though
[05:44:56] RickHull: Interlaken in particular catered to anglo tourists
[05:45:02] RickHull: but their burgers still sucked
[05:45:13] RickHull: in the middle of the euro transition
[05:45:28] RickHull: i paid always in local currency, never euro
[05:45:31] RickHull: rarely dollar
[05:47:18] RickHull: I'm quite interested now
[05:47:27] RickHull: I ran across a nice site from HN
[05:47:29] RickHull: trying to find it now
[05:47:37] RickHull: it was on HN like 7-10 days ago
[05:47:48] RickHull: news.ycombinator.com
[05:48:47] RickHull: the last time I looked at Haskell, it seemed alien
[05:48:58] RickHull: but on this site, still looking, it looked totally reasonable
[05:49:13] RickHull: now, the last time I looked at Haskell was before I tried Elixir and didn't grok at all
[05:50:20] RickHull: there's this one (not it) https://news.ycombinator.com/item?id=15882776
[05:50:29] RickHull: (Currying is not idiomatic in javascript)
[05:52:03] RickHull: baweaver: do you have a 'haskell' batsignal?
[05:53:25] RickHull: found it! https://soupi.github.io/rfc/reading_simple_haskell/
[05:56:38] RickHull: so what's the real version?
[05:57:34] RickHull: well, how about side effects?
[05:57:39] RickHull: or imperative style
[05:57:46] RickHull: isn't that reasonably accurate?
[05:58:47] RickHull: i have no clue on 'do' notation at this point, literally zero besides skimming the slides a week ago and maybe recently
[05:59:02] RickHull: but what would you say 'do' notation is for?
[05:59:35] RickHull: hmm, good example
[05:59:38] RickHull: still looking
[05:59:53] RickHull: i don't like the trailing quote on main
[06:00:02] RickHull: but I assume I can over it
[06:00:13] RickHull: i'm a hater :/
[06:00:51] RickHull: so how would you say it to me in english? main prime gets XYZ>?
[06:01:27] RickHull: well, I think '=' in Haskell isn't quite 'gets' (not the ruby gets, but assignment, like x gets the value of z)
[06:02:05] RickHull: in ruby, when I see x = y, in my head there is
[06:02:22] RickHull: it's a peer to e.g. n?
[06:03:02] RickHull: I say "f prime of x equals/is dotdotdot"
[06:03:22] RickHull: main-prime, ok
[06:04:14] RickHull: so what is your taste between former and latter?
[06:04:33] RickHull: I like the stream-ishness of the latter
[06:04:39] RickHull: but the former seems nice too
[06:05:12] RickHull: there are less operators in the former
[06:05:21] RickHull: the latter has a backslash-looking-escape thing
[06:07:20] RickHull: it reminds me of counting in lambda calculus
[06:07:29] RickHull: like quite circuitous but ok, fair enough
[06:08:56] RickHull: I still have trouble evaluating your last statement before the wink in my head... <sigh>
[06:09:08] RickHull: lambda x composed with x ?
[06:09:41] RickHull: which is identity, right?
[06:10:17] RickHull: totally understood, there
[06:10:28] RickHull: but what should I understand when I see lambda x dot x
[06:10:33] RickHull: is that identity?
[06:11:48] RickHull: does that imply how counting works?
[06:12:05] RickHull: sorry, I'm just grasping at some formalisms
[06:12:44] RickHull: i'm a little shaky on function composition, and not sure if dot means composition here
[06:13:55] RickHull: so I see lambda x dot x, and one version is def f(x); x; end
[06:15:17] RickHull: in which case I would say `f` is the identity function
[06:16:54] RickHull: or like you said `identity = -> (x) { x }`