Skills

The Weekly Feast – Buran

A Middle Eastern, medieval recipe for meatballs in an eggplant yogurt sauce.
Take eggplant, and boil lightly in water and salt, then take out and dry for an hour. Fry this in fresh sesame oil until cooked; peel, put into a dish or a large cup, and beat well with a ladle, until it becomes like kabis. Add a little salt and dry coriander. Take some Persian milk, mix in garlic, pour over the eggplant, and mix together well. Take red meat, mince fine, make into small cabobs, and melting fresh tail, throw the meat into it, stirring until browned. Then cover with water, and stew until the water has evaporated and only the oils remain. Pour on top of this the eggplant, sprinkle with fine ground cumin and cinnamon, and serve. (BCB III.7)
This particular meal is one of my favorites to eat, but I despise cooking it. It takes forever. It’s so worth it, though! The yogurt sauce is very reminiscent of Baba Ganoush, and if you have any left over, use it as dip the next day. Believe me, your taste buds will dance with joy!
Ingredients
  • 2 lbs eggplant
  • sesame oil
  • 1 lb ground meat (lamb, meatball mix, or beef, twice ground)
  • 1 tbsp shawarma/mild curry spice per pound of meat
  • 1/2 tsp salt
  • 1 tsp ground coriander seed
  • 1/2 cup plain Greek yogurt OR 1/2 cup plain yogurt plus a pinch of salt
  • 2 cloves garlic, crushed
  • 2 tbsp finely minced parsley
  • 1/2 tsp ground cumin + 1/4 tsp cinnamon, mixed

Read More

Prepping – RTE Meals

When I prep, I store a variety of types of meals. I have a lot of rice and beans, as I can make those into dozens of different meals with very different spice pallets. There’s one type of meal that I do store at least a few of, for emergencies. That’s RTE, or Ready To Eat meals. These require either no prep at all, or just water and heat.

RTE meals are an important part of any prep for any situation. There are simply going to be times when you do not have the time or energy to cook, but you still need to eat. Having meals that require little to no preparation time will save you, time and again. I don’t mean for zombie apocalypse, either, though they work for that too. I mean for that moment when the power goes out right after you’ve finished 3 hours of snow blowing, and you’re exhausted and starving and now can’t use your stove. Or for when you’re backpacking, you get caught in a storm, and you’re stuck under a rock for a few hours for safety’s sake, and you need to eat.

While you can certainly go out and buy WiseFoods or any of the other “emergency bucket” type emergency meal kits, it’s very easy to assemble your own. Job Lots, Walmart, and even Amazon carry many very good options. It used to be that you’d save your cans of tuna for those emergencies, but now the tuna comes as part of an entire meal.

Starkist Tuna Snacks are the gold standard around here. We keep them in our go-bags, eat them as evening snacks, and they always go with me when I am camping away from the house. It’s fast and easy, and requires no heating. Simply slap the tuna on the cracker, and you’re ready to go.

Bumblebee Tuna Bowls are really yummy, and again, require no heating. There are three different kinds available on Amazon, but I’m told you can find a few more if you go looking. These include pasta, rice, and/or beans, and include vegetables as well. You’re getting a whole meal here. At 190 calories each, they’re a quick fix for a hungry person. They also do not contain any added sugars, so they can be eaten by diabetics. They are NOT good for people with Celiac though.

Starkist Smart Bowls are rice and beans with tuna, in a variety of flavors. These are the soft packs, so they stack easily in a backpack or go bag. They’re lower in fat and higher in carbs than the Bumblebee bowls, but neither of those are likely to be an issue when you’re dealing with an emergency situation.

At the slightly more bougie level, we have Cole’s Open and Eat Meals. These are a bit more expensive, but the quality is also higher. You get a larger meal, with more calories (250), and a variety of flavors. The reviews of them are pretty good, with the main sticking point being price. This is definitely one of those “you get what you pay for” moments.

And then there’s the ones I like best: Freshe Gourmet Canned Tuna. They have tuna and they have salmon, four flavors of each. You can buy them in bulk, and the price is a bit less than Cole’s. Each style has a different calorie amount listed, so you have to look at each of the flavors separately. Having eaten these both cold and warmed, I can say they are VERY yummy. I went out and bought a bunch of these at my earliest convenience after a friend introduced me to them.

There are chicken versions and salmon versions of all of the above. I would guess you can probably find ham and Spam ones, as well. I prefer to have the cans in my camping bin, because they can safely rattle around in the bottom of the bin and not be harmed. They will still be good to eat next summer, if I don’t get to them. The flat pack ones are best for backpacks and go bags. I usually slip mine into the front pouch of my backpack or in the interior flat area of my go bag, where they won’t be punctured.  Read More

Software source code. Program code. Code on a computer screen. The developer is working on program codes in the office. Photo with source code. Python IDE

One step forward …

Tuesday I picked Ally up at The Fort at No 4. On the way home, we stopped to do some banking and pick up some groceries.

As we were walking to the bank I said, “Oh, it is closed.”

“Why?”

“Because it’s Sunday.”

“Huh?”

I then got home and posted “Tuesday Tunes” to show up on Wednesday.

I’ve been working on a major website. This includes a content management system for the site that meets the requirements for that vertical.

What I decided on was a “management bar” for those logged in as manager. When they activate the “edit page” function, all the blocks that can be edited are highlighted. Click on the block to start editing the block.

Save your changes. When you are satisfied, click “make live” on the management bar to make all the changes at once.

There are a few good tools for editing text in place.

This left all the other blocks, image editor, carousel editor, calendar editor and a few others.

Design from the top, build from the bottom

I know what I want to do, how I want it to work. Fortunately, I only have to worry about the “working” part. Not the pretty part. I have a team member who helps with that.

What this means is that I see the entire system laid out. This thing will do this, this other thing will do that, the user will see this.

Which leads to a balancing game. How much is done in the template build out? How much is done in the JavaScript module? How much is done on the backend? And how much support does the Frontend request from the Backend?

Currently, I have three different editing models built, each one a bit different from the others. Why? Piece wise progression.

In my original implementation, all logic was done on the Frontend from data provided by the Backend during page load. These led me to a working edit for the carousel. Click here, drag and drop or upload an image. Click there, and you can rotate, mirror, flip, and crop an image, maintaining a fixed aspect ratio.

The next was the text editor. That was simple because the editor works in place, sort of. But it is working. I’ll be adding more features to it, but that is mostly done.

Then the new image processing came into play. Click on the image you want to edit, a dialog pops up, the original, raw image is loaded. Recorded edits are applied, the image can now be edited.

All modals had to be preloaded. All the content of the modal was preloaded. Everything works by modifying existing elements or modifying the DOM. The only communications with the backend are fetching the raw image.

Which led to the calendar editor.

Piecewise progression.

With this, the amount of data started to exceed easy storage in the DOM. Access to needed data was looking more and more like a call back to the backend. The need to serialize objects on the backend for the frontend to manipulate was starting to get stupidly complex.

This led to a redesign. Instead of multiple modals, there is now a single modal (dialog) which is fetched, on need, from the Backend. In this modal, there is a tabbed pane. Click on the tab, a different pane shows.

By listening for a pane to be displayed, we can determine what content we require and request that from the backend, which has full access to all the data and logic required to make this work.

Bingo, everything starts to get easier.

Which means, once this edit is completed, I’ll return to the image editor, make the same design decisions, which in turn will make the carousel editor a simple modification of the image editor.

Things are getting a little easier as I become more comfortable with TypeScript and “promises”

Why the concerns?

First, when I started programming, you didn’t do redundant things because there were no spare cycles and there were no spare bytes.

As an example, I like to write a = do_it(param)->do_other(params2)->do_different(do_wildly_different(param3)).

This seems reasonable to me. No extra cycles, no extra bytes.

Today, it is better to do r1=do_it(param); r2=do_wildly_different(param3); r3=r1.do_other(param2); r4=r3.do_different(r2); This performs the same actions, but it is often clearer to read and allows for checking results at each step. All good.

The other big thing is communications. My last project was a shopping app. Our family still uses it. It creates shopping lists that you can then use from your Android Phone. It has more to it, but that’s the gist.

Because communications is sketch around here, it was designed to work in a standalone state, uploading changes when it could, downloading changes when required.

This lead to an entire mindset of “Communications is expensive”. Which I’ve had to break. The new site makes seriously different design choices.

  1. All Manager level actors will have modern browsers
  2. All staff working with the site will have reasonable download speeds
  3. All volunteers using the site will have reasonable browsers and speeds.
  4. All visitors to the site will have a relatively modern browser.

In other words, If you are working on the site, and it takes 5 seconds to get an updated pane or modal, this will be acceptable, or you will need to upgrade your device.

In looking at the current usage of browsers on the Internet, more than 95% of the people using the Internet will do just fine.

Now back to the Bootstrap 5 grind as I design pretty forms.

The Weekly Feast – Tourtière!

Tourtière is one of those iconic dishes that gets served in Northern areas. While it hales originally from France, it was popularized in Quebec, Canada. Early settlers made Tourtière frequently, and it’s a filling and very tasty pie. I don’t normally like French Canadian stuff, but Tourtière and Poutine are acceptable.

Ingredients:

  • pie crust
  • 2 teaspoons kosher salt
  • 1 teaspoon freshly ground black pepper
  • 1 teaspoon dried thyme
  • 0.5 teaspoon dried sage
  • 0.5 teaspoon ground cinnamon
  • 0.5 teaspoon ground ginger
  • 0.25 teaspoon freshly grated nutmeg
  • 0.25 teaspoon ground allspice
  • 0.25 teaspoon ground mustard
  • 0.125 teaspoon ground cloves
  • 1 pinch cayenne pepper
  • 1 large russet potato, peeled, quartered
  • 1 teaspoon kosher salt
  • 1 tablespoon butter
  • 1 large onion, finely chopped
  • 1 pinch salt
  • 0.5 cup finely diced celery
  • 4 cloves garlic, crushed
  • 1 pound ground pork
  • 1 pound ground beef
  • 1 cup potato cooking water, plus more as needed
  • 1 large egg
  • 1 tablespoon water

 

First, make the spice blend. Mix together the salt, black pepper, thyme, sage, cinnamon, ginger, nutmeg, allspice, mustard, clove, and cayenne in a small bowl. Set it aside.

Next, make the filling. Place potatoes and 1 teaspoon kosher salt in a saucepan; cover with cold water. Bring to a boil, reduce heat, and simmer until tender, 10 to 15 minutes. Use a slotted spoon to transfer potatoes to a bowl, reserving potato cooking water in the saucepan. Mash potatoes with a potato masher until smooth; set aside.

Melt butter in a skillet over medium heat. Add chopped onion and a pinch of salt. Cook and stir until onions turn golden, 10 to 15 minutes. Stir celery, garlic, and spice blend into the skillet with onions. Stir until onion mixture is evenly coated with spices, about 30 seconds.

Add ground pork, ground beef, and about ¾ cup potato cooking water to the skillet. Cook, stirring occasionally, until meat is brown and tender and most of the liquid has evaporated, about 45 minutes. Stir in mashed potatoes , turn off heat, and let cool to room temperature. Preheat the oven to 375*F.

Place your dough in a 9-inch deep-dish pie plate. Have the top crust rolled out into an 11-inch circle, and keep it for later.

Fill bottom crust with meat mixture. Smooth out the surface. Whisk together egg and water in a small bowl to make an egg wash. Brush egg wash over the edges of the bottom crust. Cover with top crust; press lightly around the edges to seal. Trim excess dough and crimp the edges. Cut small slits in the top crust to allow steam to escape. Brush entire surface of pie with egg wash.

Bake in the preheated oven until crust is well browned, about 1 hour. Let cool to almost room temperature before serving.

Notes:

I have a vegan version of this, where I replace butter with margarine, and the meat with a Beyond Beef “ground pork” sausage. It turns out very well, and has been enjoyed by many friends who were surprised to find it was not real meat!

Prepping – Practice Makes Perfect

I know I harp on about practicing all the time, but it is THAT important. I do that on a fairly regular basis, more and more so as I pick up events as an author. When I go to an event, I’m cooking over an open flame at the very least, and sometimes living on site with limited access to water, food, and shelter.

Yes, I pack in food and water with me. If an emergency happens, friends and family are a mere phone call away. I’m in a fort that does have electricity if I need it, even if it’s a bit less than convenient to get at it. Heck, I could walk to the grocery store if I wanted; it’s a mere mile away.

While I’m there, though, I do my best to learn more about survival and prepping skills. I learn more about how our ancestors lived, knowing nothing about dishwashers, cell phones, televisions, and print on demand books. I always approach fort weekends (or an entire week, as in this case) with a goal in mind. I want to learn something that I don’t know much about yet, or have only book knowledge of. Or I go to practice a skill I already know, but am not comfortable with yet.

This trip, I’m working on pie crust. You might ask, why pie crust? It’s not particularly necessary, not a skill that’s high on the list of things to help you survive. On the other hand, being able to whip up a hand pie for a journey IS a handy skill. Modern me might go buy a pasty, but here at the fort, I get the opportunity to work and make my own.

So this week is all about Cheshire Pork Pies, Tourtière, Apple Pie, and baking bread. I consider myself a subject matter expert about basic breads at this point, but I am adding something new to my skillset. This week, I’m firing up the big outdoor beehive oven. It’s large enough to bake many loaves of bread and pies, all at the same time.

I know that the basics are just like firing up the miniature one in my cabin. But this will be production cooking. See, there’s a primitive rendezvous going on in the lower field, and I’m going to be attempting to bake bread and pies for sale. Or rather, for trade, because while money is nice, I have several things I need that I can get at the rendezvous. I look forward to enjoying morning coffee with the folks in the field, then going “shopping” among the various vendors that attend.

After, I get to go back to my comfortable cabin with the fireplace roaring to keep the chill out. Temperatures during the day aren’t supposed to get much above 65*F, and the evenings will be in the low 40s, so having dry wood and the ability to be comfortable and warm (and dry, on the days it’s likely to rain) will be wonderful.

What skills are you working on this summer?

The Weekly Feast – Orange Cake

I wanted to make a birthday cake for my vegan friend, and that meant no milk, no butter, and no eggs. I decided to search for vegan alternatives, and came up with several awesome looking ones. As a side note, chocolate is easy to make vegan. However, I didn’t have the ingredients for most of the cakes I found. I did what I usually do, however, and I took an existing recipe and re-made it in my own image. That’s right, I am a Food Goddess! This is my lovely sweet treat: Orange Cake

Ingredients

  • 1-1/2 cups all-purpose flour
  • 1 cup sugar
  • 1 tsp baking soda
  • 1/2 tsp salt
  • 1 tsp white vinegar
  • 5 tbsp canola or vegetable oil
  • 1-1/2 tsp orange extract
  • 1 cup orange juice

Preheat your oven to 350*F. Line a 9×9″ pan with parchment paper, leaving an inch over each side overhanging, for easy removal.**

In a large mixing bowl, add your dry ingredients and mix well. Form three depressions in the dry mixture. In one, add the vinegar . In the second, add the orange extract , and in the final one, add the oil. Pour the orange juice over the top and, using a whisk or wooden spoon, mix together until fully combined.

Transfer your cake batter, which will be quite runny, to the lined baking pan. Bake for 25-30 minutes and then check. It will probably take close to 45 minutes to bake entirely, but you need to start checking every five or ten minutes after the 30 minute mark. Continue to bake until a skewer comes out clean. Remove the cake from the oven and let it cool in the pan for 10 minutes before transferring it to a wire rack to cool completely. If desired, frost the cooled cake.

** I used a round springform baking pan, fully lined with no-stick-sprayed parchment paper. You do have to allow the cake to cool completely before removing the parchment paper, but it works very well. I used a 9 inch diameter pan that was about 1-1/2 inches deep.

I had frosting for this cake. We didn’t use it. We literally ate hunks of it with our hands. It was moist, sweet but not unbearably, and delicious. I would recommend removing 2 tbsp of orange juice from the cup, if you plan to frost the cake. It was so moist, if I had tried to frost it, it would have fallen apart despite having good crumb.

Prepping – Food Security

We are a rich people, here in America. Even our poorest has enough food (or could if they applied). We just don’t see people in the US starving. It doesn’t happen. There are no swollen bellies here.

That doesn’t mean people aren’t hungry. As someone who’s lived on food stamps and charity at one point, I can tell you that the pickin’s are slim and you don’t get a lot of veggies. I had to be creative to keep myself and my family fed. But I managed.

This is an art that too many people just don’t get. I covered it briefly in my last article about food, but it bears repeating. There are too many people in our country who have such a sense of entitlement that they think everyone should have “great food.” While I’m liberal enough to believe that we should be providing just enough food for people to survive on, even if they’re poor, I’m not of the opinion that it should come in the form of filet mignon or lobster tails. If you are poor (when I was poor), you have to learn to budget.

And therein lies the problem. This generation has a terrible time with budgeting. They can’t seem to budget time, money, credit… and who can blame them, with the various people who’ve been in office over the last couple of decades. “Budget” has not been much in the vocabulary of any of our leaders. It definitely doesn’t seem to be in that of the parents of today’s generation.

I remember a time, about ten years or so ago, when I was picking up supplies in a bump and dent store. We were tight, and I wanted to make my grocery dollars stretch. I walked past a gentleman with his very young daughter, staring forlornly at the dried beans. I paused, and asked if he had a favorite bean, and he looked at me with tears in his eyes and explained. Seems his wife had left him, and he was trying to work, care for his daughter, and feed her. Money was too tight, and he couldn’t afford meat. He knew beans were a way of getting protein, but he had no idea how to cook them from dry. He’d only ever had canned. I sat and explained to him several really tasty recipes that I thought would go over well with a toddler, and he bought up bags of beans with a grateful thank you over his shoulder. After that, I actually printed out several bean recipes and with the store’s permission, posted them in the beans aisle. They would be picked up every single week. I got a lot of thank yous.

Read More

The Weekly Feast – Drinks!

I haven’t touched on the topic of what to drink when you’re enjoying your post-apocalyptic spam, so I think today I’ll go there. 😉

There are several really tasty, easy to make drinks for when you’re doing a lot of labor or it’s extremely hot, but you don’t have access to Gatorade or its equivalents. I would hazard to say that they’re much better for you, as well.

Sekanjabin

This is what we refer to as “Viking gatorade” because it was popularized by the Vikings. It originated in Persia as a mint based drink, but the Vikings played with it, and I played with it more. It is basically a simple syrup that you add to water to make it more palatable. The vinegar and sugar help balance your electrolytes, and the ginger makes it just “warm” enough (from your body’s standard) to drink even in very hot weather without causing yourself cramps. Just a note, the Vikings and Persians both added crushed mint to this. I don’t, so it isn’t included in my recipe. Feel free to add it to yours!

Ingredients

  • 4 cups red wine or apple cider vinegar
  • 4 to 8 cups sugar/honey/sweetener/blend of choice
  • 2 tbsp minced or grated ginger
  • fruit of choice (I like lemon, strawberry, and blackberry, or a mix, but you do you)

In a pot, add the vinegar. You can even mix red wine and apple cider vinegars for a different flavor if you like. Get the cheap stuff, by the by. This is not something where the vinegar has to be bougie. Bring the vinegar to a low boil, then begin to add the sugar, a cup at a time. I usually use four cups of a mix of sweeteners, but always use at least one cup of real sugar to help it become syrup. Stir in between, preferably with a wooden spoon. When all the sugar is in and has dissolved, add in your ginger, and your fruit. When it comes to fruit, you can use fresh, but frozen works better because it sort of dissolves in the vinegar. I’ve done it with fresh, though; just cut it up into chunks so the “meat” of the fruit is exposed.

Simmer your fruit stew for a minimum of 20 minutes, and likely much longer.  You should reduce the amount of liquid in the pot by AT LEAST one third. It’s usually easy to tell, because it leaves a sugary ring on the edge of your pot. What you want is a syrup, not a liquid, so wait for it to really begin to thicken up. You want it to have the texture of a light corn syrup or maple syrup, but not be as thick as molasses. Allow your syrup to cool for several hours.

Once it’s cool, strain the sekanjabin through cheesecloth or a lint-free towel, and store in jars. I usually purchase the apple cider vinegar that comes in a glass bottle (it’s cheap), and so I pour it right back into the bottle and put the diffuser thingie back in. That way I can easily shake out just enough to sweeten my water.

To use, add about a tablespoon of syrup to 8 oz of water, stir, and enjoy. You may want to add a bit more or a bit less depending on both your tastes and the intensity of your sekanjabin. Store your sekanjabin at room temperature for up to a week, or in the fridge pretty much forever (I’ve never had it go off).

Note: it’s pronounced seh-KAHN-ja-bin

Read More

Coding Styles and Methods

My formal education is as a computer scientist. I was lucky enough to get this education at one of the cusps of computer development.

My Mentor went through a computer science program just 4 years earlier. There were classes he took that were not even offered in my program. The change was in moving from a need to understand hardware to a place where understanding the hardware wasn’t important to computer science.

What this meant was that my Mentor could design a computer from the gate up, I still struggle with hardware design.

My education included understanding low level instructions, instruction timings, bit manipulation, data structures, semaphores, and a host of other low level concepts. It also included much higher concepts.

At the time, my program included a year-long class where we wrote a working compiler, a required class where we wrote an operating system, as well as all the languages of the day. We even had theory class, such as the class on proving a program correct.

In addition to the formal classes offered by the University, I participated in an intense 8-week course where I was taught how to apply the classroom theory to actual working systems. This was the “systems class”. It started at 0800, ran through to 1200 with no breaks. We had a lunch break from 1200 to 1300. Then classes continued from 1300 to 1700.

We had to turn in our assignment of the day at 0800 the next morning.

This is what a day was like on the third week.

Wake up on a table in the student workroom of the computer center. Collect our work, stumble next door to start our 0800 classes. At 1200 hoof it out of there 2 miles to the house, shower, change clothes, move it back to the computer center and get there before 1300.

Being more than 15 minutes late was failure.

Study and learn new topics from the instructors. At 1700, head out to get dinner. Get back to the computer center by 1830. Work on assignments and projects until the computer was shutdown for nightly maintenance at 0400.

Decide if an hour of travel time to sleep in a real bed was worth more than an extra hour of sleep. Claim a table and fall asleep.

Repeat the next day.

Structured Programming

It is hard for a modern programmer to understand what a huge breakthrough the concept of “if-then-else-end if” was. It was the first of our structured code.

Before we had that type of language structure, we used “if condition goto”. Which was even more confusing when you used the FORTRAN IV construct of “IF value goto1, goto2, goto3” where the goto used was based on if the value was negative, zero, or positive. And yes, there was way too much code that used that instruction.

I helped my father with his MBA by being the computer dude to help him with the software he was using. It was written in FORTRAN IV or III. It wasn’t uncommon to be reading a section of code, have a GOTO that took you somewhere else in the code, which then had another goto back to the place where we just were.

In some cases, the code would conditionally jump to that “patch” which would then jump back into the other routine. It was a mess.


if condition then
do something
else if condition then
do something else
else
do something entirely different.
endif

Structured programming has at its base the concept of block correctness. Every block must be well-defined, do one job, have a set of well-defined inputs and outputs.

If this is satisfied, then you can verify the correctness of that block. You can test the set of acceptable and unacceptable inputs and verify that you get the correct outputs. If this test succeeds, then you can mark the block as ‘good’.

You can combine blocks in sequence. If you are connecting blocks, then the preceding blocks must contain all the outputs that will be used by the following blocks.

You can use conditional structures to create a block that is composed of verified working blocks.

Building from Blocks

One of the things about using blocks, is that you can build iteratively.

To give an example, I am working on a website. The front page has a carousel of rotating “hero” images.

From this, I knew I needed to be able to upload an image. The carousel has a fixed aspect ratio, this meant that I needed to have images in this aspect ratio. I also know that the user will want to decide what part of the uploaded image they wanted to use for the hero image.

In simpler terms, this means that I needed the ability to apply simple cropping to an uploaded image.

There is a black box in my head. It has defined the “cropper” block to take as input an image, the current cropping, and the current canvas to draw on. That block will interact with the user. When the user finishes, the block will output (x, y, width, height) in image pixel coordinates.

There is a different block box that takes two HTML elements and uses them to generate the required inputs to the crop block.

Another block takes the output from the crop block and turns it into a post to the server, to update those values.

Here is the thing, I’m using an obsolete cropping package because it is “simpler” while I’m extending my TypeScript and JavaScript knowledge. But I will be able to replace it with a very modern version and none of the other code will break, as long as the inputs and outputs do not change.

Currently, when you save your changes, the code submits the modifications as form data, which causes the page to reload.

Piece Wise Progression

What this means to me is that I’m constantly testing small changes. I will write a block of code, compile, deploy to the test server, test the results, edit some more.

Saturday was a lazy day. I only performed this cycle 50 or so times.

Every time I get a block working better, I make a git commit.

Friday, I had a breakthrough. I managed to make drag and drop work to select a file for uploading. Created a thumbnail of it. This was all via simple HTML and TypeScript.

Progress was fairly slow on this, learning curve, but what I found interesting is that I would get to a point where I had a working image selection, and only then realize that I had not connected the save button to anything.

Once that was working, the edit process turned out to be more difficult than I expected. It was all working from before, but I needed to hook into the code from a different place. But because that edit process had well-defined inputs, it was merely a matter of creating the correct inputs and it all “just worked”.

Of course, once I click that save button, I found out that I wasn’t actually uploading the image. Which was another thing to fix.

That worked, and it turns out that the server side needed some changes.

But everything was working because the process was all about blocks. When a block didn’t do what I wanted, it was a simple process of checking the inputs for correctness, then checking the output for correctness. If input was good and output was bad, it was a logic error. Track it down and everything gets fixed.

Working On The Railroad

When we code, it is not uncommon to find that there is some exception which can’t be processed by “normal means”.

For example, you are expecting an integer, representing the width of something. You get a string instead.

You could go down a new path, or you can convert the string into an integer. I.e. “768” becomes, simply, 768. That’s simple enough.

But what happens if instead of 768 you get “100%”? The answer could be to go down a separate logic path to deal with width, height, x, and y as percentages.

The railroad method says that you treat the code as a railroad line.

There is the mainline, it is a single track running between two cities. If you have a fast train on the tracks, and it is followed by a slow train, that fast train will get held up behind the slow train.

The answer to this is sidings. Much like the passing lanes on a two lane road, a siding is used to shunt one train out of the way while another train passes.

When the fast training is getting near, the slower train is shunted onto a siding. It waits there until the fast train has passed, then continues down the siding and back onto the mainline.

You can write code this way. When there is a problem with the input, you are being shunted onto that siding. You can decide there is no way to continue and abort, throw an error, you can do something else to get yourself back on the mainline.

Using the “100%” example, the siding means that we will do whatever code is required to convert the 100% into an integer that meats the requirements. This could be as simple as looking up the size of the parent and using that size.

The 100% could mean that we want this size to be a match for the other size. I.e., if the natural size of the image is 640×480, 100% width could mean 640. It could also mean that if we scale the height to 75% of natural height, we want to keep the width as 100% of that natural height.

These logical choices are done, and that conversion takes place on the siding. After the conversion is properly completed, the code can join the mainline again and nothing on the mainline needs to change.

Prepping – Making Do

There’s a mindset, these days, that everything is disposable. If something breaks, just get another one. Toss the old one in land fill and ignore it. This is not a sustainable practice.

Use it up, wear it out, make it do, or do without.

Why did we become the strongest country in the world? We made do. We took everyone else’s outcasts, people who wanted to work and were motivated to become citizens, and we said “let’s do this.” Those people, coming into America, were coming here to become AMERICANS. They didn’t come to be African Americans or Cuban Americans or Chinese Americans or Polish Americans. They came here to be Americans, plain and simple. They came here because America provided (and still provides) a place for hard work and sacrifice to pay off in the creation of strong family and safe home.

Use It Up

If you buy something, use it up. It seems simple when you say it that way, but I have to ask you, how many times have you allowed that cabbage or bit of leftover stew in the back of the fridge until it turned into something approaching sentience? Too often, I’d wager. I’m bad at it myself, frankly. This is a basic thing that Grandma would have wanted you to know, though. If you’re in doubt, ask yourself: would Grandma be disappointed in me for doing this (or not doing it, as the case may be)?

Learn to turn little bits of leftover vegetables into something new. Learn how to make stews and soups. Learn how to dehydrate and can. Learn how to compost, too. If you have animals like chickens or goats or pigs, feed things to them rather than putting them in the trash. Make certain that every bit of food you purchase is actually eaten or preserved in some way.

This is how we end up with scrap quilts, by the way. When you buy (or thrift) fabric for clothing (or sheets or towels, or whatever), you will almost always be left with a handful of scraps. Sometimes they may be tiny, because you’ve patterned extremely well, and you can congratulate yourself. Still, stash away those scraps. They can be used to patch up clothing or sheets, or to fill holes in jeans. When you have enough scraps of whatever size, you cut them into a lovely pattern of squares or hexes or triangles, and now you have a quilt. Our grandmothers turned their leftover bits and pieces into huge sheets of stitched love that are now passed down from generation to generation. You, too, can do that.

Read More