00:02:12  <noffle>streams Q: I have a transform stream that, per byte read, write 8000 bytes. sure enough stream.push() returns false, indicating the next stream's buffer is full and writing should stop. so like a good citizen I do. however, transform streams don't seem to emit 'drain' events like writeable streams. I'm reading the node stream docs, but haven't puzzled out yet how to handle backpressure here.
00:05:18  <jfhbrook>noffle, I'm pretty clueless about modern streams, but maybe one of those transform stream modules, like through2, would help bridge the gap?
00:05:50  <noffle>jfhbrook: appreciated, but I'm really keen on closing this gap in my understanding of streams :)
00:05:58  <jfhbrook>yeah I feel you
00:06:01  <jfhbrook>good luck!
00:06:25  <jfhbrook>I'm all about cursor implementations these days over object streams
00:06:38  <jfhbrook>speaking of, any y'all fuck with redis cursors? the API is kinda hilarious
00:06:50  <jfhbrook>so like if you want to do a scan of all keys in redis, you start with
00:06:56  <jfhbrook>scan 0
00:07:07  <jfhbrook>and it's like, [ 31, [ 'some', 'keys' ] ]
00:07:20  <jfhbrook>where 31 is (to you) a seemingly-arbitrary number
00:07:22  <jfhbrook>so you call
00:07:23  <jfhbrook>scan 31
00:07:28  <jfhbrook>and get another similar result back
00:07:36  <jfhbrook>and you keep playing this choose-your-own-adventure until you get
00:07:44  <jfhbrook>[ 0, [ 'the', 'rest', 'of', 'the', 'keys' ]]
00:08:02  <jfhbrook>To get more keys, turn to page 31
00:12:28  <mafintosh>noffle: the transform stream will handle it for you
00:12:54  <mafintosh>noffle: it won't call ._transform again until the readable buffer is < HWM
00:13:07  <noffle>mafintosh: where does the extra data I write past what stream.push() wanted *go*?
00:13:20  <noffle>pipe() just puts it somewhere?
00:13:40  <mafintosh>noffle: it goes in a buffer
00:13:50  <mafintosh>noffle: (._readableState.buffer i think)
00:14:07  <noffle>okay, cool
00:14:59  <noffle>I'm suspecting that I'm not doing the wrong thing here then. maybe node-speaker is just not throttling itself when I oversaturate it with samples
00:19:17  * PsionTheoryquit (Remote host closed the connection)
00:32:21  <mikolalysenko>streams are good when you want to handle backpressure
00:32:43  <mikolalysenko>which is the case in many situations
00:33:05  <mikolalysenko>but they are also very complicated and not always the best solution
00:33:31  <jfhbrook>right, and a lot of times I'm dealing with discrete http requests and a cursor.next(function(err, nextThing) { kinda situation
00:33:55  <mikolalysenko>if you are going to buffer the whole result anyway, then a stream makes no sense
00:34:18  <jfhbrook>I mean, I'm not doing cursor.asArray( here
00:34:25  <jfhbrook>(these are all mongodb-native apis I'm using here)
00:35:06  <jfhbrook>redis scan is more like, var idx = '0'; redis.scan(idx, function(err, data) { idx = data[0];
00:57:02  * contrahaxquit (Quit: Sleeping)
00:59:47  * contrahaxjoined
01:30:52  * contrahaxquit (Quit: Sleeping)
01:33:48  * contrahaxjoined
01:36:06  * pfrazejoined
02:34:30  * contrahaxquit (Quit: Sleeping)
02:40:29  * pfrazequit (Remote host closed the connection)
02:49:50  * pfrazejoined
03:12:45  * contrahaxjoined
04:11:39  * tobiequit (Ping timeout: 260 seconds)
04:11:39  * daviddiasquit (Ping timeout: 260 seconds)
04:11:39  * mikolalysenkoquit (Ping timeout: 260 seconds)
04:11:39  * karissaquit (Ping timeout: 260 seconds)
04:12:15  * jhieseyquit (Ping timeout: 260 seconds)
04:12:49  * rom1504quit (Ping timeout: 260 seconds)
04:12:49  * grncdrquit (Ping timeout: 260 seconds)
04:12:49  * eugenewarequit (Ping timeout: 260 seconds)
04:12:49  * machtyquit (Ping timeout: 260 seconds)
04:12:49  * jlordquit (Ping timeout: 260 seconds)
04:12:51  * karissajoined
04:13:23  * indexzeroquit (Ping timeout: 260 seconds)
04:13:24  * tmpvarquit (Ping timeout: 260 seconds)
04:13:24  * nrwquit (Ping timeout: 260 seconds)
04:13:24  * mmckeggquit (Ping timeout: 260 seconds)
04:13:24  * addisonjquit (Ping timeout: 260 seconds)
04:13:24  * perlbotquit (Ping timeout: 260 seconds)
04:13:36  * rom1504joined
04:14:07  * perlbotjoined
04:16:39  * tmpvarjoined
04:16:39  * indexzerojoined
04:17:14  * addisonjjoined
04:17:38  * nrwjoined
04:17:38  * mmckeggjoined
04:17:51  * grncdrjoined
04:18:23  * eugenewarejoined
04:18:27  * dlmanning_joined
04:19:01  * tobiejoined
04:19:09  * parshapquit (Ping timeout: 260 seconds)
04:19:10  * lachenmayerquit (Ping timeout: 260 seconds)
04:19:10  * dlmanningquit (Excess Flood)
04:19:13  * dlmanning_changed nick to dlmanning
04:19:18  * substackquit (Ping timeout: 263 seconds)
04:19:40  * parshapjoined
04:19:49  * jfhbrookquit (Ping timeout: 260 seconds)
04:20:20  * lachenmayerjoined
04:20:32  * substackjoined
04:20:47  * jfhbrookjoined
04:22:15  * jlordjoined
04:22:33  * machtyjoined
04:22:59  * mikolalysenkojoined
04:23:14  * jhieseyjoined
04:23:31  * daviddiasjoined
04:24:03  * ec\joined
04:47:07  * pfrazequit (Remote host closed the connection)
05:00:07  * knownasilyaquit (Quit: Connection closed for inactivity)
06:08:57  * domanicjoined
06:18:09  * contrahaxquit (Quit: Sleeping)
06:45:32  * contrahaxjoined
06:53:43  * domanicquit (Ping timeout: 250 seconds)
06:55:14  * phatedquit (Remote host closed the connection)
07:38:45  * domanicjoined
07:41:10  * contrahaxquit (Quit: Sleeping)
07:44:17  * domanicquit (Ping timeout: 276 seconds)
07:48:49  * rwaldronquit (Remote host closed the connection)
08:02:15  * phatedjoined
08:06:46  * phatedquit (Ping timeout: 256 seconds)
08:22:46  * fotoveritequit (Quit: fotoverite)
08:48:41  * peutetrejoined
09:02:46  * peutetrequit (Ping timeout: 252 seconds)
09:06:59  * peutetrejoined
09:50:42  * phatedjoined
09:55:00  * phatedquit (Ping timeout: 256 seconds)
10:43:27  * contrahaxjoined
10:55:52  * phatedjoined
11:00:32  * phatedquit (Ping timeout: 250 seconds)
11:31:47  * contrahaxquit (Quit: Sleeping)
11:49:02  <emilbayes>Anybody know of a module that returns the mapping from an unsorted array to a sorted? Like R's order command. Eg. `var i = ['c', 'a', 'b']; var o = [1, 2, 0] // as i[o[0]] = 'a', i[o[1]] = 'b', i[o[2]] = 'c'
12:54:03  * nrwquit (Ping timeout: 240 seconds)
12:54:05  * nrw_joined
12:59:45  <rom1504>emilbayes: google doesn't seem to know about that in any language. Interesting question though, it would probably not be too hard to code a function that build that. Why do you need that though ?
13:00:49  <emilbayes>rom1504: R has the command :) https://stat.ethz.ch/R-manual/R-devel/library/base/html/order.html
13:01:34  <emilbayes>I have a long list that has a bunch of names sorted by "importance". I'd like to be able to do a quick binary search by spelling, and then get successors by "importance"
13:01:50  <emilbayes>So the order array would be useful for how the binary search should proceed
13:03:13  <rom1504>ah R as in the language, R was ramda to me so I didn't understand
13:04:06  <rom1504>emilbayes: here you go https://www.npmjs.com/package/order-permutation
13:04:29  <rom1504>funny how using the right keywords still make all the difference
13:04:41  <rom1504>(here Ordering Permutation )
13:06:05  <emilbayes>rom1504: wow thanks! Feel like I've tried permutation, but must have missed that one
13:50:52  * pfrazejoined
14:08:44  * pfrazequit (Remote host closed the connection)
15:18:28  * peutetre_joined
15:18:58  * peutetrequit (Read error: Connection reset by peer)
15:22:12  * pfrazejoined
15:48:38  * peutetre_quit (Quit: ...)
15:53:45  * peutetrejoined
16:06:04  * peutetrequit (Quit: ...)
16:11:39  * contrahaxjoined
16:34:46  * peutetrejoined
16:36:27  * contrahaxquit (Quit: Sleeping)
16:41:04  * contrahaxjoined
16:49:03  * contrahaxquit (Quit: Sleeping)
16:58:23  * fotoveritejoined
17:01:23  * peutetrequit (Quit: ...)
17:23:08  * peutetrejoined
17:24:04  * peutetrequit (Client Quit)
17:27:47  * jhermsjoined
17:40:40  * shamajoined
18:02:07  * phatedjoined
18:07:30  * jhermsquit (Ping timeout: 260 seconds)
18:09:54  * contrahaxjoined
18:21:28  * peutetrejoined
18:54:16  * peutetrequit (Quit: ...)
18:55:21  * contrahaxquit (Quit: Sleeping)
18:56:37  * contrahaxjoined
19:01:04  * contrahaxquit (Client Quit)
19:02:11  * contrahaxjoined
19:18:53  * shamaquit (Remote host closed the connection)
19:20:19  * shamajoined
19:20:57  * shama_joined
19:20:59  * shama_quit (Remote host closed the connection)
19:21:27  * shama_joined
19:22:19  * shama_quit (Remote host closed the connection)
19:23:41  * hij1nxquit (Ping timeout: 245 seconds)
19:24:21  * shama_joined
19:24:30  * shamaquit (Ping timeout: 250 seconds)
19:24:40  * hij1nxjoined
19:26:26  * shama_quit (Remote host closed the connection)
19:27:26  * shamajoined
19:29:45  * shamaquit (Remote host closed the connection)
19:53:21  * phatedquit (Remote host closed the connection)
20:30:18  * contrahaxquit (Quit: Sleeping)
20:44:52  * shamajoined
20:47:50  * kanzurequit (*.net *.split)
20:47:50  * yangwaoquit (*.net *.split)
20:48:26  * shamaquit (Client Quit)
20:49:44  * kanzurejoined
20:49:44  * yangwaojoined
20:49:47  * kanzurequit (Max SendQ exceeded)
20:52:29  * kanzurejoined
20:55:05  * phatedjoined
20:57:40  * kanzurequit (Changing host)
20:57:40  * kanzurejoined
20:59:24  * phatedquit (Ping timeout: 250 seconds)
21:26:58  * phatedjoined
21:43:04  * phatedquit (Remote host closed the connection)
22:59:55  * phatedjoined
23:21:39  * phatedquit (Remote host closed the connection)