#ruby - 08 October 2018
« Back 1 day Forward 1 day »
[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`.
[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.
[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: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
[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: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:29:20] baweaver: a class is essentially a bit of extra context you want in a box for easier access
[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:47:59] zenspider: hrm... anyone know off the top of their head if I can set an ivar on a RTypedData ?
[19:50:42] mroutis: zenspider: is this ruby related? I haven't heard anything about `ivar`s or RTypedData
[20:08:33] mroutis: if you don't mind me asking, what are you writing that requires such _low-level_ management?
[20:13:21] zenspider: A wrapper around SDL2. My code currently wraps SDL1 and the changes between them are a bit much
[21:36:01] zenspider: I think there's a pretty big difference between "the stove is hot" and "C++ is a fine language"
[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: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:47:16] zenspider: well... considering I'm doing a complete rewrite about a month before my talk...
[21:50:38] cout: there was less than 24 hours between the first line of Rubygems and the first demo...
[22:00:17] cout: zenspider: though weirdly I had to run "rake newb" twice, and it worked the second time
[22:01:43] zenspider: thanks. dunno about the rake newb thing. that sounds odd but fairly low priority atm.
[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?