Activity Graph

Page 1 of 1


[20:16:20] relyks: has joined #ruby
[23:30:34] relyks: Quit: relyks


[20:19:40] relyks: has joined #ruby
[20:21:35] relyks: Client Quit
[20:24:16] relyks: has joined #ruby
[20:28:43] relyks: Client Quit


[00:11:38] relyks: Read error: Connection reset by peer


[23:32:25] relyks: has joined #ruby
[23:32:50] relyks: is there way to determine what exceptions can be produced from a method?
[23:44:53] relyks: Radar: for any method? but preferably one that's not in the standard library? i'm curious how you go about handling all exceptions that might result from someone else's code
[23:48:00] relyks: Radar: so there isn't a way without actually observing what exceptions are produced? nothing like calling .methods on an object to see its available methods?
[23:48:32] relyks: I guess that's a problem with dealing with dynamically typed code lol
[23:48:40] relyks: still love ruby <3
[23:49:37] relyks: yeah, true, but perhaps a method throws specific exception classes created by the maintainer
[23:49:50] relyks: but I agree


[04:25:05] relyks: has joined #ruby
[04:25:51] relyks: can you do something like this in ruby?
[04:26:05] relyks: (lambda { |location| (location['lat'], location['lng']) }).call(l)
[04:26:29] relyks: where you define a lambda expression and then call the lambda with an argument without defining the lambda in a variable?
[04:26:57] relyks: i'm just screwing around, but i can't get it work. i thought it'd be possible
[04:42:30] relyks: nevermind, just realized what I did wrong
[05:08:23] relyks: Radar: yeah, it was supposed to be an array :D I was thinking of the multiple assignment syntax. thanks
[05:09:02] relyks: Radar: I appreciate it :)
[05:09:16] relyks: cool, that you can do that. ruby is like lisp!!! :D
[07:01:53] relyks: Quit: relyks
[07:02:12] relyks: has joined #ruby
[07:15:36] relyks: Quit: relyks
[07:22:41] relyks: has joined #ruby
[07:22:50] relyks: Remote host closed the connection


[21:43:16] relyks: has joined #ruby
[22:55:25] relyks: Quit: relyks


[20:17:35] relyks: has joined #ruby
[22:21:09] relyks: Quit: Leaving.


[02:31:06] relyks: has joined #ruby
[02:31:32] relyks: is there a way to sort an array when some of the values are nil?
[02:33:04] relyks: nevermind, figured it out :)
[05:07:32] relyks: Quit: Leaving


[02:00:17] relyks: has joined #ruby
[02:44:20] relyks: how how do you iterate over a jagged array? when I do [1, [2, 3], 4].each { |e| puts e} it outputs each element including the ones in the second nested array
[02:44:41] relyks: I want it to be 1, [2, 3], 4 instead of 1, 2, 3, 4
[02:50:49] relyks: zenspider: when I use each, it iterates over every element separately including the ones in the nested array. i don't want it to iterate over the elements of the nested array separately
[02:50:58] relyks: zenspider: is that clearer?
[02:59:19] relyks: elomatreb: oh shit, you're right!
[02:59:56] relyks: thanks elomatreb and zenspider :)
[06:56:55] relyks: Ping timeout: 255 seconds
[16:06:11] relyks: has joined #ruby
[16:26:39] relyks: Ping timeout: 276 seconds


[00:00:09] relyks: has joined #ruby
[00:17:19] relyks: Ping timeout: 246 seconds
[01:52:24] relyks: has joined #ruby
[07:17:42] relyks: Quit: Leaving


[22:02:56] relyks: has joined #ruby
[22:24:57] relyks: ost number of dogs. does anyone have an idea of how i could approach this?
[22:24:57] relyks: i'm having trouble coming up with a solution to this problem. i have an array with objects. each object has 2 properties. i'm trying to optimize based on a constraint. i want the array to be sorted based on the minimum of the first property and the maximum of the second property. like let's say the array consists of type person. each person has a number of dogs and number of cats. i'm trying to find the person with the least number of cats and m
[22:27:14] relyks: havenwood: i think that's what i'm having trouble figuring out
[22:28:40] relyks: havenwood: wtf, that totally works :D how did you come with that?
[22:28:46] relyks: thanks so much :)
[22:31:14] relyks: havenwood: i'm having trouble understanding why subtracting one from the other works
[22:32:07] relyks: i'll think about it more. thanks so much havenwood :)
[22:46:01] relyks: why is it wrong?
[22:46:32] relyks: using havenwood's code as an example, i did owners.sort_by { |cats, dogs| cats - dogs }
[22:47:01] relyks: zenspider: i have no idea how your snippet works :D
[22:47:43] relyks: oh wait, i see how it works
[22:47:59] relyks: yeah that makes sense
[22:52:20] relyks: zenspider: yeah
[23:10:11] relyks: zenspider: i'd want the first one
[23:13:40] relyks: zenspider: i think yours is the correct solution
[23:13:58] relyks: because i need prioritize least cats over most dogs
[23:14:28] relyks: lol, this is also funny that i'm using this an example, but it's analogous to what i'm doing
[23:14:40] relyks: i'm not actually sorting cats and dogs :)
[23:48:35] relyks: Ping timeout: 240 seconds