Handy comparison pictures

So here's a random fitness-related link.  It's a handy page I found for doing visual body fat comparisons.  I particularly like this one because (at least for the men's section) a bunch of the pictures are of the same guy.  Apparently he must have lost a bunch of weight and kept good track of it.  That makes it much easier to see the differences in physique than when you're looking at different people with different sizes and shapes.

If you're not into fitness, you might not be familiar with body fat measurement.  Body fat percentage is one of those metrics that are handy for gauging your fitness level.  It's basically just the percentage of your body weight that consists of fat.  If you don't train, then just tracking your weight is fine, but once you're lifting weights or doing other strength training, you're going to build muscle.  Since muscle is more dense than fat, it makes weight tracking less reliable - you can get into a situation where you're getting thinner, but are actually gaining weight because you're burning fat and building muscle.

There are a number of ways to measure body fat: there's the DEXA scan, which stands for dual energy X-ray absorptiometry and is considered the "gold standard"; there are multiple techniques using calipers to measure skin folds; and there's the seriously low-tech method of eyeballing it, i.e. using comparison pictures. Of course, none of these measurement techniques is exact.  Even the DEXA scan is just an estimate that can be influenced by a variety of factors.  The only 100% accurate way to determine your body fat percentage is to excise every gram of fat from your body, weigh it, and compare that to your total weight - which can't be done without killing you.

Looking at pictures is the method I use.  It's obviously the least accurate and the least precise, but it has the benefit of being by far the cheapest and easiest.  I mean, you're just looking at pictures on the internet, for crying out loud!  And for my purposes, the exact number doesn't really matter anyway.  It's more a reference point for helping to figure out what weight changes mean and where my general fitness level is.  It's nice to have a general idea, but it's not important enough to me to spend significant time or money on it.  It's just one metric among many.  How useful it is depends on your needs and goals.

Conference talks

The other day I decided to go back to something I did when I was still working in the office: putting tech conference talks on in the background while I work.  Sometimes it's nice to have a little background noise if I'm not trying to concentrate too deeply on something (what I'm currently working on involved a lot of waiting for CI pipelines to run).  Of course, sometimes I my concentration level ramps up and I totally tune out the entire talk, but sometimes I don't and it ends up being interesting.

This particular afternoon I was listening to some talks from the GOTOpia Europe 2020 virtual conference.  This one had an especially good lineup, including talks from Dave Thomas, Kevlin Henney, and Allen Holub, who are some of my favorite presenters.  Cat Swetel, who I'd never seen speak before, also had a very interesting presentation on metrics that I would heartily recommend.

It might not be the same vibe as the live conferences, but it's at least nice to be reminded that the entire world hasn't been canceled due to the pandemic.  And there are always some interesting discussions at GOTO, so it's worth a watch.

Composer autoload annoyances

Note to self: Sometimes you need to run composer du -o to make things work.

I'm not entirely sure why.  But it's a pain in the butt.

This has come up a couple of times in working on one of our projects for work.  This particular one is an internal command-line application written in PHP and using the command-line components from the Symfony framework.  I won't get into the details, but the point is that it glues together the various steps required to configure and run certain things on Linux-based servers.  So to test it, I have to put the code on my test server and make sure it works there.

The problem that I ran into today was that I tried to add a new command class to the application and it barfed all over itself.  The Symfony DI container complained that it couldn't find a certain class name in a certain file. The PSR-4 autoloader requires that the class name and namespace match the filesystem path, so usually this indicates a typo in one of those.  But in this case, everything was fine.  The app worked fine on my laptop, and if I deleted the new command, it worked again.

Well, it turns out that running composer du -o fixed it.  I suspect, based on the composer documentation, that the issue was that the class map was being cached by the opcache.  The Symfony cache was empty, so that's about the only one left.  Unfortunately, this is pretty opaque when it comes to trouble-shooting.  I would have expected it to fall back to reading the filesystem, but apparently there's more to it than that.  Perhaps it's related to how Symfony collects the commands - I haven't put in the time to investigate it.

But in any case, that's something to look out for.  Gotta love those weird errors that give you absolutely no indication of the solution.