Programming Leftovers
-
Vincent Lammens ☛ Going to a simpler code editor: Coderunner
I've moved away from using VS Code after they started including Copilot by default. I know you can probably disable it, but my needs for a development environment have shrunk a bit. I went out to find an alternative editor I'd actually like, and I settled at CodeRunner. It's a simple enough UI, has plenty of features, and most importantly: it does the job.
-
Dirk Eddelbuettel ☛ zigg 0.0.2 on CRAN: Micromaintenance
The still very new package zigg which arrived on CRAN a week ago just received a micro-update at CRAN. zigg provides the Ziggurat pseudo-random number generator (PRNG) for Normal, Exponential and Uniform draws proposed by Marsaglia and Tsang (JSS, 2000), and extended by Leong et al. (JSS, 2005). This PRNG is lightweight and very fast: on my machine speedups for the Normal, Exponential, and Uniform are on the order of 7.4, 5.2 and 4.7 times faster than the default generators in R as illustrated in the benchmark chart borrowed from the git repo.
-
Daniel Lemire ☛ Thread-safe memory copy
But what happens if, while you are copying the data, another thread is modifying either the source or the destination? The result is fundamentally unpredictable and almost surely a programming error.
-
Chris Wellons ☛ Tips for more effective fuzz testing with AFL++
Fuzz testing is incredibly effective for mechanically discovering software defects, yet remains underused and neglected. Pick any program that must gracefully accept complex input, written in any language, which has not yet been been fuzzed, and fuzz testing usually reveals at least one bug. At least one program currently installed on your own computer certainly qualifies. Perhaps even most of them. Everything is broken and low-hanging fruit is everywhere. After fuzz testing ~1,000 projects over the past six years, I’ve accumulated tips for picking that fruit. The checklist format has worked well in the past (1, 2), so I’ll use it again. This article discusses AFL++ on source-available C and C++ targets, running on glibc-based Linux distributions, currently the best fuzzing platform for C and C++.
-
Karl Seguin ☛ Using Generics to Inject Stubs when Testing
I have an unapologetic and, I'd like to think, pragmatic take on testing. I want tests to run fast, not be flaky and not be brittle. By "flaky", I mean tests that randomly fail. By "brittle", I mean tests that break due to seemingly unrelated changes in the code.
I'm happy that the definition of "unit tests" has broadened over the years: it's now acceptable to have "unit tests" do more, i.e. hitting a database. I call the period of time where I (we?) over-relied on dependency injection and mocking frameworks, the "dark ages". Still, I do believe that stubs and similar testing tools can be useful in specific cases.
-
Rlang ☛ Kerning and Kerning in a Widening Gyre
I said earlier (twice) that PDF is the Devil Incarnate. This is not really true. Font rendering in general is the Devil Incarnate. PDF is a Major Demon of the Font World. It is descended from greater demons. It traces its foul lineage through an immense tangle of filthy string, glue, and pins back to the earliest days of high-fidelity computer displays and printers.
I make my plots in R, with ggplot usually. (And sometimes tinyplot. It’s good. You Base R snobs can bite me; I’ve been using R since it was a different letter.) Anyway, by default, R’s PDF graphics device does not embed fonts, presumably on the sensible grounds that the more you reject the Devil and all his Works, the better off you are. However, over the years, many people with fallen natures have devised various ways to truck with Satan and specifically to get fonts properly embedded in PDFs. Think of it as a process of building one’s house on a combination of other people’s houses, piles of sand, a variety of leftover construction paper, and ultimately the giant tangle of string mentioned before.
-
Jim Nielsen ☛ Software Pliability
Quoting myself from former days on Twitter:
Businesses have a mental model of what they do.
Businesses build software to help them do it—a concrete manifestation of their mental model.
A gap always exists between these two.
What makes a great software business is their ability to keep that gap very small.
I think this holds up. And I still think about this idea (hence this post).
Software is an implementation of human understanding — people need X, so we made Y.
But people change. Businesses change. So software must also change.
-
Golang
-
Redowan Delowar ☛ Go slice gotchas
Just like any other dynamically growable container structure, Go slices come with a few gotchas. I don’t always remember all the rules I need to be aware of. So this is an attempt to list some of the most common mistakes I’ve made at least once.
-