a tumblelog
week 19, 2020

Alice and the red cat

On our way to my mother's house we encountered a red cat. Alice walked towards it and started to pet it.

Alice petting a red cat
Alice petting a red cat.

Propagating user-facing errors in Swift

If it’s one thing that almost all programs have in common is that they will, at some point, encounter some form of error. While some errors might be the result of bugs and failures caused by faulty code, incorrect assumptions, or system incompatibilities — there are also multiple kinds of errors that are completely normal, valid parts of a program’s execution.

One challenge with such errors is how to propagate and present them to the user, which can be really tricky, even if we disregard tasks like crafting informative and actionable error messages. It’s so incredibly common to see apps either display a generic ”An error occurred” message regardless of what kind of error that was encountered, or throw walls of highly technical debugging text at the user — neither of which is a great user experience.

So this week, let’s take a look at a few techniques that can make it much simpler to propagate runtime errors to our users, and how employing some of those techniques could help us present richer error messages without having to add a ton of complexity within each UI implementation.

Source: Propagating user-facing errors in Swift, an article by John Sundell.

Linux on the desktop as a web developer

I’ve been using Ubuntu as my primary home desktop OS for the past year and a half, so I thought it would be a good time to write up my experiences. Hopefully this will be interesting to other web developers who are currently using Mac or Windows and may be Linux-curious.

Source: Linux on the desktop as a web developer, an article by Nolan Lawson.

Learn Vimscript the Hard Way

Learn Vimscript the Hard Way is a book for users of the Vim editor who want to learn how to customize Vim.

It is not a guide to using Vim. Before reading this book you should be comfortable editing text in Vim and know what terms like "buffer", "window" and "insert mode" mean.

Source: Learn Vimscript the Hard Way, an online book by Steve Losh.

JavaScript: Variable Hoisting

JavaScript moves variables and functions declaration to the top of its scope during execution. This behaviour in JavaScript is called Hoisting.

Source: JavaScript: Variable Hoisting, an article by Karthik Vasudevan.

I admit it: I like Python's asyncio

Python's asyncio gets a fair bit of bad press. Some of it I agree with, but there is one aspect I like about it: the API needed for a lot of common tasks is actually fairly small and clear.

Source: I admit it: I like Python's asyncio, an article by Michal Charemza.

ZFS 101—Understanding ZFS storage and performance

To really understand ZFS, you need to pay real attention to its actual structure. ZFS merges the traditional volume management and filesystem layers, and it uses a copy-on-write transactional mechanism—both of these mean the system is very structurally different than conventional filesystems and RAID arrays. The first set of major building blocks to understand are zpools, vdevs, and devices.

Source: ZFS 101—Understanding ZFS storage and performance, an article by Jim Salter.

Calculating Streaks in Pandas

A streak is when several events happen in a row consecutively. In this post, we’re going to be working with NBA shot data and looking at players who made or missed a number of shots in a row. That said, streaks can take many forms. You can just as easily use this technique to detect and measure other streaks like consecutive days logging in to an app or website.

Source: Calculating Streaks in Pandas, an article by Josh Devlin.

An Illustrated Guide to Graph Neural Networks

Graph Deep Learning (GDL) is an up-and-coming area of study. It’s super useful when learning over and analysing graph data. Here, I’ll cover the basics of a simple Graph Neural Network (GNN) and the intuition behind its inner workings.

Source: An Illustrated Guide to Graph Neural Networks, an article by Rishabh Anand.

What is Benford’s Law and why is it important for data science?

We discuss a little-known gem for data analytics — Benford’s law, which tells us about expected distribution of significant digits in a diverse set of naturally occurring datasets and how this can be used for anomaly or fraud detection in scientific or technical publications.

Source: What is Benford’s Law and why is it important for data science?, an article by Tirthajyoti Sarkar.

A Guide to Big O notation

You have probably come across big O notation before. Maybe you have read that merge sort is better than insertion sort because merge sort is O(n log ⁡n) compared to insertion sort, which is O(n2). In this article, you'll understand what this means, and why this makes merge sort the better algorithm.

Source: A Guide to Big O notation, an article by Erik André Jakobsen.

Six Things I Learned from Mr. Robot

Mr. Robot is an amazingly accurate series about a hacker (Elliot Alderson) and his, uhm, undertakings. The series is consulted by many cybersecurity experts and so every hack that happens is actually properly executed, using real tools and commands that do exactly what an infosec expert would expect.

Source: Six Things I Learned from Mr. Robot an article by Bozhidar Bozhanov.

JavaScript magic with Symbols

A symbol is a primitive data type introduced in ES6. It's created with Symbol function and globally unique. Symbols can be used as object properties to provide uniqueness level access to objects and as hooks into built-in operators and methods, enabling us to alter the default behavior of JavaScript.

Source: JavaScript magic with Symbols, an article by Marko Marinovic.

Three Git Configurations that Should Be the Default

Recently, I started to customize my Git configuration to fit my workflow. I’ve found a few configurations that should be the default for anyone who installs Git.

Source: Three Git Configurations that Should Be the Default, an article by Andy Peterson.

Emacs is Not Just An Editor

The editor war between users of the vim editor and the Emacs editor exists since decades. Here is my comment on that as somebody who is using vim and GNU/Emacs intensive on a daily basis.

In my opinion, the most dominant advantage of Emacs is that it's not just an editor: it's a LISP interpreter and thus a very capable highly dynamic platform.

Source: Emacs is Not Just An Editor, an article by Karl Voit.

JSON Parsing from Scratch in Haskell

JSON is probably the most used standard file format for storing and transmitting data on the internet in recent times. Though it was historically derived from JavaScript, it is a programming language independent format and is now supported by almost all languages. JSON has a simple syntax specification with only four scalar data types and two composite data types. So, writing a parser for JSON is a great exercise for learning the basics of parsing. Let’s write one from scratch in Haskell.

Source: JSON Parsing from Scratch in Haskell, an article by Abhinav Sarkar.