Vegan 3:15 Marathon Project

Can a mediocre vegan runner match an omnivore professional?

Can a mediocre vegan runner match an omnivore professional?

My uncle worked at the YMCA, ran sometimes twice a day as part of job as a fitness coach. He ran dozens of marathons in his life, with a known lifetime PR of 3:15 at the age of 50. He, like my Dad and everyone else at the time, ate like everyone else--neither vegetarian or vegan.

I recently saw "The Game Changers" a documentary with the thesis, "Plant Based athletes recover faster and so can work out harder and more frequently." I figure I should put that to the test.

My goal is to run a 3:15 marathon at the 2024 Marine Corps Marathon. That 13 months from now.

Can I do it?

You can take your recent races and plug them into calculators to predict your race time. Depending on the calculator, it seems like my 5k, 10k and half marathon paces are not far from where they need to be. I've never run a marathon before, so I only have predictions, which say I have quite a large gap to close.

How will I do it?

Well, eating plant based of course. But also eating clean in the currently sense of clean- low saturated fat, high fiber, high carb, etc.

Daily Goals

  • Grits or oats for breakfast
  • Something vegan for lunch and dinner
  • Less restaurant food than usual
  • Less

Supplements and why

  • B12 - because there's no bacterial sources of b12 in modern vegan diet.
  • D - because I'm indoors a lot
  • Hibiscus - to reduce blood pressure by 5-10 points
  • Omega 3 Fatty Acids, Lutein - Speculated to help with brain, nervous system, vision because I'm not young anymore.
  • Magnesium - to replace magnesium lost to sweating
  • No multivitamin - too many effects

Post workout

  • 20g protein after workouts. Replace any protein lost, rebuild muscles, tendons, etc.
  • Salt tablet, like Nuun. To prevent feeling exhaustion post workout
  • Watermelon juice. Citruline is speculated to reduce muscle soreness, speed recovery
  • Cracker or some sugary drink. Speeds restocking glycogen in liver and muscles

Pre-workout/Race

  • Beet juice - temporary increase to Vo2 max/cardiovascular efficiency
  • Taurine - 3g speculated to help with recovery
  • Creatine - for speed bursts and has good data supporting its use in sports
  • Caffeine - for speed, data appears to support net-benefit

Actions

  • Hired a coach and will follow the plan as close as I can
  • Sleep 11 hours a day
  • Do something to tighten up scheduling in the rest of my life to make time for enough running

Information Tracking

  • Use Garmin tracker
  • Use Garmin chest strap HR tracker
  • Use Strava and Final Surge

Gear

  • Carbon plate shoes on race days only
  • Maximalist shoes because I'm used to them and changing is as risky as any merit or demerit of a shoe type
Read and Comment »

Catching up on TypeScript

After avoid JavaScript for a few years, I must reface my nemesis, the undefined, the null, the falsy.

Hello TypeScript, again.

Surprise!

So, I had ChatGPT write a merit tracker. It wrote up some Javascript I don't even recognize anymore.

  • const is everywhere
  • looks like requires() won the module wars
  • JS isn't restricted to a DOM and can deal with CLI args with yargs and the file system with fs ... but
  • fs is already passé and fs-extra is the new hotness
  • export is now a keyword and not an IIFE (Immediately Invoked Function Expression)
  • There are things like python f-strings, e.g. console.log(``${date}.``)

I had the bot convert it to TypeScript. Usefully it gave me step-by-step instructions to convert it myself, rather than giving me a big blob of TypeScript.

Testing

I installed jest, several times to be sure. I ended up installing all of these.

{
  "@jest/globals": "^29.5.0",
  "@types/jest": "^29.5.0",
  "jest": "^29.5.0",
  "ts-jest": "^29.1.0"
}

Then I had to install a jest-config.js file. Without it, the tests ran twice, one time for the typescript version and another time for javascript version. The relevant magic is the testRegex, particular the last part that restricts running tests against the .ts version of the file.

This later turns out to be a bad idea. testMatch: ['**/*.test.(ts|tsx)'], is better, and less likely to be buggy regex. The real problem was I wasn't specifying a dist folder in tsconfig.json e.g. "outDir": "dist".

/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
    roots: [
        './tests'
    ],
  preset: 'ts-jest',
  testEnvironment: 'node',
    "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
    "moduleFileExtensions": [
        "js",
        "ts",
        "tsx",
        "json"
    ],
};

Astonishing

If I imported import jest from 'jest'; I got error messages about jest not having certain properties. So I removed the import altogether and it worked! Astonishing.

I also ran into a problem where the mocks failed to have the right properties. The error message: Cannot read properties of undefined (reading 'readJsonSync')

The solution, put this into tsconfig.json:

"esModuleInterop": true

Coverage

Now coverage is not working, it consistent reports 0% coverage and acts generally like the tests are using .js and coverage is looking at .ts or vica versa.

The problem was .ts and .js files were compiled to the same directory and the coverage tool was looking at the wrong one. I had to tell typescript to compile the .js files to a dist folder.

Linting

I'm working throught that right now. I'll publish again when I get it working.

Read and Comment »

Creating a useful and funny python serializer

I wrote a library that serializes and deserializes markdown to and from python, but more in the style of pickle and less in the style of a document object model.

Hello markpickle

I got the name from ChatGPT.

Origin Story

I wanted an API to support as many mime types as possible. Some mime types are for the people, such as PDF, Excel/CSV. Some time types are for the machines, like json, bson.

I thought, what about HTML and text? HTML has a problem with XSS risks. Text has a problem of not having much of a standard story for "styled" plaintext. Except for Markdown. Can I use markdown as a mime type for what starts out as a JSON object?

Challenges

The app is two functions, loads and dumps and they take or return an Any type and take or return a string. The Any is a problem, because mypy doesn't know how to deal with arbitrarily complex types. It seems to get confused with Unions of Unions of Unions. It gets confused with generics, e.g. lists that can work with any contents.

Impedance Mismatches

Markdown has some analogies:

  • header groupings + paragraphs make dicts, or even nested dicts
  • Lists or lists of lists
  • tables are dicts, but you can only put scalars in the values. This makes python objects of a certain level of nesting unrepresentable.
  • strings and non-string types can be represented, but you can only infer a number should be integer. This blocks round tripping.

Some things are impossible

  • empty dictionaries, empty lists exist in python but have no representation in markdown. An empty list is just zero-length whitespace where the list is not. This blocks round tripping.

Python has no use for a lot of markdown formatting, such as bold, or code block or quote. Those things would just be strings and they'd continue to hold markdown in the string.

Read and Comment »

Matt's Health Advice in 2023

I'm going to talk about how I'm managing my health and how it is going

Overall Goal

The overall goal is to maximize your healthspan. More and more people are making it to or close to their maximum lifespan, of something close to 100. At the same time, more people are getting lifestyle diseases that mean they will be sick a good chunk of that.

What I Eat

I would still be vegan if the health data wasn't panning out in favor of plant based diets. I believe the data demonstrates that I've lucked out and my ethical preferences match up with my health goals.

I was omnivore until age 16. I read a book that made the case for vegetarianism and adopted it. I ate dairy and egg until about age 38 or so. Despite the dairy, for most of the time I tried to be "low fat" which is somewhat contradictory if you eat any cheese at all. For this whole time I had a healthy body weight, 145-150 lbs for a 5'11" guy.

I am vegan for a bit over a decade. My lipid numbers are great. Blood pressure fine, but could be better.

What I do

I ran in high school, I did a few years or two of no particular exercise. After starting a desk job and getting colossal back pain, I started doing follow-along exercise on DVD videos. That worked out great. On and off, I did bicycling, scootering, roller-blading, hiking. I resumed running about a decade ago and have been particularly serious in the last five.

Mood

I think that we all suffer from anger, depression and anxiety in different ratios. Depending on what ratio you got, you might have a personality, or a diagnosable disorder.

Optimizing

Between eating right (vegan) and exercising (running) I'm doing pretty good. Everything else is a micro-optimization.

I'm also pushing 50. Even if you eat right & exercise you'll still age. I got grey hairs & when the knee parts fail, they really fail. Some joints have the start of arthritis. The eyes have nuisance cataracts.

  • Vitamins
  • B12. Only bacteria make it, animals don't. Heck even farm animals have to take B12.
  • Creatine. For sprinting & strength training
  • Magnesium. Because I run and sweat a lot.
  • Hibiscus - Weak anti-hypertensive.
  • Coffee - makes me type faster
  • Sometimes
  • Algal Omega Fatty Acids. They are taken up by the brain. Who knows it if helps.
  • Other B vitamins.

I used to, but no longer take multivitamins, the data on them was negative.

Sources

My favorite source on this sort of thing is Dr. Gregor. The rest of the sources are lost to memory, because they were books I checked out at the library.

Read and Comment »