Monday, January 4, 2010

Take my own advice, dernit

Sent to a friend. Posted here so I can review as needed.


Here's the diet strategy that works best for me.

1) Commit to exercising every day. Make a plan at the beginning of the day. Even if I do not manage to exercise 7 days a week -- trying to helps me exercise more often that I would otherwise. I bought PowerBlocks so I have the equivalent of dumbbells in the range 10-45 pounds in 5 pound increments -- in the space of 1.5 shoeboxes. 20 minutes of weight-lifting kills me, and my bench is set up in the basement -- so there's always a way to exercise, and always time.

2) Get in the habit of eating more-or-less fixed meals for breakfast and lunch. I'm eating steel-cut oats for breakfast every day. Literally, the entire processing is cutting up the oats into smaller bits -- which means they take longer to digest and pose less of a sugar hit -- which is what leads to hunger. Lunch: broccoli and friends from the caf. Oats lower cholesterol.

3) Continually get information on the subject, to keep me in the game. FitnessRocks.org has 150 podcasts from a physician - fitness nut, that Susie can put on her iPhone and listen to while she grocery shops or works out. I'm on podcast 60 -- my second pass through the collection. RealAge is good. I keep this excellent book next to the bed and pick it up every few days. Check the reviews on Amazon. You want to be eating the Mediterranean diet. A huge error I made for decades was avoiding fats in food. There are healthy fats, esp. olive oil. Atkins worked for millions, and that wasn't low fat.

Something I have not tried, which I intend to try, when I'm a bit fitter and the weather is less nasty -- is seeking the company of skinny people. A FitnessRocks episode and other sources present research that being around heavy people makes you heavier. Your psychological set point changes, or something. With luck, this spring, I'll get routinely involved with my wife's running club. There are a couple people there as chubby as me -- but the average is more like the general population looked, 40 years ago. I went to the club's annual party a few weeks ago and was struck by the seeming gauntness -- which is what used to be normal. I wince when I think of Wall-E -- how the captains were successively heavier, the whole population huge. How many captains into that sequence am I? With 67 percent of U.S. adults overweight or worse, "normal" is not healthy.

An email about identifying duplicate MP3s (etc)

How do I find duplicate music files?

Here's an idea for finding duplicate music files at the album level, that is, when the MP3s are organized from the start by album.

Order the MP3s by run time -- how many minutes and seconds they run. Using the run time accounts for the fact that there can be several versions of a song -- if you want to keep the versions (like, single vs album). It would work across formats, like MP3 vs WMA vs FLAC.

Compute the ratios (within some accuracy) of one to the next, and turn that into a hash that serves as a unique key for the album. #1 is 1.3 times longer than #2, which is 1.13 times longer than #3, which is 1.4 times longer than #4, etc Using the ratios might help with error estimating the run time; the time would be off systematically, we hope. It might be best to compute the hash from the 3 or longest, to avoid accumulating too much error. Experimentation would show that, maybe.

Given the hash, compare it to the other albums that have the same number of songs. If you find a match -- keep the bigger set, hoping for higher quality. Or always keep FLAC, if you like FLAC.

Can you determine the MP3 run time in C# code? I dunno. I saw a couple comments where people were struggling.

So figure it out by playing them! Write a hugely multi-threading app that simultaneously plays as many MP3s (or FLACs, etc) as your computer will manage. Use some tag-writing code to stash the run time in the ID3 tag, so you only have to play it once. Do the math: if you get (pick a number) 100 players going at once -- can you get through your collection before the energy death of the universe?

This might be helpful. This was impressive, but probably not so helpful, except conceptually maybe. Here's a way to play 'em. This enlists Windows Media Player to get the length.