Loading Pydantic models from JSON without running out of memory
Pydantic’s JSON loading uses a huge amount of memory; here’s how to reduce it.
Pydantic’s JSON loading uses a huge amount of memory; here’s how to reduce it.
Jeffrey Yasskin recently pointed out an interesting security bug: The idea is, if you had registered googlelogoligature.net then Chrome on Android (and possibly other Google products) would have displayed it as Google.net, potentially tricking users into thinking they were really interacting with Google. To see how…
In a service with capacity $\mu$ requests per second and background load $\lambda_0$, the usable headroom is $H = \mu - \lambda_0 > 0$. When $M$ clients align, e.g., after a cache expiry, at a cron boundary, or as a service returns from an outage, the bucketed arrival rate can
This post illustrates a key lemma that is used in proving the fundamental theorem of Galois theory (FTGT). Note that FTGT is not covered in this post. The focus of this post is on understanding and proving this lemma only. Here is the lemma from the book Galois Theory , 5th ed. by Stewart (2023):
“Compiler Engineering in Practice” is a blog series intended to pass on wisdom that seemingly every seasoned compiler developer knows, but is not systematically written down in any textbook or online resource. Some (but not much) prior experience with compilers is needed.
I recently went on a nice long SCUBA diving trip with my wife and daughters. Lots of diving implies lots of showers, and lots of showers means lots of shower-thoughts! [1] An especially interesting one I had turned into a nice way to visualize some aspects of the Collatz Conjecture.
A browser with Wasm GC and tail call support is required for this demo. We recommend using either Mozilla Firefox or Google Chrome.
Types in coding projects are good. Don’t be afraid to create them when you need to.
I think I figured out what’s stressing me out about programming in dynamically typed languages: It’s about always being unsure if using a library in a particular way is going to work and if minor version upgrades aren’t going to break your code.
Exponential backoff with jitter is de rigeur for making service calls. This code, or something like it, probably looks really familiar: func do(ctx context.Context) error { const ( maxAttempts = 10 baseDelay = 1 * time.Second maxDelay = 60 * time.Second ) delay := baseDelay for attempt := range maxAttempts { err :=…
As usual, when a new blog post comes out on blog.golang.org, I’m all eager to read it as soon as possible. The most recent one, Contributors Summit, is a nice write-up on the issues that the Go contributors have been talking about. While reading it, I stumbled upon a sentence that made me write this post. Here is is…
So how hard could it be. As input we have something like Fri, 17 Jan 2025 06:07:07 in UTC, and we’d like to turn this into 1737094027, the notional (but not actual) number of seconds that have passed since 1970-01-01 00:00:00 UTC. Trying to figure this out led me to discover many ‘surprise features’ and otherwise…
In this post, I talk about my favorite C/C++ pattern involving macros.
A deep dive into HTML whitespace collapsing: How it works, why it sucks, how it should work, and how to deal with it.
Curious why D3.js code looks long and complicated? I quickly explain why D3 is verbose, how it gives developers control, and what makes it powerful for data visualisation.
After the Graz, Austria February 2025 WG14 Meeting, I am now confident in the final status of the defer TS, and it is now time.
A walk through of building an image that displays its own MD5 Hash
Applications can append events directly to ScopeDB and query committed data without a separate ETL pipeline.
This is a story about Imagebin. Imagebin is the longest-lived software project that I still maintain. I'm the only user. I use it to host images, mainly to include in my blog, sometimes for sharing in other places. Imagebin's oldest changelog entry is dated May 2010, but I know it had already existed for about a year…
“A good programmer is someone who looks both ways before crossing a one-way street.” – Doug Linder
Write an awesome description for your new site here. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
Personal blog of Stephen Diehl - Software engineer writing about technology, programming, and the future
(From someone who has spent far too much time thinking about the designs of programming languages)
We’ve had decades of thought leadership around testing, especially coming from holistic development philosophies like Agile, TDD, and BDD. After all that time and several supposedly superseding movements, the developers I talk to seem to have developed a folk wisdom around tests. That consensus seems to boil down to…
A blog by sunfishcode
A single-function JSON parser for the POSIX shell.
Model minimalistically Start from a tiny core, and always keep a working model as you extend. Your default should be omission. Add a compone...
If you type “WAIT6502,1″ into a Commodore PET with BASIC V2 (1979), it will show the string “MICROSOFT!” at the top left corner of the screen. Legend has it Bill Gates himself inserted this easter egg “after he had had an argument with Commodore founder Jack Tramiel”, “just in case Commodore ever…