Plurrrr

week 47, 2020

Building Your Color Palette

Ever used one of those fancy color palette generators? You know, the ones where you pick a starting color, tweak some options that probably include some musical jargon like "triad" or "major fourth", and are then bestowed the five perfect color swatches you should use to build your website?

This calculated and scientific approach to picking the perfect color scheme is extremely seductive, but not very useful.

Source: Building Your Color Palette.

How variables are implemented in CPython

Consider a simple assignment statement in Python:

a = b

The meaning of this statement may seem trivial. What we do here is take the value of the name b and assign it to the name a, but do we really? This is an ambiguous explanation that gives rise to a lot of questions:

  • What does it mean for a name to be associated with a value? What is a value?
  • What does CPython do to assign a value to a name? To get the value?
  • Are all variables implemented in the same way?

Today we'll answer these questions and understand how variables, so crucial aspect of a programming language, are implemented in CPython.

Source: Python behind the scenes #5: how variables are implemented in CPython, an article by Victor Skvortsov.

Transitioning from Docker to Podman

Podman is an excellent alternative to Docker containers when you need increased security, unique identifier (UID) separation using namespaces, and integration with systemd. In this article, I use real-world examples to show you how to install Podman, use its basic commands, and transition from the Docker command-line interface (CLI) to Podman. You’ll also see how to run an existing image with Podman and how to set up port forwarding.

Source: Transitioning from Docker to Podman, an article by Cedric Clyburn.

Getting started with Random Matrices: A Step-by-Step Guide

In the Deep Learning (DL) age, more and more people have encountered and used (knowingly or not) random matrices. Most of the time this use is limited to the initialization of the networks weights, that can be accomplished with a single line of code in your favorite DL framework. However, Random Matrices have a rich mathematical theory with far reaching applications in physics, network theory, machine learning, finance, etc. This fascinating range of applications also means that each field often developed its dedicated terminology to describe the same mathematical concept, often with confusing consequences. The aim of this article(s) is to introduce Random Matrix Theory (RMT) from a physicist's perspective while trying to relate different tools and terminology, especially across the math and physics literature. Although you do need to know basic calculus, I will try to introduce new concepts and give references in case you would like to go deeper.

Source: Getting started with Random Matrices: A Step-by-Step Guide, an article by Mirco Milletarì.

Using Arrow Functions in Javascript – The Why and How

Since arrow functions were introduced in ES6, they have become increasingly popular, changing the look and function of regular functions.

I love arrow functions; I use them all the time. In fact, they have grown so popular that you rarely see the function keyword anymore, though I can assure you it is still used. I almost always use arrow functions in place of the function keyword.

This is a short guide about Javascript arrow functions.

Source: Using Arrow Functions in Javascript – The Why and How.

An Introduction to ZFS

ZFS has become increasingly popular in recent years. ZFS on Linux (ZoL) has pushed the envelope and exposed many newcomers to the ZFS fold. iXsystems has adopted the newer codebase, now called OpenZFS, into its codebase for TrueNAS CORE. The purpose of this article is to help those of you who have heard about ZFS but have not yet had the opportunity to research it.

Our hope is that we leave you with a better understanding of how and why it works the way it does. Knowledge is key to the decision-making process, and we feel that ZFS is something worth considering for most organizations.

Source: An Introduction to ZFS A Place to Start, an article by Nick Fusco.

Better Python console apps with Rich

Recently I've been working on a few internal tools for my company, Teclado. Things like web scrapers to collect data and store it in a database, or simple tools to make people's jobs easier.

Because these are intended for a very small audience who are doing very specific tasks, I normally make console applications. And console applications can be tricky to use (and look hideous) most of the time.

Rich is a Python library that changes that completely. My new console apps are a joy to use, look great, and it's super easy to create them.

In this post, let me tell you about Rich and how I've been using it. I'm not a Rich expert by any means, but I hope it helps!

Source: Better Python console apps with Rich, an article by Jose Salvatierra.

How to unit-test a private (non-exported) function in JavaScript

When writing unit-tests for JavaScript modules, we often encounter a dilemma wherein the module has some private functions that have not been exported. Testing a function that has been exported is easy since it can be imported in the unit testing framework, and the functionality can be tested. But how to unit-test a private (non-exported) function?

Source: How to unit-test a private (non-exported) function in JavaScript, an article by Saransh Kataria.

Adam's Acanthoscurria geniculata

In the early evening I managed to remove the lid of the enclosure of Adam's Acanthoscurria geniculata without disturbing the spider. The juvenile female tarantula was resting on top of its burrow, so I took several photos. She's very skittish and most of the time when I remove the lid she hides from view immediately.

Acanthoscurria geniculata resting on top of her burrow
Acanthoscurria geniculata resting on top of her burrow.

Firefox 83 introduces HTTPS-Only Mode

Security on the web matters. Whenever you connect to a web page and enter a password, a credit card number, or other sensitive information, you want to be sure that this information is kept secure. Whether you are writing a personal email or reading a page on a medical condition, you don’t want that information leaked to eavesdroppers on the network who have no business prying into your personal communications.

That’s why Mozilla is pleased to introduce HTTPS-Only Mode, a brand-new security feature available in Firefox 83. When you enable HTTPS-Only Mode:

  • Firefox attempts to establish fully secure connections to every website, and
  • Firefox asks for your permission before connecting to a website that doesn’t support secure connections.

Source: Firefox 83 introduces HTTPS-Only Mode, an article by Christoph Kerschbaumer, Julian Gaibler, Arthur Edelstein, and Thyla van der Merwe.

How to Build HTML Forms Right: User Experience

As you build out forms for the web, getting the semantics, accessibility, and styling right is a lot of work. If you can get all those right, you’re doing quite well for yourself. However, there are still some thing we can do to make life better for the folks filling out our forms.

In this article, we’ll look at some of the do’s and don’ts about HTML form user experience (UX)

Source: How to Build HTML Forms Right: User Experience, an article by Austin Gil.

What’s changed in Bootstrap 5?

Bootstrap 5 is currently in its 3rd alpha release. The plan seems to be to release Bootstrap 5 to the public as a final version near the end of the year. In one of our recent projects we already went ahead with using it, anticipating that the underlying logic wouldn’t change that much from now until the release.

So let’s talk about some of the most important changes in Bootstrap 5.

Source: What's changed in Bootstrap 5?, an article by Johan Ronsse.

The 2020 Mac Mini Unleashed

Since a few days, we’ve been able to get our hands on one of the first Apple Silicon M1 devices: the new Mac mini 2020 edition. While in our analysis article last week we had based our numbers on the A14, this time around we’ve measured the real performance on the actual new higher-power design. We haven’t had much time, but we’ll be bringing you the key datapoints relevant to the new Apple Silicon M1.

Source: The 2020 Mac Mini Unleashed: Putting Apple Silicon M1 To The Test, an article by Andrei Frumusanu.

Nginx Hardening Guide

Nginx is a lightweight, open-source, robust, high-performance HTTP server and a reverse proxy. It’s the most popular web server, beating Apache and IIS.

Nginx is recognized for its stability, performance, rich feature set, easy configuration, and low resource consumption.

While the default configurations are favoured by most people, they are not secure enough, and extra tweaks are needed to reinforce the web server.

Here, we will look into some actions you can take to strengthen and improve Nginx server security.

Source: Nginx Server Security: Nginx Hardening Guide, an article by Manieendar Mohan.

cut vs. awk

So, what does it mean to do one thing and do it well? Well, awk has been a staple of any UNIX diet since the late 1970s. I think it's a lovely little tool which I use even for rather mundane tasks. It's certainly changed a bit over the years, but the core concept of the language remains the same. Still, it's a complete programming language and can do a lot more than a simple, single-purpose command.

The cut command is slightly newer, but like awk, it's a part of the POSIX standard. It can also hardly be considered to have suffered much feature creep: it's got a rather stringent set of parameters and really does just one thing, which is cutting a smaller piece of text out of a larger piece of text.

The question is of course, does the UNIX philosophy still hold up? Is it always better to have one small program doing one thing well, as opposed to a slightly bigger program doing many things? Let's examine this by performing a simple task with two slightly different twists.

Source: cut vs. awk, an article by Carl Svensson.

Term Rewriting

Continuing on from our series last week, this time we’re going to discuss the topic of term rewriting. Term rewriting is a very general model of computation that consists of programmatic systems for describes transformations (called rules) which transform expressions called terms into other sets of terms.

Source: Exotic Programming Ideas: Part 2 (Term Rewriting), an article by Stephen Diehl.

Serverless APIs: Lessons learned

If you are thinking about or never heard that building completely serverless APIs was possible? This post is for you. I’m going to compile a few lessons I’ve learned in the past 3-4 years while shipping a few production projects and dealing with no servers at all.

Source: Serverless APIs: Lessons learned, an article by Igor Escobar.

Image Processing in Python: Algorithms, Tools, and Methods

Images define the world, each image has its own story, it contains a lot of crucial information that can be useful in many ways. This information can be obtained with the help of the technique known as Image Processing.

It is the core part of computer vision which plays a crucial role in many real-world examples like robotics, self-driving cars, and object detection. Image processing allows us to transform and manipulate thousands of images at a time and extract useful insights from them. It has a wide range of applications in almost every field.

Python is one of the widely used programming languages for this purpose. Its amazing libraries and tools help in achieving the task of image processing very efficiently.

Through this article, you will learn about classical algorithms, techniques, and tools to process the image and get the desired output.

Source: Image Processing in Python: Algorithms, Tools, and Methods You Should Know, an article by Neetika Khandelwal.