For Father's Day Esme had planned a visit to the Rijksmuseum in
Amsterdam. So a bus, a train, a metro, and a tram later we arrived.
After some walking around we arrived at the famous Night
Watch. Because the Rijksmuseum is carrying out a detailed study of
Rembrandt's masterpiece it was in a huge glass box and surrounded by
equipment.
After the museum we took a tram to the center and walked in the
direction of the train station. On our way Alice and Adam each bought
a book. Alice bought Five Nights at Freddy's - The Silver Eyes and
Adam bought the sequel Five Nights at Freddy's - The Twisted Ones.
In the early evening I pushed tumblelog version 5.1.2 to
GitHub. This version mqkes
it easier to style the calendar pages, the month overview pages, the
tags and individual tag pages. I also added a new argument;
--feed-size. The integer value that must follow this option
determines the number of items in each feed. This used to be 14, the
same as the number of days (--days), but I changed it to 25.
Version 5.1.2 of tumblelog is available on
GitHub. As always feedback
is very welcome.
Harry Potter, Ron and Hermione return to Hogwarts School of
Witchcraft and Wizardry for their third year of study, where they
delve into the mystery surrounding an escaped prisoner who poses a
dangerous threat to the young wizard.
In the evening Esme, Alice, and I watched Harry Potter and the
Prisoner of Azkaban. Adam had
been to a birthday party and was sound asleep. I had seen the movie
before. I liked the movie and give it an 8 out of 10.
Apple computers include a custom operating system - macOS, which has
a few annoying features. Among the annoyances a special place has to
be reserved for the inability to remove or rename the folders
located in $HOME. On the web countless macOS users are looking for
the ways to bypass this restriction. Multiple suggestions are
provided as possible solutions. You can: replace the folders with
files; hide the folders from ‘Finder’ and make them inaccessible; or
simply learn to live with them, as the system will recreate those
folders by itself anyway.
Rust is an exciting language. I recently bought The Rust
Programming Language Book. It’s
quite dense with a lot of concepts I haven’t thought about since
college. Working in high-level programming languages such as Java,
Python, and TypeScript have allowed me to mostly forget about the
woes of low-level programming. Rust has both re-introduced me to
these problems, and then immediately solved them with the advanced
static analysis that its compiler provides.
In the afternoon I noticed that Adam's Heterometrus silenus was out
and about. We keep this scorpion in a plastic container on my desk. As
it was actively searching for food I decided to give it a mealworm.
It grabbed the mealworm and even the tweezers I used; it was quite
hungry. When it had transferred the mealworm to its "mouth" it kept
looking for food so I gave it another mealworm. This is the first time
the scorpion is this active, maybe because of the high temperatures in
my office (±28°C).
Despite being a fundamental concept in relational databases, First
Normal Form (or 1NF) is often explained confusingly or downright
incorrect. This post explains what 1NF actually means and is useful
for, and debunk a number of the misunderstandings.
There are a huge number of HTTP clients available for Python - a
quick search for “Python HTTP Clients” on Github returns over
1700 results(!) How do you make sense of all of them and find one
which is right for your particular use case?
Do you have a single machine at your disposal, or a collection of
them? Do you want to keep things simple or is raw performance more
of a concern? A web application needing to make the odd request to a
micro-service api is going to have quite different requirements to a
script constantly scraping data. Additionally, there's the concern
whether the library you choose will still be around 6 months down
the line.
In this article we're going to cover five of the best HTTP clients
currently available for Python and detail why each of them might be
one for you to consider.
In the evening I noticed that another scorpion had become quite
active; Liocheles australasiae. So I dropped a mealworm close to
it. At first it was not interested but later I checked upon the small
scorpion and it was enjoying its meal.
The Rust team is happy to announce a new version of Rust,
1.53.0. Rust is a programming language that is empowering everyone
to build reliable and efficient software.
This article will walk you through the process of setting up a Git
server which can be pushed to, cloned from, and browsed, using a
static site generator called
stagit as a front-end. You
can see my stagit-made site at
git.theohenson.com.
Requirements:
Some sort of Linux server (it could be as simple as a Raspberry
Pi, or a VPS).
At least a basic understanding of Git and the shell.
I happened to discourage using an ORM in our company internal Slack
and suddenly found myself needing to explain some problems common in
ORMs. I got a little bit carried away, and the explanation turned
into this blog post.
This blog post compares the advantages and disadvantages of docker
containers with VMs and describes why and how we execute docker
images inside a QEMU MicroVM. The described approach makes it
possible to combine the security of VMs with the existing ecosystem
of docker (e.g. images and tools). Afterwards we take a look at ways
how we can map features like bind mounts to solutions supported by
QEMU and demonstrate this by running the NGINX docker image in QEMU.
The console is the built-in debugger of the browser. Many developers
use console.log() all the time to print messages and debug
problems in their code. But this tool has a lot more to offer than
you may have ever realized!
A modulino is a file which behaves like a library when it is
imported, and like a script when executed. I first read about them
in Mastering
Perl,
but you can create them in other languages too. Here’s how to do it
in Bash.
In the morning I pushed md2tweets to
GitHub. This program is a
companion to tumblelog.
It reads the Markdown input file of tumblelog and outputs tweets
separated by a % character; the input format of
tweetfile, a program to
post to Twitter at random.
I run md2tweets each time after I run tumblelog via a
Makefile. The
tweetfile program is called several times a day via cron on MacOS.
I do a lot of web scraping in my spare time, and have been chasing
down different formats and code snippets to make a large amount of
network requests locally, with controls for rate limiting and error
handling.
I’ve gone through a few generations - I’ll use this post to
catalogue where I started and what I’m doing now.
I used to think that I didn’t need comments if I wrote
self-documenting code. However, I have realized that I do write
comments, and that I find them really useful. To see how many
comments I write, and what kind they are, I wrote a script to
analyze my git commits from the last six years. In total, seven
percent of my committed lines contained a comment. This blog post
has details on what constitutes good and bad comments, as well as
more statistics from my script.
Today, I'm writing about what types can be used for other than
checking code properties. It will involve a good chunk of dynamic
typing, and yes it's in Rust. There are some wild ideas in it, so
fasten your seatbelt and get ready for a ride!
Most code running on the web is event-based, garbage-collected, and
dynamically typed. In stark contrast, Rust is a compiled language
with static type- and memory-safety without a
garbage-collector. What are the implications for a project that
compiles Rust to WebAssembly? I try to answer this question with a
fictive story and hands-on code examples.
Heaps are a
fundamental data structure that implement the priority queue
abstract data
type. Essentially,
a priority queue is one where the element at the front of line is
always the one of highest priority, which is defined by the
programmer for a specific implementation. A standard heap
implementation provides fast access to the front element of the
queue, in O(1) time, as well as insertion/deletion in
O(log(n)) time.
Usually, the highest priority value is defined as either the minimum
or maximum value in the data, as implemented in min and max heaps
respectively. In this post, however, we will look at a more
specialized heap that instead prioritizes the median value. Why
would this be useful? I'm not sure of any practical applications,
but assumedly it could be if it were ever performance critical to
repeatedly calculate the median. Let's jump in.