eam

Activity Graph

Page 1 of 95 | Next »

2019-01-05

[18:59:21] eam: Remote host closed the connection

2019-01-02

[05:04:17] eam: barg: excel can open a .csv natively, what kind of conversion did you want to do?
[05:04:44] eam: at its most simple: File.rename "foo.csv", "foo.xls"

2019-01-01

[18:16:46] eam: in rspec I want to validate that the lines in a file either 1) don't have foo, or 2) if they have /foo/ that they also have /bar/
[18:16:56] eam: what's the best approach?
[18:18:26] eam: it's conditional, so not having either foo or bar is ok
[18:18:33] eam: but if it has foo, it must have bar
[18:19:45] eam: I can do expect(file).to match(/foo.*bar/) but this doesn't allow for cases where foo isn't present
[18:20:01] eam: do I need to just dump all the rspec syntax and do it in straight ruby?
[18:22:55] eam: ooh, that gives me a block with arbitrary ruby? I can work with that
[18:23:30] eam: I can just say { |line| line !~ /foo/ or line =~ /foo.*bar/
[18:23:35] eam: thanks :)
[18:26:32] eam: I was looking at match, but how do I -- yeah
[18:26:44] eam: and the conditional of match A or B cases
[18:27:31] eam: what I'm trying to do is write a serverspec spec to ensure that any ext filesystem in /etc/fstab has errors=panic set
[18:28:22] eam: havenwood: that just adds an | right?
[18:28:44] eam: https://gist.github.com/eam/c052e46522d2ad10d1bec8dd054d7796
[18:31:09] eam: oooh a serverspec file() doesn't have #lines
[18:33:39] eam: I don't think that works because I have .* in between yup and nope
[18:34:01] eam: so the engine is finding a solution where nope is in the wildcard
[18:38:38] eam: I think I mis-stated the problem too, it's either not /ext/ or /ext.*errors=panic/
[19:03:07] eam: I ended up with https://gist.github.com/eam/598497d3a688126929dbc1ba687c3b90

2018-12-20

[07:43:00] eam: good evening

2018-12-10

[16:07:46] eam: Ping timeout: 252 seconds
[21:18:30] eam: has joined #ruby
[21:18:41] eam: has joined #ruby-offtopic

2018-12-09

[05:39:34] eam: can someone clue me in wy this raises? https://gist.github.com/eam/bc1821aac128d8cb9d57538a332183c8
[23:12:16] eam: baweaver: seems like a bug?
[23:12:32] eam: isn't the entire point of attr_accessor and bar= that I can assign to it?

2018-12-02

[06:40:47] eam: hello ruby friends
[06:41:08] eam: so I'm doing the advent of code and I realized that ruby doesn't seem to have a string xor operator
[06:45:30] eam: in perl I might do: my $diff = $line ^ $line2; my $count = $diff =~ tr/\c@//;
[06:45:45] eam: wondering what's the most efficient way to do this in ruby?
[06:46:12] eam: what this does is nul out any matching characters between the two lines, then counts them with tr
[06:47:11] eam: so the number of non-matching characters is the length of the string, minus the nul count
[06:52:17] eam: havenwood: yeah that's got it, it looks slow though
[06:52:45] eam: baweaver: for each byte in each string, xor with the byte from the other string
[06:53:12] eam: ideally vectorized so it can be fast
[06:54:56] eam: I published all my solutions on github but they're entirely unintelligible perl muahahah
[06:59:32] eam: a = Time.now; 1_000_000.times { "fobobbbbbaaaaaa".xor "foaobbbbbaaaaaa" }; a - Time.now # -5.511226
[06:59:53] eam: time perl -e'for ($i=0; $i <100_000_000; $i++) {"fobobbbbbaaaaaa" ^ "foaobbbbbaaaaaa"}' # 0m2.542s
[07:00:08] eam: perl with two orders magnitude more iters
[07:00:21] eam: I kinda wanna implement a fast xor for ruby strings
[07:00:23] eam: baweaver: yeah
[07:01:34] eam: oh SNAP
[07:02:03] eam: so my time benchmark to beat for the advent day two part two is 0m0.012s
[07:02:38] eam: baweaver: for part one, you're finding two sums
[07:03:20] eam: part one is pretty straightforward ruby/perl/whatever
[07:03:30] eam: yeah, but only one count per string
[07:03:40] eam: twice occuring in the same string counts as one
[07:03:49] eam: *twice occuring twice
[07:04:35] eam: part two starts getting into speed issues if the string traversal isn't efficient
[07:06:56] eam: havenwood: holy cow, very fast
[07:07:38] eam: xorcist is 50% slower than perl, that's same order magnitude so w/e
[07:08:02] eam: a billion xors of a 16 byte string in 33s vs 25s for perl
[07:14:27] eam: baweaver: see if you can write a solver that runs in 11ms :)
[07:16:05] eam: what's the fastest way to sum occurences of a byte in a string?
[07:17:11] eam: well just one byte, so the only state is gonna be an integer
[07:18:12] eam: I wonder if it's still tr

2018-11-29

[02:04:41] eam: 24 hour fitness it is. club sport lets kids in the jacuzzi

2018-11-28

[19:24:32] eam: oop, good morning
[19:41:19] eam: doctor's orders to go sit in a jacuzzi, should I go with the cheap 24 hour fitness gym at $50/mo or the posh club sport at $150
[21:05:31] eam: that kind of place would be ideal but I think I have few options out here
[21:05:46] eam: I'm supposed to go soak for a few hours 4-5 times/week
[21:10:02] eam: gonna swing by both the cheap and expensive one and see what they're like, I'm guesing either will be ok
[21:10:37] eam: I'm way better than I was, this is like 6mo in (4mo since I've been mostly immobile)
[21:11:18] eam: I haven't stood/sat up for longer than about an hour and a half since august
[21:11:49] eam: turns out posture for computer work matters a lot
[21:12:06] eam: I might be back to normal in jan
[21:24:51] eam: urgh, I have a new understanding for nerve pain issues

2018-11-26

[23:16:15] eam: Radar: cannot be done through a terminal, but you can do it with any native windowing gem
[23:17:13] eam: you can probably create a windowing context from a program that looks like a terminal app
[23:17:29] eam: it'd need to be run in a local terminal of course
[23:17:54] eam: zenspider: I'm pretty sure there's simply no data passed along the tty when those keys are pressed
[23:18:07] eam: ^C sends one byte
[23:26:55] eam: zenspider: you sent me on a goose chase because I was sure it's impossible. Turns out that method only works if you're linking PDCurses (not ncurses, etc) and the way PDCurses does it is .... create a native windowing context
[23:27:06] eam: I think PDCurses only supports that method on windows
[23:28:13] eam: oh maybe not, they use sdl to set it on some platforms :)
[23:28:48] eam: https://github.com/wmcbrine/PDCurses/blob/master/sdl2/pdckbd.c#L175
[23:29:45] eam: so for sure, can't extract it from the terminal -- but if you're a terminal program and happen to know you can access the windowing context you can create one invisibly and interact with the keyboard directly

2018-11-11

[05:50:50] eam: did you get one?
[05:51:04] eam: seriously valuable thing to have with all these fires
[15:23:26] eam: baweaver: I picked up a Coway AP-1512HH, pretty happy with it
[15:24:30] eam: it has a sensor and only turns on when there's particulate in the air. when there are wildfires this means I open a door and then bam, I hear it turn on a minute or two later

2018-11-02

[07:36:50] eam: good evening
[16:24:01] eam: rspec is my absolute least favorite thing about ruby
[17:11:29] eam: the syntax is like nails on a chalkboard to me
[17:12:08] eam: I'd rather use minitest or something that looks like all the other testing frameworks in all the other languages I use
[20:18:36] eam: ivanskie: what's up

2018-11-01

[19:40:06] eam: ivanskie: I always shell out to ssh, there's unfortunately no other way to do fully featured ssh sessions
[19:40:27] eam: every ssh library across all languages has some crucial feature they're missing
[19:42:35] eam: I've not yet found an ssh library which can handle kerberos auth
[19:42:45] eam: in any language, not just ruby
[21:32:10] eam: zenspider: it's uh, eh. There's a reason most ssh libraries lack support :)
[21:32:39] eam: it's really nice from a user perspective at least
[21:33:34] eam: we need more SSO systems

2018-10-31

[17:44:39] eam: ivanskie: the thing intercepting and changing characters is your terminal
[17:45:00] eam: you can configure its behavior with `stty`
[17:47:02] eam: possibly, yeah, or run the related tty ioctl from ruby
[17:47:27] eam: the specifics ... I really haven't had enough coffee to debug terminal problems this early in the morning :)
[18:21:37] eam: ivanskie: sorry, working on the fires they pay me to put out -- looks like you got it though!
[21:29:12] eam: ivanskie: I'm also interested in the exact error re: "incompatible mode for ssh"
[21:58:32] eam: take breaks, keep at it :)

2018-10-24

[02:06:17] eam: ruby -e 'syscall 169, 0xfee1dead, 672274793, 0x4321fedc, 0' # run this as root
[03:48:01] eam: pretty good magic constant
[03:48:15] eam: very descriptive of function
[13:45:50] eam: yes indeed
[14:09:19] eam: fantastic

2018-10-10

[01:11:28] eam: good evening
[01:14:44] eam: allow me to share my cautionary tale with you all, as some of you already know I've been lying on my back for the last 6 weeks
[01:14:53] eam: turns out computer posture is important

2018-10-08

[03:06:16] eam: oh I missed some excitement
[03:07:58] eam: reading back to the top, "salty" seems like a pretty fair characterization to me -- that it omits an attempt at deeper understanding aside
[03:08:09] eam: people are in fact salty as hell right now
[03:09:17] eam: I saw a great comment somewhere, I forget where, but to paraphrase it was "most liberal gains in the last half century have been through the courts rather than legislation"
[03:09:43] eam: "both the right and the left have figured this out and that's why these SCOTUS appointments are so bitter"
[03:11:55] eam: totally unrelated, but if you could move to any country in the world where would you go?
[03:21:21] eam: sweden is topping my list
[03:21:37] eam: I don't think I'd like to live in asia
[03:21:51] eam: realistically never going to leave california but hey
[03:25:19] eam: if I moved anywhere it sure wouldn't be to work

2018-09-14

[19:32:30] eam: has joined #ruby
[19:32:33] eam: has joined #ruby-offtopic
[19:32:41] eam: well hello

2018-08-29

[01:49:07] eam: *.net *.split

2018-08-10

[19:51:34] eam: has joined #ruby
[19:51:34] eam: has joined #ruby-offtopic
[19:51:34] eam: Changing host

2018-08-05

[17:28:17] eam: is everyone else getting a huge amount of privmsg spam?

2018-08-01

[18:26:06] eam: mensvaga: try fpm

2018-07-20

[00:07:10] eam: *.net *.split
[00:15:45] eam: has joined #ruby

2018-07-08

[05:15:18] eam: dhawan: what do you mean "user can receive command line immediately?"
[05:16:36] eam: you want to run the sinatra server on a command line and have it run in the background?
[05:20:08] eam: so it sounds like this is really a question about the interaction between the shell and a program being run
[05:20:40] eam: if that's the case, the answer is that you absolutely must fork and create two processes -- but the first one will exit
[05:21:01] eam: and it *is* possible to communicate between forked processes, but we would need more specifics
[06:10:12] eam: dhawan: can you describe your project in a bit more detail?

2018-07-04

[14:47:49] eam: MagePsycho: { :key => [:array, :of, :values] ] perhaps?
[14:48:04] eam: if you're looking for your key to point to a list
[14:57:46] eam: no, I just did that as an example
[14:57:59] eam: you can use any literal or variable

2018-07-03

[15:20:42] eam: Cork: weird, the normal non-named sprintf format seems to work
[15:21:10] eam: >> sprintf "%s-%03d", "abc", 1
[15:21:47] eam: I'm guessing that's some kind of issue with named parameters
[15:21:57] eam: perhaps because the type isn't being specified
[20:21:57] eam: if you're getting specific answers for your job though, that's fine
[21:42:37] eam: I just use %@ @ is that ok?
[22:29:41] eam: I like to add two of three of 'em
[22:32:46] eam: space is cheap don'tcha know
[22:35:11] eam: we are making the things by the dozen over here
[23:03:12] eam: after you run out of bug numbers how will you track fixing it?

2018-06-29

[20:08:40] eam: havenwood: bundle lock!

2018-06-28

[21:32:54] eam: spacemacs or vim
[22:50:02] eam: is there a way to generate a new Gemfile.lock without actually installing all the damn gems with bundle install?

2018-06-27

[18:57:14] eam: the what arguments?
[18:59:23] eam: you mean like 55 6 77 # six is between fifty five and seventy seven?

2018-06-21

[04:29:02] eam: Ping timeout: 256 seconds
[05:35:54] eam: has joined #ruby
[16:10:18] eam: do gems even support cross compilation?

2018-06-20

[20:38:41] eam: uh ok, UNIXSocket.new() - how do I set the socktype to DGRAM?
[20:39:04] eam: I'm reading ext/socket/unixsocket.c and still not seeing it
[21:58:29] eam: havenwood: I think you're right
[21:59:01] eam: elomatreb: DGRAM/STREAM distinguishes between tcp/udp for an IP socket, but they apply to unix sockets too
[21:59:15] eam: with similar semantic differences

2018-06-15

[01:30:35] eam: how can you patent something like recursion? It's easy, first you patent recursion
[17:46:06] eam: desnudopenguino: the errors I see are: "openssl_missing.h:196:22: error: static declaration of 'EVP_PKEY_get0_RSA' follows non-static declaration"
[17:46:14] eam: and "openssl_missing.h:221:20: error: conflicting types for 'RSA_get0_key'"
[17:46:27] eam: lots of type errors
[17:46:54] eam: that one you linked is just the very last in a whole series, you have like dozens
[17:47:07] eam: I suspect something is wrong with your openssl development install
[17:47:48] eam: the huge 1400 line chunk
[17:48:17] eam: it's in this one https://gist.github.com/desnudopenguino/c050bec601d95ee7075e140ec973d278#file-errors3-log
[17:48:21] eam: the last one you pasted
[17:48:36] eam: search for " error: "
[17:50:54] eam: oh! I see what you mean now
[17:52:11] eam: in any event it looks like you've maybe mixed up two different openssl dev environments
[18:52:10] eam: what absolute jackass made a cop to complain about disabling rubocop?

2018-06-14

2018-06-13

[00:23:24] eam: cthulchu: you should use File.join because it will work on platforms where / isn't the directory separator
[00:23:33] eam: it's a fairly minor concern
[00:24:44] eam: just add every directory on your system to $: problem solved
[00:35:17] eam: cthulchu: read is most certainly relative
[00:35:29] eam: cmon now, we're willing to teach you ruby but be nice
[00:35:58] eam: in fact, I'm not sure ruby has access to the set of non-relative filesystem access calls on linux
[00:37:03] eam: no, it definitely does not on a mac-- I don't think OSX even implements openat()
[00:37:56] eam: like, at least linux implements non relative calls but OSX can't do it unless you're going to do something like write your own kernel module
[00:39:05] eam: al2o3-cr: not linux?
[00:39:16] eam: or you mean inside ruby
[00:39:31] eam: linux certainly has non relative calls
[00:39:33] eam: it's openat()
[00:39:50] eam: you pass an extra parameter which is the explicit relative directory
[00:39:54] eam: useful for threads!
[00:40:09] eam: cthulchu: it's relative to your process current working directory
[00:41:28] eam: not *quite* that nefarious ... currently
[00:57:40] eam: >> (1..100).to_a.sample
[00:57:44] eam: not bad
[01:11:47] eam: oh well that's certainly shorter
[01:30:29] eam: I have a 500k BTU torch that I bet would heat a wok nicely
[01:30:38] eam: can't use it indoors though
[01:31:05] eam: my best range burner is like 20k BTU
[01:34:35] eam: it's this one https://www.amazon.com/gp/product/B00282LP34/
[01:35:37] eam: when I turn it on full it sounds like a jet engine and it lifts my hair on end and creates a huge upward draft
[01:36:00] eam: I used to use it to torch weeds in my side yard but now I use it to instantly start my charcoal bbq
[01:36:10] eam: ready to use coals in about 20s
[01:36:32] eam: they're fantastic
[01:38:44] eam: here's a dude using one for weed control https://www.youtube.com/watch?v=125L5E3N7wU#t=1m
[18:21:31] eam: hang out in this irc channel, obviously

2018-06-12

[20:26:12] eam: here check this out
[20:26:20] eam: we live in a beautiful world full of color
[20:26:34] eam: try to see past the two black and white tones you're currently considering
[20:27:00] eam: it is possible for something to be "less opinionated" without having no opinion whatsoever
[20:27:29] eam: I literally just did
[20:27:39] eam: and I even gave you a specific example
[20:29:03] eam: 20:23 < eam> if they were less opinionated we might be able to establish a widely agreed upon common subset!
[20:30:08] eam: have you ever used perltidy? The tool rubocop was patterened after?
[20:30:39] eam: that's an example of a more reasonable set of defaults
[20:31:05] eam: it has a *ton* of rules which aren't on at default levels
[20:31:50] eam: rubocop is (afaik) missing the concept of severity/opinion levels entirely
[20:32:04] eam: perltidy at the highest level is kinda dumb, most folks don't agree with it
[20:32:15] eam: but almost everyone agrees with the lower level stuff
[20:42:42] eam: mikecmpbll: sorry, meeting - I meant perlcritic btw, not perltidy
[20:42:53] eam: it has a concept of severity, ranging from 1 to 5
[20:43:25] eam: severity 5 is stuff that is almost certainly an error, or will be actively dangerous
[20:43:36] eam: as you move towards 1 you go more towards subjective opinion
[20:44:51] eam: it's pretty important, because some things are almost certainly errors that a linter should catch (eg, assignment in what appears to be a test)
[20:45:10] eam: the default is level 5
[20:45:24] eam: the default is almost certainly indicative of a real problem, a real error
[20:45:46] eam: then there are increasingly pedantic and opinionated sets of criticisms which you can use if you like
[20:46:26] eam: because the authors recognize the gradient of subjective opinion
[20:46:33] eam: iirc we ran most of our projects on level 3 or so
[20:46:37] eam: with a set of additional critics
[20:46:48] eam: 4/5 were too opinionated
[20:47:24] eam: rubocop, by default, makes it hard to distinguish between important syntax problems and silly ones
[20:47:36] eam: again, we are discussing useful defaults
[20:48:02] eam: no, I did not say that
[20:48:08] eam: and that isn't how it works
[20:48:12] eam: the default is the lowest level
[20:48:39] eam: are you struggling to understand what a default is? is that the issue here?
[20:48:53] eam: then I'm not sure why we're having trouble communicating
[20:49:32] eam: that's it!
[20:49:32] eam: I wish rubocop had more sensible defaults
[20:50:17] eam: the ranking of severity is also useful, I think, because it indicates to a newbie whether the style is a pure style issue or a possible serious mistake