Programming Leftovers
-
Rlang ☛ Parallel and Asynchronous Programming in Shiny with future, promise, future_promise, and ExtendedTask
There’s a saying that goes: “There are only two hard things in computer science: cache invalidation and naming things.” Well, I’d argue there are actually three:
2. Cache Invalidation
1. Naming things
3. Asynchronous ComputingYes, that’s a nerdy joke. No, I’m not sorry.
In this post, we’ll dive into parallel and asynchronous programming, why it matters for {shiny} developers, and how you can implement it in your next app.
-
Rlang ☛ How to Find the Column with the Max Value for Each Row in R
Are you working with a data frame in R where you need to determine which column contains the maximum value for each row? This is a common task when analyzing data, especially when dealing with multiple variables or measurements across different categories.
In this comprehensive guide, we’ll explore various approaches to find the column with the max value for each row using base R functions, the dplyr package, and the data.table package. By the end, you’ll have a solid understanding of how to tackle this problem efficiently in R.
-
DJ Adams ☛ The elements of programming with respect to CDL and SICP
CAP's language for expressing the domain model, the entities, their relationships, services, and more, is CDS's Conceptual Definition Language (CDL). It's a language that I've been dwelling on a lot recently, the simplicity and power of which impresses me more every time I consider its design.
I came across a section of the classic SICP (Structure and Interpretation of Computer Programs) this evening, in Chapter 1 "Building Abstractions with Procedures". Specifically in section 1.1 "The Elements of Programming", it is stated: [...]
-
Nolen Royalty ☛ Writing down (and searching through) every UUID
I’ve been struggling to remember all of the UUIDs 1. There are a lot of them. So this week I wrote them all down. You can see my list at everyuuid.com.
The site looks like this - UUIDs are displayed in a random-ish but consistent order and you can quickly search for one that you like: [...]
-
Terence Eden ☛ Creating a generic “Log-in with Mastodon” service
Let's say you have a website - your_website.tld - and you want people to log in to it using their Mastodon account.
For a traditional social-media site like Twitter or Facebook, you would create an OAuth app on the service that you want. But there are hundreds of Mastodon servers. So you need to create a new app for each one. That sounds hard, but it isn't. Well… not too hard.
Here's some code adapted from Infosec.press. It's all written using cURL on the command line - so you should be able to adapt it to your preferred programming language.
-
Nicholas Tietz-Sokolsky ☛ Parsing MIDI messages in Rust
I'm working on a terrible idea of a project, and this project uses MIDI. That means I need a MIDI implementation! I chose to use an existing library, midir, to connect to devices and receive messages. But the reason I was interested in this not-yet-announced project is because I wanted to understand MIDI. So it was time to implement the communication protocol myself.
-
Quentin Santos ☛ Rust Strings for C Programmers - Quentin Santos
This article will quickly explain the Rust types [T; N], &[T; N], &[T], Vec<T>, &Vec<T> with C code, and what the str, &str, String, OsString and CString add.
-
Muxup ☛ Directly committing files to a separate git branch
Suppose you have some files you want to directly commit to a branch in your current git repository, doing so without perturbing your current branch. Why would you want to do that? My current motivating use case is to commit all my draft muxup.com posts to a separate branch so I can get some tracking and backups without needing to add WIP work to the public repo. But I also use essentially the same approach to make a throw-away commit of the current repo state (including any non-staged or non-committed changes) to be pushed to a remote machine for building.
-
Perl / Raku
-
Perl Data Language ☛ Day 10: Playing Nice with Bad Values - PDL Advent calendar 2024
Santa has discovered quality control issues in some of the scientific equipment that was delivered to children last Christmas. The results from the Early Elf Joint Internship Training program were more No-No-No than Ho-Ho-Ho! However the EEJIT's were consistent and testing revealed that the first 3 values in every 10 measurements were faulty. An update was sent to all affected children so they could recalculate their results, knowing which readings to ignore.
Problem: How should they treat the suspect values?
-
Perl ☛ Perl Advent Calendar 2024 - Programming like a BEAST
Enhance Your Development Workflow with the e Module
You know how certain aspects of development can be a real drag - slow and pretty boring? I’ve definitely been there. But here’s where the e module comes in and changes the game. Rapid Prototyping
The e module comes loaded in with many features that can aid in rapid prototyping as well as testing.
-
-
Python
-
ID Root ☛ How To Convert Image to PDF File Using Python
Converting images to PDF files is a common task in various fields, from business to education. It allows for easier sharing, archiving, and printing of documents. Python, a versatile programming language, provides several libraries that make this conversion process straightforward and efficient.
-
ID Root ☛ Python Program to Convert Centimeters to Feet and Inches
In the world of programming and measurement conversions, creating a Python program to convert centimeters to feet and inches is a practical and educational endeavor. This comprehensive guide will walk you through the process of developing such a program, from basic implementation to advanced techniques.
-
Matthew Rocklin ☛ Python Support is Socially Complex
Supporting a Python product is difficult because it’s hard to draw a line between your product and the rest of the ecosystem. This creates confusion, especially when it comes to triage and attributing failure to one product or another.
When a complex product like a Python-based data workflow fails, most of the work in fixing it is in diagnosing the problem. When the product is self-contained and supported by one company, like a car for example, it’s clear whose responsibility it is to diagnose and fix the problem.
However, when a product is complex and ownership is jointly distributed among many different responsible entities, diagnostics become fraught. No individual entity has clear responsibility to solve any particular problem, and no entity has responsibility to triage the problem as a whole.
-