ngw

Activity Graph

Page 1 of 2 | Next »

2019-07-15

[14:43:18] ngw: has joined #ruby
[14:45:31] ngw: Client Quit
[14:45:59] ngw: has joined #ruby
[14:46:43] ngw: hi, generic question but help highly appreciated: how can I make this faster? https://gist.github.com/ngw/54a544b7f9dcd8964d7d27ae84c754ac
[14:47:01] ngw: especially if the file is big
[16:27:34] ngw: havenwood: actually I'm an idiot, I was trying the code in irb and didn't realize that 99% of the problem was outputting the results...
[16:27:57] ngw: the file is around 400k lines, takes less than 3s
[16:28:07] ngw: totally acceptable
[16:52:26] ngw: Quit: WeeChat 2.5

2019-07-08

[01:13:12] ngw: Quit: WeeChat 2.4

2019-07-07

[17:06:56] ngw: has joined #ruby
[17:10:22] ngw: I can't solve this exercise https://gist.github.com/ngw/9814e04ac4cc1de08b0b10bf2742eca9
[17:10:34] ngw: I got that far, but I'm stuck on the neighbours...
[17:11:30] ngw: it's already > 1 hour I'm messing around but I guess I'm stuck :(
[17:11:38] ngw: can someone give me a hand?
[17:12:13] ngw: the problem is in calculate_neighbours(x:, y:)
[17:13:08] ngw: best result I got till now is that it miscalculates the borders
[17:18:18] ngw: just pasted the "almost correct" version
[17:22:29] ngw: omg, I got it... when index is 0 and I do -1 it goes to the last line on the other side

2019-05-31

[08:50:58] ngw: has joined #ruby
[11:49:38] ngw: Ping timeout: 272 seconds
[11:58:18] ngw: has joined #ruby
[13:17:29] ngw: Read error: Connection reset by peer
[13:20:11] ngw: has joined #ruby
[14:03:21] ngw: Quit: WeeChat 2.4

2019-05-30

[16:19:33] ngw: has joined #ruby
[16:20:07] ngw: how would you refactor this puddle of filth? https://gist.github.com/ngw/2773fa496dd5de57b36e5d3d5f95f77e
[16:20:33] ngw: I'm under the impression there's a better way to do that
[16:21:35] ngw: where exactly @adam12?
[16:22:00] ngw: @result is an instance var I initialize as empty hash in the initializer
[16:29:02] ngw: not sure I understand `Hash.new { |h, key| h[key] = Hash.new(0) }`, what would be in h and key?
[16:31:28] ngw: MAGIC! adam12 thanks!
[16:32:27] ngw: my understanding is that it says whatever is in [whatever][whatever] is 0, is this correct?
[16:32:35] ngw: didn't know I could do that
[16:32:38] ngw: thanks!
[16:35:13] ngw: well because I need to know page_url AND ip
[16:36:08] ngw: the final hash looks like {page_url => { ip1 => 3 visits, ip2 => 1 visit}}
[16:36:57] ngw: I'm parsing a file that is lines of "url ip"
[16:37:07] ngw: oh I see what you mean
[17:47:16] ngw: Ping timeout: 272 seconds
[17:52:43] ngw: has joined #ruby
[17:57:24] ngw: Ping timeout: 272 seconds
[18:02:55] ngw: has joined #ruby
[18:07:20] ngw: Ping timeout: 258 seconds
[18:23:08] ngw: has joined #ruby
[18:27:48] ngw: Ping timeout: 272 seconds
[18:33:34] ngw: has joined #ruby
[18:37:52] ngw: Ping timeout: 246 seconds
[18:43:45] ngw: has joined #ruby
[18:48:20] ngw: Ping timeout: 268 seconds
[19:03:37] ngw: has joined #ruby
[19:08:17] ngw: Ping timeout: 258 seconds
[19:24:13] ngw: has joined #ruby
[19:28:36] ngw: Ping timeout: 258 seconds
[19:44:33] ngw: has joined #ruby
[19:49:30] ngw: Ping timeout: 272 seconds
[19:55:05] ngw: has joined #ruby
[19:59:25] ngw: Ping timeout: 246 seconds
[20:05:18] ngw: has joined #ruby
[20:10:24] ngw: Ping timeout: 272 seconds
[20:25:18] ngw: has joined #ruby
[20:30:02] ngw: Ping timeout: 272 seconds
[20:46:50] ngw: has joined #ruby
[20:51:13] ngw: Ping timeout: 246 seconds
[20:57:08] ngw: has joined #ruby
[21:01:42] ngw: Ping timeout: 272 seconds
[21:17:04] ngw: has joined #ruby
[21:21:41] ngw: Ping timeout: 258 seconds
[21:37:33] ngw: has joined #ruby
[21:41:41] ngw: Ping timeout: 244 seconds

2019-05-03

[15:20:31] ngw: has joined #ruby
[15:21:34] ngw: I'm looking at elasticsearch-api, differente versions of the library support different versions of the server, how to support more than one version in a library/service?
[15:21:48] ngw: what an exceptionally weird design choice...
[16:28:17] ngw: Quit: WeeChat 2.4

2019-04-30

[00:06:40] ngw: has joined #ruby
[00:10:52] ngw: Ping timeout: 245 seconds
[00:26:56] ngw: has joined #ruby
[00:31:12] ngw: Ping timeout: 246 seconds
[00:37:21] ngw: has joined #ruby
[00:41:28] ngw: Ping timeout: 246 seconds
[00:47:27] ngw: has joined #ruby
[00:51:48] ngw: Ping timeout: 250 seconds
[01:07:21] ngw: has joined #ruby
[01:11:27] ngw: Ping timeout: 244 seconds
[01:27:33] ngw: has joined #ruby
[01:31:45] ngw: Ping timeout: 246 seconds
[01:47:47] ngw: has joined #ruby
[01:52:02] ngw: Ping timeout: 250 seconds
[02:07:53] ngw: has joined #ruby
[02:12:19] ngw: Ping timeout: 258 seconds
[02:28:17] ngw: has joined #ruby
[02:32:46] ngw: Ping timeout: 250 seconds
[02:48:31] ngw: has joined #ruby
[02:52:57] ngw: Ping timeout: 258 seconds
[03:08:44] ngw: has joined #ruby
[03:12:52] ngw: Ping timeout: 244 seconds
[03:28:49] ngw: has joined #ruby
[03:33:17] ngw: Ping timeout: 255 seconds
[03:39:25] ngw: has joined #ruby
[03:43:42] ngw: Ping timeout: 246 seconds
[03:49:32] ngw: has joined #ruby
[03:53:54] ngw: Ping timeout: 258 seconds
[04:09:26] ngw: has joined #ruby
[04:13:47] ngw: Ping timeout: 245 seconds
[04:29:42] ngw: has joined #ruby
[04:34:06] ngw: Ping timeout: 250 seconds
[04:49:51] ngw: has joined #ruby
[04:54:10] ngw: Ping timeout: 246 seconds
[05:07:37] ngw: has joined #ruby
[05:12:14] ngw: Ping timeout: 250 seconds
[08:32:26] ngw: has joined #ruby
[09:56:52] ngw: Quit: WeeChat 2.4

2019-04-29

[14:20:35] ngw: has joined #ruby
[14:21:49] ngw: hi *, is there an easy way to parse multipart data in plain ruby? I know Rack has the code for doing that but I'm building an AWS lambda, I feel silly requiring Rack for nothing
[14:30:09] ngw: I won't die I guess if I use Rack
[14:30:21] ngw: just hoped for something easier
[14:39:06] ngw: eh, it's quite out of scope with what I'm doing, I hate helpers/libs when completely out of scope with the project
[17:12:35] ngw: Ping timeout: 258 seconds
[19:07:05] ngw: has joined #ruby
[19:11:25] ngw: Ping timeout: 258 seconds
[19:48:46] ngw: has joined #ruby
[19:53:04] ngw: Ping timeout: 246 seconds
[20:04:50] ngw: has joined #ruby
[20:09:14] ngw: Ping timeout: 268 seconds
[20:27:03] ngw: has joined #ruby
[20:31:17] ngw: Ping timeout: 245 seconds
[20:47:16] ngw: has joined #ruby
[20:51:47] ngw: Ping timeout: 268 seconds
[21:07:38] ngw: has joined #ruby
[21:11:43] ngw: Ping timeout: 244 seconds
[21:24:49] ngw: has joined #ruby
[21:29:14] ngw: Ping timeout: 255 seconds
[21:45:07] ngw: has joined #ruby
[21:49:22] ngw: Ping timeout: 250 seconds
[22:05:12] ngw: has joined #ruby
[22:09:44] ngw: Ping timeout: 250 seconds
[22:25:37] ngw: has joined #ruby
[22:29:59] ngw: Ping timeout: 255 seconds
[22:45:45] ngw: has joined #ruby
[22:50:03] ngw: Ping timeout: 246 seconds
[23:05:51] ngw: has joined #ruby
[23:10:07] ngw: Ping timeout: 246 seconds
[23:26:02] ngw: has joined #ruby
[23:30:28] ngw: Ping timeout: 245 seconds
[23:46:27] ngw: has joined #ruby
[23:50:42] ngw: Ping timeout: 250 seconds

2019-04-01

[16:19:06] ngw: has joined #ruby
[16:20:27] ngw: hello *, I'm struggling with a problem that I guess is quite easy: I'm using a node.js module to encrypt some variables with Aws kms, variables that I want to decrypt using ruby and obviously the aws-kms module
[16:22:05] ngw: I can see everything is happening here: https://github.com/nordcloud/serverless-kms-secrets/blob/master/index.js#L81-L94
[16:22:40] ngw: I'm not sure what that `Buffer.from` is in Node.js and how to emulate it in Ruby, but unfortunately I can't make it work
[16:23:20] ngw: The whole thing is summarized in https://stackoverflow.com/questions/55168878/decrypting-keys-from-aws-kms-in-ruby if someone wants some reputation points on SO
[16:26:39] ngw: omg what an idiot I am
[16:27:15] ngw: Quit: WeeChat 2.4

2019-03-15

[15:09:55] ngw: has joined #ruby
[15:10:37] ngw: does anybody have any idea how to solve this? https://stackoverflow.com/questions/55168878/decrypting-keys-from-aws-kms-in-ruby
[15:10:44] ngw: I'm losing my mind on it
[15:38:40] ngw: Quit: WeeChat 2.4

2019-02-15

[00:04:16] ngw: has joined #ruby
[00:08:48] ngw: Ping timeout: 258 seconds
[00:24:06] ngw: has joined #ruby
[00:28:44] ngw: Ping timeout: 258 seconds
[00:43:56] ngw: has joined #ruby
[00:48:17] ngw: Ping timeout: 258 seconds
[01:03:38] ngw: has joined #ruby
[01:07:58] ngw: Ping timeout: 245 seconds
[01:23:28] ngw: has joined #ruby
[01:27:58] ngw: Ping timeout: 245 seconds
[01:43:28] ngw: has joined #ruby
[01:47:58] ngw: Ping timeout: 245 seconds
[02:03:22] ngw: has joined #ruby
[02:07:56] ngw: Ping timeout: 250 seconds
[02:23:10] ngw: has joined #ruby
[02:27:34] ngw: Ping timeout: 258 seconds
[02:43:03] ngw: has joined #ruby
[02:47:36] ngw: Ping timeout: 268 seconds
[03:02:52] ngw: has joined #ruby
[03:07:16] ngw: Ping timeout: 244 seconds
[03:22:45] ngw: has joined #ruby
[03:26:57] ngw: Ping timeout: 246 seconds
[03:42:37] ngw: has joined #ruby
[03:47:25] ngw: Ping timeout: 268 seconds
[04:02:31] ngw: has joined #ruby
[04:06:51] ngw: Ping timeout: 258 seconds
[04:22:20] ngw: has joined #ruby
[04:26:36] ngw: Ping timeout: 250 seconds
[04:42:11] ngw: has joined #ruby
[04:46:24] ngw: Ping timeout: 246 seconds
[05:01:52] ngw: has joined #ruby
[05:06:58] ngw: Ping timeout: 268 seconds
[05:21:52] ngw: has joined #ruby
[05:26:42] ngw: Ping timeout: 268 seconds
[05:41:46] ngw: has joined #ruby
[05:46:08] ngw: Ping timeout: 258 seconds
[09:46:51] ngw: has joined #ruby
[09:53:34] ngw: Quit: WeeChat 2.3
[12:30:09] ngw: has joined #ruby
[12:41:13] ngw: I hate having to find configurations and other assets using __FILE__ and by dealing with a million of ../../.., do you set a project root inside .env of what other improvements you do?
[13:34:20] ngw: Ping timeout: 250 seconds
[13:59:54] ngw: has joined #ruby
[15:14:01] ngw: Quit: WeeChat 2.3

2019-02-14

[17:37:45] ngw: has joined #ruby
[17:38:32] ngw: I wanted to see an example of a library that wraps some kind of client to see how the client is actually used
[17:40:13] ngw: for example: client to elasticsearch, with a set of specific objects "under" it that know a lot about the structure of the indexes and such, so basically I have an object Index that needs a client to be executed, but whose logic is all inside the Index object
[17:41:04] ngw: basically when I call Index.create or something like that it turns into a call to a client that parforms a parametrized call somewhere
[17:41:49] ngw: I don't know if I've been clear, I don't think so :)
[17:47:25] ngw: only example, it's something that is gonna run on AWS lambda
[17:47:39] ngw: I'm wrapping Elasticsearch
[17:47:53] ngw: the client will basically be the elasticsearch client
[17:48:10] ngw: from gem elasticsearch-api
[17:49:12] ngw: yes that is something I was thinking a lot about, inheritance vs composition
[17:49:27] ngw: IMVHO inheritance is perfectly viable here
[17:51:04] ngw: second example makes perfect sense too, considering everything is on lambda I couldn't care less of initializing a client every time I call an object
[17:51:10] ngw: bookmarked
[17:57:01] ngw: Ping timeout: 244 seconds
[19:36:57] ngw: has joined #ruby
[19:41:06] ngw: Ping timeout: 246 seconds
[20:14:26] ngw: has joined #ruby
[20:19:06] ngw: Ping timeout: 268 seconds
[20:42:22] ngw: has joined #ruby
[20:46:47] ngw: Ping timeout: 258 seconds
[21:02:21] ngw: has joined #ruby
[21:06:27] ngw: Ping timeout: 240 seconds
[21:22:21] ngw: has joined #ruby
[21:27:02] ngw: Ping timeout: 258 seconds
[21:42:19] ngw: has joined #ruby
[21:46:38] ngw: Ping timeout: 250 seconds
[22:02:19] ngw: has joined #ruby
[22:07:01] ngw: Ping timeout: 268 seconds
[22:24:58] ngw: has joined #ruby
[22:29:13] ngw: Ping timeout: 245 seconds
[22:44:48] ngw: has joined #ruby
[22:49:02] ngw: Ping timeout: 250 seconds
[23:04:40] ngw: has joined #ruby
[23:09:00] ngw: Ping timeout: 246 seconds
[23:24:23] ngw: has joined #ruby
[23:28:54] ngw: Ping timeout: 250 seconds
[23:44:25] ngw: has joined #ruby
[23:49:23] ngw: Ping timeout: 268 seconds

2019-02-13

[17:26:01] ngw: hello *
[17:26:58] ngw: I'm unsure on how to cleanly have a huge chunk of data in a class. This data is basically static (Elasticsearch index definition) and is basically a normal Hash
[17:28:00] ngw: I'm fiddling with the idea of having an external configuration file that I just load, but I'm 'stopped' by the fact that in the end it's just an Hash, and I'd need to save the conf as json/yaml
[17:28:33] ngw: I'm really very anal right now, but wanted to hear someone elses pov
[17:50:31] ngw: Quit: WeeChat 2.3