« Back to channel list

#ruby - 28 March 2017

« Back 1 day Forward 1 day »
[00:00:01] Verity: in his code actually
[00:00:04] Verity: its done differently
[00:00:15] Verity: he & with a mask, then shifts the mask
[00:00:18] Verity: to get at the bits
[00:00:54] matthewd: Yeah, that's what I expected
[00:01:10] xnxq: has joined #ruby
[00:01:31] Verity: I was going to do it differently with an array of 1s and 0s and slicing it, maybe this makes no sense
[00:01:44] matthewd: .. and why I've been saying you should start from said code, for the last four hours
[00:01:59] Verity: especially when I don't understand even his algortithm fully or the math behind it, thats part of why I wanted to start from scratch though
[00:02:07] blackmesa: has joined #ruby
[00:02:08] Verity: I'll try to adapt his code to ruby.
[00:02:13] Verity: I'll take a break for a while for health
[00:02:51] lmc: has joined #ruby
[00:03:27] zeddan: has joined #ruby
[00:11:14] aglorei: has joined #ruby
[00:12:19] djbkd: has joined #ruby
[00:13:55] rakm: has joined #ruby
[00:15:30] enterprisey: has joined #ruby
[00:18:54] millerti: has joined #ruby
[00:20:33] uxp: has joined #ruby
[00:22:25] linduxed: has joined #ruby
[00:26:32] JeanCarloMachado: has joined #ruby
[00:28:10] muelleme_: has joined #ruby
[00:28:58] hutch34: has joined #ruby
[00:31:53] nofxx: has joined #ruby
[00:32:38] am55: has joined #ruby
[00:32:56] oddalot: has joined #ruby
[00:36:20] skweek: has joined #ruby
[00:38:17] lmc: has joined #ruby
[00:39:12] xnxq: has joined #ruby
[00:39:49] Yzguy: has joined #ruby
[00:40:42] lmc_: has joined #ruby
[00:41:32] Verity: str.each_entry do |b| b = b-1 end --- str.each_entry.map {|b| b = b-1} how is that different?
[00:42:52] bmurt: has joined #ruby
[00:43:00] rasca_: has joined #ruby
[00:43:46] rasca_: Hello everyone! While trying to run gitlab I'm getting the following weird error: https://gitlab.com/gitlab-org/gitlab-ce/issues/30124
[00:44:04] rasca_: Has anyone seen something like this? Do you have any idea what might be happening?
[00:44:15] brent__: has joined #ruby
[00:44:31] Channel6: has joined #ruby
[00:49:00] lmc: has joined #ruby
[00:51:16] olivier__: has joined #ruby
[00:52:49] centrx: has joined #ruby
[00:54:16] ncthom91: has joined #ruby
[00:54:59] hays_: has joined #ruby
[00:57:04] naprimer_2: has joined #ruby
[01:00:44] GodFather: has joined #ruby
[01:02:16] davorb: has joined #ruby
[01:03:05] xnxq: has joined #ruby
[01:04:38] agent_white: has joined #ruby
[01:05:37] Disavowed: rasca_: a quick google looks like your gprc_c.so is compiled for 32 bit when you want 64
[01:05:42] Verity: I got it =)
[01:06:16] Verity: >> str = "hello"; str = str.unpack('B*')[0]; str = str.chars; str = str.each.map {|bit| bit = bit.to_i}; str.class; str[1]; str[0];
[01:06:18] ruby[bot]: Verity: # => 0 (https://eval.in/762259)
[01:06:43] pwnd_nsfw: has joined #ruby
[01:07:37] Disavowed: Verity: Didn't someone yell at you yesterday for abusing the bot? Don't get in trouble - I like having you here!
[01:07:49] Verity: I'm not abusing it
[01:07:54] Verity: I'm using it to show things, just like they said.
[01:08:09] Verity: in this case, I'm showing my solution for critique
[01:08:40] Verity: and thanks, same to you
[01:08:47] Verity: people who yell at others should be more introspective
[01:09:14] Rodya_: has joined #ruby
[01:09:44] dlitvak: has joined #ruby
[01:11:10] roamingdog: has joined #ruby
[01:11:37] Verity: has joined #ruby
[01:11:40] gusrub: has joined #ruby
[01:13:49] Verity: has joined #ruby
[01:15:23] astrobunny: has joined #ruby
[01:15:55] milardovich: has joined #ruby
[01:21:24] bkxd: has joined #ruby
[01:21:25] Rodya__: has joined #ruby
[01:21:41] Chch: has joined #ruby
[01:24:03] patarr1: has joined #ruby
[01:24:32] harrycee: has joined #ruby
[01:24:40] nickjj_: has joined #ruby
[01:25:56] yaewa: has joined #ruby
[01:27:07] wsmoak: has joined #ruby
[01:27:22] Lloyd: has joined #ruby
[01:27:26] incomprehensibly: has joined #ruby
[01:27:44] andywojo: has joined #ruby
[01:28:11] AustinMatherne: has joined #ruby
[01:28:27] SuperLag: has joined #ruby
[01:28:28] aep: has joined #ruby
[01:28:39] olspookishmagus: has joined #ruby
[01:28:45] Verity: got a nice one line!
[01:28:53] Verity: >> bit_array = "string".unpack('B*')[0].chars.map{|char| char = char.to_i}
[01:28:54] ruby[bot]: Verity: # => [0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, ...check link for more (https://eval.in/762284)
[01:28:55] ozzloy: has joined #ruby
[01:29:04] Verity: making progress
[01:29:08] genpaku: has joined #ruby
[01:29:20] jsilver: has joined #ruby
[01:29:26] Drakevr: has joined #ruby
[01:29:28] Yzguy: has joined #ruby
[01:30:12] jsilver: say I have an array of hashes, with id keys in it, and I have another string "id, id, id, id". how do I sort the array of hashes by that list of ids?
[01:30:50] olivier__: has joined #ruby
[01:31:15] erlend: has joined #ruby
[01:31:16] DarkBushido: has joined #ruby
[01:31:16] DarkBushido: has joined #ruby
[01:31:49] bandu: has joined #ruby
[01:32:00] matthewd: jsilver: What do you have so far?
[01:32:30] Apocalypse: has joined #ruby
[01:32:36] segy: has joined #ruby
[01:33:08] lele: has joined #ruby
[01:33:12] jsilver: i have something which calls an api and says gives me ids 1...x and then it returns them out of order
[01:33:12] KramerC: has joined #ruby
[01:34:00] roamingdog: has joined #ruby
[01:36:13] GodFather: has joined #ruby
[01:39:29] nobitanobi: has joined #ruby
[01:40:00] lmc: has joined #ruby
[01:42:33] jeyraof^mbpr: has joined #ruby
[01:44:31] ekinmur: has joined #ruby
[01:46:53] milardovich: has joined #ruby
[01:47:58] allisio: Verity: Congratulations on "getting there", for some definition of the term.
[01:48:16] allisio: Be advised that #map uses the result of the block for the transformation, so that assignment to `char` is perfectly superfluous.
[01:50:34] nobitanobi: has joined #ruby
[01:51:38] aglorei1: has joined #ruby
[01:53:14] certainty: has joined #ruby
[01:54:37] hahuang61: has joined #ruby
[02:00:24] tolerablyjake: has joined #ruby
[02:01:30] mzo: has joined #ruby
[02:03:26] d^sh: has joined #ruby
[02:03:28] Pumukel: has joined #ruby
[02:05:23] libastral: has joined #ruby
[02:05:56] bmurt: has joined #ruby
[02:10:19] Yzguy: has joined #ruby
[02:13:04] astrobunny: has joined #ruby
[02:20:46] whiteline: has joined #ruby
[02:20:51] raspado: has joined #ruby
[02:21:02] Chch: has joined #ruby
[02:22:04] milardovich: has joined #ruby
[02:23:49] astrobunny: has joined #ruby
[02:26:55] jeyraof^mbpr: has joined #ruby
[02:27:36] MrJoshua: has joined #ruby
[02:31:00] raspado: has joined #ruby
[02:32:04] milardovich: has joined #ruby
[02:38:47] s2013: has joined #ruby
[02:43:04] Guest96_: has joined #ruby
[02:49:49] raspado: has joined #ruby
[02:52:07] marcdel: has joined #ruby
[02:52:34] bkxd: has joined #ruby
[02:54:10] Disavowed: allisio: Are you trying to write Ruby in Python again? :P
[02:54:23] allisio: Disavowed: Just digging.
[02:55:05] Disavowed: Don't leave here
[02:56:05] Jameser: has joined #ruby
[03:02:53] davorb: has joined #ruby
[03:08:30] rakm: has joined #ruby
[03:11:04] gnufied: has joined #ruby
[03:13:40] baweaver: Disavowed: I was just reminding them they have a REPL in their CLI.
[03:13:40] allisio: has joined #ruby
[03:14:03] baweaver: I'll let someone know if it's really a problem
[03:17:03] astrobunny: has joined #ruby
[03:17:17] gix: has joined #ruby
[03:18:35] JoshS: has joined #ruby
[03:18:49] Disavowed: baweaver: I think it was a bit of a mischaracterisation to say you yelled, too. Speaking of repls, does anyone have any preferable alternatives to pry?
[03:19:02] baweaver: Pry not working?
[03:19:34] Disavowed: No it's fine. Just wanted to make sure I wasn't missing out on anything
[03:20:31] Autolycus: has joined #ruby
[03:22:50] Disavowed: Just saw the plugins page. Perhaps I could soup it up a little
[03:32:26] BabyMario: has joined #ruby
[03:35:48] cyphase: has joined #ruby
[03:37:52] hahuang61: has joined #ruby
[03:40:31] NightMonkey: has joined #ruby
[03:41:35] lmc: has joined #ruby
[03:46:39] IRCFrEAK: has joined #ruby
[03:47:43] choke: has joined #ruby
[03:48:35] IRCFrEAK: has left #ruby: ()
[03:49:26] nickjj_: has joined #ruby
[03:50:32] astrobunny: has joined #ruby
[03:50:45] Vile`: has joined #ruby
[03:50:48] astrobunny: has joined #ruby
[03:51:14] knight33: has joined #ruby
[03:52:10] Sammichmaker: has joined #ruby
[03:53:03] MasterNayru: has joined #ruby
[03:54:03] jusa: has joined #ruby
[03:54:16] certainty: has joined #ruby
[03:55:38] heyimwill: has joined #ruby
[04:02:15] xnxq: has joined #ruby
[04:03:39] krasnus: has joined #ruby
[04:04:10] djbkd: has joined #ruby
[04:05:16] CloCkWeRX: has joined #ruby
[04:05:51] choke: has joined #ruby
[04:07:49] bocaneri: has joined #ruby
[04:11:22] milardovich: has joined #ruby
[04:11:26] Rodya_: has joined #ruby
[04:12:33] bocaneri: has joined #ruby
[04:20:23] Jameser: has joined #ruby
[04:25:16] grillon: has joined #ruby
[04:27:28] RenatoSilva: has joined #ruby
[04:38:19] bkxd: has joined #ruby
[04:42:24] rippa: has joined #ruby
[04:43:15] nowhere_man: has joined #ruby
[04:43:44] shinnya: has joined #ruby
[04:45:33] Pumukel: has joined #ruby
[04:49:06] skweek: has joined #ruby
[04:49:47] pulkit4tech: has joined #ruby
[04:51:35] raspado: has joined #ruby
[04:56:05] milardovich: has joined #ruby
[04:56:13] skweek: has joined #ruby
[05:02:28] davorb: has joined #ruby
[05:04:36] sneakerhax: has joined #ruby
[05:11:58] Rodya_: has joined #ruby
[05:13:08] nowhere_man: has joined #ruby
[05:15:03] jenrzzz: has joined #ruby
[05:18:06] username1: has joined #ruby
[05:19:36] zeddan: has joined #ruby
[05:25:23] astrobunny: has joined #ruby
[05:26:16] nofxxx: has joined #ruby
[05:26:46] nowhere_man: has joined #ruby
[05:28:44] hutch34: has joined #ruby
[05:30:26] jamesaxl: has joined #ruby
[05:31:02] Qchmqs: has joined #ruby
[05:31:53] nowhere_man: has joined #ruby
[05:33:44] renchan: has joined #ruby
[05:38:42] hahuang61: has joined #ruby
[05:40:27] jenrzzz: has joined #ruby
[05:40:28] jenrzzz: has joined #ruby
[05:40:48] ddffg: has joined #ruby
[05:42:19] lmc: has joined #ruby
[05:44:11] ledestin: has joined #ruby
[05:44:51] willardg: has joined #ruby
[05:45:24] pankaj_: has joined #ruby
[05:48:32] igniting: has joined #ruby
[05:52:04] nobitanobi: has joined #ruby
[05:54:46] nowhere_man: has joined #ruby
[05:54:59] certainty: has joined #ruby
[05:56:58] muelleme_: has joined #ruby
[05:58:07] HippoDippo: has joined #ruby
[06:03:54] HippoDippo: Is this sort method considered good or bad?: https://gist.github.com/anonymous/2c84cea470f2d9a004b5d4beca794eed
[06:04:15] certainty: has joined #ruby
[06:08:03] Verity: has joined #ruby
[06:11:42] herwin: it breaks when you input an empty array
[06:11:57] herwin: the array.length * 5 is completely arbitrary
[06:12:41] herwin: and of course you could just use Array#sort (but I assume this code was for educational purposes)
[06:13:19] Rodya_: has joined #ruby
[06:13:29] HippoDippo: yes i'm still learning
[06:15:31] cam27_: has joined #ruby
[06:15:57] HippoDippo: herwin: im guessing using recursion for this would be a good idea?
[06:17:05] elomatreb: Normally you terminate sort algorithms like this with a check if all elements are sorted, not with a static number of iterations
[06:18:13] elomatreb: Also, having both a return and a break in line 16/17 does nothing, return already terminates the loop
[06:19:06] herwin: HippoDippo: https://en.wikipedia.org/wiki/Bubble_sort
[06:19:17] herwin: this is pretty close to what you are trying to do
[06:23:39] jenrzzz: has joined #ruby
[06:23:40] jenrzzz: has joined #ruby
[06:23:42] bkxd: has joined #ruby
[06:24:15] HippoDippo: elomatreb: How would you check the array to see if the elements are sorted?
[06:24:31] Cohedrin: has joined #ruby
[06:25:04] Mortomes|Work: has joined #ruby
[06:25:14] elomatreb: Loop through it until you find an element that is larger than the next (assuming you want ascending order), immediately fail if you do. If you reach the end of the array without finding such an element, you're sorted
[06:25:34] HippoDippo: ahhh ok thanks
[06:26:16] elomatreb: Tip: Array#each_cons instead of fumbling about with index variables
[06:27:08] HippoDippo: So those index variables were bad?
[06:28:45] elomatreb: Not *bad*, but it's easy to make a mistake and e.g. accidentally get an element too much (past the end of the array). In other languages this might fail immediately, but in Ruby it silently returns nil
[06:29:04] elomatreb: >> a = [1, 2]; a[3]
[06:29:06] ruby[bot]: elomatreb: # => nil (https://eval.in/762429)
[06:30:31] HippoDippo: Ohh i see. I was basically trying to make a sort method with the bare essentials
[06:30:52] lubekpl: has joined #ruby
[06:31:05] last_staff: has joined #ruby
[06:33:12] gdonald: has joined #ruby
[06:37:40] green_hat: has joined #ruby
[06:39:03] andikr: has joined #ruby
[06:39:44] hahuang61: has joined #ruby
[06:40:16] jusa: has joined #ruby
[06:41:21] patarr: has joined #ruby
[06:41:45] muelleme_: has joined #ruby
[06:42:48] mark_66: has joined #ruby
[06:43:21] lmc: has joined #ruby
[06:43:37] herwin: you could start of with a very simple implementation (like "def sort(array); array.sort; end"), write a number of test cases for it, and then just keep changing things to get closer and closer to bare metal
[06:43:59] herwin: the test cases could be used to see if the implementation still works
[06:44:54] Verity: has joined #ruby
[06:50:01] Dfoolz: has joined #ruby
[06:50:11] Zarthus: has joined #ruby
[06:54:50] valentinul: has joined #ruby
[06:54:58] Arpanet69: has joined #ruby
[06:56:44] Kug3lis: has joined #ruby
[06:58:42] vali: has joined #ruby
[06:59:20] TomyWork: has joined #ruby
[07:03:03] davorb: has joined #ruby
[07:07:50] fmartingr: has joined #ruby
[07:09:21] govg: has joined #ruby
[07:10:39] jgnagy: has joined #ruby
[07:11:58] Tau: has joined #ruby
[07:12:54] nobitanobi: has joined #ruby
[07:13:49] Rodya_: has joined #ruby
[07:20:03] zeddan: has joined #ruby
[07:20:08] jaruga: has joined #ruby
[07:21:11] spicerack: has joined #ruby
[07:21:15] aufi: has joined #ruby
[07:23:33] jenrzzz: has joined #ruby
[07:23:42] nobitanobi: has joined #ruby
[07:23:46] pulkit4tech: has joined #ruby
[07:24:03] tAn: has joined #ruby
[07:25:16] nobitano_: has joined #ruby
[07:26:19] Sylario: has joined #ruby
[07:29:49] hutch34: has joined #ruby
[07:30:51] cfec0b8d: has joined #ruby
[07:31:09] antgel: has joined #ruby
[07:39:21] aganov: has joined #ruby
[07:41:48] nowhere_man: has joined #ruby
[07:42:38] esObe_: has joined #ruby
[07:44:14] flying: has joined #ruby
[07:46:50] biberu: has joined #ruby
[07:46:51] maattdd: has joined #ruby
[07:46:51] jud^: has joined #ruby
[07:47:45] xenops: has joined #ruby
[07:48:11] yurikoles: has joined #ruby
[07:51:25] burgestrand: has joined #ruby
[07:58:32] cfec0b8d: has joined #ruby
[07:58:35] snickers: has joined #ruby
[08:01:04] xywbtu: has joined #ruby
[08:01:27] binaryplease: has joined #ruby
[08:02:40] hurricanehrndz: has joined #ruby
[08:02:58] tvw: has joined #ruby
[08:07:52] avelldiroll: has joined #ruby
[08:08:32] charliesome: has joined #ruby
[08:09:25] User458764: has joined #ruby
[08:11:35] mikecmpbll: has joined #ruby
[08:11:51] olivier__: has joined #ruby
[08:13:01] czerasz: has joined #ruby
[08:16:04] Rodya_: has joined #ruby
[08:17:53] jsrn_: has joined #ruby
[08:18:39] tomphp: has joined #ruby
[08:22:17] siovene: has joined #ruby
[08:24:19] bronson_: has joined #ruby
[08:24:23] dionysus69: has joined #ruby
[08:24:35] bkxd: has joined #ruby
[08:28:07] maloik: has joined #ruby
[08:29:01] conta: has joined #ruby
[08:30:23] binaryplease: has joined #ruby
[08:38:59] nowhere_man: has joined #ruby
[08:40:32] hahuang61: has joined #ruby
[08:41:16] Beams: has joined #ruby
[08:42:16] patarr: has joined #ruby
[08:42:25] _2easy: has joined #ruby
[08:44:23] lmc: has joined #ruby
[08:45:29] banisterfiend: has joined #ruby
[08:51:36] pwnd_nsfw`: has joined #ruby
[08:52:40] binaryplease1: has joined #ruby
[08:54:23] gdonald: has joined #ruby
[08:58:44] doublemalt_: has joined #ruby
[09:01:42] certainty: has joined #ruby
[09:04:06] workmad3: has joined #ruby
[09:06:55] blackmesa: has joined #ruby
[09:07:10] rgr: has joined #ruby
[09:07:45] charliesome: has joined #ruby
[09:08:34] vasilakisFiL: has joined #ruby
[09:08:48] vasilakisFiL: can anyone help me why the last method here raises an error? https://gist.github.com/vasilakisfil/f6b5c6bdd6da0f60c24cba5c26433934
[09:09:34] fxa: has joined #ruby
[09:09:56] marr: has joined #ruby
[09:11:20] jgnagy: has joined #ruby
[09:14:07] lel: has joined #ruby
[09:15:45] canton7: vasilakisfil, what error, what line?
[09:16:38] Rodya_: has joined #ruby
[09:18:34] lxsameer: has joined #ruby
[09:23:00] zeddan: has joined #ruby
[09:24:12] chuff: has joined #ruby
[09:29:31] vasilakisFiL: canton7 in the last line of my gist I show what error I get
[09:29:50] vasilakisFiL: essentially the block within I define some methods is not passed in the class during the class initialization
[09:30:00] vasilakisFiL: maybe I am doing something wrong but I don't know how I can achieve that
[09:30:11] vasilakisFiL: I have seen folks in active admin do the same thing so it should be possible
[09:30:14] hutch34: has joined #ruby
[09:30:26] vasilakisFiL: canton7 here: https://gist.github.com/vasilakisfil/f6b5c6bdd6da0f60c24cba5c26433934#file-test-rb-L31
[09:31:04] vasilakisFiL: when I dynamically define a new class, it picks up the inheritence not the methods in the block though
[09:32:26] jenrzzz: has joined #ruby
[09:32:26] jenrzzz: has joined #ruby
[09:35:41] jusa: has joined #ruby
[09:36:51] matthewd: vasilakisfil: You need to either pass the block directly to Class.new as &block, or use instance_exec
[09:39:50] matthewd: vasilakisfil: But that's not an endorsement of the strategy; it looks unwise to me -- unconventional, opaque, class definitions aren't doing future developers any favours
[09:42:07] snickers: has joined #ruby
[09:42:21] fxa90id: has joined #ruby
[09:43:56] rgr_: has joined #ruby
[09:51:15] jusa: has joined #ruby
[09:55:15] vasilakisFiL: matthewd I know I am experimenting
[09:55:18] vasilakisFiL: thanks it worked !
[09:58:05] blackmesa: has joined #ruby
[10:01:58] elaptics: has joined #ruby
[10:02:53] ferr1: has joined #ruby
[10:06:51] govg: has joined #ruby
[10:10:27] bkxd: has joined #ruby
[10:11:20] mikecmpbll: has joined #ruby
[10:12:18] rhyselsmore: has joined #ruby
[10:15:03] tvw: has joined #ruby
[10:15:04] bascht1: has joined #ruby
[10:17:28] Rodya_: has joined #ruby
[10:18:11] binaryplease: has joined #ruby
[10:21:47] Emmanuel_Chanel: has joined #ruby
[10:28:46] hahuang61: has joined #ruby
[10:29:10] certainty: has joined #ruby
[10:31:02] hutch34: has joined #ruby
[10:32:34] facest: has joined #ruby
[10:36:19] jusa: has joined #ruby
[10:36:36] Fernando-Basso: has joined #ruby
[10:38:00] blackwind_123: has joined #ruby
[10:38:45] Fernando-Basso: has joined #ruby
[10:39:08] ncthom91: has joined #ruby
[10:41:36] charliesome: has joined #ruby
[10:42:29] Tau: has joined #ruby
[10:43:12] patarr: has joined #ruby
[10:45:59] govg: has joined #ruby
[10:48:29] bkxd: has joined #ruby
[10:53:47] bkxd: has joined #ruby
[10:54:01] charliesome: has joined #ruby
[10:55:16] jaruga: has joined #ruby
[10:56:12] olivier__: has joined #ruby
[10:56:37] olivier__: has joined #ruby
[11:03:34] davorb: has joined #ruby
[11:07:08] binaryplease: has joined #ruby
[11:08:43] username1: has joined #ruby
[11:08:53] charliesome: has joined #ruby
[11:08:59] zeddan: has joined #ruby
[11:09:09] TheWhip: has joined #ruby
[11:12:10] jgnagy: has joined #ruby
[11:14:39] |RicharD|: has joined #ruby
[11:18:06] Rodya_: has joined #ruby
[11:18:47] dionysus69: has joined #ruby
[11:22:58] Lord_of_Life: has joined #ruby
[11:24:34] heftig: has joined #ruby
[11:24:36] Giphy[m]: has joined #ruby
[11:24:38] Tagami[m]: has joined #ruby
[11:24:39] M107262[m]: has joined #ruby
[11:24:39] daveyboi[m]: has joined #ruby
[11:24:41] thulsa_legume[m]: has joined #ruby
[11:24:41] aviraldg: has joined #ruby
[11:24:41] travisr: has joined #ruby
[11:24:42] MicaFox[m]: has joined #ruby
[11:24:42] jakebriggs[m]: has joined #ruby
[11:24:43] el_ocho[m]: has joined #ruby
[11:24:43] dman[m]: has joined #ruby
[11:24:51] deviation: has joined #ruby
[11:25:26] velu_aon[m]: has joined #ruby
[11:30:44] hutch34: has joined #ruby
[11:34:05] jenrzzz: has joined #ruby
[11:39:08] flak: has joined #ruby
[11:41:25] User458764: has joined #ruby
[11:43:40] blackmesa: has joined #ruby
[11:44:47] nobitanobi: has joined #ruby
[11:48:38] zacts: has joined #ruby
[11:50:05] chuff: has joined #ruby
[11:53:03] ledestin: has joined #ruby
[11:54:42] kristofferR: has joined #ruby
[11:55:23] sepp2k: has joined #ruby
[11:55:44] mikecmpbll: has joined #ruby
[11:57:27] rippa: has joined #ruby
[11:57:42] certainty: has joined #ruby
[11:58:20] nettoweb: has joined #ruby
[12:03:04] chuff: has joined #ruby
[12:03:09] Jameser: has joined #ruby
[12:05:28] Lord_of_Life: has joined #ruby
[12:05:58] milardovich: has joined #ruby
[12:09:28] HoierM: has joined #ruby
[12:10:15] leito: has joined #ruby
[12:13:24] chuff: has joined #ruby
[12:15:43] moei: has joined #ruby
[12:16:43] synthroid: has joined #ruby
[12:20:34] nowhere_man: has joined #ruby
[12:24:39] Verity: has joined #ruby
[12:24:42] gnufied: has joined #ruby
[12:24:46] Verity: Should I try to copy his code directly into ruby?
[12:24:55] Verity: Or Should try to replace this nested for loop
[12:25:08] Verity: From what I understand ruby programmers don't use a lot of for loops
[12:25:22] nobitanobi: has joined #ruby
[12:25:23] Silthias1: has joined #ruby
[12:25:24] mikecmpbll: i'm trying to parse a DateTime in the current system's timezone
[12:25:57] elomatreb: Verity: You didn't post your code again
[12:25:59] mikecmpbll: what's the simplest way? for whatever reason DateTime.parse('07:00').to_time converts to local timezone
[12:26:12] mikecmpbll: so .to_time.to_datetime is an option :p
[12:29:39] hahuang61: has joined #ruby
[12:34:37] zeddan: has joined #ruby
[12:35:47] jenrzzz: has joined #ruby
[12:36:32] knight33: has joined #ruby
[12:37:55] Tau: has joined #ruby
[12:38:59] last_staff: has joined #ruby
[12:39:24] jusa: has joined #ruby
[12:39:41] gdonald: has joined #ruby
[12:43:41] brent__: has joined #ruby
[12:44:06] patarr: has joined #ruby
[12:45:15] TheWhip: has joined #ruby
[12:46:14] TheWhip: has joined #ruby
[12:47:50] jaruga: has joined #ruby
[12:49:23] jaruga: has joined #ruby
[12:50:18] yehowyada: has joined #ruby
[12:51:20] aupadhye: has joined #ruby
[12:55:34] charliesome: has joined #ruby
[13:00:38] ramortegui: has joined #ruby
[13:01:56] GodFather: has joined #ruby
[13:03:08] davorb: has joined #ruby
[13:04:06] meshsmith: has joined #ruby
[13:05:29] olivier__: has joined #ruby
[13:07:23] cdg: has joined #ruby
[13:07:36] spicerack: has joined #ruby
[13:10:46] cam27: has joined #ruby
[13:12:18] AgentVenom: has joined #ruby
[13:13:00] jgnagy: has joined #ruby
[13:13:36] dionysus69: has joined #ruby
[13:14:31] rikkipitt: has joined #ruby
[13:16:22] yurikoles: has joined #ruby
[13:19:54] Rodya_: has joined #ruby
[13:22:22] bmurt: has joined #ruby
[13:22:42] agent_white: has joined #ruby
[13:22:59] vali: has joined #ruby
[13:27:17] Verity: bug report submitted
[13:27:36] Pumukel: has joined #ruby
[13:28:09] Pumukel: has joined #ruby
[13:28:22] kernelPaniq: has joined #ruby
[13:30:14] ekinmur: has joined #ruby
[13:31:19] agent_white: Mornin' folks
[13:34:57] duckpupp1: has joined #ruby
[13:35:06] DLSteve: has joined #ruby
[13:37:25] centrx: has joined #ruby
[13:37:26] centrx: has joined #ruby
[13:39:55] gnufied: has joined #ruby
[13:40:32] Verity: >> for byte in 0..7 puts byte end
[13:40:33] ruby[bot]: Verity: # => /tmp/execpad-d51bbe2941a9/source-d51bbe2941a9:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/762721)
[13:40:42] Verity: how do I make that work with each
[13:41:15] Verity: >> for byte in 0..7 do puts byte end
[13:41:16] ruby[bot]: Verity: # => 0 ...check link for more (https://eval.in/762722)
[13:41:21] centrx: Verity: (0..7).each { |n| puts n }
[13:41:37] centrx: Verity: or (0..7).each do |n| puts n end for multi-line blocks
[13:41:47] Verity: ty, I see now
[13:42:59] shinnya: has joined #ruby
[13:44:14] TheWhip: has joined #ruby
[13:45:52] s2013: has joined #ruby
[13:48:04] TheWhip_: has joined #ruby
[13:48:22] jwsuiw: has joined #ruby
[13:49:09] lmc: has joined #ruby
[13:50:40] bkxd: has joined #ruby
[13:54:23] ldnunes: has joined #ruby
[13:55:23] Verity: Alright, I typed up and fully understood the C++ code. I tried it out a bit and it works. Then I tried to translate it to ruby. I'm close, and have made progress. I'm not there yet. I managed to get rid of all syntax errors, and now my only remaining problem is incorrect crc result.
[13:59:29] lmc: has joined #ruby
[13:59:33] [k-: has joined #ruby
[14:00:17] zeddan: has joined #ruby
[14:00:37] r3zn0v: has joined #ruby
[14:00:59] sofubi: has joined #ruby
[14:02:32] millerti: has joined #ruby
[14:03:25] Verity: Here is the full working C++ code: https://gist.github.com/anonymous/debc2b40a82c609e602d9e405deb7f44
[14:03:37] Verity: Here is the full broken Ruby code: https://gist.github.com/anonymous/ee69d5283498e370c3bcf1b25f51b7b3
[14:04:16] Verity: elomatreb, matthewd I've posted full code including the original and my attempted adaptation
[14:04:53] canton7: Verity, line 11 is different
[14:04:56] canton7: (line 11 in the ruby)
[14:05:20] Pumukel: has joined #ruby
[14:05:24] canton7: also, in ruby '0' is truthy, while in C it's falsy
[14:05:36] canton7: so those 'if' statemtents will need altering to take account of that
[14:05:36] elomatreb: ^ this. Your conditionals will always run
[14:05:57] canton7: so, the 'if' statements do the wrong test, and the 'if' statement on line 11 is backwards, and tests the wrong thing
[14:06:43] Verity: ok, I'll start with line 11
[14:07:25] Rodya_: has joined #ruby
[14:07:29] SirFunk: has joined #ruby
[14:07:37] matthewd: The C++ code is using the char[] as a list of 8-bit integers, so you probably want to pass packet.bytes
[14:07:51] matthewd: The final return is different/wrong too
[14:08:35] howdoi: has joined #ruby
[14:08:49] patarr: has joined #ruby
[14:09:08] tercenya: has joined #ruby
[14:09:20] matthewd: The inner loop should be 8.times
[14:10:51] matthewd: The outer one can be `7.times do |byte|` if you like
[14:14:25] Verity: ty, fixing these errors now
[14:17:31] Verity: what do you mean backwards
[14:20:32] centrx: statement if conditional_expression === if conditional_expression statement
[14:22:12] Verity: the while thing has to be rewritten I think
[14:22:24] Verity: I'm watching reg in the debugger and its growing huge
[14:22:53] Verity: so its not backwards, its my choice as I thought
[14:23:04] yeticry: has joined #ruby
[14:24:12] LyndsySimon: Is there anything link Kenneth Reitz's "Hitchhiker's Guide to Python" for Ruby? http://python-guide.org
[14:25:03] bmurt: has joined #ruby
[14:25:36] ldnunes: has joined #ruby
[14:25:43] centrx: Verity: It's the opposite of the C++ code
[14:26:17] chouhoulis: has joined #ruby
[14:27:02] ekinmur_: has joined #ruby
[14:28:54] canton7: Verity, the C++ says 'if(packet[byte] & mask) reg |= 1;'. The Ruby says the equivalent of 'if (reg |= 1) packet[byte].to_i & mask'
[14:29:05] hutch34_: has joined #ruby
[14:30:08] User458764: has joined #ruby
[14:30:14] nh`: has joined #ruby
[14:30:41] hahuang61: has joined #ruby
[14:30:43] canton7: Verity, also, "h".to_i is '0' in ruby, but 'h' is 104 in C/C++
[14:30:46] thadtheman: has joined #ruby
[14:32:44] ozcanesen: has joined #ruby
[14:33:25] Verity: I'll take a look at this
[14:33:51] deuterium: has joined #ruby
[14:33:56] elomatreb: >> "h".ord # is what you want Verity
[14:33:57] ruby[bot]: elomatreb: # => 104 (https://eval.in/762738)
[14:34:17] igniting: has joined #ruby
[14:34:25] Verity: packet[byte] is a fixnum though
[14:34:43] w0lf_: has joined #ruby
[14:34:52] ruby[bot]: elomatreb: # => "h" (https://eval.in/762739)
[14:34:59] matthewd: Not in the gist we're looking at it's not
[14:35:27] matthewd: Unless you've done my suggested "you probably want to pass packet.bytes", in which case it will be
[14:35:35] Verity: packet[byte]class ->>>>Fixnum
[14:35:41] Verity: ah yes, I did that
[14:35:45] canton7: update your gist then
[14:35:51] matthewd: (but I failed to note that assumes `packet` is a string, not the current array)
[14:36:04] Verity: I adjusted it
[14:36:34] jenrzzz: has joined #ruby
[14:36:35] jenrzzz: has joined #ruby
[14:36:37] Verity: https://gist.github.com/anonymous/721e3750b6f94355694e3ae278e47383
[14:36:48] canton7: you can modify gists btw, at least if you're signed into github
[14:36:49] snickers: has joined #ruby
[14:36:52] lmc: has joined #ruby
[14:37:14] canton7: right, so line 11 is still buggy, and packet[byte].to_i will still return 0 for almost everything
[14:37:27] canton7: and you're still assuming that 0 is falsy, when ruby treats it as truthy
[14:37:29] matthewd: canton7: No it won't
[14:37:55] canton7: matthewd, "1hello0"[1].to_i is 0. What am I missing?
[14:38:00] matthewd: (though the to_i is now unnecessary)
[14:38:01] canton7: aaah, .bytes, that's what
[14:39:38] matthewd: So yeah, flip 11, fix the zero conditionals, and this is sounding right
[14:39:46] toretore: has joined #ruby
[14:40:04] canton7: ah, no, not quite
[14:40:10] truenito: has joined #ruby
[14:40:23] blackmesa: has joined #ruby
[14:41:23] canton7: that 'reg <<= 1' line in the C++ looks odd. It's going to be execute 56 times, but only has 16 bits, so it's going to end up as 0 and stay as 0 fairly quickly
[14:41:45] canton7: ruby doesn't know that it's only 16 bits wide, and so won't do that - so you'll have a difference there
[14:42:24] canton7: ah no, I missed the 'reg |= 1', so the C++ is probably OK. Regardless, the ruby won't follow the same behaviour in some cases
[14:42:31] zeddan: has joined #ruby
[14:42:35] matthewd: Irrelevant, though it'll mean we have a bignum involved; the final result is masked on 16
[14:43:04] matthewd: Only the bottom 9 bits of reg are used
[14:43:13] matthewd: Oh and actually, none of the rest can get set
[14:43:30] matthewd: poly clears bit 9 any time it gets set, before it can be shifted further
[14:43:53] Verity: yes thats how it was supposed to function
[14:44:05] Verity: from my limited understanding of the algorithm
[14:44:21] Verity: let me take a look at the remaining errors
[14:44:49] Arpanet69: has joined #ruby
[14:44:59] canton7: also, given it's ruby, you'll probably want to do 'packet.each do |byte| on line 7 (and use 'byte' instead of 'packet[byte].to_i' on line 11)
[14:45:35] matthewd: Yeah, I was waiting until it was working, but +1
[14:45:53] matthewd: Line 4 can go away
[14:45:55] canton7: fair, I'm getting ahead of myself
[14:49:10] |RicharD|: has joined #ruby
[14:49:22] olivier__: has joined #ruby
[14:49:25] DaveTaboola: has joined #ruby
[14:50:09] nofxx: has joined #ruby
[14:51:35] bkxd: has joined #ruby
[14:53:08] Verity: thank you canton7 that looks much cleaner
[14:53:09] ChanServ: +o havenwood
[14:53:32] ChanServ: -o havenwood
[14:53:34] matthewd: Are we getting the right answers now?
[14:53:46] darix: havenwood: what did you change?
[14:54:00] havenwood: darix: Ruby 2.2.7 released!
[14:54:04] havenwood: https://www.ruby-lang.org/en/news/2017/03/28/ruby-2-2-7-released/
[14:55:15] havenwood: ACTION senses 2.3.4 in the mysterious future
[14:55:18] vuoto: has joined #ruby
[14:56:55] thadtheman: has joined #ruby
[14:59:22] Verity: flip 11 do you mean
[14:59:29] Verity: byte & mask if reg |= 1 >>> if reg |= 1 byte & mask
[14:59:33] Verity: I thought those were equivalent
[14:59:49] psychicist__: has joined #ruby
[14:59:50] matthewd: Those are equivalent, and neither match what the C++ is doing
[14:59:57] Verity: ok let me look more closely
[14:59:57] canton7: the C++ doesn't say 'if reg |= 1 byte & mask' though...
[15:00:29] pulkit4tech: has joined #ruby
[15:01:20] Verity: ah I see now what you meran
[15:01:26] Verity: that was a purely amateur mistake =\
[15:01:32] eblip: has joined #ruby
[15:01:59] ekinmur: has joined #ruby
[15:01:59] canton7: (the clue is that the condition shouldn't have side effects (and yours does), while the statement should actually do something (which yours doesn't)
[15:02:20] User458764: has joined #ruby
[15:04:30] choke: has joined #ruby
[15:04:54] Guest96: has joined #ruby
[15:06:37] Verity: https://ideone.com/7byrpM
[15:07:02] Verity: https://gist.github.com/anonymous/7e528bda46113cd3e866cf50adcb6672
[15:07:29] Verity: I managed to make the number change
[15:07:46] canton7: `|| nil` wut?
[15:07:50] Verity: its wrong by 10 though
[15:07:52] Verity: so almost there
[15:08:16] Verity: I wonder if I can just add 10 now, I doubt it
[15:08:58] matthewd: Your input packets don't match
[15:09:29] charliesome: has joined #ruby
[15:10:34] matthewd: {'1', 'h', 'e', 'l', 'o','0'} != "1hello0"
[15:11:42] matthewd: crc8("1helo0\0".bytes) == 116
[15:11:49] Verity: I see what you mean, I messed it up
[15:11:55] Verity: I have trouble with that sort of error
[15:12:03] Verity: but it seems to be working now!!!
[15:12:12] Verity: != 0 || nil w as thed fix
[15:12:21] canton7: the `|| nil` does exactly nothing
[15:12:29] canton7: since 'if nil' is always false
[15:12:41] herwin: just keep adding random statements until it compiles?
[15:12:57] Verity: herwin, yes
[15:13:05] Verity: thats easier now with the plugins I just got for vscode
[15:13:25] Verity: shows syntax errors before they happen, but can't help with this sort of semantic problem
[15:13:47] jgnagy: has joined #ruby
[15:14:07] canton7: "just keep adding random statements until it compiles" is supposed to be a very bad thing... You're not supposed to go "Yes! That's what I do!" :P
[15:14:31] Verity: its part of how I learn
[15:15:06] atom3: has joined #ruby
[15:16:23] jusa: has joined #ruby
[15:17:31] thadtheman: has joined #ruby
[15:21:43] Fernando-Basso: has joined #ruby
[15:21:53] tenderlove: has joined #ruby
[15:24:13] blackmesa: has joined #ruby
[15:24:33] patarr1: has joined #ruby
[15:25:37] Fernando-Basso: has joined #ruby
[15:27:16] meshsmith: has joined #ruby
[15:28:10] Verity: ACTION rages
[15:30:35] himmmmmm: has joined #ruby
[15:30:49] himmmmmm: i am having a problem with my caesar's cipher for some reason
[15:30:50] himmmmmm: https://repl.it/Gi7Y/0
[15:31:20] grillon: has joined #ruby
[15:31:27] himmmmmm: i don't understand why i am getting special characters or lowercase characters for that matter
[15:31:31] himmmmmm: i shouldn't be
[15:32:19] elomatreb: himmmmmm: I think you're printing the wrong variable
[15:32:20] tolerablyjake: has joined #ruby
[15:32:42] himmmmmm: elomatreb: sorry
[15:32:49] himmmmmm: before i had puts char.chr
[15:32:54] himmmmmm: and i am getting that
[15:32:59] himmmmmm: https://repl.it/Gi7Y/1
[15:33:08] Yzguy: has joined #ruby
[15:33:36] matthewd: himmmmmm: Your algorithm is wrong
[15:34:38] matthewd: Line 4 doesn't make sense
[15:34:45] baweaver: Explain to us what it's doing
[15:34:47] baweaver: line by line
[15:34:59] AndBobsYourUncle: has joined #ruby
[15:35:01] matthewd: The fact you don't use `rotate` at all is also a clue
[15:35:18] himmmmmm: i did before
[15:35:27] himmmmmm: i was just debugging and changed some stuff
[15:35:34] millerti: has joined #ruby
[15:35:50] himmmmmm: numbers has an array with a range of 65-90
[15:36:01] baweaver: matthewd: So if you solve a Caesar cypher by throwing random solutions at it, does it make it a Brutus force attempt?
[15:36:19] himmmmmm: rotate has a number that it is supposed to rotate the letters by
[15:36:34] himmmmmm: then the iterator iterates through each of those numbers
[15:36:37] baweaver: note that it's not being used as mentioned earlier.
[15:36:46] matthewd: baweaver: I think the fact I just actual-lolled confirms I really need to get some sleep :P
[15:36:48] thadtheman: has joined #ruby
[15:37:00] __Yiota: has joined #ruby
[15:37:00] himmmmmm: add is the variable that will add a number to rotate it by so it will never exceed 90
[15:37:05] baweaver: or you have a good sense of humor. I don't judge
[15:37:14] baweaver: himmmmmm you sure?
[15:37:26] brent__: has joined #ruby
[15:37:38] jenrzzz: has joined #ruby
[15:37:38] jenrzzz: has joined #ruby
[15:37:45] jgnagy: has joined #ruby
[15:37:52] ruby[bot]: baweaver: # => 0 (https://eval.in/762782)
[15:37:58] antoniobeyah: has joined #ruby
[15:38:05] ruby[bot]: baweaver: # => 12 (https://eval.in/762783)
[15:38:10] himmmmmm: i see what's haoppenning
[15:38:27] baweaver: &ri String#tr
[15:38:27] `derpy: http://ruby-doc.org/core-2.4.0/String.html#method-i-tr
[15:38:31] baweaver: that's faster.
[15:39:36] ResidentBiscuit: has joined #ruby
[15:39:38] himmmmmm: if i put an ugly if statement there will everyone hate me?
[15:39:38] baweaver: >> 'abcde'.chars # himmmmmm
[15:39:39] ruby[bot]: baweaver: # => ["a", "b", "c", "d", "e"] (https://eval.in/762784)
[15:39:50] baweaver: you don't need one
[15:40:22] Verity: its not right
[15:40:44] baweaver: >> 'abcde'.each_char.map { |c| c }
[15:40:45] ruby[bot]: baweaver: # => ["a", "b", "c", "d", "e"] (https://eval.in/762785)
[15:41:01] baweaver: if you do something in map you can have a new version of the string
[15:41:08] silva: has joined #ruby
[15:41:15] baweaver: though do note this is just ROT13
[15:41:27] baweaver: so tr is a much simpler solution.
[15:41:33] brent__: has joined #ruby
[15:41:42] baweaver: See the above link
[15:42:28] Lord_of_Life: has joined #ruby
[15:42:42] silva: hello, I'm having this error "undefined method `zip' for nil:NilClass" in this code line "latency.zip metric" I'm not a ruby programmer, I just wanna run a probram. What should I do?
[15:43:08] canton7: silva, 'latency' is nil
[15:43:32] matthewd: silva: Report a bug to whoever wrote the program
[15:43:35] silva: canton7: so I have to install latency gem?
[15:44:03] canton7: silva, I've no idea. That specific varilable is nil. I've no idea why that might be, from the information you've given us
[15:44:58] cagomez: has joined #ruby
[15:45:14] silva: this is the full code: https://github.com/nckrse/graphite-smokeping/blob/master/bin/graphite-smokeping, I don't undestand much of it
[15:45:28] cagomez_: has joined #ruby
[15:45:39] silva: (line 24)*
[15:45:41] himmmmmm: i can't read my own solution but who cares right?
[15:45:42] himmmmmm: https://repl.it/Gi7Y/2
[15:46:11] Verity: https://gist.github.com/anonymous/bae444858cfe30d6d5daf739314ba33e matthewd
[15:47:06] baweaver: silva: latency is defined on line 21
[15:47:12] baweaver: so that command isn't working.
[15:47:24] himmmmmm: my solution is very wrong
[15:47:27] Verity: wiat they come out to 48 in both
[15:47:33] Verity: I thoguth it was supposed to come back out as 0
[15:47:46] silva: baweaver: so it is a fucntion of Net::Fping library
[15:48:26] baweaver: so what it's doing is opening a file named spokeping_hosts and going over every line of it
[15:49:00] baweaver: so check your smokeping_hosts file and get the first line
[15:49:17] baweaver: then run `irb` in your terminal, it's a live Ruby environment you can play in
[15:49:21] matthewd: Verity: Hint: what is ASCII 48?
[15:49:42] baweaver: type in: require 'net/fping'
[15:49:47] User458764: has joined #ruby
[15:50:04] baweaver: then put in that line in place of dst: Net::Fping::latency("your first line here", "68", "6", "1000")
[15:50:15] baweaver: >> '' << 48
[15:50:16] ruby[bot]: baweaver: # => "0" (https://eval.in/762787)
[15:50:34] knight33: has joined #ruby
[15:50:38] silva: baweaver: thanks a lot! gonna try that :)
[15:50:47] baweaver: let us know how it goes
[15:51:05] baweaver: for some reason it's returning nil, so that's the issue. Most likely your file is borked
[15:51:10] silva: of course
[15:51:33] baweaver: though that code is rather silly
[15:51:35] Verity: matthewd, got it!!! =)
[15:51:45] Verity: thank you all for helping me get this translated
[15:52:24] matthewd: That doesn't sound right.. what did you just do?
[15:53:26] synthroid: has joined #ruby
[15:53:31] himmmmmm: this should work though... i don't get it
[15:53:31] himmmmmm: https://repl.it/Gi7Y/3
[15:54:32] silva: baweaver, this is the error output: https://gist.github.com/goaquin/c20051bf8ae65905d1cb3821d283eb12
[15:55:00] baweaver: ACTION blinks
[15:55:06] matthewd: himmmmmm: This is still waaayy off. Back up and think about the definition of the cipher. Forget about the ASCII parts.
[15:55:18] himmmmmm: i just add 13
[15:55:44] baweaver: silva: give me a sec
[15:55:52] matthewd: So which line is doing that?
[15:56:04] silva: baweaver: ok :)
[15:56:04] himmmmmm: OOOOOOHHHHHHHHHHHH
[15:56:08] himmmmmm: why am i so stupid
[15:56:13] himmmmmm: i will never know
[15:56:26] matthewd: Sounds like it's trying to run an fping executable
[15:56:36] baweaver: https://github.com/penguinpowernz/net-fping/blob/master/lib/net/fping.rb#L53
[15:56:38] himmmmmm: but i am rotating it by 13
[15:56:42] baweaver: was checking for the source
[15:56:45] himmmmmm: chr_num = n % rotate
[15:56:49] himmmmmm: rotate = 13
[15:57:14] Pumukel: has joined #ruby
[15:57:15] matthewd: That doesn't sound like "add" to me
[15:57:24] silva: baweaver, matthewd: so I have to intsall fpinglocaly
[15:57:30] gdonald: has joined #ruby
[15:57:37] baweaver: looks like it
[15:57:39] himmmmmm: chr_num + 65 or chr_num + n
[15:58:01] matthewd: And that doesn't sound like 13
[15:58:27] himmmmmm: but i did the mod to find out where the + 13 should be
[15:59:36] himmmmmm: i get it i think
[15:59:48] matthewd: himmmmmm: As I said: throw this away, and start from the actual definition. The only things this has in common with the right answer is that they both have a mod operation and an addition (but not in this order)
[15:59:59] Arpanet69: has joined #ruby
[16:00:24] matthewd: Verity: Yes, my immediate reply was to you. What does your code look like now?
[16:00:42] Verity: give me a minute, I'm adding it into the maina pplication now
[16:01:19] thadtheman: has joined #ruby
[16:01:23] silva: thanks guys that was the problem :)
[16:01:46] juggler: has joined #ruby
[16:05:22] username1: has joined #ruby
[16:05:52] baweaver: silva: https://github.com/penguinpowernz/net-fping/pull/3 - Also added a patch to the library
[16:06:04] baweaver: we'll see if they take it. It's basic but it'll work for now.
[16:06:42] xnxq: has joined #ruby
[16:07:18] willardg: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[16:07:39] Verity: now its wrong, this is odd
[16:08:10] himmmmmm: https://repl.it/Gi7Y/4
[16:10:06] matthewd: Line 6 should be 13, not rotate.. but otherwise it seems plausible
[16:10:26] matthewd: .. though that line could actually just be position -= 26, too
[16:10:45] Verity: now I'm getting 120 for the crc instead of 106 =\
[16:10:48] Verity: https://gist.github.com/anonymous/62b8ce8ea3ce8d3479e5960b44d32dcf
[16:10:54] baweaver: >> 'foobar'.tr('a-z','n-za-m') # himmmmmm :D
[16:10:55] ruby[bot]: baweaver: # => "sbbone" (https://eval.in/762788)
[16:10:56] Verity: after moving the function into my main program
[16:11:46] himmmmmm: baweaver: that's illegible
[16:12:39] baweaver: &ri String#tr
[16:12:39] `derpy: http://ruby-doc.org/core-2.4.0/String.html#method-i-tr
[16:12:44] matthewd: >> 'foobar'.tr('a-mn-z', 'n-za-m') # better?
[16:12:45] ruby[bot]: matthewd: # => "sbbone" (https://eval.in/762791)
[16:12:57] himmmmmm: yeah but a person who is not a coder will be like wtf
[16:13:20] baweaver: then why would they be reading code?
[16:13:37] lhcrkd: has joined #ruby
[16:13:42] matthewd: Said person is going to struggle with the significance of 65 & 90 just a little bit too ¯\_(ツ)_/¯
[16:13:45] himmmmmm: that's a good question
[16:14:06] himmmmmm: matthewd: what are you saying
[16:14:11] himmmmmm: i don't think that's coherent english
[16:14:43] himmmmmm: but that can be explained no?
[16:15:03] xnxq: has joined #ruby
[16:15:20] himmmmmm: https://repl.it/Gi7Y/5
[16:15:49] llaine: has joined #ruby
[16:16:02] baweaver: Now what if you need to ROT13 some arbitrary string?
[16:16:25] kegster: has joined #ruby
[16:16:54] matthewd: It's fun to implement it "manually" as an exercise, but if someone actually tried to commit this instead of using the appropriate built-in function, "it's easier for a non-programmer to read" would not get it past code review
[16:17:25] matthewd: Verity: Is that because you're now including EOT?
[16:17:29] cam27: has left #ruby: ()
[16:17:44] himmmmmm: can we petition to change the spaceship operator to something that looks more like a spaceship?
[16:18:01] himmmmmm: <=> to 8==D
[16:18:11] baweaver: !troll himmmmmm
[16:18:12] ruby[bot]: +bb himmmmmm!*@*$#ruby-banned *!*@gateway/web/freenode/ip.216.114.94.31$#ruby-banned
[16:18:12] ruby[bot]: ruby[bot] kicked himmmmmm: is a bannable offense, see http://ruby-community.com/pages/user_rules
[16:19:14] olivier__: has joined #ruby
[16:20:16] havenwood: >> alias 🚀 <=>; 42.🚀 42
[16:20:18] ruby[bot]: havenwood: # => 0 (https://eval.in/762805)
[16:20:50] Verity: >> "hello".bytes.map!{|b| b = b+13}.pack('C*')
[16:20:51] ruby[bot]: Verity: # => "uryy|" (https://eval.in/762807)
[16:21:14] millerti: has joined #ruby
[16:21:14] [Butch]: has joined #ruby
[16:21:19] Verity: my rot13 encoder
[16:21:35] burgestrand: has joined #ruby
[16:21:45] Verity: >> "uryy|".bytes.map!{|b| b = b-13}.pack('C*')
[16:21:46] ruby[bot]: Verity: # => "hello" (https://eval.in/762812)
[16:21:56] Verity: I'm learning!!!
[16:22:12] Verity: contrary to the beliefs of some
[16:22:15] matthewd: Don't need the assignment, or the !
[16:22:42] Verity: b-13 === b = b-13?
[16:23:05] matthewd: map cares about the result of the block, not what value ends up in the variable
[16:23:21] baweaver: >> [1,2,3].map { 1 }
[16:23:21] gusrub: has joined #ruby
[16:23:22] ruby[bot]: baweaver: # => [1, 1, 1] (https://eval.in/762817)
[16:23:34] Verity: so it just sets each element to the result of the block
[16:23:47] baweaver: >> a = [1,2,3]; a.map { 1 }; a
[16:23:48] ruby[bot]: baweaver: # => [1, 2, 3] (https://eval.in/762820)
[16:24:01] xnxq: has joined #ruby
[16:24:08] baweaver: it returns a new collection which is the result of applying a function to each element
[16:24:17] baweaver: >> a = [1,2,3]; a.map { 1 }
[16:24:18] ruby[bot]: baweaver: # => [1, 1, 1] (https://eval.in/762822)
[16:24:22] matthewd: &ri Enumerable#map
[16:24:23] `derpy: http://ruby-doc.org/core-2.4.0/Enumerable.html#method-i-map
[16:24:32] baweaver: map doesn't mutate what it's called on. map! does
[16:25:25] llaine: has joined #ruby
[16:26:01] TheWhip: has joined #ruby
[16:26:28] nadir: has joined #ruby
[16:26:32] marxarelli: has joined #ruby
[16:27:06] xnxq: has joined #ruby
[16:27:41] KnownSyntax: has joined #ruby
[16:28:19] Rodya_: has joined #ruby
[16:29:00] Rodya__: has joined #ruby
[16:29:56] kristofferR: has joined #ruby
[16:31:34] czerasz: has joined #ruby
[16:33:46] amclain: has joined #ruby
[16:34:14] montanonic: has joined #ruby
[16:34:34] ledestin: has joined #ruby
[16:36:34] burgestrand: has joined #ruby
[16:38:07] jenrzzz: has joined #ruby
[16:43:31] doublemalt_: has joined #ruby
[16:44:34] milardovich: has joined #ruby
[16:45:59] milardovich: has joined #ruby
[16:46:13] TomyLobo2: has joined #ruby
[16:46:45] nowhere_man: has joined #ruby
[16:46:51] TheWhip: has joined #ruby
[16:47:44] Pumukel: has joined #ruby
[16:47:47] olivier__: has joined #ruby
[16:51:13] Pumukel: has joined #ruby
[16:52:14] bkxd: has joined #ruby
[16:55:00] ddffg: has joined #ruby
[16:57:06] dhollinger: has joined #ruby
[16:58:41] Xiti: has joined #ruby
[17:00:51] hugorincon: has joined #ruby
[17:01:30] hahuang61: has joined #ruby
[17:03:41] davorb: has joined #ruby
[17:05:03] RenatoSilva: has joined #ruby
[17:06:02] dengar007: has joined #ruby
[17:07:22] montanonic: has joined #ruby
[17:07:23] AndBobsYourUncle: has joined #ruby
[17:08:37] User458764: has joined #ruby
[17:10:21] t-recx: has joined #ruby
[17:12:54] ejnahc: has joined #ruby
[17:14:34] hahuang65: has joined #ruby
[17:15:52] snapcase: has joined #ruby
[17:20:49] gusrub: has joined #ruby
[17:23:29] MittelDank: has joined #ruby
[17:25:07] Ebok: has joined #ruby
[17:26:05] cagomez: has joined #ruby
[17:28:57] gusrub: has joined #ruby
[17:29:15] muelleme_: has joined #ruby
[17:30:15] pulkit4tech: has joined #ruby
[17:34:17] enterprisey: has joined #ruby
[17:35:04] ThatsNotJack: has joined #ruby
[17:38:56] gusrub: has joined #ruby
[17:40:21] tomphp: has joined #ruby
[17:42:18] jenrzzz: has joined #ruby
[17:42:19] jenrzzz: has joined #ruby
[17:43:49] certainty: has joined #ruby
[17:45:28] thadtheman: has joined #ruby
[17:46:51] raspado: has joined #ruby
[17:48:22] adavia: has joined #ruby
[17:51:15] tolerablyjake: has joined #ruby
[17:53:22] Rodya_: has joined #ruby
[17:57:02] slackbotgz: has joined #ruby
[17:57:28] Lord_of_Life: has joined #ruby
[17:57:49] spider-mario: has joined #ruby
[17:58:59] tomphp: has joined #ruby
[17:59:28] Lord_of_Life: has joined #ruby
[18:00:56] brendan-: has joined #ruby
[18:01:11] milardovich: has joined #ruby
[18:01:14] tolerablyjake: has joined #ruby
[18:01:39] rakm: has joined #ruby
[18:03:27] hutch34_: has joined #ruby
[18:06:16] adavia: This is not working as expected but if i have 6 answers then for each existing answer is adding the same amount of nil values to the array https://gist.github.com/adavia/c518cf08cea12f6c05d4c67acdd2d159
[18:06:45] milardovich: has joined #ruby
[18:06:49] tomphp: has joined #ruby
[18:08:16] ldnunes: has joined #ruby
[18:11:12] hxegon: has joined #ruby
[18:11:37] hxegon: has joined #ruby
[18:11:44] xnxq: has joined #ruby
[18:12:01] hxegon: has joined #ruby
[18:12:55] jhass: adavia: could you add sample input and desired and actual output?
[18:16:14] thadtheman: has joined #ruby
[18:16:26] knight33: has joined #ruby
[18:18:05] tomphp: has joined #ruby
[18:18:43] tercenya: has joined #ruby
[18:20:16] brent__: has joined #ruby
[18:24:29] tAn: has joined #ruby
[18:26:16] SeepingN: has joined #ruby
[18:27:42] gloscombe: has joined #ruby
[18:28:06] jenrzzz: has joined #ruby
[18:28:07] jenrzzz: has joined #ruby
[18:30:50] elaptics_: has joined #ruby
[18:33:15] psychici1t__: has joined #ruby
[18:34:01] meshsmith: has joined #ruby
[18:34:06] centrx: has joined #ruby
[18:34:26] sepp2k: has joined #ruby
[18:34:28] kirun: has joined #ruby
[18:35:09] araujo: has joined #ruby
[18:36:47] cfec0b8d: has joined #ruby
[18:38:17] tAn: has joined #ruby
[18:39:52] millerti: has joined #ruby
[18:40:01] moei: has joined #ruby
[18:40:22] renchan: has joined #ruby
[18:41:07] thadtheman: has joined #ruby
[18:41:24] Renich: has joined #ruby
[18:42:54] Fernando-Basso: has joined #ruby
[18:44:56] porton: has joined #ruby
[18:45:45] porton: I've read "the first edition of the Pragmatic Programmers’ book". What to read next: Ruby User's Guide or https://en.wikibooks.org/wiki/Ruby_Programming? (I am an advanced programmer but new with Ruby)
[18:46:38] porton: I need it for Rails
[18:48:53] esObe_: has joined #ruby
[18:49:09] adam12: porton: POODR always gets praise.
[18:49:37] porton: adam12: what is POODR?
[18:49:54] adam12: porton: http://www.poodr.com
[18:50:51] porton: adam12: I think I am good with OOP. I need Ruby specifics not general ideas
[18:51:12] adam12: porton: Not a book but RubyTapas is pretty decent.
[18:52:59] bkxd: has joined #ruby
[18:53:15] porton: adam12: I'd prefer more classical book or manual
[18:54:14] blackmesa: has joined #ruby
[18:54:16] govg: has joined #ruby
[18:54:28] porton: I mean an online book or manual
[18:54:40] porton: Ruby User's Guide or https://en.wikibooks.org/wiki/Ruby_Programming?
[18:54:55] gusrub: has joined #ruby
[18:55:22] Ebok: Have you Read the Community Guidelines for Ruby? I found it extremely useful when learning the language.
[18:55:58] Ebok: It's mostly syntax, but due to that it ends up being a great list of features.
[18:56:07] THEKKKLAN: has joined #ruby
[18:56:13] Ebok: Which can be easily googleable / testable
[18:56:43] ged: has joined #ruby
[18:58:03] mahlon: has joined #ruby
[19:00:21] porton: I see [[Exceptions]] in https://en.wikibooks.org/wiki/Ruby_Programming is 0% developed. So I assume it is a work in progress and I should read Ruby User's Guide instead. Right?
[19:01:01] SeepingN: thanks for the POODR ref
[19:01:17] THEKKKLAN: I'm writing a ruby app that educates the ignorant about the dangers of immigrants kikes and niggers
[19:01:22] SeepingN: just what I need to write real ruby and not this functional garbage
[19:02:07] ruby[bot]: elomatreb: ops currently in #ruby: adaedra, aredridel, havenwood, Radar, apeiros, baweaver, helpa, jhass, ljarvis, matthewd, miah, ruby[bot] and zzak
[19:02:19] havenwood: !badnick THEKKKLAN
[19:02:19] ruby[bot]: +bb THEKKKLAN!*@*$#ruby-banned *!*@gateway/web/freenode/ip.172.58.12.6$#ruby-banned
[19:02:19] ruby[bot]: ruby[bot] kicked THEKKKLAN: is not suitable for this channel, see http://ruby-community.com/pages/user_rules
[19:03:23] Disavowed: Poodr looks really good actually. I was trying to work through a Sandy Metz blog post in a similar vein but keep putting it off. Thank you adam12
[19:03:37] adam12: Disavowed: Sandi's done a bunch of great talks too, on Youtube.
[19:03:55] gloscombe: has joined #ruby
[19:03:58] chouhoul_: has joined #ruby
[19:04:15] davorb: has joined #ruby
[19:04:56] futilegames: has joined #ruby
[19:05:06] chouhoul_: has joined #ruby
[19:05:13] futilegames: has left #ruby: ()
[19:06:14] thadtheman: has joined #ruby
[19:07:34] havenwood: Disavowed: +1 Sandi Metz talks, worth watching
[19:08:03] havenwood: Disavowed: https://confreaks.tv/presenters/sandi-metz
[19:08:23] [Butch]: has joined #ruby
[19:10:38] naztharune: has joined #ruby
[19:10:52] wkoszek: has joined #ruby
[19:11:21] xnxq: has joined #ruby
[19:12:50] yqt: has joined #ruby
[19:13:17] Disavowed: I had no clue Sandi Metz is female. TIL
[19:15:36] tomphp: has joined #ruby
[19:18:22] ujjain: has joined #ruby
[19:18:22] ujjain: has joined #ruby
[19:18:28] millerti: has joined #ruby
[19:23:59] wkoszek: has joined #ruby
[19:24:40] tvw: has joined #ruby
[19:26:30] [Butch]: has joined #ruby
[19:27:32] kazo: has joined #ruby
[19:27:52] ujjain: has joined #ruby
[19:27:52] ujjain: has joined #ruby
[19:28:13] hxegon: haven't seen a bad one yet :)
[19:28:25] __Yiota: has joined #ruby
[19:29:08] jamesaxl: has joined #ruby
[19:30:24] hxegon: kazo: hello
[19:30:55] kazo: hxegon: I am new to ruby
[19:31:07] Azure|dc: has joined #ruby
[19:31:19] cagomez: has joined #ruby
[19:31:27] kazo: hxegon: reading a tutorial lead me to this IRC chat
[19:32:25] hxegon: must have been a decent tutorial then :P
[19:32:26] jamesaxl: has joined #ruby
[19:33:16] SeepingN: possibly the best
[19:34:07] kazo: hxegon: it is my first tutorial and I really it
[19:36:14] hxegon: kazo: do you want some ruby problems to chew on?
[19:36:55] kazo: I am a newbie
[19:37:08] kazo: lets first read the tutorial until the end
[19:37:13] ahrs: has joined #ruby
[19:37:21] kazo: and I will be ready for the challenge
[19:40:38] Rodya_: has joined #ruby
[19:43:06] jenrzzz: has joined #ruby
[19:43:07] jenrzzz: has joined #ruby
[19:43:34] daivyk: has joined #ruby
[19:43:45] montanonic: has joined #ruby
[19:45:35] cagomez: has joined #ruby
[19:46:36] olivier__: has joined #ruby
[19:46:59] bmurt: has joined #ruby
[19:47:37] Yzguy: has joined #ruby
[19:48:59] millerti: has joined #ruby
[19:49:19] milardovich: has joined #ruby
[19:49:53] olivier__: has joined #ruby
[19:50:46] chouhoulis: has joined #ruby
[19:56:10] __Yiota: has joined #ruby
[19:56:36] vasilakisFiL: has joined #ruby
[20:00:56] ahrs: has joined #ruby
[20:01:19] thadtheman: has joined #ruby
[20:02:17] adavia: jhass: https://gist.github.com/adavia/c518cf08cea12f6c05d4c67acdd2d159
[20:03:17] code_zombie: has joined #ruby
[20:03:23] jhass: adavia: so you need to either repeat all checks in a single if that adds the nil or keep a boolean to decide at the end whether or not to add the nil
[20:03:54] jhass: or you make it an if/elsif chain if only ever ony of the keys is present/accepted
[20:04:14] adavia: I guess i tried that
[20:04:27] tercenya: has joined #ruby
[20:05:26] montanonic: has joined #ruby
[20:07:05] jhass: so what's the desired output for [{answer_open: "foo", answer_image: "bar"}]?
[20:07:37] adavia: i need to output a new array as ["Foo", nil, "Bar"]
[20:08:07] jhass: that doesn't seem to answer my question
[20:08:31] ionte: has joined #ruby
[20:09:02] adavia: jhass: in that case ["foo", "bar"]
[20:09:07] tercenya: has joined #ruby
[20:10:04] jhass: and [{answer_open: "", answer_image: ""}] ?
[20:10:16] adavia: [nil, nil]
[20:10:28] xnxq: has joined #ruby
[20:10:51] jhass: how about [{answer_open: nil, answer_image: nil}] then?
[20:11:21] adavia: That should return also [nil, nil]
[20:12:25] bkxd: has joined #ruby
[20:12:41] bheesham: has joined #ruby
[20:13:33] hxegon: >> [{answer_open: "Foo"}, {answer_image: ""}, {answer_image: "Bar"}].flat_map { |h| h.map { |_, v| v unless v.empty? } } # adavia
[20:13:33] jhass: alright, one more: [{answer_open: "foo", answer_image: nil}, {answer_open: nil, answer_image: "bar"}]
[20:13:34] ruby[bot]: hxegon: # => ["Foo", nil, "Bar"] (https://eval.in/762975)
[20:14:02] jhass: hxegon: clearly homework :/
[20:14:09] allisio: hxegon: Naughty, naughty.
[20:14:15] hxegon: whoops :|
[20:14:42] hxegon: sorry adavia, pay no attention to my assetry
[20:15:32] electrostat: has joined #ruby
[20:16:50] ResidentBiscuit: has joined #ruby
[20:17:55] cdg: has joined #ruby
[20:18:12] adavia: jhass: [["foo", nil], [nil, "bar"]]
[20:18:40] jhass: now that's quite different to all you previous examples
[20:20:02] jhass: I couldn't find a clear pattern in your answers and I think that's your main issue. Try to get a clearer understanding on what should transform to what and what the constraints on your input are exactly
[20:21:03] jhass: for example given the last one, why wouldn't [{answer_open: "foo"}] translate to [["foo"]] or even [["foo", nil]]?
[20:21:14] adavia: jhass: Still theres no input like [{answer_open: "foo", answer_image: nil}, {answer_open: nil, answer_image: "bar"}]
[20:21:43] jhass: well then you should've said so as I posed the example ;)
[20:22:13] adavia: Yeah sorry i wasnt paying attention
[20:22:27] jhass: yet enough to come up with some output
[20:22:41] brent__: has joined #ruby
[20:23:09] jhass: the question remains whether [{answer_open: "foo", answer_image: nil}] is valid or different from [{answer_open: "foo"}]
[20:24:04] adavia: jhass: Thats valid.. in that case i should get ["foo"]
[20:24:33] adavia: ["foo", nil] ["foo"]
[20:24:40] gusrub: has joined #ruby
[20:24:48] jhass: so why'S the first different from the second?
[20:25:00] gusrub: has joined #ruby
[20:25:13] jhass: given {}[:answer_open] returns nil
[20:25:49] adavia: jhass: i want to raplace any blank values with nil
[20:26:28] jhass: blank in the rails/AS sense or as in String#empty?
[20:27:15] adavia: jhass: in the rails sense should be present?
[20:27:42] brent__: has joined #ruby
[20:28:22] jhass: then one could argue that, given nil is blank?/!present? and {}[:foo] returns nil, a non-existent key is as blank as one pointing to the empty string
[20:28:33] pabloh: has joined #ruby
[20:29:34] jhass: don't get me wrong, it can be entirely valid to treat a non-existent key differently than one set to nil, I just want to make sure you have a good reason to do so
[20:31:19] workmad3: has joined #ruby
[20:31:50] jhass: especially since your target datastructure seems rather lossy, for example [{answer_open: "foo"}, {answer_image: "bar"}] and [{answer_image: "foo"}, {answer_open: "bar"}] both would convert into the same output
[20:32:02] adavia: jhass: the real explanation is to export a csv with blank values in case attributes are not present. Otherwise the headers do not match with my rows lol
[20:32:26] jhass: so what's your headers?
[20:33:43] adavia: "answer_open", "answer_image" and for those i need "foo" "bar" or nil, "bar" or nil, "bar"
[20:34:00] adavia: "bar", nil
[20:34:39] jhass: so it should be an array of two element arrays after all, no?
[20:35:11] jhass: well none of your examples had that except the last one for the invalid input
[20:35:21] bkxd: has joined #ruby
[20:35:51] jhass: assuming rails context: answers.map {|answer| [answer[:answer_open].presence, answer[:answer_image].presence] }
[20:36:11] xnxq: has joined #ruby
[20:39:14] cyphase: has joined #ruby
[20:40:28] azwieg103: has joined #ruby
[20:44:19] thadtheman: has joined #ruby
[20:46:07] Rodya_: has joined #ruby
[20:46:24] ldnunes: has joined #ruby
[20:46:48] Rodya__: has joined #ruby
[20:48:35] Xiti: has joined #ruby
[20:50:41] darmou: has joined #ruby
[20:52:59] username1: has joined #ruby
[20:56:43] blackmesa: has joined #ruby
[21:01:55] Rutix: has joined #ruby
[21:01:55] Rutix: has joined #ruby
[21:03:21] darmou: has joined #ruby
[21:03:50] davorb: has joined #ruby
[21:03:59] gdonald: has joined #ruby
[21:06:31] millerti: has joined #ruby
[21:06:43] LuckyABA: has joined #ruby
[21:08:49] SeepingN: has joined #ruby
[21:09:04] enterprisey: has joined #ruby
[21:09:56] thadtheman: has joined #ruby
[21:10:22] jusa: has joined #ruby
[21:14:06] meshsmith: has joined #ruby
[21:18:13] cdg_: has joined #ruby
[21:21:49] volty: has joined #ruby
[21:22:40] GodFather_: has joined #ruby
[21:24:12] montanonic: has joined #ruby
[21:32:13] gusrub: has joined #ruby
[21:33:55] Tau: has joined #ruby
[21:34:10] czerasz: has joined #ruby
[21:36:16] mikecmpbll: has joined #ruby
[21:43:18] johnzorn: has joined #ruby
[21:47:31] Rodya_: has joined #ruby
[21:48:11] thadtheman: has joined #ruby
[21:48:54] gloscombe: has left #ruby: ()
[21:49:09] hutch34_: has joined #ruby
[21:54:15] dionysus69: has joined #ruby
[21:56:16] kegster: has joined #ruby
[21:57:10] gloscombe: has joined #ruby
[22:00:30] postmodern: has joined #ruby
[22:01:31] yokel: has joined #ruby
[22:04:54] cagomez: has joined #ruby
[22:09:00] Gaelan: has joined #ruby
[22:09:32] Gaelan: Anyone know of a good way to call Cocoa from Ruby?
[22:09:51] Gaelan: RubyMotion is probably not an option, this is an OSS project and there shouldn’t be a $200 fee to contribute
[22:10:52] montanonic: has joined #ruby
[22:11:03] Jayson_Virissimo: has joined #ruby
[22:11:49] marxarelli: has joined #ruby
[22:13:09] hutch34_: has joined #ruby
[22:20:23] cagomez: has joined #ruby
[22:24:27] hxegon: has joined #ruby
[22:38:00] millerti: has joined #ruby
[22:39:59] br0d1n: has joined #ruby
[22:43:19] thadtheman: has joined #ruby
[22:43:43] spicerack: has joined #ruby
[22:45:28] oncall-pokemon: has joined #ruby
[22:46:11] Synthead: has joined #ruby
[22:49:18] patarr: has joined #ruby
[22:49:34] chouhoul_: has joined #ruby
[22:53:17] cpruitt: has joined #ruby
[22:56:32] montanonic: has joined #ruby
[22:57:38] Verity: has joined #ruby
[22:58:30] SeepingN: well damn. It appears that "trap
[22:58:45] SeepingN: well damn. It appears that "trap" takes over regardless of scope
[22:59:14] hahuang65: has joined #ruby
[22:59:23] SeepingN: so if I define an "outter trap" to catch ^C, and a different one while inside a particular function, that upon leaving that block, trap does not "revert"
[22:59:24] cagomez: has joined #ruby
[22:59:42] SeepingN: and runs irrelevant code that was defined inside that block/function
[23:02:03] thadtheman: has joined #ruby
[23:02:22] CloCkWeRX: has joined #ruby
[23:03:42] jerme_: has joined #ruby
[23:04:26] davorb: has joined #ruby
[23:09:49] bkxd: has joined #ruby
[23:11:13] jusa: has joined #ruby
[23:13:23] meshsmith: has joined #ruby
[23:17:58] nofxx: has joined #ruby
[23:23:08] AndBobsYourUncle: has joined #ruby
[23:27:24] bocaneri: has joined #ruby
[23:28:56] rgtk: has joined #ruby
[23:29:45] rgtk: has joined #ruby
[23:30:01] patarr: has joined #ruby
[23:31:12] wald0: has joined #ruby
[23:32:11] bocaneri: has joined #ruby
[23:32:55] jamesaxl: has joined #ruby
[23:33:49] agent_white: has joined #ruby
[23:33:51] cahoots_: has joined #ruby
[23:34:29] choke: has joined #ruby
[23:35:14] cahoots_: hi, i want to run a shell command, show the output as each line is written to stdout, and only return when the command is done. i've tried Process.spawn("sleep 2; echo 'hi'; sleep 2; echo 'hey'"); Process.wait
[23:35:21] cahoots_: but that returns immediately
[23:36:58] cahoots_: volty, hey nice
[23:45:09] t-recx: has joined #ruby
[23:47:03] charliesome: has joined #ruby
[23:49:26] skweek: has joined #ruby
[23:50:39] patarr: has joined #ruby
[23:55:16] Gaelan: has joined #ruby
[23:57:29] Robtop__: has joined #ruby
[23:57:43] CloCkWeRX: has joined #ruby
[23:57:57] BabyMario: has joined #ruby