How all the United States presidencies have ended

There are lots of ways a United States presidency can come to an end. Let’s look at some of them.

Did not run for re-election

20 presidents have chosen not to run for re-election when their term expired. (I also include cases where a president sought re-election but was not nominated.)

  1. George Washington, 1796
  2. Thomas Jefferson, 1808
  3. James Madison, 1816
  4. James Monroe, 1824
  5. Andrew Jackson, 1836
  6. John Tyler, 1844
  7. James K. Polk, 1848
  8. Millard Fillmore, 1852
  9. Franklin Pierce, 1856
  10. James Buchanan, 1860
  11. Andrew Johnson, 1868
  12. Ulysses S. Grant, 1876
  13. Rutherford B. Hayes, 1880
  14. Chester A. Arthur, 1884
  15. Grover Cleveland (second term,) 1896
  16. Theodore Roosevelt, 1908
  17. Woodrow Wilson, 1920
  18. Calvin Coolidge, 1928
  19. Harry S. Truman, 1952
  20. Lyndon B. Johnson, 1968

Lost re-election

Eleven presidents have run for re-election but lost. Grover Cleveland later ran again and won.

  1. John Adams, 1800
  2. John Quincy Adams, 1828
  3. Martin van Buren, 1840
  4. Grover Cleveland (first term,) 1888
  5. Benjamin Harrison, 1892
  6. William Howard Taft, 1912
  7. Herbert Hoover, 1932
  8. Gerald Ford, 1976
  9. Jimmy Carter, 1980
  10. George H. W. Bush, 1992
  11. Donald Trump, 2020

Died in office

Eight presidents have died while in office.

  1. William Henry Harrison, 1841
  2. Zachary Taylor, 1850
  3. Abraham Lincoln, 1865
  4. James A. Garfield, 1881
  5. William McKinley, 1901
  6. Warren G. Harding, 1923
  7. Franklin D. Roosevelt, 1945
  8. John F. Kennedy, 1963

Exhausted term limits

In 1951 the 22nd amendment to the United States Constitution instituted term limits for the presidency. Five presidents have exhausted those term limits.

  1. Dwight D. Eisenhower, 1960
  2. Ronald Reagan, 1988
  3. Bill Clinton, 2000
  4. George W. Bush, 2008
  5. Barack Obama, 2016


One president has resigned.

  1. Richard Nixon, 1974

Impeached and removed

Article I of the Constitution lays out a process for impeachment (by the House) and removal (by the Senate) of a president. Impeachment has happened four times, but removal has not happened:

  1. Andrew Johnson, 1868 (acquitted)
  2. Bill Clinton, 1998 (acquitted)
  3. Donald Trump, 2019 (acquitted); 2021 (term ended prior to trial)

Unable to discharge powers and duties

Article II of the Constitution, as amended in 1967 by the 25th amendment, lays out a process by which the Vice President can become Acting President if the President is “unable to discharge the powers and duties of his office.” This has not happened.

EDIT 2021-01-13: Impeachment has happened four times now.

EDIT 2021-01-20: Donald Trump’s term has officially ended via “lost re-election.”

Cyrus Smith lays a sick burn on Captain Nemo in Jules Verne’s “The Mysterious Island”

I’ve been reading Jules Verne’s L’île mystérieuse (The Mysterious Island.) It’s about a bunch of Civil War prisoners who escape in a balloon, find themselves marooned on a desert island, and by a slow application of engineering principles build up food, shelter, defense, and eventually a working telegraph system.
Oh, and it has Captain Nemo.
Near the end, the engineer Cyrus Smith and Captain Nemo have a face-to-face where Nemo spills his guts about why he removed himself from society. Cyrus then lays a pretty sick burn on him, which I think cuts to the heart of engineering philosophy, so I’m quoting it here.
The original French, from
Quelques instants de silence suivirent cette réponse, et le capitaine Nemo prononça de nouveau cette phrase:
«Que pensez-vous de moi, messieurs?»
Cyrus Smith tendit la main au capitaine, et, à sa demande, il répondit d’une voix grave:
«Capitaine, votre tort est d’avoir cru qu’on pouvait ressusciter le passé, et vous avez lutté contre le progrès nécessaire. Ce fut une de ces erreurs que les uns admirent, que les autres blâment, dont Dieu seul est juge et que la raison humaine doit absoudre. Celui qui se trompe dans une intention qu’il croit bonne, on peut le combattre, on ne cesse pas de l’estimer. Votre erreur est de celles qui n’excluent pas l’admiration, et votre nom n’a rien à redouter des jugements de l’histoire. Elle aime les héroïques folies, tout en condamnant les résultats qu’elles entraînent.»
La poitrine du capitaine Nemo se souleva, et sa main se tendit vers le ciel.
«Ai-je eu tort, ai-je eu raison?» murmura-t-il.
And an English translation, by Jordan Stump:
These words met only with silence, and again Captain Nemo spoke:
“What do you think of me, gentlemen?”
Cyrus Smith stretched out his hand and answered gravely:
“Captain, your mistake was to believe you could bring back the past. You struggled against progress, which is a good and necessary thing. This is an error that some admire and others condemn, but God alone can judge of its virtue, and human reason can only pardon it. A man who errs through what he believes to be good intentions may well be denounced, but he will always be esteemed. Some may find much to praise in your error, and your name has nothing to fear from the judgment of history. History loves heroic follies, even as it condemns their consequences.”
Captain Nemo’s breast heaved, and he raised his hand heavenward.
“Was I right, was I wrong?” he murmured.
Compare and contrast: Luddites, John Henry, Kasparov vs. Deep Thought/Deep Blue, et al.

Microsoft etiquette: calendar appointments when going out of office

A common convention within Microsoft when going out of office is to create two calendar appointments in Outlook:

  1. An appointment which allows people who are trying to schedule a meeting with you to know that you’re out of office at the time
    1. Attendees: just you
    2. Show As: Out of Office
  2. An informational appointment which allows people who work closely with you to know when you’re going to be out of office
    1. Attendees: people who work closely with you (e.g., your immediate team)
    2. Show As: Free
    3. Request Responses: Off
    4. Allow New Time Proposals: Off
    5. Reminder: None

I’m always forgetting one of the steps under 2., so I’m creating this blog post. Next time I go out of office I’ll remember to check this post.

Even if someone’s signaling right, they still have the right of way

I was driving to work this morning and I had an experience which vindicated my paranoia, and may even have passed it on to someone else.

I was heading East on NE 80th St approaching 140th Ave NE in Redmond. This is a two-way stop; drivers on 140th have the right of way and do not stop. Drivers on 80th (me) have to stop.

I came to a full stop and signaled right (I wanted to head South on 140th). A driver (let’s call him Sam) pulled up behind me, also signaling right. There were three cars heading South on 140th, all of them signaling right (they wanted to head West on 80th).


At this point I had a conversation with myself that went something like this.

Well, Matt, you could turn right now. All those cars are turning right, so they won’t hit you.
But wait, Matt. Those cars have the right of way. Sure they’re signaling right. But that doesn’t mean they’ll actually turn right.
Yup, you’re right, Matt. Better to wait to see what actually happens.

So I waited, and sure enough, all three cars actually turned right. So I suppose I could have gone. And more cars were feeding in to 140th from Redmond Way. And all of these cars were signaling right. And one was a school bus.

At this point Sam (remember Sam?) got impatient and honked his horn. This shocked me a little.

I imagine anyone who is from New York or Los Angeles is shaking their heads at me now. Not for waiting, but for being shocked. “He honked his horn? So what?”

(This is a cultural difference. In New York or Los Angeles, if you’re waiting at a red light, you will get honked at as soon as the other guy’s light turns yellow. But in Washington, the guy behind you will calmly wait through two full greens, then politely knock on your window and ask if everything is OK.)

I trust the school bus even less than the cars, so I let the school bus go.

The car behind the school bus is a minivan. He’s signaling right, too. But I let him go as well… and he goes straight!


Behind the minivan, there’s enough of a gap that I feel comfortable pulling out, so I do. And Sam pulls up to the line.

As I’m cruising down 140th, I glance in my rear-view mirror. I see a line of cars coming down 140th to the intersection I just left, all signaling right…

… and I see my friend Sam…

… patiently waiting.

May the Force be with you, Sam.

Translating Ada Lovelace – mathematical science is an instrument

Lady Augusta Ada, Countess of Lovelace is credited with being the first computer programmer.


The short version: her associate Charles Babbage gave a lecture on his Analytical Engine in Italy; an Italian engineer wrote up a report on his lecture, in French;
Lady Ada then translated the report into English, and added her own notes. Her own notes include a procedure for calculating Bernoulli numbers using the Analytical
Engine; it is this procedure which is regarded as being the first computer program, making her the first computer programmer.

Her translation and notes, in full

The program (very large image)

I was skimming through this and stumbled on this sentence which immediately struck me.

Those who view mathematical science, not merely as a vast body of abstract and immutable truths, whose intrinsic beauty, symmetry and logical completeness, when
regarded in their connexion together as a whole, entitle them to a prominent place in the interest of all profound and logical minds, but as possessing a yet deeper
interest for the human race, when it is remembered that this science constitutes the language through which alone we can adequately express the great facts of the
natural world, and those unceasing changes of mutual relationship which, visibly or invisibly, consciously or unconsciously to our immediate physical perceptions, are
interminably going on in the agencies of the creation we live amidst: those who thus think on mathematical truth as the instrument through which the weak mind of man
can most effectually read his Creator’s works, will regard with especial interest all that can tend to facilitate the translation of its principles into explicit
practical forms.
— Augusta Ada Lovelace

Wow, I thought.

That’s a heckuva sentence.

(I’m a sucker for the “connexion” spelling.)

… I have no idea what it means, though.

I reread it a couple of times until I thought I knew what it meant. (Go ahead. I’ll wait.)

I looked at the last few words: “the translation of its principles into explicit practical forms.” As a test I asked myself: “What does ‘it’ refer to?”

I didn’t immediately know, which revealed that I still didn’t really understand the sentence.

Gosh darn it, I said to myself, I’m going to lick this sentence. I didn’t resort to a sentence diagram, but I did a much more forceful attempt at parsing it.
Here’s how I rewrote it:

There are two ways to view mathematical science.

Most people are “normal”. Normal people view mathematical science as merely a vast body of truths. These truths are abstract and immutable. They have intrinsic
beauty, symmetry, and logical completeness. They connect together to form a whole. Normal people think that all profound and logical minds give a prominent place to
these truths.

But mathematical science possess a deeper interest for the human race. The natural world has great facts. Also, the creation we live amidst has agencies. These
agencies have mutual relationships which are unceasingly changing. Sometimes these changes are visible, or otherwise conscious to our immediate physical perceptions.
Sometimes they are not. Only the language of mathematical science can adequately express these facts, and these changes.

Some people are “geeks”. Geeks think that mathematical truth is an instrument. They think the weak mind of man can most effectually read his Creator’s works
through this instrument.

Sometimes a special kind of technique is discovered. These techniques tend to translate the principles of mathematical science into explicit practical forms.

Geeks are specially interested in all such techniques.

— Augusta Ada Lovelace, paraphrased

Rules for making change

It happens a million times a day.  Somebody pays cash for something and gets change.  But there are rules, and Raymond’s friend seems to like to break those rules.  Luckily for Raymond’s friend, one of the rules is the customer is always right… or as Mr. Krabs would say, the money is always right.  This blog post is about a couple of the more mathematical rules.

Rule for the cashier: you must give “canonical” change.

Whether to honor requests for non-canonical change is a complicated morass I will not attempt to tackle in this blog post as too much depends on context.  But the initial offering must be canonical.

By “canonical change”, I mean the cashier must give change using the smallest possible number of canonical coins and bills.  For example, (one quarter + one nickel) is a rendering of $0.30 using only two coins, while (three dimes) is three coins, so a cashier must never give change that includes three dimes.

By “canonical coins and bills” I mean (in the U.S.) this precise list:

  • penny
  • nickel
  • dime
  • quarter
  • $1 bill
  • $5 bill
  • $10 bill
  • $20 bill

I discuss usage of non-canonical (unusual) coins and bills later.

Rule 1 for the customer: “Tap, tap, no takebacks”

The tender and canonical change cannot intersect.

Don’t give the cashier anything they would just hand back to you directly.

This is the rule that Raymond’s friend broke – it just wastes everyone’s time to play musical chairs with the money.

Actually, this rule is just a corollary of the more general rule:

Rule 2 for the customer: “No side transactions.”

No subset of the tender can have the same value as any subset of canonical change for that tender.

Don’t give the cashier anything that they would just hand back to you in coalesced form.

If you want to consolidate your change, go to a bank or use one of those big machines.

Corollary 1: it is always OK to pay with a single large bill.
Corollary 2: it is always OK to give exact change.

Unusual denominations:

The two-dollar bill, the dollar coin (in any of its forms), the half-dollar coin, and bills higher than $20 are “unusual” denominations that complicate the situation slightly.

Rule for the cashier: Unusual denominations stay in the drawer.

Accept them (unless there are security rules at your place of business) but they are explicitly not part of any canonical change.

Rule for the customer: Go right ahead.

You can pay with an unusual denomination provided that you do not break the “no side transactions” rule or any large-denomination security rule at the business in question.


In the following examples, “total” is the amount owed; “tender” is the amount the customer gives to the cashier; and “change” is what the cashier gives back to the customer.

Total Tender Change Notes
$5.20 $5 bill + $2 bill $1 bill + three quarters + one nickel OK – cashier correctly accepted the $2
$5.20 $5 bill + $1 bill two quarters + three dimes Cashier gave out more coins than necessary
$5.20 $5 bill + $1 bill half-dollar + one quarter + one nickel Cashier gave out non-canonical half-dollar
$5.20 $5 bill + four quarters three quarters + one nickel Customer gave three “takeback” quarters
$5.20 $5 bill + quarter + nickel dime OK
$5.20 $5 bill + quarter + five pennies dime OK
$5.20 $5 bill + quarter + ten pennies dime + nickel Customer got nickel for five pennies in “side transaction”

In the last row, you can think of the “side transaction” as either five pennies for a nickel or ten pennies for a dime. I prefer the former.

Forcing Windows to install on a single partition

If you’re installing Windows via a boot DVD, and you choose Custom, you have the option to rearrange partitions.  I like to use this to have each drive be one big partition.

Windows 7 wants to set aside a 100 MB partition for something-or-other.  I’m sure there’s a very good reason for this but I am too lazy to look up the team that owns this space and ask them what it is.

So I’m in the “Where do you want to install Windows?” stage, I’ve gone into “advanced drive setup”, and I’ve deleted all the partitions.  Fine.  I then create a partition that fills the drive, and I get this popup:

Install Windows
To ensure that all Windows features work correctly, Windows might create additional partitions for system files.
OK | Cancel

After letting Windows finish installing, I jump into diskpart.exe and sure enough, Windows has created an additional partition.  A small one, to be sure… but an additional partition (horrors!)

Not being one to let Windows push me around, I decided to experiment, and came up with the following dance to allow me to just have one big partition thankyouverymuch:

  1. Boot from the Windows DVD
  2. Choose Custom (advanced) as opposed to Upgrade
  3. Go into Drive options (advanced)
  4. Delete all partitions on the drive
  5. Create a new partition – you will get the prompt above
  6. Click OK
  7. There will now be two partitions – a small (System) one and a large (Primary) one.
  8. Delete the large one.
  9. Extend the new one to fill the drive.
  10. Install Windows.
  11. Open Windows Explorer
  12. Right-click the C: drive | Properties
  13. Delete the “System Reserved” partition name

Et voilà, Windows installs perfectly happily on the single partition (confirmed with diskpart.exe post-installation.)

Tweaks I make every time I install Windows

As preparation for moving one of my machines from Vista to Windows 7, I’m compiling a list of all the little tweaks I like to make to machines that I use a lot:

Boot from the Windows DVD.  Delete all partitions; make each hard drive one big partition.  (Hmm… apparently Windows 7 really wants a second 100 MB partition.  Do the partition dance to force it into installing on a single partition.)

In the “password hint” box, type a misleading hint.

In “Help protect your computer and improve Windows automatically”, choose “Ask me later.”

Once I’m in, create a new limited user (not a member of the Administrators group) and use that as my primary account.

Control Panel | Hardware and Sound | Mouse
Pointers | Enable pointer shadow (uncheck)
Pointer Options
Enhance pointer precision (uncheck)
Hide pointer while typing (uncheck)

Right-click taskbar | Properties | Taskbar
Use small icons (check)
Taskbar location on screen (change to “Right”)
Taskbar buttons (change to “Never combine”)
Notification area | Customize
Turn system icons on or off
Clock | Off (select)
Volume | Off (select)
Network | Off (select)
… turn everything off, except sometimes.
(for example, I might leave Power on for a laptop.)
Always show all icons and notifications on the taskbar (check)
Use Aero Peek to preview the desktop (uncheck)

Windows Explorer | Organize
Layout | Details pane (uncheck)
Folder and search options | View | Advanced settings
Always show icons, never thumbnails (check)
Always show menus (check)
Display file icon on thumbnails (uncheck)
Display file size information in folder tips (uncheck)
Display the full path in the title bar (Classic theme only) (check)
Hidden files and folders | Show hidden files, folders, and drives (select)
Hide empty drives in the Computer folder (uncheck)
Hide extensions for known file types (uncheck)
Hide protected operating system files (Recommended) (uncheck, Yes I’m sure)
Show pop-up description for folder and desktop items (uncheck)

Control Panel | System and Security | Windows Update | Change settings
Download updates but let me choose whether to install them (select)
Allow all users to install updates on this computer (check)

Elevated command prompt | gpedit.msc | Local Computer Policy
User Configuration | Administrative Templates | Windows Components
Windows Explorer | Turn off numerical sorting in Windows Explorer (enable)
Computer Configuration | Administrative Templates
Power Management | Video and Display Settings
Turn Off Adaptive Display Timeout (Plugged In) (enable)
Turn Off Adaptive Display Timeout (On Battery) (enable)
Windows Components | Windows Update
Do not display ‘Install Updates and Shut Down’ … (enable)
Do not adjust default option to ‘Install Updates and Shut Down’ … (enable)

Control Panel | View by: Small icons (select)
AutoPlay | Use AutoPlay for all media and devices (uncheck)
Indexing Options | Modify | Show all locations
Offline Files (uncheck)
C:\Users (uncheck)
C:\ProgramData\Microsoft\Windows\Start Menu (uncheck)
Troubleshooting | Change settings | Computer Maintenance | Off (select)
Windows Defender | Tools
Automatic scanning | Automatically scan my computer (uncheck)
Real-time protection | Use real-time protection (recommended) (uncheck)
Administrator | Use this program (uncheck)

Right-click Start Menu | Properties
Computer | Don’t display this item (select)
Connect To (uncheck)
Control Panel | Don’t display this item (select)
Default Programs (uncheck)
Devices and Printers (uncheck)
Documents | Don’t display this item (select)
Enable context menus and dragging and dropping (uncheck)
Games | Don’t display this item (select)
Help (uncheck)
Highlight newly installed programs (uncheck)
Music | Don’t display this item (select)
Open submenus when I pause on them with the mouse pointer (uncheck)
Personal folder | Don’t display this item (select)
Pictures | Don’t display this item (select)
Search other files and libraries | Don’t search (select)
Search programs and Control Panel (uncheck)
Use large icons (uncheck)
Number of recent programs to display (set to 20 to make the menu bigger)
Number of recent items to display in Jump Lists (set to 20 to make the menu bigger)
Store and display recently opened programs in the Start menu (uncheck)
Store and display recently opened items in the Start menu and the taskbar (uncheck)

Right-click everything that is pinned to the taskbar
Unpin this program from taskbar

Right-click Recycle Bin | Properties
For each hard drive in turn (select)
Don’t move files to the Recycle Bin. Remove files immediately… (select)

Control Panel | Appearance and Personalization
Personalization | Change desktop icons | Recycle Bin (uncheck)
Change desktop background
Picture Location: Solid Colors (select, choose black)

Control Panel | User Accounts | Change your account picture
Browse for more pictures

Control Panel | Ease of access
Change how your mouse works
Mouse pointers | Regular Black (select)
Prevent windows from being automatically arranged when moved to the edge of the screen (check)
Change how your keyboard works
Set up Sticky Keys | Turn on Sticky Keys when SHIFT is pressed five times (uncheck)
Optimize visual display
Turn off all unnecessary animations (when possible) (check)

Make a folder on the desktop named “_”
Open the following folders simultaneously
C:\ProgramData\Microsoft\Windows\Start Menu
C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu
Copy various shortcuts from Start Menu over to _
Command Prompt
… whatever else strikes my fancy
… as I install programs, consider adding them here if I use them a lot

Right-click the taskbar | Toolbars | New toolbar… | Desktop | _ (Select Folder)
Right-click the taskbar | Lock the taskbar (uncheck)
Drag the thumb of the _ toolbar to the top of the taskbar
Right-click _
Show Text (uncheck)
Show title (uncheck)
View | Small Icons (check)
Drag the taskbar to be a tiny bit wider so three small icons fit side-by-side
Drag the view-active-tasks part of the taskbar to be big
Right-click the taskbar | Lock the taskbar (check)

Make a 1-pixel-by-1-pixel black .jpg and set it as the LogonUI background

I’m sure I’m forgetting some other things.  I’ll add them later when I run into them.

I could probably make a series out of this.  Possible candidates for future posts: “Tweaks I make every time I install Office”, “Tweaks I make every time I install Firefox”…

Command Prompt | Alt-Space | Defaults | QuickEdit Mode (check)

The more experience I get the more I like to try new things

There is a general pattern in professional people.  We start out idealistic and adventurous, and as disasters inevitably accumulate we become more circumspect and pessimistic.

(Pre-emptive snarky response: “you say that like it’s a bad thing.”)

While pessimism is invaluable to a tester, it should be tempered with a just sense of hubris.  Larry Wall’s saw about the three virtues of any great programmer has a historical antecedent from one of the canonical American authors:

We should be careful to get out of an experience only the wisdom that is in it — and stop there; lest we be like the cat that sits down on a hot stove-lid. She will never sit down on a hot stove-lid again — and that is well; but also she will never sit down on a cold one any more.
    — Mark Twain, Following the Equator

Keep your childlike optimism.

If you see a fact, try to see it as intuitively as possible

Insight is a tricky thing.  To a certain degree people are born with it (or without it) – but if you are gifted with a measure of it, you can develop it (as though it were a muscle) by working at it.

The late mathematician George Pólya had a number of helpful problem-solving mottos, one of which is the title of this post.  There’s a nice echo in the chess world, where the maxim “If you see a good move, wait – look for a better one!” is popular (as is the simpler version, “Sit on your hands!”)

The granddaddy of them all is William of Ockham’s “entia non sunt multiplicanda praeter necessitatem“… AKA, Occam’s [sic] Razor.

KISS, as they say.

What am I going on about?

In the Computer Science world, it happens very often that your first idea… though it works… is inferior to your second idea.  A great tragedy that is played over and over is:

  1. Developer is faced with a problem.
  2. Developer has brilliant idea.
  3. Developer starts coding.  And coding.  For hours.  Straight.
  4. After a few hours developer pauses.  Hmm.  Developer has better idea.
  5. Developer goes back and hacks up what they wrote to implement the better idea.
  6. Goto step 3.
  7. Catch out-of-time exception.  Finish the latest iteration as quickly as possible.  Ship it.

I’m exaggerating a bit by calling this a great tragedy.  It’s also a perfectly good development strategy to begin coding with the knowledge that you will probably come back and redo a large chunk of what you’re doing as you become more familiar with the problem domain.  The key words here are “with the knowledge“… if you know that what you’re coding is experimental, you can avoid a lot of scheduling Sturm und Drang.

Bottom line: it happens frequently that a good idea has a better one as a sequel.  Keep your eyes open… are you solving a specific case when you could, with less work, solve the general problem?  Look at your fixed code fresh – are you introducing another problem with the fix?  Is there a more appropriate way to fix the problem?  Is it better to fix the symptom instead of the disease?  Stop and think.  Even if you don’t find a better way, it’s good exercise for your noodle.