week 22, 2023

Proposing a struct syntax for Python

I want to introduce the new (soft) keyword struct (the name was chosen by my wife, Andrea, as more understandable than data once you explain struct is short for structure and how it's used in other programming languages). You would be able to follow the keyword with the name of the struct class. The parentheses after the name would contain the positional-or-keyword and/or keyword-only parameters the constructor would accept. Each parameter name would directly map to an attribute name for which the parameter would be saved to. Because of this mapping of parameter name to attribute name, no positional-only parameters are allowed (the only deviation from function declearation syntax).

Source: Proposing a struct syntax for Python, an article by Brett Cannon.

Grown Ups 2 (2013)

After moving his family back to his hometown to be with his friends and their kids, Lenny finds out that between old bullies, new bullies, schizo bus drivers, drunk cops on skis, and four hundred costumed party crashers sometimes crazy follows you.

In the evening Esme and I watched Grown Ups 2. I liked the movie less than the previous one so I give it a 6 out of 10.

Killing Moon

THE HUNT IS ON AND THE POLICE ARE RUNNING OUT OF TIME. Two young women are missing, their only connection a party they both attended, hosted by a notorious real-estate magnate. When one of the women is found murdered, the police discover an unusual signature left by the killer, giving them reason to suspect he will strike again.

THEY'RE FACING A KILLER UNLIKE ANY OTHER. And exposing him calls for a detective like no other. But the legendary Harry Hole is gone—fired from the force, drinking himself to oblivion in Los Angeles. It seems that nothing can entice him back to Oslo. Until the woman who saved Harry's life is put in grave danger, and he has no choice but to return to the city that haunts him and track down the murderer.

CATCHING HIM WILL PUSH HARRY TO THE LIMIT. He'll need to bring together a misfit team of former operatives to accomplish what he can't do alone: stop an unstoppable killer. But as the evidence mounts, it becomes clear that there is more to this case than meets the eye...

In the evening I started in Killing Moon, a Harry Hole Novel (13) by Jo Nesbø.

NixOS for the Impatient

NixOS is a Linux distribution configured using Nix. It is declarative, meaning that the entire system state can be defined in a single .nix file; and reproducible, meaning you can have multiple computers set up identically.

Source: NixOS for the Impatient, an article by Fernando Borretti.

Random testing in Go

Choosing good test cases for our Go programs can be a bit hit-and-miss. Sometimes we get lucky and find an input that causes incorrect behaviour, or even a crash, but in general, picking inputs at random isn’t a good way to find bugs.

Or is it? What if we leaned into that idea a little and used a lot of different inputs? Say, a million, or even a billion. With that many inputs, our chances of finding the one weird value that triggers a problem start to look pretty good.

Source: Random testing in Go, an article by John Arundel.

Grown Ups (2010)

After their high school basketball coach passes away, five good friends and former teammates reunite for a Fourth of July holiday weekend.

In the evening Alice and I watched Grown Ups. I had seen the movie before. I liked it and give it a 7 out of 10.

Transformer Math 101

A lot of basic, important information about transformer language models can be computed quite simply. Unfortunately, the equations for this are not widely known in the NLP community. The purpose of this document is to collect these equations along with related knowledge about where they come from and why they matter.

Source: Transformer Math 101, an article by Quentin Anthony, Stella Biderman, and Hailey Schoelkopf.

Data Compression Drives the Internet. Here’s How It Works.

With more than 9 billion gigabytes of information traveling the internet every day, researchers are constantly looking for new ways to compress data into smaller packages. Cutting-edge techniques focus on lossy approaches, which achieve compression by intentionally “losing” information from a transmission. Google, for instance, recently unveiled a lossy strategy where the sending computer drops details from an image and the receiving computer uses artificial intelligence to guess the missing parts. Even Netflix uses a lossy approach, downgrading video quality whenever the company detects that a user is watching on a low-resolution device.

Very little research, by contrast, is currently being pursued on lossless strategies, where transmissions are made smaller, but no substance is sacrificed. The reason? Lossless approaches are already remarkably efficient. They power everything from the PNG image standard to the ubiquitous software utility PKZip. And it’s all because of a graduate student who was simply looking for a way out of a tough final exam.

Source: How Lossless Data Compression Works, an article by Elliot Lichtman.

The Basics of Python Packaging in Early 2023

You may have heard there are new, modern standards in Python packaging (pyproject.toml!) that have been adopted over the last few years. There are now several popular and shiny modern tools for managing your packaging projects. (Poetry! Hatch! PDM!) However, the documentation is scattered and much of it is specific to these competing tools. What are the recommended best practices when creating a Python package? What is the minimal amount that you need to do in order to follow the best practices?

Source: The Basics of Python Packaging in Early 2023, an article by Jay Qi.

Trial by Fire (2018)

The tragic and controversial story of Cameron Todd Willingham, who was sentenced to death in Texas for killing his three children even after scientific evidence and expert testimony bolstered his claims of innocence.

In the evening I watched Trial by Fire. I liked the movie and give it a 7 out of 10.

What is the Standard Library for?

Overall, there was agreement that the original motivations for a large, “batteries-included” standard library no longer held up to scrutiny. “In the good old days,” Ned Deily reminisced, “We said ‘batteries-included’ because we didn’t have a good story for third-party installation.” But in 2023, installing third-party packages from PyPI is much easier.

Source: The Python Language Summit 2023: What is the Standard Library for?, an article by Alex Waygood.

Media Queries, Responsive Design? Help me!

Media queries are a CSS language feature which allow an author to conditionally apply CSS rules according to characteristics of the device or window in which an application is being viewed. Most commonly, these might be according to the viewport width allowing CSS authors to create components and layouts that are responsive to the size of the window or device that they are being viewed in. But this may also extend to whether a user prefers light or dark mode, or even a user's accessibility preferences, plus many more properties.

Source: Everything You Want To Know About Media Queries and Responsive Design, an article by Nathan Hardy.

Bcrypt at 25: A Retrospective on Password Security

Over the years, I've observed modern password hashing algorithms significantly reduce the effectiveness of brute-force password guessing. However, password stuffing attacks—where attackers use previously leaked credentials to gain unauthorized access—continue to be a persistent threat. On the other hand, the advent of multi-factor authentication (MFA) has shifted the focus to protecting user accounts through additional layers of verification, making passwords less critical to security.

Source: Bcrypt at 25: A Retrospective on Password Security, an article by Niels Provos.