jmeeuwen has quit [Quit: Disconnecting from stoned server.]
jmeeuwen has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
marr has quit [Ping timeout: 248 seconds]
nathanstitt has quit [Quit: I growing sleepy]
julweber_ has joined #ruby-lang
_ffio_ has joined #ruby-lang
kuja has quit [Ping timeout: 264 seconds]
julweber has quit [Ping timeout: 246 seconds]
nathanstitt has joined #ruby-lang
kuja has joined #ruby-lang
cored has quit [Ping timeout: 276 seconds]
glebm has quit [Quit: Computer has gone to sleep.]
hogeo has joined #ruby-lang
glebm has joined #ruby-lang
mjc_ has quit [Disconnected by services]
nathanstitt has quit [Quit: I growing sleepy]
nathanstitt has joined #ruby-lang
nathanstitt has quit [Client Quit]
ruurd has joined #ruby-lang
mistym has quit [Remote host closed the connection]
ruby-lang518 has joined #ruby-lang
tkuchiki has joined #ruby-lang
duphus has quit [Quit: Leaving.]
iliketurtles has quit [Quit: zzzzz…..]
ruby-lang518 has quit [Changing host]
ruby-lang518 has joined #ruby-lang
duphus1 has joined #ruby-lang
flip_digits has quit [Remote host closed the connection]
flip_digits has joined #ruby-lang
wmoxam has joined #ruby-lang
gregmoreno has quit [Ping timeout: 240 seconds]
Gaelan is now known as GaelanAintAround
duphus1 has quit [Quit: Leaving.]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ruby-lang518 has quit [Ping timeout: 250 seconds]
GeissT has joined #ruby-lang
robbyoconnor has quit [Read error: No route to host]
robbyoconnor has joined #ruby-lang
Polish_ has joined #ruby-lang
wmoxam has quit [Ping timeout: 240 seconds]
Polish_ has quit [Client Quit]
fosky has quit [Remote host closed the connection]
julweber_ has quit [Remote host closed the connection]
iliketurtles has joined #ruby-lang
arooni-mobile has joined #ruby-lang
daihuws has joined #ruby-lang
nathanstitt has joined #ruby-lang
<arooni-mobile>
basic question but /blah[/]?/ should be an optional / or nothing at all right
<daihuws>
Hi all. Can anyone tell me how to get an array for the positions of a series of Regexp matches - i.e. for a string "s s s s" and pattern /\s/ you'd get [1,3,5] ?
<drbrain>
arooni-mobile: if your regexp is inside // you need to escape / everywhere inside the regexp
<arooni-mobile>
so should be /blah[\/]?/ ?
<drbrain>
arooni-mobile: and yes, that's an optional "/"
<drbrain>
yes
<drbrain>
you can drop the [] for matching "/" too
<drbrain>
so also /blah\/?/ (or %r%blah/?%)
<arooni-mobile>
sorry i meant .... an optoinal \ ... so that would be /blah[\\]
<arooni-mobile>
sorry /blah[\\]?/
<drbrain>
yes
<drbrain>
or /blah\\?/
<arooni-mobile>
i i guess i didnt need the brackets huh
<drbrain>
for special characters it might be more clear to use [] like ?, +, *
<Nilium>
%r{ blah \\? }x ← I sort of like this way of doing it.
<Nilium>
Keeps the regular expressions more readable to have some padding around bits of it
<arooni-mobile>
i have a string that comes up sometimes 'id=41NQPPU\' ... and my match is /id=([^&\\]*)/ but whereas i dont want the trailing slash
<arooni-mobile>
im still collecting it
pr0ton has quit [Quit: pr0ton]
MrPoT4tO has joined #ruby-lang
Asher1 has quit [Quit: Leaving.]
Asher has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<Nilium>
So why are you collecting the slash if you don't want it?
vlad_starkov has quit [Ping timeout: 240 seconds]
iliketurtles has quit [Ping timeout: 276 seconds]
mdedetrich has joined #ruby-lang
julweber has joined #ruby-lang
iliketurtles has joined #ruby-lang
Domon has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
julweber has quit [Ping timeout: 246 seconds]
nathanstitt has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
toretore has quit [Quit: Leaving]
<arooni-mobile>
i was trying to collect everything but the slash
gja has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
<arooni-mobile>
so i put it in the ^ not part
<arooni-mobile>
or do i need the ^ in front of every character?
<arooni-mobile>
within the []
MrPoT4tO has quit [Read error: Connection reset by peer]
MrPoT4tO has joined #ruby-lang
duphus has joined #ruby-lang
flip_digits has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
<Nilium>
You only need it as the first character.
flip_digits has joined #ruby-lang
<Nilium>
I'm just not sure how you're collecting the slash if you're not collecting the slash
<Nilium>
Hm I could code or I could play borderlands 2
ecnalyr has joined #ruby-lang
flip_digits has quit [Ping timeout: 268 seconds]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
havenwood has quit [Read error: Connection reset by peer]
mdedetrich has joined #ruby-lang
flip_digits has joined #ruby-lang
krz has joined #ruby-lang
ecnalyr has quit [Remote host closed the connection]
Kabaka has quit [Remote host closed the connection]
hahuang65 has quit [Quit: Computer has gone to sleep.]
Oak has joined #ruby-lang
Oak has joined #ruby-lang
Oak has quit [Changing host]
* Oak
waves
johnnytao has joined #ruby-lang
D9 has quit [Quit: Leaving]
iliketurtles has joined #ruby-lang
io_syl has joined #ruby-lang
io_syl_ has joined #ruby-lang
johnnytao has quit [Ping timeout: 248 seconds]
joshuawscott has quit [Quit: Leaving.]
johnnytao has joined #ruby-lang
flip_digits has quit [Remote host closed the connection]
Johnny_ has joined #ruby-lang
Johnny_ has quit [Client Quit]
io_syl_ has quit [Quit: Computer has gone to sleep.]
Johnny_ has joined #ruby-lang
diegoviola has joined #ruby-lang
johnnytao has quit [Ping timeout: 268 seconds]
johnnytao has joined #ruby-lang
johnnytao has quit [Client Quit]
Johnny_ has quit [Quit: Leaving]
jonahR has joined #ruby-lang
swav_ has quit [Remote host closed the connection]
cmaxw_ has joined #ruby-lang
swav has joined #ruby-lang
henrikhodne has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
bzalasky has joined #ruby-lang
dhruvasagar has joined #ruby-lang
cmaxw_ has quit [Read error: Connection reset by peer]
bzalasky has quit [Remote host closed the connection]
cmaxw__ has joined #ruby-lang
iliketurtles has quit [Quit: zzzzz…..]
roadt__ has quit [Ping timeout: 240 seconds]
roadt__ has joined #ruby-lang
brianpWins has joined #ruby-lang
duphus has joined #ruby-lang
MrPoT4tO has quit [Read error: Connection reset by peer]
mistym has joined #ruby-lang
cordax has joined #ruby-lang
Y_Ichiro has quit [Ping timeout: 240 seconds]
Y_Ichiro has joined #ruby-lang
Y_Ichiro has quit [Changing host]
Y_Ichiro has joined #ruby-lang
rshetty has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 240 seconds]
Domon has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
iliketurtles has joined #ruby-lang
PaulePanter has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
_ffio_ is now known as ffio
mistym has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
jsullivandigs has quit [Remote host closed the connection]
vbatts has quit [Ping timeout: 264 seconds]
jsullivandigs has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 240 seconds]
tenderlove has joined #ruby-lang
jsullivandigs has joined #ruby-lang
cschneid has quit [Read error: Operation timed out]
vlad_starkov has joined #ruby-lang
iliketurtles has quit [Quit: zzzzz…..]
hahuang65 has joined #ruby-lang
cschneid has joined #ruby-lang
roadt__ has quit [Ping timeout: 240 seconds]
roadt__ has joined #ruby-lang
iliketurtles has joined #ruby-lang
bzalasky has joined #ruby-lang
jonahR has quit [Quit: jonahR]
<henrikhodne>
Is there some easy way to get a Hash from an array where the keys are unique elements and the values are the counts of the elements? So %w[foo foo bar foobar bar baz].magic_function == { "foo" => 2, "bar" => 2, "foobar" => 1, "baz" => 1 }
adambeynon has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 240 seconds]
<henrikhodne>
Ah, I just realised that I solved this very problem a few days ago. ary.uniq.inject({}) { |hsh, word| hsh.merge(word => ary.count(word) }
zoo-zed has joined #ruby-lang
zoo-zed has quit [Client Quit]
zoo-zed has joined #ruby-lang
workmad3 has quit [Ping timeout: 240 seconds]
io_syl has quit [Quit: io_syl]
zoo-zed has quit [Client Quit]
zoo-zed has joined #ruby-lang
cmaxw__ has quit [Read error: Connection reset by peer]
zoo-zed has quit [Client Quit]
cmaxw_ has joined #ruby-lang
rshetty has quit [Ping timeout: 240 seconds]
scottj has joined #ruby-lang
dagobah has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 268 seconds]
Guest27023 has quit [Changing host]
Guest27023 has joined #ruby-lang
Guest27023 has joined #ruby-lang
benlovell has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
brianpWins has joined #ruby-lang
Domon has joined #ruby-lang
bzb has quit [Quit: I hate to quit but my bladder's full. :-(]
cmaxw_ has quit [Quit: cmaxw_]
flip_digits has joined #ruby-lang
tomkadwill has joined #ruby-lang
flip_digits has quit [Ping timeout: 264 seconds]
tomkadwill has quit [Remote host closed the connection]
joeroot has joined #ruby-lang
ryez has joined #ruby-lang
<henrikhodne>
heftig: I realised that I only allow two different values in the array, so I ended up with { "foo" => ary.count("foo"), "bar" => ary.count("bar") }
<heftig>
henrikhodne: still traverses the array twice
gja has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
mdedetrich has joined #ruby-lang
<diegoviola>
is mocking and stubbing in rspec about faking objects for testing?
<diegoviola>
i'm new with tdd/bdd
<henrikhodne>
heftig: True. The arrays won't be long enough for this to be a significant performance hit, though.
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
diegoviola was kicked from #ruby-lang by apeiros [cross-posting without telling that you cross-post is not welcome. this is only a kick, not a ban, take it as a warning.]
diegoviola has joined #ruby-lang
<diegoviola>
sorry
solars has joined #ruby-lang
joeroot has quit [Quit: Leaving...]
bzalasky has joined #ruby-lang
ChristianS has joined #ruby-lang
firstdayonthejob has quit [Quit: WeeChat 0.4.1]
tobiasvl has joined #ruby-lang
cordax has quit [Quit: Computer has gone to sleep.]
stan has joined #ruby-lang
julweber has joined #ruby-lang
vbatts has joined #ruby-lang
duphus has quit [Quit: Leaving.]
gja has quit [Quit: This computer has gone to sleep]
vikhyat has joined #ruby-lang
marr has joined #ruby-lang
Nss has joined #ruby-lang
ffio has quit [Ping timeout: 240 seconds]
ffio_ has joined #ruby-lang
PaulePanter has joined #ruby-lang
<yorickpeterse>
morning
mytrile has joined #ruby-lang
rsync has quit [Ping timeout: 240 seconds]
hhatch has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
julweber has quit [Remote host closed the connection]
fosky has quit [Ping timeout: 240 seconds]
fosky has joined #ruby-lang
rolax has joined #ruby-lang
rolax has quit [Remote host closed the connection]
<gnufied>
what we need is to fun a kick starter so as Yorick can hire a QA team
<gnufied>
fund*
<yorickpeterse>
I have a Q&A team, it's the internet :)
<ledestin>
running the lint on many ruby projects should do it
<yorickpeterse>
ledestin: correct, but first need to solve some false positives in Rails
<gnufied>
I meant QA team, not Q&A team
<yorickpeterse>
there's a difference?
<whitequark>
quality assurance vs questions and answers
<gnufied>
^
<yorickpeterse>
right
<yorickpeterse>
I thought they were the same
<whitequark>
lol
mbj_ has joined #ruby-lang
<judofyr>
:D
mbj has quit [Ping timeout: 240 seconds]
anonymuse has joined #ruby-lang
<judofyr>
yorickpeterse: what's up with develop and master branches?
<yorickpeterse>
master is stable, develop is semi stable
<yorickpeterse>
It's a pretty common pattern actually
cmaxw_ has joined #ruby-lang
<yorickpeterse>
master only gets updated between releases
<whitequark>
antipattern
<whitequark>
;)
<judofyr>
tag == stable, master == latest
<whitequark>
^
<yorickpeterse>
haha, go tell that to every big project out there
<whitequark>
like linux?
<judofyr>
and Rails?
<whitequark>
Rails isn't exactly big :p
<whitequark>
also yeah
<judofyr>
no, but it's in the context of Ruby development
<yorickpeterse>
ehm, not entirely
vlad_starkov has joined #ruby-lang
<yorickpeterse>
it's pretty common in non dickfarts projects (not just in Ruby land) to have some sort of stable branch to allow people to make patches without having to deal with your hacks and what not
<whitequark>
yorickpeterse: that's not exactly how it works
<whitequark>
you maintain a branch for each stable release
<yorickpeterse>
that's a different pattern?
<whitequark>
it doesn't make sense to just have "a" stable branch
<yorickpeterse>
it makes perfect sense
<DefV>
not really
<yorickpeterse>
I'm not going to bikeshed about it, deal with it
anonymuse has quit [Remote host closed the connection]
<whitequark>
look at the rationale for separated develop and master branches
<gnufied>
I have seen as well people using so called "develop" branch.
anonymuse has joined #ruby-lang
<gnufied>
but it does not make any sense for open source gem/pkg projects
<yorickpeterse>
whitequark: can you for once not be a fucking ass and try to understand the reasoning behind it?
<yorickpeterse>
"OH SHIT IT DOESN'T SAY X IN THE FIRST PARAGRAPH, TL;DR THEREFOR IT'S WRONG"
<yorickpeterse>
I'd love to explain it but not right now, I'm dealing with CRUD
<whitequark>
yorickpeterse: I understand the reasoning behind it, I simply consider it unnecessary
arcz has joined #ruby-lang
gja has quit [Quit: This computer has gone to sleep]
Squarepy has joined #ruby-lang
<yorickpeterse>
Assuming people have problems with it (e.g. they keep comitting shit in the wrong branch) I'll merge the two together, but until then I'd prefer to keep them separate
anonymuse has quit [Ping timeout: 276 seconds]
<yorickpeterse>
I may be a pedantic dick but I don't really have problems with reconsidering things if it makes things easier
<whitequark>
yes you are
<whitequark>
well, pedantic at least
wmoxam has joined #ruby-lang
<yorickpeterse>
I'm both, trust me
<yorickpeterse>
at least when it comes to IT
<yorickpeterse>
I suppose I'm like Linus but a factor of 10 less bad
<yorickpeterse>
Plus I'd prefer not to yell at contributors unless they do stupid things on purpose
<whitequark>
Linus doesn't either
<yorickpeterse>
I suppose the best way to piss me off would be to take a random project of mine, fork it, relicense it under the WTFPL and submit a PR
zz_jus is now known as jus
<yorickpeterse>
and I probably shouldn't have said that
vlad_starkov has quit [Remote host closed the connection]
sethetter has joined #ruby-lang
sethetter has left #ruby-lang [#ruby-lang]
scampbell has joined #ruby-lang
mnngfltg has quit [Quit: Ex-Chat]
<yorickpeterse>
Fuckit, I'm merging the two branches. whatever, yolo, etc
<yorickpeterse>
Seeing how this also fixes some issues with Codeclimate (DIFFERENT BRANCHES WHAT'S THAT?) and friends
<zzak>
injekt: ping
rshetty has quit [Quit: Sleeping]
Mon_Ouie has joined #ruby-lang
<yorickpeterse>
ugh, `distance_of_time_in_words` is such a dumb name
<yorickpeterse>
PIG DISGUSTING
mucker has joined #ruby-lang
kstuart has joined #ruby-lang
<yorickpeterse>
might as well have called it carpal_tunnel_syndrome
rickruby has quit [Remote host closed the connection]
<zzak>
yorick
<zzak>
how_much_coffee_did_you_have_today_so_far?
<kalleth>
Drinking::NotEnoughCaffeineException
<yorickpeterse>
zzak: I don't drink coffee
<yorickpeterse>
The smell alone makes me barf
<yorickpeterse>
But that reminds me, I should probably make some tea
* whitequark
places a cup under yorickpeterse's face
<yorickpeterse>
whitequark: enjoy the arm pain by holding that cup up! Ha! Take that!
<whitequark>
yorickpeterse's not going to write a partial evaluator good enough to detect autoloading in general case
<whitequark>
because that partial evaluator is called rubinius
<judofyr>
whitequark: re: Foundry: I'm still wondering if there's a decent market for embedded Ruby. but it sure is an interesting technical project :)
<whitequark>
judofyr: at first, I'm aiming at hobbyists
<yorickpeterse>
judofyr: I'm not aiming to deal with the stuff like Camping
<yorickpeterse>
it's too meta-wtf
<whitequark>
judofyr: since folks who do actual embedded work are insanely conservative and also have quite higher demands, so that'll take some time to get Foundry in the necessary shape
<yorickpeterse>
either way, hopefully I can tackle this in at least a basic form before August 1st
<whitequark>
years, perhaps.
<whitequark>
but I'm completely sure that there is a need for a much more flexible language with C/C++ perf characteristics
<judofyr>
whitequark: I've probably asked you before, but what are your thoughts on Rust?
<whitequark>
judofyr: it's a fine language, but has two problems
<whitequark>
1) insane churn. they really don't know what they want their language to do. and it doesn't seem that the churn slows down significantly :/
<whitequark>
2) it has metaprogramming in form of template macros, which sucks even more than autoconf+cpp
<yorickpeterse>
"I need dis...and dis...and dis" - Rust
fosky has joined #ruby-lang
<whitequark>
also yes, I believe that everyone who does metaprogramming with macros is fundamentally wrong :3
<yorickpeterse>
The african american dude is pretty funny
skmp has joined #ruby-lang
<judofyr>
specially when the music stops
<yorickpeterse>
haha yeah
cored has quit [Ping timeout: 240 seconds]
<yorickpeterse>
"how much is it, I'll take two"
<judofyr>
I think I've played this song maybe 20 times today
<judofyr>
(or, the video)
<yorickpeterse>
the hipster dude is also fun
<yorickpeterse>
"I've heard it much earlier when it first came out"
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<yorickpeterse>
"Some super girl some feminist would approve of" haha
xxaM has quit [Quit: ZZzZzzZzzZZ]
<judofyr>
and that jr. high school student
<yorickpeterse>
haha
<judofyr>
so skeptical
<judofyr>
oh well
marr has joined #ruby-lang
<judofyr>
there went my productivity
elia has joined #ruby-lang
fosky has quit [Ping timeout: 240 seconds]
kstuart has quit [Ping timeout: 264 seconds]
dhruvasagar has joined #ruby-lang
Cakey has joined #ruby-lang
tbuehlmann has joined #ruby-lang
benlovell has quit [Ping timeout: 264 seconds]
hhatch has quit [Read error: Connection reset by peer]
havenwood has joined #ruby-lang
glebm has joined #ruby-lang
Cakey has quit [Read error: Connection reset by peer]
snarfmason has joined #ruby-lang
benlovell has joined #ruby-lang
cmaxw_ has quit [Ping timeout: 268 seconds]
<yorickpeterse>
bah, my flawless code is not so flawless after all
skade has quit [Quit: Computer has gone to sleep.]
snarfmason has quit [Client Quit]
<yorickpeterse>
MySQL question that's related: if I do a JOIN on 25 rows (the joined table has like a bazillion rows), does it only join those 25 or does it gobble everything up and then filter out what it needs?
<yorickpeterse>
so it's basically 25 -> N where I only need 25 of N
cmaxw_ has joined #ruby-lang
<yorickpeterse>
if that makes sense
zomgbie has quit [Read error: Connection reset by peer]
Drago has joined #ruby-lang
Drago has quit [Client Quit]
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
hhatch has joined #ruby-lang
elia has quit [Ping timeout: 240 seconds]
adwhit has quit [Ping timeout: 245 seconds]
elia has joined #ruby-lang
adwhit has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 256 seconds]
<judofyr>
yorickpeterse: EXPLAIN is your friend
<apeiros>
AAAARGH IEEEEEEEEE!!!!!
<whitequark>
EXPLAIN SELECT yorickpeterse(code) FROM github WHERE repo = "rails/rails";
<apeiros>
IE8 & CSS == russian roulette
<yorickpeterse>
meh, I fixed it by not joining and just doing a WHERE on the column in question. Associated data seems to always exist anyway