Registered For My First Marathon

So some big running news in my world. I’ve now committed to doing my first marathon with my first race registration. It is the Red Rock Canyon Marathon out in Nevada. It is along the scenic highway drive through that park and is supposed to have absolutely amazing views. It’s still a ways out, January 2022, so I imagine I will end up doing a local one before then. So my actual first marathon will be the second one that I register for. Regardless, I’ve taken that all important step of putting my cash on the table and my name on the registration form.

Training is going really well. I’ve gotten a new personal best 10k last week of 46:46 and just yesterday I scored a new one for my half marathon at 1:44:41. That’s the first time I’ve actually broken 1:45 on a half. I did it on the Sammamish River Trail which is also the first time I’ve run it too. I’ve driven by lots and have always thought about running it… for years… but this Easter weekend, with some friendly encouragement, I decided to finally pull the trigger. It’s a completely flat and well maintained trail which is just made for speed and it takes you through some farm country which I absolutely love. I’m kind of thinking about making it apart of my regular long run training and saving the hills for my shorter weekday trots.

It’s been almost 2 years now since I started Noom and I haven’t given it up yet. Cooking and eating low density foods are now firmly a way of life for me. Mostly green, sometimes yellow, and rarely red. You can’t run yourself out of a bad diet and Noom really has been the key to my success. I’ve lost and kept off over 50 lbs since I started almost 2 years ago and it has had a huge impact on my running. I’m an Amazon Halo beta user and it tells me that I am at a health 15.5% body fat; that’s literally right smack in the middle of the healthy green range. These last two years have been quite an eye opening journey on my personal fitness and what is actually a healthy lifestyle.

Brand New PB 10K

Well, I broke 48 minutes yesterday morning. I am legitimately excited about this run as I kept my pace pretty consist at 7:45 with a sprint for the last half mile. It is still a far cry from 7:15 which is the Boston qualifying time but it doesn’t feel like an impossible thing to shoot for.

In other news, the Rock And Roll Las Vegas marathon in November got pushed to February and is no longer offering a marathon route. I’m pretty disappointed about that as I was hoping for it to be my first marathon and first race after the pandemic is all over. Well, from that disappointment hatched this idea: Devil After Dark

So running my first marathon in a desert at night is probably not one of my better ideas but if you put aside the high temperature at the start and its dramatic drop after the sun goes down, there is a uniqueness about it that has inspired me. I haven’t registered yet and to date my longest run is just over 19 miles with all my training being done in the wet and cold fall/winter months of the PNW. Remarkably, that does make me pretty confident in the night time portion. I need to get some heat training runs in once summer hits before I can properly decide though.

Vegan Cornbread

Over Thanksgiving and Christmas last year, I discovered this recipe for vegan cornbread. It has quickly become one of my favorite hiking treats. They are so easy to whip together first thing in the morning. You can have them ready just as you drive out to your target trail head.

I love that they are vegan. I’m not quite vegetarian but I am definitely eating less meat every month as I learn about different plant proteins and incorporate them into my regular cooking. That has been helping me a lot with respects to maintaining my noom found weight which in turn has been great for my running.

My goal for this year is to slowly lose another 10 lbs. I will still be well within my BMI but from everything I have read and experienced with my marathon training, it will make a big difference in my speed and how I feel around mile 20.

Meringue Hearts

Valentine’s came and went this year and I have to admit it was a bit odd to have it at home socially distanced. That didn’t stop me from having a bit of fun in the kitchen. I ended up making meringue hearts.

There isn’t a lot that goes into meringue so you can quickly pull together the mixture and just start piping away. The key, however, is that you need to let these little guys cool in the oven for 6-8 hours. Meringue is notoriously fragile so this cooling period is quite important to allow them to completely dry out.

Air Fryer Naan Bread

One of my life changing purchases that I made during this COVID era is an air fryer. I honestly got it because I wanted to reduce the number of grocery store trips I was making. I was a huge salad eater but unfortunately leafy greens and bag mixes don’t last that long in the fridge. I knew at the time that air fryers were awesome for cooking sweet potatoes but that is literally the tip of the iceberg.

I use my air fryer almost everyday, sometimes twice. It is fantastic for quickly cooking tougher veggies and roots while at the same time giving them a great crisping. I’m a huge fan of the instant pot too because of its speed but the air fryer is even faster and has almost no clean up. Frankly, both are fast. Case in point though, if you like having roasted veggies in a flash, you got to get an air fryer.

Now here is where things get really fun. You can make naan bread in the air fryer. Ya… that’s right… and from scratch too. I posted my recipe on cookpad. It’s no secret that I love baking and messing with dough and pastry. Air frying naan bread however… that is just mad science. Honestly, it is quite practical to do even in an apartment setting. Normally, you would use a cast iron pan to fry them up but when you use an air fryer instead, you don’t make any smoke; none at all. You just get hot and delicious naan!

New longest distance – 15.8 miles

Well, my marathon training is still progressing even with the number of COVID cases in Washington spiking again. It actually isn’t that bad running outside at this time of year. There aren’t too many other runners or walkers out there. I am using my hiking buffs as my running mask which I rarely need to use since I can easily keep 8 feet or more away from anyone I happen to bump into.

Today I hit a new high of 15.8 miles. I am also one week away from the half way point in my training schedule. With these distances, I need to make sure I’m used to having snacks during my runs. The last time I really got this serious about running, I tried gels and they were just awful both in flavor and in how they agreed with my stomach. I used chews but they are pretty expensive and you always end up wasting some. So I did a bit of research and discovered that raisins and dried cherries are pretty good options which is awesome for me because I love eating them too. I’ve done 3 runs with them now and today I even added in a few dark chocolate discs all of which I had no problems with. I do a lot of baking so I always have dried fruit and chocolate discs kicking around but more importantly, not only are these much healthy options, they are way cheaper too.

So if you are working into runs where you need snacks, don’t feel compelled to buy those over the counter running snacks. You might have just what you need in your own pantry to do your own DIY ones.

Bonkers Post Election Day Run

Hi all. It’s been a few since I posted. Work has been absolutely nuts with the pandemic. It’s been busy but a really good busy where each day the things I do I know have an impact. As weird as the social distancing and lockdown have been, there is a wonderful sense of reward in having those honest days of work.

In addition to working all the time, I’ve also been focusing on my running. I have official started training for a marathon and I am now on week 7 of an 18 week schedule. Today I did a 7.9 mile run at a 7:57 pace which is a personal best for me; it was a crazy one given it is November and raining. I don’t have an actual race on the schedule yet but I am hopeful for one early in 2021 once we all get vaccinated.

Sub 50 10k

Well, it has been a long time since I’ve broken 50 minutes with my 10ks but today was the day. I think the last time I did it was about 6 or 7 years ago. This morning, I really shattered it going sub 49.

Without a doubt, Noom has had a huge impact on my life. It’s been about 10 months since I’ve started following their green/yellow/red approach to tracking what I eat. I’ve managed to lose and keep off about 40 lbs. Just shedding that weight dramatically improved my running. Recently though, I started mixing in interval runs about once a week. This post from Running Faster is a good one for routines. I don’t quite know why I decided to do them again. It was probably a combination of things but I think it was primarily that I am feeling more confident about my running and I have a smart watch where I can program in the intervals. Anyhow, I’ve been hovering around the 50 minute mark for a while trying to work my way towards breaking it and I guess it was a plateau. I literally knocked a minute off my time this morning.

Imperfect Foods: One Weird Sweet Potato

I’ve been getting my groceries delivered to me weekly now for about a month using Imperfect Foods. I love these guys. The service, aside from being very convenient, has a mission of helping the environment by focusing on selling meat and produce that cosmetically doesn’t meet the bar for grocery stores. Unsurprisingly, there is a lot of food that doesn’t look perfect but what is surprising is that it typically doesn’t get sold. This is where Imperfect Foods comes in. Instead of letting that food go to waste, they make it available in their delivery service and at a great price. I am now saving money on my groceries every week and they are delivered to my front door, basically for free when you think about it.

Last week I got this especially odd looking sweet potato. It kind of looks like a heart. It just looked weird though. Nothing else was wrong with it. I cooked it up in a hash with spinach. Yum!

jolt: JSON Transforms Simplified

Every now and then it comes up that a REST API you are working with is a little inconsistent with the JSON that it returns. Sometimes a property you want is an array when it has multiple values but an object when there is only one. It’s annoying when you encounter these APIs and it happens more often than you think. Jolt is a package that handles JSON transformations really well and is perfect for this exact situation.

What I especially like about it is that it separates JSON transformation logic into separate files that can be read in at runtime. That allows it to be more configuration driven as oppose to being in your code. Here are a few examples that you can play with to get a feeling for things.

Step 1: Include jolt as a dependency

Create a new starter project using Gradle as your dependency manager. Add jolt as a dependency.

compile group: 'com.bazaarvoice.jolt', name: 'jolt-complete', version: '0.1.1'

Step 2: Get a JSON string to transform

Add this JSON to your src/main/resources folder as a file named jolt-me.js. We are going to use it as the target for our jolt transformations.

{
    "hello": "world",
    "I'm an array": [
        {
            "object": 1
        }
    ]
}

The following snippet will read that JSON file and covert it into a String instance.

Scanner scanner = new Scanner(ClassLoader.getSystemResourceAsStream("jolt-me.js"));
StringBuilder inputJSON = new StringBuilder();
while(scanner.hasNextLine()) {
    inputJSON.append(scanner.nextLine() + "\n");
}
scanner.close();

Step 3: Create a transformation JSON

All jolt transformations are executed using an instance of Chainr. To create an instance, you feed it JSON that defines the transformations that you want it to perform. Jolt provides several types of transformations out of the box. The two I find the most usefully are Shift and Cardinality.

Step 3.1: Shift transform

Shift transformations are for moving properties around and renaming them. Hence why it is called shift. Here is a simple example below. Safe it in a file named shift-spec.js in your src/main/resources folder:

[
    {
        "operation": "shift",
        "spec": {
            "hello": "blue",
            "*": "&"
        }
    }
]

The following snippet loads and runs the shift transformation.

Chainr chainr = Chainr.fromSpec(JsonUtils.jsonToList(ClassLoader.getSystemResourceAsStream("shift-spec.js")));
System.out.println(JsonUtils.toPrettyJsonString(
        chainr.transform(JsonUtils.jsonToObject(inputJSON.toString()))
    )
);

That results in the following output:

{
  "blue" : "world",
  "I'm an array" : [ {
    "object" : 1
  } ]
}

Step 3.2: Cardinality transform

This transformation is by far my favorite. The cardinality transform is specifically for dealing with JSON properties that are sometimes arrays and sometimes objects. In other words, the API you are working with is not consistent in how it returns data. I don’t know why this happens so often but I suspect developers of those APIs are trying to make things easier by considering the context in which their end points are getting called. However, it really has the opposite effect especially when you are trying to deserialize that JSON into a POJO.

Create the file cardinality-spec.js in src/main/resources with the contents below.

[
    {
        "operation": "cardinality",
        "spec": {
            "I'm an array": "ONE"
        }
    }
]

As with the previous step, you use a Chainr instance to execute the transformation. For example:

Chainr chainr = Chainr.fromSpec(JsonUtils.jsonToList(ClassLoader.getSystemResourceAsStream("cardinality-spec.js")));
System.out.println(JsonUtils.toPrettyJsonString(
        chainr.transform(JsonUtils.jsonToObject(inputJSON.toString()))
    )
);

That gives the following output. Notice that I'm an array is not an array anymore. It’s an object.

{
  "hello" : "world",
  "I'm an array" : {
    "object" : 1
  }
}

Step 3.3 Chaining transforms

What is really cool is that you can chain transforms together. So let’s combine the previous two transforms into a single JS file called chain-spec.js in your src/main/resources folder. The contents should be the following:

[
    {
        "operation": "cardinality",
        "spec": {
            "I'm an array": "ONE"
        }
    },
    {
        "operation": "shift",
        "spec": {
            "hello": "blue",
            "*": "&"
        }
    }
]

This familiar Chainr snippet will execute it.

Chainr chainr = Chainr.fromSpec(JsonUtils.jsonToList(ClassLoader.getSystemResourceAsStream("chain-spec.js")));
System.out.println(JsonUtils.toPrettyJsonString(
         chainr.transform(JsonUtils.jsonToObject(inputJSON.toString()))
    )
);

That gives you the following. As you can see, both the shift and cardinality transforms were performed on our JSON data.

{
  "blue" : "world",
  "I'm an array" : {
    "object" : 1
  }
}

Closing Thoughts

Jolt is pretty convenient as an off the shelf utility for quickly doing some JSON transformations. The implementation of its JsonUtils is a little clunky and it is annoying how it doesn’t support generics so explicit casting has to be done. Regardless, that is pretty minimal pain compared to having to do these transformations using POJOs.