« Back to channel list

#ruby - 03 March 2018

« Back 1 day Forward 1 day »
[00:01:24] cagomez: has joined #ruby
[00:03:09] dmitriy_: has joined #ruby
[00:07:25] emilford: has joined #ruby
[00:08:07] dmitriy_: has joined #ruby
[00:09:12] emilford: has joined #ruby
[00:09:25] logoscoder: has joined #ruby
[00:10:28] lupine: badly, one assumes
[00:10:39] lupine: just like the rest of every language ever
[00:13:10] dmitriy_: has joined #ruby
[00:15:25] logoscoder: has joined #ruby
[00:18:07] dmitriy_: has joined #ruby
[00:22:34] naprimer: has joined #ruby
[00:23:08] dmitriy_: has joined #ruby
[00:24:01] willmichael: has joined #ruby
[00:24:10] shinnya: has joined #ruby
[00:24:11] jenrzzz: has joined #ruby
[00:25:24] zenspider: !conn dmitriy
[00:26:33] bmurt: has joined #ruby
[00:26:34] zenspider: has joined #ruby
[00:27:05] zenspider: !conn dmitriy
[00:27:41] gizmore: self.extend GDO::UI::WithHTML
[00:28:06] dmitriy_: has joined #ruby
[00:30:01] zenspider: !connection dmitriy
[00:30:01] ruby[bot]: zenspider: Could not find user with nick "dmitriy"
[00:30:11] zenspider: !connection ~dmitriy@208.184.154.83
[00:30:11] ruby[bot]: zenspider: Could not process command, usage: !connection nick [channel]
[00:30:34] fba: has joined #ruby
[00:33:09] dmitriy_: has joined #ruby
[00:38:07] dmitriy_: has joined #ruby
[00:42:05] mikhael_k33hl: How to handle Thread.kill?
[00:42:29] Mr_Tea: has joined #ruby
[00:42:46] hahuang61: has joined #ruby
[00:43:07] dmitriy_: has joined #ruby
[00:43:17] ledestin: has joined #ruby
[00:43:18] StarSeed0000: has joined #ruby
[00:43:53] hahuang65: has joined #ruby
[00:45:33] workmad3: has joined #ruby
[00:46:18] emilford: has joined #ruby
[00:46:37] bigblind: has joined #ruby
[00:47:01] Mr_Tea: I'm sure there's an idiomatic way of making this chip8 emulator here's what I have so far https://gist.github.com/76755345c2660dc6426cc01e6a164283 some guidence would be awesome
[00:48:08] dmitriy_: has joined #ruby
[00:50:33] banisterfiend: has joined #ruby
[00:50:41] gizmore: mikhael_k33hl: this should silently kill the thread and fulfil waits?
[00:53:02] guacamole: has joined #ruby
[00:53:02] guacamole: has joined #ruby
[00:53:09] dmitriy_: has joined #ruby
[00:58:06] dmitriy_: has joined #ruby
[00:58:13] mikhael_k33hl: gizmore: I'm using concurrent-ruby and I want my threads to invoke a method before getting killed
[00:58:37] gizmore: how do you kill them?
[00:58:52] gizmore: wrap your run in a try catch and use finally?
[00:59:45] gizmore: remember to treat kills differently
[01:00:38] willmichael: has joined #ruby
[01:00:44] mikhael_k33hl: gizmore: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/doc/thread_pools.md, it says here that when I shutdown the pool, it calls Thread.kill to its threads
[01:01:45] havenwood: Mr_Tea: Avoid `for` in Ruby.
[01:02:03] havenwood: Mr_Tea: Use `each` instead.
[01:03:10] dmitriy_: has joined #ruby
[01:03:49] havenwood: Mr_Tea: I take it this doesn't work yet? It's something of pseudocode?
[01:04:47] havenwood: Mr_Tea: Consider making `fontset` a constant with: FONT_SET = ...
[01:05:15] havenwood: Mr_Tea: In #initialize you define a bunch of local variables, and I suspect you actually want instance variables for at least some of those.
[01:05:46] Mr_Tea: yeah there's some pseudocode in there
[01:05:48] havenwood: Mr_Tea: Use `warn` instead of `puts` to print to stderr instead of stdout.
[01:05:58] havenwood: (And also respect warning flags.)
[01:06:55] havenwood: I'm not sure what all you're using curses for, but if it's just the screen size and getch from the script you can do it with just IO::Console and no gem.
[01:07:03] Mr_Tea: I suspect the local variables are why the linter was yelling at me about unused variables
[01:07:20] havenwood: https://ruby-doc.org/stdlib/libdoc/io/console/rdoc/IO.html
[01:07:26] havenwood: Mr_Tea: Aye, that makes sense.
[01:07:47] havenwood: They are unused.
[01:07:51] Mr_Tea: the graphics are simple so I was just gonna use curses to display what I needed
[01:08:07] dmitriy_: has joined #ruby
[01:08:09] havenwood: >> require 'io/console'; $stdout.winsize
[01:08:10] ruby[bot]: havenwood: # => Inappropriate ioctl for device (Errno::ENOTTY) ...check link for more (https://eval.in/966170)
[01:08:27] havenwood: Mr_Tea: yeah, no problem with that
[01:08:37] Mr_Tea: do I need self.memory and so on if I wanna use instance variables
[01:08:49] havenwood: Mr_Tea: @memory =
[01:09:00] havenwood: Mr_Tea: From other methods you can access that variable with: @memory
[01:09:14] havenwood: Mr_Tea: Local variables are local to the method in which they were defined.
[01:09:16] orbyt_: has joined #ruby
[01:09:23] Mr_Tea: ruby is just modern smalltalk I love it
[01:09:26] havenwood: Mr_Tea: Instance variables are visible from other methods in the same instance.
[01:09:45] havenwood: Mr_Tea: Indeed! :-D
[01:13:12] dmitriy_: has joined #ruby
[01:13:30] cagomez: has joined #ruby
[01:15:07] Puffball: has joined #ruby
[01:18:12] dmitriy_: has joined #ruby
[01:20:21] konsolebox: has joined #ruby
[01:23:07] dmitriy_: has joined #ruby
[01:23:30] DTZUZO: has joined #ruby
[01:23:44] hahuang65: has joined #ruby
[01:27:39] bmurt: has joined #ruby
[01:28:07] dmitriy_: has joined #ruby
[01:28:48] bodgix: has joined #ruby
[01:32:59] tlaxkit: has joined #ruby
[01:33:09] dmitriy_: has joined #ruby
[01:37:12] hahuang65: has joined #ruby
[01:38:07] dmitriy_: has joined #ruby
[01:39:03] guacamole: has joined #ruby
[01:39:04] guacamole: has joined #ruby
[01:41:24] karapetyan: has joined #ruby
[01:42:04] hahuang65: has joined #ruby
[01:42:33] apparition: has joined #ruby
[01:43:07] dmitriy_: has joined #ruby
[01:43:37] hahuang65: has joined #ruby
[01:48:07] dmitriy_: has joined #ruby
[01:49:02] GodFather: has joined #ruby
[01:50:58] AndBobsYourUncle: has joined #ruby
[01:52:09] yokel: has joined #ruby
[01:52:17] LiamW: has joined #ruby
[01:52:26] LiamW: im setlocal_OP__WC__0 what does WC stand for?
[01:53:10] dmitriy_: has joined #ruby
[01:53:52] konsolebox: has joined #ruby
[01:56:59] n0m4d1c: has joined #ruby
[01:57:24] joe_from_maine: has joined #ruby
[01:58:11] dmitriy_: has joined #ruby
[01:58:46] postmodern: has joined #ruby
[01:59:19] konsolebox: has joined #ruby
[02:03:10] dmitriy_: has joined #ruby
[02:08:09] dmitriy_: has joined #ruby
[02:12:13] netherwolfe: has joined #ruby
[02:13:09] dmitriy_: has joined #ruby
[02:18:09] dmitriy_: has joined #ruby
[02:21:45] nadir: has joined #ruby
[02:23:11] dmitriy_: has joined #ruby
[02:23:19] GotHyper: has joined #ruby
[02:28:14] dmitriy_: has joined #ruby
[02:31:04] dinfuehr: has joined #ruby
[02:33:10] dmitriy_: has joined #ruby
[02:38:12] dmitriy_: has joined #ruby
[02:43:11] dmitriy_: has joined #ruby
[02:44:11] n0m4d1c: has joined #ruby
[02:46:12] workmad3: has joined #ruby
[02:48:11] dmitriy_: has joined #ruby
[02:49:34] darkhanb: has joined #ruby
[02:52:46] johnny56: has joined #ruby
[02:53:09] dmitriy_: has joined #ruby
[02:57:53] cdg: has joined #ruby
[02:58:09] gizmore|2: has joined #ruby
[02:58:10] dmitriy_: has joined #ruby
[03:00:12] cadillac_: has joined #ruby
[03:01:41] herbmillerjr: has joined #ruby
[03:02:06] mikhael_k33hl: has joined #ruby
[03:04:01] LiamW: thanks for all the help...
[03:06:20] mikhael_k33hl: I'm trying to debug my ruby script which uses concurrent-ruby. I'm setting brekapoints via `binding.pry` but it's gibing me an error "before_session hook failed: ThreadError: can't be called from trap context /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/monitor.rb:187:in `lock' (see _pry_.hooks.errors to debug)"
[03:07:44] bigblind: has joined #ruby
[03:27:11] bmurt: has joined #ruby
[03:36:03] govg: has joined #ruby
[03:36:18] hahuang61: has joined #ruby
[03:37:10] orbyt_: has joined #ruby
[03:43:30] arescorpio: has joined #ruby
[03:47:39] cagomez: has joined #ruby
[03:57:50] joe_from_maine: has joined #ruby
[04:09:11] soniya29: has joined #ruby
[04:09:14] soniya29_: has joined #ruby
[04:11:48] kies: has joined #ruby
[04:14:26] chromis: has joined #ruby
[04:15:17] bweston92: has joined #ruby
[04:15:36] nadir: has joined #ruby
[04:15:49] raynold: has joined #ruby
[04:23:24] lunarkitty7: has joined #ruby
[04:24:22] DTZUZO: has joined #ruby
[04:25:14] trautwein: has joined #ruby
[04:27:17] syndikate: has joined #ruby
[04:32:37] joe_from_maine: has joined #ruby
[04:33:32] bigblind: has joined #ruby
[04:36:45] shinnya: has joined #ruby
[04:38:21] hahuang61: has joined #ruby
[04:39:54] mahlon_: has joined #ruby
[04:40:06] ski7777: has joined #ruby
[04:52:24] konsolebox: has joined #ruby
[04:54:28] rippa: has joined #ruby
[05:00:27] xenops: has joined #ruby
[05:04:25] karapetyan: has joined #ruby
[05:05:34] joe_from_maine: has joined #ruby
[05:10:33] pastorinni: has joined #ruby
[05:13:25] cdg: has joined #ruby
[05:15:07] joe_from_maine: has joined #ruby
[05:15:18] mikhael_k33hl: has joined #ruby
[05:15:57] hahuang61: has joined #ruby
[05:18:55] konsolebox: has joined #ruby
[05:21:51] kapil___: has joined #ruby
[05:26:04] joe_from_maine: has joined #ruby
[05:27:40] StarSeed0000: has joined #ruby
[05:44:04] joe_from_maine: has joined #ruby
[05:44:15] jamesaxl: has joined #ruby
[05:52:28] Yzguy: has joined #ruby
[05:58:44] dmitriy_: has joined #ruby
[06:00:23] howdoi: has joined #ruby
[06:04:57] cadillac_: has joined #ruby
[06:06:38] joe_from_maine: has joined #ruby
[06:07:46] DTZUZO: has joined #ruby
[06:11:53] antoniobeyah: has joined #ruby
[06:16:21] schneider: has joined #ruby
[06:16:22] nadir: has joined #ruby
[06:17:01] milardovich: has joined #ruby
[06:18:24] [reed]: has joined #ruby
[06:18:24] [reed]: has joined #ruby
[06:19:10] LocaMocha: has joined #ruby
[06:23:37] joe_from_maine: has joined #ruby
[06:27:06] _aeris_: has joined #ruby
[06:27:23] karapetyan: has joined #ruby
[06:27:24] soniya29_: has joined #ruby
[06:27:24] soniya29: has joined #ruby
[06:33:07] joe_from_maine: has joined #ruby
[06:37:29] milardovich: has joined #ruby
[06:42:05] hahuang61: has joined #ruby
[06:43:36] joe_from_maine: has joined #ruby
[06:47:40] workmad3: has joined #ruby
[06:50:46] Mia: has joined #ruby
[06:50:46] Mia: has joined #ruby
[07:00:12] dmitriy_: has joined #ruby
[07:03:04] bigblind: has joined #ruby
[07:03:35] joe_from_maine: has joined #ruby
[07:16:58] milardovich: has joined #ruby
[07:18:25] cadillac_: has joined #ruby
[07:20:22] milardovich: has joined #ruby
[07:33:54] conta: has joined #ruby
[07:35:25] cadillac_: has joined #ruby
[07:37:35] hahuang61: has joined #ruby
[07:37:38] morfin: has joined #ruby
[07:42:34] joe_from_maine: has joined #ruby
[07:48:33] oleo: has joined #ruby
[07:49:40] ledestin: has joined #ruby
[07:53:50] Dimik: has joined #ruby
[07:55:03] bijan_: has joined #ruby
[07:58:40] MyMind: has joined #ruby
[08:00:21] alex``: has joined #ruby
[08:01:02] shpoont: has joined #ruby
[08:03:01] amatas: has joined #ruby
[08:04:53] mtkd: has joined #ruby
[08:20:20] bijan_: has joined #ruby
[08:20:38] joe_from_maine: has joined #ruby
[08:31:35] schneider: has joined #ruby
[08:33:51] moei: has joined #ruby
[08:37:15] hahuang61: has joined #ruby
[08:43:35] joe_from_maine: has joined #ruby
[08:47:13] Gnut: has joined #ruby
[08:54:36] joe_from_maine: has joined #ruby
[09:00:37] n008f4g_: has joined #ruby
[09:07:55] marr: has joined #ruby
[09:10:36] hahuang61: has joined #ruby
[09:13:43] cdg: has joined #ruby
[09:13:45] shpoont: has joined #ruby
[09:21:43] Fusselgesicht: has joined #ruby
[09:23:37] joe_from_maine: has joined #ruby
[09:23:41] mynameisdebian: has joined #ruby
[09:23:58] mynameisdebian: How can I insert a NULL value with the sequel gem?
[09:24:31] Fusselgesicht: has joined #ruby
[09:24:37] apeiros: mynameisdebian: DB[:some_table] << {col: nil}
[09:25:26] apeiros: basically, null maps to nil
[09:25:52] mynameisdebian: so if I specify a nil variable to insert into a field, and the field allows NULL, it will insert nothing?
[09:26:04] sidx64: has joined #ruby
[09:26:13] apeiros: it will insert null
[09:28:11] bigblind: has joined #ruby
[09:30:01] sidx64_: has joined #ruby
[09:36:33] joe_from_maine: has joined #ruby
[09:42:49] sidx64: has joined #ruby
[09:43:04] amatas: has joined #ruby
[09:46:30] phaul: has joined #ruby
[09:47:12] dmitriy_: has joined #ruby
[09:50:02] wojnar: has joined #ruby
[09:50:28] amatas: has joined #ruby
[09:50:32] shpoont: has joined #ruby
[10:05:24] GodFather: has joined #ruby
[10:12:12] _whitelogger: has joined #ruby
[10:21:34] joe_from_maine: has joined #ruby
[10:21:53] seanh: has joined #ruby
[10:22:06] colstrom: has joined #ruby
[10:22:14] Mutsuhito: has joined #ruby
[10:28:19] jamesaxl: has joined #ruby
[10:29:20] Azure|dc: has joined #ruby
[10:31:38] Xiti`: has joined #ruby
[10:32:54] sirecote_: has joined #ruby
[10:34:07] hlmjr: has joined #ruby
[10:35:36] nrk: has joined #ruby
[10:36:21] plexigras2: has joined #ruby
[10:37:51] aviraldg: has joined #ruby
[10:38:31] iceskins[m]: has joined #ruby
[10:38:42] mtkd: has joined #ruby
[10:38:59] hahuang61: has joined #ruby
[10:39:11] gbailey: has joined #ruby
[10:39:28] dyyylan: has joined #ruby
[10:40:21] roshanavand: has joined #ruby
[10:42:22] syndikate: has joined #ruby
[10:42:47] Gnut: has joined #ruby
[10:44:03] tomphp: has joined #ruby
[10:49:03] workmad3: has joined #ruby
[10:49:22] joe_from_maine: has joined #ruby
[11:00:53] \void: has joined #ruby
[11:03:40] claudiuinberlin: has joined #ruby
[11:09:27] envex: has joined #ruby
[11:15:37] AJA4350: has joined #ruby
[11:17:57] fba: has joined #ruby
[11:21:49] zenspider: exponential growth in did_you_mean based on object graph size. :/
[11:23:58] zenspider: https://gist.github.com/zenspider/4fbf1a5d237095c52184a57c86cdb5eb
[11:24:45] fba: has joined #ruby
[11:24:58] anisha: has joined #ruby
[11:29:03] nowhere_man: has joined #ruby
[11:29:20] Ryzokuken: has joined #ruby
[11:33:38] tsht: has joined #ruby
[11:34:49] ams__: has joined #ruby
[11:35:44] mynameisdebian: With sequel insert(), can I insert a formula as a string, like "DATE_FORMAT(\"#{data_array[14]}\", \"%b %c, %Y\")"
[11:37:05] hahuang61: has joined #ruby
[11:37:51] desperek: has joined #ruby
[11:40:41] vutral|kali: has joined #ruby
[11:40:41] vutral|kali: has joined #ruby
[11:42:03] Pisuke: has joined #ruby
[11:48:12] Zaab1t: has joined #ruby
[11:49:03] drewmcmillan: has joined #ruby
[11:50:17] tekk: has joined #ruby
[11:55:04] tAn: has joined #ruby
[12:00:43] InfinityFye: has joined #ruby
[12:02:30] Paraxial: has joined #ruby
[12:02:37] InfinityFye: has left #ruby: ()
[12:06:23] willmichael: has joined #ruby
[12:10:30] willmichael: has joined #ruby
[12:11:58] willmichael: has joined #ruby
[12:12:25] willmichael: has joined #ruby
[12:12:47] Papierkorb: has joined #ruby
[12:18:50] tomphp: has joined #ruby
[12:31:50] milardovich: has joined #ruby
[12:35:39] hahuang61: has joined #ruby
[12:41:54] willmichael: has joined #ruby
[12:42:03] joe_from_maine: has joined #ruby
[12:43:01] ski7777: has joined #ruby
[12:43:07] conta: has joined #ruby
[12:59:14] keithy: has joined #ruby
[13:01:43] Papierkorb: has left #ruby: ("Konversation terminated!")
[13:02:13] banisterfiend: has joined #ruby
[13:03:20] drewmcmillan: has joined #ruby
[13:09:47] yqt: has joined #ruby
[13:10:28] hahuang61: has joined #ruby
[13:12:59] goatish: has joined #ruby
[13:13:46] tcopeland: has joined #ruby
[13:25:20] karapetyan: has joined #ruby
[13:29:38] rrutkowski: has joined #ruby
[13:31:41] n008f4g_: has joined #ruby
[13:33:23] karapetyan: has joined #ruby
[13:35:21] Sylario: has joined #ruby
[13:43:59] iNs: has joined #ruby
[13:47:41] karapetyan: has joined #ruby
[13:50:44] iNs: has joined #ruby
[13:54:58] RougeR: has joined #ruby
[13:54:58] RougeR: has joined #ruby
[14:03:43] mtkd: has joined #ruby
[14:10:02] schneider: has joined #ruby
[14:13:55] jnollette: has joined #ruby
[14:14:07] AJA4350: has joined #ruby
[14:14:41] _aeris_: has joined #ruby
[14:19:53] milardovich: has joined #ruby
[14:23:00] mtkd: has joined #ruby
[14:23:09] sameerynho: has joined #ruby
[14:23:42] rikkipitt: has joined #ruby
[14:36:52] logoscoder: has joined #ruby
[14:37:38] Prutheus: has joined #ruby
[14:38:28] Emmanuel_Chanel: has joined #ruby
[14:39:25] Prutheus: I want to use talib-ruby .... I am on windows with 64bit ruby .... however, I need to install the talib c bindings first ... so i downloaded sourceforge.net/projects/ta-lib/files/ta-lib/0.4.0/ta-lib-0.4.0-msvc.zip/download , extracted it to C:\ta-lib and want to build my ruby gem now with gem install talib_ruby -- --with-talib-include=C:\ta-lib\c\include --with-talib-lib=C:\ta-lib\c\lib
[14:39:39] Prutheus: Problem: I get errors: talib.o:talib.c:(.text+0x43): undefined reference to `TA_CallFunc' (and some more)
[14:40:51] willmichael: has joined #ruby
[14:41:17] shpoont: has joined #ruby
[14:42:53] za1b1tsu: has joined #ruby
[14:43:39] hahuang61: has joined #ruby
[14:47:54] aguestuser: has joined #ruby
[14:50:25] workmad3: has joined #ruby
[14:50:48] bigblind: has joined #ruby
[14:50:56] John_Ivan: has joined #ruby
[14:51:33] kapil___: has joined #ruby
[14:55:24] Emmanuel_Chanel: has joined #ruby
[14:59:48] shpoont: has joined #ruby
[14:59:50] LiamW: has left #ruby: ("WeeChat 2.0.1")
[15:05:09] willmichael: has joined #ruby
[15:08:05] joe_from_maine: has joined #ruby
[15:08:55] zapata: has joined #ruby
[15:16:14] memo1: has joined #ruby
[15:18:15] konsolebox: has joined #ruby
[15:20:42] Mike11: has joined #ruby
[15:22:24] amatas_: has joined #ruby
[15:27:50] shpoont: has joined #ruby
[15:27:59] RougeR: has joined #ruby
[15:27:59] RougeR: has joined #ruby
[15:32:47] wojnar: has joined #ruby
[15:33:38] tAn: has joined #ruby
[15:35:00] sammi`_: has joined #ruby
[15:35:03] hahuang61: has joined #ruby
[15:35:48] drewmcmillan: has joined #ruby
[15:37:01] milardovich: has joined #ruby
[15:37:15] konsolebox: has joined #ruby
[15:38:46] _aeris_: has joined #ruby
[15:39:10] memo1: has joined #ruby
[15:48:23] hightower: has joined #ruby
[15:48:40] tomphp: has joined #ruby
[15:59:34] tomphp: has joined #ruby
[16:00:21] Mike111: has joined #ruby
[16:01:17] zapata: has joined #ruby
[16:04:08] tAn: has joined #ruby
[16:04:59] tomphp: has joined #ruby
[16:18:12] willmichael: has joined #ruby
[16:24:44] naftilos76: has joined #ruby
[16:25:31] giraffe: has joined #ruby
[16:26:19] tpendragon: has joined #ruby
[16:29:15] stormpack: has joined #ruby
[16:30:25] DoubleMalt: has joined #ruby
[16:31:24] suukim: has joined #ruby
[16:32:09] shpoont: has joined #ruby
[16:39:58] noobineer: has joined #ruby
[16:41:00] tAn: has joined #ruby
[16:41:02] orbyt_: has joined #ruby
[16:41:56] hahuang61: has joined #ruby
[16:42:46] schneider: has joined #ruby
[16:43:48] willmichael: has joined #ruby
[16:44:49] Ishido: has joined #ruby
[16:45:43] r3m: has joined #ruby
[16:50:22] ule: Hey guys
[16:50:42] ule: I'm trying to think a way to transoform this: ["A/B/C/", "A/B/D/", "A/B/E/", "A/F/G/"] to "A": {"B": {"C", "D", "E"}, "F": {"G"}}
[16:51:01] ule: basically, path to tree
[16:51:11] workmad3: has joined #ruby
[16:51:27] apeiros: ule: ok. what code do you have so far?
[16:51:53] schneider: has joined #ruby
[16:52:04] ule: The code I have so far makes some magic to create that: ["A/B/C/", "A/B/D/", "A/B/E/", "A/F/G/"]
[16:52:42] ule: I'm trying to think on this next step
[16:53:21] lupine: I scent recursion
[16:53:41] ule: lupine: exactly, assuming that my input will change dinamically
[16:54:15] ule: man, I feel so stupid for getting stuck at algorithms like this. It must be basic stuff from CC courses no?
[16:54:18] StarSeed0000: has joined #ruby
[16:55:03] banisterfiend: has joined #ruby
[16:55:12] apeiros: ule: maybe start at how you'd transform "A/B/C" on its own
[16:55:17] lupine: so you've got a function, f, that takes a hash and a string. it removes the leftmost element from the string and either adds it to the hash, or adds an empty hash to the hash and calls itself with teh remainder, if there is more to do
[16:55:59] apeiros: also note that {"A": {"B": {"C", "D", "E"}}} is not really ruby. assuming you meant {"A": {"B": ["C", "D", "E"]}}, consider{"A": {"B": {"C": {}, "D": {}, "E":{}}}} as a first step
[16:56:33] apeiros: so: transform "A/B/C" to {"A" => {"B" => {"C" => {}}}
[16:56:55] ule: apeiros: right, let me start easy
[16:57:04] ule: lupine: right
[16:57:52] ule: I guess I need to group by levels
[16:58:07] ule: using .split will give me this level, 0,1,2
[16:58:19] ule: then I need to create this hash based on levels
[16:59:25] oroborous: has joined #ruby
[17:01:23] lupine: consider https://gist.github.com/anonymous/b533d29afb9ce1d543e93efc7dc1a68f
[17:01:35] shinnya: has joined #ruby
[17:01:45] lupine: which gets me {"A"=>{"B"=>{"C"=>{}, "D"=>{}, "E"=>{}}, "F"=>{"G"=>{}}}}
[17:02:49] ule: lupine: dammit, you were fast
[17:03:09] ule: let me study your code
[17:03:25] apeiros: ACTION has a different solution
[17:03:33] lupine: lots of ways to do it
[17:03:37] havenwood: ACTION has a different solution as well
[17:03:46] apeiros: too sad there's only #dig, no #bury
[17:03:55] lupine: I probably wouldn't actually use recursion if this came up in real life
[17:04:01] apeiros: would make it even easier.
[17:04:08] ule: lupine: why not?
[17:04:10] karapetyan: has joined #ruby
[17:04:17] apeiros: I didn't use recursion. in languages like ruby it's usually better to avoid it.
[17:04:36] lupine: ule: because deep stack traces are nasty
[17:04:45] ule: apeiros lupine havenwood whats the secret to mastering on problems like this?
[17:04:56] lupine: stepwise thinking
[17:05:10] apeiros: ule: dunno. I've had ~30y of training.
[17:05:11] lupine: as long as you can see the first step, you can come up wiht a solution eventually
[17:05:12] ule: Can I get to your level or it is something just for people with IQ > 160
[17:05:18] apeiros: but yeah, divide and conquer
[17:05:21] lupine: just keep bashing on it
[17:05:35] lupine: if nothing else, apply a genetic approach and change things randomly each step until you get what you want out of the other end
[17:05:35] apeiros: cut big problems you can't solve into smaller problems until you have a problem you can solve. then reassemble the partial solutions.
[17:06:07] ule: persiscense
[17:06:49] apeiros: since I'm going afk and a solution has already been posted (which I wanted to avoid), here's mine: https://gist.github.com/apeiros/0b241060c4faca420c97ef21ef124c7b
[17:07:22] apeiros: could also use a self-initializing hash instead of that ugly ||= part
[17:07:45] apeiros: but I tend to be lazy and omit the .default_proc = nil part at the end :D
[17:08:14] ule: this is awesome, thank you very much guys
[17:11:04] hahuang61: has joined #ruby
[17:13:04] mtkd: has joined #ruby
[17:13:09] ule: tree data structure
[17:13:25] tAn: has joined #ruby
[17:13:44] ule: I know there are some websites with some trick questions like that so people can solve
[17:13:58] ule: then they compare each algorithm based on efficiency
[17:14:17] ule: I don't remember which website though, but I remember seeing something like that
[17:15:59] karapetyan: has joined #ruby
[17:25:02] upinspace__: has joined #ruby
[17:25:38] apeiros: ule: project euler
[17:25:39] havenwood: inputs = %w[A/B/C/ A/B/D/ A/B/E/ A/F/G/]
[17:25:39] havenwood: h = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
[17:25:50] tom__: has joined #ruby
[17:26:03] ule: havenwood: O_o
[17:26:17] havenwood: didn't mean to paste that here >.>
[17:26:20] havenwood: ACTION needs coffee
[17:31:05] tom__: dose anyone know why i get an unexpected identifyer error with this code?http://paste.debian.net/1012933/
[17:31:40] tom__: i think it might be to do with using brackets when calling methods, i still have not got my head around the rules for calling methods...
[17:32:56] havenwood: tom__: You just need brackets with `sum(arr, i+1)` for syntax.
[17:33:16] havenwood: >> [1, 2, 3, 4, 5].sum
[17:33:17] ruby[bot]: havenwood: # => undefined method `sum' for [1, 2, 3, 4, 5]:Array (NoMethodError) ...check link for more (https://eval.in/966288)
[17:33:28] havenwood: tom__: ^ that works in the most recent Ruby
[17:34:22] havenwood: tom__: You'll see that your recursive version runs into trouble when the Array gets too big.
[17:34:29] havenwood: sum [*1..100000] #!> SystemStackError: stack level too deep
[17:35:06] ule: tom__: https://repl.it/repls/StableCuddlySysadmin
[17:36:57] havenwood: >> [].reduce 0, :+
[17:36:58] ruby[bot]: havenwood: # => 0 (https://eval.in/966289)
[17:37:02] havenwood: >> [1, 2, 3, 4, 5].reduce 0, :+
[17:37:03] ruby[bot]: havenwood: # => 15 (https://eval.in/966290)
[17:37:30] upinspace__: has joined #ruby
[17:38:01] havenwood: In Ruby 2.4+: [1, 2, 3, 4, 5].sum #=> 15
[17:41:49] salih: has joined #ruby
[17:42:03] hahuang61: has joined #ruby
[17:42:49] shpoont: has joined #ruby
[17:44:44] cdg: has joined #ruby
[17:46:27] karapetyan: has joined #ruby
[17:47:42] pastorinni: has joined #ruby
[17:54:17] banisterfiend: has joined #ruby
[17:58:14] schneider: has joined #ruby
[17:58:54] rwb: has joined #ruby
[17:59:33] govg: has joined #ruby
[18:01:04] yokel: has joined #ruby
[18:03:08] nowhere_man: has joined #ruby
[18:03:26] tsht: has joined #ruby
[18:13:20] guille-moe: has joined #ruby
[18:15:19] tAn: has joined #ruby
[18:15:41] nicesignal: has joined #ruby
[18:17:25] alex``: has joined #ruby
[18:17:37] logoscoder_: has joined #ruby
[18:18:09] coderphive: has joined #ruby
[18:19:27] bigblind: has joined #ruby
[18:20:58] willmichael: has joined #ruby
[18:21:50] Bilge: has left #ruby: ()
[18:30:57] cdg: has joined #ruby
[18:35:06] upinspace: has joined #ruby
[18:41:24] drewmcmillan: has joined #ruby
[18:44:08] hahuang61: has joined #ruby
[18:47:46] pastorinni: has joined #ruby
[18:47:47] coderphive: has joined #ruby
[18:48:11] schneider: has joined #ruby
[18:50:36] tAn: has joined #ruby
[18:51:53] workmad3: has joined #ruby
[18:57:09] nowhereman_: has joined #ruby
[18:58:16] Dimik: has joined #ruby
[18:59:55] dviola: has joined #ruby
[19:12:06] \void: has joined #ruby
[19:12:46] hahuang61: has joined #ruby
[19:12:59] karapetyan: has joined #ruby
[19:16:30] anisha: has joined #ruby
[19:19:01] upinspace: has joined #ruby
[19:23:29] banisterfiend: has joined #ruby
[19:26:04] shpoont: has joined #ruby
[19:27:18] phaul: has joined #ruby
[19:28:23] upinspace__: has joined #ruby
[19:32:44] tAn: has joined #ruby
[19:37:01] cadillac_: has joined #ruby
[19:40:16] john__: has joined #ruby
[19:40:23] hahuang61: has joined #ruby
[19:43:13] willmichael: has joined #ruby
[19:46:57] sammi`: has joined #ruby
[19:49:22] sammi`__: has joined #ruby
[20:04:20] herbmillerjr: has joined #ruby
[20:18:28] desperek: has joined #ruby
[20:20:01] mtkd: has joined #ruby
[20:20:07] tAn: has joined #ruby
[20:20:24] raynold: has joined #ruby
[20:23:06] drewmcmillan: has joined #ruby
[20:26:06] upinspace__: has joined #ruby
[20:27:12] PMS: has joined #ruby
[20:27:49] nicoulaj: has joined #ruby
[20:33:19] mtkd: has joined #ruby
[20:35:10] bigblind: has joined #ruby
[20:35:57] TinkerTyper: has joined #ruby
[20:39:28] antoniobeyah: has joined #ruby
[20:41:34] Joufflu: has joined #ruby
[20:43:15] nicoulaj: has joined #ruby
[20:43:35] hahuang61: has joined #ruby
[20:47:04] gr33n7007h1: has joined #ruby
[20:52:13] NightMonkey: has joined #ruby
[20:52:30] workmad3: has joined #ruby
[20:56:25] n008f4g_: has joined #ruby
[21:04:35] tomphp: has joined #ruby
[21:12:35] hahuang61: has joined #ruby
[21:15:49] tAn: has joined #ruby
[21:18:44] sidx64: has joined #ruby
[21:20:22] GodFather: has joined #ruby
[21:22:31] bigblind: has joined #ruby
[21:27:27] n008f4g_: has joined #ruby
[21:28:13] weaksauce: interesting it took ruby of all languages that long to get sum on an array
[21:29:05] apeiros: I'm more surprised it actually got it
[21:29:14] apeiros: it's a very specific operation on a generic datastructure
[21:30:00] weaksauce: i suppose but ruby has always had programmer happiness as a goal
[21:30:14] apeiros: yeah, but…
[21:30:23] apeiros: >> Array.instance_methods(false).size
[21:30:24] ruby[bot]: apeiros: # => 93 (https://eval.in/966316)
[21:30:35] apeiros: method overload can hurt happiness
[21:32:23] weaksauce: depends. in this case inject or reduce is a somewhat odd thing to pull out when all you want to do is sum up the numbers in an array.
[21:34:01] apeiros: dunno. I didn't feel that way about it.
[21:34:14] apeiros: don't feel like that about it either for factorials
[21:34:45] apeiros: though factorials I'll use a range
[21:36:05] shpoont: has joined #ruby
[21:38:17] weaksauce: the case could be made having it as a separate method because they might be able to eek out some performance optimizations
[21:38:25] weaksauce: but :shrug:
[21:39:03] apeiros: don't get me wrong. I don't mind it being there
[21:39:29] apeiros: as for performance: I'd love narray/nvector/nmatrix to be stdlib
[21:40:31] hahuang61: has joined #ruby
[21:41:21] PMS: has joined #ruby
[21:48:12] GodFather: has joined #ruby
[21:55:22] tAn: has joined #ruby
[21:57:02] DTZUZO: has joined #ruby
[21:57:38] leitz: has joined #ruby
[21:57:40] phaul: has joined #ruby
[21:59:13] leitz: Anyone have a short explination of the dry-rb stuff. Seems interesting but the introduction assumes you know what it does and why you want it.
[21:59:26] leitz: http://dry-rb.org/
[22:07:27] ledestin: has joined #ruby
[22:12:07] dionysus69: has joined #ruby
[22:12:16] leitz: Hrmph...not sure this is a good idea. bundle install asks for sudo password. However, no idea what is being done with the password if i give it. Running sudo bundle install says bundle shouldn't be run as root.
[22:13:02] DTZUZO: has joined #ruby
[22:13:35] helpa: has joined #ruby
[22:19:32] leitz: And installing 40 some gems that an app now depends on seems shaky.
[22:22:30] bigblind: has joined #ruby
[22:27:18] leitz: And not having a "-y" option to uninstall seems unkind.
[22:27:37] leitz: Sorry for grumping.
[22:34:44] darkhanb: has joined #ruby
[22:36:41] hahuang61: has joined #ruby
[22:37:41] tAn: has joined #ruby
[22:40:35] bigblind: has joined #ruby
[22:49:16] bigblind: has joined #ruby
[22:50:15] orbyt_: has joined #ruby
[22:53:14] workmad3: has joined #ruby
[22:53:34] ResidentBiscuit: has joined #ruby
[23:11:48] upinspace__: has joined #ruby
[23:12:17] phaul: has joined #ruby
[23:13:02] tomphp: has joined #ruby
[23:13:53] konsolebox: has joined #ruby
[23:18:44] tAn: has joined #ruby
[23:19:09] nadir: has joined #ruby
[23:20:55] noobineer: has joined #ruby
[23:20:59] upinspace__: has joined #ruby
[23:33:29] ElFerna: has joined #ruby
[23:34:31] hahuang61: has joined #ruby
[23:39:18] aguestuser: has joined #ruby
[23:40:32] Puffball: has joined #ruby
[23:41:24] aguestuser: has joined #ruby
[23:44:49] nowhere_man: has joined #ruby
[23:47:30] arkymad: has joined #ruby
[23:48:05] vondruch: has joined #ruby
[23:52:36] vondruch: has joined #ruby
[23:53:56] orbyt_: has joined #ruby
[23:55:17] tcopeland: has joined #ruby
[23:56:42] shortdudey123: has joined #ruby
[23:59:42] tcopeland: has joined #ruby