Month: October 2020

Easy Eggs Benedict

Easy Eggs Benedict

There’s really not much to making this fabulous breakfast (or lunch or dinner) dish. This video shows how to make Eggs Benedict in about 10 minutes.

Actually, the video is only 9 minutes, because we cut out part of the egg poaching time.

But all you need to make Eggs Benedict is

  • 2 English muffins, split and toasted
  • 4 slices ham, sauteed in butter
  • 4 eggs to poach
  • 3 egg yolks
  • 1-2 Tb lemon juice
  • ¼ lb butter melted and still hot

Sauté the ham slices in butter for about a minute.

Toast the split English muffins and top each half with a ham slice.

The important part of making the Hollandaise in a blender is to melt the butter so it is hot and bubbly. In our microwave, this is about 75 seconds (1:15 minutes). Make sure the butter is quite hot, so it cooks the egg yolks a bit when you pour it into the blender with the yolks and lemon juice.

To poach the eggs, we use a 3-quart saucepan with water gently simmering. Add salt and about 2 Tb white vinegar to the water, and quickly slip the 4 eggs into the water. No need to stir or swirl. Set a timer for 3:00 minutes and then lift the eggs out and put them on the toasted English muffins with the hams slice. Pour on some hollandaise and serve right away. Decorate with a bit of parsley if you like.

This makes a festive breakfast in about 15 minutes, including the time to bring the water to a boil. Enjoy it!

Entering data in Python: console or GUI

Entering data in Python: console or GUI

Suppose you want the user to enter some data for a Python program to work on. For this, Python provides the input statement, which can print out a prompting string and wait for keyboard input. 

name = input("What is your name? ")
print("Hi "+name +" boy!")

This little program asks for your name and waits for you to type a string and press Enter. The input statement accepts keyboard input and returns a string. So, the resulting console results might look like this:

What is your name? Jim
Hi Jim boy!

Heinlein fans may recognize the reference.

You can paste that 2-line program into any development environment, such as Thonny, PyCharm or even Jupyter Notebook and see it work right away.

Adding two numbers

Of course, you can enter numbers as well, but you must be sure to convert the resulting strings into an int or a float. Here we use the more general float.

x = float(input("Enter x: "))
y = float(input("Enter y: "))
print("The sum is: ", x+y)

The resulting output is:

Enter x: 23.45|
Enter y: 41.46
The sum is:  64.91

Of course, this naïve program expects only legal input. If you enter, say, “qq” instead of 22, you will get a Python error:

File "C:\Users\James\PycharmProjects\input\inputdemo.py", line 7, in <module>    
y = float(input("Enter y: "))
ValueError: could not convert string to float: 'qq'

There are ways to check for this, of course, such as catching Exceptions, and we will explain those in the following example.

However, you will only find the input statement in rudimentary examples. Most programs that need user input get it from a windowing interface. We’ll show these same examples next using the tkinter GUI library.

Making a windowing example program

You can do much the same thing by using the Entry field in the tkinter GUI (graphical user interface). Here we repeat those examples in simple tkinter windows.  To use tkinter, you have to import that library into your program:

from tkinter import *
import tkinter as tk

You also create an abbreviation for tkinter, naming it just tk.

Then, most of the setup code creates the visual widgets and their arrangement. In the following example, we use an Entry field, a Button and two Labels. You start by getting the window system pointer tk.Tk() and use it to attach the widgets to. After you create this objects, you run the mainloop() function which displays the window and receives mouse and keyboard input. The window keeps running until you close it by clicking on the “X” in the upper right corner or selects some widget that causes the window to close.

Our first example above was one where you enter your name and it says Hello back, again giving homage to Heinlein in the process. The tkinter program does the same thing

The code for this program creates the two labels, the Entry field and the OK button:

def build(self):
    root = tk.Tk()
    # top label
    Label(root,
         text="""What is your name?""",
         justify=LEFT, fg='blue', pady=10, padx=20).pack()

    # create entry field
    self.nmEntry = Entry(root)
    self.nmEntry.pack()   # and put it into the window

    # OK button calls getName when clicked
    self.okButton = Button(root, text="OK",
                            command=self.getName )
    self.okButton.pack()

    # This is the label whose text changes
    self.cLabel = Label(root, text='name', fg='blue')
    self.cLabel.pack()
    mainloop()      #run loop until window closes

When you click on the OK button, it calls the getName method, which fetches the text from the entry field and inserts it into the bottom label text.

# gets the entry field text
# places it on the cLabel text field
def getName(self):
   newName = self.nmEntry.get()
   self.cLabel.configure(text="Hi "+newName+" boy!")

Adding two numbers

And our second example rewritten from above reads two Entry fields, converts them to floats and puts the sum in the lower label.

 The code for this window is much the same, except that we fetch and add two numbers. Here is the function the OK button calls.

xval= float(self.xEntry.get())
yval = float(self.yEntry.get())
self.cLabel.configure(text="Sum = "+str(xval+yval))

Catching the error

However, if you enter some illegal non-numeric value, you can catch the exception and issue a error message:

try:
    xval= float(self.xEntry.get())
    yval = float(self.yEntry.get())
    self.cLabel.configure(text="Sum = "+str(xval+yval))
except:
    messagebox.showerror("Conversion error",
                              "Not numbers")

If you enter non-numeric strings, the program displays this message box:

And that’s all there is to creating a program with a simple graphical user interface.

Steak béarnaise using a blender

Steak béarnaise using a blender

Steak béarnaise is a simple dish. You cook a steak and pour some sauce béarnaise over it. You can cook the steak over a grill, in a cast iron pan, or even in the oven. Here is a classic description of cooking an (effing) steak.

But how to make béarnaise? It’s really very easy, and here we simplify it even more by using a blender and a microwave.

  • 1/3 to ½ cup dry white wine
  • 2 scallions, chopped
  • 2 tsp tarragon
  • 3 egg yolks
  • ¼ lb (1 stick) butter
  • Another 2 tsp tarragon
  • 1 steak (sirloin or ribeye works well)
  1. Put the wine in a small saucepan and add the scallions and tarragon.
  2. Boil the wine down to about 1-2 tablespoons. Do this slowly, so the pan doesn’t suddenly go dry.
  3. Strain the wine reduction into a small dish, pressing the scallions to squeeze out any remaining wine.
  4. Put the 3 egg yolks and the wine reduction in a blender and pulse briefly.
  5. Melt the butter in a microwave for about 1 minute. The butter should be hot and bubbly. If it isn’t, add another 15 seconds or so. You need the butter hot to cook the egg yolks.

  1. Slowly  pour the hot butter into the running blender. Add the remaining tarragon and turn off the  blender. Let it set while you prepare the steak.
  2. Cook the steak to about 120˚ F.  Let it rest for at least 5 minutes. Then cut it into serving strips.
  3. Pour the béarnaise over the steak and  serve it. If by any chance you want the béarnaise thicker, you can heat it briefly over low heat, with constant stirring.

Serve with baked potatoes and a veggie or salad (or both).

Ten products you can skip –as seen on TV

Ten products you can skip –as seen on TV

Cable news, even when its reporting is sound, is rife with advertising of products you never heard of. And for good reason, advertising is relatively cheap on cable news and anyone can flood the news with “wonderful new products” that probably aren’t that great.

Prevagen does not improve your memory, as explained in this Harvard Health blog. . You have probably seen Prevagen ads everywhere. Targeted particularly at seniors who may experience normal word finding difficulties, the claims may mention “studies,” but not “doctors,” because no doctor recommends. It. Allegedly extracted from jellyfish (apoaequorin) actual studies have shown no significant effect, although by rearranging their data (called p-hacking) Quincy Biosciences has claimed it does. The FDA does not agree as explained in this Science Based Medicine article. The Global Council on Brain Health concludes that  “there is no convincing evidence to recommend daily dietary supplements for brain health in healthy older adults.”

The ASPCA does not help your local animal shelter. Despite their tear-jerking ads, the ASPCA is a New York City organization, and is not an umbrella organization for your local SPCA. Give to your local animal shelter instead. Further the ASPCA has been criticized for euthanizing pets rather than saving them.

Zerowater is a water filtering pitcher which takes about six minutes to filter a quart of water. Consumer Reports rated it Very Good and the competing Britta filter Excellent. It takes only about 1:15 to filter a quart of water. However, the Zerowater seems to removes 98% more contaminants. Unless your tap water has an unpleasant taste or smell, these may not  be that valuable.

Mr Clean Magic Eraser.  These products look like a good idea and have positive reviews, although it is not clear how they improve on a damp paper towel and some SoftScrub.  According to reviews at The Spruce, “Because the eraser works by scrubbing at the surface with tiny but extremely hard threads, you should not use on highly glossy or satin finishes….it is not appropriate for paneling or wood finished surfaces. It will strip away the surface and create damage and the sponge does begin to break down after [several] uses.

Tac Shaver by Bell and Howell. The reviews of this shaver are mixed, but according to this review apparently it didn’t last long and the beard trimmer didn’t do much. The Bell and Howell company you may remember from years back essentially got out of the technology business in the 2000’s and is now just a name owned by Westview Capital Partners.

COQ10 with Turmeric – If you are taking statins, a COQ10 supplement won’t do much of anything more. And turmeric is mostly good in curries.

Flex Seal is one of those As Seen on TV pitches you probably are skeptical of. You should be. It works for some things, but has a cumulative review of 1.5 out of 5 stars.

Yoshi Copper Grill MatIt “sort of works” but can’t be placed over an open flame. You could use it on a gas grill with covered burners, though.

Spin Power – is a multi-outlet charging station for your cordless devices. It does not include any spot for phones that can be charged by induction. It has mixed reviews on Amazon as you might expect from anything from ASOTV.

WATCHMAN – is an implant from Boston Scientific for stroke prevention. It is FDA approved and in wide use, But it was criticized in a handful of studies cited by Dr David Becker from Chestnut Hill Temple Cardiology and by Dr John Mandrola of Baptist Medical Associates of Louisville. If you are a candidate for this implant, discuss these objection with your cardiologist. The product has been generally  successful.

Spurtles – I never heard the word outside of the commercials from Lucinda’s Kitchen. They seem to be a set of wooden kitchen utensils made of acacia wood. Lucinda claims these exactly fit pans and jars and are more useful than what you have now. (I seriously doubt that.) You must hand wash them rather than tossing them in the dishwasher. This review calls them low-quality, not durable and having delayed delivery.