Sunday, April 29, 2007

The Near Disaster....

Today, I actually have plans that do not include Atlas Quest. There's a water taxi here in Seattle, that travels between downtown Seattle and West Seattle. It doesn't run during the winter months, though, and today is the day it starts up again. I read this in a newspaper last week, and for the inaugural day of the season, people will be allowed to ride it for free. I've never ridden the water taxi before and considering it's FREE today, I figured I'd be a fool not to take advantage of it.

So I called up one of my old college buddies from San Luis who, after graduating, moved to Seattle to work for Microsoft, where you'll still find her toiling away. There are a few of my old college buddies who got sucked into the Microsoft engine, but Gloria is the only one I've kept in touch with over the years. At least sporadically. The last time I actually saw her in person was about a year ago.

But I digress.... I called her up. Okay, I e-mailed her up, and told her my idea. I'd meet her downtown and we could walk to West Seattle and use the water taxi to make a full loop of the walk. Okay, it was actually her idea--she suggested it over a year ago. I've walked from downtown Seattle to West Seattle more times than I can count, but she'd never done it and wanted to try it. Somehow, it never ended up happening.

So when I read we could ride it for FREE this afternoon, I called--err, I mean e-mailed her--and said, "You still interested?"

She was and we hashed out a time and location we'd meet downtown. (Eleven o'clock at Westlake Center, for those who are really nosy.)

How's this relate to Atlas Quest? It doesn't really--that's the whole point. I was taking the day off. =) But I couldn't help myself. I deliberately pulled myself out of bed earlier than normal just so I could check Atlas Quest. Make sure everything was running as expected before I left for most of the day.

One of the first things I check are errors that AQ recorded. When I log in--when anyone in the webmaster user group logs in, in fact, but I'm the only person in that user group right now--there are two small buttons in the upper-right corner of the page. One of them are errors that AQ recorded while the other are slow query warnings that were recorded. The error button is bright red. When things show up there, I have to check things out. Maybe once or twice a day something shows up as an error, and usually it's not important. Perhaps AQ was unable to connect with a blog's server while updating the Letterboxing News so it reports the problem, the problem is on the blog server, not Atlas Quest. So I delete the error messages and continue on.

This morning however, there was an error in the clue caching page. Atlas Quest only caches clues late at night when the server load is low. This has two benefits. It can make use of the excess system capacities at night, but when it caches clues on LbNA, it's also using LbNA's excess capacity at night. I'm assuming, of course, that LbNA doesn't get as many visitors at 2:00 in the morning just like Atlas Quest. That way, Atlas Quest is only "bothering" LbNA late at night when it was lonely and bored anyhow. Yes, Atlas Quest runs off with LbNA each night. Sordid affair, that it is. =)

Anyhow, I'd been updating the nightly scripts, as well you know if you've been following this blog lately, and the clue caching page generated an error. In a nutshell, it was trying to assign the number associated with a clue to the number associated with a letterbox. This should NEVER HAPPEN. Once something is assigned a number, it should NEVER change. I accidentally did that with the letterboxes. What would happen if it changed? It would assign the clue for ABC box to the XYZ box. All of the clues would get switched around! A disaster of the biggest magnitude!

It complained about the query trying to assign more than one number to Box #0. (There is no box #0, I might add--numbers always start at 1.) With a growing sense of doom, I tried checking box #1, my Los Osos Oaks series. "Box not found."

Crap. A slight bit of panic on my part ensued. Did I have to reinstall the boxes from the backups the previous night? I wasn't going to get that finished before I could meet Gloria in downtown Seattle.

I checked box #2, Victoria Falls, and it seemed to show up fine. Then I ran a query to look at the first 50 boxes, and they generally all looked good. #0 was my Los Osos Oaks series, and #1 was missing, but the rest seemed to be in tact and working fine. Whew--it was not the disaster I first imagined.

The query that ran, it converted box #1 into box #0. Then it tried to convert box #2 into box #0, but it couldn't--box #0 already existed. The query failed, threw up, and generated an error report. Disaster averted.

I fixed up the Los Osos Oaks series, and then fixed the broken query. It only took a few minutes--I had left myself with a full hour to goof around on AQ this morning before I needed to get going.

Everything seems to be in working order once again. Those who have finds on Los Osos Oaks--your F-count will be off by 4 until the nightly updates again. (After all, you couldn't "find" a box that didn't exist on AQ, so those finds weren't counted in last night's update!)

Now I'm taking the afternoon off. =)

I might also mention this, once during a walk from downtown to West Seattle, I found a small plaque on the side of the road that claims to mark where the first service station in America was opened. The actual location is fenced off, part of the Port of Seattle now, but for probably two or three years now, I've wanted to hide a letterbox there to honor that first gas station. I've never met anyone's who knows this. Not even any locals seem to know this interesting piece of history here.

Just in case you thought I was getting too far off from letterboxing in this blog. ;o)

Saturday, April 28, 2007

Riding the Cheetah

A commonly known piece of trivia is that the cheetah is the fastest land animal on the planet, able to achieve speeds of 70 mph. Astounding, isn't it? Think about that. If you had to drive through Oregon on I-5 going the speed limit, that cheetah would be passing you! That's pretty fast. A wild turkey, in case you're wondering, tops out at 15 mph.

Why do I mention this? Because I like to think Atlas Quest is pretty darned fast. I spend a lot of time and effort trying to make it so. One source clocks AQ as being faster than 96% of the typical website on the Internet. Two thumbs up for me!

But it's a constant battle. The database that makes up Atlas Quest has now grown over 400 megabytes in size, and continues to grow a couple of more megabytes each week. I expect it'll grow to over 500 megabytes by the end of the year--perhaps even as much as 600 megabytes or more. That's a huge amount of growth to handle, and I'm not professionally trained for such large databases. I knew what most programmers know about them--terminology like foreign key constraints, joins, and primary keys. I could join a few tables together without too much trouble. But the Atlas Quest database is now about 1,000 times larger than anything I've ever worked with before. Let me spell that out for you. One thousand times larger. Things work a lot different on that sort of scale, and I'm constantly figuring out new tricks to keep things running fast.

One problem I had early in Atlas Quest history was figuring out exactly which queries were the biggest problems. A query, for those not in the know, is a technical term that essentially means to ask the database for information.

So I created a small bit of code to help me track down problem queries. Atlas Quest answers--on average--eight queries every single second. During the busiest times of the day, it can be much higher. Instead of querying the database directory, any code that needs information calls this special code I created. The special code logs the exact time (to a thousandth of a second), then forwards my query to the database. The database does it's thing then returns the data to the special code I wrote. That code then logs the exact time (to a thousandth of a second) that the data was returned. Subtract one from the other and it can tell you exactly how long it took the database to process that query. Most queries take less than 1/100th of a second to process. More complicated ones might take 1/10th of a second, which I consider acceptable.

Occasionally, a query might take a few seconds to process. Perhaps the database needs to load a large index from disk. Maybe Atlas Quest is doing nightly updates and needs to temporarily lock out other database queries for a few seconds while it's calculating everyone's PFX counts.

But sometimes, it's a symptom of a bigger problem. Maybe the query itself is inefficient. So I set a limit--if a query takes more than ten seconds to run, it logs a warning to a file that webmasters can access. It tells me exact query that was slow, when it ran, what page it was run from, who viewed the page (if known), and where on the page the query was called from.

Additionally, if it's a webmaster that's viewing the page, it will show every single query that was run to generate the page and the time each query took to run at the bottom of the page.

The message board update I did was a substantial change to the code base, so I've been paying more attention to the query profiling than usual to make sure it all stays running fast. I browse through the list of slow queries, looking for patterns. I surfed the message boards, just to scroll to the bottom of the page and check the query profiles. Are any of them running slower than expected? Do certain queries seem to show up as slow more often than others?

That's what I started to do yesterday afternoon. Squeezing every last ounce of performance out of Atlas Quest. When I spot something suspicious, I dissect the query and try multiple different ways to get the same information from the database. Which version run the fastest or the slowest? And why? What can I do to improve them?

Last night, shortly before I planned to go to sleep, I took one last brief through the list of slow queries and noticed a number of them coming from the nightly updates. This is nothing new--I have not spent much effort trying to keep those queries running fast. Why bother? They only run once per day, and late at night when few people are online to be affected anyhow. My efforts are better spent concentrating on the queries that run thousands of times each day.

But I spotted an easy fix to one of the queries. I wasn't even really looking for it--just kind of popped out at me. I fixed the query so it ran faster--much faster--then decided to look through those queries from the nightly updates a bit closer. Quite a few improvements could be made.

I ended spending the next two hours tweaking the queries that make up the night updates--LONG after I planned to go to sleep. The result of all this work? Fewer "hiccups" on Atlas Quest for you late night web surfers. Times when AQ seems to pause for maybe ten or twenty seconds before doing what you asked it to.

It'll still happen--I haven't fixed all of the slow queries. Some of them just can't be fixed, such as calculating everyone's PFX count each night. Atlas Quest has to pull up every one of the more than 40,000 letterboxes from the database and nearly 400,000 recorded finds and count them up, one at a time. Very slow. How else can I get an accurate count for everyone, though?

But the number of particularly slow queries during the nightly updates, I figure, has probably been cut by about 70%. The only difference anyone might notice are fewer "hiccups" when AQ is processing a time consuming query before it responds to your page request.

By 2:00am, I was falling asleep at the keyboard, so I finally called it a night and went to sleep. But I was anxious to continue my slow query slaying ways (say that ten times fast!) and continued work on the problem this morning. One slow query that showed up this morning--I went to sleep too early to see it last night--was the update for the Hall of Fame page.

Counting PFX counts can be tricky. AQ would first count all of your recorded finds, then subtract out a count of all finds on your own boxes, then subtract out any boxes you've counted more than once as a find. It was one messed up query. Counting all the finds for everyone is going to be a slow query no matter what, but this convoluted way of counting was really slow. So I started to fix the query.

Then I realized I was getting more than just counts of traditional boxes. It was also counting non-traditional boxes--just throwing that data away afterwards, though. I've wanted to update the Hall of Fame feature to include non-traditional boxes for quite some time now (it's a rather common feature request I get--just not high on my priority list). Now that I'm getting all this spare data anyway, I may as well use it!

So I spent the morning and afternoon rewriting the Hall of Fame code to now display top planters and finders of non-traditional letterboxes.

I had no idea when I went to sleep last night I'd be doing this particular feature today. It's was a surprise, but that's what I get for riding the cheetah. =)

I uploaded the changes--this particular feature didn't require me to take down the site for a period of time, so I uploaded the changes as soon as they were done. Then I went out for lunch (I was hungry), stretched my legs, and mailed an eBay item that Amanda sold.

Now I'm back, on the prowl for more ways turn Atlas Quest into a cheetah. Not a whole lot to work with at the moment. In the time it took me to write this blog entry, AQ only recorded one slow query. I'll check it out thought, and see if there's anything I can do to make it faster. During busy times on Atlas Quest is the best time to identify slow queries. It's when the database is bogged down trying to serve up a hundred queries per second that the slowest queries make their presence known, but Sunday is a typically slow day on Atlas Quest. Not much activity on today. Sunday night tends to pick up, though, and Mondays are far and away the busiest day on Atlas Quest. Tonight will be the first full night of nightly updates since my tweaking last night and this morning, so it'll be interesting to see exactly how often slow queries rear their ugly heads.

Friday, April 27, 2007

...and the update is DONE!

Since my last point, I took a short nap yesterday afternoon since I expected to stay up very late to upload the changes.

One thing I decided to try, unfortunately a very last-minute idea that did not turn out as well as expected, was changing people's trail names so spaces were written using HTML spaces. I was trying to get better control over where the browser might break up someone's trail name into two or more lines. Ideally, I want trail names not to wrap. I tried it on my development machine and it worked predictably well, so why not run with it?

At midnight, AQ locked everyone out but me. Actually, there is a special cookie that if you manually set on your browser will allow you to 'break through' that update page and let you back into the site, but of course, I'm not telling what that is. ;o) It allows me up put in updates and test them on the live site before opening it back up for everyone else to start finding bugs.

Wassamatta u triggered the first bug, a result of an update I did to the database earlier in the day. I added a couple of new user preferences, which added a couple of columns to one of the database tables. It's pretty easy to add NEW columns without breaking existing code--it's when I change columns that things tend to break. Since I was just adding new columns, I did to early yesterday. I figured that way, by the time I did the update, everyone would have been logged out of AQ (either by clicking the logout link or by timing out) and when they logged in again (either manually or with the auto-login) it would pick up the new database columns and nobody would be none the wiser. Of course, Wassa was wiser.

The first bug showed up about a half hour after I made the site public again. One of my automated nightly scripts choked. I don't even remember the specific problem anymore--it only affected the caching of clues and no permanent damage done. Nobody using the site would even know of that problem.

But Wassa showed up here minutes later, and AQ recorded an error when he tried to change some of his preferences. Wassa seems to live here, and during all those hours never let his session die. It took about a half hour after I brought the website back up, but as soon as he tried to play with those new options, AQ generated an error. His session variables didn't include those two columns I added earlier in the day.

I sent him an AQ mail suggesting he log out and back in to get that session variable in a correct state, and hoped no one else would be caught by it.

Then a more serious problem was discovered--people were having trouble replying to others who spaces in their trail name. I had just AQ mailed wassa without any trouble, so I figured it must have been a specific link that wasn't working, and I tried to track down where it wasn't working. As I realized the problem was much larger and more extensive than I realized, I renamed everyone's trail name to no longer use the HTML code for a space in it. Problem solved. Actually, it was possible that some people had that HTML space in the trail names on session variables. Once again, I told a couple of people I knew who were affected to log out and back in to reset those session variables.

I'm not not sure why I had no trouble with the spaces but other people did. Maybe it was a browser thing? Or perhaps an operating system thing? Whatever the reason, it was a problem and time to back out. Won't do THAT again! =) It was purely for cosmetic reasons, and pretty minor ones at that. I have no intention of trying to make that work again. I thought it was an easy change, but apparently it's not. *shrug*

I seriously considered deleting all session variables--something I should have done when I had the site down and could be assured I wasn't deleting anything important--but by now the site had already been back up for an hour and I was afraid that deleting all session variables would cause anyone currently writing posts, adding boxes, or whatever to loose what they'd written. To delete or not delete, that was the question? Deciding that only a tiny minority of people were having session problems, I decided not to delete. Just keep an eye on things, and I added a quick hack so AQ wouldn't stop cold if it detected session problems.

I stayed on AQ until about 3:00 am to keep an eye on things. Fixed a few minor, mostly cosmetic problems I found along the way. When I started noticing east coast people logging in, I decided it was about time for ME to get some shut eye!

I woke up at 7:00 and rather than lay around thinking about my day--that's what I usually do in the morning, as reported in my last two posts--I jumped onto Atlas Quest to see what other new problems were discovered during my four hours of blissful sleep.

Nothing especially serious, I'm happy to report. While using the site myself, I noticed that replies to AQ mail were not returning to the message that had just been replied to, which was annoying, so I fixed that. Pungent Bob wanted to see the board names in the summary and simple views of the message boards, so I added that. (But only if all the messages were on several boards. If they're all from the same board, the board name is at the top of the page.) Updated wiki-style documentation to show how to create quote boxes. Minor tweaks as the public at large kicked the tires and made their suggestions.

I did this for about three hours, but I was still pretty groggy from lack of sleep before, so I went back to sleep at around 10:00. Nap time. =)

I slept for another couple of hours before some construction equipment outside woke me up again and now I'm starting to feel normal again. Not too tired. AQ seems to be running smoothly. My biggest decision is if I should send Silent Doug an e-mail to let him know that I finished implementing the message board summary he suggested, or let him find it on his own and surprise him. =)

At this point, I feel safe to leave AQ for a few hours. Time to get out and stretch my legs a bit, before it starts to rain. (Not looking pretty outside right now!) Maybe celebrate the relatively trouble-free update of last night by taking myself out for lunch somewhere. I could finish reading the other half of that Smithsonian magazine that I didn't finish before.

I'd probably get back around five or six o'clock this evening, at which point I'll jump on the computer to make sure no additional bugs or problems have been found while I was gone. And if there were some found, to get them fixed.

All's well it ends well. Tomorrow, I'll start on the next BIG THING. Which, for now, I want to keep a secret and surprise you all with later. ;o)

But I declare the update officially done.

Happy trails!

Thursday, April 26, 2007

The Update is Ready.....

...or at least it will be by tonight. =)

As you might have read from my last post, I woke this morning like I do most mornings, with the sun streaming through the window. I laid around for a half hour, thinking about all the things I had to do. Could I finish my updates to the message boards to upload the changes tonight?

And somewhere in my meandering thoughts, I had an idea. When I created the WikiBoxing feature, I decided to use the wiki-style formatting of text. It's simplier to learn and use than the html-style AQ has always used before, and in the back of my head it's always been a thought that I could update AQ use the wiki-style formatting exclusively. For writing posts, and writing AQ mail, and writing clues, and--well, you get the idea.

Except now that everyone's learned HTML, a lot of people probably would be resistant to learning wiki-style formatting as well. And all the pieces popped into my head at just the right moment: Set it up so people can choose which option to use.

Frankly, I'd rather use one or the other instead of confusing people with two different options, but the wiki-style is so much more flexible, but it seems criminal to rip out the rug from everyone using html-style too. I'm hoping people might start trying the wiki-style formatting, get used to it, and eventually I can retire the html-style option completely. New members on AQ will automatically default to the wiki-style formatting. Old members will automatically default to the html-style. And all members will be able to chose exactly which style of formatting should be applied to a given message board post. The default option can be set as part of your preferences, but you can override the default as necessary.

I'm already mucking around with the mesage board code, so now's as good as time as any to introduce the wiki-style formatting. It was elegantly simple to include, I might add, in the sleek new code I've spent the last week working on. =) That's what sleek new code gets me--the ability to modify and add features quickly and easily.

I did my rounds on Atlas Quest, then ate breakfast, then sat down and added the wiki-style formatting to message board posts. Works beautifully!

Then I start thinking--since I'm already adding it to the message board posts, why not allow it to work for AQ mail as well? Keep things consistant. *nodding* So I worked on allowing that as an option while composing an AQ mail. That wasn't so easy--the "write an AQ mail" code is pretty old and in bad shape, so that took a couple of hours to fix up enough to add the wiki-style formatting option. It's still not great code--I just cleaned it up enough to add what I wanted. Eventually, it'll likely need to be rewritten from scratch someday.

The one other major place where people can enter large quantities of text is the clue. I'd love to support wiki-style formatting for clues, but alas, that will have to wait for another day. The html-sytle formatting has two procedures that go with it: One to convert from html-style text to the display version, and one to convert from the display version back into html-style text. That's how you can edit clues. AQ converts your clues back into the text your originally typed then lets you update.

The wiki-style formatting only has one procedure that turns it into "display ready" text. There's nothing to convert it back into the original text you typed. Once it's converted, it can't be edited anymore. Which is fine for message boards and AQ mail--you can't edit those to begin with. Clues have to be edited.

But OH, you might think--you can edit entries in WikiBoxing. What's THAT about!

Clever thinking, I might add, but there's a trick to that. Interally, every time you edit a wiki entry, AQ stores TWO versions of it in the database. One is your original text and the other is your "display ready" version of the text. When it comes to editing a wiki entry, AQ pulls up the original text and lets you change that. The display version just gets copied over with your edits.

So that's how that works.

I could do that with clues, but that would require significant amounts of rewritting the code that I'm not ready to delve into at the moment. Perhaps someday, but I'd just prefer to create a procedure that allows AQ to convert from display-ready text into wiki-style formatting and use that. But until I create that, clues are stuck with html-style formatting only.

I also fixed-up the reporting of problem posts and set it up so when you try to contact someone to send them AQ mail, Atlas Quest will return you to the page you were last one before you contacted them. (It used to take you to your inbox after the message was sent.) Much more friendly to take people back to where they left off. Details! Details!

*** Technical speak ahead--you might want to skip the next two paragraphs if you don't want your head to explode ***

While testing the new features, I noticed that AQ was remarkably slow (a few seconds) when trying to display a list of messages, but only SOME of the time. I finally determined it was only slow when I wanted it to display messages from just one board. I visually checked the query, and it looked good. I double-checked the indices were correctly there, which also looked good. So I ran an explanation of how the database was processing the query, and it was completely ignoring the one index it should have been using. The database is usually very good about picking an optimal query, but alas, this one seemed to be stumping it. To test my theory that this was the problem, I tweaked the query by explicitly telling it what indices to use, and the query ran blazing fast. YES!

I added that change to the code and now the messages were turning up fast, but only if I looked at messages from a single board. If I tried to look at just a thread or all messages, the query was running slow. Exactly the opposite problem I had before. In a nutshell, I needed to tweak the code to only use my hand-picked indices if AQ was trying to display all messages from a single board, otherwise the database should use whatever it felt was best. This would have a terrible, terrible thing to do with the old message board code. But it was such a simple, elegent fix--just the addition of just one line of code. I commented it heavily--that line of code is VERY important but it's not obvious why. I don't want to inadvertantly delete it later while looking at the code and assuming it's not really important.

Why is this important? The queries run faster. There are nearly 90,000 posts on Atlas Quest now, growing by two or three hundred more every single day. Think about that for a minute. You click on a link that says something to the effect: "Show me every single post from the Yakking It Up board posted since 9:30 last night (the last time you read the board)." Atlas Quest has to search through nearly 90,000 posts, figure out which ones are on that specific board, which of those posts were posted after 9:30 last night, which of them were posted by people on your ignore list (and therefore should NOT be displayed), which of them were deleted (and therefore should NOT be displayed--except if you're an admin who needs to undelete it), and then pull up each of those messages. Then it needs to look up the name of each person who posted one of those messages, information about them like PFX counts that show up by their name. And it needs to do all that in about 1/10 of a second. (Faster, if I can, but alas, that's about as fast as I've been able to get it working.)

That's pretty darned amazing. How long do you think it would take YOU to do all that? =) The message boards are the single most often used feature on Atlas Quest, with tens of thousands of message board pages being displayed every single day. During the last few months, Atlas Quest been been bogging down a bit under the strain, and I think that one little line of code could help improve that particular query by a factor of 10. A full TEN times faster than without that line. Perhaps it's the one thing I needed to get in there to keep AQ running fast and efficient for another year without having to upgrade again? I don't know, but it'll certainly help! Upgrading my hosting account to the next 'level' would cost about $500/year. That single line of code may have saved me $500. Now you see why I'm so happy about it? =) And also why I want to make SURE I don't unwittingly delete it in the future thinking it's not important.

But you won't see a visual change because of that. AQ will do what it always has, just a little bit faster.

There will be other visual changes in this update, though. Mostly minor ones, but a whole lot of new code backing it up.

The one problem left (that I know about, at least) is the forwarding of AQ mail. I expect to get that working correctly soon, though, and once it is all these updates will be ready for the live site. With all this new code, there likely will be bugs in it I have not yet discovered. I'm sure you all will help me root them out and squash them as they come into the light, though. =)

As such, I've set AQ to close down at midnight tonight, Pacific time. I'll be uploading all these changes then.

I'll take a nap later this afternoon--the better to stay up until an ungodly hour of the morning updating the site when you are all asleep in bed. =)

As far as jobs go, working on AQ isn't half bad. It's the only time I've ever been able to justify a nap as "working." =) Otherwise, I'd have to take AQ down at more inconvenient hours when everyone is awake and online.

So there's my little speach for today, and some of the things you can expect in the Next Big Update.

Wednesday, April 25, 2007

What Did You Do Today?

Today was a pretty average day for me, but I'm going to tell you about it. In case you wonder what it is I really do all day, now's your chance to find out. =)

I woke this morning, as I do most mornings, when the sunlight started streaming through the window and woke me up. I usually let the sun wake me up--it's a wonderful way to start a day. However, I do tend to sleep in a lot later during the winter than I do during the summer. During the longest days of the year, I often wake up at six or seven in the morning. During the winter months, I often lounge around until nine or ten.

Today, I woke up at about 8:00. Usually I lay around thinking about what I want to accomplish for the day. I do this for perhaps a half hour or so. If I do it TOO long, all those things I want to get accomplished rarely get accomplishing!

Then I got up and pulled myself onto the computer, usually wrapped in a flannel blanket, to check up on Atlas Quest. I check AQ mail, e-mail, and the message boards and scan the major news headlines to see if anything interesting happened during my sleep. Checking AQ mail, e-mail, and the message boards--which includes fixing minor bugs people report. For instance, Fair Oaks, California, was not listed as being in Sacramento Country which it seems confused some folks. So I moved the town to Sacramento County. (I had it listed in San Joaquin County--which does have a town named Fair Oaks, but nobody's letterboxing there!) Got a few reports about my letterboxes that people have found or want to find in the near future.

I like to think of it as my 'beat'. Policemen have beats, and so do I. I patrol Atlas Quest. =)

This usually takes me a couple of hours. It varies. Usually it takes at least one hour, but I usually call it quits if I haven't finished it all within three hours because I'm getting so darned hungry! =) Today I spent about two hours checking stuff, replying to questions, and such. After finishing up with all those minor details, I eat some breakfast.

Usually cereal, although the brand varies. With cold, non-fat milk. Yum, yum. =)

Then I get back on the computer and work on whatever project it is I'm currently working on. Sometimes I have to be logged in to the Internet for it, and sometimes I don't. The April's Fool joke with all those icons, for instance? I was online virtually non-stop trying to find images I could use for the icons. I typically check the boards and AQ mail more often since I'm online already.

Today, though, I've been working on message board code. It's a lot of coding, crafted with nothing but a few reference books, documentation I've already downloaded to my computer, and my wits. I don't need to be online for this, so today was largely an offline day.

I wrote a list of things I needed to complete for the message board code. I'm rewriting almost all of it from scratch. When it's ready, you'll see a few visible changes. It'll likely seem more like a minor update than a complete rewrite of the message board code, but I'll have to take AQ down for an hour or two to get all the changes on the live site. Don't worry--I try only to do that late at night when most people are asleep in bed. I hoped I might have it done for tonight, but alas, it didn't work out. Maybe tomorrow night? Maybe the next after that? I don't really have a set schedule--it's done when it's done. =)

Why am I rewriting all this code if you're only going to see relatively minor changes? Frankly, the old code is crap. When I created the message boards on Atlas Quest, I didn't really know what I was doing. I was making everything up as I went along. =) I learned from it, hacked it, and cobbled it together, but it wasn't particularly well-crafted code.

Well-written code is *extremely* important. It allows me to add and modify features quickly and easily. It allows me to tweak database queries for better efficiency without having to fear I'll break something else in the process. I was scared to modify the old code in fear I'd break something else unexpectedly. When I'm scared to modify code--that's a good hint I should just rewrite it from scratch. Use my new knowledge and skills to do the job right.

I've been wanting to update the message board code for months now, but something else was always more important. Come to think of it, there are other things I'd rather be working on than the message board code. It could have waited another couple of months, no big deal. So why am I working on the message board code instead? =)

It's all Silent Doug's fault! He suggested a feature that would allow people to read just the first few lines of a message--somewhere between the 'compressed' and 'expanded' versions of the message boards. It's quite a good idea, but--gasp!--it would require substantial modifications to the message board code. If I had done a good job coding it in the first place, I could slip a feature like that into the code base fairly effortlessly. But alas, that was not the case. The message board code was terrible.

So by golly, I decided it's time I finally updated the code base. It's much slicker now, and almost perfect. I slipped in Silent Doug's suggestion yesterday. Today was a "details" day. The little stuff that still needed to be done. The BIG stuff was all working as expected. There's a lot of details, though, and at this point, I need to start writing them down to make sure I don't forget any of them.

Here's my list for today:

  • Make sure admins can still see and undelete posts, if necessary
  • Make sure the icons by people's name still show up correctly (particularly the 'new member' and 'updated profile' icons--I wasn't sure if they would work anymore).
  • Posting new messages works (I could VIEW messages--but I hadn't fixed the code that actually posts them)
  • Stop opening links into new windows
  • Check that 'hidden' board stay hidden from those who aren't supposed to access them
  • Test the boards with an admin account, a moderator account, a premium member account, a "normal" member account, and as someone who's not logged in
  • Update the code for reporting problem posts (the old code works, but I want to revamp it to provide more information for moderators)
As I'm working on the code and I think of new things that need to be added to the list, they go on. And I'll cross off the ones I finish. Checking that everyone profiles show up correctly turned out to work without any modifications, so I crossed that one off very quickly. The others took more effort. The only thing I haven't finished yet is that last item, but even when I do finish it, I plan to do much more testing before I make the feature live. Measure twice, cut once. =)

Of course, I know bugs will slip through. I'm just one man and Atlas Quest members number in the thousands. You'll try doing things I never even thought of, and find bugs during the process.

But that's for another day.... Today, it's just a work day. =)

I worked on several features, before taking a rest a little after 2:00 in the afternoon. I reached a good stopping place. A good stopping place is usually when I can cross off another item from the list but before I've started fixing another one. I usually eat lunch between 2:00 and 3:00--I like a late lunch because dining areas are much less busy then. Much quieter and relaxing. Even if I eat here, I'm still in the habit of eating late lunches. It's just what I do.

I also tend to take long lunches, and today was no exception. =) Amanda left a postal box for me to mail for her--she left late last night to work and I'm her mail-deliverer when she's not in town--so I walked it to the post office and mailed it off. Then I checked my PO box. I usually only check it a couple of times a week when I'm at the post office mailing stuff anyhow. Alas, no checks from premium members today, but there was a copy of Smithsonian magazine that had arrived.

So I walked the magazine down to the Taco Time a few blocks away and ordered lunch. They had a few newspapers available for reading as well, so I picked up the business section for reading, and read about Boeing's earnings report (I own 50 shares of Boeing--gotta keep on top of those investments!) and their progress on the 878 Dreamliner. The tail fins arrived in nearby Everett last night, just in case you're wondering. The first pieces of the first 878 are starting to come together.

Then I read about half the Smithsonian magazine before walking back to the apartment. I'll save the other half for another day. =)

All told, between the post office, walking, lunch, and reading, I wasted about three hours. My exact whereabouts during lunch vary. Sometimes I eat at home, sometimes I eat out. Sometimes I go for a REALLY long walk, and sometimes I read books or magazines. Sometimes I make a trip to the post office to mail stuff and check my PO box, and sometimes I go to the library to pick up books or read other magazines and newspapers. Oddly, regardless of what I do, it always seems to take about three hours in total. =)

I got back to the apartment this afternoon at around 5:00 this evening, and immediately checked up on Atlas Quest. Run my patrol--usually much faster than in the morning since I was only gone for a few hours rather than the whole night while the east coast has a three hour lead on me. I spent about a half hour catching up with e-mails and messages, then disconnected from the Internet and delved back into hard-core programming.

In this case, I worked on getting the ability to post messages working on my development machine and stopped links from opening into new windows. There was a good reason for all those windows opening into new windows when I first implemented it, I might add--mostly related to the fact that you could read all of you favorite message boards at once. Now that you can't read all of your favorite message boards at once, there's no longer any reason for me to open all those links into new windows. Since I'm working on the message board code anyhow, may as well clean up that little problem while I'm at it. =)

By about 8:30 this evening, my head needed a rest. I got a lot done and feel like I've been especially productive, which is a good feeling. =) But concentrating gets tiring after several hours. I needed some lighter material to keep me occupied for a change. I did another run on my AQ beat, read online about Delta being cleared to exit bankruptcy (I like to keep on top of news in the airline industry since Amanda works in it--I'd never buy stocks in it, though!)

Then I decided to tell all of you folks about my day.

That's a typical day for me when Amanda's not around. When she's around, she likes to use the computer too so I try to work around her. I try to work on stuff that doesn't require a computer (reading books about web servers or databases, for instance), brainstorming ideas, and creating to-do lists. Sometimes I take my laptop and work on my Appalachian Trail book. It's too small and hard to write actual code and develop Atlas Quest with the laptop, but it works fine for writing so I'll sometimes take the day off from Atlas Quest and work on my book instead. My lunches might stretch out to four or five hours since Amanda's on the computer and I'm not very productive then. Not that I'm trying to avoid her, of course, but only one of us can work on the computer at a time.

Maybe I'll write about one of my days when Amanda is in town to give you a taste of that. =)

The rest of tonight I'm going to relax by watching television. Lost and Medium is on tonight, both shows which I enjoy. I usually watch about half of Leno before calling it a night (very rarely do I watch any of the guests he has on) and going to sleep. Sometimes I'll check on AQ before going to sleep, and sometimes I don't. *shrug*

So there you have it. A typical day in the life of Ryan Carpenter. =)

Monday, April 02, 2007

April Fool's!

If there's one thing I learned yesterday, it's that letterboxers have a special fondness for April Fools. Yes, that announcement yesterday about the new attributes on Atlas Quest was a joke. I figured the "Killer Clown Area" icon would probably clue most people in, but it appears that at least a handful of people fell for it anyhow. Many thanks to the other administrators who helped me brainstorm ideas for some of the better icon ideas. =)

A few people enjoyed the random themes so much they wanted to know if they could make that their default theme! Alas, sorry to say, that is not an option. Themes are generally created through the use of CSS, but that random theme required a bit of programming for it to work. Until CSS supports randomized themes, it will not become a choice. Enjoy it while it lasts, for it will only last a short time.

The best April Fool's joke of all time, naturally, I had nothing to do with. Go ahead and close your mouth now--if there's one person that can one-up me in a battle of wits and humor, it's wassamatta_u, who enlisted his son to show up at the event in San Jose, dressed as a rookie policeman, to arrest him. Brilliant! Heaven forbid if he tries to top this little joke next year. We're keeping an eye on you, wassa!

Fortunately, however, wassamatta wasn't aware of all the little surprises in store. He was the proud recipient of a large box of underwear from letterboxers around the country. I know lisascenic took some pictures, so perhaps she'll share those soon. Can't wait to read his comments in the next Boxers and Briefs entry!