« Back to channel list

#ruby - 05 April 2017

« Back 1 day Forward 1 day »
[00:02:24] kaspergr1bbe: has joined #ruby
[00:02:49] Verity: you doing code audits tonight?
[00:03:04] Verity: would be nice to get another set of eyes on this project as it grows larger
[00:05:51] nofxxx: Verity, what's the project?
[00:06:07] Verity: cli rs232 serial communications application
[00:06:16] Verity: specifically file transfer
[00:07:38] SeepingN: wow, how 1995 of you
[00:08:04] SeepingN: what are you interfacing with?
[00:08:43] nofxxx: hehe, funny .. I'm waiting for an rs485 to do some serial stuff... modbus controlling a frequency inverter
[00:10:04] nofxxx: for a rs485 chip* still wide used for industrial stuff
[00:12:04] chouhoulis: has joined #ruby
[00:12:43] meshsmith: has joined #ruby
[00:12:55] nofxxx: SeepingN, but also curious about file transfering over it...
[00:13:11] nofxxx: Verity, <SeepingN> what are you interfacing with?
[00:14:03] rakm: has joined #ruby
[00:14:18] Verity: sorry for delay
[00:14:36] charliesome: has joined #ruby
[00:14:40] Verity: I think I screwed up, also
[00:14:45] Verity: because this week we are going to switch it to use TCP
[00:14:52] Verity: and I think I didnt break my functions down quite small enough
[00:15:00] Verity: so I'll have a bunch of stuff to go in and change instead of a few short funcs
[00:15:57] nofxxx: Verity, yup, was going to tell you there's some way I don't remember you can kinda emulate an interface, and the kernel does it for you
[00:16:20] nofxxx: like ifconfig up/down and all... but instead of eth0 is like tty0 heh
[00:17:16] gigetoo: has joined #ruby
[00:17:22] Verity: https://gist.github.com/anonymous/37fc539a2f833c04356c6e81e854f4a2
[00:17:26] Verity: I think its due tomorrow
[00:18:04] Verity: but if anyone has a moment to take a look and see if I made an glaring errors or big mistakes
[00:18:18] Verity: (it fully works, aside from any unknown bugs)
[00:18:35] Verity: but I'd like to improve my ruby code quality as I picked this project to learn the language
[00:18:54] nofxxx: Verity, rubocop it, nice to find lil improves
[00:19:20] Disavowed: Verity: Not a mistake, but I know that attr_accessor has unlimited arity, so I don't think you need to call it for each attribute. That might be rubbish though - I'm not exactly seasoned at Ruby
[00:19:52] Rodya_: has joined #ruby
[00:19:54] Verity: rubocop has some problems with it, mostly methods too long and some other stuff I didn't understand. I used it to help fix a lot of stuff though and meet standard preferred form
[00:20:03] nofxxx: Disavowed, +1 that...
[00:21:02] Verity: that could be one attr_accessor
[00:21:09] Verity: with a comma separated list of properties
[00:21:41] Pumukel: has joined #ruby
[00:22:02] Disavowed: Verity: That's the way.
[00:22:08] agent_white: has joined #ruby
[00:22:37] havenwood: Verity: Consider `%w[-s -r]` on line 7.
[00:23:05] havenwood: Verity: Do any of these not need a setter as well as a getter? If so, change to: attr_reader
[00:23:08] havenwood: Verity: https://gist.github.com/anonymous/37fc539a2f833c04356c6e81e854f4a2#file-packet-rb-L10-L37
[00:23:35] Verity: I'll have to go through and check, but absolutely some only need a getter, yes
[00:23:37] nofxxx: Verity, just a suggestion too: the commands == 's' and 'r' blocks, could be inside the class, so no need for p1. p1. p1. on each line, just: SerialPort.new(com_port).send! or ... (com_port).receive!
[00:23:51] havenwood: Verity: Why `0xff.chr` instead of `255.chr` when the rest are ints?
[00:24:16] Verity: I think its a relic from when I was confused, I'l fix that
[00:24:32] havenwood: Verity: Consider interpolating all at once instead of shoveling on multiple times: https://gist.github.com/anonymous/37fc539a2f833c04356c6e81e854f4a2#file-packet-rb-L69-L73
[00:24:32] skweek: has joined #ruby
[00:25:04] enterprisey: has joined #ruby
[00:25:12] havenwood: Verity: It's better to `!File.exist?(filename)` instead of refuting true: https://gist.github.com/anonymous/37fc539a2f833c04356c6e81e854f4a2#file-packet-rb-L77
[00:25:39] shinnya: has joined #ruby
[00:26:00] Verity: ah ok, didn't realize that would work here too
[00:26:05] havenwood: Verity: Just `exit` produces a success exit signal of 0. Consider using `abort` instead for an exit signal of 1.
[00:26:07] elomatreb: unless is even more ruby-ish probably
[00:26:18] Verity: is this what you mean about the shoveling line, "packet = soh + payload + gen_crc8(packet.bytes).chr"
[00:26:48] havenwood: Verity: Also, `puts` prints to STDOUT not STDERR. You can `warn`, but better yet use `abort('Error. Bad filename.')` to both warn and exit(1).
[00:26:48] Verity: ah wait that would be a problem, I'll think it over
[00:26:51] chouhoulis: has joined #ruby
[00:27:21] havenwood: Verity: It's nice to use File.open with a block so it's self-closing. If you don't use a block it's up to you to ensure it closes.
[00:28:02] Verity: I think I forget to close it
[00:28:03] Verity: if thats the case
[00:28:20] havenwood: Verity: On these lines like `if finished == true` change it to just `if finished`.
[00:28:42] havenwood: Verity: Just `finished` is already truthy or falsey.
[00:29:07] Verity: and so if !finished would work too?
[00:29:18] Verity: for the lines that need the reverse
[00:29:32] havenwood: Verity: Except say `unless finished`
[00:29:45] havenwood: Verity: but yes, `!finished` is not finished
[00:30:13] havenwood: Instead of `ARGV.count < 3 || ARGV.count > 3` just do `ARGV.count == 3`
[00:30:38] havenwood: Verity: This is a good place for a case statement: https://gist.github.com/anonymous/37fc539a2f833c04356c6e81e854f4a2#file-packet-rb-L360-L376
[00:31:06] allisio: havenwood: You're a saint, y'know.
[00:31:22] havenwood: Verity: case command; when '-s'; ...; when '-r'; ...; end
[00:31:51] Verity: that will be cleaner, I had forgotten///not learned ruby had a switch type statement
[00:32:07] Verity: thanks for all of these tips, I'm going to make the improvements
[00:34:57] naprimer: has joined #ruby
[00:36:30] hahuang65: has joined #ruby
[00:38:20] hutch34_: has joined #ruby
[00:38:49] gnufied: has joined #ruby
[00:40:25] LuckyABA: has joined #ruby
[00:44:04] allisio: Ruby's `case` is way better than $LANG's `switch`.
[00:45:21] charliesome: has joined #ruby
[00:46:34] allisio: It uses the case equality (`===`) operator (which is really the #=== method) to do the comparison, so you get a lot of nifty functionality for free.
[00:48:29] patarr: has joined #ruby
[00:48:53] Channel6: has joined #ruby
[00:48:59] ahrs: has joined #ruby
[00:49:38] Pumukel: has joined #ruby
[00:50:10] raspado: has joined #ruby
[00:50:26] Pumukel: has joined #ruby
[00:51:14] Pumukel: has joined #ruby
[00:52:02] Pumukel: has joined #ruby
[00:52:39] allisio: StoneCypher: https://eval.in/767965
[00:53:12] Pumukel: has joined #ruby
[00:53:41] elomatreb: It also can do Regex matching on strings, and instance checks if you use a class
[00:56:55] astrobunny: has joined #ruby
[01:00:24] truenito: has joined #ruby
[01:01:42] gigetoo: has joined #ruby
[01:03:47] esObe_: has joined #ruby
[01:04:37] bkxd: has joined #ruby
[01:04:51] gdonald: has joined #ruby
[01:05:06] Rodya_: has joined #ruby
[01:06:23] Komic: has joined #ruby
[01:06:39] Komic: I'm losing my mind over what's probably a really retarded problem
[01:07:26] elomatreb: Don't use "retarted" like that please, but do ask
[01:07:44] Komic: trying to run rbenv install 2.3.1 (trying a mastodon instance, blah), but the openssl extension doesn't compile
[01:08:01] Komic: I did check I had libssl-dev installed
[01:08:36] Komic: also tried specifying /usr/bin as openssl's path
[01:09:14] Komic: (running debian sid, everything's up to date)
[01:09:59] elomatreb: I'm not good with dependency foo, but what's the specific error you're getting?
[01:11:00] Komic: i get 2500 lines of seemingly okay compilation input in the log
[01:11:11] Komic: then just The Ruby openssl extension was not compiled.
[01:11:11] Komic: ERROR: Ruby install aborted due to missing extensions
[01:11:11] Komic: Try running `apt-get install -y libssl-dev` to fetch missing dependencies.
[01:11:21] patarr: has joined #ruby
[01:11:27] enterprisey: has joined #ruby
[01:13:28] PorcoRex: has joined #ruby
[01:15:22] nofxx: has joined #ruby
[01:15:51] PorcoRex: Good evening from Argentina #ruby. It's nice to see such a popular channel about Ruby.
[01:16:24] znz_jp: has joined #ruby
[01:18:36] shterrett: has joined #ruby
[01:19:09] cam27: has joined #ruby
[01:19:40] patarr: has joined #ruby
[01:19:44] PorcoRex: I have a question about concurrency in Ruby, not specifically on the MRI implementation of the language. I want to make my gem thread safe using a readers-writer lock.
[01:20:15] Guest96: has joined #ruby
[01:23:01] PorcoRex: I'm aware the Sync class in the standard library that provides this kind of functionality, but I have seen the Mutex being used much more often, even when a shared/exclusive lock would be a better choice (i.e. Singleton).
[01:24:02] PorcoRex: I was just wondering if anyone has some concerns or commentary on the Sync class and if it would be safe to use considering different language implementations.
[01:27:45] chouhoul_: has joined #ruby
[01:29:00] Komic: dang okay
[01:29:03] Komic: i fixed it
[01:29:16] Komic: turns out it was just confused because it expected another version of openssl
[01:29:27] patarr: has joined #ruby
[01:29:39] Komic: apt install libssl1.0-dev to replace libssl-dev fixed it
[01:29:56] Komic: i'll reinstall libssl-dev later~
[01:30:00] Komic: sorry for the bother
[01:30:11] Komic: the error message is a bit weird, tho
[01:33:47] allisio: PorcoRex: Sync appears to be almost completely undocumented.
[01:34:05] allisio: Does Mutex and its #synchronize method not serve your purpose?
[01:35:35] PorcoRex: Well, it is almost completely undocumented in the docs, but there are just the examples I needed on the Pickaxe. I believe (though I might be wrong) that Mutex does not allow to open shared/exclusive locks. So for instance:
[01:36:03] Komic: (cheers~)
[01:36:05] Komic: has left #ruby: ()
[01:36:14] PorcoRex: sync.synchronize(:SH) { # Shared (read) block. }
[01:36:35] PorcoRex: sync.synchronize(:EX) { # Exclusive (write) block. }
[01:36:43] PorcoRex: Where sync is Sync.new.
[01:38:55] allisio: I mean, that looks to be exactly what you want? Which Ruby engines are you targeting?
[01:39:34] PorcoRex: As many as possible, since I'm working on a gem.
[01:40:12] shterrett: has joined #ruby
[01:40:14] PorcoRex: I just wonder about Sync just because there is, as you point out, so little documentation on this.
[01:42:33] knight33: has joined #ruby
[01:44:22] Sammichmaker: has joined #ruby
[01:53:54] duderonomy: has joined #ruby
[01:54:47] d^sh: has joined #ruby
[01:57:23] pwnd_nsfw`: has joined #ruby
[02:00:22] chouhoulis: has joined #ruby
[02:01:35] chouhoulis: has joined #ruby
[02:02:12] Jameser: has joined #ruby
[02:03:04] jeffreylevesque: has joined #ruby
[02:03:14] jeffreylevesque: is `require 'json'; $temp.to_json` valid, if i need it all in one line?
[02:04:25] jeyraof^mbpr: has joined #ruby
[02:05:21] esObe_: has joined #ruby
[02:05:27] libastral: has joined #ruby
[02:05:34] PorcoRex: jeffreylevesque, yes.
[02:05:55] jeffreylevesque: will that convert `{sudoers => {path => /etc/sudoers, access_all => [trusted_linux_admin, dev_linux_admin]}}` into json
[02:06:05] jeffreylevesque: is there an online ruby interpreter for me to test
[02:06:13] jcao219: has joined #ruby
[02:06:17] jeffreylevesque: i'm writing some stuff to complement my puppet script
[02:06:42] hutch34_: has joined #ruby
[02:06:47] jeffreylevesque: has left #ruby: ()
[02:06:55] jeffreylevesque: has joined #ruby
[02:07:00] jeffreylevesque: sorry got disconnected
[02:07:37] PorcoRex: "/etc/sudoers" won't be interpreted correctly. Also I assume everything else is a variable.
[02:12:42] minimalism: has joined #ruby
[02:15:21] naprimer: has joined #ruby
[02:17:46] MasterAsia: has joined #ruby
[02:17:50] jeffreylevesque: i have: {key1 => val1, subkey1 => key2 'val2'}
[02:18:01] MasterAsia: I want a unique string for each file so I can do deduplication
[02:18:07] MasterAsia: That would be calculating a hash for each file right?
[02:18:30] jeffreylevesque: when i do ` require "json"; $temp = {key1 => val1, subkey1 => key2 'val2'}; $temp.to_json`
[02:19:25] jeffreylevesque: ah, there's a typo in the hash
[02:19:58] allisio: masterasia: What sort of files?
[02:20:15] PorcoRex: masterasia, how about `__FILE__`?
[02:20:23] MasterAsia: allisio, images/pdfs
[02:20:24] genpaku: has joined #ruby
[02:20:32] MasterAsia: I was thinking of using Digest::MD5.digest
[02:20:38] jeffreylevesque: even with the typo fixed: ` require "json"; $temp = {key1 => val1, subkey1 => key2 => 'val2'}; $temp.to_json`, i still get "null"
[02:20:44] MasterAsia: PorcoRex, I don't think that is correct
[02:20:45] allisio: masterasia: Consider looking into perceptual hashing: http://www.phash.org/
[02:20:49] MasterAsia: isn't __FILE__ a reference to the current file
[02:20:58] allisio: Yeah, that had nothing to do with your question. :P
[02:21:00] PorcoRex: masterasia, that's how I interpreted it.
[02:22:40] PorcoRex: masterasia, would that be based on the contents of the file?
[02:23:31] MasterAsia: Well I really just want to know if a pdf/image has been uploaded before
[02:23:34] MasterAsia: this is an internal tool
[02:23:39] MasterAsia: for a company
[02:23:46] MasterAsia: if an image has been uploaded before - I can link them
[02:23:51] allisio: Sure, something from the SHA family should do just fine.
[02:24:00] MasterAsia: Would there be collisions?
[02:24:12] allisio: You know enough to ask the question.
[02:24:23] allisio: That's exactly as much as you need to find your way to the answer.
[02:24:33] mazeinmaze_: has joined #ruby
[02:24:45] bruce_lee: has joined #ruby
[02:24:53] MasterAsia: I actually know very little. You named SHA family - what's wrong with md5 for this?
[02:24:59] PorcoRex: masterasia, but I mean, do you need to check the filename or do you need to check the actual contents of the file?
[02:25:09] MasterAsia: PorcoRex, actual contents would be preferable
[02:25:25] MasterAsia: as people can rename files
[02:26:04] al2o3-cr: masterasia: Digest::SHA256.file("image.foo").to_s should do
[02:26:23] jeffreylevesque: is "{key1 => val1, subkey1 => {key2 => val2}}" a valid hash in ruby?
[02:26:47] MasterAsia: yes jeffreylevesque
[02:27:03] MasterAsia: you can nest hashes
[02:27:05] PorcoRex: al2o3-cr, nice.
[02:27:38] jeffreylevesque: shouldn't `require "json"; $temp = {key1 => val1, subkey1 => key2 => 'val2'}; $temp.to_json`, return a json string?
[02:27:57] al2o3-cr: jeffreylevesque: should do
[02:28:16] MasterAsia: you might need to be explicit about that internal hash
[02:28:40] MasterAsia: al2o3-cr, thanks I'll look into it.
[02:28:49] MasterAsia: Weirdly enough - I don't see any documentation for that method
[02:29:00] PorcoRex: You need {} on the last key/value.
[02:29:17] al2o3-cr: &ri Digest::SHA256.file
[02:29:17] `derpy: No results
[02:30:08] MasterAsia: https://ruby-doc.org/stdlib-2.1.0/libdoc/digest/rdoc/Digest.html
[02:31:29] jeffreylevesque: ah, yes it worked
[02:31:37] jeffreylevesque: i wasn't interpolating correctly in puppet
[02:32:23] jeffreylevesque: $adjusted = inline_template('<%= require "json"; @temp.to_json %>')
[02:32:28] jeffreylevesque: that's why i kept getting null
[02:35:27] PorcoRex: `temp` was a global var a minute ago, now it's an instance var? What's going on here? :)
[02:36:38] jeffreylevesque: genius is going on here
[02:36:52] unreal_: has joined #ruby
[02:37:18] PorcoRex: As long as you're enjoying yourself. :)
[02:37:28] hahuang65: has joined #ruby
[02:37:43] jeffreylevesque: it's what i do best
[02:39:52] MasterAsia: If I change just the filename - does the hash change?
[02:40:56] allisio: Depends on the filesystem, technically, but all the modern ones store metadata elsewhere.
[02:41:06] jeffreylevesque: if you have a windows system you can test it out
[02:41:11] jeffreylevesque: right click and hash it
[02:41:48] jeffreylevesque: you can generate the checksum md5, etc.
[02:42:09] jeffreylevesque: prob same with osx, etc, though you may need to install the corresponding package
[02:43:19] jeffreylevesque: masterasia: that's how i generated the https://atlas.hashicorp.com/jeff1evesque/boxes/trusty64 checksum
[02:43:34] PorcoRex: I believe the SHA# should be generated only be based on the file contents, but I might be off.
[02:45:36] hahuang65: has joined #ruby
[02:49:10] pwnd_nsfw: has joined #ruby
[02:50:41] KevinCOM: has joined #ruby
[02:53:29] tolerablyjake: has joined #ruby
[02:55:20] c_nick: has joined #ruby
[02:56:08] hndk: has joined #ruby
[02:57:04] c_nick: hi ..Addition of two arrays into a third.. is the '+' operator the right way to do it ? or should i loop the contents and use '<<' operator ?
[02:58:48] PorcoRex: c_nick, "+" is concatenation, and should work fine unless there is a reason for you not to add a particular element into the array (for example you don't want repeated elements or etc.).
[02:59:31] PorcoRex: c_nick, also "<<" will append items in place, which might or might not be what you want to do.
[03:00:53] c_nick: PorcoRex, indeed, was planning to loop in the array and then add the individual element in the new array
[03:01:19] c_nick: conatenation is not a costly operation right as compared to <<?
[03:01:45] c_nick: concatenation* (appologies for the typo, getting used to the new laptop keyboard)
[03:02:50] PorcoRex: Just give us a brief example and maybe we can figure out the best way to implement it.
[03:05:19] bkxd: has joined #ruby
[03:06:10] c_nick: PorcoRex, simple addition .. [1,2] [3,4] no issues of duplicated.. i can use concat to save on the extra variable (being too miser?)
[03:06:27] allisio: You said you had three arrays.
[03:06:39] allisio: If that's still the case, you want either #concat or `reduce(:+)`.
[03:06:45] c_nick: allisio, the third array is an addition of first two ..
[03:06:46] esObe_: has joined #ruby
[03:06:51] im314ous: has joined #ruby
[03:06:57] raspado: has joined #ruby
[03:07:07] allisio: c_nick: Ah, forgive me seeing the subtle ambiguity.
[03:07:14] baweaver: [*a, *b, *c] or [a,b,c].flatten
[03:07:42] c_nick: baweaver, i have a performance fetiesh
[03:07:52] PorcoRex: If I understand correctly then `new_array = [1, 2] + [3, 4]` is probably what you want.
[03:07:59] baweaver: we accept all types here
[03:08:01] c_nick: PorcoRex, bingo
[03:08:10] allisio: Well, that was easy.
[03:08:11] baweaver: joking aside....
[03:08:17] allisio: I still like the splatterfest approach.
[03:08:19] baweaver: &ri Benchmark#measure
[03:08:19] `derpy: http://ruby-doc.org/stdlib-2.4.0/libdoc/benchmark/rdoc/Benchmark.html#method-i-measure
[03:08:25] baweaver: use that to play with it
[03:08:39] allisio: Better than -ips in 2.4?
[03:08:57] baweaver: I rarely bother to use it honestly
[03:09:05] PorcoRex: c_nick, consider that the "+" method is native, i.e. C code, so it should be better than iterating the arrays yourself in Ruby.
[03:09:31] c_nick: ok thanks everyone :)
[03:10:33] jenrzzz: has joined #ruby
[03:10:33] jenrzzz: has joined #ruby
[03:14:46] al2o3-cr: [*a, *b] is the faster of those three
[03:15:40] PorcoRex: al2o3-cr, ¿even the "+" concatenation?
[03:15:55] PorcoRex: al2o3-cr, very interesting.
[03:16:07] al2o3-cr: concat is faster than +
[03:16:50] al2o3-cr: on ruby 2.4 anyway
[03:19:04] PorcoRex: al2o3-cr, seems counterintuitive considering that #concat can concatenate multiple arrays and "+" can only concatenate a pair of them.
[03:19:38] al2o3-cr: PorcoRex: only true as of 2.4
[03:20:14] erlend: has joined #ruby
[03:20:16] PorcoRex: Don't misunderstand me, I'm just saying it's a bit weird.
[03:21:07] al2o3-cr: how do you mean "+" can only concatenate a pair?
[03:21:16] allisio: A pair of arrays.
[03:21:23] allisio: You can't say `a.+(b, c)`.
[03:21:50] baweaver: ACTION actually thought about how to monkeypatch that
[03:22:20] Channel6: has joined #ruby
[03:22:42] johnzorn: has joined #ruby
[03:25:09] gigetoo: has joined #ruby
[03:25:13] allisio: You would.
[03:27:01] dar123: has joined #ruby
[03:36:42] HippoDippo: has joined #ruby
[03:37:12] hutch34_: has joined #ruby
[03:37:30] HippoDippo: In general, what are the main reasons why someone would use recursion?
[03:37:37] ElSif: has joined #ruby
[03:38:19] PorcoRex: That sounds like a homework/test question.
[03:39:25] Mia: has joined #ruby
[03:40:16] jaequery: has joined #ruby
[03:41:02] allisio: HippoDippo: We would appreciate your candor.
[03:41:13] Sweetlie: has joined #ruby
[03:43:03] HippoDippo: allisio: I suppose i am just wondering what is recursion used for other than, looping through a method with a modified parameter. I'll find the answer somewhere but was just seeing if i could get a quick answer.
[03:44:02] allisio: HippoDippo: Recursion essentially gives you an implicit stack, and stacks are mighty useful.
[03:44:39] allisio: Iteration and recursion can be shown to be completely equivalent; it's just that one or the other is usually more convenient (read: well-suited) to a particular problem.
[03:44:57] PorcoRex: HippoDippo, it's a bit more than that. For instance you'll want to have a condition in your method that returns something. Say you have a circle with more circles inside, and you want to count all circles.
[03:46:10] PorcoRex: Then you could go to the big circle and count all circles that are immediately inside it, and then you would call the function recursively on each of the inner circles. Once a circle does not have inner circles you would return 1 (to count oneself).
[03:46:15] PorcoRex: Boom, it's magic.
[03:47:12] PorcoRex: You add all the ones and return the additions, and you go adding them as you're going out of the recursion. Then you have the total ammount of circles.
[03:47:22] PorcoRex: Also works with triangles.
[03:48:16] HippoDippo: what about hexagons?
[03:48:36] PorcoRex: I haven't tried, but probably works. ;)
[03:48:49] HippoDippo: Like you said, MAGIC ;)
[03:59:09] PorcoRex: Talking about recursion in Ruby, do you think it would be a good or bad idea for a "functional" approach to Ruby? I mean for example tail call optimization or at least a good trampolining option for using recursion for looping?
[03:59:21] jenrzzz: has joined #ruby
[04:00:54] baweaver: ruby has TCO as a compile flag
[04:01:00] baweaver: but I wouldn't call that true support
[04:01:43] PorcoRex: baweaver, that's neat, I wasn't aware of it!
[04:01:53] baweaver: Ruby can go functional-lite, but you can only get so far on it without straight lambda-calculus style programming with lambdas
[04:01:54] xall: has joined #ruby
[04:01:58] PorcoRex: I know a guy that'll love it.
[04:02:49] baweaver: Scala is probably a better language for it on the hybrid end
[04:02:50] PorcoRex: I'm not really functional-oriented myself, in fact I'm a layman. What is the flag just out of curiosity?
[04:03:14] PorcoRex: I'll let him know on his birthday or something.
[04:03:19] baweaver: http://nithinbekal.com/posts/ruby-tco/
[04:03:57] PorcoRex: Bookmarked, thanks a bunch!
[04:04:30] baweaver: if you want to go full on functional you'll end up deep into a magical land called category theory
[04:04:47] AnoHito_: has joined #ruby
[04:04:57] baweaver: Read 'The Haskell Book' or 'Learn you a Haskell' if you're inclined to take that jump
[04:04:58] mitt3ns: has joined #ruby
[04:05:09] baweaver: that's effectively the deep end
[04:05:18] jcao219: has joined #ruby
[04:05:46] baweaver: Scala (JVM), Kotlin(JVM), F#(.NET), and others are more hybrid in their approaches and can be more welcoming.
[04:05:46] AnoHito_: has joined #ruby
[04:06:03] baweaver: Clojure in the case that you want to stay dynamic
[04:06:11] bkxd: has joined #ruby
[04:06:23] PorcoRex: baweaver, I've started reading some Haskell because, if I must learn functional programming, I don't want the JavaScript functional approach. I want the real thing, you know? But it's good to have a reference to start.
[04:06:47] AnoHito_: has joined #ruby
[04:06:48] baweaver: For all the hate, JS actually has more potential to be functional than Ruby
[04:07:19] MrBismuth: has joined #ruby
[04:07:27] PorcoRex: baweaver, oh, definitely, but if I learn a completely new paradigm I'm more prone on making mistakes on JS than on Haskell.
[04:08:17] esObe_: has joined #ruby
[04:08:32] baweaver: Scala will feel very familiar as well
[04:09:00] StoneCypher: has joined #ruby
[04:09:06] PorcoRex: baweaver, I prefer the hard road, just to assimilate the paradigm. Once I'm confortable I think I can make the choice of a hybrid lang.
[04:09:42] PorcoRex: In any case, which one would you recommend on a complete noob of functional programming, the Haskell book or the other one?
[04:09:45] baweaver: note I mentioned two Haskell books
[04:09:55] baweaver: The Haskell Book is paid
[04:10:17] baweaver: but also written by BiteMyApp (Chris Evans) who's one of the best IRC helpers around for the language
[04:10:21] baweaver: so if anyone knows it....
[04:10:25] PorcoRex: If it's worth it, then it's a great gift after I finish reading it.
[04:10:44] baweaver: It's definitely a tome, fair warning
[04:11:37] PorcoRex: So I guess that's the recommended one. :) Thanks!
[04:15:14] ruby[bot]: -b *!*@gateway/web/freenode/ip.50.140.195.159$#ruby-banned
[04:15:31] PorcoRex: baweaver, and if I might pick your brain one last time tonight, in your biased opinion, is a declarative or an imperative approach better, considering an app that will need to be maintained in the long term?
[04:15:53] mim1k: has joined #ruby
[04:15:58] PorcoRex: And also performance, if you want to take it into account.
[04:16:02] baweaver: depends heavily on what the app is in my opinion
[04:16:16] baweaver: and by which metric you want to measure performance
[04:16:36] baweaver: it's silly to use a chainsaw on a Bonsai tree, but also foolish to use a hand axe on a redwood
[04:17:08] baweaver: right tool for the job and such
[04:17:18] PorcoRex: baweaver, that's fair, but consider I'm completely unaware of the declarative programming paradigm.
[04:17:25] baweaver: Erlang/Elixir are great for highly concurrent systems but can be terrible at string manipulation
[04:17:35] baweaver: Haskell gets a ton of use in the financial sectors
[04:18:02] allisio: Is it "a ton" these days?
[04:18:05] baweaver: there's really not a good answer
[04:18:43] StoneCypher: erlang is fine for string manipulation.
[04:18:45] PorcoRex: baweaver, then a better question would probably be, if there was only the choice, would you use declarative or imperative?
[04:19:03] baweaver: which tree am I trying to cut down?
[04:19:09] StoneCypher: that reputation comes from people who don't know the language suffering performance consequences that chapter 2 of the manual would have warned them away from, such as binary caching
[04:19:42] StoneCypher: PorcoRex: there are almost no real world declarative languages
[04:20:04] StoneCypher: PorcoRex: unless you're talking about css, the chances that a declarative language is available to you is small enough that i have serious doubts about the question
[04:20:19] StoneCypher: PorcoRex: in the meantime, the language is far more important than under what paradigm it is described
[04:20:30] StoneCypher: PorcoRex: with respect i would proffer that you should consider another approach
[04:20:33] pulkit4tech: has joined #ruby
[04:21:50] PorcoRex: StoneCypher, another approach in what sense? I'm just considering approaching a different paradigm and I want to assess how far of my confort zone that will get me.
[04:22:09] StoneCypher: PorcoRex: another approach in the sense that looking by paradigm is like looking for the best car by paint color.
[04:22:28] baweaver: Prolog is a declarative language, but you'd be hard pressed to make it do general work.
[04:22:29] StoneCypher: PorcoRex: instead consider looking for a language by the set of tools it offers for your current situation
[04:22:48] baweaver: mainly it ends up on rule engines and logic chains
[04:22:54] djbkd: has joined #ruby
[04:23:04] StoneCypher: baweaver: it's actually not. the rules are modifiable and it's implemented with horn clauses
[04:23:17] StoneCypher: it's close enough that people say that
[04:23:21] StoneCypher: but, technicality land, etc
[04:23:48] PorcoRex: StoneCypher, I don't think that's entirely correct. For instance I can live confortably generating random numbers by calling a method in Ruby, but hard pressed to think about such a thing in a functional language such as Haskell.
[04:23:59] StoneCypher: PorcoRex: well, ... i'm not sure why
[04:24:07] StoneCypher: PorcoRex: probably that's because you don't speak haskell
[04:24:29] StoneCypher: PorcoRex: but not because of its paradigm, really. like, you can do the same thing procedurally, imperatively, or functionally easily in ruby (and probably also javascript)
[04:24:49] PorcoRex: baweaver, is it straightforwards to generate random numbers in Haskell?
[04:25:01] baweaver: I'd have a heck of a time describing something in spanish or german, but can do just fine in english
[04:25:24] StoneCypher: baweaver: that's a good way to explain that. i'm stealing it
[04:25:34] Pumukel: has joined #ruby
[04:25:35] baweaver: Mein deutsch ist schrecklich
[04:25:39] aglorei: has joined #ruby
[04:25:45] StoneCypher: mein deutsch ist nicht so gut
[04:25:59] PorcoRex: Pero yo no hablo el Alemán.
[04:26:03] StoneCypher: it's good enough for me to say "kartoffelsalat" in entirely inappropriate places, on purpose
[04:26:12] allisio: Gesundheit.
[04:26:19] StoneCypher: allisio: no, it's mayonnaise
[04:26:41] allisio: To your health, all the same.
[04:27:10] agent_white: I like butter on my sandwiches instead.
[04:27:13] PorcoRex: StoneCypher, I think you're right. I might as well delve into it and see how everything clicks.
[04:27:14] agent_white: Mayo is ok too though.
[04:27:35] baweaver: Remember you have years in C style languages
[04:27:42] baweaver: not so much in Haskell land
[04:27:45] StoneCypher: PorcoRex: haskell is too large and difficult to be a useful platform for learning paradigms. if you want to learn it, great; it's a wonderful language. but if your goal is to learn functional programming, it's as bad a choice as learning c++ to pick up datastructures.
[04:28:03] baweaver: ACTION coughs
[04:28:06] agent_white: I dunno about that.
[04:28:11] baweaver: ACTION tries to forget college
[04:28:21] agent_white: I think it's entirely useful.
[04:28:29] StoneCypher: ACTION didn't say anything about utility.
[04:28:51] agent_white: We are a carrier (CLEC) and our infrastructure is heavily based in Haskell.
[04:28:53] StoneCypher: actually i did. sorry and withdrawn
[04:28:58] StoneCypher: agent_white: okay?
[04:29:08] StoneCypher: agent_white: note that what i said was "useful for learning paradigms"
[04:29:20] agent_white: StoneCypher: To discount Haskell, or any language, is sillyness. Don't be a silly nilly.
[04:29:21] PorcoRex: StoneCypher, fair enough. Do you say that because C already had data structures or because I'm learning Haskell when a good and minimal subset of functional programming can be had somewhere else?
[04:29:23] StoneCypher: agent_white: c++ is a wonderful tool for a lot of things too. just not for learning the basics of datastructures.
[04:29:28] StoneCypher: agent_white: i didn't discount haskell
[04:29:46] StoneCypher: agent_white: in fact i said "if you want to learn it, great; it's a wonderful language"
[04:30:13] agent_white: Most colleges teach those data structures in C or Java. So don't be surprised when folks come from there.
[04:30:19] StoneCypher: PorcoRex: c doesn't have datastructures :D structs aren't datastructures. but yes, i meant that in contrast to c, where implementing them tends to be easier.
[04:30:42] agent_white: Haskell will be nothing like C.
[04:30:45] agent_white: Just know that.
[04:30:54] PorcoRex: agent_white, probably not. :)
[04:31:04] agent_white: The paradigm shift is fairly drastic.
[04:31:24] PorcoRex: I'll just do Haskell. Null nil void alternatives seem a bit redundant to me.
[04:31:31] jdm_: has joined #ruby
[04:31:47] StoneCypher: PorcoRex: if your goal is to learn haskell, then do
[04:31:51] baweaver: I find it all Optional
[04:32:00] StoneCypher: baweaver: ... ouch
[04:32:11] renchan: has joined #ruby
[04:32:16] baweaver: welcome to #ruby, where a good pun is its own reword
[04:32:42] PorcoRex: StoneCypher, thanks! :)
[04:33:19] Verity: I learned data structures in C++
[04:34:14] AnoHito: has joined #ruby
[04:35:45] PorcoRex: Verity, I need to read about them. I thought they were the "struct" ones up until this point.
[04:36:46] agent_white: Someone shoulda asked HippoDippo what the function of a slope is to explain one reason why a function would be recursive.
[04:37:16] StoneCypher: Verity: ... ouch
[04:38:17] AnoHito: has joined #ruby
[04:38:20] hutch34_: has joined #ruby
[04:38:22] PorcoRex: agent_white, I think he just wanted to understand why does recursion might even be useful at any point in time.
[04:38:50] agent_white: Or factorials I guess. Maybe say "if you're doing finance here is your compound interest function stuffs"
[04:38:57] agent_white: Yeah I know :)
[04:39:09] agent_white: Or stocks or something.
[04:39:20] PorcoRex: agent_white, and Hanoi.
[04:39:41] Verity: nrf.rf_setup(:rate_250kbps, :max_power
[04:39:46] agent_white: PorcoRex: Well that problem largely depends on the colour of the stacks. If I don't like the colours they won't stack.
[04:39:59] Verity: obj.method(:arg=12, :arg2=42)
[04:40:01] Verity: what is this?
[04:40:19] StoneCypher: PorcoRex: all a struct does is say "these fields exist and have this name and type" (and in some versions of the language, maybe specify packing)
[04:40:43] StoneCypher: PorcoRex: a proper datastructure is something like List or Map (that is, not an implementation of them, but the general idea)
[04:40:44] PorcoRex: agent_white, the most amazing thing about the Hanoi Towers is, if I'm not mistaken, was a game people used to play, with wooden pieces and everything.
[04:40:53] StoneCypher: PorcoRex: generally defined in terms of what things it has to do, at what performance
[04:41:11] StoneCypher: but rather in terms of how it's actually implemented
[04:41:24] StoneCypher: that is, it's only a list if it's node and (pointer-or-reference-or-whatever) based
[04:41:53] StoneCypher: so if you have some wacky alternate setup that offers the same api, it's not actually the same datastructure (at that point, you're talking about containers instead)
[04:42:09] StoneCypher: which is why people get confused how maps aren't always trees (because sometimes they're hashes)
[04:42:30] PorcoRex: StoneCypher, http://www.cplusplus.com/doc/tutorial/structures/
[04:42:59] StoneCypher: you should go into efnet #c++ and say "which is worse: cplusplus.com or w3schools.com?"
[04:43:05] JoshS: has joined #ruby
[04:43:07] StoneCypher: it will start a hilarious rage war
[04:44:03] PorcoRex: StoneCypher, dude, you're right. I just got confused because I read bad bibliography in the past. Take it easy.
[04:44:12] StoneCypher: this is actually part of the c++ standard, by the way. although they call them ADTs instead of datatypes because "abstract"
[04:44:20] StoneCypher: take it easy?
[04:44:31] StoneCypher: because ... i think the rage wars in another channel/network are funny? :D
[04:46:00] StoneCypher: Verity: i don't really speak ruby, but those look like named arguments to me
[04:46:02] PorcoRex: Look, I'm just came today to the friendly #Ruby channel. I don't intend to create any conflicts here. I'm sure many people are laughing at me for misunderstanding what a datastructure is. I can take it.
[04:46:12] StoneCypher: PorcoRex: i'm not sure what conflict you see, but i'll withdraw
[04:48:05] dminuoso: Since we're already in the business of making fun, what are we making fun of?
[04:51:52] PorcoRex: dminuoso, the Hanoi tower game. Did people in the past actually played it. And if so, how many pieces did they use?
[04:51:56] dminuoso: PorcoRex: Ive read about your discussion. If you apply your Haskell background to Ruby you will end up with painless and easy-to-test Ruby, but Rubyists will hate you for it.
[04:52:13] dminuoso: Mostly because half the people in here don't even know the meaning of a "pure function"
[04:52:45] dminuoso: PorcoRex: It depends. Some players haven't advanced beyond 2 pieces on 4 poles.
[04:52:48] dminuoso: It's pretty tough.
[04:52:53] PorcoRex: dminuoso, not all of them, as I was telling some dude that makes the language, some people like it. Maybe it's hype about functional programming? IDK.
[04:53:13] dminuoso: Functional programming is not hyped, it's simply better for so many reasons.
[04:53:23] dminuoso: But that's a fact that has been known for about 50 years or so.
[04:55:09] gigetoo: has joined #ruby
[04:55:18] PorcoRex: dminuoso, since I know pretty much nothing besides entry level I will not discuss that fact. BUT, when close to the metal, how does functional programming fare against the CPU's way of processing stuff? Does it translates fairly?
[04:56:17] dminuoso: PorcoRex: It depends on a few factors. On an immediate level it's pretty shitty because of how CPUs work internally.
[04:57:11] StoneCypher: pure function is easier to explain than to make fun of
[04:57:17] StoneCypher: kindness goes a long way sometimes
[04:57:29] PorcoRex: dminuoso, I see it a bit like raycasting and the way GPUs work. Light works much more like raycasting, but GPUs work on triangle things.
[04:57:29] __Yiota: has joined #ruby
[04:58:10] dminuoso: PorcoRex: It's a good comparison. FP is applied everywhere on GPUs. Shader cores are basically exactly that.
[04:58:12] PorcoRex: So functional programming may be better overall, but how does it fare against the chip that interprets it?
[04:58:23] dminuoso: Shader cores are just pure functional processing cores.
[04:58:44] dminuoso: And that shows the power of it, how you can ruthlessly parallelize a problem across (nowdays) thousands of stream processors.
[05:00:02] gigetoo: has joined #ruby
[05:00:22] dminuoso: PorcoRex: Though in the end it's a matter of principle. On a hardware level a general-purpose CPU is basically a huge imperative machine.
[05:00:48] dminuoso: The entire CPU design is so massively complicated because of it. Just look how bus arbitration and cache coherency protocols make designing effective CPUs really hard.
[05:01:25] StoneCypher: so what would a functional cpu, as opposed to an imperative cpu, look like?
[05:01:28] PorcoRex: dminuoso, well that's right, but your comment about the shader cores picked my interest. I need to delve into it as I learn a bit of FP.
[05:04:10] hahuang65: has joined #ruby
[05:06:58] patarr: has joined #ruby
[05:08:36] PorcoRex: dminuoso, I believe "piqued" is the actual word. Sorry about the confution, and thanks StoneCypher for correcting me via a private message.
[05:09:35] esObe_: has joined #ruby
[05:11:57] PorcoRex: *consufion <- I corrected this myself.
[05:12:26] astrobunny: has joined #ruby
[05:12:34] astrobunny: has joined #ruby
[05:14:21] Guest96: has joined #ruby
[05:14:25] agent_white: PorcoRex: We use some Haskell for mission-critical functions: Knowing that if you call a function with a set of arguments deterministically always leads to the same result can help a lot with debugging and reasoning about code.
[05:15:21] agent_white: Strongly typed to scope out errors at compile time rather than later should your code take an uncommon path and assumptions violated.
[05:15:49] agent_white: (which is where pure functions/isolated effects is nice)
[05:16:05] PorcoRex: agent_white, yes, I understand that and I think that's probably the greatest appeal (functions are like math. functions).
[05:17:20] PorcoRex: Don't get me wrong, I really like that, but I need to think a different way to code that way. I'm just used to state, and keep the state encapsulated, but able to touch it at a whim.
[05:17:50] luluapple: has joined #ruby
[05:17:54] PorcoRex: FP is a new and interesting way of thinking about solutions, and I'm just trying to get the right foot in.
[05:18:33] agent_white: Aye. Best to just have atter; then after using it you'll see cases where it could/should be applied.
[05:18:40] agent_white: Until then you won't know.
[05:20:28] agent_white: Personally I've been leaning towards Elixir because of Erlang; OTP is a thing of beauty :)
[05:21:02] agent_white: (of course, also cause it's scriptures are written with a Ruby-esque hand)
[05:22:50] PorcoRex: agent_white, I remember when I went from C++/Java to Ruby that first time. It was anathema. Constants can be modified? Classes can be reopened and tinkered with? After some time it all made sense. And really, Ruby is one of my favorite OOP languages nowadays.
[05:23:10] gdonald: has joined #ruby
[05:23:31] PorcoRex: It's also a great entry languagem, because procedural languages are not as widely used as before.
[05:24:42] Rodya_: has joined #ruby
[05:25:50] __Yiota: has joined #ruby
[05:30:32] whiteline: has joined #ruby
[05:32:36] PorcoRex: And that's an interesting discussion if anyone has some spare time for it, should entry level courses on CS be procedural (i.e. Pascal, C, etc.)? I think Ruby would be an easier to learn language and then leave Assembler, C, etc. as advanced machine-thinking languages.
[05:34:35] nofxxx: has joined #ruby
[05:38:30] moei: has joined #ruby
[05:38:53] xall: has joined #ruby
[05:39:17] hutch34_: has joined #ruby
[05:49:41] StoneCypher: PorcoRex: pascal and c are imperative, not procedural. there is no call graph. there is no global ordering. yes, pascal has things called procedures. yes, wikioverflow probably says that procedural is a kind of imperative. yes, sql really is the one getting it right this time.
[05:50:15] StoneCypher: PorcoRex: the distinction between a function and a procedure is atomic transactionality. yes, no programming language other than sql that i can think of gets that right
[05:50:35] StoneCypher: PorcoRex: the only time a procedure should be able to run during another procedure (WALs and etc notwithstanding) is when it's called by that procedure
[05:53:27] Bock: has joined #ruby
[05:56:24] igniting: has joined #ruby
[05:57:30] anisha: has joined #ruby
[06:02:12] houhoulis: has joined #ruby
[06:02:53] nadir: has joined #ruby
[06:06:48] bkxd: has joined #ruby
[06:07:21] dminuoso: PorcoRex: Ruby is only a small taste. You should try Smalltalk.
[06:07:45] dminuoso: Which is one of the major languages that Ruby was designed around.
[06:09:45] pwnd_nsfw: has joined #ruby
[06:11:44] volix: has joined #ruby
[06:11:44] volix: has joined #ruby
[06:14:16] StoneCypher: dminuoso: still kind of curious what a functional cpu would be
[06:14:31] StoneCypher: hoping you just didn't see me ask
[06:15:47] dhollinger: has joined #ruby
[06:17:09] harfangk: has joined #ruby
[06:23:51] octo8: has joined #ruby
[06:24:07] octo8: photoshop is now open source !
[06:24:39] octo8: StoneCypher: sorry, wrong channel.
[06:26:05] Rodya_: has joined #ruby
[06:28:15] Pumukel: has joined #ruby
[06:28:38] PorcoRex: dminuoso, I've heard of Smalltalk, one of the first OO languages (maybe the first?). I don't know much about it, but do you think it's a good entry language?
[06:29:17] last_staff: has joined #ruby
[06:29:52] PorcoRex: dminuoso, and also, do you think an OO language is a good entry language, as BASIC was in the 80's for instance?
[06:30:03] cfec0b8d: has joined #ruby
[06:30:14] naprimer: has joined #ruby
[06:34:40] gigetoo: has joined #ruby
[06:34:47] StoneCypher: PorcoRex: people argue about whether true oo is from algol/simula (older than smalltalk) or smalltalk
[06:35:07] StoneCypher: PorcoRex: what ken did was more important, but he wasn't the first to use that name, or the vague idea
[06:36:36] PorcoRex: StoneCypher, care to answer my question or are you only interested in planting seed of random factoids?
[06:36:48] StoneCypher: is smalltalk a good entry language?
[06:36:52] StoneCypher: not in my opinion, no
[06:37:12] StoneCypher: is an oo language in general a good entry language?
[06:37:19] StoneCypher: depends on which one you're asking about. some of them are, sure
[06:37:36] StoneCypher: javascript, ruby, and python, which are oo to varying degrees, all seem to me like reasonable starting places
[06:37:42] StoneCypher: also some languages that aren't oo do too
[06:37:51] StoneCypher: i don't think oo (on or off) is that important, personally. ymmv
[06:38:27] agent_white: I've been learning some Perl. Coming from a Ruby it's just as fun to play with :) The grammar is pretty neat.
[06:38:34] PorcoRex: StoneCypher, ok, but do you have a preference for a language that does not know how to program enter into the career?
[06:38:50] StoneCypher: i'd generally choose according to the project that motivates them. i know that's kind of a dodge answer
[06:38:53] PorcoRex: for a person*
[06:39:18] StoneCypher: like, the right language for a web thing is not the same as the right language for a phone game, you know?
[06:39:51] hutch34_: has joined #ruby
[06:39:52] StoneCypher: the answer i think i should probably give is i'd try to motivate them to choose a language which you can learn a small piece of and be able to do things, which is relatively easy to set up, and which is relatively easy to debug
[06:40:01] StoneCypher: and then frame it to whatever they're actually trying to accomplish
[06:40:38] StoneCypher: i find that i end up recommending javascript more often than most other languages.
[06:40:43] StoneCypher: but sometimes i recommend ruby
[06:41:09] PorcoRex: I'm not sure we're discussing the same thing. It's like trying to figure out the best way to teach math to a child and you telling me that it depends if they want to do a bank job or rocket science.
[06:41:37] govg: has joined #ruby
[06:42:54] gigetoo: has joined #ruby
[06:43:15] agent_white: StoneCypher: Best entry level? I dunno. Depends on the person and how they learn.
[06:43:31] agent_white: The neat thing is, most languages that would cover that question can be tried out for free.
[06:45:50] yourname1: has joined #ruby
[06:46:07] StoneCypher: i actually feel like one not-free language is actually pretty profoundly good for this, with a select small group of people, given active instruction
[06:46:11] StoneCypher: namely, mathematica
[06:46:19] StoneCypher: or the wolfram language or whatever marketey bs you want to call it
[06:46:28] agent_white: I have a buddy learning programming, just moving from methods onto the concept of classes... it can be a weird thing to grasp.
[06:46:59] StoneCypher: shapes usually make it easy. if not, roguelike monsters.
[06:47:02] StoneCypher: if not, have a doctor see them
[06:48:57] PorcoRex: Thank you all for a very interesting discussion, I'll be sure to drop by some other time. Good night!
[06:50:58] jusa: has joined #ruby
[06:51:11] conta: has joined #ruby
[06:51:33] antgel: has joined #ruby
[06:55:27] zun: has joined #ruby
[06:58:10] tAn: has joined #ruby
[07:01:14] v1n: has joined #ruby
[07:04:00] StoneCypher: has joined #ruby
[07:04:31] zipace: has joined #ruby
[07:05:17] hahuang65: has joined #ruby
[07:05:41] jcao219: has joined #ruby
[07:06:38] postmodern_: has joined #ruby
[07:07:32] uncertainty: has joined #ruby
[07:07:52] patarr: has joined #ruby
[07:08:15] lhambley: has joined #ruby
[07:08:34] ratcatcher: has joined #ruby
[07:09:35] Arpanet69: has joined #ruby
[07:10:58] esObe_: has joined #ruby
[07:14:45] astrobunny: has joined #ruby
[07:15:34] jgt: has joined #ruby
[07:16:56] govg: has joined #ruby
[07:18:30] Guest96_: has joined #ruby
[07:20:51] TomyWork: has joined #ruby
[07:22:51] aganov: has joined #ruby
[07:25:25] aufi: has joined #ruby
[07:27:03] esObe_: has joined #ruby
[07:28:00] Rodya_: has joined #ruby
[07:28:04] v1n: has joined #ruby
[07:28:33] pytuger: has joined #ruby
[07:30:14] mim1k: has joined #ruby
[07:30:33] mark_66: has joined #ruby
[07:34:11] kegster: has joined #ruby
[07:34:13] kegster: has joined #ruby
[07:38:33] ratcatcher: has joined #ruby
[07:40:34] hutch34_: has joined #ruby
[07:40:47] Qchmqs: has joined #ruby
[07:41:46] dionysus69: has joined #ruby
[07:45:11] vali: has joined #ruby
[07:51:13] toretore: has joined #ruby
[07:55:46] Toledo: has joined #ruby
[07:55:55] mim1k: has joined #ruby
[07:56:15] z3uS: has joined #ruby
[08:03:15] Qchmqs: has joined #ruby
[08:03:28] blackmesa: has joined #ruby
[08:05:34] Silthias1: has joined #ruby
[08:07:11] Silthias2: has joined #ruby
[08:07:41] bkxd: has joined #ruby
[08:10:49] jsrn_: has joined #ruby
[08:11:04] flying: has joined #ruby
[08:13:59] Beams: has joined #ruby
[08:15:32] andikr: has joined #ruby
[08:16:22] lazyatom: has joined #ruby
[08:16:58] gigetoo: has joined #ruby
[08:17:40] Mortomes|Work: has joined #ruby
[08:19:44] rgtk: has joined #ruby
[08:21:33] kassav_: has joined #ruby
[08:24:58] gigetoo: has joined #ruby
[08:25:31] jenrzzz: has joined #ruby
[08:25:31] jenrzzz: has joined #ruby
[08:25:38] ltem: has joined #ruby
[08:26:07] ltem: has left #ruby: ()
[08:27:53] uncertainty: has joined #ruby
[08:29:01] renchan_: has joined #ruby
[08:31:03] lxsameer: has joined #ruby
[08:32:54] kassav_: has joined #ruby
[08:35:09] blackmesa: has joined #ruby
[08:36:07] arne_: has joined #ruby
[08:36:15] arne_: Gem::InstallError: rack requires Ruby version >= 2.2.2
[08:36:19] arne_: can someone help me with that?
[08:37:03] arne_: i am on ruby2.4 on gentoo, thats why that message confuses me
[08:37:22] matthewd: arne_: How are you installing the gem?
[08:37:31] osliusar: has joined #ruby
[08:37:32] arne_: bundle install with my gemfile
[08:37:53] Tau: has joined #ruby
[08:38:12] matthewd: Does `bundle env` agree about your ruby version?
[08:38:27] \tau: has joined #ruby
[08:39:32] jusa: has joined #ruby
[08:41:10] marr: has joined #ruby
[08:41:18] hutch34_: has joined #ruby
[08:41:34] lenwood: has joined #ruby
[08:47:29] paemlm: has joined #ruby
[08:47:30] biberu: has joined #ruby
[08:47:45] arne_: when having nginx in a docker container
[08:47:53] arne_: how would i get the request ip from?
[08:48:07] arne_: 172.17.0.1 - - [05/Apr/2017:08:46:16 +0000] "GET / HTTP/1.1"
[08:48:34] Guest96: has joined #ruby
[08:49:32] hutch34_: has joined #ruby
[08:52:09] anisha: has joined #ruby
[08:54:40] ddffg: has joined #ruby
[08:55:42] arne_: in general how would i know where the connection is coming from inside a container?
[08:55:57] arne_: AHHH, wrong channel
[08:56:07] arne_: i am sorry.
[08:56:51] arne_: sorry, doing alot of things at the same time
[08:56:57] arne_: matthewd: you led me to the solution, thanks
[08:57:13] arne_: my packagemanager of my distro took bundler from the systems ruby version
[08:59:39] jenrzzz: has joined #ruby
[09:00:30] hahuang65: has joined #ruby
[09:00:47] burgestrand: has joined #ruby
[09:03:07] hs366: has joined #ruby
[09:04:45] StoneCypher: has joined #ruby
[09:05:38] rob_: arne_: your load balancer needs to set X-Forwarded-For ;)
[09:08:49] patarr: has joined #ruby
[09:10:03] pandaant: has joined #ruby
[09:23:18] A124: has joined #ruby
[09:23:43] Beams: has joined #ruby
[09:29:16] Rodya_: has joined #ruby
[09:30:16] arne_: rob_: well, i don't have something like that, yet
[09:30:29] arne_: but my guess i need nginx => nginx(docker), yes
[09:30:38] arne_: because only nginx(docker) sees the other docker hosts
[09:31:36] N30: has joined #ruby
[09:32:23] Pumukel: has joined #ruby
[09:32:44] uncertainty: has joined #ruby
[09:34:03] stamina: has joined #ruby
[09:36:32] naftilos76: has joined #ruby
[09:38:29] bkxd: has joined #ruby
[09:39:06] Ag3nt: has joined #ruby
[09:45:45] shterrett: has joined #ruby
[09:51:50] workmad3: has joined #ruby
[09:59:03] Pumukel: has joined #ruby
[10:02:10] ejnahc: has joined #ruby
[10:09:04] bkxd: has joined #ruby
[10:14:30] bkxd: has joined #ruby
[10:15:55] patarr: has joined #ruby
[10:22:11] hardwin: has joined #ruby
[10:22:34] jaruga: has joined #ruby
[10:23:19] Guest96: has joined #ruby
[10:26:47] Ag3nt: has joined #ruby
[10:27:31] burgestrand: ?guys hardwin
[10:27:31] ruby[bot]: hardwin: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[10:27:39] burgestrand: hardwin also hi! :D
[10:31:49] tvw: has joined #ruby
[10:32:50] hardwin: sorry, i bad speak english
[10:33:45] hardwin: i just need to find some comunity, to ask some questions about ruby
[10:33:57] aryaching_: has joined #ruby
[10:33:57] burgestrand: hardwin you've probably come to the right place then :)
[10:33:58] hardwin: am newbie on it
[10:34:18] roshanavand: has joined #ruby
[10:36:19] zcq100: has joined #ruby
[10:43:48] blackmesa: has joined #ruby
[10:44:11] zcq100: has joined #ruby
[10:45:02] Fernando-Basso: has joined #ruby
[10:45:50] nadir: has joined #ruby
[10:51:06] Ag3nt: has joined #ruby
[10:53:07] Guest96: has joined #ruby
[11:02:52] hahuang65: has joined #ruby
[11:05:37] StoneCypher: has joined #ruby
[11:05:37] aryaching: has joined #ruby
[11:07:16] jgt: has joined #ruby
[11:07:56] burgestrand: has joined #ruby
[11:09:59] raspado: has joined #ruby
[11:11:30] Ag3nt: has joined #ruby
[11:12:09] ensyde: has joined #ruby
[11:13:08] uncertainty: has joined #ruby
[11:14:32] j0bk: has joined #ruby
[11:19:52] millerti: has joined #ruby
[11:21:43] jgt: has joined #ruby
[11:22:19] gk_1wm_su: has joined #ruby
[11:23:16] zcq100: has joined #ruby
[11:24:09] gk_1wm_su: has left #ruby: ()
[11:30:49] Rodya_: has joined #ruby
[11:32:33] shterrett: has joined #ruby
[11:35:04] spyder55: has joined #ruby
[11:35:31] aryaching_: has joined #ruby
[11:36:17] ldnunes: has joined #ruby
[11:36:28] aryaching: has joined #ruby
[11:39:05] aryaching__: has joined #ruby
[11:47:18] aryaching: has joined #ruby
[11:48:44] marcellus: has joined #ruby
[11:48:58] Verity: def show_name_and_address(name="Someone", address="Somewhere"); def show_name_and_address(name: "Someone", address: "Somewhere");
[11:49:00] Verity: which is favored
[11:51:05] dionysus69: has joined #ruby
[11:51:27] yurikoles: has joined #ruby
[11:52:00] burgestrand: Verity I'd vote first, because the keyword arguments are reduntant when you name your method as such.
[11:52:42] matthewd: Verity: For two parameters, and especially where there's a somewhat "natural" order.. the first.
[11:53:12] burgestrand: Verity depending (very much) on context, a call such as e.g. `show(name: "Someone", address: "Somewhere")` could also be OK.
[11:59:48] fmcgeough: has joined #ruby
[12:01:33] aufi: has joined #ruby
[12:03:30] HoierM: has joined #ruby
[12:04:24] synthroid: has joined #ruby
[12:05:18] knight33: has joined #ruby
[12:06:22] aryaching: has joined #ruby
[12:07:15] blackmesa: has joined #ruby
[12:08:29] vuoto: has joined #ruby
[12:08:51] workerbeetwo: has joined #ruby
[12:11:08] workerbeetwo: Hi. is there a short cut for constructions liek this ? : def mything { a: other.a, b: other.b, c: other.c } where attributes are the very same?
[12:11:53] aryaching_: has joined #ruby
[12:11:59] pliniker: has joined #ruby
[12:14:39] matthewd: workerbeetwo: No
[12:18:15] kegster: has joined #ruby
[12:19:28] esObe_: has joined #ruby
[12:19:53] hardwin: hey folks, got a question here
[12:20:05] Pumukel: has joined #ruby
[12:20:22] _sfiguser: has joined #ruby
[12:20:45] hardwin: how many times you use a special math in web development practice?
[12:20:52] burgestrand: hardwin what is special math?
[12:21:10] Pumukel: has joined #ruby
[12:21:13] hardwin: means eny math
[12:21:16] t-recx: has joined #ruby
[12:21:58] burgestrand: hardwin +-/* sometimes, more involved less times
[12:22:21] hardwin: ok big thanks for u
[12:22:31] nemesit|znc: has joined #ruby
[12:22:34] burgestrand: hardwin but you can be web developer without being math expert, no problem
[12:22:54] hardwin: i think i do)
[12:23:09] fmcgeough: has joined #ruby
[12:28:14] sonOfRa: modulo is useful as a fifth
[12:28:27] sonOfRa: Also knowing that floating point math doesn't work as you would expect it to work
[12:29:00] max_v: has joined #ruby
[12:31:18] hardwin: <sonOfRa> it some problem to me?
[12:31:34] Rodya_: has joined #ruby
[12:31:37] hardwin: sorry my english
[12:31:52] ruby[bot]: Burgestrand: # => 0.30000000000000004 (https://eval.in/768449)
[12:40:06] bsartek: has joined #ruby
[12:40:21] JeanCarloMachado: has joined #ruby
[12:40:38] centrx: has joined #ruby
[12:40:57] centrx: has joined #ruby
[12:43:00] pupsicle: has joined #ruby
[12:43:52] hahuang65: has joined #ruby
[12:49:36] mim1k: has joined #ruby
[12:50:17] StoneCypher: has joined #ruby
[12:51:43] zapata: has joined #ruby
[12:52:02] osliusar: has joined #ruby
[12:56:16] aryaching: has joined #ruby
[12:56:27] xall: has joined #ruby
[12:58:23] aupadhye: has joined #ruby
[13:00:40] ramortegui: has joined #ruby
[13:03:15] houhoulis: has joined #ruby
[13:03:44] millerti: has joined #ruby
[13:04:09] vali: has joined #ruby
[13:04:23] toretore: has joined #ruby
[13:06:25] synthroid: has joined #ruby
[13:09:01] bkxd: has joined #ruby
[13:09:05] shinnya: has joined #ruby
[13:11:10] jeffreylevesque: has joined #ruby
[13:13:51] jamesaxl: has joined #ruby
[13:18:23] aufi: has joined #ruby
[13:20:13] centrx: has joined #ruby
[13:20:14] centrx: has joined #ruby
[13:23:06] aupadhye_: has joined #ruby
[13:30:00] jeffreylevesque: has joined #ruby
[13:32:09] aupadhye: has joined #ruby
[13:32:10] uncertainty: has joined #ruby
[13:32:24] DLSteve: has joined #ruby
[13:32:24] Rodya_: has joined #ruby
[13:34:40] charliesome: has joined #ruby
[13:42:42] cwnqsg: has joined #ruby
[13:43:53] yeticry: has joined #ruby
[13:44:39] hahuang65: has joined #ruby
[13:45:12] Pumukel: has joined #ruby
[13:47:29] fusta: has joined #ruby
[13:49:12] DaveTaboola: has joined #ruby
[13:51:27] aufi: has joined #ruby
[14:00:10] harfangk: has joined #ruby
[14:03:07] uncertainty: has joined #ruby
[14:04:30] Guest96: has joined #ruby
[14:08:45] houhoulis: has joined #ruby
[14:09:18] Guest96: has joined #ruby
[14:09:21] knight33: has joined #ruby
[14:09:49] bkxd: has joined #ruby
[14:11:43] kaspergr1bbe: has joined #ruby
[14:11:58] gnufied: has joined #ruby
[14:12:04] gigetoo: has joined #ruby
[14:16:20] dlitvak: has joined #ruby
[14:16:43] mim1k: has joined #ruby
[14:19:50] Vingador: has joined #ruby
[14:22:42] rwb: has joined #ruby
[14:23:45] yeticry_: has joined #ruby
[14:23:58] cdg: has joined #ruby
[14:24:42] rakm: has joined #ruby
[14:24:45] shwouchk: has joined #ruby
[14:26:13] Guest96: has joined #ruby
[14:27:33] rakm_: has joined #ruby
[14:33:54] polishdub: has joined #ruby
[14:35:26] __Yiota: has joined #ruby
[14:36:23] Guest37211: has joined #ruby
[14:37:03] Qchmqs: has joined #ruby
[14:39:16] agent_white: has joined #ruby
[14:42:37] etehtsea: has joined #ruby
[14:42:48] t-recx: has joined #ruby
[14:42:58] Lord_of_Life: has joined #ruby
[14:44:16] ovidnis: has joined #ruby
[14:45:02] Silthias: has joined #ruby
[14:45:47] StoneCypher: has joined #ruby
[14:47:22] patarr: has joined #ruby
[14:47:40] etehtsea: has joined #ruby
[14:47:48] Silthias1: has joined #ruby
[14:49:37] antoniobeyah: has joined #ruby
[14:50:39] __Yiota: has joined #ruby
[14:51:20] aupadhye_: has joined #ruby
[14:51:57] raspado: has joined #ruby
[14:56:15] uncertainty: has joined #ruby
[14:57:08] fusta: has joined #ruby
[14:58:28] rippa: has joined #ruby
[14:59:55] dionysus70: has joined #ruby
[15:00:30] ahrs: has joined #ruby
[15:00:43] Guest96: has joined #ruby
[15:00:51] igniting: has joined #ruby
[15:05:19] agent_white: Mornin' folks
[15:06:30] ovidnis: agent_white: o/
[15:07:44] patarr: has joined #ruby
[15:10:34] bkxd: has joined #ruby
[15:10:43] [Butch]: has joined #ruby
[15:12:44] Rodya_: has joined #ruby
[15:13:00] patarr: has joined #ruby
[15:15:00] raspado: has joined #ruby
[15:15:02] knight33: has joined #ruby
[15:17:19] araujo: has joined #ruby
[15:17:19] araujo: has joined #ruby
[15:18:02] patarr1: has joined #ruby
[15:21:59] chouhoulis: has joined #ruby
[15:22:38] etehtsea: has joined #ruby
[15:30:55] kegster: has joined #ruby
[15:31:31] whiteline: has joined #ruby
[15:31:47] LuckyABA: has joined #ruby
[15:32:36] patarr: has joined #ruby
[15:33:01] fusta: has joined #ruby
[15:34:57] Lord_of_Life: has joined #ruby
[15:35:21] TomyLobo: has joined #ruby
[15:41:27] Lord_of_Life: has joined #ruby
[15:42:46] ledestin: has joined #ruby
[15:44:29] patarr: has joined #ruby
[15:44:49] furkanusta: has joined #ruby
[15:45:30] hahuang65: has joined #ruby
[15:48:42] blackmesa: has joined #ruby
[15:54:32] amclain: has joined #ruby
[15:54:42] rakm: has joined #ruby
[15:59:35] Eleeleth: has joined #ruby
[16:04:07] patarr: has joined #ruby
[16:06:24] ltem: has joined #ruby
[16:08:43] tercenya: has joined #ruby
[16:09:10] snockerton: has joined #ruby
[16:12:24] gusrub: has joined #ruby
[16:13:47] RobertBirnie: has joined #ruby
[16:15:18] ozcanesen: has joined #ruby
[16:15:39] minimalism: has joined #ruby
[16:19:40] cschneid_: has joined #ruby
[16:22:14] ovidnis`: has joined #ruby
[16:22:28] nitric: has joined #ruby
[16:27:13] SeepingN: has joined #ruby
[16:27:24] ozcanesen: has joined #ruby
[16:27:24] jaequery: has joined #ruby
[16:32:12] marr: has joined #ruby
[16:33:22] yurikoles: has joined #ruby
[16:36:44] patarr: has joined #ruby
[16:37:14] outreachdan: has joined #ruby
[16:37:47] volty: has joined #ruby
[16:38:57] adavia: has joined #ruby
[16:38:59] osliusar: has joined #ruby
[16:40:54] tvw: has joined #ruby
[16:41:03] narval: Is there a cleaner way to do this https://gist.github.com/adavia/f207322a2dec5e4b48fc8d8607bb17ba
[16:42:33] havenwood: narval: You could use `answers.flat_map` in place of `answers.map` then drop the `flatten`.
[16:43:32] havenwood: narval: https://docs.ruby-lang.org/en/2.4.0/Enumerable.html#method-i-flat_map
[16:45:38] havenwood: narval: Instead of `map(&:id)).empty?` consider `none?(&:id)` if #id never returns false or nil.
[16:47:08] havenwood: narval: You could DRY up the `a.question == f.question` logic since it's the same in every case.
[16:47:28] havenwood: Bring it ahead of the case statement.
[16:48:09] SeepingN: has joined #ruby
[16:49:57] Rodya_: has joined #ruby
[16:50:07] [Butch]_: has joined #ruby
[16:50:16] havenwood: narval: next if filters.none? { |filter| a.question == filter.question }
[16:50:31] havenwood: Something like that.
[16:51:43] [Butch]_: has joined #ruby
[16:52:10] username1: has joined #ruby
[16:52:33] [Butch]_: has joined #ruby
[16:52:38] A124: has joined #ruby
[16:52:58] Arpanet69: has joined #ruby
[16:53:20] username1: any suggestions for a good cross platform (mac/win) way to control OS level keyboard events?
[16:53:55] username1: i could use AppleScript/win32ole but want to see if there is a cross platform solution
[16:55:11] username1: volty: nice
[16:55:13] username1: how would that look?
[16:55:18] username1: at a high level
[16:55:55] username1: can QT send OS Level key events?
[16:56:31] volty: you can post an event, but you'll have to get it back with qt routines
[16:57:17] username1: volty: why cant Ruby just send a system level keyboard event?
[16:57:36] username1: no interface to the OS level events built into ruby?
[16:57:44] username1: and QT provides that layer?
[16:58:16] volty: I could try to answer better if you give us a simple example of what are you trying to achieve
[16:59:17] volty: if you are trying to simulate keystrokes to be consumed by other apps, you'd better go with ah-hoc external programs
[17:00:24] volty: but if you are going to consume them within your own app, you can go with qt even with no windows (but I'd have to verify this one)
[17:00:24] username1: volty: im trying to press "Enter" for a Chrome dialog that pops up from a ruby process
[17:00:48] username1: im using watir to run test automation, but an OS level dialog pops up
[17:00:49] tercenya: has joined #ruby
[17:00:55] username1: and selenium webdriver cant access OS level dialogs
[17:01:33] username1: i can use Applescript/VBScript via different ruby gems
[17:01:39] volty: or something like that (on linux)
[17:02:21] username1: volty: i am curious though, why Ruby doesnt just include it as part of standard library
[17:02:35] username1: too much pain to continue to work with the interface supplied by the different OSes?
[17:02:48] username1: thanks, ill look into xdotool
[17:03:30] matthewd: This is an OS dialog that's not an alert/confirm/prompt, I assume?
[17:03:45] username1: matthewd: yeah
[17:03:55] username1: its not from the OS
[17:03:57] username1: its from the browser
[17:04:01] username1: but its not a javascript alert
[17:04:20] matthewd: What is it?
[17:04:23] username1: it cant be interacted with via javascript or selenium webdriver
[17:04:25] username1: its from an extension
[17:04:48] manveru: start browser without extension? :)
[17:04:55] username1: its the same reason why selenium webdriver cant access the print dialog
[17:04:57] username1: from a browser
[17:04:58] Emmanuel_Chanel: has joined #ruby
[17:05:03] username1: manveru: hah, i wish
[17:05:10] username1: i need to test the extension out
[17:05:19] _whitelogger: has joined #ruby
[17:05:20] mistym: has joined #ruby
[17:05:20] mistym: has joined #ruby
[17:05:24] cpruitt: has joined #ruby
[17:05:30] manveru: but yeah, as mentioned above, you kinda have to hack something together with autoitscript/applescript/xdotool :|
[17:06:02] username1: manveru: thanks
[17:06:05] lupine: has joined #ruby
[17:06:09] manveru: in the easiest case you only need to target some coordinates... not sure such popups have their own "window"
[17:06:31] username1: i just need to press Enter key
[17:06:34] username1: that should take care of it
[17:06:47] volty: ops, sorry, got to go away
[17:06:59] mim1k: has joined #ruby
[17:07:06] manveru: https://github.com/Quintus/Automations username_
[17:07:07] volty: could be i can give you sol for linux , wait
[17:07:17] sepp2k: has joined #ruby
[17:08:07] volty: found, I use wmctrl to get a list of windows on my desk
[17:08:16] username1: so it basically just sits on top of au3/AutoIt or xdtoolanyways
[17:09:36] patarr: has joined #ruby
[17:10:30] SuperLag: has joined #ruby
[17:10:38] volty: as for the standard library I guess it isn't here just because almost no ruby coders need it
[17:10:54] username1: volty: makes sense
[17:11:12] bkxd: has joined #ruby
[17:11:12] hahuang65: has joined #ruby
[17:11:19] saneax: has joined #ruby
[17:12:04] knight33: has joined #ruby
[17:13:05] username1: but at the same time it seems like it would fairly trivial to implement in the OS module or something similar
[17:13:17] tercenya: has joined #ruby
[17:13:20] phoo1234567: has joined #ruby
[17:13:28] Xiti: has joined #ruby
[17:13:50] username1: but seems like other languages face the same problem
[17:13:56] username1: so im thinking its an interface issue
[17:14:02] username1: difficult to maintain likely
[17:14:34] matthewd: It's just really not a thing applications need to do
[17:15:35] volty: you can extend the os module calling external progs, or you can extend it writing your own c routines
[17:17:03] volty: the os's were designed for human clicking and typing
[17:18:17] username1: volty: nice
[17:19:00] _sfiguser: has joined #ruby
[17:26:13] AndBobsYourUncle: has joined #ruby
[17:33:55] snickers: has joined #ruby
[17:35:22] Puffball: has joined #ruby
[17:36:29] raspado: hi all, is it fine to put an if statement inside my unless? https://pastebin.com/tL3yqW5n heres my example, seems to work fine but not sure if this has damaging effects
[17:36:29] ruby[bot]: raspado: as I told you already, please use https://gist.github.com
[17:38:28] skweek: has joined #ruby
[17:41:07] JeanCarloMachado: has joined #ruby
[17:42:00] callahanrts: has joined #ruby
[17:43:07] SeepingN: has joined #ruby
[17:44:34] bsartek: has joined #ruby
[17:49:42] muelleme_: has joined #ruby
[17:49:47] duderonomy: has joined #ruby
[17:50:43] jcao219: has joined #ruby
[17:51:12] Ishido: has joined #ruby
[17:51:20] Rodya_: has joined #ruby
[17:52:42] blackmesa: has joined #ruby
[17:52:48] ovidnis`: has left #ruby: ("ERC (IRC client for Emacs 25.1.1)")
[17:53:48] ovidnis: has joined #ruby
[17:57:39] outreachdan: has joined #ruby
[17:58:35] baweaver: raspado: It isn't necessary
[17:58:51] patarr1: has joined #ruby
[17:58:54] baweaver: just put all the conditionals on one line
[17:59:11] raspado: i just need to exclude 1 env so it does not run through that if statement
[17:59:11] baweaver: only use two conditional branches if there's a difference between what'll execute
[17:59:29] raspado: oh so just another && ?
[17:59:29] postmodern: has joined #ruby
[17:59:44] bsartek: has joined #ruby
[18:01:03] baweaver: honestly I think you could just write it as: abort "exiting #{cloud} is not training" unless cloud.match(/training/) || issue_type != 'non-prod deploy'
[18:01:36] xall: has joined #ruby
[18:01:46] raspado: mmm yeah good call, thx baweaver
[18:01:47] `derpy: No results
[18:01:56] baweaver: &ri Kernel#abort
[18:01:56] `derpy: http://ruby-doc.org/core-2.4.0/Kernel.html#method-i-abort
[18:02:26] baweaver: so effectively: puts "msg" and exit(1)
[18:07:11] allisio: *warn "msg" and exit(1)`
[18:09:22] snickers: has joined #ruby
[18:09:26] baweaver: allisio keeps me honest it seems
[18:10:23] allisio: I've just been bitten by my share of debug messages getting into pipelines.
[18:10:41] baweaver: ACTION shrugs
[18:13:28] jgt: has joined #ruby
[18:14:10] sinequanon: has joined #ruby
[18:14:26] zun: has joined #ruby
[18:15:59] uncertainty: has joined #ruby
[18:17:06] solocshaw: has joined #ruby
[18:27:01] solocshaw: has joined #ruby
[18:32:59] antgel: has joined #ruby
[18:40:10] jenrzzz: has joined #ruby
[18:40:11] jenrzzz: has joined #ruby
[18:41:16] Flipp`-: has joined #ruby
[18:42:06] Flipp`-: has left #ruby: ()
[18:49:39] mim1k: has joined #ruby
[18:51:30] celesteh: has joined #ruby
[18:53:04] futilegames: has joined #ruby
[18:54:01] celesteh: Noob question: My gemfile wants ruby2.3.1, rvm says it's not installed, but ruby2.3 -v returns ruby 2.3.1p11. Is 2.3.1 installed or not?
[18:54:04] ldnunes: has joined #ruby
[18:54:11] tildes: has joined #ruby
[18:54:20] jgt: has joined #ruby
[18:55:00] skweek: has joined #ruby
[18:55:01] maddmaxx: has joined #ruby
[18:55:13] ozcanesen: has joined #ruby
[18:55:30] dionysus69: has joined #ruby
[18:56:55] ResidentBiscuit: has joined #ruby
[19:00:30] raul782: has joined #ruby
[19:01:42] matthewd: celesteh: It sounds like you have a ruby 2.3.1, but rvm isn't aware of it / isn't managing it
[19:02:32] celesteh: mattewd: is this something I can sort out without root?
[19:02:48] havenwood: celesteh: rvm install 2.3.1
[19:02:57] havenwood: celesteh: as long as you happen to have the deps installed
[19:03:25] celesteh: havenwood I'm not root. My webhosting company owns the box
[19:04:58] tildes: has joined #ruby
[19:07:37] havenwood: celesteh: try?: rvm autolibs read-only && rvm requirements
[19:07:41] havenwood: celesteh: are you missing anything?
[19:08:15] havenwood: celesteh: If not, you're good to go. Another question is whether there's a precompile binary available for your os/distro. If there is, you don't need build tools.
[19:08:31] celesteh: Missing required packages: libyaml-devel
[19:09:10] enterprisey: has joined #ruby
[19:09:11] havenwood: celesteh: Yeah, so you'd have to install libyaml-devel one way or another. Is this a box for development or production? What os/distro?
[19:09:11] planigan: has joined #ruby
[19:09:56] jhass: can't they just mount the ruby 2.3.1 they have into rvm?
[19:10:35] celesteh: Is there a way to use ruby2.3 without rvm?
[19:10:43] havenwood: rvm mount $(command -v ruby2.3) -n ruby-2.3.1
[19:10:50] havenwood: celesteh: Yes.
[19:10:50] muelleme_: has joined #ruby
[19:11:34] celesteh: Is it an option in bundle? This is the error I get with it: Your Ruby version is 2.2.5, but your Gemfile specified 2.3.1
[19:12:02] bkxd: has joined #ruby
[19:12:03] havenwood: jhass: Yeah. I'm still curious if it's a deployment server though. Probably no reason for RVM at all.
[19:12:05] manveru: celesteh: using nix? :)
[19:12:30] havenwood: celesteh: Dev or prod? What os/distro?
[19:12:47] havenwood: celesteh: We can give better recommendations if you let us know.
[19:14:22] celesteh: It's CentOS. I'm on webfaction
[19:14:26] cfec0b8d: has joined #ruby
[19:14:44] celesteh: Trying to install a Mastodon instance
[19:17:10] hahuang61: has joined #ruby
[19:18:25] maattdd: has joined #ruby
[19:19:34] havenwood: celesteh: If you don't need to switch Ruby versions, you don't need a Ruby version switcher. You might just want to: rvm implode --force
[19:21:56] Ishido: has joined #ruby
[19:24:08] milardovich: has joined #ruby
[19:24:55] cfec0b8d1: has joined #ruby
[19:26:13] im314ous: has joined #ruby
[19:26:51] LuckyABA: has joined #ruby
[19:27:44] bjfish2: has joined #ruby
[19:29:46] gdonald: has joined #ruby
[19:31:11] lxsameer: has joined #ruby
[19:31:12] BSaboia: has joined #ruby
[19:38:27] tercenya: has joined #ruby
[19:38:52] AndBobsYourUncle: has joined #ruby
[19:39:44] maattdd_: has joined #ruby
[19:40:02] ResidentBiscuit: has joined #ruby
[19:48:41] yxhuvud: has joined #ruby
[19:48:44] planigan: has joined #ruby
[19:52:29] rgtk: has joined #ruby
[19:55:29] username: has joined #ruby
[19:55:49] tildes: has joined #ruby
[19:56:43] S1kx: has joined #ruby
[20:00:30] workmad3: has joined #ruby
[20:02:48] lupine: has joined #ruby
[20:04:43] samdvr: has joined #ruby
[20:07:47] blackmesa: has joined #ruby
[20:10:07] br0d1n: has joined #ruby
[20:10:27] cdg: has joined #ruby
[20:11:10] JoshS: has joined #ruby
[20:16:07] zipace: has joined #ruby
[20:17:02] zipace: has joined #ruby
[20:17:04] nowhere_man: has joined #ruby
[20:18:21] zipace: has joined #ruby
[20:18:28] lupine: has joined #ruby
[20:19:22] futilegames: has joined #ruby
[20:22:07] planigan: has joined #ruby
[20:24:59] raul782: has joined #ruby
[20:25:11] skweek: has joined #ruby
[20:29:57] Nahra: has joined #ruby
[20:31:33] DoubleMalt: has joined #ruby
[20:32:48] MrBusiness: has joined #ruby
[20:33:07] tAn: has joined #ruby
[20:33:30] planigan: has joined #ruby
[20:35:52] antgel: has joined #ruby
[20:37:44] kitikonti: has joined #ruby
[20:38:16] esObe_: has joined #ruby
[20:41:42] username: has joined #ruby
[20:44:58] ddffg: has joined #ruby
[20:46:26] uncertainty: has joined #ruby
[20:50:55] hutch34_: has joined #ruby
[20:51:22] milardovich: has joined #ruby
[20:53:21] Rodya_: has joined #ruby
[20:53:44] mim1k: has joined #ruby
[20:53:45] muelleme_: has joined #ruby
[20:57:13] akkad: has joined #ruby
[20:57:44] bkxd: has joined #ruby
[21:00:12] ldnunes: has joined #ruby
[21:02:17] patarr: has joined #ruby
[21:02:50] yurikoles: has joined #ruby
[21:06:23] jusa: has joined #ruby
[21:07:56] aglorei: has joined #ruby
[21:08:10] rwb: has joined #ruby
[21:08:18] raul782: has joined #ruby
[21:14:53] nowhere_man: has joined #ruby
[21:16:23] Rodya_: has joined #ruby
[21:21:32] nowhere_man: has joined #ruby
[21:26:11] nowhere_man: has joined #ruby
[21:26:56] ij: has left #ruby: ("WeeChat 1.7")
[21:30:03] ramortegui: has joined #ruby
[21:31:25] milardovich: has joined #ruby
[21:32:10] nowhereman: has joined #ruby
[21:32:26] raspado: this might be a hack but is it acceptable? !['prod'].include?(env)
[21:33:00] matthewd: raspado: What part of it?
[21:33:20] raspado: basically trying to accomplish the opposite of exclude
[21:33:27] raspado: oops opposite of include? :)
[21:33:40] bougyman: why not just use unless?
[21:33:57] bougyman: unless ['prod'].include? env
[21:34:05] matthewd: raspado: Yes, ! is a perfectly reasonable thing to use; that's why it's there :)
[21:34:16] Guest96: has joined #ruby
[21:34:32] raspado: ^ bougyman hmmm true ;)
[21:34:40] bougyman: i just feel like unless is more clear.
[21:34:44] raspado: but that was part of a one liner conditional
[21:34:46] elomatreb: If your env array only has one entry anyway, why not just compare them?
[21:34:56] raspado: but yeah maybe i should just add the unless in the if
[21:35:02] raspado: makes more sense for sure
[21:35:05] cagomez: has joined #ruby
[21:35:07] bougyman: some_shit unless ['prod'].include? env
[21:35:13] bougyman: still a one-liner
[21:35:13] elomatreb: i.e. env == "prod"
[21:35:14] jenrzzz: has joined #ruby
[21:35:17] raspado: elomatreb: i was thinking just incase we need to add more in the future
[21:35:39] elomatreb: <Insert quote about premature optimisation>
[21:35:55] matthewd: `unless x` > `if !x`... but `if x && !y` > `if x; unless y; ..`
[21:36:06] matthewd: (IMO, as a general principle, YMMV, etc)
[21:36:27] raspado: nice thx matthewd bougyman
[21:37:26] elomatreb: If you're going to plan ahead and use the array, I'd at least recommend to move that to a constant instead of using the literal directly. (SOME_ENVS = ["prod"])
[21:38:39] matthewd: Oh, and yeah, I wouldn't bother with an array just to save the possible effort of maybe changing == to include? in the future.
[21:39:42] esObe_: has joined #ruby
[21:40:20] allisio: matthewd: How about `... unless y if x`?
[21:41:42] matthewd: allisio: (face melting)
[21:41:58] StoneCypher: has joined #ruby
[21:42:05] matthewd: allisio: I mean.. no, I'd personally avoid that as it's not as clear as some alternatives
[21:42:51] bronson: has joined #ruby
[21:43:14] JeanCarloMachado: has joined #ruby
[21:43:45] govg: has joined #ruby
[21:43:50] naprimer: has joined #ruby
[21:49:27] VladGh: has joined #ruby
[21:52:40] hutch34_: has joined #ruby
[21:59:20] r3m: has joined #ruby
[22:11:08] kristofferR: has joined #ruby
[22:14:00] chouhoul_: has joined #ruby
[22:19:42] raul782: has joined #ruby
[22:22:07] Mrgoose: has joined #ruby
[22:22:33] Mrgoose: Any of you familiar with ruby and openssl? Im trying to use grpc in ruby to connect to a grpc server and im getting ssl_transport_security.c:947] Handshake failed with fatal error SSL_ERROR_SSL: error:1000006b:SSL routines:OPENSSL_internal:BAD_ECC_CERT
[22:22:44] Mrgoose: but If I use openssl directly it works fine
[22:25:09] grh: has joined #ruby
[22:26:32] aryaching: has joined #ruby
[22:27:14] al2o3-cr: package ruby
[22:28:54] Mrgoose: Ubuntu 16.04 , ruby 2.2.5
[22:30:47] al2o3-cr: you make sure
[22:31:01] al2o3-cr: you get right bindinds
[22:31:06] Mrgoose: how can i check
[22:31:08] minimalism: has joined #ruby
[22:31:25] al2o3-cr: OpenSSL::VERSION
[22:31:43] al2o3-cr: from repl oor cl
[22:31:51] al2o3-cr: commans line
[22:33:47] Mrgoose: OpenSSL 1.0.2g 1 Mar 2016
[22:34:04] Mrgoose: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
[22:34:04] Mrgoose: OpenSSL 1.0.2g 1 Mar 2016
[22:36:33] al2o3-cr: what sys this
[22:36:42] al2o3-cr: ruby -r{openssl,fiddle} <<<'include Fiddle; p Function.new(Handle::DEFAULT["SSLeay_version"], [TYPE_INT], TYPE_VOIDP).(0).to_s'
[22:36:43] Mrgoose: Ubuntu 16.04
[22:37:01] Mrgoose: ruby -r{openssl,fiddle} <<<'include Fiddle; p Function.new(Handle::DEFAULT["SSLeay_version"], [TYPE_INT], TYPE_VOIDP).(0).to_s'
[22:37:01] Mrgoose: "OpenSSL 1.0.2g 1 Mar 2016"
[22:38:15] al2o3-cr: ruby -r{openssl,fiddle} <<<'include Fiddle; p Function.new(Handle::DEFAULT["SSLeay_version"], [TYPE_INT], TYPE_VOIDP).(2).to_s'
[22:38:49] Mrgoose: "compiler: cc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m
[22:38:49] Mrgoose: -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM"
[22:40:13] al2o3-cr: Mrgoose: what cmd line ?
[22:40:14] hahuang65: has joined #ruby
[22:40:20] al2o3-cr: with openssll
[22:43:04] Mrgoose: I do not understand the question :/
[22:43:07] al2o3-cr: soounds like amitch match
[22:43:43] username: has joined #ruby
[22:45:13] al2o3-cr: Mrgoose: u using version managinf
[22:46:23] al2o3-cr: or std ubuntu ruby
[22:46:31] Mrgoose: ubuntu ruby
[22:49:18] al2o3-cr: mrGoose shits got me
[22:51:03] celesteh: has joined #ruby
[22:53:48] _aeris_: has joined #ruby
[22:54:41] jgnagy: has joined #ruby
[22:56:06] al2o3-cr: Mrgoose: https://github.com/grpc/grpc/issues/3613 # take a ganderz
[22:56:13] kegster: has left #ruby: ("Leaving")
[22:56:26] zenspider[m]: has joined #ruby
[22:57:08] solocshaw: has joined #ruby
[22:58:35] bkxd: has joined #ruby
[23:01:42] nemesit|znc: has joined #ruby
[23:02:01] al2o3-cr: zenspider[m]: you a tiger/lion?
[23:02:44] gnufied: has joined #ruby
[23:03:01] al2o3-cr: zenspider[m]: hey,
[23:06:17] solocshaw: has joined #ruby
[23:06:38] al2o3-cr: Mrgoose: expres your question again maybe sme can help :))
[23:07:11] jusa: has joined #ruby
[23:08:01] rgtk: has joined #ruby
[23:08:04] al2o3-cr: ACTION is f***ed almiyty
[23:08:51] al2o3-cr: recomendatin 13' ?
[23:09:19] al2o3-cr: this is sluggish
[23:16:27] uncertainty: has joined #ruby
[23:17:54] hutch34_: has joined #ruby
[23:18:51] ruby-lang899: has joined #ruby
[23:21:03] raul782: has joined #ruby
[23:21:07] ruby-lang899: Can anyone help
[23:22:18] cschneid_: has joined #ruby
[23:22:27] hahuang65: has joined #ruby
[23:27:00] outreachdan: has joined #ruby
[23:29:59] ski7777: has joined #ruby
[23:30:09] tercenya: has joined #ruby
[23:32:01] camilasan: has joined #ruby
[23:34:13] hahuang61: has joined #ruby
[23:36:59] Vile`: has joined #ruby
[23:39:44] hndk: has joined #ruby
[23:41:01] esObe_: has joined #ruby
[23:42:24] StoneCypher: has joined #ruby
[23:43:39] chouhoulis: has joined #ruby
[23:43:39] houhoulis: has joined #ruby
[23:44:59] raul782: has joined #ruby
[23:50:07] raul782: has joined #ruby
[23:50:25] dar123: has joined #ruby
[23:54:02] raul782: has joined #ruby
[23:54:08] mim1k: has joined #ruby
[23:58:28] JeanCarloMachado: has joined #ruby
[23:59:14] bkxd: has joined #ruby