Author: Ollie

Cloud adventures in CPAP

My dentist, the competent and honorable Dr. J. P. St. Clair, has been pestering me for more than a year saying, “You snore. I can tell by looking down your mouth. Do something about it!”  So I finally did. I took a “home sleep test” and the sleep clinic people said, yes you should do something about it. Plus Carolyn… Read more →

Handling errors in nodejs and express

Many people surely know all this by now. Still, here are some things I’ve recently learned about notifying clients (browsers, API clients) about errors. Delivering errors from route handlers to clients This is remarkably easy, once you figure it out. Just use the http-errors package. (Beware, not the http-error package; it does something different. Call next() with an object made… Read more →

Net Promoter Score survey from a regulated monopoly? WTF?

I just got an email survey from our local monopoly internet service provider. Will you recommend Comcast to a friend? Yes=10  No=1 This betrays a profound misunderstanding of the usefulness of that kind of survey, called the Net Promoter Score (NPS) survey. Why is “will you recommend our lightly regulated monopoly to your friends” a stupid question?  Well, my friends… Read more →

Movement Voter Project: make a difference in the elections and beyond!

In this critical moment in our history, we are all struggling with what we can do to make the biggest difference. I’m writing to share with you a unique and powerful response to our political crisis that I learned about in a recent presentation: the Movement Voter Project. The Movement Voter Project (MVP) is a great way for those of… Read more →

From browser Javascript, how to tell if an image won’t load

Sometimes it’s necessary in Javascript in a browser to find out whether an image object loads correctly. You might do this to check whether a server is responding, or whether it’s blocked by a firewall. In plain HTML you would load the image like this <img src=”/maybe.png” /> then look for the browser’s broken-image indicator visually. You can do this… Read more →

Computing the mode with SQL

The mode of a bunch of numbers is the most frequent number in the bunch. A bunch of numbers can have more than one most-frequent number. Given a table tbl with columns category and value, this SQL returns the mode for each category.   WITH freq AS ( SELECT COUNT(*) freq, value, category FROM tbl GROUP BY value, category ),… Read more →

Stop tax cheats: pay bounties

Back in the 1970s, the US government paid bounties to citizens who identified big polluters and helped bring them to justice. Some of those bounties helped found the Riverkeeper organization that keeps watch on the Hudson River to this day. Those bounties helped make water and air much cleaner. In the twenty-teens we have another situation where government needs help:… Read more →