« Back to channel list

#ruby - 11 April 2019

« Back 1 day Forward 1 day »
[00:00:42] scientes: Process.daemon
[00:00:57] bhaak: has joined #ruby
[00:03:11] DarthGandalf: has joined #ruby
[00:04:45] scientes: now i have CI!
[00:04:50] scientes: on push to my server
[00:26:09] bambanx: has joined #ruby
[00:30:20] faces: has joined #ruby
[00:30:27] cozachk: has joined #ruby
[00:30:51] akem: has joined #ruby
[00:31:21] skryking_: has joined #ruby
[00:31:31] Brian-W-Gray: has joined #ruby
[00:32:07] ur5us_: has joined #ruby
[00:32:07] danielz1: has joined #ruby
[00:32:10] kaleido: has joined #ruby
[00:32:39] shtirlic: has joined #ruby
[00:33:46] zenspider: has joined #ruby
[00:34:19] mochiyoda: has joined #ruby
[00:34:31] tarptaeya: has joined #ruby
[00:36:15] akosednar: has joined #ruby
[00:36:15] akosednar: has joined #ruby
[00:36:37] Milos: has joined #ruby
[00:37:22] Spitfire: has joined #ruby
[00:37:22] Spitfire: has joined #ruby
[00:37:38] Tharbakim: has joined #ruby
[00:37:39] Tharbakim: has joined #ruby
[00:37:42] doodlebug: has joined #ruby
[00:48:06] xall: has joined #ruby
[00:55:19] IGnorAND: how does one go about testing a APIAdapter?
[00:55:38] IGnorAND: Do you just test the api command, and then all possible values for all possible params?
[00:57:44] pupsikov: has joined #ruby
[00:57:56] scientes: IGnorAND, "all possible", thats impossible
[00:58:15] IGnorAND: scientes: all possible 'classes' of input
[00:58:28] scientes: that sounds about right
[00:58:30] IGnorAND: but also the combination of?
[00:58:39] scientes: test anything you want to work
[00:58:44] scientes: its quite simple
[00:59:48] GodFather: has joined #ruby
[01:01:36] x0F: has joined #ruby
[01:06:57] IGnorAND: I have a param PageSize. Minimum value is 10, and maximum value is 100. Default Value: 20. So I test for <10, x>=10 && x<=100, >100 and non integers?
[01:08:13] x0F: has joined #ruby
[01:15:15] llua: has joined #ruby
[01:20:11] IGnorAND: I wonder if ruby programmers also adhere to the 'fail fast' principle. Maybe I should thrown an exception at the initializer
[01:22:53] fluxAeon: has joined #ruby
[01:30:36] GodFather: has joined #ruby
[01:33:57] mr_rich101: has joined #ruby
[01:34:40] UnknownSoldier: has joined #ruby
[01:36:59] jottr: has joined #ruby
[01:45:03] xall: I'm trying to sum a hash with another hash but I'm not getting it quite right: https://pastebin.com/2YyEdHNZ. Is it possible to do it like this?
[01:47:38] Jameser: has joined #ruby
[01:48:30] adam12: xall: What are you trying to achieve, exactly? ie. what are you expecting as output
[01:52:08] ljarvis: has joined #ruby
[01:55:28] adam12: xall: I think this is what you're looking for? {"win"=>1, "draw"=>0, "loss"=>0}.merge({"win"=>3, "draw"=>1, "loss"=>0}) { |key, oldval, newval| newval + oldval }
[01:55:49] adam12: &>> {"win"=>1, "draw"=>0, "loss"=>0}.merge({"win"=>3, "draw"=>1, "loss"=>0}) { |key, oldval, newval| newval + oldval }
[01:55:51] rubydoc: # => {"win"=>4, "draw"=>1, "loss"=>0} (https://carc.in/#/r/6pfb)
[01:56:13] xall: In that case, I expect 3 as output. I want to sum the results with the actual point values
[01:58:28] adam12: xall: What's the math used to get 3? I'm not following.
[02:01:05] havenwood: xall: How does 4 wins and a draw equal 3?
[02:01:16] xall: sorry - so results is the actual data and result_values is how much each point is worth, so win=1 is worth 3 points
[02:01:28] jottr: has joined #ruby
[02:01:47] mangold: has joined #ruby
[02:02:20] havenwood: &>> [{win: 1, draw: 0, loss: 0}, {win: 3, draw: 1, loss: 0}].sum { |win:, draw:, loss:| win - loss }
[02:02:21] rubydoc: # => 4 (https://carc.in/#/r/6pfc)
[02:02:50] adam12: havenwood: Nice solution :)
[02:02:59] xall: (result_values says that win is worth 3, draw is worth 1)
[02:03:11] havenwood: &>> [{win: 1, draw: 0, loss: 0}, {win: 3, draw: 1, loss: 0}].sum { |win:, draw:, loss:| win * 3 - loss }
[02:03:11] rubydoc: # => 12 (https://carc.in/#/r/6pfd)
[02:06:49] havenwood: xall: Can you use Symbol instead of String keys? :)
[02:06:58] havenwood: Symbols make nice keys.
[02:08:47] adam12: &>> {"win"=>1, "draw"=>0, "loss"=>0}.reduce(0) { |m, (k, v)| m + ({"win"=>3, "draw"=>1, "loss"=>0}.fetch(k) * v) }
[02:08:47] rubydoc: # => 3 (https://carc.in/#/r/6pfe)
[02:08:49] adam12: Because I'm lazy.
[02:09:35] adam12: Breaking it up from a oneliner will make it clearer but maybe havenwood has an idea with destructuring keyed symbols.
[02:10:49] dsmythe: has joined #ruby
[02:11:12] xall: I'm using strings because it's part of an exercise where you have to parse given lines like `Allegoric Alaskans;Blithering Badgers;win`
[02:13:30] xall: https://pastebin.com/3WsbTe3Q
[02:13:32] xall: thanks for the help
[02:15:41] havenwood: &>> score_values = {"win"=>3, "draw"=>1, "loss"=>-2}; [{"win"=>1, "draw"=>0, "loss"=>0}, {"win"=>3, "draw"=>1, "loss"=>0}].sum { |h| h.merge(score_values) { |_, score, value| score * value }.values.sum }
[02:15:42] rubydoc: # => 13 (https://carc.in/#/r/6pff)
[02:22:09] Swyper: has joined #ruby
[02:23:02] troulouliou_dev: has joined #ruby
[02:45:29] brool: has joined #ruby
[02:59:06] Autolycus: has joined #ruby
[02:59:28] jottr: has joined #ruby
[03:09:11] Swyper: has joined #ruby
[03:09:21] jenrzzz: has joined #ruby
[03:10:23] braincrash: has joined #ruby
[03:18:59] yield: has joined #ruby
[03:19:47] xco: has joined #ruby
[03:20:46] xco: i want to make some steps to create my first ruby gem. but need some thougts. is it a good idea for a gem to make an api call to some other service? are there gems like that already
[03:21:35] xco: the gem i want to make will require an API secret key which if you’er using rails you’d put the key in your initializers folder but i’m not sure if this is a good idea
[03:21:58] maxdoubt: has joined #ruby
[03:26:56] jenrzzz: has joined #ruby
[03:41:22] jenrzzz: has joined #ruby
[03:50:26] Swyper: has joined #ruby
[03:50:26] DTZUZO: has joined #ruby
[03:50:36] jenrzzz: has joined #ruby
[03:54:22] maxdoubt: has joined #ruby
[03:58:50] Wolland: has joined #ruby
[04:06:38] havenwood: xco: it's a fine idea for a gem to make an API call. there are lots of gems that wrap APIs or make API calls for various reasons.
[04:07:03] Wolland: has joined #ruby
[04:07:17] DmitryBochkarev: has joined #ruby
[04:07:30] xco: havenwood: thanks for the response. reason i asked was i thought if i created a gem like that it’d be “odd” since i haven’t personally used a gem that makes an API call
[04:07:31] havenwood: xco: gems involving secret keys often are initialized with the key. another pattern is to assign an environment variable.
[04:07:47] xall: has joined #ruby
[04:08:30] xco: yeah and ENV variable would work too, good idea i’ll keep that option in my thoughts
[04:09:57] havenwood: xco: the company I work for, for example, has a square_connect gem that is an SDK for Square APIs
[04:11:07] havenwood: xco: it's pretty common for a company to have a gem that wraps their APIs
[04:11:27] xco: yeah prolly a private gem right? i’m yet to see a public OS gem that makes use of keys like that
[04:11:45] havenwood: yes, you don't have to publish a gem
[04:11:49] havenwood: you can have it be private
[04:13:35] havenwood: xco: lots of gems do use API keys
[04:14:19] havenwood: xco: here are some examples
[04:14:23] havenwood: Twitters: https://github.com/sferik/twitter#configuration
[04:14:43] havenwood: GitHubs: https://github.com/octokit/octokit.rb#oauth-access-tokens
[04:15:06] xco: oooo awesome! this will give me an idea how to implement my api key part
[04:15:08] havenwood: Squares: https://github.com/square/connect-ruby-sdk#getting-started
[04:16:18] havenwood: xco: https://github.com/aws/aws-sdk-ruby#configuration
[04:16:42] xall: has joined #ruby
[04:17:07] xco: thanks ;)
[04:24:06] xall: has joined #ruby
[04:24:31] kapil____: has joined #ruby
[04:32:55] iMadper: has joined #ruby
[04:37:24] xall: has joined #ruby
[04:38:40] xco: has joined #ruby
[04:43:41] xall: has joined #ruby
[04:43:46] Wolland: has joined #ruby
[04:44:07] xco: has joined #ruby
[04:49:21] Arahael: has joined #ruby
[04:49:47] Arahael: has joined #ruby
[04:59:07] xall: has joined #ruby
[05:00:25] jottr: has joined #ruby
[05:05:47] jottr: has joined #ruby
[05:09:19] ferr: has joined #ruby
[05:12:16] xall: `"foo;bar".split(?;)` -- first time encountering this syntax but I can't find it in google. It's not a regex (b/c no enclosing //), right?
[05:14:43] sidx64: has joined #ruby
[05:17:47] conta: has joined #ruby
[05:19:32] ferr: has joined #ruby
[05:22:23] havenwood: xall: it's a character literal (it just creates a single character string)
[05:22:31] havenwood: &>> ?x.class
[05:22:32] rubydoc: # => String (https://carc.in/#/r/6pfi)
[05:22:42] havenwood: &>> ?x == 'x'
[05:22:43] rubydoc: # => true (https://carc.in/#/r/6pfj)
[05:22:46] hays: has joined #ruby
[05:24:18] xall: havenwood: Thanks. Surely I've seen that before but evidently not enough
[05:27:53] DmitryBochkarev: has joined #ruby
[05:28:00] Dbugger: has joined #ruby
[05:38:11] hays: has joined #ruby
[05:39:11] sidx64: has joined #ruby
[05:41:04] duderonomy: has joined #ruby
[05:43:29] jottr: has joined #ruby
[05:43:41] ferr: has joined #ruby
[05:47:41] jenrzzz: has joined #ruby
[05:49:37] duderonomy: has joined #ruby
[05:55:36] sleetdrop: has joined #ruby
[05:57:07] beilabs_: has joined #ruby
[06:11:23] iNs: has joined #ruby
[06:15:30] sauvin: has joined #ruby
[06:20:45] teclator_: has joined #ruby
[06:21:41] tuor: has joined #ruby
[06:27:27] ferr: has joined #ruby
[06:27:48] sidx64: has joined #ruby
[06:32:10] duderonomy: has joined #ruby
[06:39:25] duderonomy: has joined #ruby
[06:40:56] schleppel: has joined #ruby
[06:45:24] duderonomy: has joined #ruby
[06:46:39] aupadhye: has joined #ruby
[06:46:49] andikr: has joined #ruby
[06:47:11] Nicmavr: has joined #ruby
[06:53:33] Swyper: has joined #ruby
[06:55:09] HendrikPeter: has joined #ruby
[07:00:21] jenrzzz: has joined #ruby
[07:00:37] jottr: has joined #ruby
[07:02:34] clemens3_: has joined #ruby
[07:07:59] prestorium: has joined #ruby
[07:08:58] danielsju6: has joined #ruby
[07:10:26] mhlei: has joined #ruby
[07:13:07] szulak: has joined #ruby
[07:17:17] waheedi: has joined #ruby
[07:19:48] nowhereman: has joined #ruby
[07:20:30] powerbit: has joined #ruby
[07:24:49] ferr: has joined #ruby
[07:24:59] TomyWork: has joined #ruby
[07:27:14] xall_: has joined #ruby
[07:29:42] mangold: has joined #ruby
[07:31:04] HendrikPeter: has joined #ruby
[07:41:56] lxsameer: has joined #ruby
[07:43:53] DmitryBochkarev_: has joined #ruby
[07:53:45] TvL: has joined #ruby
[07:58:13] tuor: havenwood: thx for all your explanation. I went trew it again. I think I understand the idea, but I still don't understand what symbols exactly are and how they work.
[08:06:48] marz_d`ghostman: has joined #ruby
[08:07:48] marz_d`ghostman: In rails, it doesn't seem that running rails credentials:edit and saving it doesn't seem to be included when dockerizing it.
[08:08:02] marz_d`ghostman: How do I find the file so I can save it along in docker?
[08:18:13] ur5us: has joined #ruby
[08:19:23] Sylario: has joined #ruby
[08:19:58] marmotini_: has joined #ruby
[08:24:33] ur5us: has joined #ruby
[08:25:28] marmotini: has joined #ruby
[08:25:49] schleppel: has joined #ruby
[08:33:19] cisco: has joined #ruby
[08:36:57] alem0lars: has joined #ruby
[08:38:56] Ai9zO5AP: has joined #ruby
[08:41:52] ferr: has joined #ruby
[08:44:55] jenrzzz: has joined #ruby
[08:47:12] amfabaiste: has joined #ruby
[08:52:41] jottr: has joined #ruby
[09:05:23] sidx64: has joined #ruby
[09:10:12] am0123: has joined #ruby
[09:10:39] kyrylo: has joined #ruby
[09:11:27] tuor: has joined #ruby
[09:11:27] tuor: has joined #ruby
[09:16:16] marmotini_: has joined #ruby
[09:17:27] dar123: has joined #ruby
[09:35:04] sidx64: has joined #ruby
[09:39:03] wolfshappen_: has joined #ruby
[09:41:04] mangold: has joined #ruby
[09:49:50] hightower2: has joined #ruby
[09:56:03] dinfuehr: has joined #ruby
[10:07:08] doodlebug: has joined #ruby
[10:08:25] conta: has joined #ruby
[10:11:06] teclator_: has joined #ruby
[10:17:43] tuor: has joined #ruby
[10:17:43] tuor: has joined #ruby
[10:18:35] dinfuehr: has joined #ruby
[10:21:37] xco: has joined #ruby
[10:21:57] sidx64: has joined #ruby
[10:41:12] marmotini: has joined #ruby
[10:41:13] AJA4350: has joined #ruby
[10:45:07] jenrzzz: has joined #ruby
[10:51:49] marmotini_: has joined #ruby
[10:58:27] am0123: has joined #ruby
[11:02:07] marmotini: has joined #ruby
[11:05:57] jinie: has joined #ruby
[11:11:35] sidx64: has joined #ruby
[11:16:34] dviola: has joined #ruby
[11:17:06] kyrylo: has joined #ruby
[11:20:28] sidx64: has joined #ruby
[11:28:14] kyrylo: has joined #ruby
[11:36:48] ldnunes: has joined #ruby
[11:40:25] conta: has joined #ruby
[11:43:01] kyrylo: has joined #ruby
[11:46:04] mondz: has joined #ruby
[11:48:52] AJA4351: has joined #ruby
[11:56:50] kyrylo: has joined #ruby
[11:58:12] ljarvis: has joined #ruby
[11:59:57] hightower2: has joined #ruby
[12:14:53] AJA4350: has joined #ruby
[12:15:56] dinfuehr: has joined #ruby
[12:16:25] irdr: has joined #ruby
[12:17:26] marmotini_: has joined #ruby
[12:20:44] alem0lars_: has joined #ruby
[12:22:48] marmotini: has joined #ruby
[12:25:36] alem0lars: has joined #ruby
[12:34:23] kyrylo: has joined #ruby
[12:39:04] marmotini_: has joined #ruby
[12:46:32] jenrzzz: has joined #ruby
[12:51:30] mangold: has joined #ruby
[13:04:50] tuor: A symbol is an object which can be converted to a string or integer and is immutable. Is this all to know or are there other special things about symbols?
[13:09:48] fredolinhares: has joined #ruby
[13:11:00] phaul: :xxx is not allocated as an object but when first encountered put in the symbol table of the interpreter. It's never freed, invisible to garbage collection. It's a unique thing in the program, and object_id would match up even across programs
[13:11:21] phaul: therefore don't create symbolsdynamically, otherwise you leak memory
[13:13:21] phaul: that also means that while 'xxx'; 'xxx' allocated and grabage collects 2 times, :xxx ; :xxx would not do any of that
[13:15:24] kyrylo: has joined #ruby
[13:15:30] tuor: Ah ok. So when to use them? What it the purpose or why not just using strings?
[13:16:25] phaul: use them for unique values, that represent a thing in your program. :monday, :tuesday, :to_s, to_h, :+ etc.
[13:16:36] phaul: use string for text
[13:17:04] phaul: there is no :mondaytuesday, but there would be 'monday' + 'tuesday'
[13:22:52] tuor: OK. makes sense.
[13:23:15] pupsikov: has joined #ruby
[13:33:59] lucasb: has joined #ruby
[13:37:39] nowhereman: has joined #ruby
[13:38:49] mondz: has joined #ruby
[13:40:33] AJA4350: has joined #ruby
[13:45:30] nadir: has joined #ruby
[13:46:21] IGnorAND: https://gist.github.com/nuheluxulu/13de64b734ace5835ed4a121625776d9 WHy does it look like my response variable isn't getting set?
[13:50:22] jhass: to me it looks like the spec code you shared is not the same as the one that produced the output you shared
[13:50:48] jhass: if it were it would say "expected: 7" and "got: 0", not vice versa
[13:51:06] jhass: so make sure you saved your file?
[13:52:16] jhass: then regardless of that, note that code outside of it, describe, context, before and after blocks is run first and once
[13:52:38] jhass: the spec code is not run sequentially as it's written into the file
[13:52:56] jhass: so api_response will be the same value for both of your it blocks
[13:53:01] tuor: has joined #ruby
[13:54:19] jhass: oh wait, I got confused, you made the same typo in both of your it blocks
[13:54:27] jhass: so nvm regarding the wrong output
[13:54:41] jhass: it's just the second thing I mentioned
[13:56:02] jhass: you want to move your local variables inside your it blocks, or introduce more context blocks if you expect multiple specs with the same output and then use before blocks or let declarations inside
[13:57:31] Rapture: has joined #ruby
[14:00:15] polishdub: has joined #ruby
[14:04:16] IGnorAND: jhass: aah, I made different contexts for the cases
[14:04:42] Iarfen: has joined #ruby
[14:05:08] IGnorAND: parsing xml is harder than I thought, even with nokogiri
[14:06:16] conta: has joined #ruby
[14:08:23] dennis2: has joined #ruby
[14:09:43] fluxAeon_: has joined #ruby
[14:09:43] maxdoubt: has joined #ruby
[14:10:32] segy: has joined #ruby
[14:14:04] phaul: IGnorAND: I made some rewording of your code, I think this is more the rspec way : https://gist.github.com/phaul/ae0fcb5af62deb6de3bbdedfe9ee2b9e (I did not try to fix any issues you are having)
[14:14:13] moei: has joined #ruby
[14:17:52] IGnorAND: phaul: much appreciated, I changed the spec to reflect it with the issue fixed :)
[14:22:46] jobewan: has joined #ruby
[14:26:02] jobewan: has joined #ruby
[14:26:03] IGnorAND: phaul: I'd like to be more like the guy in this talk: He seems to make a distinction between subject, result and then do asserts on the result. I think I'm still miles away from that now though :)
[14:26:12] IGnorAND: https://www.youtube.com/watch?v=VD51AkG8EZw
[14:28:57] jobewan: has joined #ruby
[14:32:44] ellcs: has joined #ruby
[14:33:42] Blaguvest: has joined #ruby
[14:36:31] GodFather: has joined #ruby
[14:41:43] jobewan: has joined #ruby
[14:42:22] maryo: has joined #ruby
[14:46:41] sphenxes: has joined #ruby
[14:46:52] jenrzzz: has joined #ruby
[14:47:05] AJA4351: has joined #ruby
[14:49:29] kyrylo: has joined #ruby
[14:55:21] dennis2: thanks for the link to the talk, I'm learning to enhance my specs aswell :)
[14:57:24] Inline: has joined #ruby
[14:58:33] Renich: has joined #ruby
[14:59:16] asio: has joined #ruby
[15:00:09] cisco: has joined #ruby
[15:00:15] Swyper: has joined #ruby
[15:00:44] kyrylo: has joined #ruby
[15:00:52] DmitryBochkarev_: has joined #ruby
[15:02:24] IGnorAND: @dennis2 the problem becomes trying to do it :)
[15:09:57] i1nfusion: has joined #ruby
[15:13:48] i1nfusion: has joined #ruby
[15:16:57] UnknownSoldier: has joined #ruby
[15:21:01] aupadhye: has joined #ruby
[15:24:33] BTRE: has joined #ruby
[15:27:05] Paraxial: has joined #ruby
[15:29:46] SeepingN: has joined #ruby
[15:31:44] rippa: has joined #ruby
[15:35:31] jottr_: has joined #ruby
[15:38:16] AJA4351: has joined #ruby
[15:41:14] alem0lars: has joined #ruby
[15:43:46] ryouba: i'm trying to use Matrix for the first time
[15:43:49] ryouba: but it's confusing!
[15:43:59] ryouba: can somebody explain what is happening in https://gist.github.com/sixtyfive/040af73c64da2b2151f5fd1ca316ea2a ?
[15:44:16] ryouba: i.e. why the second command gives an Exception?
[15:44:32] IGnorAND: cool, looks like algebra :)
[15:45:33] phaul: I guess it doesn't have an inverse.
[15:46:28] ryouba: and i know zilch about algebra :(
[15:46:49] IGnorAND: I can't even find Matrix in my ruby
[15:47:11] ryouba: phaul: i've tried to find just *one* other Matrix that works with #inverse
[15:47:37] ryouba: IGnorAND: require 'matrix' ... but i'm on 2.6.1!
[15:47:47] phaul: determinant shouldn't be 0 iirc
[15:48:40] ryouba: phaul: even [[1,1],[1,1]] doesn't work ... no zeroes in there
[15:48:57] IGnorAND: ryouba: inv works here
[15:49:03] ryouba: (that's [[row1],[row2]], right?)
[15:49:29] ryouba: IGnorAND: with any of the examples i gave?
[15:49:32] phaul: ryouba: both your examples are not invertible.
[15:49:40] phaul: https://en.wikipedia.org/wiki/Invertible_matrix
[15:49:46] ryouba: ah! cool!
[15:50:23] ryouba: too bad there's no #invertible?
[15:50:33] IGnorAND: ryouba: https://gist.github.com/nuheluxulu/c104883b6844fce68eaa9a5713fa48b3
[15:50:59] mondz: has joined #ruby
[15:51:01] ryouba: IGnorAND: that's the example from the class docs. that one's working for me, too.
[15:51:02] phaul: ryouba: is there a #determinant ?
[15:51:18] IGnorAND: ryouba: so which are you trying?
[15:51:23] phaul: if so #invertible? == ! #determinant.zero?
[15:51:35] phaul: and being square and such
[15:51:41] ryouba: phaul: [[1,2],[3,4]] is invertible
[15:51:53] mondz: has joined #ruby
[15:51:57] Iarfen: has joined #ruby
[15:52:07] ryouba: phaul: yes, they have #determinant and also the short form #det
[15:52:59] IGnorAND: I see a singular?
[15:53:33] IGnorAND: A square matrix that is not invertible is called singular or degenerate.
[15:53:48] IGnorAND: Matrix[[1, 1], [1, 1]].singular?
[15:53:56] ryouba: lol, degenerate is a weird name
[15:54:43] IGnorAND: how come you people have such 'easy' problems :P
[15:54:51] IGnorAND: I must be programming wrong
[15:54:52] ryouba: and you guys would agree that the simple inverse of a matrix (such as we've been doing now) is a different thing from taking the moore-penrose "pseudoinverse" (https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse), right?
[15:55:02] ryouba: IGnorAND: my gf is in neuroscience
[15:55:12] IGnorAND: ryouba: ask your gf :P
[15:55:40] ryouba: well she's busy helping herself while i'm trying to find way to help her
[15:55:47] IGnorAND: ACTION just looked up matrix and inverse on wikipedia and die a .methods on the object to see what would fit :)
[15:57:22] IGnorAND: ryouba: it says its a generalization of the inverse matrix. So I guess x is a, but a is not x
[15:59:29] IGnorAND: ryouba: maybe this helps: https://github.com/SciRuby/nmatrix/commit/f3950b11b8189903f1d70c8012f1bd15e153cca4 - guess you need nmatrix
[16:02:19] ryouba: oooooooooooh cooooooooooooooooool
[16:02:32] ryouba: ACTION gets the gem
[16:05:59] ryouba: this is aaaaaaaaaaaaaawesome!!! the thing actually reads Matlab .mat files!
[16:12:01] IGnorAND: ryouba: have fun :)
[16:12:11] AJA4351: has joined #ruby
[16:12:54] Swyper: has joined #ruby
[16:15:26] i1nfusion: has joined #ruby
[16:17:01] xco: has joined #ruby
[16:18:02] mondz: has joined #ruby
[16:22:08] ellcs1: has joined #ruby
[16:28:12] ryouba: IGnorAND: having fun compiling fortran libraries needed for that #pinv ...
[16:28:38] IGnorAND: ryouba: hey, at least you have a roadmap of what to do now :)
[16:29:04] gix: has joined #ruby
[16:29:07] IGnorAND: I'm still struggling on figiring out if I write my code correctly by decoupling stuff or if I am overly complicating stuff :)
[16:29:16] ryouba: i'm so psyched because now i can implement the algorithm from my gf's prof's paper in Ruby instead of having to use Matlab, IGnorAND
[16:29:48] IGnorAND: ryouba: but shouldn't she have already done it in matlab?
[16:29:53] ryouba: if your code has more than 200 lines i would say go and learn what you need to know to be able to decouple it. your future you will thank you.
[16:30:26] ryouba: IGnorAND: yes, she has. but it's giving bogus results. and i'm trying to help but my head keeps threating to explode because matlab is so godforsakenly stupid.
[16:30:33] ryouba: threatening*
[16:31:14] wallace_mu: has joined #ruby
[16:33:20] IGnorAND: ryouba: I'm trying to follow sandi metz with her 100 lines per class, 5 lines per method, 4 params per method, 1 instance variables per view, 2 class names per controller action
[16:34:36] ryouba: oh i've never heard of her ... *googles*
[16:34:37] tdy: has joined #ruby
[16:35:00] ryouba: they sound like nice approximate numbers
[16:35:06] ryouba: what's your problem with that method?
[16:35:12] ryouba: are you following it too religiously?
[16:35:50] krawchyk: has joined #ruby
[16:36:17] nowhereman: has joined #ruby
[16:36:36] IGnorAND: ryouba: no method issues. more like am I doing this right in terms of classes :)
[16:37:04] IGnorAND: I want to make a library to call stuff from namecheap: https://www.namecheap.com/support/api/methods/domains/get-list.aspx
[16:37:29] IGnorAND: so I made a command class with a subclass for every api call.
[16:37:41] ryouba: IGnorAND: in case you ever want to play with nmatrix, too, heed https://stackoverflow.com/questions/18828730/lapack-linking-error-recompile-with-fpic and compile LAPACK with -fPIC
[16:37:43] IGnorAND: now I need a response class with a subclass for every type of response
[16:38:07] IGnorAND: @ryouba I havent touched calculus or algebra in > 10 years
[16:38:07] ryouba: IGnorAND: by method i meant sandi metz's method(ology)
[16:38:26] ryouba: well you never know
[16:38:37] IGnorAND: @ryouba how old are you if I may ask?
[16:38:39] ryouba: i'm trying to do this and i just *barely* got my A-levels in math back then
[16:38:48] IGnorAND: same age :)
[16:39:51] havenwood: ACTION tugs on his grey beard with tired eyes
[16:40:00] Swyper: has joined #ruby
[16:40:13] IGnorAND: anyway, since I have a cmd and a response for every method in the api, I think I should name the classes cmd_method_name and rsp_method_name or method_name_rsp and method_name_cmd
[16:40:36] ryouba: anyways, one thing i've learned about myself when it comes to designing larger scripts (i.e. large enough to require classes): coming up with a class structure beforehand never works. i have to make the bare minimum functionality work and introduce classes as needed, then take a step back and see if what i did makes sense, then re-design from an eagle's eye perspective on paper, then remodel/refactor as needed.
[16:40:39] IGnorAND: havenwood: well, you ussually have good answers for my questions, so you must be like gandalf :)
[16:40:51] ryouba: havenwood: but unlike us, you have gained wisdom
[16:41:50] IGnorAND: ryouba: I'd like to rubber duck program with you sometime. I think I keep trying to design first, and then crash
[16:43:55] IGnorAND: ryouba: sandi metz also explains you cannot design beforehand, just get it to work, make your tests green, and as you continue look up code smells and refactor
[16:44:44] IGnorAND: https://github.com/Havenwood that beard isn't grey!
[16:45:07] AJA4351: has joined #ruby
[16:45:36] ryouba: hey the duck's supposed to sit ON your screen, not inside of it ;)
[16:46:13] ryouba: ACTION also has never gotten into TDD and might not be a good source of information for that reason alone
[16:46:18] IGnorAND: ryouba: my english is bad :P
[16:46:30] IGnorAND: ryouba: so we make mistakes together :)
[16:47:13] jenrzzz: has joined #ruby
[16:56:49] houhoulis: has joined #ruby
[17:02:57] nowhereman: has joined #ruby
[17:11:10] krawchyk_: has joined #ruby
[17:15:04] jobewan: has joined #ruby
[17:16:01] fanta7531: has joined #ruby
[17:16:19] pupsikov: has joined #ruby
[17:20:37] am0123: has joined #ruby
[17:24:44] orbyt_: has joined #ruby
[17:25:30] jcarl43: has joined #ruby
[17:25:30] cd: has joined #ruby
[17:26:57] Nicmavr: has joined #ruby
[17:30:15] duderonomy: has joined #ruby
[17:30:21] jenrzzz: has joined #ruby
[17:38:21] ramfjord: has joined #ruby
[17:46:24] nowhereman: has joined #ruby
[17:52:37] IGnorAND: Would you do a raise 'domain name too long' unless @domain_name <=70 for https://www.namecheap.com/support/api/methods/domains/get-info.aspx
[17:56:02] AJA4351: has joined #ruby
[17:58:12] lunarkitty7: has joined #ruby
[17:58:19] jottr: has joined #ruby
[18:02:44] duderonomy: has joined #ruby
[18:08:05] baweaver: IGnorAND: The thing to remember about Metz's rules are that they're not a hard and fast law
[18:08:23] baweaver: They were designed to give constraints to people who wanted them as an arbitrary guideline of what to pursue
[18:08:48] baweaver: Artificially refactoring your code to hit those numbers may be counter-intuitive
[18:09:01] am0123: has joined #ruby
[18:12:00] IGnorAND: @baweaver law would be a string word. I'd think of guidelines
[18:12:17] baweaver: Yeah, that's what I'd keep in mind in general :)
[18:12:27] baweaver: They're good guidelines in general
[18:12:36] baweaver: just some folks take them very religiously and get carried away.
[18:12:43] IGnorAND: but I have weird questions coming from static typed langues
[18:13:13] baweaver: Have you read her book, Practical Object Oriented Design in Ruby?
[18:13:43] IGnorAND: @baweaver I'm somewhere with a bycicle with spare parts, I think about halfway through
[18:14:16] baweaver: It's a pretty good book
[18:14:19] IGnorAND: I'm trying to initialize all my classes with a hash
[18:14:26] baweaver: Typically I recommend it and Eloquent Ruby
[18:14:42] IGnorAND: trying to do the post_initialize_hook for subclasses
[18:15:02] IGnorAND: but I'm writing rails, or at least I think I was, but I somehow got all the way too plain ruby
[18:15:14] bokwoon: has joined #ruby
[18:15:38] IGnorAND: Russ Olsen?
[18:19:24] bokwoon: has joined #ruby
[18:24:44] tdy: has joined #ruby
[18:27:07] lxsameer: has joined #ruby
[18:28:20] bokwoon: has joined #ruby
[18:30:15] bokwoon: has joined #ruby
[18:31:30] mkroman: has joined #ruby
[18:33:54] bokwoon: has joined #ruby
[18:37:15] doodleb77: has joined #ruby
[18:41:19] maryo: has joined #ruby
[18:45:46] jenrzzz: has joined #ruby
[18:47:43] theunraveler: has joined #ruby
[18:49:53] mondz: has joined #ruby
[18:50:16] Dbugger: has joined #ruby
[18:50:48] jenrzzz: has joined #ruby
[18:51:36] Azure: has joined #ruby
[18:53:28] kyrylo: has joined #ruby
[18:54:23] orbyt_: has joined #ruby
[18:57:14] ramfjord_: has joined #ruby
[19:01:15] doodleb53: has joined #ruby
[19:01:21] AJA4351: has joined #ruby
[19:01:37] krawchyk: has joined #ruby
[19:03:16] orbyt_: has joined #ruby
[19:06:46] dar123: has joined #ruby
[19:07:16] doodlebug: has joined #ruby
[19:20:47] nowhereman: has joined #ruby
[19:25:57] SeepingN: has joined #ruby
[19:30:41] polishdub: has joined #ruby
[19:36:02] AJA4351: has joined #ruby
[19:39:32] dsmythe: has joined #ruby
[19:42:23] zachk: has joined #ruby
[19:47:47] ellcs1: has joined #ruby
[19:57:25] orbyt_: has joined #ruby
[19:59:44] Mia: has joined #ruby
[19:59:44] Mia: has joined #ruby
[20:00:04] fredolinhares: has joined #ruby
[20:00:07] am0123: has joined #ruby
[20:07:05] ramfjord: has joined #ruby
[20:16:57] am0123: has joined #ruby
[20:19:20] i1nfusion: has joined #ruby
[20:22:47] maryo: has joined #ruby
[20:26:25] Swyper: has joined #ruby
[20:26:57] orbyt_: has joined #ruby
[20:46:37] orbyt_: has joined #ruby
[20:52:27] themsay: has joined #ruby
[20:58:47] duderonomy: has joined #ruby
[20:59:20] noizex: has joined #ruby
[21:07:09] ur5us: has joined #ruby
[21:14:10] Fernando-Basso: has joined #ruby
[21:16:56] Emmanuel_Chanel: has joined #ruby
[21:17:17] jinie: has joined #ruby
[21:20:15] Stan: has joined #ruby
[21:26:58] Emmanuel_Chanel: has joined #ruby
[21:28:09] hightower2: has joined #ruby
[21:31:24] pupsikov: has joined #ruby
[21:36:09] wallace_mu: has left #ruby: ()
[21:39:02] gigetoo: has joined #ruby
[21:39:40] Emmanuel_Chanel: has joined #ruby
[21:39:57] barg: has joined #ruby
[21:43:07] barg: how would a program like vnc send data to and fro, the mouse coordinates from client to server, and the screen from server to client? would it use a refresh every like half a second so the client does a POST with coordinates and gets the screen sent back. Or would it use websockets?
[21:43:44] d10n-work: has joined #ruby
[21:45:25] miah: barg: https://en.wikipedia.org/wiki/RFB_protocol
[21:46:38] ellcs1: has joined #ruby
[21:51:26] barg: thanks. I want to write a simple program not like VNC, but you'd have two users, each user is presented with two textboxes. One textbox , the user types into. The other textbox, will display what the other user has typed. How would one go about doing that?
[21:51:52] barg: like, in terms of sending data, what protocol would you suggest?
[21:52:28] tarptaeya: has left #ruby: ("Leaving...")
[21:53:34] jhass: in a browser websocket makes sense
[21:53:49] dsmythe: has joined #ruby
[21:53:57] SCHAPiE: has joined #ruby
[21:55:39] barg: ok, what about if not in a browser?
[21:55:57] IGnorAND: barg: there is something called sockets. I think rails does this with cable or something
[21:56:13] barg: yeah rails actioncable uses websockets. But what about if not in a browser?
[21:56:30] IGnorAND: don't think it matters
[21:56:36] IGnorAND: a socket is a socket
[21:56:55] jhass: a socket is a socket but not a websocket
[21:57:03] jhass: websocket is protocol on top of http
[21:57:14] IGnorAND: require 'socket'
[21:57:23] jhass: a plain socket is either TCP or UDP
[21:57:32] barg: hmm, I hadn't thought about connecting to a railis server without using a web browser
[21:57:43] jhass: you really don't need rails here
[21:58:29] jhass: the next question you need to answer here is whether you want to work peer to peer or peer to server to peer
[21:58:54] IGnorAND: https://www.tutorialspoint.com/ruby/ruby_socket_programming.htm looks like it explains
[21:59:16] jhass: do you have two clients connecting to a server or two clients connecting to each other
[22:00:23] havenwood: another question is whether it's Ruby on both ends?
[22:00:39] dsmythe_: has joined #ruby
[22:03:42] JawJack: has joined #ruby
[22:04:29] IGnorAND: I have a person has_many :organizations, through: :employments and organization has_many :employees, through: :employments. This results in Organization.first.employees.first being a person. It seems to make more sense to call Organization.first.employments.first and add functions such as wages etc there. My naming is screwed I think
[22:05:04] havenwood: barg: it might be "fun" to use DRb (distributed Ruby) from the stdlib
[22:08:11] dar123: has joined #ruby
[22:08:20] orbyt_: has joined #ruby
[22:13:11] Swyper: has joined #ruby
[22:15:17] barg: jhass: yeah i've been considering both possibilities, maybe one version they connect directly, and another versoin there is a server in between
[22:15:38] barg: havenwood: yeah would be ruby on both ends
[22:16:03] jhass: for client to client you need to pick one of them to be the server and the other connect to it
[22:16:14] barg: yeah i know
[22:18:45] havenwood: barg: that reminds me of sudo_pair: https://github.com/square/sudo_pair#sudo_pair
[22:20:13] havenwood: barg: here's a ten-year-old example of a simple TCP server/client chat: https://gist.github.com/sirupsen/628372/cc5c76efd77afec4b45abfee8139fc93f40c7111
[22:20:53] dsmythe: has joined #ruby
[22:26:12] orbyt_: has joined #ruby
[22:43:27] Swyper: has joined #ruby
[22:48:24] doodlebug: has joined #ruby
[22:50:41] Calinou: has joined #ruby
[22:51:05] also_uplime: has joined #ruby
[22:52:40] jhass: has joined #ruby
[23:00:23] doodleb81: has joined #ruby
[23:00:35] mondz: has joined #ruby
[23:01:51] dsmythe: has joined #ruby
[23:07:51] duderonomy: has joined #ruby
[23:08:45] segy: has joined #ruby
[23:17:28] garyserj: has joined #ruby
[23:17:42] dar123: has joined #ruby
[23:18:25] doodlebug: has joined #ruby
[23:19:32] Calinou: has joined #ruby
[23:25:28] mondz: has joined #ruby
[23:26:01] amfabaiste: has joined #ruby
[23:27:59] Emmanuel_Chanel: has joined #ruby
[23:27:59] mhlei: has joined #ruby
[23:27:59] iMadper: has joined #ruby
[23:27:59] x0F: has joined #ruby
[23:27:59] priodev: has joined #ruby
[23:27:59] aspiers: has joined #ruby
[23:27:59] Bish: has joined #ruby
[23:27:59] graft: has joined #ruby
[23:27:59] larissa: has joined #ruby
[23:27:59] LenPayne: has joined #ruby
[23:27:59] cuplime: has joined #ruby
[23:27:59] reaVer: has joined #ruby
[23:27:59] Koshian: has joined #ruby
[23:27:59] jmosco: has joined #ruby
[23:27:59] alnk: has joined #ruby
[23:29:52] bambanx: has joined #ruby
[23:30:22] rafadc: has joined #ruby
[23:31:46] troulouliou_div2: has joined #ruby
[23:41:10] IGnorAND: how do I force ruby to divide but give me a double instead of an integer
[23:42:17] IGnorAND: all I see is .to_f
[23:44:18] jenrzzz: has joined #ruby
[23:47:58] Swyper: has joined #ruby
[23:48:42] brool: has joined #ruby
[23:49:20] DmitryBochkarev_: has joined #ruby
[23:51:02] Swyper: has joined #ruby
[23:53:02] Swyper: has joined #ruby
[23:58:23] i1nfusion: has joined #ruby
[23:58:54] wolfshappen: has joined #ruby