<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://pragmati.st/feed.xml" rel="self" type="application/atom+xml" /><link href="https://pragmati.st/" rel="alternate" type="text/html" /><updated>2026-07-20T02:07:53+00:00</updated><id>https://pragmati.st/feed.xml</id><title type="html">pragmatist</title><subtitle>Patrick Joyce&apos;s website.</subtitle><author><name>Patrick Joyce</name></author><entry><title type="html">What I Read in 2025</title><link href="https://pragmati.st/2026/01/10/what-i-read-in-2025/" rel="alternate" type="text/html" title="What I Read in 2025" /><published>2026-01-10T00:00:00+00:00</published><updated>2026-01-10T00:00:00+00:00</updated><id>https://pragmati.st/2026/01/10/what-i-read-in-2025</id><content type="html" xml:base="https://pragmati.st/2026/01/10/what-i-read-in-2025/"><![CDATA[<p><img src="/images/book_collage_2025.jpg" alt="2025 Book Collage" /></p>

<p>This year I read 30 books (just 2 in Spanish).</p>

<!--more-->

<h2 id="january">January</h2>
<ul>
  <li><a href="https://www.amazon.com/Second-Act-Bloomers-Success-Reinventing/dp/1399813315">Second Act: What Late Bloomers Can Tell You About Success and Reinventing Your Life</a></li>
  <li><a href="https://www.amazon.com/gp/aw/d/0358329752">Sprawball</a> - The belated realization that 3 points are more than 2 points has dramatically changed basketball. This book has excellent data visualizations showing how much the game has changed. Personally, I mostly like the modern game, but basketball isn’t static and I thought he had some good suggestions for tweaking the rules. In particular, I loved the idea to make the corners a restricted area similar to the paint. Long ago we restricted the most valuable area (under the basket) so players can’t just stand there. I think it is reasonable to do the same for the corners. Getting rid of players standing still in the corner would be an improvement.</li>
  <li><a href="https://www.amazon.com/What-Talk-About-When-Running/dp/0307389839">What I Talk About When I Talk About Running</a> - The discipline of his life is impressive. A tender book about accepting one’s limitations. His desired epitaph of “Novelist and runner. He never walked” is pretty great.</li>
  <li><a href="https://www.amazon.com/-/es/Elena-Ferrante/dp/1941999727">La amiga estupenda (Dos amigas 1)</a> - <em>Spanish</em> Figured I would be reading a translation from the Italian in any case and so might as well read it in Spanish. I could tell this was objectively <em>excellent</em> literature, but for whatever reason it didn’t really grab me.</li>
</ul>

<h2 id="march">March</h2>
<ul>
  <li><a href="https://www.amazon.com/Wuthering-Heights-Emily-Bronte/dp/0141439556">Wuthering Heights</a> - I found the reading I did <em>about</em> the book after finishing it more interesting than the book itself. In particular, the multiple layers of unreliable narrators opens the book up to various very different interpretations. But solely as a story I didn’t understand the characters’ behavior.</li>
</ul>

<h2 id="april">April</h2>
<ul>
  <li><a href="https://www.amazon.com/Abundance-Progress-Takes-Ezra-Klein/dp/1668023482"><strong>Abundance</strong></a> - I think we can have a society that grows richer <em>and</em> takes care of the less fortunate. I’d very much like to see a liberalism that builds.</li>
  <li><a href="https://www.amazon.com/Revenge-Tipping-Point-Overstories-Superspreaders/dp/0316575801">Revenge of The Tipping Point</a></li>
</ul>

<h2 id="may">May</h2>
<ul>
  <li><a href="https://www.amazon.com/America-Bottom-Up-Revolution-American-Prosperity/dp/1119564816/">Strong Towns</a></li>
  <li><a href="https://www.amazon.com/Thinking-Basketball-Ben-Taylor/dp/1532968175">Thinking Basketball</a></li>
  <li><a href="https://www.amazon.com/Martians-Kim-Stanley-Robinson/dp/0553801171">The Martians</a></li>
  <li><a href="https://www.amazon.com/Happiness-Curve-Life-Better-After/dp/1250078806">The Happiness Curve: Why Life Gets Better After 50</a></li>
  <li><a href="https://www.amazon.com/How-Infrastructure-Works-Inside-Systems-ebook/dp/B0BV1LSLCH">How Infrastructure Works</a> - The actual discussion of infrastructure was interesting. The author seemed to be having an internal struggle between an optimistic, abundance mindset, and a more conventional leftist pessimism about capitalism. When talking about concrete things I found myself agreeing with her. When she started talking about collectivism and the evils of the profit motive and how all things should just be provided to all people without costs I found myself rolling my eyes aggressively.</li>
</ul>

<h2 id="june">June</h2>
<ul>
  <li><a href="https://www.amazon.com/Longitude-Genius-Greatest-Scientific-Problem/dp/080271529X">Longitude</a></li>
  <li><a href="https://www.amazon.com/How-See-Visual-Adventures-World/dp/0714873837/">How to See</a> - I found this a bit disappointing. The photos and groupings were interesting. There were a few exercises sprinkled throughout that I thought would be good for developing mindfulness about the built environment. But I found the author’s relentless contempt for modernity frustrating.</li>
  <li><a href="https://www.amazon.com/dp/1419744801">How to Watch Basketball Like a Genius</a> - It was fine. Some good anecdotes. Wanted more from it.</li>
</ul>

<h2 id="august">August</h2>
<ul>
  <li><a href="https://www.amazon.com/Mastering-Private-Equity-Transformation-Investments-dp-1119327970/dp/1119327970">Mastering Private Equity</a></li>
  <li><a href="https://www.amazon.com/Artemis-Novel-Andy-Weir/dp/0553448145">Artemis</a> - I <em>love</em> “The Martian” and “Project Hail Mary”. This wasn’t on the level of those but was a fine beach read.</li>
  <li><a href="https://www.amazon.com/Hip-Hop-History-Questlove/dp/0374614075">Hip-Hop is History</a> - Listened to this as an audiobook as we were driving to the beach. Spending a couple hours with Questlove sharing his encyclopedic knowledge of hip-hop history is not a bad way to spend a drive</li>
  <li><a href="https://www.amazon.com/Freedoms-Forge-American-Business-Produced/dp/0812982045"><strong>Freedom’s Forge</strong></a> This was the optimistic story of America doing hard things that I needed. Immigrants like Bill Knudsen came to America, drove innovation by pioneering mass production in the car industry, and then applied those lessons to convert all of American industrial might to defeat the Nazis. We can do hard (and good) things together and we can do them via private industry.</li>
  <li><a href="https://www.amazon.com/Body-Guide-Occupants-Bill-Bryson/dp/0385539304">The Body: A Guide For Occupants</a></li>
  <li><a href="https://www.amazon.com/Never-Split-Difference-Negotiating-Depended/dp/0062407805">Never Split the Difference</a></li>
</ul>

<h2 id="september">September</h2>
<ul>
  <li><a href="https://www.amazon.com/Breakneck-Chinas-Quest-Engineer-Future/dp/1324106034"><strong>Breakneck: China’s Quest to Engineer the Future</strong></a> -</li>
  <li><a href="https://www.amazon.com/Triumph-City-Greatest-Invention-Healthier-ebook/dp/B0049U4HTW/">Triumph of the City: How Our Greatest Invention Makes Us Richer, Smarter, Greener, Healthier, and Happier</a> <em>Spanish</em></li>
</ul>

<h2 id="october">October</h2>
<ul>
  <li><a href="https://www.amazon.com/Nvidia-Way-Jensen-Huang-Making/dp/1324086718">The Nvidia Way</a></li>
  <li><a href="https://www.amazon.com/Origins-Efficiency-Brian-Potter/dp/1953953522">The Origins of Efficiency</a> - I’m a fan of Construction Physics so pre-ordered this book as soon as it was announced.</li>
</ul>

<h2 id="november">November</h2>
<ul>
  <li><a href="https://www.amazon.com/Expensive-Basketball-Shea-Serrano-ebook/dp/B0DYDDJ4Z1">Expensive Basketball</a></li>
  <li><a href="https://www.amazon.com/Squirrel-Seeks-Chipmunk-Modest-Bestiary/dp/0316038407">Squirrel Seeks Chipmunk</a></li>
  <li><a href="https://www.amazon.com/Running-Ground-Father-Simplest-Sports-ebook/dp/B0DVBWGMWB"><strong>The Running Ground: A Father, a Son, and the Simplest of Sports</strong></a> - This was excellent. A story of a difficult—but loving—father and son.<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup> Alternates memoir chapters of the author with chapters focused on the stories of other runners. The Julia Lucas chapter will stick with me forever (in particular the greek tragedy in a 5k of her <a href="https://youtu.be/dqdxuWmdsYI?si=RnuYzzP7njOhmY2g">2012 Olympic Trials race</a>)</li>
</ul>

<h2 id="december">December</h2>
<ul>
  <li><a href="https://www.amazon.com/Babel-Necessity-Violence-Translators-Revolution/dp/0063021420">Babel</a> - 200 pages in I thought this was going to be one of my favorite books of the year. Very well written. The magical system of silver was promising and the prose was excellent. But I was let down by the lack of nuance as the book developed.</li>
  <li><a href="https://www.amazon.com/How-Life-Works-Users-Biology/dp/0226826686"><strong>How Life Works: A User’s Guide to the New Biology</strong></a> - My level of knowledge of biology is whatever was in IB Bio 25 years ago. There is a lot we’ve learned that I didn’t understand. If nothing else, this book fully disabused me of the idea that DNA / the genome represnts a “blueprint” for life. So much of development is contingent on various physical and chemical processes that have nothing to do with information encoded in DNA.</li>
</ul>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>The father basically turns into the unhinged Sam Rockwell character from White Lotus. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Patrick Joyce</name></author><category term="year-end-book-lists" /><summary type="html"><![CDATA[This year I read 30 books (just 2 in Spanish).]]></summary></entry><entry><title type="html">The Time We Ran a Super Bowl Ad</title><link href="https://pragmati.st/2025/02/09/the-time-we-ran-a-superbowl-ad/" rel="alternate" type="text/html" title="The Time We Ran a Super Bowl Ad" /><published>2025-02-09T00:00:00+00:00</published><updated>2025-02-09T00:00:00+00:00</updated><id>https://pragmati.st/2025/02/09/the-time-we-ran-a-superbowl-ad</id><content type="html" xml:base="https://pragmati.st/2025/02/09/the-time-we-ran-a-superbowl-ad/"><![CDATA[<p>I’ve got a story to tell.</p>

<p>It’s been 14 years, so I think we’re past the statute of limitations on this one. I’m also pretty sure nothing here qualifies as proprietary anymore.</p>

<p>One disclaimer: I’m working from 14-year-old memories, so I might get some of the details wrong, but I’m pretty sure I’ve got most of the story right.</p>

<!--more-->

<h2 id="the-setup">The Setup</h2>

<p>It’s late January 2011. I’m at LivingSocial. We’ve got a 12-person engineering team, <a href="https://techcrunch.com/2010/12/02/livingsocial-confirms-175-million-amazon-investment/">$175 million freshly raised from Amazon</a>, and are in the midst of the daily deals arms race with Groupon. They’re bigger than us, but we’re growing faster. We’ve just pulled off the largest one-day flash sale in history, <a href="https://archive.nytimes.com/bits.blogs.nytimes.com/2011/01/19/livingsocial-gets-attention-for-amazon-discount/">selling 1.3 million Amazon gift cards in 24 hours</a>. It took some heroic efforts to keep the site up, but we did it.</p>

<p>Then one day, our CTO grabs a couple of us and says:</p>

<blockquote>
  <p>“We’re going to run a Super Bowl ad.”</p>
</blockquote>

<p>Cool.</p>

<blockquote>
  <p>“I’ve talked to people who’ve done this before. Here’s the pattern: there’s an insane burst of traffic for 30 to 60 seconds, then a gradual taper to a manageable level. That first minute, though? We’re talking 10–100x what we saw during the Amazon deal. We need to make sure we stay up.”</p>
</blockquote>

<p>Less cool.</p>

<h3 id="the-problem">The Problem</h3>

<p>We needed to:</p>

<ol>
  <li>Handle the traffic surge without taking the whole site down.</li>
  <li>Make sure people could sign up for our email list and buy deals.</li>
</ol>

<p>And we had some serious constraints:</p>

<ol>
  <li><strong>Our hardware capacity was fixed.</strong> This was 2011. We were hosted on <em>actual physical servers</em> at Rackspace. No AWS, no GCP. Scaling meant calling someone to order hardware and waiting for it to be racked. We’d already pushed Rackspace’s capacity about as far as it could go.</li>
  <li><strong>Avoid saturating our network.</strong> We were legitimately worried about saturating Rackspace’s network ingress so needed to keep as much traffic as possible at the CDN.</li>
  <li><strong>We had about 10 days.</strong></li>
</ol>

<h2 id="the-plan">The Plan</h2>

<p>We started kicking ideas around. I remember being inspired by how The New York Times handled live updates election night traffic with a Rails app that generated static HTML pages and pushed them all into their CDN with a short TTL.</p>

<h3 id="step-1-make-the-site-static">Step 1: Make the Site Static</h3>

<p>We decided to <em>pre-render the entire site</em> and serve it as static HTML through Akamai with a 5-minute TTL. One of my coworkers built a Rake task to generate static snapshots of every key page.</p>

<p>That covered browsing, but we still had two critical features that ultimately required a persistent write:</p>

<ol>
  <li><strong>Email subscriptions</strong> – We needed to capture email addresses and cities.</li>
  <li><strong>Purchases</strong> – We needed to process orders and credit cards.</li>
</ol>

<p>Normally, our architecture looked something like this:</p>

<p><em>Akamai → F5 → nginx → unicorn workers (Rails) → Resque/MySQL</em></p>

<p>But even with the static site, we knew our unicorn workers couldn’t handle another 10x of our peak from the Amazon deal—even if all they were doing was dropping requests into Redis for background processing.</p>

<h3 id="step-2-lean-on-nginx-and-log-everything">Step 2: Lean on Nginx and Log Everything</h3>

<p>Then someone (I wish I remembered who) had an idea:</p>

<blockquote>
  <p>“Nginx is a beast. Writes to disk are fast. What if we just log all POST params directly in nginx logs, then process them asynchronously later?”</p>
</blockquote>

<p>I built a parser to read nginx logs and queue background jobs for:</p>

<ul>
  <li>Vaulting credit cards with Braintree</li>
  <li>Creating accounts</li>
  <li>Logging purchases</li>
</ul>

<p>We tested the hell out of it on staging. Then we did a small production run during off-peak hours. Everything worked.</p>

<h3 id="game-day">Game Day</h3>

<p>On Super Bowl Sunday, we were all in the office tired but full of adrenaline.</p>

<p><strong>20 minutes before the ad aired</strong>, we regenerated the static site and tested it on a subdomain. Everything looked good.</p>

<p><strong>2 minutes before the ad aired</strong>, we flipped the switch. The live site became a static site. Right before doing this, we cleared the nginx logs so they wouldn’t contain test data.</p>

<p>The ad ran.</p>

<p>Traffic spiked. No 500s. Everything looked good at the load balancer.</p>

<p>I was SSH’d into our production application servers and checking the logs.</p>

<p>Nothing.</p>

<p>The log files were <em>empty</em>.</p>

<p>My stomach dropped.</p>

<h2 id="the-mistake">The Mistake</h2>

<p>Nginx buffers logs in memory before writing them to disk, so there is often a slight delay before the logs are written to disk. But <em>we should have been seeing data</em>.</p>

<p>We weren’t.</p>

<p>I raised the alarm. We started digging. Then I heard a string of curses.</p>

<p>When we “cleared” the logs before the ad ran, we <strong>deleted</strong> the log files instead of truncating them.</p>

<p>Under normal circumstances, this wouldn’t be a huge deal—you just restart nginx, and it creates new log files. But we’d <em>forgotten to restart nginx</em>. So it kept an open file descriptor for the deleted file kept writing to a file that no longer existed, meaning everything was effectively going to <code class="language-plaintext highlighter-rouge">/dev/null</code>.</p>

<p>We’d just lost <em>all</em> the traffic data from those critical minutes.</p>

<h2 id="the-aftermath">The Aftermath</h2>

<p>Within five minutes, traffic had dropped to a manageable level, so we switched back to the normal site.</p>

<p>But the logs were lost to the ether.</p>

<p>There was nothing to be done.</p>

<p>I poured myself a <em>very</em> large bourbon. My coworker who built the static site generator poured himself a <em>very</em> large tequila.</p>

<p>By halftime, I’d left the office to meet my wife at a Super Bowl party.</p>

<h3 id="the-sort-of-silver-lining">The (Sort of) Silver Lining</h3>

<p>The traffic spike wasn’t quite as big as we’d feared or hoped—it was close to, but not as big as—our peak during the Amazon deal. Ironically, <em>we could have just run on our normal system</em>.</p>

<p>Losing that five-minute window cost us a few thousand purchases and subscriptions, which wasn’t great, but wasn’t catastrophic. Super Bowl ads aren’t really direct response plays—they’re brand plays. The purchases would have been a bonus.</p>

<p>The ad itself? <a href="https://www.youtube.com/watch?v=nGN939P6YAo">Not great</a>. I saw it for the first time the night before. Doesn’t age well and even at the time I didn’t feel great about making a trans person a punchline. Still, it managed to be <a href="https://www.cbsnews.com/news/livingsocial-tries-to-learn-from-groupon-some-publicity-really-is-bad/">get less backlash than Groupon’s</a>, and we did get a ton of earned media mostly just about the fact that we were big enough to run a Super Bowl ad.</p>

<p>Would I call it a good return on ad spend? No. But screwing up five minutes of logging didn’t materially change the outcome.</p>

<h3 id="the-takeaway">The Takeaway</h3>

<p>Even after all these years, I’m still incredibly proud of what we built. Five people, 10 days, and a system that <em>could</em> have handled 100x our normal traffic.</p>

<p>It should have worked.</p>

<p>It <em>would</em> have worked.</p>

<p>If not for <del>you meddling kids</del> <strong>failing to properly rotate nginx logs</strong>.</p>

<p><img src="/images/scooby-doo-nginx-logs.jpeg" alt="And it would have worked, too" /></p>]]></content><author><name>Patrick Joyce</name></author><summary type="html"><![CDATA[I’ve got a story to tell. It’s been 14 years, so I think we’re past the statute of limitations on this one. I’m also pretty sure nothing here qualifies as proprietary anymore. One disclaimer: I’m working from 14-year-old memories, so I might get some of the details wrong, but I’m pretty sure I’ve got most of the story right.]]></summary></entry><entry><title type="html">Playing With LLMs As A Binary Classifier</title><link href="https://pragmati.st/2025/02/01/playing-with-llms-as-a-binary-classifier/" rel="alternate" type="text/html" title="Playing With LLMs As A Binary Classifier" /><published>2025-02-01T00:00:00+00:00</published><updated>2025-02-01T00:00:00+00:00</updated><id>https://pragmati.st/2025/02/01/playing-with-llms-as-a-binary-classifier</id><content type="html" xml:base="https://pragmati.st/2025/02/01/playing-with-llms-as-a-binary-classifier/"><![CDATA[<p>A friend of mine leads an internal data team for hospital group.</p>

<p>They recently received the updated 2025 ICD-10 codes which is a coding system of ~74,000 codes that are used by healthcare providers and insurance companies for billing, tracking public health trends, and medical recordkeeping.</p>

<p>Basically, they got handed a plain text file with 74,260 lines and were asked to annotate the data with various additional bits of information. For example, they want to record whether each ICD code represents an infection:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">A200    Bubonic plague</code> is an infection</li>
  <li><code class="language-plaintext highlighter-rouge">Y9366   Activity, soccer</code> is <em>not</em> an infection</li>
</ul>

<p>Annotating more than 74,000 lines is tedious and time consuming<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>, so he hit up the group chat asking about how to script an LLM to do this.</p>

<p>This seemed like a fun toy problem to try out some stuff I personally hadn’t done yet, so I decided to see how well I could use LLMs as a binary classifier for “infection/not infection”</p>

<!--more-->

<h2 id="attempt-1---scripting-local-llms-on-my-m1-macbook-air">Attempt 1 - Scripting local LLMs on my M1 MacBook Air</h2>
<p>I’d been wanting to play directly with some of the open weights LLMs like Llama, Mistral, Qwen, and DeepSeek and this seemed like a good excuse.</p>

<p>I installed Simon Willison’s <a href="https://github.com/simonw/llm">llm command line tool</a> and the <a href="https://github.com/nomic-ai/gpt4all">gpt4all plugin</a> and started pulling down models and doing some quick testing with a few.</p>

<p>(Embarrassingly, I wasn’t able to figure out how to get any of the Llama models to work)</p>

<p>qwen2-1_5b-instruct-q4_0 didn’t really follow instructions, outputting a bunch of the prompt and making up some additional codes that weren’t in the input.</p>

<p>But mistral-7b-instruct-v0 at least followed the instructions and output in the right format, so I went down that path a bit. Here is the command line invocation I used:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/src/icd10cm-codes-classifier <span class="o">&gt;</span> <span class="nb">shuf</span> <span class="nt">-n</span> 5 /Users/patrick/src/icd10cm-codes-classifier/icd10cm-codes-2025.txt | llm <span class="nt">-m</span> mistral-7b-instruct-v0 <span class="nt">--system</span> <span class="s1">'You are an expert in medical coding. You are given a list of ICD-10 codes and their corresponding descriptions. Your job is to annotate each line with an additional column. If the ICD code and description is for an infection then add TRUE. If it is for something that is not necessarily an infection add FALSE. Output the icd code, the descriptionand the TRUE/FALSE column. DO NOT ADD ANYTHING ELSE TO THE OUTPUT.'</span>
</code></pre></div></div>
<p>This is pulling 5 random codes out of the file and prompting mistral to classify them.</p>

<p>And here is the output:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>T18120S Food in esophagus causing compression of trachea, sequela TRUE
G501    Atypical facial pain FALSE
H18521  Epithelial (juvenile) corneal dystrophy, right eye FALSE
S72111J Displaced fracture of greater trochanter of right femur, subsequent encounter for open fracture type IIIA, IIIB, or IIIC with delayed healing TRUE
M84756D Complete transverse atypical femoral fracture, unspecified leg, subsequent encounter for fracture with routine healing FALSEException ignored in: &lt;_io.TextIOWrapper name=7 mode='w' encoding='UTF-8'&gt;
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/llm/0.20/libexec/lib/python3.13/site-packages/llm_gpt4all.py", line 294, in __exit__
    sys.stderr = self.original_stderr
OSError: [Errno 9] Bad file descriptor
</code></pre></div></div>

<p>It “worked”. <em>Sort of</em>. A couple of problems:</p>

<ol>
  <li>The program blew up with an exception. This was common across the LLMs I was running with llm, and I didn’t take the time to to properly debug it, because…</li>
  <li>Two out of the five classifications were obviously wrong. I’m not a documentation nurse, but I know that “Food in esophagus” is not an infection.</li>
</ol>

<p>So this wouldn’t be actively useful.</p>

<h2 id="attempt-2---naive-scripting-with-openai-api">Attempt 2 - Naive Scripting with OpenAI API</h2>
<p>It was getting late and I was frustrated that I hadn’t gotten anything useful for my friend yet. So I decided to throw a little of money at the problem and use GPT-4o.</p>

<p>I fired up cursor and used composer to prompt for a python script that would iterate over the ~74,000 rows in batches of 100 and then call to the OpenAI API with a prompt that I provided.</p>

<p>Success! (mostly)</p>

<p>I got responses back, and from spot checking they seemed mostly right.</p>

<p>There were just a couple of problems:</p>

<ol>
  <li>I dropped some data. I ended up with a file with 73,509 rows vs. the 74,260 rows I should have had. I’m not sure what was happening here, but if I was doing this for real I could easily do some integrity checks on each batch to make sure the output ICD codes match the input.</li>
  <li>It was <em>super</em> slow. I did this in the most naive way possible of just doing sequential API requests and waiting for each one to finish before starting the next. This was a quick experiment so I just went to bed and let it run overnight, but I could easily parallelize each batch and make this much faster.</li>
</ol>

<p>Still this was good enough for a quick weeknight proof of concept so the next morning when the job finished I sent the file off to my friend.</p>

<p>Total cost: $19.94</p>

<ul>
  <li>gpt-4o-2024-08-06, cached input - $0.13</li>
  <li>gpt-4o-2024-08-06, input - $3.76</li>
  <li>gpt-4o-2024-08-06, output - $16.05</li>
</ul>

<p>All the code is available on <a href="https://github.com/KeeperPat/icd10cm-codes-classifier">github</a>.</p>

<h2 id="next-steps">Next Steps</h2>
<p>Now that I’ve got this little toy test project, I’d like to try a few more experiments on top of it. Look for them in a future part 2:</p>

<ul>
  <li>Play with batch sizes. I picked the 100 line batch size out of thin air. I’m no where near the per request token limit. But I also wonder if I’d see any impact on accuracy with larger batch sizes.</li>
  <li>Use the OpenAI batch API - this will ~halve the cost. And while there is a 24 hour SLA on batch requests I bet this will end up being significantly faster by having</li>
  <li>Try other models.
    <ul>
      <li>Compare GPT-4o and 4o-mini - The task is relatively simple, so I’m willing to wager that 4o-mini will also be able to function as a classifiers.</li>
      <li>Access other models in the cloud. My personal laptop only has 16GB of RAM which limits what it can run. But I can play with</li>
    </ul>
  </li>
  <li>Implement voting - run the LLM “classifier” multiple times. Store each of the results. Possibly call multiple different models and see where they agree and where they disagree. Places of disagreement can be used to highlight codes for manual review.</li>
</ul>
<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>They did some quick napkin math that it would take ~300 hours of labor from a documentation nurse to do this which would cost ~$18,000. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Patrick Joyce</name></author><summary type="html"><![CDATA[A friend of mine leads an internal data team for hospital group. They recently received the updated 2025 ICD-10 codes which is a coding system of ~74,000 codes that are used by healthcare providers and insurance companies for billing, tracking public health trends, and medical recordkeeping. Basically, they got handed a plain text file with 74,260 lines and were asked to annotate the data with various additional bits of information. For example, they want to record whether each ICD code represents an infection: A200 Bubonic plague is an infection Y9366 Activity, soccer is not an infection Annotating more than 74,000 lines is tedious and time consuming1, so he hit up the group chat asking about how to script an LLM to do this. This seemed like a fun toy problem to try out some stuff I personally hadn’t done yet, so I decided to see how well I could use LLMs as a binary classifier for “infection/not infection” They did some quick napkin math that it would take ~300 hours of labor from a documentation nurse to do this which would cost ~$18,000. &#8617;]]></summary></entry><entry><title type="html">What I Read in 2024</title><link href="https://pragmati.st/2025/01/04/what-i-read-in-2024/" rel="alternate" type="text/html" title="What I Read in 2024" /><published>2025-01-04T00:00:00+00:00</published><updated>2025-01-04T00:00:00+00:00</updated><id>https://pragmati.st/2025/01/04/what-i-read-in-2024</id><content type="html" xml:base="https://pragmati.st/2025/01/04/what-i-read-in-2024/"><![CDATA[<p><img src="/images/book_collage_2024.jpg" alt="2024 Book Collage" /></p>

<p>Looking back, I noticed a couple of themes in my reading this year. One was biographies of people who had achieved success and then figured out how to change so that the drive that propelled their success didn’t eat them from the inside (Becoming Steve Jobs, Pep Guardiola)</p>

<p>Another theme was books that prompted some reflection that I would read (or listen to) in the morning as I got the kids ready for school (What We Owe The Future, Not The End Of The World, A Decent Life)</p>

<p>And then there is my normal mix of trying to better understand the world and pick up additional tools for functioning in it (The Laws of Trading, Thinking in Systems, Sludge, Noise, Stories that Stick). I’m happy with those books if I take away one mental model or skill that I can use.</p>

<!--more-->

<h2 id="january">January</h2>
<ul>
  <li><a href="https://www.amazon.com/Whats-Our-Problem-Self-Help-Societies-ebook/dp/B0BTJCTR58">What’s Our Problem?</a> - I love Tim Urban’s writing at “<a href="https://waitbutwhy.com">Wait But Why?</a>” He has an inherent curiosity and explains things in a way that I find persuasive. And this book did spur me to action in that it convinced me to change my monthly donation from the ACLU to FIRE. It also succeeded in making me a bit more worried about illiberal tendencies on my side of the aisle. But I walked away pretty unsatisfied because I thought he got stuck on a false equivalence between the illiberal left (who shout a lot on the internet but are not representative of mainstream left and center left political power in the US) and the authoritarian right (who are very much represented in the mainstream of the Republican party). I remain a committed advocate for enlightenment beliefs.</li>
  <li><a href="https://www.amazon.com/Verbal-Judo-Gentle-Persuasion-Updated/dp/0062107704">Verbal Judo</a></li>
</ul>

<h2 id="february">February</h2>
<ul>
  <li><a href="https://www.amazon.com/What-Owe-Future-William-MacAskill/dp/1541618629">What We Owe The Future</a> - I started this book expecting to be a bit frustrated because the longtermism movement within EA seemed so <em>dogmatic</em>. My prior was that we should value the future <em>more</em> than we do today, but <em>less</em> than the longtermism movement within EA advocated for. I thought the book made compelling arguments and was more reasonable than I was expecting based on the longtermism arguments that had filtered out to me through the internet. I’ll say that it was successful in convincing me to update my prior to care even more about the future than I did before I read the book, but still not with the certainty that McCaskill was arguing for.</li>
</ul>

<h2 id="march">March</h2>
<ul>
  <li><a href="https://www.amazon.com/Becoming-Steve-Jobs-Evolution-Visionary/dp/0385347405">Becoming Steve Jobs</a> - This was a re-read, but I’d forgotten I’d read it until I was 2 chapters in so kept going. Not perfect but so very much better than the Isaacson biography which I still think is one of the worst books I’ve ever read and such a missed opportunity.</li>
  <li><a href="https://www.amazon.com/gp/aw/d/B0C3ZPN6NT/ref=tmm_kin_swatch_0?ie=UTF8&amp;qid=&amp;sr="><strong>Not the End of the World: How We Can Be the First Generation to Build a Sustainable Planet</strong></a> - I see a sense of doomerism amongst some of my friends that I find frustrating. I’m not pollyannish, I think that we face many serious environmental problems. But I think it is demonstrably inaccurate to think that everything is getting worse and we face extinction. This book was an excellent fact-based antidote to the thought that humanity can’t thrive while preserving the planet.</li>
  <li><a href="https://www.amazon.com/Pep-Guardiola-Deportes-corner-Spanish-ebook/dp/B00C5QRXJ8/ref=mp_s_a_1_13?crid=1AAFJXZV0Z6T8&amp;keywords=guillem+balague&amp;qid=1689525985&amp;sprefix=guillem+%2Caps%2C111&amp;sr=8-13">Pep Guardiola: Otra Manera de Ganar</a> - I liked this. I want to read an updated version with more information on how he has evolved in his time at Man City so that he can sustain greatness instead of working himself to exhaustion and near the point of physical collapse like he did at Barcelona.</li>
</ul>

<h2 id="april">April</h2>
<ul>
  <li><a href="https://www.amazon.com/Decent-Life-Morality-Rest-Us/dp/022660974X">A Decent Life</a> - Much of philosophy focuses on how to live an ideal life. I enjoyed this book’s more grounded ambition: how to live a decent life. I know I’m deeply flawed, but I aim to be a slightly better person each year. Reading a little of this each morning was a good way to keep that goal top of mind.</li>
  <li><a href="https://www.amazon.com/MANIAC-Benjamin-Labatut/dp/0593654471/ref=sr_1_1?tag=marginalrevol-20"><strong>The MANIAC</strong></a> - This book is incredible. It is a biography of John Von Neumann but it is told through a series of fictionalized first person narratives of people who knew him. It also is a metaphor for the coming of artificial super intelligence. Highly, <em>highly</em> recommended.</li>
</ul>

<h2 id="june">June</h2>
<ul>
  <li><a href="https://www.amazon.com/Song-Cell-Exploration-Medicine-Human-ebook/dp/B09RX45W14/ref=tmm_kin_swatch_0?_encoding=UTF8&amp;qid=1706463255&amp;sr=8-1">The Song of the Cell</a></li>
  <li><a href="https://www.amazon.com/Laws-Trading-Traders-Decision-Making-Everyone/dp/1119574218">The Laws of Trading: A Trader’s Guide to Better Decision-making for Everyone</a> - The thing I took from this book was that there are several potential sources of “edge” (a sustainable advantage) and you need to be clear-eyed in evaluating what edges you may have.</li>
  <li><a href="https://www.amazon.com/Time-Travelling-Economist-Education-Electricity-Fertility/dp/3030975967/">The Time-Travelling Economist: Why Education, Electricity and Fertility Are Key to Escaping Poverty</a> - As I’ve taught my children “the past is a terrible place” and I wouldn’t want to have been born at any other time or any other place in human history. My hope is that we can continue to expand prosperity so that more of humanity can be as fortunate as me.</li>
</ul>

<h2 id="july">July</h2>
<ul>
  <li><a href="https://www.amazon.com/gp/aw/d/B00KWDN3MC/ref=tmm_kin_swatch_0?ie=UTF8&amp;qid=&amp;sr=">El futbol a sol y sombra</a> - For a classic book about soccer was a bit of a slog for me. It isn’t that it wasn’t good—it was very good—but for some reason it just took me several months to work through it. Two things stick in my memory. First, this is the first time I learned that the position of goalkeeper is sometimes referred to as “cerbero” (cerberus) and as a goalkeeper I think that is amazing: because we guard the gates of hell! Second, the running joke in the recap of world events before each World Cup from 1966 to 2006 that “Fuentes bien informadas de Miami anunciaban la inminente caída de Fidel Castro, que iba a desplomarse en cuestión de horas.” cracked me up.</li>
  <li><a href="https://www.amazon.com/Subtle-Art-Not-Giving-Counterintuitive-ebook/dp/B019MMUA8S/ref=tmm_kin_swatch_0?_encoding=UTF8&amp;qid=&amp;sr=">The Subtle Art of Not Giving a F**k</a> - Read it in Spanish as a quick read while we were in Korea as a palate cleanser after El Futbol A Sol Y Sombra. It was fine.</li>
</ul>

<h2 id="august">August</h2>
<ul>
  <li><a href="https://www.amazon.com/Red-Mars-Trilogy-Kim-Stanley/dp/0553560735"><strong>Red Mars</strong></a> -  I <em>loved</em> this book when I read it in middle school. I’m not sure I’d finished the entire trilogy as a child because the later books get pretty deep into the politics of forming a socialist utopia. That part still didn’t really speak to me, but on this re-read I was struck by how much I’m desperate for advances in materials science (space elevators built from carbon nanotubes extruded from an asteroid! piezoelectric films that can tent canyons on mars and generate electricity from wind!) and biological science (<a href="https://www.kimstanleyrobinson.info/content/longevity-treatment">the longevity treatment!</a>). Also, no one can write descriptions of landscapes quite like Kim Stanley Robinson. It is so vivid I feel like I’m there. I was inspired to re-read these by Casey Handmer and enjoyed <a href="https://caseyhandmer.wordpress.com/2022/12/13/mars-trilogy-technical-commentary/">his accompanying technical analysis</a>.</li>
  <li><a href="https://www.amazon.com/Poor-Charlies-Almanack-Essential-Charles/dp/1953953239">Poor Charlie’s Almanack</a> - Collection of essays and speeches by Charlie Munger. A very clear thinker. An edition by Stripe Press.</li>
  <li><a href="https://www.amazon.com/Thinking-Systems-Donella-H-Meadows/dp/1603580557">Thinking in Systems: A Primer</a> -  A little dry but solid. I feel like this is descriptive of how I think but giving a vocabulary to it has been somewhat useful.</li>
</ul>

<h2 id="september">September</h2>
<ul>
  <li><a href="https://www.amazon.com/Green-Mars-Trilogy-Kim-Stanley/dp/0553572393">Green Mars</a> -  See above.</li>
  <li><a href="https://www.amazon.com/Blue-Mars-Trilogy-Kim-Stanley/dp/0553573357">Blue Mars</a> -  See above.</li>
  <li><a href="https://www.amazon.com/Sludge-Stops-Getting-Things-about-ebook/dp/B08PYB9XN4/ref=sr_1_1?dchild=1&amp;keywords=cass+sunstein+sludge&amp;qid=1625781059&amp;sr=8-1">Sludge: What Stops Us from Getting Things Done and What to Do about It</a> - Sludge is like the evil twin of “<a href="https://www.amazon.com/Nudge-Final-Richard-H-Thaler/dp/014313700X/">Nudge</a>” (I don’t think the rhyming names were an accident). Good reminder to be on the lookout for unnecessary friction that gets in the way of achieving what we want.</li>
</ul>

<h2 id="october">October</h2>
<ul>
  <li><a href="https://www.amazon.com/One-Giant-Leap-Untold-Story/dp/1501106295/"><strong>One Giant Leap: The Impossible Mission That Flew Us to the Moon</strong></a> - I really enjoyed this. I like to be reminded that we can do great things. It also inspired me to watch the 2019 documentary <a href="https://www.youtube.com/watch?v=3Co8Z8BQgWc">Apollo 11</a> which was <em>stunning</em>. I grew up loving space. But I also was born after our last trip to the moon. This book made me think of all the thousands of people who worked on Apollo and <em>didn’t know</em> if it was going to work. And that made me think of one of my favorite pieces of writing from the last several years: 22 Goals. And particularly the episode about the 1970 World Cup and the part about <a href="https://www.theringer.com/2022/12/07/soccer/22-goals-world-cup-brazil-carlos-alberto">Pele bursting into tears on the way to the final and trying to hide it</a> by crouching down to look for a rattle and how “If one moment can change everything, the people who create that moment are living through it in the present. They don’t know the outcome in advance. The greatest soccer team ever assembled can also be a bunch of guys dealing with their nerves by singing on a bus on the way to the biggest game of their lives.”</li>
</ul>

<h2 id="november">November</h2>
<ul>
  <li><a href="https://www.amazon.com/How-See-Looking-Talking-Thinking/dp/0393248135?dplnkId=faba44c7-6a40-4c50-a472-c45b06a048e2&amp;nodl=1"><strong>How to See</strong></a> - I don’t really know anything about art, but I enjoyed this collection of essays from painter and art critic David Salle. There were times that I didn’t have the context to fully follow what he was talking about, but for the most part I feel like I walked away with a greater understanding and appreciation for the practice of creating art. And I learned I really love <a href="https://www.artsy.net/artist-series/alex-katz-landscapes">Alex Katz’ nature paintings</a>.</li>
  <li><a href="https://www.amazon.com/Edge-Art-Risking-Everything/dp/1594204128?dplnkId=b83f4055-9b8b-407d-a436-8aeb608e256e&amp;nodl=1"><strong>On the Edge: The Art of Risking Everything</strong></a> - I enjoy Nate Silver’s thinking and writing. I liked this as a book more than I remembered liking The Signal and The Noise. There is value in taking risk and understanding the world. I do think he fell a little too in love with is Village and River metaphor but he hit on a meaningful cluster of traits that don’t exactly map onto a traditional left-right view of US politics</li>
</ul>

<h2 id="december">December</h2>
<ul>
  <li><a href="https://www.amazon.com/Noise-Human-Judgment-Daniel-Kahneman/dp/0316451401/ref=sr_1_1_nodl?dchild=1&amp;keywords=noise+a+flaw&amp;qid=1620400324&amp;sr=8-1/marginalrevol-20">Noise: A Flaw in Human Judgment</a> - Key takeaway: Keep your facts and your values separate when making decisions.</li>
  <li><a href="https://www.amazon.com/Stories-That-Stick-Storytelling-Captivate-ebook/dp/B07KF2328Z?dplnkId=7b276b0b-2f0f-4bba-9451-8c2d759f8a76&amp;nodl=1"><strong>Stories That Stick</strong></a> - The structure of a good story is Normal, Explosion, New Normal and the key elements are having identifiable characters, authentic emotion, a significant moment (this is the explosion), and specific details. This was a book about a craft or engineering, not art. The goal was to help you use stories to achieve some concrete goal. A successful story is one that achieves that goal. A story that doesn’t achieve the goal isn’t successful, but can probably be tweaked to achieve the goal.</li>
  <li><a href="https://www.amazon.com/Portuguese-Modern-History-Barry-Hatton/dp/1566568447">The Portuguese: A Modern History</a> - I’m going to Portugal later this month to see a Champions League match between Benfica and Barcelona. I’ve never been to Portugal (despite having lived in Spain) and realized I knew next to nothing about the country.</li>
  <li><a href="https://amzn.to/3Kp629E">Probably Overthinking It</a> - Fun examples of statistical thinking and several counterintuitive traps people fall into.</li>
  <li><a href="https://www.amazon.com/Why-Machines-Learn-Elegant-Behind-ebook/dp/B0CF1223R8/ref=tmm_kin_swatch_0?_encoding=UTF8&amp;sr=">Why Machines Learn</a> - Very good history of the development of machine learning. Unlike other popular science books this didn’t shy from walking the reader through the math that underlies machine learning. It’s been a long time since I took Calc so I’ll admit I can’t really <em>do</em> the math anymore, but I do at least still remember the concepts so I can follow along. There wasn’t a <em>ton</em> new here after I did my deep dive a few years ago, but the discussion in the last chapter of how massive neural networks don’t overfit and we have no satisfactory theory to explain why was completely new.</li>
</ul>]]></content><author><name>Patrick Joyce</name></author><category term="year-end-book-lists" /><summary type="html"><![CDATA[Looking back, I noticed a couple of themes in my reading this year. One was biographies of people who had achieved success and then figured out how to change so that the drive that propelled their success didn’t eat them from the inside (Becoming Steve Jobs, Pep Guardiola) Another theme was books that prompted some reflection that I would read (or listen to) in the morning as I got the kids ready for school (What We Owe The Future, Not The End Of The World, A Decent Life) And then there is my normal mix of trying to better understand the world and pick up additional tools for functioning in it (The Laws of Trading, Thinking in Systems, Sludge, Noise, Stories that Stick). I’m happy with those books if I take away one mental model or skill that I can use.]]></summary></entry><entry><title type="html">What I Read in 2023</title><link href="https://pragmati.st/2024/03/12/what-i-read-in-2023/" rel="alternate" type="text/html" title="What I Read in 2023" /><published>2024-03-12T00:00:00+00:00</published><updated>2024-03-12T00:00:00+00:00</updated><id>https://pragmati.st/2024/03/12/what-i-read-in-2023</id><content type="html" xml:base="https://pragmati.st/2024/03/12/what-i-read-in-2023/"><![CDATA[<p><img src="/images/book_collage_2023.jpg" alt="Collage of book covers of books I read in 2023" /></p>

<p>Took me long enough to write this one up :)</p>

<h2 id="january">January</h2>
<ul>
  <li><a href="https://www.amazon.com/Last-Days-Roger-Federer-Endings-ebook/dp/B09CNFV2KS">The Last Days of Roger Federer: And Other Endings</a></li>
</ul>

<h2 id="february">February</h2>
<ul>
  <li><a href="https://www.amazon.com/Blindsight-Peter-Watts/dp/0765319640"><strong>Blindsight</strong></a> - This book is bonkers (in that it posits a world where Vampires are real) but was very interesting and made me reflect on the nature of consciousness.</li>
</ul>

<h2 id="march">March</h2>
<ul>
  <li><a href="https://www.amazon.com/Four-Thousand-Weeks-Management-Mortals/dp/0374159122">Four Thousand Weeks: Time Management for Mortals</a> - A philosophical meditation on how to ensure you accomplish the important stuff and enjoy your life from a self-described “recovered productivity obsessive”.</li>
</ul>

<h2 id="april">April</h2>
<ul>
  <li><a href="https://www.amazon.com/Dopamina-mol%C3%A9cula-condiciona-enamoramos-Behavioral/dp/8411000109">Dopamine: The Molecule of More</a> - <em>Spanish translation</em></li>
  <li><a href="https://www.amazon.com/Hackers-Computer-Revolution-Steven-Levy/dp/1449388396">Hackers</a> - Never read this before. Pretty cool stories from the people who created so much of the culture of programming.</li>
  <li><a href="https://www.amazon.com/-/es/Mike-Isaac-ebook/dp/B08JNPQYVN">Super Pumped</a> - <em>Spanish translation</em>  - I knew a lot of the story but not all of it. There is something resembling a greek tragedy in the story of Uber in that the things that made Travis Kalanick uniquely suited to lead Uber to success when they were upstarts combatting evil taxi monopolies (insane drive, pathological competitiveness, and a willingness to flout regulations) is also what made him uniquely ill-suited to lead a multi-billion dollar global company. This was fun to read in Spanish and pick up a bunch of startup vocabulary.</li>
  <li><a href="https://www.amazon.com/Echopraxia-Firefall-Book-Peter-Watts-ebook/dp/B00IHCBDJ0">Echopraxia</a> - Sequel to Blindsight. I enjoyed it significantly less than Blindsight.</li>
</ul>

<h2 id="june">June</h2>
<ul>
  <li><a href="https://www.amazon.com/AI-Revolution-Medicine-GPT-4-Beyond-ebook/dp/B0BXNVM6FC/">The AI Revolution in Medicine</a> - A team of medical doctors and researchers got early access to GPT-4 to see how it affected care. This mirrored a lot of my thoughts about the possibilities and limitations of generative AI. I am convinced widespread AI will be a society altering change, probably a bigger change than the adoption of personal computers and the internet.</li>
  <li><a href="https://www.amazon.com/Proyecto-Hail-Mary-Project-Spanish/dp/8418037016"><strong>Project Hail Mary</strong></a> - <em>Spanish translation</em> - I loved this book so much.</li>
</ul>

<h2 id="august">August</h2>
<ul>
  <li><a href="https://www.amazon.com/Creative-Act-Way-Being/dp/0593652886">The Creative Act</a> - Rick Rubin is a weird and uniquely talented dude. The book sometimes veers into faux mysticism that I’m constitutionally allergic to, but also contained some really good prompts to unblock thinking.</li>
  <li><a href="https://www.amazon.com/Whats-Our-Problem-Self-Help-Societies-ebook/dp/B0BTJCTR58">What’s Our Problem?</a> - I love <a href="https://waitbutwhy.com">Wait But Why</a>. Tim Urban makes a lot of very good points as he tries to figure out how societal discourse seems to have gone off the rails. I also think he oversimplifies quite a bit and falls victim to false equivalencies in several places. We should all aspire to consistently be high rung thinkers.</li>
  <li><a href="https://sheaserrano.gumroad.com/l/actionheroscoutingreport">Action Hero Scouting Report</a> - Shea Serrano is one of my favorite writers and I enjoy how much fun he’s having with little projects like this.</li>
  <li><a href="https://www.amazon.com/Hard-Things-Resilience-Surprising-Toughness-ebook/dp/B09GRDXXCP">Do Hard Things: Why We Get Resilience Wrong and the Surprising Science of Real Toughness</a></li>
</ul>

<h2 id="october">October</h2>
<ul>
  <li><a href="https://www.amazon.com/Going-Infinite-Rise-Fall-Tycoon-ebook/dp/B0C5DNW987"><strong>Going Infinite: The Rise and Fall of a New Tycoon</strong></a> - FTX is another story I’d followed and was fairly informed on but there still were <em>a lot</em> of absoluely amazing stories in here. I feel like Michael Lewis wrote this about as sympathetic to SBF as possible and I still read it as “he committed massive financial fraud”</li>
</ul>

<h2 id="november">November</h2>
<ul>
  <li><a href="https://www.amazon.com/detectives-salvajes-Spanish-Roberto-Bolaño-ebook/dp/B01JH3F2PI"><strong>Los Detectives Salvajes</strong></a> - <em>Spanish</em> - I spent 4½ months with with this book. I went into it pretty much entirely blank with only a vague recollection that Roberto Bolaño was a big deal when I was in Spain in 2003, died young, and occupies sort of a Spanish language David Foster Wallace niche in my mind. I won’t attempt to summarize the book, but it is very, <em>very</em> good. I’m glad I read it and am confident it’s going to stick with me for a long time.</li>
</ul>

<h2 id="december">December</h2>
<ul>
  <li><a href="https://www.amazon.com/Resumen-historia-del-Ecuador-Spanish-ebook/dp/B0DK423KSX">Resumen de Historia del Ecuador</a> - <em>Spanish</em> - We were going to Ecuador and I didn’t know anything about the history of the country so I found this 200 page cliff’s notes history written for Ecuadorean high school students.</li>
  <li><a href="https://www.amazon.com/Savage-Detectives-Reread-Rereadings-ebook/dp/B094YXXZVY/ref=tmm_kin_swatch_0?_encoding=UTF8&amp;sr=">The Savage Detectives Reread</a> - I had a feeling I was missing quite a bit so sought out this academic English language book to get deeper context.</li>
  <li><a href="https://www.amazon.com/Origin-Species-150th-Anniversary/dp/0451529065">On the Origin of Species</a> - We were going to the Galapagos, and I’d never actually read Darwin so I figured now was the time. Victorian prose is <em>rough</em>, but it is amazing how much he got right. I enjoyed <a href="https://scienceblogs.com/bloggingtheorigin">this series of an evolutionary biologist blogging through reading the book</a> in 2009.</li>
</ul>]]></content><author><name>Patrick Joyce</name></author><category term="year-end-book-lists" /><summary type="html"><![CDATA[I read 18 books in 2023. Including 5 in Spanish. Here they are.]]></summary></entry><entry><title type="html">Monitor For The Absence Of Success, Not Just the Presence of Failures</title><link href="https://pragmati.st/2023/08/13/monitor-for-the-absence-of-success/" rel="alternate" type="text/html" title="Monitor For The Absence Of Success, Not Just the Presence of Failures" /><published>2023-08-13T00:00:00+00:00</published><updated>2023-08-13T00:00:00+00:00</updated><id>https://pragmati.st/2023/08/13/monitor-for-the-absence-of-success</id><content type="html" xml:base="https://pragmati.st/2023/08/13/monitor-for-the-absence-of-success/"><![CDATA[<p>Let’s start with a brief story: last year one of my teams built a new system that was in a limited beta. The system was dependent on receiving messages from an upstream system owned by a different team in an entirely different part of the company. It processed those messages, using them to display something to customers that had a meaningful positive impact on purchase conversion for the small number of merchants that were using the new feature.</p>

<p>After an intense and successful Black Friday / Cyber Monday period, most of the team was looking forward to taking a well-earned rest around the end of the year. We were confident that our on-call rotations and monitoring would let people mostly unplug and recharge, while knowing that if anything went wrong, we’d know about it.</p>

<p>Unfortunately, when we came back from a week off, we realized that the buyer-facing feature had essentially been disabled for a week and <em>we didn’t know</em>.</p>

<!--more-->

<h2 id="what-happened">What happened?</h2>
<p>The upstream team got nervous about their ability to support the new system and turned it off before they went on break. This could have been a valid business decision, but unfortunately they forgot to tell us. So we were surprised to learn that this new and valuable feature was essentially disabled for a week.</p>

<h2 id="how-did-we-miss-it">How did we miss it?</h2>
<p>We <em>did</em> have monitoring in place.</p>

<p>We had alerts configured to page us if the job that processed the messages failed. And we had other alerts configured that would page us if there was a backup of messages.</p>

<p>What we <em>didn’t</em> have was an alert that paged us if <em>no messages</em> were sent.</p>

<h2 id="the-lesson">The Lesson</h2>
<p><strong>When setting up comprehensive monitoring you must monitor both for the absence of success as well as the presence of failure.</strong></p>

<p>Monitoring for the absence of success is monitoring for when something you expect to happen <em>didn’t happen</em> as opposed to only monitoring for when an unexpected failure <em>did happen</em>.</p>

<p>I’ve found that teams naturally monitor for failures. The first alerts that get set up are generally for spikes in 500s, errors, or failed background jobs. And those are good! But they aren’t sufficient.</p>

<p>The goal of monitoring is to have confidence that your system is working as expected. To do that you need to monitor whether the key outcomes of your system are succeeding.</p>

<h2 id="common-challenges">Common Challenges</h2>
<h3 id="monitoring-at-the-right-level-of-abstraction">Monitoring At The Right Level of Abstraction</h3>
<p>I find that when monitoring for the absence of success it is important to define the success at the right level of abstraction. In the instance above we could have directly monitored for the number of messages successfully processed.</p>

<p>But we might have been better off monitoring at even an even higher level of abstraction (the number of times we displayed the buyer facing feature)</p>

<p>Monitoring at higher levels allows you to catch more issues with a single monitor. For instance, monitoring that the expected number of messages have been processed would have caught the issue where the upstream system stopped sending messages, but it wouldn’t have caught an issue where we failed to display the buyer facing feature. Monitoring the number of times we displayed the buyer facing feature is better because it would have caught an error in any part of the system and also is monitoring the action that directly created business value.</p>

<h3 id="seasonality">Seasonality</h3>
<p>Many systems have a natural seasonality of usage within a day. If you run a service with overwhelmingly North American user base there won’t be a lot of usage at 4am ET / 1am PT.</p>

<p>There are a couple of ways to handle this. The simplest is to configure your monitoring to only alert during times of day where there is generally enough usage to confidently detect abberations.</p>

<h3 id="high-cardinality-of-data">High Cardinality of Data</h3>
<p>High cardinality refers to having a large number of groupings of values in a dataset. In the context of monitoring, it can make detecting specific anomalies more complex due to the sheer variety of potential failures.</p>

<p>For example, at LivingSocial, we negotiated different rates for each of our business lines in various countries, resulting in a unique merchant account for every country and business line. This high cardinality made it challenging to monitor success rates for specific combinations like travel purchases in New Zealand, which were rare and therefore too noisy to detect changes in success rate in the same way we did for higher volume merchant accounts.</p>

<p>One way to manage high cardinality is to set up less granular monitoring that checks for the presence of success over a longer period of time. For instance, after an issue with the configuration at our payment gateway led to a days long outage of the New Zealand/travel combination I set up a monitor to check that there had been at least one successful transaction in the last 12 hours for the New Zealand/Travel combination. This might be slower to a alert than the finer grained alerting we had in higher volume countries but it was effective in detecting anomalies within highly granular data without leading to false positives.</p>

<h2 id="conclusion">Conclusion</h2>
<p>Effective monitoring goes beyond merely watching for failures. Remember, it’s not just about what could go wrong; it’s also about ensuring what should go right, does. Your users, your team, and your bottom line will thank you.</p>]]></content><author><name>Patrick Joyce</name></author><summary type="html"><![CDATA[Let’s start with a brief story: last year one of my teams built a new system that was in a limited beta. The system was dependent on receiving messages from an upstream system owned by a different team in an entirely different part of the company. It processed those messages, using them to display something to customers that had a meaningful positive impact on purchase conversion for the small number of merchants that were using the new feature. After an intense and successful Black Friday / Cyber Monday period, most of the team was looking forward to taking a well-earned rest around the end of the year. We were confident that our on-call rotations and monitoring would let people mostly unplug and recharge, while knowing that if anything went wrong, we’d know about it. Unfortunately, when we came back from a week off, we realized that the buyer-facing feature had essentially been disabled for a week and we didn’t know.]]></summary></entry><entry><title type="html">What I Read in 2022</title><link href="https://pragmati.st/2023/01/01/what-i-read-in-2022/" rel="alternate" type="text/html" title="What I Read in 2022" /><published>2023-01-01T00:00:00+00:00</published><updated>2023-01-01T00:00:00+00:00</updated><id>https://pragmati.st/2023/01/01/what-i-read-in-2022</id><content type="html" xml:base="https://pragmati.st/2023/01/01/what-i-read-in-2022/"><![CDATA[<!--more-->

<p><img src="/images/book_collage_2022.jpg" alt="Collage of book covers of books I read in 2022" /></p>

<h2 id="january">January</h2>
<ul>
  <li><a href="https://www.amazon.com/Enemy-All-Mankind-Historys-Manhunt/dp/0735211604">Enemy of All Mankind</a> - Interesting and relatively light read of piracy and the world’s first international manhunt at the dawn of modern nation states.</li>
  <li><a href="https://www.amazon.com/Soccermatics-Mathematical-Adventures-Pro-Bloomsbury/dp/1472924142/">Soccermatics: Mathematical Adventures in the Beautiful Game</a> - It was fine. I have a much better soccer book later in the year though.</li>
</ul>

<h2 id="february">February</h2>
<ul>
  <li><a href="https://www.amazon.com/Dilla-Time-Afterlife-Producer-Reinvented/dp/0374139946"><strong>Dilla Time</strong></a> - This is one of the best books I have read in the last 10 years. It is about J.Dilla, possibly my favorite producer of all time, but it is also about the history of Black music in America, technological development and disruption, the entire neo soul movement, and the cost of enabling a single minded obsession. This book left me speechless.</li>
</ul>

<h2 id="march">March</h2>
<ul>
  <li><a href="https://www.amazon.com/Cien-años-soledad-Aniversario-Illustrated/dp/0525562443/ref=sr_1_1?keywords=cien+anos+de+soledad+spanish&amp;qid=1672695612&amp;sprefix=cien+%2Caps%2C83&amp;sr=8-1">Cien Años de Soledad</a> - This was a bucket list book for me. After I got back from Spain and my Spanish was at its peak I started this book. Then the semester started back up, and I had to set it down. Then on the next break I tried again. I’d probably read the first 75 pages 3 times, but had never gotten through it. This time I did. Technology helps: I’d read the kindle book, while listening to the spanish audio book with Audible. Then after finishing a chapter in Spanish, I’d read it in English, then re-read it in Spanish. It’s a difficult book and probably wasn’t a wise choice for my first foray back into reading in Spanish but I’m glad I did it.</li>
  <li><a href="https://www.amazon.com/Scout-Mindset-People-Things-Clearly-ebook/dp/B07L2HQ26K/">The Scout Mindset: Why Some People See Things Clearly Others Don’t</a> - Essentially a book long exploration of how to defeat confirmation bias.</li>
  <li><a href="https://www.amazon.com/Scorecasting-Hidden-Influences-Behind-Sports-ebook/dp/B004C43GC4/ref=tmm_kin_swatch_0?_encoding=UTF8&amp;qid=&amp;sr=">Scorecasting</a> - This was a fine beach read but nothing special. It had a “freakanomics but for sports” vibe but wasn’t as engaging as I remember Freakanomics being (althogh it has been 15+ years since I read that)</li>
</ul>

<h2 id="april">April</h2>
<ul>
  <li><a href="https://www.amazon.com/Origin-Genetic-Americas-Jennifer-Raff-ebook/dp/B08B6F2YFX/">Origins: A Genetic History of the Americas</a> - Using ancient DNA to trace human migration to the Americas.</li>
  <li><a href="https://www.amazon.com/Upheaval-Turning-Points-Nations-Crisis-ebook/dp/B07H2997W4/">Upheaval: Turning Points for Nations in Crisis</a> - The stories of how different countries responded to crises in different ways were interesting. The attempt to construct an underlying theory for how nations respond to crisis from an N of ~8 was… a stretch.</li>
</ul>

<h2 id="may">May</h2>
<ul>
  <li><a href="https://www.amazon.com/Most-Never-Want-Have-Again/dp/1481867954/">The Most Fun I Never Want To Have Again: A Mid-Life Crisis in Community Banking</a> - A first person narrative of launching a community bank on the outskirts of Atlanta in the run up to the 2008 financial crisis.</li>
</ul>

<h2 id="june">June</h2>
<ul>
  <li><a href="https://www.amazon.com/Talent-Identify-Energizers-Creatives-Winners/dp/1250275814">Talent: How to Identify Energizers, Creatives, and Winners Around the World</a> - Interesting and thought provoking read. But I was left with the feeling that the specific techniques suggested by the authors wouldn’t necessarily generalize to normal recruiting without some additional guardrails. Tyler Cowen is a professor and a lot of his interviewing is part of grantmaking and Daniel Gross is an early stage VC who is interviwing founders. In both of those scenarios you’re seeking outlier performers and high variance is fine (it is fine if most grants / investments don’t pan out if you find one or two “hits”). But in interviewing at a normal company, even a top notch company with very high standards, your downside risk is higher.</li>
</ul>

<h2 id="july">July</h2>
<ul>
  <li><a href="https://www.amazon.com/Locos-ricos-y-asiáticos-Spanish-ebook/dp/B07F17Z633">Locos, Ricos, and Asiáticos</a> - After Cien Años de Soledad I needed something lighter so went with the Spanish translation of Crazy Rich Asians. Wasn’t quite as easy as I was hoping for as there is a ton of luxury goods vocabulary that I didn’t know. Fun read though overall. I had enjoyed the movie, but, as always, the book is better.</li>
  <li><a href="https://www.amazon.com/Hábitos-atómicos-Spanish-James-Clear-ebook/dp/B07PLNHHDP/"><strong>Hábitos Atómicos</strong></a> - Now this was more my speed. Turns out that mass market business / personal development books are written with relatively clear language so this was a way easier read. Also a good book. Emphasis on</li>
  <li><a href="https://www.amazon.com/Rome-Empires-Story-Greg-Woolf-ebook/dp/B008FK84EQ">Rome: An Empire’s Story</a> - We went to Italy in July and I like to learn a bit about the places I went. This wasn’t a comprehensive history of the Roman Empire, but was more a history of the development of the <em>concept of empire</em>.</li>
  <li><a href="https://www.amazon.com/Florentines-Galileo-Transformation-Civilization-Histories-ebook/dp/B08LDY4WD1">The Florentines: From Dante to Galileo: The Transformation of Western Civilization</a> - This I found more compelling. It is a history of the emergence of the Reannaisance in Florence focused on specific people.</li>
</ul>

<h2 id="august">August</h2>
<ul>
  <li><a href="https://www.amazon.com/Extra-Life-History-Living-Longer-ebook/dp/B08H18J8S4/">Extra Life: A Short History of Living Longer</a> - A look at how we have doubled global life expectancy from ~40 in 1920 to ~80 today.</li>
</ul>

<h2 id="september">September</h2>
<ul>
  <li><a href="https://www.amazon.com/Anarchy-Company-Corporate-Violence-Pillage-ebook/dp/B07W952J1F/ref=sr_1_1?keywords=the+anarchy&amp;qid=1672696626&amp;s=digital-text&amp;sprefix=the+anarc%2Cdigital-text%2C71&amp;sr=1-1">The Anarchy</a> - A history of the East India company and more specifically the 100 year period of chaos following the East India company’s toppling of the Mughal empire. Almost everything in this book is insane, from a private company essentially acting as sovereign of one of the largest nations on earth to descriptions of torture more depraved than anything in Game of Thrones.</li>
</ul>

<h2 id="november">November</h2>
<ul>
  <li><a href="https://www.abramsbooks.com/product/net-gains_9781419758911/"><strong>Net Gains</strong></a> - I’m a sucker for analytical soccer books. I really enjoyed that this book was written by an American who came up in our youth development system and played through college. Good overview of the evolution of an analytical understanding of the game. Not a ton here that is new if you’ve read “Football Hackers” but I thoroughly enjoyed it and highly recommend.</li>
</ul>

<h2 id="december">December</h2>
<ul>
  <li><a href="https://www.amazon.com/MINDSET-Spanish-CAROL-DWECK-ebook/dp/B0744LQGH9/">Mindset: La Actitud del Éxito</a> - I’ve been familiar with the concept of Growth Mindset and have found it a useful tool for thinking about how I approach challenges and how I attempt to steer my children. The book is a bit of a mixed bag, particualrly because I was already coming convinced that Growth Mindset was a real thing (they even did a well [designed replication study(https://marginalrevolution.com/marginalrevolution/2018/03/growth-mindset-replicates.html)]). There are some good examples of how to phrase praise to. But I think the book at time veered into labeling anything the authour liked as “Growth Mindset” and anything they didn’t like as “Fixed Mindset”. In particular, I found the chapter arguing for Jack Welch—famous for living in an $80,000/month GE owned apartment <em>even after he retired</em>—as a down to earth, man of the people, Growth Mindset CEO boderline hilarious because he cut the executive dining room. Reading it in Spanish I learned <em>a lot</em> of synonyms for “challenge”</li>
</ul>]]></content><author><name>Patrick Joyce</name></author><category term="year-end-book-lists" /><summary type="html"><![CDATA[I read 18 books in 2022. Including 4 in Spanish. Here they are.]]></summary></entry><entry><title type="html">A Brief Morality Play About A Cool, User Friendly Feature</title><link href="https://pragmati.st/2022/08/11/a-brief-morality-play-about-a-cool-user-friendly-feature/" rel="alternate" type="text/html" title="A Brief Morality Play About A Cool, User Friendly Feature" /><published>2022-08-11T00:00:00+00:00</published><updated>2022-08-11T00:00:00+00:00</updated><id>https://pragmati.st/2022/08/11/a-brief-morality-play-about-a-cool-user-friendly-feature</id><content type="html" xml:base="https://pragmati.st/2022/08/11/a-brief-morality-play-about-a-cool-user-friendly-feature/"><![CDATA[<p>I saw a feature request from my friend and former colleague Ellen Beldner last night on Twitter:</p>

<blockquote>
  <p>i simply want a protocol that embeds password requirements into the form field html and that password managers can use to create a matching PW</p>
  <footer>
    <strong>Ellen Beldner</strong>
    <cite>
      <a href="https://mobile.twitter.com/ellenbeldner/status/1557405353674825728">Twitter</a>
    </cite>
  </footer>
</blockquote>

<p>What follows is a running diary of my thoughts for the next five minutes where I:</p>

<ol>
  <li>Get super excited about her idea</li>
  <li>Figure out how it could work technically with current standards</li>
  <li>Realize why it wouldn’t do much good in the real world</li>
</ol>

<!--more-->
<hr />

<p><strong>0m:01s</strong> — That sounds amazing! I <strong>hate</strong> when the password 1Password generates is rejected. How would I implement that?</p>

<p><strong>0:10</strong> — Wait, doesn’t HTML5 have support for client side validation built in? Wouldn’t that cover it? I bet I could figure out how to make this work and impress my friend.</p>

<p><strong>00:30</strong> — It does! There isn’t a full protocol, but HTML5 allows for specifying regex patterns that an input is required to match. There’s even a <a href="https://www.w3schools.com/howto/howto_js_password_validation.asp">w3schools tutorial</a> on how to set up regex validation for a password field complete with an example:</p>

<figure class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="o">&lt;</span><span class="n">input</span> <span class="n">type</span><span class="o">=</span><span class="s2">"password"</span> <span class="nb">id</span><span class="o">=</span><span class="s2">"psw"</span> <span class="nb">name</span><span class="o">=</span><span class="s2">"psw"</span> <span class="n">pattern</span><span class="o">=</span><span class="s2">"(?=.*</span><span class="se">\d</span><span class="s2">)(?=.*[a-z])(?=.*[A-Z]).{8,}"</span> <span class="n">title</span><span class="o">=</span><span class="s2">"Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters"</span> <span class="n">required</span><span class="o">&gt;</span></code></pre></figure>

<p><strong>0:35</strong> — OK, so I’ve got a regex, what would do I need to know to make sure that my generated password matches?</p>

<p><strong>0:45</strong> — Here are the options for a new password in 1Password:</p>

<p><img src="/images/1Password-new-password-screen.png" alt="1Password New Password Options" /></p>

<p><strong>1:00</strong> — Alright, I think I just need to know four things:</p>

<ol>
  <li><strong>Is there a minimum length?</strong> But this doesn’t seem very important because it is unlikely your password manager will try to generate a password that is too <em>short</em>.</li>
  <li><strong>Is there a <em>maximum</em> length?</strong> <em>This one matters</em>. This is probably the most common failure reason when 1Password generated passwords exceed the arbitrarily short password lengths that some sites mandate.</li>
  <li><strong>Are there any characters that are forbidden?</strong> This is the next most common reason I’ve had a generated password fail. Normally when there is a blocklist of certain symbols.</li>
  <li><strong>Are there any classes of characters that are required</strong> “Must contain at least one number, one lowercase letter, and one capital letter”. Won’t worry about this one, because I haven’t seen it  prevent a generated password from working.</li>
</ol>

<p><strong>1:30</strong> — So… how do you extract that information from an arbitrary regex. Well, I’m sure that there are smart ways to do this, probably something with an AST of the regex?</p>

<p><strong>2:15</strong> — But “perfect is the enemy of the good” and I can already think of two pretty dumb ways to do this so I don’t need to use my CS degree today:</p>

<ol>
  <li><em>mostly</em> dumb: I could probably parse out just the max length and any characters that are globally blocked fairly easily.</li>
  <li><em>really</em> dumb: When generating a password I could just feed the regex in, try a few variations with my current rules, then loosen the rules if it fails, and try again. Generate 5 random passwords, if they all fail remove the requirement for symbols, generate 5 more, if those all fail shorten the length by one, repeat until something works or we hit an arbitrary minimum size. Voila!</li>
</ol>

<p><strong>2:45</strong> — Alright… I feel like we’re getting somewhere! That may be a dumb, inefficient implementation but I bet it would work for 99% of cases.</p>

<p><strong>2:46</strong> — But… if I can figure out how to make this work in 5 minutes of thinking, wouldn’t the people who spend their whole working lives thinking about password managers have thought of this? I’m sure they dogfood their products and they have to be extra annoyed every time a site rejects their password…</p>

<p><strong>3:00</strong> — I have a feeling that the sites with annoying password requirements that reject strong passwords aren’t implementing a ton of the newest HTML5 stuff.</p>

<p><strong>3:01</strong> — How can I test that hunch? I’ve had autogenerated passwords rejected, but I don’t remember <em>where</em> off the top of my head.</p>

<p><strong>3:30</strong> — Thankfully everything exists on the Internet! A quick search for “<a href="https://www.google.com/search?client=safari&amp;rls=en&amp;q=sites+with+dumb+password+requirements&amp;ie=UTF-8&amp;oe=UTF-8">sites with dumb password requirements</a>” brings me to <a href="https://github.com/duffn/dumb-password-rules/blob/master/README.rst">Dumb Password Rules</a> on GitHub.</p>

<p><strong>3:45</strong> — And… I have accounts with a couple of these sites so let’s check and see if they look like they’re implementing anything modern like HTML5 form hints.</p>

<p>(checks the HTML for the password reset forms for two sites from the list)</p>

<p><strong>4:55</strong> — <em>They decidedly are not.</em></p>

<p><strong>5:00</strong> — OK… so this feature could totally exist! <em>But only if sites with annoying password requirements added something to their HTML</em>. And if I worked on a password manager I wouldn’t build this feature, because I doubt it would meaningfully reduce how many autogenerated passwords get rejected in real world usage. What we have is a problem of adverse selection:</p>

<ol>
  <li>The sites that implement new, user friendly features like standards based, HTML5 form validation are the least likely to have arbitrary and restrictive password requirements that reject password manager generated passwords <em>and</em></li>
  <li>The sites with dumb requirements like “Passwords must be between 6 and 10 characters and can only be letters and numbers” are the <em>last</em> sites that would add a validation regex pattern to help password managers.</li>
</ol>

<hr />

<p>And thus I conclude this edition of “Patrick gets excited about a feature idea, figures out how it could work, and then crushes his own dreams in 5 minutes.”</p>

<hr />

<p>I wish I had a more useful lesson here. Maybe some form of <a href="https://fs.blog/chestertons-fence/">Chesterton’s Fence</a> like “If you have an idea for an obvious feature in someone else’s product, ask yourself why they haven’t built it before you propose it”</p>

<p>But I don’t think that is particularly useful.</p>

<p>Because you don’t get any credit for calling that something will fail. The <em>default</em> is that things don’t work.</p>

<p>So I’ve spent the last decade training myself to look for “<em>how could it work?</em>” and “<em>how much would it matter if it did?</em>”</p>

<p>At the same time, quickly eliminating ideas that seem good but wouldn’t actually work is necessary to spend time on the ideas that really matter, so being able to quickly eliminate plausible sounding ideas <em>is</em> valuable.</p>]]></content><author><name>Patrick Joyce</name></author><summary type="html"><![CDATA[I saw a feature request from my friend and former colleague Ellen Beldner last night on Twitter: i simply want a protocol that embeds password requirements into the form field html and that password managers can use to create a matching PW Ellen Beldner Twitter What follows is a running diary of my thoughts for the next five minutes where I: Get super excited about her idea Figure out how it could work technically with current standards Realize why it wouldn’t do much good in the real world]]></summary></entry><entry><title type="html">What I Read in 2021</title><link href="https://pragmati.st/2022/03/05/what-i-read-in-2021/" rel="alternate" type="text/html" title="What I Read in 2021" /><published>2022-03-05T00:00:00+00:00</published><updated>2022-03-05T00:00:00+00:00</updated><id>https://pragmati.st/2022/03/05/what-i-read-in-2021</id><content type="html" xml:base="https://pragmati.st/2022/03/05/what-i-read-in-2021/"><![CDATA[<p><img src="/images/book_collage_2021.jpg" alt="Collage of book covers of books I read in 2021" /></p>

<h2 id="january">January</h2>
<ul>
  <li><a href="https://www.amazon.com/Pachinko-National-Book-Award-Finalist/dp/1455563935"><strong>Pachinko</strong></a> - Epic multi-generational story of Koreans in Japan.</li>
  <li><a href="https://www.amazon.com/Station-Eleven-Emily-John-Mandel-ebook/dp/B00J1IQUYM"><strong>Station Eleven</strong></a> - Excellent. I’m not sure that reading about a world ending pandemic was great for my mental state last January. The HBO show currently airing is also beautifully shot. It is meaningfully different than the book owing to the need to have the characters, you know, meet. The book is better, but the TV show is different enough that you can enjoy each separately.</li>
</ul>

<h2 id="february">February</h2>
<ul>
  <li><a href="https://www.amazon.com/Influence-Without-Authority-Allan-Cohen-ebook/dp/B075MSLV6W/">Influence Without Authority</a> - I find most business books overly transactional but if I can learn one thing from them that makes me better I consider it time well spent. In this case that one thing was that people value different things, so paying attention to what your coworkers value makes it possible to give them things they care about. Which in turn makes it more likely that they’ll be able to help you. Sounds cynical, but mostly is about treating people how <em>they</em> want to be treated.</li>
  <li><a href="https://www.amazon.com/Lords-Strategy-Intellectual-History-Corporate/dp/1591397820">Lord of Strategy</a> - I’ve worked with a lot of ex-management consultants, but have never been a management consultant. Interesting history of the creation and development of management consulting and modern business schools.</li>
</ul>

<h2 id="may">May</h2>
<ul>
  <li><a href="https://leanpub.com/theMLbook"><strong>The Hundred-Page Machine Learning Book</strong></a> - I’ve worked closely with Data Scientists for years, but I didn’t really have any hands-on experience. This was an excellent—and brief—overview that laid the conceptual groundwork to do a deeper hands-on dive during my break between jobs. Recommended to any engineer who works with data scientists.</li>
  <li><a href="https://www.amazon.com/Idea-Factory-Great-American-Innovation/dp/0143122797"><strong>The Idea Factory</strong></a> - History of Bell Labs. They invented <em>everything</em></li>
  <li><a href="https://www.amazon.com/Outsider-History-Goalkeeper-Jonathan-Wilson-ebook/dp/B00GU3560U">The Outsider: A History of the Goalkeeper</a> - Very British centric. Wanted to enjoy this more than I did.</li>
  <li><a href="https://www.amazon.com/dp/B08V1N49ZN/">The Bomber Mafia</a> - Malcom Gladwell is a great story-teller. Not his best book but very enjoyable and one of the better produced audio books I’e ever listened to.</li>
  <li><a href="https://www.amazon.com/gp/product/B074C3123B">Veronica Mars: The Thousand Dollar Tan Line</a> - We watched Veronica Mars a few years ago and I quite enjoyed it. Kristen Bell read the audio book version. Not the worst way to spend a cross-country flight.</li>
  <li><a href="https://www.amazon.com/Veronica-Mars-Original-Mystery-Thomas-ebook/dp/B00KAFX8HM/">Veronica Mars: Mr. Kiss and Tell</a></li>
  <li><a href="https://www.amazon.com/dp/B08V91YY8R">The Premonition</a> - Michael Lewis is a great writer. Scathing on the CDC.</li>
</ul>

<h2 id="june">June</h2>
<ul>
  <li><a href="https://www.amazon.com/Goliath-Monopolies-Secretly-Took-World/dp/1501183087">Goliath</a> - This book made me <em>angry</em>. There are plenty of problems with large companies but this felt like Matt Stoler started with the conclusion “big = EVIL” and then portrayed every scenario in the most negative possible light. For instance, he wrote in scandalized tones that the A&amp;P ruthlessly bullied food distributors for lower prices in the 1930s and I wanted to scream “You mean they achieved lower food prices for millions of Americans!”</li>
  <li><a href="https://www.amazon.com/Big-Business-Letter-American-Anti-Hero/dp/1250110548">Big Business: A Love Letter to an American Anti-Hero</a> - I deliberately read this next as a contrast to Goliath and found it a much more compelling argument.</li>
  <li><a href="https://www.amazon.com/Entangled-Life-Worlds-Change-Futures/dp/0525510311/"><strong>Entangled Life: How Fungi Make Our Worlds, Change Our Minds &amp; Shape Our Futures</strong></a> - Fungi are super weird and break a bunch of my assumptions about how life works.</li>
  <li><a href="https://www.amazon.com/Working-Backwards-Insights-Stories-Secrets-ebook/dp/B08BYCQBZN/">Working Backwards</a> - Detailed view of how Amazon worked (at least how Amazon worked at some point in the past). I’ve worked with several ex-Amazon people and can see the value of many of these practices. A meeting that consists of reviewing a rigorously prepared 6-pager that everyone has read will lead to better discussion and decision than walking through a presentation live. However, these practices evolved in a very specific environment at Amazon and they can only be successful if the environment shares the values that produced them.</li>
  <li><a href="https://www.amazon.com/Hands-Machine-Learning-Scikit-Learn-TensorFlow-ebook-dp-B07XGF2G87/dp/B07XGF2G87/ref=mt_other?encoding=UTF8&amp;me=&amp;qid="><strong>Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow</strong></a> - Practical introduction to a broad array of machine learning techniques. Reading “The Hundred Page Machine Learning Book” before this gave me some conceptual understanding. Doing all the exercises in this book gave me a much deeper understanding of those concepts.</li>
  <li><a href="https://www.amazon.com/Lying-Money-Legendary-Frauds-Workings-ebook/dp/B078WFT5JV">Lying for Money: How Legendary Frauds Reveal the Workings of Our World</a> - Building stuff on the Internet means dealing with fraud. This was a fun history of the ways in which humans defraud each other and the very human vulnerabilities those frauds exploit.</li>
</ul>

<h2 id="july">July</h2>
<ul>
  <li><a href="https://www.amazon.com/gp/product/B08TB1TP7H/ref=dbs_a_def_rwt_bibl_vppi_i0">Amazon Unbound</a> - Amazon is one of the most impactful organizations in the world today. This was a deeply researched history of how they went from a large e-commerce retailer to one of the most important companies in the world.</li>
  <li><a href="https://www.amazon.com/Range-Generalists-Triumph-Specialized-World/dp/0735214484">Range</a> - I <em>loved</em> David Epstein’s first book “The Athlete Gene”. This is an equally well written book about the benefits of avoiding early specialization.</li>
  <li><a href="https://www.amazon.com/Guide-Good-Life-Ancient-Stoic/dp/1522632735??tag=dailystoic07-20"><strong>A Guide to the Good Life: The Ancient Art of Stoic Joy</strong></a> - Excellent personal advice on how to apply the lessons of ancient stoic philosophy to live a good life in the modern world. When I’ve practiced the principles in this book I’ve felt more peaceful and joyful.</li>
  <li><a href="https://www.amazon.com/How-Be-Epicurean-Ancient-Living-ebook/dp/B07NCV1D94/">How to Be an Epicurean: The Ancient Art of Living Well</a> - I thought I should examine some of the other ancient schools of philosophies. This didn’t feel as applicable.</li>
</ul>

<h2 id="august">August</h2>
<ul>
  <li><a href="https://www.amazon.com/gp/aw/d/B001D1SRRS/">The Machine That Changed the World: The Story of Lean Production</a> - Lean manufacturing is a background influence on a lot of modern software development. Two things were striking in the book that originally coined the term: how incredibly <em>inefficient</em> American auto manufacturing was in the 1970s and the palpable fear of Japanese economic domination in the 1980s.</li>
  <li><a href="https://www.amazon.com/Ministry-Future-Kim-Stanley-Robinson-ebook/dp/B084FY1NXB/">The Ministry for the Future: A Novel</a> - I loved the Red Mars trilogy when I was a kid. This was a hard science fiction look at a near future ravished by climate change. This book made me deeply anxious. Which I think was the author’s intention.</li>
  <li><a href="https://www.amazon.com/Finite-Infinite-Games-James-Carse-ebook/dp/B004W3FM4A/">Finite and Infinite Games</a> - The concept of finite and infinite games is central to how Shopify looks at the world. I didn’t love the writing but I do love the concept.</li>
  <li><a href="https://www.amazon.com/Cost-These-Dreams-Stories-Business/dp/014313387X">The Cost of These Dreams: Sports Stories and Other Serious Business</a> - Wright Thompson has written two of my favorite magazine articles ever: <a href="http://www.espn.com/espn/feature/story/_/page/Michael-Jordan/michael-jordan-not-left-building">Michael Jordan Has Not Left The Building</a> and <a href="http://www.espn.com/espn/feature/story/_/id/10984370/portrait-serial-winner-luis-suarez-soccer-most-beautiful-player">Portrait of a Serial Winner</a> about Luis Suarez. This is an anthology where each article seems to deal with the deep pain and sacrifice that comes from a pursuit of greatness.</li>
</ul>

<h2 id="september">September</h2>
<ul>
  <li><a href="https://www.amazon.com/Why-We-Sleep-Unlocking-Dreams-ebook/dp/B06ZZ1YGJ5/"><strong>Why We Sleep: Unlocking the Power of Sleep and Dreams</strong></a> - Pretty amazing overview on the importance of sleep. I’m not sure I believe <em>everything</em> in the book, but it has changed my habits: I haven’t had any caffeine since September.</li>
  <li><a href="https://www.amazon.com/gp/aw/d/9814841900/">Crossroads: A Popular History of Malaysia and Singapore</a> - Singapore is a <em>tiny</em> nation that has become wealthy through a relentless prioritization of growth and rising living standards over all else—including basic personal freedoms.</li>
</ul>

<h2 id="october">October</h2>
<ul>
  <li><a href="https://www.amazon.com/gp/aw/d/B017QL8UOS/ref=tmm_kin_title_0?ie=UTF8&amp;qid=1466257955&amp;sr=8-1">The Perfect Bet</a> - I don’t gamble, but I very much enjoy <em>thinking about gambling</em>.</li>
  <li><a href="https://www.amazon.com/Pie-Sky-Remy-Lai/dp/1250314097"><strong>Pie in the Sky</strong></a> - I generally don’t include the books I read with my kids here, but this book was <em>beautiful</em>. It is the story of an 11 year old boy who immigrates to Australia with his mother and little brother after the death of his father. Funny and heart wrenching. JoJo ended up having to read the last few pages out loud because I couldn’t get the words out through my sobs.</li>
  <li><a href="https://www.amazon.com/Success-Luck-Good-Fortune-Meritocracy-ebook/dp/B017I2M8ZC/">Success and Luck</a> - I have led an <em>unbelievably</em> fortunate life. I read this as part of a conscious exercise in gratitude to appreciate that luck. The book also makes a strong argument for dramatically higher marginal tax rates on the wealthy and how that would deflate top-end asset prices but increase utility… even for those who are being taxed dramatically higher. This <a href="https://www.theatlantic.com/magazine/archive/2016/05/why-luck-matters-more-than-you-might-think/476394/">adaptation of the introduction</a> is worth reading.</li>
  <li><a href="https://www.amazon.com/Team-Teams-Rules-Engagement-Complex-ebook/dp/B00KWG9OF4/">Team of Teams</a> - Solid personal narrative of building organizations that can adapt quickly to changing conditions.<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup></li>
</ul>

<h2 id="november">November</h2>
<ul>
  <li><a href="https://www.amazon.com/Hip-Hop-Other-Things-Shea-Serrano-ebook/dp/B093GP147K/ref=tmm_kin_swatch_0?_encoding=UTF8&amp;qid=&amp;sr="><strong>Hip Hop (And Other Things)</strong></a> - I love Shea Serrano. Thoroughly enjoyed this. I also very much enjoyed his podcast “No Skips” (particularly The Miseducation of Lauren Hill episode)</li>
  <li><a href="https://www.amazon.com/Estonia-A-Modern-History/dp/1787383377">Estonia: A Modern History</a> - I was more interested in the recent history about the extremely digital savvy nation that emerged after Communism, but this was more focused on early to mid 20th century. Despite not being what I hoped I learned a lot more about the Baltic states than I previously new.</li>
  <li><a href="https://www.amazon.com/gp/product/0593087682">Trillions: How a Band of Wall Street Renegades Invented the Index Fund and Changed Finance Forever</a> - I invest in index funds because I know I’m not smarter than the market. The indifference and hostility that met the first index funds is amazing given that index funds eventually became the default form of investment.</li>
  <li><a href="https://www.amazon.com/Rational-Optimist-Prosperity-Evolves-P-s/dp/0061452068">The Rational Optimist</a> - There is a lot of pessimism about the future. I intentionally seek out well argued thinking about why we should be optimistic for the future.</li>
</ul>

<h2 id="december">December</h2>
<ul>
  <li><a href="https://www.amazon.com/Box-Shipping-Container-Smaller-Economy-ebook/dp/B003U2TR5O">The Box: How the Shipping Container Made the World Smaller and the World Economy Bigger</a> - Fascinating, but also one of those books I think might have been better as 2 or 3 long magazine articles.</li>
  <li><a href="https://www.amazon.com/dp/B08QGKHYHT/">The Last Shadow</a> - I <em>love</em> the Ender series. This… didn’t really need to exist, but wasn’t the worst beach read.</li>
  <li><a href="https://www.amazon.com/One-Billion-Americans-Thinking-Bigger-ebook/dp/B082ZR6827"><strong>One Billion Americans</strong></a> - For the US to maintain its global influence we need to grow. The policy recommendations are reasonable and seem like they should be achievable if we committed to increasing growth. This is similar to Derek Thompson’s <a href="https://www.theatlantic.com/ideas/archive/2022/01/scarcity-crisis-college-housing-health-care/621221/">Abundance Agenda</a>. I work in growth companies because—for all the challenges—everything is better when a company is growing. In a stagnant or slow-growing company there is a zero-sum competition for resources and promotions. But in a growth company there is an abundance of opportunity and it is clear that when person succeeds it makes it more likely that everyone else also succeeds. I’d like to see the US become a growth country again, and I think we can do it.</li>
  <li><a href="https://www.amazon.com/Mans-Search-Meaning-Viktor-Frankl-ebook/dp/B009U9S6FI">Man’s Search for Meaning</a> - A personal story of surviving the Holocaust paired with a practical approach to finding a meaning and therefore satisfaction in the less dire situations of everyday life.</li>
</ul>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>Warning: The repeated references to Michael Flynn as a valuable and competent member of senior military leadership as opposed to a crazy person actively working to overthrow the US government are… jarring. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Patrick Joyce</name></author><category term="year-end-book-lists" /><summary type="html"><![CDATA[I read 39 books in 2021. Here they are.]]></summary></entry><entry><title type="html">What I Read in 2020</title><link href="https://pragmati.st/2021/02/14/what-i-read-in-2020/" rel="alternate" type="text/html" title="What I Read in 2020" /><published>2021-02-14T00:00:00+00:00</published><updated>2021-02-14T00:00:00+00:00</updated><id>https://pragmati.st/2021/02/14/what-i-read-in-2020</id><content type="html" xml:base="https://pragmati.st/2021/02/14/what-i-read-in-2020/"><![CDATA[<p><img src="/images/book_collage_2020.jpg" alt="Collage of book covers of books I read in 2020" /></p>

<p>I read far fewer books in 2020 than in past years. Pandemic stress and the lack of commute as I moved to 100% remote work really cut down on my reading time.</p>

<p>Looking back it also influenced my selection: a greater percentage of fiction and books about sports than in usual needs.</p>

<p>Favorites in <strong>bold</strong>.</p>

<h2 id="february">February</h2>
<ul>
  <li><a href="https://www.amazon.com/dp/B07TRNVTZQ/"><strong>Why We’re Polarized</strong></a> - An examination of the structural issues that explain the outcome of our two party system. Good to read, did not provide a confidence about a way to improve things.</li>
</ul>

<h2 id="june">June</h2>
<ul>
  <li><a href="https://www.amazon.com/How-Buildings-Learn-Happens-Theyre-dp-0670835153/dp/0670835153/">How Buildings Learn: What Happens After They’re Built</a> - About buildings but really about evolutionary design.</li>
  <li><a href="https://www.amazon.com/dp/B0798NPPSN/"><strong>An Absolutely Remarkable Thing</strong></a> - Really enjoyed this. Royela recommended it to me, I couldn’t put it down, and it blew my mind when I got to the end, read the “About the Author” and realized it was the nerdy guy from the <a href="https://www.youtube.com/user/scishow">SciShow youtube channel</a> I’ve been watching with the kids for years.</li>
  <li><a href="https://www.amazon.com/Football-Hackers-Science-Data-Revolution/dp/1788702050/">Football Hackers: The Science and Art of a Data Revolution</a> - Soccer is an extremely difficult to quantify but there has been a lot of progress. Soccer analytics feel 5 years behind basketball analytics.</li>
</ul>

<h2 id="september">September</h2>
<ul>
  <li><a href="https://www.amazon.com/gp/product/B081Y4Q86K">A Beautifully Foolish Endeavor</a> - The sequel to “An Absolutely Remarkable Thing.” I also enjoyed this.</li>
</ul>

<h2 id="august">August</h2>
<ul>
  <li><a href="https://www.amazon.com/Once-Future-King-T-White-ebook/dp/B00AEDDSQG/">The Once and Future King</a> - This was my father’s favorite book when he was growing up. In the lamest act of teenage rebellion I refused to read it. Finally, made that right this year. The Arthur as child book was repetitive, but I really enjoyed the Lancelot focused book.</li>
</ul>

<h2 id="october">October</h2>
<ul>
  <li><a href="https://www.amazon.com/Inner-Game-Tennis-Classic-Performance-ebook/dp/B003T0G9E4/">The Inner Game of Tennis</a> - Heard about this in the second season of Michael Lewis’ <a href="https://atrpodcast.com/episodes/the-coach-in-your-head-s1!82597">Against The Rules</a> podcast which I thoroughly enjoyed and highly recommend. The book was fine.</li>
  <li><a href="https://www.amazon.com/Pakistan-Hard-Country-Anatol-Lieven-ebook/dp/B0077BONPS/">Pakistan: A Hard Country</a> - One of the reasons I read so few books this year is that I started reading this in about March. It took a while. I didn’t realize how little I knew about Pakistan. In particular the very loose central control of large parts of the country. The book ends in 2010. I wish there was an updated version covering the last 10 years.</li>
  <li><a href="https://www.amazon.com/MVP-Machine-Baseballs-Nonconformists-Players-ebook/dp/B07J4WG7FF/"><strong>The MVP Machine</strong></a> - Baseball is far from my favorite sport but its highly discrete nature means it is generally at the lead of analytics. Where the first part of the analytics revolution chronicled in Moneyball was about roster building, this book examines how new tools are influeing dramatically changing player development. For instance, high speed cameras and specialized radar allows pitchers to develop new pitches faster than ever before. This book made me thing about the competitive advantage of creating better performance feedback loops.
    <h2 id="december">December</h2>
  </li>
  <li><a href="https://www.amazon.com/Inverting-Pyramid-History-Soccer-Tactics-ebook/dp/B07CLJJQTV/">Inverting The Pyramid</a> - Definitive history of soccer tactics starting before the standardization of rules in the 1800s and continuing through geigenpressing. The older stuff was mildly interesting but found the more recent stuff much more interesting. There is a very good chapter on Marcelo Bielsa who is a fascinating person.<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup></li>
</ul>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>If you like soccer you should watch the first season of <a href="https://www.amazon.com/Take-Us-Home-United-Season/dp/B07W5D9X3R">Take Us Home: Leeds United</a>. The press conference where Bielsa breaks down his degree of preparation after getting caught filming opposing teams training is amazing. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Patrick Joyce</name></author><category term="year-end-book-lists" /><summary type="html"><![CDATA[I read far fewer books in 2020 than in past years. Pandemic stress and the lack of commute as I moved to 100% remote work really cut down on my reading time. Here they are.]]></summary></entry></feed>