Example of Python Generator Function.

One of the great features of Python is Generator Functions.  Generator functions allow you to convert any function to a generator function by simply including the yield keyword somewhere in the function body.  When a generator function is called, the response is a generator object, which can be iterated over among other things.

To boil this down to basics, generator functions allow you the programmer to create a function which yields one value at a time (and pauses until the next value is requested) until you decide it is done.  This opens endless possibilities for converting sequences, creating sequences, filtering, and more.

The following example is a generator function which will take a simple list or iterator and return pairs of (element, previous_element).  This is a great use for generators and the yield statement.

Generator Function:

def lineandlast(listish, first=True, last=True):
    iterator = iter(listish)
    lastline = next(iterator)

    if first:
      yield lastline, None

    for line in iterator:
        yield line, lastline
        lastline = line

    if last:
        yield None, lastline


for line, last in lineandlast([1,2,3,4,5]):
    print(line, last)


1 None
2 1
3 2
4 3
5 4
None 5

There are two keyword arguments, first and last, which can be used to control the output of the first and last items on the output example above.

Stain Dipper Upper Pulley

The Stain Dipper is taking shape one component at a time.  We have the servo controller, servo motor, brass for pulleys, bearings, blocks of UHMW Polyethylene for supports, taps, set screws, aluminum rods, shafts, an Arduino Mega, buttons, switches, power supplies, wire, and more…

Here are some views of the upper pulley system.



Fudge Version 2

Fudge version 2.  (Version one wasn’t good enough to write about).

This is a cross between two recipes that I learned about.  I made use of some of the techniques but did not follow the recipe that Alton Brown explains so well in his episode “Fudge Factor” at https://www.foodnetwork.com/shows/good-eats/episodes/fudge-factor

Fudge V2

… start with …
2 3/4 cups sugar
1 cup cocoa
1/4 cup corn syrup
1/4 stick butter
1 cup milk

… and later …
1/2 stick softened butter
1 tbsp real vanilla extract

… and if you want…
Cocktail peanuts (or walnuts or whatever)

Put the “start with” ingredients in a saucepan over high heat and stir constantly with a wooden spoon until boiling.  I tried covering it as Alton Brown said, but it just tried to boil over, so maybe I did that wrong?

Turn heat down to medium low and DO NOT TOUCH IT.  As soon as the temp hits 232F, turn off heat and just let it set there.   Place a small amount of butter on the top to prevent it from drying out.  Let it sit undisturbed until it is 110F…. then…

Dump in the “and later” ingredients and stir it AS HARD AS YOU CAN with a wooden spoon.  When it starts feeling like it’s time, maybe losing it’s sheen, maybe starting to get stiff, it’s time to dump it into a parchment paper lined 8×8 pan before too late.

I then poured the peanuts on top and worked them down in with a spatula.   I though it was ruined, because it just wasn’t setting up.

But I got up the next day and sure enough it was perfect.


Southwestern Smoked Chicken And Corn

Another “experiment”…  Thanks again to Ezra, I had some fresh KC BBQ Rubbed Smoked Chicken Breast in the fridge.

Frozen, sweet white corn, in seasoned cast iron on high heat until perfectly done (stirring constantly).  Chopped up smoked chicken breast in.  A little Adobo (which is made from salt, pepper, garlic, spices) for seasoning and a few tablespoons of heavy whipping cream to meld it all together.

Served with On The Border corn chips and fresh salsa.  Mmmm.  It was outstanding.


Beef and Broccoli v2

This is our second go at beef and broccoli (with peppers, sugar snap peas, and carrots).

For the first try see: https://blog.gahooa.com/2018/03/12/beef-and-broccoli-recipe/

  • Beef was cut a bit smaller.
  • Soaked 4 cups water + 1/4 cup baking soda + 1 tbsp salt for 13 minutes.
  • Veggies were boiled slightly less – they were not quite done when we drained them.  This way when mixed and heated again with the meat and sauce they ended up about perfect.

Also first try at fried rice.  I thought for sure I ruined it but it turned out okay.  Looking forward to doing this again.



Baked Mac ‘n Cheese

So the other day we cooked up a couple of pounds of macaroni, strained it, and added a little bit of butter to keep it from sticking together.  Then into a pot with milk, several bags of shredded cheese, some bbq seasoning, salt, pepper, and a can of cream of celery soup.  Then it got baked for about an hour with cheese and breadcrumbs sprinkled on top.

It was pretty good.  Not bad at all, but not amazing.

Leftovers went in fridge.  A couple of days later, I needed a quick dinner for some of the kids, so I threw some of the leftovers in a well seasoned cast iron skillet and heated it up on high heat until it was nicely sizzled.


In my whole life I never had better mac ‘n cheese.  I’m not sure exactly what made it the best, but here is a picture, and we’re going to have to try this again sometime.



Beef and Broccoli (Recipe)

This is my first go at Beef and Broccoli.  While it’s not quite as “pretty” as the chicken dishes, it’s flavor and texture was outstanding.

I like doing this at home, from scratch, because it is a challenge, and lets me cook quite healthy food that tastes amazing.


  • Stir fry beef (1+ lb)
  • 2 big broccoli crowns (2+ lbs)
  • half a bag of sliced carrots (about 1/2 lb)
  • a large green pepper
  • kikkoman hoisin sauce (half jar – about 5 oz)
  • sesame oil (about 1-2 tsp)
  • peanut oil (about 4 tbsp)
  • fresh garlic (5-10 cloves, less than one head)
  • ground ginger (about 1 tsp)
  • kikkoman reduced sodium soy sauce (a couple tbsp)
  • baking soda (1/4 cup or 4tbsp)

Prepare Rice

Put 1-2 cups of rice in your largest pot full of boiling water.  Keep on high.  After 13 minutes, dump in strainer and rinse with warm water to stop it from cooking.  Remove to bowl and wash your strainer :)

Prepare Meat

Trim meat down into consistently sized pieces.  Most of what I had was about 1/2″ wide by 1/4″ to 3/8″ thick.

Place in large bowl along with 4 cups warm water and 4 tbsp baking soda.  Agitate every couple of minutes to keep the baking soda from settling out.  After 10-12 minutes, place in strainer and rinse with cool/warm water, then after done dripping, move to a bowl and wash your strainer :)

Note: do not leave it in solution too long or it will start to gain a weird texture that is not appetizing.  If left in just the right amount of time it will have a soft texture like from a restaurant.

Once in the bowl, crush 5-10 cloves of garlic on the meat.  Sprinkle a generous amount of ginger on it as well (1 tsp).  Put 5-10 shakes of sesame oil on it as well (1 tsp).

Prepare Veggies

While meat is soaking, chop up pepper, carrots, brocolli into bite sized pieces.  Place in large bowl.

Get a large pot full of boiling water and dump the vegetables in.  Keep on high heat.  It only takes 3-5 minutes, you’ll know they are done by sampling them to see when they are soft but still crispy. Without delay, dump into strainer to stop them from cooking in the hot water.  Remove to bowl and wash your strainer :)

Cook Meat:

In your largest skillet, hopefully cast iron, and on super high heat (I use 2 burners with a 17″ skillet), get the skillet smoking hot.  Then add about 4 tbsp of peanut oil.  Promptly dump in the meat and then start and keep moving it around.  You want the skillet to stay hot hot hot.  When you think it is about done, snip a thick piece in half to see if it is cooked through.  Try not to over cook as this only takes about 3-5 minutes.

Once done keep heat on medium high and:

Assemble It:

Dump in veggies.  All of the veggies.  Dump in half a jar of hoisin sauce (about 4-5 oz).  Add a generous amount (1-2 tbsp) of soy sauce.  All this time you should be stirring so as to sizzle the veggies, but not too long, maybe 45 seconds or so.

Turn off heat.  Make sure it is all stirred together and if needed add a little more soy sauce, ginger, sesame oil, salt, or hoisin sauce – all to taste.


Compared to many restaurant versions that are heavy on the sauce, this is a “light dish”,. It only has about 5 tbsp of oil covering 10 generous servings.  And the fact that 1 lb of meat is spread across 10 servings means it is mostly veggies.

We put down about 1/2 rice and cover it with about 1/2 beef and broccoli.


Note: this is a “draft recipe” from memory based on my first experience with cooking this dish.  But it did turn out well I thought I’d write it down.  I did not base this on another recipe, but rather from some techniques I’ve been practicing.