news
Programming Leftovers
-
Hisham ☛ Sorting "git branch" with most recent branches last
This is something I always have to look up whenever I set up a new machine, so I might as well store here: [...]
-
Marc Brooker ☛ One or Two? How Many Queues?
Are there cases where one queue still makes sense, even in this precommitted world? Not that I could find.
-
DJ Adams ☛ Functional programming resources
I've created quite a bit of FP related content in the past but it's somewhat scattered across different platforms and in different formats and I can't remember what or where it all is. So this is a meta post in which I point to all the resources (that I can remember that) I've created on the topic.
-
Rlang ☛ A Bayesian proportional hazards model for a cluster randomized trial
In recent posts, I introduced a Bayesian approach to proportional hazards modeling and then extended it to incorporate a penalized spline. (There was also a third post on handling ties when multiple individuals share the same event time.) This post describes another extension: a random effect to account for clustering in a cluster randomized trial. With this in place, I’ll be ready to tackle the final step—building a model for analyzing a stepped-wedge cluster-randomized trial that incorporates both splines and site-specific random effects.
-
Rlang ☛ checkglobals: an(other) R-package for static code analysis
When it comes to package development, it is good practice to run R CMD check to perform a series of automated checks identifying possible issues with the R-package. Among the checks performed by R CMD check is a static inspection of the internal syntax trees of the code through the use of the codetools package. This code analysis discovers undefined functions and variables without executing the code itself, leading to the following (perhaps familiar) notifications: [...]
-
arXiv ☛ Spatial Data Science Languages: commonalities and needs
Recent workshops brought together several developers, educators and users of software packages extending popular languages for spatial data handling, with a primary focus on R, Python and Julia. Common challenges discussed included handling of spatial or spatio-temporal support, geodetic coordinates, in-memory vector data formats, data cubes, inter-package dependencies, packaging upstream libraries, differences in habits or conventions between the GIS and physical modelling communities, and statistical models. The following set of insights have been formulated: (i) considering software problems across data science language silos helps to understand and standardise analysis approaches, also outside the domain of formal standardisation bodies; (ii) whether attribute variables have block or point support, and whether they are spatially intensive or extensive has consequences for permitted operations, and hence for software implementing those; (iii) handling geometries on the sphere rather than on the flat plane requires modifications to the logic of simple features, (iv) managing communities and fostering diversity is a necessary, on-going effort, and (v) tools for cross-language development need more attention and support.
-
Daniel Lemire ☛ Unsigned comparisons using signed types
There are two main types of fixed-precision integers in modern software: unsigned and signed. In C++20 and above, the signed integers must use the two’s complement convention. Other programming languages typically specify two’s complement as well.
-
Scoop News Group ☛ Researchers raise alarm about critical Next.js vulnerability
The software defect in the widely used open-source JavaScript framework allows attackers to bypass middleware-based authorization.
-
Josef Strzibny: Running JavaScript after a Turbo Stream renders
If you are building your application with Hotwire, your Turbo streams will likely add, remove, and replace some HTML nodes. This mostly works except when you want to add HTML that comes with some JavaScript. Like a file picker, Trix editor, and the like.
Turbo itself won’t do anything about this. It’s a rather simple tool with simple purpose. JavaScript initialization should come with the HTML Turbo is about to add. Hotwire solves this with Stimulus.
-
Adam Young: Diff between Code review versions
Bottom line up front: create a tag with each version of a code review you post, to be able to see changes between versions.
Git commits come in (at least) three flavors.
First is the personal flavor, where you commit to git in order to not lose some quantum of behavior you have just implemented. These commits are small, and may be breaking commits. They are not meant for upstream consumption in the long term. -
Education
-
Rlang ☛ Dealing with Duplicate Data in R workshop
Description: Maintaining high data quality is essential for accurate analyses and decision-making. Unfortunately, high data quality is often hard to come by. This talk will focus on some “how-tos” of cleaning data and removing duplicates to enhance data integrity. We’ll go over common data quality issues, how to use the {{janitor}} package to identify and remove duplicates, and business practices that can help prevent data issues from happening in the first place.
-
-
Python
-
Matt Keeter ☛ The Prospero Challenge
The "challenge" is simple: render the image as quickly as possible.
A basic renderer is 28 lines of Python, using Numpy for pixel parallelism: [...]
-
Remy Van Elst ☛ Fast MQTT logger (to syslog)
For almost 5 years I've been using the mqtt-data-logger python script to log all MQTT communication. This script works, but is a bit limited in how it stores logs (files per time it's started) and it often can't keep up with the message rate (tens of thousands per second) of my mqtt brokers. So I've written a new tool in C++ to log all MQTT messages to syslog and optionally to the terminal. Then, via syslog, you can send it to where ever you like, be it a file or an ELK (Logstash/Elasticsearch/Kibana) stack. It even compiles without syslog support, if you only want to log to a file or the terminal. There's a docker image and a docker compose file, so you can easily deploy it wherever you have an MQTT broker running.
-
-
Shell/Bash/Zsh/Ksh
-
Lawrence Tratt ☛ Better Shell History Search
Since many command-line tools have hard-to-remember options, we can save huge chunks of time – not to mention make fewer errors – if we can search our shell history to find a previous incantation of a command we want to run. In this post I’m going to show how, with little effort, searching shell history can look like this: [...]
-
-
Java
-
Silicon Angle ☛ Chainguard introduces Java libraries for secure language dependency management
Secure software supply chain solution provider Chainguard Inc. today announced Chainguard Libraries, a new product line that offers secure language libraries for Java built directly from source in supply-chain levels for software artifacts-hardened infrastructure. Libraries has been built with end-to-end integrity and native protection at package build and distribution.
-
-
Rust
-
Niko Matsakis: Dyn async traits, part 10: Box box box
This article is a slight divergence from my Rust in 2025 series. I wanted to share my latest thinking about how to support
dyn Trait
for traits with async functions and, in particular how to do so in a way that is compatible with the soul of Rust.Background: why is this hard?
Supporting
async fn
in dyn traits is a tricky balancing act. The challenge is reconciling two key things people love about Rust: its ability to express high-level, productive code and its focus on revealing low-level details. When it comes to async function in traits, these two things are in direct tension, as I explained in my first blog post in this series – written almost four years ago! (Geez.) -
Linuxiac ☛ GRUB Gets a Taste of Rust with New Prototype
There is no doubt that the Rust programming language is picking up serious momentum in the open-source world. We’re seeing more and more projects embrace it—like System76’s COSMIC desktop environment, which is being built entirely in Rust, and Fish Shell 4.
-
Niko Matsakis: Dyn you have idea for `dyn`?
Knock, knock. Who’s there? Dyn. Dyn who? Dyn you have ideas for
dyn
? I am generally dissatisfied with howdyn Trait
in Rust works and, based on conversations I’ve had, I am pretty sure I’m not alone. And yet I’m also not entirely sure the best fix. Building on my last post, I wanted to spend a bit of time exploring my understanding of the problem. I’m curious to see if others agree with the observations here or have others to add.Why do we have
dyn Trait
?It’s worth stepping back and asking why we have
dyn Trait
in the first place. To my mind, there are two good reasons.
-