<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Posts Tagged "til" on Alex Leighton's Blog</title>
  <id>https://alexleighton.com/posts/tags/til-tag-feed.xml</id>
  <link href="https://alexleighton.com/posts/tags/til-tag-feed.xml" rel="self" />
  <link href="https://alexleighton.com/posts/tags/til.html" />
  <updated>2026-03-11T13:36:28.055135011Z</updated>
  <author>
    <name>Alex Leighton</name>
    <uri>https://alexleighton.com/</uri>
  </author>
  <icon>https://alexleighton.com/static/icon-dino.png</icon>
  <logo>https://alexleighton.com/static/icon-dino.png</logo>
  
  <entry>
    <title>Another Avenue of Database Testing</title>
    <id>https://alexleighton.com/posts/2026-03-10-another-avenue-of-database-testing.html</id>
    <link href="https://alexleighton.com/posts/2026-03-10-another-avenue-of-database-testing.html" />
    <published>2026-03-10T14:15:00Z</published>
    <updated>2026-03-10T14:15:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>Re: Production query plans without production data.</p><p>Published on <span title="2026-03-10T14:15:00Z">2026-03-10</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>Re: Production query plans without production data.</h3><p>Published on <span title="2026-03-10T14:15:00Z">2026-03-10</span><br>Tags: database, kotlin, postgres, software-eng, til</p><blockquote>
<p><a href="https://boringsql.com/posts/portable-stats/"><strong>Radim Marek</strong> on 2026-03-08</a>:</p><p>PostgreSQL 18 changed that. Two new functions: <code>pg_restore_relation_stats</code> and <code>pg_restore_attribute_stats</code> write numbers directly into the catalog tables. Combined with <code>pg_dump --statistics-only</code>, you can treat optimizer statistics as a deployable artifact. Compact, portable, plain SQL.</p></blockquote>
<p>This article was both informative and enlightening; I recommend reading it in full. At work, my team works primarily with Postgres, schema migration done with <a href="https://github.com/flyway/flyway">Flyway SQL scripts</a>, and queried from Kotlin REST services. Often the queries are written with <a href="https://jakarta.ee/specifications/persistence/">JPA Repositories</a>, backed by <a href="https://hibernate.org/">Hibernate</a>. The article has inspired two intriguing ideas in me.</p>
<h2>Manual Query Testing</h2>
<p>By company policy, software engineers don't have write access to the production databases, and require business justification to have read access. Infrequently I've run into situations where a migration script or service query in development contain write statements. As a result we can't <code>EXPLAIN</code> the queries (no write access means <code>EXPLAIN UPDATE ...</code> is rejected) or get an idea of its performance characteristics ahead of time. In the past we've had to create a ticket for a database admin to <code>EXPLAIN</code> the queries for us.</p><p>...<br><a href="https://alexleighton.com/posts/2026-03-10-another-avenue-of-database-testing.html">Read the full post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>TIL: Python Exception Groups</title>
    <id>https://alexleighton.com/posts/2025-12-31-til-python-exception-groups.html</id>
    <link href="https://alexleighton.com/posts/2025-12-31-til-python-exception-groups.html" />
    <published>2026-01-01T00:15:00Z</published>
    <updated>2026-01-01T00:15:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>Grouping exceptions and selectively handling multiple exceptions at once.</p><p>Published on <span title="2026-01-01T00:15:00Z">2026-01-01</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>Grouping exceptions and selectively handling multiple exceptions at once.</h3><p>Published on <span title="2026-01-01T00:15:00Z">2026-01-01</span><br>Tags: python, til</p><blockquote>
<p><a href="https://lobste.rs/s/ce0ksl/second_great_error_model_convergence#c_ikzkb2"><strong>natfu</strong> on 2025-12-29</a>:</p><p>In Python, I really want business logic to throw exception <a href="https://docs.python.org/3/library/exceptions.html#exception-groups">I can even group them and handle them later</a> and I'm fine with try-except-finally.</p></blockquote>
<blockquote>
<p><a href="https://docs.python.org/3.14/library/exceptions.html#exception-groups"><strong>Python 3.14.2 Documentation</strong> on 2025-12-05</a>:</p><p>The following are used when it is necessary to raise multiple unrelated exceptions. They are part of the exception hierarchy so they can be handled with <a href="https://docs.python.org/3.14/reference/compound_stmts.html#except">except</a> like all other exceptions. In addition, they are recognised by <a href="https://docs.python.org/3.14/reference/compound_stmts.html#except-star">except*</a>, which matches their subgroups based on the types of the contained exceptions.</p></blockquote>
<p>Today I learned that Python has a standard library mechanism for grouping exceptions together into a single <code>ExceptionGroup</code>. It’s part of the exception hierarchy, so you can catch it like other exceptions, and the <code>except*</code> syntax lets you handle only the exceptions you care about while the rest are re-raised.</p><p>...<br><a href="https://alexleighton.com/posts/2025-12-31-til-python-exception-groups.html">Read the full post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>Gaps</title>
    <id>https://alexleighton.com/posts/2025-12-23-gaps.html</id>
    <link href="https://alexleighton.com/posts/2025-12-23-gaps.html" />
    <published>2025-12-23T21:00:00Z</published>
    <updated>2025-12-23T21:00:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>In space and time.</p><p>Published on <span title="2025-12-23T21:00:00Z">2025-12-23</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>In space and time.</h3><p>Published on <span title="2025-12-23T21:00:00Z">2025-12-23</span><br>Tags: science, til, tv-series</p><p>A tale of two gaps:</p>
<h2>1. Darién Gap</h2>
<p>I learned of the <a href="https://en.wikipedia.org/wiki/Dari%C3%A9n_Gap">Darién Gap</a>, a roughly 60-mile gap in the Pan-American Highway in Panama, consisting of thick jungle that effectively separates North from South America, from TikTok a while back. It's been fun to see it pop up in popular culture thanks to Pluribus's latest episode <a href="https://www.imdb.com/title/tt32777421/?ref_=tt_eps_rec">"The Gap"</a>. The episode features one of the characters attempting to traverse the Gap to reach another character in the US.</p>
<h2>2. Cat Gap</h2>
<p>Today I learned about the <a href="https://en.wikipedia.org/wiki/Cat_gap">Cat Gap</a> — a ~7 million year gap where no "cat" fossils can be found. It's the story of the evolution and migration of animals and the intersection of climate change. <a href="https://en.wikipedia.org/wiki/Nimravidae">Nimravidae</a>, a family of cat-like carnivores that evolved in Eurasia (later migrating to North America), went extinct around 25 million years ago due to a combination of environmental changes and competition with <a href="https://en.wikipedia.org/wiki/Amphicyonidae">"bear-dogs"</a>. <a href="https://en.wikipedia.org/wiki/Felidae">Felidae</a> started evolving into existence in Eurasia around the same time the Nimravids were going extinct. They ended the cat gap around 18.5 million years ago when they migrated over <a href="https://en.wikipedia.org/wiki/Beringia">Beringia</a> into North America.</p><p>...<br><a href="https://alexleighton.com/posts/2025-12-23-gaps.html">Read the full post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>Listening To: #DiesisLive Handpan Set</title>
    <id>https://alexleighton.com/posts/2025-12-11-listening-to-diesislive-handpan-set.html</id>
    <link href="https://alexleighton.com/posts/2025-12-11-listening-to-diesislive-handpan-set.html" />
    <published>2025-12-12T06:15:00Z</published>
    <updated>2025-12-12T06:15:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>By Giolì & Assia</p><p>Published on <span title="2025-12-12T06:15:00Z">2025-12-12</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>By Giolì & Assia</h3><p>Published on <span title="2025-12-12T06:15:00Z">2025-12-12</span><br>Tags: listening-to, music, til</p><a href="https://www.youtube.com/watch?v=m4U232MuTG4">Giolì &amp; Assia - #DiesisLive @Vulcano, Aeolian Islands [Handpan Set]</a>
<p>Lovely electronic music set, performed at a breathtaking location — on <a href="https://maps.app.goo.gl/Us4ExusyCcvF2vxo9">the rim of an active volcano</a> on the island <a href="https://en.wikipedia.org/wiki/Vulcano">Vulcano</a>, in the Aeolian Islands north of Sicily. Today I learned "the English word "volcano", and its equivalent in several European languages, derives from the name of this island, which derives from the Roman belief that the tiny island was the chimney of Vulcan, the Roman god of fire."</p>
<p><a href="https://en.wikipedia.org/wiki/File:Aerial_image_of_Vulcano_(view_from_the_east).jpg"><img class="post-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Aerial_image_of_Vulcano_%28view_from_the_east%29.jpg/1024px-Aerial_image_of_Vulcano_%28view_from_the_east%29.jpg"></a></p><p><a href="https://alexleighton.com/posts/2025-12-11-listening-to-diesislive-handpan-set.html">Read the post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>TIL: Solid Surface Bearing</title>
    <id>https://alexleighton.com/posts/2025-12-11-til-solid-surface-bearing.html</id>
    <link href="https://alexleighton.com/posts/2025-12-11-til-solid-surface-bearing.html" />
    <published>2025-12-12T06:00:00Z</published>
    <updated>2025-12-12T06:00:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>Made from a soft metal alloy.</p><p>Published on <span title="2025-12-12T06:00:00Z">2025-12-12</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>Made from a soft metal alloy.</h3><p>Published on <span title="2025-12-12T06:00:00Z">2025-12-12</span><br>Tags: engineering, science, til</p><p>Today I learned that there exists metal used as a bearing (<em>a mechanism that bears the friction between a rotating part and its housing</em>) that is not in the shape of a ball or a roller and that provides friction reduction through its microstructure. Babbitt metal is a silver alloy consisting primarily of tin or lead, with small percentages of copper and antimony.</p>
<blockquote>
<p><a href="https://en.wikipedia.org/wiki/Babbitt_(alloy)"><strong>Wikipedia article - Babbitt (alloy)</strong> on 2025-12-11</a>:</p><p>Babbitt metal is most commonly used as a thin surface layer in a complex, multi-metal assembly, but its original use was as a cast-in-place bulk bearing material. Babbitt metal is characterized by its resistance to galling. Babbitt metal is soft and easily damaged, which suggests that it might be unsuitable for a bearing surface; however, its structure is made up of small, hard crystals dispersed in a softer metal, which makes it, technically, a metal matrix composite. As the bearing wears, the softer metal erodes somewhat, creating paths for lubricant between the hard high spots that provide the actual bearing surface. When tin is used as the softer metal, friction causes the tin to melt and function as a lubricant, protecting the bearing from wear when other lubricants are absent.</p></blockquote><p>...<br><a href="https://alexleighton.com/posts/2025-12-11-til-solid-surface-bearing.html">Read the full post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>Lost Farmers of Neolithic Europe</title>
    <id>https://alexleighton.com/posts/2025-11-29-lost-farmers-of-neolithic-europe.html</id>
    <link href="https://alexleighton.com/posts/2025-11-29-lost-farmers-of-neolithic-europe.html" />
    <published>2025-11-30T04:30:00Z</published>
    <updated>2025-11-30T04:30:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>The brutal collapse of an early farming culture.</p><p>Published on <span title="2025-11-30T04:30:00Z">2025-11-30</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>The brutal collapse of an early farming culture.</h3><p>Published on <span title="2025-11-30T04:30:00Z">2025-11-30</span><br>Tags: science, til</p><blockquote>
<p><a href="https://www.science.org/content/article/headless-bodies-hint-why-europe-s-first-farmers-vanished"><strong>Andrew Curry in A Headless Mystery</strong> on 2025-11-20</a>:</p><p>In 2017, archaeologists digging in the middle of a Slovak wheat field uncovered four headless skeletons. The burials, in a ditch dug on the edge of a settlement more than 7000 years ago, belonged to one of Europe’s first farming communities. Burying people in or near settlements wasn’t unusual at the time—but burying them without heads was.</p>
<p>Year after year, the researchers have returned to find more and more headless skeletons on the outskirts of Vráble, a small village 100 kilometers east of Bratislava. “Everywhere we started to dig, we found bones. Everywhere we were sitting or standing, there were bones,” says Katharina Fuchs, a biological anthropologist at Kiel University who has excavated in Vráble every summer since 2021. In the summer of 2022, she and colleagues from Kiel and the Slovak Academy of Sciences’s Institute of Archaeology recovered the skeletal remains of 34 people, piled on top of each other two or three deep in a space about the size of a parking spot. With the exception of one child, none of them had heads.</p>
<p>Each year the team expects to reach the mass grave’s edge. Instead, it finds more bodies. “Every time we think we have a clue, the site shows differently,” Fuchs says. “It’s not stopping. We now have a skeleton layer 45 meters long.”</p>
<p>Vráble’s headless bodies are more than a ghoulish curiosity. They could help answer a decades-old question: What happened to central Europe’s first farmers?</p></blockquote><p>...<br><a href="https://alexleighton.com/posts/2025-11-29-lost-farmers-of-neolithic-europe.html">Read the full post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>TIL: Websockets and SSE</title>
    <id>https://alexleighton.com/posts/2025-11-20-til-websockets-and-sse.html</id>
    <link href="https://alexleighton.com/posts/2025-11-20-til-websockets-and-sse.html" />
    <published>2025-11-20T17:00:00Z</published>
    <updated>2025-11-20T17:00:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>Protocol basics at the transport layer.</p><p>Published on <span title="2025-11-20T17:00:00Z">2025-11-20</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>Protocol basics at the transport layer.</h3><p>Published on <span title="2025-11-20T17:00:00Z">2025-11-20</span><br>Tags: javascript, protocol, til</p><p>Today at work I learned of the existence of <a href="https://en.wikipedia.org/wiki/Server-sent_events">Server Sent Events</a> (SSE) and some transport layer/protocol facts about <a href="https://en.wikipedia.org/wiki/WebSocket">Websockets</a>.</p>
<p>SSE is just a standardization of the old <a href="https://en.wikipedia.org/wiki/Comet_(programming)">Comet</a> model. The browser initiates an HTTP request, the server and the client keep the underlying TCP connection alive, with the server sending events-as-they-happen by adding more data onto a neverending HTTP response body.</p>
<p>Websockets also <a href="https://en.wikipedia.org/wiki/WebSocket#Protocol">start life as an HTTP request</a> to the server, but the initial request is to switch protocols, after which the server and client drop down to communicating in a binary frame-based protocol on top of the underlying TCP connection.</p><p><a href="https://alexleighton.com/posts/2025-11-20-til-websockets-and-sse.html">Read the post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>TIL: Structural Regular Expressions</title>
    <id>https://alexleighton.com/posts/2025-11-15-til-structural-regular-expressions.html</id>
    <link href="https://alexleighton.com/posts/2025-11-15-til-structural-regular-expressions.html" />
    <published>2025-11-16T05:55:00Z</published>
    <updated>2025-11-16T05:55:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>38 year old treasure by Rob Pike.</p><p>Published on <span title="2025-11-16T05:55:00Z">2025-11-16</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>38 year old treasure by Rob Pike.</h3><p>Published on <span title="2025-11-16T05:55:00Z">2025-11-16</span><br>Tags: text-editor, til</p><blockquote>
<p><a href="https://www.sminez.dev/match-it-again-sam/"><strong>Innes Anderson-Morrison</strong> on 2025-11-10</a>:</p><p>Introduced by Rob Pike in his <a href="http://doc.cat-v.org/plan_9/4th_edition/papers/sam/">Sam</a> text editor, and discussed in his <a href="http://doc.cat-v.org/bell_labs/structural_regexps/">1987 paper</a>, structural regular expressions provide a notation and semantics for composing the regular expressions we all know and love in order to more easily describe the structure of the text being searched.</p></blockquote>
<p>Today I learned that Rob Pike suggested an enhancement to regular expressions called Structural Regular Expressions to more easily match and edit text across lines in a file, before I was even born. They're a little more complex than the usual global find-and-replace-with-regex that most editors provide, so I can understand why I've never run into them before now.</p><p><a href="https://alexleighton.com/posts/2025-11-15-til-structural-regular-expressions.html">Read the post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>TIL: Linux Commit Messages</title>
    <id>https://alexleighton.com/posts/2025-10-10-til-linux-commit-messages.html</id>
    <link href="https://alexleighton.com/posts/2025-10-10-til-linux-commit-messages.html" />
    <published>2025-10-10T13:30:00Z</published>
    <updated>2025-10-10T13:30:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>Communicating changes.</p><p>Published on <span title="2025-10-10T13:30:00Z">2025-10-10</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>Communicating changes.</h3><p>Published on <span title="2025-10-10T13:30:00Z">2025-10-10</span><br>Tags: communication, git, software-eng, til</p><p>The Linux patch submission process has a <a href="https://www.kernel.org/doc/html/v4.12/process/submitting-patches.html#describe-your-changes">nice guide</a> (<a href="https://lobste.rs/s/szoe3m/conventional_commits_considered#c_vjm6mt">via</a>) on crafting git commit messages:</p>
<blockquote>
<p>Describe your changes in imperative mood, e.g. “make xyzzy do frotz” instead of “[This patch] makes xyzzy do frotz” or “[I] changed xyzzy to do frotz”, as if you are giving orders to the codebase to change its behaviour.</p>
</blockquote><p><a href="https://alexleighton.com/posts/2025-10-10-til-linux-commit-messages.html">Read the post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>TIL: Minikube Ingress DNS</title>
    <id>https://alexleighton.com/posts/2025-10-01-til-minikube-ingress-dns.html</id>
    <link href="https://alexleighton.com/posts/2025-10-01-til-minikube-ingress-dns.html" />
    <published>2025-10-01T13:30:00Z</published>
    <updated>2025-10-01T13:30:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>Automatic service exposure.</p><p>Published on <span title="2025-10-01T13:30:00Z">2025-10-01</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>Automatic service exposure.</h3><p>Published on <span title="2025-10-01T13:30:00Z">2025-10-01</span><br>Tags: til</p><p>At work our production systems are run inside of <a href="https://en.wikipedia.org/wiki/Kubernetes">Kubernetes</a> (k8s) on a fleet of machines. For testing we have a tool that will take the same production k8s configuration and install it on a single machine, run via <a href="https://minikube.sigs.k8s.io/docs/">Minikube</a>. I learned recently that our Minikube has been setup with <a href="https://minikube.sigs.k8s.io/docs/handbook/addons/ingress-dns">Ingress DNS</a> which automatically enables you to directly access one of the services running inside:</p>
<pre><code>curl http://service-name.hostname/rest/path
</code></pre><p><a href="https://alexleighton.com/posts/2025-10-01-til-minikube-ingress-dns.html">Read the post →</a></p>]]></content>
  </entry>
  
  <entry>
    <title>TIL: Git Exclude</title>
    <id>https://alexleighton.com/posts/2025-09-03-til-git-exclude.html</id>
    <link href="https://alexleighton.com/posts/2025-09-03-til-git-exclude.html" />
    <published>2025-09-04T04:55:00Z</published>
    <updated>2025-09-04T04:55:00Z</updated>
    <author><name>Alex Leighton</name></author>
    <summary type="html"><![CDATA[<p>Local-only git ignore.</p><p>Published on <span title="2025-09-04T04:55:00Z">2025-09-04</span></p>]]></summary>
    <content type="html"><![CDATA[<h3>Local-only git ignore.</h3><p>Published on <span title="2025-09-04T04:55:00Z">2025-09-04</span><br>Tags: git, software-eng, til</p><p>I came across <a href="https://marijkeluttekes.dev/blog/articles/2025/09/03/git-exclude-a-handy-feature-you-might-not-know-about/">"Git exclude, a handy feature you might not know about"</a> by Marijke Luttekes, and TIL that git has a local-only ignore files feature. Unlike <code>.gitignore</code>, you can put file paths to be ignored by git into <code>.git/info/exclude</code>, but there's no file checked into tracked files, so your ignored files aren't shared with people you're working with. Useful for local notes or snippets or your favorite text editor's repo-specific configuration.</p><p><a href="https://alexleighton.com/posts/2025-09-03-til-git-exclude.html">Read the post →</a></p>]]></content>
  </entry>
  
</feed>
