« Back to channel list

#ruby - 11 December 2017

« Back 1 day Forward 1 day »
[00:03:27] ineb: has joined #ruby
[00:09:25] mtkd: has joined #ruby
[00:13:54] Axolotl___: has joined #ruby
[00:14:31] Xiti: has joined #ruby
[00:22:00] Technodrome: has joined #ruby
[00:22:19] woodruffw: has joined #ruby
[00:22:20] woodruffw: has joined #ruby
[00:23:16] jnyw: has joined #ruby
[00:29:55] ineb: has joined #ruby
[00:30:19] GodFather: has joined #ruby
[00:32:25] zautomata: has joined #ruby
[00:33:59] hndk: has joined #ruby
[00:34:31] |ifei5g00d: has joined #ruby
[00:40:36] oetjenj: has joined #ruby
[00:42:43] bkxd_: has joined #ruby
[00:44:55] cdg: has joined #ruby
[00:49:19] ineb: has joined #ruby
[00:51:14] astronavt: has joined #ruby
[01:03:36] uZiel: has joined #ruby
[01:04:13] orbyt_: has joined #ruby
[01:08:26] cdg: has joined #ruby
[01:09:20] ineb: has joined #ruby
[01:11:00] dreamthese: has joined #ruby
[01:11:31] alfiemax: has joined #ruby
[01:12:58] goyox86: has joined #ruby
[01:13:34] cpruitt: has joined #ruby
[01:18:16] alfiemax: has joined #ruby
[01:19:38] goyox86_: has joined #ruby
[01:20:21] roamingdog: has joined #ruby
[01:21:41] goyox86__: has joined #ruby
[01:24:56] ineb: has joined #ruby
[01:25:45] charliesome: has joined #ruby
[01:27:17] milardovich: has joined #ruby
[01:27:37] goyox86__: has joined #ruby
[01:27:57] bkxd: has joined #ruby
[01:33:21] Technodrome: has joined #ruby
[01:36:44] moei: has joined #ruby
[01:38:42] iMadper`: has joined #ruby
[01:44:46] yeticry: has joined #ruby
[01:47:24] Jameser: has joined #ruby
[01:48:38] drowze: has joined #ruby
[01:50:23] iMadper``: has joined #ruby
[01:56:46] rexb0t: has joined #ruby
[01:56:52] Azure: has joined #ruby
[02:06:20] Jameser: has joined #ruby
[02:09:24] bmurt: has joined #ruby
[02:09:34] bkxd_: has joined #ruby
[02:09:37] oetjenj: has joined #ruby
[02:14:00] bkxd: has joined #ruby
[02:14:17] mtkd: has joined #ruby
[02:16:51] rivalomega: has joined #ruby
[02:17:28] roamingdog: has joined #ruby
[02:18:18] roamingdog: has joined #ruby
[02:19:03] roamingdog: has joined #ruby
[02:19:51] roamingdog: has joined #ruby
[02:20:36] roamingdog: has joined #ruby
[02:21:41] roamingdog: has joined #ruby
[02:21:57] yeticry: has joined #ruby
[02:25:54] Jameser`: has joined #ruby
[02:28:37] alfiemax: has joined #ruby
[02:29:28] enterprisey: has joined #ruby
[02:30:59] mullah_: has left #ruby: ("Leaving")
[02:31:36] gizmore|2: has joined #ruby
[02:36:34] |ifei5good: has joined #ruby
[02:42:31] rhyselsmore: has joined #ruby
[02:46:34] Exhiled: has joined #ruby
[02:48:02] d^sh: has joined #ruby
[02:54:51] Jameser: has joined #ruby
[02:56:36] bkxd_: has joined #ruby
[02:57:56] alfiemax: has joined #ruby
[02:59:37] Jameser`: has joined #ruby
[03:02:56] bkxd: has joined #ruby
[03:04:56] alfiemax: has joined #ruby
[03:06:10] Jameser: has joined #ruby
[03:06:12] pb122: has joined #ruby
[03:06:17] cdg: has joined #ruby
[03:08:55] mullah_: has joined #ruby
[03:12:43] minn: has joined #ruby
[03:18:13] _whitelogger: has joined #ruby
[03:32:02] mullah_: has left #ruby: ("Leaving")
[03:36:26] uZiel: has joined #ruby
[03:37:52] bkxd_: has joined #ruby
[03:39:47] DmitryBochkarev: has joined #ruby
[03:40:08] SuperLag: has joined #ruby
[03:44:32] yeticry: has joined #ruby
[03:44:37] maum: has joined #ruby
[03:46:00] pwnd_nsfw`: has joined #ruby
[03:50:31] DTZUZO: has joined #ruby
[03:52:25] bkxd: has joined #ruby
[03:58:19] elphe: has joined #ruby
[04:06:48] elphe: has joined #ruby
[04:08:52] howdoi: has joined #ruby
[04:23:41] alfiemax_: has joined #ruby
[04:25:49] rhyselsmore: has joined #ruby
[04:26:32] Jameser: has joined #ruby
[04:28:45] gix: has joined #ruby
[04:32:46] Jameser`: has joined #ruby
[04:32:51] Xiti: has joined #ruby
[04:33:24] bkxd_: has joined #ruby
[04:35:05] Jameser: has joined #ruby
[04:36:01] alfiemax: has joined #ruby
[04:36:56] bkxd: has joined #ruby
[04:41:39] mson: has joined #ruby
[04:46:01] al2o3-cr: has joined #ruby
[04:49:51] mtkd: has joined #ruby
[04:54:53] rhebz916: has joined #ruby
[04:57:47] anisha: has joined #ruby
[05:02:40] cdg: has joined #ruby
[05:03:07] jackjackdripper: has joined #ruby
[05:03:27] KeyJoo: has joined #ruby
[05:07:16] Xiti: has joined #ruby
[05:08:50] elphe: has joined #ruby
[05:09:15] maxirater: has joined #ruby
[05:17:27] rivalomega: has joined #ruby
[05:20:51] gh: has joined #ruby
[05:22:17] bkxd: has joined #ruby
[05:26:30] mikhael_k33hl: has joined #ruby
[05:28:09] mikhael_k33hl: Where can I find documentation for params.fetch()?
[05:29:14] elphe: has joined #ruby
[05:33:34] mozzarella: look for Hash#fetch, maybe?
[05:35:32] mikhael_k33hl: mozzarella: I'm currently going through a ruby code and I see some class methods wrapping instance methods with instance.methodCall . . . is that a convention or something?
[05:36:17] goyox86: has joined #ruby
[05:39:00] rhebz916: has joined #ruby
[05:49:05] RickHull: is the instance being passed in? anyway, no -- that sounds strange
[05:51:05] iamarun: has joined #ruby
[05:51:47] mikhael_k33hl: RickHull: It's an existing codebase that I'm working on, I'm pretty new with ruby so I'm trying to determine if this kind of practice is conventional or something. Would you mind taking a look: http://paste.ubuntu.com/26161817/
[05:52:18] mikhael_k33hl: RickHull: though I doubt this can be improved
[05:56:53] reber: has joined #ruby
[06:07:31] bkxd: has joined #ruby
[06:09:51] elomatreb: Judging by the "include Singleton" you have a singleton there, so the class methods using that instance method probably from the included module is probably intentional
[06:10:22] elomatreb: mikhael_k33hl: ^
[06:11:29] goyox86: has joined #ruby
[06:12:42] mikhael_k33hl: elomatreb: can you elaborate more on the "so the class methods using that instance method probably from the included module is probably intentional"
[06:13:21] elomatreb: Mh, sorry. Bad sentence. Your class uses this: https://ruby-doc.org/stdlib-2.4.2/libdoc/singleton/rdoc/Singleton.html -- A singleton object is an object of which there can only be one
[06:14:12] Xiti: has joined #ruby
[06:17:40] Jameser: has joined #ruby
[06:17:46] jenrzzz: has joined #ruby
[06:17:46] jenrzzz: has joined #ruby
[06:18:07] mikhael_k33hl: elomatreb: Oh yeah, just found out that it automatically creates an instance and you can refer to it with the "instance" variable. Thanks
[06:18:08] eckhardt: has joined #ruby
[06:18:24] elomatreb: Specifically it's always the same instance, that's what's interesting.
[06:18:28] tAn: has joined #ruby
[06:20:18] c0ncealed: has joined #ruby
[06:20:38] cschneid_: has joined #ruby
[06:24:01] dionysus69: has joined #ruby
[06:30:42] `derpy: has joined #ruby
[06:31:39] uZiel: has joined #ruby
[06:31:43] adaedra: has joined #ruby
[06:36:02] goyox86: has joined #ruby
[06:38:03] al2o3-cr: has joined #ruby
[06:41:19] armando: has joined #ruby
[06:43:05] uZiel: has joined #ruby
[06:45:16] rabajaj: has joined #ruby
[06:47:01] Barrt: has joined #ruby
[06:50:50] Jameser`: has joined #ruby
[06:52:42] bkxd_: has joined #ruby
[06:54:03] Jameser: has joined #ruby
[06:55:00] mtkd: has joined #ruby
[06:55:02] Xiti: has joined #ruby
[06:55:05] alex``: has joined #ruby
[06:55:26] jenrzzz: has joined #ruby
[06:56:46] cschneid_: has joined #ruby
[06:59:56] goyox86: has joined #ruby
[07:00:39] ur5us: has joined #ruby
[07:03:42] Technodrome: has joined #ruby
[07:12:21] Exhiled: has joined #ruby
[07:14:15] JusticeFries: has joined #ruby
[07:23:35] Jameser`: has joined #ruby
[07:24:09] ur5us: has joined #ruby
[07:27:34] Drakevr: has joined #ruby
[07:28:03] Drakevr: has joined #ruby
[07:28:59] Jameser: has joined #ruby
[07:29:57] Mia: has joined #ruby
[07:29:57] Mia: has joined #ruby
[07:30:15] alfiemax: has joined #ruby
[07:30:27] conta: has joined #ruby
[07:34:16] bkxd: has joined #ruby
[07:35:23] cdg: has joined #ruby
[07:36:04] goyox86: has joined #ruby
[07:38:04] bkxd_: has joined #ruby
[07:40:19] Jameser: has joined #ruby
[07:41:59] andikr: has joined #ruby
[07:43:08] Jameser`: has joined #ruby
[07:44:00] rivalomega: has joined #ruby
[07:46:23] Metrela: has joined #ruby
[07:49:08] Jameser: has joined #ruby
[07:49:28] rivalomega: has joined #ruby
[07:50:44] burgestrand: has joined #ruby
[07:51:49] nofxx1: has joined #ruby
[07:55:27] jackjackdripper: has joined #ruby
[07:56:55] rivalomega: has joined #ruby
[07:58:57] goyox86: has joined #ruby
[07:59:18] guille-moe: has joined #ruby
[08:02:42] elphe: has joined #ruby
[08:03:35] rrutkowski: has joined #ruby
[08:08:21] rrutkowski: has joined #ruby
[08:08:31] yeticry: has joined #ruby
[08:08:44] tAn: has joined #ruby
[08:10:45] lurkingninja: has joined #ruby
[08:11:29] jackjackdripper: has joined #ruby
[08:12:02] ferr: has joined #ruby
[08:13:05] ferr: has left #ruby: ()
[08:15:27] anas: has joined #ruby
[08:16:41] rmhonji: has joined #ruby
[08:17:14] goyox86: has joined #ruby
[08:17:26] InfinityFye: has joined #ruby
[08:18:49] sleetdrop: has joined #ruby
[08:19:30] bkxd: has joined #ruby
[08:20:11] InfinityFye: has left #ruby: ()
[08:20:14] anisha: has joined #ruby
[08:20:36] apofis: has joined #ruby
[08:23:02] aufi: has joined #ruby
[08:23:14] bkxd_: has joined #ruby
[08:23:51] Technodrome: has joined #ruby
[08:25:00] sepp2k: has joined #ruby
[08:30:51] mark_66: has joined #ruby
[08:31:30] Jameser`: has joined #ruby
[08:34:55] goyox86: has joined #ruby
[08:36:21] Jameser: has joined #ruby
[08:38:42] tAn: has joined #ruby
[08:38:43] yeticry: has joined #ruby
[08:39:30] biberu: has joined #ruby
[08:42:36] jenrzzz: has joined #ruby
[08:42:47] Dimik: has joined #ruby
[08:43:52] rmhonji: has joined #ruby
[08:45:24] Jameser`: has joined #ruby
[08:45:32] petervbeck: has joined #ruby
[08:46:16] hs366: has joined #ruby
[08:46:59] mjolnird: has joined #ruby
[08:49:03] bweston92: has joined #ruby
[08:51:41] RevanOne: has joined #ruby
[08:52:21] vondruch: has joined #ruby
[08:53:32] goyox86: has joined #ruby
[09:00:10] mtkd: has joined #ruby
[09:00:20] nowhere_man: has joined #ruby
[09:00:21] bijan__: has joined #ruby
[09:00:24] Sylario: has joined #ruby
[09:04:31] bijan__: has joined #ruby
[09:04:45] bkxd: has joined #ruby
[09:10:53] goyox86: has joined #ruby
[09:11:49] im0nde: has joined #ruby
[09:19:17] burgestrand: has joined #ruby
[09:19:42] bkxd_: has joined #ruby
[09:19:57] mim1k: has joined #ruby
[09:22:14] Riddell: has joined #ruby
[09:23:32] rhebz916: has joined #ruby
[09:25:23] huyderman: has joined #ruby
[09:25:34] hahuang65: has joined #ruby
[09:28:28] nowhere_man: has joined #ruby
[09:32:38] goyox86: has joined #ruby
[09:32:43] qba73: has joined #ruby
[09:35:20] NL3limin4t0r: has left #ruby: ("WeeChat 1.7")
[09:35:37] bijan__: has joined #ruby
[09:37:39] marr: has joined #ruby
[09:37:57] Beams: has joined #ruby
[09:40:02] pifon: has joined #ruby
[09:53:03] al2o3-cr: has joined #ruby
[09:55:04] Cavallari: has joined #ruby
[09:57:06] spectrum: has joined #ruby
[09:58:34] DmitryBochkarev: has joined #ruby
[10:01:09] bkxd: has joined #ruby
[10:04:55] bkxd_: has joined #ruby
[10:09:23] ferr: has joined #ruby
[10:10:04] ur5us: has joined #ruby
[10:11:04] DTZUZO: has joined #ruby
[10:12:53] jenrzzz: has joined #ruby
[10:13:41] TomyWork: has joined #ruby
[10:15:52] goyox86: has joined #ruby
[10:16:30] bronson: has joined #ruby
[10:21:34] jottr: has joined #ruby
[10:25:14] ldnunes: has joined #ruby
[10:25:15] anisha: has joined #ruby
[10:31:49] im0nde: has joined #ruby
[10:32:20] rhebz916: has joined #ruby
[10:33:29] TheBrayn: has joined #ruby
[10:34:16] rabajaj: has joined #ruby
[10:35:48] nofxx: has joined #ruby
[10:38:59] Barrt: has joined #ruby
[10:39:39] rahul_bajaj: has joined #ruby
[10:39:51] rahul_bajaj: has joined #ruby
[10:42:44] jaruga: has joined #ruby
[10:43:20] yeticry: has joined #ruby
[10:46:22] bkxd: has joined #ruby
[10:48:09] goyox86: has joined #ruby
[10:48:21] claudiuinberlin: has joined #ruby
[10:50:11] bkxd__: has joined #ruby
[10:50:13] nofxx: has joined #ruby
[10:51:55] nofxx1: has joined #ruby
[10:53:23] ShekharReddy: has joined #ruby
[11:01:30] apparition: has joined #ruby
[11:06:53] tomphp: has joined #ruby
[11:09:40] miskatonic: has joined #ruby
[11:10:17] syf-revk: has joined #ruby
[11:10:37] rahul_bajaj: has joined #ruby
[11:10:58] quobo: has joined #ruby
[11:11:06] syf-revk: hey there guys
[11:11:55] syf-revk: i'm looking for a way to find a specific string from a file, seek to that string's position, and then continue searching... but i'm not having much luck
[11:12:01] syf-revk: anyone have any advice?
[11:13:27] JaccoP: has joined #ruby
[11:13:47] abhi56rai: has joined #ruby
[11:14:43] Technodrome: has joined #ruby
[11:16:44] Barrt: has joined #ruby
[11:22:29] dminuoso: syf-revk: What does "continue" searching mean?
[11:22:34] dminuoso: Do you just want the pos of the first occurence?
[11:22:48] dminuoso: Should this match in a multiline mode?
[11:23:01] dminuoso: Would be matching against string equality or pattern matching with regex?
[11:23:24] dminuoso: And once you have answered all of that, please show us what you have tried so far.
[11:23:25] yeticry: has joined #ruby
[11:24:05] dminuoso: And what matchingn algorithm do you want if its just string equality?
[11:24:18] dminuoso: Should it be boyer moore strstr?
[11:26:55] goyox86: has joined #ruby
[11:27:23] rahul_bajaj: has joined #ruby
[11:28:33] syf-revk: thanks dminuoso; i want the pos of each occurrence (except i suppose the last) which i would like to seek to, and by "continue searching" i mean repeat this process for all occurrences until no further matches are found. i'm looking to perform this for only one line.
[11:29:30] burgestrand: syf-revk is the file small enough to read all into memory at once?
[11:29:34] syf-revk: i'm looking for a match against string equality rather than regex, and am nonfussed on the matching algo - boyer moore would be fine but i'm just looking for anything at this point
[11:29:55] dminuoso: syf-revk: Okay string quality, using what matching algorithm?
[11:30:00] syf-revk: i'm working with a number of json files that are all less than 5mb
[11:30:04] brandthdl: has joined #ruby
[11:30:13] dminuoso: syf-revk: just implement boyer moore. you will gain "positions" for free.
[11:30:21] dminuoso: Its a good algorithm and good practice.
[11:30:30] burgestrand: I disagree wholeheartedly
[11:30:53] dminuoso: Burgestrand: Can you argue your point?
[11:31:32] syf-revk: Burgestrand; do you suggest an alternative? i'd also like to hear why
[11:31:44] bkxd: has joined #ruby
[11:31:55] syf-revk: and thanks dminuoso, i'll give it a go
[11:31:59] burgestrand: dminuoso It's a rather large yak to shave when the standard library has string search that's just fine
[11:34:17] dminuoso: Burgestrand: *shrugs*
[11:34:56] im0nde: has joined #ruby
[11:35:48] bkxd_: has joined #ruby
[11:38:00] burgestrand: i.e. use IO.read to read the file into a single string into memory, use String#scan with a regex to find all matches, and use $~.begin(0) to find the position of each individual match
[11:38:43] qba73: has joined #ruby
[11:38:45] syf-revk: thanks Burgestrand, i'll try both methods out and let you guys know if i have any trouble
[11:42:01] burgestrand: It's kind of when I want to make a game and I start with/end up making a game engine, it's fun and educational but not really what I wanted to in the first place :D
[11:42:09] ldepandis: has joined #ruby
[11:43:05] gregf_: has joined #ruby
[11:49:31] rahul_bajaj: has joined #ruby
[11:50:07] guardianx: has joined #ruby
[11:50:26] enterprisey: has joined #ruby
[11:52:41] rahul_bajaj: has joined #ruby
[11:55:15] qba73: has joined #ruby
[11:55:57] arup_r: has joined #ruby
[11:56:36] arup_r: Can anyone tell me if ruby has any gems to do what exactly this npm lib https://www.npmjs.com/package/filepreview does?
[11:56:40] rabajaj: has joined #ruby
[11:57:50] goyox86: has joined #ruby
[11:58:36] rivalomega: has joined #ruby
[11:59:12] arup_r: I need to create preview images for pdf, word doc, videos and images. So searching web for a gem which can help me to do the task
[12:00:37] Psybur: has joined #ruby
[12:06:03] Technodrome: has joined #ruby
[12:06:14] arup_r: if not then I will use that JS lib, and write my JS code to process and execute the JS code using https://github.com/jsdf/ruby_node_task :) Not sure if it is a good approach too, but it will do my job
[12:09:06] guille-moe: has joined #ruby
[12:10:51] minn: what causes the interpreter to lock in a multithreaded application? e.g., can't be killed with CTRL+D.
[12:11:10] minn: (well, obviously problems with multithreading - but why can't i kill the interpreter?)
[12:11:59] ur5us: has joined #ruby
[12:12:14] unshadow: has joined #ruby
[12:13:29] minn: pressing CTRL+C advances the line, but it otherwise appears unresponsive to keyboard input
[12:13:58] alex``: has joined #ruby
[12:14:22] brandthdl: has joined #ruby
[12:15:21] mnemon: child in uninterruptible sleep?
[12:17:50] minn: i'm pretty sure that's no the case - i guess killing the irb process works until i debug further
[12:21:33] claudiuinberlin: has joined #ruby
[12:21:52] yeticry: has joined #ruby
[12:22:26] im0nde: has joined #ruby
[12:23:50] tcopeland: has joined #ruby
[12:28:06] Cavallari1: has joined #ruby
[12:28:25] yeticry: has joined #ruby
[12:28:31] qba73: has joined #ruby
[12:30:59] hogetaro: has joined #ruby
[12:32:54] Cavallari1: has joined #ruby
[12:34:29] burgestrand: has joined #ruby
[12:35:51] plexigras: has joined #ruby
[12:38:55] goyox86: has joined #ruby
[12:39:43] JaccoP: has joined #ruby
[12:42:22] tsglove: has joined #ruby
[12:43:18] Cavallari: has joined #ruby
[12:51:16] aufi_: has joined #ruby
[12:52:39] yeticry: has joined #ruby
[12:54:34] despai: has joined #ruby
[12:55:44] WhereIsMySpoon_: has joined #ruby
[12:55:45] WhereIsMySpoon_: has joined #ruby
[12:55:49] goyox86: has joined #ruby
[12:55:54] WhereIsMySpoon_: has left #ruby: ()
[12:57:12] sailfin: has joined #ruby
[13:00:43] AJA4350: has joined #ruby
[13:02:53] nadir: has joined #ruby
[13:06:41] tsglove: has joined #ruby
[13:13:55] aufi_: has joined #ruby
[13:20:38] synthroid: has joined #ruby
[13:23:10] Axolotl___: has joined #ruby
[13:23:31] tvw: has joined #ruby
[13:24:12] workmad3: has joined #ruby
[13:26:31] bmurt: has joined #ruby
[13:33:46] truenito: has joined #ruby
[13:36:03] tcopeland: has joined #ruby
[13:36:37] goyox86: has joined #ruby
[13:37:14] Cavallari1: has joined #ruby
[13:39:49] mensvaga: has joined #ruby
[13:41:13] aScottishBoat: has joined #ruby
[13:41:42] rirc_7ACB: has joined #ruby
[13:51:01] cdg: has joined #ruby
[13:51:11] despai: has joined #ruby
[13:52:27] jlebrech: has joined #ruby
[13:53:29] jlebrech: hi, i'm running a method for a long time and I'm yielding to keep track of the progress but when i yield at the very end it doesn't seem be picked up
[13:54:09] alex``: has joined #ruby
[13:54:59] mcr1: has joined #ruby
[14:00:02] aScottishBoat: has joined #ruby
[14:00:26] ldnunes: has joined #ruby
[14:00:37] goyox86: has joined #ruby
[14:02:41] banisterfiend: has joined #ruby
[14:06:45] JaccoP: has joined #ruby
[14:07:25] burgestrand: ?code jlebrech
[14:07:26] ruby[bot]: jlebrech: We can't help you without your code, please post it to https://gist.github.com
[14:10:06] shinnya: has joined #ruby
[14:12:39] ur5us: has joined #ruby
[14:15:31] JusticeFries: has joined #ruby
[14:16:32] jlebrech: Burgestrand: nevermind it was returning before yield
[14:17:24] dionysus69: has joined #ruby
[14:22:04] mcr1: has joined #ruby
[14:23:18] |ifei5g00d: has joined #ruby
[14:23:25] Puffball_: has joined #ruby
[14:24:08] |ifei5g00d: has joined #ruby
[14:27:00] alfiemax: has joined #ruby
[14:28:46] JaccoP: has joined #ruby
[14:29:09] aScottishBoat: has joined #ruby
[14:29:38] megan1993: has joined #ruby
[14:29:53] megan1993: I have this statement: Item.where.not(url: nil).joins(application: :tokens).where("token.resource_owner_id": self.id).distinct Now I would like to change this to use a WHERE EXISTS instead of a joins (inner join), because I don't care about the return values, I just want to know if it exists. But I'm not sure how I could accomplish this syntax wise, could anyone help me here?
[14:30:18] qba73: has joined #ruby
[14:31:22] veeti: has joined #ruby
[14:31:25] DLSteve: has joined #ruby
[14:33:06] petervbeck: has joined #ruby
[14:33:17] goyox86: has joined #ruby
[14:33:23] KeyJoo: has joined #ruby
[14:39:58] megan1993: Any advice?
[14:41:08] qba73: has joined #ruby
[14:41:28] oleo: has joined #ruby
[14:41:31] banisterfiend: has joined #ruby
[14:41:31] dionysus69: has joined #ruby
[14:42:45] yeticry: has joined #ruby
[14:42:52] JusticeFries: has joined #ruby
[14:44:27] sameerynho: has joined #ruby
[14:45:18] oleo: has joined #ruby
[14:45:19] krawchyk: has joined #ruby
[14:46:06] guille-moe: has joined #ruby
[14:46:35] tobiasvl: megan1993: what framework is this?
[14:46:37] despai: has joined #ruby
[14:46:46] tobiasvl: I have no idea what it is, so can't help, sorry
[14:46:57] tobiasvl: if it's rails, maybe #RubyOnRails can help
[14:48:44] mson: has joined #ruby
[14:48:45] jamiejackson: has joined #ruby
[14:49:47] polishdub: has joined #ruby
[14:51:40] goyox86: has joined #ruby
[14:51:46] polishdub: has left #ruby: ()
[14:52:28] aScottishBoat: has joined #ruby
[14:59:20] m1911: has joined #ruby
[14:59:43] burgestrand: has joined #ruby
[15:01:41] cats: has joined #ruby
[15:04:53] brandthdl: has joined #ruby
[15:05:27] pastorinni: has joined #ruby
[15:06:41] rippa: has joined #ruby
[15:07:55] dionysus69: has joined #ruby
[15:08:03] anas: has joined #ruby
[15:09:52] orbyt_: has joined #ruby
[15:11:17] dviola: has joined #ruby
[15:11:45] jlebrech: megan1993: try adding .count to the query? is this active record?
[15:12:36] johnpaul: has joined #ruby
[15:13:07] Rapture: has joined #ruby
[15:13:39] jlebrech: or replace where with "exists?"
[15:14:18] megan1993: @jlebrech I want to replace the JOIN with a where exists
[15:16:13] armando: has joined #ruby
[15:17:58] jlebrech: what was the join for?
[15:20:11] goyox86: has joined #ruby
[15:21:40] banisterfiend: has joined #ruby
[15:22:28] workmad3_: has joined #ruby
[15:23:23] uZiel: has joined #ruby
[15:24:22] zapata: has joined #ruby
[15:26:03] dennisbot: has joined #ruby
[15:26:15] dennisbot: hello everyone!
[15:26:59] dennisbot: hope you can help me, I'm receiving a message from `rails -v` which is here! https://cl.ly/0K1u1p2C2E2c , thanks in advance
[15:28:01] gizmore: dennisbot: your path is not using the 2.4 dir
[15:28:02] ams__: has joined #ruby
[15:28:10] dennisbot: how can I check that?
[15:28:19] gizmore: try `which ruby`
[15:28:30] dennisbot: it's in the image I provided above
[15:29:14] gizmore: heh yeah...sry
[15:30:08] gizmore: dennisbot: maybe just installed and need a fresh login?
[15:30:16] gizmore: probably not though
[15:33:15] dennisbot: gizmore, starting up the terminal seems to have solved the problem, thanks!
[15:33:28] gizmore: wow nice... can i pm you?
[15:33:37] gizmore: for one advertisement link?
[15:33:51] dennisbot: I'm not used to use IRC so I'm not sure if I'm doing this right
[15:35:31] aScottishBoat: has joined #ruby
[15:36:26] banisterfiend: has joined #ruby
[15:41:54] aScottishBoat: has joined #ruby
[15:42:27] uZiel: has joined #ruby
[15:42:30] dionysus69: has joined #ruby
[15:46:09] aScottishBoat: What made you fall in love with Ruby?
[15:47:28] Guest40205: has joined #ruby
[15:47:39] mcr1: has joined #ruby
[15:47:55] mfaeh: has joined #ruby
[15:50:00] aScottishBoat: has joined #ruby
[15:50:08] alfiemax: has joined #ruby
[15:50:12] gizmore: aScottishBoat: the syntax
[15:50:27] aScottishBoat: Yeah, good answer.
[15:50:28] gizmore: the greatness of code that creates code
[15:50:41] gizmore: the elegance.... this grip of everything's great
[15:50:43] aScottishBoat: What are your thoughts on Python?
[15:51:04] gizmore: isnt it this esoteric language, similiar to \t\twhitespace?
[15:51:15] selim: has joined #ruby
[15:51:17] gizmore: never tried python
[15:52:57] burgestrand: has joined #ruby
[15:56:07] safetypin: has joined #ruby
[15:56:33] goyox86: has joined #ruby
[15:56:42] cognoscente_: has joined #ruby
[15:57:01] dionysus69: has joined #ruby
[15:58:20] justicef_: has joined #ruby
[15:58:23] DmitryBochkarev: has joined #ruby
[15:59:01] Cavallari: has joined #ruby
[15:59:28] qba73: has joined #ruby
[16:03:52] cagmz: has joined #ruby
[16:05:18] cschneid_: has joined #ruby
[16:05:38] rivalomega: has joined #ruby
[16:06:57] aScottishBoat: has joined #ruby
[16:08:07] Map: has joined #ruby
[16:08:31] JusticeFries: has joined #ruby
[16:09:09] mim1k: has joined #ruby
[16:09:24] gnufied: has joined #ruby
[16:13:23] ur5us: has joined #ruby
[16:14:19] mtkd: has joined #ruby
[16:18:28] JaccoP: has joined #ruby
[16:19:32] troys: has joined #ruby
[16:21:00] Azure: has joined #ruby
[16:21:01] mim1k: has joined #ruby
[16:24:26] despai: has joined #ruby
[16:28:14] synthroid: has joined #ruby
[16:30:47] FrostCandy: has joined #ruby
[16:34:00] DmitryBochkarev: has joined #ruby
[16:34:31] cagomez: has joined #ruby
[16:39:50] yeticry: has joined #ruby
[16:40:37] dionysus69: has joined #ruby
[16:44:50] Exhiled: has joined #ruby
[16:45:30] jackjackdripper: has joined #ruby
[16:47:16] goyox86: has joined #ruby
[16:55:37] Olipro: has joined #ruby
[16:55:56] jamesaxl: has joined #ruby
[16:57:54] mostlybadfly: has joined #ruby
[16:59:21] plexigras: has joined #ruby
[16:59:26] DrCode: has joined #ruby
[17:01:53] dionysus69: has joined #ruby
[17:03:40] chocoelho: has joined #ruby
[17:04:20] synthroid: has joined #ruby
[17:05:10] dinfuehr: has joined #ruby
[17:10:44] bmurt: has joined #ruby
[17:11:36] jnollette: has joined #ruby
[17:12:00] Lytol: has joined #ruby
[17:13:27] JusticeFries: has joined #ruby
[17:16:02] dionysus69: has joined #ruby
[17:16:11] mikkelsen: has joined #ruby
[17:27:06] guille-moe: has joined #ruby
[17:27:37] eckhardt: has joined #ruby
[17:33:09] dionysus69: has joined #ruby
[17:37:20] petervbeck: has joined #ruby
[17:39:25] pifon: has joined #ruby
[17:46:48] ramfjord: has joined #ruby
[17:47:09] goyox86: has joined #ruby
[17:47:58] sanscoeur: has joined #ruby
[17:50:27] duderonomy: has joined #ruby
[17:50:31] shaman42: has joined #ruby
[17:50:39] Technodrome: has joined #ruby
[17:51:47] aScottishBoat: has joined #ruby
[17:55:17] bmurt: has joined #ruby
[17:55:33] tAn: has joined #ruby
[17:59:46] orbyt_: has joined #ruby
[18:00:21] alfiemax: has joined #ruby
[18:06:57] guille-moe: has joined #ruby
[18:10:50] rm8: has joined #ruby
[18:11:07] johnpaul: has joined #ruby
[18:11:13] ur5us: has joined #ruby
[18:11:56] goyox86: has joined #ruby
[18:11:58] brandthdl: has joined #ruby
[18:13:22] mim1k: has joined #ruby
[18:15:50] marahin: has joined #ruby
[18:18:41] eblip: has joined #ruby
[18:19:22] mtkd: has joined #ruby
[18:19:23] claudiuinberlin: has joined #ruby
[18:19:57] Eiam: has joined #ruby
[18:24:00] mson: has joined #ruby
[18:24:10] gr33n7007h: has joined #ruby
[18:27:12] wilbert: has joined #ruby
[18:28:44] mtkd: has joined #ruby
[18:29:02] mim1k: has joined #ruby
[18:30:02] tomphp: has joined #ruby
[18:32:37] goyox86: has joined #ruby
[18:34:20] johnny56_: has joined #ruby
[18:37:17] KeyJoo: has joined #ruby
[18:42:03] kitikonti: has joined #ruby
[18:44:09] conta1: has joined #ruby
[18:45:21] Technodrome: has joined #ruby
[18:47:51] alfiemax: has joined #ruby
[18:52:13] growp: has joined #ruby
[18:52:41] paranoicsan: has joined #ruby
[18:55:55] hahuang65: has joined #ruby
[18:58:21] jolamb: So this is basically the same code repeated 5 times; is there a good ruby idiom to make this less repetitive? https://github.com/dobbymoodge/sprint_tools/blob/add_loader/lib/trello_json_loader.rb#L23-L47
[18:59:15] alex``: has joined #ruby
[19:00:51] jolamb: I was thinking something like `['labels', 'members', 'cards', ...].each do |json_type|` ... `send("load_#{json_type}", object_json, trello)`
[19:01:15] jolamb: but that smells to me
[19:02:07] wilbert: has joined #ruby
[19:02:38] TomyLobo: has joined #ruby
[19:02:56] orbyt_: has joined #ruby
[19:03:39] goyox86: has joined #ruby
[19:09:28] jhass: first of all do you need to reuse instances or couldn't you make trello an initializer parameter and instance variable?
[19:09:48] JusticeFries: has joined #ruby
[19:09:51] jhass: also what's the point of the class if it's nil/not given?
[19:10:11] jhass: just having the accessors?
[19:10:27] jhass: idk, feels like conflating two jobs into one
[19:10:55] Xiti: has joined #ruby
[19:11:54] jhass: then I'd surely extract the if x; x.each; into a method, like each_item(data, 'foo') do |foos|
[19:12:06] tmm88_: has joined #ruby
[19:15:26] jhass: if you extract the trello.add_ calls into a separate steps you can probably do @foo = load(list, Trello::Foo) and inside list.each_with_object({}) {|item, items| items[item["id"]] = kind.new(item) }
[19:15:40] jhass: inside = implementation of load
[19:15:41] yeticry: has joined #ruby
[19:15:55] jhass: which then is probably better named parse or map or something
[19:16:48] SeepingN: has joined #ruby
[19:18:09] jhass: if you want to keep the trello.add_ stuff in this class I'd make it a separate interface, so that it becomes project = TrelloProject.from_json(json); project.populate(trello) or so
[19:18:49] jhass: and populate is then just 6 times @foo.each {|x| trello.add_x(x) } basically
[19:19:36] jhass: not sure I got all the requirements for this right but you get the idea
[19:21:22] jhass: in general avoid names of data formats or structures in variable names, json_data -> board, member_json -> members etc
[19:22:40] claudiuinberlin: has joined #ruby
[19:22:49] clemens3: has joined #ruby
[19:23:50] brandthdl: has joined #ruby
[19:24:52] jolamb: jhass: sorry, someone stopped by my desk. Reading now
[19:25:13] jhass: sure no worries
[19:28:19] drowze: has joined #ruby
[19:28:40] ltem: has joined #ruby
[19:29:27] hays: has joined #ruby
[19:29:28] hays: has joined #ruby
[19:30:10] jolamb: jhass: yeah, the load_xyz methods all cache the loaded objects, so I could just load them all and then move the code to populate the trello object into the TrelloHelper class, and use accessors
[19:31:48] dionysus69: has joined #ruby
[19:36:33] goyox86: has joined #ruby
[19:38:28] Secret113: has joined #ruby
[19:39:19] Secret113: I am new to ruby and am having trouble with this code, could i get some assistance
[19:39:30] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[19:40:35] Secret113: I cant get it to recognize that @shiftedboard[r][c] == 0 is true
[19:41:31] Secret113: https://gist.github.com/Whiterussian113/14c20ed713987d8fc17135eec8764def
[19:41:43] Secret113: ive never used gist
[19:43:11] Dimik: has joined #ruby
[19:43:24] bmurt: has joined #ruby
[19:43:29] jhass: Secret113: use p instead of puts for debug prints. when you interpolate for debugging do "foo: #{x.inspect}" instead of just "foo: #{x}"
[19:43:53] jhass: you might quickly find your mistake when apply that advice to your current debug prints ;)
[19:45:18] Secret113: Really, they are strings... Sighs... Ive been stuck for 3 hrs
[19:45:24] bmurt: has joined #ruby
[19:45:32] jhass: you're welcome :D
[19:46:06] tomphp: has joined #ruby
[19:47:37] jhass: ?pry Secret113
[19:47:37] ruby[bot]: Secret113: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[19:47:44] baweaver: puts returns nil, fair warning
[19:47:59] tomphp: has joined #ruby
[19:48:22] baweaver: so if you put it at the bottom of a method you get back nil even though the result shows up on screen
[19:48:45] csk157: has joined #ruby
[19:48:47] jhass: another thing that makes p better for debugging, since it returns its argument
[19:49:57] wilbert: has joined #ruby
[19:52:06] Secret113: I added return nil
[19:52:13] Secret113: works perfectly
[19:53:25] jhass: tutorials should start with how to debug I guess, baweaver does your book? :D
[19:53:42] baweaver: It has a large section on debugging, yes
[19:53:47] baweaver: (that still needs to be written)
[19:54:10] baweaver: I want to cover finding answers on Google, SO, asking questions, reading stack traces, and binding.irb
[19:54:45] Secret113: I dont use a book, but now its not going through the loop properly, It should go through 81 times, but it is only going 3 times
[19:55:47] Secret113: nevermind, Im just an idiot
[19:58:35] despai: has joined #ruby
[19:58:50] Secret113: LOVE YOU ALLL
[19:59:07] Secret113: This is my final, 50% of grade
[19:59:28] Secret113: and he is making us use ruby, but didnt bother to teach us ruby
[20:00:36] tvw: has joined #ruby
[20:00:43] jxv: has joined #ruby
[20:01:55] rhyselsmore: has joined #ruby
[20:03:57] ur5us: has joined #ruby
[20:04:21] chocoelho: has joined #ruby
[20:04:44] veeti: has joined #ruby
[20:05:49] rrutkowski: has joined #ruby
[20:06:54] RougeT430: has joined #ruby
[20:08:00] RougeT430: noob question
[20:08:03] RougeT430: https://gist.github.com/CodePint/a6f33d989176fa96940b1d23e293c9be
[20:08:29] RougeT430: getting this error: ruby_testing.rb:41:in `roll_dice': undefined method `times' for nil:NilClass (NoMethodError)
[20:08:55] skweek: has joined #ruby
[20:10:49] aScottishBoat: for advice, Rubyists tend to code with a tabspace of 2
[20:11:27] RougeT430: ahh ill change my editor
[20:11:38] aScottishBoat: I haven't programmed in Ruby for a while (gasp) but isn't that an error on line 41
[20:11:45] aScottishBoat: `ask_rolls.times do rand_gen = rand(x..y)`
[20:12:08] aScottishBoat: for one, change your 'do' to { and add the appropriate closing bracket
[20:12:29] aScottishBoat: you haven't closed it
[20:13:36] aScottishBoat: also I don't think #times was used correctly (but I'm out of touch with Ruby)
[20:13:40] RougeT430: isnt that end closing it?
[20:13:57] RougeT430: if its over one line use end as standard
[20:14:12] ljarvis: yes, your indenting is just bad
[20:14:24] aScottishBoat: Ahh yes, that end is closing it. I thought it was closing the function definition
[20:14:35] RougeT430: yeah my indentation is a mess
[20:14:44] aScottishBoat: Tell you what, why don't you 1) change tabspace to 2, and 2) make sure everything is indented properly\
[20:14:44] ljarvis: clean that up and then re-paste it :-)
[20:14:51] aScottishBoat: yep, what ljarvis said
[20:14:52] RougeT430: okay, will do
[20:14:59] Secret113: also perchance, did you used to use perl
[20:15:16] aScottishBoat: Secret113 lmao
[20:15:31] Secret113: i am a perl coder, I am only using ruby b/c class
[20:16:15] aScottishBoat: Because of a course at school?
[20:16:22] aScottishBoat: I like the idea of loving perl, but I can't get into it :(
[20:16:33] Secret113: its not hard
[20:16:33] ljarvis: RougeT430: once you've repasted, take a look at this method and see if you can tell what's wrong: https://gist.github.com/CodePint/a6f33d989176fa96940b1d23e293c9be#file-rand01-rb-L24-L28
[20:16:43] ljarvis: same with `ask_sides`
[20:17:37] aScottishBoat: also RougeT430 you don't need to specify `return` like you did
[20:17:58] aScottishBoat: if you specify a value without the return keyword, it'll be implicitly returned
[20:17:59] Secret113: also will can someone confirm that this solves Sudoku https://gist.github.com/Whiterussian113/14c20ed713987d8fc17135eec8764def
[20:18:06] Secret113: and doesnt go infinite
[20:18:13] aScottishBoat: Take line 44 for example: just put results_array
[20:18:48] RougeT430: aScottishBoat: thanks for the tip, im not quite sure why i was doing that
[20:18:54] Secret113: is using an expliit return bad?
[20:18:55] aScottishBoat: God I love Ruby and the Ruby community, good job guys
[20:19:03] aScottishBoat: No that I know of, but it'
[20:19:07] aScottishBoat: it's a bit redundant *
[20:19:13] Secret113: This community is way nicer than Java
[20:19:46] RougeT430: yeah it is way nicer. i agree, hang out in the linux community a fair bit...
[20:19:47] Secret113: I thought in ruby the symbol would be :+1
[20:19:54] aScottishBoat: Secret113, open up irb and specify a variable. Now just call that variable in irb without any function. You'll see it gets returned
[20:20:11] aScottishBoat: Secret113, you blew my mind
[20:20:25] Secret113: i know it does, im just wondering if there is any harm in explicit returns
[20:20:36] skweek: has joined #ruby
[20:20:48] aScottishBoat: Ah. Don't think so. I was advised a while ago by a Ruby wizard to just implicitly return the value
[20:20:52] RougeT430: what else was wrong with style other than my tabs. its something ive struggled with a bit
[20:21:04] RougeT430: was easy with python as indentation was so rigid
[20:21:06] Secret113: Paste link again?
[20:21:24] RougeT430: https://gist.github.com/CodePint/14a4ba3feb5c493663cecbb695274984
[20:21:44] ljarvis: that looks the same
[20:21:56] RougeT430: ive got my friend who is a comp sci major spending some time with me later anyway.
[20:21:58] aScottishBoat: indenting properly
[20:22:09] Secret113: make the vars start with @
[20:22:14] aScottishBoat: RougeT430, do you use Linux? just curious
[20:22:20] RougeT430: aScottishBoat: i do
[20:22:31] aScottishBoat: Secret113, really?
[20:22:34] RougeT430: fairly recent convert to desktop though
[20:22:59] RougeT430: used it on servers for long time. only just swapped to it for full time DD
[20:23:02] Secret113: It is something that I was taught, and if you notice it does not hurt
[20:23:09] ljarvis: https://gist.github.com/anonymous/675c5efb2124503ba722c61f3e7a26d7
[20:23:15] ljarvis: no dont make the vars start with @
[20:24:19] Secret113: does upto start at the top or bottom
[20:24:21] RougeT430: just reading changes ljarvis
[20:24:33] ljarvis: RougeT430: i just fixed the indenting is all
[20:24:41] ljarvis: no other changes yet
[20:24:43] RougeT430: i set the indenting to be fixed on sublime
[20:24:52] RougeT430: but its not doing it when i paste to github
[20:25:17] ljarvis: you might have to reformat it in sublime, it might just be making it look nice without making changes on disk
[20:25:40] ljarvis: anyway, indenting problems aside, take at look at the `ask_rolls` method. What's it meant to do?
[20:26:22] jenrzzz: has joined #ruby
[20:26:22] jenrzzz: has joined #ruby
[20:26:29] Secret113: it seems like ljarvus is a teacher
[20:26:45] RougeT430: ljarvis: get the amount of rolls from the user and then convert it to an integer. then return the value to the function
[20:26:52] orbyt_: has joined #ruby
[20:26:52] Secret113: am I right?
[20:27:06] RougeT430: ACTION is taking a ruby course end of january
[20:27:10] ljarvis: RougeT430: "return the value to the function" -- explain that to me a bit. Is `ask_rolls` method to return the value?
[20:27:34] RickHull: has joined #ruby
[20:27:43] goyox86: has joined #ruby
[20:28:42] SuperLag: has joined #ruby
[20:29:23] RougeT430: its not actually getting the value returned. its just sitting as the variable?
[20:29:32] ljarvis: is that what you want?
[20:29:42] RougeT430: no it isnt. or its not how its setup
[20:29:43] knight33: has joined #ruby
[20:29:53] ljarvis: right, you want to return it from the method, right?
[20:30:02] RougeT430: yeah i do. so i dont need the roll =
[20:30:07] RougeT430: i just want the gets.chomp?
[20:30:15] ljarvis: yep, or the `nil` on the next line, since that means the method will return nil
[20:30:26] goyox86_: has joined #ruby
[20:30:29] RougeT430: why would i want that?
[20:30:41] ljarvis: well exactly
[20:30:53] ljarvis: so you remove it
[20:30:58] ljarvis: now do the same with `ask_sides` which has the same issue, and run your code
[20:31:02] RougeT430: okay, yeah let me give that a shot
[20:31:18] RougeT430: ive not programmed in a few weeks, so i was trying to do some exercises to get my brain working
[20:31:28] RougeT430: lets give it a go
[20:31:39] alfiemax_: has joined #ruby
[20:32:21] goyox86_: has joined #ruby
[20:33:44] RougeT430: just reading through now trying to figure next bit
[20:34:08] ljarvis: no rush, shout if you need help
[20:34:08] bmurt: has joined #ruby
[20:34:42] goyox86_: has joined #ruby
[20:40:08] RougeT430: ljarvis: it works, but its asking for ask_rolls and ask_sides several times. just looking at that
[20:40:19] eckhardt: has joined #ruby
[20:40:33] ljarvis: yep, hint: you call them in both ask_loop AND roll_dice
[20:40:54] ljarvis: I would recommend asking for them both in ask_loop and then pass them into the roll_dice method as arguments
[20:41:28] RougeT430: ill look at that now ty
[20:42:28] cagomez: has joined #ruby
[20:43:26] veeti: has joined #ruby
[20:43:49] RougeT430: oh i didnt realise string interpolation would call the function i just wanted to interpolate the result
[20:44:21] ljarvis: RougeT430: you have to call the method to get the result ;)
[20:44:49] RougeT430: yeah it makes sense its just running the code in there
[20:44:56] RougeT430: ill do it with variables. cleaner
[20:45:26] ljarvis: well also method you only want 1 result, so you need to store it in a variable. Definitely makes sense
[20:45:39] ljarvis: s/method/because/
[20:45:45] ljarvis: words are hard today
[20:51:34] zmo: /go#git-services/git-repo
[20:51:51] zmo: oops, mosh messed up :)
[20:55:31] sameerynho: has joined #ruby
[20:58:32] kus_ubuntui686: has joined #ruby
[20:58:47] Xiti: has joined #ruby
[20:59:00] cagomez: has joined #ruby
[20:59:11] roshanavand: has joined #ruby
[21:01:38] jackjackdripper: has joined #ruby
[21:02:24] jenrzzz_: has joined #ruby
[21:02:56] mattp_: has joined #ruby
[21:03:23] RougeT430: ljarvis: all working btw
[21:03:38] RougeT430: trying to find out why sublime is still tabbing wrong
[21:08:44] ramfjord: has joined #ruby
[21:10:09] RougeT430: w.e ill fix the tabs later
[21:10:11] RougeT430: https://gist.github.com/CodePint/0a98488140cde598de2684921c6a8f25
[21:10:20] RougeT430: but working alright. thanks for all your help
[21:10:22] lele: has joined #ruby
[21:12:58] bkxd: has joined #ruby
[21:14:14] truenito: has joined #ruby
[21:15:26] minn: has joined #ruby
[21:18:09] tomphp: has joined #ruby
[21:18:40] conta1: has joined #ruby
[21:20:33] oleo: has joined #ruby
[21:22:29] jhass: RougeT430: make sure "use spaces" is checked, then select everything and select "convert tabs to spaces" from the command palette
[21:28:25] helpa: has joined #ruby
[21:29:58] Exhiled: has joined #ruby
[21:35:13] rrutkowski: has joined #ruby
[21:35:32] sanscoeur: has joined #ruby
[21:37:03] tomphp: has joined #ruby
[21:37:27] JusticeFries: has joined #ruby
[21:38:33] shinnya: has joined #ruby
[21:40:26] aScottishBoat: RougeT430, nice refactoring
[21:41:34] RougeT430: aScottishBoat: thanks. just finished tidying it up fully. guna do a few more little tasks to get back in the swing
[21:41:36] RougeT430: https://gist.github.com/CodePint/f233fa3a3ff840cdaafa16a55c201b9d
[21:42:49] aScottishBoat: do you prefer having a newline char on its own line?
[21:42:50] houhoulis: has joined #ruby
[21:43:12] _aeris_: has joined #ruby
[21:43:15] RougeT430: i know you can just add them on. but sometimes i prefer having it like this
[21:43:22] RougeT430: acts as a break for readability
[21:43:28] baweaver: puts takes multiple arguments
[21:43:36] baweaver: and just puts by itself gives a newline
[21:44:04] baweaver: puts('takes', 'varadic', 'arguments', 'and', 'outputs', 'with', 'newlines')
[21:44:21] RougeT430: will put each on its own line
[21:44:56] baweaver: also no need to recursively call the loop
[21:45:05] baweaver: just don't break unless you have the break condition
[21:45:20] RougeT430: yep, well spotted.
[21:45:23] RougeT430: taken that out now
[21:45:32] RougeT430: i think i was doing a conditional loop at one point
[21:45:58] RougeT430: ACTION kicks back
[21:46:09] baweaver: roll_dice is odd
[21:46:42] baweaver: should name the arguments something more useful like dice_size and number_of_dice
[21:46:52] cagmz_: has joined #ruby
[21:47:05] |ifei5good: has joined #ruby
[21:47:13] baweaver: number_of_dice.times.map { rand(1..dice_size) }
[21:47:41] RougeT430: does .map create the array for you?
[21:47:53] baweaver: >> 5.times.to_a
[21:47:54] ruby[bot]: baweaver: # => [0, 1, 2, 3, 4] (https://eval.in/917028)
[21:47:55] Asher1: has joined #ruby
[21:47:56] tao_: has joined #ruby
[21:48:08] baweaver: >> 5.times.map { |i| i * 10 }
[21:48:09] ruby[bot]: baweaver: # => [0, 10, 20, 30, 40] (https://eval.in/917029)
[21:48:25] nathani1: has joined #ruby
[21:48:25] Nilium_: has joined #ruby
[21:48:36] qba73: has joined #ruby
[21:48:37] RougeT430: thats pretty neat. ill try changing that shortly. i was reading about .map as i was looking how to do it, still got tab open
[21:48:40] baweaver: >> 5.times.map { rand(1..6) }
[21:48:41] baweaver: ACTION waits for bot
[21:48:41] ruby[bot]: baweaver: # => [1, 5, 2, 4, 3] (https://eval.in/917030)
[21:48:41] toogley: has left #ruby: ("WeeChat 1.9.1")
[21:48:46] lytol_: has joined #ruby
[21:48:52] _musl_: has joined #ruby
[21:48:53] Keltia_: has joined #ruby
[21:48:59] baweaver: map basically takes an array and returns a new array with each element being transformed by its function
[21:49:11] RougeT430: right okay, gotcha
[21:49:31] baweaver: short version: Applies a function to an array
[21:49:39] baweaver: &ri Enumerable
[21:49:39] `derpy: http://ruby-doc.org/core-2.4.1/Enumerable.html
[21:49:44] chihhsin_: has joined #ruby
[21:49:45] ski4x7: has joined #ruby
[21:49:47] RougeT430: ill read the ruby doc on it
[21:49:51] baweaver: Read into: map, reduce, select, and find
[21:49:59] baweaver: those four are critical to know
[21:50:19] RougeT430: awesome, let me have a putter.
[21:50:35] aScottishBoat: I like delete_if
[21:50:39] baweaver: The rest are definitely nice to know, you'll just find yourself using those ones more frequently
[21:50:58] baweaver: I use reject only because it gives me a new array instead of mutating the original
[21:51:02] aScottishBoat: Array.delete_if { |i| i.eql? "unwanted_entry" }
[21:51:15] aScottishBoat: baweaver, why do you prefer a new array?
[21:51:16] qba73: has joined #ruby
[21:51:35] kke_: has joined #ruby
[21:51:36] reaVer_: has joined #ruby
[21:51:38] chrisarc1nd: has joined #ruby
[21:51:39] NicolasH1: has joined #ruby
[21:51:41] baweaver: def my_method(array) array.delete_if { ... } end
[21:51:43] miah_: has joined #ruby
[21:51:57] baweaver: do you expect your array to be mangled? Maybe you want it for something else
[21:52:00] hxegon_: has joined #ruby
[21:52:05] PaulePan1er: has joined #ruby
[21:52:07] mbr_: has joined #ruby
[21:52:23] fmccann_: has joined #ruby
[21:52:33] jinie_: has joined #ruby
[21:52:40] baweaver: the less you mutate things the easier it is to reason about your application in general
[21:52:41] baweaver: and test, incidentally.
[21:54:54] miskatonic: has joined #ruby
[21:55:07] Jello_Raptor_: has joined #ruby
[21:55:07] esObe_: has joined #ruby
[21:55:10] akhkharu: has joined #ruby
[21:56:27] helpa: has joined #ruby
[21:56:41] dminuoso: has joined #ruby
[21:57:16] bmurt: has joined #ruby
[21:57:19] jpterry: has joined #ruby
[21:57:46] ramfjord: has joined #ruby
[21:58:10] aScottishBoat: baweaver, I'll take those to heart
[21:58:45] enterprisey: has joined #ruby
[21:59:04] baweaver: It's one of the reasons I go after people for using puts in methods
[21:59:22] baweaver: let the methods return strings, and only puts it later
[22:00:08] bokayio: has joined #ruby
[22:00:09] d^sh: has joined #ruby
[22:00:12] BTRE: has joined #ruby
[22:00:15] marahin: has joined #ruby
[22:00:16] aScottishBoat: baweaver, do you have extensive experience with any other scripting language? I'd love your feedback on a quick comparison to/from ruby
[22:00:28] Guest40205: has joined #ruby
[22:01:04] baweaver: Javascript, some Python, some Perl, very little TCL/TK, some Bash
[22:01:07] krawchyk: has joined #ruby
[22:01:33] baweaver: and depends what you mean by that
[22:01:48] shaman42: has joined #ruby
[22:01:49] mkaito: has joined #ruby
[22:02:23] adaedra: has joined #ruby
[22:02:51] aScottishBoat: What makes you like Ruby more than the others?
[22:02:55] MrBusiness: has joined #ruby
[22:04:06] baweaver: Than Python: It's less strict, it allows me to be more expressive, it has a notably functional flavor to it, and it reads more cleanly
[22:04:16] ledestin: has joined #ruby
[22:04:39] baweaver: Than Javascript: I actually like Javascript, so it's more of a what am I working on issue.
[22:04:46] JaccoP: has joined #ruby
[22:04:57] baweaver: Than Perl: Less odd magic and edge cases in the language and preference towards verbosity over surgical compactness and illegibility.
[22:05:14] baweaver: Than TCL/TK: It actually has a community at all
[22:06:38] elphe: has joined #ruby
[22:06:54] bmurt: has joined #ruby
[22:11:46] mson: has joined #ruby
[22:12:01] shaman42: has joined #ruby
[22:12:06] Sightes: has joined #ruby
[22:12:40] jenrzzz: has joined #ruby
[22:12:41] jenrzzz: has joined #ruby
[22:13:06] ski7777: has joined #ruby
[22:14:35] elphe: has joined #ruby
[22:14:48] banisterfiend: has joined #ruby
[22:16:03] tfitts: has joined #ruby
[22:16:41] miah: has joined #ruby
[22:17:04] bmurt: has joined #ruby
[22:25:11] eckhardt: has joined #ruby
[22:26:04] jnyw: has joined #ruby
[22:26:12] JusticeFries: has joined #ruby
[22:28:24] orbyt_: has joined #ruby
[22:29:50] bmurt: has joined #ruby
[22:32:40] krawchyk: has joined #ruby
[22:34:01] yeticry: has joined #ruby
[22:34:21] skweek: has joined #ruby
[22:39:20] mtkd: has joined #ruby
[22:42:01] eckhardt: has joined #ruby
[22:47:21] rrutkowski: has joined #ruby
[22:51:48] bmurt: has joined #ruby
[22:52:43] Axy: has joined #ruby
[22:52:45] Axy: has joined #ruby
[22:57:22] yeticry: has joined #ruby
[23:00:43] cagomez: has joined #ruby
[23:05:08] jenrzzz_: has joined #ruby
[23:07:23] orbyt_: has joined #ruby
[23:07:42] tcopeland: has joined #ruby
[23:11:09] soulisson: has joined #ruby
[23:13:44] astronavt: has joined #ruby
[23:14:56] guardianx: has joined #ruby
[23:15:11] guille-moe: has joined #ruby
[23:19:12] pastorinni: has joined #ruby
[23:21:21] elphe: has joined #ruby
[23:22:13] bmurt: has joined #ruby
[23:31:46] bmurt: has joined #ruby
[23:32:25] jenrzzz: has joined #ruby
[23:32:26] jenrzzz: has joined #ruby
[23:36:30] mim1k: has joined #ruby
[23:37:52] jenrzzz_: has joined #ruby
[23:42:14] moei: has joined #ruby
[23:43:15] charliesome: has joined #ruby
[23:44:29] rrutkowski: has joined #ruby
[23:46:59] soulisson: Hi, is the size of a variable the amount of data that it can contain?
[23:47:53] banisterfiend: has joined #ruby
[23:48:19] bmurt: has joined #ruby
[23:50:12] tessi_zz: has joined #ruby
[23:50:44] baweaver: soulisson: what?
[23:51:09] jackjackdripper: has joined #ruby
[23:51:17] baweaver: The size is how many elements an Array currently has, or a Hash, or another collection
[23:51:45] baweaver: as far as how much it _can_ contain, how much RAM do you have?
[23:52:39] soulisson: baweaver: but when we say we have a 16 byte buffer/variable, it refers to how many bytes we can put in it, no?
[23:53:17] baweaver: you realize you're in a Ruby channel, no?
[23:53:58] baweaver: It's a dynamic language, so that's why it's such an odd question
[23:54:14] baweaver: they don't technically have defined sizes as far as the developer is concerned.
[23:56:42] Tony-St4rk: has joined #ruby
[23:56:57] soulisson: yes, my bad
[23:57:55] contradictioned: has joined #ruby
[23:58:09] foamz: has joined #ruby
[23:58:10] petems: has joined #ruby
[23:58:40] TvL: has joined #ruby
[23:59:11] darix: has joined #ruby
[23:59:13] RushPL: has joined #ruby
[23:59:31] cttttt: has joined #ruby
[23:59:33] amitchellbullard: has joined #ruby
[23:59:36] olivierjanss: has joined #ruby
[23:59:36] stephenh: has joined #ruby
[23:59:37] mattwc: has joined #ruby
[23:59:39] justinweiss: has joined #ruby
[23:59:43] chrisseaton: has joined #ruby
[23:59:44] err_ok: has joined #ruby