Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TorgoX (1933)


"Il est beau comme la retractilité des serres des oiseaux rapaces [...] et surtout, comme la rencontre fortuite sur une table de dissection d'une machine à coudre et d'un parapluie !" -- Lautréamont

Journal of TorgoX (1933)

Sunday January 19, 2003
08:05 PM

"The captain says: I'm a caveman"

[ #10077 ]
Dear Log,

So, looking for something to do other than work on the book, I fiddled around and made a program that uses Astro::Sunrise to make a graph of sunrise and sunset times over the course of the year, for Juneau, and anywhere else I give coordinates for.

Along the way, I found some bugs in Astro::Sunrise, which more or less show up only as you get toward the poles. The notable bug was that when you ask for when the sun rises on a particular day, one of the intermediate calculations uses some Math::Trig functions that don't behave quite as expected in some cases. Normally all is well -- but what if you're in Barrow, Alaska (above the Arctic Circle) in winter or summer, and you ask the question "when is sunrise (or sunset) today?". The answer is, there isn't one. But this wasn't being explicitly checked for in Astro::Sunrise. So in a very mathy way, one of the Math::Trig functions starts returning a complex number at that point, which makes everything in Astro::Sunrise after that go screwy and scream warnings. So I inserted some checks for such cases (making them return undef, in line with how some other checks in there already work), also fixed some TZ math stuff (so if sundown isn't until 1:10am, it shows up as 01:10, not 25:10), prettied up the docs, and sent off a patch to the guy.

Meanwhile, I sent Gisle a patch to improve error reporting in HTML::Entities. And while I was at it, I added a function to HTML-escape things numerically instead of nominally (&#Xhexnum; instead of &foo;), and also added a few more examples to the docs. The silliest that I added was an example of HTML-escaping the string "vis-à-vis Beyoncé's naïve papier-mâché résumé".

Thus far I have survived almost an entire month without Tivo. It's like living in CAVEMAN TIMES!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.