horesman has quit [Remote host closed the connection]
mistym has joined #ruby-lang
KINGSABRI has joined #ruby-lang
KINGSABRI has quit [Ping timeout: 272 seconds]
asahi has joined #ruby-lang
jbsan_ has joined #ruby-lang
jbsan has quit [Ping timeout: 246 seconds]
jbsan_ is now known as jbsan
<asahi>
wondering how I can iterate over an array but do something different for the last element. For example, creating a string like "link1<br />link2<br />link3" from an array of links
<dhruvasagar>
but that does not have timezone information, so when parsed at client side (Datejs), it automatically treats it as client timezone which is not the same as server timezone
IPGlider has joined #ruby-lang
<bnagy>
it does have timezone information?
<bnagy>
it's in zulu
<bnagy>
utc+0
virunga has joined #ruby-lang
Axsuul has quit [Ping timeout: 240 seconds]
ramonmaruko has joined #ruby-lang
<workmad3>
bnagy: just told him exactly the same in #rubyonrails :)
fayimora has quit [Ping timeout: 264 seconds]
<judofyr>
bnagy: zulu?
fayimora has joined #ruby-lang
<oddmunds>
zulu is just phonetic for z?
<rue>
Yes
d3vic3 has quit [Ping timeout: 248 seconds]
fayimora has quit [Client Quit]
<judofyr>
ah
d3vic3 has joined #ruby-lang
ryez has joined #ruby-lang
<apeiros_>
the zululanians are proud of their timezone
<Muz>
Oh sorry, you want the indexes, not the values, rght?
<mytrile>
yep
<banisterfiend>
mytrile: array.each_with_index.with_object([]) { |(v, i), o| o << i if v == 1 }
<rue>
[1,2,1].select.with_index.map {|o, i| i if o == 1}.squeeze
<Muz>
array.each_index { |i| puts i if array[i] == 1 }
<rue>
Er, wait, what gets rid of nils?
<banisterfiend>
rue: compact
<banisterfiend>
rue: wtf is squeeze
<rue>
That’s the bunny
<rue>
String#squeeze
<banisterfiend>
cool
<rue>
Actually the #select does nothing there, I guess
<rue>
Ah, #partition
<rue>
Duh
francisfish has joined #ruby-lang
<judofyr>
rue: #compact gets rid of nil
<rue>
Yes, that’s the one
srbartlett has joined #ruby-lang
kurko_ has joined #ruby-lang
<banisterfiend>
rue: that's the bunny
<rue>
So array.map {|o, i| i if some_condition }.compact
<rue>
But I’d probably put that in a method
<banisterfiend>
map.with_index ?
<rue>
And using #with_object is probably nicer.
<rue>
That, yes
neocoin has joined #ruby-lang
<banisterfiend>
that's the bunny
<banisterfiend>
:P
<rue>
Fucking bunnies escaping everywhere
Criztian has joined #ruby-lang
<mytrile>
thanks guys
<banisterfiend>
mytrile: which one did u go with mytr
<banisterfiend>
rue: did u see prometheus?
<rue>
Nah
<rue>
Any good?
<mytrile>
banisterfiend: I'll test which is the fastest now
<banisterfiend>
rue: hmm, i just saw it tonight. It's a good premise but there's absolutely no resolutions; none of the mysteries are resolved at the end of the film so you're left thinking 'wtf???'
<banisterfiend>
rue: so i found it frustrating
<rue>
Still better than the ME3 ending™
<banisterfiend>
rue: haha, ok, it was apparently written by the same guy who wrote lost
<banisterfiend>
so maybe that it explains it
<Muz>
You say "written", that would suggest that there was some sort of conclusive direction in the plot...
<banisterfiend>
Muz: you saw prometheus?
<Muz>
Nah, I'm just being snide and presenting an opinion about something, whilst not having a leg to stand on. ;)
<judofyr>
banisterfiend: oh, JJ Abrams was the co-creator of Lost…
<judofyr>
actually, it seems that Damon Lindelof was too
<judofyr>
"Lost was created by Jeffrey Lieber, J. J. Abrams and Damon Lindelof"…
<judofyr>
nevermind then
<judofyr>
banisterfiend: CARRY ON
<banisterfiend>
judofyr: finished :P did you see prometheus?
<judofyr>
nope
<banisterfiend>
too bad, i want to hear other people's theories on it
<banisterfiend>
i didnt understand it at all
zz_wasnotrice is now known as wasnotrice
<lzhz>
there will be a sequel, that's why there's some unanswered questions
<judofyr>
banisterfiend: plot.send(:binding).pry
<banisterfiend>
lzhz: well, if it's anything like 'lost', the answers will either not exist or be unsatisfying :/
<lzhz>
like why the hell did the keep running forward instead of taking two steps to the side when the ship came rolling after them. ;)
ben_m has joined #ruby-lang
<banisterfiend>
judofyr: hehe
<judofyr>
banisterfiend: JJ Abrams had a lunch talk at WWDC this year. there was a Q&A. some guy started: "well, I have a lots of questions about Lost…". Abrams ran off the stage :)
<judofyr>
s/a lots/lots/
TheHunter_1039 has joined #ruby-lang
andrewhl has joined #ruby-lang
<banisterfiend>
judofyr: haha, yeah. it's relatively easy to create mystery piled on mystery, but infinitely more difficult to resolve them all in a satisfying way. what did u thin of the endig to lost?
wasnotrice is now known as zz_wasnotrice
<judofyr>
banisterfiend: haven't seen Lost
imperator has joined #ruby-lang
zmack has quit [Remote host closed the connection]
EvilJStoker has quit [Excess Flood]
zz_wasnotrice is now known as wasnotrice
dfr|mac has joined #ruby-lang
sockmonk has joined #ruby-lang
<workmad3>
judofyr: if you like resolved stories... never watch it
ttilley_off is now known as ttilley
dv310p3r has joined #ruby-lang
EvilJStoker has joined #ruby-lang
sailias has quit [Ping timeout: 248 seconds]
akira989 has joined #ruby-lang
mistym has quit [Remote host closed the connection]
bglusman has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
bryancp has joined #ruby-lang
piyush has quit [Ping timeout: 276 seconds]
enebo has joined #ruby-lang
rhodee has joined #ruby-lang
fgomez has quit [Remote host closed the connection]
outoftime has joined #ruby-lang
d3vic3 has quit [Ping timeout: 252 seconds]
tzvi has joined #ruby-lang
digitalbane has joined #ruby-lang
tcopp has joined #ruby-lang
<jperry2>
so I came a cross a nice approach to not using class variables and use class instance variables instead to save state but something from the top level can change the value of the class instance variable
<jperry2>
any way to protect that so only your instances can change it?
zmack has joined #ruby-lang
<workmad3>
jperry2: not in a way that can't be subverted :)
<workmad3>
jperry2: but that's true of just about everything in ruby (and in fact, true in just about every language)
<Silex>
imperator: "of course" ?!?!? see this paste, same class same object_id same everything, yet different somehow
<kyrylo>
Russians are odd.
<jarib>
Silex: i'm pretty sure rails collections don't return the real class
<Silex>
oh they fake the object_id too
<Silex>
bastards
<Silex>
okay, thanks!
<lianj>
evil sorcery
<imperator>
never try to understand the rails internals, you'll go insane
<imperator>
just do what the nice manual says
<whitequark>
did you know that AR3 scope is a monad?
<imperator>
whitequark, oh, nothing, was just going to make a cold war joke or something, but then i couldn't think of one
bastilian has joined #ruby-lang
<whitequark>
imperator: not only I'm russian, but also I was born after USSR fallen apart, so I won't grasp it anyway
<whitequark>
(as3 scope) each scope is a dup of the original class
<whitequark>
pretty clever I'd say
<banisterfiend>
whitequark: are you one of those russians who does chin-ups from a bridge 200ft in the air
<banisterfiend>
seems to be a thing in russia ;)
<whitequark>
never heard of
<imperator>
banisterfiend, was it you that asked me about c99 patches on windows a little while ago?
<banisterfiend>
imperator: Yeah
<imperator>
i was thinking about that and realized it would never be an issue
<banisterfiend>
imperator: interesting why's dat
mytrile has quit [Remote host closed the connection]
<imperator>
ruby compiles with msvc currently; always has (since 1.8 anyway); any incompatible c99 change would be reported as a bug; ergo it would never be an issue in practice
<banisterfiend>
imperator: really? i saw a lot of c99 in the yarv code base
<banisterfiend>
imperator: maybe microsoft extensions to c89 lets it pass
<imperator>
well, it's not that msvc doesn't support c99, it's just not 100% compliant
<imperator>
so the c99 code you see must be compatible
<banisterfiend>
well, they officially refuse to support c99, so if they support it, they almost support it by accident as one of their extensions i think, rather than trying to support c99 explicitly
<imperator>
whitequark, you and mentalguy would get along :)
<imperator>
banisterfiend, or, just you know, compile as c++ ;)
<banisterfiend>
imperator: does that 'just work' ?
<kith>
so what do you guys suggest? ditch ORM's entirely? :D
<Tasser>
nope, just be aware they are booby-trapped
<Tasser>
just like a woman
<imperator>
kith, depends what you're doing
<andrewvos>
women are booby-trapped?W
<imperator>
me? i used dbi for years before orm's in ruby got popular
zz_wasnotrice is now known as wasnotrice
<imperator>
because, you see, I KNOW FUCKING SQL
<imperator>
sorry, sorry, too much caffeine
<lianj>
f'ing caffeine
KINGSABRI has joined #ruby-lang
<andrewvos>
Someone get imperator a medal.
<imperator>
that's it, i'm installing rdbi right now!
<andrewvos>
Hold him back1
gnufied has joined #ruby-lang
<imperator>
well, if there's one benefit to orm's, it's that they abstract away the vendor specific stuff
bglusman has joined #ruby-lang
<imperator>
just in case your company decides to move 20 years of baggage to a new vendor for kicks
<imperator>
you'll be safe!
gouthamvel has quit [Ping timeout: 260 seconds]
<Tasser>
imperator, if you're using an ORM, you can't use most of the stuff your vendor provides anyway
bfreeman has quit [Quit: bfreeman]
<imperator>
Tasser, indeed
<Tasser>
what's the 'if this script is run as $0, run this code' in ruby?
<imperator>
if $0 == __FILE__
<Tasser>
thx
<kith>
hmm switch from rdbms to oodbms ::D
<kith>
:D
IPGlider has quit []
<andrewvos>
FFUUUUU
coryf has joined #ruby-lang
d3vic3 has joined #ruby-lang
<workmad3>
kith: nah, just think about your data structure a bit and make sure you've got a good fit, rather than just chucking a RDBMS in and throwing an ORM on top and assuming that it will sort everything out for you and solve your problems and be magical
* imperator
wonders if Og is still around
<imperator>
hm, does seem to be
sailias has joined #ruby-lang
<Tasser>
argh @ minitest test shuffling
<oddmunds>
that's supposed to be a good thing
<Tasser>
how the heck do I test like http://sprunge.us/IUjG if minitest shuffles my test?
<workmad3>
Tasser: I think lianj may be onto something... the before location is the real problem
<workmad3>
Tasser: think about it... in the outside describe block, you have 4 before blocks...
<workmad3>
I think that would be borked even without shuffling :)
<Tasser>
fail
<workmad3>
the last one to run would always be the @verb you get
<Tasser>
fuck
<Tasser>
lianj, or should I undelete the question?
<lianj>
i havent logged on to stackoverflow in years :D
<Tasser>
oke
carloslopes has quit [Ping timeout: 252 seconds]
<workmad3>
Tasser: if you're going to do that style btw, maybe consider sticking the word into the describe string too
<workmad3>
Tasser: so you have 'describe "describe the word #{verb}" do...
<lianj>
good point
arooni-mobile has quit [Quit: Leaving]
<Tasser>
workmad3, thanks
<Tasser>
alias new old or alias old new ?
<Tasser>
and any good clue how to remember that?
<workmad3>
Tasser: and I'm guessing you should always have the describe as the first thing in the block... you could potentially create an extension for minitest to let you do ary.describe_each "%{item} should do stuff" do ... end
<Tasser>
workmad3, I'll think about that
<workmad3>
I'm just procrastinating on a friday afternoon now, btw :)
Defusal has quit [Quit: Quit message goes here]
jano has joined #ruby-lang
<Tasser>
good, you're helping someone else (me) work :D
<banisterfiend>
Tasser: seems like a small amount of tests for that many files :P
robotmay has quit [Remote host closed the connection]
<Tasser>
3129 total
<Tasser>
that's data :-)
<banisterfiend>
cool, what's the project Tasser?
<Tasser>
ehh, ~ 10 more of data
zmack has quit [Ping timeout: 276 seconds]
<Tasser>
banisterfiend, apertium for rumantsch (still incubator state)
<banisterfiend>
Tasser: wht does it do
<banisterfiend>
i have no idea what apterium or rumantsch are :P
asahi has joined #ruby-lang
<Tasser>
banisterfiend, apertium is machine translation, rumantsch a language spoken in swizerland and around - with a shitload of idioms (more differences than dialects)
<Tasser>
banisterfiend, is there a pry module for starting up at failed minitest examples?
zmack has joined #ruby-lang
stamina has quit [Quit: Lost terminal]
stamina has joined #ruby-lang
butchanton has joined #ruby-lang
kurko___ has joined #ruby-lang
<banisterfiend>
Tasser: yes plymouth, but i haven't worked on it for a while
<banisterfiend>
Tasser: no, it's called plymouth :P
dhruvasagar has joined #ruby-lang
sora_h is now known as s0ra_h
dhruvasagar has quit [Client Quit]
<banisterfiend>
Tasser: can u get back to me on the efficacy of plymouth? i haven't had much feedback
<jano>
any treetop experts around? i have this erb grammar and would like to ignore trailing whitespace. https://gist.github.com/2973631 ping me if you know this stuff :D
msaffitz has joined #ruby-lang
fgomez has quit [Ping timeout: 252 seconds]
ttilley has joined #ruby-lang
tjadc has quit [Ping timeout: 240 seconds]
deryl has quit [Ping timeout: 265 seconds]
fgomez has joined #ruby-lang
workmad3 has quit [Ping timeout: 255 seconds]
fgomez has quit [Client Quit]
fgomez has joined #ruby-lang
wasnotrice is now known as zz_wasnotrice
deryl has joined #ruby-lang
carloslopes has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
solars has quit [Ping timeout: 246 seconds]
deryldoucette has joined #ruby-lang
deryl is now known as Guest60214
deryldoucette is now known as deryl
Guest60214 has quit [Ping timeout: 272 seconds]
enebo has quit [Quit: enebo]
savage- has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
tcopp has left #ruby-lang [#ruby-lang]
akira989 has quit [Remote host closed the connection]
bfreeman has joined #ruby-lang
cdt has quit [Quit: Ex-Chat]
cantonic_ has joined #ruby-lang
zmack has quit [Remote host closed the connection]
solars has joined #ruby-lang
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
akira989 has joined #ruby-lang
rhodee has quit [Quit: rhodee]
asahi has left #ruby-lang [#ruby-lang]
<zzak>
let is just a fancy lambda
yannis has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby-lang
bryancp has quit [Remote host closed the connection]
bglusman has quit [Remote host closed the connection]
havenn has joined #ruby-lang
S1kx has joined #ruby-lang
rippa has quit [Ping timeout: 248 seconds]
rhodee has quit [Quit: rhodee]
S2kx has quit [Ping timeout: 265 seconds]
florentg2 has quit [Quit: florentg2]
florentg2 has joined #ruby-lang
fgomez has quit [Ping timeout: 245 seconds]
kurko___ has quit [Quit: Saindo]
misham has joined #ruby-lang
<zenspider>
burgestrand: sorry. I got distracted. um. 30 minutes
<zenspider>
also thinking about gogaruco and I'm not sure how long that is
<burgestrand>
zenspider: no worries, I’m distracted too :p
<zenspider>
I think it is 45-50
coryf has quit [Read error: Connection reset by peer]
coryf_ has joined #ruby-lang
sailias has quit [Quit: Leaving.]
<burgestrand>
Have been thinking a bit about it but I don’t have any ideas I’m afraid
wpaulson has joined #ruby-lang
robotmay has joined #ruby-lang
<burgestrand>
I tend to take a liking to the motivational/inspirational talks as opposed to the technical or demo talks when it comes to longer sessions
mistym has quit [Remote host closed the connection]
dv310p3r has quit [Ping timeout: 276 seconds]
qwerxy has joined #ruby-lang
Nekka has quit [Ping timeout: 276 seconds]
neocoin has quit [Remote host closed the connection]
qwerxy has quit [Client Quit]
hinbody has quit [Ping timeout: 245 seconds]
fayimora has joined #ruby-lang
outsmartin has quit [Quit: Leaving.]
hinbody has joined #ruby-lang
outoftime has quit [Quit: Leaving]
s0ra_h is now known as sora_h
<rue>
I really did have a good idea
peppyheppy has joined #ruby-lang
peppyheppy has quit [Client Quit]
sepp2k has joined #ruby-lang
<zenspider>
rue: write it down damnit
havenn has quit [Remote host closed the connection]
florentg2 has joined #ruby-lang
LnL has joined #ruby-lang
r0bby has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 260 seconds]
LnL has quit [Remote host closed the connection]
M4g1c5t0rM has quit [Read error: Connection reset by peer]
coryf_ has quit [Remote host closed the connection]
solars has quit [Read error: Operation timed out]
M4g1c5t0rM has joined #ruby-lang
misham has quit [Ping timeout: 244 seconds]
Kuukunen has quit [Read error: Connection reset by peer]
Criztian_ has quit [Remote host closed the connection]
chendo_ has quit [Ping timeout: 244 seconds]
A124 has quit [Quit: Leaving.]
LnL has joined #ruby-lang
sora_h is now known as s0ra_h
workmad3 has joined #ruby-lang
rmascarenhas has joined #ruby-lang
LnL has quit [Remote host closed the connection]
havenn has joined #ruby-lang
mobile_ has joined #ruby-lang
benjammin891 has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
misham has joined #ruby-lang
scientes has joined #ruby-lang
<scientes>
has anyone ported ruby to emscripen, so that you can run ruby in the browser?
sailias has joined #ruby-lang
carloslopes has quit [Quit: Leaving.]
s0ra_h is now known as sora_h
<zenspider>
meh
erics has quit [Remote host closed the connection]
Skif has joined #ruby-lang
<naquad>
i have a StringScanner instance and i want to get matched groups from string_scanner_obj.scan(/([^:]+):(.+?)\]\]/) expression. how do i do that?
florentg2 has quit [Quit: florentg2]
mobile_ has quit [Remote host closed the connection]
florentg2 has joined #ruby-lang
sepp2k has quit [Remote host closed the connection]
wpaulson has joined #ruby-lang
misham has quit [Ping timeout: 260 seconds]
<zenspider>
naquad: ri StringScanner.[]
<naquad>
zenspider, thanks, found it already :) finally googled sane docs for StringScanner. first result was old version of rdoc with really bad docs