{"description":"I just said what I said and it was wrong. Or was taken wrong.","feed_url":"https:\/\/leancrew.com\/all-this\/feed.json","title":"And now it\u2019s all this","items":[{"title":"Easter in Mathematica","url":"https:\/\/leancrew.com\/all-this\/2026\/04\/easter-in-mathematica\/","author":{"name":"Dr. Drang"},"summary":"The notebook I used to make the calculations summarized in yesterday\u2019s post.","date_published":"2026-04-06T00:42:45+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/04\/easter-in-mathematica\/","content_html":"<p><a href=\"https:\/\/leancrew.com\/all-this\/2026\/04\/scientific-americans-easter\/\">Yesterday\u2019s post<\/a> included some behind-the-scenes calculations that I figured were worth talking about. They were all done in Mathematica, and here\u2019s the notebook I used:<\/p>\n<iframe height=\"600\" src=\"https:\/\/www.wolframcloud.com\/obj\/mark80\/Published\/easter-dates.nb?_embed=iframe\" width=\"100%\"><\/iframe>\n<p>The first calculation works out the days of the vernal equinox in every year from 1961 through 2026. The key function for this is <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/FindAstroEvent.html\"><code>FindAstroEvent<\/code><\/a>, a fairly new function that returns the date and time of the first occurrence of a given event after the given date. I asked for the first <code>MarchEquinox<\/code> after January 1 of each year, and I wanted the time to be given in Greenwich Mean Time. Since I only cared about the day of the month, I used the <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/DateList.html\"><code>DateList<\/code> function<\/a> to convert the <code>DateObject<\/code> returned by <code>FindAstroEvent<\/code> into a list of year, month, day, hour, minute, and second and pulled out just the third item of that list.<\/p>\n<p>With <code>equinoxes<\/code> set to a list of 19s, 20s, and 21s, I used the <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/Tally.html\"><code>Tally<\/code> function<\/a> to count the occurrences of each day number. As you can see, there were 58 20s in the list of 66 equinoxes, so I included that result in the post to show that March 20 is the most common date of the vernal equinox.<\/p>\n<p>The remaining calculations were done to compare the algorithmic date of Easter with the date that Easter would be if it were determined by the actual date of the first full moon after the vernal equinox. So I used <code>FindAstroEvent<\/code> again, this time setting the event to <code>FullMoon<\/code> and the date to the equinox dates calculated earlier. That list of <code>DateObject<\/code>s was saved to the variable <code>fullMoons<\/code>.<\/p>\n<p>I needed to compare these dates to the dates of Easter for the years of interest. Oddly, Mathematica doesn\u2019t seem to have a built-in function for calculating Easter, but it does have a <a href=\"http:\/\/reference.wolfram.com\/language\/ref\/ResourceFunction.html\"><code>ResourceFunction<\/code><\/a>. The function is called <a href=\"https:\/\/resources.wolframcloud.com\/FunctionRepository\/resources\/EasterSunday\"><code>EasterSunday<\/code><\/a>, and it calculates the date for the given year.<\/p>\n<p>With the lists of <code>easters<\/code> and <code>fullMoons<\/code> in hand, I subtracted the latter from the former. If the difference is more than a week, the algorithmic and astronomical Easters aren\u2019t in agreement. As you can see, there are two instances in which Easter is 31 days after the full moon: first in 1962 (which I didn\u2019t mention in the post) and then again in 2019 (which I did). The final calculation was just a repeat of one of the calculations in <code>equinoxes<\/code>; I did it again so I wouldn\u2019t have to hunt down the 2019 equinox date.<\/p>\n<p>I\u2019m not sure when I learned of the <code>FindAstroEvent<\/code> function, but it really came in handy yesterday. I\u2019m pretty sure there are functions in <a href=\"https:\/\/lccn.loc.gov\/2017024295\"><em>Calendrical Calculations<\/em><\/a> that deal with equinoxes and full moons, but I haven\u2019t gotten that far in the book yet.<\/p>"},{"title":"Scientific American\u2019s Easter","url":"https:\/\/leancrew.com\/all-this\/2026\/04\/scientific-americans-easter\/","author":{"name":"Dr. Drang"},"summary":"A few small mistakes I feel compelled to correct.","date_published":"2026-04-05T04:12:31+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/04\/scientific-americans-easter\/","content_html":"<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href=\"https:\/\/leancrew.com\/all-this\/2026\/04\/scientific-americans-easter\/\">the original article<\/a> to see them rendered properly.]<\/p>\n<hr \/>\n<p>In its continuing attempt to teach us how calendars work, <em>Scientific American<\/em> has <a href=\"https:\/\/www.scientificamerican.com\/article\/the-mathematical-formula-that-reveals-when-easter-is-every-year\/\">an article<\/a> (<a href=\"https:\/\/apple.news\/A8aMtxwNRRFa9rJIYdWMbMA\">Apple News link<\/a>) up today that goes through <a href=\"https:\/\/en.wikipedia.org\/wiki\/Date_of_Easter#Gauss's_Easter_algorithm\">Gauss\u2019s algorithm<\/a> for calculating the date of Easter. The article was written by Manon Bischoff, who also wrote <a href=\"https:\/\/www.scientificamerican.com\/article\/why-friday-the-13th-is-a-mathematical-inevitability\/\">the Friday the 13th article<\/a> I covered <a href=\"https:\/\/leancrew.com\/all-this\/2026\/03\/scientific-american-and-friday-the-13th\/\">a few weeks ago<\/a>.<\/p>\n<p>There are a few small mistakes in the article: one computational and two definitional. Let\u2019s take a look at them.<\/p>\n<p>The computational error comes in the calculation of the intermediate value <em>p<\/em>. The article says<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>p<\/mi><mo>=<\/mo><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mi>k<\/mi><mn>3<\/mn><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><\/mrow><\/math>\n<p>where the topless brackets mean the <a href=\"https:\/\/mathworld.wolfram.com\/FloorFunction.html\">floor function<\/a>, the integer less than or equal to what\u2019s inside the brackets. The correct equation is<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>p<\/mi><mo>=<\/mo><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mrow><mn>13<\/mn><mo>+<\/mo><mn>8<\/mn><mi>k<\/mi><\/mrow><mn>25<\/mn><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><\/mrow><\/math>\n<p>In both equations, <em>k<\/em> is<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>k<\/mi><mo>=<\/mo><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mi>y<\/mi><mn>100<\/mn><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><\/mrow><\/math>\n<p>i.e., the first two digits of the year (at least until we get to the year 10,000).<\/p>\n<p>In giving the wrong equation for <em>p<\/em>, Bischoff is following Gauss himself. In the original presentation of his Easter algorithm, Gauss gave the same simple formula as Bischoff, but he corrected it several years later. Why Bischoff is still using the wrong equation two centuries later is anyone\u2019s guess.<\/p>\n<p>Actually, I <em>can<\/em> guess. Maybe Bischoff\u2019s using the wrong formula for <em>p<\/em> because it\u2019s simpler and the error won\u2019t manifest itself until the year 4200 (!). Here\u2019s a quick Python script to see the centuries, starting in the 1600s, for which the simpler formula is wrong:<\/p>\n<pre><code>python:\nfor k in range(16, 60):\n  if k\/\/3 != (13 + 8*k)\/\/25:\n    print(f'Century {k*100} gives the wrong value')\n<\/code><\/pre>\n<p>The output is<\/p>\n<pre><code>Century 4200 gives the wrong value\nCentury 4500 gives the wrong value\nCentury 4800 gives the wrong value\nCentury 5100 gives the wrong value\nCentury 5400 gives the wrong value\nCentury 5700 gives the wrong value\n<\/code><\/pre>\n<p>I think we can live with a mistake that won\u2019t rear its head for over 2000 years.<\/p>\n<p>I\u2019m less inclined to overlook the definitional errors in the article\u2019s early paragraphs. This one:<\/p>\n<blockquote>\n<p>For those who celebrate it, tracking what day the holiday Easter takes place on can be a challenge. According to Christian religious traditions, Easter Sunday falls on the first Sunday following the first full moon after the vernal equinox.<\/p>\n<\/blockquote>\n<p>And this one:<\/p>\n<blockquote>\n<p>[T]he vernal equinox, or start of spring, is fixed as March 21. If a full moon occurs on that exact day, March 22 becomes the earliest possible calendar date for Easter Sunday. According to the lunar calendar, the latest possible date for a full moon after March 21 is April 18. That means Easter Sunday never falls later than April 25.<\/p>\n<\/blockquote>\n<p>While it\u2019s true that the idea behind the date of Easter is to be \u201con the first Sunday following the first full moon after the vernal equinox,\u201d when it comes to determining Easter, both the equinox and the lunar cycle are estimated\u2014they aren\u2019t based on accurate astronomical calculations or observations.<\/p>\n<p>First, let\u2019s look at the vernal equinox.<sup id=\"fnref:spring\"><a href=\"#fn:spring\" rel=\"footnote\">1<\/a><\/sup> One need only think back a couple of weeks to realize that it isn\u2019t \u201cfixed as March 21.\u201d The most recent equinox was on March 20, as were 58 of the 66 vernal equinoxes I\u2019ve lived through. March 20 is by far the most common date for the true vernal equinox. The Church fathers who set the date of Easter used March 21 as an approximation because it made the calculation simple and resulted in Easters more or less when they thought they should be.<\/p>\n<p>Similarly, they used the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Metonic_cycle\">Metonic cycle<\/a>\u2014with some occasional adjustments\u2014to estimate when full moons would occur. There are almost exactly 235 lunar months in 19 years, a fact you can use to calculate a good estimate of when full moons occur.<sup id=\"fnref:19\"><a href=\"#fn:19\" rel=\"footnote\">2<\/a><\/sup> But this is an average, and because lunar months vary in length, the date of a calculated full moon doesn\u2019t always fall on the date of an actual full moon. (There\u2019s also a slow drift that has to be accounted for.)<\/p>\n<p>So although the date of Easter is <em>guided<\/em> by astronomical events, it isn\u2019t <em>determined<\/em> by them. As it happens, this year the vernal equinox was, as we said, on Friday, March 20, and the following full moon was on Wednesday, April 1. So having Easter Sunday on April 5 works out both astronomically and algorithmically. But in 2019, that wasn\u2019t the case. The vernal equinox was on Wednesday, March 20; the following full moon was on Thursday, March 21; but Easter Sunday was celebrated on April 21, not March 24.<\/p>\n<div class=\"footnotes\">\n<hr\/>\n<ol>\n<li id=\"fn:spring\">\n<p>My apologies to those of you in the Southern Hemisphere. I\u2019m talking about the equinox in March, which was vernal to the people who decided when Easter should be celebrated.\u00a0<a href=\"#fnref:spring\" rev=\"footnote\">\u21a9<\/a><\/p>\n<\/li>\n<li id=\"fn:19\">\n<p>If you go through the calculations Bischoff presents, you\u2019ll see a division by 19. That\u2019s the Metonic cycle in action.\u00a0<a href=\"#fnref:19\" rev=\"footnote\">\u21a9<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>"},{"title":"A less complicated complication","url":"https:\/\/leancrew.com\/all-this\/2026\/03\/a-less-complicated-complication\/","author":{"name":"Dr. Drang"},"summary":"watchOS 26.4 fixes a problem I complained about a couple of months ago.","date_published":"2026-03-29T15:42:04+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/03\/a-less-complicated-complication\/","content_html":"<p>Back in January, <a href=\"https:\/\/leancrew.com\/all-this\/2026\/01\/a-complication-thats-one-step-too-complicated\/\">I complained<\/a> about the Apple Watch\u2019s Timer complication being too complicated. A couple of days ago, Dan Moren told me <a href=\"https:\/\/zeppelin.flights\/@dmoren\/116303829086040884\">on Mastodon<\/a> that my complaint had been addressed in <a href=\"https:\/\/support.apple.com\/en-us\/123002\">watchOS 26.4<\/a>, which was released earlier this week. After a surprisingly quick update of my watch (I had already updated every other device to 26.4 but somehow forgot to do the watch), I added a 3-minute timer as the bottom center complication and, miracle of miracles, it worked exactly as it should.<\/p>\n<p><img alt=\"Apple Watch with 3-minute timer complication\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260329-Apple%20Watch%20with%203-minute%20timer%20complication.png\" title=\"Apple Watch with 3-minute timer complication\" width=\"40%\"\/><\/p>\n<p>To recap, my January complaint was that although I could create a complication that looked like it would start a 30-second timer when tapped, that complication actually required a second tap on a smaller button to start it\u2014a stupid way to implement the feature. As of 26.4, the stupidity has been removed. Now the timer starts immediately when you tap the complication.<\/p>\n<p>If you\u2019d like a quick way to set a specific timer on your watch, press and hold on your watch\u2019s home screen, tap the Edit button, and then swipe (if necessary) to get to the complications screen. Tap the complication you want to change to a Timer, scroll through the list, and choose Timers. At this point, you will be given the option to choose either a generic timer complication\u2014one that just opens the Timers app\u2014or one set to one of the specific times you\u2019ve created in the Timers app.<\/p>\n<p><img alt=\"Apple Watch complication setting\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260329-Apple%20Watch%20complication%20setting.png\" title=\"Apple Watch complication setting\" width=\"40%\"\/><\/p>\n<p>Choose the one you want and go back to your home screen. Now you have a specific timer complication that works the way it should.<\/p>\n<p>(Aside: I wanted a 30-second timer in January because I was doing physical therapy stretching exercises then that were supposed to be held for 30 seconds. I\u2019m not doing those exercises anymore, so I made a 3-minute timer for tea.)<\/p>\n<p>Thanks to Dan for telling me about this. I had given up on this type of complication and wouldn\u2019t have thought to look for the improvement.<\/p>\n<hr\/>\n<p>Another improvement in 26.4\u2014one that\u2019s sort of mentioned in the <a href=\"https:\/\/support.apple.com\/en-us\/123002\">release notes<\/a>\u2014is that you no longer have to tap the small arrow button to start a workout. You can also tap anywhere in the big area around the exercise icon above the three bottom buttons on the Workouts screen. And you don\u2019t have to wait for the arrow button to slowly animate into view.<\/p>\n<p><img alt=\"Watch Workouts screen\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260329-Watch%20Workouts%20screen.png\" title=\"Watch Workouts screen\" width=\"40%\"\/><\/p>\n<p>I bitched about the previous behavior\u2014prompted by a <a href=\"https:\/\/mastodon.social\/@agiletortoise\/115741664171965520\">Greg Pierce complaint<\/a>\u2014<a href=\"https:\/\/leancrew.com\/all-this\/2025\/12\/watch-workout-widget-worse\/\">in December<\/a>. It\u2019s almost as if Apple is listening now.<\/p>"},{"title":"Are you a mod or a rocker?","url":"https:\/\/leancrew.com\/all-this\/2026\/03\/are-you-a-mod-or-a-rocker\/","author":{"name":"Dr. Drang"},"summary":"An unusual modulo arithmetic notation I learned about while studying Mayan calendars.","date_published":"2026-03-27T23:07:06+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/03\/are-you-a-mod-or-a-rocker\/","content_html":"<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href=\"https:\/\/leancrew.com\/all-this\/2026\/03\/are-you-a-mod-or-a-rocker\/\">the original article<\/a> to see them rendered properly.]<\/p>\n<hr \/>\n<p>I\u2019ve been working my way slowly through <a href=\"https:\/\/lccn.loc.gov\/2017024295\">Reingold and Dershowitz\u2019s <em>Calendrical Calculations<\/em><\/a>. This week I hit Chapter 11 on the Mayan and Aztec calendars and came across a notation for modulo arithmetic that wasn\u2019t familiar to me.<sup id=\"fnref:one\"><a href=\"#fn:one\" rel=\"footnote\">1<\/a><\/sup> I figured I\u2019d write about it here on the off-chance that any of you would find it interesting. Also, to make it stick in my head a little better.<\/p>\n<p>The notation came up in the section on the <a href=\"https:\/\/www.mayan-calendar.com\/ancient_haab.html\">Haab calendar<\/a>, a sort of solar calendar that the Mayans used along with the <a href=\"https:\/\/www.mayan-calendar.com\/ancient_tzolkin.html\">Tzolk\u2019in<\/a> and <a href=\"https:\/\/www.mayan-calendar.com\/ancient_longcount.html\">Long Count<\/a> calendars. The Haab calendar has 18 months of 20 days each and then a 19th sort-of-month with just 5 days. There\u2019s no year number in the Haab calendar, so there\u2019s no way to convert directly from the Haab calendar to other calendars. But there is a way to get a date in another calendar that\u2019s on or nearest before a given Haab date.<\/p>\n<p>Reingold and Dershowitz use a \u201cfixed\u201d or \u201cRD\u201d calendar as their way station between all the calendars. It\u2019s a single day number that counts up from what would have been January 1 of the Year 1 in the Gregorian calendar if the Gregorian calendar had existed back then. In this system, 0001-01-01 is Day 1 and today, 2026-03-27, is Day 739,702.<\/p>\n<p>The function that finds the closest given Haab date on or before a given fixed date is called <code>mayan-haab-on-or-before<\/code>, and it\u2019s defined this way in the text:<\/p>\n<p><img alt=\"Mayan Haab date function\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260327-Mayan%20Haab%20date%20function.jpg\" title=\"Mayan Haab date function\" width=\"100%\"\/><\/p>\n<p>What\u2019s odd about the modulo notation in this definition is that the thing after \u201cmod\u201d isn\u2019t a divisor, it\u2019s an interval: the half-open interval between <em>date<\/em> (inclusive) and <em>date<\/em> \u2013 365 (exclusive).<\/p>\n<p>Here\u2019s how R&amp;D define this interval modulus, both in Chapter 1 of <em>Calendrical Calculations<\/em> and in <a href=\"https:\/\/dl.acm.org\/doi\/abs\/10.1145\/2421096.2421112\">this ACM paper<\/a>:<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>n<\/mi><mrow><mspace width=\"0.444em\"><\/mspace><mrow><mi mathvariant=\"normal\">mod<\/mi><mo>\u2061<\/mo><\/mrow><mspace width=\"0.222em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">[<\/mo><\/mrow><mn>a<\/mn><mspace width=\"0.167em\"><\/mspace><mi>.<\/mi><mspace width=\"0.167em\"><\/mspace><mi>.<\/mi><mspace width=\"0.167em\"><\/mspace><mi>b<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mspace width=\"0.167em\"><\/mspace><mover><mo>=<\/mo><mrow><mi mathvariant=\"normal\">d<\/mi><mi mathvariant=\"normal\">e<\/mi><mi mathvariant=\"normal\">f<\/mi><\/mrow><\/mover><mspace width=\"0.167em\"><\/mspace><mrow><mo form=\"prefix\" stretchy=\"true\">{<\/mo><mtable><mtr><mtd columnalign=\"left\" style=\"text-align: left\"><mi>a<\/mi><mo>+<\/mo><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>n<\/mi><mo>\u2212<\/mo><mi>a<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mrow><mspace width=\"0.444em\"><\/mspace><mrow><mi mathvariant=\"normal\">mod<\/mi><mo>\u2061<\/mo><\/mrow><mspace width=\"0.222em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">(<\/mo><\/mrow><mi>b<\/mi><mo>\u2212<\/mo><mi>a<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mtd><mtd columnalign=\"left\" style=\"text-align: left\"><mspace width=\"0.222em\"><\/mspace><\/mtd><mtd columnalign=\"left\" style=\"text-align: left\"><mrow><mtext mathvariant=\"normal\">if <\/mtext><mspace width=\"0.333em\"><\/mspace><\/mrow><mi>a<\/mi><mo>\u2260<\/mo><mi>b<\/mi><\/mtd><\/mtr><mtr><mtd columnalign=\"left\" style=\"text-align: left\"><mi>n<\/mi><\/mtd><mtd columnalign=\"left\" style=\"text-align: left\"><mspace width=\"0.222em\"><\/mspace><\/mtd><mtd columnalign=\"left\" style=\"text-align: left\"><mrow><mtext mathvariant=\"normal\">if <\/mtext><mspace width=\"0.333em\"><\/mspace><\/mrow><mi>a<\/mi><mo>=<\/mo><mi>b<\/mi><\/mtd><\/mtr><\/mtable><\/mrow><\/mrow><\/math>\n<p>As long as the two ends of the interval aren\u2019t identical, the answer will lie in the range <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mo form=\"prefix\" stretchy=\"false\">[<\/mo><mi>a<\/mi><mspace width=\"0.167em\"><\/mspace><mi>.<\/mi><mspace width=\"0.167em\"><\/mspace><mi>.<\/mi><mspace width=\"0.167em\"><\/mspace><mi>b<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><\/math>. This notation is helpful in shifted modulo operations like the one in <code>mayan-haab-on-or-before<\/code> because it explicitly tells you the range of answers you\u2019ll get. The idea is that the resulting fixed date will be anywhere from 0 (inclusive) to 365 (exclusive) days before the given date.<\/p>\n<p>(The normal modulo notation, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>n<\/mi><mrow><mspace width=\"0.444em\"><\/mspace><mrow><mi mathvariant=\"normal\">mod<\/mi><mo>\u2061<\/mo><\/mrow><mspace width=\"0.222em\"><\/mspace><mi>m<\/mi><\/mrow><\/mrow><\/math>, could be written as <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>n<\/mi><mrow><mspace width=\"0.444em\"><\/mspace><mrow><mi mathvariant=\"normal\">mod<\/mi><mo>\u2061<\/mo><\/mrow><mspace width=\"0.222em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">[<\/mo><\/mrow><mn>0<\/mn><mspace width=\"0.167em\"><\/mspace><mi>.<\/mi><mspace width=\"0.167em\"><\/mspace><mi>.<\/mi><mspace width=\"0.167em\"><\/mspace><mi>m<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><\/math>, although this doesn\u2019t seem particularly helpful.)<\/p>\n<p>Note that in <code>mayan-haab-on-or-before<\/code>, the interval goes backward, which means the divisor in the standard mod function is a negative number: \u2013365. If you\u2019re implementing this function in a programming language, you have to make sure that using a negative divisor in your language\u2019s <code>mod<\/code> will give you a negative answer. This means that <code>mod<\/code> must have a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Modulo#Variants_of_the_definition\"><em>floored<\/em> definition<\/a>. The <code>mod<\/code> function in Lisp, which R&amp;D are using, and the <code>%<\/code> operator in Python, which I\u2019m using as I reimplement R&amp;D, both use the floored definition.<\/p>\n<p>I mentioned earlier that the 19th month of the Haab calendar is an oddball because it has only 5 days. As it happens, today is smack in the middle of that 19th month, which is called Wayeb or Uayeb, depending on whose transliteration you use.<\/p>\n<p>Another odd thing about the Haab calendar\u2014something that computer programmers must love\u2014is that the day numbers within a month start at 0, not 1. So Monday, which is the start of the next Haab cycle, will be 0 Pop, Pop being the name of the first Haab month.<\/p>\n<div class=\"footnotes\">\n<hr\/>\n<ol>\n<li id=\"fn:one\">\n<p>It would have been familiar if I\u2019d read Chapter 1 carefully instead of skimming, but I was eager to get past the preliminaries quickly and figured I could always go back to Chapter 1 if necessary. Which it was.\u00a0<a href=\"#fnref:one\" rev=\"footnote\">\u21a9<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>"},{"title":"Saving us from ourselves?","url":"https:\/\/leancrew.com\/all-this\/2026\/03\/saving-us-from-ourselves\/","author":{"name":"Dr. Drang"},"summary":"A new feature in macOS 26.4 sounds like a good idea, but I haven't been able to get it to work.","date_published":"2026-03-26T21:06:30+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/03\/saving-us-from-ourselves\/","content_html":"<p>You may have seen <a href=\"https:\/\/www.macrumors.com\/2026\/03\/25\/macos-26-4-terminal-security-feature\/\">this article<\/a> by Joe Rossignol in MacRumors yesterday. It\u2019s about a new feature in macOS 26.4 that\u2019s designed to keep us from pasting dangerous commands in Terminal. If a user pastes such a command, this warning pops up:<\/p>\n<p><img alt=\"macOS 26.4 command paste warning\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260326-macOS%2026.4%20command%20paste%20warning.jpg\" title=\"macOS 26.4 command paste warning\" width=\"50%\"\/><\/p>\n<p>Near the end of the article, Rossignol says<\/p>\n<blockquote>\n<p>We have yet to determine exactly which commands trigger the warning, which does not always appear.<\/p>\n<\/blockquote>\n<p>I updated to 26.4 today and tried to trigger the warning. Since <code>rm -rf<\/code> is generally considered dangerous, I created some files I could try it out on.<\/p>\n<p>Here are the commands I used in Terminal to create five new files, named <code>test1.txt<\/code> through <code>test5.txt<\/code>, in a folder named <code>test<\/code> and fill them with some nonsense text:<\/p>\n<pre><code>$ mkdir test\n$ touch test\/test{1..5}.txt\n$ pbcopy &lt;&lt;END\n&gt; Same continent also, pre-occupation has probably played a more marked\ninfluence; thus I can understand how it may be said, to be striving to the \nferal animals of South America) the black bear was seen by Hearne swimming \nfor hours with widely open through an internal force beyond the other \ncompleted cells. It must suffice for our profound ignorance on the variations \nwhich have been.\n&gt; END\n$ for f in test\/*; do pbpaste &gt;&gt; $f; done\n<\/code><\/pre>\n<p>The nonsense text in the <a href=\"https:\/\/www.gnu.org\/software\/bash\/manual\/bash.html#Here-Documents\">here-document<\/a> was generated on the fly using <a href=\"https:\/\/leancrew.com\/all-this\/2011\/02\/dissociated-darwin\/\">my Dissociated Darwin script<\/a>. I used to call it via TextExpander; now it\u2019s called via Typinator, but the process is the same.<\/p>\n<p>I then created a simple HTML file with the command <code>rm -rf test<\/code> in its body and uploaded it to my server. Since websites were mentioned in the warning as a source of dangerous commands, I figured copying the command from an external site would be the most likely way to trigger the warning.<\/p>\n<p>I aimed Safari at the file\u2019s URL, copied the command, switched back to Terminal, and pasted. No warning popped up, and I was able to execute the pasted command and delete the folder and files with no trouble.<\/p>\n<p>OK, let\u2019s try something a little more convoluted. After recreating the <code>test<\/code> folder and files, I made a file named <code>dangerous.txt<\/code> and put it on my server. Its contents were simply <code>rm -rf test<\/code>. I then added this command to the HTML file described above:<\/p>\n<pre><code>curl https:\/\/leancrew.com\/dangerous\/dangerous.txt | bash\n<\/code><\/pre>\n<p>Surely, I thought, a command that pipes the contents of some random file on the internet into <code>bash<\/code> for execution would be worth warning about. Nope. I copied the <code>curl<\/code> command from Safari, pasted it into Terminal, and hit Return. No warning from macOS and my test folder and files disappeared again.<\/p>\n<p>My feelings about this have gone from \u201cI hope Apple doesn\u2019t make it impossible for me to work the way I normally do\u201d to \u201cLooks like Apple isn\u2019t going overboard on the protection\u201d to \u201cIs there any protection here at all?\u201d<\/p>\n<p>Maybe there\u2019s some setting on my system I changed long ago that\u2019s now bypassing the warning. If so, I\u2019d like to know what it is. Or maybe I just haven\u2019t hit a high enough danger level yet. Which seems wrong.<\/p>"},{"title":"Hardware vs. software","url":"https:\/\/leancrew.com\/all-this\/2026\/03\/hardware-vs-software\/","author":{"name":"Dr. Drang"},"summary":"Apple\u2019s different philosophies.","date_published":"2026-03-19T18:28:33+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/03\/hardware-vs-software\/","content_html":"<p>I\u2019ve been thinking about the new <a href=\"https:\/\/www.apple.com\/studio-display\/\">Apple Studio Display<\/a> lately, mainly in the context of Jason Snell\u2019s review of it on <a href=\"https:\/\/sixcolors.com\/post\/2026\/03\/2026-apple-studio-display-review-the-smallest-of-upgrades\/\">Six Colors<\/a> and his further discussion with Myke Hurley on <a href=\"https:\/\/www.relay.fm\/upgrade\/607\">Upgrade<\/a>.<\/p>\n<p>Jason\u2019s primary complaint about the Studio Display isn\u2019t its high price or how little it\u2019s improved over the 2022 version. It\u2019s that the base stand\u2014the one you get for $1600\u2014has no height adjustment. To get the ergonomic benefit of height adjustment, you need to buy either the VESA mount adapter (and an arm if you don\u2019t already have one) or the exquisite height-adjustable stand, which is a $400 addition.<\/p>\n<p><img alt=\"Height-adjustable Studio Display in profile\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260319-Height-adjustable%20Studio%20Display%20in%20profile.jpg\" title=\"Height-adjustable Studio Display in profile\" width=\"30%\"\/><\/p>\n<p>It\u2019s hard to argue with Jason when he says this:<\/p>\n<blockquote>\n<p>Apple claims it\u2019s a champion of accessibility. But in my opinion, part of accessibility is ergonomics. Different people need displays at different heights, and we are all shaped differently. Apple\u2019s continued insistence on shipping displays and iMacs that aren\u2019t height-adjustable by default is frustrating. You spend all this money on a pricey Apple display and then, what, put it on an old dictionary? Meanwhile, even the cut-rate competition offers height adjustments.<\/p>\n<\/blockquote>\n<p>The \u201cold dictionary\u201d comment reminded me that in the days of CRT monitors, I\u2014and many of the people I worked with\u2014used the <em>CRC Handbook of Chemistry and Physics<\/em> to bring our monitors up to the proper height. We all agreed it was the best use we\u2019d ever gotten out of that book.<\/p>\n<p>And that experience my friends and I had with the <em>CRC Handbook<\/em> points to an important fact about monitor height adjustment: for most people, it\u2019s a set-it-and-forget-it feature. You get your monitor to a height that works well with your desk setup, and you don\u2019t change it for ages. The smooth fingertip control Apple provides with its upgraded stand\u2014while undoubtedly useful for some\u2014isn\u2019t the kind of ergonomic help that most customers need.<\/p>\n<p>What Apple\u2019s doing here is the opposite of what it does on the software side. Most Apple apps are built to be good enough for the great bulk of its users. People who need more\u2014in a calendar, a mail client, a to-do manager, a spreadsheet, a word processor, and so on\u2014go to third-party apps to get those extra features.<\/p>\n<p>This has served both Apple and its customers well. Even those of us who consider ourselves power users aren\u2019t power users across the whole gamut of computing. We use a mix of basic and advanced apps to match our needs. Apple doesn\u2019t have to stay on the cutting edge of all its many software products, and we get free apps that handle a lot of what we do.<\/p>\n<p>Maybe Apple thinks its basic stand has been designed to hit that sweet spot for the vast majority of its users. Maybe they\u2019ve spent considerable time and money on studies of desks and chairs and torsos and have come up with a single monitor height that\u2019s \u201cjust fine.\u201d I hope not, because that money would\u2019ve been better spent on a simpler and less beautiful height-adjustable stand.<\/p>"},{"title":"A leap year inequality","url":"https:\/\/leancrew.com\/all-this\/2026\/03\/a-leap-year-inequality\/","author":{"name":"Dr. Drang"},"summary":"Calculating leap years and other things with modulo arithmetic.","date_published":"2026-03-15T23:22:53+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/03\/a-leap-year-inequality\/","content_html":"<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href=\"https:\/\/leancrew.com\/all-this\/2026\/03\/a-leap-year-inequality\/\">the original article<\/a> to see them rendered properly.]<\/p>\n<hr \/>\n<p>I\u2019ve been working my way through the fourth edition of Reingold and Dershowitz\u2019s <a href=\"https:\/\/lccn.loc.gov\/2017024295\"><em>Calendrical Calculations<\/em><\/a>, and I want to talk about something I learned.<\/p>\n<p><img alt=\"Calendrical Calculations book cover\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260315-Calendrical%20Calculations%20book%20cover.jpg\" title=\"Calendrical Calculations book cover\" width=\"60%\"\/><\/p>\n<p>It\u2019s a simple inequality that initially appears in the first chapter of the book and gets used several times thereafter. Here it is:<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>\u2113<\/mi><mspace width=\"0.167em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>y<\/mi><mo>+<\/mo><mi mathvariant=\"normal\">\u0394<\/mi><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mrow><mspace width=\"0.444em\"><\/mspace><mrow><mi mathvariant=\"normal\">mod<\/mi><mo>\u2061<\/mo><\/mrow><mspace width=\"0.222em\"><\/mspace><mi>c<\/mi><\/mrow><mo>&lt;<\/mo><mi>\u2113<\/mi><\/mrow><\/math>\n<p>It\u2019s first presented as a way to figure out how leap years are distributed. In some calendars\u2014<em>not<\/em> the Gregorian\u2014there\u2019s a repeating cycle of <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>c<\/mi><\/math> years in which <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>\u2113<\/mi><\/math> years are leap years. If the leap years are distributed as evenly as possible, then the years in which <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>y<\/mi><\/math> satisfies the inequality are the leap years. The <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi mathvariant=\"normal\">\u0394<\/mi><\/math> is a sort of offset that determines the position within the cycle associated with Year 0, and the <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi mathvariant=\"normal\">mod<\/mi><\/math> operator represents <a href=\"https:\/\/en.wikipedia.org\/wiki\/Modulo\">modulo division<\/a>. In Python, that\u2019s the <code>%<\/code> operator.<\/p>\n<p>It\u2019s helpful to look at examples. Let\u2019s say we have a 7-year cycle with 2 leap years and 5 normal years in each cycle. The leap years have to be either 3 or 4 years apart. Here\u2019s an example showing three cycles:<\/p>\n<pre><code>                       1 1 1 1 1 1 1 1 1 1 2 2\nYear 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\nType N N N L N N L N N N L N N L N N N L N N L\n<\/code><\/pre>\n<p>For this, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>c<\/mi><mo>=<\/mo><mn>7<\/mn><\/mrow><\/math>, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>\u2113<\/mi><mo>=<\/mo><mn>2<\/mn><\/mrow><\/math>, and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi mathvariant=\"normal\">\u0394<\/mi><mo>=<\/mo><mn>0<\/mn><\/mrow><\/math>. You can plug the values into the inequality to show that it\u2019s satisfied for years 4, 7, 11, 14, 18, 21, and so on.<\/p>\n<p>Here\u2019s a similar example. The only difference is the offset. In this case, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi mathvariant=\"normal\">\u0394<\/mi><mo>=<\/mo><mn>2<\/mn><\/mrow><\/math>, and the leap years are years 2, 5, 9, 12, 16, 19, and so on.<\/p>\n<pre><code>                       1 1 1 1 1 1 1 1 1 1 2 2\nYear 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\nType N L N N L N N N L N N L N N N L N N L N N\n<\/code><\/pre>\n<p>A practical example of this formula is with the Hebrew calendar. It has a 19-year cycle (<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>c<\/mi><mo>=<\/mo><mn>19<\/mn><\/mrow><\/math>) with 7 leap years (<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>\u2113<\/mi><mo>=<\/mo><mn>7<\/mn><\/mrow><\/math>), and the offset is 11 years (<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi mathvariant=\"normal\">\u0394<\/mi><mo>=<\/mo><mn>11<\/mn><\/mrow><\/math>). The current year is 5786, for which<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mn>7<\/mn><mspace width=\"0.167em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>5786<\/mn><mo>+<\/mo><mn>11<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mrow><mspace width=\"0.444em\"><\/mspace><mrow><mi mathvariant=\"normal\">mod<\/mi><mo>\u2061<\/mo><\/mrow><mspace width=\"0.222em\"><\/mspace><mn>19<\/mn><\/mrow><mo>=<\/mo><mn>14<\/mn><mo>\u2265<\/mo><mn>7<\/mn><\/mrow><\/math>\n<p>so this is not a leap year. But for next year,<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mn>7<\/mn><mspace width=\"0.167em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>5787<\/mn><mo>+<\/mo><mn>11<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mrow><mspace width=\"0.444em\"><\/mspace><mrow><mi mathvariant=\"normal\">mod<\/mi><mo>\u2061<\/mo><\/mrow><mspace width=\"0.222em\"><\/mspace><mn>19<\/mn><\/mrow><mo>=<\/mo><mn>2<\/mn><mo>&lt;<\/mo><mn>7<\/mn><\/mrow><\/math>\n<p>so it <em>is<\/em> a leap year and will have 13 months instead of 12. You can confirm this on any number of websites; the key is to note that 5787 has both an Adar I and an Adar II.<\/p>\n<p>The Gregorian calendar has a 400-year cycle with 97 leap years, but those leap years are <em>not<\/em> distributed as evenly as possible, so the formula can\u2019t be used. If it had been used, we\u2019d have leap years typically every fourth year but occasionally every fifth year. Pope Gregory and his people must\u2019ve thought that would be too tricky to deal with.<\/p>\n<p>Surprisingly (to me, anyway), Reingold and Dershowitz <em>do<\/em> use this formula with the Gregorian calendar, but they use it with months instead of years. Think of the months in the Gregorian calendar as being either short or long. In a year, there are 5 short months and 7 long months, and they\u2019re distributed like this:<\/p>\n<pre><code>                          1 1 1\n        1 2 3 4 5 6 7 8 9 0 1 2\nMonth   J F M A M J J A S O N D\nLength  L S L S L S L L S L S L\n<\/code><\/pre>\n<p>The positions of the long months correspond to our inequality with <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>c<\/mi><mo>=<\/mo><mn>12<\/mn><\/mrow><\/math>, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi>\u2113<\/mi><mo>=<\/mo><mn>7<\/mn><\/mrow><\/math>, and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mi mathvariant=\"normal\">\u0394<\/mi><mo>=<\/mo><mn>11<\/mn><\/mrow><\/math>. Plug in those values, and you\u2019ll see that the long months are 1, 3, 5, 7, 8, 10, and 12.<\/p>\n<p>To calculate the day number within a year, it\u2019s usually easiest to calculate the number of days in the preceding months and then add the day number within the current month. Today is March 15, so it\u2019s Day <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mn>31<\/mn><mo>+<\/mo><mn>28<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>+<\/mo><mn>15<\/mn><mo>=<\/mo><mn>74<\/mn><\/mrow><\/math> of the year.<\/p>\n<p>Instead of looping through the lengths of the preceding months, R&amp;D use a formula based on our inequality to count the number of long months before the current month. That formula is<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mrow><mi>\u2113<\/mi><mspace width=\"0.167em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>m<\/mi><mo>+<\/mo><mi mathvariant=\"normal\">\u0394<\/mi><mo>-<\/mo><mn>1<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><\/mrow><mi>c<\/mi><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><mo>\u2212<\/mo><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mrow><mi>\u2113<\/mi><mi mathvariant=\"normal\">\u0394<\/mi><\/mrow><mi>c<\/mi><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><\/mrow><\/math>\n<p>where the brackets without tops represent the <a href=\"https:\/\/mathworld.wolfram.com\/FloorFunction.html\">floor function<\/a>, i.e., the integer equal to or just below what\u2019s inside the brackets.<\/p>\n<p>Plugging in our values for <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>c<\/mi><\/math>, <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>\u2113<\/mi><\/math>, and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi mathvariant=\"normal\">\u0394<\/mi><\/math> and doing some algebra, we get<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mrow><mn>7<\/mn><mi>m<\/mi><mo>\u2212<\/mo><mn>2<\/mn><\/mrow><mn>12<\/mn><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><\/math>\n<p>This is the number of long months in the year before the current month <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>m<\/mi><\/math>.<\/p>\n<p>If February had 30 days, the number of days in the months before the current month would be<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mn>30<\/mn><mspace width=\"0.167em\"><\/mspace><mo form=\"prefix\" stretchy=\"false\">(<\/mo><mi>m<\/mi><mo>\u2212<\/mo><mn>1<\/mn><mo form=\"postfix\" stretchy=\"false\">)<\/mo><mo>+<\/mo><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mrow><mn>7<\/mn><mi>m<\/mi><mo>\u2212<\/mo><mn>2<\/mn><\/mrow><mn>12<\/mn><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><mo>=<\/mo><mrow><mo form=\"prefix\" stretchy=\"true\">\u230a<\/mo><mfrac><mrow><mn>367<\/mn><mi>m<\/mi><mo>\u2212<\/mo><mn>362<\/mn><\/mrow><mn>12<\/mn><\/mfrac><mo form=\"postfix\" stretchy=\"true\">\u230b<\/mo><\/mrow><\/mrow><\/math>\n<p>So to get the (Gregorian) day of the year, R&amp;D calculate the day number as if February had 30 days and then subtract (if necessary) to account for February\u2019s deficiency. In Python, the code looks like this:<\/p>\n<pre><code>python:\ndef day_of_year(year, month, day):\n  year_day = (367 * month - 362) \/\/ 12 + day\n  if month &lt;= 2:\n    return year_day\n  elif leap_year(year):\n    return year_day - 1\n  else:\n    return year_day - 2\n<\/code><\/pre>\n<p>where I\u2019m assuming we already have a Boolean function <code>leap_year<\/code> to determine whether it\u2019s a leap year or not. That\u2019s not necessarily the most obvious code in the world, but it makes sense if you\u2019ve gone through the derivation.<\/p>\n<p>One last thing. Reingold is the co-author of <a href=\"https:\/\/iccl.inf.tu-dresden.de\/w\/images\/9\/92\/Harris-ACM2004.pdf\">a paper<\/a> in which our inequality is connected to <a href=\"https:\/\/en.wikipedia.org\/wiki\/Euclidean_algorithm\">Euclid\u2019s algorithm<\/a> for calculating the greatest common divisor and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bresenham%27s_line_algorithm\">Bresenham\u2019s algorithm<\/a> for plotting lines on bitmaps. Which is pretty cool.<\/p>"},{"title":"Scientific American and Friday the 13th","url":"https:\/\/leancrew.com\/all-this\/2026\/03\/scientific-american-and-friday-the-13th\/","author":{"name":"Dr. Drang"},"summary":"SciAm horns in on my territory.","date_published":"2026-03-13T23:48:46+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/03\/scientific-american-and-friday-the-13th\/","content_html":"<p><em>Scientific American<\/em> has <a href=\"https:\/\/www.scientificamerican.com\/article\/why-friday-the-13th-is-a-mathematical-inevitability\/\">a fun little article<\/a> today about the frequency of Friday the 13ths. It ends with this table,<\/p>\n<p><img alt=\"SciAm 13th table\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260313-SciAm%2013th%20table.png\" title=\"SciAm 13th table\" width=\"100%\"\/><\/p>\n<p>and this true but overstated conclusion:<\/p>\n<blockquote>\n<p>In other words, the 13th of a month will be a Friday more times than any other day of the week.<\/p>\n<\/blockquote>\n<p>Well, yes, if you live to be 400 years old, you\u2019ll see one more Friday the 13th than Wednesday the 13ths or Sunday the 13ths. Kind of a weird thing to focus on, though. I\u2019m guessing you\u2019ll have other worries by then.<\/p>\n<p>But I shouldn\u2019t be so snarky. A few years ago, <a href=\"https:\/\/leancrew.com\/all-this\/2023\/10\/friday-the-13th-comes-on-a-friday-this-month\/\">I wrote a post<\/a> that calculated the same set of Fri13 counts for a 400-year Gregorian cycle. I did the calculations in Mathematica and (of course) showed the code. Today, I did the same thing in Python,<\/p>\n<pre><code>python:\n 1:  #!\/usr\/bin\/env python\n 2:  \n 3:  from datetime import date\n 4:  \n 5:  f13s = [0]*7\n 6:  for y in range(1800, 2200):\n 7:    for m in range(1, 13):\n 8:      wd = date(y, m, 13).weekday()\n 9:      f13s[wd] += 1\n10:  \n11:  print(f13s)\n<\/code><\/pre>\n<p>and got a result of<\/p>\n<pre><code>[685, 685, 687, 684, 688, 684, 687]\n<\/code><\/pre>\n<p>for Monday through Sunday. This also matches the SciAm table.<\/p>\n<p>Those of us who are alive now (and have realistic longevities) won\u2019t live through any non-leap century years. For us, the calendar has and will repeat every 28 years (1461 weeks), and over every 28-year period in our lives, there will be 48 Fri13s, the same as the number of Mon13s, Tue13s, Wed13s, and so on.<\/p>\n<p>Of course, few of us live exactly a multiple of 28 years. Personally, I\u2019ve lived through 113 Fri13s so far, which is just under the number of Sun13s I\u2019ve seen (114). So I\u2019ve been lucky?<\/p>\n<p>In a Friday the 13th post from <a href=\"https:\/\/leancrew.com\/all-this\/2012\/07\/friday-the-13th-frequency\/\">way back in 2012<\/a>, I talked about how Fri13s repeat within years because the number of days in certain month sequences is a multiple of 7. So if there\u2019s a Fri13 in April, there will be another in July because<\/p>\n<pre><code>Apr + May + Jun\n30  + 31  + 30  = 91\n<\/code><\/pre>\n<p>which is 13 weeks. The last time that happened was in 2018.<\/p>\n<p>Similarly, if there\u2019s a Fri13 in September, there will also be one in December because<\/p>\n<pre><code>Sep + Oct + Nov\n30  + 31  + 30  = 91\n<\/code><\/pre>\n<p>That pair of Fri13s last happened in 2024.<\/p>\n<p>There\u2019s also an 8-month sequence that adds to a multiple of 7:<\/p>\n<pre><code>Mar + Apr + May + Jun + Jul + Aug + Sep + Oct\n31  + 30  + 31  + 30  + 31  + 31  + 30  + 31  = 245\n<\/code><\/pre>\n<p>So there will be another Fri13 in November of this year.<\/p>\n<p>The sequences above happen every year. In non-leap years only\u2014this year, for example\u2014a Fri13 in February will be followed by one in March. In leap years only, a Fri13 in January will be followed by one in April. That last happened in 2012.<\/p>\n<p>I covered all these repeated Fri13s in <a href=\"https:\/\/leancrew.com\/all-this\/2012\/07\/friday-the-13th-frequency\/\">that 2012 post<\/a>. Today, I learned of a new repeat that spans certain year boundaries. If there\u2019s a Fri13 in December of a non-leap year that\u2019s followed by a leap year, there will be a Fri13 in March of that following year. That last happened in December of 2019 and March of 2020.<\/p>\n<p>Superstitious or not, you have to admit March of 2020 was pretty unlucky.<\/p>"},{"title":"Port ability","url":"https:\/\/leancrew.com\/all-this\/2026\/03\/port-ability\/","author":{"name":"Dr. Drang"},"summary":"A brief thought about the MacBook Neo.","date_published":"2026-03-11T00:53:12+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/03\/port-ability\/","content_html":"<p>I read <a href=\"https:\/\/sixcolors.com\/post\/2026\/03\/macbook-neo-review\/\">Jason Snell\u2019s review<\/a> of the MacBook Neo this morning and was struck by this section on its two USB-C ports:<\/p>\n<blockquote>\n<p>So Apple has done the work to put two USB-C ports on the Neo\u2014and those ports reveal a bit more of the struggles Apple had in building this computer. Both of the USB-C ports will let you charge (which is good, because there\u2019s no MagSafe), but only the one that\u2019s furthest back is a fully functional USB 3 port with support for driving an external display at 4K, 60 frames per second. The closer-in USB port only offers USB 2 speeds. (The good news is that Apple has built alerts into macOS that will warn you if the device you\u2019ve plugged into the slow port would be better off plugged into the faster one, so you won\u2019t be transferring files slowly unnecessarily.)<\/p>\n<\/blockquote>\n<p>It reminded me of <a href=\"https:\/\/mastodon.social\/@film_girl\/116172541746813426?kjy=spring\">Christina Warren\u2019s angry Mastodon post<\/a> about the Neo\u2019s ports:<\/p>\n<blockquote>\n<p>I\u2019m just going to say that pointing out flaws in $600 and $700 laptops and having people instinctively respond \u201cit\u2019s not for real users, these buyers don\u2019t know\/care\u201d is gross. Why should we make the assumption that those buyers don\u2019t still deserve better, or at least on par with the 6 year old product it\u2019s replacing that sold at the same price. Stop assuming people who don\u2019t spend $1000+ on tech are imbeciles or deserve subpar options. No one in 2026 deserves a laptop with a single USB 3 port.<\/p>\n<\/blockquote>\n<p>My first thought upon reading Christina\u2019s complaint last week was \u201cWhy should I care about the configuration of a computer I\u2019ll never buy?\u201d Kind of a Republican thought, I admit, and I\u2019m not proud of it. But I have many reasons to be disappointed by Apple, and I need to conserve my outrage. Christina\u2019s much younger than I am and has deeper outrage reserves.<\/p>\n<p>Jason pointed out the biggest problem with the low-speed port in his next paragraph:<\/p>\n<blockquote>\n<p>Honestly, I\u2019m more disappointed by the fact that mismatched ports can lead to user frustration\u2014no, not that port, the other one\u2014than I am about the one slow USB port.<\/p>\n<\/blockquote>\n<p>Many Neo users will be too young to remember the joy of flipping USB-A plugs back and forth before getting the orientation right. Apple has updated that wonderful experience for the USB-C age.<\/p>"},{"title":"Lent and Lisp","url":"https:\/\/leancrew.com\/all-this\/2026\/02\/lent-and-lisp\/","author":{"name":"Dr. Drang"},"summary":"More stuff about calendars, some of which I should have written about last week.","date_published":"2026-02-25T15:13:32+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/02\/lent-and-lisp\/","content_html":"<p>After writing <a href=\"https:\/\/leancrew.com\/all-this\/2026\/02\/chinese-new-year-and-ramadan\/\">last week\u2019s post<\/a> about the start of Ramadan and Chinese New Year, I expected to hear from people asking why I didn\u2019t include the further coincidence of Ash Wednesday. I was surprised that the only such feedback I got was an email from <a href=\"https:\/\/rhymeswithdiploma.com\/\">TJ Luoma<\/a>. It makes sense that Lent would be on TJ\u2019s mind\u2014it\u2019s a big part of his business calendar\u2014but I had an answer prepared, and I wrote him back with my reasons.<\/p>\n<p>As I typed out the reply, though, the reasons seemed weaker. Yes, it\u2019s true that the full moon that determines this year\u2019s <a href=\"https:\/\/aa.usno.navy.mil\/faq\/easter\">date of Easter<\/a> (and therefore Ash Wednesday) isn\u2019t part of the same lunation that determines the start of Ramadan and Chinese New Year, so there was an astronomical reason to keep Ash Wednesday out of the post. But it\u2019s also true that both Ramadan and Lent represent periods of self-denial, so there\u2019s a cultural connection.<\/p>\n<p>Adding a new bit of Emacs Lisp code to what I\u2019d already written to include a check for Ash Wednesday wouldn\u2019t be hard, but another thought was buzzing in my head: switching from Emacs Lisp to Common Lisp. The ELisp calendar functions were written by Edward Reingold and Nachum Dershowitz, authors of the well-known <a href=\"https:\/\/lccn.loc.gov\/2017024295\"><em>Calendrical Calculations<\/em><\/a>. That book includes <a href=\"https:\/\/www.cambridge.org\/us\/universitypress\/subjects\/computer-science\/computing-general-interest\/calendrical-calculations-ultimate-edition-4th-edition?format=HB#resources\">a lot of code<\/a> that isn\u2019t in the Emacs implementation, code that does astronomical calculations I\u2019d like to explore. So it seemed like a good idea to write a Ramadan\/Lent\/Chinese New Year script in Common Lisp and use the functions from the book.<\/p>\n<p>The problem with that idea was that the Common Lisp code I downloaded from the <a href=\"https:\/\/www.cambridge.org\/us\/universitypress\/subjects\/computer-science\/computing-general-interest\/calendrical-calculations-ultimate-edition-4th-edition?format=HB#resources\">Cambridge University Press site<\/a>, <code>calendar.l<\/code>, didn\u2019t work. I tried it in both <a href=\"https:\/\/www.sbcl.org\/\">SBCL<\/a> and <a href=\"https:\/\/clisp.sourceforge.io\/\">CLISP<\/a>, and calling<\/p>\n<pre><code>(load \"calendrical.l\")\n<\/code><\/pre>\n<p>threw a huge number of errors. I was, it turned out, not the first to have <a href=\"https:\/\/stackoverflow.com\/questions\/72716454\/start-working-with-large-lisp-library-calendrical-calculations\">run into this problem<\/a>. The workarounds suggested there on Stack Overflow didn\u2019t help. There\u2019s <a href=\"https:\/\/elangocheran.com\/2023\/12\/06\/calendars-and-usable-calendrical-calculations-code\/\">a port to Clojure<\/a> that apparently works, but I was reluctant to use <a href=\"https:\/\/clojure.org\/\">Clojure<\/a> and have to maintain both it and a Java Virtual Machine.<\/p>\n<p>What I found, though, was that Reingold &amp; Dershowitz\u2019s code would load in CLISP with one simple change. After many lines of comments, the working part of <code>calendar.l<\/code> starts with these lines:<\/p>\n<pre><code>(in-package \"CC4\")\n\n(export '(\n          acre\n          advent\n          akan-day-name\n          akan-day-name-on-or-before\n\n          [and so on for a few hundred lines]\n\n          yom-ha-zikkaron\n          yom-kippur\n          zone\n          ))\n<\/code><\/pre>\n<p>Deleting these lines got me a file that would load without errors in CLISP,<sup id=\"fnref:sbcl\"><a href=\"#fn:sbcl\" rel=\"footnote\">1<\/a><\/sup> so I named the edited version <code>calendar.lisp<\/code> and saved it in my <code>~\/lisp\/<\/code> directory. I believe the problem with the unedited code has something to do with packages and namespaces, and if I keep using Common Lisp long enough, I may learn how to make a better fix. Until then, this will do.<\/p>\n<p>With a working library of calendar code, I wrote the following script, <code>ramadan-lent<\/code>, to get the dates for which Ramadan 1 and Ash Wednesday correspond over a 500-year period:<\/p>\n<pre><code> 1:  #! \/usr\/bin\/env clisp -q\n 2:  \n 3:  ;; The edited Calendrical Calculations code by Reingold and Dershowitz\n 4:  (load \"calendar.lisp\")\n 5:  \n 6:  ;; Names\n 7:  (setq\n 8:    weekday-names\n 9:    '(\"Sunday\" \"Monday\" \"Tuesday\" \"Wednesday\" \"Thursday\" \"Friday\" \"Saturday\")\n10:  \n11:    gregorian-month-names\n12:    '(\"January\" \"February\" \"March\" \"April\" \"May\" \"June\"\n13:      \"July\" \"August\" \"September\" \"October\" \"November\" \"December\"))\n14:  \n15:  ;; Date string function\n16:  (defun gregorian-date-string (date)\n17:    (let ((g-date (gregorian-from-fixed date))\n18:          (weekday (day-of-week-from-fixed date)))\n19:      (format nil \"~a, ~a ~d, ~d\"\n20:        (nth weekday weekday-names)\n21:        (nth (1- (second g-date)) gregorian-month-names)\n22:        (third g-date)\n23:        (first g-date))))\n24:  \n25:  ;; Get today's (Gregorian) date.\n26:  (multiple-value-setq\n27:    (t-second t-minute t-hour t-day t-month t-year t-weekday t-dstp t-tz)\n28:    (get-decoded-time))\n29:    \n30:  ;; Loop through 500 Islamic years, from 250 years ago to 250 years in\n31:  ;; the future and find each Ramadan 1 that corresponds to Ash Wednesday.\n32:  ;; Print as a Gregorian date.\n33:  (setq\n34:    f (fixed-from-gregorian (list t-year t-month t-day))\n35:    ti-year (first (islamic-from-fixed f)))\n36:  (dotimes (i 500)\n37:    (setq iy (+ (- ti-year 250) i)\n38:          r (fixed-from-islamic (list iy 9 1))\n39:          g-year (gregorian-year-from-fixed r)\n40:          aw (- (easter g-year) 46))\n41:    (if (equal aw r)\n42:      (format t \"~a~%\" (gregorian-date-string r))))\n<\/code><\/pre>\n<p>The <code>-q<\/code> in the shebang line tells CLISP not to put up its typical welcome banner. I had to write my own <code>gregorian-date-string<\/code> function (Lines 16\u201323) because <code>calendrical.lisp<\/code> doesn\u2019t have one, but it was pretty easy.<\/p>\n<p>In fact, it was all pretty easy. I haven\u2019t programmed in Lisp or Scheme in quite a while, but I quickly remembered how fun it is. The only tricky bits were:<\/p>\n<ul>\n<li>learning how to handle the multiple value output of <code>get-decoded-time<\/code> (Lines 26\u201328);<\/li>\n<li>remembering how to handle more than one variable assignment in <code>setq<\/code>; and<\/li>\n<li>recognizing that what the ELisp calendar library calls \u201cabsolute\u201d dates, the Common Lisp calendar library calls \u201cfixed\u201d dates.<\/li>\n<\/ul>\n<p>R&amp;D\u2019s library has an <code>easter<\/code> function for getting the date of Easter for a given (Gregorian) year; Line 40 gets the date of the associated Ash Wednesday by going back 46 days from Easter.<\/p>\n<p>The output of <code>ramadan-lent<\/code> was<\/p>\n<pre><code>Wednesday, February 6, 1799\nWednesday, February 24, 1830\nWednesday, February 22, 1928\nWednesday, February 18, 2026\nWednesday, March 7, 2057\nWednesday, February 16, 2124\nWednesday, March 5, 2155\nWednesday, February 13, 2222\nWednesday, March 2, 2253\n<\/code><\/pre>\n<p>The most common gap between successive correspondences was 98 years, but there were occasional gaps of 31 and 67 years.<\/p>\n<p>It took only a few extra lines at the end to include a check for Chinese New Year. Here\u2019s <code>ramadan-lent-new-year<\/code>:<\/p>\n<pre><code> 1:  #! \/usr\/bin\/env clisp -q\n 2:  \n 3:  ;; The edited Calendrical Calculations code by Reingold and Dershowitz\n 4:  (load \"calendar.lisp\")\n 5:  \n 6:  ;; Names\n 7:  (setq\n 8:    weekday-names\n 9:    '(\"Sunday\" \"Monday\" \"Tuesday\" \"Wednesday\" \"Thursday\" \"Friday\" \"Saturday\")\n10:  \n11:    gregorian-month-names\n12:    '(\"January\" \"February\" \"March\" \"April\" \"May\" \"June\"\n13:      \"July\" \"August\" \"September\" \"October\" \"November\" \"December\"))\n14:  \n15:  ;; Date string function\n16:  (defun gregorian-date-string (date)\n17:    (let ((g-date (gregorian-from-fixed date))\n18:          (weekday (day-of-week-from-fixed date)))\n19:      (format nil \"~a, ~a ~d, ~d\"\n20:        (nth weekday weekday-names)\n21:        (nth (1- (second g-date)) gregorian-month-names)\n22:        (third g-date)\n23:        (first g-date))))\n24:  \n25:  ;; Get today's (Gregorian) date.\n26:  (multiple-value-setq\n27:    (t-second t-minute t-hour t-day t-month t-year t-weekday t-dstp t-tz)\n28:    (get-decoded-time))\n29:    \n30:  ;; Loop through 500 Islamic years, from 250 years ago to 250 years in\n31:  ;; the future and find each Ramadan 1 that corresponds to Ash Wednesday\n32:  ;; and Chinese New Year.\n33:  ;; Print as a Gregorian date.\n34:  (setq\n35:    f (fixed-from-gregorian (list t-year t-month t-day))\n36:    ti-year (first (islamic-from-fixed f)))\n37:  (dotimes (i 500)\n38:    (setq iy (+ (- ti-year 250) i)\n39:          r (fixed-from-islamic (list iy 9 1))\n40:          g-year (gregorian-year-from-fixed r)\n41:          aw (- (easter g-year) 46))\n42:    (if (equal aw r)\n43:      (let ((ny (chinese-new-year-on-or-before r)))\n44:        (if (equal ny (1- r))\n45:          (format t \"~a~%\" (gregorian-date-string r))))))\n<\/code><\/pre>\n<p>The <code>chinese-new-year-on-or-before<\/code> function (Line 43), which is in the library to aid in the writing of the typically more useful <code>chinese-from-fixed<\/code> function, turned out to be just what I needed here. It gets me the fixed date of Chinese New Year that\u2019s on or before Ramadan 1. I then check to see if that\u2019s exactly one day before Ramadan 1 in Line 44.<\/p>\n<p>This script\u2019s output was<\/p>\n<pre><code>Wednesday, February 6, 1799\nWednesday, February 18, 2026\nWednesday, February 16, 2124\nWednesday, February 13, 2222\n<\/code><\/pre>\n<p>We see that last week\u2019s triple correspondence hadn\u2019t occurred in 227 years, and it\u2019ll be another 98 years before the next one. Thanks to TJ for getting me to look into this rare event.<\/p>\n<p>I\u2019ve had a copy of the second edition of <em>Calendrical Calculations<\/em> (called the <em>Millenium Edition<\/em> because it came out in 2001) for over twenty years. As I was fiddling with <code>ramadan-lent<\/code> and <code>ramadan-lent-new-year<\/code>, I ordered the fourth (or <em>Ultimate<\/em>) edition so I\u2019d have the best reference on the functions in <code>calendar.lisp<\/code>. You can expect more posts on calendars and astronomical events as I dig into it.<\/p>\n<div class=\"footnotes\">\n<hr\/>\n<ol>\n<li id=\"fn:sbcl\">\n<p>Not in SBCL, unfortunately. As best as I can tell, SBCL wants every function to be defined in terms of previously defined functions, and R&amp;D didn\u2019t write their code that way. CLISP is more forgiving in the order of definitions.\u00a0<a href=\"#fnref:sbcl\" rev=\"footnote\">\u21a9<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>"},{"title":"My OmniGraffle ticks","url":"https:\/\/leancrew.com\/all-this\/2026\/02\/my-omnigraffle-ticks\/","author":{"name":"Dr. Drang"},"summary":"Dimension lines without arrows and structural stencils.","date_published":"2026-02-20T17:40:43+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/02\/my-omnigraffle-ticks\/","content_html":"<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href=\"https:\/\/leancrew.com\/all-this\/2026\/02\/my-omnigraffle-ticks\/\">the original article<\/a> to see them rendered properly.]<\/p>\n<hr \/>\n<p>I thought some of you might be wondering about the dimensions on this drawing from <a href=\"https:\/\/leancrew.com\/all-this\/2026\/02\/easy-to-be-hard\/\">yesterday\u2019s post<\/a>:<\/p>\n<p><img alt=\"Radii relationship\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260219-Radii%20relationship.png\" title=\"Radii relationship\" width=\"50%\"\/><\/p>\n<p>Don\u2019t be offended\u2014I trust you all to know why the horizontal components of the two diagonals are <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mi>\/<\/mi><msqrt><mn>2<\/mn><\/msqrt><\/mrow><\/math> and <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mn>1<\/mn><\/msub><mi>\/<\/mi><msqrt><mn>2<\/mn><\/msqrt><\/mrow><\/math>. What I thought you might be questioning was my use of short diagonal ticks instead of arrowheads on the dimension lines along the bottom of the drawing.<\/p>\n<p>This is a style I picked up as an undergrad. I use it all the time in hand-drawn sketches, and I think I\u2019m going to use it here from now on. The first person I saw using this kind of dimension line was <a href=\"https:\/\/modernize.cee.illinois.edu\/spaces\/article\/47912\">John Haltiwanger<\/a>, who taught the second structural analysis class I took, and I adopted it in emulation of him. I mentioned Prof. Haltiwanger and his insistence on good sketches in <a href=\"https:\/\/leancrew.com\/all-this\/2025\/11\/a-sense-of-structure\/\">this post<\/a> last year.<\/p>\n<p>There are two advantages to using ticks instead of arrowheads: speed and clarity. The speed advantage is obvious. Clarity comes in drawings of structural problems, where we use arrowheads to represent forces. Although it\u2019s usually clear from context which lines are for forces and which are for dimensions, sometimes the two cross or are close enough to one another that it helps to use different ends. This is especially true when sketching on paper or a blackboard, where you can\u2019t use line thickness to distinguish between the two.<\/p>\n<p>Let\u2019s say I\u2019m going to analyze a simply supported beam with a uniformly distributed load across its entire length and a concentrated load at its center. I\u2019d sketch it this way in my notebook:<\/p>\n<p><img alt=\"Simply-supported beam sketch\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260220-Simply-supported%20beam%20sketch.jpg\" title=\"Simply-supported beam sketch\" width=\"80%\"\/><\/p>\n<p>After drawing the beam, supports, and forces, I make the vertical leader lines, one long dimension line the full length of the beam, and then three quick diagonal ticks.<\/p>\n<p>If I\u2019m going to blog about it, I\u2019ll turn it into a nicer drawing in <a href=\"https:\/\/www.omnigroup.com\/omnigraffle\">OmniGraffle<\/a>:<\/p>\n<p><img alt=\"Simply-supported beam OmniGraffle drawing\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260220-Simply-supported%20beam%20OmniGraffle%20drawing.png\" title=\"Simply-supported beam OmniGraffle drawing\" width=\"80%\"\/><\/p>\n<p>Using blue for the leader and dimension lines\u2014and making them thinner\u2014is a good way to distinguish them from forces, and I\u2019ve been doing that for years.<sup id=\"fnref:blue\"><a href=\"#fn:blue\" rel=\"footnote\">1<\/a><\/sup> I\u2019ve usually used a different style of arrowhead for the dimensions than for the forces. OmniGraffle has a huge number of arrowhead styles:<\/p>\n<p><img alt=\"OmniGraffle arrows\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260220-OmniGraffle%20arrows.png\" title=\"OmniGraffle arrows\" width=\"50%\"\/><\/p>\n<p>I\u2019ve generally used the \u201cFilled Arrow\u201d for forces and the \u201cSharp Arrow\u201d for dimensions. You might think I\u2019d use the \u201cDimension Arrow,\u201d but I\u2019ve never liked it. It has a little leader line attached to it, which is, unfortunately, pretty much useless because it\u2019s always the same length. Leader lines are supposed to draw your eye from the object to the dimension line\u2014they have to be different lengths, and they\u2019re usually much longer than the tiny ticks OmniGraffle provides.<\/p>\n<p>I could continue to use the sharp arrows, of course, but I\u2019ve decided my drawings here should look more like the sketches I make in my notebook. And it\u2019s a nice tribute to Prof. Haltiwanger. Although his was my second structural analysis class, it was the one in which I began to truly appreciate the topic.<\/p>\n<p>While I\u2019m at it, I should mention that I made a set of stencils with objects commonly seen in structural analysis drawings.<\/p>\n<p><img alt=\"Structural stencils for OmniGraffle\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260220-Structural%20stencils%20for%20OmniGraffle.png\" title=\"Structural stencils for OmniGraffle\" width=\"50%\"\/><\/p>\n<p>The top two rows show fixed, simple, and guided ends; the bottom two rows show springs. There are four variations on simple ends; the differences depend on whether there\u2019s a roller and whether I want to show the hinge explicitly. There\u2019s only one linear spring, but I needed four rotational springs to account for different angles of attachment. All of these can be rotated as needed once they\u2019re placed in an OmniGraffle document.<\/p>\n<div class=\"footnotes\">\n<hr\/>\n<ol>\n<li id=\"fn:blue\">\n<p>As you can see, I have not been consistent in my use of blue or black for the dimensions themselves.\u00a0<a href=\"#fnref:blue\" rev=\"footnote\">\u21a9<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>"},{"title":"Easy to be hard","url":"https:\/\/leancrew.com\/all-this\/2026\/02\/easy-to-be-hard\/","author":{"name":"Dr. Drang"},"summary":"After solving this SciAm puzzle the easy way, I redid it the hard way.","date_published":"2026-02-20T00:25:13+00:00","id":"https:\/\/leancrew.com\/all-this\/2026\/02\/easy-to-be-hard\/","content_html":"<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href=\"https:\/\/leancrew.com\/all-this\/2026\/02\/easy-to-be-hard\/\">the original article<\/a> to see them rendered properly.]<\/p>\n<hr \/>\n<p>Here\u2019s <a href=\"https:\/\/www.scientificamerican.com\/game\/math-puzzle-sum-circles\/\">a geometry puzzle<\/a> from the March issue of <em>Scientific American<\/em>. If you see the trick, it\u2019s easy to solve.<sup id=\"fnref:trick\"><a href=\"#fn:trick\" rel=\"footnote\">1<\/a><\/sup> After doing it the easy way, I decided to solve it again the hard way, as if I hadn\u2019t noticed the trick.<\/p>\n<p>Here\u2019s the puzzle:<\/p>\n<p><img alt=\"SciAm circle puzzle by Amanda Montan\u0303ez\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260219-SciAm%20circle%20puzzle%20by%20Amanda%20Montanez.png\" title=\"SciAm circle puzzle by Amanda Montan\u0303ez\" width=\"100%\"\/><\/p>\n<blockquote>\n<p>A red circle is inscribed inside a blue square. The arrangement leaves gaps in the square\u2019s four corners, two of which are filled with smaller circles that just barely touch the big red circle and the two corner sides of the blue square. This, in turn, leaves two smaller gaps in the corners, which are filled with smaller circles, and so on, with ever smaller circles ad infinitum. The entire diagram is inscribed inside of a 1 \u00d7 1 gray square. What is the total circumference of all the circles?<\/p>\n<\/blockquote>\n<p>Without the trick, we\u2019re going to have to work out all the circumferences and add them together. We\u2019ll start by figuring out the relationship between the radii of consecutive circles. Here\u2019s a quarter of the largest circle, the radius of which we\u2019ll call <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>r<\/mi><mn>0<\/mn><\/msub><\/math>, and the next largest circle, the radius of which we\u2019ll call <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>r<\/mi><mn>1<\/mn><\/msub><\/math>:<\/p>\n<p><img alt=\"Radii relationship\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260219-Radii%20relationship.png\" title=\"Radii relationship\" width=\"50%\"\/><\/p>\n<p>From this drawing, we can express the width in two ways and set them equal to one another:<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mo>=<\/mo><msub><mi>r<\/mi><mn>1<\/mn><\/msub><mo>+<\/mo><mfrac><msub><mi>r<\/mi><mn>1<\/mn><\/msub><msqrt><mn>2<\/mn><\/msqrt><\/mfrac><mo>+<\/mo><mfrac><msub><mi>r<\/mi><mn>0<\/mn><\/msub><msqrt><mn>2<\/mn><\/msqrt><\/mfrac><\/mrow><\/math>\n<p>Multiplying through by <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msqrt><mn>2<\/mn><\/msqrt><\/math> and rearranging, we get<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mn>1<\/mn><\/msub><mo>=<\/mo><mfrac><mrow><msqrt><mn>2<\/mn><\/msqrt><mo>\u2212<\/mo><mn>1<\/mn><\/mrow><mrow><msqrt><mn>2<\/mn><\/msqrt><mo>+<\/mo><mn>1<\/mn><\/mrow><\/mfrac><mspace width=\"0.167em\"><\/mspace><msub><mi>r<\/mi><mn>0<\/mn><\/msub><\/mrow><\/math>\n<p>I want to turn this into a fraction with a 1 in the numerator, so I\u2019ll multiply the top and bottom by an expression that will eliminate the square root in the numerator:<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mn>1<\/mn><\/msub><mo>=<\/mo><mfrac><mrow><msqrt><mn>2<\/mn><\/msqrt><mo>\u2212<\/mo><mn>1<\/mn><\/mrow><mrow><msqrt><mn>2<\/mn><\/msqrt><mo>+<\/mo><mn>1<\/mn><\/mrow><\/mfrac><mspace width=\"0.167em\"><\/mspace><mfrac><mrow><msqrt><mn>2<\/mn><\/msqrt><mo>+<\/mo><mn>1<\/mn><\/mrow><mrow><msqrt><mn>2<\/mn><\/msqrt><mo>+<\/mo><mn>1<\/mn><\/mrow><\/mfrac><mspace width=\"0.167em\"><\/mspace><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mo>=<\/mo><mfrac><mrow><mn>2<\/mn><mo>\u2212<\/mo><mn>1<\/mn><\/mrow><mrow><mn>2<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><mo>+<\/mo><mn>1<\/mn><\/mrow><\/mfrac><mspace width=\"0.167em\"><\/mspace><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mo>=<\/mo><mfrac><mn>1<\/mn><mrow><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><\/mrow><\/mfrac><mspace width=\"0.167em\"><\/mspace><msub><mi>r<\/mi><mn>0<\/mn><\/msub><\/mrow><\/math>\n<p>This relationship also holds for any two consecutive circles,<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mi>i<\/mi><\/msub><mo>=<\/mo><mfrac><mn>1<\/mn><mrow><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><\/mrow><\/mfrac><mspace width=\"0.167em\"><\/mspace><msub><mi>r<\/mi><mrow><mi>i<\/mi><mo>\u2212<\/mo><mn>1<\/mn><\/mrow><\/msub><\/mrow><\/math>\n<p>which means we can express the radius of the <em>i<\/em>th circle in terms of the radius of the largest circle:<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mi>i<\/mi><\/msub><mo>=<\/mo><mfrac><mn>1<\/mn><msup><mrow><mo form=\"prefix\" stretchy=\"true\">(<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><mo form=\"postfix\" stretchy=\"true\">)<\/mo><\/mrow><mi>i<\/mi><\/msup><\/mfrac><mspace width=\"0.25em\"><\/mspace><msub><mi>r<\/mi><mn>0<\/mn><\/msub><\/mrow><\/math>\n<p>So the sum of all the circumferences is <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mn>2<\/mn><mi>\u03c0<\/mi><\/mrow><\/math> times the sum of all the radii:<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mn>2<\/mn><mi>\u03c0<\/mi><mrow><mo form=\"prefix\" stretchy=\"true\">[<\/mo><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mo>+<\/mo><mn>2<\/mn><munderover><mo>\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mo accent=\"false\">\u221e<\/mo><\/munderover><mspace width=\"0.278em\"><\/mspace><mfrac><mn>1<\/mn><msup><mrow><mo form=\"prefix\" stretchy=\"true\">(<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><mo form=\"postfix\" stretchy=\"true\">)<\/mo><\/mrow><mi>i<\/mi><\/msup><\/mfrac><mspace width=\"0.167em\"><\/mspace><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mo form=\"postfix\" stretchy=\"true\">]<\/mo><\/mrow><mo>=<\/mo><mn>2<\/mn><mi>\u03c0<\/mi><mspace width=\"0.167em\"><\/mspace><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mspace width=\"0.278em\"><\/mspace><mrow><mo form=\"prefix\" stretchy=\"true\">[<\/mo><mn>1<\/mn><mo>+<\/mo><mn>2<\/mn><munderover><mo>\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mo accent=\"false\">\u221e<\/mo><\/munderover><mspace width=\"0.278em\"><\/mspace><mfrac><mn>1<\/mn><msup><mrow><mo form=\"prefix\" stretchy=\"true\">(<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><mo form=\"postfix\" stretchy=\"true\">)<\/mo><\/mrow><mi>i<\/mi><\/msup><\/mfrac><mo form=\"postfix\" stretchy=\"true\">]<\/mo><\/mrow><\/mrow><\/math>\n<p>Note that there\u2019s only one circle with radius <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>r<\/mi><mn>0<\/mn><\/msub><\/math>, but two circles for all the other radii.<\/p>\n<p>By the way, this expression is where it\u2019s helpful to have the fraction inside the sum written with a 1 in the numerator. We know that<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><munderover><mo>\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mo accent=\"false\">\u221e<\/mo><\/munderover><mspace width=\"0.278em\"><\/mspace><mfrac><mn>1<\/mn><msup><mn>2<\/mn><mi>i<\/mi><\/msup><\/mfrac><\/mrow><\/math>\n<p>converges, so our fraction, which has a larger denominator, must also converge.<\/p>\n<p>We\u2019re nearly there. Recall that the gray square (the one that\u2019s rotated 45\u00b0) has a side length of 1. That means<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><msub><mi>r<\/mi><mn>0<\/mn><\/msub><mo>=<\/mo><mfrac><mn>1<\/mn><mrow><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><\/mrow><\/mfrac><\/mrow><\/math>\n<p>so the sum of the circumferences is<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mfrac><mi>\u03c0<\/mi><msqrt><mn>2<\/mn><\/msqrt><\/mfrac><mspace width=\"0.278em\"><\/mspace><mrow><mo form=\"prefix\" stretchy=\"true\">[<\/mo><mn>1<\/mn><mo>+<\/mo><mn>2<\/mn><munderover><mo>\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mo accent=\"false\">\u221e<\/mo><\/munderover><mspace width=\"0.278em\"><\/mspace><mfrac><mn>1<\/mn><msup><mrow><mo form=\"prefix\" stretchy=\"true\">(<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><mo form=\"postfix\" stretchy=\"true\">)<\/mo><\/mrow><mi>i<\/mi><\/msup><\/mfrac><mo form=\"postfix\" stretchy=\"true\">]<\/mo><\/mrow><\/mrow><\/math>\n<p>Now for a confession: I have always stunk at working out infinite series. Luckily, I can now lean on a computational cane. Here\u2019s a Mathematica expression that will return the infinite sum:<\/p>\n<pre><code>Pi\/Sqrt[2] (1 + 2 Sum[1\/(3 + 2 Sqrt[2])^i, {i, 1, Infinity}])\n<\/code><\/pre>\n<p>The answer, as we know from doing it the easy way, is <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>\u03c0<\/mi><\/math>.<\/p>\n<p>If I didn\u2019t have Mathematica, I\u2019d probably set up a finite series for the expression without <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>\u03c0<\/mi><\/math>,<\/p>\n<math display=\"block\" xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mrow><mfrac><mn>1<\/mn><msqrt><mn>2<\/mn><\/msqrt><\/mfrac><mspace width=\"0.278em\"><\/mspace><mrow><mo form=\"prefix\" stretchy=\"true\">[<\/mo><mn>1<\/mn><mo>+<\/mo><mn>2<\/mn><munderover><mo>\u2211<\/mo><mrow><mi>i<\/mi><mo>=<\/mo><mn>1<\/mn><\/mrow><mi>n<\/mi><\/munderover><mspace width=\"0.278em\"><\/mspace><mfrac><mn>1<\/mn><msup><mrow><mo form=\"prefix\" stretchy=\"true\">(<\/mo><mn>3<\/mn><mo>+<\/mo><mn>2<\/mn><msqrt><mn>2<\/mn><\/msqrt><mo form=\"postfix\" stretchy=\"true\">)<\/mo><\/mrow><mi>i<\/mi><\/msup><\/mfrac><mo form=\"postfix\" stretchy=\"true\">]<\/mo><\/mrow><\/mrow><\/math>\n<p>and run out the calculations for different values of <em>n<\/em> to see where it converges. We can show the results as a table,<\/p>\n<table>\n<thead>\n<tr>\n<th align=\"center\">n<\/th>\n<th align=\"center\">Sum<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"center\">1<\/td>\n<td align=\"center\">0.94974747<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">2<\/td>\n<td align=\"center\">0.99137803<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">3<\/td>\n<td align=\"center\">0.99852070<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">4<\/td>\n<td align=\"center\">0.99974619<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">5<\/td>\n<td align=\"center\">0.99995645<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">6<\/td>\n<td align=\"center\">0.99999253<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">7<\/td>\n<td align=\"center\">0.99999872<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">8<\/td>\n<td align=\"center\">0.99999978<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">9<\/td>\n<td align=\"center\">0.99999996<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">10<\/td>\n<td align=\"center\">0.99999999<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>or as a plot,<\/p>\n<p><img alt=\"Convergence plot\" class=\"ss\" src=\"https:\/\/leancrew.com\/all-this\/images2026\/20260219-Convergence%20plot.png\" title=\"Convergence plot\" width=\"80%\"\/><\/p>\n<p>Either way, going out ten terms is overkill\u2014it\u2019s obvious that the sum is converging to 1, which means the circumference sum is converging to <math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>\u03c0<\/mi><\/math>. You can, I guess, consider this numerical exercise as a check on Mathematica\u2019s work. Or a check on the easy solution.<\/p>\n<div class=\"footnotes\">\n<hr\/>\n<ol>\n<li id=\"fn:trick\">\n<p>SciAm also uses the trick in its solution, which you <em>won\u2019t<\/em> see if you click on the link in this paragraph. It\u2019s one link further away.\u00a0<a href=\"#fnref:trick\" rev=\"footnote\">\u21a9<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>"}],"home_page_url":"https:\/\/leancrew.com\/all-this\/","version":"https:\/\/jsonfeed.org\/version\/1","icon":"https:\/\/leancrew.com\/all-this\/resources\/snowman-200.png"}