Ryan Beck
  • The Library of Congress Tells Me About Corporal Punishment

    April 10, 2023

    I’ve been reading Empire of Liberty: A history of the Early Republic, 1780-1815 by Gordon S. Wood and while it’s full of fascinating information one passage in particular recently caught my eye:

    In Massachusetts in 1785 a counterfeiter was no longer executed. Instead, he was set in the pillory, taken to the gallows, where he stood with a rope around his neck for a time, whipped twenty stripes, had his left arm cut off, and finally was sentenced to three years’ hard labor.

    The context here is the decline in corporal punishment for crime, which had apparently been the dominant form of punishment, and its replacement with imprisonment. The next paragraph:

    Although most states did something to change their code of punishment, Pennsylvania led the way in the 1780s and 1790s in the enlightened effort, as its legislation put it, “to reclaim rather than destroy,” “to correct and reform the offenders” rather than simply to mutilate or execute them. Pennsylvania abolished all bodily punishments such as “burning in the hand” and “cutting off the ears” and ended the death penalty for all crimes except murder. Instead, the state proposed a scale of punishments based on fines and years of imprisonment.

    We can see the sentiment that led to the 8th amendment developing here (banning cruel and unusual punishments, adopted in 1791).

    Going back to that first quote, one portion especially stood out to me:

    had his left arm cut off

    This seemed far and away beyond anything I imagined occurring in that time period in the US. I know tarring and feathering was happening, and one of my general takeaways from the rest of Empire of Liberty is that 18th century “civilized” society was downright barbaric. But still, tarring and feathering was usually associated with mob violence, and state sponsored corporal punishment — especially the forced parting with one’s own arm — did indeed seem shocking to me.

    Tarring and Feathering
    Metropolitan Museum of Art, CC0, via Wikimedia Commons — more historical information about this image available from the Library of Congress

    All of it seemed extreme, such as burning hands and cutting off ears, but cutting off an entire arm? I had to know more. So I skimmed and cntrl+f’d my way through the sources referenced in that section of Empire of Liberty and came up short. I couldn’t find anything as extreme as cutting off an arm mentioned.

    While my own research skills failed me, I was pleased to find in my search that the Library of Congress provides an Ask a Librarian resource, where you can submit a question to one of their specialists. So I did, and I was delighted to get the following detailed answer in response, with the relevant segment shared in full (and lightly formatted):

    Consulting Wood we found the passage you quoted on page 493.

    We next consulted Laws of the Commonwealth of Massachusetts from November 28, 1780 to February 28, 1807, 3 v., Boston, J. T. Buckingham for Thomas & Andrew, 1807. In July 1786, a law was passed, repealed in 1805, “against counterfeiting or uttering counterfeit coin”. In section 1 the law stipulates:

    …That if any person shall forge or counterfeit an silver or gold money or coin, the currency of which is or shall be established and regulated by law, or shall forge or counterfeit any silver or gold money or coin that is or shall be current in this Commonwealth, he shall be fined at the discretion of the court; be set in the pillory for the space of one hour, and then have one of his ears cut off; and from thence be drawn to the gallows, and set thereon with a rope about his neck for the space of one hour, and shall be whipped, not exceeding forty stripes, and shall be sentenced to hard labor for a term of not more than seven years. — Act of July 4, 1786, vol 1, pp 329-332

    As mentioned the law was repealed in 1805. In the subsequent law the matter of punishment for counterfeiting coins was addressed in section 6 as follows:

    …That if any person shall forge or counterfeit, or shall procure to be forged or counterfeited, or shall willingly aid or assist in forging or counterfeiting any gold or silver coin, current within this Commonwealth, by the laws or usages there of; or if any person, knowing of such forging and counterfeiting, shall willing aid or or assist in passing and rendering current as true, and such forged or counterfeit coin, and for that purpose shall, at any one time, possess any number not less than ten or similar pieces of false money or coin, forge and counterfeited to the similitude of the gold or silver money or coin current as aforesaid, with intent to utter the same as true, knowing the same to be false, forged and counterfeit, every person so offending in either of the particulars aforesaid, who shall be convicted thereof in the Supreme Judicial Court, shall be punished by solitary imprisonment, for a term, not exceeding one year, and by confinement afterwards to hard labour for and during his or her life. — Act of March 15, 1805, vol. 3, pp. 277-281

    We can found nothing about cutting off an arm as punishment for counterfeiting. Although capital punishment for counterfeiting was imposed in Massachusetts and other colonies during the 18th century since under English law the act was considered to be treason, it was discontinued later in the century. We reviewed Edwin Powers Crime and Punishment in Early Massachusetts, 1620-1692: A documentary history, Boston: 1966. On page 307, in a section on treason, Powers documents that the crime included

    …or to counterfeit the kings great or privy seal, or the seal of this province. — (citing Prov. Laws ch. 12, 1696)

    Powers mentions this law was amended during the War for Independence to make supporting the crown a capital crime.

    We also reviewed articles by Gordon Wood in the database America: History and Life with full text, but no reference could be found.It is possible that Wood examined early court records but did not provide a citation.

    We next searched Hein Online : State Reports a Historical Archives for the term “counterfeit” and the years 1770-1800. Although 46 cases were located none were from Massachusetts. We advise you to contact the staff of the library at the American Antiquarian Society, who might have other insights or resources. We hope you find this information helpful and wish you the best in your research.

    Dang, it’s amazing to me that I can send an email off to an expert employed by the government and get such an in-depth response! I haven’t followed up with the American Antiquarian Society as I’m not sure how much more time of these wonderful experts I should waste on this passing interest of mine. My current feeling is that the lopping off of arms for counterfeiting most likely didn’t happen in the US during that time and that some kind of error occurred in writing of the originally quoted passage. Though I realize I haven’t done nearly enough research to make that assertion with confidence, so please accept a heaping helping of salt along with my opinion.

    By the way, I definitely recommend Empire of Liberty to anyone interested in US history at the close of the 18th and beginning of the 19th century. It’s given me a whole new appreciation for the modern state of our politics and society, and as much lamenting as there is about the hostile state of our current political environment I think it’s refreshing to see still more evidence that everything old is new again, even when it comes to politicians being completely childish towards one another.

  • A Noob's Guide to Github Actions

    February 10, 2022

    I have a few Rmarkdown scripts that I’ve created to visualize data for forecasting. I host them on Github so they appear as html pages on my website. I’ve been looking for a way to automatically render those Rmarkdown files every day instead of manually running and uploading the updated html file to Github, and someone suggested I try Github Actions. This turned out to be the perfect solution, but it took a lot of head scratching and confusion on my part to get it going. So here I’m documenting in detail everything I learned from the perspective of a novice muddling through it. There are other guides out there from people who have more knowledge of Github, Github Actions, and R, but as I looked at these guides I felt that there were gaps where they were either discussing things above my level of understanding or things didn’t apply to my situation. I’m hoping that by documenting what I’ve learned here it will help other noobs learn and setup their own Github Actions more quickly, and also that I’ll be able to use this guide myself when I inevitably forget how my setup works.

    References and Helpful Sources

    Before digging in, a few things are worth mentioning and linking up front so they can be referred to. First are the guides I used to piece this all together. I’ve included a TL;DR as well, if the TL;DR sounds like it fits perfectly with what you need to do feel free to jump on over and ignore everything else I have to say.

    • Source: Running R Scripts on a Schedule with GitHub Actions
      • TL;DR: A great overview of all the steps of creating an R script, putting it into a package, uploading the package to Github, and creating a Github action to schedule it. It gave me a great starting point but it was too light on explanation, didn’t really specify what was actually happening at a basic level, and used a procedure that at the end I felt was more complicated than I needed.
    • Source: Rendering your README with GitHub Actions
      • TL;DR: This one is based around creating an Rmarkdown file that will be used to update the README in their Github repository automatically. This one filled in a few more pieces about syntax and helpfully describes what’s happening in certain parts of the process, but there were still parts that I didn’t understand, background I felt like I was missing, and it didn’t give me all the information I needed to complete my Github Action.
    • Source: R-lib Actions
      • TL;DR: A Github repository with a bunch of actions and examples for using Github Actions to run R scripts and files. This one was particularly useful for figuring out syntax or what specific commands were doing, but it’s somewhat light on descriptions so is mostly useful for templates and added context.

    Those are the main sources of useful information related to Github Actions I found. But there are some additional helpful tools and sources I’ve mentioned in the following guide that I’ll link here. These might be meaningless to anyone reading this who isn’t familiar with this stuff, but I think it will be useful to have some of the more important links up front and all in one place for referring back to later.

    First Step - Making a Simple Package

    Once you have an R file you want to regularly run using Github Actions, whether it’s a script or an Rmarkdown document, the first thing you need to do is make a package. This is simpler than it might sound. There are several different package formats, but we only care about the simplest one. It’s essentially your R file placed in a folder with a few other basic files nearby. You make a folder, name it what you want your package name to be, and the inside of that folder will end up looking like this:

    Package Folder Structure
    Package Folder Structure

    Your R script or Rmarkdown file will go inside the “R” folder shown. The DESCRIPTION and NAMESPACE files just contain information about the package. We probably don’t even need the NAMESPACE file, but it doesn’t hurt to keep it either. We do need the DESCRIPTION file though, because we’ll use that for telling our Github Action what packages our R code needs.

    To build your package you can either just manually create or copy the folder structure I’ve shown, or follow one of the procedures to generate a package I linked in the references section above. I recommend just copying and editing, feel free to download and copy my files (you can use the Github directory downloader I mentioned in the references section to download them).

    The DESCRIPTION and NAMESPACE files can be edited as text documents in Notepad or your preferred text editor. One of my DESCRIPTION files looks like this:

    DESCRIPTION File Contents
    DESCRIPTION File Contents

    You can edit the yellow highlighted information as you please, that’s just stuff that’s supposed to be information if someone else were to use or look at the package. The “Package” line should be changed to the name of the folder you put the DESCRIPTION and NAMESPACE files and “R” folder in because that’s the name of your package. The green highlighted lines under imports is what we really care about. We’re going to reference this stuff in our Github Action to tell Github what packages it needs to load to run our R file. Anything you call in your R script or Rmarkdown document with library() (e.g. library(tidyverse)), should go here. Otherwise you won’t have the proper libraries loaded to run your script.

    Once you’re done editing the DESCRIPTION file you can save it as a .txt file and then rename it to delete the .txt extension. The NAMESPACE file in my packages just contains this: exportPattern(“^[[:alpha:]]+”). I don’t know what that means or what that does. According to this it’s just something that helps R packages talk to each other. The text in that file was just what was there when I generated a package in RStudio. I don’t think we really need the file, but it doesn’t seem to be hurting anything either so I left it there.

    Side note: When creating a typical R package for others to use, you’re generally not supposed to leave library() calls in your R script. It sounds like this can create errors for package users. However, I don’t think we care about this because our intent isn’t to distribute the package for others to use, we just want to put our R file in a package so it will be run automatically. If you intend to create a more traditional R package for distribution and others to use you probably need to take a deeper look at whether you’re following the appropriate best practices.

    Once the files are edited, your package folder is named appropriately, and your R file is placed in the “R” folder the next step is to upload the package to Github. Just place it wherever in your Github repository you like.

    Create a .Github/Workflows Directory

    Make a new folder called “.Github” in the root directory of your repository. It has to be in the root, otherwise it won’t work. Then in the “.Github” folder make a folder called “Workflows”. This is where the .yaml files that define the workflows to be completed automatically will go. You can see the .Github/Workflows directory in my repository for an example.

    Create a Github Action

    Next we’ll create the .yaml file that will define the Github Action. I’ll walk line by line through mine and try to explain my understanding of what each is doing.

    Github Action Lines 1 through 16
    Github Action Lines 1 through 16

    First up, line 1. The “on:” line tells Github what will trigger the action. There are multiple ways to trigger your action, such as by looking for a recent push to your repository or many other types of events. Mine is using a schedule, which runs at specified intervals based on cron syntax. My lines 1 through 3 tell the Github Action to trigger at 7 PM every day (in UTC, the timezone used on Github). You can tell it to run at time intervals instead if you want, such as by entering “*/10 * * * *” which would tell it to run every ten minutes (the most frequent Github allows is every 5 minutes).

    At line 5 I define a job. Each Github Action can have multiple jobs if you want, and the jobs will run in parallel (at the same time) if you define more than one. Line 6 is just what I’ve decided to call this job. Instead of “render’ you can put anything you want there, like “create-pizza-order” or whatever you want to describe your job as. Line 7 defines what Github runner will be used. But instead of directly defining it on this line the “${{“ syntax means it’s referring to a variable defined elsewhere, in this case it’s referring to “matrix.config.os” which is a variable defined on lines 13 through 15. Line 7 is telling the Github Action to run on the Github runner “windows-latest”. That means that you’re choosing which virtual environment to run your commands on, in this case it means our R script or Rmarkdown file will run on that environment. You can choose from several options such as different Mac, Ubuntu, and Windows environments. I suggest using what you run locally. The example I followed used an Ubuntu environment, and I initially just kept that as is until I realized it was giving me errors because I didn’t have a certain package defined in my Rmarkdown document that it needed to work on an Ubuntu system.

    I’m not entirely sure of the purpose of the “name” entry on line 9, but I think all it does is set the name for the job for display somewhere on Github. In this case the name is set to show the operating system and the release of R used for the job.

    Next up is lines 11 through 15. I don’t fully understand the purpose of the “strategy” section here. According to the Github documentation it’s one of the “contexts” available that can be used for different purposes. In this case I’m not sure if it’s really necessary, but within the strategy section several variables are defined for use elsewhere, such as the OS and R version. The “fail-fast” option seems to be something that could cancel all in-progress jobs if one of your matrix jobs fails. I don’t know what that means and as far as I can tell there isn’t a matrix job actually happening here, so I’m not sure if this section is really necessary but I left it in from the example I modified since it seems to work fine without removing it.

    Github Action Lines 17 through 34
    Github Action Lines 17 through 34

    Onto line 17. The “env” portion is another context where certain variables are set. Some of these variables just seem to be what I’ll call “trust me” variables, as in “a bunch of examples do it this way so just trust that they’re right”. If you care about why or are suspicious they’re causing you trouble here’s some more info I found about each:

    • R_REMOTES_NO_ERRORS_FROM_WARNINGS: If you’ve installed packages in R before you’ve probably seen some warnings pop up, this keeps those warnings from turning into errors that could mess up your Github Action.
    • RSPM: RSPM seems to stand for “R Studio Package Manager”. I don’t think this line is necessary, but also it’s not hurting anything so I’m leaving it in. In other examples it seems to be calling a variable set under the matrix section, like we did with the OS. But the example I followed didn’t set an RSPM variable so I’m fairly sure it’s doing nothing, but I also haven’t tried to take it out. ¯\_(ツ)_/¯
    • GITHUB_PAT: This line seems to work some Github Actions magic that I don’t know the reason for, other people say that it helps and to put it there so why not.

    The variables on lines 21 through 24 are ones I created. You’ll see how I use them later on, but basically I’m just putting the path and filename I want up front so I can copy this workflow and change only those variables the next time I want to automate an R file. I don’t actually use the variables on lines 23 and 24, they’re commented out using “#”.

    Line 26 begins the “steps” section. Actions run as steps, and in this section you can give each action a name and run that action. First it defines some of the tools it “uses”. That’s what’s happening on lines 27 and 29. Line 27 uses a tool that lets this workflow check out a repository and line 29 sets up the R environment for use in actions. Note that the “@master” portion seems to specify what branch of the “setup-r” tool we’re looking at, it’s kind of like a version signifier. The current version seems to be “v2”, but according to this thread since the branch was renamed from “master” and has eventually become “v2” Github automatically redirects from “master” to “v2”. So that’s why “master” still seems to work. It sounds like the proper naming might be “v2” but master seems to work fine. If you have trouble and trace it back to that being the source it might be good to try “v2” instead.

    Lines 30 through 32 define some settings for the “setup-r” action. “With” means line 29 will use info provided on lines 31 and 32. Line 31 sets the version of R we want to use and references the variable previously defined under the matrix section on line 15. I’m just using “release”, which seems to default to the latest available version, but you can specify other versions if desired. Line 32 sets an “http-user-agent” setting used by the “r-setup” tool, but references a variable under the matrix section that we never defined, so I’m not sure if it’s actually doing anything but I’m leaving it in there in case it is.

    Line 34 sets up Pandoc, which is something used to generate Rmarkdown output. If you want to know more about it this is a useful explanation.

    Github Action Lines 36 through 57
    Github Action Lines 36 through 57

    Finally we’re getting to the interesting stuff. Line 36 is our first named step that will start doing something useful. I mostly just left the names as-is from the example I followed. In this case we’re querying dependencies, which means looking at what packages our R file needs. First this step gets a name on line 36. Then we define the working directory. This line references the variable in the “env” section we set. We want to set the working directory to the folder of our R package. In my example my R package is called “FluPackage”, so I set the working directory to “./forecasting/FluPackage”.

    When we’re defining paths and directories, it’s important to know how to start them. The “./” at the beginning means we’re starting in the current working directory. For our Github action that means we’re starting in the root directory of our repository. That’s where we want to start, but I use other starting locations elsewhere so we’ll want to know what they mean. Based on this resource here’s the important ones to know:

    • ”/” = root directory (top level of all your folders)
    • ”./” = current working directory
    • ”../” = parent directory (one folder up from the current working directory)

    On line 38 we enter the run command which tells our action to execute commands. The | after “run:” just means there are multiple lines to this run command and tells it to look at the lines below. Something important to know is that the “shell: Rscript {0}” on line 43 tells this step what shell to use. I don’t fully understand it, but my impression is that the different shells are just the core computer languages you can choose from. Specifically, line 43 is using a command to specify a custom shell for R files. That’s all we need to know, since we setup the R environment in previous commands it’ll recognize that we want to run R commands.

    The actual contents of this step on lines 39 through 40 are just installing two packages that are needed. Those lines are important. The lines 41 and 42 aren’t really being used. What they’re doing is using some R commands to look at the dependencies in our package (based on the DESCRIPTION file) and writing them to a “depends.Rds” file that can be referenced later. But this file only gets used in the “Cache R Packages” step on lines 51 through 57, which I’ve commented out because I wasn’t able to get it working and it’s not critical unless you really care about how long your Github Action is taking to run. If you do care about that you’ll have to do some more digging because I couldn’t figure it out, I suggest starting with this article that I started from, he succeeds at getting his packages to cache.

    I’m keeping lines 41 and 42 in because I don’t want to accidentally break anything if I take them out, and I want them there in case I decide to try to fix the caching section someday. But lines 39 and 40 are important, they’re packages that do get used later, so if you tweak stuff don’t delete those. You can see where packages have been used when you see the name of the package followed by “::”, such as “remotes::dev_package…” on line 41.

    Lines 45 through 49 constitute the next step, where we install another package we need, the “rmarkdown” package. If you aren’t using Rmarkdown files for this you probably don’t need that installed, and some of the later steps may need modified since you won’t actually be rendering an .Rmd files.

    Github Action Lines 59 through 80
    Github Action Lines 59 through 80

    Next on lines 59 through 63 we install dependencies. This section will look in our working directory, find the package there, and look in the DESCRIPTION file to see which dependencies are there. It does that on line 62, where it uses the “remotes” package to look for and install these dependencies. Again, the working directory on line 60 should point to our package so that the install dependencies command is looking in the correct place.

    Lines 65 through 69 are where the Rmarkdown file in the package actually gets rendered. I set the working directory to the package location, then it runs the render command and I specify the necessary inputs to that command. First I specify the file to be rendered. On line 22 I had set that as “R/Flu_Hospitalizations.rmd”. The working directory is already set to the package, so all this is doing is say go to the file in the “R” folder in the package. Then I specify that I want the output to be html, and that I want the output directory to be in the parent directory, which means one folder above the working directory. You may have to adjust these if you want it to output elsewhere.

    Lines 71 through 80 commit the files. When the files are run and output is created the output needs to be committed to appear in your Github repository. Initially my strategy here was to commit the specific output file by name, but that didn’t seem to be working so I just made it commit all the files. Because it’s just committing everything I commented out the working directory, since I believe this will commit everything in my repository that needs committed regardless of where it is. Line 74 is just a command to output the top level of the “working tree”. I don’t fully understand what a working tree is, but basically it just outputs what the current working tree is so that I could check and make sure I was operating in the right place when I was having issues committing my files, but ultimately it didn’t end up being all that useful. Lines 75 and 76 were in the example I followed, and I believe they basically just create a bot that will do the committing. Not sure exactly, but I suggest leaving them as-is.

    Line 77 adds all files with changes to the “staging area”. There are different add commands as described in detail here, but the “–all” just adds everything with changes. The staging area basically means stuff that’s ready to be committed. Line 78 will just output the status, which means it’ll show what the status of the uncommitted files is in the working directory and staging area.

    Line 79 commits the changes. The output files should now show up in the repository. The “-am” is a combination of “-a” and “-m”. The “a” essentially means all and the “m” means message, which means it’ll make “Scheduled Update” appear as the message in Github. The “||” was hard to figure out at first because Google isn’t the best with symbols, but this is called a “double pipe” and basically means “OR”. Commit the files OR if there’s nothing to commit output (I believe that’s what “echo” means) “No changes to commit”.

    Line 80 pushes the commit to the remote server. That’s kind of gibberish to me, but I think (based on a handy explanation here) it means that the files we’ve committed have been committed on the virtual environment we created (the “windows-server” or whatever), but still need to be pushed to Github itself. The “origin” part of this is confusing to me, but it has something to do with Github branches. And again, if there’s nothing to push we get the echo output “No changes to commit”.

    Github Action Lines 82 through 88
    Github Action Lines 82 through 88

    Finally, the last step starting on line 82 just creates some session info logging for us. Not entirely sure how it works and I don’t think I’ve really used it, but might be helpful for anyone trying to troubleshoot stuff.

    Monitoring and Troubleshooting

    That’s pretty much the breakdown of the Github actions. The last useful thing to know is that Github logs each step of your action as it executes, and you can look through that to see where things went wrong. The top menu on Github has an “Actions” tab that you can look at to see the status of your actions.

    Github Actions Tab
    Github Actions Tab

    You can see your workflows there, and if you click on one of the completed workflows you see this:

    Github Workflow Summary
    Github Workflow Summary

    You can click on “1 job completed” and then again on the name of the virtual environment it ran in and you’ll see this:

    Github Workflow Log
    Github Workflow Log

    You can expand each step and see a log of what happened. If your Github action failed you can check out the first one that shows up with a red X and try to diagnose why from that. If you’re having trouble I suggest making changes and then setting a cron schedule to run the action every 10 minutes so the action will trigger again soon and you can see if your changes have managed to fix things.

    Okay Bye

    That’s pretty much everything I’ve managed to figure out when trying to make a working Github Action. So far it’s been successful, I have two Github Actions in my “workflows” folder and they run without errors once per day on their own. If you’ve made it this far I hope this has helped you!

  • Afghanistan Uncertainty

    August 27, 2021

    I’ve been increasingly frustrated with the public conversation around Afghanistan. The whole situation is a tragedy, and instead of sober reflection on the situation we got ourselves into the public conversation has predictably become nothing but political finger pointing. Those flinging blame at this point appear to be selectively attacking only their political enemies and defending their political allies. But the failures have been bipartisan, and I think we should all be ignoring the people who are currently using this horrible situation as a tool to attack their political enemies.

    Every additional piece of information I’ve read about what’s been going on in Afghanistan makes me less sure what the right solution was. I think uncertainty is often the opposite of partisanship, so in the hopes of spreading some uncertainty I’ve tried below to provide some of the most useful information I’ve seen. I’ve tried to keep it light on opinion and I’ve also tried to include sources for everything I’ve said here.

    In February of 2020 the Trump administration negotiated with the Taliban and signed the Doha Agreement [1] [2]. This agreement specified that the US would withdraw all its forces by May of 2021, and in exchange the Taliban agreed to prevent any threats against the United States and its military originating in Afghanistan. Additionally, the agreement specified that the Afghan government would release 5,000 Taliban prisoners, and the Taliban would release 1,000 Afghan government soldiers they held prisoner. The Afghan government was not a party to this negotiation.

    After the agreement the Taliban ceased attacks on US led forces in Afghanistan. You may have seen people saying that no US soldiers had died in Afghanistan since February of 2020. This is why. Wikipedia has a count of US soldiers killed in Afghanistan by month and you can see there are no deaths since February of 2020 [3]. However, according to [1], the Taliban continued and even increased the frequency of attacks against the Afghan government after the agreement was signed. It just stopped attacking US led forces.

    Biden became president in January, and in March he publicly stated that the US may miss its May withdrawal deadline [4]. Biden cited difficulties in the presidential transition process as the reason saying “The failure to have an orderly transition from the Trump presidency to my presidency… has cost me time and consequences.” On April 13 Biden announced that the date of full withdrawal would be moved to September 11th, the 20 year anniversary of the September 11th attacks. [5]

    In May, General Mark Milley, chairman of the Joint Chiefs of Staff, said plans were being created to evacuate Afghan allies such as interpreters, if necessary. Additionally, the State Department was stated to be processing Special Immigrant Visas (SIVs) in Kabul for Afghans. [6] Also in May, Zalmay Khalilzad, U.S. special envoy to Afghanistan and lead US negotiator on the February 2020 Doha Agreement with the Taliban, said “We don’t want to signal panic and the departure of all educated Afghans by worst-casing and undermining the morale of the Afghan security forces… I personally believe that the statements that [Afghan] forces will disintegrate and the Talibs will take over in short order are mistaken.” [7]

    In June the US intelligence community stated that they believed the Afghan government could fall between 6 and 12 months after US forces withdrew, revising from a previous estimate of approximately 2 years [8]. On August 16th the Taliban captured Kabul, the capital of Afghanistan, before US troops had completed their withdrawal. [9]

    I tried to keep the above as close to the evidence and available information as possible, but of course there will be bias in what I’ve considered important enough to include. I’m also just learning about all this myself, so keep in mind someone who has carefully studied this more closely and for longer will have other information that would be important to consider. The rest of this will be my interpretation of the above and will obviously be based more on my opinion.

    The whole thing is a mess, and in my opinion it seems very unclear that we could have left Afghanistan without chaos ensuing. At the same time, in hindsight it also seems very likely that we could have left in a better way, but I’m not sure if anyone really could have foreseen some of these unexpected consequences.

    The Doha Agreement was responsible for the reduction in attacks on US soldiers in 2020. In the few years prior to the Doha Agreement on average about one US soldier was killed in action per month [3]. But what’s not clear to me is what would have happened if Biden had decided to cancel the withdrawal entirely or delay it for significantly longer. It seems likely to me that the Taliban would have seen this as a violation of the agreement and restarted attacks against the US, resulting in US soldiers being killed again. In my opinion the Taliban signed onto the Doha Agreement in the first place because they knew once US troops were out of the way they would eventually gain control of Afghanistan. If US troops instead remain in violation of the agreement, why wouldn’t the Taliban continue or renew its attacks and try to regain territory? Some opinion pieces in April were arguing the same. [10]

    Biden chose to take US troops out, though he delayed the withdrawal to try to prepare more. Obviously that failed. Could he have prepared better? I think so. I think Biden, the intelligence community, and everybody involved should have had a better contingency plan in place for a sudden takeover by the Taliban. But to me it seems like nobody saw this coming and therefore did not plan effectively for this possibility. The intelligence community thought 6 to 12 months in June. The US envoy to Afghanistan, Zalmay Khalilzad, basically said they didn’t want to begin mass evacuations because that could start a panic and demoralize the Afghan forces, and that he believed they would hold out. So in the administrations mind the Afghan government would hold out for some time, so they would have time to get US citizens and Afghan allies out, and if they tried to do that too quickly it could demoralize the Afghan government and military and lead to an earlier collapse.

    I think the sudden collapse of the Afghan government surprised everyone, so I don’t know how much blame should be placed solely at the feet of the Biden administration for this bad forecast. Certainly some. But don’t believe anyone that tells you this was foreseeable unless they have receipts. Hindsight is easy, figuring out what’s likely in advance is hard. As proof that no one expected this I can point to a related question which was on Good Judgement Open, a forecasting platform where people compete to try to have the most accurate forecast of what’s likely to happen. This question asks if the US will evacuate or lose control of its embassy in Kabul before December 1, 2021. [11] You can see the crowd forecast in the picture below. The crowd was at less than 10% chance all the way up until August 9th, just a week before Kabul fell. 91 people forecasted on that question (I did not, though I’m sure I would have assigned a low probability like the majority of them did). And keep in mind the question asked if it would happen before December, so these forecasters expected the embassy to stay under US control at least two and a half months after the September 11th withdrawal deadline Biden had set.

    Good Judgement Open Kabul Embassy Forecast
    Good Judgement Open Kabul Embassy Forecast

    I think Biden has mainly failed in a couple ways. One is lack of preparation for the possibility of a swift collapse of the Afghan government. It seems like not enough planning was done for this possibility because everyone expected the Afghan government to last at least a few months. Another big failure is setting the withdrawal date as September 11th. This was purely a political date, meant to coincide with the 20th anniversary of the September 11th attacks. Some have argued pretty convincingly that the withdrawal should have waited for winter because the Taliban typically withdraws back to bases in the winter at the end of the “fighting season” in the summer. [12] The link at [12] has a larger criticism of the things the author thinks Biden did wrong and is definitely worth a read.

    The other main failure I think is a bipartisan one, which is not immediately committing to taking more Afghan refugees. The number of Afghan refugees the US will admit has apparently not yet been decided, but there is concern that Biden will shy away from taking a significant amount of Afghan refugees due to the political opposition against refugees from certain Republicans such as Trump and his supporters. [13] I hope that’s not the case, and according to the link in [13] some Republicans such as Mitt Romney, Joni Ernst, and others have come out in favor of welcoming Afghan refugees, which I’m glad to hear.

    Aside from the things I mentioned above, what were our other options and did anyone see this coming? I don’t really know for sure. Mitch McConnell in April released a statement criticizing Biden’s decision to pull out of Afghanistan saying “A reckless pullback like this would abandon our Afghan, regional, and NATO partners in a shared fight against terrorists that we have not yet won.” [14] The statement also mentions that he’d previously criticized the Trump administration for their decision to agree to withdrawal. Arguably this could be seen as a prediction of bad consequences, but it’s vague enough that we can’t say exactly what he thought would happen. His solution was to stay in Afghanistan indefinitely, as seen from this quote from his statement “Foreign terrorists will not leave the United States alone simply because our politicians have grown tired of taking the fight to them. The President needs to explain to the American people why he thinks abandoning our partners and retreating in the face of the Taliban will make America safer.”

    I don’t think staying indefinitely is a good option, and I think most people agree with that. People are tired of a war dragging on for 20 years, and there was bipartisan support for leaving, as evidenced by the fact that Trump signed an agreement that we would leave and Biden followed through on it. I’m fairly certain that had we not left the same people criticizing Biden right now for the Afghanistan debacle would be criticizing him for not leaving. It seems like a situation with no good outcomes. We can and should expect better of our government, but at the same time governments are always flawed, and this seems like a situation where there would have been at least some chaos no matter how well the Biden administration executed the withdrawal.

    Like I said, I don’t have any strong opinions because I’m uncertain a good outcome was even possible. My only strong feelings are sadness and disappointment at the situation we got ourselves into and the lives endangered or lost. I hope that for anyone reading this far I’ve managed to add some uncertainty into how you view the situation too. If you think I’m missing something or incorrect about anything here please tell me!

    ##Addendum (9-15-2021)
    The above was written in late August. After posting that I asked Alex Nowrasteh, immigration expert at the Cato Institute, if there was more the Biden administration could have done on the visa process for Afghans and he suggested that they could have used parole. He was referring to Humanitarian or Significant Public Benefit Parole for Individuals Outside the United States. [15] The gist of this program seems to be that the US can grant special parole admission for urgent humanitarian reasons. I don’t know the history of this or if there are limits to its use, but Nowrasteh believes the US could have used it to grant admission to at-risk refugees. When I asked why he thought the Biden administration didn’t use it he responded:

    @AlexNowrasteh: A few theories. My number 1 is that Biden thinks nativism is a more powerful political force than it actually is and that a big parole would ignite some kind of political reaction similar to Europe in 2015. In other words, somebody in the admin is reading too much a Breitbart

    If his theory is accurate then I think that points to a significant failure by the Biden administration. I’m sure conservatives would have had a cow if the US used this parole power to let thousands of Afghan citizens into the US, but why are we leaving people in danger because we’re scared of what Tucker Carlson will say on Fox News? I hope that’s not the reason this tool wasn’t used, but regardless it seems like the Biden administration could have done more to rescue Afghans in danger.

    [1] https://en.wikipedia.org/wiki/Doha_Agreement_(2020)

    [2] Full text of the Doha Agreement (pdf, 4 pages): https://www.state.gov/wp-content/uploads/2020/02/Agreement-For-Bringing-Peace-to-Afghanistan-02.29.20.pdf

    [3] https://en.wikipedia.org/wiki/United_States_military_casualties_in_the_War_in_Afghanistan

    [4] https://www.npr.org/2021/03/17/978106035/biden-says-u-s-may-miss-deadline-for-withdrawing-troops-from-afghanistan

    [5] https://www.whitehouse.gov/briefing-room/speeches-remarks/2021/04/14/remarks-by-president-biden-on-the-way-forward-in-afghanistan/

    [6] https://www.nbcnews.com/politics/national-security/u-s-planning-possible-evacuation-afghan-interpreters-says-top-u-n1268852

    [7] https://gandhara.rferl.org/a/u-s-lawmakers-express-concerns-over-fate-of-afghan-allies-with-taliban-return/31262511.html

    [8] https://archive.is/PqKok

    [9] https://www.bbc.com/news/world-asia-58223231

    [10] https://www.nbcnews.com/think/opinion/trump-could-gain-biden-s-decision-delay-withdrawing-afghanistan-ncna1263956

    [11] https://www.gjopen.com/questions/2071-will-the-us-fully-evacuate-or-lose-control-of-its-embassy-in-kabul-afghanistan-before-1-december-2021

    [12] https://archive.is/rwjQ0

    [13] https://www.cnn.com/2021/08/22/politics/biden-afghan-refugees-resettlement-us-politics/index.html

    [14] https://www.republicanleader.senate.gov/newsroom/remarks/clumsy-retreat-from-afghanistan-would-be-a-grave-mistake

    [15] https://www.uscis.gov/humanitarian/humanitarian-or-significant-public-benefit-parole-for-individuals-outside-the-united-states

  • Degeneracy and Jefferson and a Moose

    March 17, 2021

    “The Europeans who pass into America degenerate, as do the animals; a proof that the climate is unfavourable to the improvement of either man or animal… This degradation of humanity must be imputed to the vitiated qualities of the air stagnating in their immense forests, and corrupted by the noxious vapours from standing waters and uncultivated grounds.”

    Apparently around the Revolutionary period in America, one of the most popular theories in Europe about human and animal origins was degeneration theory. Basically the idea that humans originated in the same place, but that the reason they were different in different places now is that some ended up living in different places with unfavorable climates, leading them to “devolve” and decline from their original complexity in many places. Of course, being a European theory the idea was that Europeans had not degenerated much or at all.

    Obviously this was a theory motivated by racism, used to explain the “inferiority” of other races and peoples. But a funny aspect of it is the controversy it caused with American colonists. The dopes pushing the theory implied that the American colonists had become inferior too by being exposed to the climate of North America. The idea was that the North American climate was bad for living creatures, resulting in toxic plants, which infected people and animals and made them smaller and feebler of mind and body. Some of the founding fathers got offended by Europeans calling them inferior and spent time criticizing the theory. Thomas Jefferson even had a stuffed moose sent to one of the originators of the theory to say “hey idiot, look at how massive this thing is, call my moose small and feeble, I dare you.”

    The quote at the start of this post and all of the hilariously incorrect quotes below come from a Dutch philosopher named Cornelius de Pauw who was one of the proponents of degeneration theory. The source is from a translation of his book at the link, you can look at it for free. Just prepare yourself for some horrifying racism and stupidity: https://www.google.com/books/edition/Selections_from_Les_Recherches_philosoph/4WRZAAAAcAAJ?hl=en&gbpv=1

    “It was observed, at the discovery of the new world, that there was no such thing as a large quadruped to be found between the Tropics; there were neither horses, asses, oxen, camels, dromedaries, nor elephants; all which, except the last, have from time immemorial been so effectually tamed to the services of man in our hemisphere.”

    “The Puma, or lion of America, has no mane; nor is it to be compared for size, force, or courage, with the lion of Africa. The same may be affirmed of their Jaguar, which has been honoured with the name of tiger; as to the Couguar, or poltroon tiger, as it is called, it seems to be peculiar to this country.”

    Offended Cougar
    What did you call me?

    “It is certain that many animals have been found in the new world, which have not their familiars in the old; from which we may infer, that the two continents were never united under the equator; for if the sea between Guinea and the Brazil had ever been terra firma, the animals of the Torrid Zone of the two hemispheres would be found on each continent: whence it follows, that each climate hath received from Nature its appropriated species.”

    “To the malignity of the air of America must be imputed the prodigious propagation of insects, venomous serpents, and infected vegetations, which so unhappily distinguish the hemisphere. The same ill qualities of the air which are favourable to these noxious productions, are probably the true origin of the degeneracy in men and animals; as the same corrupt juices which infect the vegetable nature, must taint the blood, and subdue the powers of the animal.”

    A wikipedia article on degeneration theory: https://en.wikipedia.org/wiki/Degeneration_theory

    More info on the story of how Thomas Jefferson sent a dead moose to Paris: https://www.monticello.org/site/research-and-collections/american-moose

  • New Vaccine Page

    March 16, 2021

    I forgot to post here about it, but a few weeks ago I turned my vaccine spreadsheet into a webpage on my site. You can check it out at the link below, it should be easier to navigate than the spreadsheet, especially on mobile.


    I’m pretty proud of how it works, it looks simple enough but behind the scenes it’s populating the webpage tables with the values grabbed from the google spreadsheet. It took some effort and muddling through a bunch of Javascript (thanks StackOverflow!) to get it working, but now that it’s done it works pretty slick. It was one of those projects where it would have been a lot easier to just manually update the HTML every time I wanted to update the table, but I’m a fan of automation for the sake of automation so now I only have to update the values in one place.

    Anyway, for anyone who happens to see this post I hope you find my vaccine information useful and I hope you’re able to get vaccinated soon. Should be available for everyone within a couple months!