news
Programming Leftovers
-
J Kenneth King ☛ Fixed Time Efficient Least Frequently Used Cache
In the last post I wanted to demonstrate how to implement a time-efficient Least Frequently Used cache in C++23 using doubly-linked lists. While the idea and the approach was right, the implementation was not, and we ended up with O(n) operations (again) instead of the promised, O(1).
Here’s the annotated implementation so you can see where the problem is: [...]
-
Andrew Nesbitt ☛ Zig and the M×N Supply Chain Problem
Zig shipped a built-in package manager in version 0.11 in August 2023. It uses build.zig.zon files for manifests and fetches dependencies directly from URLs, usually tarballs on GitHub. There’s no central registry yet, though the community runs unofficial indexes like zpm and aquila.1
-
Igor Roztropiński ☛ Data Consistency: transactions, delays and long-running processes
All systems that persist data deal with the first data consistency scope, local to module/service. It might seem obvious, but it is worth stating clearly and openly, as it is the fundamental building block from which global, system-wide data consistency is constructed. And interestingly, if our system consists of a monolith with just one module, or there are multiple but totally independent modules, not exchanging any data, we deal solely with this simpler, local scope.
-
Python
-
Pete Warden ☛ Speech Embeddings for Engineers
Deciding who said what is one of the most common tasks when dealing with live speech, but there’s less information available about it than other parts of the pipeline like transcription or voice-activity detection. I’ve been doing more work on speaker identification recently, for an upcoming open source project I’ll be excited to share soon, and I realized I was hazier on some of the practical details than I’d like. As any teacher knows, the best way to find the holes in your own knowledge of a topic is to try to explain it to someone else, so I decided to write a step-by-step Python notebook explaining the basics of speech embeddings with working examples inline.
-
University of Toronto ☛ Why I'm ignoring pretty much all new Python packaging tools
One of the things going on right now is that Python is doing a Python developer survey. On the Fediverse, I follow a number of people who do Python stuff, and they've been posting about various aspects of the survey, including a section on what tools people use for what. This gave me an interesting although very brief look into a world that I'm deliberately ignoring, and I'm doing that because I feel my needs are very simple and are well met by basic, essentially universal tools that I already know and have.
-
Python Speed ☛ Speeding up NumPy with parallelism
In this article I’ll cover:
• A simple example of making a NumPy algorithm parallel.
• A separate kind of optimization, making a more efficient implementation in Numba.
• How to get even more speed by using both at once.
• Aside: A hardware limit on parallelism.
• Aside: Why not Numba’s built-in parallelism?
-