Archive of January 2009
Saturday, January 24, 2009
DECIMAL() - A Lesson in Data Retention
So unknown to me, MySQL changed the way it handles DECIMAL columns between 4.x and 5.0. Typically this wouldn't be a problem, but when my site was migrated to a new server, it also upgraded it to MySQL 5.0. And I swear, initially the data was fine. And based on what I read on the change page it should have kept the old table functionality. But it would appear sometime over the Christmas holiday —while I was out of town and not paying much attention, they must have dumped and reloaded the database. And doing that changes the column from the old to new functionality. (See the last paragraph in the above referenced article.)Now the ugly part for me…my CycleLog uses DECIMAL to store some of the personal data from my rides (weight, body fat and sleep time). And unfortunately, the weight column was previously configured as DECIMAL(3,1) which in MySQL 4.x allowed values up to 999.9, but in MySQL 5.x only 99.9. Thus being my weight is over 100 pounds, all of my rides that had a weight associated with them —that would be nearly all of them, had their weight values reset to 99.9 for all rides.
I stumble upon this when I entered a ride and the weight I entered was showing up as 99.9. Thus the "huh, what's going on" journey began. Once I found out about the column change, I altered the table to DECIMAL(4,1), updated my data and it then worked again.
I run a nightly database backups to S3, but I only retain 10 days worth. Going back to the oldest one, the data was already gone. And initially I thought my hosting provided might be able to get it back as they thought the old server was still around. But unfortunately, it had been recycled. Thus I have no backup with the old data. I know I've certainly lost at least the last 3-5 years worth of data. The 2009 data will be fine as I had the data for the couple of rides I had taken. (I've been sick so I have been riding lately.) And I have the first 5 years worth of data in my old paper logbooks. So I should be able to painfully recover that, although my wife has offered to do some data entry for me. So I may have here enter the date and weight on a spreadsheet, export that to CSV and then write a quick script to reinsert it. I also may have some more of it archived on a CD somewhere as I used to log it on my Palm for later entry for a few years. But that likely will be more involved as I'll have to Perl it out of the Palm DB files.
So once the initial shock and disbelief passed, and I accepted the fact that a lot of it is gone forever, I'm left with a tough lesson in data retention. I'm bummed, but it could have been a lot worse had I lost my whole DB. It certainly makes me wish I had started to archive the database quarterly like I had been intending to do. It will certainly happen moving forward though.
And the real kicker? The personal data was a later add-on to the CycleLog. I'm not sure why I used DECIMAL there, because the rest of the schema uses DOUBLE. Had I done that this never would have happened. ARGH!!!!!!!!!!! January 24, 2009 @ 08:17 am | Category: Software Development
Sunday, January 18, 2009
Saturday, January 17, 2009
A New Computer
So after suffering though years of falling further and further behind the technology curve, I've finally bought a new computer for home. But before I get to that, let's talk about what I'm typing this on at this very moment…Currently I have white box PC that originally was built in 1997. It's been piece by piece rebuilt or upgraded over the years, but nothing new for a number of years now. It originally was a Pentium II or maybe even Pentium. I know I replaced the motherboard at one point, but I don't know if I changed processors then. In any case, a couple of years after that I did get a Pentium III on the cheap which is what it currently runs. I don't recall the rated speed, but it's overclocked to 784MHz and has a lofty 256MB of RAM. It originally had a 6GB hard drive, but I added a second 40GB hard drive. It originally had a cheap 15" monitor that was later replaced with better castoff monitors. First a better 15", then a 17" and about 3 months ago a 19" which is about the only truly worthwhile part of it. So anyone else think it's time for an upgrade? Me too…about 5 years ago.
Ever since my first PC I've always built my own machines. But these days I simply don't have the time or inclination to do that. Thus, "Dude's getting a Dell". ;) So last weekend I finally pulled the trigger on a XPS Studio series machine. The basics:
- Intel Core i7-920 processor (8MB L2 Cache 2.66GHz)
- 8GB DDR3 SDRAM AT 1066MHZ
- ATI RADEON HD4670 512MB
- 640GB Serial ATA 2 Hard Drive 7200 RPM
- Dell S2409W 24-inch Full HD Widescreen Monitor
- Dell A525 30 Watt 2.1 Stereo Speakers with Subwoofer
- 6-Button Logitech Mouse
- 19 in 1 Media Card Reader
It's got the newest processor line available, although a couple of steps below the top of the line. (cost consideration) But it's got lots of DDR3 memory which should really help with the type of things I struggle with currently that I'd like to do more of. That being audio ripping and encoding, photo and video manipulation and scanning, again mostly photos. Currently trying to do most of those sorts of things is painfully slow and you can't do anything else. That shouldn't be a problem anymore. The speakers certainly aren't audiophile quality, but it's big step up from the no-name basic plastic boxes I currently have. Besides, if I really want to listen to something through the computer I generally use a good set of headphones. It's got a six button mouse which is something I have gotten used to using at work and I find very handy. And the front panel media reader is a godsend as I'm tired of hassling with various adapters and having to constantly pull and unplug various things to free up a port.
I'm happy with my decision. And I'm excitingly awaiting it's arrival. Which could be as long as another two weeks as the estimate ship date is on or before 1/28. This is due to having to wait for the monitor to be in stock, but I believe it's worth it. If endure the current system for 12 years so what's 3 more weeks at this point, right? January 17, 2009 @ 07:57 am | Category: Brainwork
Sunday, January 11, 2009