I’m pissed at the Library of Congress

Today I tried to add a couple of recently purchased books to my library database using my lccn2library script. It failed because the Library of Congress has either moved or deleted the files lccn2library relies on.

Let’s say I was trying to add Applied Elasticity by Timoshenko and Lessells.1 If you go to the LoC’s MARC record for the book and click on the Download link, you’ll see a popup that looks like this:

LoC downloads popup

So it looks like you can click the MODS link to get the MODS file for the book. That’s the file my script parses to get the information to add to the database. The MODS link for this book is

https://lccn.loc.gov/26010978/mods

which is the URL form that lccn2library expects. Unfortunately, that link returns an empty file. And not just for that book, but for every book I tried. What does the little northeast-pointing arrow mean? Beats me. You’d think it was an indication that the MODS link was pointing to some external site, but that’s not the case.

Maybe I’ve caught the LoC in the middle of a transition to a new system for storing records in various formats. Maybe I’ll return in a month or two to find that everything is working again—perhaps with new URLs for the different formats. I hope so.

But until that hoped-for day, I’m pissed at the LoC because I have to add books to my database by hand using the sqlite3 interactive command-line tool. Which is slow but not terrible, especially since I’m adding only a book or two at a time.

The command to add a new book to the database is

INSERT INTO book(title, subtitle, volume, edition, publisher, published, lccn, loc, added)
VALUES(<list of values separated by commas>);

The book will be assigned an ID automatically. To get it, I run

SELECT id,title FROM book WHERE added IS "2026-10-08";

The first field in the output will be the ID. The date must be a string with the current date in yyyy-mm-dd format.

The new book may be written by an author already in the database. To check if that’s the case, I run

SELECT * FROM author WHERE name LIKE "%<portion of name>%";

If the author’s already in the database, that command will return their ID. If not, it returns nothing. I then run

INSERT INTO author(name) VALUES("<full name>");

and then the SELECT command above to get the author’s ID.

The final step is to add a record to the book_author table to tie the book and author together. That’s

INSERT INTO book_author(book_id, author_id) VALUES(<book ID>, <author ID>);

As I said, this is slow because it’s several steps, but none of the steps are difficult.

What will I do if the LoC never fixes the problem of the missing MODS files? I suppose I could parse the MARC records, which are still accessible, but that would be a pain in the ass. Maybe I’ll build a little interactive script where I can just type in the necessary information and have the script generate and run the SQL commands. I hope it doesn’t come to that.


  1. It’d be so cool to have this book. It was written when Timoshenko had just come to the US and was working at Westinghouse before landing a teaching gig at the University of Michigan. Sadly, this was not one of the books I was adding to my library. ↩


Making a tall, skinny plot in Mathematica

Yesterday’s post included this plot:

Rescaled Moon and Earth orbit

I figured it was worth a quick post to show how I made it.

I had already done most of the work back in 2022 in a Mathematica notebook I made to support my original orbital curvature post. So I copied the pertinent calculations from that notebook, pasted them into a new one, and made the adjustments necessary to produce the plot. Here’s the new notebook:

The bottom half of the notebook is where the plotting commands are. The key items are:

To get the image out of the notebook, I right-clicked on it, selected Save Graphic As… from the popup menu, and chose SVG as the format. That’s why the plot stays smooth if you zoom in on it.


Distorted plots

Rhett Allain, physics professor and blogger, published a nice article today about the Moon’s orbit. It follows largely the same line of reasoning as my post on the same topic (and the various write-ups I linked to in that post) from a few years ago. I nodded my head as I read through it, until I got to a plot at the end of the article.

For much of the article, Allain complains about how the orbit of the Moon as it and the Earth make their way around the Sun is often distorted in textbooks. Like this, which is a frame from an animated GIF in the article.

Distorted orbits around the Sun

In this image, the Earth-Moon distance is exaggerated, and it looks like the Moon curves away from the Sun when it’s between the Earth and the Sun. To show that this is wrong, he plots portions of the Moon and Earth orbits without exaggerating the Moon-Earth distance:

Allain plot of Moon and Earth orbits

Forgive me, but what the actual fuck? How can you spend over 1000 words complaining about graphical distortions and then produce this? Sure, it’s not the same distortion he was complaining about, but still. The whole point of the article was to show that the Moon’s path over the course of an Earth year is a sort of wobbly circle around the Sun. The arcs in this plot are nowhere near circular.

Here’s a properly scaled version of Allain’s plot:

Rescaled Moon and Earth orbit

Yes, the plot is really tall and skinny. It has to be to avoid distorting the paths. Note that the grids are square and represent the same distance in each direction.

We all know how this happened. The range of the x data is very small compared to the range of the y data, but because the plotting software defaults to a landscape-style graph, the paths come out looking like arcs of very wide ellipses. Unless the person running the software steps in to make sure x and y distances are drawn to the same scale.

I could write a post like this almost every day. So many people accept the defaults of their graphing software without thinking about how one or two small tweaks could make their plots so much better.


Too dumb for AI

I’ll admit that the first thing I looked into regarding yesterday’s “Super Intelligence” meeting at the White House was whether Tim Cook was there. He wasn’t, which was probably a relief to Tim, even though it’s also an admission that Apple isn’t considered a player in AI. By anyone, not even the idiots in the Trump administration.

You’ve probably seen the stupid misspelling above Trump’s signature on the “morally binding” agreement that came out of the meeting.

Signature page

Yes, he signed it as the “President of the Unites States” and then proudly posted it to Truth Social. I can’t imagine the agreement means anything, as you’d be hard-pressed to find a single moral shared among the people in the meeting. I will say, though, that Jensen Huang’s signature is pretty spiffy.

As for who was at the meeting, Trump also posted this seating chart, which hurts to look at:

Seating chart

Click the image to see it at full size, if you dare. Also, don’t feel obligated to follow either of the Truth Social links; I’m including them only because I feel an obligation to give credit—or in this case blame.

Lots of the images Trump posts are AI-generated, but I find it hard to believe that any AI system would produce something with this many graphical errors:

And then there’s the best one:

The meeting probably would have been better for all of us if this had been so.