A model can be anything from 2 numbers scribbled on the back of a
napkin, to 100s of numbers tied together in a spreadsheet, to an
entire software program performing millions of calculations.
These models are simplified versions of reality that can help us to
think better by using numbers. With calculators and spreadsheets, we
can build models to help us decide where to go on holiday, how much
money to save, and how many employees to hire.
But there's one ingredient that our models, and therefore our
decisions, tend to neglect — uncertainty.
Today our daughter Alice turned 13. Around 4PM her aunt and uncle paid
us a visit, standing outside of the house at a safe distance. They had
brought some presents, including one from Alice's grandmother.
After they had left we enjoyed some crumble pie. And a little later we
played triominos, a game she got as a present from her grandmother.
When we had finished playing one game Alice wanted to play
with the painting set she got as a present from her aunt and uncle.
This is a guide for working software engineers who have an interest
in Haskell but don’t know Haskell yet. I presume you know some
basics about how your operating system works, the shell, and some
fundamentals of other imperative programming languages. If you are a
Python or Java software engineer with no Haskell experience, this is
the executive summary of Haskell theory and practice for you. We’ll
delve into a little theory as needed to explain concepts but no more
than necessary. If you’re looking for a purely introductory
tutorial, this probably isn’t the right start for you, however this
can be read as a companion to other introductory texts.
A nice feature I’ve become used to in the last year is a so-called
“smart directory changer” that keeps track of the directories you
change into, and then lets you jump to popular ones quickly, using
fragments of the path to find the right location.
There is quite some prior art in this, such as
autojump,
fasd or
z, but I could not resist building my
own implementation of it, optimized for zsh.
Today I’ve decided that I want to write a little rant on the topic
of language design. Since I’m a C programmer, and I use it on a
daily basis, I’ve had many thoughts about C syntax over past few
years. I like C, and it is a good language, that defined modern
operating systems and software. But I think that C still needs a
better syntax and macro system. Not because C syntax is inconvenient
to use, but because syntax is a tool of expression. And macros can
extend this concept even further.
Generalized algebraic datatypes, or simply GADTs, are a
generalization of the algebraic data types that you are familiar
with. Basically, they allow you to explicitly write down the types
of the constructors. In this chapter, you'll learn why this is
useful and how to declare your own.
When I first started learning JavaScript I thought it was hard to
understand map. I will attempt to explain map to someone who never
heard of it, a beginner trying to learn JavaScript.
Go is a bit infamous for not supporting generics, but lately
generics have come much closer to becoming a reality. There's a
draft
design
that seems to be relatively stable and is gaining traction in the
form of a prototype source-to-source translator implemented by the
Go team. Here's what the latest design looks like and how you can
try out generics yourself.
Type I and type II errors happen when you erroneously spot winners
in your experiments or fail to spot them. With both errors, you end
up going with what appears to work or not. And not with the real
results.
This time, we are going to describe our journey of getting Haskell
garbage collection times under control when dealing with heap sizes
of up to 100 GB per instance. Ultimately, we managed to reduce the
garbage collection time while parsing 320,000 product rows from 68s
to 3s, reducing the total parsing time from 110s to 46s.
As you probably know, setting things up in a developer's environment
is wild — you don't know what to expect. It's hard to set things up
deterministically, and reproduce one environment into
another. Homebrew for instance, tries to do as
best as it can, but since it treats the environment as a global
space in which dumping things, alike a singleton class that anyone
can modify, that often results in hard-to-debug errors.
The first time that I heard about Nix was on this blog
post
from Pinterest, but it didn't catch my attention until now. I
started reading about it and watching some internal videos that
Burke is creating to evangelize
the idea. The more I read about it, the more amazed I am with the
idea.
In the morning I tested image upload in a phpBB forum I installed
recently. I could upload a small photo as an attachment, but a larger
one failed. So I configured the board settings to accept attachments
of maximum 10MB. But now I got an HTTP error.
The error log of the Nginx web server showed a client intended to
send too large body message. To fix this, I logged in and changed to
the root account using /bin/su -. Next, I added the following line:
client_max_body_size 10M;
to the http section of /etc/nginx/nginx.conf and reloaded the
server using systemctl reload nginx.
Next, I changed one setting in /etc/php/7.3/fpm/php.ini and added
another one. Those settings are as follows:
upload_max_filesize=10M
post_max_size=10M
Finally, I restarted php7.3-fpm as follows:
systemctl restart php7.3-fpm
Note that I use php7.3-fpm on Ubuntu 18.04 LTS because the version
that (still) comes with it, PHP 7.2, comes with a php-xml package
that prevents phpBB version 3.3 from working correctly. See this how
to
for instructions.
I remember when mosh first came out and
thinking "that sounds like a great idea, maybe I'll set it up
sometime" and then never getting around to it. Several times over
the years I've thought similarly, but it never seemed worth it. A
week ago a coworker asked if there were good tools for handling
remote terminal use over laggy internet connections, and I suggested
mosh. They really liked it, which then had me feeling silly for
never trying it, and got me to actually do it. So: I'm typing this
over mosh, and it's excellent! I should have done this years ago.
Having a good database schema design is crucial for building
applications that will need to scale in traffic and complexity. If
you happen to do a bad design choice you will see that it takes a
lot of effort to stop the pattern from propagating to your backends’
services and controllers, and finally to your frontend.
So there is a need to be able to evaluate if a database design is
better than another.
But what does good mean when we are talking about design?
WireGuard is a relatively new VPN
tunnel protocol that aims to be very fast and easy to setup. It
follows the Unix
Philosophy
closely in that it only does one thing (creating secured VPN
tunnels) and does it well.
In the evening I saw my Chromatopelma cyaneopubescens grooming
itself on top of a piece of coco peat that I keep moist to provide a
humid section to its otherwise dry container.
I used a dosing syringe to moisten the piece of coco peat a little
more and saw the tarantula lower itself to the substrate; it was
taking some of the moisture.
Soon after it returned to its "house": a few small twigs that it has
covered in some webbing.
Last Saturday I ordered the following four tarantulas with Fatbob's
Exotics:
0.0.1 Hapalopus sp Colombia big 3FH €5
0.0.1 Heteroscodra maculata 2FH €4
0.0.1 Psalmopoeus irminia 3/4FH €5
0.0.1 Pterinochilus murinus RCF 3FH €5
Three of which were on the
wishlist
I made back in March.
I also ordered one scorpion:
0.0.1 Chaerilus sp Java 2FH €6
Although the order added up to €25 and shipping was €7 I was asked to
pay €31.
This morning the order, shipped on Monday, arrived. After some
shopping for containers, cork tubes, fake plants, and coco peat I
started the rehousing of the arachnids as all animals were shipped in
small vials.
First, I prepared a terrarium for the Psalmopoeus irminia, an
arboreal species, guided by a care
sheet. Rehousing
the small spider was easy. Next, I prepared a terrarium for the
Heteroscodra maculata, another arboreal species. Again I used a
care
sheet
for guidance. However, when I opened the vial to rehouse the tarantula
I noticed that it was much smaller than the Psalmopoeus irminia, and
for sure too small for the terrarium I just prepared. Luckily, I had a
much smaller container, and used that one instead.
Next, I rehoused the Pterinochilus murinus into a terrarium I had
prepared using a care
sheet
for guidance. When I carefully tried to move the tarantula with a soft
brush it attacked the brush. A common name for this species is Orange
Bitey Thing; a play on the common name Orange Baboon Tarantula (OBT)
for this species.
For the final two arachnids I needed also a much smaller terrarium. So
Esme and I went out again. First I went to a shop to buy two small cups
with garlic sauce; the right size for the tiny Chaerilus sp. Java, a
scorpion. We also bought a few additional containers in another shop.
For the scorpion I used some coco peat and a small piece of cork to
provide a hiding place. For the Hapalopus sp Colombia I used once
more a care
sheet for
guidance.
As Alice and Adam had collected a bunch of snails at my mother's
place last Sunday, I helped Alice with preparing a nice terrarium for
their collection.
Comparison operators are frequently used in JavaScript applications,
and are an important part of controlling the logic flow of the
app. But if you don’t have a good understanding of how they work you
can run into a couple issues. Understanding strict comparisons and
abstract comparisons is also really important, and in this article
we’ll cover both of these comparisons.
A lot of web development is transforming JSON one way or another. In
TypeScript/JavaScript this is straightforward, since JSON is built
into the language. But can we also achieve good ergonomics in
Haskell and Rust? Dear reader, I am glad you asked! 🙌