havenn has quit [Remote host closed the connection]
localhost has quit [Quit: Do fish get thirsty?]
woollyams has joined #ruby-lang
quazimodo has joined #ruby-lang
<quazimodo>
hey guys :D
savage- has quit [Read error: Connection reset by peer]
savage- has joined #ruby-lang
dhruvasagar has joined #ruby-lang
t57116 has quit [Remote host closed the connection]
t81637 has joined #ruby-lang
yats has joined #ruby-lang
gmci has quit [Quit: Computer has gone to sleep.]
dmwuw_ has joined #ruby-lang
dmwuw has quit [Ping timeout: 244 seconds]
dhruvasagar has quit [Ping timeout: 272 seconds]
dmwuw_ has quit [Ping timeout: 260 seconds]
kaiwren has joined #ruby-lang
reactormonk has quit [Ping timeout: 276 seconds]
t81637 has quit [Remote host closed the connection]
t90212 has joined #ruby-lang
slyphon is now known as slyphon_away
woollyams has quit [Quit: Computer has gone to sleep.]
dmwuw has joined #ruby-lang
gmci has joined #ruby-lang
macmartine has joined #ruby-lang
reactormonk has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
t90212 has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
t2981 has joined #ruby-lang
brianpWins has joined #ruby-lang
charliesome has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
rhizmoe has joined #ruby-lang
<rhizmoe>
hi all
banisterfiend has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
<rhizmoe>
i'm writing some ruby for which i'd like to also write tests. does a basic test consist only of requiring the ruby files being tested and test/unit?
<countdigi>
rhizmoe: i use rspec but i believe u require 'test/unit' and then require 'libfoo' whatever that might be
<countdigi>
cool .. the only other warning is u have to watch paths if u have your tests in one dir and your libs in another - but i would start w/ it in the same directory til u get swinging
<countdigi>
then check out "require_relative" when u break it apart
<rhizmoe>
yeah, it's just a coding test and i'm used to rails magic, so just two files: code + tests
yats has quit [Ping timeout: 240 seconds]
yats has joined #ruby-lang
dmwuw has quit [Ping timeout: 276 seconds]
woollyams has quit [Quit: Computer has gone to sleep.]
t2981 has quit [Remote host closed the connection]
t19193 has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
lcdhoffman_ has quit [Quit: lcdhoffman_]
woollyams has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dmwuw has joined #ruby-lang
<rhizmoe>
hm, my require isn't finding a file in the same directory
<foucist>
your stupid require!!!!
<foucist>
rhizmoe: did you try './file'
<TTilus>
rhizmoe: afaik 1.9 does not have '.' in load path
<rhizmoe>
i did, and it complained that TestCase::CurrentFile::RequiredFile didn't exist
<abletony84>
thanks lianj but aint that just adding fuel to the fire?
<andrewvos>
True, but I just want to get this work done.
<erikh>
it gives you some pretty keen insight as to how a unix box does a lot of work
<rue>
abletony84: What is your actual desire here?
<rue>
If you don’t want the \t, just leave it out.
cdt has quit [Quit: Ex-Chat]
carloslopes has joined #ruby-lang
<abletony84>
rue: My desire is to simplify things as much as possible, like that whole "Perfection is achieved, not when there's nothing left to add, but when there's nothing left to take away kinda thing"
<abletony84>
* take away" kinda thing
<rue>
I don’t understand what that means
<rue>
What is your problem with the \t?
chimkan has quit [Quit: chimkan]
Leeky is now known as Leeky_afk
<abletony84>
hmm.. dont like the way it looks!
<erikh>
tttt \t\t\t, \t is the word
<abletony84>
hehe
<abletony84>
im gonna take them out
<abletony84>
why'd the author put them there in the first place?
carloslopes has quit [Client Quit]
<erikh>
probably to indent the log output
segy has quit [Ping timeout: 268 seconds]
carloslopes has joined #ruby-lang
mrsolo has joined #ruby-lang
<erikh>
just a... "pro tip", you should understand code you take from others.
<erikh>
that's part of the learning process and has the nice side effect of not blowing up your computer because you didn't know what you were doing
<abletony84>
hehe
<abletony84>
good point thanks man
gmci has quit [Quit: Computer has gone to sleep.]
yats has joined #ruby-lang
<abletony84>
erikh: i dont understand why he'd want to indent the log output though
<headius>
does that mean it takes 150% as long to run the bench?
<headius>
1.5x longer?
<headius>
or does that mean it's half as fast
<headius>
2x longer
<rue>
I’d say it takes 2x as long
<headius>
if jruby is 2x faster than maglev, and maglev is 2x faster than 1.9.3, then jruby's 4x faster than 1.9.3
<rue>
Is two times faster three times as fast?
hynkle has quit [Ping timeout: 240 seconds]
<headius>
did you just ask that?
<rue>
Yes!
<headius>
I'd say two times faster is two times as fast, but maybe I'm crazy
<rue>
I dunno
<headius>
otherwise "one time" faster would have to mean twice as fast
<headius>
mixing times and percents like they did is very confusing
<headius>
they should just say "2x faster than 1.9.3, but JRuby still smokes the hell out of us"
<rue>
Right, once (again) faster == 2x AS fast :D
hynkle has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
zmack has quit [Remote host closed the connection]
BigFatFatty has joined #ruby-lang
akira989_ has quit [Remote host closed the connection]
<headius>
that I can buy
sailias has joined #ruby-lang
sailias has quit [Client Quit]
banisterfiend has joined #ruby-lang
<headius>
three times as fast = twice faster?
<headius>
again, and again
<rue>
This calls for an RFC!
<headius>
"JRuby is thrice slower than a third of the benchmarks but 2x faster on 50% of the remainder"
havenn has quit [Remote host closed the connection]
<headius>
I'm sure we could come up with lines that mean nothing at all
<headius>
half double decaffeinated half-caf with a twist of lemon
havenn has joined #ruby-lang
DefV has quit [Ping timeout: 272 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
dfr|mac has joined #ruby-lang
gmci has joined #ruby-lang
t97587 has quit [Remote host closed the connection]
t76705 has joined #ruby-lang
Guest89690 has quit [Read error: Operation timed out]
akira989 has joined #ruby-lang
Axsuul has joined #ruby-lang
havenn has quit [Remote host closed the connection]
zmack has joined #ruby-lang
havenn has joined #ruby-lang
zmack has quit [Remote host closed the connection]
erichmenge has joined #ruby-lang
erichmenge has quit [Client Quit]
workmad3 has joined #ruby-lang
macmartine has joined #ruby-lang
m3nd3s has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby-lang
akira989_ has joined #ruby-lang
Hakon has joined #ruby-lang
akira989 has quit [Ping timeout: 252 seconds]
t76705 has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
t68195 has joined #ruby-lang
chessguy has joined #ruby-lang
banisterfiend has joined #ruby-lang
ipabs has quit [Read error: Connection reset by peer]
Torrieri has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
akira989_ has quit [Read error: Connection reset by peer]
rippa has quit [Ping timeout: 240 seconds]
qwerxy has quit [Quit: offski]
akira989 has joined #ruby-lang
kain has quit [Quit: exit]
m3nd3s has joined #ruby-lang
Torrieri has quit [Quit: Saliendo]
workmad3 has quit [Ping timeout: 252 seconds]
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby-lang
publicvoid_ has joined #ruby-lang
tenderlove has joined #ruby-lang
publicvoid has quit [Ping timeout: 252 seconds]
enroxorz-work has quit [Quit: Leaving]
m3nd3s has quit [Read error: Connection timed out]
<cout>
whoever wrote progress_bar is the most awesome ruby programmer on the planet
yxhuvud has quit [Ping timeout: 245 seconds]
m3nd3s has joined #ruby-lang
arooni-mobile has quit [Read error: Connection reset by peer]
t68195 has quit [Remote host closed the connection]
t78357 has joined #ruby-lang
erichmenge has joined #ruby-lang
bytephilia has quit [Ping timeout: 272 seconds]
chessguy has quit [Remote host closed the connection]
gsav has quit [Read error: Connection reset by peer]
chessguy has joined #ruby-lang
itsmeduncan has joined #ruby-lang
17SABR2Q2 has quit [Quit: 17SABR2Q2]
Hakon has quit [Quit: Leaving...]
tallship has joined #ruby-lang
Hakon has joined #ruby-lang
wallerdev has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
neocoin has quit [Remote host closed the connection]
banisterfiend has joined #ruby-lang
t78357 has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
t63825 has joined #ruby-lang
itcharlie has joined #ruby-lang
chessguy has quit [Remote host closed the connection]
qwerxy has joined #ruby-lang
totallymike has joined #ruby-lang
chessguy has joined #ruby-lang
itcharlie has quit [Read error: Connection reset by peer]
kain has joined #ruby-lang
scampbell has quit [Quit: Ex-Chat]
akira989_ has joined #ruby-lang
akira989 has quit [Read error: Connection reset by peer]
t63825 has quit [Remote host closed the connection]
t9438 has joined #ruby-lang
hynkle has quit [Quit: Computer has gone to sleep.]
hynkle has joined #ruby-lang
kvirani has quit [Remote host closed the connection]
voker57 has quit [Remote host closed the connection]
dfr|mac has quit [Remote host closed the connection]
hynkle has quit [Ping timeout: 248 seconds]
dfr|mac has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has quit [Remote host closed the connection]
lcdhoffman has quit [Quit: lcdhoffman]
crookshanks has joined #ruby-lang
g0bl1n has joined #ruby-lang
qwerxy has quit [Quit: offski]
crookshanks has quit [Remote host closed the connection]
dfr|mac has quit [Remote host closed the connection]
carloslopes has quit [Quit: Leaving.]
t9438 has quit [Remote host closed the connection]
t6054 has joined #ruby-lang
dfr|mac has joined #ruby-lang
andrewhl has joined #ruby-lang
bjensen has joined #ruby-lang
<bjensen>
Im trying to fix a poorly encoded string, and Im using gsub to do it, so far I have this: gsub("Ã¥", "å").gsub("æ", "æ").gsub("ø", "ø") but does anyone know how I can find the upper case versions?
<drbrain>
bjensen: does str.force_encoding Encoding::UTF_8 work?
dejongge has quit [Quit: Leaving.]
<bjensen>
"har en god opgaveforståelse" nope
<bjensen>
thats the string
<bjensen>
if i do #encoding on its it returns utf 8..
voker57 has joined #ruby-lang
<drbrain>
I see
<drbrain>
it looks like it's a corrupt UTF-8 string
<drbrain>
gsub is not the correct solution, other unicode characters will also be corrupt
<drbrain>
you need to figure out which encodings it went through that resulted in the corruption and reverse them
<bjensen>
drbrain: well it was in rails using the serialize attribute
<bjensen>
as part of a hash
itsmeduncan has quit [Quit: itsmeduncan]
<bjensen>
drbrain: well I have the test string, how can I find out which encodings it has gone through?
<drbrain>
bjensen: you'll need to look at how serialize attribute works and what encoding transformations your DB performed
<drbrain>
bjensen: … it may have gone through YAML instead of JSON, but the same UTF-8 corruption could occur
<bjensen>
drbrain: to be honest I don't have time for such a hunt right now. So I would just like to use gsub for now
<bjensen>
its legacy data
<bjensen>
so just need to get it converted
<drbrain>
ok
ylluminate has joined #ruby-lang
t6054 has quit [Remote host closed the connection]
<bjensen>
drbrain: so I have this gsub("Ã¥", "å").gsub("æ", "æ").gsub("ø", "ø") but that only handles the smaller case versions of the letters, I need the big ones as well
t81335 has joined #ruby-lang
<drbrain>
they'll have different code points you need to look up
<rking>
bjensen: There are tools to transcode.
<rking>
You sure you don't want to be using iconv or similar?
<bjensen>
rking: sure if I can do it with iconv
<drbrain>
rking: the problem is the string is corrupt
<bjensen>
yeah
<rking>
But usually it's corrupt in a known mapping.
deryl has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
deryl has quit [Client Quit]
<rking>
Doing a forest of gsub()s is unlikely the directest way out of the mess.
Criztian has joined #ruby-lang
akira989 has quit [Read error: Connection reset by peer]
<bjensen>
if you have any suggestions of use of icon, then I would love to hear it
akira989 has joined #ruby-lang
<Harzilein>
if the mapping is not known, there are heuristics for finding it
qwerxy has quit [Quit: offski]
<Harzilein>
it looks like utf8 interpreted as latin1
<rking>
You just have to find out what causes the particular flavor of Mojibake mapping "å" to "Ã¥", then reverse it.
<rking>
Harzilein: That was my guess, but it's not quite.
<rking>
That "A" is odd.
<rking>
No, it's an "Ã", "A WITH TILDE"
<bjensen>
yeah it is
<rking>
Yes, that being a c3 it's definitely UTF-8 that got reinterpreted as something else.
<rking>
drbrain: Yep. That's just a bit more verbose is all.
tbuehlmann has quit [Remote host closed the connection]
<Harzilein>
bjensen: so find out if the data is actually saved in what the db think it is saving. if that's the case, set up your db access to use utf-8 conversion. you should not even need any conversion inside ruby then.
<Harzilein>
bjensen: do puts Iconv.iconv("LATIN1", "UTF-8", ...)
<rking>
bjensen: And?
havenn has joined #ruby-lang
<drbrain>
bjensen: require 'iconv' says: iconv will be deprecated in the future, use String#encode instead.
slyphon has quit [Quit: WeeChat 0.3.7]
<bjensen>
um why is Iconv.iconv("LATIN1", "UTF-8", "opgaveforståelse") and puts Iconv.iconv("LATIN1", "UTF-8", "opgaveforståelse") not the same?
<Harzilein>
bjensen: the former gets pretty printed by irb
<Harzilein>
bjensen: the irb pretty printing is more akin to using pp instead of puts
<bjensen>
ah
banisterfiend has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
<bjensen>
so its actually right the Iconv.iconv("LATIN1", "UTF-8", "opgaveforståelse")
macmartine has joined #ruby-lang
banisterfiend has joined #ruby-lang
<Harzilein>
bjensen: but again, check if the raw data in the db is saved as utf-8 and if the db expects to read it as utf-8 and if your db adaptor is set up to request an utf-8 session.
<bjensen>
right
<Harzilein>
bjensen: if you don't have actual mojibake in your db you should not need conversion in ruby, and if you do, you should convert your data to match the db setup
erics has joined #ruby-lang
<bjensen>
like i said earlier, this is just some data i need moved
<Harzilein>
(or adjust your db setup, if that's possible while retaining the raw data (might become invalid by that though))
tenderlove has quit [Ping timeout: 250 seconds]
thone_ has quit [Ping timeout: 260 seconds]
tenderlove has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
Skif has quit [Ping timeout: 240 seconds]
t81335 has quit [Remote host closed the connection]
thone has joined #ruby-lang
t3562 has joined #ruby-lang
sepp2k has joined #ruby-lang
JoshWines has joined #ruby-lang
g0bl1n has joined #ruby-lang
hynkle has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby-lang
MrWGW has quit [Ping timeout: 245 seconds]
MrWGW has joined #ruby-lang
LanceHaig has left #ruby-lang ["Leaving"]
arooni-mobile has joined #ruby-lang
erics has quit [Remote host closed the connection]
Skif has joined #ruby-lang
<bjensen>
Harzilein: Hmm when I try to save the data again into my utf8 db, I get this error: Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT
hynkle has quit [Quit: Computer has gone to sleep.]
kingCrawlerx has joined #ruby-lang
t3562 has quit [Remote host closed the connection]
t35551 has joined #ruby-lang
<bjensen>
the force_encoding might be doing some magic..
chessguy has quit [Remote host closed the connection]
sandbags has quit [Remote host closed the connection]
Marc3000 has joined #ruby-lang
Marc3000 has left #ruby-lang [#ruby-lang]
dfr|mac has quit [Remote host closed the connection]
<erikh>
as someone who's dealt with this before I'd strongly suggest finding out how many strings you have with this encoding problem before you try to spin you wheels on hacks
<erikh>
it might be faster to do it right.
Marc3000 has joined #ruby-lang
m3nd3s has quit [Remote host closed the connection]
kingCrawlerx has quit [Quit: Computer has gone to sleep]
kingCrawlerx has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
<andrewvos>
Anyone here need a free api to ist postcodes in a given latitude or longitude?
<drbrain>
erikh: knife-solo is working perfectly
<drbrain>
erikh: looks like I'll be able to boot a bare instance, run knife-solo, then make an image out of it
qwerxy has joined #ruby-lang
Marc3000 has quit [Quit: Leaving.]
Marc3000 has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
akira989 has quit [Remote host closed the connection]
bjensen has quit [Quit: bjensen]
lcdhoffman has joined #ruby-lang
<erikh>
awesome
justinseiter has joined #ruby-lang
<zzak>
hi!
toretore has quit [Quit: Leaving]
milesforrest has joined #ruby-lang
akira989 has joined #ruby-lang
Nisstyre has joined #ruby-lang
ylluminate has quit [Quit: Bye!]
<drbrain>
zzak: hi!
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
outoftime has quit [Quit: Leaving]
erichmenge has quit [Quit: Be back later]
dous_ has quit [Remote host closed the connection]
kingCrawlerx has quit [Quit: Computer has gone to sleep]
bytephilia has joined #ruby-lang
dous has joined #ruby-lang
ryez has joined #ruby-lang
macmartine has quit [Quit: Computer has gone to sleep.]
kingCrawlerx has joined #ruby-lang
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-dev)]
banisterfiend has quit [Read error: Connection reset by peer]
woollyams has joined #ruby-lang
andrewhl has quit [Read error: Connection reset by peer]
kingCrawlerx has quit [Client Quit]
banisterfiend has joined #ruby-lang
andrewhl has joined #ruby-lang
BigFatFatty has left #ruby-lang [#ruby-lang]
andrewhl has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
stardiviner has quit [Client Quit]
stardiviner has joined #ruby-lang
qwerxy has quit [Quit: offski]
cantonic has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
jackhammer2022 has joined #ruby-lang
t35551 has quit [Remote host closed the connection]
t44393 has joined #ruby-lang
woollyams has joined #ruby-lang
Weems has quit [Ping timeout: 248 seconds]
ryez has quit [Quit: Page closed]
lcdhoffman has quit [Quit: lcdhoffman]
kvirani has joined #ruby-lang
ryez has joined #ruby-lang
andrewhl has joined #ruby-lang
bytephilia has quit [Remote host closed the connection]
m3nd3s_ has joined #ruby-lang
andrewhl has quit [Remote host closed the connection]
richardjortega has quit [Quit: richardjortega]
banisterfiend has quit [Read error: Connection reset by peer]