<pustoye>
And I can't figure out how to get it to return 1
bradsmith has quit [Read error: Connection reset by peer]
_tockitj has joined #ruby-lang
<bnagy>
show code - use gist or pastie
bradsmith has joined #ruby-lang
<bnagy>
because what you said is impossible :)
LauraE has quit [Remote host closed the connection]
<bnagy>
(also ace is 1 or 11 ;)
<pustoye>
well that sounds like a bad sign. Okay, one minute
<pustoye>
Yeah, I know, but I have it assigned to 1 in the hash so that I can calculate an initial score, then sweep through again and see if I need to consider another score
naquad has quit [Ping timeout: 260 seconds]
chokesmaster has quit [Remote host closed the connection]
naquad has joined #ruby-lang
wmoxam has joined #ruby-lang
Sanjay has quit [Remote host closed the connection]
felipe has quit [Ping timeout: 260 seconds]
Sanjay has joined #ruby-lang
<pustoye>
okay, here's the code. The hash is at the beginning followed by the method I'm working on. http://pastie.org/8213704
<pustoye>
If you need more, I could paste in the whole thing, but it's still pretty messy
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
<bnagy>
why is the card self[0][0] ? It looks like it should be just an array of cards
<bnagy>
like [:Ace, :Queen]
dhruvasagar has quit [Ping timeout: 245 seconds]
bradsmith has quit [Remote host closed the connection]
<pustoye>
each card has a number and a suit
<pustoye>
so it's like [[:Ace, :Spades], [:Queen, :Hearts]]
<pustoye>
I could probably work around that if I have to, but I don't see why it should be causing a problem
mdedetrich has quit [Quit: Computer has gone to sleep.]
jsullivandigs has quit [Ping timeout: 264 seconds]
<pustoye>
oh, and I'm running Ruby 1.8.7 in case that matters
<bnagy>
pustoye: basically, I want to see the code around where you can have p self[0][0] => :Ace and p CARD_VALUES[self[0][0]] => nill right next to each other
rickhull has quit [Quit: Leaving.]
<lianj>
pustoye: look at my def value
jsullivandigs has joined #ruby-lang
<pustoye>
lianj: looking at it, and I think it might solve my problem by letting me ditch my hash map entirely! I'll let you know in a minute if it works.
<pustoye>
bnagy: sure, one sec, need to recreate the code I added for testing
fosky has joined #ruby-lang
dhruvasagar has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
gja has joined #ruby-lang
mdedetrich has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
<bnagy>
lianj: btw giving people a canned solution when they're writing things as a learning exercise is kind of uncool
<bnagy>
imho anyway
setmeaway has quit [Ping timeout: 268 seconds]
<pustoye>
it's cool, I'll have to modify it to make it work for my code anyway, and I appreciate the help
Sanjay has quit [Remote host closed the connection]
<pustoye>
that outputs :Ace, 1, nil
<pustoye>
or whatever card is drawn, 1, nil
hahuang65 has joined #ruby-lang
<bnagy>
... change all the puts to p
<bnagy>
and then I guess I'd have to see all the code at once - you can use eval.in or something, that will run code for you in a sandbox
<pustoye>
oh, hah, that shows how much of a newbie I am, I guess
<lianj>
pustoye: what about two aces? :)
<pustoye>
lianj: hmm? What do you mean?
<bnagy>
just that the rest of your algorithm is a bit broken
<bnagy>
but let's fix first things first
cads has quit [Ping timeout: 264 seconds]
<pustoye>
2 aces shouldn't be a problem, should it? Only one can take on a value of 11 or else you bust
<bnagy>
what aboout AA
<bnagy>
I can hit 12 can't I?
jxie has quit [Ping timeout: 240 seconds]
_helloworld_ has joined #ruby-lang
<pustoye>
yeah. But this goes through, assigns an initial value of 2, then it sees that there's an ace, so it returns 2+12 as a second value. It should be the same as having one ace, basically, since one of your aces has to be counted as 1 point or else you bust
siberia has joined #ruby-lang
<pustoye>
am I missing something?
<bnagy>
... no, actually I don't think so :)
mdedetrich has quit [Quit: Computer has gone to sleep.]
<bnagy>
I just read too fast
<pustoye>
oh good, after the last few hours trying to fix bugs like this, you could seriously convince me that I'm crazy if you wanted to
<lianj>
yea i think pustoye is right
<bnagy>
there are only ever two scores, and they're always 10 apart
<bnagy>
so.. now back to the impossible thing :P
<bnagy>
all I can see is that self[0][0] outputs as :Ace but it's not actually a symbol
<bnagy>
which is why I said to use p not puts
bradsmith has joined #ruby-lang
banister has quit [Remote host closed the connection]
<pustoye>
it actually is a symbol, though! I tested that too
<pustoye>
which is why I think I'm going crazy
<pustoye>
But I tracked down the bug to a different part of my program, although I'm still confused about why it exists. If I hard code into my Shoe class (basically a deck) to send [:Ace, :Queen] when I invoke hand.draw, then CARD_VALUES[self[0][0]] does not return nil
jxie has joined #ruby-lang
<pustoye>
Even though whenever I try looking at all the values in the array self, it looks fine
s_s_l has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 276 seconds]
dhruvasagar has quit [Ping timeout: 245 seconds]
mistym has joined #ruby-lang
kristof has joined #ruby-lang
dhruvasagar has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
brushbox has joined #ruby-lang
kristof has left #ruby-lang [#ruby-lang]
setmeaway has quit [Quit: Leaving]
krasnus has joined #ruby-lang
dagobah has joined #ruby-lang
Senjai has quit [Quit: "Girlfriend Needs Me :/"]
wallerdev has quit [Quit: wallerdev]
relix has joined #ruby-lang
wallerdev has joined #ruby-lang
lele has joined #ruby-lang
fragamus has joined #ruby-lang
rshetty has quit [Quit: Sleeping]
dc5ala has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
gja has joined #ruby-lang
rshetty has joined #ruby-lang
Kabaka has quit [Ping timeout: 240 seconds]
bousquet has joined #ruby-lang
bousquet has quit [Remote host closed the connection]
bousquet has joined #ruby-lang
skepti has joined #ruby-lang
Kabaka has joined #ruby-lang
TvL2386 has joined #ruby-lang
gja has quit [Quit: This computer has gone to sleep]
iliketurtles has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
brushbox has joined #ruby-lang
mistym has quit [Remote host closed the connection]
joshuawscott has joined #ruby-lang
solars has joined #ruby-lang
joshuawscott has quit [Client Quit]
jxie_ has joined #ruby-lang
joshuawscott has joined #ruby-lang
joshuawscott has quit [Client Quit]
brushbox has quit [Quit: Leaving.]
brushbox has joined #ruby-lang
amerine has quit [Quit: Computer has gone to sleep.]
iliketurtles has quit [Quit: zzzzz…..]
mistym has joined #ruby-lang
jxie_ has quit [Client Quit]
jxie has quit [Quit: leaving]
jxie has joined #ruby-lang
GeissT has joined #ruby-lang
joshuawscott has joined #ruby-lang
richardburton has joined #ruby-lang
maxmanders has joined #ruby-lang
felipe has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
gja has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
mistym has quit [Remote host closed the connection]
arBmind has joined #ruby-lang
amerine has joined #ruby-lang
joshuawscott has quit [Quit: Leaving.]
rshetty has quit [Quit: Sleeping]
jsullivandigs has quit [Ping timeout: 264 seconds]
judofyr has joined #ruby-lang
mytrile has joined #ruby-lang
<judofyr>
charliesome: congrats!
kristof has joined #ruby-lang
<charliesome>
judofyr: thanks :D
<judofyr>
charliesome: dem exploits finally paid off!
<judofyr>
or something
matled has quit [Read error: Operation timed out]
matled- has joined #ruby-lang
kristof has quit [Client Quit]
matled- is now known as matled
<charliesome>
judofyr: dem ruby hacks
<judofyr>
;)
<judofyr>
so what are you going to do?
<charliesome>
lots of cruby hacking
<judofyr>
cool
<charliesome>
performance stuff
skepti has quit [Quit: Leaving]
<bnagy>
congrats, charliesome
<charliesome>
bnagy: thank you :)
bousquet has quit [Remote host closed the connection]
<bnagy>
are you old enough to drink in the US?
<charliesome>
bnagy: nope
<bnagy>
:>
krasnus has quit [Ping timeout: 276 seconds]
<charliesome>
which is why i'm gonna be remote from australia!
<judofyr>
that's certainly remote
<bnagy>
even cooler
<bnagy>
you can have a semi-insane police state instead of totally insane
crudson has left #ruby-lang [#ruby-lang]
<charliesome>
the less insane the better as i always say
elia has joined #ruby-lang
<bnagy>
I've been here for almost 8 weeks, visiting, and I am So Done
<bnagy>
helps if you don't ever read any newspapers or watch any TV though
wallerdev has quit [Quit: wallerdev]
io_syl has quit [Quit: io_syl]
marr has joined #ruby-lang
benlovell has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
jaimef has quit [Ping timeout: 264 seconds]
jxie has quit [Quit: leaving]
yfeldblum has joined #ruby-lang
jxie has joined #ruby-lang
jaimef has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby-lang
rshetty has joined #ruby-lang
kurko_ has quit [Ping timeout: 264 seconds]
kurko_ has joined #ruby-lang
mdedetrich has joined #ruby-lang
Cakey has quit [Ping timeout: 245 seconds]
Harzilein has joined #ruby-lang
<Harzilein>
hi
<judofyr>
hi Harzilein
<Harzilein>
do you know of non-html yard templates?
<Harzilein>
i'd like to look at one for my plan to be able to render to perlpod
skade has joined #ruby-lang
mdedetrich has quit [Client Quit]
<judofyr>
ah, nope, don't know how that works
<judofyr>
Harzilein: maybe see how it generates RI-files?
<judofyr>
or does it generate RI files?
vlad_starkov has joined #ruby-lang
<Harzilein>
i think it can indeed generate ri files, there's even a convenience shortcut for it, yri
dhruvasagar has quit [Ping timeout: 240 seconds]
<judofyr>
then I would start there
<Harzilein>
i wonder how i did not manage to think of that before, thanks
vlad_starkov has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
minivan has joined #ruby-lang
<gnufied>
congrats charliesome!
<charliesome>
gnufied: thanks :D
<Harzilein>
it appears i'll need my own command line frontend anyway, as the docs keeps pointing out that the generate method used by the cli frontend is mostly geared towards rendering html
vlad_starkov has joined #ruby-lang
kith_ is now known as kith
dhruvasagar has quit [Ping timeout: 245 seconds]
<maloik>
charliesome: new job? where/what ? :o
<charliesome>
maloik: github
dhruvasagar has joined #ruby-lang
kstuart has joined #ruby-lang
<maloik>
oh cool
<maloik>
(just found via the twitters)
<maloik>
also: one of the best gifs I've seen, well played
<charliesome>
heh thanks
yatish27 has joined #ruby-lang
<yorickpeterse>
morning
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
krasnus has joined #ruby-lang
jmeeuwen has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
brushbox has joined #ruby-lang
<charliesome>
yorickpeterse: mornin
<jonahR>
Hello everyone, I wrote a new CoderWall post: RSpec Test Results in HTML - https://coderwall.com/p/gfmeuw (PS. I'm not a bot)
joshuawscott has joined #ruby-lang
<gnufied>
hmm
arBmind has quit [Quit: Leaving.]
<gnufied>
judofyr: xavier is moving all bundler feature requests to new location. and bundler/bundler for only issues.
<maloik>
people dont say 'im not a bot', that's like liars instantly going 'im not lying' !
<maloik>
:D
sascha_d has quit [Quit: obai]
minivan1 has joined #ruby-lang
linc01n has quit [Ping timeout: 240 seconds]
minivan has quit [Ping timeout: 240 seconds]
<gnufied>
something I don't necessarily agree with. :-)
<jonahR>
yeah, that does sound like what a bot would say
hashkey has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
<maloik>
although we actually just asked them to let us rewrite the entire thing
<crazyhorse>
judofyr: sweet
vlad_starkov has joined #ruby-lang
jxie has joined #ruby-lang
<crazyhorse>
i need to get a process to run 24/7 on a windows machine.. obviously i won't have anything like cron or upstart to make sure it's always running
<crazyhorse>
how can you keep ruby processes running on windows?
<gnufied>
interesting problem.
<krasnus>
you could try something like sucker_punch for scheduling
<gnufied>
most of ruby specific tools that daemonize and watch processes are unix specific
<crazyhorse>
having something on all the time is more .. make sure this is running rather than scheduling
jsullivandigs has quit [Ping timeout: 245 seconds]
gja has joined #ruby-lang
gja has joined #ruby-lang
gja has quit [Changing host]
stardiviner has quit [Remote host closed the connection]
stardiviner has joined #ruby-lang
<maloik>
makes me wonder why I spend my time working on shitty web apps when I could be working on laser fingers
jxie__ has joined #ruby-lang
jxie___ has joined #ruby-lang
jxie has quit [Ping timeout: 245 seconds]
jxie_ has quit [Ping timeout: 245 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brushbox has quit [Quit: Leaving.]
brushbox has joined #ruby-lang
banister has joined #ruby-lang
barttenbrinke has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
dhruvasagar has quit [Read error: Connection reset by peer]
bondar has joined #ruby-lang
bondar has quit [Excess Flood]
ldnunes has joined #ruby-lang
Sanjay has joined #ruby-lang
yatish27 has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
relix has joined #ruby-lang
realDAB has joined #ruby-lang
stardiviner has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
relix has quit [Client Quit]
<yorickpeterse>
lol APIs with a rate limit of basically 1 request per 5 seconds
mdedetrich has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
"YOU'RE CALLING THIS API TOO OFTEN" I hit F5 twice in 10 seconds or so
<whitequark>
yorickpeterse: an excellent example of fuck you engineering
<yorickpeterse>
"You are calling the XXXX API more often than is necessary to keep up with the availability of new articles" I waited another few seconds
<yorickpeterse>
SO MUCH FOR A TRIAL
<yorickpeterse>
oh and now it just gives me empty XML
arBmind has quit [Read error: Connection reset by peer]
<whitequark>
#yorickpeterse-rage
arBmind has joined #ruby-lang
<yorickpeterse>
"The average customer should schedule calls every 30 seconds. "
yatish27 has quit [Remote host closed the connection]
barttenbrinke has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
richardburton has joined #ruby-lang
ffio has joined #ruby-lang
mdedetrich has joined #ruby-lang
barttenbrinke has joined #ruby-lang
richardburton has quit [Ping timeout: 240 seconds]
mdedetrich has quit [Read error: Connection reset by peer]
yatish27 has joined #ruby-lang
mdedetrich has joined #ruby-lang
heftig has quit [Quit: Quitting]
heftig has joined #ruby-lang
jxie__ has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
jxie has joined #ruby-lang
mdedetrich has quit [Ping timeout: 264 seconds]
barttenbrinke has quit [Remote host closed the connection]
<yorickpeterse>
"Since Charlie is not old enough to drink in the States, we expect him to take over the responsibilities of GitHub's infrastructure while the rest of us are out partying." hahaha
<darix>
is not exactly a good method name mvisi
barttenbrinke has quit [Remote host closed the connection]
brushbox has quit [Quit: Leaving.]
<maloik>
he did say he was going to work remotely from australia
<maloik>
(drunkard!)
<yorickpeterse>
lucky son of a bitch
<yorickpeterse>
Though this means he'll probably no longer maintain his code, like any true Githubber
<ericwood>
yorickpeterse: congrats on the whole github thing!
dhruvasagar has quit [Ping timeout: 264 seconds]
pipework is now known as tiredwork
dhruvasagar has joined #ruby-lang
duphus has joined #ruby-lang
richardburton has quit [Ping timeout: 276 seconds]
siberia has joined #ruby-lang
hahuang65 has quit [Ping timeout: 276 seconds]
gja has quit [Quit: This computer has gone to sleep]
w00x has joined #ruby-lang
taylos87 has joined #ruby-lang
SamT has joined #ruby-lang
<maloik>
I love how I can spend time reading through pirate lingo and consider it my job
SamT is now known as Guest81303
Guest81303 has quit [Client Quit]
sjltaylor has joined #ruby-lang
<whitequark>
yarrr
<PaulePanter>
Can you think of any advantages of using `==` over `.eql?` or vice versa?
brett_ has joined #ruby-lang
<ericwood>
no
yhsgw has left #ruby-lang [#ruby-lang]
<ericwood>
they're both function calls
<PaulePanter>
Using .eql? shows that Ruby is more object oriented?
<ericwood>
yeah but don't do that
<ericwood>
== is more idiomatic
duphus has quit [Quit: Leaving.]
<PaulePanter>
ericwood: Ok. Thanks.
<yorickpeterse>
ericwood: eh wat
<yorickpeterse>
I don't work there
ssb123 has joined #ruby-lang
<ericwood>
yorickpeterse: wait
Uranio has joined #ruby-lang
<yorickpeterse>
charliesome works there
<ericwood>
oh
<ericwood>
I suck at names :(
<ericwood>
sorry
<ericwood>
congrats on other stuff though?
* realDAB
congratulates everyone on everything, just in case
sjltaylor has quit [Client Quit]
<maloik>
sweet, thanks
<ericwood>
yeah, thanks realDAB
ledestin has quit [Quit: ledestin]
banister has left #ruby-lang [#ruby-lang]
kurko_ has joined #ruby-lang
banisterfiend has joined #ruby-lang
<banisterfiend>
PaulePanter: == and eql? actually have different behaviour
cads has joined #ruby-lang
<ericwood>
banisterfiend: I had a feeling that was the case but he should really just be using ==
<banisterfiend>
ericwood: depends what he's doing :)
<banisterfiend>
4 == 4.0 #=> true
<banisterfiend>
4.eql?(4.0) #=> false
<ericwood>
so it's almost like == vs. === in JS? :P
<banisterfiend>
that would be .equal? vs ==, i think
<banisterfiend>
.equal? afaik is essentially obj1.object_id == obj2.object_id
<ericwood>
aaah okay
enebo has joined #ruby-lang
<ericwood>
that makes more sense
<whitequark>
.equal? is identity comparison, yeah
<realDAB>
by coincidence, i'm just getting to the section on object equality in my revisions of the well-grounded rubyist
<ericwood>
it's useful for resolving identity crisis
barttenbrinke has joined #ruby-lang
cads has quit [Max SendQ exceeded]
brushbox has joined #ruby-lang
cads has joined #ruby-lang
GeissT has quit [Quit: MillBroChat AdIRC User]
vlad_starkov has quit [Remote host closed the connection]
mdedetrich has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
hurr hurr
Sanjay has quit [Remote host closed the connection]
Sanjay has joined #ruby-lang
brushbox has quit [Ping timeout: 246 seconds]
<ericwood>
I'll be here all week, don't forget to tip your waiter
realDAB has quit [Quit: realDAB]
nathanstitt has joined #ruby-lang
Sanjay has quit [Ping timeout: 264 seconds]
AndChat| has joined #ruby-lang
hogeo has quit [Remote host closed the connection]
rwilcox has joined #ruby-lang
<yorickpeterse>
Today is one of those days where I feel like I'm driving a truck at 200 km/h while swapping out the engine and trying to steer at the same time
<yorickpeterse>
(code-wise)
<yorickpeterse>
"This part is broken, fuckit I'll ninja-refactor it while also trying to do other things"
<whitequark>
cue yorickpeterse getting fired
<yorickpeterse>
How so? It's effectively part of my job description
<yorickpeterse>
(not actually driving a truck at 200 km/h, I don't even have a driver's license_
<whitequark>
*facepalm*
realDAB has joined #ruby-lang
<whitequark>
facepalm
* whitequark
giggles
relix has joined #ruby-lang
* yorickpeterse
would slap whitequark, but is not being violent today
taylos87 has left #ruby-lang [#ruby-lang]
<yorickpeterse>
BULLSHIT
* yorickpeterse
likes slapping people and randomly picks whitequark to slap
<yorickpeterse>
better
relix has quit [Client Quit]
nneko001__ has quit [Quit: Konversation terminated!]
barttenbrinke has quit [Remote host closed the connection]
rwilcox has quit [Quit: Leaving.]
barttenbrinke has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 276 seconds]
rwilcox has joined #ruby-lang
wallerdev has joined #ruby-lang
jxpx777 has joined #ruby-lang
ffio_ has joined #ruby-lang
ffio has quit [Ping timeout: 264 seconds]
bradsmith has joined #ruby-lang
bradsmith has quit [Remote host closed the connection]
bradsmith has joined #ruby-lang
_helloworld_ has quit [Remote host closed the connection]
richardburton has joined #ruby-lang
jxie has joined #ruby-lang
jxie___ has quit [Ping timeout: 276 seconds]
thepumpkin has joined #ruby-lang
jxie_ has joined #ruby-lang
sjltaylor has joined #ruby-lang
jsullivandigs has joined #ruby-lang
rwilcox has quit [Quit: Leaving.]
yatish27 has quit [Remote host closed the connection]
rwilcox has joined #ruby-lang
killthe|misc is now known as killtheliterate
wallerdev has quit [Quit: wallerdev]
hahuang65 has joined #ruby-lang
<sjltaylor>
how to I make a pull request to the standard library?
Bosox20051 has quit []
thepumpkin has quit [Ping timeout: 245 seconds]
<banisterfiend>
sjltaylor: same way you make any pull request to mri i'd imagine
MaddinXx has quit [Remote host closed the connection]
marr has quit [Ping timeout: 245 seconds]
banister has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
richardburton has joined #ruby-lang
<rickhull>
electric flyswatters are so much fun
saarinen has joined #ruby-lang
pipework is now known as grumpwork
yatish27 has quit [Remote host closed the connection]
<yorickpeterse>
My cat normally kills them but couldn't keep up
<yorickpeterse>
Having some spiders would probably help too
<yorickpeterse>
but alas, my cat kills those too
saarinen has quit [Client Quit]
arooni-mobile has quit [Ping timeout: 264 seconds]
brushbox has joined #ruby-lang
havenwood has quit [Ping timeout: 246 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
retro|cz has quit [Ping timeout: 264 seconds]
<_jpb_>
blist online
<_jpb_>
blist online
<_jpb_>
blist
brushbox has quit [Ping timeout: 256 seconds]
_jpb_ has quit [Quit: leaving]
_jpb_ has joined #ruby-lang
MaddinXx has joined #ruby-lang
<yorickpeterse>
wat
saarinen has joined #ruby-lang
cored has quit [Ping timeout: 276 seconds]
_helloworld_ has joined #ruby-lang
_helloworld_ has quit [Remote host closed the connection]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
efrainolivares has joined #ruby-lang
jonahR has joined #ruby-lang
Senjai has quit [Ping timeout: 276 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
dvk has joined #ruby-lang
hahuang65_ has joined #ruby-lang
hahuang65_ has quit [Client Quit]
<tubbo>
yorickpeterse: gross.
realDAB has joined #ruby-lang
havenwood has joined #ruby-lang
<apeiros>
/nick unrealDAB
<yorickpeterse>
tubbo: yeah well, TIL flies can reproduce super fast when the weather is hot and you haven't cleaned your trash bin for 2 days
<whitequark>
kill them with fire
saarinen has quit [Quit: saarinen]
banister has joined #ruby-lang
<tubbo>
yorickpeterse: yeah i gotta pretty much scrub down my cat's wet food bowl every day so i don't get flies
<tubbo>
also an exterminator laid down poisons today
ssb123 has quit [Remote host closed the connection]
ssb123 has joined #ruby-lang
<yorickpeterse>
With warm weather they also just fly inside due to the windows open. Probably get one of those tape things
<yorickpeterse>
(the ones you hang on the ceiling)
<yorickpeterse>
* being open
<yorickpeterse>
wohoo, down to 4 false positives in ruby-lint for its own VM
pkrnj has joined #ruby-lang
<yorickpeterse>
(it used to have like 40 false positives)
<yorickpeterse>
though it did spot an actually unused constant, which is good
skade has joined #ruby-lang
banister has left #ruby-lang [#ruby-lang]
banisterfiend has joined #ruby-lang
realDAB has quit [Quit: realDAB]
towski has joined #ruby-lang
glenn_ritz has joined #ruby-lang
glenn_ritz has quit [Remote host closed the connection]
torrieri has joined #ruby-lang
pothibo has joined #ruby-lang
vlad_starkov has joined #ruby-lang
realDAB has joined #ruby-lang
relix has joined #ruby-lang
workmad3 has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
bradsmith has quit [Remote host closed the connection]
saarinen has joined #ruby-lang
mbj has quit [Ping timeout: 264 seconds]
pothibo has quit [Quit: pothibo]
lguardiola has quit [Remote host closed the connection]
Senjai has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
lguardiola has joined #ruby-lang
banister has joined #ruby-lang
havenwood has joined #ruby-lang
efrainolivares has quit [Quit: efrainolivares]
workmad3 has quit [Ping timeout: 248 seconds]
daihuws has joined #ruby-lang
daihuws has quit [Client Quit]
daihuws has joined #ruby-lang
daihuws has left #ruby-lang [#ruby-lang]
mbj has joined #ruby-lang
nickgal has quit [Quit: nickgal]
solars has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
realDAB has quit [Quit: realDAB]
realDAB has joined #ruby-lang
Senjai has quit [Ping timeout: 260 seconds]
efrainolivares has joined #ruby-lang
workmad3 has joined #ruby-lang
netShadow has quit [Quit: netShadow]
efrainolivares has quit [Quit: efrainolivares]
fcahoon has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
danrabinowitz has joined #ruby-lang
Senjai has joined #ruby-lang
Senjai has joined #ruby-lang
saarinen has quit [Quit: saarinen]
hakunin has joined #ruby-lang
marr has joined #ruby-lang
workmad3 has quit [Ping timeout: 276 seconds]
torrieri has quit [Quit: Leaving...]
saarinen has joined #ruby-lang
scmx has joined #ruby-lang
torrieri has joined #ruby-lang
mistym has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
benanne has quit [Ping timeout: 276 seconds]
ssb123 has quit [Remote host closed the connection]
<yorickpeterse>
whitequark: ping
torrieri has quit [Quit: Leaving...]
efrainolivares has joined #ruby-lang
retro|cz has joined #ruby-lang
_helloworld_ has joined #ruby-lang
torrieri has joined #ruby-lang
benanne has joined #ruby-lang
cored has quit [Ping timeout: 256 seconds]
iliketurtles has quit [Quit: zzzzz…..]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
charliesome has joined #ruby-lang
bradsmith has joined #ruby-lang
Quadro has joined #ruby-lang
dernise_ has quit [Quit: This computer has gone to sleep]
torrieri has quit [Quit: Leaving...]
ssb123 has joined #ruby-lang
bradsmith has quit [Ping timeout: 276 seconds]
arooni-mobile has joined #ruby-lang
s0ber_ has joined #ruby-lang
torrieri has joined #ruby-lang
scmx has quit [Ping timeout: 246 seconds]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
s0ber has quit [Ping timeout: 264 seconds]
s0ber_ is now known as s0ber
Uranio has quit [Quit: while you reading this, a kitty dies]
serroft has left #ruby-lang [#ruby-lang]
Quadro has left #ruby-lang [#ruby-lang]
bradsmith has joined #ruby-lang
havenwood has quit [Ping timeout: 260 seconds]
dvk has quit [Quit: Computer has gone to sleep.]
<whitequark>
yorickpeterse: pong
torrieri has quit [Ping timeout: 248 seconds]
duphus has quit [Quit: Leaving.]
rikai_ has quit [Read error: Connection reset by peer]
rikai_ has joined #ruby-lang
<yorickpeterse>
whitequark: do you happen to know if there's a specific name to the case where you use a Hash's keys to keep track if something is used or not? e.g.
anonymuse has quit [Remote host closed the connection]
<yorickpeterse>
numbers = {}; numbers[10] = true; if numbers.key?(10); .....
<whitequark>
ri Set
<yorickpeterse>
basically the more efficient way of doing [...].include?(1)
<yorickpeterse>
Set doesn't actually come with the performance benefit though
<yorickpeterse>
plus it's not a Set
<whitequark>
it does
<apeiros>
um, yes?
<whitequark>
it's a Hash internally.
<apeiros>
Set's point is exactly O(1) add/lookup/delete
nickgal has joined #ruby-lang
<yorickpeterse>
Hmmm
<apeiros>
well, lookup as in presence-check
<whitequark>
amortized O(1)
<whitequark>
but yeah
<yorickpeterse>
Somehow I thought it used an Array
<apeiros>
and what whitequark said - current implementation is a hash anyway
<apeiros>
somewhat sad
<yorickpeterse>
It does bluntly overwrite it though, not sure if there would be anything attached to that
<yorickpeterse>
(performance wise)
<whitequark>
bluntly overwrite ?
<apeiros>
I'd love a native implementation (could still use hash), so set operations would be faster
<yorickpeterse>
as in, #add just calls `@hash[0] = true`
<apeiros>
it's perverse that Set is slower than Array for set operations…
<whitequark>
yorickpeterse: well, so?
<whitequark>
that's how sets work
anonymuse has joined #ruby-lang
<yorickpeterse>
whitequark: I'm not sure if that would be slower than only doing so if the key is not already there
<yorickpeterse>
lets find out!
<whitequark>
no, exactly same
<whitequark>
at least with a proper hash table impl
_helloworld_ has quit [Remote host closed the connection]
arooni-mobile has quit [Ping timeout: 276 seconds]
<apeiros>
setting it only if it isn't already there = 2 lookups
saarinen has quit [Quit: saarinen]
<apeiros>
(unless you "embed" the operation)
<yorickpeterse>
whitequark: using Hash#key? is actuall faster
<apeiros>
but with h[x] = true unless h.key?(x) it definitively does 2 lookups instead of just 1
<whitequark>
it's simple if you know how hashtables work
<yorickpeterse>
heh, rbx shows the exact opposite
<whitequark>
1. it hashes x 2. it finds the bucket 3. it linearly iterates the bucket & performs the desired operation
<whitequark>
so, since []= always replaces, it always needs to iterate the whole bucket
<whitequark>
then it's a difference between appending an element or not appending.
<yorickpeterse>
doesn't that contract you saying the performance should be the same?
<yorickpeterse>
unless I'm misunderstanding
jsullivandigs has joined #ruby-lang
<apeiros>
contradict?
<whitequark>
how so?
<yorickpeterse>
I asked if it would be slower, you mentioned it being the same
<yorickpeterse>
But somehow it's actually faster to use Hash#key? on MRI
<yorickpeterse>
at least in the above silly benchmark
<whitequark>
then MRI has a shitty hashtable impl.
<apeiros>
hm, well, actually
<apeiros>
yorickpeterse: your test is flawed
efrainolivares has quit [Quit: efrainolivares]
<apeiros>
but: .key? for a key which doesn't exist only needs to perform the check on the bucket
<apeiros>
it doesn't need to perform the .eql? test
<apeiros>
since it finds an empty bucket and can then shortcut
<yorickpeterse>
How is my test flawed?
richardburton has quit [Quit: Leaving.]
<yorickpeterse>
it's also faster on jruby apparently
<apeiros>
you only test the scenario where the key is present (after the first loop)
<yorickpeterse>
that's the point, I wanted to see if that specific bit would actually be slower
<apeiros>
but I still don't see why your bench shows 'check' to be faster
<yorickpeterse>
What timings do you get when you run it?
<apeiros>
I didn't run it
<apeiros>
I meant in the sense of "why? why ruby? why? it doesn't make sense!"
arBmind has joined #ruby-lang
<yorickpeterse>
Ah
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mbj_ has joined #ruby-lang
efrainolivares has joined #ruby-lang
mbj has quit [Ping timeout: 240 seconds]
anonymuse has quit [Remote host closed the connection]
_helloworld_ has joined #ruby-lang
havenwood has joined #ruby-lang
arooni-mobile has joined #ruby-lang
anonymuse has joined #ruby-lang
iliketurtles has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
richardburton has joined #ruby-lang
vlad_starkov has joined #ruby-lang
mistym has joined #ruby-lang
Nisstyre has joined #ruby-lang
anonymuse has quit [Remote host closed the connection]
cored has quit [Ping timeout: 256 seconds]
richardburton has quit [Ping timeout: 260 seconds]
rikai_ has quit [Remote host closed the connection]
dhsmith_ has joined #ruby-lang
anonymuse has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 240 seconds]
alekst has joined #ruby-lang
dhsmith has quit [Ping timeout: 276 seconds]
<drbrain>
I think there's a little extra work in Hash#[] than Hash#key?
<whitequark>
drbrain: what would be that?
nickgal has quit [Quit: nickgal]
<drbrain>
if you compare rb_hash_has_key (key?) to rb_hash_aref ([]), key? seems to return immediately for an empty hash while [] returns the default value
<whitequark>
right
<apeiros>
but it's about []=, not []
<drbrain>
to fully determine, we'd need a couple different benchmarks
<drbrain>
there's also the packed entries stuff
<drbrain>
there's a few extra pointer dereferences with [] compared to key?
ssb123 has quit [Remote host closed the connection]
<drbrain>
I'm still unsure why check is faster, []= should do enough more work to lose out
<drbrain>
oh, []= is only called once for check, so it's the extra work in []= that makes no check slower
Dernise has joined #ruby-lang
<drbrain>
if number wasn't constant I would expect the performance to flip
<banister>
happy eid!
<drbrain>
banister: which one?
ldnunes has quit [Quit: Leaving]
Senjai has quit [Ping timeout: 264 seconds]
<banister>
drbrain: this one i guess Eid al-Fitr :)
<zenspider>
my point is none of them are optimized in 1.8 and ||= still wins out.
dhsmith has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
<whitequark>
sure
<zenspider>
and as long as you're not trying to set something falsey, I think ||= reads and conveys intent better
<zenspider>
unless blahblah.key? blah is just ugly
Senjai has joined #ruby-lang
Senjai has quit [Changing host]
Senjai has joined #ruby-lang
<zenspider>
we should add Hash#merge? that'll set any keys not already set
<zenspider>
and then, OBVIOUSLY, we should add Hash#merge‽ to do that mutatively
<zenspider>
hrm... I need a better font in emacs. that didn't come through
<whitequark>
wouldn't that basically be reverse_merge?
<rue>
zenspider: Wouldn’t that be Hash#add ?
Senjai has quit [Read error: Connection reset by peer]
bgant has quit [Quit: Leaving.]
pabs has quit [Read error: Operation timed out]
<zenspider>
oh look... you two are taking a bad idea seriously. :P
arooni-mobile has quit [Ping timeout: 264 seconds]
<zenspider>
GAH. all lexers suck
<whitequark>
except ragel!
<zenspider>
no. it sucks too. fucking unreadable mess w/ too much syntax
realDAB has quit [Quit: realDAB]
<zenspider>
in fact... I might go as far as saying it sucks more than average because of that
<whitequark>
if I had a dime every time someone complains about syntax...
<whitequark>
but I don't, because syntax doesn't matter (that much). deal with it
<zenspider>
and... you're in russia? :P
<whitequark>
yup
<whitequark>
what's about that?
<zenspider>
no dimes?
<yorickpeterse>
call me a neckbeard but static typing for Ruby would make it a fuckton easier to analyze
<yorickpeterse>
* analyse, or w/e the spelling is
<whitequark>
zenspider: I'm using localized idioms
jvrmaia has quit [Quit: Leaving]
<whitequark>
besides
<whitequark>
can't I exchange dimes for roubles anyway?
<zenspider>
if syntax didn't matter we'd all still be coding in assembler. syntax matters. a lot. syntax is a big part of the reason we love ruby. (and hate it, for me)
<zenspider>
you couldn't when I was in school... but that was a long time ago :)
<zenspider>
at least, as I understood it
beerdy has joined #ruby-lang
beerdy has quit [Client Quit]
postmodern has joined #ruby-lang
nickgal has joined #ruby-lang
anonymuse has quit [Remote host closed the connection]
<zenspider>
I think I need to unfactor my lexer :/
<whitequark>
zenspider: my less provocative version of that sentence is: good syntax should describe things idiomatic for your language concisely
<whitequark>
that's all. whether it is {} or do..end or whatever doesn't matter
<soahccc>
zenspider: I took a look at the code of a deassembled NES game... I was interested but well, the comments are the only thing I can even read :)
<whitequark>
syntax should reflect semantics
<zenspider>
whitequark: I totally agree with that
anonymuse has joined #ruby-lang
<whitequark>
well, it seems that your complaint about ragel mostly refers to the fact that it likes {}|;
<whitequark>
no?
wmoxam has quit [Ping timeout: 276 seconds]
<zenspider>
I tried to read your lexer and couldn't make heads nor tails out of it. not your fault... it was written clearly and well documented.
<zenspider>
I'm experimenting with a fork of rexical right now... still not sure it'll fit for this application because the ruby_lexer has sooo much BS in it
<whitequark>
zenspider: I can explain how my lexer works if you want
<whitequark>
have some free time.
x0f_ has joined #ruby-lang
<whitequark>
(rexical) I don't think it can handle lexing ruby
<zenspider>
I'd like to finish this experiment first. either declare it a failure or success
<zenspider>
I'm about 25% through porting it over
<zenspider>
this is a fork with some nice extensions
<zenspider>
like predicate methods are available, not just one state, etc.
<whitequark>
on the second look maybe it is
<whitequark>
*it does
* whitequark
nods
arooni-mobile has joined #ruby-lang
x0f has quit [Ping timeout: 245 seconds]
<zenspider>
it could also be the case that my lexer has too much bullshit cruft in it to make this feasible and starting over might help shed a lot of that
skade has joined #ruby-lang
<banister>
zenspider: have you played with haskell's parsing libs? they're quite pretty
mbj has joined #ruby-lang
realDAB has joined #ruby-lang
realDAB has quit [Client Quit]
<whitequark>
lol
<zenspider>
banister: not haskells... I've poked at ML's tho
<whitequark>
ocaml's menhir (LR(1)) is really amazing
<whitequark>
it explains conflicts in terms of grammar
<whitequark>
basically, it shows you the sequence of tokens and two valid interpretations, and not some bullshit set of numbers
<zenspider>
nice. not bad for an LR.
cored has joined #ruby-lang
<whitequark>
well, that
mbj_ has quit [Ping timeout: 246 seconds]
<whitequark>
*that's a parser generator, it can be as sophisticated as it needs to be without being limited by the grammar it recognizes
<whitequark>
it also has a really nice tool which generates pretty error reports for the target grammar
<whitequark>
say you can make "class foo" generate a message "class name should be a constant and not a local variable"
<whitequark>
and that would be without changing the grammar itself.
<whitequark>
it's sort of bolted on: interprets the automaton and then introspects parser state at the error site
<whitequark>
zenspider: oh by the way, I've seen a really interesting paper recently, on shift-resolve parsing
<whitequark>
basically it describes would be linear time parsing with unlimited lookahead
<whitequark>
s,would be,,
<whitequark>
so it gathers best parts of LR/LL (linear time+space) and PEG (unlimited lookahead).
<zenspider>
hah. you can watch it run in your browser
<zenspider>
I'm up to 2
<zenspider>
ooh! fizz!
<banister>
zenspider: ingy is a cool dude
_helloworld_ has joined #ruby-lang
<banister>
(he hangs out on #pry, with all the other cool dudes ;)
daturkel has joined #ruby-lang
<zenspider>
I've known ingy for years. he's local
<banister>
he co-invented YAML, right?
<daturkel>
hey, noob question. i've got a class BaseClass and a subclass SubClass (not real names) which is declared as 'class SubClass < BaseClass' and both of those classes are in their own file from my main file. if i require them both, do i need to require the baseclass in the subclass file?
<daturkel>
it seems from my testing that i don't have to rerequire BaseClass in SubClass.rb but just wanted to check here
<daturkel>
i don't think i understand what you mean by defining the root of the namespace. would that not run if your drbrain/whatever requires were at the top?
<drbrain>
drbdump/loader.rb has class DRbDump::Loader so the class DRbDump needs to be defined before Loader can be defined
sjltaylor has joined #ruby-lang
<drbrain>
… so it's the namespace instead of the parent class that needs to be defined
mbj_ has joined #ruby-lang
grumpwork has quit [Remote host closed the connection]
<daturkel>
oh okay, i get you. but since i'm not defining any classes in my main file, that's not a problem
mbj has quit [Ping timeout: 264 seconds]
pabs has joined #ruby-lang
__butch__ has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
* drbrain
nods
<whitequark>
actually, I noticed that the author of shift-resolve parsing article did implement it in C... but didn't share the sources
<whitequark>
only a linux executable
jbsan has quit [Quit: jbsan]
<whitequark>
maybe if I ask him nicely he'll give them to me
<daturkel>
wooh, just built my first working gem
_helloworld_ has quit [Remote host closed the connection]
flip_digits has quit [Remote host closed the connection]
mbj has joined #ruby-lang
flip_digits has joined #ruby-lang
mbj_ has quit [Ping timeout: 264 seconds]
daturkel has quit [Ping timeout: 250 seconds]
joshuawscott has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
ssb123 has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
thmzlt has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ledestin has joined #ruby-lang
jxpx777 has quit [Read error: Connection reset by peer]
jxpx777 has joined #ruby-lang
solars has quit [Ping timeout: 276 seconds]
thmzlt has joined #ruby-lang
sjltaylor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ssb123 has joined #ruby-lang
xuser has joined #ruby-lang
poga has quit [Remote host closed the connection]
jbsan has joined #ruby-lang
tsou has quit [Ping timeout: 268 seconds]
arooni-mobile has quit [Ping timeout: 240 seconds]
anonymuse has quit [Remote host closed the connection]
tsou has joined #ruby-lang
yfeldblum has quit [Ping timeout: 248 seconds]
arooni-mobile has joined #ruby-lang
pkrnj has quit [Quit: Computer has gone to sleep.]
torrieri has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
realDAB has joined #ruby-lang
realDAB has quit [Client Quit]
mootpointer has joined #ruby-lang
efrainolivares has quit [Quit: efrainolivares]
elia has quit [Quit: Computer has gone to sleep.]
efrainolivares has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
tomzx_mac has joined #ruby-lang
efrainolivares has quit [Quit: efrainolivares]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
mbj_ has joined #ruby-lang
woollyams has joined #ruby-lang
nickgal has quit [Quit: nickgal]
mbj has quit [Ping timeout: 248 seconds]
TvL2386 has quit [Quit: Ex-Chat]
tylersmith has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
havenwood has quit [Ping timeout: 264 seconds]
tylersmith has joined #ruby-lang
mdedetrich has joined #ruby-lang
jwoods has quit [Ping timeout: 264 seconds]
JoshuaPaling has joined #ruby-lang
nathanstitt has joined #ruby-lang
ssb123 has quit [Remote host closed the connection]
pkrnj has joined #ruby-lang
realDAB has joined #ruby-lang
bradsmith has quit [Remote host closed the connection]