« Back to channel list

#ruby - 08 October 2018

« Back 1 day Forward 1 day »
[00:01:21] asphyxia: has joined #ruby
[00:06:38] Voxxit: has joined #ruby
[00:16:02] apeiros: has joined #ruby
[00:16:51] TheBloke: has joined #ruby
[00:32:42] dbz: has joined #ruby
[00:33:35] Radar: wtb compact_map (like flat_map, but compacting instead of flattening)
[00:34:29] Radar: Lotsa times I've been doing `.map` -> `.flatten` and then that's easier now with `.flat_map`, but I'm also finding I'm repeating the same thing with `.map` -> `.compact`.
[00:36:02] asphyxia: has joined #ruby
[00:40:47] Fr4n: has joined #ruby
[00:50:01] eckhardt: has joined #ruby
[00:52:22] cagomez: has joined #ruby
[00:56:07] dbz: has joined #ruby
[00:59:12] MoritaShinobu: has joined #ruby
[01:10:10] apeiros: has joined #ruby
[01:23:02] cagomez: has joined #ruby
[01:25:17] ajsharma: has joined #ruby
[01:29:44] asphyxia: has joined #ruby
[01:33:27] cagomez: has joined #ruby
[01:38:56] fluxAeon: has joined #ruby
[01:39:28] ajsharma: has joined #ruby
[01:40:26] ajsharma: has joined #ruby
[01:55:00] bkxd: has joined #ruby
[02:03:43] dbz: has joined #ruby
[02:04:14] apeiros: has joined #ruby
[02:05:00] ajsharma: has joined #ruby
[02:07:14] cagomez: has joined #ruby
[02:38:11] MIR100_: has joined #ruby
[02:58:43] apeiros: has joined #ruby
[03:03:27] DecimPrime: has joined #ruby
[03:06:06] orbyt_: has joined #ruby
[03:09:44] braincrash: has joined #ruby
[03:15:03] dbz: has joined #ruby
[03:19:21] cagomez: has joined #ruby
[03:21:20] dbz: has joined #ruby
[03:23:45] ajsharma: has joined #ruby
[03:26:39] xuanrui: has joined #ruby
[03:36:06] DecimPrime: has joined #ruby
[03:41:53] dbz: has joined #ruby
[03:42:00] skwurl: has joined #ruby
[03:46:42] skwurl: idk working on a character generator.
[03:47:09] skwurl: check it out !? tell me what you think !? https://codeshare.io/5NOxxr
[03:50:41] bkxd: has joined #ruby
[04:01:17] weaksauce: has joined #ruby
[04:06:10] Radar: You're using global variables when you could probably be using local or instance variables and making methods that returns that characters data.
[04:06:32] Radar: skwurl: I would wrap that whole thing in a Character class and then maybe another class that does all the `namegen`, `ctypegen` stuff.
[04:06:43] dbz: has joined #ruby
[04:10:20] DecimPrime: has joined #ruby
[04:12:17] skwurl: cool! thanks!
[04:12:42] skwurl: im just learning and went for the path of least resistance.
[04:13:31] skwurl: or rather, jsut found that solution first. kind of ghetto though huh
[04:32:36] iAmDecim: has joined #ruby
[04:36:02] cagomez: has joined #ruby
[04:46:42] apeiros: has joined #ruby
[04:55:02] za1b1tsu: has joined #ruby
[04:55:37] duderonomy: has joined #ruby
[05:08:58] rserkov: has joined #ruby
[05:31:24] apeiros: has joined #ruby
[05:32:45] clemens3: has joined #ruby
[05:34:15] dinfuehr: has joined #ruby
[05:46:16] bkxd: has joined #ruby
[05:46:43] dbz: has joined #ruby
[05:52:03] dbz: has joined #ruby
[05:54:33] aufi_: has joined #ruby
[05:59:21] dinfuehr: has joined #ruby
[06:04:19] dinfuehr_: has joined #ruby
[06:08:36] Pisuke: has joined #ruby
[06:23:37] solocshaw: has joined #ruby
[06:24:22] za1b1tsu: So I have a string like this "/test/i". Anyway I can convert it in to a regex?
[06:24:41] bkxd: has joined #ruby
[06:26:24] llua: by escaping the metacharacters
[06:27:10] aupadhye: has joined #ruby
[06:28:54] c0ncealed3: has joined #ruby
[06:33:43] za1b1tsu: llua: so "\/test\/i", right? how can I convert in to a regex now?
[06:47:45] sgen: has joined #ruby
[06:48:35] al2o3-cr: za1b1tsu: "/text/i"[/\/(.+)\/(.)/]; Regexp.new $1, $2
[06:49:07] al2o3-cr: i can't think of a better way.
[06:59:44] grenierm: has joined #ruby
[07:01:21] xfbs_: has joined #ruby
[07:05:08] za1b1tsu: al2o3-cr: wow
[07:07:53] Sembei: has joined #ruby
[07:10:43] baweaver: za1b1tsu: why do you have a string like that?
[07:11:07] za1b1tsu: ahhh, its complicated
[07:11:19] thebigj: has left #ruby: ()
[07:11:25] za1b1tsu: I decided to use to_regexp
[07:17:03] al2o3-cr: za1b1tsu: what do you mean "I decided to use to_regexp"
[07:19:19] za1b1tsu: al2o3-cr: yes, I don't really understand the $1, $2 part
[07:21:03] al2o3-cr: they're pseudo-global captures
[07:21:54] baweaver: ACTION is still curious why za1b1tsu has regex-like strings in the first place
[07:25:03] duderonomy: has joined #ruby
[07:25:47] yohji: has joined #ruby
[07:29:54] phaul: has joined #ruby
[07:31:53] za1b1tsu: al2o3-cr: damn, learn something new everyday
[07:32:09] za1b1tsu: baweaver: I don't even know how to explain, it's a personal project
[07:32:09] dionysus69: has joined #ruby
[07:32:13] za1b1tsu: testing stuff
[07:32:42] baweaver: carry on my wayward son (or daughter)
[07:33:24] za1b1tsu: thanks father (or mother or priest)
[07:33:46] baweaver: there'll be peace when you are done
[07:34:01] baweaver: https://www.youtube.com/watch?v=2X_2IdybTV0
[07:34:09] baweaver: ACTION starts humming rest of song
[07:34:42] za1b1tsu: nice tase in music
[07:34:54] dionysus69: using rvm in docker deployment doesn't make any sense right?
[07:34:57] za1b1tsu: I listen to garbage :(
[07:50:18] vondruch: has joined #ruby
[07:54:24] Mike11: has joined #ruby
[07:59:11] Puffball: has joined #ruby
[08:12:41] lxsameer: has joined #ruby
[08:19:13] savolla: has joined #ruby
[08:21:56] Cyrus: has joined #ruby
[08:23:39] clemens3: has joined #ruby
[08:25:57] dbz: has joined #ruby
[08:32:56] grenierm: has joined #ruby
[08:46:04] bkxd: has joined #ruby
[08:53:41] Nicmavr: has joined #ruby
[08:56:56] venmx: has joined #ruby
[09:05:51] savolla: has joined #ruby
[09:09:46] aufi: has joined #ruby
[09:12:51] dionysus69: has joined #ruby
[09:24:16] exchgr`: has joined #ruby
[09:42:39] asphyxia: has joined #ruby
[09:45:30] dbz: has joined #ruby
[09:52:46] jenenliu: has joined #ruby
[09:58:42] ansraliant: has joined #ruby
[10:01:20] phaul: has joined #ruby
[10:23:10] roshanavand: has joined #ruby
[10:25:06] aufi_: has joined #ruby
[10:39:51] Puffball: has joined #ruby
[10:41:15] maryo_: has joined #ruby
[10:46:25] aufi: has joined #ruby
[10:53:35] cgfbee: has joined #ruby
[11:00:20] xfbs: has joined #ruby
[11:01:27] apeiros: has joined #ruby
[11:04:05] aufi_: has joined #ruby
[11:12:48] AJA4350: has joined #ruby
[11:14:57] foxxx0: has joined #ruby
[11:30:46] stoffus: has joined #ruby
[11:31:53] spiette: has joined #ruby
[11:31:55] roshanavand: has joined #ruby
[11:43:11] spiette: has joined #ruby
[11:45:50] roshanavand: has joined #ruby
[11:50:56] nowhere_man: has joined #ruby
[11:53:41] lxsameer: has joined #ruby
[12:01:23] kapil____: has joined #ruby
[12:08:43] vondruch_: has joined #ruby
[12:12:42] bmurt: has joined #ruby
[12:16:42] Xeago: has joined #ruby
[12:23:15] savolla: has joined #ruby
[12:29:36] dreamthese: has joined #ruby
[12:30:06] nowhere_man: has joined #ruby
[12:47:00] stoffus1: has joined #ruby
[12:47:39] jcalla: has joined #ruby
[12:50:16] tjbp: has joined #ruby
[12:57:51] aufi_: has joined #ruby
[13:00:10] zapata: has joined #ruby
[13:04:47] rapha: has joined #ruby
[13:06:12] rapha: what's the nicest way to get the "195" in "Pages: 195" as an Integer? I'm using .match(/[0-9]+/).to_s.to_i, but that seems overly complicated...
[13:07:45] sonne: rapha: string.tr('^0-9','').to_i might do the trick
[13:08:39] nowhereman_: has joined #ruby
[13:09:07] sonne: string.split[-1].to_i would also work.. it all depends on what your assumptions are
[13:09:53] rapha: sonne: the input is sufficiently regular that both of these will work, and i like the second of them best. Dankeschön! :-D
[13:13:39] nowhereman_: has joined #ruby
[13:21:31] apeiros_: has joined #ruby
[13:23:04] vondruch: has joined #ruby
[13:25:07] lxsameer: has joined #ruby
[13:30:09] Blaguvest: has joined #ruby
[13:36:46] dbz: has joined #ruby
[13:41:48] lxsameer: has joined #ruby
[14:04:01] Rapture: has joined #ruby
[14:14:08] donofrio: has joined #ruby
[14:15:29] uplime: has joined #ruby
[14:16:19] gnufied: has joined #ruby
[14:21:34] ansraliant: has joined #ruby
[14:22:35] bkxd: has joined #ruby
[14:22:48] orbyt_: has joined #ruby
[14:32:44] fluxAeon: has joined #ruby
[14:33:36] RougeR: has joined #ruby
[14:35:53] BrainWork: has joined #ruby
[14:38:04] zxq2: has joined #ruby
[14:51:18] maryo_: has joined #ruby
[14:51:54] desperek: has joined #ruby
[14:54:44] yxhuvud: has joined #ruby
[14:55:06] xfbs: has joined #ruby
[14:57:46] apeiros_: has joined #ruby
[14:57:56] bkxd: has joined #ruby
[14:59:07] mrexox7: has joined #ruby
[15:00:08] phaul: has joined #ruby
[15:01:07] tdy: has joined #ruby
[15:08:31] GodFather: has joined #ruby
[15:13:56] Fr4n: has joined #ruby
[15:14:03] AJA4350: has joined #ruby
[15:16:41] phaul: has joined #ruby
[15:19:33] mroutis: has joined #ruby
[15:20:48] al2o3-cr: has joined #ruby
[15:22:04] kurko__: has joined #ruby
[15:22:20] ansraliant: has joined #ruby
[15:26:57] mrexox7: has left #ruby: ("ERC (IRC client for Emacs 25.2.2)")
[15:28:43] troys: has joined #ruby
[15:31:17] troys: has left #ruby: ()
[15:32:10] jdelStrother_: has joined #ruby
[15:38:25] kent\n: has joined #ruby
[15:44:24] chouhoulis: has joined #ruby
[15:54:30] jeffreylevesque: has joined #ruby
[15:56:50] rippa: has joined #ruby
[16:05:22] beowuff: has joined #ruby
[16:16:25] xfbs: has joined #ruby
[16:19:32] za1b1tsu: has joined #ruby
[16:20:10] Azure: has joined #ruby
[16:34:28] darkhanb: has joined #ruby
[16:39:40] reber: has joined #ruby
[16:51:59] kurko_: has joined #ruby
[17:07:52] ua_: has joined #ruby
[17:17:16] Eiam: has joined #ruby
[17:19:37] za1b1tsu: has joined #ruby
[17:23:41] sameerynho: has joined #ruby
[17:23:54] bkxd: has joined #ruby
[17:32:45] ansraliant: has joined #ruby
[17:35:14] doubledup: has joined #ruby
[17:36:23] cout: has joined #ruby
[17:46:55] savolla: has joined #ruby
[17:47:02] elcontrastador: has joined #ruby
[17:48:54] Vapez: has joined #ruby
[17:49:24] roshanavand: has joined #ruby
[17:52:15] eckhardt: has joined #ruby
[17:55:37] jeffreylevesque: has joined #ruby
[18:00:03] ramfjord: has joined #ruby
[18:02:49] maasha: has joined #ruby
[18:03:25] phaul: hi maasha
[18:07:45] iAmDecim: has joined #ruby
[18:08:23] roshanavand: has joined #ruby
[18:15:14] maasha: Sooooo, I am carrying around a database session object that is being passed to a ton of methods, I wonder if I can make it a module wide variable?
[18:18:21] roshanavand: has joined #ruby
[18:23:23] baweaver: rapha: str.scan(/\d+/)
[18:23:49] baweaver: >> "Pages: 195".scan(/\d+/)
[18:23:54] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[18:24:33] al2o3-cr: s[/\d+/].to_i
[18:24:46] baweaver: maasha: Have you considered wrapping it in a class?
[18:25:02] baweaver: al2o3-cr: fair, I always forget brackets can do that.
[18:25:03] al2o3-cr: baweaver: they wanted it as an integer.
[18:25:44] al2o3-cr: i forget many methods ;)
[18:27:45] maasha: baweaver: hm, I better try
[18:28:01] za1b1tsu: has joined #ruby
[18:29:20] baweaver: a class is essentially a bit of extra context you want in a box for easier access
[18:29:47] baweaver: granted that glosses over details a bit,
[18:30:40] maasha: who needs details
[18:30:44] maasha: this is not C :o)
[18:31:15] samort7: has joined #ruby
[18:31:20] dviola: has joined #ruby
[18:40:02] Lytol: has joined #ruby
[18:48:22] roshanavand: has joined #ruby
[19:00:40] snickers: has joined #ruby
[19:07:18] cout: a class is a box only because a class is an object, and objects are boxes
[19:08:25] mostlybadfly: has joined #ruby
[19:08:43] phaul: But boxes are objects. Therefore box == object. QED.
[19:08:49] cout: (at least in Alan Kay's OOP -- other OOPs can differ)
[19:12:00] phaul: has anyone used yard DSL macros successfully? Maybe I'm missing the point but yard doesn't seem to generate the expansion with @!macro [attach] ...
[19:12:18] rapha: baweaver: wow, okay, that looks really elegant!
[19:15:13] c0ncealed3: has joined #ruby
[19:16:01] savolla: has joined #ruby
[19:17:53] improv42: has joined #ruby
[19:19:25] roshanavand: has joined #ruby
[19:21:32] clemens3: has joined #ruby
[19:33:26] Nicmavr: has joined #ruby
[19:35:54] tAn: has joined #ruby
[19:40:13] mroutis: has joined #ruby
[19:41:44] leitz: has joined #ruby
[19:47:29] francisco: has joined #ruby
[19:47:59] zenspider: hrm... anyone know off the top of their head if I can set an ivar on a RTypedData ?
[19:48:22] zenspider: I now need to return 2 things where before there was only 1
[19:49:32] roshanavand: has joined #ruby
[19:50:42] mroutis: zenspider: is this ruby related? I haven't heard anything about `ivar`s or RTypedData
[19:51:38] zenspider: mroutis: yes... it is ruby related.
[19:51:45] zenspider: ivar == instance variable
[19:51:52] wildermind: has joined #ruby
[19:51:56] zenspider: RTypedData is an internal struct
[19:52:29] mroutis: today I learned ^ :O
[20:00:25] zenspider: hrm... this might not be the right way to do this anyways... I dunno
[20:00:45] clemens3: has joined #ruby
[20:03:46] SeepingN: has joined #ruby
[20:06:25] jic: has left #ruby: ("Leaving")
[20:08:33] mroutis: if you don't mind me asking, what are you writing that requires such _low-level_ management?
[20:09:34] roshanavand: has joined #ruby
[20:13:21] zenspider: A wrapper around SDL2. My code currently wraps SDL1 and the changes between them are a bit much
[20:16:07] za1b1tsu: has joined #ruby
[20:23:02] LightStalker: has joined #ruby
[20:37:16] Ekho: has joined #ruby
[20:51:30] za1b1tsu: has joined #ruby
[21:07:42] bkxd: has joined #ruby
[21:25:52] herbmillerjr: has joined #ruby
[21:29:46] zenspider: holy shit... I don't just have pixels... it's actually sorta kinda working.
[21:30:01] zenspider: and... it went from 30-60 fps to ~260fps ?!?!?!
[21:30:14] zenspider: that has to be wrong
[21:30:23] impermanence: has joined #ruby
[21:30:28] cout: zenspider: hio
[21:31:24] zenspider: cout: hey hey! how goes?
[21:31:53] cout: zenspider: busy growing new ruby/c++ programmer
[21:32:55] cout: pain is an important part of the childhood experience. :)
[21:34:57] RougeR: has joined #ruby
[21:35:29] darkhanb: has joined #ruby
[21:36:01] zenspider: I think there's a pretty big difference between "the stove is hot" and "C++ is a fine language"
[21:37:54] baweaver: Yeah, one will scar you for life
[21:37:58] baweaver: the other is a stove
[21:38:04] baweaver: zenspider :D
[21:38:05] cout: Fine like a saw blade, maybe
[21:39:08] cout: Or maybe fine like a parking ticket
[21:39:48] baweaver: Not a very nice change
[21:39:55] baweaver: But it makes cents
[21:40:09] baweaver: Give them no quarter!
[21:40:10] cout: zenspider: why wouldn't you be able to set an ivar on an RTypedData?
[21:41:45] zenspider: just hadn't done it. The RTypedData is a stand alone struct... has an internal RObject but I wasn't sure if it was gonna behave differently
[21:41:51] zenspider: turns out it seems fine. I think.
[21:42:03] zenspider: I'm juggling too many balls atm tho... who knows?
[21:43:28] cout: zenspider: I think rb_ivar_set should work with anything that holds an RBasic
[21:43:58] zenspider: appears that way
[21:44:31] cout: and maybe also some things that don't
[21:44:37] zenspider: my window sizes are entirely wonky. There must be some scaling thing I am unaware of and all the numbers are wrong... but my demos are almost all running. it's crazy
[21:45:03] baweaver: zenspider is on the ball
[21:47:16] zenspider: well... considering I'm doing a complete rewrite about a month before my talk...
[21:48:12] cout: zenspider: what are you talking on?
[21:48:47] zenspider: ah shit. I just introduced a segfault somewhere... huh
[21:49:00] zenspider: I'm giving a talk on my graphics gem.
[21:49:45] cout: a month is plenty of time!
[21:50:38] cout: there was less than 24 hours between the first line of Rubygems and the first demo...
[21:51:58] zenspider: I was there. :P
[21:59:59] cout: zenspider: looks interesting
[22:00:17] cout: zenspider: though weirdly I had to run "rake newb" twice, and it worked the second time
[22:01:01] bkxd: has joined #ruby
[22:01:43] zenspider: thanks. dunno about the rake newb thing. that sounds odd but fairly low priority atm.
[22:01:55] zenspider: hopefully after this revamp not everything will be broken
[22:03:52] cout: zenspider: what do you mean "These allow simple things like Trigonometry functions to work as expected"? Doesn't Math.sin et. al. use radians?
[22:05:06] akem: has joined #ruby
[22:05:40] cout: zenspider: it looks like a useful teaching tool
[22:07:46] za1b1tsu: has joined #ruby
[22:09:29] Fusl: has joined #ruby
[22:22:44] code_zombie: has joined #ruby
[22:22:49] darkhanb: has joined #ruby
[22:33:44] ellcs: has joined #ruby
[22:36:05] kn-928: has joined #ruby
[22:36:53] nemesit|znc: has joined #ruby
[22:45:25] vikaton: has joined #ruby
[22:46:45] Nahra: has joined #ruby
[22:47:45] MoritaShinobu: has joined #ruby
[23:00:05] eckhardt: has joined #ruby
[23:02:00] g-: has joined #ruby
[23:02:02] MaiconVieira: has joined #ruby
[23:19:44] eckhardt: has joined #ruby
[23:22:32] asphyxia: has joined #ruby
[23:32:30] r3m_: has joined #ruby
[23:33:31] francisco: has joined #ruby
[23:37:33] duderonomy: has joined #ruby
[23:42:57] edwardly: has joined #ruby
[23:52:41] c0ncealed3: has joined #ruby
[23:55:44] bkxd: has joined #ruby
[23:55:52] za1b1tsu: has joined #ruby
[23:58:34] agent_white: has joined #ruby
[23:59:17] sarmiena_: has joined #ruby