Activity Graph

Page 1 of 9 | Next »


[01:01:28] cthulchu: Ping timeout: 246 seconds


[02:11:46] cthulchu: folks, how do I connect my nginx to ruby backend if I don't wanna use a framework like rails?
[02:11:54] cthulchu: I also don't want to use CGI
[02:59:48] cthulchu: I don't want anything to do with web really
[02:59:54] cthulchu: nginx will do it for me
[03:01:03] cthulchu: all I want to do is to return a string to nginxz
[03:01:14] cthulchu: based on what nginx passed to me
[03:02:28] cthulchu: interesting
[03:02:45] cthulchu: maybe I could parse that request... manually...
[03:02:46] cthulchu: as a string
[03:05:06] cthulchu: okaym, socket sounds fine
[03:05:17] cthulchu: but I will need something rubbyish to listen to it...
[03:05:23] cthulchu: so ruby should run all the time
[03:05:50] cthulchu: well then I don't need nginx
[03:06:15] cthulchu: nah, it's for internal use only
[03:06:33] cthulchu: I want to let anybody ability to the QA backend
[03:06:46] cthulchu: so that they could create and manipulate test accounts
[03:07:14] cthulchu: mkay, gotta go. will look it up tomorrow, thanks


[17:30:35] cthulchu: has joined #ruby


[01:14:47] cthulchu: Ping timeout: 272 seconds


[04:01:53] cthulchu: Remote host closed the connection
[04:02:17] cthulchu: has joined #ruby
[14:02:10] cthulchu: *.net *.split
[14:04:22] cthulchu: has joined #ruby


[17:30:01] cthulchu: has joined #ruby


[02:26:32] cthulchu: Ping timeout: 244 seconds


[16:27:45] cthulchu: has joined #ruby


[00:03:42] cthulchu: Ping timeout: 276 seconds


[20:41:57] cthulchu: RUUUUUUUBYYYYY!
[21:12:35] cthulchu: well I thought so... But it's not worth asking
[21:15:09] cthulchu: I want to measure performance of one my functions
[21:15:26] cthulchu: I'm gonna just do start = Time.now() in the beginning
[21:15:44] cthulchu: and then puts start-Time.now() at the end
[21:15:54] cthulchu: yeah, benchmark
[21:16:04] cthulchu: should work
[21:17:26] cthulchu: but looks like a lot more syntax than what I have
[21:17:47] cthulchu: when I need to benchmark something smaller, I'll do benchmark
[21:57:59] cthulchu: I prefer python's syntax
[21:58:21] cthulchu: I still hate how ruby has different ways to mark differnt blocks
[21:58:40] cthulchu: sometimes you can use {}, sometimes it's def-end or if-end
[21:58:50] cthulchu: but I got used to it. kinda.
[21:59:42] cthulchu: yes, ruby has immense amount of magic
[21:59:49] cthulchu: I have never seen so much magic
[21:59:55] cthulchu: it scares me a bit
[22:02:39] cthulchu: faster coding - yes
[22:02:49] cthulchu: there are certain tradeoffs
[22:02:58] cthulchu: but yeah, I appreciate the speed too
[22:04:01] cthulchu: tbh, I love Java's OOP implementation
[22:04:09] cthulchu: and how reliable it is
[22:04:30] cthulchu: I don't imagine coding similar low-level stuff in Ruby
[22:05:09] cthulchu: just take a look at proper implementation of static in Ruby
[22:05:19] cthulchu: first of all, Ruby doesn't seem to fully realize what static is
[22:05:35] cthulchu: and then when you see the proper implementation of static... it's hell.
[22:05:47] cthulchu: I still use the @@ shortcut for static vars
[22:06:43] cthulchu: also protection isn't the thing in Ruby. so if something is Private, you still can do whatever you want with it :)
[22:06:50] cthulchu: it's kinda relaxing
[22:57:03] cthulchu: not magic equals is !===?
[22:57:55] cthulchu: will irb it
[22:58:12] cthulchu: crap, Ruby!
[22:58:37] cthulchu: why isn't there !== or !===?
[22:58:58] cthulchu: when left side DOESNT *magic* the right?
[22:59:49] cthulchu: I know why!
[22:59:53] cthulchu: cuz !(/.*flush.*/ === "flush keep") does the trick!
[23:03:59] cthulchu: it's the same
[23:04:09] cthulchu: but I want to be explicit about what I expect to see
[23:05:15] cthulchu: it may be explicit to you
[23:05:20] cthulchu: it's not explicit enough to me
[23:06:38] cthulchu: I got used to using .* everywhere where I mean it
[23:06:47] cthulchu: doesn't harm productivity
[23:07:23] cthulchu: I see your point
[23:07:36] cthulchu: it's a bad habit. I'll try to get rid of it. Thanks
[23:09:51] cthulchu: what is directly?
[23:09:54] cthulchu: or indirectly
[23:10:27] cthulchu: and indirectly?
[23:10:52] cthulchu: but your indirect usage has no ===
[23:11:58] cthulchu: I thought that black magic was just for kids to play with
[23:12:41] cthulchu: nah, I find === too comfortable to use it indirectly
[23:12:50] cthulchu: also I'm the user of my software
[23:13:04] cthulchu: so if I see that explicit usage of === harms me, I'll rewrite it
[23:13:09] cthulchu: till now it was super comfy
[23:13:21] cthulchu: yeah, I know
[23:13:37] cthulchu: I know it's a lot more powerful than what I use it for
[23:14:01] cthulchu: and it probably creates tons of potential bugs, but I'm the only consumer, so it's fine
[23:14:25] cthulchu: I'm not looking for straightforwardnes really. I look for speed and comfort
[23:15:31] cthulchu: I write tests and so my testing function accepts strings to comare them with what happens in real life, but sometimes I wanna pass a regex instead of a string when it becomes a bit dynamic
[23:16:04] cthulchu: I surely could check the type and then do regex match instead of == if the variable's type is regex, but === is so comfy
[23:28:02] cthulchu: it's pretty powerful
[23:30:50] cthulchu: interesting
[23:30:56] cthulchu: is it heavy on resources?
[23:31:07] cthulchu: I suspect === is super vicious
[23:31:42] cthulchu: what is vanilla though
[23:32:03] cthulchu: I didn't know there was vanilla pattern matching
[23:32:44] cthulchu: and both Qo and Vanilla have the same complexity?
[23:33:12] cthulchu: same complexity?
[23:33:51] cthulchu: I guess for array*array it would be O(n^2)
[23:34:33] cthulchu: I'm asking if the comlexity for both is the same
[23:35:04] cthulchu: cuz if I do O(n^2) in vanilla and then O(n) in Qo, then I can't compare them
[23:35:49] cthulchu: the complexity of the algos you compare should be the same to be able to compare them
[23:35:59] cthulchu: or rather compare the implementation
[23:36:31] cthulchu: you can, but you won't compare their benchmarks
[23:36:35] cthulchu: you will compare their Os
[23:36:47] cthulchu: if you go down to benchmarks, you assume the Os are the same
[23:37:47] cthulchu: the question is what was your vanilla
[23:37:54] cthulchu: was it comparable or not
[23:38:09] cthulchu: if it has a different complexity then it's ridiculous to compare them
[23:38:32] cthulchu: yes, and so I asked a question instead of reading the implementation
[23:40:50] cthulchu: well I guess so
[23:40:58] cthulchu: if the complexity difference is not obvious
[23:41:48] cthulchu: what I'm saying is if you want to test your implementation effectiveness, you should make sure the thing you test it with has identical complexity
[23:41:57] cthulchu: cuz if it doesn't, then you're cheating
[23:44:41] cthulchu: dropping complexity always seems very cool to me
[23:44:50] cthulchu: even if it looks overthought
[23:45:37] cthulchu: also I noticed that really polished solutions look very clean
[23:46:00] cthulchu: but if you're making a library, you want to make it as efficient as possible
[23:46:08] cthulchu: cuz you don't know what it's gonna be applied to
[23:46:22] cthulchu: like gitter
[23:48:34] cthulchu: a level is what? log(n)?
[23:50:37] cthulchu: are you sure about that?
[23:51:08] cthulchu: but yeah, I got the idea
[23:51:13] cthulchu: good chat, thanks
[23:51:17] cthulchu: gonna go home :)


[20:09:28] cthulchu: in a static variable
[20:09:46] cthulchu: and then I will use it for every next iteration to start reading from
[20:10:50] cthulchu: there is another approach where I only iterate through the last N lines, but it's not as reliable
[20:16:14] cthulchu: hell this documentation is quite hard to read
[20:17:30] cthulchu: looks like seek is not quite good at starting from somewhere meaningful
[20:17:47] cthulchu: it always starts from the beginning of the file
[20:18:01] cthulchu: and then you only influence the direction and limit of search
[20:18:12] cthulchu: whereas I need it to start from the specific line
[20:18:45] cthulchu: I guess I'd use lazy for it
[20:20:55] cthulchu: first iteration: seeking from 0 to 289, which happens to be the eof. second iteration: seeking from 289 to the new eof
[20:21:46] cthulchu: I also need a block and .each for seek
[20:22:05] cthulchu: it's not for seek
[20:22:25] cthulchu: aha! whence!
[20:22:31] cthulchu: whence can change the position
[20:22:38] cthulchu: no, it cant
[20:22:44] cthulchu: maybe rewind?
[20:22:56] cthulchu: like a smart rewind
[20:23:11] cthulchu: I have no clue
[20:24:39] cthulchu: maybe this? https://stackoverflow.com/questions/26950338/how-to-start-reading-a-filecsv-from-a-given-line-n-in-ruby
[21:22:43] cthulchu: guys, files should be better
[21:22:57] cthulchu: byte position!
[21:23:16] cthulchu: phaul, I should remember the last byte and then start reading from there!
[21:23:25] cthulchu: buz bytes are arrays, right?
[21:23:35] cthulchu: I don't need to read through everything now!
[21:23:45] cthulchu: only one problem: can Ruby tackle that?
[21:25:27] cthulchu: that's fine
[21:25:40] cthulchu: as I said, I read this file in iterations
[21:25:55] cthulchu: I have, say, 20 tests running one after another
[21:26:04] cthulchu: logs from all of them get to the same file
[21:26:25] cthulchu: but I don't need logs from test N 8 in test N 9
[21:27:02] cthulchu: but now the question is even harder
[21:27:17] cthulchu: how do I save the byte position and load it to start iterating from there
[21:28:10] cthulchu: havenwood, I can't afford that and it's not very applicable
[21:30:14] cthulchu: the problem is that I don't need seek to...
[21:30:17] cthulchu: I need seek from
[21:30:29] cthulchu: also seek is weird
[21:30:33] cthulchu: I'm not sure how it works
[21:30:41] cthulchu: I saw its doc
[21:30:47] cthulchu: but it seems to return 0
[21:30:57] cthulchu: and then what do I do with it?
[21:31:08] cthulchu: do I just do file.each_line?
[21:31:40] cthulchu: havenwood, I think I'll try seeking to byte #
[21:31:57] cthulchu: I hope seek is smart enough to treat it as an array and not iterate through the thing
[21:32:22] cthulchu: havenwood, I described above
[21:32:35] cthulchu: havenwood, I read this file many times and don't want to start from 0 every time
[21:33:51] cthulchu: phaul, will seek work for each_line?
[21:34:44] cthulchu: and then how do I iterate through new lines after that?
[21:35:04] cthulchu: starting from that absolute position
[21:35:46] cthulchu: or should I do that right in the each_line loop?
[21:36:58] cthulchu: havenwood, it is useless since the file changes
[21:37:14] cthulchu: I mean, the length of it. it's a log file
[21:37:52] cthulchu: so I need to know the address since where to look for new changes
[21:38:11] cthulchu: we figured it should be byte address, which makes perfect sense
[21:38:31] cthulchu: phaul, could you please show a snippet?
[21:39:48] cthulchu: phaul, thanks a lot :)
[21:48:02] cthulchu: is there a way to find eof byte #?
[21:48:09] cthulchu: without iterating through it
[21:48:12] cthulchu: should be in FS
[21:48:26] cthulchu: it should be there
[21:48:41] cthulchu: how else do you read from the end
[21:48:45] cthulchu: yeah, for sure
[21:52:12] cthulchu: havenwood, cool! thanks!
[21:52:41] cthulchu: I even saw it before
[21:53:04] cthulchu: great question
[21:53:23] cthulchu: where would it take me though?
[21:53:32] cthulchu: did we just found a way to travel in time?
[21:53:52] cthulchu: to brake the space-time continuum?
[21:54:07] cthulchu: hell I'm curious where it would take me
[22:06:03] cthulchu: oh so when we do the argument magic, it's still symbols? like def asd(a:"",b:"",c:"")
[22:06:25] cthulchu: that means that the function accepts links
[22:07:07] cthulchu: and then if I run asd(a:"qweqwe"), I actually pass a link to a static string?
[22:07:21] cthulchu: I mean, not static, but primitive as hell
[22:07:43] cthulchu: nah, no, probably those aren't symbols
[23:29:28] cthulchu: looks like I made a mistake :(
[23:34:10] cthulchu: I'll debug and come back
[23:51:48] cthulchu: I also shouldn't debug at the end of a day
[23:52:08] cthulchu: I usually end up wasting hours on something trivial