news
Programming Leftovers
-
HowTo Geek ☛ The easiest way to build a local dev toolbox with one file
Every developer I know has been through the same cycle. You start a new project, and you need a database. So you download PostgreSQL or MySQL, go through configuration, and forget the password you set five minutes later. A few months down the line, you start another project that needs a different version of that database, or perhaps it needs Redis, and suddenly your host machine is a graveyard of services you installed once and forgot about.
There are many ways to solve this problem (way too many to be honest), but for a personal local dev environment, the simplest and most maintainable solution is to put everything in a single Docker Compose file.
-
Terence Eden ☛ Bored of eating your own dogfood? Try smelling your own farts!
"Dogfooding" is a sacred practice in the tech industry. Use your own products. That's it. That's all you have to do. For example, if you work for Slack - you can't use Teams for your messaging solution. You have to show people that you have faith in your own products.
But it goes deeper than that. When I used to work for mobile phone networks, they asked us to spend time in call centres. It isn't enough to receive a quarterly report on customer KPIs. You have to hear the rage in customers' voices as they struggle with your billing system. Perhaps that will convince you to have empathy with the people paying to use your product.
-
Nelson Elhage ☛ From error-handling to structured concurrency
Today I want to ask: how should we update this pattern for concurrent programs, where there is no single stack? How do we organize our code to handle error conditions, in the presence of multiple concurrent tasks2?
-
Jussi Pakkanen ☛ Everything old is new again: memory optimization
Peak consumption is ~100 kB in this implementation. It uses only 7.7% of the amount of memory required by the Python version.
-
Lean Rada ☛ Flow field visualisation on my homepage
I did a few optimisations to make it smoother, but in the end I had to lower the framerate and tried to make the low frame rate look intentional. Optimisation was important especially for mobile devices.
-
Andreas ☛ SSE for a real-time sensor dashboard
In one of my small sensor dashboard projects, I had multiple devices sending measurements to a backend, and a browser UI showing those measurements live.
At first, I was considering the usual options: polling or maybe WebSockets. Polling would work, but it means the browser asks the server for updates on a timer. WebSockets would also work, but they felt heavier than what I actually needed. The browser did not need a full two-way channel. It mostly just needed to receive updates whenever any device sent a new measurement. That made Server-Sent Events (SSE) a good fit.
-
Rlang ☛ Why Advanced Attribution Matters More When Everyone Else Uses Last Touch
I just read Ron Berman’s paper Beyond the Last Touch: Attribution in Online Advertising, and I think the most useful implication for practitioners is slightly different from the headline result.
The paper compares no attribution, last-touch attribution, and Shapley-value attribution in a multi-publisher advertising market. Its central result is that attribution is not just a reporting layer. It changes bidding incentives and therefore changes market outcomes.
That matters because most advertisers still do not operate with advanced measurement. In many cases they rely on some mix of: [...]
-
Daniel Holden ☛ Inertial Easing
So let me try to explain my interpretation of Inertial Easing:
Inertial Easing starts with the following problem statement (which might sound familiar to those who have read my article on springs). If we have a value, changing with a given velocity, and a target value we want to interpolate towards within some fixed time, how do we find a smooth path that brings us there: [...]
-
Perl / Raku
-
DEV Community ☛ Beautiful Perl feature: reusable subregexes
Perl is famous for its regular expressions (in short: regexes): this technology had been known for a long time, but Perl was probably the first general-purpose programming language to integrate them into the core. Perl also augmented the domain-specific sublanguage of regular expressions with a large collection of extended patterns; some of these were later adopted by many other languages or products under the name "Perl-compatible regular expressions".
-
-
Python
-
James Bennett ☛ Rewriting a 20-year-old Python library
Over the next six years, I periodically pushed out small releases of akismet, mostly focused on keeping up with upstream Python version support (and finally going Python-3-only, in 2020 when Python 2.7 reached its end of upstream support). But beginning in 2024, I embarked on a more ambitious project which spanned multiple releases and turned into a complete rewrite of akismet which finished a few months ago. So today I’d like to talk about why I chose to do that, how the process went, and what it produced.
-
-
R / R-Script
-
Rlang ☛ Speeding up tidySummarizedExperiment through query optimisation and the plyxp backend
The generality of tidySummarizedExperiment makes it easy to interface with several tidyverse packages (e.g. dplyr, tidyr, ggplot2, purrr, plotly). This is possible thanks to its approach of converting SummarizedExperiment objects to tibbles, performing operations, and converting back to the original format. This conversion process introduces substantial overhead when working with large-scale datasets. Each operation requires multiple data transformations, with the conversion to tibble format creating memory copies of the entire dataset, followed by the reverse conversion back to SummarizedExperiment. For datasets containing hundreds of samples and tens of thousands of genes, these repeated conversions can consume memory and add significant computational overhead to even simple operations such as filtering or grouping.
-