Activity Graph

Page 1 of 1


[14:57:48] ekleog: has left #ruby: ("parting")


[11:11:36] ekleog: Remote host closed the connection
[11:16:04] ekleog: has joined #ruby


[08:29:12] ekleog: *.net *.split
[08:30:17] ekleog: has joined #ruby
[08:42:01] ekleog: *.net *.split
[10:34:47] ekleog: *.net *.split
[11:06:33] ekleog: has joined #ruby


[07:56:05] ekleog: *.net *.split
[08:01:27] ekleog: has joined #ruby
[16:35:42] ekleog: Ping timeout: 240 seconds
[19:01:43] ekleog: *.net *.split
[19:08:46] ekleog: has joined #ruby


[23:05:29] ekleog: Ping timeout: 250 seconds
[23:08:36] ekleog: has joined #ruby


[03:45:52] ekleog: *.net *.split
[22:40:32] ekleog: Read error: Connection reset by peer
[22:42:41] ekleog: has joined #ruby


[20:20:35] ekleog: Ping timeout: 240 seconds
[20:23:16] ekleog: has joined #ruby


[05:14:23] ekleog: *.net *.split


[16:06:35] ekleog: Read error: Connection reset by peer
[16:07:43] ekleog: has joined #ruby
[16:09:14] ekleog: Read error: Connection reset by peer
[16:10:20] ekleog: has joined #ruby


[21:12:22] ekleog: Read error: Connection reset by peer
[21:13:31] ekleog: has joined #ruby


[16:15:22] ekleog: Read error: Connection reset by peer
[16:17:12] ekleog: has joined #ruby
[16:18:40] ekleog: Read error: Connection reset by peer
[16:19:47] ekleog: has joined #ruby


[13:56:23] ekleog: Ping timeout: 244 seconds
[14:02:32] ekleog: has joined #ruby


[14:29:06] ekleog: Read error: Connection reset by peer
[14:30:14] ekleog: has joined #ruby
[14:43:17] ekleog: Read error: Connection reset by peer
[14:44:24] ekleog: has joined #ruby


[17:30:19] ekleog: Ping timeout: 250 seconds
[17:33:14] ekleog: has joined #ruby


[00:13:37] ekleog: has joined #ruby


[12:35:45] ekleog: Ping timeout: 244 seconds
[12:40:34] ekleog: has joined #ruby


[06:07:27] ekleog: Ping timeout: 272 seconds
[06:56:49] ekleog: has joined #ruby
[20:49:03] ekleog: Ping timeout: 272 seconds
[20:55:09] ekleog: has joined #ruby


[22:37:34] ekleog: Ping timeout: 244 seconds
[22:38:41] ekleog: has joined #ruby


[11:33:38] ekleog: Ping timeout: 246 seconds


[15:31:19] ekleog: Remote host closed the connection
[15:42:29] ekleog: has joined #ruby
[15:48:19] ekleog: Remote host closed the connection
[15:49:25] ekleog: has joined #ruby


[13:22:56] ekleog: Read error: Connection reset by peer
[13:24:03] ekleog: has joined #ruby


[20:50:54] ekleog: Ping timeout: 252 seconds
[20:55:34] ekleog: has joined #ruby


[16:24:22] ekleog: Ping timeout: 244 seconds
[16:26:34] ekleog: has joined #ruby


[20:41:41] ekleog: Ping timeout: 272 seconds
[20:46:54] ekleog: has joined #ruby


[16:33:23] ekleog: Remote host closed the connection
[16:33:34] ekleog: has joined #ruby
[17:34:00] ekleog: Remote host closed the connection
[17:36:15] ekleog: has joined #ruby


[01:33:29] ekleog: Quit: No Ping reply in 180 seconds.
[01:34:46] ekleog: has joined #ruby


[16:09:58] ekleog: Ping timeout: 244 seconds
[16:41:41] ekleog: has joined #ruby


[02:34:41] ekleog: Ping timeout: 272 seconds
[16:06:26] ekleog: Remote host closed the connection
[16:07:32] ekleog: has joined #ruby


[12:10:29] ekleog: Remote host closed the connection
[12:10:43] ekleog: has joined #ruby


[04:03:58] ekleog: has joined #ruby
[04:36:57] ekleog: Ping timeout: 244 seconds
[04:39:31] ekleog: has joined #ruby


[23:16:53] ekleog: Ping timeout: 272 seconds


[09:40:55] ekleog: Remote host closed the connection
[09:41:25] ekleog: has joined #ruby


[19:58:08] ekleog: Remote host closed the connection
[19:58:25] ekleog: has joined #ruby


[15:50:13] ekleog: Any hint about how to atomically push *two* elements in a Queue? I wouldn't even mind if it forced all threads to wait, would just prefer to avoir having to recode the entire Queue class :/
[15:50:29] ekleog: s/avoir/avoid/
[15:55:41] ekleog: apeiros: Hmmm, I was guessing the thread was interrupted between the two pushes, guess I'll have to search for another bug
[15:59:53] ekleog: Well, I'm bringing something down and then up again, but this thing will bring me down with it, so the "go up" message must arrive before I'm brought down
[16:00:20] ekleog: Otherwise I could just add a third message type that says "downup", but I feel it's ugly :/
[16:02:39] ekleog: The trick is the thing I'm "restarting" is just a placeholder that serves as a way to express dependencies to other services, so it does not actually do anything, just shutdown every dependent service when going down and start them back again when going up


[13:40:11] ekleog: Hi there! Do you know how well (or not) MiniTest's assert_output manages multiple threads writing? I can ensure the write is entirely made while execution is inside assert_output
[13:57:51] ekleog: nvm, it appears to do it cleanly, another mistake made me think it was it :)
[18:08:24] ekleog: Is there a way to emulate sending two blocks as arguments to one function? I thought of making a function that takes a block and returns a partial function that takes the other block, but that would require the user to add a .call
[18:10:14] ekleog: That's what I tried to avoid for the end-user, to be able to write something like not_really_if { |c| condition } { |c| code_block }
[18:14:04] ekleog: Oh right, the arrow syntax, thanks!
[18:28:27] ekleog: >> def foo(l, &b); end; foo -> { |a| 0 } { |b| 0 }
[18:28:27] ekleog: Mmhmmm... Any idea why this is syntax error?
[18:29:54] ekleog: Oh right.
[18:29:57] ekleog: ACTION feels stupid
[21:19:37] ekleog: I'm in the prrocess of documenting my gem, and if eg. I link using {Logger#debug} it does not create a link in the yard server. Should I assume proper linking will be made on rubygems.org?
[21:33:51] ekleog: Can't seem to find any gem that links to anything outside it :/ Would it be possible to update the gem without bumping the version on rubygems, just to update the documentation?
[21:37:10] ekleog: jhass: Great, thanks!
[22:11:36] ekleog: Yet another question wrt yard: Is there a way to link to a method group?
[23:39:53] ekleog: A (hopefully) last question about yard: is there a way to force it to output methods in some order? I've designed methods that naturally flow in one way in the class prototype, but yard insists on sorting them alphabetically :/
[23:43:41] ekleog: Ox0dea: :/ thanks anyway!
[23:44:39] ekleog: Ox0dea: Wait, I'm allowed to redefine a function and rubygems will allow me to run arbitrary code?
[23:45:13] ekleog: Mmhm, guess I'll go back to studying yard
[23:45:20] ekleog: (and one point on the bingo)


[06:35:10] ekleog: Hi there! I seem to remember having seen some weird hack so that var_name = SomeClass.new; var_name.varname returns "var_name" in ruby. Have I dreamt?
[06:39:37] ekleog: >> (Bar = (Foo = Class.new)).name
[06:39:42] ekleog: Oh, fail :'(
[06:40:15] ekleog: Hoped for a second I could use that to return classes instead of variables and use that
[06:40:37] ekleog: ACTION back in a second, looking at how Class does it...
[06:43:42] ekleog: Basically I'm writing a DSL, and ideally var = some_function "args" would add "var": some_other_function "args" in some Hash -- cleaner than var, stuff["var"] = some_function "args" for the end user
[06:45:19] ekleog: Ugh, Class is a builtin :(
[07:03:59] ekleog: The ruby source code search gave nothing, it looks like it's hacked right into the C code
[07:05:06] ekleog: I think I'm going to use eam's Binding-based solution: it is (presumably?) more portable; and I can have the end user call a function at the end of the file sending "binding" so I could backtrack it :)
[07:05:24] ekleog: (or the last one if I understand anything in it)
[07:10:41] ekleog: ACTION bangs head onto wall, realizing once again ruby is interpreted
[07:11:20] ekleog: Ox0dea: Going to have a look at your solution, and hope you don't go to hell for this :)
[07:14:40] ekleog: Oh, just thought the variable assignments could be scattered among several files... Well, guess I'll just require an explicit name to be given in each function call, and come back later to this issue -- but after some thought variable name may not be unique, when variables are defined inside functions...
[07:15:05] ekleog: ACTION probably just tried to do something impossible
[07:15:29] ekleog: (and no, I'm not only looking for unique names, but for human-"guessable" unique names)
[07:21:27] ekleog: But would require the top part to be present at the top of each file, isn't it? If so I'd rather impose a call to a method sending binding at the end of each file / function :)
[07:25:54] ekleog: Well, I think I don't understand how '__FILE__' works: if in main.rb I require my_file.rb and in both main.rb and my_file.rb I include my_gem (containing __FILE__), in main.rb calling a function from my_gem using __FILE__ will let it equal to main.rb, and in my_file.rb to my_file.rb? How would it do that?
[07:29:29] ekleog: How do you count operations? Is a swap a "unitary" operation?
[07:30:29] ekleog: Swap is usually implemented in 3 operations, so...
[07:31:50] ekleog: Ox0dea: In France it would be T_n ~ coeff * n ; where T_n would be defined as the time necessary for the function to complete ; don't know whether it's international though
[07:32:55] ekleog: Not in the french computer courses I had unfortunately ^^'
[08:07:46] ekleog: Hmmm... Is there a way to convert a code block to a lambda? Stupid example, but let's say I'd like to make a my_lambda function that takes a code block and returns the same "function" as a lambda...?
[08:13:00] ekleog: Oh, just forgot to mention the block should be optional :/ (so AFAICT I have no item to call to_proc on?)
[08:14:33] ekleog: apeiros: I get a warning when doing def foo; lambda.call; end; foo{"bar"} ... ? ("tried to create a Proc object without a block")
[08:17:23] ekleog: Oh, with s/lambda/proc/ it does appear to work, looks good :)
[08:18:09] ekleog: apeiros: It looks like I cannot define a default value for &block using this syntax ("syntax error, unexpected '=', expecting ')'")
[08:18:12] ekleog: morning :)
[08:21:02] ekleog: >> def foo; proc.call; end; foo{"a"}
[08:21:02] ekleog: I'm not dreaming, this works? (I don't understand why, though...)
[08:22:37] ekleog: >> def foo; proc; end; foo{"a"}.call # adaedra: More near what I'm trying to do ;)
[08:22:45] ekleog: Ox0dea: Great :D
[08:28:44] ekleog: Pathfinder: Thanks :)
[08:29:38] ekleog: adaedra: Still not, was looking for an optional block :p (solved now anyway :) )
[08:38:04] ekleog: apeiros: Thanks :)
[08:43:41] ekleog: >> test = ->() { test }; [test, test.call] # Discovering ruby's fun facts
[08:47:18] ekleog: I feel I have finally recovered the lost power of C-style pointers
[09:00:05] ekleog: I guess system "openvpn --genkey --secret ta.key" wouldnt fit you?
[09:44:53] ekleog: Yet another question: I just found Hash.new{|h, k| h[k] = "..."} ; but now I wonder: is there a way to have a similar behavior with an OpenStruct? I can't find anything like this, and passing a well-prepared Hash to OpenStruct.new seems not to work :/
[09:48:57] ekleog: apeiros: Thanks :)
[09:49:14] ekleog: (for :45:53)
[10:11:41] ekleog: 'night folks :)


[05:05:11] ekleog: ACTION is happy :)
[05:05:11] ekleog: ACTION will be able to throw away 21 lines of *_eval black magic
[05:05:11] ekleog: ACTION just discovered that ruby classes are open
[05:15:37] ekleog: tyl: Is that what you want? http://pastie.org/10355952
[05:29:04] ekleog: Is there a "standard" way to write a noop lambda? Would you be shocked by reading "lambda {}"?
[05:29:57] ekleog: tyl: You could place generalMethod2 just like generalMethod1 in the previous example, but in the class that generalMethod1 returns ;)
[05:32:32] ekleog: Indeed, when you write "a.foo.bar", foo must return something so that bar can be called upon it
[05:33:31] ekleog: Some convoluted way to do this would be to use a class wrapper that provides the wanted methods and wraps the underlying object
[05:35:41] ekleog: tyl: Something like that: http://pastie.org/10355969
[05:36:12] ekleog: (whoops, forgot to delete the "Model" class addendum in this paste)
[05:42:03] ekleog: You're welcome :)
[06:33:47] ekleog: Is there a clean way to make { foo: "bar" }.foo return "bar"?
[06:35:30] ekleog: nvm, just found method_missing
[06:37:24] ekleog: ostruct = OpenStruct? Looks like exactly what I was trying to do :)
[06:51:05] ekleog: Unrelated: Is there a way to deny creation, except for static methods on the class?
[06:51:53] ekleog: Like "'Blah.new' should fail"
[06:52:07] ekleog: (just trying to enforce usage of factory methods)
[06:53:24] ekleog: I found private_class_method, but if I understood correctly, private in ruby means private including to other objects of the same class, so I guess it'd be private for static methods
[07:03:11] ekleog: sevenseacat: I was about to say I'm unable to call new from a static method. Then I saw Ox0dea's answer and tried without the class name in front and it worked. Thanks all!
[07:05:49] ekleog: Well, I tried using private_class_method and to do MyClass.new inside the factory functions and it didn't work. Then I saw the feature request, and I tried using only "new", which worked :)
[07:06:04] ekleog: s/to do/doing/


[06:00:28] ekleog: WeeBeanie: You can do the opposite: "\t Hello, I'm Jim \nNice to meet you!".delete "^a-zA-Z0-9.,! "
[06:00:59] ekleog: This would delete everything but alphanumeric characters, space, dot, comma and bang
[06:03:17] ekleog: \n and \t do not break JSON AFAICT
[07:02:04] ekleog: Hey folks, in Logger's documentation, I can't find any mention of multithreading. Should I assume it is thread-unsafe, and two concurrent logs could either "corrupt" the log file or write nonsense in lieu of the two log lines?
[07:04:41] ekleog: OK, thanks!
[07:07:01] ekleog: OK, thanks, it's always great to discover undocumented features :)
[07:10:06] ekleog: Ox0dea: You are right of course, but with <1 week of ruby coding I do not feel ready to delve into ruby's standard library yet


[08:06:24] ekleog: Hi there! I have a Logger "global variable" (actually a module @@variable). I'm using MiniTest through rake. Is there a way to set this variable to output to STDERR in case it is run through rake test, yet default to STDOUT for normal programs?
[08:10:36] ekleog: Well, I must have poorly explained my issue: I don't know where in the Rakefile I could put the line that sets it to output to STDERR -- the only way I could think of would be to put a line at the beginning of each test case -- clearly a bad idea
[08:12:41] ekleog: (and when trying to put it inside the TestTast definition the path seems not to be setup yet for module requisition)
[08:12:49] ekleog: s/Tast/Task/
[08:14:26] ekleog: This would mean I have to put one for each MiniTest::Test class; isn't it ?
[08:18:12] ekleog: Oh, just thought about adding an intermediate class inbetween my tests and MiniTest::Test ; thanks!
[08:20:29] ekleog: zenspider: Basically, I have to initialize a global state before any test is run
[08:23:44] ekleog: Not only if it is run through rake, but only for the tests -- and if I do not have to repeat the global state setup for each test file I feel better. The solution of which was to make my tests inherit from MyTest instead of MiniTest::Test ; and to do the global state setup in MyTest.setup
[08:31:26] ekleog: zenspider: Is this name any special? I have a helper file in which I have put the MyTest class definition; but searching for "ruby test_helper" only brought up stuff about rails
[08:34:29] ekleog: ACTION is too used to languages requiring a "main" function
[11:29:42] ekleog: The reason I'm learning ruby: It's the only multiline-lambda interpreted language I know of
[11:29:59] ekleog: (except lisp, but lisp is lisp)
[11:42:44] ekleog: Actually I learn ruby for a single project that makes heavy use of these lambdas, given no language I know of allows overloading the "if" "operator" [writing a DSL]
[11:46:42] ekleog: Ox0dea: Just heard of lisp, but frankly it really has far too many parentheses for me to be willing to jump in -- and an if_ function taking a lambda as a parameter should work
[11:49:36] ekleog: Yes it is, but I had a choice to make (and (+ a b) feels unintuitive to me). Besides, just checking, multithreading supports seems pretty ill-supported in CommonLISP to my unexperienced eye
[11:51:43] ekleog: Is there anything else than https://common-lisp.net/project/bordeaux-threads/ for multithreading in LISP ? It has seen no release for two years, and its mailman seems down
[11:52:17] ekleog: (and still learning english, sorry for any mistake)
[11:54:22] ekleog: I completely trust you on that, but I do need multithreading (well, I could simulate multithreading by scheduling threads myself I guess, but that would be masochism)
[12:02:00] ekleog: Anyway, it doesn't really matter, does it?
[12:02:00] ekleog: Ox0dea: When I search for "arc multithreading", I fall upon an Objective-C library... And I would most likely try lisp, should I ever feel a need for it (until 2 weeks ago I never even thought of learning ruby, until this project came to my mind and I was faced with learning ruby or lisp -- and chose ruby without any other insight than having seen a few pieces of code in both, and thinking the dsl based on ruby would look cleaner)
[12:04:50] ekleog: My arbitrary choice of language


[06:17:58] ekleog: Quit: http://quassel-irc.org - Chat comfortably. Anywhere.
[06:18:07] ekleog: has joined #ruby
[10:50:38] ekleog: Hi there! Is there a way for object A to modify a variable internal to object B, if both belong to the same class? I'm hurt by the "unexpected tIVAR" syntax error :/
[10:54:57] ekleog: apeiros: Thanks!
[11:43:08] ekleog: Already back: I use assert_output from Minitest to check that a given function outputs something. However, I just changed the function from using puts to print ; and suddenly assert_output finds there is nothing outputted. Do you know why ?
[12:08:26] ekleog: atmosx: Actually that was the point of switching to print ; and assert_output gives me a diff that shows nothing is displayed ; but now debugging I seem to have much deeper problems in my code (eg. a theoretically minor change just made a seemingly trivial test infinite-loop...)
[12:10:17] ekleog: Oh. My. God.
[12:10:39] ekleog: Switching from print to puts just makes the infinite loop go away
[12:11:09] ekleog: Now I just wonder wtf is going on
[12:31:39] ekleog: (no, just trying to find a minimal non-working example)
[12:44:51] ekleog: OMG just found why ; stupid mistake...
[12:45:19] ekleog: My lambda was calling print, but located inside a member function called print...
[12:48:28] ekleog: ACTION feels stupid


[08:58:43] ekleog: has joined #ruby
[09:04:26] ekleog: Hi there! Just wondering, is there a way to test whether some function prints something to stdout?
[09:04:51] ekleog: (I'm 5-hour-new to ruby, so please forgive if my question is stupid)
[09:05:42] ekleog: OK, thanks!
[09:07:42] ekleog: Well, ATM that's just for grabbing from puts, so it should be OK, but I'll keep that in mind
[09:08:09] ekleog: jhass: The tutorials I followed all used minitest so I'm going for minitest
[09:10:21] ekleog: ACTION returns to learning searches
[10:13:05] ekleog: Is there a way to mark a function / class as "private inside the module / gem", or is this only in the documentation?
[10:13:34] ekleog: Thanks :)
[22:06:47] ekleog: Ping timeout: 272 seconds