Programming Leftovers
-
Dirk Eddelbuettel ☛ Dirk Eddelbuettel: RcppFastFloat 0.0.5 on CRAN: New Upstream, Updates
A new minor release of RcppFastFloat just arrived on CRAN. The package wraps fast_float, another nice library by Daniel Lemire. For details, see the arXiv preprint or published paper showing that one can convert character representations of ‘numbers’ into floating point at rates at or exceeding one gigabyte per second.
-
Jim Nielsen ☛ Tools As Ways of Being
A good tool improves your output.
A great tool improves your output and your understanding and empathy for others and their disciplines.
-
Buttondown LLC ☛ What are the Rosettas of formal specification?
For this I'd want a set of "Rosetta" examples. Rosetta Code is a collection of programming tasks done in different languages. For example, "99 bottles of beer on the wall" in over 300 languages. If I wanted to make a Rosetta Code for specifications of concurrent systems, what examples would I use?
-
Karl Seguin ☛ Peeking Behind Zig Interfaces by Creating a Dummy std.Random Implementation
We've looked at Zig Interfaces in the past. If you want to understand how they work and how to write your own, I recommend you read that post first. But I recently needed to create a dummy std.Random implementation (for testing purposes) and felt that the experience was a nice refresher.
-
Seth Michael Larson ☛ Quickly visualizing an SBOM document
Have you ever had a Software Bill-of-Materials (SBOM) document and just want to look at the dang thing? Preferably using CLI tools? SBOMs tend to be quite large for non-trivial software projects, so looking at them in a text editor becomes difficult fast.
Many "solutions" for visualizing an SBOM document require running a service which is something I don't want to do. Here's what you can do to quickly visualize an SBOM document using Anthony Harrison's sbom2dot project, the DOT language, and GraphViz: [...]
-
Unnamed Website ☛ Fenwick Trees are Awesome!
This post will only use one-based indexing since that’s what Fenwick trees traditionally use, although they can be modified to use zero-based indexing.
So imagine you have an array $A$ of size $N$, and you’d like to support two operations. The first one, called $Update(i, v)$, is trivial: Given an index $i$, add $v$ to $A_i$. Easy peasy!
-
Rlang ☛ Best Prompt Engineering Books
Best Prompt Engineering Books, Prompt engineering is a rapidly growing field that focuses on crafting high-quality input prompts to elicit accurate and informative responses from artificial intelligence (AI) models.
With the increasing adoption of AI technologies in various industries, such as customer service, healthcare, and finance, the need for effective prompt engineering has become more pressing than ever.
Well-designed prompts can significantly improve the quality of output, reduce errors, and enhance the overall user experience.
-
Perl / Raku
-
Perl ☛ Creating MIDI Music with Perl
It is older than agriculture and civilization itself. We shall only cover the essential parts needed to make music on the computer. So let’s get right to the point!
How do you make music with code? And what is music in the first place?
Well, for our purposes, music is a combination of rhythm, melody, and harmony.
Okay, what are these musical elements from the perspective of a programming language? And how do you create these elements with code? Enter: Perl.
-
-
Python
-
Six Colors ☛ Counting almost-duplicates in very long lists
And so I created the first iteration of this tool, which Myke Hurley and I have been using for our projects for a year or two. It’s a Python script that’s just inserted into a one-line Shortcut (run shell script, since you can choose Python from a list of shells) for convenience’s sake.
All the original script does is read the clipboard, puts everything in title case (thereby avoiding differences in capitalization), and then strips out a bunch of extraneous spaces and the addition of “The” via regular expressions.
-
University of Toronto ☛ (Multiple) inheritance in Python and implicit APIs
This was an interesting bug, and one of the things it made me realize is that the absence of a __str__ method on 'list' itself had implicitly because part of list's API. Django had set up class definitions that were 'class Something(..., list, AMixin)', where the 'AMixin' had a direct __str__ method, and Django expected that to work. This only works as long as 'list' doesn't have its own __str__ method and instead gets it through inheritance from object.__str__. Adding such a method to 'list' would break Django and anyone else counting on this behavior, making the lack of the method an implicit API.
-
Tom's Hardware ☛ Raspberry Pi powers this Meshtastic network BBS
Because Meshtastic is Python based, it only makes sense that MeshBoard, the BBS put together by VeggieVampire, is also Python-based. VeggieVampire was kind enough to make the project open source and shared all of the source code over at GitHub for anyone to download or just take a closer look at.
-
-
Standards/Consortia
-
Free Our Feeds ☛ Free Our Feeds
But it will take independent funding and governance to turn Bluesky’s underlying tech—the AT Protocol—into something more powerful than a single app. We want to create an entire ecosystem of interconnected apps and different companies that have people’s interests at heart.
-
PC World ☛ A high school student just made Doom playable in a PDF file
There’s a growing trend of developers flexing their muscles to make PDF documents do completely different things than what they’re intended to do. The goal is to push the boundaries of the PDF format.
PDF (which stands for Portable Document Format) was created in 1992 as a way to present documents independently of software, hardware, and operating systems. It’s practical, but it’s also complex — and that’s what makes the format attractive to programmers and malware creators alike. (Where some see security risks, others see a chance to shine.)
-