I just got a renewal notice for a domain. I haven’t thought about this bill in ages and started wondering what the future of billing will look like as more people set up more bills for auto-pay and as those people die. What will happen with those bills? Will credit cards and billers need to change their billing frequency or account expiration policies? It’s cheap enough to keep fringeuser.com registered and it’s the best deal to do the 5 year registration, but eventually the auto-pay option will probably hit its interval after I’m gone.
You meowed quietly and stretched your legs when I picked you up from the ratty old basement chair, covered in fur and old bits of thrown up food. We looked around at the cracked yellow floor you’d walked across thousands of times and said goodbye to the swinging door I cut for you to make nighttime escapes. You said goodbye to the rows of fenced-in backyards that you’d indiscriminately considered your home for the past 8 years, your entire life, and went up the stairs, you cradled in my arms.
We stopped for a moment and went upstairs. Would you like to say goodbye to the lady, fast asleep, in whose restless lap you liked to try to find a comfy resting place? The dog made you too anxious to stay long and then headed back down to the entry way, stripped of its familiar golden trim. You eyed the box, your least favorite place to spend any time and I coaxed you inside, meowing with more apprehension.
“Do I have to?”
“Yes, little friend, I’m sorry but it has to be.”
“meow…”
You waited, unquietly, while I tethered the dog, whose excitement for any trip to anywhere would always be predictable and eventually I brought you with us out to the larger metal box where forces would jostle you around impolitely.
You reminded me of the first trip over five years ago when your breathing had grown strained and on our way to the doctor who would inspect your small, frail lungs and learn you suffered asthma, preparing you for a lifetime of forced puffs - one in the morning, one at night - to alleviate that struggle as we made our way north.
“meow”
“I know, I’ll miss it too.”
“meow”
“It won’t be long, I promise.”
I let you loose to explore the metal box for the rest of the trip. Your big friend lay quietly in the back as the streetlights streamed in, over, and past while you explored the front seat, armrest, and floor.
And eventually the box stopped - I opened the door, and you went out to explore your new home just past midnight.
“meow”
“I know - it’s not the same, but you’ll make friends. You always do.”
How do I construct a SQL aggregate function over time to measure wall clock hours? Say I work in corporate security and I have information about employees entering and leaving a building so I know how long Jim and Pam were in the building individually and I want to know how many minutes *anybody* was in the building? A security log might look like this:
Person
Enter
Exit
aggregate minutes
Jim
7:00AM
11:30AM
270
Pam
8:00AM
9:00AM
60
Pam
10:00AM
11:45AM
105
From such a log, I’ve got a total of 285 minutes when someone was in the building. In a standard language like C or perl this might not be too hard to solve by iterating over the records and a bit array for minutes of the day which could be set “on” when people are present, or by iterating through records (sort by start time and duration and compute overlaps and do some counting) but right now I’m not sure how to do it in SQL.
More thinking out loud to come as I make progress or get increasingly frustrated with this…
Update: I think I figured out the right way to approach this. As far as I know, no DB server implementation offers such a time aggregate facility so that’s probably not the right tool to throw at this job. This is data I have (and need this computation performed on) is in a database built on a Ruby on Rails web application and the simpler way to handle this will probably to recalculate that aggregate value as records are entered or modified from the web UI and then retrieve that value directly from the database rather than trying to compute it from the constituent records. Design-wise I’m not sure which approach I prefer. This is a pivot on DB data and feels best performed in some post-processing context (with the flexibility to pivot in different ways and see “minutes in the office [by day|by people in a department|by hour|etc]”) but I also know there is only one axis this will ever be pivoted on, so there’s a fine case for removing that business logic from the database. And since I don’t know how to do it in SQL, that’s the way I’ll probably go
In an address last June, […Sarah Palin…] urged ministry students to pray for a plan to build a $30 billion natural gas pipeline in the state, calling it “God’s will.”
Yeah, Moses probably just forgot “Thou shalt build a $30 billion natural gas pipeline” when he was trying to keep all those other commandments in his head on the way down from Mount Sinai.
August 26, 2008 at 8:24 am
· Filed under Uncategorized
I talked with my homeowners insurance agent and during the interview he asked a question which wound up leading my to understand the answer to one of life’s persistent questions: what is the difference between a jacuzzi and a hot tub?
Jacuzzi a bathtub with jets
Hot tub a large multi-person pool with jets, frequently found outdoors
So at last Tuesday’s track workout my leg was acting up again.
To recap: about four weeks ago I started pushing into the higher mileage weeks (mid-50’s). This turned out to be bittersweet since I did a couple runs with headphones and was really turning in some very gratifying runs of like 8-9 miles at a low 7ish pace (they were probably just about exactly at my Boston qualifying pace which is about a 7:10-7:15) and it felt really, really good, however around this time I also started developing a new pain in my right quad. I felt it in the time trial this month but did that anyway and still coasted to a fairly comfortable 11:47 and negative split, but this was kind of strange since the pain had stayed with me and felt deeper than normal (not quite in the muscle) and also wasn’t responding to ice like most soreness. I talked with my coach who suggested it could be a stress fracture, which was surprising since I always expected such a thing to develop around my shins but I looked online and many of my symptoms lined up.
Fast forward through me getting more concerned but not totally quitting running, noticing more of the pain if I hustled down the concrete hill to the bus in the morning, and an x-ray by a pretty suspicious tech whose nametag (”Sunshine”) didn’t really reassure me (but where the x-ray didn’t prove that I do have a stress fracture developing) and I made the kind of difficult decision last week to rest. So I hadn’t run in a week and continued to ice my quad. The symptoms *still* haven’t subsided, but I’d started going a little nuts and last night was too perfect for running to think about staying in so I went out for a blissful 6 miles at what turned out to be a 7 minute pace (telling myself the whole time “easy, fella…”). I’m finally scheduled for a bone scan (tomorrow) which should be conclusive for the stress fracture or not.
But for me, the key, is that I really, really don’t want to have an injury. A stress fracture would be just about the worst thing evar since it typicalyl means 6-8 weeks of rest. I could bike or something and wouldn’t be on crutches, but no running or impact. So I’ve got my fingers crossed. But I *am* excited about getting the scan done. This is MR technology, so I go in in the morning to get an injection (not the part I’m excited about), come back 3 hours later and get scanned for about an hour and then should have some cool 3D imaging of the interior of my leg.