Tux Machines

Programming Leftovers

Posted by Roy Schestowitz on Aug 27, 2023

=> Education Leftovers | Proprietary Software and Windows Insecurity

The Python dictionary dispatch pattern

=> ↺ The Python dictionary dispatch pattern

One of my favourite patterns in the Python programming language is the "dictionary dispatch" pattern. This pattern is when you have a dictionary with string keys and functions as values. These functions can then be called concisely. This is useful if you have a range of functions to which different values can be applied that all accept (around) the same arguments.

Accurate Cycle Counting On RP2040 MicroPython

=> ↺ Accurate Cycle Counting On RP2040 MicroPython

The RP2040 is a gorgeous little chip with a well-defined datasheet and a fantastic price tag. Two SDKs are even offered: one based on C and the other MicroPython. More experienced MCU wranglers will likely reach for the C variant, but Python does bring a certain speed when banging out a quick project or proof of concept. Perhaps that’s why [Jeremy Bentham] ported his RP2040-based vehicle speedometer to MicroPython.

Clean mount lists in Linux

=> ↺ Clean mount lists in Linux

Default installations of Linux distributions mount more filesystems than they used to. This is because of loop devices, cgroups, and, in Ubuntu, snaps. As a result, the output from GNU df(1) as well as from lsblk(8) and mount(8) is more difficult to understand at a glance.
It is possible to make the output of these commands more readable by removing some of the “noise” devices. The following is a list of command arguments that remove irrelevant devices. After the list, I show how to replace the default commands in fish. You can adapt the replacement script for other shells.

Rust Cryptography Should be Written in Rust

=> ↺ Rust Cryptography Should be Written in Rust

All of the above is achievable with reasonable effort, time, and cost. It is often impractical for people to advocate for or work on pure Rust cryptography, even if they want to do so—especially when they may work for organizations that already have committed to doing something else. The community has to kindly demand pure Rust cryptography, politely but firmly refuse compromises, and generously support the individuals who are actively working towards making safe Rust cryptography a reality.

NP-hard does not mean easy

=> ↺ NP-hard does not mean easy

Recently the internet resurfaced my 2017 article, "NP-hard does not mean hard". I wrote the article mainly to express the nuance that NP-hardness only models the worst case of a problem, not the average case under any particular distribution—i.e., the instances you happen to encounter in the real world. More specifically, being NP-hard means that a problem has sufficient expressive power to model arbitrary boolean logic. But you can't blame NP-hardness for why you're bad at Super Mario

This isn't the way to speed up Rust compile times

=> ↺ This isn't the way to speed up Rust compile times

Recently serde, one of the most popular Rust libraries made a decision that supposedly sped up compile times by using a precompiled version of a procedural macro instead of compiling it on the fly. Like any technical decision, there are tradeoffs and advantages to everything. I don't think the inherent ecosystem risks in slinging around precompiled binaries are worth the build speed advantages, and in this article I'm going to cover all of the moving parts for this space.

GNUnet News: GSoC Work Product: GNUnet over QUIC

=> ↺ GNUnet News: GSoC Work Product: GNUnet over QUIC

Hi, my name is Marshall and throughout the summer of 2023 I worked on developing a new communicator for the GNUnet transport service. I learned a lot about GNUnet through my development experience. Here are some details about the journey!

=> gemini.tuxmachines.org

Proxy Information
Original URL
gemini://gemini.tuxmachines.org/n/2023/08/27/Programming_Leftovers.1.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
139.749966 milliseconds
Gemini-to-HTML Time
0.883699 milliseconds

This content has been proxied by September (ba2dc).