Time to get fit (by )

Sarah's been putting a lot of work into losing weight lately, but apart from the fitness stuff I do in Krav Maga classes most weeks, I've not really paid much attention to my own health. However, my work have a fancy new medical insurance benefit thing, which has two features of relevance: One is that they pay for us to be poked and prodded and weighed and so on to establish our basic health parameters, and the other is that they encourage us to do exercise and eat well through a complex system of points-based incentives.

This has a two-pronged effect: It's told me that my body mass index (23.4) is in the healthy range (18.5-25), but a bit close to the top end; and my blood pressure (124/75) should be under (120/80). Thankfully, both of these can be improved by doing more cardiovascular exercise; and with the complex system of points-based incentives, this is GAMIFIED. Combined that with discounts on interesting fitness tracker gadgets, and feeling that nagging awkward feeling of watching Sarah work really hard on her weight loss while I slumped on the sofa with my laptop, and it started to become inevitable that I was going to start doing more exercise.

So, I got a discounted Polar RC3 GPS. This is a watch with a GPS and some smarts in it, which communicates via radio with a heart rate monitor worn on a strap. By logging heart rate data it can measure my exertion in an activity, and if that activity involves moving around (running or cycling, for instance) it can combine that with speed and gradient information from the GPS to work out what effort I was expending. This data is uploaded via a USB cable to a Web service that Polar run (alas, I have to depend on them keeping the thing up and bothering to securely store all my data, although there does seem to be an option to download it in a documented file format; but if the site goes down, I'll be having to reverse-engineer their USB protocol to continue to get data from my watch).

The fun is in the analysis, however. Their software has a model of human metabolism that works out how much strain I'm putting on my system, how many calories I've used, how many calories of fat I've burnt, and an efficiency factor they call "running index". It'll gather data across exercise sessions and work out trends and all sorts of fun stuff, including a "training load" graph that tracks an exponentially decaying cumulative average of the strain I undergo; horizontal bands on the chart indicate cumulative load levels where I should be taking things easy for a few days.

It also has an ability to suggest training schedules, which can be uploaded into the watch, and will then guide me - giving me a target heart rate to aim for for a given time period, then moving up to a higher pace, than down again, for instance.

So I've set myself the target of doing at least one - and ideally three or four - runs a week, where I spend at least half an hour above seventy percent of my estimated maximum heart rate. Here's one I did earlier. You can even see what I did on a little map, including my cool-down period at the end!

The data from this thing feeds into the health insurance provider, too, which then drives their points-based incentive system. This has an unexpected benefit; although I'm quite enamored of earning points on principle, some of the benefits are things that Sarah and the kids enjoy (free cinema tickets once a week, Starbucks or iTunes credit, etc). That makes an incentive for them to send me out on runs; given how busy our life is, that's surprisingly useful!

Other than meeting my weight and blood pressure goals, and generally increasing the number of armed assailants I can disable at Krav before I start to get sweaty, I'd quite like to do a marathon or something one day.

Anti-abortion protestors in Gloucester (by )

I nipped into the center of Gloucester at lunchtime today. Doing so takes me past Gloucester Royal Hospital, and on my way in, I saw two men outside the sexual health clinic clinic (Hope House), with a big banner on the railings reading "Pray to end abortion". Looks like it's made the local news: Women using Hope House reassured that an anti-abortion protest will not affect their treatment.

On the way back, standing in front of them was a woman holding up a bit of cardboard upon which had been written "YOUR BODY, YOUR CHOICE". I gave her a grin as I passed; one of the men was muttering something inaudible to her, and I heard her start to respond with "It's been shown in studies that...".

Is this going to get worse? Are we going to need a clinic escort system, like they have in America? I work just opposite the hospital, and am not afraid to get shouted at or attacked while protecting people's rights; so if anybody does feel intimidated about visiting Hope House, I'll happily walk you in/out if I've got any break time free. You can ask me on Twitter.

How I’m managing my life with emacs org-mode (by )

It's no secret that I'm a busy person; often, when I decide to do something, a few years pass before I actually get to do it. So the only way I keep afloat is by the judicious use of computers to track my task lists. I rely on automatic systems to make sure I always know what I need to do today, and what are the most important things I need to do "sometime" that I can do right now. There's no way I could keep all that in my head without forgetting about things and letting people down, or feeling stressed because I'm juggling too much in my mind, or not being able to find the best thing to do when I have a free moment.

As I've mentioned before on here, I want a personal information management system based on predicate logic, so I can express complex relationships between things easily, and tell the system how to infer knowledge automatically. However, "build one of those" has yet to hit the top of my TODO list, so for now I'm using emacs' legendary org-mode. This lacks the rich semantic power of my proposed PIM, but it's already implemented and has a nice editing interface 🙂

A few people have asked about what I've done, so here's my attempt to document it.

Read more »

Goal-based artificial intelligence for home automation (and maybe piloting a network of autonomous killbots) (by )

For a while, I've been mulling the idea of writing zmiku, a daemon that can be programmed to automatically control various kinds of systems. My application is home automation, and maybe automating the management of servers (restarting and failing over services, dealing with overload situations, gracefully handling disks being full, that sort of thing); but it occurs to me that the same basic problem also applies to controlling autonomous robots such as space probes, industrial processes, and that sort of thing. A good solution to all these problems in one would be quite useful!

You might say that this is a non-problem; normally, people would just write programs from scratch to control these kinds of things, sitting in a loop reading inputs and updating state variables and choosing what output actions to generate, but the complexity of the resulting program tends to increase rapidly as the problem complexity rises.

Rather than traditional programming languages, a better notation for such a reactive system is a state machine. The Wikipedia articles on a UML state machine diagram gives a good introduction to one version of this notation, including some discussion of ways to extend the most basic version in ways that increase its expressiveness and modularity.

I'd like to base zmiku on a textual version of the UML statecharts, but today I've had a horrible stomach ache, so been unable to do much more than lie around and think about stuff, and what my mind settled on was the interesting question of how to integrate state machines with goal-based programming, which is also useful for controlling complex systems. In a goal-based system, various goals are known to the system, each with a priority; for instance, a flying robot may have a destination demanded by the user, which the navigation system tries to fly the robot towards; but a collision-avoidance system may sometimes override the navigation system when it detect that a collision will result otherwise, with a higher-priority goal for the steering system. And when the collision has been avoided, that goal will disappear, and the earlier goal of getting to the destination will take over once more. And if the robot's batteries are running low, then flying towards a charging place (or a place where the solar panels are in sunlight) might be a higher priority than the user's chosen destination, but not a higher priority than avoiding collisions. And so on.

So I came up with a model for integrating the two, using the "scoreboard" model from artificial intelligence; giving a system a shared global state between a number of concurrent subsystems. And this blog post is the result of me writing up my scribbled notes. I'm still in a lot of stomach pain, so I'm afraid it's going to be a bit rambly 🙂

Read more »

Folding history (by )

Ugarit is a content-addressed store; the vault is a series of blocks, identified by a hash, that cannot change once they are written.

But logically, they appear as a set of "tags", each of which either points to an archive (a set of files with associated metadata, which can be added to, or the metadata of existing files changed) or snapshots (a chain of snapshots of a filesystem at a point in time).

So in a store where objects cannot be modified, how do we create the illusion of mutable state in these "tags"? Read more »

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales