ljames

Activity Graph

Page 1 of 2 | Next »

2016-07-11

2016-07-10

[06:47:44] ljames: has joined #ruby

2016-06-20

[08:09:27] ljames: has joined #ruby

2016-06-08

2016-06-07

[19:03:07] ljames: has joined #ruby

2016-06-06

2016-06-05

[21:04:40] ljames: has joined #ruby

2016-06-04

[02:10:41] ljames: Remote host closed the connection
[02:16:51] ljames: has joined #ruby

2016-06-03

[19:56:42] ljames: has joined #ruby

2016-06-02

2016-06-01

[17:00:45] ljames: has joined #ruby

2016-05-29

[01:46:37] ljames: has joined #ruby

2016-05-27

[06:33:00] ljames: Remote host closed the connection
[07:15:21] ljames: has joined #ruby

2016-05-26

[16:10:56] ljames: has joined #ruby

2016-05-25

2016-05-24

[15:05:25] ljames: has joined #ruby

2016-05-23

2016-05-22

[15:02:48] ljames: has joined #ruby

2016-05-21

2016-05-20

[15:01:41] ljames: has joined #ruby
[16:34:57] ljames: Ping timeout: 276 seconds
[16:36:24] ljames: has joined #ruby

2016-05-18

2016-05-17

[15:01:32] ljames: has joined #ruby

2016-05-16

2016-05-15

[20:25:40] ljames: has joined #ruby
[22:08:16] ljames: has joined #ruby

2016-05-14

2016-05-13

[18:01:40] ljames: has joined #ruby

2016-05-12

2016-05-11

[17:17:27] ljames: has joined #ruby

2016-05-10

[00:05:59] ljames: Ping timeout: 260 seconds
[00:40:14] ljames: has joined #ruby

2016-05-09

[15:00:13] ljames: has joined #ruby

2016-05-04

[07:07:59] ljames: Ping timeout: 260 seconds

2016-05-03

[15:38:22] ljames: has joined #ruby

2016-05-02

[15:21:37] ljames: Ping timeout: 260 seconds
[15:55:34] ljames: has joined #ruby

2016-05-01

[17:14:09] ljames: has joined #ruby

2016-04-30

[00:17:49] ljames: has joined #ruby
[05:58:44] ljames: Ping timeout: 260 seconds

2016-04-29

[17:37:16] ljames: has joined #ruby
[23:13:19] ljames: Ping timeout: 260 seconds

2016-04-28

2016-04-27

[15:08:43] ljames: has joined #ruby

2016-04-26

2016-04-25

[17:29:37] ljames: has joined #ruby

2016-04-24

2016-04-23

[16:05:24] ljames: has joined #ruby

2016-04-22

2016-04-21

[20:57:59] ljames: has joined #ruby

2016-04-20

[15:00:31] ljames: has joined #ruby

2016-04-18

[11:05:56] ljames: Ping timeout: 260 seconds
[11:21:57] ljames: has joined #ruby

2016-04-17

[16:08:34] ljames: has joined #ruby

2016-04-16

2016-04-15

[15:20:33] ljames: has joined #ruby

2016-04-13

[15:13:12] ljames: has joined #ruby

2016-04-12

2016-04-11

[15:34:08] ljames: has joined #ruby

2016-04-09

[12:02:01] ljames: has joined #ruby

2016-04-08

2016-04-07

[08:44:38] ljames: has joined #ruby
[13:14:27] ljames: Ping timeout: 276 seconds
[14:50:08] ljames: has joined #ruby

2016-04-06

2016-04-05

[16:12:55] ljames: has joined #ruby

2016-04-04

2016-04-03

[08:16:27] ljames: has joined #ruby

2016-04-01

2016-03-31

[22:24:29] ljames: has joined #ruby

2016-03-30

2016-03-29

[16:58:47] ljames: has joined #ruby

2016-03-28

[01:27:48] ljames: Ping timeout: 276 seconds
[02:13:40] ljames: has joined #ruby
[07:09:42] ljames: Ping timeout: 276 seconds
[07:26:14] ljames: has joined #ruby

2016-03-27

[18:16:14] ljames: has joined #ruby

2016-03-26

2016-03-25

[17:59:36] ljames: has joined #ruby

2016-03-24

2016-03-23

[17:51:42] ljames: has joined #ruby

2016-03-22

[18:14:51] ljames: Ping timeout: 276 seconds
[18:35:02] ljames: has joined #ruby

2016-03-21

[17:48:20] ljames: has joined #ruby

2016-03-20

2016-03-19

[18:59:03] ljames: has joined #ruby

2016-03-18

[00:49:03] ljames: has joined #ruby
[21:26:18] ljames: Ping timeout: 276 seconds
[21:26:45] ljames: has joined #ruby

2016-03-16

[19:41:31] ljames: any way to load a file (like 'require') as if it was typed directly into irb - keeping the local variables as is? some sort of instance_eval or module_eval?

2016-03-15

[17:18:07] ljames: has joined #ruby

2016-03-14

[11:43:36] ljames: Ping timeout: 276 seconds
[11:57:01] ljames: has joined #ruby

2016-03-13

[16:01:54] ljames: has joined #ruby

2016-03-12

[18:23:57] ljames: what could cause $m[i] to not get updated with the map's value, while l is assigned the correct, non-nul, non-empty array value? in this example: m={}; l = $m[i] =|| x.map{|a| something.new(*a)}
[18:25:21] ljames: erm, I meant $m = {}
[18:25:57] ljames: for some reason when I run it, l has the right value, but $m[i] becomes []
[18:26:25] ljames: program works fine if I just remove the caching part with = $m[i] =||
[18:28:19] ljames: in other cases where I just have a = $cache[i] = func(...), it works fine, but for some reason the .map breaks it, I'm thinking I typo'd something somewhere, or some syntax weirdness
[18:32:05] ljames: but I don't want to modify the value of x, basically I have x = [1,2,3], and I want an array like [SomeObj.new(1),SomeObj.new(2),SomeObj.new(3)]?
[18:32:15] ljames: and I want that array stored in $m[i]
[19:27:22] ljames: hanmac, I ended up figuring out what the bug was. I was .pop'ing from that array afterwards without realizing the cache was being modified too, and that's why I ended up with empty arrays at the end. doing a = a.dup, solved the problem

2016-03-11

[16:04:10] ljames: has joined #ruby

2016-03-10

[02:25:12] ljames: I want to generate some code at runtime that will be used quite a lot during the program's runtime. The code cannot be generated at compile time because it completely depends on values known only at runtime. Efficiency is somewhat important because I expect to call the generated functions dozens of thousands of times to hundreds of thousands of times. How would I go about it? Eval some string of code, or maybe some sort of lambdas as closures?
[02:25:28] ljames: I would expect the lambdas to be cleaner to program, but maybe less efficient?
[02:25:49] ljames: and the evals to take longer to run the first time
[02:27:32] ljames: and I expect maybe few hundred generated functions, and each would be called as many times as I mentioned.
[02:30:39] ljames: havenwood, can you link me to the parts of the documentation I should read? I'm pretty new to Ruby
[02:30:56] ljames: I know of Proc and lambda, although not all the particulars
[02:31:57] ljames: I could obviously build the function body out of strings and generate the lambda string then eval it, but it seems ugly, even if I think it might be the most efficient way, because otherwise I have to build the lambdas out of many small chunks
[02:34:01] ljames: interesting
[02:34:43] ljames: a close enough example though would be that I would would be passed an array of unknown number of elements then I would need to generate a function that calls a function for each element of that array, so in your example I'd need 3 puts calls
[02:34:50] ljames: even the function body?
[02:37:45] ljames: Ox0dea, basically I'm reading some user inputted code in a restricted domain specific language and I need to compile that to something efficient, as the code will be called between 10-100k calls each.
[02:38:16] ljames: the language itself is simple enough that I could build it out of lambdas maybe, but I think it might be too slow
[02:39:12] ljames: Ox0dea, I could, but most of the code is written in Ruby already
[02:39:48] ljames: I guess if the performance is truly poor I'll do that, but for now I wanted to see how far I could get without switching languages
[02:41:06] ljames: Ox0dea, just a set of simple expressions like ((x+123)*456)^789, similar to that, where x will be supplied at runtime
[02:41:11] ljames: its not quite that, but similar enough
[02:41:15] ljames: not even a turing complete language
[02:41:38] ljames: however the generated code has to be called a lot
[02:42:24] ljames: the language the expressions are written isn't exactly that though
[02:43:39] ljames: I can live with 100 slowdown from C, but not with 10k slowdown
[02:44:13] ljames: take that expression and compile it to C code, then compile that to native code. now take the same expression in ruby and eval it
[02:44:31] ljames: is the ruby version runs 100 times slower it's acceptable to me, but 10000 slower and its no longer acceptable
[02:46:02] ljames: <havenwood> https://github.com/seattlerb/wilson <-- haha, thanks, I actually have access to another x86 assembler from within ruby (metasm), although I haven't looked into how to get it to execute the native code
[02:47:31] ljames: I guess if the performance is poor enough I can always go that way, as the variables in my expressions are fixed sized ints
[02:49:34] ljames: I suppose I'll have to benchmark it afterwards, or maybe not if it turns out to be of satisfactory speed
[02:51:36] ljames: thanks for the ideas havenwood, Ox0dea

2016-03-09

[16:04:22] ljames: has joined #ruby

2016-03-08

2016-03-07

[16:58:31] ljames: has joined #ruby

2016-03-06

2016-03-05

[15:59:22] ljames: has joined #ruby

2016-03-04

2016-03-03

[16:08:23] ljames: has joined #ruby

2016-03-02

[01:42:06] ljames: Ping timeout: 276 seconds
[01:57:52] ljames: has joined #ruby
[16:49:02] ljames: what's the simplest way to enumerate through an Array, finding an element that meets a condition and get its index, followed by performing a second test starting the found index until the test succeeds and then stopping, returning a second index? optionally, drop items between those 2 indexes from the array. is there a simple way of doing this, or should I just each_with_index?
[16:50:26] ljames: thanks adaedra, aegis3121. and flip flop might jsut work for it, thanks Ox0dea, will try
[16:52:39] ljames: flip flop might just be the most elegant way to do this, thanks

2016-03-01

[15:52:38] ljames: has joined #ruby

2016-02-29

2016-02-28

[16:02:33] ljames: has joined #ruby

2016-02-27

[12:35:30] ljames: how can I initialize an object using a variable number of arguments contained in another variable? for example calling "func *a" works, but "SomeObj.new *a" gives me an error?
[12:35:48] ljames: similar to "apply" in some other languages
[12:51:17] ljames: Papierkorb, it was in some third party library; and turns out I was passing invalid arguments in the *a, and it works now that I've fixed it. sorry for asking.

2016-02-26

[16:59:58] ljames: has joined #ruby

2016-02-25

[15:12:24] ljames: Ping timeout: 260 seconds
[15:27:03] ljames: has joined #ruby
[16:25:19] ljames: Ping timeout: 260 seconds
[16:45:54] ljames: has joined #ruby
[18:42:48] ljames: Ping timeout: 276 seconds

2016-02-24

[15:56:22] ljames: has joined #ruby
[16:44:54] ljames: Ping timeout: 260 seconds
[16:58:58] ljames: has joined #ruby

2016-02-23

[02:26:21] ljames: Remote host closed the connection
[02:26:56] ljames: has joined #ruby
[05:50:44] ljames: Ping timeout: 260 seconds
[06:40:40] ljames: has joined #ruby
[08:03:09] ljames: Ping timeout: 260 seconds
[08:17:18] ljames: has joined #ruby
[08:24:09] ljames: Ping timeout: 260 seconds
[08:55:05] ljames: has joined #ruby
[12:51:26] ljames: Read error: Connection reset by peer
[12:51:51] ljames: has joined #ruby

2016-02-22

[15:50:27] ljames: has joined #ruby

2016-02-21

[06:50:54] ljames: Ping timeout: 260 seconds
[07:04:25] ljames: has joined #ruby

2016-02-20

[16:01:21] ljames: has joined #ruby

2016-02-19

[09:18:30] ljames: has joined #ruby

2016-02-18

[16:56:44] ljames: has joined #ruby

2016-02-17

[09:52:38] ljames: *.net *.split
[09:57:21] ljames: has joined #ruby

2016-02-16

[14:08:55] ljames: has joined #ruby

2016-02-15

[19:10:03] ljames: Remote host closed the connection

2016-02-14

[13:57:31] ljames: has joined #ruby

2016-02-13

[00:06:03] ljames: has joined #ruby

2016-02-12

[11:48:43] ljames: has joined #ruby
[23:41:58] ljames: Remote host closed the connection

2016-02-10

[15:59:31] ljames: has joined #ruby

2016-02-09

2016-02-08

[08:32:03] ljames: has joined #ruby

2016-02-07

2016-02-06

[09:07:25] ljames: I'm looking at some old ruby code that used "case ... when : ..." syntax, maybe 50 or more instances of it, what's a good way of dealing with code like that? change all instances to when ... then ..., or is there a way to enable some sort of compatibility mode and just have the code just work?
[09:08:50] ljames: I meant "case ...: ..." syntax, rather than "case ... when ..."
[09:09:22] ljames: argh, "case ... when ...:" rather than "case ... when ... then", that is, the deprecated semicolon
[09:14:41] ljames: I suppose I'll do that then. ; would work fine too? as in, I shouldn't expect fall-through issues like is common with C's "if ... else ..." when you don't delimit the block and it only treats the first expression as part of the conditional's to-be-executed body? (I'm fairly new to Ruby, so I hope I'm understanding the syntax right)
[09:16:34] ljames: thanks, I suppose it should work, and if not, I'll just test it out
[09:26:06] ljames: Ox0dea, oh, 2 more unrelated questions, one a bit related to your nickname: any way to force it to print decimals as hexadecimal by default in irb or the like? and the second: I found myself doing a lot of method(args);1 or similar because I need to supress insanely large outputs when irb prints the object (manageable to a console, but if using Emacs not so manageable)
[09:26:20] ljames: and by that I mean Fixnums or other numbers
[09:29:50] ljames: I suppose I should try that, but I might need to do the same for Bignum too

2016-02-05

[21:39:36] ljames: has joined #ruby

2016-02-04

[08:37:32] ljames: has joined #ruby

2016-02-03

2016-02-01

[20:30:26] ljames: has joined #ruby

2016-01-31

[12:25:17] ljames: *.net *.split
[12:29:17] ljames: has joined #ruby

2016-01-30

[17:06:41] ljames: has joined #ruby

2016-01-29

2016-01-28

[16:09:59] ljames: has joined #ruby

2016-01-27

[03:07:20] ljames: Excess Flood
[03:08:00] ljames: has joined #ruby
[03:08:34] ljames: Excess Flood
[03:09:00] ljames: has joined #ruby

2016-01-26

[15:52:56] ljames: has joined #ruby

2016-01-25

2016-01-24

[10:38:24] ljames: has joined #ruby

2016-01-23

2016-01-22

[05:08:13] ljames: has joined #ruby
[18:49:09] ljames: has joined #ruby

2016-01-20

2016-01-19

[16:18:51] ljames: has joined #ruby