PHP 7 error handling class

Since writing bug-free code is not possible it is very important that you can quickly reproduce and fix bugs. Any programmer will tell you that this is only possible with a good bug report. Not all bugs are about missing/wrong functionality, sometimes the application runs into an error. Fortunately error reports (or crash reports as they are sometimes called) can be automated. In this post I will explain how errors are handled in PHP and how you can collect and log error data. ...

July 27, 2021 · Maurits van der Schee

Planned obsolescence and the right to repair

What have light-bulbs in common with Apple products? They are designed so that you can’t repair them and they are (needlessly) designed so that they need replacement pretty fast. Batteries are glued into the phone and the glass front panel breaks easily and is hard to replace. Is that legal? I feel it shouldn’t be. Fortunately, fines of millions of euros are given to counter this phenomenon also known as “planned obsolescence”. Still it seems these fines are not frequent and/or high enough to stop manufacturers from applying this practice. Planned obsolescence is mainly a environmental threat as many appliances and devices are thrown away and end up on garbage dumps (needlessly). ...

July 6, 2021 · Maurits van der Schee

Antec ISK 110 with 3400G using cTDP

I’ve built another PC. This time I wanted to create a silent but powerful small form factor PC. It aims to replace my AMD 3400G midi tower with something equally powerful and quiet that fits my desk. I’ve chosen an ASRock Fatal1ty B450 Gaming-ITX/ac motherboard with a on-board WiFi 5 (802.11ac) in an Antec ISK110 VESA-U3 small form factor case. I transferred the AMD 3400G quad core, the 2x16 GB of G.Skill Ripjaws 3600 a the 2 TB ADATA XPG SX8200 Pro NVMe drive. It is a small, pretty, super fast and not too noisy little box. The case costs 91 euros and has a built-in 90W power supply and comes with an IEC-C5 (also known as “clover”) power cable included. Unfortunately the cable I received was UK type instead of EU type. ...

June 23, 2021 · Maurits van der Schee

Firefox on Ubuntu has crackling sound

I’m running Xubuntu 21.04 and when I’m listening to mixcloud and visit certain sites using Firefox the sound starts to crackle and gets distorted. It can only be resolved by restarting Firefox, but restarting the browser is quite annoying. I added a bookmark to the URL “about:RestartRequired” to make the process a little less painful. I had to restart my browser fairly often until I found the following fixes to resolve the problem and find the cause. ...

June 20, 2021 · Maurits van der Schee

Minesweeper written in Go using Ebiten

It was already 7 years ago that I wrote Minesweeper for a the iPad on the iPad (using Pythonista). It was an implementation of Minesweeper in Python and it was optimized for touch usage. I have ported that implementation to Go using the Ebiten game engine, which can compile to Web Assembly. This project really was like a code kata and it proofed to be a great learning experience and a lot of fun to build. ...

June 15, 2021 · Maurits van der Schee

Low power computing at 8 watt idle

I’ve built another PC. This time I wanted to create a low power computer that could be always on. It aims to replace my NUC i7 with something powerful, silent and not too expensive. I’ve chosen an ASRock J5040-ITX motherboard with a on-board Intel J5040 CPU in an Inter-Tech ITX-601 HTPC case. This little machine is 3.2 GHz quad core with 32 GB of RAM a 1 TB SSD and costs less than 500 euro. It is a small, pretty, super fast and not too noisy little box. The case is an amazing value at 61 euros as it comes with a 60 Watt power supply with a power brick and all cables required. I run Xubuntu 20.04 LTS and it works great, I’m very pleased with the results! ...

May 5, 2021 · Maurits van der Schee

Why I use Bitlocker without TPM

Bitlocker is the Full Disk Encryption (FDE) solution in Windows, similar to FileVault in OSX and LUKS in Linux. I do advocate the use of full disk encryption on any device, but especially on devices that are prone to theft, such as laptops. In my threat model I’m using full disk encryption (solely) to prevent data theft in case of hardware theft. The power of full disk encryption lies in that it is easy to understand and reason about. Unfortunately this cannot be said about the Windows 10 (professional only) solution, unless you do what I did, as explained in this post. ...

April 4, 2021 · Maurits van der Schee

Storing JSON strings in MariaDB

In SQL every column has a name, a type and a single value (that may be NULL in some cases). These strong guarantees makes working with SQL very nice. Nevertheless people seem intrigued by these “limitations” and propose “improvements”. Some of these improvements are: The ARRAY type in SQL99 and nested arrays in SQL2003. The JSON type in MySQL the JSON/JSONB type in PostgreSQL. The XML type in SQL Server. They all weaken the guarantee that a table row has a fixed number of keys and that every key has exactly one value and that each value has a specified type. ...

March 11, 2021 · Maurits van der Schee

Installing PDO_SQLSRV on Debian 10

Installing the PHP SQL Server driver (PDO_SQLSRV) on a Debian 10 Linux system requires several steps, starting with the installation of the Microsoft ODBC Driver. Note that Debian requires TLS 1.2 and if your SQL Server does not support that you will run into “Error code 0x2746”. This post will explain how to resolve that issue. First we make sure to install the Microsoft ODBC Driver for SQL Server on Linux. ...

February 18, 2021 · Maurits van der Schee

Should table names be singular or plural?

As we all know “naming things” is jokingly named as one of the two hard problems in software engineering (the other one being “cache invalidation”). This post is about the question whether your (database) table names should be plural or singular, e.g. “posts” or “post”. You should read the following Stack Overflow post to understand that this is a heated debate: Stack Overflow: Table Naming Dilemma: Singular vs. Plural Names ...

January 2, 2021 · Maurits van der Schee