Programming Leftovers
-
Jens Georg: Remote deploy to server using SSH and Gitlab
These are my notes for setting up a “deploy-to-remote-webserver” workflow with ssh and an sftp-only chroot, in case someone might find it useful.
Compiled from various bits and pieces around the internet.
-
Marc Brooker ☛ What Fekete's Anomaly Can Teach Us About Isolation
What is Fekete’s anomaly? It’s an example of a snapshot isolation behavior first described in Fekete, O’Neil, and O’Neil’s paper A Read-Only Transaction Anomaly Under Snapshot Isolation. The first time I read about it, I found it spooky. As in five stages of grief spooky. But the more I’ve thought about it, the more I think it’s just a great teaching example.
To understand the anomaly, let’s talk about two people. We’ll call the Pat and Betty. Pat and Betty share a pair of bank accounts - a savings account and a current account. They bank at Alan’s bank, which charges a $1 overdraft fee any time a withdrawal will reduce the total value of their accounts below $0.
-
Robin Schroer ☛ String vs &str
Something I see somewhat regularly when engineers adopt Rust, almost regardless of their level of experience, is the confusion between &str and String. To add to the confusion, both are used in different situations, one of them can transparently convert to the other under the correct conditions, and there is generally an optimal choice to be made.
An important fact to notice is that &str is a reference, which means it does not own the memory holding the string, it is merely a pointer to a string elsewhere. This means it has a known size1 and can thus be stored on the stack instead of on the heap, but limits where it can be passed. It can only be alive as long as its source also is alive.
-
Sean Goedecke ☛ Good engineers are right, a lot
Bryan Cantrill has a good rant about the Amazon principle here. I agree with Bryan that it’s a bit silly-sounding, and that it’s not the kind of fundamental principle that can guide tough decisions (no problem, just pick the right choice, like a good leader would do!) But I do think it’s just a straight-up fact. Good leaders are right a lot. Of course that flows from other qualities: they’re smart, or they surround themselves with good people, or for any of a hundred other reasons. I think the point of Amazon’s principle is that it’s hard to assess those other qualities in the aggregate. It’s easier to ask yourself: is this person right a lot?
-
Modus Create LLC ☛ The refactoring of a Haskell codebase
Common engineering scenario: There is a large legacy codebase out there which is known to have a few pervasive problems that everyone wants to get rid of. But nobody understands all the details of the codebase, and few are willing to risk breaking the artifact in a long and costly surgery. This post is an experience report on one such refactoring of Liquid Haskell (LH), a tool to verify Haskell programs.
LH has grown mostly from academic contributions that demonstrate the feasibility of some proof technique or another. Since the focus of a demonstration is not always placed on generality, a new user can find unresolved problems, sometimes blockers that make adoption difficult. Let us look at one such example.
-
Qt ☛ Qt for MCUs 2.8.2 LTS released
Qt for MCUs 2.8.2 LTS (Long-Term Support) has been released and is available for download. This patch release provides bug fixes and other improvements while maintaining source compatibility with Qt for MCUs 2.8. It does not add any new functionality.
-
Rlang ☛ New version of package gDefrag
We have developed a new version of the gDefrag package. The previous version has been retired from CRAN due to dependencies on outdated packages. This updated version is still under development and may contain limitations. Please exercise caution when using it. -
Python
-
Vincent Lammens ☛ Coderunner.app and python virtual environments
So I've been playing with CodeRunner as my new IDE, but I had one problem: I use python virtual environments and it did not use them by default.
Nothing you can't solve with code, and CodeRunner allows you to use a compilation script.
-
-
Rust
-
Rust Blog ☛ The Rust Programming Language Blog: crates.io: development update
Back in July 2024, we published a blog post about the ongoing development of crates.io. Since then, we have made a lot of progress and shipped a few new features. In this blog post, we want to give you an update on the latest changes that we have made to crates.io.
Crate deletions
In RFC #3660 we proposed a new feature that allows crate owners to delete their crates from crates.io under certain conditions. This can be useful if you have published a crate by mistake or if you want to remove a crate that is no longer maintained. After the RFC was accepted by all team members at the end of August, we began implementing the feature.
-