Continued fractions in Python

My last post ends with “one last thing” about continued fractions. That turned out to be a lie. After playing around a bit more, I decided I should have some functions that compute continued fractions in Python, so I looked around for continued fraction libraries. I found some, b … | Continue reading


@leancrew.com | 9 months ago

Decimal to fraction

A few days ago, Rhett Allain, professor of physics education at Southeastern Louisana University and Wired columnist, posted a video in which he wrote a short Python script that used mediants to convert real numbers into fractions. I thought it was worth a few comments. | Continue reading


@leancrew.com | 9 months ago

Connections

For the past few weeks, my family has been playing a new (it’s in “beta”) New York Times game called Connections. Our daughter found it—she has an NYT games subscription—and got the rest of the family hooked on it. | Continue reading


@leancrew.com | 10 months ago

Better medication tracking

Back in March, my doctor prescribed a new pill for me to take every day. That brought the number up to six—five in the morning and one at night—and I decided to give the medication tracking feature of the iOS Health app a try. This was a new addition last fall when iOS 16 came ou … | Continue reading


@leancrew.com | 10 months ago

Doppler Petty

A couple of days ago, as I was out taking my morning walk, I passed a guy on a bicycle who was coming the opposite way down the path. I was northbound, he was southbound. He was, annoyingly, playing his music out loud through a speaker instead of privately through earbuds. Less a … | Continue reading


@leancrew.com | 10 months ago

Converting lists

Sometimes I realize I’ve been doing something the slow way for a really long time, and it’s kind of embarrassing. A few days ago, I needed to take a column of numbers from a spreadsheet and convert it into a comma-separated list for pasting into Mathematica. I pasted the numbers … | Continue reading


@leancrew.com | 10 months ago

The Prime Directive

I don’t intend for this blog to turn into commentary on YouTube videos, but here’s another one. | Continue reading


@leancrew.com | 10 months ago

Rolling and pulling

A few days ago, Steve Mould posted a video about the rolling spool problem. He explains the problem well but not in the traditional engineering way. This problem, or a variation on it, is commonly taught to students in elementary engineering mechanics courses, and it’s taught in … | Continue reading


@leancrew.com | 11 months ago

ChatGPT and reliability

The day before my last post—the one about ChatGPT trying to solve beam bending problems—Adam Wuerl, an aerospace engineer at Blue Origin, wrote up his similar adventure with ChatGPT. Adam was trying to get it to solve a reliability problem: | Continue reading


@leancrew.com | 11 months ago

ChatGPT and beam bending

There’s an internet law that everyone must blog about ChatGPT, and I’m way behind, so here we go. I think what I have to say is something new. | Continue reading


@leancrew.com | 11 months ago

Parabolic mirrors made simple(r)

A couple of days ago, Numberphile released a video on YouTube in which Tom Crawford explained why parabolic mirrors reflect incoming light to the focal point. His explanation was, I thought, needlessly complicated, so I decided to write up a simpler one. No implicit differentiati … | Continue reading


@leancrew.com | 11 months ago

ImageOptim

Yesterday, I listened to the most recent Mac Power Users episode, “20 Mac Apps Under $20.” Although MPU is probably best known for its deep dive episodes, I always like these more rapid-fire discussions. As usual, this one has a good mix of apps that are new to me and those I alr … | Continue reading


@leancrew.com | 1 year ago

Feet, inches, and averaging

After Purdue’s historically embarrassing loss to Fairleigh Dickinson on Friday night, many sportswriters awakened to Purdue’s longstanding poor performance in the NCAA tournament and wrote articles like this one in Slate. As I read that article, I saw one error that should embarr … | Continue reading


@leancrew.com | 1 year ago

Better MathJax equations

If some of the equations in my posts look a little off—poorly spaced or, more likely, with a wobbly baseline—there may be something you can do about it. I learned this on Mastodon through a combination of Andy Napper and Mimmo. | Continue reading


@leancrew.com | 1 year ago

Concrete and pi

Back in either 1980 or ’81, I took course called Properties and Behavior of Concrete, which had the course number CE 214 and this description: | Continue reading


@leancrew.com | 1 year ago

Physics and units again

I don’t want this place to turn into a Matt Parker followup blog, but there are things in his recent Pi Day video that fit in with comments I made on his Runge video, specifically the part about engineers embedding unit conversions within formulas. So go ahead and watch the video … | Continue reading


@leancrew.com | 1 year ago

Learning (sort of) from ChatGPT

Simon Willison, the primary developer of the Datasette exploratory data analysis tool, has a strong interest in ChatGPT and similar AI toys.1 He recently linked on Mastodon to this dialog with ChatGPT to write some AppleScript. In that dialog, we see the good and bad of using Cha … | Continue reading


@leancrew.com | 1 year ago

Automation via embarrassment

This morning I was adding an entry to my homemade wiki when I became acutely embarrassed by how convoluted the entry was becoming. I stopped writing, created an automation that made the process I was describing much simpler, and rewrote the entry feeling much better about myself. | Continue reading


@leancrew.com | 1 year ago

Cleaning and graphing baseball data

If any of you followed the link in yesterday’s post to my old writeup from a decade ago, you noticed that the scripts I wrote back then used the csv and cPickle libraries to read, filter, and store the baseball game data. Now I find it more natural to use pandas for all of that, … | Continue reading


@leancrew.com | 1 year ago

Revisiting baseball game durations

This morning, I learned from Paul Kafasis that major league baseball will be going to a pitch clock, something they tried out in the minor leagues last year. The idea, of course, is to speed up our interminable national pastime. | Continue reading


@leancrew.com | 1 year ago

Modulo

I left something out of yesterday’s post. Another mathematical aspect of Underscore David Smith’s unitSquareIntersectionPoint function is this set of lines at the top of the function: | Continue reading


@leancrew.com | 1 year ago

Underscore David Smith and linearization for large angles

Underscore David Smith wrote a post earlier this week that I had trouble with. Part of the trouble was that the code he wrote was in Swift, but that was a minor problem, as UDS’s code was clear enough to understand even though I don’t know Swift. The bigger problem was how he man … | Continue reading


@leancrew.com | 1 year ago

Updating scripts

Yesterday’s post ended with this little script for searching a Mastodon archive: | Continue reading


@leancrew.com | 1 year ago

Seaching through my Mastodon graveyard

I’ve been sketching out a post on the ChatGPT/Bing/Sydney fuss, but I’m not sure I’ll finish it. It’s kind of meandering and not deliberately so. One thing I’m sure of is that I want to start by quoting this Mastodon post of mine: | Continue reading


@leancrew.com | 1 year ago

Mastodon and Open Graph

When I moved back to Mastodon in November, I wrote a little script that used the Mastodon API to automatically post a link there whenever I published something new here on the blog. It worked fine, but the links were plain—they didn’t have the graphic pizazz that the same link on … | Continue reading


@leancrew.com | 1 year ago

Swings and roundabouts

I found Matt Parker’s recent video a bit confusing, and I’d like to talk about it. According to the title, it’s about the Runge phenomenon, and while it certainty covers that topic, it starts out pretty far away and takes a sudden swing.1 | Continue reading


@leancrew.com | 1 year ago

Markdown footnoting in BBEdit

Two years ago, I wrote a post in which I outlined all the little scripts I’d built to help me write blog posts in BBEdit. I’d been writing posts almost exclusively on my iPad for quite a while, but the M1 MacBook Air I bought in February of 2021 turned me back into a Mac-first gu … | Continue reading


@leancrew.com | 1 year ago

Consolidating my little date commands

This morning, I was composing a nice email to a client, and I needed to know how many days it had been since September 23 of last year: This invoice is 137 days old. When the fuck are you going to pay it? I used my ago script, which worked fine, except I needed to switch from Mai … | Continue reading


@leancrew.com | 1 year ago

Mastodon miscellany

I’ve been collecting odds and ends about Mastodon over the past couple of weeks. Time to dump them all out of my head into this post. | Continue reading


@leancrew.com | 1 year ago

Wordle permutations

Last week, as a followup to my most recent Wordle/grep post, John Gruber sent me an email in which he told me about a script he wrote to do the same thing but with less fuss. Inspired by this, I wrote my own script. | Continue reading


@leancrew.com | 1 year ago

What’s a Twitter client?

Thanks to yesterday’s Engadget report from Karissa Bell, we all know the official Twitter rule that Twiterrific and Tweetbot broke. It’s this bit of Section II.A of the Twitter Developer Agreement: | Continue reading


@leancrew.com | 1 year ago

Twitter via RSS

I canceled my Tweetbot subscription a month or two ago and don’t go to Twitter anymore—the former followed from the latter—so I haven’t been caught up in the recent mess. But it was a reminder that I wanted to share a simple tip for fellow Twitter-leavers on the off-chance you di … | Continue reading


@leancrew.com | 1 year ago

Not cheating at Wordle

I got yesterday’s Wordle1 in three guesses and was immediately (and jokingly) accused of cheating by my family—mainly because they needed more guesses, but also because the word had a repeated letter and we usually don’t start guessing repeated letters that early in the game. | Continue reading


@leancrew.com | 1 year ago

Triangles and area coordinates

Earlier this month, John D. Cook posted a nice little article about using a determinant to get the area of a triangle. The method was both familiar and unfamiliar. I knew I’d once learned about getting a triangle’s area from a determinant, but I was sure it wasn’t the same way Co … | Continue reading


@leancrew.com | 1 year ago

Another small adventure in data cleaning

In a project at work, I had a folder with dozens of engineering drawings for a piece of construction equipment. As part of a report, I needed to generate a list of all the drawings I had according to their drawing numbers, and I also needed to make sure my list corresponded to th … | Continue reading


@leancrew.com | 1 year ago

Outlining and Bike

I’ve been planning to write this post for some time, but things kept coming up. Today, though, Jesse Grosjean is running a sale on Bike, his outlining app for the Mac, and it seemed like the right day to finally push this out. The sale is a pretty good one—$10 instead of the usua … | Continue reading


@leancrew.com | 1 year ago

Hair splitting

A few days ago, Brady Haran at Numberphile released a new video with Ben Sparks. Like most of Ben’s videos, it’s interesting without being super heavy with math. In this case, I think the psychology behind the video is the most interesting part. | Continue reading


@leancrew.com | 1 year ago

Announcing new posts on Mastodon

With lots of people, including me, either starting up new Mastodon accounts or dusting off the old ones they created during a previous Twitter crisis, I decided to write a script that would autotoot to Mastodon whenever I publish a new post here. It didn’t take long, as the Masto … | Continue reading


@leancrew.com | 1 year ago

Are you a mod or a rocker?

This post was supposed to go up just a few days after the last one, but stuff got in the way. At least we’re in the same month. | Continue reading


@leancrew.com | 1 year ago

Simplifying trig expressions

When using any computer algebra system, there comes a time when you wonder why the result produced by the program isn’t as simple as you could make it by hand. To get good at using such a system, you have to learn its tricks of substitution and simplification. | Continue reading


@leancrew.com | 1 year ago

Orbital curvature

Last week, John Cook wrote a nice post on the shape of the Moon’s orbit. He was inspired by a paper written by Noah Samuel Brannen for the College Mathematics Journal back in 2001.1 The gist of their analyses is that if you trace out the Moon’s path as it and the Earth travel aro … | Continue reading


@leancrew.com | 1 year ago

Learning from (Wordle) failure

This morning, after 108 straight wins, I lost at Wordle. I got to four correct letters by my fourth guess, but there were too many possibilities for the remaining letter, and I didn’t guess right in either of my last two guesses. | Continue reading


@leancrew.com | 1 year ago

Thoughts on Pads

Today, as 512 Pixels and other sites have told me, is the 30th anniversary of the release of the IBM ThinkPad. It was both a brilliantly designed computer and a brilliantly named one. For decades, THINK had been associated with IBM, and the ThinkPad was, for its time, a small eno … | Continue reading


@leancrew.com | 1 year ago

Good fortune

I don’t want this to turn into the “obscure Unix commands blog” (any more than it already is), but I did have reason to use another old Unix command the other day. Unlike rs, this one is one that I’d used a lot in the past but hadn’t done anything with in ages. | Continue reading


@leancrew.com | 1 year ago

Reshaping text

It’s not often that I run into a new (to me) Unix command. But when I had a problem yesterday, I came across a simple solution using the rs command, which I’d never heard of before. Maybe you’ll find it useful, too. | Continue reading


@leancrew.com | 1 year ago

No reason to get excited

Last week’s Apple Event didn’t give me the push to get a new watch that I was expecting. Yes, my Series 3 won’t accept watchOS 9, but I’ve known that since WWDC. And while both the SE and the Series 8 are clear improvements over the Series 3, I’m not sure what I will get out of t … | Continue reading


@leancrew.com | 1 year ago

My contribution to Markdown

I was listening to the most recent episode of The Talk Show this morning, and my extremely important contribution to Markdown came up. Sort of. | Continue reading


@leancrew.com | 1 year ago

Filtering my RSS reading

A couple of weeks ago, I decided to cut back on my RSS feed reading.1 Not by reducing the number of feeds I’m subscribed to, but by filtering articles to eliminate those that would just be a waste of my time. The change was inspired by a particularly stupid post by Erik Loomis at … | Continue reading


@leancrew.com | 1 year ago