Activity Graph

Page 1 of 5 | Next »


[08:22:42] c-c: has left #ruby: ("ta")


[16:49:49] c-c: *.net *.split


[16:45:45] c-c: has joined #ruby
[18:32:03] c-c: I bumped into https://www.microsoft.com/en-us/research/publication/a-fork-in-the-road/
[18:34:19] c-c: and since my micro sized engine draft uses fork (line 192) https://gist.github.com/csmr/ffc1c691c24cc9bf7b0f2e9bd729c471
[18:34:41] c-c: I'm thinking maybe must posix_spawn() or other fancying
[18:42:37] c-c: - but is there a posix spawn in ruby libs?
[18:43:32] c-c: hm, maybe this could be bash level stuff


[07:28:47] c-c: Ping timeout: 245 seconds
[07:28:53] c-c: has joined #ruby


[15:14:25] c-c: mistergibson: a http-server?
[15:16:44] c-c: it sounds like "wha, mu-mu-multiple IP's?!" to me
[15:16:53] c-c: how can your machine have multiple IP's


[15:35:19] c-c: make a function that takes p[:s], p[:b], p[:r]?
[15:35:38] c-c: - and calls message new with that
[15:36:12] c-c: also, could just change from hash to array for params
[15:38:22] c-c: Heh I often do weird stuff like a[9], a[0], a[1] and everything is an array and just have to ensure its all in the arr
[15:38:38] c-c: ACTION https://www.youtube.com/watch?v=sUtoxEZvPyY
[15:46:55] c-c: &>> def f(a:, b:, q=[]) 'hi'; end; h = {a: 1, b: 2, c: 3}; f(**h)
[15:52:39] c-c: I wonder if one could somehow do **h.to_a[0..2]
[15:52:53] c-c: - It works on the hash alone, but not inside a method call + splat
[15:55:46] c-c: duh, then the splat is not needed! *forehead slap*
[15:57:49] c-c: - but one has to see that the keys are inserted in the correct order, or some such obscurity 8P


[14:03:28] c-c: shouldn't that be
[14:04:12] c-c: &>> ar = [1,2,3,4,"foo","bar"]; ar[ar.length % 5]
[14:04:30] c-c: &>> ar = [1,2,3,4,"foo","bar"]; ar[22 % ar.length]
[14:04:41] c-c: TomyWork: just fooling around
[14:05:05] c-c: ACTION has convoluted mind


[22:09:03] c-c: Ok, I got to another gold spike. Spawning processes and their messaging abstracted to (read)next_msg/send https://gist.github.com/csmr/ffc1c691c24cc9bf7b0f2e9bd729c471
[22:09:45] c-c: It spawns 3 processes that helo each other with loop n
[22:10:21] c-c: (as you can read in the logfile, don't forget to $ killall ruby
[22:11:09] c-c: its still pretty ugly, input welcome
[22:15:22] c-c: uplime: maybe the string in single quotes is literal and the double quotes is interpolated?
[22:16:13] c-c: uplime: that was a question
[22:29:16] c-c: Hmm, next I'll have to write the engine-from-rules -thing. I still think the rules should be possible to write in yml
[22:30:18] c-c: engine-genny
[22:33:41] c-c: rubocop would retire if it saw my code
[22:34:08] c-c: have to clean up first


[13:44:14] c-c: Bish: why would you do that?
[13:46:06] c-c: Bish: and the coupon code is so hot it can't wait for a process to be spawned. So much hotter than f.ex. unicorns or similar.
[13:47:12] c-c: I wouldn't use threads, just an extra complexity layer
[13:48:05] c-c: So, its sleeping all day but gets called thousand times a second. Ok I think this is beyond my skill, bordering on paradoxical.
[13:50:01] c-c: Bish I have zero patience for antisocial comments.
[13:50:52] c-c: Bish: if ppl don't understand your question, you need to rephrase your q. Not call channel members "trolls".
[13:51:03] c-c: ACTION thats an order


[16:08:39] c-c: Ok, nice to clean up the code with vim '='. But struggling with the structure for the data of the opened named pipe IO-object, its r/w flags, and how to represent related nicks and processes. https://gist.github.com/csmr/5c0da68094e8112c4624f457f180be24#file-pipedprocs-rb-L105
[16:11:05] c-c: ^ thats like 50% way through (and opening pipes and spawning procs works)
[16:49:01] c-c: phaul how would you ever know if they output same? fuzzing?
[16:56:36] c-c: phaul: how did the channel bot run ruby again?
[17:01:33] c-c: >> p "From test program."; Process.exit!(true)
[17:02:04] c-c: Thats my proof that there is no halting problem: the program ran and exited.
[17:21:07] c-c: >> p "From test program."; return Process.exit!(true)


[10:53:19] c-c: rizwan_: ok you still need help?
[10:53:38] c-c: lets start with your ruby and gem install
[10:53:50] c-c: How did you install ruby? B)
[10:54:48] c-c: so, bundler doesn't run? Or, gem install doesn't run?
[10:55:32] c-c: Lets ignore bundler for a while.
[10:56:02] c-c: Lets check your ruby and gem install. Or, I'll try to show you how you can do that. Ignore rails, too, for now.
[10:56:40] c-c: So, in your shell you have environment var $PATH, that is for searching for commands in dirs.
[10:57:33] c-c: Also, $GEM_HOME and $GEM_PATH are needed for gems
[10:57:54] c-c: its the gem command
[10:58:28] c-c: yes, gem is for ruby, what npm is for js
[10:59:02] c-c: Ok, now you know the first thing: check path!
[10:59:30] c-c: second thing: whats gem doing. try looking at its paths: $ gem environment
[11:00:46] c-c: you already have the $, no need to retype it ;)
[11:00:52] c-c: so, try without
[11:01:15] c-c: when you see $ before command, you know its supposed to be run in a shell or term
[11:01:49] c-c: ACTION suggest you take a piece of paper and write the $ and path stuff down in large weird letters
[11:02:46] c-c: also try (and write in note) $ which ruby
[11:03:09] c-c: rizwan_: because writing it down will cause your brain to process it, and that will cause it to be memorized in your brain!
[11:03:22] c-c: it means: make notes
[11:04:12] c-c: all of this
[11:05:25] c-c: ACTION has to go, but will be back in 30
[11:06:01] c-c: rizwan_: you need to get this stuff right first, the path vars in your shell env
[11:41:21] c-c: kke: is it for gwtting your threads stopped etc at the same time
[12:06:16] c-c: kke: well then you know where your threads are
[12:17:12] c-c: Whats alive do on a thread anyway?
[13:10:54] c-c: ok, it does exist on a thread instance to check if sleeping
[13:49:00] c-c: merijn: install ri, run $ ri <cmd>
[13:49:11] c-c: Thats less than a minute!
[13:53:06] c-c: hm, '<cmd>' isn't right, maybe that should be '<keyword>'


[20:21:58] c-c: ytti: have you looked at rust lately?
[21:40:24] c-c: eightfold: do you have ~/.gem?
[21:41:16] c-c: is ruby in your PATH?
[21:42:29] c-c: hm and whats echo say for $GEM_HOME and $GEM_PATH
[21:44:18] c-c: btw whats your shell and OS?
[21:47:17] c-c: eightfold: maybe you need gem environment
[21:47:37] c-c: $ gem environment
[21:48:29] c-c: hm, wherecha pick up on the rbenv clue? Wasn't that Net
[21:49:01] c-c: eightfold: so you have rbenv? 8)
[21:49:44] c-c: eightfold: just run what I said at :47
[21:51:01] c-c: eightfold: looks to me like your homedir gem is in the gem path
[21:51:28] c-c: eightfold: you think those are correct paths?
[21:53:59] c-c: eightfold: all the paths for gems and bins in your user dir
[21:56:30] c-c: eightfold: so maybe you can follow this, to make your own ~/.gemrc to run with that flag
[21:56:45] c-c: eightfold: also, $ gem which
[21:58:11] c-c: trying to install gems in ~/.gem
[22:00:04] c-c: eightfold: you can set --install-dir
[22:00:36] c-c: (I guess also should then --bindir)
[22:01:22] c-c: I wonder why --user-isntall didn't work
[22:03:20] c-c: eightfold: seems to me your best bet is to go through https://guides.rubygems.org/faqs/
[22:05:09] c-c: Well, one must maintain couple of env variables in a shell session. If thats too complex, maybe stick to system gems.
[22:05:41] c-c: and yeah, sometimes it takes couple of hours just to get things in line with the env var conf


[18:41:34] c-c: What I learned today?
[18:42:20] c-c: Struct.new(:vals) do; # You can declare self.class methods here; end
[19:19:42] c-c: havenwood: ok that looks convy
[19:20:11] c-c: ACTION is still reeling in the monads as a tool, f.ex. https://www.youtube.com/watch?v=J1jYlPtkrqQ
[19:21:50] c-c: its great but somehow being able to think on that level.. hm or is it modality... is often lost as I struggle to get on with the simple stuff
[19:22:12] c-c: maybe in a year or two
[19:24:02] c-c: Maybe Evenetually, And Then
[19:27:07] c-c: ah, Crockfords 'Curse of Monads' in the wild
[19:28:20] c-c: This was almost as good as Tom's code based monad lecture: https://www.youtube.com/watch?v=ZhuHCtR3xq8
[19:28:26] c-c: (Don't Fear The Monad)


[09:11:53] c-c: If I have a method that creates a class instance, its not possible to refer to that instance from a block passed into that method for yielding?
[09:17:41] c-c: >class Spawner; def initialize; @foo=0; end; def spa; bar = @foo + 1; yield; end; end; s=Spawner.new; s.spa do; p bar; end
[09:17:50] c-c: &> class Spawner; def initialize; @foo=0; end; def spa; bar = @foo + 1; yield; end; end; s=Spawner.new; s.spa do; p bar; end
[09:18:19] c-c: &>> "test"
[09:18:25] c-c: &>> class Spawner; def initialize; @foo=0; end; def spa; bar = @foo + 1; yield; end; end; s=Spawner.new; s.spa do; p bar; end
[09:18:55] c-c: (so I'm after bar, in the spa do; end; -block)
[09:36:03] c-c: Ok, that works (note: debug code) https://gist.github.com/csmr/5c0da68094e8112c4624f457f180be24#file-pipedprocs-rb-L244
[16:44:19] c-c: Ok I have Ale for (n)vim and it seems to pinpoint problems long before I even save. Also, I added airline. What other vim plugs do you use? (I don't use plugin installers, git svn etc use from terminal, so I won't need those)
[18:10:40] c-c: surprising that all kinds of tech has gone into computers, but note scribbling as a creative efforte is still smoother on pen&paper or whiteboard
[18:13:21] c-c: so a char is a substring
[18:13:26] c-c: or do you need n > 1
[18:16:57] c-c: Killed (Sigyn (Spam is off topic on freenode.))
[18:30:15] c-c: has joined #ruby


[18:07:27] c-c: has joined #ruby
[18:07:38] c-c: Evening ghosts
[18:08:20] c-c: time to continue monologue on writing a proc with named pipe message box
[18:09:02] c-c: last weekkie I got this far, its only about 10% pseudocode https://gist.github.com/csmr/5c0da68094e8112c4624f457f180be24
[18:09:53] c-c: so next I will attempt to have a gold spike, ie no-brains procs with message boxes using the fastest IPC method (outside shared memory)
[18:32:07] c-c: havenwood: if the socket takes 25 ms, named pipe takes 4 ms
[18:32:26] c-c: (shared memory takes like 0,1 ms)
[18:32:36] c-c: also, I'm just learning stuff
[18:36:48] c-c: yeah my approach is all wrongf
[18:37:35] c-c: this looks clean https://github.com/phlipper/ichannel/blob/master/lib/ichannel.rb
[18:39:54] c-c: yeah I started this rewrite because I kept having problems opening the pipe correctly, Should just open both ends at once and pass the handles around.


[12:30:24] c-c: Ping timeout: 246 seconds


[00:05:25] c-c: phaul so you type command but it won't show errors in the console?


[20:45:03] c-c: has joined #ruby
[23:00:35] c-c: I want to pass a block into a new, and into a method from there, into a method which yields. Whats the correct way to do this? Is it OK to bind the new proc into a var? like keep doing ablock = Proc.new if block_given?
[23:09:42] c-c: Ahem, why didn't I realize the block can be bound to a class var
[23:12:03] c-c: Anyway, I was thinking that &block in an argument list was 10x slower than Proc.new - read something about it somewhere.
[23:19:13] c-c: it may be 10x just for the case where the block is not ever run
[23:19:54] c-c: never nil.call
[23:20:03] c-c: - or something
[23:27:00] c-c: phaul: how would you pass the @x? Like say when instantiating another class with new in method foo?
[23:27:16] c-c: like &@x ?
[23:28:23] c-c: Or maybe: Aklas.new(foo) @x
[23:28:49] c-c: erm, foo was a poor choice for unambiguity there on my part
[23:32:32] c-c: &>> class Zero; def initialize; Proc.new.call if block_given?; end; end; class One; def initialize; @y = Proc.new if block_given?; Zero.new? @y; end;
[23:33:04] c-c: wow it doesn't error
[23:33:28] c-c: &>> class Zero; def initialize; Proc.new.call if block_given?; end; end; class One; def initialize; @y = Proc.new if block_given?; Zero.new? @y; end; One.new { p 0 }
[23:36:31] c-c: Weird! so it works if: class Zero; def initialize; Proc.new.call if block_given?; end; end; class One; def initialize; @y = Proc.new if block_given?; Zero.new &@y; end; end; One.new { p 0 }


[11:57:09] c-c: has joined #ruby
[12:05:10] c-c: Hello! Time to return to the little game engine stub I started on last spring!
[12:06:34] c-c: Currently its just bunch of methods, that spawn 3 processes with game loop. Next, I'm looking at abstracting the inter-process messaging in a class (as opposed to copypaste).
[12:08:32] c-c: So somehow, this https://gist.github.com/csmr/5c0da68094e8112c4624f457f180be24 class instaces in a process would use these https://gist.github.com/csmr/31639d9172274841edc7e528e2351998
[12:21:15] c-c: I added some ideas about the implementation to comments before the class
[14:56:04] c-c: Ok, I updated the wanna be inter-process message box class https://gist.github.com/csmr/5c0da68094e8112c4624f457f180be24
[14:56:13] c-c: it actually instantiates that class
[14:56:37] c-c: - but actual ipc is not written yet
[14:59:06] c-c: I wonder if the Utils module is a good approach to reusing those methods... hmm, would a class have its parent module methods visible (inside the MessageBox)
[18:24:02] c-c: Quit: Changing server


[14:26:40] c-c: has left #ruby: ("ta!")


[08:06:05] c-c: has joined #ruby
[08:07:29] c-c: Hey how would you automate jpg to webm where each consequtive frame has -1 jpg compression quality?
[08:08:00] c-c: - So the image appears to degrade over time into jpg mosh
[08:15:52] c-c: Looks like I have mini-magick package on debian...
[08:16:32] c-c: - Is mini-magick legit?
[10:24:50] c-c: ACTION always does [1..3][0,1]
[10:24:57] c-c: one less char
[10:31:36] c-c: you could also do [0,1][1..8]


[23:16:12] c-c: Ping timeout: 244 seconds


[00:01:26] c-c: ok, I'll be sure to watch that when I have extra 30 minutes
[00:02:54] c-c: I'm not going to use monads. 8) Replying to a code paste with a video - thats basically blowing someone off.
[00:03:34] c-c: Sad that I couldn't use your suggestions, but remember succint, on-topic, to-the-point
[00:04:45] c-c: best accept facts: my question is broad, and its hard to provide answer to it, unles you already have a code-example.
[00:13:16] c-c: Maslows Hammer
[00:13:39] c-c: - When you've been studying/using X, all problems look like you should use X to solve them
[00:49:38] c-c: - that video *is* great and makes me wonder if I should monad
[00:52:13] c-c: Ah well, 4 am soon, maybe I'll go dream of eventually optionals
[09:19:58] c-c: Ok, moving forward with last nights imperative nil-check hell. Managed to remove about 30% of redundant lines: https://gist.github.com/csmr/31639d9172274841edc7e528e2351998
[09:21:23] c-c: ^ its as simple IPC model as I can implement. Then again, I'm no genius so I suppose its probably still kinky.
[09:23:45] c-c: - also still have funny stuff happening with .put/puts/!/flush. Seems the only way to be 100% sure the message flows into a pipe is "my_pipe.puts msg\n my_pipe.flush"
[09:24:32] c-c: (thats why the put! and get! singleton methods were not used in that snippet)
[09:50:18] c-c: s/IPC/nonblocking IPC/
[10:01:14] c-c: - bah, looking at IO.select doc, looks like should read all pipes that a proc has open in read_line_nonblocking
[10:06:21] c-c: hehe so don't look at the snippet, it should probably be a mixin module thing anyway
[11:44:40] c-c: hm, maybe I should wrap that IPC code in an array with maybe. So you get IPC message-stack that only needs list of pipes and .read_next to use.
[11:52:27] c-c: hnnh, that would be two-directional named pipe in ruby
[11:58:52] c-c: hnghh, an asyncronous bidirectional named pipe in ruby, to be correct
[12:17:30] c-c: yet another async bidirectional ipc lib? pipesnow? hm, maybe I could call it fiberoptic
[12:20:47] c-c: hm, I wonder if thats easily confused with threading
[12:23:49] c-c: ACTION mumbles monologue and wondrs off
[17:05:56] c-c: phaul: hey I watched the monad vid
[17:06:09] c-c: phaul: it was good stuff, thanks!
[17:41:41] c-c: I'm wondering if should implement my own Maybe on Ruby 2.3.3
[17:45:07] c-c: I think I mostly understand what Maybe is
[17:45:35] c-c: - but maybe should implement, to learn if nothing to learn
[17:46:30] c-c: - or Maybe something
[17:48:17] c-c: ACTION meta 


[22:22:04] c-c: weird, my irb responds undefined method 'yield_self'
[22:22:56] c-c: ok, I'm on 2.3.3p222
[22:23:32] c-c: so much peeve
[22:24:01] c-c: - I have to test to for nil!
[22:33:37] c-c: yeah have stuff like msg = rwe[0][0].gets.strip unless rwe == nil || rwe[0][0] == nil
[22:34:19] c-c: - which will fail if that returns nil
[22:43:43] c-c: So, this works: msg = rwe[0][0] unless rwe == nil || rwe[0][0] == nil -- but rwe[0][0].gets.strip doesn't!
[22:43:58] c-c: its as if it ecals the strip before the unless
[22:45:31] c-c: was struggling ther for 10 minutes with new syntax bugs
[22:46:17] c-c: aw, my ruby doesn't support &.
[22:48:25] c-c: ah well, I'll have to accept that
[22:51:52] c-c: let me revisit this nil syntax pet peeve with a more illustrative gist https://gist.github.com/csmr/177daf69dfaffed11306f9a5b6fa0cbf
[22:52:19] c-c: Its like I have set nil or test for nil on every 2nd line all the time
[22:58:44] c-c: interestingly &.split seems to work.. I think
[23:06:41] c-c: having to constantly ensure the wahtever is not nil
[23:07:27] c-c: I still do
[23:08:09] c-c: In fact this whole thing is "fragile" when I wanted it to just sit and run even if nothing is read
[23:39:22] c-c: Ok finally managed to fix the regression
[23:40:23] c-c: I feel as if there maybe is whole another approach, but I keep ending in imperative land where I test if nil after/before IO: https://gist.github.com/csmr/177daf69dfaffed11306f9a5b6fa0cbf
[23:41:37] c-c: this seems bit exessive, given the input is always of format "VERB NOUN"
[23:42:53] c-c: - And I'm still not sure if read_line_nonblocking might return something funny when msg == nil
[23:46:55] c-c: phaul thanks for input. I'm sorry but your comment on removing nils didnt seem to work, as "&."
[23:47:59] c-c: yup, thats incorrect
[23:49:04] c-c: yeah, haven't managed to remove single nil yet
[23:50:04] c-c: I think this whole boat needs to be turned around
[23:51:11] c-c: well, stuff breaks if not watching out for nil explicitly in every turn
[23:55:32] c-c: I think this whole thing is somehow wrong
[23:57:33] c-c: The basic concept is a process reading input stream, store lines in msg_stack - unless none, then read the msg_stack to see what to do with state