ramonmaruko has quit [Remote host closed the connection]
ramonmaruko has joined #ruby-lang
nazty has joined #ruby-lang
ryanf has joined #ruby-lang
spuk has joined #ruby-lang
rking has quit [Remote host closed the connection]
rking has joined #ruby-lang
Zyclops has joined #ruby-lang
espinet has joined #ruby-lang
espinet has left #ruby-lang [#ruby-lang]
espinet has joined #ruby-lang
<espinet>
why do symbols exist in ruby?
livinded has joined #ruby-lang
<espinet>
i understand that they come with better performance than strings in certain aspects, but fundamentally… why where they added
<livinded>
how can I take a fixnum and convert it to a hex escaped string? (eg. 1 -> "\x31")
<erikh>
1.chr.sprintf("\x%x") should be close
<erikh>
just ignore all of that
<livinded>
ah, that's what I was looking for. chr
<erikh>
yeah, although it'd be something like '\x%x' % [ 1.chr ]
<livinded>
chr does it by itself
<erikh>
well, inspect is doing the hex-escaping
<livinded>
oh
<erikh>
:)
<espinet>
nobody?
<erikh>
espinet: why does lisp have symbols?
<erikh>
why do we have null terminated strings in some languages, header-based ones in others, and even others have no distinction on length?
<livinded>
erikh: invalid escape sequence with \x
<erikh>
livinded: sec.
<tef>
erikh: i'd take a wager that symbols are in as immutable strings for use internally. not much use if you can change a string once and mutate every method name using it
<erikh>
mmm no
<erikh>
livinded: '\x%02x' % [ "1".ord ]
<erikh>
so if you have a fixnum, to_s between the number and ord
<espinet>
erikh: i don't have much experience in lisp so i couldn't say
<erikh>
symbols are there for performance reasons and are preferred in certain situations over strings.
wpaulson has joined #ruby-lang
<erikh>
99% of the time it doesn't matte.r
<espinet>
so you are saying its strictly performance?
ryanf has quit [Quit: leaving]
<erikh>
mutability is less of an issue but they aren't immutable, but easily transformed
<erikh>
e.g., (:foo.to_s + "_bar").to_sym
<erikh>
err, are immutable, but easily transformed.
<espinet>
how are symbols easily transformed?
<erikh>
I just showed you code.
<livinded>
erikh: fuuuuu apparently rubininus doesn't have ord implemented or it's broken
<espinet>
oh
<erikh>
livinded: could be an encoding issue
<erikh>
try this
<erikh>
1.to_s[0,1]
<lianj>
"1".unpack("C")
<erikh>
yeah, that'd do it
<erikh>
unpack's probably a better solution than my sprintf stuff anyhow
<livinded>
had to install 3 different versions of ruby today due to incompatabilities :(
<livinded>
all kinds of annoying issues with qrcode encoding
<tef>
1.8 1.9 and 1.9.3?
wpaulson has quit [Client Quit]
<livinded>
1.9.3, 1.8.7, rbx
<erikh>
livinded: what library is this?
<livinded>
rqrcode
<erikh>
oh really
<livinded>
doesn't like encoding binary data that's utf-8
<erikh>
we're using that on a stupid little project to encode PGP keys
<erikh>
err, cmaujean and I
<erikh>
.... who doesn't seem to be in here atm
<livinded>
erikh: honestly I'm just doing some really stupid stuff. The library probably is pretty good, but it is a known bug
<erikh>
it's slow, but that's not surprising really
<livinded>
better than piping out to qrencode
<erikh>
right, a C extension would be ideal but it'd still be hard to manage.
<livinded>
and was hoping it would handle binary data better than qrencode but it doesn't seem to
<erikh>
all the back and forth of communicating the structure, etc.
<livinded>
apparently the spec saying that it support 8bit byte encoding of data is bullshit, or all the encoders are broken
<bnagy>
try msgpack maybe
<erikh>
msgpack? for qr codes?
<bnagy>
fast, encodes binary data really well
banisterfiend has quit [Ping timeout: 252 seconds]
<livinded>
bnagy: it's more a matter of I want to use qrcodes
<erikh>
a QR code is a visual representation of data, typically used by cell phones
<bnagy>
erikh: I dunno, I just saw 'encoding binary, no work'
<postmodern>
erikh, you'd be surprised at how little input validation is performed on barcodes/qrcodes
<livinded>
as soon as I can get a return address into the stack somewhere I'll be set
<postmodern>
livinded, fuzzing qrcodes i take it?
<livinded>
encoding everything from 0x0-0x7f works fine, 0x80-0x9f just shits itself, and 0xa0-0xff gets mangled into multibytes chars for some reason
<livinded>
postmodern: sort of
<livinded>
did learn that 0x1f is perfectly acceptable ascii NOP in x86 though
<bnagy>
there are shellcode -> ascii encoders
<livinded>
bnagy: I know, I'm doing that
<livinded>
addresses in the stack space however aren't ascii representable
<bnagy>
it's a bit like the irc bot project for hackers :>
<livinded>
I'm trying to write some crazy ret2libc code to jump into the stack
<bnagy>
uh
savage- has joined #ruby-lang
<bnagy>
that makes no sense
<livinded>
on linux stack starts in 0xbf.....
<livinded>
non-ascii representable. Thus I can't represent it in a qr code
<bnagy>
nah I meant about using ret2libc to jump into the stack
<livinded>
bnagy: ROP
<livinded>
looking for code in libc to use for it
<bnagy>
yes, I'm familiar with the technique :)
<bnagy>
what's your basic vuln, anyway?
<livinded>
custom code
<livinded>
simple stack overflow
<bnagy>
hrm. 'normal' linux is going to have stack cookies etc
<bnagy>
you need to get some eip control first
<bnagy>
then worry about the shellcode
<erikh>
lookin' for jmp in all the wrong places
<erikh>
fuck today. I'm getting wasted.
<bnagy>
\m/
<bnagy>
I need to linux things first :(
<erikh>
I need to man up and finish my process monitor
banisterfiend` has joined #ruby-lang
<tef>
livinded: 'mangled into multibytes' - this sounds like your string is being treated as unicode points rather than bytes and being implicitly encoded into utf-8
msaffitz has joined #ruby-lang
kvirani has quit [Remote host closed the connection]
msaffitz has quit [Quit: Computer has gone to sleep.]
espinet has quit [Quit: espinet]
ttilley_off is now known as ttilley
robbyoconnor has quit [Read error: Connection reset by peer]
hahuang65_ has joined #ruby-lang
robbyoconnor has joined #ruby-lang
andrewhl has quit [Remote host closed the connection]
<livinded>
bnagy: I have control of eip already
imperator has joined #ruby-lang
<livinded>
the problem is moving it somewhere that has code I control
<livinded>
tef: but as far as I know, qrcodes don't support unicode. It's 8bit bytes
<tef>
livinded: so if the string you're building isn't a bytestring, but a 'real' string, the library might be encoding it on your behalf
<livinded>
tef: I tried encoding it outside of ruby
<livinded>
did the same thing
<livinded>
I think it's an issue with how zxing decodes qrcode images
<livinded>
I'm using a different thing now and it's doing the same thing though with different mangling
brianpWins has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby-lang
msaffitz has joined #ruby-lang
mistym has quit [Remote host closed the connection]
igotnolegs has quit [Quit: Fire walk with me]
msaffitz has quit [Quit: Computer has gone to sleep.]
chutwig has quit [Quit: Computer has gone to sleep.]
andrewhl has joined #ruby-lang
dfr|mac has quit [Remote host closed the connection]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
imperator has quit [Quit: Leaving]
cantonic has quit [Quit: cantonic]
robbyoconnor has quit [Read error: Connection reset by peer]
bglusman has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
Natch has quit [K-Lined]
andrewhl has quit [Remote host closed the connection]
crackity_jones has quit [Ping timeout: 245 seconds]
cdt has quit [Read error: Connection reset by peer]
cdt has joined #ruby-lang
sora_h is now known as s0ra_h
toretore has joined #ruby-lang
cdt has quit [Read error: Connection reset by peer]
cdt has joined #ruby-lang
gnufied has joined #ruby-lang
cdt has quit [Client Quit]
cdt has joined #ruby-lang
diegoviola has quit [Read error: Connection reset by peer]
cdt has quit [Read error: Connection reset by peer]
cdt has joined #ruby-lang
sepp2k has joined #ruby-lang
cdt has quit [Read error: Connection reset by peer]
cdt has joined #ruby-lang
cdt has quit [Read error: Connection reset by peer]
dejongge has joined #ruby-lang
dejongge has quit [Client Quit]
justinmcp has joined #ruby-lang
dejongge has joined #ruby-lang
kaochenlong has quit [Quit: kaochenlong]
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
s0ra_h is now known as sora_h
charlies_ has joined #ruby-lang
cdt has joined #ruby-lang
charlies_ is now known as charliesome2
Zyclops has quit [Quit: Leaving.]
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
neoesque has quit [Quit: Bye!]
tjadc has quit [Read error: Connection reset by peer]
tjadc has joined #ruby-lang
sora_h is now known as s0ra_h
future_chimp has quit [Quit: This computer has gone to sleep]
robin850 has quit [Read error: Operation timed out]
future_chimp has joined #ruby-lang
hbs_ has joined #ruby-lang
hbs_ has quit [Client Quit]
hbs_ has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
s0ra_h is now known as sora_h
yumike has joined #ruby-lang
NOKAH has joined #ruby-lang
Hakon|mbp has quit [Ping timeout: 265 seconds]
NOKAH has quit [Client Quit]
Hakon|mbp has joined #ruby-lang
hbs_ has quit [Quit: hbs_]
hbs_ has joined #ruby-lang
future_chimp has quit [Quit: Leaving]
hbs_ has left #ruby-lang [#ruby-lang]
future_chimp has joined #ruby-lang
joshwines has quit [Ping timeout: 244 seconds]
<tjadc>
I have a test string 'myword$call_23.friend.id'. I would like regex that will group \.\w+ but the group should return the whole match, for instance '.friend.id'. I currently have \$call_(\d+)(\.\w+)* as my regex. According to rubular, the whole word matches, however the group is only returning the last occurence, namely '.id' of the last group
<darix>
tjadc: shouldnt it return '.friend'
<darix>
i dont see how your regexp would give you '.id'
<tjadc>
I don't either, but it does
<tjadc>
check it on rubular
<tjadc>
a version I created now that works is, \$call_(\d+)((\.\w*)*)
<tjadc>
just that it seems slightly verbose
<darix>
this is really weird
<tjadc>
darix: don't forget the * at the end
<darix>
\w might not contain the .
<tjadc>
that is what tells it to find .friend.id
<tjadc>
It doesn't, I have explicitly told it to find .
<darix>
/\$call_(\d+)(\..+)/
<darix>
no
<darix>
you havent
<darix>
for that you want
corecode has joined #ruby-lang
<darix>
\$call_(\d+)([\.\w]+)*
<corecode>
o hi
<corecode>
is there a way to do a IO tee, or a computational IO?
<tjadc>
darix: perfect, thanks
<corecode>
i.e. something were i can intercept all reads/writes from/to a IO
<tjadc>
darix: I was caught up on the idea that I had to have 2 or more \w characters, but that isn
<corecode>
writes is sufficient
<tjadc>
t the case
<tjadc>
Thanks a lot
<darix>
corecode: what do you want to do?
<corecode>
darix: i want to intercept all output to $stdout and write to stdout and to a file
<corecode>
i.e. something like $stdout = IOTee.new($stdout, File.open('foo', 'w'))
<corecode>
where IOTee would be something IO-like that can intercept any output
joshwines has joined #ruby-lang
<darix>
well
<darix>
if you dont need the stdout output anymore
<darix>
you could just do $stdout = File.new...
<corecode>
that will just write to that file
<corecode>
i'd like to intercept writes
<darix>
io.reopen it is
dfr|mac has joined #ruby-lang
<corecode>
so that i can handle them, writing them to the original stdout and to a file
<darix>
well write a small class that does the duplication
<darix>
then $stdout.reopen :p
<corecode>
sure
<corecode>
but what do i have to implement to act like IO
<corecode>
is it sufficient to do class MyIO < IO; def write(o); ...; end; end
<corecode>
or does it have to be also puts, print, etc.
<darix>
try it and find out?:)
<corecode>
well, without formal specification this could change any time
dfr|mac has quit [Remote host closed the connection]
butchanton has joined #ruby-lang
sora_h is now known as s0ra_h
Carnage\ has quit []
robotmay has joined #ruby-lang
msaffitz has joined #ruby-lang
thisirs has quit [Remote host closed the connection]
hynkle has joined #ruby-lang
apeiros_ has joined #ruby-lang
outoftime has quit [Ping timeout: 244 seconds]
future_chimp has quit [Quit: Leaving]
ruurd has quit [Quit: Leaving...]
sailias has quit [Quit: Leaving.]
kvirani has quit [Remote host closed the connection]
hynkle has quit [Quit: Computer has gone to sleep.]
crudson has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
outoftime has joined #ruby-lang
jxie has quit [Ping timeout: 265 seconds]
jxie has joined #ruby-lang
xtagon has joined #ruby-lang
ddfreyne has quit [Excess Flood]
ddfreyne has joined #ruby-lang
dpeter has joined #ruby-lang
brianpWins has joined #ruby-lang
shirmung has joined #ruby-lang
T_Rex_ has joined #ruby-lang
hynkle has joined #ruby-lang
hynkle has quit [Client Quit]
workmad3 has quit [Ping timeout: 252 seconds]
JustinCampbell has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
outsmartin1 has joined #ruby-lang
jperry2 has joined #ruby-lang
brunocoelho has joined #ruby-lang
outsmartin has quit [Ping timeout: 264 seconds]
kaspernj has joined #ruby-lang
wallerdev has joined #ruby-lang
<kaspernj>
Can anyone explain what this error means from Enumerator#next: fiber called across stack rewinding barrier
<kaspernj>
?
jperry2 has quit [Quit: jperry2]
jperry2 has joined #ruby-lang
jperry2 has quit [Client Quit]
jperry2 has joined #ruby-lang
<JustinCampbell>
kaspernj: it means the iterator is trying to call something outside of the current fiber
<JustinCampbell>
where is it happening
jperry2 has quit [Client Quit]
jperry2 has joined #ruby-lang
<kaspernj>
JustinCampbell, I am trying to do a "Gnome-Do"-like project for fun. I have an enumerator returning results. It starts by calling next and shows the result. The user then presses down, which calls "next" on the enumerator again, when the error occurs. I am using Gtk2.
<JustinCampbell>
can you gist a code sample
<kaspernj>
JustinCampbell, is it ok I link you the source on Github (the project is on Github already) ?
<JustinCampbell>
kaspernj: im sorry im not too familiar with what this is trying to achieve
<JustinCampbell>
i get that you want up and down to show the next and previous entries
<JustinCampbell>
you could try using the cursor index instead of calling #next
<JustinCampbell>
@enum[@result_i]
kurko__ has joined #ruby-lang
<kaspernj>
JustinCampbell, I will give it a try. Thanks.
kurko_ has quit [Ping timeout: 244 seconds]
<kaspernj>
JustinCampbell, []-method is not mentioned in the docs, and I also get a "undefined method `[]'" ? Do you mean I should convert it to an array? I would really like to avoid that, since that might create thousands or results at once, greatly slowing the application down and eating my memory.
<JustinCampbell>
agreed
<kaspernj>
thousands of*
sfifbo has joined #ruby-lang
sfifbo has left #ruby-lang [#ruby-lang]
sailias has joined #ruby-lang
kvirani has joined #ruby-lang
erpuds has joined #ruby-lang
cube526 has joined #ruby-lang
achamian_ has joined #ruby-lang
shirmung has quit [Read error: Connection reset by peer]
shirmung has joined #ruby-lang
achamian has quit [Ping timeout: 250 seconds]
fayimora has joined #ruby-lang
dpeter has quit [Read error: Connection reset by peer]
T_Rex_ has quit [Ping timeout: 246 seconds]
mytrile has quit [Remote host closed the connection]
A124 has quit [Quit: Leaving.]
cirenyc has joined #ruby-lang
sockmonk has joined #ruby-lang
r0bby has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 245 seconds]
hynkle has joined #ruby-lang
hynkle has quit [Client Quit]
tekin has joined #ruby-lang
kaspernj has quit [Read error: Operation timed out]
achamian_ has quit [Ping timeout: 246 seconds]
cube526 has quit [Quit: Bye]
shirmung has quit [Read error: Connection reset by peer]
shirmung has joined #ruby-lang
tekin has quit [Quit: Computer has gone to sleep.]
shirmung has quit [Read error: Connection reset by peer]
jsilver has joined #ruby-lang
shirmung has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
Criztian has joined #ruby-lang
anjen has joined #ruby-lang
T_Rex_ has joined #ruby-lang
msaffitz has quit [Quit: Computer has gone to sleep.]
digitalbane1 has joined #ruby-lang
digitalbane1 has left #ruby-lang [#ruby-lang]
corecode has quit [Quit: leaving]
digitalbane has quit [Ping timeout: 240 seconds]
kaochenlong has quit [Quit: kaochenlong]
moisesv has quit [Quit: moisesv]
A124 has joined #ruby-lang
zmack has joined #ruby-lang
anjen has quit [Quit: anjen]
ruurd has joined #ruby-lang
fayimora has quit [Ping timeout: 245 seconds]
fayimora has joined #ruby-lang
mrsolo has joined #ruby-lang
gsav has quit [Ping timeout: 265 seconds]
dv310p3r has quit [Ping timeout: 264 seconds]
jtoy has joined #ruby-lang
<jtoy>
is there any way to speed up requiring gems? it seems that is slowing down my code a lot
<jtoy>
I'm writing some very simple ruby scripts, most of the time is in the require
coryf has quit [Ping timeout: 245 seconds]
coryf has joined #ruby-lang
<jtoy>
I'm on ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
<yfeldblum>
jtoy, might try out falcon's patch
<yfeldblum>
jtoy, if you're using rvm, `rvm install 1.9.3 --patch falcon`
zmack has quit [Ping timeout: 264 seconds]
<jtoy>
hmm, im not
<jtoy>
it takes multiple seconds just for the ruby script to check if a file exists and if so, exit, wtf
<lianj>
what gems to you require?
<jtoy>
yaml.yajl,optparse,riak,typhoeus, and oauth
<jtoy>
if its makes it past the file check, then it uses those gems
<jtoy>
yfeldblum: do you know if Ruby 1.9.3-p194 has the patch to go faster?
solars has joined #ruby-lang
<yfeldblum>
jtoy, i believe so, at least some of falcon's patches
<jtoy>
yfeldblum: but 1.9.3p0 doesn't have them?
<yfeldblum>
jtoy, but i'm not sure about that
<yfeldblum>
jtoy, maybe, but i'm not really sure one way or the other
zmack has joined #ruby-lang
zmack has quit [Remote host closed the connection]
robin850 has quit [Quit: Konversation terminated!]
rindolf has joined #ruby-lang
<rindolf>
Hi all.
<lianj>
jtoy: %w[yaml yajl optparse typhoeus oauth].each{|i| require i } takes 0.28 seconds here
<jtoy>
lianj: with just those requires its real 0m0.778s for me
<lianj>
slow IO ? :D
<FiXato>
still don't get why require doesn't take a splat
<jtoy>
lianj: it is ec2
<lianj>
using bundler?
dv310p3r has joined #ruby-lang
<jtoy>
lianj: no, does that make it faster or slower?
<jtoy>
slower i would imagine
scientes has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
neocoin has joined #ruby-lang
brunocoelho has joined #ruby-lang
achamian has joined #ruby-lang
achamian has quit [Remote host closed the connection]
brunocoelho has quit [Remote host closed the connection]
neocoin has quit [Ping timeout: 244 seconds]
tekin has joined #ruby-lang
moos3 has joined #ruby-lang
<moos3>
is there a quick way to check if a string is yyyy-dd-mm ?
<rindolf>
moos3: a regex.
<rindolf>
moos3: well, there may be a date parsing module.
<rindolf>
moos3: do you wish to account for invalid stuff like 2012-50-05 or 2012-05-20 ?
<mistym>
In ruby, regexps aren't quite strings; they're a class of object of their own, with their own methods and everything. So no quoting to turn it into a string: stamp =~ /.../
<rindolf>
Well, 2012-05-40
<moos3>
yeah rindolf just to make sure its a valid format and date
tjadc has joined #ruby-lang
<moos3>
the regex should be (\d{4})\-(\d{2})\-(\d{2})
<moos3>
that would check the format
<rindolf>
moos3: do you want to capture the three fields?
<rindolf>
moos3: well, 2012-50-03 is an invalid date.
<moos3>
the user is passing in via cli, as 2012-31-08
<rindolf>
Because there isn't a 50th month.
<moos3>
yea
<moos3>
its year-day-month
<moos3>
or i can do day-month-year
daniellutz has joined #ruby-lang
<rindolf>
moos3: there isn't a 50th day in a month either.
<rindolf>
moos3: but the naïve regex will match nonetheless.
<moos3>
yea i know, so how should i handle that case
<rindolf>
moos3: you should probably use a date/time library.
<moos3>
k
<lianj>
maybe, date = Time.parse('foo bar 2012-12-01 baz').strftime("%Y-%m-%d") rescue false
Criztian has quit [Remote host closed the connection]
dv310p3r has joined #ruby-lang
workmad3 has joined #ruby-lang
<whitequark>
ok, remember when I said I can crash everything <=1.9.2-p192?
<whitequark>
er, -p180
<whitequark>
now I have crashed 1.9.3-p194
workmad3 has quit [Ping timeout: 264 seconds]
<whitequark>
and it's not like I'm doing something inherently evil. as I've said, no Cexts.
Nisstyre has quit [Ping timeout: 246 seconds]
mssola has quit [Ping timeout: 265 seconds]
<drbrain>
whitequark: can you file a bug?
cdt has joined #ruby-lang
cdt has quit [Read error: Connection reset by peer]
dejongge has quit [Ping timeout: 252 seconds]
thone has joined #ruby-lang
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
brunocoelho has joined #ruby-lang
enroxorz has quit [Quit: Leaving]
thone has quit [Quit: leaving]
Axsuul has joined #ruby-lang
<whitequark>
drbrain: I can't seem to reproduce it
<whitequark>
even if I could, what should I post in the bug? the code in question? it tends to not fail when ran on different machine.
<drbrain>
☹
<whitequark>
i.e. it's like it fails on 30% of machines where it's ran (way above margin for faulty hardware), but a particular bug isn't reproducible on another one.
<whitequark>
maybe not 30% but you got the idea
<whitequark>
and it was working that way ever since I started the project
sernin has joined #ruby-lang
<whitequark>
I do nothing particularly evil, just simultaneously stress the gc, runtime and interpreter.
Berglund has joined #ruby-lang
sepp2k1 has joined #ruby-lang
msaffitz has joined #ruby-lang
<drbrain>
whitequark: if you can include debugger backtrace and the VM dump info from a crash that'll be useful
sepp2k has quit [Ping timeout: 264 seconds]
akira989 has quit [Remote host closed the connection]
bglusman has quit [Remote host closed the connection]
<drbrain>
whitequark: it won't hurt… I've seen VM bugs fixed with just this output
Jaxel has joined #ruby-lang
<drbrain>
it won't hurt
<drbrain>
(wait, I said that twice)
yxhuvud has quit [Ping timeout: 265 seconds]
<whitequark>
... I guess it will hurt, then :D
<Jaxel>
hello
<andrewvos>
JAXEL HI
<Jaxel>
i am having trouble using a gem called 'ocra'
<Jaxel>
it is telling me bad file descriptor (errno::EBADF)
<Jaxel>
on this line: @of << [OP_CREATE_FILE, tgt.to_native, str.size, str].pack("VZ*VA*")
<whitequark>
Jaxel: in my experience, it was broken long ago
<Jaxel>
i had been using it before successfully
<Jaxel>
are you saying i should attempt downgrading
<whitequark>
oh, so it worked for you
<whitequark>
no, I won't comment on it then, I've used it years ago
<Jaxel>
yep, this is a new problem
<Jaxel>
i even tried recompiling files i'd used it successfully on in the past
<Jaxel>
no luck
<Jaxel>
it's the only compiler that's ever worked for me, so
jperry2 has quit [Quit: jperry2]
akira989 has joined #ruby-lang
ruby-lang522 has joined #ruby-lang
<Jaxel>
let's try ocrasa 1.2.0
bglusman has joined #ruby-lang
HassanS has quit [Ping timeout: 252 seconds]
redxoom has joined #ruby-lang
workmad3 has quit [Read error: Operation timed out]
apeiros_ has quit [Remote host closed the connection]
<mistym>
'foo'.force_encoding('utf-8') + 'bar'.force_encoding('shift_jis') => encoding is UTF-8
<mistym>
'foo'.force_encoding('utf-8') + str (where str is a Shift_JIS string containing actual Japanese) => encoding is Shift_JIS
<mistym>
why
cirenyc has quit [Quit: Leaving...]
<drbrain>
mistym: string combining checks if both strings are ASCII-7bit compatible and contain only ASCII-7bit characters and just joins them if they are
<drbrain>
it seems to pick the left-hand encoding
<mistym>
drbrain: What is the result if they're not?
<mistym>
In this case the output became Shift_JIS because it contained non ASCII-7bit chars. Are there other possible outcomes?
<drbrain>
if both are ASCII-7bit compatible and one contains non-7bit characters it upgrades the other
<drbrain>
I think if one is not ASCII-7bit compatible you get an exception
<drbrain>
… I'm typing this from memory
<drbrain>
err, both aren't ASCII_7bit
<mistym>
Ah, so I do: "incompatible character encodings: UTF-8 and Shift_JIS"
havenn has joined #ruby-lang
<mistym>
So it doesn't attempt a transcode, even in the cases where it knows how to do so.
<drbrain>
I don't think you can tag a string with ASCII-7bit, though
<drbrain>
IIRC it's internal only
sailias has quit [Read error: Operation timed out]
<mistym>
Yeah, looks like it.
<mistym>
I meant transcode, in this case, SJIS=>UTF8
<drbrain>
I think you can describe the behavior of "ruby will join strings of compatible contents regardless of encoding"
<rue>
Encodings are awesome.
kaspernj has joined #ruby-lang
mssola has joined #ruby-lang
petercooper has joined #ruby-lang
redxoom has quit [Ping timeout: 265 seconds]
srbartlett has joined #ruby-lang
ruby-lang522 has quit [Ping timeout: 245 seconds]
<mistym>
drbrain: Thanks.
qpingu has joined #ruby-lang
<mistym>
Though in this case I don't think "ruby will join strings of compatible contents regardless of encoding" is quite right, since it won't join a nonascii utf8 string with a nonascii sjis string which can be represented in utf8.
<mistym>
The real lesson is "don't keep non-utf8 strings around any longer than you have to" so this doesn't need to be dealt with, I suppose.
<yfeldblum>
mistym, that's a good lesson
<drbrain>
yeah, ruby won't make a transformation between encodings for you
<drbrain>
… unless there's no dataloss possible
<drbrain>
which is likely only true for ASCII-7bit contents
<mistym>
Right, so it only tries for ASCII-7bit contents.
<mistym>
This is reminding me. Is there a decent way to handle conversion when there is an invalid multibyte char?
<rindolf>
drbrain: so what is the origin of your nickname?
<mistym>
I had a project where I was working with some fairly exotic text from the late 80s and early 90s, which is usually valid SJIS but occasionally had invalid chars. I suspect the computer it was created for had its own proprietary SJIS extension.
<rue>
drbrain: You must remedy that
<drbrain>
rindolf: high school ego
<rue>
(Actually he just misspelled dr brian)
brunocoelho has quit [Remote host closed the connection]
<rindolf>
drbrain: oh.
chrismcg is now known as zz_chrismcg
daniellutz has quit [Read error: Connection reset by peer]
daniellutz has joined #ruby-lang
daniellutz has quit [Read error: Connection reset by peer]
hynkle has joined #ruby-lang
daniellutz has joined #ruby-lang
havenn has quit [Remote host closed the connection]
srbartlett has quit [Remote host closed the connection]
daniellutz has quit [Read error: Connection reset by peer]
daniellutz_ has joined #ruby-lang
tomb has quit [Quit: Computer has gone to sleep.]
<injekt>
erikh: ping
Sambalero has joined #ruby-lang
tomb has joined #ruby-lang
moos3 has quit [Quit: Computer has gone to sleep.]
krz has joined #ruby-lang
workmad3 has joined #ruby-lang
hynkle has quit [Quit: Computer has gone to sleep.]
Nisstyre has joined #ruby-lang
kaspernj has quit [Quit: Leaving]
<erikh>
injekt: pong
<erikh>
drbrain: you should become drmario
<erikh>
I don't know why
<erikh>
it sounded cool a second ago thoguh
<drbrain>
erikh: but I've never been good at punching bricks
<erikh>
dr. mario is an awesome puzzle game where you drop pills on bugs
<erikh>
to eradicate them!
<rue>
Not much of a doctor if that’s his best plan
<erikh>
beats tetris
<mistym>
rue: I suspect Dr. Mario doesn't have a real degree
<rue>
Probably just a Master’s
<workmad3>
bah, mario is only a bachelor... his 'princess' is always in another castle
<erikh>
bad
<erikh>
so bad.
<workmad3>
hell yeah :P
s0ra_h is now known as sora_h
<rue>
:D
mistym has quit [Remote host closed the connection]
cirenyc has joined #ruby-lang
banisterfiend has joined #ruby-lang
HassanS has joined #ruby-lang
dv310p3r has quit [Ping timeout: 264 seconds]
banisterfiend` has quit [Ping timeout: 265 seconds]
shancial has joined #ruby-lang
shancial has left #ruby-lang [#ruby-lang]
workmad3 has quit [Ping timeout: 246 seconds]
thone has joined #ruby-lang
jsilver has quit [Remote host closed the connection]