What's your sign?

0 views
Skip to first unread message

Joshua Warchol

unread,
Aug 25, 2007, 1:06:22 AM8/25/07
to New-Haven-R...@googlegroups.com
Hey guys,

I was looking over some code today and saw a method for calculating a
persons astrological sign that seemed to read pretty nice, but looked
like it probably had bad performance characteristics. I thought I'd
ask for some more eyes.

http://pastie.caboo.se/private/qz8f8lrniakk9aqws8

My first thought was to skip all that Date range business and just
enumerate out each day of the year and what sign that was. But that's
not going to work right for leap years. Looking at the code I don't
like how it creates a whole slew of Date objects for every call to it.
And it puts them into a nice hash, but it's not able to just index
into the hash to get the right answer.

Thanks for any advice.

Josh

PS: Anyone else going to do the Rails Rumble this year?

--
Joshua E. Warchol
jwar...@gmail.com

Reply all
Reply to author
Forward
0 new messages