apeiros changed the topic of #ruby-lang to: Nick registration required to talk || Ruby 2.0.0-p247: http://ruby-lang.org (Ruby 1.9.3-p448) || Paste >3 lines of text on http://gist.github.com
iraja has joined #ruby-lang
<drbrain>
foucist: I have never seen that, nor needed to do that
<Mon_Ouie>
I've only seen this for variables that aren't used but still given a name for reference (that doesn't seem to be the case in your example though)
<drbrain>
foucist: I guess "it is an odd convention"
<drbrain>
maybe they don't understand ruby's local variable/method ambiguity
iraja has quit [Ping timeout: 240 seconds]
beastieboy is now known as banister
<foucist>
drbrain: would it cause problems?
<drbrain>
the _ in the local variable name? no
vlad_starkov has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
<foucist>
just in a rails model, but doesn't seem like there's a reason for it
<drbrain>
foucist: I suppose there is also a #categories method?
havenwood has joined #ruby-lang
<foucist>
nope
<drbrain>
huh
norplr_ has joined #ruby-lang
toretore has quit [Quit: Leaving]
<lianj>
damn you rails for link_to remote:true + js.erb
vlad_starkov has quit [Ping timeout: 240 seconds]
havenwood has quit [Ping timeout: 260 seconds]
cads has joined #ruby-lang
fijimunkii has joined #ruby-lang
ldnunes has quit [Ping timeout: 260 seconds]
ldnunes has joined #ruby-lang
snarfmason has joined #ruby-lang
kireevco_ has joined #ruby-lang
micalexander has quit [Remote host closed the connection]
jeff_r_ has quit [Remote host closed the connection]
micalexander has joined #ruby-lang
Coincide_ has quit [Ping timeout: 272 seconds]
jeff_r has joined #ruby-lang
ninjago has quit [Remote host closed the connection]
ninjago has joined #ruby-lang
stardiviner has joined #ruby-lang
jeff_r has quit [Ping timeout: 245 seconds]
ldnunes has quit [Quit: Leaving]
micalexander has quit [Ping timeout: 272 seconds]
ldnunes has joined #ruby-lang
Coincidental has joined #ruby-lang
mistym has quit [Quit: Leaving]
ninjago has quit [Ping timeout: 264 seconds]
sevvie has joined #ruby-lang
slyphon has joined #ruby-lang
Elico has quit [Ping timeout: 252 seconds]
francisfish has joined #ruby-lang
saarinen has quit [Quit: saarinen]
slyphon has quit [Client Quit]
amerine has quit [Quit: Computer has gone to sleep.]
x0nic has quit [Ping timeout: 268 seconds]
sevvie has quit [Ping timeout: 245 seconds]
francisfish has quit [Ping timeout: 268 seconds]
julweber_ has joined #ruby-lang
cads has quit [Ping timeout: 240 seconds]
mistym has joined #ruby-lang
x0nic has joined #ruby-lang
julweber has quit [Ping timeout: 268 seconds]
Coincidental has quit [Remote host closed the connection]
Coincidental has joined #ruby-lang
Coincidental has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby-lang
Coincidental has joined #ruby-lang
hahuang61 has quit [Ping timeout: 268 seconds]
ecnalyr has joined #ruby-lang
stardiviner has quit [Ping timeout: 272 seconds]
ykk` has joined #ruby-lang
Coincidental has quit [Ping timeout: 240 seconds]
nathanstitt has quit [Quit: I growing sleepy]
bzalasky has joined #ruby-lang
enmand has joined #ruby-lang
ItSANgo has joined #ruby-lang
jsullivandigs has joined #ruby-lang
ldnunes has quit [Quit: Leaving]
kireevco_ has quit [Ping timeout: 272 seconds]
shinnya has quit [Ping timeout: 245 seconds]
stardiviner has joined #ruby-lang
ykk` has quit [Ping timeout: 268 seconds]
slyphon has joined #ruby-lang
sevvie has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
jxie has quit [Read error: Connection reset by peer]
jxie_ has joined #ruby-lang
bzalasky has joined #ruby-lang
badboy4471 has joined #ruby-lang
bzalasky has quit [Read error: Connection reset by peer]
bzalasky has joined #ruby-lang
sevvie has quit [Ping timeout: 240 seconds]
brianpWins has quit [Quit: brianpWins]
momomomomo has joined #ruby-lang
micalexander has joined #ruby-lang
ykk` has joined #ruby-lang
martndemus has joined #ruby-lang
benlovell has joined #ruby-lang
martndemus has quit [Ping timeout: 245 seconds]
benlovell has quit [Ping timeout: 272 seconds]
ecnalyr has quit [Remote host closed the connection]
Andrevan has joined #ruby-lang
ninjago has joined #ruby-lang
ninjago has quit [Ping timeout: 245 seconds]
tubbo has joined #ruby-lang
cored has quit [Ping timeout: 240 seconds]
jeff_r has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
stamina has quit [Ping timeout: 268 seconds]
tubbo has quit [Ping timeout: 272 seconds]
jeff_r has quit [Ping timeout: 240 seconds]
brianpWins has joined #ruby-lang
mj12albert has joined #ruby-lang
mj12albert has quit [Max SendQ exceeded]
mj12albert has joined #ruby-lang
io_syl has quit []
bzalasky has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
stardiviner has quit [Ping timeout: 272 seconds]
bzalasky has quit [Ping timeout: 245 seconds]
badboy4471 has quit [Quit: 离开]
saarinen has joined #ruby-lang
dhruvasagar has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
Domon has joined #ruby-lang
lfox has joined #ruby-lang
nathanstitt has joined #ruby-lang
jeff_r has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
lsegal has joined #ruby-lang
fijimunkii has quit [Ping timeout: 240 seconds]
Grimscribe has joined #ruby-lang
flip_digits has quit [Remote host closed the connection]
flip_digits has joined #ruby-lang
foucist has quit [Ping timeout: 240 seconds]
mdedetrich has joined #ruby-lang
flip_digits has quit [Ping timeout: 245 seconds]
alexju has joined #ruby-lang
tylersmith has joined #ruby-lang
martndemus has joined #ruby-lang
flip_digits has joined #ruby-lang
martndemus has quit [Ping timeout: 245 seconds]
Grimscribe has quit [Quit: Grimscribe]
tylersmith has quit [Read error: Connection reset by peer]
ninjago has joined #ruby-lang
lfox has quit [Quit: ZZZzzz…]
Grimscribe has joined #ruby-lang
ninjago has quit [Ping timeout: 268 seconds]
kitak_ has joined #ruby-lang
kitak has quit [Read error: Connection reset by peer]
ykk` has quit [Quit: ykk`]
hahuang61 has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
tubbo has joined #ruby-lang
D9 has joined #ruby-lang
foucist has joined #ruby-lang
kurko_ has quit [Quit: Computer has gone to sleep.]
tubbo has quit [Ping timeout: 272 seconds]
mannyt has joined #ruby-lang
musty has joined #ruby-lang
<imperator>
matz contemplated using a leading underscores for private instance variables that couldn't be seen by subclasses
<banister>
hmm
<musty>
banister: Indeed.
<imperator>
back in 2005 :)
<banister>
i was thinking u could setup a class-level hash key'd by the instance to achieve something similar
jithu has joined #ruby-lang
Domon__ has joined #ruby-lang
Domon__ has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
<imperator>
apparently there was a library called superhash that was designed for that
<imperator>
though, it was on the RAA, now defunct, and the current superhash gem appears to be unrelated
Domon has quit [Ping timeout: 272 seconds]
mannyt has quit [Quit: mannyt]
enmand has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<imperator>
on an unrelated note, rust takes quite a while to build
benlovell has joined #ruby-lang
martndemus has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
kitak_ has quit [Remote host closed the connection]
tylersmith has joined #ruby-lang
Domon has joined #ruby-lang
benlovell has quit [Ping timeout: 245 seconds]
martndemus has quit [Ping timeout: 245 seconds]
soba has joined #ruby-lang
Oloryn_lt21 has quit [Ping timeout: 272 seconds]
kitak has joined #ruby-lang
natevick has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 245 seconds]
mannyt has joined #ruby-lang
natevick has quit [Remote host closed the connection]
kireevco_ has joined #ruby-lang
julweber_ has quit [Remote host closed the connection]
julweber has joined #ruby-lang
julweber has quit [Ping timeout: 272 seconds]
a1ph4g33k has quit [Quit: Leaving]
brianpWins has quit [Read error: Connection reset by peer]
nathanstitt has quit [Quit: I growing sleepy]
heathjs is now known as heath
postmodern has quit [Quit: Leaving]
Grimscribe has quit [Quit: Grimscribe]
mucker has joined #ruby-lang
hahuang61 has quit [Ping timeout: 245 seconds]
imperator has left #ruby-lang ["Leaving"]
brianpWins has joined #ruby-lang
Hung has joined #ruby-lang
jonahR has joined #ruby-lang
io_syl has joined #ruby-lang
r0bby_ has joined #ruby-lang
saarinen has quit [Quit: saarinen]
fijimunkii has joined #ruby-lang
havenwood has quit [Ping timeout: 240 seconds]
Asher has quit [Quit: Leaving.]
Asher has joined #ruby-lang
Cakey has joined #ruby-lang
martndemus has joined #ruby-lang
yellow5 has quit [Ping timeout: 248 seconds]
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
yellow5 has joined #ruby-lang
foucist has quit [Quit: leaving]
fijimunkii has quit [Ping timeout: 272 seconds]
ecnalyr has joined #ruby-lang
banister has quit [Quit: Computer has gone to sleep.]
Cakey has left #ruby-lang [#ruby-lang]
martndemus has quit [Ping timeout: 272 seconds]
jsullivandigs has quit [Ping timeout: 240 seconds]
hahuang61 has joined #ruby-lang
Andrevan has quit [Quit: WeeChat 0.4.2-rc1]
ninjago has joined #ruby-lang
ninjago has quit [Ping timeout: 264 seconds]
Domon has quit [Remote host closed the connection]
Asher has quit [Quit: Leaving.]
Asher has joined #ruby-lang
francisfish has joined #ruby-lang
cads has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
malev has quit [Quit: Leaving]
francisfish has quit [Ping timeout: 268 seconds]
jeff_r has quit [Remote host closed the connection]
jeff_r has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
ledestin has quit [Ping timeout: 272 seconds]
dhruvasagar has joined #ruby-lang
guest_________ has left #ruby-lang [#ruby-lang]
guest_________ has joined #ruby-lang
jeff_r has quit [Ping timeout: 245 seconds]
postmodern has joined #ruby-lang
amerine has joined #ruby-lang
ninjago has joined #ruby-lang
toretore has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 240 seconds]
hahuang61 has quit [Ping timeout: 245 seconds]
jeer has quit [Ping timeout: 260 seconds]
mac_ has joined #ruby-lang
jeer has joined #ruby-lang
ecnalyr has quit [Remote host closed the connection]
Hung has quit [Remote host closed the connection]
mucker has quit [Remote host closed the connection]
hahuang61 has joined #ruby-lang
Domon has joined #ruby-lang
arBmind has joined #ruby-lang
Domon has quit [Read error: Connection reset by peer]
majjoha has joined #ruby-lang
Domon has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
mgberlin has joined #ruby-lang
benlovell has joined #ruby-lang
martndemus has joined #ruby-lang
jerrytgarcia has quit [Ping timeout: 245 seconds]
musty has quit [Read error: Connection reset by peer]
musty_ has joined #ruby-lang
arBmind has quit [Ping timeout: 245 seconds]
benlovell has quit [Ping timeout: 268 seconds]
D9 has quit [Ping timeout: 245 seconds]
martndemus has quit [Ping timeout: 245 seconds]
musty_ has quit [Ping timeout: 240 seconds]
schaerli has joined #ruby-lang
mgberlin has quit [Quit: mgberlin]
mdedetrich has joined #ruby-lang
<mistym>
Anyone able to help out with a ruby-ffi issue?
<rickhull>
on its face, i hate the idea of special naming conventions implying mechanism
guest_________ has quit [Ping timeout: 250 seconds]
<rickhull>
"leading underscores"
mgberlin has joined #ruby-lang
<rickhull>
as opposed to private/protected or the @ sigil
<rickhull>
if underscore were promoted to a proper sigil, then sure/maybe
Elico has joined #ruby-lang
mac_ has quit [Remote host closed the connection]
<crankharder>
I've got a String that has multiple "<html>etc...</html>" blocks in it. can I leverage scan and some regex to split it into strings beginning and ending w/ the html tag?
rickhull1 has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
slyphon has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nathanstitt has joined #ruby-lang
nathanstitt has quit [Client Quit]
kurko_ has joined #ruby-lang
kek has quit [Remote host closed the connection]
kek has joined #ruby-lang
Grimscribe has joined #ruby-lang
enmand has quit [Ping timeout: 272 seconds]
pcw888 has joined #ruby-lang
kek has quit [Ping timeout: 245 seconds]
enmand has joined #ruby-lang
mannyt has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 268 seconds]
arBmind has quit [Quit: Leaving.]
Mon_Ouie has joined #ruby-lang
slyphon has joined #ruby-lang
mannyt has quit [Quit: mannyt]
yfeldblum has joined #ruby-lang
kek has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
mmorga has joined #ruby-lang
majjoha has quit [Read error: Connection reset by peer]
barttenbrinke has joined #ruby-lang
francisfish has joined #ruby-lang
r0bby_ has quit [Ping timeout: 240 seconds]
mmorga has quit [Read error: Connection reset by peer]
mmorga has joined #ruby-lang
benlovell has quit [Ping timeout: 272 seconds]
kitak has quit [Remote host closed the connection]
kitak has joined #ruby-lang
barttenbrinke has quit [Ping timeout: 272 seconds]
majjoha has joined #ruby-lang
kitak has quit [Ping timeout: 246 seconds]
Lench has joined #ruby-lang
<Lench>
hello
kurko_ has quit [Ping timeout: 272 seconds]
melter_ is now known as melter
kurko_ has joined #ruby-lang
<Lench>
i read a line of a textfile, the line looks kinda like this: "123 bla blabla 567" its seperated with tabstops. my question is: how do i get each word in that line with regex? is it wise to use something like .gsub(/\t/, ' ') ?
<Lench>
*can i safely work with \t?
majjoha has quit [Read error: Connection reset by peer]
majjoha has joined #ruby-lang
JohnBat26 has joined #ruby-lang
benlovell has joined #ruby-lang
vondruch has quit [Quit: Ex-Chat]
slyphon has quit [Ping timeout: 272 seconds]
<Lench>
there are a lot of tabstops (like 25) in a line, my current regex does not look very efficient ._.
hogeo has quit [Remote host closed the connection]
slyphon has joined #ruby-lang
hogeo has joined #ruby-lang
kgrz has joined #ruby-lang
h_kon has joined #ruby-lang
h_kon has quit [Remote host closed the connection]
hogeo has quit [Ping timeout: 268 seconds]
Mon_Ouie has quit [Ping timeout: 260 seconds]
ecnalyr has joined #ruby-lang
jsullivandigs has joined #ruby-lang
<bougyman>
Lench: .split works
michael_mbp is now known as zz_michael_mbp
pcw888 has quit [Ping timeout: 240 seconds]
enebo has joined #ruby-lang
bean__ has joined #ruby-lang
tdm00 has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 272 seconds]
tdm00 has quit [Client Quit]
[spoiler] has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
barttenbrinke has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
xdccmule has joined #ruby-lang
sr78ger has quit [Ping timeout: 246 seconds]
CoreData has joined #ruby-lang
Grimscribe has quit [Quit: Grimscribe]
pcw888 has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
barttenbrinke has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 272 seconds]
tkuchiki has quit [Ping timeout: 245 seconds]
Mon_Ouie has joined #ruby-lang
majjoha has quit [Read error: Connection reset by peer]
jperry has joined #ruby-lang
Guest60861 has joined #ruby-lang
ninjago has joined #ruby-lang
slyphon has quit [Ping timeout: 268 seconds]
kedibasi has joined #ruby-lang
xdccmule has quit []
heftig has quit [Ping timeout: 268 seconds]
guest_______ has joined #ruby-lang
havenwood has joined #ruby-lang
majjoha has joined #ruby-lang
hrs has joined #ruby-lang
MaddinXx_ has quit [Remote host closed the connection]
arBmind has joined #ruby-lang
julweber has quit [Write error: Connection reset by peer]
julweber has joined #ruby-lang
ssb123 has joined #ruby-lang
<Lench>
bougyman: thank you!
VTLob has joined #ruby-lang
hackndoes has joined #ruby-lang
hackndoes is now known as Guest88247
kitak has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
Grimscribe has joined #ruby-lang
havenwood has joined #ruby-lang
<Guest60861>
Does anyone know anything about Curses and command prompt?
Elico has joined #ruby-lang
lfox has joined #ruby-lang
<darix>
Lench: CSV module might also be an option
<Lench>
darix: I played with CSV already, but since I already use rubyXL in another script, I tend to keep using that one
<Lench>
*a bit
<Lench>
(dunno if rubyXL is known, but it does what it should)
tomzx_mac has quit [Ping timeout: 246 seconds]
Mon_Ouie has quit [Ping timeout: 260 seconds]
jiuweigui has joined #ruby-lang
heftig has joined #ruby-lang
jeff_r has joined #ruby-lang
nathanstitt has joined #ruby-lang
mannyt has joined #ruby-lang
JasonC_ has joined #ruby-lang
hrs has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
slyphon has joined #ruby-lang
<darix>
Lench: so if rubyXL handles CSV style files ... why not use that instead of split?;)
lfox has quit [Ping timeout: 245 seconds]
slyphon has quit [Client Quit]
lfox has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
slyphon has joined #ruby-lang
<Lench>
darix: oh, it's because I need xls files and it would not make much sense to create a csv from the textfile and then convert it into a xls imo
<Lench>
^ it handles xls files, i shouldve mentioned that
hrs has joined #ruby-lang
<Guest60861>
Nobody know anything about Curses?
<Guest60861>
dr.brain: Are you available?
francisfish has quit [Remote host closed the connection]
francisfish has joined #ruby-lang
cnivolle_ has quit [Remote host closed the connection]
vmoravec has quit [Quit: Leaving]
cnivolle has joined #ruby-lang
<ddfreyne>
Guest60861: Curses has a very C-like API, so you should check out the C manual (including man pages)
<Guest60861>
ddfreyne: I have actually been reading that :)
arBmind has quit [Quit: Leaving.]
<Guest60861>
I'm getting a really strange error though.
<ddfreyne>
Guest60861: If you have a question, ask it
<Guest60861>
Basically, if a window is larger than 89 columns, it crashes with a "window already closed error"
<Guest60861>
But only when using Command Prompt with Ruby on Rails, which is installed by this: http://rubyinstaller.org/
francisfish has quit [Ping timeout: 246 seconds]
JohnBat26 has quit [Ping timeout: 260 seconds]
apeiros has quit [Remote host closed the connection]
<Guest60861>
I think it's because, for some reason, the window (the actual program's window) of Command Prompt with Ruby on Rails doesn't widen any more than 89 columns
<Guest60861>
really weird, it just doesn't.
<Guest60861>
ddfreyne: Do you have any idea for a workaround?
<Kero>
what would you do when you know the program is running from a prompt or terminal?
pglombardo has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<Guest60861>
Kero: I'm creating a command like GUI. Works well in unixy OS', completely mauled in Command Prompt because Command Prompt window is a set size
<Guest60861>
I can programatically increase Command Prompt window size use Ruby's system() method
<Guest60861>
but I only want to utilise such a method when the program is indeed running in Command Prompt
<drbrain>
Guest60861: like highline or like curses? (and why aren't you using either)?
<Guest60861>
I'm using curses
<Guest60861>
Command Prompt mangles curses
julweber has quit [Remote host closed the connection]
<Guest60861>
actually, it crashes if a curses window is larger than the commant prompt window (already closed window error--very odd)
<Guest60861>
anyway, I've got around it
<Guest60861>
but I just want to implement my work around when command prompt is being utilised
julweber has joined #ruby-lang
<drbrain>
probably need to check your parent process name
julweber has quit [Read error: Connection reset by peer]
julweber has joined #ruby-lang
<Kero>
can't you check the window size, rpogrammatically? refrain from opening a too-large-curses window?
<joevandyk>
drbrain: i'm running into http://bugs.ruby-lang.org/issues/8182 (exact same problem, communicating with mailchimp fails after moving to 2.0). Should I patch my Ruby? Or do something else?
<Guest60861>
Kero: Sometimes the GUI needs to be a certain size
julweber has quit [Remote host closed the connection]
<Guest60861>
it's fine, everything's working wonderfully, I was just wondering if it could be a little better...
<drbrain>
joevandyk: I guess you'll need to patch your ruby
<Guest60861>
then again, if it ain't broke don't fix it
julweber has joined #ruby-lang
<Guest60861>
drbrain: How could I check my parent process?
<drbrain>
on *NIX, use ps. I don't know about windows
<Guest60861>
don't blame you :)
ingof has quit [Remote host closed the connection]
<drbrain>
is there's another method in stdlib that provides that?
<drbrain>
joevandyk: it says: 2.0.0: REQUIRED
<drbrain>
so it's needed for 2.0
<joevandyk>
ha
<joevandyk>
i can't read
<joevandyk>
so the fix is in 2.0, I just need to run the stable release?
julweber has quit [Ping timeout: 245 seconds]
<joevandyk>
looks like it
majjoha has joined #ruby-lang
<drbrain>
joevandyk: you'd have to check the branch to see if it's been committed and released
priodev has quit [Ping timeout: 240 seconds]
* Kero
realizes there is something named "Command Prompt", rather than something just being a command prompt.
<Kero>
not aware of a stdlib call to get the name
priodev has joined #ruby-lang
krzyzaq has quit [Quit: This computer has gone to sleep]
jvrmaia has quit [Quit: Leaving]
MaddinXx has joined #ruby-lang
majjoha has quit [Ping timeout: 272 seconds]
torrieri has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 245 seconds]
<mistym>
Having a little trouble calling a C function via FFI.
<mistym>
Its C definition in the header: gme_err_t gme_open_file( const char path [], Music_Emu** out, int sample_rate );
<mistym>
I've wrapped it like so: attach_function :gme_open_file, [ :string, :pointer, :int ], :gme_err_t
<mistym>
Then called it via gme_open_file('path', emu.get_pointer(0), 0)
<mistym>
Doesn't seem to be working - didn't segfault, but is failing due to an assert in the function body. When I called it in a simple C test program, I didn't run into the same issue: https://gist.github.com/mistydemeo/f6e0c6e716b3e8a57939
<drbrain>
mistym: how does the function fill in out?
<drbrain>
mistym: might need ptr = emu.get_pointer(0); gme_open_file('path', ptr.to_ptr, 0)
<drbrain>
my FFI knowledge is poor, so I might be wrong, but I don't think emu.pointer(0) is the same as &emu in the C example
<mistym>
Maybe not, I'll check - thanks
<drbrain>
I think the FFI side is just "emu"
<drbrain>
… on the C side
<mistym>
out is a C++ object being passed through C as an opaque struct. gme_open_file() sets *out = 0;, then instantiates a Music_Emu object at the pointer
<mistym>
drbrain: Aha - I realized get_pointer(0) isn't doing what I thought it was
<mistym>
It's returning a pointer with absolute(?) address 0, not a pointer to offset 0 of the FFI::MemoryPointer
<drbrain>
ah
<drbrain>
yeah
<drbrain>
probably need ptr = FFI::MemoryPointer.new; gme_open_file('path', ptr.to_ptr, 0) ?
<mistym>
There isn't a #to_ptr instance method on MemoryPointer, so wondering if FFI::Pointer.new(ptr) is the most concise way
<mistym>
I'm finding it seriously weird that #get_pointer isn't doing what I thought it would, given that it doesn't seem to be relative to the instance at all
<mistym>
Oh! Derrrp, I see why now
<mistym>
#get_pointer is equivalent to #get_bytes - reading n pointers from the pointer, *not* convering ptr into a pointer
<mistym>
Joy, now it's segfaulting on the next function call. This is progress at least.
<drbrain>
:D
<drbrain>
that's me every time I try to FFI something
<Guest60861>
drbrain: Why isn't this curses window colored red?
<drbrain>
Guest60861: each window has its own set of color
<drbrain>
see line 35-38
<drbrain>
Guest60861: if you want the window border to be colored too, put the win.box inside the attron block
<mistym>
drbrain: OK, so given the next function: gme_err_t gme_start_track( Music_Emu*, int index ); wrapped as: attach_function :gme_start_track, [ :pointer, :int ], :gme_err_t
mannyt has joined #ruby-lang
schaerli has quit [Ping timeout: 265 seconds]
<mistym>
drbrain: Can you think of why passing the FFI::MemoryPointer to gme_start_track() would cause it to segfault?
<Guest60861>
drbrain: Isn't the win.box inside the attron block?
bean__ has joined #ruby-lang
<drbrain>
Guest60861: for a different window
<drbrain>
so it won't apply
<Guest60861>
So I need a new set of attron and attroff for each window?
<drbrain>
yes
<Guest60861>
and it's not working because I have a string in there first?
<drbrain>
Guest60861: you should use the block form, it'll be easier to remember
<drbrain>
which is not working?
<drbrain>
mistym: can you paste it?
<Guest60861>
the coloring of win1 isn't working
<Guest60861>
because it's coloring the string in first?
vlad_starkov has quit [Remote host closed the connection]
bean__ has quit [Quit: Computer has gone to sleep.]
<mistym>
drbrain: Yeah, this way of doing it is fairly awkward
superdealloc has joined #ruby-lang
benlovell has joined #ruby-lang
<drbrain>
ah, ptr.address maybe?
diegoviola has quit [Quit: WeeChat 0.4.2]
<Guest60861>
drbrain: Thanks a lot for your paste it works :). You know if I wanted to create a background color, would I create large 'parent window', apply a color attribute and fill it with spaces?
<Guest60861>
would that be a good practise?
<Guest60861>
just wondering
<drbrain>
Guest60861: I think so
<Guest60861>
kewl. I'll get stuck in
<drbrain>
Guest60861: you should also be able to set the background color of the default window
io_syl has joined #ruby-lang
<drbrain>
I think there's a different call than attron
<drbrain>
ah, bkgd
superdealloc has quit [Ping timeout: 245 seconds]
<Guest60861>
by default window you mean the 'invisible' master window that everything's inside? So addstr "hi" is actually appending to this master window?
<mistym>
drbrain: #address returns an int
<drbrain>
mistym: I wonder if that matters when you specify :pointer
<mistym>
drbrain: Oh, the int value to FFI::Pointer is in fact the address
<mistym>
That said, FFI::Pointer.new(ptr) and FFI::Pointer.new(ptr.address) are the same except the latter doesn't have a size attributre
<mistym>
*attribute
<drbrain>
instead of line 16 in player.rb, gme_open_file(file, @player.address, @frequency)
benlovell has quit [Ping timeout: 260 seconds]
<mistym>
Oh, I see what you mean
banisterfiend has quit [Ping timeout: 272 seconds]
<mistym>
drbrain: Nope, doesn't like taking an int for a :pointer
<drbrain>
:(
majjoha has joined #ruby-lang
<drbrain>
Guest60861: yes, but it's not really invisible :D
<Guest60861>
that's true!
<drbrain>
you can still call box, addstr, attron, etc.
<Guest60861>
wow.. win1.bkgd(COLOR_RED) gives me a load of smiley faces!
<Guest60861>
a background of smiley faces
a1ph4g33k has joined #ruby-lang
<drbrain>
Guest60861: maybe bkgd is wrong
<Guest60861>
no...it's from the docs
<drbrain>
… I've never used it
<Guest60861>
fair enough
<Guest60861>
was not expecting a load of smilies
<Guest60861>
madness
apeiros has quit [Remote host closed the connection]
MartynKeigher has joined #ruby-lang
apeiros has joined #ruby-lang
Coincidental has quit [Remote host closed the connection]
bean__ has joined #ruby-lang
majjoha has quit [Ping timeout: 252 seconds]
Coincidental has joined #ruby-lang
<mistym>
drbrain: Thanks for your help, I'm pretty perplexed. Going to ask about this on the ffi mailing list
<drbrain>
mistym: I really want to like FFI/Fiddle, but I always get myself confused and write C programs to figure out what I'm doing wrong
<drbrain>
… so then I usually switch to C :/
<mistym>
drbrain: :/
<mistym>
drbrain: Makes sense :/
<drbrain>
I think I spent two or three hours on that two function fiddle code I linked
<mistym>
Heh, that makes me feel a little better
diegoviola has joined #ruby-lang
<Guest60861>
drbrain: What does CH mean?
<Guest60861>
as in bkgdset(ch)
mistym has quit [Remote host closed the connection]
<charliesome>
Guest60861: character
<charliesome>
i'd say
<Guest60861>
what would a character be? :L
apeiros has quit [Ping timeout: 272 seconds]
<charliesome>
'x'
<Guest60861>
wouldn't that be str for string or something?
Coincidental has quit [Ping timeout: 265 seconds]
<drbrain>
since it's wrapping a C API, things get weird
ledestin has joined #ruby-lang
<charliesome>
Guest60861: a character is different to a string
banisterfiend has joined #ruby-lang
<charliesome>
in c, single quotes are for chars and double quotes are for strings
<Guest60861>
meh
<Guest60861>
oh, that's interesting
<Guest60861>
BAH! I just can't get this background thing working..I'll just fill it with colored spaces and overwrite them
duardbr has quit [Ping timeout: 272 seconds]
duard has joined #ruby-lang
metus_violarium has quit [Quit: Konversation terminated!]
slyphon has quit [Read error: Connection reset by peer]
bf4 has quit [Ping timeout: 272 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hrs has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
io_syl has quit []
toretore has quit [Quit: Leaving]
enebo has quit [Quit: enebo]
Grimscribe has joined #ruby-lang
ingof has quit [Remote host closed the connection]
nisstyre has quit [Quit: Leaving]
benlovell has joined #ruby-lang
vlad_starkov has joined #ruby-lang
cads has quit [Ping timeout: 272 seconds]
benlovell has quit [Ping timeout: 272 seconds]
Coincidental has joined #ruby-lang
dus7 has joined #ruby-lang
majjoha has joined #ruby-lang
dus7 has quit [Remote host closed the connection]
atongen has joined #ruby-lang
kgrz has joined #ruby-lang
lfox has quit [Quit: ZZZzzz…]
torrieri has quit [Quit: Leaving...]
majjoha has quit [Ping timeout: 265 seconds]
vlad_starkov has quit [Ping timeout: 245 seconds]
enmand has quit [Ping timeout: 272 seconds]
kgrz has quit [Ping timeout: 252 seconds]
enmand has joined #ruby-lang
CoreData has quit [Ping timeout: 245 seconds]
slyphon has joined #ruby-lang
tomzx_mac has joined #ruby-lang
torrieri has joined #ruby-lang
sepp2k has quit [Ping timeout: 245 seconds]
sepp2k1 has joined #ruby-lang
workmad3 has quit [Ping timeout: 272 seconds]
jeff_r has joined #ruby-lang
Guest60861 has quit [Ping timeout: 268 seconds]
solars has quit [Ping timeout: 246 seconds]
majjoha has joined #ruby-lang
kitak has quit [Remote host closed the connection]
retro|cz has quit [Ping timeout: 265 seconds]
kireevco_ has quit [Read error: Connection reset by peer]
Grimscribe has quit [Ping timeout: 246 seconds]
majjoha has quit [Ping timeout: 272 seconds]
kireevco_ has joined #ruby-lang
ldnunes has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
macsplean has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
elia has quit [Read error: Connection reset by peer]
alexju has quit [Remote host closed the connection]
alexju has joined #ruby-lang
awkwords has joined #ruby-lang
retro|cz has joined #ruby-lang
atongen has quit [Quit: leaving]
<awkwords>
hi so to find out methods avaiable to objects in IRB i do object.public_methods.sort.. is their anyway to setup something like an alias in IRB so i can do <object>.showmethods
fn_ has joined #ruby-lang
elia has joined #ruby-lang
<mistym>
awkwords: Yep, just define a `show_methods` method on Object that returns public_methods.sort
andyhuynh has joined #ruby-lang
alexju has quit [Ping timeout: 272 seconds]
<awkwords>
is their anyway to alias this when irb starts up so its in scope for all objects?
fn_ has quit [Remote host closed the connection]
<mistym>
Put it in your ~/.irbrc, which will be executed when you start irb.
<mistym>
All objects inherit from Object, so if you open the class and define the method there, all objects will get it.
<awkwords>
thanks mistym
Forgetful_Lion has quit [Remote host closed the connection]
VTLob has quit [Quit: VTLob]
kitak has joined #ruby-lang
nigerianceo has quit []
<micalexander>
wanna make a method that does a gsub based on the arguments passed. I'm using the lambda version of gsub and cant seem to pass in a the groups match argument to it. is it even possible to do so?
<drbrain>
micalexander: remove the last , on line 13
ldnunes has quit [Ping timeout: 262 seconds]
jeff_r has quit [Remote host closed the connection]
jeff_r has joined #ruby-lang
<julian_>
drbrain: No, I haven't been working on this all this time :P But..it's still bugging me that my program could be better. If you had to guess, how would you get win1.bkgd(ch) to work
<micalexander>
drbrain: now it thinks pattern is a method
<drbrain>
julian_: I played with it for a bit but couldn't figure it out
<drbrain>
julian_: it seems like you're supposed to set it to something like win.bkgd(' '.ord | Curses.color_pair(1))
<mistym>
micalexander: Need the parens around the method parameters, otherwise in this case it interpreted the block as being an argument to a method called pattern
postmodern has joined #ruby-lang
<micalexander>
mistym: yes but it still didnt retain the first part of my input string
<awkwords>
is their anyway to list methods and ignore any provided by the kernel object? mistym
andyhuynh has joined #ruby-lang
<drbrain>
micalexander: ah, right, $1 in the gsub block doesn't work that way
<drbrain>
its special :/
jeff_r has quit [Ping timeout: 245 seconds]
<mistym>
magic_globals--
<micalexander>
drbrain: so there is no what to make this piece of code modular