Archive for November, 2006

When did I change my mysql database structure?

November 30th, 2006 by daryl

A stats tracking application I’ve slowly built over the last six months or so recently started showing some potentially anomalous data for one of its views. A number that has trended upward steadily for all time suddenly dipped substantially (5%) and wallowed about at the low number for a week before beginning to trend upward again. During the low period, I looked into the matter to try to determine whether there was a problem with the stats or whether the numbers were legitimately low.

My first step was to identify any changes that had been made to the stats program immediately prior to the dip. There were a couple of changes that couldn’t possibly have related to the issue and one that seemed unlikely to have caused a problem but that merited investigation. So in a copy of the code and on a copy of the production database, I rolled back the possible culprit and re-crunched the stats. The numbers came back the same, so the possible culprit I had identified was in fact not the culprit.

Next, I wanted to determine whether or not I had made any recent changes to the database structure that could possibly have skewed my calculations (I do all sorts of calculations and caching on raw data). This wasn’t as straightforward as just viewing an svn log to determine when any relevant files were changed. But there is a way to tell when (if not how) a database was last changed. You need only look at the timestamps on the files that contain information about your database structure. This works for mysql, in any case. Here are the steps I took:

  1. Figure out where your data files are stored. If you don’t know, try typing “ps -eaf |grep mysql” (or the equivalent on your linux distro) and looking for the “datadir” parameter in the command line string. Change into that directory.
  2. There, you should see a directory whose name corresponds to the database you want to check for changes. Change into that directory.
  3. Next, do something like “ls -la *.frm” or, if there are many tables, “ls -la <tablename>.frm”. This lists timestamps for the files that store table structure, which tells you when the tables were changed.

In my case, I have a production database and a staging database that stay pretty close to in sync. Luckily, I had synced data between the two but hadn’t synced a change I had made to a production table’s structure. So the timestamp for my production table corresponded to the date on which our stats dip appeared. I could then get a mysql prompt and type “show create table <tablename>” for both my production and my staging databases to see what the difference between them was.

It turned out to be that I had simply dropped an extraneous index in production, something that shouldn’t have affected my stats. That crunching stats in both the staging and the production environments had the same end result corroborates my conclusion that the index change didn’t matter.

As my stats had begun trending upward again and we had just come off the Thanksgiving holiday break, I felt pretty confident after doing this little diligence pronouncing the dip a product of holiday lag. In any case, now you know, if you didn’t already, how you can check to see when you last changed a mysql table’s structure.

powered by performancing firefox

Whirlaway

November 22nd, 2006 by daryl

Today, I fixed the garbage disposal at the house we’re purchasing. The symptoms of its problem were that it would hum when you flipped its switch, and after a couple of seconds, the reset button would toggle. It wouldn’t spin at all. I researched disposals and found that this usually means that something’s keeping the flywheel that drives the rotation from moving. Nobody’s lived in this house for a year, and I guess the owners left some junk in the disposal when they left. After doing my research, I checked, and, sure enough, there was lots of brown crud caked all into the inner workings of the disposal as seen from above.

Typically, when you need to loosen the flywheel, you stick an allen wrench up in a hole devised for the purpose and turn until the wheel loosens enough to let the thing spin. Then you pulse the switch to fling out whatever the obstruction was. But Whirlaway units (the brand installed at my new house) have no hole for this purpose. When I called the manufacturer to find out more about how to fix the thing, they told me that the preferred way of fixing this issue is — get this — to jam a broomstick down into the disposal and try to get leverage enough to loosen the wheel. Whaaa?

I tried that technique yesterday, applying enough force to bend (not in a damaging way) the stainless steel sink, to no avail. The manufacturer today suggested WD-40, and I sprayed the better part of a can of that down the disposal today trying to eat away at some of the gunk in hopes that it was corrosion rather than food. That cleaned things up a bit but didn’t solve the problem. So I attacked it with some Drain-O. Which still didn’t solve the problem. At this point, I summoned my inner brute once again and applied more force with a paint roller extender (in lieu of a broomstick). The aggregate effect of the chemicals and my own manly labors with the extender did the trick, and I finally got the flywheel to move.

And that’s how you fix a Whirlaway disposal.

powered by performancing firefox

Flurry

November 21st, 2006 by daryl

We’re on the home stretch with the sale of our current house and the purchase of a new one. A week from today, I’ll have all my stuff moved out of my house. Some of it will already be in my new house, and some will be in transit on closing day. I’ve had a month to do repairs requested by the purchasers of my house, among them the repair of a toilet (which doesn’t need repairing) and getting the roof evaluated for possible hail damage. I also had the microwave, which was on recall, repaired at no cost, and I tried my hand at applying bondo and caulk to a water damaged back door (with pretty good results, I think). For the toilet and roof repair, I had contacted Mleeka’s uncle — a contractor — to see if he could refer to me anyone who’d do a good job and not bend me over on cost. His plumber keeps saying he’ll show up but never does, and I went ahead over the weekend and officially gave up on the roofer. The toilet thing is a 1-hour job in the right hands, so I’m not really sweating that, but the roof has been a big unknown.

So I called a random roofer over the weekend to see if he could come do an evaluation on Monday. He said he’d be here bright and early, but he never showed up and never called. We did get a surprise snow flurry at midday, and that’s what he blamed his no-show on when I called him, but it wouldn’t have been an issue if he’d made an appearance in the morning as promised. So there I was, halfway through Monday, with two more workdays before the holidays this week, closing on my unrepaired house on Tuesday next week, and worried from some things the absentee roofer had said that I was going to have to replace my whole roof, a very much unanticipated expense.

Here’s how the rest of the day went:

  • Call a bunch of other roofers to try to find somebody who could get out to look at my roof asap.
  • Finally find one who can come yesterday afternoon. He calls back to reschedule for this morning. Which is fine, because at least he called to let me know he couldn’t make it, and he was still the fastest responder from among the many roofers I called.
  • Sit and wait for the plumber. No show.
  • Wait for a call from the power company, who’s supposed to turn on pilot lights at my new house so that I don’t blow the place up trying to do so myself.
  • Work.
  • Wring hands.
  • Grow gray hairs over this roof thing.
  • At the end of the workday, have friends show up a week early to help us move. I was going to paint Lennie’s new room yesterday, so they came along and helped.
  • After the first coat of paint gets applied, run Lennie and Mleeka home for bed-time, go back to buy more paint, and apply a second coat of paint.
  • Get home at midnight.
  • Can’t sleep.
  • Find email waiting for me from the lender on my current home offering me a rates of 5.875% and 7.25% on the two loans I’m getting on my new house. These rates are lower (by 1.5 percentage points on the smaller loan) than what I’m locked in at for the new house. We’re talking a $36 difference per month, $450 a year, $13K over the lifetime of the loans. Nothing to sneeze at.
  • Work for a couple of hours until I’m finally wound down enough to hit the sack at 3:00 a.m.

So far, today’s looking a little better. My roofer showed up and seems to think the roof is ok. There are some nails that have popped up and need to have their holes caulked and their shingles renailed. The boots on the fans need to be replaced. There’s one cracked shingle that’ll need to be replaced. Otherwise, he says the roof looks fine. No hail damage whatsoever. I’ll drop $200 to have this stuff repaired rather than the $4K - $5K I was suddenly confronted with paying to buy somebody else a brand new roof. I paint again tonight (and tomorrow night) and will probably be up late again, but it’ll be with one load lifted, at least. I called the lender on my new home and tasked her with trying to break the locked-in rate and get me a slightly better loan. We’re almost there, almost done with all this hassle.

Stand up for your rice

November 18th, 2006 by daryl

Stand up for your rice. One-and-a-half or two years ago, this might have been a suggestion we made to Lennie. But today, it’s Lennie’s rendition of Bob Marley’s rebellious classic “Stand up For Your Rights.” She heard it in the car with Mleeka the other day and started singing it unprompted.

Last weekend while out and about with her, I prompted Lennie to sing the refrain from Sting’s “Roxanne,” and she belted out “you don’t have to put on the red light” with much gusto.

I continue to encourage her to sing both songs. Kanye West and Tenacious D remain on the list of artists I can’t listen to in front of Lennie.

Blogged with Flock

Tags:

House Saga

November 4th, 2006 by daryl

Simultaneously buying and selling a house is the biggest single pain the ass I have ever endured. When you sell, you’re constantly pushed out of your house by people who it turns out look down on the abode you’ve loved for lo these many years. When you’re buying a house, you’re constantly pushing out of their homes people who have loved their homes for lo these many years. It’s a lose-lose situation until you have contracts at both ends of the deal, at which it’s still an utterly bittersweet proposition.

A couple of weeks ago, we got a contract on our house. We did two or three counters and finally agreed upon a deal that got us our minimum acceptable bid. The buyers’ inspection turned up a couple of things that should be within the budget I allotted, so provided they can get financing (on 100%!), the selling part of our pain the ass is over.

The buying part is a whole other story. When we bought our current house, we worked with a realtor who took us around to various houses and tried to convince us that each one was the house we were born to live in. The house we finally bought was one we happened to drive by on our own and think might be ok. It was for sale by owner. We got our realtor to contact the owner and get us in, and we fell madly in love with the house. We’re still madly in love with it. If there were enough yard and the covenants would allow it, we’d just add a room or two and stay here. We looked in some earnest at no fewer than four houses in our current subdivision in hopes that we could stay at least pretty close to where we currently live. But it wasn’t in the cards.

So we made our realtor — the wife of a former boss of mine –  take us to probably 20 houses. We offered on one that we liked quite a bit, but it turned out to have a cracked foundation. A couple of weeks later, we found another we liked on a faux-lakefront property, and we offered on that one contingent upon approval for installing a fence, but it turned out that we couldn’t install a fence.  We finally decided to really blow the hell out of our budget on a brand new house in a nice new subdivision, but as a last resort, we checked out the house pictured above, and it turned out to be totally decent and many thousands of dollars closer to our budget. We seem to have an accepted contract on the house, inspection and some repairs pending. In any case, we’re out on our butts on Nov. 28, so if this third offer doesn’t pan out and you know us, we may be knocking on your door with hat (and furniture and all other earthly possessions) in hand for lodging until we find something different

Insomnia

November 4th, 2006 by daryl

Off and on for years, I’ve suffered from insomnia. I remember nights during high school that I couldn’t get to sleep and found myself, after having tried all the standard relaxation techniques, weeping at 5:00 in the morning because I was so worn out from nights of having not slept. I think it eased up some in college, though I’ve had some trouble sleeping lately. If tonight is any indication, however, I’ve passed an insomnia gene along to my daughter.

Mleeka and her sister Abbey went out to a movie tonight, and I was charged with getting Lennie to sleep. Which in theory wasn’t hard, as they left at around her bedtime, and I was reading her a bedtime story per the usual routine as they left. Comfortable that she was going to drop off to sleep soon as always, I found a movie (the pretty recent “Casanova” on Comcast’s On Demand with Heath Ledger and Oliver Platt, which movie was most entertaining, especially if you happen to have studied comedy as a literary form) and settled in for a poor deserted husband’s night alone (bam chicka bam). As you may have guessed, I enjoyed the movie quite a bit, but that didn’t stop me from peeking into Lennie’s room from time to time. Several times, I found her counting her toes or mumbling to herself. It’s not terribly uncommon for her to play around for a while before going to sleep, so this was no big deal. When I peeked in on her at 10:00, figuring she must surely be asleep, I found her sitting on the floor beside her bed reading a book.  This was two hours after bedtime. So I went in to see if maybe I could cuddle her for a few minutes to help her get to sleep. She told me she wanted to pee on the potty, so I picked her up and found that her diaper was half off and that she had two legs in one leg of her pajamas (clearly having tried to take matters into her own hands). I took her in to sit on her potty and noticed that she had the saddest wet little tear in the world sitting on her cheek. I decided that rather than putting her back to bed, where she clearly was having no luck going to sleep, I’d snuggle her on the couch in front of the rest of my boring grown-up movie. It didn’t help.

At around 11:00, Mleeka got home, and Lennie was still awake. We sat around watching TV for a bit longer, and at around midnight, I finally convinced the two of them to go to bed. It appears that they’re now both asleep.