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 Parts

Here is a screenshot of some of the parts we’ve designed for the Stain Dipper.  All of the mechanical parts are in the design and correctly positioned and all the hardware has been ordered…

Here are several of the parts from Fusion 360


Here is a servo motor mount and custom made pulley.

Frame v27

Here is a small piece of Nylon used to connect a 1/16″ cable with a aluminum tube.


Stain Dipper

We’ve been doing some research into air knives and considering ways to make staining of thousands of small parts faster.  Dip it into the stain, and have a captive air knife blow the excess off (dripping back into the bucket) as the part is pulled out.

The PVC tube will be hinged so it can be opened for cleaning.  The air knife assembly will be near the top of the tube.

Did some checking on PVC compatibility with stain and it seems to be acceptable: https://www.berlinpackaging.com/insights/chemical-guidelines-for-plastic/

Here is a possible air knife kit. http://www.exair.com/index.php/products/air-wipes/super-air-wipe/saw-kit.html

Now just need to design the servo motor mounts, air knife mount, and misc. other structural components.


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.


Grilling Chicken On Cast Iron

Lodge Cast Iron makes some nice products.  They are quality cast iron, made in the USA, and sold at incredibly good prices.  Here is a link http://shop.lodgemfg.com/

I was at Walmart the other day to restock up on Corelle dinnerware (which is also great – they just don’t play nicely with a tile floor – and my numbers were dwindling).  I noticed this Cast Iron Grill pan:


I never saw the point in these before, but then again, never used one…  But the price was less than $20, so I figured I’d get one…. well I liked it so much I ended up with two :)

So far I’ve cooked Pork Chops and Chicken Tenderloins.  Here is a picture of the chicken from lunch today.  I must say, some of the best chicken I’ve ever eaten.  Perfectly seared, drizzled in salt, pepper, lemon, and butter, it was cooked completely but soooo tender and juicy.


This deserves a longer post, but I’ll put the rundown here for reference:

  • Rinse tenderloins in sink and shake off excess water
  • Liberal amount of kosher salt and pepper
  • Get grill pan(s) screaming hot (starting to smoke) and lay the chicken on it for about 3-4 minutes until the underside has nice grill marks.
  • Turn chicken over, turn burner to LOW, and let other side also get grill marks (another 3 minutes or so).
  • Turn over every 1-2 minutes brushing butter on the freshly turned up side and drizzling fresh lemon juice on each side.  Continue this until internal temp reaches 165+ in the thickest part.
  • Let rest for 5 min in a pile on a plate.


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.


Smoked Chicken And Cheese Wrap

Being in the possession of some freshly smoked chicken breast (Thanks Ezra!), I made a smoked chicken and cheese wrap.   Chunks of smoked chicken and chunks of Boar’s Head Munster cheese into a cast iron skillet until sizzling.  Flour tortilla into another skillet with a dollop of butter until browned on both sides.  A little bit of mustard and mayonnaise wrapped up with the sizzling chicken and cheese mix…. it was divine.




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.



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.