<Radar>
wtb compact_map (like flat_map, but compacting instead of flattening)
<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`.
asphyxia has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
Fr4n has joined #ruby
eckhardt has joined #ruby
cagomez has joined #ruby
dbz has joined #ruby
MoritaShinobu has joined #ruby
dbz has quit [Ping timeout: 260 seconds]
asphyxia has quit [Ping timeout: 252 seconds]
apeiros has joined #ruby
apeiros has quit [Ping timeout: 246 seconds]
cagomez has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donofrio has quit [Remote host closed the connection]
<Radar>
You're using global variables when you could probably be using local or instance variables and making methods that returns that characters data.
<Radar>
skwurl: I would wrap that whole thing in a Character class and then maybe another class that does all the `namegen`, `ctypegen` stuff.
dbz has joined #ruby
DecimPrime has joined #ruby
<skwurl>
cool! thanks!
<skwurl>
im just learning and went for the path of least resistance.
<skwurl>
or rather, jsut found that solution first. kind of ghetto though huh
Danielss89 has quit [Quit: Bye]
DecimPrime has quit [Ping timeout: 252 seconds]
iAmDecim has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
skwurl has quit [Ping timeout: 252 seconds]
cagomez has quit [Ping timeout: 252 seconds]
apeiros has joined #ruby
apeiros has quit [Ping timeout: 245 seconds]
za1b1tsu has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
rserkov has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
bkxd has quit [Ping timeout: 272 seconds]
apeiros has joined #ruby
clemens3 has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
apeiros has quit [Remote host closed the connection]
dbz has quit [Remote host closed the connection]
bkxd has joined #ruby
dbz has joined #ruby
bkxd has quit [Ping timeout: 244 seconds]
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
aufi_ has joined #ruby
dinfuehr has quit [Ping timeout: 252 seconds]
dinfuehr has joined #ruby
xuanrui has quit [Remote host closed the connection]
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 260 seconds]
Pisuke has joined #ruby
MyMind has quit [Ping timeout: 272 seconds]
agent_white has quit [Quit: gnight]
solocshaw has joined #ruby
<za1b1tsu>
So I have a string like this "/test/i". Anyway I can convert it in to a regex?
bkxd has joined #ruby
solocshaw has quit [Client Quit]
<llua>
by escaping the metacharacters
aupadhye has joined #ruby
c0ncealed3 has quit [Remote host closed the connection]
c0ncealed3 has joined #ruby
<za1b1tsu>
llua: so "\/test\/i", right? how can I convert in to a regex now?
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
nowhere_man has joined #ruby
stoffus_ has joined #ruby
jcalla has joined #ruby
stoffus has quit [Ping timeout: 252 seconds]
tjbp has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aufi_ has joined #ruby
zapata has joined #ruby
rapha has joined #ruby
<rapha>
hi
<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...
<sonne>
rapha: string.tr('^0-9','').to_i might do the trick
nowhereman_ has joined #ruby
<sonne>
string.split[-1].to_i would also work.. it all depends on what your assumptions are
nowhere_man has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 264 seconds]
<rapha>
sonne: the input is sufficiently regular that both of these will work, and i like the second of them best. Dankeschön! :-D
<sonne>
bitte :)
nowhereman_ has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
uplime has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
Blaguvest has joined #ruby
dbz has joined #ruby
dbz has quit [Ping timeout: 250 seconds]
lxsameer has joined #ruby
stoffus_ has quit [Quit: leaving]
MoritaShinobu has quit [Quit: Leaving]
maryo_ has quit [Ping timeout: 252 seconds]
Rapture has joined #ruby
donofrio has joined #ruby
uplime has joined #ruby
gnufied has joined #ruby
ansraliant has joined #ruby
bkxd has joined #ruby
orbyt_ has joined #ruby
grenierm has quit [Quit: grenierm]
apeiros_ has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 260 seconds]
fluxAeon has joined #ruby
RougeR has joined #ruby
BrainWork has joined #ruby
zxq2 has joined #ruby
aupadhye has quit [Ping timeout: 252 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
ansraliant has quit [Ping timeout: 260 seconds]
maryo_ has joined #ruby
xfbs has quit [Quit: afk]
maryo_ has quit [Remote host closed the connection]
desperek has joined #ruby
Yxhuvud has joined #ruby
xfbs has joined #ruby
apeiros_ has joined #ruby
bkxd has joined #ruby
mrexox7 has joined #ruby
phaul has joined #ruby
tdy has joined #ruby
lightstalker has quit [Remote host closed the connection]
GodFather has joined #ruby
Fr4n has quit [Read error: Connection reset by peer]
AJA4350 has quit [Remote host closed the connection]
Fr4n has joined #ruby
AJA4350 has joined #ruby
phaul has quit [Ping timeout: 244 seconds]
phaul has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.2]
mroutis has joined #ruby
xfbs has quit [Quit: afk]
al2o3-cr has joined #ruby
kurko__ has joined #ruby
ansraliant has joined #ruby
<mrexox7>
л
mrexox7 has left #ruby ["ERC (IRC client for Emacs 25.2.2)"]
troys has joined #ruby
troys has left #ruby [#ruby]
jdelStrother_ has joined #ruby
kent\n has quit [Remote host closed the connection]
kent\n has joined #ruby
ansraliant has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeffreylevesque has joined #ruby
rippa has joined #ruby
jeffreylevesque has quit [Client Quit]
yohji has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 245 seconds]
GodFather has quit [Ping timeout: 250 seconds]
nowhereman_ has quit [Ping timeout: 260 seconds]
beowuff has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xfbs has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
za1b1tsu has joined #ruby
Azure has joined #ruby
aufi_ has quit [Ping timeout: 244 seconds]
darkhanb has joined #ruby
clemens3 has quit [Ping timeout: 272 seconds]
reber has joined #ruby
RougeR has quit [Ping timeout: 244 seconds]
bkxd has quit [Ping timeout: 246 seconds]
za1b1tsu has quit [Ping timeout: 268 seconds]
kurko__ has quit [Read error: Connection reset by peer]
kurko_ has joined #ruby
ua_ has joined #ruby
ua has quit [Read error: Connection reset by peer]
Eiam has joined #ruby
za1b1tsu has joined #ruby
sameerynho has joined #ruby
bkxd has joined #ruby
za1b1tsu has quit [Ping timeout: 245 seconds]
ansraliant has joined #ruby
doubledup has joined #ruby
cout has joined #ruby
roshanavand has quit [Ping timeout: 264 seconds]
savolla has joined #ruby
elcontrastador has joined #ruby
Vapez has joined #ruby
roshanavand has joined #ruby
eckhardt has joined #ruby
jeffreylevesque has joined #ruby
venmx has quit [Ping timeout: 244 seconds]
jeffreylevesque has quit [Client Quit]
ramfjord has joined #ruby
maasha has joined #ruby
<maasha>
Howdy
<phaul>
hi maasha
c0mrad3 has quit [Quit: Connection closed for inactivity]
roshanavand has quit [Ping timeout: 252 seconds]
iAmDecim has joined #ruby
roshanavand has joined #ruby
jdelStrother_ has quit [Quit: Connection closed for inactivity]
<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?
roshanavand has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
<baweaver>
rapha: str.scan(/\d+/)
<baweaver>
>> "Pages: 195".scan(/\d+/)
<ruby[bot]>
baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<baweaver>
=> ["195"]
<al2o3-cr>
s[/\d+/].to_i
<baweaver>
maasha: Have you considered wrapping it in a class?
<baweaver>
al2o3-cr: fair, I always forget brackets can do that.
<al2o3-cr>
baweaver: they wanted it as an integer.
<al2o3-cr>
i forget many methods ;)
<maasha>
baweaver: hm, I better try
za1b1tsu has joined #ruby
<baweaver>
a class is essentially a bit of extra context you want in a box for easier access
<baweaver>
granted that glosses over details a bit,
<maasha>
who needs details
<maasha>
this is not C :o)
samort7 has joined #ruby
dviola has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
Lytol has joined #ruby
mroutis has quit [Ping timeout: 252 seconds]
roshanavand has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
desperek has quit [Quit: xoxo]
savolla has quit [Ping timeout: 268 seconds]
snickers has joined #ruby
<cout>
a class is a box only because a class is an object, and objects are boxes
mostlybadfly has joined #ruby
<phaul>
But boxes are objects. Therefore box == object. QED.
<cout>
(at least in Alan Kay's OOP -- other OOPs can differ)
<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] ...
<rapha>
baweaver: wow, okay, that looks really elegant!
c0ncealed3 has quit [Remote host closed the connection]
c0ncealed3 has joined #ruby
savolla has joined #ruby
maasha has quit [Quit: Page closed]
improv42 has joined #ruby
roshanavand has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
clemens3 has joined #ruby
savolla has quit [Ping timeout: 268 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
<zenspider>
hrm... anyone know off the top of their head if I can set an ivar on a RTypedData ?
Fr4n has quit [Read error: Connection reset by peer]
<zenspider>
I now need to return 2 things where before there was only 1
roshanavand has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
<mroutis>
zenspider: is this ruby related? I haven't heard anything about `ivar`s or RTypedData
<zenspider>
mroutis: yes... it is ruby related.
<zenspider>
ivar == instance variable
wildermind has joined #ruby
<zenspider>
RTypedData is an internal struct
<mroutis>
today I learned ^ :O
improv42 has quit [Ping timeout: 264 seconds]
clemens3 has quit [Ping timeout: 252 seconds]
<zenspider>
hrm... this might not be the right way to do this anyways... I dunno
clemens3 has joined #ruby
SeepingN has joined #ruby
jic has left #ruby ["Leaving"]
roshanavand has quit [Ping timeout: 246 seconds]
<mroutis>
if you don't mind me asking, what are you writing that requires such _low-level_ management?
roshanavand has joined #ruby
<zenspider>
A wrapper around SDL2. My code currently wraps SDL1 and the changes between them are a bit much
za1b1tsu has joined #ruby
doubledup has quit [Quit: Leaving]
za1b1tsu has quit [Ping timeout: 272 seconds]
lightstalker has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
Ekho has joined #ruby
<zenspider>
pixels!
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
reber has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
asphyxia has quit [Ping timeout: 245 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has quit [Quit: Leaving]
bkxd has quit [Ping timeout: 245 seconds]
herbmillerjr has joined #ruby
Vapez has quit [Read error: Connection reset by peer]
<zenspider>
holy shit... I don't just have pixels... it's actually sorta kinda working.
<zenspider>
and... it went from 30-60 fps to ~260fps ?!?!?!
<zenspider>
that has to be wrong
impermanence has joined #ruby
<cout>
zenspider: hio
<zenspider>
cout: hey hey! how goes?
<cout>
zenspider: busy growing new ruby/c++ programmer
<zenspider>
yay/boo
<cout>
pain is an important part of the childhood experience. :)
RougeR has joined #ruby
darkhanb has joined #ruby
<zenspider>
I think there's a pretty big difference between "the stove is hot" and "C++ is a fine language"
<baweaver>
Yeah, one will scar you for life
<baweaver>
the other is a stove
<baweaver>
zenspider :D
<cout>
Fine like a saw blade, maybe
<cout>
Or maybe fine like a parking ticket
<baweaver>
Not a very nice change
<baweaver>
But it makes cents
<cout>
hah
<baweaver>
Give them no quarter!
<cout>
zenspider: why wouldn't you be able to set an ivar on an RTypedData?
<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
<zenspider>
turns out it seems fine. I think.
<zenspider>
I'm juggling too many balls atm tho... who knows?
<cout>
zenspider: I think rb_ivar_set should work with anything that holds an RBasic
<zenspider>
appears that way
g- has quit [Quit: WeeChat 1.6]
<cout>
and maybe also some things that don't
<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
<baweaver>
zenspider is on the ball
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
well... considering I'm doing a complete rewrite about a month before my talk...
samort7 has quit [Quit: Leaving]
<cout>
zenspider: what are you talking on?
<zenspider>
ah shit. I just introduced a segfault somewhere... huh
<zenspider>
I'm giving a talk on my graphics gem.
<cout>
a month is plenty of time!
<cout>
there was less than 24 hours between the first line of Rubygems and the first demo...
<zenspider>
I was there. :P
<cout>
zenspider: looks interesting
<cout>
zenspider: though weirdly I had to run "rake newb" twice, and it worked the second time
bkxd has joined #ruby
<zenspider>
thanks. dunno about the rake newb thing. that sounds odd but fairly low priority atm.
Fusl has quit [Ping timeout: 256 seconds]
<zenspider>
hopefully after this revamp not everything will be broken
<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?
akem has quit [Remote host closed the connection]
akem has joined #ruby
<cout>
zenspider: it looks like a useful teaching tool
<cout>
bbl
za1b1tsu has joined #ruby
Fusl has joined #ruby
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clemens3 has quit [Ping timeout: 250 seconds]
za1b1tsu has quit [Ping timeout: 252 seconds]
mroutis has quit [Ping timeout: 244 seconds]
code_zombie has joined #ruby
darkhanb has joined #ruby
chouhoulis has quit [Remote host closed the connection]
phaul has quit [Ping timeout: 245 seconds]
ellcs has joined #ruby
nemesit|znc has quit [Ping timeout: 244 seconds]
kn-928 has joined #ruby
kn-928 has quit [Client Quit]
nemesit|znc has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
ellcs has quit [Ping timeout: 240 seconds]
vikaton has joined #ruby
nahra has joined #ruby
MoritaShinobu has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
g- has joined #ruby
MaiconVieira has joined #ruby
eckhardt has quit [Client Quit]
uplime has quit [Ping timeout: 268 seconds]
bkxd has quit [Ping timeout: 252 seconds]
eckhardt has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
xfbs has quit [Quit: afk]
asphyxia has joined #ruby
sameerynho has quit [Ping timeout: 240 seconds]
wildermind has quit [Quit: Connection closed for inactivity]
r3m_ has joined #ruby
Francisco has quit [Remote host closed the connection]