ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
Clordio_ has joined #ruby-lang
fgomez has joined #ruby-lang
Sailias has joined #ruby-lang
looopy has joined #ruby-lang
mbriggs has joined #ruby-lang
seanstickle has joined #ruby-lang
RORgasm has joined #ruby-lang
fgomez has joined #ruby-lang
gregmoreno has joined #ruby-lang
S1kx has joined #ruby-lang
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
bryancp has joined #ruby-lang
H2H_ has joined #ruby-lang
rking has joined #ruby-lang
shevy has joined #ruby-lang
skipper has joined #ruby-lang
x0F_ has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
wallerdev has joined #ruby-lang
Luxx_ has joined #ruby-lang
rohit has joined #ruby-lang
tjadc has joined #ruby-lang
slaytanic has joined #ruby-lang
rdavila has joined #ruby-lang
davpoind has joined #ruby-lang
gnufied has joined #ruby-lang
sora_h has joined #ruby-lang
Boohbah has quit [#ruby-lang]
mikeric has joined #ruby-lang
neoesque has joined #ruby-lang
casaram has joined #ruby-lang
rking has joined #ruby-lang
shtirlic_ has joined #ruby-lang
slyphon has joined #ruby-lang
roobnoob has joined #ruby-lang
<roobnoob> Hi there. Would anyone be willing to assist me w/ a BinData question, please?
<roobnoob> I have a file containing a bunch of null-terminated strings. I can parse a single one with stringz :firstfn, but I can't grab all of them at once using array :filenames, :type => :stringz
slimfit has joined #ruby-lang
<roobnoob> Anyone use BinData to parse arrays of any type before, even?
dasibre has joined #ruby-lang
RORgasm has joined #ruby-lang
<lianj> roobnoob: BinData::Array.new(:type => :stringz, :read_until => :eof).read("A\x00B\x00") ?
rking has joined #ruby-lang
<roobnoob> My hero! I was starting to worry I was alone!
<roobnoob> THANK YOU, Lian. brb, eagerly testing
<roobnoob> er, wait... I have other stuff after the strings
<roobnoob> they're just one chunk in the file stream
<roobnoob> the next chunk, coincidentally, contains the number of strings
<lianj> does it tell you how many strings to read?
<roobnoob> Yes sir, but it appears after the strings
<lianj> oO awesome format
<roobnoob> haha, no kidding
<roobnoob> I didn't make it!
<lianj> how should you know that the next chunk is a number and not another string?
<roobnoob> It appears that after the list of filenames, there are padding nulls such that there are at least two consecutive nulls - continuing until the offset is divisible by four
<roobnoob> I am ashamed to admit that I didn't understand the relevance of the read_until param until your kind pointer
<roobnoob> I guess I can look for double-null as a sentinal, no?
Clordio_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
<roobnoob> Yay, array :filenames, :type => :stringz, :read_until => lambda { array[index].length == 0 } works. Thanks a billion, Lianj. I'm in your debt, sir.
<lianj> but then you get one more element in your array
<lianj> "a\x00b\00\00" becomes ["a","b",""]
gnufied has joined #ruby-lang
<roobnoob> Yeah. That's unfortunate, but not a deal-breaker. Or is there a more elegant way to handle it?
<lianj> maybe, but i found no other :)
<roobnoob> fair enough... I'm happy enough to chop the array - it's a junk-byte anyway
<roobnoob> It would be nice if you could avoid picking up that last element, though... I'm not yet sure how I'll handle the variable-length pads
jarred has joined #ruby-lang
Indian has joined #ruby-lang
mbriggs has joined #ruby-lang
Joeysomo has joined #ruby-lang
rking has joined #ruby-lang
imperator has joined #ruby-lang
<drbrain> roobnoob: is there seek or rewind?
<roobnoob> hrm.... the parser takes an IO object
<roobnoob> er, I'm wrong. It takes a binary string, as returned by File.binread
<neilc> zenspider: around?
rking_ has joined #ruby-lang
Indian_ has joined #ruby-lang
Indian_ has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
brianpWins has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine> Anybody ever use banister's DevIL wrapper?
rking_ has joined #ruby-lang
rking has joined #ruby-lang
<imperator> nope
<andkerosine> Bummer.
<andkerosine> I'm using the low-level interface to IL for speed, but ToBlob returns something different every time I call it, even when the FromBlob data is the same.
<andkerosine> Just doesn't make any sense. : /
Indian has joined #ruby-lang
<imperator> line 292 ff.
<imperator> looks like it returns a string
<andkerosine> And it does.
<andkerosine> But it's a different string each time.
<imperator> but you're saying the string it returns is different every time?
<imperator> ah, ok
<imperator> without knowing more about what ilGetData() does i cannot comment
rking has joined #ruby-lang
<andkerosine> Fair enough.
<andkerosine> Thanks for having a look.
<andkerosine> I imagine it's the pointer arithmetic that's going awry, no?
<imperator> the hard coded 4? could be
<andkerosine> Well, I'm making sure to pass in an RGBA value.
<andkerosine> IL.FromBlob "\XFF\x00\x00\xFF", 1, 1
<andkerosine> IL.ToBlob # => \xA\xA\xA\xFF
<andkerosine> Where A is always the same hexadecimal number, but different with each run.
Banistergalaxy has joined #ruby-lang
<andkerosine> Hm.
<andkerosine> Changing the FF in FromBlob results in an FF in ToBlob.
<andkerosine> Really, really odd. I suppose I'll just use the high-level API...
<imperator> yeah, was going to suggest that if it was possible
<imperator> i would submit a bug report
<imperator> author is usually around here, too i think
<andkerosine> Mm-hmm. I see him almost every time I'm in... except when I run into trouble with one of his libraries. : )
<andkerosine> Banistergalaxy: Oh, hai.
rking_ has joined #ruby-lang
dr0id has joined #ruby-lang
tonesfrommars has joined #ruby-lang
takaokouji has joined #ruby-lang
krz has joined #ruby-lang
gnufied1 has joined #ruby-lang
takaokouji has joined #ruby-lang
gnufied2 has joined #ruby-lang
andkerosine has quit [#ruby-lang]
andkerosine has joined #ruby-lang
<erikh> hello internet
<andkerosine> Internet.index(#ruby-lang)
rking_ has joined #ruby-lang
<erikh> that's pretty nerdy
gnufied has joined #ruby-lang
<rue> A bit imprecise maybe
Natch| has joined #ruby-lang
vpamulap has joined #ruby-lang
mikeric has joined #ruby-lang
headius has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
casaram has joined #ruby-lang
Natch has joined #ruby-lang
savage- has joined #ruby-lang
io_syl has joined #ruby-lang
lsegal has joined #ruby-lang
<imperator> erikh, hello, this is internet
<erikh> internet I have a problem
<erikh> my cat does not pee in the box
looopy has joined #ruby-lang
rking_ has joined #ruby-lang
<erikh> does anyone know offhand if ERB#result accepts a proc in 1.8.7 like it does in 1.9.3?
<erikh> generating docs for 1.8.7 now, just hoping someone could save me some time.
gix has joined #ruby-lang
* imperator has no idea
<imperator> as for the cat, most cats usually get the idea very quickly once you set them in a litterbox, so i'm not sure
<imperator> unless it's an old cat in which case...senile
rohit has joined #ruby-lang
mitch45 has joined #ruby-lang
yumike has joined #ruby-lang
<imperator> internet out
havenn has joined #ruby-lang
Joeysomo has joined #ruby-lang
brianpWins has joined #ruby-lang
WillMarshall has joined #ruby-lang
qz has joined #ruby-lang
rking_ has joined #ruby-lang
yxhuvud has joined #ruby-lang
rking has joined #ruby-lang
|Vargas| has joined #ruby-lang
rking has joined #ruby-lang
mikeric has joined #ruby-lang
WillMarshall has joined #ruby-lang
dfr|mac has joined #ruby-lang
andkerosine has quit [#ruby-lang]
Guest81617 has joined #ruby-lang
x0F__ has joined #ruby-lang
pygmael has joined #ruby-lang
RORgasm has joined #ruby-lang
Defusal has joined #ruby-lang
yugui has quit [#ruby-lang]
charper has joined #ruby-lang
brianpWins has joined #ruby-lang
rking has joined #ruby-lang
davpoind has joined #ruby-lang
dc5ala has joined #ruby-lang
robotmay has joined #ruby-lang
rking has joined #ruby-lang
rking has joined #ruby-lang
rking has joined #ruby-lang
JohnBat26 has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
<Defusal> does anyone know of a way to set the default for all new IO to close_on_exec = true?
sandbags has joined #ruby-lang
Joeysomo has joined #ruby-lang
rking has joined #ruby-lang
toretore has joined #ruby-lang
Jan_ has joined #ruby-lang
pygmael has joined #ruby-lang
seoaqua has joined #ruby-lang
<Defusal> can anyone help me try pinpoint roughly where this hard crash i'm getting is?
<Defusal> i have no experience with gdb, but i loaded the ruby script in it, and it doesn't give any useful info near the crash
<Defusal> all it says after the crash message is: Program received signal SIGABRT, Aborted.
<Defusal> 0x00007ffff6f8b3a5 in raise () from /lib/x86_64-linux-gnu/libc.so.6
<seoaqua> i've installed bundler within rvm ruby 1.9.2, but there is nothing in 'gem list', so i cant run 'bundle install'. what should i do
futurechimp has joined #ruby-lang
francisfish has joined #ruby-lang
<rue> erikh: Is this new behaviour, new box, new litter, or new cat? I'd try A) changing the litter from crystal/clay/wood/paper to one of the others, B) changing the box type (some hate open, or closed, or triangular, or whatever) If it's new behaviour, vet might be a good idea just in case.
<Asher> also - cats often piss outside the box bc either 1. its' not clean enough or 2. you're not giving them enough attention (then they usually find your shoe or something)
nofxx has joined #ruby-lang
pcboy_ has joined #ruby-lang
<yorickpeterse> rue: ...
<yorickpeterse> seoaqua: did you actually tell it to use RVM instead of the system ruby?
<yorickpeterse> seoaqua: `rvm use NAME --default`
<yorickpeterse> where NAME is 1.9.2, 1.9.3, etc
RORgasm has joined #ruby-lang
zmack has joined #ruby-lang
<seoaqua> yorickpeterse, maybe its rbenv that conflicts, let me check,thanks
alindeman has joined #ruby-lang
Skif has joined #ruby-lang
uniqanomaly_ has joined #ruby-lang
cczona has joined #ruby-lang
CoverSli1e has joined #ruby-lang
s0ber has joined #ruby-lang
yango has joined #ruby-lang
bryanl has joined #ruby-lang
dmathieu has joined #ruby-lang
Dreamer3 has joined #ruby-lang
fvollero has joined #ruby-lang
_ko1 has joined #ruby-lang
flatliner has joined #ruby-lang
mahlon has joined #ruby-lang
thorncp has joined #ruby-lang
charper has joined #ruby-lang
thrcka has joined #ruby-lang
mitchty has joined #ruby-lang
<yorickpeterse> You never mentioned rbenv was installed
<yorickpeterse> And yes, it could be that it conflicts
io_syl has joined #ruby-lang
tjadc has joined #ruby-lang
<shevy> hehe cool
<shevy> using both rvm and rbenv at the same time
kitallis has joined #ruby-lang
rking has joined #ruby-lang
<seoaqua> shevy, the manual was confused :(
thrcka has joined #ruby-lang
rking has joined #ruby-lang
gnufied has joined #ruby-lang
workmad3 has joined #ruby-lang
nofxx has joined #ruby-lang
rking has joined #ruby-lang
rking has joined #ruby-lang
thrcka has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
rking has joined #ruby-lang
rking has joined #ruby-lang
robotmay has joined #ruby-lang
<rking> Defusal: It only has that one line? Nothing before it?
thrcka has joined #ruby-lang
<erikh> man guys, I wasn't seriuos
rippa has joined #ruby-lang
Xzyx987X has joined #ruby-lang
retro|cz has joined #ruby-lang
<injekt> install all the ruby version managers!
WillMarshall has joined #ruby-lang
<andrewvos> Can someone please explain to me this "an" shit on twitter?
<injekt> andrewvos: huh?
conceal_rs has joined #ruby-lang
<andrewvos> injekt: "an horse"
<injekt> i must be following the wrong people
<Asher> is there a reason that Regexp.new( 'regexp' ) === Regexp or /regexp/ === Regexp evaluate to false?
<rippa> Asher: Regexp === //
<andrewvos> rue: Enlighten me please ^^
<Asher> ah i see
solars has joined #ruby-lang
<Defusal> Asher: /foobar/.is_a? Regexp
<Asher> ya i was wondering about case tho
<Defusal> yea, it's a little odd compared to most classes
<erikh> so, /foo/ === "foo"
<erikh> instance === is different methinks for purposes of case
<erikh> where Regexp.=== is probably just Class.====
<erikh> bah
<erikh> my ailing fingers.
<erikh> andrewvos: an andrewvos
<Asher> oh i see my problem
<Asher> had nothing to do with my question - namespace was getting stomped for Regexp by local module named Regexp
<Asher> ::Regexp fixed it
<erikh> ha
<erikh> although, /foo/ === Regexp is still false
<Asher> yes but it works in case which is the reason i was asking
<erikh> orly?
<rippa> he used it implicitly
<rippa> with case/when
<Asher> case /regexp/ ; when Regexp
<Asher> that works
<rippa> and there it works with different order
<erikh> yeah; I'm just having brain trouble I guess, I thought it went in the other direction
<erikh> right
<Asher> yea
<yorickpeterse> ttps://github.com/puma/puma/issues/12 Somebody tell me why you'd want to support Rails 2
<yorickpeterse> + ^h
<erikh> lots of people are still on rails 2.
<andrewvos> erikh: :/
<yorickpeterse> That's a problem in my opinion, not something you have to keep supporting for years and years to come
Nss has joined #ruby-lang
<erikh> lots of companies can't spare the resources for a near rewrite
<erikh> moving from 2.3 -> 3.0 comes close to that
<erikh> and that's before you get into 3.1 and 3.2
<injekt> heh
<erikh> well it's the truth
<erikh> injekt: also how are you
<injekt> erikh: I'm good thanks, how're you? zomgvacation soon amirite?
<erikh> on it now
<erikh> decided it was best to just check out a little early
<injekt> oh nice
<erikh> I was.... antsy for it to start.
<injekt> :)
<injekt> you got much planned for it?
<erikh> been beating the hell out of my editor as a result
<erikh> I did, but the plans fell through unfortunately
<erikh> so it's a staycation
<erikh> my wife's going out of town so I'll have the house to myself
<erikh> it's gonna be underwear and cheetos all week
<injekt> woop
<andrewvos> yay
nofxxx has joined #ruby-lang
apeiros_ has joined #ruby-lang
judofyr has joined #ruby-lang
Xzyx987X has joined #ruby-lang
d3vic3 has joined #ruby-lang
ixx has joined #ruby-lang
yumike has joined #ruby-lang
workmad3 has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
RORgasm has joined #ruby-lang
seoaqua has joined #ruby-lang
<seoaqua> could someone help me with rvm,pls?
<seoaqua> gem install bundler
<seoaqua> WARNING: You don't have /home/aqua/.gem/ruby/1.9.1/bin in your PATH,
<seoaqua> gem executables will not run.
<seoaqua> Successfully installed bundler-1.1.3
<seoaqua> 1 gem installed
<seoaqua> Installing ri documentation for bundler-1.1.3...
<seoaqua> Installing RDoc documentation for bundler-1.1.3...
<seoaqua> [aqua@pc octopress]$ bundle install
<seoaqua> ERROR: Gem bundler is not installed, run `gem install bundler` first.
<injekt> seoaqua: #rvm might be able to helper quicker
<injekt> help*
<seoaqua> injekt, thanks
robotmay has joined #ruby-lang
<erikh> I love chef
havenn has joined #ruby-lang
gjaldon has joined #ruby-lang
nofxx has joined #ruby-lang
<injekt> erikh: why?
<erikh> it's just amazing when you set everything up and it just fucking does it
<erikh> there's so much to be done in server automation, so many good ideas
<erikh> being able to type 'sudo chef-client' and walk away for 20 minutes and come back to a fully functional server is amazing.
<erikh> all these moving parts just working together; that's what software is about for me
<erikh> anyhow rambling
allan_ has joined #ruby-lang
thrcka has joined #ruby-lang
gokul has joined #ruby-lang
<allan_> /msg nickserv help
kitallis has joined #ruby-lang
shtirlic has joined #ruby-lang
kaiwren has joined #ruby-lang
Radium has joined #ruby-lang
sandbags has joined #ruby-lang
morozovm has joined #ruby-lang
dhruvasagar has joined #ruby-lang
WillMarshall has joined #ruby-lang
francisfish has joined #ruby-lang
kashyapkmbc has joined #ruby-lang
rue has joined #ruby-lang
rohit has joined #ruby-lang
kitallis has joined #ruby-lang
zz_wasnotrice has joined #ruby-lang
My_Hearing has joined #ruby-lang
seanstickle has joined #ruby-lang
woollyams has joined #ruby-lang
gnufied has joined #ruby-lang
gokul has joined #ruby-lang
kitallis has joined #ruby-lang
shtirlic has joined #ruby-lang
gokul has joined #ruby-lang
WillMarshall has joined #ruby-lang
brushbox has joined #ruby-lang
lele|w has joined #ruby-lang
headius has joined #ruby-lang
Spooner has joined #ruby-lang
kaiwren has joined #ruby-lang
gokul has joined #ruby-lang
RORgasm has joined #ruby-lang
fold has joined #ruby-lang
morozovm has joined #ruby-lang
mark_locklear has joined #ruby-lang
kaiwren has joined #ruby-lang
<Defusal> hmm
<Defusal> i seem to remember being able to define top level methods with constant names, is this still possible in 1.9.3? it doesn't seem to work
<judofyr> Defusal: sure.
<judofyr> you just need () or arguments to call them
<judofyr> Foo(1)
<judofyr> Foo()
<judofyr> but just "Foo" doesn't work
<Defusal> ahh
<Defusal> damn, that kinda defeates the purpose :P
<Defusal> i'll just use a module :)
<Defusal> thanks
Clordio_ has joined #ruby-lang
headius has joined #ruby-lang
rohit has joined #ruby-lang
morozovm has joined #ruby-lang
m3nd3s has joined #ruby-lang
takaokouji has joined #ruby-lang
WillMarshall has joined #ruby-lang
m3nd3s has joined #ruby-lang
m3nd3s has joined #ruby-lang
Radium has joined #ruby-lang
<injekt> erikh: is your gist a generic script you use?
m3nd3s has joined #ruby-lang
lsegal has joined #ruby-lang
m3nd3s has joined #ruby-lang
kaiwren has joined #ruby-lang
seanstickle has joined #ruby-lang
seanstickle has joined #ruby-lang
dous has joined #ruby-lang
Pupeno_W has joined #ruby-lang
<Pupeno_W> Is there anything wrong in doing file1.write(file2.read)? Because I'm getting the error Encoding::UndefinedConversionError ("\xFF" from ASCII-8BIT to UTF-8), which I find it surprising because I just want to copy the binary data, not interpret any of it.
chimkan has joined #ruby-lang
<matled> Pupeno_W: see the encoding options available with IO#new, set the encoding to binary and you should be fine. additionally you might want to use a loop for large files (the whole content of the file is read first and then written)
tommyvyo has joined #ruby-lang
Sailias has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
<Pupeno_W> matled: ah… file modes… forgot about it. Thanks… it seems though that Tempfiles can't be binary?
casaram has joined #ruby-lang
<injekt> Pupeno_W: you're using TempFile ?
<Pupeno_W> injekt:
<Pupeno_W> injekt: yes.
<Pupeno_W> file.binmode seems to do it.
<injekt> yeah you can call any File methods on TempFile is just doesn't have the same method sigs for open/new
Joeysomo has joined #ruby-lang
rue has joined #ruby-lang
virunga has joined #ruby-lang
justinxreese has joined #ruby-lang
enebo has joined #ruby-lang
Radium has joined #ruby-lang
Stalkr_ has joined #ruby-lang
codewrangler has joined #ruby-lang
dv310p3r has joined #ruby-lang
dragonkh has joined #ruby-lang
<Pupeno_W> injekt: initially I passed a "wb" argument and since it didn't complaint I thought it was ok…. it wasn't.
bryancp has joined #ruby-lang
chris2 has joined #ruby-lang
d3vic3 has joined #ruby-lang
RORgasm has joined #ruby-lang
sora_h has joined #ruby-lang
mistym has joined #ruby-lang
bglusman has joined #ruby-lang
rippa has joined #ruby-lang
outoftime has joined #ruby-lang
casaram has joined #ruby-lang
Spooner has joined #ruby-lang
RORgasm has joined #ruby-lang
bryancp has joined #ruby-lang
futurechimp has joined #ruby-lang
msisk has joined #ruby-lang
davpoind has joined #ruby-lang
<apeiros_> no, but it would be considered sane in order to clean up coupling
<apeiros_> rake is missing utilities there IMO
<apeiros_> it should be possible to define requires as dependencies, which could then be reported properly
<apeiros_> (both, when running rake -T, and when trying to run the task in question)
<andrewvos> apeiros_: Yeah I agree
<andrewvos> It's just we have a very large rake file
<andrewvos> And it takes a while to laod :/
<andrewvos> load*
<apeiros_> andrewvos: maybe I wasn't clear :)
<apeiros_> I think it's a good idea to do it
<andrewvos> Oh right :)
<apeiros_> I just think there's a more important reason for it than performance ;-)
<andrewvos> hehe
<andrewvos> Ohh ok
<apeiros_> and I also think that it's sad that we have to do it this way, instead of rake providing proper facilities.
<andrewvos> Yeah
<andrewvos> Well
<andrewvos> I'm not sure about that
<andrewvos> Seems like too much complexity to add the proper facilities to me
<andrewvos> I can see myself saying "what the shit, why can't I just use require like normal people? fuck you rake!!!!"
joshkraemer has joined #ruby-lang
alindeman has joined #ruby-lang
rippa has joined #ruby-lang
Sailias has joined #ruby-lang
rdavila has joined #ruby-lang
<apeiros_> andrewvos: if a rake taskfile would only be loaded if that task must be executed, then you could
<apeiros_> but usually rake taskfiles get all loaded
<apeiros_> hm, that just gave me a nice idea (not for ruby, though)
<andrewvos> apeiros_: But they need to be loaded cause of the way rake works though
kaiwren has joined #ruby-lang
<andrewvos> apeiros_: Can't even put the requires inside the namespace block :/
<andrewvos> So there will be some duplication of reqires
<andrewvos> reqires*
<apeiros_> andrewvos: actually no, they don't need to be loaded
<andrewvos> apeiros_: So how do you propose --tasks works then?
<apeiros_> you could have 'desc "foo"; task :foo; …' with all task descriptions in one file
<apeiros_> but it'd still require stupid tooling
<apeiros_> i.e., that descs file is paying only half of the bill :-/
<apeiros_> you still need to ensure that the actual task definition gets loaded when you want to run it
<andrewvos> yeah
<andrewvos> true true
<apeiros_> you could read ARGV, unless rake destructively parses it
<apeiros_> maybe rake makes the task to be run accessible
<apeiros_> if so, you could translate it to a require by convention
<apeiros_> e.g. foo:bar --> require 'rake_tasks/foo/bar'
<andrewvos> hehe
<andrewvos> Ok too much work zone quickly being approached
<apeiros_> so it'd just be: require "rake_tasks/#{current_task.tr(':', '/')}" # in Rakefile
<apeiros_> I might even try that
CoverSlide has joined #ruby-lang
Rabbitt has quit [#ruby-lang]
havenn has joined #ruby-lang
dejongge has joined #ruby-lang
deryl has joined #ruby-lang
olesu has joined #ruby-lang
crudson has joined #ruby-lang
wyhaines has joined #ruby-lang
paul0 has joined #ruby-lang
havenn has joined #ruby-lang
<andrewvos> Right so every time I cd into my project directory rvm reinstalls 1.9.3. Is this to be expected?
<andrewvos> (rhetorical in case not obvious enough)
m3nd3s has joined #ruby-lang
jmeeuwen has joined #ruby-lang
<andrewvos> Contents of .rvmrv: rvm 1.9.3
lsegal has joined #ruby-lang
adambeynon has joined #ruby-lang
io_syl has joined #ruby-lang
<workmad3> andrewvos: when was the last time you updated RVM?
<andrewvos> workmad3: That's waht I'm doing now
<andrewvos> workmad3: Should I be using head or stable?
<workmad3> andrewvos: it's possible you've just hit a bug there, where rvm is set up to automatically install ruby if it isn't installed, and it somehow loses that it has that ruby version installed :)
<workmad3> andrewvos: I use head generally... but if you do that often then you're more likely to hit bugs
<workmad3> andrewvos: whereas stable won't update as often but stable releases should be well... more stable :)
<andrewvos> heh
mbriggs has joined #ruby-lang
<andrewvos> Anyway, fourth ruby install today. Not sure how I feel about that.
bglusman has joined #ruby-lang
<andrewvos> Right sorry to paste two twitter links in here but does anyone know something that does this: https://twitter.com/#!/AndrewVos/status/185745102340239361
havenn has joined #ruby-lang
<andrewvos> here: Installing gems from http://rubygems.org is very slow on CI. Is there a way store gems locally and install them with bundler?
<andrewvos> Disregard twitter link.
* andrewvos shuts up now
casaram has joined #ruby-lang
<mbriggs> andrewvos: bundle package
<andrewvos> mbriggs: LOVE YOU
<shevy> ok ok enough with the kissing
<mbriggs> andrewvos: :)
wallerdev has joined #ruby-lang
brianpWins has joined #ruby-lang
apeiros_ has joined #ruby-lang
havenn has joined #ruby-lang
kvirani has joined #ruby-lang
hackeron_ has joined #ruby-lang
futurechimp has joined #ruby-lang
jxie has joined #ruby-lang
havenn has joined #ruby-lang
casaram has joined #ruby-lang
dr0id has joined #ruby-lang
dr0id has joined #ruby-lang
m3nd3s has joined #ruby-lang
dous has joined #ruby-lang
<singpolyma> Is there an easy way to tell ruby "force this number to a FixNum (32-bit int instead of Integer)"
looopy has joined #ruby-lang
<Mon_Ouie> Fixnum != 32-bit integer
retro|cz has joined #ruby-lang
<singpolyma> Mon_Ouie: that's why I specified the extra restriction
<workmad3> singpolyma: what happens if you're on a 64bit ruby?
<Mon_Ouie> It's used for a restricted set of integer, but what it actually is is implementation defined. In MRI, it's pointer_size - 1 bit
<Mon_Ouie> workmad3: Even on a 32bit ruby, fixnums are only 31 bits.
Indian has joined #ruby-lang
futurechimp has joined #ruby-lang
havenn has joined #ruby-lang
<apeiros_> singpolyma: what's the purpose?
<singpolyma> apeiros_: I'm doing constant folding in a compiler, so I want the behaviour to be the same as it will be on the machine when the machine does math
<apeiros_> you can do bit operations on integers in ruby too, e.g. &0xffffffff to consider only the first 32 bit
casaram has joined #ruby-lang
<apeiros_> but that doesn't map to Fixnums vs Bignums
<apeiros_> (there are no direct instances of Integer, it's Fixnum or Bignum)
m3nd3s has joined #ruby-lang
robbrit has joined #ruby-lang
<singpolyma> so, [n].pack('N').unpack('N').first will probably work in my case, but it's a bit gross
voker57 has joined #ruby-lang
<apeiros_> singpolyma: what's wrong with &?
SuperTaz_work has joined #ruby-lang
<singpolyma> apeiros_: ?
<apeiros_> 18:07 apeiros_: you can do bit operations on integers in ruby too, e.g. &0xffffffff to consider only the first 32 bit
<singpolyma> hmm, that might be better
m3nd3s has joined #ruby-lang
<apeiros_> um, yeah, "might"… *eyeroll*
<singpolyma> seems to work as well as the other one did
wmoxam has joined #ruby-lang
m3nd3s has joined #ruby-lang
davpoind has joined #ruby-lang
<singpolyma> oh, nope, that forces negative numbers to unsigned
<singpolyma> so, back to pack it is :)
butchanton has joined #ruby-lang
RORgasm has joined #ruby-lang
<apeiros_> o0
florentg2 has joined #ruby-lang
<any-key> pack is a weird command
seanstickle has joined #ruby-lang
butchanton has quit [#ruby-lang]
butchanton has joined #ruby-lang
<apeiros_> pack is awesome
<any-key> oh goodness, opening my iTunes library XML file in nokogiri is a GREAT way to eat through RAM
<any-key> maybe I should use a SAX parser instead...
<apeiros_> haha
<any-key> 5 minutes later it's still going
<any-key> almost all 8gigs of RAM are being used
<singpolyma> why is 17197 / (5479 * -11314) -1 in ruby? I would expect 0
<bougyman> irb(main):001:0> 17197 / (5479 * -11314)
<bougyman> => (-17197/61989406)
<any-key> it's not floating point; do this instead: (17197.to_f / (5479 * -11314)).floor
<bougyman> when you include mathn and fraction.
<any-key> shit, floor is -1 :P
<any-key> use ceil instead
<bougyman> or .to_i
sandbags has joined #ruby-lang
erics has joined #ruby-lang
<bougyman> jjor .round
tenderlove has joined #ruby-lang
musl has joined #ruby-lang
<lianj> python is fun, it gives you a float even though you give it only ints
rue has joined #ruby-lang
<Defusal> "python is fun"
<Defusal> kinda like snakes and ladders :P
rue has joined #ruby-lang
<any-key> harharhar
musl has joined #ruby-lang
nofxx has joined #ruby-lang
casaram has joined #ruby-lang
savage- has joined #ruby-lang
slimfit has joined #ruby-lang
cldwalker has joined #ruby-lang
dhruvasagar has joined #ruby-lang
m3nd3s_ has joined #ruby-lang
macmartine has joined #ruby-lang
<Mon_Ouie> lianj: I'm not sure it's inherently wrong. Many beginners wonder why 3 / 4 == 0 in languages that use / for integer division.
m3nd3s has joined #ruby-lang
<apeiros_> Mon_Ouie: you at euruko or railsberry?
<Mon_Ouie> Nope
macmartine has joined #ruby-lang
<apeiros_> Mon_Ouie: :(
<apeiros_> any-key: I prefer .fdiv
<apeiros_> it's IMO clearer about the intent (and as a side-benefit also slightly more efficient)
<any-key> hm?
<any-key> never heard of it
<apeiros_> any-key: instead of num.to_f / other --> num.fdiv(other)
<any-key> oh neat
<any-key> that is better...
<apeiros_> yeah, it's only in ruby as of 1.8.7 iirc
<any-key> I refuse to support anything < 1.8.7
<any-key> also 1.8.7 doesn't have each_byte which is stupid :(
<Defusal> i dont care for anything pre 1.9
<Defusal> 1.8 was too slow
<any-key> agreed
ascarter has joined #ruby-lang
achiu has joined #ruby-lang
ddfreyne has joined #ruby-lang
Torrieri has joined #ruby-lang
Torrieri has joined #ruby-lang
zmack has joined #ruby-lang
m3nd3s has joined #ruby-lang
urbanmonk has joined #ruby-lang
jordan` has joined #ruby-lang
olesu has joined #ruby-lang
wdperson has joined #ruby-lang
lsegal has joined #ruby-lang
looopy has joined #ruby-lang
mrsolo has joined #ruby-lang
jmontross has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
kurko_ has joined #ruby-lang
publicvoid has joined #ruby-lang
tjadc has joined #ruby-lang
olesu has joined #ruby-lang
Skif has joined #ruby-lang
robbyoconnor has joined #ruby-lang
casaram has joined #ruby-lang
musl has joined #ruby-lang
comboy has joined #ruby-lang
imperator has joined #ruby-lang
<imperator> greetings programs
cirwin has joined #ruby-lang
qpingu has joined #ruby-lang
olesu has joined #ruby-lang
<cirwin> Is it possible to create new Encodings?
<TTilus> talking about division operator, imo 1 / 3 should => Rational(1, 3)
chimkan has joined #ruby-lang
<rue> It is
<TTilus> 1 / 3 # => 0
<TTilus> rue: wheres the catch?
SuperTaz_work has joined #ruby-lang
jmontross has joined #ruby-lang
<imperator> hm, i thought it did if you require'd rational, but it doesn't seem to be the case, at least in 1.9
<TTilus> rue: or were you talking to cirwin?
<TTilus> imperator: tried 1.8 and 1.9 and it does not
Xzyx987X_ has joined #ruby-lang
<matled> TTilus: so use 1.to_r / 3 if you want to use rationals
<cirwin> it's quite useful to be able to do integer arithmetic sometimes
<TTilus> matled: yes, yes
<cirwin> but i agree it should be easier to do normal arithmetic
<TTilus> imperator: imo it would be pretty much summoning nausal daemons if requiring rational really changed how int/int works, require 'rational' deep in third party lib and *bam* your nice integer arithmetic is ruined ;)
chrismanderson has joined #ruby-lang
<imperator> i think it used to
<TTilus> oh my
<TTilus> the way it is now is definitely better
<chrismanderson> drbrain: howdy - wanted to know the process of submitting patches/edits to ruby documentation
<apeiros_> imperator: it used to, but not by requiring rational
<apeiros_> it was require 'mathn' which did it
<imperator> ah, that's right
<apeiros_> and yes, it was a bad idea
fgomez has joined #ruby-lang
Sailias has joined #ruby-lang
Sailias_ has joined #ruby-lang
kvirani has joined #ruby-lang
benanne has joined #ruby-lang
CoverSli1e has joined #ruby-lang
<Asher> what's the best way to create every combination made from 1 element selected from each provided set? so if we have A( 1, 2, 3 ) , B( 1 ), C( 1, 2 ) naming sets A, B, C with numbered member elements, I want A1B1C1, A1B1C2, A2B1C1, A2B1C2, A3B1C1, A3B1C2
<apeiros_> Asher: take a look at the newer enumerable methods
<apeiros_> there are a couple for combinations/permutations
<rue> #combination or #permutation, without looking at the particulars
<rue> Or rather, did you rule those out?
<Asher> yea those seem to operate on shallow arrays not across multiple arrays
<Asher> ie [1, 2, 3].combination( 2 ) => 1, 2 2, 3, 1, 3
mattonrails has joined #ruby-lang
chimkan_ has joined #ruby-lang
<rippa> Asher: #product
chimkan has joined #ruby-lang
<Asher> ah! awesome
<Asher> thanks rippa!
Swimming_Bird has joined #ruby-lang
Tukeke has joined #ruby-lang
florentg2 has joined #ruby-lang
* imperator suggests looking at the 'set' library to see what it offers, too
<Asher> #product was exactly what i needed
<drbrain> chrismanderson: hi
<drbrain> chrismanderson: if you like github, you can create a pull request for ruby/ruby
Jake232 has joined #ruby-lang
<chrismanderson> i do like github so that's what I'll do
<Jake232> array = [*[1,2,3]] #=> [1,2,3]
<Jake232> Whats the * called, in this case?
<chrismanderson> documentation occurs in the actual c files, right? and those c files are parsed via rdoc to generate the actual html pages?
<mistym> Jake232: That's the splat operator.
<drbrain> chrismanderson: if you want to be extra nice, you can create an issue and point to your pull request https://bugs.ruby-lang.org/projects/ruby-trunk/issues/new
<drbrain> but that's not necessary, since I get pull request notifications
nofxx has joined #ruby-lang
<chrismanderson> ok cool, good to know
<chrismanderson> thanks!
<drbrain> chrismanderson: correct, documentation occurs in the actual C files
<drbrain> chrismanderson: `make` will build ri data
<drbrain> if you want to build HTML from a ruby checkout you can `rdoc -o html path`
phaedrix has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
erics has joined #ruby-lang
wallerdev has joined #ruby-lang
srbaker has joined #ruby-lang
macmartine has joined #ruby-lang
tr-808 has joined #ruby-lang
internet_user has joined #ruby-lang
dejongge has joined #ruby-lang
publicvoid has joined #ruby-lang
Radium has joined #ruby-lang
zmack has joined #ruby-lang
l0st1 has joined #ruby-lang
cirwin has joined #ruby-lang
robbyoconnor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
jmontross has joined #ruby-lang
casaram has joined #ruby-lang
chris2 has joined #ruby-lang
<wmoxam> drbrain: nice article on OSS funding
<drbrain> wmoxam: thanks
* imperator reads
<imperator> huh, didn't realize he was being attacked
havenn has joined #ruby-lang
Indian has joined #ruby-lang
tenderlove has joined #ruby-lang
mattonrails has joined #ruby-lang
mikeric has joined #ruby-lang
bradland has joined #ruby-lang
bradland has joined #ruby-lang
<drbrain> I'd seen enough on my twitter feed to get me caremad
enebo has joined #ruby-lang
casaram has joined #ruby-lang
apeiros_ has joined #ruby-lang
deryl has joined #ruby-lang
chrismanderson has quit [#ruby-lang]
<erikh> I contributed to that
<erikh> but drbrain is right
postmodern has joined #ruby-lang
wyhaines_ has joined #ruby-lang
looopy has joined #ruby-lang
mattonrails has joined #ruby-lang
<rue> Well, hopefully there won't be overreaching in the other direction
ivanoats has joined #ruby-lang
s0ber_ has joined #ruby-lang
y3llow_ has joined #ruby-lang
jacktrik has joined #ruby-lang
imperator has joined #ruby-lang
codewrangler has joined #ruby-lang
hirotoshi has joined #ruby-lang
<imperator> erikh, tsk, task
<imperator> er, tsk
<imperator> something something
slimfit has joined #ruby-lang
jmontross has quit [#ruby-lang]
<imperator> BGG is down! I can't go on!
casaram has joined #ruby-lang
<erikh> BGG?
<imperator> boardgamegeek.com
thone has joined #ruby-lang
bglusman has joined #ruby-lang
Stalkr_ has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
tenderlove has joined #ruby-lang
paul0` has joined #ruby-lang
bryancp has joined #ruby-lang
Skif has joined #ruby-lang
tenderlove has joined #ruby-lang
deryl has joined #ruby-lang
Radium has joined #ruby-lang
burgestrand has joined #ruby-lang
kesor has joined #ruby-lang
ttilley has joined #ruby-lang
gsav has joined #ruby-lang
robbyoconnor has joined #ruby-lang
bawer has joined #ruby-lang
H2H has joined #ruby-lang
outoftime has joined #ruby-lang
bryancp has joined #ruby-lang
AndChat| has joined #ruby-lang
jarred has joined #ruby-lang
<rue> Board games are for nerds, cool people play RPGs
<kesor> cool people play Draw Something, man you're old, not cool.
rdavila has joined #ruby-lang
<rue> That's true
<rue> I tried to play it with the wife, and one of my drawing options was “omggurlz”. I stopped playing at that point.
<imperator> i quit playing rpg's after college
gregf has joined #ruby-lang
<imperator> you can sort of get a mix of rpg and boardgame with a few of them
<imperator> battlestar galactica, android, etc
<rue> I really wish Wizards would get their freaking Virtual Game Table launched. It's like 4 years late
<kesor> fuck that, Diablo III is just around the corner.
<rue> Could run some D&D for you, imperator
<imperator> not sure what that is
<imperator> no thanks, don't like role playing any more
mattonrails has joined #ruby-lang
<kesor> ruby should have a role playing game framework
<imperator> think it does....where's ged
casaram has joined #ruby-lang
<imperator> faeriemud.org
<kesor> a mud in ruby?
<imperator> yeah
<kesor> but there are no details how to connect to it anywhere on that website :(
<imperator> i think he kept it private
<imperator> gem search -r rpg reveals a few things
<rue> Actually, you strike me more as a Shadowrun guy
<imperator> heard of it, never played it
<imperator> we played ad&d in college for a few years with the same characters; that was fun
<imperator> but afterwards, just had no desire to ever do it again
<rue> kesor: Don't like Diablos, way too H&S for me
<kesor> damn, i'm a bit drunk and have this urge to re-install wow … someone pair program some ruby with me quick!
<rue> Baldur/NWN and so on all the way.
<imperator> looks like there's a mud gem called muding out there
<rue> There's Jon's TeensyMUD, too.
<rue> Tyche, if any of you used to hang out on TMC
<imperator> kesor, make love, not warcraft
<kesor> i don't like my gf THAT much
<rue> imperator: You can make love in Warcraft too
<kesor> yeah, what rue said.
<imperator> scary
bawer has joined #ruby-lang
<imperator> watched my nephew play a few times, looked kinda dull
<rue> It is, WoW's got the worst mechanics of them all.
<imperator> tried one of the big space mmorpg's once, but was utterly baffled by the interface and gave up
<rue> I liked DDO okay, the combat is more fun
<imperator> played world of tanks for a while, that was fun
<kesor> world of tanks? really? … that game completely sucks compared to wow
<imperator> it's a wildly different game from wow
<imperator> in world of tanks you hop in a tank and blow shit up
<kesor> sounds kinda the same
<imperator> in wow, you make a character and, uh, kill stuff - TOTALLY DIFFERENT
<kesor> you have tanks in wow
<deryl> there was a tank game where you fought tank on tank. battle tanks i think. similar?
casaram has joined #ruby-lang
<imperator> deryl, isn't that the old 80's video game?
<deryl> block style tanks
<deryl> imperator: yeah something like that for timeframe
<kesor> on a sinclair console?
<deryl> :shrug:
<rue> Oh, the one with either CGA *OR* EGA graphics?
brushbox has joined #ruby-lang
dous has joined #ruby-lang
<kesor> no, the one with the magnetic tape thingy that you hooked up to your tv
<rue> I always played on CGA for some reason, I think it showed something better than EGA
hirotoshi has joined #ruby-lang
<imperator> not the one i was thinking of
<kesor> cga is way too advanced
<erikh> heh
<deryl> i do miss the old galaga. on the '87 machines if you saved the last guy in the bottom 2 rows, killed everything else, and then let them shoot at you and stayed alive for something like 2 minutes, they would eventually stop shooting at you but the shot sound would still be made. if you killed them once that happened, NONE of the waves going forward would shoot at you.
<erikh> my stepdad spent an absurd amount of money on a 286/16 with EGA graphics
Sailias has joined #ruby-lang
<erikh> it had a turbo switch!
<deryl> bug in the code
<deryl> used to rack up some MAD points hehe
<kesor> just idkfa the mofo
<imperator> deryl, ever watch the show chuck?
<deryl> imperator: yeah. few eps. not all
<imperator> just made me think of the missile command episode
* deryl cocks his head trying to conjure up an image of it.
<deryl> not sure if i watched that one
<imperator> jeff, the sorta crazy looking creepy dude that works at the store, was once a missile command champion
<imperator> there's some top secret info embedded in one of the machines, and they use him to get it or something
<erikh> kesor: haha
<deryl> hehe. sorta creepy looking dude., good description :)
<imperator> pretty funny episode in general
<erikh> idkfa was godmode right? and iddqd was infinite ammo?
<erikh> it's been too long.
<erikh> been playing quake live lately though, that's a blast.
<rue> erikh: The turbo switch was great
<deryl> what was the one that let you fly through walls and stuff?
<deryl> idnoclip?
<erikh> idspispopd
<imperator> i think i played quake, or doom or one of those
<deryl> lol! the fact you remembered that..
<deryl> i used to like doom
<erikh> oh man
<deryl> that and castle wolfenstein
<imperator> i just remember using that gun that could shoot through walls, but you had to spend a second or two warming it up
<deryl> oh the god gun
<erikh> so, we were too cheap to buy a NMC or LAN gear (which was still expensive) to play together
ttilley has joined #ruby-lang
<rue> Although we were lucky, dad worked in data systems for the environment ministry (and/or was an international spy), so we had a Mac since '85 maybe, and moved to an Osborne 386 at some point
<deryl> shot the orb
<erikh> so we figured out if we ran a rj-45 line between two modems
<erikh> and turned carrier checking off
<erikh> and dialed with no number
<erikh> we could get them to negotiate
<imperator> and?
<erikh> doom heaven
<kesor> oh yeah, just bought diablo3 pre-order and they have the huge 9999gb download ready right now. nice.
<deryl> Diablo was too boring to me. took too damned long :)
<deryl> i do miss Descent Freespace though
<kesor> diablo3 seems really impressive though
<deryl> and the regular Descent
<kesor> descent was awesome
<erikh> I'll probably get it, but I don't have high hopes.
<erikh> definitely no multiplayer. that is a pit.
<kesor> they put into diablo3 all the stuff they learned from warcaraft
<deryl> i was going to get ME3 but.. been reading too many negatives about it. I never played the series so maybe it won't matter to me
<deryl> one game series i really and truly miss was Mech Warriors
<deryl> that entire series rocked
<erikh> ME3 was pretty good
<erikh> the ending a lot of people didn't like
<imperator> i played allegiance for a while, that was fun
<erikh> the gameplay was good regardless.
<erikh> it gets *really* hard near the end though.
<deryl> i might get it then. i haven't played any in the series so the ending probably won't matter to me.
<imperator> deryl, yeah, MW: Mercenaries a lot
<deryl> but i do need to get and play Portal 1. I have 2
<deryl> imperator: oh yeah. loved my Timber Wolf.
<deryl> man you could seriously fuck some shit up with a TW :)
<imperator> they have a battletech center up the street :)
<deryl> hahaha niiice
<imperator> only went once
<imperator> but it was fun
<deryl> you evener done laser tag irl?
<slyphon> dominikh: w00t! weechat wrapper :D
<imperator> think i did it once a long time ago; did paintball once, too
<deryl> that shits a blast. i go with my nieces and nephew occasionally
<slyphon> dominikh: i wrote a little bit of one too :)
* slyphon waves to imperator
<imperator> slyphon, howdy
<dominikh> slyphon: mine is old and unmaintained though
<deryl> oh dude, i love paint balling. my nephew and i would play for hours at my sister's place. she has a HUGE ass backyard. like a 100 acre backyard
<imperator> perfect for it
<deryl> definitely
<deryl> fucker's slick too :)
<deryl> he's got hideaways all over the place
mikeric has joined #ruby-lang
<slyphon> dominikh: mine is older and unmaintaineder
<imperator> i didn't have that great of a time, because it was really muggy that day and my goggles kept fogging up
<deryl> spit is about the only thing you can do then
<dominikh> slyphon: someone once offered to maintain it for me, pushed once, never showed back
ericmuyser has joined #ruby-lang
<deryl> cripes we had 2 weeks of beautiful weather, and now i got snow covering my backyard
<slyphon> ha
<deryl> that sucks
robotmay has joined #ruby-lang
<imperator> where?
<deryl> Port Elgin, Ontarip
<deryl> err s/p/o/
<deryl> came out of friggin nowhere
<imperator> well, you *are* in canada ;)
<deryl> yeah yeah :p
<imperator> heck, i've seen snow in may in wisconsin
<deryl> well we shoudl really be coverd in snow. we got a flash spring
ericmuyser has joined #ruby-lang
<imperator> deryl, we're trying to warm you guys up as fast as we can!
<deryl> then a couple of days ago it started cooling again, killed off a bunch of my flowers
<deryl> lol, get crackin!
<slyphon> dominikh: any clue what weechat this worked with?
<deryl> and yes, during summer and late spring i'm rarely on the computers. i'm out in my flower gardens. I've a 3-tier garden out the back. love green thumbin
<deryl> peaceful
<deryl> damn it, wish Growl would quit crashin on me every 5 or 6 times it displays something
<slyphon> deryl: which Growl?
<slyphon> version
<deryl> 1.3
<deryl> but not telling me the minor
* slyphon nods
* slyphon is glad he's never upgraded
<deryl> wishin i hadn't. i might go back
<slyphon> i'm kinda surprised someone hasn't forked it
nofxx has joined #ruby-lang
<deryl> does HW growler and.or Net growler crash your 1.2 at all?
<kesor> btw, you know Growl is free right?
<deryl> kills 1.3 all the time
<deryl> kesor: up to 1.3 is
<deryl> 1.3 is payware
<slyphon> net doesn't
<kesor> even 1.3 is open source, so you can just d/l it yourself and compile it … its free.
<deryl> slyphon: but hw does?
<deryl> i'm not that good with xcode's debugging capabilities yet so i'm having trouble figuring out if its growler itself or hw/net thats got the issue
<slyphon> m
<slyphon> oh, i haven't used hw in a long time
fgomez has joined #ruby-lang
<deryl> i've only been on a mac for about the last year, not quite 1.5. only started using xcode directly about 6m ago. this thing has tons of stuff to it. almost as freaky as Visual Studio heheh.
<dominikh> slyphon: uff, tough question. 0.3.2, maybe. just check the date of my last commit and what weechat version was released by then :D
<dominikh> slyphon: it _might_ work with the current versions, too, but not everything will be supported
<dominikh> slyphon: I'd probably advise you to write your own wrapper…
<deryl> slyphon: (last comment is relevant only because i've been playing with debugging using it)
SuperTaz_work has joined #ruby-lang
<bawer> I'm having a butload of problems reading a CSV-file that I saved in Excel on Mac (macroman encoding) and it contains some chars used in swedish ("???") .. problem is I keep getting "invalid byte sequence in UTF-8" while using CSV to parse it? any ideas on how to solve that problem?
<apeiros_> bawer: data = File.read(path, :encoding => 'macroman').encode('utf-8')
<apeiros_> then parse `data`
<apeiros_> (the csv lib provides an encoding flag by itself, but that never worked for me)
<bawer> apeiros_: thing is, this should work for any source encoding (at least for ANSI and ISO-8859-1). Do you know good way to detect the encoding and use that?
<apeiros_> bawer: you can not, I repeat, you can not detect the encoding of a file. you *must* know it or ask the user.
<apeiros_> there simply is absolutely no automatic way.
<apeiros_> best thing you can do is make guesses based on occurrence patterns.
<bawer> that sucks.. :)
<drbrain> yup, guessing is not feasible
<apeiros_> what you also can do is exclude multibyte encodings based on invalid sequences. many encodings aren't multibyte, so every sequence a valid code sequence.
<bawer> and, let's face it, my users don't even know what encoding is.. :)
<apeiros_> drbrain: well, not for joe average with limited time. but otherwise, you can perform word analysis etc. - works reasonably well. but effort is off limits…
<drbrain> yeah
<apeiros_> bawer: are your users from a limited set of regions? i.e., can you safely assume it'll be one of e.g. 3 encodings?
<apeiros_> (macroman, iso-8859-1 and utf-8)
looopy has joined #ruby-lang
IPGlider has joined #ruby-lang
<bawer> apeiros_: yes, at least I have that, it would be one of those.. these are csv-files genreated mostly from Excel-files, although I'm also reading excel-files directly and it works allright? just the CSV that's giving me aches.
<bawer> apeiros_:what would you propose?
<apeiros_> excel files contain meta data, and therefore probably contain the encoding
<apeiros_> you can do a) read the file, convert to binary and test agains /[\x80-\xff]/n - if it doesn't match, there are no "dangerous" characters in it and you can just convert it to utf-8 and parse
<apeiros_> b) if it does match, you can try to encode it to utf-8, if it passes, you can assume it's indeed utf-8
<apeiros_> c) if it doesn't pass (raises an invalid blabla error) you've got either iso-8859-1 or macroman at hand, now starts the bigger effort
<apeiros_> (the whole thing is a naive approach and not very efficient, mind you)
Hakon|mbp has joined #ruby-lang
<bawer> I get it, I've done things like that before but I'm new to ruby and was hoping someone already solved that problem :)
<bawer> I'm lazy like that
<apeiros_> you could - in case c) - parse it as both, once as macroman and once as iso-8859-1, extract all words which contain \x80-\xff and match it against a list of known words, the one with more matches wins
<apeiros_> hm, yeah, you could take a look at ruby-toolbox, maybe somebody wrote an encoding-guesser
<bawer> apeiros_: thanks anyway, I'm pressed for time and might just end up not allowing csv-files :/
andkerosine1 has joined #ruby-lang
<bawer> my users would probably only use the excel approach
<apeiros_> bawer: if you have the possibility, allow the user to supply the encoding
<apeiros_> you can limit it to those 3
<apeiros_> in the worst case, they'll just try until it fits
<apeiros_> after all, humans are excellent pattern matchers
<bawer> apeiros_: naah, that would be like.. building a rocket-ship kind of hard on my poor marketing-person users? :)
<apeiros_> not really. they'll try it a couple of times and then figure "oh, it's always X for me"
<apeiros_> (only if you limit it to 3 options, I'd also mark them like e.g. mac-roman with "macroman (Excel Mac)")
<bawer> sure, but it's really just a convenience to supply the possibility of using csv-files? excel files will do for now? and when that dread day comes I'll remember our little chat and do what you suggested
wmoxam has joined #ruby-lang
guns has joined #ruby-lang
* bawer has no more time
<bawer> you know how it is
<bawer> deadlines and such
<apeiros_> heh, I do
jmontross has joined #ruby-lang
<jmontross> is there a simple string.in(array) method? like opposite of Array.includes?(string)
<apeiros_> no
<apeiros_> makes little sense anyway
<apeiros_> String would have to know how all collections work, or delegate to the collections #include? anyway.
<rue> I think there's one in Facets
<rue> And it does indeed do the latter
<andkerosine1> What purpose could that possibly serve?
sandbags has joined #ruby-lang
<rue> It reads better.
casaram has joined #ruby-lang