Sunday, September 02, 2007

Sweating and Laborings

Based on the dramatic drop of people visiting Atlas Quest yesterday and today, I assume you're all off enjoying Labor Day. I suspect a surge of find reports come Tuesday morning when you all get back to work. If AQ is running a little sluggish that day, you'll likely know the reason. ;o)

As for me, I like to work during the Labor Day weekend to avoid the crowds that are at the beaches and on the trails. Traveling is hard as it is, packed full of cars on vacation. Not really my thing, so I'd just as soon work during the weekend then go out and play when everyone else has to go back to work. =)

Not to mention that it's freakishly hot outside this weekend. I'm in California at the moment, and I swear it must have been a hundred degrees outside. I didn't even walk anywhere today to stretch my legs. You know it's bad when I don't do that. Even eleven o'clock at night, as I write this, I'm sweating bullets. The temperature has cooled outside, but alas, the heat in the house hasn't escaped yet even though all the windows are open and the fans are on. It's not fun.

As for work, my number one priority is knocking out the 2008 Atlas Quest letterboxing calendar. Yesterday I spent hours pouring over nearly 500 photos narrowing them down to about 100. Today I've narrowed it down even more, down to about 50 choices, but it's getting harder, and started searching for interesting quotes that can go with all 50 of them. When I have two amazing photos I can't decide between, I'll end up deciding which one I can find the better quote to go with it and let the quote be the deciding factor. So I'm scouring the web looking for interesting quotes to go with all 50-or-so finalists. It'll take some time.

For the first time, I'm also considering turning them into TWO calendars--I really did get a lot of very impressive photos! Perhaps a more "serious" calendar like the last couple of years, then a "silly" calendar that's meant to entertain and make you laugh. =) There are certainly some interesting choices available. I might need to make use of Wassamatta_u's puns.

This afternoon, I enabled the AQ shopping cart for myself so I could kick it a bit and see if it's still working properly since last year, and so far the results look promising. The pages themselves look like their working as expected. I wanted to fix a couple of minor issues that came up last year, but it's not really in a state for me to make extensive changes to the code base, so I'll leave the minor issues in place. Maybe next year I'll fix them. =) I still need to check that payments using PayPal will still process and work correctly, but the rest of the code seems to work correctly. I'm rather happy with the results so far.

I'm thinking I might go to a movie tomorrow afternoon to beat the heat in an air-conditioned movie theater. Perhaps go out for lunch to an air-conditioned restaurant while I'm at it. Gosh, I hope it cools down soon. Oh, and I'm scheduled to donate platelets for a couple of hours, which is also air-conditioned. =) Turns out, they have a difficult time convincing people to donate blood on Labor Day and were gushing about my willingness to do so. Hello? Everyone else is at the beach! I'd rather donate blood when nobody else wants to and things are running slow and calm. I also get more attention during such times. ;o)

Tiring of work on the calendar, I spent an hour this evening fixing a minor bug I discovered a few days ago. This bug really amuses me, because it's been on AQ since almost day 1, and it's been lurking there all this time. It's a minor bug, to be sure, and reared it's ugly head when someone posted a link to the help section somewhere (I'm not even sure where--probably the message boards). The link was at the end of a sentence, however, and since URLs can include periods, the period at the end of the sentence got included in the URL.

Consequently, the URL looked something like http://www.atlasquest.com/directory/page.html?gId=2312.

The period should not be part of the URL, but it slipped in anyhow.

Normally, this isn't a problem. AQ always checks the data coming into the site to insure it's valid. Hackers often like to try changing the data in a URL to break into websites, so before I use the data labeled gId, I check to make sure it is indeed a number like expected. If it's not a number, AQ will send you to the dreaded 404 Page Not Found error.

Turns out, "2312." actually IS a number. I really didn't want the period in there, but it slipped through my check of the data anyhow, then it broke the database query which was expecting a whole number without the period. When AQ directs you to a 404 error page because someone typed a URL wrong, I don't worry too much about it, and AQ doesn't tell me about the problem. The URL is incorrect and that's the proper response. In this case, however, AQ approved the number "2312." when it shouldn't have, then it broke a query. At that point, the code knows something has gone horrible wrong and SOMETHING needs to be fixed. So it sends an error message that webmasters can read. This particular error message said something like "SQL Error: Check query "SELECT * FROM Gizmo WHERE id=2312."

So I tracked the problem back to an incorrect URL that slipped through the data verification process. It's a minor issue--it doesn't happen very often at all unless you follow a link that includes a period in the number--and when it does happen, the worst that will happen is you see a blank screen. That blank screen is AQ's way of freaking out. Something totally unexpected happen, it notifies the webmaster, then just stops dead in its tracks, unsure of what to do next. Continue? Redirect to another page? Display an error and stop? It doesn't know--so it just stops. The person who followed the link might try refreshing the page a couple of times hoping to get it to work, but it won't work and they'll eventually give up and go away or find some other way to access the information they were looking for.

Being such an uncommon error with relatively little minor consequences, it was high on my to-do list. I think getting the calendar out and the latest update done is more important, so I put the bug aside. Until this evening, when I found myself exhausted from working on the calendar and the update and wanted a change of pace. So I spent about an hour creating a special function that can take input from the command line and pull out a number--just the digits zero through 9, or return FALSE if it's not a number. Then updating all calls that were expected to pull numbers from the command line to use my new data-checking function that will make sure no periods get included into the number. Creating the new function--easy. Mere minutes and it was working. Updating the 319 places where I needed to call the new function--that look about an hour.

As with all the changes I've been making lately, the bug fix will be in the Next Big Update. =) In the meantime, if you want to freak out AQ, try changing one of those URLs that have a number in it to include a period at the end of the number. Doesn't matter where you do this. The member ID, a letterbox ID, a blog ID--none of them currently work correctly with that period. Some places might actually--inadvertently--work as expected, but most of those 319 places will probably cause a blank screen and an error notification to be sent to me.

Enjoy the hacking now, though, because it'll be fixed in the Next Big Update. =)

Now I'm off to bed. Goodnight all!

No comments: