hays_

Activity Graph

Page 1 of 3 | Next »

2019-08-22

[00:56:11] hays_: *.net *.split
[01:14:35] hays_: has joined #RubyOnRails
[01:14:41] hays_: has joined #ruby
[01:15:51] hays_: Max SendQ exceeded

2019-08-18

[11:30:11] hays_: has joined #RubyOnRails
[11:30:11] hays_: has joined #ruby

2019-06-20

[15:57:14] hays_: has joined #ruby
[15:57:14] hays_: has joined #RubyOnRails

2018-12-28

[17:04:01] hays_: has joined #ruby
[17:04:01] hays_: has joined #RubyOnRails
[17:20:07] hays_: Remote host closed the connection
[17:23:49] hays_: has joined #RubyOnRails
[17:23:49] hays_: has joined #ruby
[17:31:45] hays_: Ping timeout: 250 seconds
[17:46:25] hays_: has joined #RubyOnRails
[17:46:25] hays_: has joined #ruby
[19:39:32] hays_: Ping timeout: 250 seconds

2018-11-09

[10:06:58] hays_: has joined #RubyOnRails
[10:06:59] hays_: has joined #ruby

2018-10-03

[14:03:40] hays_: has joined #ruby
[14:03:40] hays_: has joined #RubyOnRails

2018-09-20

[00:45:46] hays_: is it totally nuts to listen to 127.0.0.101 as another 'localhost'
[00:45:55] hays_: its a /8 subnet after all
[00:46:19] hays_: pinging it certainly doesn't work
[01:17:13] hays_: yeah. can't ping it like localost tho
[01:33:54] hays_: havenwood: hmm I think I have to actually bind 127.0.0.101 to the lo interface
[01:34:01] hays_: that's what i was missing
[02:11:00] hays_: Remote host closed the connection

2018-09-19

[22:30:03] hays_: has joined #ruby
[22:33:21] hays_: anyone who uses rubocop--is it fair to say that driving the number of "offenses" to zero is not usually practicable
[22:33:51] hays_: I'm finding some cases where.. it doesn't make sense to make the method shorter, or ABC complexity makes sense
[23:19:52] hays_: baweaver: it seems basically impossible to use optparse in a way that won't violate a rubocop rule
[23:20:14] hays_: since you end up with a big block if you have more than a few args
[23:45:43] hays_: optparse might be like a page long

2018-09-13

[04:23:03] hays_: has joined #ruby
[04:23:44] hays_: i was wondering what people think of this pattern: https://bpaste.net/show/cec01c8f1a04 I am using a class variable which is usually a no-no
[04:24:01] hays_: but it seems right, since i actually do want the variable to inherit to subclasses
[04:26:12] hays_: how would you do it
[04:27:10] hays_: i want do be able to do Point.handler_map(:int16).new
[04:27:52] hays_: allowing me to avoid a large case statement
[04:28:34] hays_: do you mean Point.new.handler_map(:int16).new ?
[04:28:44] hays_: that seems inefficient
[04:29:34] hays_: creating a PointINT16 object
[04:29:57] hays_: based on having a variable with :int16 in it
[04:30:46] hays_: without case variable; when :int16; foo=PointINT16.new; when :int32, etc. etc.
[04:36:10] hays_: https://bpaste.net/show/bf75fb02e3fe
[04:36:52] hays_: I am obviously not showing the implementation, but these classes all have different details of hows things need to be handled
[04:37:20] hays_: definitely looking for a better way
[04:39:36] hays_: there are short and long floats, 8 bit variants as well, and possibly others
[04:39:53] hays_: but even that case statement right there is long enough to flag a tool like rubocop
[04:40:30] hays_: plus, that case statement ends up getting copy/pasted to a lot of places since it is outside the class definition
[04:56:44] hays_: there are read and write methods that do very different things
[04:57:14] hays_: when structured like that ^ you end up with big complex methods with a high ABC score
[04:57:50] hays_: those case statements end up in the read/write methods
[04:58:37] hays_: i think that's what im doing?
[04:58:54] hays_: not namespace, but class abstractions
[05:03:14] hays_: i don't know enough ruby to quite understand how to implement Point[:uint16].new
[05:03:53] hays_: im screwing around too. with maybe a factory pattern
[05:05:58] hays_: something like this maybe https://bpaste.net/show/39a1bc37d463
[05:07:46] hays_: hmm ok that gives me something to think about
[05:13:33] hays_: that's .. interesting. const_get
[05:14:21] hays_: class with a k--is that a convention of some kind
[05:16:36] hays_: i sometimes use cls
[05:16:50] hays_: that's probably a bit terse
[05:17:53] hays_: yeah. well thanks for that. I would have never thought to use modules in that way
[05:18:26] hays_: long names are nice, but sometimes cause me grief regarding the 80 line limits
[05:19:18] hays_: its always interesting when you have a chain of methods, how far to take it
[05:20:08] hays_: do you mean \
[05:24:47] hays_: Ping timeout: 240 seconds
[05:27:07] hays_: has joined #ruby
[05:27:20] hays_: hotel wifi. erg
[05:28:06] hays_: how do you speak self.[]
[05:28:27] hays_: "self braces" ?
[05:29:04] hays_: what about []=
[05:29:24] hays_: i was trying to explain to someone what these were
[06:19:24] hays_: Ping timeout: 272 seconds

2018-09-12

[05:21:30] hays_: has joined #ruby
[05:23:39] hays_: anyone here run rubocop as a style guide enforcer? it seems to really crack down too much on ABC complexity and method length. specifically im hung up on a situation where i have a case statement with a bunch of possible cases, each one calls a separate method so they are one line, and even so it exceeds the method lengh. can't see how to break it up so its clearer
[05:24:28] hays_: i thought about subclassing to avoid the case statement, but it just moves the problem up the chain, eventually to a JSON config object that must do a case statement on a bunch of possible strings
[05:26:26] hays_: i could make a dict that mayby maps strings to classes, and then use a lookup to create the class.. but now i've just moved it to a dict, which seems like cheating
[05:28:20] hays_: class_lookup[:foo].new. i guess that's pretty clean.
[06:12:07] hays_: Ping timeout: 246 seconds
[13:53:42] hays_: has joined #ruby
[13:53:49] hays_: this is the best i can do to avoid a big fat case statement, but rubocop still whines about the class variable. what do you guys think. any way to avoid it? Is this too strange?
[13:53:51] hays_: https://bpaste.net/show/cec01c8f1a04
[13:53:54] hays_: one creates a point with Point.handler_map(:int16).new
[14:12:27] hays_: Ping timeout: 240 seconds

2018-09-11

[17:05:28] hays_: has joined #ruby
[17:05:35] hays_: how does !true work?
[17:05:39] hays_: I was looking at :!.methods
[17:06:05] hays_: and it seems like :!.send_public(true) won't do it
[17:08:42] hays_: nvermind.
[17:08:47] hays_: Read error: Connection reset by peer

2018-09-07

[04:23:45] hays_: has joined #ruby
[04:24:27] hays_: this is my favorite piece of code today: https://github.com/tablador/rpn_calc/blob/master/rpn_calc.rb
[04:27:41] hays_: not sure i've seen any examples this generic
[04:30:33] hays_: i feel like this might be a good beginning to an obfuscated ruby contest
[04:35:02] hays_: oh, please tell me all the reasons it is bad
[04:43:24] hays_: i considered reduce, but it seemed that it would reduce clarity. and to me, each isn't an idiom that implies that order is important.
[04:45:20] hays_: i do not see a problem with a two pronged case statement, nor do I see a problem with using the symbols. I should raise a better error message--agreed. varadic args also might be a good idea
[04:47:36] hays_: who says it has to be numbers
[04:47:57] hays_: it can be any method.
[04:48:14] hays_: that seems more flexible to me
[04:48:53] hays_: I think that a reasonable implementation of each (maybe not in ruby) would ignore order and happen in parallel
[04:49:03] hays_: whereas a for loop implies ordering
[04:50:02] hays_: If I tell you to chop each of these 5 vegetables, do you think you much chop them in the order i handed them to you?
[04:53:00] hays_: so, are you saying that there is no use case in ruby for a for loop?
[04:53:08] hays_: since .each is equivalent?
[04:55:01] hays_: I am just surprised to hear the opinion that the use of for loops is bad ruby
[04:55:53] hays_: are you saying you've held this opinion for a while?
[04:58:23] hays_: we are just two people talking. I'm just trying to understand your ideas, which are probably coming from a place of deeper understanding of ruby
[04:59:40] hays_: i wouldn't think code is bad if it clearly expresses what is happening, but it does appear that at least the rubocop style guide labels for loops as bad also
[05:00:36] hays_: someone who doesn't know what a for loop is
[05:01:30] hays_: i wonder if we counted developers who didn't know what a for loop was and then counted developers who didn't know what .each does, which would be higher
[05:02:06] hays_: havenwood: cool. each_with_object is fancy. yeah
[05:03:40] hays_: baweaver: there is a world where people must know many languages and not know them in great detail. I don't think that's necessarily a strawman. but I am not disagreeing with you, really. Except that I am not sure I would say that a for loop is bad. Maybe less idiomatic, sure
[05:04:24] hays_: havenwood: yeah, each_with_object is one of those things that pops up quite a bit
[05:06:43] hays_: your version really uses a lot of ruby-specific ideas
[05:07:34] hays_: some things I am actually reluctant to use in practice, maybe because of the people I work with, including myself, who have to switch between a lot of languages
[05:08:06] hays_: heh is that SHL
[05:08:52] hays_: i tend to prefer ruby that could be trivially converted to .. say.. python without much deep though
[05:10:22] hays_: its the world I live in. in fact, we might be dumping ruby soon. for probably arbitrary reasons
[05:13:36] hays_: havenwood: well.. we backed into Ruby via Rails, and its been fine. but we're reconsidering rails, and some other things we're doing would indicate Python as a smart choice because of its rather strong set of libraries for .. well a lot o things
[05:14:19] hays_: I personally don't think the problem is Rails. I think the problem is we don't have a strong enough team and its leading to bad implementations in Rails
[05:14:54] hays_: baweaver: yep, but its also solid with web, comms, and other IT glue stuff
[05:15:39] hays_: like I can pull down a iec 61850 implementation in python, but not in Ruby. its just so big
[05:16:28] hays_: It isn't going to be my call--software engineering is going to decide what to do with the Rails stuff
[05:16:35] hays_: baweaver: yep
[05:16:59] hays_: its just not a deep enough bench for the experience
[05:17:53] hays_: im on the sidelines, but I am seeing just huge problems everytime I glance across it. last time I did, I found some huge resource leak with threads and sockets due to the way they were being created and managed. causing the app to crash the server
[05:18:16] hays_: but we have one developer, and then a 'team in India'
[05:18:35] hays_: all managed by the developer--a person who cannot manage a team
[05:18:45] hays_: but this is wayyy off topic sorry
[05:19:42] hays_: The stuff I'm working on is probably best suited to be Python. So I may have less occasion to use Ruby, which will make me a little sad, because I like Ruby
[05:22:01] hays_: havenwood: small bug, your pops are backwards I think
[05:22:16] hays_: [15, 3, :/] should yield 5
[05:22:52] hays_: my version 1 did that too heh
[05:29:01] hays_: why .instance_of and not .is_a ?
[05:51:00] hays_: Remote host closed the connection
[12:51:30] hays_: has joined #ruby
[12:51:30] hays_: has joined #RubyOnRails

2018-09-06

[17:41:48] hays_: has joined #ruby
[17:42:15] hays_: if I have a file that is opened by an object, is there a way to make sure the file is closed properly upon Ctrl-C, etc
[17:42:30] hays_: want to make sure output is flushed, etc if an exception rolls through
[17:47:35] hays_: Remote host closed the connection

2018-09-05

[21:06:56] hays_: has joined #ruby
[21:07:26] hays_: If I wanted to use map to generate a hash, is the clearest/best way to go about this to use to_h? I find end.to_h to be .. disturbing
[21:10:20] hays_: Hash[] also seems weird, encasing a block like that. is this something I should just get over
[21:26:04] hays_: is there a way to have ruby be associated more strongly with the directory I am in? right now I am using rbenv and basically if I have a shared directory among different users, each one needs to have a certain ruby installation and associated gems
[21:26:36] hays_: it would be cool if there was a way to just have a ruby that is in that directory somehow, and it is picked up when someone cds into the directory.
[21:40:38] hays_: im using rbenv because it is what others on my team use
[22:48:07] hays_: is there a nice way to merge two keys into a single key so that it is usable in a Hash?
[22:49:55] hays_: interesting. thats a number, which I guess is OK
[22:50:00] hays_: maybe better than a sting
[22:51:36] hays_: i was thinking that, but it seems like using a mutable as a key is asking for problems
[22:52:12] hays_: the context is.. a lot like the situation where you have ip and tcp. except they are :syms
[22:52:47] hays_: trying to figure out reasonable way to be able to store those.. was thinking nested dicts isn't too bad
[23:18:05] hays_: Remote host closed the connection

2018-09-03

[16:05:42] hays_: has joined #ruby
[16:05:42] hays_: has joined #RubyOnRails
[16:12:55] hays_: Ping timeout: 246 seconds

2018-08-16

[01:12:42] hays_: has joined #ruby
[01:14:10] hays_: i am seeking a useful pattern for ruby. here's the deal. I tend to encode config items in JSON. its pretty easy to load in a json file and then just access the stuff. but its also kinda opaque in the sense that I'm not really validating or documenting the structure of that json in my code. is there a good, concise pattern for something like this?
[01:15:32] hays_: maybe I want this: https://github.com/ruby-json-schema/json-schema
[02:23:21] hays_: Remote host closed the connection

2018-08-15

[01:32:54] hays_: has joined #ruby
[01:33:13] hays_: bear with me--i have made a gem, and I get whining when I install it that my dependencies dont have versions
[01:33:33] hays_: but--when I add versions it complains about something else
[01:34:05] hays_: how should I be specifying versions in gem dependency lists
[01:46:21] hays_: yeah, sorry. hit a hiccup. I made an s.executables = Dir["{bin}/*"] and it doesnt like the bin/ in that so i need to fix that to reproduce the error
[01:56:58] hays_: desnudopenguino: WARNING: open-ended dependency on gserver (>= 0) is not recommended
[01:57:14] hays_: WARNING: open-ended dependency on activerecord (>= 0)
[02:00:03] hays_: so do I add ~> 0 to those?
[02:31:01] hays_: am I misunderstanding bundle? I am running bundle install and it doesn't seem like some of the gems are installing
[02:32:03] hays_: it seem slike it is "using" the gem from a github repo, but not installing it somehow
[02:34:29] hays_: crazy enough, bundle exec irb shows the gem installed, but straight irb does not.
[02:44:32] hays_: yes, but I don't really know how to help with your request
[02:46:16] hays_: ok. well I have a Gemfile. it has a list of gems. one of them is to a private github repository
[02:46:39] hays_: that one does not show up in gem list, but it shows up if I do bundle exec irb
[02:47:03] hays_: however, the gems that are public. those seem to install in system/rbenv ruby
[02:47:47] hays_: so if its a rubygem it installs it in the system, but if its a github gem it somehow keeps it isolated within the bundle tool?
[02:48:20] hays_: curious. ok
[02:48:47] hays_: with the other problem, I took a guess at it, and seemed to get it to build/install the gem without warnings
[02:49:50] hays_: i was getting warnings when I ran gem build foo-1.0.gemspec
[02:50:04] hays_: erm thats a garbage gemspec name. I meant foo.gemspec
[02:50:16] hays_: it didn't seem to like unversioned gem depedencies
[02:50:49] hays_: WARNING: open-ended dependency on gserver (>= 0) is not recommended
[02:51:12] hays_: so for that one I added '~>0' and it seems to be OK now
[02:51:33] hays_: but I was getting the same warning for nokogiri, activerecord, and mysql2
[02:53:08] hays_: i made activerecord ~> 5.2
[02:53:41] hays_: not sure if that's reasonable
[02:53:50] hays_: mysql ~> 0.5
[05:32:22] hays_: has left #ruby: ()

2018-08-09

[06:41:36] hays_: Read error: Connection reset by peer

2018-08-01

[09:28:07] hays_: has joined #ruby
[09:28:07] hays_: has joined #RubyOnRails

2018-07-24

[08:49:57] hays_: Ping timeout: 240 seconds

2018-07-20

[00:07:00] hays_: *.net *.split
[00:15:26] hays_: has joined #RubyOnRails
[00:15:37] hays_: has joined #ruby

2018-07-17

[11:39:13] hays_: Ping timeout: 248 seconds
[11:47:18] hays_: has joined #ruby
[11:47:18] hays_: has joined #RubyOnRails

2018-07-14

[19:04:53] hays_: has joined #ruby
[19:04:53] hays_: has joined #RubyOnRails

2018-07-12

[00:12:47] hays_: has joined #ruby
[00:12:48] hays_: has joined #ruby
[00:12:48] hays_: Changing host
[00:31:53] hays_: any major differences in MRI implementation for Linux vs. Mac/Windows that might underlie an issue I am having where a script using celluloid would only crash in Linux?
[00:32:54] hays_: kind of a vague question i know, but im a bit at a loss why i only seem to experience problems on linux
[00:33:39] hays_: script running on powerful, underutilized server--crash and burn. Run it on a Windows laptop, no problems
[00:37:23] hays_: bougyman: yeah
[00:39:07] hays_: g-: I do, and I am working that angle also--probably some unhandled exception. but I still find it puzzling that this only happens on linux machine
[00:48:21] hays_: oh i have
[00:48:40] hays_: its now across two distros even
[00:49:15] hays_: one day i will have the time to actually track down this bug and fix it, but I was just hoping there might be some major differences in platform that could give me a hint
[01:13:10] hays_: g-: nope. no DB. it does some TCP comms
[01:13:20] hays_: writes to disk
[01:13:50] hays_: i have some semaphores to make sure stuff doesn't get stomped on
[01:16:13] hays_: oh well. it was a bit of a shot in the dark anyways
[01:43:10] hays_: g-: I don't think so.
[01:45:10] hays_: scheduler is just cfs these days right?
[01:45:27] hays_: the IO scheduler is per HDD but id have to check what the default is.. deadline?
[01:48:06] hays_: cfq looks to be the default at least in ubuntu
[02:17:20] hays_: g- unfortunately not really--plus it would not be fair to ask you to do my work for me, but I appreciate the offer
[02:46:04] hays_: Remote host closed the connection

2018-07-06

[21:49:19] hays_: Ping timeout: 256 seconds

2018-06-23

[22:28:57] hays_: has joined #ruby
[22:28:57] hays_: has joined #RubyOnRails

2018-06-08

[13:30:40] hays_: has joined #ruby
[13:30:40] hays_: Changing host
[13:30:40] hays_: has joined #ruby
[14:12:51] hays_: Remote host closed the connection

2018-06-07

[18:49:22] hays_: Read error: Connection reset by peer

2018-05-29

[02:48:14] hays_: has joined #ruby
[02:48:14] hays_: Changing host
[02:48:14] hays_: has joined #ruby

2018-05-24

[17:39:56] hays_: has joined #ruby
[17:39:56] hays_: Changing host
[17:39:56] hays_: has joined #ruby
[18:40:37] hays_: Remote host closed the connection

2018-05-07

[15:28:23] hays_: has joined #ruby
[15:28:23] hays_: Changing host
[17:52:24] hays_: Remote host closed the connection