Books I read in 2023

I read 24 books for a total of 7070 pages in 2023. That’s seven more books than last year, which is quite an outstanding result considering the seemingly unstoppable decline in book reading I have suffered in recent years. Most have been fiction books, and that’s something new and influential with the final result, as I tend to read non-fiction more slowly. The bad news is that I did not review most of the books I read this year, and that sucks....

December 29, 2023
First glimpse of the view that will open up later, once we reach the summit of Poggio Montironi.

The wilderness of Poggio Montironi

Yesterday was a beautiful, sunny, cold winter Sunday. I felt like going out and enjoying nature, so I took a solo hike in the Foreste Casentinesi National Park, about an hour’s drive from home. This one marks my very first technology-assisted hiking adventure. It may seem weird for someone who’s been hiking for so long, is a notorious geek and is a professional computer programmer to have never used technology before....

December 15, 2023

How Many Hobbits?

For those who don’t know me, I’m a demographer. I study population. And my first love in fantasy was, of course, Middle Earth. How many people live in Middle Earth? Being a demographer, I was mainly interested in the data side of things. Tolkien is frustratingly vague about population. He almost never gives us estimates of settlement sizes, and many of the larger metropolises of Middle Earth (like Pelargir) never actually appear on the page....

December 14, 2023

The Winterkeeper

The Guardian’s The Winterkeeper: A Lifetime Spent Protecting Yellowstone National Park is a beautiful short documentary I truly enjoyed watching. A little research on Steven Fuller, the protagonist, allowed me to dig out some promising reading material.

December 10, 2023

Quoting Andrej Karpathy

I always struggle a bit with I’m asked about the “hallucination problem” in LLMs. Because, in some sense, hallucination is all LLMs do. They are dream machines. We direct their dreams with prompts. The prompts start the dream, and based on the LLM’s hazy recollection of its training documents, most of the time the result goes someplace useful. It’s only when the dreams go into deemed factually incorrect territory that we label it a “hallucination”....

December 9, 2023

Intro to Large Language Models (video)

Andrej Karpathy has a very well-done Intro to Large Language Models video on YouTube. As a founding member and research scientist at OpenAI and with a two-year hiatus working on Tesla Autopilot, Karpathy is an authority in the field. He is also good at explaining hard things. As a Kahneman reader, I appreciated the Thinking Fast and Slow analogy proposed at about half-length in the video: “System 1” (fast automatic thinking, rapid decisions) is where we’re now; “System 2” (rational, slow thinking, complex decisions) is LLMs next goal....

November 24, 2023

I am speaking at the .NET Conference Italia 2023

In a few days, on Monday, December 4, at 10 a.m., I will present at the .NET Conference Italia 2023, which will be held at the Microsoft House in Milan. My session is titled “C#12 What’s new and interesting” and is part of a rich agenda focused on the recent release of .NET 8. I presented on the same subject at a DevRomagna meetup a few months ago when C# 12 was in preview and still had several moving parts....

November 23, 2023

How to use XmlWriter along with StringWriter to properly serialize a UTF-8 string

Today, I (re)learned how to serialize an XML to a UTF-8 string. Like all the other times I did this, I got backstabbed by StringWriter, which only supports UTF-16. A simple code snippet like this: await using var sw = new StringWriter(); await using var w = XmlWriter.Create(sw, new() { Async = true }); ... await w.FlushAsync(); return sw.ToString(); Will emit this output: <?xml version="1.0" encoding="utf-16"?><... There’s nothing inherently wrong with UTF-16, but XML is usually UTF-8, so one must do something about it....

November 9, 2023

FatturaElettronica for .NET v3.4.11

Fattura Elettronica for .NET v3.4.11 was released on NuGet today. The Fattura Elettronica project allows for the fixes a missing validation point. See the changelog for details (Italian). validation and de/serialization of electronic invoices following the Italian Revenue Agency standards.

October 27, 2023

LINQ DistinctBy on a property for .NET Standard and older .NET versions

Today I learned how to implement a custom Enumerable.DistinctBy extension method that returns distinct elements from a sequence according to a specified key selector function. .NET 6 and its successors have the method built in within LINQ, but I needed it in a .NET Standard 2.0 class library, so I was out of luck. My implementation is simple, not different from others I found online, and should also work fine with old ....

October 25, 2023