Friday, March 31, 2023

This "Clam Dip" is basically a chemical stew

Well-known food writer Michael Pollan counsels us not to buy any food product with more than five ingredients. 

A couple of weeks ago, I saw this on sale at my local supermarket, and thought "It might be nice to try something different from my usual home-made onion dip." After all, the package advertised "The Perfect Dip For Chips!"

Reser's Creamy Clam Dip

Can't argue with "perfect", so into my basket it went. 

Sadly, it fell considerably short of perfection. Though labeled "Creamy Clam Dip", it had no visible clams and almost no clam flavor. And its texture was…not creamy, but a sort of watery, gelatinous blob that was nothing like the sour cream-based dips one usually sees. 

I got curious about what was actually in the stuff. Here's the ingredient list, exactly as printed (in very small, slightly fuzzy type) on the plastic tub: 


If you make more than a passing attempt to wade through this, you will soon be waylaid by the various parentheses and brackets that group ingredients and explain their functions. It's a confusing jumble. But relax, I've done the hard work of parsing the list and organizing the ingredients. Here they are, in hierarchical outline form: 

sour dressing
    nonfat milk
    palm oil
        modified food starch
        mono and diglycerides
        guar gum
        sodium phosphate
    soybean oil
        lactic acid
        citric acid
        acetic acid
        natural and artificial flavors
    mono- and diglycerides
    beta carotene
    potassium sorbate
    natural and artificial flavor
    soybean oil
    egg yolks
    sea clams
    sea clam juice
    sodium tripolyphosphate
    calcium disodium EDTA
    xanthan gum
    hydrolyzed protein
    potassium sorbate
    citric acid
    corn syrup solids
    cod liver oil
    modified corn starch
    cellulose gum
    soybean oil
    caramel color
    natural and artificial flavors
    garlic powder
    yeast extract
    tamarind extract
    lactic acid
dehydrated onion
modified corn starch
sodium benzoate    

I've tried hard to keep it all straight, but it's possible I've made errors. 

Now let's talk about unique ingredients, because several ingredients (salt, e.g.) are listed multiple times. Here's what I've come up with (in order of appearance, not in order of decreasing amounts, like normal ingredient lists):

  1. nonfat milk 
  2. palm oil 
  3. modified food starch (thickener/stabilizer)
  4. gelatin (thickener/stabilizer)
  5. mono- and diglycerides (fats) 
  6. guar gum (thickener/stabilizer)
  7. carrageenan (another thickener/stabilizer)
  8. sodium phosphate (thickener/emulsifier)
  9. soybean oil (a "processing aid")
  10. lactic acid (adds "sour cream" taste)
  11. water 
  12. citric acid (more sour taste)
  13. acetic acid (essentially, vinegar)
  14. "natural and artificial flavors" (this covers a lot of ground!) 
  15. beta carotene (for color)
  16. potassium sorbate (preservative)
  17. egg yolks 
  18. vinegar 
  19. salt 
  20. sea clams 
  21. sea clam juice 
  22. sodium tripolyphosphate (preservative, also used in detergents)
  23. calcium disodium ethylenediaminetetraacetic acid (My God, just read what Wikipedia says about this stuff:
  24. sugar 
  25. maltodextrin (basically sugar, but with a higher glycemic index)
  26. xanthan gum (thickener)
  27. hydrolyzed corn protein (simulates a bouillon, or broth taste)
  28. hydrolyzed soy protein 
  29. hydrolyzed wheat protein 
  30. corn syrup solids (a cheater term for "sugar", basically) 
  31. "spices" 
  32. molasses (really? for color and flavor, I assume; contains a lot of sugar)
  33. cod liver oil (no idea what it's doing in here; not usually considered great-tasting!) 
  34. modified corn starch (thickener/stabilizer)
  35. cellulose gum (thickener/stabilizer)
  36. caramel color 
  37. garlic powder 
  38. yeast extract (adds "umami" flavor)
  39. tamarind extract (adds sourness and flavor)
  40. dehydrated onion 
  41. sodium benzoate (preservative)

There! Did I miss anything? At least FORTY-ONE ingredients, and probably quite a few more (Who knows how many different mono- and diglycerides there are? Or "natural and artificial flavors"? Or "spices"?). When all is said and done, we're probably looking at at least 50 different ingredients. In Clam Dip! 

And they still couldn't make it taste good! 

Michael Pollan advises no more than five ingredients total. Here we have fifty! Of which, I count eight different thickeners and stabilizers, and at least three different chemical preservatives. 


Thursday, June 02, 2022

The way we test applicants for programming jobs makes no sense

I'm acquainted with a young man who has finished one programming job and is looking for his next one. 

He's applied for a few software engineering jobs and has generally sailed through the first couple of evaluations, leading to an online test of programming skill (typically four different programming problems, to be solved in an hour or so). 

But the skills these tests demand have no discernible relation to any business problem I'm aware of. 

Examples: one problem requires that the applicant write code to find the longest palindrome in an arbitrary string of characters (a palindrome is a string that reads the same forwards and backwards). Another requires a string to be printed out in a weird "zig-zag" format that has never been needed in the entire history of business computing. And this is the basis of how we choose whom to hire? 

The scoring of answers gives extra points for code that runs faster. And since these problems have been around for years, they've been attacked by numerous amped-up nerd geniuses whose self-worth is wrapped up in shaving a few milliseconds off execution times. Thus, any normal programmer who solves the exercise will always be judged against solutions that make their efforts seem inadequate on a raw speed criterion. Keep in mind: the applicant is generally allowed 15–20 minutes to dash off a solution: not nearly enough time for the thoughtful design process necessary to produce correct, reliable code that works even in the "edge cases". Again, this bears no relationship to how programmers are expected to function in the real world.

The inordinate emphasis on execution speed is only marginally relevant to good "real world" programming practice. Given the choice, most businesses would opt for code that is easy to understand, maintain, and modify—over a tricky algorithm that shaves a few machine cycles off execution time but is dense, fragile, and incomprehensible without major study. 

Modern computing systems are very fast, and have the ability to optimize code before running it. And in any real-world business application, overall processing speed is likely to depend far more on things like the speed of the network and the responsiveness of a remote database server, than on the details of the algorithm used. The programmer has no control over these limiting factors. 

The tests are designed to favor shoot-from-the-hip hotshots over programmers who actually engineer their software by carefully considering all the factors that go into good software and balancing them to produce the best solution. 

Is this the best the industry can do at selecting people to be in charge of one of their most important assets, their base of mission-critical software?

Saturday, January 29, 2022

I cracked the code for great homemade tortillas

 Been a fan of Mexican cuisine for more than 50 years. Several times along the way I've bought bags of "Masa Harina" to try making my own corn tortillas. It never really worked out. I'll spare you the details because I've finally gotten the winning formula. It's not difficult, really!

What you'll need 

What follows is a description of what works for me. Experienced chefs will know how to adjust for the tools they have on hand. If you're a rank beginner, please follow these directions closely before you tell me they don't work. 

Here's the list: 

  • The right kind of cornmeal. I stumbled onto this stuff and it seems to work much better, and taste much better, than the usual Masa Harina: My personal choice was the whole grain option, but they have others.
  • A good kitchen scale. Accurate digital scales have gotten so cheap that there's no excuse for not having one. (Side note: every recipe that specifies "cups" of anything needs to change to "grams".) 
  • A tortilla press.  There are many options but most fail IMO because they don't ensure consistent thickness. I modified my press to fix this problem (I'm considering offering this mod as a service, so let me know if you're interested.)
  • A hot, dry cooking surface. The "comal" is traditional, but not necessary. I have one, but find that a cast-iron skillet works just as well. 
  • An induction cooking plate. Again, not necessary but works terrifically to maintain the right cooking temperature of 350–400°F. 


  • First, disregard the package directions. On my bag of whole-grain cornmeal, they specified 2.5 cups of water for 2 cups of meal. This results in a sticky dough that is difficult to work with. I found that 2.25 cups of water worked much better.  
  • 1 cup of meal = 160 grams, and will make six 6" tortillas.
  • Follow the package directions for kneading and resting. I rest it for at least 10 minutes. 
  • Heat your cooking surface as described above. 
  • Line your tortilla press with plastic wrap. 
  • For my 6" press, it takes 65–70 grams of dough to make a tortilla. YMMV. The most important thing is to have consistent thickness. Use your hands to roll the dough into a sphere and place it near the hinge of your press. If you try to go too thin, you will probably have problems. 
  • Carefully peel the tortilla from the plastic wrap and slap it hard onto the heated cooking surface. This is a satisfying move!
  • From here, you're on your own. With a nicely hot pan, it should take less than a minute to cook the first side. Experience must be your guide. 
  • Use a metal spatula to turn the tortilla, because you may have to scrape hard to undo any sticking. 
  • Once the other side is done, you're good to go. Enjoy!

Sunday, May 30, 2021

A modest proposal to reform online "star" product ratings

Star ratings suck. They are next to useless. 

In my years of online shopping, I've noticed something interesting: pretty much every product I look at on (for example) Amazon is rated close to 4.5 stars.

How is that helpful? 

People talk about "grade inflation" at colleges. Now let's talk about "rating inflation" in online stores.  

  • Why should a product that simply does what's expected of it get the highest possible rating? 
  • How can you accurately rate a product without using it for a while? 
  • Why should a product be rated "1-star" because you didn't understand what you were buying?

Here's my proposal for a "New Star" rating system. (And if you use it, you should identify it as a "New Star" rating to distinguish it from the bad old system.)

Here's what I think New Star ratings should mean: 

  1. Terrible. Avoid this product. It completely fails to do what it's supposed to. (Don't assign this rating just because you're a little disappointed.)
  2. Flawed. The product works, but has some significant problems. Buy at your own risk. 
  3. Satisfactory. The product performs as advertised, possibly with some minor flaws. You won't go wrong buying it.
  4. Excellent. The product performs better than expected and is a superior value. I'm glad I chose it over alternatives.
  5. Awesome. The product is close to perfect. It surprised and delighted me with how good it is. (Don't assign this rating just because the product, you know, works.)

In this scheme, few products would get a 5-star rating. A rating of 3 stars would be the norm for products that simply do what they're supposed to. An average rating of 4 stars would indicate a superior product.

And, folks, don't rush to give something a rating the minute you take it out of the box. Many (if not most) products can't be accurately rated until you've lived with them for a while. Especially things where longevity is a key attribute (like, say, batteries). 

In my perfect world, whenever you you try to assign a star rating on a website, it should pop up a reminder to observe the "New Star" guidelines. Unlikely, I know, but I can dream. Taking this further, sellers could go through a transition phase where they display both New Star and old star ratings. And perhaps New Stars should be visually distinct from the traditional ones, for example with 4 points instead of 5. 

What do you think? Wouldn't it be great if star ratings were actually helpful?

Saturday, September 26, 2020

What if the government was run like a private insurance company?

We're all familiar with how insurance companies, being smart, will invest a little money as a hedge against a big claim. They'll pay for a free flu shot rather than incur the risk of having to cover the much more expensive treatment of a flu victim. They'll waive the deductible to get your chipped windshield fixed before it turns into a full-on windshield replacement. 

What if the government operated this way? Prime example: we have plenty of evidence that pre-K education pays big dividends in later life, in the form of higher productivity and income, and even better health. It's not even close. If government was run like a private insurer, it would insist on funding preschool because the return on its investment would be so great. 

Some other areas that a rational insurer would want to cover: 

  • Climate mitigation and resilience. Much cheaper than ever-increasing expenses for disaster recovery. 
  • Clean energy. As has been noted, the health benefits alone would deliver a big payoff for getting rid of fossil fuels. And what rational businessperson wouldn't want to invest in virtually unlimited free energy? 
  • Drug development. What if, instead of granting patent monopolies and then struggling to insure the spiraling cost of extortionate drug prices, the government simply invested in drug research and made the results available as cheap generics? The savings to Medicare and Medicaid alone would be massive. 
There are many other areas that a rational private insurer would want to invest in, in order to lower its future payouts and drive down the cost of premiums. But when it comes to government, the anti-tax crusaders view every expenditure on social welfare as a net loss to the economy. Since most of these people claim to be fans of business, how can they oppose the government operating more like a private insurer?

Labels: , ,

Sunday, August 30, 2020

Yes, Trump is inarguably a psychopath. And a dangerous one.

Note: this post is based mostly on a long article by Dr. Vince Greenwood, a clinical psychologist who founded the site because he is alarmed by Donald Trump. Greenwood directly addresses the so-called "Goldwater Rule"—you can't diagnose psychological disorders without interviewing the subject personally—and why it doesn't apply to Trump. I highly recommend the entire article, but this post covers the key points about Trump. 

Thesis: The 45th President of the United States has a disorder that conveys danger to all those in his orbit.…There is no cure for this disorder. Nor do there appear to be any effective measures to curb it. The best we might do is diagnose the disorder and warn others.

Psychopathy has received more attention and research than any other personality disorder, with over 3,300 studies to date. One can predict with a high degree of confidence that a person diagnosed as a psychopath (about 1% of the population, 75% male) "is destined to inflict significant harm and mayhem on many that cross his path." 

The standard Hare Psychopathy Checklist consists of 20 traits, each to be scored a 0 (not present), 1 (data unavailable or inconclusive), or 2 (definitely present). Traits include the following (see the article for the complete list): 

  • Egocentricity/grandiose sense of self-worth 
  • Pathological lying and deception/gaslighting 
  • Conning/lack of sincerity 
  • Callous/lack of empathy 

A "perfect" score on the checklist is 40. Different researchers have used either 25 or 30 as the threshold for a clinical diagnosis of psychopathy. The average score among the general population is 5. Among imprisoned criminals (male), the average is 22. Greenwood calls a score of 30 or more "extreme and dangerous".

He gives Trump a score of 32. 

To a significant degree, psychopathy is inherited, suggesting that Trump's parent(s) may well have suffered from it. As to what exactly is being inherited, recent research has established that it's a different brain structure than most people have. Briefly, psychopaths process emotionally-charged situations in the part of the brain responsible for language and problem-solving, not the part that handles emotional regulation. "They simply do not experience the appropriate emotional reactions to moral wrongs." When you think of a "cold-blooded killer", he's almost certainly a psychopath. 

The psychopath's brain also doesn't respond normally to things like fear of violating acceptable rules and boundaries, and the regions responsible for impulse control are smaller.

In a nutshell, then, Donald Trump inherited a brain that doesn't work the way most of ours do. He is literally incapable of caring or empathy

These brain anomalies "help explain three fundamental traits that appear to be foundational to the condition" of psychopathy: 

  1. lack of conscience 
  2. inability to process emotions that foster empathy and human connection
  3. inability to control impulses

Author Martha Stout paints this picture of the psychopath in her 2005 best-seller, The Sociopath Next Door

Imagine—if you can—not having a conscience, none at all, no feelings of guilt or remorse no matter what you do, no limiting sense of concern for the well-being of strangers, friends, or even family members. Imagine no struggles with shame, not a single one in your whole life, no matter what kind of selfish, harmful, or immoral action you have taken…Now add to this strange fantasy the ability to conceal from other people that your psychological makeup is radically different from theirs. Since everyone simply assumes that conscience is universal among human beings, hiding the fact that you are conscience-free is nearly effortless…You can do anything at all, and still your strange advantage over the majority of people, who are kept in line by their conscience, will most likely remain undiscovered.…you pursue your career with a cold passion that tolerates none of the usual moral or legal encumbrances. When it is expedient you doctor the accounting and shred the evidence, you stab your employees (or your constituency) in the back, tell lethal premeditated lies to people who trust you, attempt to ruin colleagues who are powerful or eloquent, and simply steamroll over groups who are dependent and voiceless… You have a special talent for whipping up other people’s hatred and sense of deprivation… And all this you do with the exquisite freedom that results from having no conscience whatsoever…You become unimaginably, unassailably, and maybe even globally successful. Why not? With your big brain, and no conscience to rein in your schemes, you can do anything at all.

Greenwood continues (emphasis added): "It’s hard to imagine having no fear about being found out for moral transgressions, no compunction about lying, and no gut-level reservations about acts that might harm others.…Conscience is the glue that keeps the social fabric from unraveling. It undergirds the social contract that promotes decency, safety, and trust. Yet there is that small percentage that live outside that social contract… Is it not desirable to identify those without a conscience, particularly if they are in a position of power over others?

And "the psychopath has plenty of emotional fuel. Admittedly, not the animating force that flows from love, compassion and empathy; but emotions associated with the drive to dominate such as anger, glee, resentment. envy, consternation, jealousy, and contempt. These emotions are shallow and often fleeting, but can be intense in the moment, and typically drive the psychopath’s behavior." 

Sound like anyone we know? 

A few additional points gathered from the text: 

  • For the psychopath, life is ruled by impulse. 
  • When an impulse is triggered, the deficiencies in higher-level mental functions means there is no counterweight to it. 
  • The calls most of us make every day between “l want” vs. “l should” just don’t take place with a psychopath. He has only one play available to him: the short game of winning the moment. 
  • Elizabeth Stout emphasized the psychopath’s inability to develop a loving bond with another. David Shapiro would argue there is a more fundamental inability to develop any deep allegiances: to a significant other yes, but also to friends, the community, even ideas and values. 
  • The pathological liar often contradicts himself within minutes (but shows scant concern for the contradiction). The psychopath is not interested in what is being said, but how it works for him.
  • He is at the mercy of saying quickly whatever meets his egocentric needs of the moment. 
  • Psychopathy is a unique form of psychopathology in that it does not involve suffering by the psychopath himself. The main consequence of the condition involves the danger it poses to others.

"For a psychopath who is in a position of significant power and authority, other manifestations of his condition bode ill for those under his sway. These would include the inability to act predictably, the inability to react calmly and without aggression, the inability to examine his own behavior and accept responsibility, the inability to respect boundaries and limits, and the inability to place the interests of others or the common good above his own." 

This is getting long, but I want to mention a few additional points Greenwood addresses: 

  • Trump is often called a "malignant narcissist" (combining narcissism, sadism, paranoia and psychopathy). While this may be an apt description of him, it is not a formal, accepted diagnosis, and is unnecessary. 
  • Trump is often called a "sociopath", a term often used interchangeably with "psychopath". The latter is the correct scientific term. 
  • While Trump exhibits narcissistic behavior, there is a difference. Narcissism is “hot” (the heat of feeling vulnerable) underneath, psychopathy is cold. One is an insecure peacock, the other a snake. The narcissist breaks rules because he feels special and entitled. The psychopath breaks rules because he wants to secure an advantage. 
  • There is one feature of Narcissistic Personality Disorder that applies to Trump and may contribute, at the margins, to his dangerousness. Narcissists are triggered by perceived criticism, which they view as attacks on their self-esteem or status. That can lead to aggressive outbursts and rash decision-making.
  • Psychopaths are extremely good at hiding their condition and making others believe them. They exploit the human tendency to accept what others tell them at face value. 

There is much, much more in the article. The conclusion is inescapable: Donald Trump is a psychopath, and he is very dangerous.


Saturday, August 01, 2020

The crypto technology that prevents counterfeiting mail ballots

A chorus of Republican politicians, from President Trump on down, are trying to cast doubt on the security of vote-by-mail elections. Here's why one of their biggest "concerns" is completely wrong.

First, I'll note that 5 states use mail ballots exclusively: Colorado, Hawaii, Utah, Oregon and Washington (where I live). As far as I know, there have been no credible allegations of election fraud in these states, and in fact mail ballots are in important ways more secure than the widely-criticized voting machines. I'll leave it to others to list the many advantages of voting by mail. My purpose is to show you that the "threat" of nefarious parties flooding an election with counterfeit mail ballots is bogus.

The basic solution is to use well-known cryptographic techniques and bar-coded ballots. In fact, a reasonably bright Computer Science undergraduate could design a hack-proof system with these tools.

I'm not an expert in cryptography, but I've used it for years and understand enough to realize how it can make counterfeit ballots effectively impossible. I'll describe a couple of basic ways, and an actual expert could refine them even further.

Both of these schemes start with printing a unique, random bar code number on every ballot that's sent to voters. So every voter knows what their unique ballot number is (it would be duplicated on a tear-off stub that the voter could retain). We wouldn't use sequential ballot numbers because they could potentially be matched with a list of voters, allowing individual voters' ballots to be traced to them.

Technique 1

A list of these random ballot numbers is put in the registrar's computer. Every time an incoming ballot is tallied, its number is "checked off" in the computer. If another ballot with the same number is submitted, we know it's counterfeit. Likewise, if a ballot with a number that's not in the list comes in, we know it has to be bogus. Simple as that: only legit ballots can be counted.

Technique 2

This technique is a bit fancier, but doesn't require keeping a master list of valid ballot numbers. Each ballot is "self-validating".

The basic idea exploits a cryptographic technique called "hashing". Starting with a number, or a chunk of text, or any other block of data, it's easy to compute its hash—which looks like a big, completely random number. But this is a "one-way" process: if you know the hash, it is virtually impossible to discover the data that was used to create it. And if the tiniest change in the source data is made, the new hash will come out completely different, making it easy to detect tampering.

Each time we tally a ballot, we enter its number into a database, so if someone tries to submit an exact duplicate, we'll know and can reject it. The problem arises with hackers trying to create totally new ballots with unique new numbers, and that's where hashing can stop them.

Here's a simple version of how it works; I'm using small numbers to illustrate the process, but in practice really big numbers are used to make it impractical to guess them.
  • To begin, we need to choose a secret number, the "key". Let's pick 391.
  • Now take a ballot that has a unique random number, say 742.
  • Multiply the ballot number by the secret key: 742 x 391 = 290122.
  • Now take the hash of this answer. Let's imagine that the hash of 290122 is 6704. And remember, there's no way to recover the number just by knowing the hash, except to compute the hash of every possible number until we happen to hit on the one that produces the hash value 6704. With really large numbers, this is impractical to do in the time before the election.
  • When we print each ballot, its bar code consists of 2 parts: the random ballot number (here, 742) and the hash we just calculated (6704).
  • To validate the ballot, we multiply the ballot number by the secret key (391) and check that the hash of the answer is indeed 6704.
  • If the hash in the bar code doesn't match the hash we just computed, it means that we used the wrong key to generate the bar code—and the ballot is rejected as a fake.
  • Bottom line: you can't create valid counterfeit ballots without knowing the secret key.
This is a very basic system and there are many ways of making it even more secure. But the point should be clear: IN A PROPERLY-DESIGNED SYSTEM, THERE IS ZERO RISK OF BALLOT COUNTERFEITING.

No matter what Bill Barr may try to tell you.