{"title":"fd93","link":[{"@attributes":{"href":"https:\/\/fd93.me\/","rel":"alternate"}},{"@attributes":{"href":"https:\/\/fd93.me\/feeds\/all.atom.xml","rel":"self"}}],"id":"https:\/\/fd93.me\/","updated":"2026-03-15T00:00:00+08:00","subtitle":"My site about productivity and programming","entry":[{"title":"Hosting Comments for this Blog: An Isso Adventure","link":{"@attributes":{"href":"https:\/\/fd93.me\/hosting-isso-comments.html","rel":"alternate"}},"published":"2026-03-15T00:00:00+08:00","updated":"2026-03-15T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2026-03-15:\/hosting-isso-comments.html","summary":"<p><img alt=\"A shiba looking concerned at a laptop. Credit: Ms Kng on Pexels\" src=\"\/images\/shiba-using-computer-ms-kng-pexels.jpg\"><\/p>\n<p>(To skip my narration and jump to the setup part,\n<a href=\"\/hosting-isso-comments#hetzner\">click here<\/a>.)<\/p>\n<p>As you might have noticed, fd93.me has comments now!<\/p>\n<p>Specifically, comments powered by <a href=\"https:\/\/isso-comments.de\/\">isso<\/a>. In this\narticle, I want to talk about the various decisions and technical steps that led\nme to the current setup. While this \u2026<\/p>","content":"<p><img alt=\"A shiba looking concerned at a laptop. Credit: Ms Kng on Pexels\" src=\"\/images\/shiba-using-computer-ms-kng-pexels.jpg\"><\/p>\n<p>(To skip my narration and jump to the setup part,\n<a href=\"\/hosting-isso-comments#hetzner\">click here<\/a>.)<\/p>\n<p>As you might have noticed, fd93.me has comments now!<\/p>\n<p>Specifically, comments powered by <a href=\"https:\/\/isso-comments.de\/\">isso<\/a>. In this\narticle, I want to talk about the various decisions and technical steps that led\nme to the current setup. While this article focuses on isso, the same steps\napply for hosting most web services on a VPS.<\/p>\n<p>For most of the services I host I just use my home server (a Raspberry Pi 4\n8gb). In this case, though, I didn't want to host isso on my own hardware\nbecause it needs to talk to the public internet, and I was not interested in\nexposing my home network to the tender mercies of the internet in 2026.<\/p>\n<p>Instead, I had to figure out a cloud-based solution. For a long time, I've\navoided embedding much compute in this site because it adds complexity and\nongoing cost. I worked around this with <a href=\"https:\/\/ifttt.com\/\">IFTTT<\/a> when I\ncreated the site, but using webhooks for everything wasn't very sustainable.<\/p>\n<p>Embedding comments in the site solves some problems with just posting on\nMastodon or other socials:<\/p>\n<ul>\n<li>According to analytics, the majority of my readers come from search engines,\n  especially on the how-to articles.<\/li>\n<li>Social posts disappear in a week (at most), but I try to write so-called\n  'evergreen' content which will still be relevant in a year or two.<\/li>\n<li>Social embeds force people to join the same platform as me. I like Mastodon,\n  but it seems a bit much to expect someone to jump from duckduckgo to my blog\n  post to <em>joining a Mastodon instance<\/em> just to tell me about an article.<\/li>\n<\/ul>\n<p>I had a few requirements for my solution, but I was willing to bend any of them\nif necessary:<\/p>\n<ol>\n<li>It should be cheap to run, where cheap is defined as under $10 \/ month. I\n   don't make money from this blog and prefer to keep any ongoing costs as low\n   as possible.<\/li>\n<li>It should use a European provider, preferably one located in a country with\n   laws that go beyond the minimum required by GDPR. While this is a comment\n   system and inherently public data,\n   <a href=\"https:\/\/www.convotis.com\/en\/news\/microsoft-access-eu-data\/\">I don't fully trust US providers<\/a>\n   not to mirror all my traffic data to some data collection scheme. Meanwhile,\n   Asian countries seem to have extremely thin privacy and data security laws.<\/li>\n<li>It should be relatively simple to understand and bugfix; preferably it should\n   be self-healing.<\/li>\n<\/ol>\n<h2>The AWS Designs<\/h2>\n<p>(This section discusses solutions I didn't use. If you're not interested in\nsystem design, <a href=\"#hetzner\">skip to the next section<\/a>.)<\/p>\n<p>I'd wondered about how you could efficiently host Isso on AWS for a while, and\ncame up with several different designs. To keep it very brief, they were:<\/p>\n<ol>\n<li>Just use a single EC2 instance to host Isso and keep backups.<\/li>\n<li>Use ECS to provision EC2 instances and make Isso self-healing. Use a load\n   balancer to deal with instances being terminated.<\/li>\n<li>Use AWS Lambda to host Isso, attach it to persistent storage, and proxy it\n   through API gateway and cloudformation.<\/li>\n<\/ol>\n<p>In the end, all AWS-based designs were a pretty major compromise on my 'European\nproviders only' requirement, which made me uncomfortable. I was still willing to\nbe morally flexible for the right price.<\/p>\n<p>But AWS did not meet my cost requirements either. A simple solution using a\nsingle EC2 instance would have had predictable costs of around $4 a month, but\nno ability to scale in (i.e. cut costs) and little resilience to failure. Also,\nthe instance I would get for this price (t4g.nano) is seriously underpowered at\n500mb of RAM. It also has an ARM processor, which can limit compatibility with\nsome compiled software.<\/p>\n<p>The more resilient ECS-based solution would tolerate failure better and let me\ntake advantage of spot instances to lower compute cost. Unfortunately, those\ncost savings are immediately destroyed by paying $15 \/ month for the load\nbalancer needed to implement ECS.<\/p>\n<p>The more complex solution using lambdas could have scaled in to less than $1 \/\nmonth in costs, but in theory could also have scaled <em>out<\/em> to infinite costs.<\/p>\n<p>The final nail in the coffin for AWS was the complexity of the ECS \/ Lambda\nsolutions, which would have made them harder to maintain. They also use\nproprietary AWS components, which makes it far harder to migrate off them. In\nfact, considering AWS-based solutions made it obvious I'd missed a requirement:<\/p>\n<ul>\n<li>Where possible, the solution should avoid vendor lock-in.<\/li>\n<\/ul>\n<p>If you are interested in a more in-depth look at each of these designs, let me\nknow in the comments and I will write a full article.<\/p>\n<p><a id=\"hetzner\"><\/a><\/p>\n<h2>Hetzner: Da steppt der B\u00e4r (the party's there)<\/h2>\n<p>In the end I went with Hetzner for hosting. Why?<\/p>\n<ul>\n<li>For the same price as a t4g.micro with 500mb of RAM, I can get an instance\n  with 2gb on Hetzner. This will be nice if I want to put more than one service\n  on the server.<\/li>\n<li>They are based in Germany, which meets my requirement of keeping data in\n  Europe. Not only that, Germany\n  <a href=\"https:\/\/secureprivacy.ai\/blog\/german-data-privacy-laws-guide-bdsg-ttdsg-gdpr\">supplements the GDPR with additional, stricter regulation<\/a>.<\/li>\n<li>They mainly provide plain VPS instances without much fancy additional\n  infrastructure, which keeps my solution simple.<\/li>\n<\/ul>\n<p>I went with a simple VPS server with backups and an IPv4 address, costing just\nunder 5 EUR a month. Although resilience is convenient, this is just a comment\nservice for my personal blog. Even if it's down for a week, it doesn't really\nmatter, and some basic observability can fill in the gap. A simple VPS setup\nalso has a mostly fixed cost, regardless of traffic; if you get more traffic\nthan the server can handle, it just fails. For me a bit of downtime is better\nthan blowing hundreds of dollars on a scaling solution.<\/p>\n<p>Hetzner offers a few operating system options. I chose\n<a href=\"https:\/\/www.fedoraproject.org\/\">Fedora Linux<\/a>. It's what I currently run at\nhome, and at work I usually use\n<a href=\"https:\/\/www.redhat.com\/en\/technologies\/linux-platforms\/enterprise-linux\">RHEL<\/a>\nvariants, which are Fedora-based.<\/p>\n<h2>Setting Up Isso<\/h2>\n<p>By default Hetzner's distribution of Fedora signs you in as the root user.\nRunning services as root is usually a bad idea, and\n<a href=\"https:\/\/isso-comments.de\/docs\/reference\/installation\/\">Isso's install guide<\/a>\nspecifically advises against it, so the first thing I did was set up a new user,\nswitch to it and create a virtual environment for Isso:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>adduser<span class=\"w\"> <\/span>--home-dir<span class=\"w\"> <\/span>\/home\/isso<span class=\"w\"> <\/span>--create-home<span class=\"w\"> <\/span>--user-group<span class=\"w\"> <\/span>isso\nsu<span class=\"w\"> <\/span>isso\n<span class=\"nb\">cd<\/span>\n<span class=\"c1\"># All isso runtime files will live inside \/home\/isso for ease of management.<\/span>\nvirtualenv<span class=\"w\"> <\/span>--download<span class=\"w\"> <\/span>\/home\/isso\/isso\n<\/code><\/pre><\/div>\n\n<p>Next I needed some setup tools so that isso could be installed from\n<a href=\"https:\/\/pypi.org\/\">pypi<\/a>:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"nb\">exit<\/span><span class=\"w\"> <\/span><span class=\"c1\"># back to root user<\/span>\nyum<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>python3-devel<span class=\"w\"> <\/span>python3-virtualenv<span class=\"w\"> <\/span>sqlite\nyum<span class=\"w\"> <\/span>groupinstall<span class=\"w\"> <\/span><span class=\"s2\">&quot;Development Tools&quot;<\/span>\n<\/code><\/pre><\/div>\n\n<p>The <code>groupinstall<\/code> command didn't work, so I ignored it and moved on. This\nturned out to be a mistake, as we'll see in a moment. Finally I tried to install\nisso:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>su<span class=\"w\"> <\/span>isso\n<span class=\"nb\">cd<\/span>\n<span class=\"nb\">source<\/span><span class=\"w\"> <\/span>\/home\/isso\/isso\/bin\/activate\npip<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>isso\n<\/code><\/pre><\/div>\n\n<p>This failed with an 'unable to build wheels, missing <code>gcc<\/code>' error. After digging\ninto the package names and commands for <code>dnf5<\/code>, for which both normal Google\nsearch and AI search were quite useless, I figured out that the correct commands\nto install development tools for Fedora 43 (and any recent distro which uses\n<code>dnf5<\/code>) were as follows:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>dnf5<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>python3-devel<span class=\"w\"> <\/span>python3-virtualenv<span class=\"w\"> <\/span>sqlite\ndnf5<span class=\"w\"> <\/span>group<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>development-tools\n<\/code><\/pre><\/div>\n\n<p>Since I figured other people might have the same problem,\n<a href=\"https:\/\/github.com\/isso-comments\/isso\/pull\/1092\">I filed a PR to update Isso's installation docs<\/a>.<\/p>\n<div style=\"display: flex; flex-direction: column; align-items: center; gap: 0.5em;\">\n  <img src=\"\/images\/im-doing-my-part.gif\" alt=\"I'm doing my part meme from Starship Troopers\"><\/img>\n<\/div>\n\n<p>This finally allowed isso to build and install. Next, I setup my isso config in\n<code>\/home\/isso\/isso.cfg<\/code>. It looked like this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">[general]<\/span>\n<span class=\"na\">dbpath<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">\/home\/isso\/comments.db<\/span>\n<span class=\"na\">host<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">https:\/\/fd93.me\/<\/span>\n<span class=\"na\">gravatar<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">true<\/span>\n<span class=\"na\">log-file<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">\/home\/isso\/isso.log<\/span>\n\n<span class=\"k\">[server]<\/span>\n<span class=\"na\">listen<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">http:\/\/0.0.0.0:8080<\/span>\n\n<span class=\"k\">[moderation]<\/span>\n<span class=\"na\">enabled<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">true<\/span>\n\n<span class=\"k\">[rss]<\/span>\n<span class=\"na\">base<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">https:\/\/fd93.me<\/span>\n\n<span class=\"k\">[admin]<\/span>\n<span class=\"na\">enabled<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">true<\/span>\n<span class=\"na\">password<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"s\">REDACTED<\/span>\n<\/code><\/pre><\/div>\n\n<p>I enabled moderation queue because in my past experience, blog comments sections\nare a spam magnet. I also enabled RSS because I know at least a few of my\nreaders use RSS as their primary method of following articles and comment\nchains. I did NOT enable SMTP (outbound emails) because my Hetzner account is\nnew and therefore not allowed to send outbound mail. Since this was just for\ntesting I bound to the public interface <code>http:\/\/0.0.0.0:8080<\/code>.<\/p>\n<p>(For more information on how to configure an isso server\n<a href=\"https:\/\/isso-comments.de\/docs\/reference\/server-config\/\">see the docs<\/a>.)<\/p>\n<p>After all that, I was finally ready to test drive isso:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>\/home\/isso\/isso\/bin\/isso<span class=\"w\"> <\/span>-c<span class=\"w\"> <\/span>\/home\/isso\/isso.cfg\n<\/code><\/pre><\/div>\n\n<p>Disappointment:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>no module named &#39;pkg_resources&#39; found\n<\/code><\/pre><\/div>\n\n<p>I had to dig around a bit, but it turned out this was due to\n<a href=\"https:\/\/github.com\/stumpy-dev\/stumpy\/issues\/950\">setuptools being removed from Python 3.12 and greater<\/a>.\nYou have to install it manually:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>pip<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>setuptools\n\/home\/isso\/isso\/bin\/isso<span class=\"w\"> <\/span>-c<span class=\"w\"> <\/span>\/home\/isso\/isso.cfg\n<\/code><\/pre><\/div>\n\n<p>Tried again, and:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>no module named &#39;pkg_resources&#39; found\n<\/code><\/pre><\/div>\n\n<p>After expressing myself colorfully at the computer screen, I did a bit more\nresearch. Turns out that <code>pkg_resources<\/code>\n<a href=\"https:\/\/github.com\/pypa\/setuptools\/issues\/5174\">is no longer part of setuptools &gt;= 82.0<\/a>,\nand the latest version of setuptools at time of writing is <code>82.0.0<\/code>. There are\nproper fixes to this, but by this point I was slightly tilted, so I just\ndowngraded:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>pip<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>setuptools&lt;<span class=\"m\">82<\/span>.0\nnohup<span class=\"w\"> <\/span>\/home\/isso\/isso\/bin\/isso<span class=\"w\"> <\/span>-c<span class=\"w\"> <\/span>\/home\/isso\/isso.cfg<span class=\"w\"> <\/span><span class=\"p\">&amp;<\/span>\n<\/code><\/pre><\/div>\n\n<p>This time it worked, and just in time for me to notice this line from the isso\ndocs:<\/p>\n<blockquote>\n<p>Binding to a public interface is not recommended.<\/p>\n<\/blockquote>\n<p>Looked like it was finally time to do things properly.<\/p>\n<h2>Going to production<\/h2>\n<p>Having read the dire warnings against serving Isso on a public interface, I\nimmediately removed the <code>[server]<\/code> section from my config and restarted the\nserver:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"c1\"># who knows what the actual process number was<\/span>\n<span class=\"nb\">kill<\/span><span class=\"w\"> <\/span><span class=\"nv\">$PROCESS<\/span>\nsu<span class=\"w\"> <\/span>isso\nnohup<span class=\"w\"> <\/span>\/home\/isso\/isso\/bin\/isso<span class=\"w\"> <\/span>-c<span class=\"w\"> <\/span>\/home\/isso\/isso.cfg<span class=\"w\"> <\/span><span class=\"p\">&amp;<\/span>\n<\/code><\/pre><\/div>\n\n<p>In order to serve isso without binding it to a public interface (and serve\nHTTPS), I needed to setup a web server as a reverse proxy. The isso guide\nrecommends <a href=\"https:\/\/nginx.org\/\">nginx<\/a>, but I'm too lazy to bother with\nconfiguring that, so instead I went with <a href=\"https:\/\/caddyserver.com\/\">caddy<\/a>.\nCaddy has two nice features for self-hosting:<\/p>\n<ol>\n<li>It has very succinct and readable config files<\/li>\n<li>It automatically sets up and renews free\n   <a href=\"https:\/\/letsencrypt.org\/\">Let's Encrypt<\/a> certificates<\/li>\n<\/ol>\n<p>Back as root, and having installed neovim in the meantime:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>dnf<span class=\"w\"> <\/span>copr<span class=\"w\"> <\/span><span class=\"nb\">enable<\/span><span class=\"w\"> <\/span>@caddy\/caddy\ndnf<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>caddy\nnvim<span class=\"w\"> <\/span>\/etc\/caddy\/Caddyfile\n<\/code><\/pre><\/div>\n\n<p>This is my Caddyfile, which is rather laconic. It forwards inbound traffic from\n<code>comments.fd93.me<\/code> to <code>localhost:8080<\/code>.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>comments.fd93.me\n  reverse_proxy :8080\n<\/code><\/pre><\/div>\n\n<p>Let's start the systemd unit for Caddy and see what it says:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>systemctl<span class=\"w\"> <\/span>start<span class=\"w\"> <\/span>caddy.service\nsystemctl<span class=\"w\"> <\/span>status<span class=\"w\"> <\/span>caddy\n<\/code><\/pre><\/div>\n\n<p><code>DNS problem: NXDOMAIN looking up A for comments.fd93.me<\/code>. Great.<\/p>\n<p>Unlike the various difficulties in the isso setup, this was a predictable skill\nissue, so I calmly went to my DNS provider (AWS Route 53), setup an A record\nfrom <code>comments.fd93.me<\/code> to the VPS, waited a minute for the change to propagate,\nand tried again.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>systemctl<span class=\"w\"> <\/span>start<span class=\"w\"> <\/span>caddy.service\nsystemctl<span class=\"w\"> <\/span>status<span class=\"w\"> <\/span>caddy\n<span class=\"c1\"># It works! Make the service start on boot.<\/span>\nsystemctl<span class=\"w\"> <\/span><span class=\"nb\">enable<\/span><span class=\"w\"> <\/span>caddy.service\n<\/code><\/pre><\/div>\n\n<p>Now I had TLS and a proper reverse proxy in place. But wait! Isso is still just\nrunning as a background process, and will be killed on reboot. Also, I was still\nrunning it on its development server, which is not recommended in the docs.<\/p>\n<p>Luckily Isso's maintainer provides\n<a href=\"https:\/\/salsa.debian.org\/jelmer\/isso\/-\/blob\/master\/debian\/isso.service\">a handy systemd unit for isso<\/a>.\nI tried configuring gunicorn to serve isso, but didn't have much luck. So\ninstead I went with <a href=\"https:\/\/www.gevent.org\/\">gevent<\/a>, which is a simpler setup:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>su<span class=\"w\"> <\/span>isso\n<span class=\"nb\">source<\/span><span class=\"w\"> <\/span>\/home\/isso\/isso\/bin\/activate\npip<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span>gevent\n<\/code><\/pre><\/div>\n\n<p>I then added the following modified systemd unit file at\n<code>\/etc\/systemd\/system\/isso.service<\/code>:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">[Unit]<\/span>\n<span class=\"na\">Description<\/span><span class=\"o\">=<\/span><span class=\"s\">isso commenting system<\/span>\n<span class=\"na\">Documentation<\/span><span class=\"o\">=<\/span><span class=\"s\">man:isso(8)<\/span>\n\n<span class=\"c1\"># Require the filesystems containing the following directories to be mounted<\/span>\n<span class=\"na\">RequiresMountsFor<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso<\/span>\n\n<span class=\"na\">ConditionPathIsDirectory<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso<\/span>\n<span class=\"na\">ConditionPathIsReadWrite<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso<\/span>\n\n<span class=\"c1\"># Start only if there are conf files in isso home - otherwise<\/span>\n<span class=\"c1\"># skip this unit quietly.<\/span>\n<span class=\"na\">ConditionPathExistsGlob<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso\/*.cfg<\/span>\n\n<span class=\"k\">[Service]<\/span>\n<span class=\"na\">ExecStart<\/span><span class=\"o\">=<\/span><span class=\"s\">isso -c \/home\/isso\/isso.cfg<\/span>\n\n<span class=\"c1\">#UMask=0007<\/span>\n<span class=\"na\">Restart<\/span><span class=\"o\">=<\/span><span class=\"s\">on-failure<\/span>\n<span class=\"na\">TimeoutSec<\/span><span class=\"o\">=<\/span><span class=\"s\">1<\/span>\n<span class=\"na\">User<\/span><span class=\"o\">=<\/span><span class=\"s\">isso<\/span>\n\n<span class=\"na\">LimitNOFILE<\/span><span class=\"o\">=<\/span><span class=\"s\">16384<\/span>\n<span class=\"na\">LimitNPROC<\/span><span class=\"o\">=<\/span><span class=\"s\">16384<\/span>\n<span class=\"na\">LimitLOCKS<\/span><span class=\"o\">=<\/span><span class=\"s\">16384<\/span>\n\n<span class=\"c1\"># ensures that the service process and all its children can never gain new<\/span>\n<span class=\"c1\"># privileges.<\/span>\n<span class=\"na\">NoNewPrivileges<\/span><span class=\"o\">=<\/span><span class=\"s\">true<\/span>\n\n<span class=\"k\">[Install]<\/span>\n<span class=\"na\">WantedBy<\/span><span class=\"o\">=<\/span><span class=\"s\">multi-user.targe[Unit]<\/span>\n<span class=\"na\">Description<\/span><span class=\"o\">=<\/span><span class=\"s\">isso commenting system<\/span>\n<span class=\"na\">Documentation<\/span><span class=\"o\">=<\/span><span class=\"s\">man:isso(8)<\/span>\n\n<span class=\"c1\"># Require the filesystems containing the following directories to be mounted<\/span>\n<span class=\"na\">RequiresMountsFor<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso<\/span>\n\n<span class=\"na\">ConditionPathIsDirectory<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso<\/span>\n<span class=\"na\">ConditionPathIsReadWrite<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso<\/span>\n\n<span class=\"c1\"># Start only if there are conf files in isso home - otherwise<\/span>\n<span class=\"c1\"># skip this unit quietly.<\/span>\n<span class=\"na\">ConditionPathExistsGlob<\/span><span class=\"o\">=<\/span><span class=\"s\">\/home\/isso\/*.cfg<\/span>\n\n<span class=\"k\">[Service]<\/span>\n<span class=\"na\">ExecStart<\/span><span class=\"o\">=<\/span><span class=\"s\">isso -c \/home\/isso\/isso.cfg<\/span>\n\n<span class=\"c1\">#UMask=0007<\/span>\n<span class=\"na\">Restart<\/span><span class=\"o\">=<\/span><span class=\"s\">on-failure<\/span>\n<span class=\"na\">TimeoutSec<\/span><span class=\"o\">=<\/span><span class=\"s\">1<\/span>\n<span class=\"na\">User<\/span><span class=\"o\">=<\/span><span class=\"s\">isso<\/span>\n\n<span class=\"na\">LimitNOFILE<\/span><span class=\"o\">=<\/span><span class=\"s\">16384<\/span>\n<span class=\"na\">LimitNPROC<\/span><span class=\"o\">=<\/span><span class=\"s\">16384<\/span>\n<span class=\"na\">LimitLOCKS<\/span><span class=\"o\">=<\/span><span class=\"s\">16384<\/span>\n\n<span class=\"c1\"># ensures that the service process and all its children can never gain new<\/span>\n<span class=\"c1\"># privileges.<\/span>\n<span class=\"na\">NoNewPrivileges<\/span><span class=\"o\">=<\/span><span class=\"s\">true<\/span>\n\n<span class=\"k\">[Install]<\/span>\n<span class=\"na\">WantedBy<\/span><span class=\"o\">=<\/span><span class=\"s\">multi-user.target<\/span>\n<\/code><\/pre><\/div>\n\n<p>To make this work I had to have isso available in root's PATH, which I managed\nwith a symlink:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>ln<span class=\"w\"> <\/span>-s<span class=\"w\"> <\/span>\/home\/isso\/isso\/bin\/isso<span class=\"w\"> <\/span>\/usr\/local\/bin\/isso\n<\/code><\/pre><\/div>\n\n<p>Finally, I was ready to run isso in a relatively production-ready way:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"c1\"># This reloads the systemd unit files<\/span>\n<span class=\"c1\"># so systemctl is aware of the latest versions<\/span>\ndaemon-reload\nsystemctl<span class=\"w\"> <\/span>start<span class=\"w\"> <\/span>isso.service\n<\/code><\/pre><\/div>\n\n<p>It ran!<\/p>\n<p><img alt=\"Image of isso admin interface\" src=\"\/images\/isso-admin-blank.png\"><\/p>\n<p>I decided to reboot the server to see if my setup was robust:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>systemctl<span class=\"w\"> <\/span>reboot\n<\/code><\/pre><\/div>\n\n<p>On reboot, there was no sign of isso. Pop quiz: why?<\/p>\n<p>Yet another skill issue. I'd forgotten to enable the systemd unit:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>systemctl<span class=\"w\"> <\/span>start<span class=\"w\"> <\/span>isso.service\nsystemctl<span class=\"w\"> <\/span><span class=\"nb\">enable<\/span><span class=\"w\"> <\/span>isso.service\nsystemctl<span class=\"w\"> <\/span>reboot\n<\/code><\/pre><\/div>\n\n<p>This time, the service ran as expected on reboot. Nearly finished, but now it\nneeded embedding in the blog.<\/p>\n<h2>Embedding in the blog<\/h2>\n<p>In theory, the final step to insert Isso into a blog should have been easy; just\nadd the embed code to the bottom of my article template and update the site:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"p\">&lt;<\/span><span class=\"nt\">script<\/span>\n  <span class=\"na\">data-isso<\/span><span class=\"o\">=<\/span><span class=\"s\">&quot;\/\/comments.fd93.me\/&quot;<\/span>\n  <span class=\"na\">src<\/span><span class=\"o\">=<\/span><span class=\"s\">&quot;\/\/comments.fd93.me\/js\/embed.min.js&quot;<\/span>\n<span class=\"p\">&gt;&lt;\/<\/span><span class=\"nt\">script<\/span><span class=\"p\">&gt;<\/span>\n\n<span class=\"p\">&lt;<\/span><span class=\"nt\">section<\/span> <span class=\"na\">id<\/span><span class=\"o\">=<\/span><span class=\"s\">&quot;isso-thread&quot;<\/span><span class=\"p\">&gt;<\/span>\n  <span class=\"p\">&lt;<\/span><span class=\"nt\">noscript<\/span><span class=\"p\">&gt;<\/span>Javascript needs to be activated to view comments.<span class=\"p\">&lt;\/<\/span><span class=\"nt\">noscript<\/span><span class=\"p\">&gt;<\/span>\n<span class=\"p\">&lt;\/<\/span><span class=\"nt\">section<\/span><span class=\"p\">&gt;<\/span>\n<\/code><\/pre><\/div>\n\n<p>In practice, I tried this and was immediately hit with a CORS error and a 404\nerror saying my browser couldn't retrieve <code>embed.min.js<\/code> from\n<code>comments.fd93.me<\/code>. For once, this wasn't my fault; it turns out that\n<a href=\"https:\/\/github.com\/isso-comments\/isso\/issues\/1086\">isso 0.13.2 suffers from incomplete packaging<\/a>\ndue to the same setuptools change that caused problems earlier.<\/p>\n<p>Following the sage advice of user mightykatun, I just reverted to version\n<code>0.13.0<\/code> and rebooted:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>su<span class=\"w\"> <\/span>isso\n<span class=\"nb\">source<\/span><span class=\"w\"> <\/span>\/home\/isso\/isso\/bin\/activate\npip<span class=\"w\"> <\/span>install<span class=\"w\"> <\/span><span class=\"nv\">isso<\/span><span class=\"o\">==<\/span><span class=\"m\">0<\/span>.13.0\nsystemctl<span class=\"w\"> <\/span>restart<span class=\"w\"> <\/span>isso.service\n<\/code><\/pre><\/div>\n\n<p>With this, the embed code Just Worked as intended: I could write a comment and\nsee it show up in my moderation queue immediately.<\/p>\n<div style=\"display: flex; flex-wrap: wrap; gap: 1em; max-width: 100%;\">\n  <img style=\"min-width: 0; flex: 1 1 300px;\" src=\"\/images\/isso-comment.png\" alt=\"Picture of Isso comment embed\"><\/img>\n  <img style=\"min-width: 0; flex: 1 1 300px;\" src=\"\/images\/isso-admin.png\" alt=\"Picture of Isso admin panel with comment\"><\/img>\n<\/div>\n\n<h2>Making it observable<\/h2>\n<p><a href=\"#hetzner\">Near the start of this article<\/a> I loaded Chekhov's Gun of\nObservability. Actually, it was relatively easy for me to achieve this, because\nI already have a monitoring and alerting system running on my home server. This\nuses <a href=\"https:\/\/github.com\/louislam\/uptime-kuma\">Uptime Kuma<\/a> to send regular\nrequests and <a href=\"https:\/\/gotify.net\/\">Gotify<\/a> to ping my phone if anything goes\nwrong.<\/p>\n<p>I setup two monitors in Uptime Kuma. One just sends an ICMP ping to the Hetzner\nserver once a minute and checks that it gets a response. This ensures the\nvirtual machine is running. The other tests that Isso itself is running by\nregularly requesting the comments feed on a specific article. This also has the\nnice feature of checking the TLS certificate's expiry, so I can check renewal is\nworking as intended.<\/p>\n<div style=\"display: flex; flex-wrap: wrap; gap: 1em; max-width: 100%;\">\n  <img style=\"min-width: 0; flex: 1 1 300px;\" src=\"\/images\/uptime-hetzner-vps.png\" alt=\"Uptime Kuma monitor for Hetzner VPS\"><\/img>\n  <img style=\"min-width: 0; flex: 1 1 300px;\" src=\"\/images\/uptime-fd93-isso.png\" alt=\"Uptime Kuma monitor for Isso\"><\/img>\n<\/div>\n\n<p>For now, this only gives me monitoring capabilities and I don't really have any\nability to self-heal. Per my requirements, that doesn't really matter - this is\njust a comments server. But if I feel like it in the future, it will be pretty\neasy for me to setup Uptime Kuma to reboot my VPS via the Hetzner API.<\/p>\n<h2>Why is this article so long?<\/h2>\n<p>I wanted to illustrate the process of setting up a self-hosted instance of isso\n(or any web service) end-to-end. There are very few resources that summarize\nevery step of the process required to run a web service from design to being\nready for public consumption.<\/p>\n<p>(That includes the types of failures and annoyances that I've documented, and\nthat you only really get used to with experience.)<\/p>\n<p>Since an increasing number of people are interested in self-hosting to protect\ntheir data and avoid paying for dozens of subscriptions, I thought writing this\ntype of guide might be helpful. (Okay, technically this is not self-hosting but\nself-<em>managed<\/em> hosting, I know.)<\/p>\n<p>The process for hosting almost any web service on a VPS (or home server) is\nbasically the same as I described in the article:<\/p>\n<ol>\n<li>Find a VPS provider you're happy with and provision an instance.<\/li>\n<li>Set up a web server like Apache, Nginx, or Caddy to act as an entrypoint \/\n   reverse proxy. Make sure it's robust to failures: this nearly always means\n   running it as a systemd unit.<\/li>\n<li>Get a TLS certificate for the domain names you're interested in using to host\n   your service. Caddy and <a href=\"https:\/\/certbot.eff.org\/\">Certbot<\/a> make this really\n   simple. Configure your web server to use the certificates.<\/li>\n<li>Set up your service. Debug any issues with it. Configure your web server to\n   point to it correctly. Use a production-ready server for the service if\n   applicable. Make it robust to failures: unlike the web server, you can do\n   this through many different methods. Popular ones include systemd units,\n   process monitors like <a href=\"https:\/\/pm2.keymetrics.io\/\">pm2<\/a>, or using docker\n   containers.<\/li>\n<\/ol>\n<p>Happy hosting!<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"software"}},{"@attributes":{"term":"blog"}},{"@attributes":{"term":"webdev"}}]},{"title":"Note #5 - An Example Johnny Decimal Index (Mine)","link":{"@attributes":{"href":"https:\/\/fd93.me\/note-5-an-example-johnny-decimal-index.html","rel":"alternate"}},"published":"2026-03-07T00:00:00+08:00","updated":"2026-03-07T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2026-03-07:\/note-5-an-example-johnny-decimal-index.html","summary":"<p>In <a href=\".\/note-4-spring-cleaning-for-new-year#Adopting Johnny Decimal\">Note #4<\/a> I\nmentioned that I was adopting the Johnny Decimal system for organizing my notes.\nSo far this has gone well, and if it continues to be successful I will extend\nthis system to cover other resources besides notes, <a href=\"\">as the manual suggests<\/a>.<\/p>\n<p>I'm sharing this index in \u2026<\/p>","content":"<p>In <a href=\".\/note-4-spring-cleaning-for-new-year#Adopting Johnny Decimal\">Note #4<\/a> I\nmentioned that I was adopting the Johnny Decimal system for organizing my notes.\nSo far this has gone well, and if it continues to be successful I will extend\nthis system to cover other resources besides notes, <a href=\"\">as the manual suggests<\/a>.<\/p>\n<p>I'm sharing this index in hopes that it will be a useful example for you to\ncreate your own system. I didn't include my index in the previous post for two\nreasons:<\/p>\n<ol>\n<li>At the time of writing, I still wanted to organize the admin section of my\n   notes.<\/li>\n<li>As we'll see, a full explanation of an index would have risked making that\n   note solely about Johnny Decimal.<\/li>\n<\/ol>\n<p>As I mentioned in Note #4, the main drawback of Johnny Decimal is the upfront\ntime investment in discovering categories. I had false starts in both my\n'Projects' and 'Admin' areas by making categories too narrow, but I later got\naround this by combining various categories to bring them down to a smaller\nnumber.<\/p>\n<p>Without further ado, here is the index. I only provide a few examples on\n<a href=\"https:\/\/johnnydecimal.com\/10-19-concepts\/11-core\/11.03-ids\/\">the ID level<\/a>\nbecause some IDs are sensitive and the general structure is probably unique to\nme. I also don't include\n<a href=\"https:\/\/johnnydecimal.com\/10-19-concepts\/12-advanced\/12.03-the-standard-zeros\/\">zero indexes<\/a>\nbecause these follow the standard JD structure and are therefore uninteresting.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>- 00.00 Index\n- 10-19 Creative\n  - 11 Projects\n    - 11.11 Project Kanban\n    - 11.13 Creative Writing\n    - 11.17 Writing Kanban\n    - 11.21 Homelab\n  - 12 Media\n    - 12.11 Quotes and Excerpts\n    - 12.12 Reading\n    - 12.13 Video Games\n    - 12.14 Video\n  - 13 Beliefs\n    - 13.11 Philosophy\n    - 13.12 Cultural Theory\n    - 13.13 Reflections\n  - 14 Strategy\n    - 14.11 Business Ideas\n    - 14.12 Memos and Briefs\n- 20-29 Admin\n  - 21 Journal\n  - 22 Travel and Planning\n  - 23 Work\n  - 24 Home + Family\n  - 25 Money\n- 30-39 References and Research\n  - 31 Technology and Computer Science\n  - 32 Knowledge Management\n  - 33 Languages and Linguistics\n  - 34 Mathematics and Logic\n  - 35 Crafts\n  - 36 Philosophy and Religion\n<\/code><\/pre><\/div>\n\n<p>Okay, I lied about zero indexes: I included 00.00 Index. This is a markdown file\nwhich looks very similar to this note, but with more laconic narration. I'm\nusing the\n<a href=\"https:\/\/johnnydecimal.com\/10-19-concepts\/12-advanced\/12.02-jdex-alternative-methods\/\">single-file JDex<\/a>\nsystem to organize my categories without the burden of moving real files around.\n(To be honest, it's not that much of a burden, because I use\n<a href=\"https:\/\/github.com\/stevearc\/oil.nvim\">oil.nvim<\/a>)<\/p>\n<p>Here is a brief explanation of each category and a few observations.<\/p>\n<h2>10-19 Creative<\/h2>\n<p>'Creative' is defined very broadly to make it a useful area classification. It\nincludes mostly <em>things I create<\/em> as well as what would often be called\nhumanities.<\/p>\n<h3>11 Projects<\/h3>\n<p>Self-explanatory. This stores the projects that I am working on and information\nrelating to each of them. <code>11.11 Project Kanban<\/code> uses\n<a href=\"https:\/\/codeberg.org\/fd93\/plainban\">plainban<\/a> to record ideas and progress. I\nalso use plainban for tracking the progress of different articles in\n<code>11.17 Writing Kanban<\/code><\/p>\n<h3>12 Media<\/h3>\n<p>This stores details of my media consumption such as my reading journal, video\ngames I might have an interest in playing, movies and TV series, etc.<\/p>\n<h3>13 Beliefs<\/h3>\n<p>This stores my <em>personal<\/em> beliefs about topics such as philosophy and religion.\nThis should be distinguished from the material in 30-39 References and Research,\nwhich is more objective and focused on other people's beliefs.<\/p>\n<p>The most interesting category in here is probably 13.13 Reflections. Before I\nreorganized using the JD system, this was stored under <code>journal\/personal<\/code>, but\nthe ambiguity that this introduces is a big problem.<\/p>\n<p>What is a journal? Is it a daily logbook or a space for personal reflections, or\nboth? This is a problem because I probably want to look back at my reflections,\nbut I don't care so much to look at which chores I did on such-and-such a date.<\/p>\n<p>To overcome this problem, I separated the two into completely different areas of\nthe index.<\/p>\n<h3>14 Strategy<\/h3>\n<p>This contains creative thoughts <em>about<\/em> business, operations concepts, project\nmanagement, finance and so on. It's for material <em>about<\/em> administration rather\nthan material <em>used for<\/em> administration, which is stored in 20-29. The most\nrepresentative category is probably 14.12 Memos and Briefs, which has high-level\n(strategic, natch) planning for various business and administrative tasks I need\nto do.<\/p>\n<p>Once a project crosses from 'should I do this?' and 'what am I doing?' to 'which\ntasks need to be performed?' it can happily move across to 20-29.<\/p>\n<h2>20-29 Admin<\/h2>\n<p>The admin area is about things that happen in the real world. Groceries,\nfinances, travel plans and all that.<\/p>\n<p>The largest category by far is 21 Journal, which contains every daily, weekly,\nmonthly, and yearly note I've created since 2023. Because this is a very large\ncategory - and has inherent <em>chronological<\/em> organization using\n<a href=\"https:\/\/codeberg.org\/fd93\/daily-notes.nvim\">daily-notes.nvim<\/a> - I deviated from\nthe Johnny Decimal system to create my own structure, which looks like this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>- 21 Journal\n  - 2023 (YYYY)\n    - daily\n      - 2023-01-01.md (YYYY-MM-DD)\n    - monthly\n      - 2023-01.md (YYYY-MM)\n    - weekly\n      - 2023-week-01.md (YYYY-week-WW)\n    - 2023.md (YYYY)\n<\/code><\/pre><\/div>\n\n<p>Note that this type of deviation is actually accounted for\n<a href=\"https:\/\/johnnydecimal.com\/10-19-concepts\/11-core\/11.06-saving-files\/#sorting-by-year-month\">in 11.06 of the Johnny Decimal guide<\/a>.<\/p>\n<p>I prefer this type of layout to the common <code>YYYY\/MM\/DD.md<\/code> structure for two\nreasons:<\/p>\n<ol>\n<li>It provides a space for week-of-year notes, which follow a different format\n   to what the typical nested scheme implies.<\/li>\n<li>It separates notes by <em>type<\/em> instead of <em>date<\/em> as such. Notes for a day\n   inherently have a different structure to notes for a week, and plans for a\n   quarter or a year are likely to be even more high-level. In fact, <em>The 7\n   Habits of Highly Effective People<\/em> argues against using daily notes at all.<\/li>\n<\/ol>\n<p>Since the other categories in Admin are self-explanatory, I won't go into more\ndepth here.<\/p>\n<h2>30-39 References and Research<\/h2>\n<p>This is a category that's designed for holding in-depth information such as\ncourse notes, lists of learning materials, and web clippings. Note that I don't\ndivide my notes by the traditional academic schools or faculties (humanities,\nsciences, arts, etc). There are two reasons for this:<\/p>\n<p>First, it's unlikely that I'm really interested in more than 9 broad categories;\neven developing a full systematic philosophy reference would easily exceed\nJohnny Decimal's soft limit of 99 IDs.<\/p>\n<p>Second, I've always been very interdisciplinary, and oppose separating STEM from\nthe arts. Many interesting connections come about by having dialogue and\nrelationships between different subjects. In fact, I might re-organize these\ncategories in the future to deliberately mix together technology and arts\ntopics.<\/p>\n<p>What is a bit puzzling about this area is where exactly it starts and ends. An\naccounting textbook clearly lives here. But what about my notes on how to use\n<a href=\"https:\/\/github.com\/beancount\/beancount\">beancount<\/a>, which could feasibly live\nhere, in 25 Money, or even in 14 Strategy?<\/p>\n<p>I think this will probably be something that needs to be decided on a\ncase-by-case basis and recorded in a decision log - perhaps as part of the index\nitself. This is part of the\n<a href=\"https:\/\/johnnydecimal.com\/10-19-concepts\/11-core\/11.08-the-librarian\/\">Librarian<\/a>\nrole described on the Johnny Decimal website, and seems like a useful complement\nto the system itself.<\/p>\n<h2>Final Thoughts<\/h2>\n<p>Johnny Decimal is a smooth character, and I find he insinuates himself into\nparts of my file system I didn't expect.<\/p>\n<p>I reorganized my work notes and found that it becomes natural to stash release\nartifacts alongside release notes, which I would not do without a filing system.<\/p>\n<p>For now, at least, the JD system has helped tame some of my chaotic excesses and\nirresponsibility in managing knowledge and data.<\/p>","category":{"@attributes":{"term":"notes"}}},{"title":"Note #4 - Spring Cleaning for New Year","link":{"@attributes":{"href":"https:\/\/fd93.me\/note-4-spring-cleaning-for-new-year.html","rel":"alternate"}},"published":"2026-02-28T00:00:00+08:00","updated":"2026-02-28T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2026-02-28:\/note-4-spring-cleaning-for-new-year.html","summary":"<p>Chinese New Year ended a week ago. \u65b0\u5e74\u5feb\u6a02\uff01There are many traditions\nassociated with the New Year, some of which are widely known: fireworks, gifting\nof <em>hongbao<\/em>, and playing loud music\n<a href=\"https:\/\/blog2.huayuworld.org\/huahuafun\/2014\/01\/15\/the-story-of-the-monster-nian\/\">to scare away Nian<\/a>.<\/p>\n<p>One less known New Year tradition is <em>spring cleaning<\/em>, which removes bad \u2026<\/p>","content":"<p>Chinese New Year ended a week ago. \u65b0\u5e74\u5feb\u6a02\uff01There are many traditions\nassociated with the New Year, some of which are widely known: fireworks, gifting\nof <em>hongbao<\/em>, and playing loud music\n<a href=\"https:\/\/blog2.huayuworld.org\/huahuafun\/2014\/01\/15\/the-story-of-the-monster-nian\/\">to scare away Nian<\/a>.<\/p>\n<p>One less known New Year tradition is <em>spring cleaning<\/em>, which removes bad luck,\nnegative energy, and evil spririts from the household.<\/p>\n<p>Most people will travel to reunite with their extended family in the New Year\nperiod, in much the same way as Christmas or Thanksgiving. As a foreigner I do\nnot have extended family nearby to visit, so I usually have a lot of free time.\nThe last few years I burned my vacation time by working on side projects, but\nthis year I went travelling with my partner and restricted myself to 'spring\ncleaning' existing projects.<\/p>\n<h2>Adopting Johnny Decimal<\/h2>\n<p>I've been using plaintext note-taking tools for a few years, starting with\nObsidian and later migrating to NeoVim and bespoke tools.<\/p>\n<p>One repeated frustration I have had with my notes is how to organize them\nefficiently. Given I have an MA in a humanities subject (Digital Culture) you\nwould think I'd already be good at this. Not so - it turns out Information\nScience is a complex subject, which I am very far from mastering.<\/p>\n<p>I got through my MA using Evernote notebooks, which have the main advantage that\nthey're ordered by date and can be tagged. Tags are flexible and easy to query,\nbut lead to various frustrations:<\/p>\n<ul>\n<li>Tags tend to ambiguity and repetition: should my meal plan be <code>#groceries<\/code> or\n  <code>#cooking<\/code> or <code>#home<\/code> or all three?<\/li>\n<li>Without a strict indexing scheme and frequent maintenance, you end up with\n  duplicate tags like <code>#groceries<\/code>, <code>#grocery<\/code>, and <code>#food<\/code>.<\/li>\n<li>Even if you have a strict tag indexing scheme, you have accepted the burden of\n  maintaining this\n  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ontology_(information_science)\">ontology<\/a>\n  indefinitely.<\/li>\n<\/ul>\n<p>Tags are a good fit for a metadata and hypertext based system like Evernote, or\nthe <a href=\"https:\/\/zettelkasten.de\/overview\/\">Zettelkasten<\/a> method. But I am a busy,\nlazy and chaotic note-taker, so I never bother to maintain those systems. In\nparticular, I tend to end up with 10 different index pages (or\n<a href=\"https:\/\/notes.linkingyourthinking.com\/Cards\/MOCs+Overview\">Map of Contents<\/a>)\nsplit across 5 folders, none of which I actually use.<\/p>\n<p>Clearly I needed a lower-maintenance system. Enter\n<a href=\"https:\/\/johnnydecimal.com\/\">Johnny Decimal<\/a>, a more traditional cataloguing\nsystem. Rather than relying on metadata stored in notes, Johnny Decimal (JD)\nrelies on numerical indexing and has a single index file at <code>00.00 Index<\/code>.<\/p>\n<p>Johnny Decimal allows for some deviations from its structure. This was helpful\nfor me because I maintain a journal using\n<a href=\"https:\/\/codeberg.org\/fd93\/daily-notes.nvim\">daily-notes.nvim<\/a>, which is ordered\nbut not according to any Zettelkasten or decimal scheme.<\/p>\n<p>The nice thing about Johnny Decimal is that most of the time investment seems to\nbe up-front, in planning areas and categories. Unlike tag-based systems, there\nis limited ongoing maintenance and my notes stay organized.<\/p>\n<h2>Neovim Improvements<\/h2>\n<p>As a result of adopting Johnny Decimal, I saw that my NeoVim configuration could\nbe improved.<\/p>\n<p>I've made some improvements to my NeoVim setup for note-taking and organization.\nThese have not been incorporated into\n<a href=\"https:\/\/codeberg.org\/fd93\/freak.nvim\">freak.nvim<\/a> because they use too many\nexternal tools and plugins, but I may provide writing tools as some sort of\n'add-on' pack.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/fdavies93\/daily-notes.nvim\/issues\/3\">Added navigation starting from a given file<\/a>,\n  not the system date, to daily-notes.nvim<\/li>\n<li>Wrote a custom <a href=\"https:\/\/github.com\/nvim-mini\/mini.pick\">mini.pick<\/a> picker\n  which selects from oldfiles, so that I can get back to recent files easily\n  even if I don't remember their name.<\/li>\n<li>Restored use of <a href=\"https:\/\/github.com\/artempyanykh\/marksman\">marksman<\/a> in my LSP\n  config so that I can use internal links between notes, get backlinks, etc.<\/li>\n<li>Reinstalled <a href=\"https:\/\/github.com\/folke\/zen-mode.nvim\">zen-mode<\/a>. It doesn't\n  really affect my ability to focus but I like its ability to center the current\n  note.<\/li>\n<\/ul>","category":{"@attributes":{"term":"notes"}}},{"title":"Note #3 - Reading Byung-Chul Han","link":{"@attributes":{"href":"https:\/\/fd93.me\/note-3-reading-byung-chul-han.html","rel":"alternate"}},"published":"2025-10-11T00:00:00+08:00","updated":"2025-10-11T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-10-11:\/note-3-reading-byung-chul-han.html","summary":"<p>Last weekend, my partner and I visited a second-hand bookstore and I bought two\nbooks: <em>How to Write Short<\/em> by Roy Peter Clark, and <em>The Pleasures of Reading in\nan Age of Distraction<\/em> by Alan Jacobs. I passed over higher-minded alternatives\nlike Piketty's <em>Capital in the 21st Century<\/em>; I prefer \u2026<\/p>","content":"<p>Last weekend, my partner and I visited a second-hand bookstore and I bought two\nbooks: <em>How to Write Short<\/em> by Roy Peter Clark, and <em>The Pleasures of Reading in\nan Age of Distraction<\/em> by Alan Jacobs. I passed over higher-minded alternatives\nlike Piketty's <em>Capital in the 21st Century<\/em>; I prefer to read books I buy, and\nthe most similar book I've read to Piketty's <em>Capital<\/em>, Shoshana Zuboff's <em>The\nAge of Surveillance Capitalism<\/em>, has lain half-read in my Calibre library\nsince 2020.<\/p>\n<p>This is a bad habit of mine - buying virtuously weighty academic books which I\nnever touch and then reading P.G. Wodehouse or John le Carre instead. I've\nbecome more self-aware about this habit since my early twenties, and have\nresolved to never buy books which I won't read.<\/p>\n<p>Skipping books I feel I <em>ought<\/em> to read in favour of books I actually <em>want<\/em> to\nread is probably an attitude Alan Jacobs would approve of. His <em>The Pleasures of\nReading in the Age of Distraction<\/em> is an excellent short work on the attitudes\nwhich people have towards reading and their origins. Jacobs begins by discussing\nwhat he calls the 'self-improvement model of reading', which he holds is the\nmost common American approach. In this model, reading (especially so-called\ngreat works) is morally and intellectually improving, and so it is the reader's\nsolemn duty to ensure they read a lot of books of the highest quantity possible.<\/p>\n<p>He goes on to discuss the various issues with the 'self-improvement' model of\nreading, while acknowledging that reading for education or for information makes\nsense in many contexts. He also presents alternative models of reading. Two of\nthese are interesting to me.<\/p>\n<p>The first is reading 'on whim': i.e. reading whatever brings you pleasure,\nwithout regard for its impact on your moral character. I agree with Jacobs that\nthis is preferable to scoring yourself on the virtue of your reading habits;\nthat turns reading into a competition, where those who've read the most widely\nand deeply (or are the best at lying about it) get to carry conversation at\ndinner parties. If reading at its best is a sacred act, then reducing it to a\nvehicle for social capital is heretical.<\/p>\n<p>The second model Jacobs presents is deep reading. This is the type of reading I\nlearned and specialized in at college. It's also necessary for reading poetry,\nphilosophy, and more challenging works of literature. In deep reading, you need\nto take time over specific passages of a work to grasp them in their entirety,\nbut your reward is greater understanding of and connection to the work. It took\nKant ten years to write <em>The Critique of Pure Reason<\/em>, and to roughly understand\nit will take a determined reader at least one.<\/p>\n<p>This reminder of the many ways to read a book was invaluable in completing\nanother book which I've worked on for around a month:\n<a href=\"https:\/\/www.goodreads.com\/book\/show\/61723660-the-philosophy-of-zen-buddhism\">Byung-Chul Han's <em>The Philosophy of Zen Buddhism<\/em><\/a>.<\/p>\n<p>I've been interested in reading Han's work since Stephen West covered him on\n<a href=\"https:\/\/www.philosophizethis.org\/podcast\"><em>Philosophize This<\/em><\/a>. Since I have\n<a href=\"https:\/\/fd93.me\/four-books-on-zen-buddhism\">recently been reading works on Zen<\/a>,\nI decided to tackle <em>The Philosophy of Zen Buddhism<\/em> first: it's a short work\nand I thought it would be a good way into Han's thought. Not so much.<\/p>\n<p>I should have been warned by Stephen's description of Han's writing process; Han\nwrites brief monographs over long periods of time. <em>The Philosophy of Zen\nBuddhism<\/em> is 105 pages of simple language, but cannot be read casually. This is\nbecause the work is essentially a literature review which reads numerous (mostly\nGerman) Western philosophers' views against Zen works on the same topics.<\/p>\n<p>As such, the actual arguments being presented and compared can be a challenge to\nfollow: on the average page we whip breathlessly from a haiku by Basho to\nHeidegger's concept of Dasein and back again. The top review on Goodreads says:<\/p>\n<blockquote>\n<p>Imagine writing a small introduction book on the philosophy of zen buddhism,\nand making it so that the only people who can understand what you are saying\nare a) philosophy grad students and b) people who already know quite a bit\nabout zen buddhism.<\/p>\n<\/blockquote>\n<p>To be fair, Han never claims he's writing a general introduction to Zen. In the\npreface he instead writes:<\/p>\n<blockquote>\n<p>The present study is designed as a 'comparative' one. The philosophies of\nPlato, Leibniz, Fichte, Hegel, Schopenhauer, Nietzsche, Heidegger and others\nwill be confronted with the insights of Zen Buddhism. The comparative approach\nis a method for disclosing meaning.<\/p>\n<\/blockquote>\n<p>The book is not an introductory text; it's a series of well-argued corrections\nto misinterpretations of Buddhism by Western philosophy, and clarifications of\ndifference from Western thinkers who are often equated with Buddhist thought\n(e.g. Schopenhauer, Meister Eckhart). It is structured according to the core\nconcerns of <em>Buddhism<\/em> rather than European philosophy, and tends to favour the\nBuddhist perspective over the Western one. Therefore, sections of the book are\ncalled <em>Emptiness<\/em>, <em>No One<\/em>, <em>Death<\/em>, and so on.<\/p>\n<p>The real value of this work is in drawing distinctions between concepts that are\noften equated, which is tough to do in religious philosophy, especially when\ndiscussing concepts that are not clearly outlined in philosophical language.\nThis is exactly the kind of succinct text which Jacobs has in mind for close\nreading and re-reading.<\/p>\n<p><em>The Philosophy of Zen Buddhism<\/em> is in some ways a better-argued version of the\ncore thesis of <em>God is Not One<\/em> by Stephen Prothero, which is that the concept\nof a monomyth flattens religious diversity. While I think Prothero missed the\ncore point of monomyth theory - that <em>phenomenologically<\/em> religious experiences\nresemble each other - Han very successfully argues that European philosophy and\nZen Buddhism cannot easily be equated, even on the level of experience.<\/p>\n<p>I probably did not give <em>The Philosophy of Zen Buddhism<\/em> the space it needs to\nbe fully understood, but at the same time I found it an interesting and useful\nwork. For now, I will move on, but it's a valuable addition to my growing Zen\nlibrary and I hope to revisit it in the unknowable future:<\/p>\n<blockquote>\n<p>Some books should be tasted, some devoured, but only a few should be chewed\nand digested thoroughly.<\/p>\n<\/blockquote>","category":{"@attributes":{"term":"notes"}}},{"title":"Note #2: Week 39 in Review","link":{"@attributes":{"href":"https:\/\/fd93.me\/note-2-weekly-review-w39-2025.html","rel":"alternate"}},"published":"2025-09-28T00:00:00+08:00","updated":"2025-09-28T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-09-28:\/note-2-weekly-review-w39-2025.html","summary":"<p>Due to <a href=\"note-1-weekly-review-w38-2025\">my accelerated AWS study schedule<\/a> I\nhaven't had much time to work on projects this week, other than some\nself-hosting maintenance. Instead, I spent some time eyeballing the game\nlaunches coming out this month:<\/p>\n<ul>\n<li>Hollow Knight: Silksong<\/li>\n<li>Final Fantasy Tactics: The Ivalice Chronicles<\/li>\n<li>Hades 2<\/li>\n<\/ul>\n<p>All are great \u2026<\/p>","content":"<p>Due to <a href=\"note-1-weekly-review-w38-2025\">my accelerated AWS study schedule<\/a> I\nhaven't had much time to work on projects this week, other than some\nself-hosting maintenance. Instead, I spent some time eyeballing the game\nlaunches coming out this month:<\/p>\n<ul>\n<li>Hollow Knight: Silksong<\/li>\n<li>Final Fantasy Tactics: The Ivalice Chronicles<\/li>\n<li>Hades 2<\/li>\n<\/ul>\n<p>All are great games for handheld, which is unfortunate. I have a Switch but\ndon't buy many games for it because Nintendo\n<a href=\"https:\/\/en-americas-support.nintendo.com\/app\/answers\/detail\/a_id\/63227\/~\/announcement-of-discontinuation-of-online-services-for-nintendo-3ds-and-wii-u\">has a history of pulling support for previous generations<\/a>.<\/p>\n<p>I don't want a Windows handheld due to the high price and worse user experience.\n(Bazzite fixes the UX problem, but not the hardware pricing.) I also have\ncomically small hands - a friend is 6 inches shorter than me and our hands are\nthe same size - so the Steam Deck feels unwieldy.<\/p>\n<p>Tragically, the Switch is what I'll be playing these on. I think the pro gamer\nstrategy is to buy now for Switch and wait for them to go on sale for PC. Switch\ngames famously never go on sale, while PC ones regularly appear on 90%\ndiscounts.<\/p>\n<h2>Cool Stuff from the Web<\/h2>\n<p>I've been using <a href=\"https:\/\/github.com\/BestImageViewer\/geeqie\">geeqie<\/a> for\norganizing slides from Adrian's videos. I love its bulk renaming feature,\nbecause it enables a very efficient way to study:<\/p>\n<ol>\n<li>Watch videos and take notes on my Kobo. Why not in NeoVim? See\n   <a href=\"https:\/\/fd93.me\/notebooks-thinking-better-thoughts\">On Notebooks and Thinking Better Thoughts<\/a>.\n   Using a notebook forces me to take <em>less<\/em> notes, which means I have to\n   concentrate on what the slides say and don't say.<\/li>\n<li>Use <a href=\"https:\/\/flameshot.org\/\">flameshot<\/a> to take screen captures, dump them\n   into a folder for a section of the course.<\/li>\n<li>Flip through the images I collected at the end of a section and rename them\n   to things that make sense (e.g. <code>dns-1.png<\/code>).<\/li>\n<li>Combine the slides with my notes for later review. Bonus: creating this\n   document is a form of review in itself.<\/li>\n<\/ol>\n<p>Also,\n<a href=\"https:\/\/aws.amazon.com\/blogs\/devops\/aws-cloud-development-kit-cdk-launches-refactor\/\">AWS launched refactoring<\/a>\nas part of CDK, which should greatly simplify making stack changes in\nCloudformation. This is huge for my work, which involves dealing with dozens of\nCFN stacks, but less exciting if you don't happen to be an AWS admin.<\/p>\n<h2>Project Updates<\/h2>\n<h3>misc<\/h3>\n<p>I noticed that my <a href=\"https:\/\/immich.app\/\">immich<\/a> backups to the home server were\nfailing. It turned out this was because I was running 1.131.0 when the latest\nrelease is 1.142.0, and there was a database format change between these\nversions.<\/p>\n<p>One thing led to another and through sheer incompetence I managed to corrupt my\nlibrary. Fixing my snapshots last week was a good plan. In the end it turned out\nI corrupted my <em>database<\/em>. Luckily, immich is designed for robustness and stores\ndatabase dumps on a daily basis. I restored the database, downgraded to\n<code>1.131.0<\/code>, and all was good.<\/p>\n<p>Then, I actually read the manual and upgraded via 1.133.0 to the latest release.\nThis worked and I can now back up from my phone again.<\/p>","category":{"@attributes":{"term":"notes"}}},{"title":"Note #1: Week 38 in Review","link":{"@attributes":{"href":"https:\/\/fd93.me\/note-1-weekly-review-w38-2025.html","rel":"alternate"}},"published":"2025-09-21T00:00:00+08:00","updated":"2025-09-21T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-09-21:\/note-1-weekly-review-w38-2025.html","summary":"<p>This week I've spent most of my free time studying for the AWS Solutions\nArchitect Associate exam using the\n<a href=\"https:\/\/learn.cantrill.io\/\">excellent courses from Adrian Cantrill<\/a>.<\/p>\n<p>However, my timeline for taking the exam is pretty tight (my choice), so I've\nhad to switch up my study approach. Initially I was listening to \u2026<\/p>","content":"<p>This week I've spent most of my free time studying for the AWS Solutions\nArchitect Associate exam using the\n<a href=\"https:\/\/learn.cantrill.io\/\">excellent courses from Adrian Cantrill<\/a>.<\/p>\n<p>However, my timeline for taking the exam is pretty tight (my choice), so I've\nhad to switch up my study approach. Initially I was listening to each video,\nstopping it here and there, and taking detailed notes. This approach is probably\nbetter for retention, but it doesn't work with my timelines because the Cantrill\ncourses have over 70 hours of footage. Also, a lot of the content in the course\nis on topics I already have some experience with, since I use AWS extensively in\nmy day job.<\/p>\n<p>So I've switched to more of a university-lecture style approach, where I listen\nto the videos at 1.25x speed and take notes only on what's not covered in the\nslides. I'm also planning to double my study time so that I have more time to\nstudy and review as the exam gets closer.<\/p>\n<h2>Cool Stuff from the Web<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.gartner.com\/en\/articles\/hype-cycle-for-artificial-intelligence\">Gartner published a report<\/a>\n  confirming that GenAI has passed peak hype, mainly due to underwhelming ROI in\n  businesses. It remains to be seen what impact, if any, this will have on\n  planned data center and chip investments. At the same time, it points to\n  widespread use of AI for software development. Given rising token costs for\n  the big providers are inevitable, I'll be interested to see if businesses\n  start to run models in-house.<\/li>\n<li>In security,\n  <a href=\"https:\/\/www.crowdstrike.com\/en-us\/cybersecurity-101\/identity-protection\/non-human-identities\/\">non-human identities<\/a>\n  seem to be trending as a topic. Long-lived non-human credentials are an\n  interesting risk factor, particularly as many automated systems have elevated\n  permissions compared to normal users. Also in security,\n  <a href=\"https:\/\/www.ibm.com\/think\/topics\/sbom\">software bills of materials<\/a> have\n  become a hot topic due to\n  <a href=\"https:\/\/tane.dev\/2025\/09\/oh-no-not-again...-a-meditation-on-npm-supply-chain-attacks\/\">a massive increase in supply chain attacks<\/a>,\n  many of them through NPM.<\/li>\n<li>Finally, it's not new but I've found\n  <a href=\"https:\/\/github.com\/microsoft\/markitdown\">markitdown<\/a> really helpful for\n  turning HTML notes from my Kobo into a format that's easy to review and\n  integrate with videos and images.<\/li>\n<\/ul>\n<h2>Project Updates<\/h2>\n<h3>fd93.me<\/h3>\n<ul>\n<li>Realized that I only needed to make some small tweaks to the site's theme to\n  separate short articles from the main feed. This is exciting because it means\n  <a href=\"note-0-what-are-notes\">I'm more able to write short notes on various topics<\/a>\n  than I have been in the past.<\/li>\n<li>Figured the site's theme was looking a bit dated and doesn't work great on\n  mobile. <del>Plagiarized<\/del> Took inspiration from various sites around the\n  web to come up with a new design, which I'll implement eventually.<\/li>\n<li><a href=\"https:\/\/cloudbytes.dev\/snippets\/clean-urls-in-pelican-sitemap-using-python\">Fixed sitemap rendering<\/a>\n  after Google kept telling me they couldn't find most of the pages on the site.\n  This is a long-standing issue but I didn't care about it until I noticed it\n  meant some articles are totally invisible to search engines.<\/li>\n<\/ul>\n<h3>plainban<\/h3>\n<ul>\n<li>Started refactoring the data model in a few different ways. The main change is\n  keeping the order tickets are displayed in column metadata, which involves\n  placing a <code>data.yml<\/code> file in each column \/ folder.<\/li>\n<li>Changed metadata in YAML header of tickets to use <code>plainban<\/code> prefix: e.g.\n  <code>name<\/code> is now <code>plainban.name<\/code>. This should help avoid namespace collisions\n  with other programs, like static site generators, that people might want to\n  have a YAML header for.<\/li>\n<li>Added a feature to create a <code>.keep<\/code> file in each column \/ folder by default.\n  This is a simple hack to force git to maintain column structure when\n  committing kanbans to a repository. However, it will be made obselete by the\n  new <code>data.yml<\/code> file.<\/li>\n<\/ul>\n<h3>misc<\/h3>\n<ul>\n<li>Fixed restic backups on my home server. As with many backup and hosting issues\n  this was a file permissions problem - restic wasn't allowed to read certain\n  files in my git repositories. Actually, the backup was running fine, but my\n  script assumed that non-zero exit codes indicated a failure. This meant I was\n  getting failure alerts twice a day for a few weeks, but changing the file\n  permissions and testing only took 20 minutes or so in the end.<\/li>\n<\/ul>","category":{"@attributes":{"term":"notes"}}},{"title":"Note #0 - What are Notes, Frank?","link":{"@attributes":{"href":"https:\/\/fd93.me\/note-0-what-are-notes.html","rel":"alternate"}},"published":"2025-09-20T00:00:00+08:00","updated":"2025-09-20T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-09-20:\/note-0-what-are-notes.html","summary":"<p>I bought the domain <code>fd93.me<\/code> in 2021, not long after I moved to Asia.\nOriginally it was a Wordpress site hosted on AWS Lightsail, but I got tired of\nthe complexity of Wordpress for actually writing. See\n<a href=\"\/simple-sites\">The Unreasonable Effectiveness of Simple Websites<\/a>, which was\nitself inspired by No \u2026<\/p>","content":"<p>I bought the domain <code>fd93.me<\/code> in 2021, not long after I moved to Asia.\nOriginally it was a Wordpress site hosted on AWS Lightsail, but I got tired of\nthe complexity of Wordpress for actually writing. See\n<a href=\"\/simple-sites\">The Unreasonable Effectiveness of Simple Websites<\/a>, which was\nitself inspired by No Boilerplate's\n<a href=\"https:\/\/www.youtube.com\/watch?v=WgV6M1LyfNY\">The Unreasonable Effectiveness of Plain Text<\/a>.<\/p>\n<p>At first I was focused on studying Chinese and on some study tips for doing that\nmore effectively, but as I've drifted back into the tech industry, my content\nhas become more technical. At the same time, writing articles that fit into the\ngeneral category is pretty time-consuming!<\/p>\n<p>For articles in the general category, I want to provide a good amount of depth\nand look at topics that aren't widely covered elsewhere. The only real way to do\nthis is to work on a project or to do a deep dive into academic or technical\ncontent, which is time-consuming. It also takes a lot of time to copy-edit these\narticles because I want them to have a certain level of polish, need to find\ngood cover pictures, and make sure I have links to other relevant topics. These\narticles often run to several thousand words at first draft, meaning it takes me\nsomewhere between 8 and 24 hours to go from initial idea to what you see.<\/p>\n<p>Since I'm not a full-time writer, this limits how much I'm able to publish. It\nalso stops me from writing some of the things I'd really like to, like updates\non my <a href=\"\/pages\/project-index\">various projects<\/a> or reviews of books that don't\nfit into a coherent theme like\n<a href=\"\/four-books-on-zen-buddhism\">Four Books on (Zen) Buddhism<\/a>. Finally, it forces\nme to choose between publishing on the blog and working on other projects like\n<a href=\"https:\/\/codeberg.org\/fd93\/plainban\">plainban<\/a>.<\/p>\n<p>A lot of the time I want to write content which is shorter than a magazine-style\narticle, but longer than a Mastodon post. This is the kind of work I'll put into\nnotes. Some examples of things that are a good fit for notes, but don't justify\na full article:<\/p>\n<ul>\n<li>Reviews of software, books, games, etc.<\/li>\n<li>More personal writing which doesn't fit neatly into a magazine-style article.<\/li>\n<li>Journal-style updates on personal projects.<\/li>\n<li>Link collections around particular topics (I might make pages for these,\n  though).<\/li>\n<li>Meta topics about the site itself (like this one!).<\/li>\n<\/ul>\n<p>Since notes are probably still interesting to people, they're still going to hit\nthe RSS feed, and in time I'm planning to change the theme of this site to make\nnotes a bit more prominent. But for now, you can find notes from site\nnavigation.<\/p>\n<p>Hope that regular readers appreciate this change and the more frequent updates\nI'll be able to make in the near future!<\/p>","category":{"@attributes":{"term":"notes"}}},{"title":"The Most Minimal Kanban","link":{"@attributes":{"href":"https:\/\/fd93.me\/minimal-kanban.html","rel":"alternate"}},"published":"2025-08-31T00:00:00+08:00","updated":"2025-08-31T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-08-31:\/minimal-kanban.html","summary":"<p><img alt=\"\" src=\"\/images\/kanban-whiteboard.jpg\"><\/p>\n<p>Sometimes I feel overwhelmed trying to manage everything I have to do. Lists\nwork okay if they're short, but grow out of control and fuel new anxieties: <em>am\nI failing to stay on top of things?<\/em> Writing a daily agenda lets me get a ton of\nthings done, but burns \u2026<\/p>","content":"<p><img alt=\"\" src=\"\/images\/kanban-whiteboard.jpg\"><\/p>\n<p>Sometimes I feel overwhelmed trying to manage everything I have to do. Lists\nwork okay if they're short, but grow out of control and fuel new anxieties: <em>am\nI failing to stay on top of things?<\/em> Writing a daily agenda lets me get a ton of\nthings done, but burns me out; I feel like I'm a robot executing my past plans.\nAs an alternative, I've started experimenting with kanban as a more humane way\nto manage my long-running tasks.<\/p>\n<p><a href=\"https:\/\/kanbanguides.org\/\"><em>Kanban<\/em><\/a> is a process management approach which\nfocuses on creating a smooth flow of work items through a process. Work items\nare tasks like writing an article or adding a software feature. It's common to\nuse a <em>kanban board<\/em> to visualize the way work items move through the kanban\nprocess. A kanban board has a number of <em>columns<\/em>, which match stages of some\nprocess. When writing an article, the work item might move from ideation, to\nresearch, to draft, to editing, and finally to publishing and distribution.<\/p>\n<p>Many software solutions exist to implement kanban, such as\n<a href=\"https:\/\/trello.com\/\">Trello<\/a> to\n<a href=\"https:\/\/github.com\/mgmeyers\/obsidian-kanban\">Obsidian Kanban<\/a> or the minimal\n<a href=\"https:\/\/github.com\/coderofsalvation\/kanban.bash\">kanban.bash<\/a>.<\/p>\n<p>I've used all three tools, but found them lacking. The main reason is that they\nrequire\n<a href=\"https:\/\/www.atlassian.com\/blog\/productivity\/context-switching\">context switching<\/a>.\nI spend most of my time with a computer on the command line, either editing text\nin Neovim or running code with some interpreter. Switching to a browser and\nlogging into a company portal takes long enough to break my focus on my current\ntask.<\/p>\n<p>The other problem with most kanban software is the use of non-portable data\nformats. Trello supports JSON and CSV export, but the exported data isn't usable\nin other software. kanban.bash uses a hidden folder with CSV data, but makes it\nhard to centrally manage more than a single kanban board. Obsidian Kanban uses\nMarkdown, but won't display as a kanban without the plugin - locking you into\nusing Obsidian.<\/p>\n<p>I wanted an approach which I could use from the command line, with a portable\ndata format. To do this I decided on a couple of design guidelines:<\/p>\n<ul>\n<li>No complex scripting or programming: every operation must be possible with\n  popular Linux tools. This is to avoid lock-in and make it simple to prototype.\n  Writing a complex program defeats the point of the exercise.<\/li>\n<li>Any data stored must be plain-text and integrated into a document. This is\n  because introducing a database, custom markdown extensions, or even a csv file\n  makes backup and file management more complex. It also reduces\n  interoperability with normal file system operations and makes it harder to\n  share my files with other people.<\/li>\n<\/ul>\n<h2>A Minimal Kanban<\/h2>\n<p>To build the kanban board, we can use the native layout of the file system.\nFirst, we create some folders using <code>mkdir<\/code> or our native file manager. These\nare the 'columns' of our kanban:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>- kanban\/\n  - 00-icebox\/\n  - 01-todo\/\n  - 02-in-progress\/\n  - 03-done\/\n  - 04-cancelled\/\n<\/code><\/pre><\/div>\n\n<p>Next, we create some work items inside each directory. I used\n<a href=\"https:\/\/www.markdownguide.org\/getting-started\/\">markdown<\/a> files but these can\nbe any file type - they don't even need to be text files.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>- kanban\/\n  - 00-icebox\/\n    - update-accounting-books.md\n  - 01-todo\/\n    - finish-migration.md\n    - write-a-paper.md\n  - 02-in-progress\/\n  - 03-done\/\n  - 04-cancelled\/\n<\/code><\/pre><\/div>\n\n<p>When we want to update a work item's status, we just move the file. For example,\nmoving <code>write-a-paper.md<\/code> to in-progress:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>- kanban\/\n  - 00-icebox\/\n    - update-accounting-books.md\n  - 01-todo\/\n  - 02-in-progress\/\n    - finish-migration.md\n    - write-a-paper.md\n  - 03-done\/\n  - 04-cancelled\/\n<\/code><\/pre><\/div>\n\n<p>This approach was inspired by my very brief experience working in video\nproduction. We'd lay out video clips according to which stage of the process\nthey were at, with a folder structure like:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>- project\n  - 00-rushes\n  - 01-scenes\n  - 02-videos\n<\/code><\/pre><\/div>\n\n<p>As is common in the video production industry, we used MacOS on all our editing\nmachines. MacOS Finder has\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Miller_columns\">Miller Columns<\/a> as a first-order\nfeature, and they're a great way to visualise this type of workflow. But any\nfile manager with a tree or column view can be used, on any operating system. To\nprove it, here's some Linux examples. For the GUI, I use\n<a href=\"https:\/\/github.com\/elementary\/files\">Elementary Files<\/a> (aka Marlin; Pantheon\nFiles) which is very similar to Finder.<\/p>\n<h3>Kanban Gallery<\/h3>\n<div style=\"display: flex; flex-direction: column; gap: 1em;\">\n\n  <div style=\"display: flex; flex-direction: column; align-items: center; gap: 0.5em;\">\n      <img src=\"\/images\/kanban-tree.png\" style=\"width: 500px;\"><\/img>\n      <span style=\"font-size: 10pt; justify-content: center;\">Using the CLI and tree is the most powerful option, but requires familiarity with working on a terminal.<\/span>\n  <\/div>\n\n  <div style=\"display: flex; flex-direction: column; align-items: center; gap: 0.5em;\">\n      <img src=\"\/images\/kanban-ranger.png\" style=\"width: 500px;\"><\/img>\n      <span style=\"font-size: 10pt; justify-content: center;\">TUI tools like <a href=\"https:\/\/github.com\/ranger\/ranger\">ranger<\/a> can be a good compromise between ease of use and power.<\/span>\n  <\/div>\n\n  <div style=\"display: flex; flex-direction: column; align-items: center; gap: 0.5em;\">\n      <img src=\"\/images\/kanban-miller-columns.png\" style=\"width: 500px;\"><\/img>\n      <span style=\"font-size: 10pt; justify-content: center;\">Miller Columns are helpful when one or more columns have a large number of work items.<\/span>\n  <\/div>\n\n  <div style=\"display: flex; flex-direction: column; align-items: center; gap: 0.5em;\">\n      <img src=\"\/images\/kanban-pantheon-tree.png\" style=\"width: 500px;\"><\/img>\n      <span style=\"font-size: 10pt; justify-content: center;\">Tree view is helpful to see the overall structure of the kanban.<\/span>\n  <\/div>\n<\/div>\n\n<h2>Limitations<\/h2>\n<p>What we built is a <em>minimal<\/em> software implementation of a kanban board, which\nmeans that it doesn't have the niceties of a conventional tool. There are two\nmajor limitations which are worth mentioning.<\/p>\n<h3>Work items have no sort order<\/h3>\n<p>Most file systems have no concept of a 'sort order' in the file system, and\nsorting by other file system attributes (like date modified) is probably not\nwhat we want. This is problematic if you want to use the kanban for managing a\nScrum backlog, which depends on prioritizing different work items against each\nother.<\/p>\n<p>The easiest way to work around this is to break from pure scrum by introducing a\n'prioritized' or 'todo' column. This column should contain a smaller number of\nwork items than the product backlog; at least as many as the sprint backlog. In\npractice, I find that product backlogs are often used this way, because only the\ntop 20 or so items are prioritized.<\/p>\n<p>Another way we can work around the sort order problem is by using a number\nprefix for each work item (e.g. <code>00-my-cool-work-item.md<\/code>). Doing this manually\nis tedious, and the natural solution is to write a quick script for it. But\nunder my self-imposed restrictions, this counts as programming and it's not\nallowed.<\/p>\n<h3>Work items have no metadata<\/h3>\n<p>Depending on your perspective, this could be a good or a bad thing. By not\nhaving metadata as part of our kanban, we avoid tying the kanban to any\nparticular file type. We also avoid getting distracted by add-ons like story\npoints, tags, and other shinies we may not need.<\/p>\n<p>On the other hand, we can only tell the contents of a work item by its file\nname, and any data we want to surface must be part of the file name. There's no\nreal traceability unless we use very granular version control \/ backup against\nthe kanban. That makes using this approach for process optimization - one of the\nmain goals of kanban - more challenging.<\/p>\n<p>Here is a short list of common features that cannot be implemented without work\nitem, column, or board level metadata:<\/p>\n<ul>\n<li>Work-in-progress limits<\/li>\n<li>Work item history<\/li>\n<li>Readable work item names and descriptions<\/li>\n<li>Story points<\/li>\n<li>People assigned to work on the work item<\/li>\n<li>Due dates, scheduling<\/li>\n<\/ul>\n<p>Of course, if our work items are text files, these extra features can live in\nthe body of each work item, but this will involve micromanaging the <em>human<\/em>\nkanban process.<\/p>\n<p>Other features are possible but much less convenient than in dedicated kanban\nsoftware:<\/p>\n<ul>\n<li>Sort order (see above)<\/li>\n<li>Tagging work items<\/li>\n<\/ul>\n<p>This kind of metadata would be pretty easy to script using <code>yq --front-matter<\/code>\nand some other bash commands, but that contradicts my no-programming rule.<\/p>\n<p>Even with these restrictions, this approach is probably fine for a small\npersonal kanban. It might also be appropriate for an environment with extreme\nlimitations, like a locked-down and airgapped server.<\/p>\n<p>But for team and professional use, our design restrictions are too severe.<\/p>\n<p><img alt=\"\" src=\"\/images\/chair-on-white-wall.jpg\"><\/p>\n<h2>Minimalism and Compromise<\/h2>\n<p>My motivation for trying this approach was how overbuilt many kanban\napplications are, and how poorly they fit into a CLI-based workflow. In other\nwords it was guided by a <em>minimalist<\/em> design approach.<\/p>\n<p>As we found, using the file system as a kanban board works, but comes with many\ncompromises.<\/p>\n<p>In other fields, the most extreme examples of minimalism are notable, but not\nnecessarily sensitive to most people's tastes. For example,\n<a href=\"https:\/\/www.miessociety.org\/mies-works-usa\">see the architecture of Mihes van der Rohe<\/a>,\nwhich was described as 'cold, barren design' even when it was at its most\npopular.<\/p>\n<p>An oft-mocked example of minimalism in tech is the Linux cult of\nhyper-efficiency. It's <em>possible<\/em> to run a Linux installation from under 100mb\nof disk space, but only if you're willing to work from a CLI all the time and\nconnect to the internet via a TUI. Which is a bit niche.<\/p>\n<p>This level of minimalism in design and engineering mostly belongs to academia,\nhacker culture, and art projects. Minimalism is a good guiding light but needs\nto be tempered by <em>humanism<\/em>. We need to make some compromises to people's needs\nand expectations; even Mies van der Rohe needed to find clients willing to pay\nfor his approach to architecture.<\/p>\n<p>I think a good way to find compromise between minimalist and humanist design is\nto reduce the complexity of a design as much as possible, like we did with a\nsoftware kanban in this article. We can then start to see which compromises\nwe're willing to accept, and which compromises we're not. First, we deconstruct;\nthen, we reconstruct.<\/p>\n<p>For our software kanban, the restriction on programming is the main barrier to\nmaking it more user-friendly. If we relax this restriction we can keep the\nother: to use the file system itself as a data store. We can keep most of the\nbenefits of our minimalist kanban while supporting most of the features that\ncan't be implemented in that model.<\/p>\n<p>Since I still want \/ need a kanban tool that's efficient to use and easy to back\nup, I went ahead and started writing the project. You can find it at\n<a href=\"https:\/\/codeberg.org\/fd93\/plainban\">codeberg\/plainban<\/a>.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"software"}},{"@attributes":{"term":"productivity"}}]},{"title":"Four Books on (Zen) Buddhism","link":{"@attributes":{"href":"https:\/\/fd93.me\/four-books-on-zen-buddhism.html","rel":"alternate"}},"published":"2025-08-10T00:00:00+08:00","updated":"2025-08-10T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-08-10:\/four-books-on-zen-buddhism.html","summary":"<p><img alt=\"\" src=\"images\/4-books-on-buddhism.jpg\"><\/p>\n<p>I've had an interest in Zen Buddhism since my college years. Initially this was\na rather silly and superficial thing: samurai were cool, and they practiced Zen.\nI think the first Zen-inspired book I read was <em>The Unfettered Mind: Writings\nfrom the Zen Master to the Swordsman<\/em>. Over the years \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/4-books-on-buddhism.jpg\"><\/p>\n<p>I've had an interest in Zen Buddhism since my college years. Initially this was\na rather silly and superficial thing: samurai were cool, and they practiced Zen.\nI think the first Zen-inspired book I read was <em>The Unfettered Mind: Writings\nfrom the Zen Master to the Swordsman<\/em>. Over the years, however, I've read\nthrough most of the basic spiritual texts of Chinese culture including the\n<em>Mencius<\/em> and the <em>Zhuangzi<\/em>, which are both fairly deep cuts, and hopefully\nthat gives me a bit more context with which to approach Zen.<\/p>\n<p>Despite having an ongoing interest in Zen most of my exposure to it has been\nsecond-hand through books like E.F. Schumacher's <em>Small is Beautiful<\/em>. On an\nimpulse I bought Haemin Sumin's <em>When Things Don't Go Your Way<\/em> recently, and\nthis made me interested in learning more about Buddhism as a living, practiced\nreligion rather than as a philosophy. After all, reading through Aquinas' <em>Summa\nTheologica<\/em> is not quite the same as attending the average church service.<\/p>\n<p>After reading <em>The Miracle of Mindfulness<\/em>, which is my favourite of the texts\nin this article, I attended my first zazen practice session with\n<a href=\"https:\/\/www.dharmadrum.org\/\">Dharma Drum Mountain<\/a> in Taipei. I've also become\nmore committed to practicing sitting meditation on a daily basis. Time will tell\nif I take up a more serious relationship with Buddhism.<\/p>\n<p>Each of the following texts has a slightly different take on (Zen) Buddhism than\nthe others, but I felt they were all worth mentioning in this article. I very\nmuch appreciated <em>The Miracle of Mindfulness<\/em> and <em>I May Be Wrong<\/em> for different\nreasons, but others might be more drawn to other texts.<\/p>\n<h2>Zen Mind, Beginner's Mind; Shunryu Suzuki, 1970<\/h2>\n<p>This text is widely known in the West, particularly in the USA, as a classic of\nZen literature. I first read it when I was in my late teens or early twenties,\nalthough I can't remember my exact age. Most of it went over my head. About half\nof it still goes over my head, even with a better grasp of Zen philosophy and\nhaving practiced more.<\/p>\n<p>On re-read, I took three things from it. The first is that the Japanese Zen\ntraditions are often stricter than the Chan \/ Seon \/ Thien traditions, even when\nthey're all from the Caodong \/ Soto dharma lineage. I asked my meditation\nteacher about this, and he explained that this may just be a reflection of\nJapanese culture in Zen practices.<\/p>\n<p>The second thing I took from the text was that Shunryu Suzuki was a rather stern\nteacher:<\/p>\n<blockquote>\n<p>When you do things in the right way, at the right time, everything else will\nbe organized. You are the 'boss'. When the boss is sleeping, everyone is\nsleeping. When the boss does something right, everyone will do something\nright, and at the right time. That is the secret of Buddhism.<\/p>\n<\/blockquote>\n<p>In other places in the text Suzuki makes statements about doing things the\ncorrect way and remaining committed to correct practice. The use of the word\n<em>correct<\/em> might be a translation issue, but it still gives the text a harder\nedge than other texts.<\/p>\n<p>The third thing I took from the text was that Shunryu Suzuki was very into\nphilosophy, despite saying:<\/p>\n<blockquote>\n<p>But whether Buddhism is philosophically deep or good or perfect is not the\npoint. To keep our practice in its true form it the purpose.<\/p>\n<\/blockquote>\n<p>Elsewhere in the text he makes statements which are philosophical:<\/p>\n<blockquote>\n<p>But if you are always prepared for accepting everything we see as something\nappearing from nothing, knowing that there is some reason why a phenomenal\nexistence of such and such form and color appears, then at that moment you\nwill have perfect composure.<\/p>\n<\/blockquote>\n<p>Sukuzi is probably outlining the concept of\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Prat%C4%ABtyasamutp%C4%81da\"><em>dependent origination<\/em><\/a>\nhere. While this is an important part of Buddhist doctrine, none of the other\ntexts in this article go into dependent origination in quite such terms. I'm not\nsure if Suzuki's audience (elite Californians in the 1970s: e.g. a young Steve\nJobs) played a role in his presentation. That said, I think the relationship\nbetween Western phenomology and Zen is an interesting space to explore, albeit\nthe earlier work of the\n<a href=\"https:\/\/plato.stanford.edu\/entries\/kyoto-school\/\">Kyoto School<\/a> - recently in\ntranslation more often - probably goes a lot further.<\/p>\n<p>The weight of theory in the book contradicts the way that other authors present\nZen, and that I was taught to practice; i.e. to not fixate on theorizing,\nbecause it leads to distraction. Apparently, mainstream Japanese Zen has a\ncontentious relationship with Suzuki's practice in the US. This doesn't surprise\nme based on how different Suzuki's approach is to the other two Zen texts in\nthis article. <em>Beginner's Mind<\/em> is particularly unlike <em>When Things Don't Go\nYour Way<\/em>, which makes a special effort to <em>avoid<\/em> this type of theorizing.<\/p>\n<p>I felt this book would reward re-reading for greater understanding, but that for\nan extreme deep dive into philosophy-adjacent concepts in Zen, it might be more\nuseful to read texts and articles that are from academic philosophers. It\noccupies an awkward position as neither a scholarly work nor being as accessible\nas the other texts in this article.<\/p>\n<h2>When Things Don't Go Your Way, Haemin Sumin, 2018<\/h2>\n<p>Haemin Sumin is a Seon (Zen) teacher from South Korea who also received an Ivy\nLeague education in the US. This book is unusual for a book about Buddhism, as\nit doesn't dwell much on theory (unlike <em>Beginner's Mind<\/em>), but is presented as\na series of anecdotes from the author's own experiences, interspersed with\naphorisms and thoughts. Some of these I found compelling:<\/p>\n<blockquote>\n<p>By accepting things as they are, <br \/> resistance subsides and peace emerges.\n<br \/> In that experience, there is no separate 'I' <br \/> that stands apart\nand experiences peace. <br \/> 'I' is never needed in peace. <br \/> 'I'\ndisappears in peace.<\/p>\n<\/blockquote>\n<p>Other thoughts are less compelling. One theme that runs through the text is that\nSumin spends a lot of time dwelling on success, failure, and status. As such his\nreflections can be simultaneously alienating and intriguing. He reflects that as\na novice, he knew little about Buddhist practice. Years later, on starting his\nown Buddhist organization, he was a novice again - this time at how to run an\norganization. While I have heard similar reflections from CEOs before, it's\nprobably not a relatable experience for most people.<\/p>\n<p>But perhaps this is understandable. In the introduction Sumin notes that\nBuddhist monks in Korea do not receive pensions or guaranteed housing, and\ntherefore have a hard time living up to the ideal of 'non-possession' that's\nexpected in most Buddhist societies. I think that some of the more interesting\nbut also more offputting parts of the text come from Sumin being more engaged\nwith worldly success and achievement than most Zen teachers:<\/p>\n<blockquote>\n<p>People with great success often suffer distress and anxiety in order to\nmaintain what they have accomplished. Rather than thinking only about what you\nmay gain, forsee what you may lose along with your success. Even if you should\nrealize your overflowing ambitions, success can also harm your health, create\ndistance from your family and friends, and take away all your free time.<\/p>\n<\/blockquote>\n<p>Overall, I was reminded of the sermons that we used to receive from the local\nvicar at my rather provincial Church of England school - moments of spiritual\nbrilliance strewn amongst banalities. Haemin Sumin is a practicing Seon teacher\nwho engages with society rather than retreating from it and so I suppose his\nposition is similar to that of a British vicar.<\/p>\n<p>This is a good book for connecting middle-class life in the twenty-first century\nwith Buddhist teachings, but I found it lacked much of the depth of <em>The Miracle\nof Mindfulness<\/em> and <em>Zen Mind, Beginner's Mind<\/em>. This isn't necessarily a flaw:\nit is a very different and less theoretical work than either of those books. But\nthe real value I got from this book is that it was just interesting enough to\nget me to pick up <em>The Miracle of Mindfulness<\/em> a few months later.<\/p>\n<h2>The Miracle of Mindfulness; Thich Nhat Hanh, 1975<\/h2>\n<p>Of the more 'serious' two texts on this list, I found this one to be the more\ncompelling. The main part of the text is a 1974 letter from Nhat Hanh to Brother\nQuang, who was a member of the School of Youth for Social Service. This was a\ncharitable organization operating in the Vietnam War era to provide aid to the\nVietnamese people caught in the warzone. The rest of my edition (Rider 2020)\nconsists of instructions for meditation, excerpts from the Pali Canon, and an\naccount by James Forest of Nhat Han's travels to America during the Vietnam war.<\/p>\n<p>In the first few pages Nhat Hanh tells a famous story about washing the dishes.\nThe point is that whether washing dishes is a chore or not depends on the\nmindset of the person washing them. If washing dishes is a chore we have to\nfinish before something else - whether drinking tea, or playing games, or some\nother fun activity - then it will be a miserable chore. We are focused on the\nfuture, which doesn't exist. But if we wash the dishes with focus, and our only\nthought is washing dishes, we can use that time as an opportunity to practice\nmindfulness.<\/p>\n<p>Washing dishes is not really the point - the book applies the same principle to\nmany different activities, from walking to eating to drinking tea to resting.\nThe point is that mindfulness - and Buddha-nature - is accessible regardless of\nthe activity we're engaged in. This was the main teaching that our teacher\nemphasised during the two-day course on meditation I attended.<\/p>\n<p>As far as I'm aware this is the main distinction between Zen Buddhism and other\ntraditions. In Zen, sitting meditation may be one of the most focused forms of\npractice, but it is far from the sole form. It's not practical for people, even\nmonks, to spend all their time in sitting meditation or prostration. While\nsitting meditation may be the bread-and-butter of Zen practice, the true\npractice is found in everyday life.<\/p>\n<p>At the course I attended, we therefore practiced sitting, walking, sleeping,\neating, speaking, and prostrating mindfully for two days. I found this useful\nbecause I tend to become attached to practicing in a particular way, at a\nparticular time, in a particular place, and our class aimed to break habitual\nthinking to build mindfulness.<\/p>\n<p>The main text of <em>The Miracle of Mindfulness<\/em> concludes with a retelling of\n<a href=\"https:\/\/www.libraryofshortstories.com\/storiespdf\/three-questions.pdf\"><em>The Three Questions<\/em><\/a>\nby Tolstoy, which answers three questions:<\/p>\n<ul>\n<li>What is the most important time to act?<\/li>\n<li>Who are the most important people to deal with?<\/li>\n<li>What are the most important things to do with our time?<\/li>\n<\/ul>\n<p>It answers them thus:<\/p>\n<blockquote>\n<p>Remember that there is only one important time, and that is now. The present\nmoment is the only time over which we have dominion. <br \/> <br \/> The most\nimportant person is always the person you are with, who is right before you,\nfor who knows if you will have dealings with any other person in the future?\n<br \/> <br \/> The most important pursuit is making the person standing at your\nside happy, for that alone is the pursuit of life.<\/p>\n<\/blockquote>\n<p>I found this text the most useful of the four, and it was the biggest factor in\nmy decision to attend a meditation class. Perhaps it was just a good fit for me:\nNhat Han skilfully connects anecdotes, practice, and philosophy without\noveremphasising any of them. If anything he focuses most on practice, which\nseems appropriate - Chan (Zen), in Chinese, translates simply to 'meditation'.<\/p>\n<p>It's probably obvious, but this book affected me deeply. I bought the two books\nat the same time, but I'm glad I read this text first, because it helped give\ncontext to <em>I Could Be Wrong<\/em> by Bjorn Natthiko Lindeblad.<\/p>\n<h2>I Could Be Wrong; Bj\u00f6rn Natthiko Lindeblad, 2020<\/h2>\n<p>This is a book by a Swedish man who gave up his role as a corporate economist to\nbecome a forest monk for 17 years.<\/p>\n<p>While the English edition of the book is marketed as a self-help guide packed\nwith wisdom, this is not what I took from it - the other texts in this article\nexplore mindfulness in more compelling ways. But this <strong>is<\/strong> an excellent memoir\nof what it's like to be a Buddhist monk. The book is filled with anecdotes about\nfalling asleep while meditating, the awkwardness of running a retreat for air\nhostesses, and repeatedly declining to take cash from laypeople.<\/p>\n<p>Unlike the other three books in this article, this book does not come from the\nChan \/ Zen perspective. The author was ordained in the Thai Theravada tradition\nof forest monks. The different cultural and religious flavor of his school comes\nthrough strongly in the text, as when he describes Thai monks as spending much\nof their time smoking and gossiping. The most compelling part of the text is\nwhere the narrator talks about the impact that monastic life had on him and his\nfellow monks, many of whom were Western backpackers and wanderers before\nsettling at the monastery. Over time, he says, monastic life files down the\n'hard edges' and traumas of individuals and people learn to live together.<\/p>\n<p>The overall sense I got from this book was that the author enjoyed something\nthat's rare in the West today: growing together with his community over decades.\nThis takes a tragic turn when he makes the decision to leave monastic life, and\nlike the stereotypical ex-convict becomes directionless and depressed for a\ntime. Luckily he recovers and finds happiness in giving talks and interviews\nabout his time as a monk, which formed the source material for this text.<\/p>\n<p>The book has an unusual origin - it was completed and published after the author\npassed away from a terminal illness. So most of the book was ghostwritten by a\nclose friend of the author.<\/p>\n<p>Along with the misguided marketing approach, this made the book feel a little\ndishonest - probably through no fault of the author, who by his own confession\nspent more time being interviewed than working on the original manuscript.<\/p>\n<p>This text is a good account of what becoming a monk is actually like for a\nWesterner, what expectations might be like for a more senior monk, and the\nchallenges for someone who leaves monastic life. Reading it was what encouraged\nme to seek out practice as part of the community, and <em>that<\/em> convinced me that\npursuing being a monk was not what I want at this point of my life, although I\nmay become open to a more involved lay practice.<\/p>\n<h2>What's Next?<\/h2>\n<p>This period of exploring Zen theory and practice has been an interesting one for\nme, and I intend to continue. There are a few challenges (mostly my dismal\nChinese), but that's okay. As my teacher emphasised, the practice is the point.\nOther than becoming more involved in group practice, I also have a few texts I\nwant to read:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.goodreads.com\/book\/show\/514210.The_Way_of_Zen\">The Way of Zen, Alan Watts<\/a>;\n  I've listened to Alan Watts' lectures, like many people, but have never read\n  any works by this arch popularizer of Zen. While Alan Watts is sometimes\n  mocked as an orientalist, I think this is a bit unfair given that he was\n  writing about Zen over a decade before Suzuki. He's also a near-contemporary\n  of the Kyoto School, who were reconciling Western philosophy with Zen from the\n  Japanese perspective during the war years.<\/li>\n<li><a href=\"https:\/\/www.barnesandnoble.com\/w\/the-kyoto-school-robert-e-carter\/11136273171\">The Kyoto School, An Introduction; Robert E. Carter<\/a>:\n  a scholarly work on the Kyoto School. I've listened to the\n  <a href=\"https:\/\/www.philosophizethis.org\/podcast\/episode-201-transcript-bkx3e-37rkx-bpl83-ysc9b-kkg62-rk7n2-8j6gw-p837t-fwc2c-armek-de5ar-2at4j-l2jz9-7zdw5\">Philosophize This!<\/a>\n  episodes on the Kyoto school, and would like to go a bit deeper on their work\n  from an academic philosophy perspective. Ideally I will read the primary\n  sources in translation, although the only volume I could find cost around $100\n  USD.<\/li>\n<li><em>Questions in the Practice of Buddhism<\/em>, Master Sheng-Yan of Dharma Drum\n  Mountain. I picked up this book after my meditation classes and found it\n  interesting in clarifying questions of practice. I'm fairly confident in my\n  ability to understand Zen, but practice is much more challenging for me.<\/li>\n<\/ul>\n<p>I suppose I'd also be interested in forming a reading group, but most likely\nI'll post about these works here or on <a href=\"https:\/\/fosstodon.org\/@fd93\">Mastodon<\/a>.\nFeel free to follow if you're interested in updates on my Zen reading.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"mindfulness"}},{"@attributes":{"term":"buddhism"}}]},{"title":"How to Setup Puppy Linux With Ventoy","link":{"@attributes":{"href":"https:\/\/fd93.me\/how-to-setup-puppy-linux-with-ventoy.html","rel":"alternate"}},"published":"2025-08-01T00:00:00+08:00","updated":"2025-08-01T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-08-01:\/how-to-setup-puppy-linux-with-ventoy.html","summary":"<p><img alt=\"\" src=\"images\/puppy-linux.jpg\"><\/p>\n<p>Like many people in the 2020s, I travel a lot. I work in a different city to the\none I live in, and spend a few days in one place and a few days in the other. I\ndon't really mind travelling, but it comes with a few inconveniences.<\/p>\n<p>One \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/puppy-linux.jpg\"><\/p>\n<p>Like many people in the 2020s, I travel a lot. I work in a different city to the\none I live in, and spend a few days in one place and a few days in the other. I\ndon't really mind travelling, but it comes with a few inconveniences.<\/p>\n<p>One of them is having to haul all my stuff around between multiple locations.\nSure, I have a laptop, but hauling it hundreds of miles every week is a pain,\nnot to mention it risks getting damaged with so much time on the road.<\/p>\n<p>What else can I do? Well, I could set up a desktop (or a semi-permanent laptop)\nat each location I work at. But then I have to figure out how to shuffle data\nbetween these devices, not to mention keep track of several physical devices.<\/p>\n<p>I could work in the cloud and set up a development server, but then my ability\nto do stuff is tied to internet access and the tools I have available on my\nclient systems. Railway tunnels passing through Asian mountain ranges do not\nhave great mobile internet access.<\/p>\n<p><a href=\"how-to-make-slax-your-ultimate-portable-pc\">I've experimented with portable distros before<\/a>,\nspecifically <a href=\"https:\/\/www.slax.org\/\">Slax<\/a>, but never took up the cause\nseriously. At the time my use case wasn't strong enough, and I could never\nfigure out how to get Slax to behave consistently on save. Unlike Slax, I\nmanaged to debug most of the issues with Puppy Linux over a weekend.<\/p>\n<p>Puppy Linux is probably the most popular portable Linux distribution. Unlike\nmost Linux distros it isn't usually installed; it's meant to run off a CD or USB\ndrive. Unlike most LiveCDs you can save your Puppy configuration to a USB drive\nand continue your session later with system settings intact.<\/p>\n<p>For this configuration I used <code>BookwormPup64 10.0.7<\/code>, which is a Debian Bookworm\nversion of Puppy.<\/p>\n<p>I also used <a href=\"https:\/\/www.ventoy.net\/en\/index.html\">Ventoy<\/a>, which is a tool\nwhich lets you load many different ISOs from a USB stick, and use it as storage\nat the same time. If you're an IT professional or enthusiast, it's worth a try\njust to have <a href=\"https:\/\/clonezilla.org\/\">Clonezilla<\/a> and\n<a href=\"https:\/\/gparted.org\/\">GParted<\/a> available at the same time.<\/p>\n<h2>Setting Up The Drive<\/h2>\n<p>First, get a USB drive and format it to MBR or GPT partition scheme. MBR has\nmore compatibility while GPT is more modern and flexible. I chose MBR as my goal\nwas to make a USB that would work on as many different host systems as possible.<\/p>\n<p>Next, use Ventoy to flash the USB drive. Make sure you backup any data you want\nto keep first, as this will erase the disk! You can find detailed instructions\nfor how to do this <a href=\"https:\/\/www.ventoy.net\/en\/doc_start.html\">on their website<\/a>.\nI used the Linux CLI script <code>Ventoy2Disk.sh<\/code>.<\/p>\n<p>However you install Ventoy, make sure you reserve some additional space for a\ndata partition. This is because Ventoy will format its partition as exFAT, which\nPuppy doesn't recognise for making saves.<\/p>\n<p>Make a folder on the Ventoy partition called something like ISOs and drop your\nPuppy Linux ISO into it.<\/p>\n<p>Next, create the data partition. You can either use FAT32 or ext4. Some features\nof FAT32:<\/p>\n<ul>\n<li>It's compatible with every major OS and most legacy hardware, so it's a good\n  choice for flexibility.<\/li>\n<li>However, it's not natively supported by Linux, so it can take extra work to\n  use it as a data partition.<\/li>\n<li>It also limits your save file sizes for Puppy to a maximum of 4GB.<\/li>\n<\/ul>\n<p>On the other hand, ext4:<\/p>\n<ul>\n<li>Is only compatible with Linux, and Windows and MacOS have poor support for it.<\/li>\n<li>Is a native Linux configuration, so it gives you the most flexibility if\n  you're committed to using it only on the Linux ecosystem.<\/li>\n<li>Will allow you to have uncapped file sizes or use a folder for saving data.<\/li>\n<\/ul>\n<p>I went for ext4 and allocated 16\/64GB on my USB drive to it. This is probably\nthe simplest setup since Ventoy is already formatted to exFAT and should\ntherefore be available as a storage partition on most systems.<\/p>\n<p>If you're on a Linux system, make a note of the device name of your USB by using\n<code>lsblk<\/code>.<\/p>\n<p>Optionally, you can create a Linux swap partition on your drive to get some free\nRAM (or more realistically, guarantee you have a decent amount of RAM\navailable).<\/p>\n<p>Next, create a folder called <code>\/sessions<\/code>, <code>\/puppy-saves<\/code> or similar on the\npartition you want to setup your Puppy files on. This is where the <em>changes<\/em> you\nmake to Puppy will live.<\/p>\n<p>Now we need to reboot the computer and mess around in the BIOS a bit. On most\nsystems you'll need to disable secure boot to boot a Linux USB. Secure boot is\nrequired for modern Windows installations, so remember to re-enable it again\nwhen you're finished if the host PC normally runs Windows.<\/p>\n<h2>Booting into Puppy<\/h2>\n<p>Reboot into the Ventoy boot manager and choose the Puppy ISO from the list of\nboot options.<\/p>\n<p>You can boot in any mode, but <code>grub2<\/code> is probably the most standard. Now you'll\nbe at the <em>Puppy Linux<\/em> boot menu. Press e to edit the default boot option and\nadd <code>psave=$YOUR_DEVICE_NAME:\/sessions<\/code> to the end of the line that looks like\n<code>linux \/vmlinuz pmedia=cd pfix=fsck,fsckp<\/code>. For me the correct value was\n<code>psave=sda3:\/sessions<\/code>. The label of the partition may or may not work - it\nworked on my daily driver, but not on my old Macbook. If you want to try it,\nwrite <code>psave=$LABEL:\/sessions<\/code> - for me <code>psave=puppy:\/sessions<\/code>.<\/p>\n<p>Press CTRL+X to boot...<\/p>\n<p>...and wait a moment while the bootloader copies Puppy Linux into RAM.<\/p>\n<p>After a while things will start to work, and you're booted into Puppy!<\/p>\n<p>Puppy will give you a ton of setup options, but I recommend just setting the\nimportant ones - timezone, hostname, and display resolution. For me configuring\nthe display was important since my laptop's screen is 14\" but 2.4K resolution,\nmeaning it's impractical to work on at native resolution and 1x scaling.<\/p>\n<p>After it's set up, you can try out a few of the applications that are bundled\nwith Puppy. Here I'm playing with the system monitor btop and collecting\nscreenshots for this article:<\/p>\n<p><img alt=\"\" src=\"images\/puppy-screenshot.png\"><\/p>\n<p>Now, shut down Puppy. It should prompt you to create a savefile on the device\nyou selected (e.g. <code>sda3<\/code>) and give you some options about how large you want\nyour savefile to be, if you want to use a folder instead, etc. Since I was\ninstalling on an ext4 partition I set up the save file in a partition.<\/p>\n<p>If this worked, you'll see a shutdown message on the console noting that it's\nsaving a puppy file to your chosen partition, and the computer will shut down.<\/p>\n<p>Let's boot it back up. Follow the same process as last time to boot into puppy,\nand remember to set the <code>psave<\/code> variable at the puppy boot screen. I found if\nyou don't do this Puppy can be a bit eccentric about choosing the correct\npartition to save to.<\/p>\n<p>Success! We managed to get Puppy running using a Ventoy image.<\/p>\n<h2>What comes next?<\/h2>\n<ul>\n<li>Respin the Puppy ISO to have its grub.cfg options always point to the\n  appropriate option.<\/li>\n<li>Check out this\n  <a href=\"https:\/\/forum.puppylinux.com\/viewtopic.php?p=38449\">forum thread<\/a> for more\n  information.<\/li>\n<li>To go deep on the topic of liveCDs and frugal, USB, and full installs, read\n  through the\n  <a href=\"https:\/\/puppylinux-woof-ce.github.io\/install.html\">Puppy Linux docs<\/a>.<\/li>\n<\/ul>","category":{"@attributes":{"term":"general"}}},{"title":"On Notebooks and Thinking Better Thoughts","link":{"@attributes":{"href":"https:\/\/fd93.me\/notebooks-thinking-better-thoughts.html","rel":"alternate"}},"published":"2025-07-20T00:00:00+08:00","updated":"2025-07-20T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2025-07-20:\/notebooks-thinking-better-thoughts.html","summary":"<p><img alt=\"\" src=\"images\/notebooks-thinking-better-thoughts.jpg\"><\/p>\n<p>I recently bought a few spiral-bound notebooks from Muji - two for work, and two\nfor personal use. My intention for the personal notebooks was to use them as a\ndestination for inconsequential thoughts, schemes, grocery lists, todo lists,\nand so on. In digital note-taking software these are often called 'fleeting \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/notebooks-thinking-better-thoughts.jpg\"><\/p>\n<p>I recently bought a few spiral-bound notebooks from Muji - two for work, and two\nfor personal use. My intention for the personal notebooks was to use them as a\ndestination for inconsequential thoughts, schemes, grocery lists, todo lists,\nand so on. In digital note-taking software these are often called 'fleeting\nnotes'.<\/p>\n<p>Here are some examples of what I've actually been using the personal notebook\nfor:<\/p>\n<ul>\n<li>Taking notes on texts I've been reading, specifically\n  <a href=\"https:\/\/www.goodreads.com\/book\/show\/95747.The_Miracle_of_Mindfulness\"><em>The Miracle of Mindfulness<\/em><\/a>,\n  <a href=\"https:\/\/www.goodreads.com\/en\/book\/show\/60222414-i-may-be-wrong\"><em>I May Be Wrong<\/em><\/a>,\n  and\n  <a href=\"https:\/\/dailystoic.com\/on-the-shortness-of-life-seneca\/\"><em>On the Shortness of Life<\/em><\/a>.<\/li>\n<li>A mathematical look at how organizations develop over time.<\/li>\n<li>The link between mindfulness in the sense of accepting reality and strategy:\n  \"If you know the enemy and yourself, you need not fear the result of 100\n  battles.\"<\/li>\n<li>The basic ideas for this article!<\/li>\n<\/ul>\n<p>Why is it that something as simple as recording fleeting thoughts on paper,\nrather than on a computer, has improved the quality of those thoughts? It's true\nthat I have paid more attention to the content of my thoughts recently, because\nI've been reading about mindfulness. And it's also true that I've made an effort\nto reduce distractions, and that a physical notebook inherently has less risk of\ndistraction than anything on a computer. But I think there are more fundamental\npsychological reasons for the power of my little notebooks.<\/p>\n<p>For most people, our minds are busy and lack structure. They respond to the\nimpressions that we have minute-by-minute and rarely stay focused on a single\ntopic for more than a couple of minutes. Many of these thoughts are trivial:\n\"Hey, I could use an ice cream.\" I suspect that I have an especially busy and\nchaotic mind compared to the average, because I've lived with moderate to severe\nanxiety since I was a kid.<\/p>\n<p>One of the goals and gifts of mindfulness is to learn to observe your thoughts\nbut not take them too seriously. If you have a notebook near you and you are\npaying attention to your thoughts, then you can be a little selective about what\nyou write down. Unless you're practicing\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Free_writing\">free writing<\/a>, then the process of\nwriting forces you to curate and structure your thoughts. I think this is\nespecially true with a physical notebook, since very few people can write on\npaper as quickly as they can think. When reading, the thoughts are coming from a\ntext rather than our own minds, but we are still free to pause and take notes on\nthe most compelling areas.<\/p>\n<p>If our notes seem interesting enough, we might decide to organize them into\nstructured texts. That doesn't necessarily mean long-form writing, but placing\nthe notes into a broader context. When I was studying my master's degree I'd\ncall this composting, because I'd take citations, my own narration, and other\nsuch 'trash' - and dump them into a single document, which would progressively\nbecome more structured.<\/p>\n<p>The structure can emerge over a period of weeks, months, or even years. The act\nof organization is what's interesting, and it's what computers excel at. Tags,\nbookmark lists, filesystems, hyperlinks - all are excellent tools for taking\nunstructured information and turning it into something more coherent. These\nallow us to go from our notes to a <em>personal knowledge management system<\/em>. Some\npeople will go further and adhere to the full\n<a href=\"https:\/\/zettelkasten.de\/\">Zettelkasten<\/a> method, or build a private wiki with\nsoftware like <a href=\"https:\/\/www.dokuwiki.org\/dokuwiki\">Dokuwiki<\/a>.<\/p>\n<p>Once we've let our thoughts mature for a while, we'll want to produce something\nfor other people to look at, an <em>artifact<\/em>. For me this is typically a toot, an\narticle, or some code or technical design. For other people, it could be\nanything from a strategy memo to a craft project. The production of artifacts is\nsomewhat out of the scope of this article, because they're domain-specific - a\nYouTube video is not an academic paper, which is not a Lego design.<\/p>\n<p>I think of this like a pipeline: my brain takes in stimuli from the world and\nproduces thoughts from those phenomena. By taking fleeting notes from the more\ninteresting thoughts, I record ideas. Later, I can organize these ideas in my\npersonal knowledge management system<sup id=\"fnref:1\"><a class=\"footnote-ref\" href=\"#fn:1\">1<\/a><\/sup>. Once the process of organizing my\nthoughts on some subject has reached a decent stage of maturity, I can produce\nartifacts like articles, code, or technical designs.<\/p>\n<div style=\"display: flex; flex-direction: column; align-items: center;\">\n    <img src=\"\/images\/notebooks-thinking-better-thoughts-diagram.png\"><\/img>\n    <span style=\"font-size: 10pt; justify-content: center; display: flex;\">\n      Icons by &nbsp;<a href=\"https:\/\/github.com\/Sudotachy\">@sudotachy<\/a>&nbsp; and &nbsp;<a href=\"https:\/\/github.com\/ei-au\">@ei-au<\/a>. Both &nbsp;<a href=\"https:\/\/opensource.org\/license\/mit\">MIT licensed<\/a>.\n    <\/span>\n<\/div>\n\n<p>For the last year, I've been expanding my use of self-hosting and centralizing\ndocuments from various different sources onto services I control. This has great\nbenefits for searchability and organization - I don't need to wonder about where\nimportant documents are, because they can only be in one place, which can easily\nbe searched. Therefore, around 6 months ago I decided to stop using paper for\npersonal notes. The main result of this was that <em>I didn't take any personal\nnotes<\/em>.<\/p>\n<p>Of course, that wasn't my intention. The mistake I made was to try to skip the\nfleeting notes stage of the process and impose structure before I had raw\nmaterial. Writing fleeting thoughts into a knowledge management system\nencourages trying to force structure on them, rather than letting organic\nstructures grow. Another version of this mistake which I've made before is to\nbuy a big, fancy notebook and immediately become terrified of sullying it with\nsubstandard thoughts, which is why I now prefer plain spiral-bound notebooks.<\/p>\n<p>Perhaps the biggest mistake of all is the idea that technical solutions can\nreplace the slow and considered human mind. My experience with the notebooks is\njust one example of how traditional and 'outdated' technologies can often work\nbetter than the latest toys.<\/p>\n<div class=\"footnote\">\n<hr>\n<ol>\n<li id=\"fn:1\">\n<p>I use <a href=\"https:\/\/obsidian.md\/\">Obsidian<\/a> or <a href=\"https:\/\/neovim.io\/\">Neovim<\/a> with\n<a href=\"https:\/\/github.com\/artempyanykh\/marksman\">Marksman LSP<\/a>. I'd prefer to use\nonly Neovim since it's open-source, but Obsidian has some very nice features\nand plugins which the Neovim ecosystem has not yet matched. I wrote a plugin\ncalled <a href=\"https:\/\/github.com\/fdavies93\/daily-notes.nvim\">daily-notes.nvim<\/a> to\nreplicate one of those features.&#160;<a class=\"footnote-backref\" href=\"#fnref:1\" title=\"Jump back to footnote 1 in the text\">&#8617;<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"software"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"knowledge management"}}]},{"title":"How Not To Write A Web Service in Rust","link":{"@attributes":{"href":"https:\/\/fd93.me\/bad-web-rust.html","rel":"alternate"}},"published":"2024-08-11T00:00:00+08:00","updated":"2024-08-11T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2024-08-11:\/bad-web-rust.html","summary":"<p><img alt=\"\" src=\"\/images\/bad-web-rust.jpg\"><\/p>\n<p>When writing a web service in Rust you may be tempted to do careful research\nbased on your use case, to tailor your code to fit the needs of a typed language\nwith strict memory safety, and to take a pragmatic approach to development.\nDoing things this way might make \u2026<\/p>","content":"<p><img alt=\"\" src=\"\/images\/bad-web-rust.jpg\"><\/p>\n<p>When writing a web service in Rust you may be tempted to do careful research\nbased on your use case, to tailor your code to fit the needs of a typed language\nwith strict memory safety, and to take a pragmatic approach to development.\nDoing things this way might make your project successful, but it isn't as fun.<\/p>\n<p>What's really fun is blocking yourself for months by writing your Rust project\nin a haphazard manner, complaining about it online, and then writing an article\nroasting your own skill issues.<\/p>\n<p>I'm here to illuminate your way as you walk the golden path to frustration in\nRust for the web.<\/p>\n<h2>How did we get here?<\/h2>\n<p>I'm writing a second version of\n<a href=\"https:\/\/github.com\/fdavies93\/zenkat-rust\">Zenkat<\/a>, a CLI tool for knowledge\nmanagement. The <a href=\"https:\/\/github.com\/fdavies93\/zenkat-py\">previous version<\/a> was\nin Python, which I'm more familiar with.<\/p>\n<p>The main feature that distinguishes <code>zenkat-rs<\/code> from <code>zenkat-py<\/code> is that it\nmakes use of a proper\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Recursive_descent_parser\">recursive descent parser<\/a>\nwhich emits an\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Abstract_syntax_tree\">abstract syntax tree<\/a>.\nHopefully, this will allow for much more powerful querying and document\nprocessing capabilities with less spaghetti code than the original, which used\nregexps.<\/p>\n<p>One consequence of this is that I should be able to implement an HTTP API for\nquerying and manipulating a large number of notes at once, which lets Zenkat be\nrun on a web server for e.g. handling a household or small business's knowledge\nmanagement needs.<\/p>\n<p>To do this I need to write a proper RESTful API in Rust, which is a little\nchallenging especially where I also want to use Tokio's asynchronous features. I\nhelped myself fail at the fairly simple task of implementing an HTTP server in\nRust by using a few strategies.<\/p>\n<p>In this article I'm going to share the strategies that you can use - like me! -\nto block and demotivate yourself for months on end.<\/p>\n<h2>Use the wrong stack for your use case<\/h2>\n<p>Rust networking crates are tricky to understand. There's a ton of different\noptions which are hard to understand for beginners. So why not pick one at\nrandom?<\/p>\n<p>For example we should choose <a href=\"https:\/\/gotham.rs\/\">gotham<\/a>, which keeps you\nguessing about how to use key features by making their documentation a series of\nexamples and sparsely documenting how stuff actually works. They also\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Release_early,_release_often\">release pretty slowly and infrequently<\/a>,\nwhich means they must be more stable.<\/p>\n<p>Definitely don't use <a href=\"https:\/\/github.com\/tokio-rs\/axum\">axum<\/a>, which provides a\nsimple interface for routes by using derived traits. Their release cycle is way\nshorter, which makes them more dangerous, and they're part of the same github\nuser as <code>tokio<\/code>, which means they're shilling their own product.<\/p>\n<h2>Make liberal use of dynamic language concepts<\/h2>\n<p>Don't use the features of your library which simplify async Rust - those are for\nbeginners only. Avoid the temptation to give each request type its own data type, and definitely don't use fancy lad constructs like traits, type aliases, or Rust enums to provide a common interface for objects. After all, you stopped writing C# for a reason!<\/p>\n<p>Instead, you should try using a generic request type which looks like this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">pub<\/span><span class=\"w\"> <\/span><span class=\"k\">struct<\/span><span class=\"w\"> <\/span><span class=\"nc\">Request<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">  <\/span><span class=\"n\">request_type<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"nc\">RequestType<\/span><span class=\"p\">,<\/span>\n<span class=\"w\">  <\/span><span class=\"n\">data<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"nc\">Hashmap<\/span><span class=\"o\">&lt;<\/span><span class=\"nb\">String<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"n\">unknown<\/span><span class=\"o\">&gt;<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n<p>This is totally cool and fine in Python, and Rust is basically Python, right?<\/p>\n<p>Using this kind of setup gives you a great opportunity to learn a lot more about\nhow async Rust works and how it interacts with Axum-specific abstractions:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">fn<\/span><span class=\"w\"> <\/span><span class=\"nf\">make_request_handler<\/span><span class=\"p\">(<\/span>\n<span class=\"w\">    <\/span><span class=\"n\">parser<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"kp\">&amp;<\/span><span class=\"nc\">QueryParser<\/span><span class=\"p\">,<\/span>\n<span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"p\">-&gt;<\/span><span class=\"w\"> <\/span><span class=\"nb\">Box<\/span><span class=\"o\">&lt;<\/span><span class=\"k\">dyn<\/span><span class=\"w\"> <\/span><span class=\"nb\">Fn<\/span><span class=\"p\">(<\/span><span class=\"n\">Json<\/span><span class=\"o\">&lt;<\/span><span class=\"n\">Request<\/span><span class=\"o\">&gt;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"p\">-&gt;<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"n\">StatusCode<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"n\">Json<\/span><span class=\"o\">&lt;<\/span><span class=\"n\">Response<\/span><span class=\"o\">&gt;<\/span><span class=\"p\">)<\/span><span class=\"o\">&gt;<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">    <\/span><span class=\"nb\">Box<\/span><span class=\"p\">::<\/span><span class=\"n\">new<\/span><span class=\"p\">(<\/span>\n<span class=\"w\">        <\/span><span class=\"o\">|<\/span><span class=\"n\">Json<\/span><span class=\"p\">(<\/span><span class=\"n\">payload<\/span><span class=\"p\">):<\/span><span class=\"w\"> <\/span><span class=\"nc\">Json<\/span><span class=\"o\">&lt;<\/span><span class=\"n\">Request<\/span><span class=\"o\">&gt;|<\/span><span class=\"w\"> <\/span><span class=\"p\">-&gt;<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"n\">StatusCode<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"n\">Json<\/span><span class=\"o\">&lt;<\/span><span class=\"n\">Response<\/span><span class=\"o\">&gt;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">            <\/span><span class=\"kd\">let<\/span><span class=\"w\"> <\/span><span class=\"n\">res<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"n\">Response<\/span><span class=\"p\">::<\/span><span class=\"n\">new<\/span><span class=\"p\">();<\/span>\n\n<span class=\"w\">            <\/span><span class=\"n\">parser<\/span><span class=\"p\">.<\/span><span class=\"n\">parse_query<\/span><span class=\"p\">(<\/span><span class=\"n\">payload<\/span><span class=\"p\">);<\/span>\n\n<span class=\"w\">            <\/span><span class=\"fm\">println!<\/span><span class=\"p\">(<\/span><span class=\"s\">&quot;{:?}&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"n\">payload<\/span><span class=\"p\">);<\/span>\n<span class=\"w\">            <\/span><span class=\"k\">return<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"n\">StatusCode<\/span><span class=\"p\">::<\/span><span class=\"n\">OK<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"n\">Json<\/span><span class=\"p\">(<\/span><span class=\"n\">res<\/span><span class=\"p\">));<\/span>\n<span class=\"w\">        <\/span><span class=\"p\">},<\/span>\n<span class=\"w\">    <\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span>\n<\/code><\/pre><\/div>\n\n<p>This is way cleaner and easier to understand than a more static way of handling\nroutes like:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">async<\/span><span class=\"w\"> <\/span><span class=\"k\">fn<\/span><span class=\"w\"> <\/span><span class=\"nf\">list_trees<\/span><span class=\"p\">(<\/span><span class=\"n\">State<\/span><span class=\"p\">(<\/span><span class=\"n\">state<\/span><span class=\"p\">):<\/span><span class=\"w\"> <\/span><span class=\"nc\">State<\/span><span class=\"o\">&lt;<\/span><span class=\"n\">AppState<\/span><span class=\"o\">&gt;<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"p\">-&gt;<\/span><span class=\"w\"> <\/span><span class=\"nc\">Json<\/span><span class=\"o\">&lt;<\/span><span class=\"nb\">Vec<\/span><span class=\"o\">&lt;<\/span><span class=\"n\">TreeDetail<\/span><span class=\"o\">&gt;&gt;<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">    <\/span><span class=\"kd\">let<\/span><span class=\"w\"> <\/span><span class=\"n\">tree_guard<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"n\">state<\/span><span class=\"p\">.<\/span><span class=\"n\">trees<\/span><span class=\"p\">.<\/span><span class=\"n\">lock<\/span><span class=\"p\">().<\/span><span class=\"k\">await<\/span><span class=\"p\">;<\/span>\n<span class=\"w\">    <\/span><span class=\"kd\">let<\/span><span class=\"w\"> <\/span><span class=\"k\">mut<\/span><span class=\"w\"> <\/span><span class=\"n\">tree_details<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"fm\">vec!<\/span><span class=\"p\">[];<\/span>\n<span class=\"w\">    <\/span><span class=\"k\">for<\/span><span class=\"w\"> <\/span><span class=\"n\">tree<\/span><span class=\"w\"> <\/span><span class=\"k\">in<\/span><span class=\"w\"> <\/span><span class=\"n\">tree_guard<\/span><span class=\"p\">.<\/span><span class=\"n\">iter<\/span><span class=\"p\">()<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">        <\/span><span class=\"n\">tree_details<\/span><span class=\"p\">.<\/span><span class=\"n\">push<\/span><span class=\"p\">(<\/span><span class=\"n\">TreeDetail<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">            <\/span><span class=\"n\">path<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"nc\">tree<\/span><span class=\"p\">.<\/span><span class=\"n\">path<\/span><span class=\"p\">.<\/span><span class=\"n\">clone<\/span><span class=\"p\">(),<\/span>\n<span class=\"w\">            <\/span><span class=\"n\">name<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"nc\">tree<\/span><span class=\"p\">.<\/span><span class=\"n\">name<\/span><span class=\"p\">.<\/span><span class=\"n\">clone<\/span><span class=\"p\">(),<\/span>\n<span class=\"w\">        <\/span><span class=\"p\">});<\/span>\n<span class=\"w\">    <\/span><span class=\"p\">}<\/span>\n<span class=\"w\">    <\/span><span class=\"k\">return<\/span><span class=\"w\"> <\/span><span class=\"n\">Json<\/span><span class=\"p\">(<\/span><span class=\"n\">tree_details<\/span><span class=\"p\">);<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n<p>The second example is even worse because it uses the idiomatic way to write Axum\nroute handlers. Conforming to the norm makes you a square, you should rebel\nagainst technical standards as much as possible.<\/p>\n<h2>Consider <code>.clone()<\/code> harmful<\/h2>\n<p>One of the core principles of Rust is memory safety, and one of its selling\npoints is that you can do most things with stack-allocated references that\nrequire heap allocation in other languages.<\/p>\n<p>It follows that you should listen to programming influencers and memers online\nwho say <em>never<\/em> to use <code>.clone()<\/code> unless you have skill issues. Using <code>.clone()<\/code>\non a <code>String<\/code> might allocate an extra 0.5kb of RAM, and on a personal computer\nin 2024, that's a lot.<\/p>\n<p>You should also make sure everything is on a CPU register and definitely never\nleaves the L1 cache. It's very important that you\n<a href=\"https:\/\/www.thetombomb.com\/posts\/make-it-work-right-fast\">make it fast, then make it work<\/a>.\nAfter all, if your code performs slower than a synthetic benchmark, it means\nyou're a bad programmer and you should feel bad. This is especially the case\nwhen you're trying to create an MVP rather than optimising a mature product.<\/p>\n<h2>Don't look for help<\/h2>\n<p>The internet is full of people ready to laugh at you for not being a Rust\nvirtuoso. Pay attention to the haters and ignore all the people who could help\nyou fix things. If you do post about an issue, take a distant and disinterested\nattitude so that people can't tell if you're joking or if you really need help\nwith a problem.<\/p>\n<p>Likewise, reading the <a href=\"https:\/\/doc.rust-lang.org\/stable\/book\/\">Rust book<\/a> is\nill-advised. Who reads books in 2024?<\/p>\n<p>Holding data where you don't yet know the type in a hashmap (see above) is\ndefinitely the best possible solution. Specialising types from a generic\ninterface sounds like it'd\n<a href=\"https:\/\/doc.rust-lang.org\/reference\/items\/type-aliases.html\">probably conflict<\/a>\n<a href=\"https:\/\/doc.rust-lang.org\/book\/ch10-02-traits.html\">with Rust's strict memory safety<\/a>.\n<a href=\"https:\/\/doc.rust-lang.org\/stable\/book\/ch06-01-defining-an-enum.html\">There's definitely no construct in Rust which allows multiple unlike data formats to share a location in a struct.<\/a><\/p>\n<p>You shouldn't research language features when using a language that you know\nuses several different paradigms to the ones you're familiar with. Rust is just\nC++ with quirks like lifetimes, after all.<\/p>\n<h2>Seriously, though<\/h2>\n<p>I'm not that good at Rust, and attempting a parser project involving concurrency\nas my first real project in the language was probably a sign of hubris.<\/p>\n<p>But hopefully, I'm slightly better than I was after making all these mistakes.<\/p>\n<p><a href=\"https:\/\/thethreevirtues.com\/\">Hubris is one of the three great virtues of programmers<\/a>,\nafter all.<\/p>\n<p>Now I've undone some of the questionable choices I made before, I feel a lot\nbetter moving forward with\n<a href=\"https:\/\/github.com\/fdavies93\/zenkat-rust\">zenkat-rs<\/a>, and managed to implement\na tree visualiser this weekend. Feel free to follow along with the project if\nyou find it interesting.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"software"}},{"@attributes":{"term":"rust"}},{"@attributes":{"term":"programming"}},{"@attributes":{"term":"webdev"}}]},{"title":"Why I Left NixOS for Ubuntu","link":{"@attributes":{"href":"https:\/\/fd93.me\/nixos-to-ubuntu.html","rel":"alternate"}},"published":"2024-05-02T00:00:00+08:00","updated":"2024-05-02T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2024-05-02:\/nixos-to-ubuntu.html","summary":"<p><img alt=\"\" src=\"images\/melting-snow.jpg\"><\/p>\n<p>If you've hung out in Linux enthusiast circles lately, you'll have heard whispers that Arch Linux is no longer hot product. Instead, all the cool kids are using something called NixOS.<\/p>\n<p>Since I bricked my Debian setup in an unfortunate accident involving compiling from source, I decided to give NixOS \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/melting-snow.jpg\"><\/p>\n<p>If you've hung out in Linux enthusiast circles lately, you'll have heard whispers that Arch Linux is no longer hot product. Instead, all the cool kids are using something called NixOS.<\/p>\n<p>Since I bricked my Debian setup in an unfortunate accident involving compiling from source, I decided to give NixOS a try. However, after hitting rock bottom and waking up, coldly sweating, in a darkened apartment surrounded by printouts of <code>configuration.nix<\/code>, I decided to return to the warm and wholesome embrace of Ubuntu.<\/p>\n<h2>Why I Used NixOS<\/h2>\n<p>It can be hard to understand the attraction of NixOS if you haven't had some exposure to infrastructure or system administration before.<\/p>\n<p>NixOS offers a unique set of features which make it very attractive from a system operator or power user perspective. These are largely based around avoiding issues which plague other Linux distributions.<\/p>\n<h3>Declarative Syntax and Reproducibility<\/h3>\n<p>Unlike most Linux distributions, NixOS's package manager is not primarily designed to pull down binaries from a repository. It's designed to create reproducible setups in a series of plaintext <code>.nix<\/code> files, starting with <code>configuration.nix<\/code>.<\/p>\n<p>In <code>configuration.nix<\/code> you'll find options that in other distributions are hidden away in murky utilities or config files. For example, which mode should a system's graphics card be set to? Should CUDA be enabled on this system? Do we want to have Wayland, X, or both as our display server?<\/p>\n<p>You can also install programs and system utilities this way. By adding them to <code>configuration.nix<\/code> and running <code>nixos-rebuild switch<\/code> you rebuild your current system configuration and add it as a new boot option. Since NixOS is a static distribution, this is done without manipulating existing binaries or system settings, and can be rolled back at any time.<\/p>\n<p>Rather than running an install utility, we use the Nix language to say what we want, and then tell <code>nixos-rebuild<\/code> to make it so.<\/p>\n<p>This means you can take a <code>configuration.nix<\/code> file, give it to your friend, and they'll be able to easily reproduce your setup. This has made NixOS popular for ricing in some circles, as it allows entire desktop setups to be shared as a series of plaintext files - much easier than throwing VMs or complex setup scripts around the internet.<\/p>\n<p>This is similar to the way Unix setups already handle config. Most Linux utilities, and a lot of MacOS ones, put their config files in the <code>.config<\/code> folder for a given user. Since these files are just text, you can back them up easily, and pull them onto different systems if you switch computer.<\/p>\n<h3>Isolated Environments<\/h3>\n<p>Last time I bricked Debian, it was by creating dependency hell.<\/p>\n<p>Dependency hell is a situation where two different pieces of software use different and incompatible versions of the same library. For example, App A uses <code>libga 1.3<\/code> while App B uses <code>libga 2.1<\/code>. We can't install both versions of <code>libga<\/code> at the same time. Therefore we can't use App A and App B at the same time.<\/p>\n<p>This happens <em>a lot<\/em> when you need to install packages from binaries or compile from source. On Debian, this situation comes up often: most projects choose to support <em>Ubuntu<\/em> rather than <em>Debian<\/em>, and the common workaround is just to supply the source code or a <code>.deb<\/code> binary.<\/p>\n<p>One of the unique features of NixOS is its adherence to isolated, immutable environments for different apps, including the dependencies of a package. This means that unlike with other distributions, especially Debian-based distros, you almost never run into dependency hell.<\/p>\n<p>Instead, Nix will simply install <em>both dependencies<\/em> and link the applications to different versions. This simply isn't possible on most distros without using a container runtime like Flatpak or Snap.<\/p>\n<p>This means that it's possible to run packages which are incompatible on NixOS without creating dependency hell. On most distros I find that my preferred image editor, <a href=\"https:\/\/www.pinta-project.com\/\">Pinta<\/a>, often breaks due to the GTK and LibMono versions available, but on NixOS it ran perfectly first time.<\/p>\n<p>Isolated environments also make NixOS a lot more resilient to subtle issues which can break other Linux distros. For example, in Debian Sid (unstable branch), utilities often break for unspecified periods of time while their dependencies catch up. If you're unlucky enough to have one of those dependencies be something critical for your system -- say <code>glibc<\/code> goes out of sync with <code>nvidia-drivers<\/code> -- then you'll face a sudden system failure on update.<\/p>\n<p>NixOS rarely has these issues. Since it's an immutable distribution, it also stores previous versions of the environment so you can roll back when you <em>do<\/em> encounter a system failure. On other distributions you need to use an extra utility like <a href=\"https:\/\/github.com\/linuxmint\/timeshift\">Timeshift<\/a> for this.<\/p>\n<h2>Why I Left NixOS<\/h2>\n<p>Given the benefits of NixOS I outlined above, why'd I leave? Mostly, it was down to issues with everyday usage which don't happen on competing distributions.<\/p>\n<h3>Config Files are a Timesink<\/h3>\n<p>When configuration is done via text file, you have to manage those text files. Rather than a package manager like <code>pacman<\/code> or <code>apt<\/code> which handles most of the complicated stuff, NixOS makes the end user responsible for their own system configuration. This paradigm makes a lot of sense in a business and system administration context, but not so much in everyday desktop usage.<\/p>\n<p>Often, <code>configuration.nix<\/code> doesn't offer options that are part of the underlying binaries and there's not a clear way to access those options.<\/p>\n<p>While I could write my own configuration files, or hack around with existing ones, this adds a time and maintenance burden that I don't want to deal with to use my daily driver.<\/p>\n<p>This is the same problem that I found when I was daily driving <code>nvim<\/code> -- I spent a lot of time playing with plugin options and wrastling my configuration, when I could have been working on more interesting and productive technical challenges.<\/p>\n<h3>The Downsides of Sandboxing<\/h3>\n<p>One of the languages I write most is Python. In Python, the normal way to separate project dependencies is to use a <code>venv<\/code>. It's also common to use a few global tools like PyLsp or PyLance for linting and formatting.<\/p>\n<p>NixOS's sandboxed model breaks many Python setups. <code>venv<\/code> does not work correctly under NixOS, and global dependencies like PyLance also fail. This means that the main package manager for Python, <code>pip<\/code>, is crippled on NixOS. There are Nix packages which replace many of the packages normally provided by pip, but as they're community contributed they are often out of date or slightly broken.<\/p>\n<p>This problem isn't unique to Python. Common Linux utilities like GIMP and ffmpeg were challenging to configure for NixOS. Installing Nvidia's CUDA module even required NixOS to compile GIMP from source, which took two hours.<\/p>\n<p>Less important than Python breaking, but still of concern to the desktop Linux enthusiast, is that GTK themes often break under NixOS. Not every application will correctly pick up custom themes and icons, and they sometimes require extensive configuration to pick up styles correctly.<\/p>\n<p>I've experienced similar woes with other container runtimes like Snap and FlatPak. However, since NixOS is a fully sandboxed distribution, the general issues with isolated apps are much more prominent than when you're merely <em>using<\/em> a container runtime on a conventional distribution.<\/p>\n<p>Nix's sandboxed model therefore works well in a server or workstation context, but for a general purpose desktop a more conventional distribution is probably more suitable.<\/p>\n<h3>Stability Oversold<\/h3>\n<p>As I mentioned above, Nix can have some issues with unusual configurations like CUDA and sometimes fails to correctly pick up environment variables correctly.<\/p>\n<p>More serious than this is the rare occasions Nix packages conflict with each other. While Nix separates dependencies, it doesn't separate them as absolutely as a full container system like Docker. Therefore it is <em>possible<\/em>, albeit unlikely, to end up with conflicts between versions of installed libraries.<\/p>\n<p>In the end this is what made me decide to leave Nix: I installed a new display manager and immediately broke my desktop setup. This wasn't helped by the inadequate support available online.<\/p>\n<h3>Lack of Support<\/h3>\n<p>The need to play with config files, fix stability issues and manage issues with configuration would be less of a drag if there were a NixOS resource comparable to the <a href=\"https:\/\/wiki.archlinux.org\/\">Arch Wiki<\/a>. However, the community resources available for Nix are far more scarce than for Arch. <\/p>\n<p>NixOS also follows a radically different paradigm to Arch or Debian, so you can't reuse the resources for those distros like you could on derivatives like Linux Mint or EndeavourOS.<\/p>\n<p>Since Nix is a community distribution, it also doesn't have a corporate backer who can provide official support, unlike RHEL, SUSE, or Ubuntu.<\/p>\n<p>The small community and lack of official support means that you're likely to spend a lot of time fixing issues yourself, reading documentation, and piecing together clues from various sources. This is fine if you're a technologist, but it's a major timesink.<\/p>\n<h2>Why Ubuntu?<\/h2>\n<p>Ubuntu is out of favor with Linux enthusiasts for a number of reasons. One of the main ones is good old-fashioned elitism: Ubuntu is known for being easy to use, and therefore has a reputation as a beginner distribution.<\/p>\n<p>In the last few years Ubuntu has also been plagued with a number of controversies which have damaged its reputation compared to the halcyon days of yore.<\/p>\n<p>For reasons of pride I almost went with an Ubuntu derivative or respin like Linux Mint or PopOS. I ran Mint for a couple of days before remembering why I moved away from it - Mint is an opinionated, complete experience which goes against a lot of what I enjoy about Linux. Meanwhile, PopOS is currently on a delayed release schedule due to the maintainers, System76, moving to a new desktop environment built in Rust.<\/p>\n<p>I ran Debian, Ubuntu's parent distribution, for a long time and also considered moving back to that. However, Debian has some of the same issues as NixOS, especially lacking widespread support and requiring close attention to detail in system configuration. It also has generally worse driver support and fewer packages available to it due to a lack of PPAs (community repositories).<\/p>\n<p>While many of the issues with Debian can be resolved by compiling from source, this has been one of the main causes of system failure for me in the past. It also requires equal or greater effort than playing with Nixfiles.<\/p>\n<p>As a DIY distribution, Arch would have recreated my config file woes on a grand scale. I'm also not a huge Arch fan and dislike <code>pacman<\/code> as a package manager.<\/p>\n<p>With all these considerations in mind, and not wanting to move to unfamiliar distributions like Fedora or OpenSUSE for my daily driver, I decided to just stick with Ubuntu. To fit my preference for some light ricing and desktop configuration, I opted to start with Ubuntu Server and build up a system with only the apps I wanted.<\/p>\n<p>Even taken on its own merits, Ubuntu is a good option for a daily driver no matter the user's level of experience. This is for several reasons.<\/p>\n<h3>It Just Works\u2122<\/h3>\n<p>Nearly every version of Linux has issues with drivers at some point. The specifics vary depending on your hardware, but I've found that wifi and graphic cards on laptops are the main culprits.<\/p>\n<p>My laptop happens to have hybrid graphics between an AMD Ryzen 5600 and an Nvidia RTX 3050 mobile. This has historically been a big problem on Linux, since configuring hybrid graphics setups involves a great deal of interplay between open-source and proprietary drivers.<\/p>\n<p>On NixOS this issue wasn't so bad, and I was able to configure my setup using settings from the wiki. However, it did run less efficiently than on my previous (Debian) setup.<\/p>\n<p>Meanwhile, on Ubuntu my drivers worked immediately on installation, with no need for additional configuration. While I did opt to switch power mode for performance reasons, this was trivial and the Nvidia app needed to do it was readily available as part of the package manager.<\/p>\n<p>Ubuntu (and its derivatives, especially PopOS) is one of the few distributions I've seen which consistently has hardware work out of the box. While this might be offensive to Arch users, I tend to feel that most Linux users want to be able to customise their <em>experience<\/em> more than the details of how their hardware and system daemons are set up. I appreciate that Ubuntu handles the details of <em>how<\/em> to get my system running so I can focus on actually using it.<\/p>\n<h3>Widespread Support<\/h3>\n<p>Ubuntu is widely used by enthusiasts and small businesses. While <a href=\"https:\/\/store.steampowered.com\/hwsurvey\/Steam-Hardware-Software-Survey-Welcome-to-Steam?platform=linux\">evidence suggests<\/a> it's been pushed out by Arch in the desktop space, for years it was the most dominant distro, and it's still much more widely used than Arch in server setups.<\/p>\n<p>With widespread usage comes widespread support. Most serious projects target Ubuntu as one of their Linux targets, and many of them ship PPAs (community repositories) for Ubuntu. In addition, a lot of projects ship <code>.deb<\/code> packages, which are compatible with every Debian-based distro, including Ubuntu.<\/p>\n<p>NixOS has more limited official support. While it boasts the largest collection of packages, most of these are community-contributed and therefore vary in quality. Most Nix packages which I used <em>worked<\/em> but many of them lacked the configuration options which you get in other distributions. <\/p>\n<p>Where Nix packages did have good configuration support, it was arguably a better experience than dealing with Ubuntu packages, but this was a minority of cases.<\/p>\n<h2>Conclusion<\/h2>\n<p>NixOS has significant advantages over more conventional distributions -- <em>in the professional server and workstation space<\/em>. However, for daily driving and desktop usage, there are better alternatives for most users.<\/p>\n<p>If you're already a hardcore Linux nerd and don't mind spending a ton of time configuring and optimising your system, then NixOS might be for you. However, even for software engineers, NixOS can introduce problems that don't exist on conventional distributions. It can also exhibit unexpected behaviours like rebuilding from source on a configuration change.<\/p>\n<p>While I generally disagree with the cliche that \"Linux is free if you don't value your time\", in desktop NixOS it feels that way. For people who see Linux as a blank canvas for DIY, this might be attractive. However, I prefer technology which improves my productivity, rather than hampering it.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"software"}},{"@attributes":{"term":"linux"}},{"@attributes":{"term":"nixos"}},{"@attributes":{"term":"ubuntu"}}]},{"title":"The Mindful Desktop - How to Increase Your Productivity in the Attention Economy","link":{"@attributes":{"href":"https:\/\/fd93.me\/mindful-desktop.html","rel":"alternate"}},"published":"2024-03-11T00:00:00+08:00","updated":"2024-03-11T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2024-03-11:\/mindful-desktop.html","summary":"<p><img alt=\"\" src=\"\/images\/stacked-stones.jpg\"><\/p>\n<p><strong>If you just want the VirtualBox VM for this article without the philosophising, <a href=\"\/mindful-desktop#appendix\">skip to the appendix.<\/a><\/strong> <\/p>\n<p>We live in a world full of distractions. In the modern \"attention economy\" it's more of a challenge to avoid content and advertising than it is to find it.<\/p>\n<p>Nowhere is this more \u2026<\/p>","content":"<p><img alt=\"\" src=\"\/images\/stacked-stones.jpg\"><\/p>\n<p><strong>If you just want the VirtualBox VM for this article without the philosophising, <a href=\"\/mindful-desktop#appendix\">skip to the appendix.<\/a><\/strong> <\/p>\n<p>We live in a world full of distractions. In the modern \"attention economy\" it's more of a challenge to avoid content and advertising than it is to find it.<\/p>\n<p>Nowhere is this more obvious than when we sit down at our computers to work. I look at my browser - with tabs open from last night - and see that I have 10 new videos from my favorite channels. I open my emails to see if I have anything from clients and am notified that I have 50 new messages in 5 inboxes.I go to my messaging app to ask if my partner wants anything for breakfast, and get sucked into a conversation on a group chat, from which I surface 45 minutes later to find myself hungry and undercaffeinated.<\/p>\n<p>For Jenny Odell in <em>How to Do Nothing<\/em>, the attention economy isn't taken seriously enough as a threat to our self-determination:<\/p>\n<blockquote>\n<p>We experience the externalities of the attention economy in little drips, so we tend to describe them with words of mild bemusement like \u201cannoying\u201d or \u201cdistracting.\u201d But this is a grave misreading of their nature. In the short term, distractions can keep us from doing the things we want to do. In the longer term, however, they can accumulate and keep us from living the lives we want to live, or, even worse, undermine our capacities for reflection and self-regulation, making it harder, in the words of Harry Frankfurt, to \u201cwant what we want to want.\u201d Thus there are deep ethical implications lurking here for freedom, wellbeing, and even the integrity of the self.<\/p>\n<\/blockquote>\n<p>My resolution this year was to simplify my life. That implies to orient myself <em>away<\/em> from the vociferous maw of the internet and <em>towards<\/em> more mindful ways of engaging with technology.<\/p>\n<p>And yet, while my experience is partly a result of my tendencies - I was a fiend for bulletin boards even as a teen - the reason why you have had similar experiences is because a lot of people profit from the attention economy. A lot of money is dumped into marketing and user experience hacks to keep you coming back to the same sites, viewing more advertisements, buying more products.<\/p>\n<p>This extends to the design of the technology we use. It's no mistake that the default for notifications is 'on', nor that you always see ads before useful content, nor that most sites require email sign-ups to use services that have absolutely no purpose for your email other than advertising.<\/p>\n<p>One way we can resist the attention economy's theft of our time, then, is to resist its entry onto our screen. With a bit of care, we can push unwanted interruptions away from us and reclaim agency over our time and our use of technology. We can use engineering to build technology that benefits us, not companies that want to use our engagement to sell ads.<\/p>\n<p>In this article I'm going to describe a way to set up a desktop environment that's free of, and actively discourages, getting sucked into the many distractions of the attention economy. This is based on my own experience with trying to build a desktop environment that serves me while still being practical to work with. It also includes a virtual machine which you can use as a basis for your own setup or as a focused work environment.<\/p>\n<h2>Step 1: Start with Linux<\/h2>\n<p>Linux provides a strong base for any attempt to rid ourselves of distractions. Unlike commercial operating systems, it's built for the needs of users - specifically for nerdy power users - and doesn't feature ads or other attention-getters like notifications unless we ask for them.<\/p>\n<p>In my setup I went with <a href=\"https:\/\/debian.org\/CD\/netinst\/\">Debian netinstall<\/a> as the basis for my system. This is because Debian works on a wide variety of hardware out of the box and requires little configuration to get working, while being lightweight and stable. The netinstall version also lets you start from a minimal base and choose your own desktop. I daily drove Debian until last year for these reasons.<\/p>\n<p>While I've recently switched to NixOS and considered using it in this setup, I feel like the advantages of that distro don't line up perfectly with promoting mindfulness, because of the amount of time you spend in <code>\/configuration.nix<\/code>. Debian is a much stronger candidate for never worrying about your system.<\/p>\n<h2>Step 2: Manage your windows<\/h2>\n<p>This section was almost titled \"Use a Window Manager\". Why isn't it?\nBecause regardless of which software you use, there's always the ability to get distracted. What's more important than your choice of technology is your approach to window management. Note that these are principles and not strict rules.<\/p>\n<p><strong>Use one screen.<\/strong> Multiple monitors are helpful for some tasks, but it's all too tempting to put Discord or emails on one monitor while working on another one, which invites distraction. Keep the extra 3 screens disabled until you need them. <\/p>\n<p><strong>One window per screen.<\/strong> This means that you have little ability to get distracted by action in your peripheral vision. Keep other windows out of sight unless you need them for your current task, and hide them when they're not needed.<\/p>\n<p><strong>Know where your windows live.<\/strong> The easiest way to achieve this is to use workspaces, which are a feature of most Linux desktop environments. Two features which should be avoided: stacking windows and minimising them. If a window exists in your current space, you should know about it.<\/p>\n<p>There are several ways to achieve these goals:<\/p>\n<ul>\n<li>Use a tiling window manager like <a href=\"https:\/\/i3wm.org\/\">i3<\/a> or <a href=\"https:\/\/swaywm.org\/\">sway<\/a><\/li>\n<li>Use a conventional desktop or stacking window manager with workspaces, and make sure all windows are visible on each workspace<\/li>\n<li>Use an exotic window manager like <a href=\"https:\/\/github.com\/paperwm\/PaperWM\">PaperWM<\/a> or <a href=\"https:\/\/github.com\/material-shell\/material-shell\">Material Shell<\/a> which force the above principles.<\/li>\n<li>Don't use workspaces or tiling, and close programs when you stop using them (the old-skool method).<\/li>\n<\/ul>\n<p>For my minimal demo setup I decided on <a href=\"http:\/\/openbox.org\/wiki\/Main_Page\">openbox<\/a>. This is a very simple stacking window manager which I feel encourages using the old-skool method by default, while also following the next principle I outline below.<\/p>\n<h2>Step 3: Economise on software<\/h2>\n<p>One of the main distractions when using a computer is having too many apps you need to switch between a lot. Let me give an example from programming. This is exaggerated but realistic:<\/p>\n<ul>\n<li>You are briefed about a feature by a product team via email.<\/li>\n<li>The engineers discussed that feature on Slack.<\/li>\n<li>There's also a Markdown file floating around with someone's meeting notes, which is <em>essential<\/em> because the CTO made some requirement changes in that meeting.<\/li>\n<li>The card for that feature was found on Notion with a few extra comments.<\/li>\n<li>The codebase where we'd implement that feature was in a gitlab  repository.<\/li>\n<li>The API documentation was automatically generated and hosted on an internal network.<\/li>\n<\/ul>\n<p>In order to have a full picture of the feature and not disappoint any stakeholders, an engineer would need to navigate <strong>six<\/strong> different software systems and somehow retain all that information while coding.<\/p>\n<p>Scenarios like this happen constantly in the professional world, and we often don't have any control over them. They represent a tremendous waste of time, money and human potential. At least in our own setup we can mitigate them. How?<\/p>\n<p>Let's take some advice from Guido van Rossum in <a href=\"https:\/\/peps.python.org\/pep-0020\/\">PEP 20, \"The Zen of Python\"<\/a>:<\/p>\n<blockquote>\n<p>There should be one-- and preferably only one --obvious way to do it.<\/p>\n<\/blockquote>\n<p>This applies both in writing code and in designing workflows. We should have <strong>one<\/strong> tool for writing documentation, <strong>one<\/strong> tool for browsing the web, and <strong>one<\/strong> tool for discussion. Where possible there should be no overlap between these systems, to reduce the mind-numbing redundancy of copy-pasting meeting notes into emails, Slack, and your project management system.<\/p>\n<p>In my personal setups, I achieve this by using two apps for the vast majority of my daily work: <a href=\"https:\/\/helix-editor.com\/\">Helix<\/a> and Google Chrome. My notes live in a git repository. My files are managed by <a href=\"https:\/\/github.com\/ranger\/ranger\">Ranger<\/a>, a CLI file manager I can leave running in 1\/4 of my console. My site is written in plain text, with Markdown.<\/p>\n<p>If you are not an engineer, then your workflow will look slightly different. What's important is that the apps you use are curated and suit the work you do. If you find you're not using an app, perhaps it's best to uninstall it.<\/p>\n<p>In the virtual machine, I've included the bare minimum set of apps needed for working on a computer. I broke the rules slightly by including both GUI and console based versions of the same apps, but I felt like this was a reasonable compromise to make the VM more accessible to a wider range of users.<\/p>\n<h2>Conclusion<\/h2>\n<p>While the attention economy is massive and ever-expanding, we can take steps to resist it and reclaim our time. Willpower is not enough: we also need to change the technologies that we use in our day-to-day life to promote more mindful use of technology.<\/p>\n<p>In the context of designing our desktop computing experience, this means following three steps:<\/p>\n<ol>\n<li>Start with Linux<\/li>\n<li>Manage your windows<\/li>\n<li>Economise on software<\/li>\n<\/ol>\n<p>There's also a lot of scope for other engineering efforts to reduce distractions and help people stay focused and in control of their digital lives. Since the book <a href=\"https:\/\/www.goodreads.com\/en\/book\/show\/40672036\">Digital Minimalism<\/a> was released in 2019, some of these have been widely adopted - such as monitoring screen time. <\/p>\n<p>However, recent innovations like TikTok and short video formats, which are designed to maximise engagement even more than other media formats, show that the attention economy is unlikely to slow down, barring legislation or paradigm shift. <\/p>\n<p>Time is the one resource we can't create. To make the most of it, we need to guard ourselves against distractions by any means necessary.<\/p>\n<h2><span id=\"appendix\">Appendix: A Mindful Desktop<\/span><\/h2>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1TE8uTomca5R8t7jfVwdcNtyZakfjed9f\/view\">Click here<\/a> to get the demo virtual machine. It's set up to be light and minimal while being accessible to both power users and beginners with some technical skills. It runs on <a href=\"https:\/\/www.virtualbox.org\/\">Oracle Virtualbox<\/a>, which is widely available on most operating systems.<\/p>\n<h3>Basics<\/h3>\n<ul>\n<li><strong>Base:<\/strong> Debian 12 Netinstall<\/li>\n<li><strong>Desktop environment:<\/strong> Openbox<\/li>\n<li><strong>RAM Usage (idle):<\/strong> ~220MB<\/li>\n<\/ul>\n<h3>Login Details<\/h3>\n<p>These should be changed if you want to use the VM regularly.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>User: root\nPassword: mini\n\nUser: mini\nPassword: mini\n<\/code><\/pre><\/div>\n\n<h3>Installed packages<\/h3>\n<p>You can remove and replace most of these, but be aware that removing utilities from the system utilities section might break the setup - make sure you know what you're doing if you want to modify this section.<\/p>\n<p>Because this is a VM, <em>there are no bluetooth or wireless utilities installed<\/em> as these are assumed to be handled by the host PC. If you want to replicate the setup on bare metal, you'll need to account for these and other hardware requirements.<\/p>\n<p>Instructions on how to configure the key components (X11, LightDM, Openbox) can be found on the Debian Wiki and in those projects' documentation.<\/p>\n<h4>System Utilities<\/h4>\n<ul>\n<li>X11<\/li>\n<li>LightDM<\/li>\n<li>OpenBox<\/li>\n<li>git<\/li>\n<li>wget<\/li>\n<li>sudo<\/li>\n<li>feh<\/li>\n<\/ul>\n<h4>Apps<\/h4>\n<ul>\n<li>ARandR<\/li>\n<li>PCManFM<\/li>\n<li>ranger<\/li>\n<li>sakura<\/li>\n<li>Falkon<\/li>\n<li>neovim<\/li>\n<li>FeatherPad<\/li>\n<li>neofetch<\/li>\n<\/ul>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"mindfulness"}},{"@attributes":{"term":"software"}}]},{"title":"Stacks for Simple Static Sites","link":{"@attributes":{"href":"https:\/\/fd93.me\/simple-sites-stack.html","rel":"alternate"}},"published":"2024-02-17T00:00:00+08:00","updated":"2024-02-17T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2024-02-17:\/simple-sites-stack.html","summary":"<p><img alt=\"\" src=\"\/images\/static-site-stack-header.jpeg\"><\/p>\n<p>Wouldn't it be great if you could type out an article on your computer, push a\ncouple of buttons, and have it appear on the web? No clunky page builders, no \nadmin logins, and no mandatory updates. <\/p>\n<p>With the right setup for your website, this is possible.<\/p>\n<p>I wrote about \u2026<\/p>","content":"<p><img alt=\"\" src=\"\/images\/static-site-stack-header.jpeg\"><\/p>\n<p>Wouldn't it be great if you could type out an article on your computer, push a\ncouple of buttons, and have it appear on the web? No clunky page builders, no \nadmin logins, and no mandatory updates. <\/p>\n<p>With the right setup for your website, this is possible.<\/p>\n<p>I wrote about <a href=\"simple-sites\">the benefits of simple sites<\/a> before. \nBut I didn't say how to actually create one.<\/p>\n<p>This article looks at the general shape of a static site and some of the options\navailable.<\/p>\n<p>A stack for a static site needs to include:<\/p>\n<ul>\n<li>A way to build the site - how does your content go from plain text to a web\n  page?<\/li>\n<li>A web host and CI\/CD - whose servers are your content hosted on? How does your \ncontent get from your computer to the web?<\/li>\n<li>(Optional) Interactions and addons - how do you handle interactive parts \nof the site like form submissions? How do you embed analytics?<\/li>\n<\/ul>\n<p>Let's examine each of these.<\/p>\n<h2>Building the Site<\/h2>\n<p>To make a decent static site we need a way to build it from source files. This is\nnecessary because:<\/p>\n<ul>\n<li>HTML documents have poor support for repeating components. That means that your\n  header, sidebar, and other elements that should be the same between pages will\n  need to be copied beween pages manually if you use plain HTML. While the <code>&lt;template&gt;<\/code> \n  tag and shadow DOM can work around this, their interfaces aren't exactly\n  <em>simple<\/em>.<\/li>\n<li>Baseline HTML is verbose and not ideal for casual writing.\n  Formats like <a href=\"https:\/\/www.markdownguide.org\/\">Markdown<\/a> and <a href=\"https:\/\/asciidoc.org\/\">AsciiDoc<\/a>\n  are widely used because they're simpler to read and write for human beings.\n  While <a href=\"https:\/\/www.semrush.com\/blog\/semantic-html5-guide\/\">semantic HTML<\/a>\n  addresses the readability issue, it does nothing to address the repeatability issue. <\/li>\n<\/ul>\n<p>There are many ways to build a static site based on your needs and the\nlanguage you're comfortable with. But they follow two basic\napproaches.<\/p>\n<h3>Approach 1: Use a site builder<\/h3>\n<p>A site builder is the quickest way to get up and running. They usually\ncome with themes included, and can render formats like Markdown or\nAsciiDoc into plain HTML. They often have config options for common setups (like\nGoogle Analytics) and plugins to help with deploying and optimising content.<\/p>\n<p>They're easy to use and quick to deploy, but site builders can be \ninflexible. Most can only build sites in a blog-like setup, and \nunless you want to write your own theme you might be stuck choosing between \nimperfect templates. Site builders are available in a variety of languages, \ndepending on your preference.<\/p>\n<p>Some popular site builders include:<\/p>\n<ul>\n<li><a href=\"https:\/\/gohugo.io\">Hugo<\/a>, Go<\/li>\n<li><a href=\"https:\/\/gatsbyjs.com\">Gatsby<\/a>, ReactJs<\/li>\n<li><a href=\"https:\/\/jekyllrb.com\">Jekyll<\/a>, Ruby <\/li>\n<li><a href=\"https:\/\/hyde.github.io\">Hyde<\/a>, Python<\/li>\n<li><a href=\"https:\/\/getpelican.com\">Pelican<\/a>, Python<\/li>\n<li><a href=\"https:\/\/getzola.org\">Zola<\/a>, Rust<\/li>\n<\/ul>\n<p>This site is written in Pelican because my language of choice is Python, because\nit renders Markdown files, and because I was already familiar with Jinja, its\ntemplate language. <\/p>\n<h3>Approach 2: Build with a template language<\/h3>\n<p>This option is closer to developing a website from scratch. It takes longer,\nbut you get a lot more flexibility.<\/p>\n<p>A <strong>template language<\/strong> lets you build HTML pages yourself. You can usually embed\ndifferent components in a larger template, and use logic like if statements and\nloops to generate parts of webpages. You can then write a short script in your \nprogramming language of choice to build the static site of your dreams.<\/p>\n<p>There are several popular template languages:<\/p>\n<ul>\n<li><a href=\"https:\/\/jinja.palletsprojects.com\">Jinja<\/a> - the default with Flask. \n  Also commonly used with Django and other Python projects.<\/li>\n<li><a href=\"https:\/\/ejs.co\">EJS<\/a> - the original Javascript templating language.<\/li>\n<li><a href=\"https:\/\/handlebarsjs.github.io\">Mustache<\/a> - probably the most popular templating\nsystem. Available in a variety of languages.<\/li>\n<li><a href=\"https:\/\/shopify.github.io\/liquid\/\">Liquid<\/a> - an originally Ruby-based templating\n  approach, created and used by Shopify. <\/li>\n<\/ul>\n<h2>Web Host and CI\/CD<\/h2>\n<p>When choosing a web host for your static site you probably want the cheapest,\nfastest, and best.<\/p>\n<p>The key is <strong>not to use a server<\/strong>. Instead, you want to serve \nyour site on the edge. You can achieve this with providers like\n<a href=\"https:\/\/vercel.com\">Vercel<\/a> or <a href=\"https:\/\/netlify.com\">Netlify<\/a>. If you prefer \nto be more hands-on you can use \n<a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/userguide\/WebsiteHosting.html\">AWS S3 buckets via Amazon Cloudfront<\/a>. \n<a href=\"https:\/\/pages.github.com\/\">Github pages<\/a> \nis also a good choice but requires a paid subscription for some features. \nThis site is deployed on the Vercel network as it's easy to use and currently\nfree for static sites with custom domain names.<\/p>\n<p>In all cases, you're uploading your site's assets to a\nCDN (content distribution network). This is a network of hundreds of servers\nworldwide which hosts your static content. Because static sites don't need\ncomplex infrastructure, they can be hosted cheaply - all the CDN needs to\ndo is deliver a few HTML files and images to clients on demand. Because they're\nclose to the user, they deliver content fast globally.<\/p>\n<p>To push updates from your computer to a CDN automatically, you need a code\nrepository with a CI\/CD set up. If you chose Vercel or Netlify, \nthey have integrations with Github and Gitlab built in, meaning you don't\nneed to worry about exactly <em>how<\/em> your code gets pushed to those networks. If\nyou chose AWS, then you'll need to use a <a href=\"https:\/\/github.com\/features\/actions\">Github Actions<\/a> \nworkflow or similar to build your site and upload its content to the bucket.<\/p>\n<p>The specifics vary, but deployments take three steps:<\/p>\n<ol>\n<li>Push your source code to a repository<\/li>\n<li>Build the site using your site builder or template engine<\/li>\n<li>Push the new static content to your CDN<\/li>\n<\/ol>\n<p>You'll need to configure some options on your hosting provider to get\nyour static content to show correctly. For example, Vercel has an option for\n'pretty routes' which turns urls like <code>example.com\/page.html<\/code> into\n<code>example.com\/page<\/code>, which was needed for Pelican to link pages successfully.<\/p>\n<h2>Interactions and Analytics<\/h2>\n<p>You always have Javascript available to you. You can write code to do\neverything that's possible in a more complex setup, like displaying modals and\nburger menus, in the same way on a static site.<\/p>\n<p>But since there's no server backing your website, you can't build a backend 'app'.\nBut that doesn't mean you can't build interactions or forms.<\/p>\n<p>We can use the <a href=\"https:\/\/www.patterns.dev\/vanilla\/islands-architecture\/\">Islands Architecture<\/a>\nto build out webpages with interactive elements. There are two basic ways of\nachieving this:<\/p>\n<ul>\n<li>Use third-party services to provide interactivity<\/li>\n<li>Write edge functions to provide a lean backend<\/li>\n<\/ul>\n<p>Third-party services range from integration platforms like\n<a href=\"https:\/\/ifttt.com\">IFTTT<\/a> to comments plugins like <a href=\"https:\/\/disqus.com\/\">Disqus<\/a>.\nThey're the fastest way to get the functionality you want, but they can be\nexpensive for the value they provide. (This doesn't include IFTTT, which I think\nis <em>great<\/em> value.)<\/p>\n<p>Another solution is to write your own edge functions. These are small\nsnippets of code which, like your website, are hosted on an edge network of\nservers. Netlify, Vercel, and AWS all have their own versions. You can use edge\nfunctions to do a lot of basic backend tasks, from managing uploads to taking\nform submissions. With <a href=\"https:\/\/turso.tech\/\">Turso<\/a> it's even possible to host\ndatabases on the edge.<\/p>\n<p>It's often helpful to know how many people are visiting your site, especially \nif it's something like a blog. Luckily, common analytics solutions like \n<a href=\"https:\/\/analytics.google.com\">Google Analytics<\/a> can easily be embedded into the\n<code>&lt;head&gt;<\/code> tag of your site by modifying your templates or through some\nconfiguration option in your site builder.<\/p>\n<h2>Conclusion<\/h2>\n<p>Static sites are fast and cost-effective ways to reduce the time between writing\nan article and publishing it. With a good setup you can type out an article and\nput it online in a couple of hours. This kind of pace is normally restricted to \nfull-time writers like journalists.<\/p>\n<p>By deploying to an edge network, static sites can be as fast\nas solutions costing hundreds of dollars a month - for free.<\/p>\n<p>My current workflow looks like:<\/p>\n<ul>\n<li>Write a draft in Markdown<\/li>\n<li>Edit it into a second draft<\/li>\n<li>Add images and correct formatting<\/li>\n<li>Push it to Github<\/li>\n<\/ul>\n<p>The Vercel integration and build commands take care of the rest, and content\ncomes online as little as a minute after I push it.<\/p>\n<p>If you want the benefits of speed and ease of publishing, perhaps you should give \nstatic sites a try.<\/p>\n<p><em>If you're interested in tutoring, <a href=\"\/pages\/classes\">click here<\/a>.<\/em><\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"programming"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"webdev"}}]},{"title":"The Unreasonable Effectiveness of Simple Websites","link":{"@attributes":{"href":"https:\/\/fd93.me\/simple-sites.html","rel":"alternate"}},"published":"2024-02-11T00:00:00+08:00","updated":"2024-02-11T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2024-02-11:\/simple-sites.html","summary":"<p><img alt=\"\" src=\"\/images\/pexels-tirachard-kumtanom-587441.jpg\"><\/p>\n<p>Simple websites are better than beautiful ones.<\/p>\n<p>I'll repeat that for the folks in the back.<\/p>\n<p><strong>Simple websites are better than beautiful ones.<\/strong><\/p>\n<p>Let me be clear what I mean by a simple website. I don't mean a Wordpress site\nwith a minimalist theme. I also don't mean a Substack \u2026<\/p>","content":"<p><img alt=\"\" src=\"\/images\/pexels-tirachard-kumtanom-587441.jpg\"><\/p>\n<p>Simple websites are better than beautiful ones.<\/p>\n<p>I'll repeat that for the folks in the back.<\/p>\n<p><strong>Simple websites are better than beautiful ones.<\/strong><\/p>\n<p>Let me be clear what I mean by a simple website. I don't mean a Wordpress site\nwith a minimalist theme. I also don't mean a Substack, a Medium, or a Blogger\nsite (remember those?).<\/p>\n<p>No, what I mean is an old-fashioned Web 1.0 website. For style examples, \ntake <a href=\"https:\/\/paulgraham.com\/\">Paul Graham's site<\/a>,\n<a href=\"https:\/\/news.ycombinator.com\/\">Hacker News<\/a>, \n<a href=\"https:\/\/madhadron.com\/programming\/index.html\">madhadron's blog<\/a>, and <strong>this\nsite<\/strong>. (To my lasting regret I have not achieved the spare minimalism of pg's\nblog.)<\/p>\n<p>These sites have two things in common:<\/p>\n<ul>\n<li>They look like they're from the 90s. They suck.<\/li>\n<li>They're created by experienced developers.<\/li>\n<\/ul>\n<p>Paul Graham, being one of the most successful investors in the Valley, easily\nhas the resources to have a <a href=\"https:\/\/www.apple.com\/\">modern site<\/a> with animations,\nbeautiful photography, and fancy scrolling-in pieces of text.<\/p>\n<p>So why doesn't he?<\/p>\n<p>Modern frameworks like React make it very easy to create aesthetically pleasing\nwebsites. There are component libraries like <a href=\"https:\/\/flowbite.com\/\">Flowbite<\/a>\nwhich let you add fancy widgets and doodads galore to your modern Next.js stack\nwith 10,000 node_module dependencies.<\/p>\n<p>As any experienced web developer will tell you, though, these create other\nproblems:<\/p>\n<ul>\n<li>To have a good user experience, you need to spend a lot of time working on\n  your design.<\/li>\n<li>You can't just write content: you need a CMS, which is a separate app. <\/li>\n<li>If you make your site render client-side (the default with React) it will have\n  no search engine presence.<\/li>\n<li>You probably need to deploy one instance of your site for every region you\n  want to serve. If you're going global, that means at least 7 servers.\n  Otherwise you'll experience slow load times in many parts of the world.<\/li>\n<li>Also, your framework inherently adds a lot of overhead to load time.<\/li>\n<\/ul>\n<p>All of this costs time and money that could be spent creating content. <\/p>\n<p>Of course, there is one advantage to your complex, modern site:<\/p>\n<ul>\n<li>It looks nice.<\/li>\n<\/ul>\n<p>Most sites that we interact with are either web apps, for\nwhich complex frameworks are <em>often<\/em> a good choice, or advertisements of some\nsort, for which aesthetics matter a lot more than functionality. Unfortunately, \nthis gives most of us the impression that we should use heavyweight frameworks \nfor <em>all<\/em> our projects.<\/p>\n<p>I'm here to tell you that this is not the case. Here are some advantages of \nsimple sites:<\/p>\n<p><strong>Simple sites give primacy to content and are easy for readers to navigate.<\/strong> \nPG's blog might look outdated but it's super easy to find what you want. With a\nsimple design it's trivial to follow \n<a href=\"https:\/\/taylorhieber.co\/hierarchy-of-information-fundamentals-of-design\/\">visual hierarchy principles<\/a>.<\/p>\n<p><strong>They are simple to write and compose content for.<\/strong> By using a site builder\nsuch as <a href=\"https:\/\/getpelican.com\/\">Pelican<\/a>, <a href=\"https:\/\/gohugo.io\/\">Hugo<\/a>, \nor <a href=\"https:\/\/jekyllrb.com\/\">Jekyll<\/a>, you can get content up in a fraction of the\ntime it'd take to do it on a platform like Wordpress. This site is built on\nPelican. If you want to get spicy, you can even use something like \n<a href=\"https:\/\/astro.build\/\">Astro<\/a> which lets you integrate JSX components into your\nsimple website.<\/p>\n<p><strong>They are more optimised for SEO than complex sites.<\/strong> Simple sites consisting\nmostly of text are very easy for search engines to understand, which translates\ninto higher search rankings for your site. You can also get\naddons for most site generators which help optimise your site even further.<\/p>\n<p><strong>They load quickly.<\/strong> This also helps with your SEO. One way that search\nengines judge the quality of content is to look at the time to first response\n(when the server replies) and first contentful paint (when content actually\nappears). On simple websites these take a fraction of the time than with modern\nframeworks.<\/p>\n<p><strong>They're easy to maintain and deploy.<\/strong> Infrastructure providers like\n<a href=\"https:\/\/vercel.com\/\">Vercel<\/a> and <a href=\"https:\/\/www.netlify.com\/\">Netlify<\/a> make it\neasy to deploy a simple site in a matter of seconds. \nEven if you choose to deploy the site yourself, writing the CI\/CD logic for a\nstatic site is pretty simple.<\/p>\n<p><strong>They can easily be distributed via CDN.<\/strong> This means that you can put your\nsite on over 100 servers globally for less than the cost of a single React app.<\/p>\n<h2>Conclusion<\/h2>\n<p><strong>What we often forget is that modern web frameworks aren't designed to be easy\nor optimal for solo developers or freelancers.<\/strong> They're designed to be scalable \nfor large organisations. React originates from Facebook, Angular from Google.\nTellingly, Vue.js, the simplest of the mainstream frameworks, was created by an\nindividual, not a company.<\/p>\n<p>Next time you're tempted to reach for a heavyweight framework, then, take pause. \nYou might be missing an opportunity to make your life much simpler.<\/p>\n<p><em>If you're interested in tutoring, <a href=\"\/pages\/classes\">click here<\/a>.<\/em><\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"programming"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"webdev"}}]},{"title":"Todo Lists II: The Eisenhower Matrix","link":{"@attributes":{"href":"https:\/\/fd93.me\/todo-ii.html","rel":"alternate"}},"published":"2024-01-19T00:00:00+08:00","updated":"2024-01-19T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2024-01-19:\/todo-ii.html","summary":"<div style=\"display: flex; flex-direction: column; align-items: center;\">\n    <img src=\"\/images\/eisenhower-portrait.jpg\" style=\"width: 100%;\"><\/img>\n<\/div>\n\n<p>In <a href=\"todo-i.html\">a previous article<\/a> I discussed the power of todo lists and their use in\norganising your tasks. I have a confession: for a long time I didn't use task\nlists. This is because of some practical issues which plagued me as a user of\nthose tools. And when I \u2026<\/p>","content":"<div style=\"display: flex; flex-direction: column; align-items: center;\">\n    <img src=\"\/images\/eisenhower-portrait.jpg\" style=\"width: 100%;\"><\/img>\n<\/div>\n\n<p>In <a href=\"todo-i.html\">a previous article<\/a> I discussed the power of todo lists and their use in\norganising your tasks. I have a confession: for a long time I didn't use task\nlists. This is because of some practical issues which plagued me as a user of\nthose tools. And when I reached for more complex tools like the kanban or the\npriority matrix, they normally made things worse.<\/p>\n<p>The first problem with a todo list is its length. A todo list with more\nthan 15 or so elements becomes intimidating and you grow to dread opening up the\ndocument. What's even worse is when you try to re-order the list: should I pay\nmy taxes first, or hang the laundry? Is it more essential for me to add this new\nfeature, or should I fix the problems with the last one I implemented? In other\nwords, what heuristics am I using to decide what happens first? Is the urgency\nof a task more important, or its impact on my life?<\/p>\n<p>One possible answer to this is provided by the <em>Eisenhower Matrix<\/em>. This\nstrategy was invented and used by Dwight D. Eisenhower, 34th President of the\nUSA and Supreme Commander of Allied Forces in Europe in World War II.<\/p>\n<p>Eisenhower's strategy for organising todo lists is as follows: for each task,\ndecide if it's urgent or non-urgent. Decide if it's important or not important.\nThen, treat them as follows:<\/p>\n<ol>\n<li>Urgent and important: deal with these as soon as possible<\/li>\n<li>Important, but not urgent: schedule a time to deal with these<\/li>\n<li>Urgent, but not important: avoid or delegate to others<\/li>\n<li>Neither urgent nor important: don't do these<\/li>\n<\/ol>\n<div style=\"display: flex; flex-direction: column; align-items: center;\">\n    <img src=\"\/images\/eisenhower-matrix.png\" style=\"height: 500px;\"><\/img>\n    <span style=\"font-size: 10pt; justify-content: center; display: flex;\">A visual representation of the Eisenhower Matrix.<\/span>\n<\/div>\n\n<p>These are relative to your perspective and to other tasks\nyou're currently dealing with. This means that your matrix is tailored to you,\nlike the best productivity tools.<\/p>\n<p>A couple of nice features of the Eisenhower matrix are:<\/p>\n<ul>\n<li>It only defines 4 priorities, one of them being \"cancel\". This means that\n  you run little risk of falling into \"priority hell\", where every\n  task has its own priority level. It also makes it\n  easier to use with most software tools.<\/li>\n<li>It can be used as a set of sections on a single vertical todo list.\n  This is helpful if you use a plain text editor like\n  <a href=\"https:\/\/obsidian.md\/\">Obsidian<\/a>, <a href=\"https:\/\/logseq.com\/\">LogSeq<\/a> or\n  <a href=\"https:\/\/www.vim.org\/\">Vim<\/a> as your main working  environment.<\/li>\n<\/ul>\n<p>That said, while the Eisenhower matrix can be helpful in pruning and ordering a\nset of tasks, it ultimately just breaks them into 3 sections and a trashcan.\nThis means that you still have a problem with task overload, albeit\nyour list can be a bit longer (30-45 items).<\/p>\n<p>The normal addendum to the Eisenhower matrix is to limit each sub-list to\nno more than 10 items. If you're the POTUS you'll have people to\nmanage your diary and delegate tasks to. If you're not, you might\nprefer to try strategies like timeboxing to limit the scope of your tasks as\nmuch as possible. As a last resort, you can split your task\nlist into several smaller lists, but this often leads to more confusion.<\/p>\n<p>In my experience, the Eisenhower Matrix (and task lists in general) are\nhelpful in situations where you're compromised: whether that's\nbecause you have an overwhelming amount of tasks, because you haven't been\nsleeping well, or because you've just broken up with a partner. When you're in\nflow, you feel in control without extra tools, and so task lists feel like a\nburden to maintain.<\/p>\n<p>As always, then, focus on the overall solution and don't feel constrained by your\ntools.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"handbook"}}]},{"title":"Hard to Parse: Designing a Language II","link":{"@attributes":{"href":"https:\/\/fd93.me\/language-design-2.html","rel":"alternate"}},"published":"2024-01-15T00:00:00+08:00","updated":"2024-01-15T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2024-01-15:\/language-design-2.html","summary":"<p><img src=\"\/images\/language-design-2-head.jpg\"><\/img><\/p>\n<p>After writing the lexer I could turn any math expression into a set of tokens. However, they were still organised as a list and couldn't be used to do any useful work. To go from a list of tokens to a program, I needed to write a <strong>parser<\/strong>.<\/p>\n<p>The goal \u2026<\/p>","content":"<p><img src=\"\/images\/language-design-2-head.jpg\"><\/img><\/p>\n<p>After writing the lexer I could turn any math expression into a set of tokens. However, they were still organised as a list and couldn't be used to do any useful work. To go from a list of tokens to a program, I needed to write a <strong>parser<\/strong>.<\/p>\n<p>The goal for any parser is to output a <strong>parse tree<\/strong>. A parse tree is a type of data structure which organises an expression in a way the computer can use to generate a list of simple operations. If we want to compile our expression, then this will be machine code; if we want to use an interpreter, it will be a set of functions in our interpreter. Parse trees look something like this:<\/p>\n<div style=\"display: flex; flex-direction: column; align-items: center;\">\n    <img src=\"\/images\/language-design-2-1.png\" style=\"height: 500px;\"><\/img>\n    <span style=\"font-size: 10pt; justify-content: center; display: flex;\">A parse tree representing the equation.<\/span>\n<\/div>\n\n<p>Parse trees can be verbose, so we often use one more step to reduce them to an <strong>abstract syntax tree<\/strong>, which is easier for the computer to use. Abstract syntax trees (ASTs) look like this:<\/p>\n<div style=\"display: flex; flex-direction: column; align-items: center;\">\n    <img src=\"\/images\/language-design-2-2.png\" style=\"height: 500px;\"><\/img>\n    <span style=\"font-size: 10pt; justify-content: center; display: flex;\">An AST for the same equation. Notice that all unnecessary elements have been\n    removed from the tree.<\/span>\n<\/div>\n\n<p>An <strong>operator-precedence parser<\/strong> is a simple type of <strong>shift-reduce parser<\/strong>. Shift-reduce parsers work <strong>bottom-up<\/strong> - they go through a list of tokens and attempt to build a tree by grouping tokens together. In the case of an operator-precedence parser, this is done by checking different operators in order of precedence.<\/p>\n<p>In algebra our operations are, in order:<\/p>\n<ul>\n<li>Expressions in parentheses: <code>(x+2)<\/code><\/li>\n<li>Exponentiation: <code>x^3<\/code><\/li>\n<li>Multiplication and division: <code>x*3<\/code> or <code>x\/2<\/code><\/li>\n<li>Addition and subtraction: <code>x-2<\/code> or <code>x+3<\/code><\/li>\n<\/ul>\n<p>An operator-precedence parser will check each of these in order and organise tokens accordingly. Note that as addition and subtraction are the same operation, they are simply read left-right. The following example shows how this process works step-by-step.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>10 + 10 ^ 3 \/ 5 * 3\n\/\/ skipping parentheses, try exponentiation\n10 + (10 ^ 3) \/ 5 * 3\n\/\/ exponentiation done, try divide and multiply\n10 + ((10 ^ 3) \/ 5) * 3\n10 + (((10 ^ 3) \/ 5) * 3)\n\/\/ divide and multiply done, try addition and subtraction\n(10 + (((10 ^ 3) \/ 5) * 3))\n\/\/ expression completed!\n<\/code><\/pre><\/div>\n\n<p>This is equivalent to the following abstract syntax tree:<\/p>\n<div style=\"display: flex; flex-direction: column; align-items: center;\">\n    <img src=\"\/images\/language-design-2-3.png\" style=\"height: 500px;\"><\/img>\n<\/div>\n\n<p>You can represent this tree however you like in memory: however, my preference\nis as a nested list. (Note that in C an n-ary tree and a nested list are identical.) In Python our algorithm looks like:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"c1\"># this is an incomplete and probably buggy piece of code<\/span>\n<span class=\"c1\"># it&#39;s just designed to demonstrate bottom-up parsing<\/span>\n<span class=\"c1\"># and its general algorithm<\/span>\n<span class=\"c1\"># a full implementation would include the NEGATE operand, for example <\/span>\n\n<span class=\"k\">def<\/span> <span class=\"nf\">nest_operation<\/span><span class=\"p\">(<\/span><span class=\"n\">op_str<\/span><span class=\"p\">:<\/span> <span class=\"nb\">str<\/span><span class=\"p\">):<\/span>\n   <span class=\"k\">def<\/span> <span class=\"nf\">out_fn<\/span><span class=\"p\">(<\/span><span class=\"n\">tokens<\/span><span class=\"p\">:<\/span> <span class=\"nb\">list<\/span><span class=\"p\">[<\/span><span class=\"nb\">str<\/span><span class=\"p\">]):<\/span>\n        <span class=\"n\">new_tokens<\/span> <span class=\"o\">=<\/span> <span class=\"p\">[]<\/span>\n        <span class=\"k\">for<\/span> <span class=\"n\">i<\/span><span class=\"p\">,<\/span> <span class=\"n\">token<\/span> <span class=\"ow\">in<\/span> <span class=\"nb\">enumerate<\/span><span class=\"p\">(<\/span><span class=\"n\">tokens<\/span><span class=\"p\">):<\/span>\n            <span class=\"k\">if<\/span> <span class=\"n\">token<\/span> <span class=\"o\">!=<\/span> <span class=\"n\">op_str<\/span><span class=\"p\">:<\/span>\n                <span class=\"n\">new_tokens<\/span><span class=\"o\">.<\/span><span class=\"n\">append<\/span><span class=\"p\">(<\/span><span class=\"n\">token<\/span><span class=\"p\">)<\/span>\n                <span class=\"k\">continue<\/span>\n            <span class=\"n\">new_tokens<\/span><span class=\"o\">.<\/span><span class=\"n\">extend<\/span><span class=\"p\">(<\/span> <span class=\"p\">[<\/span><span class=\"n\">tokens<\/span><span class=\"p\">[<\/span><span class=\"n\">i<\/span><span class=\"o\">-<\/span><span class=\"mi\">1<\/span><span class=\"p\">],<\/span> <span class=\"n\">token<\/span><span class=\"p\">,<\/span> <span class=\"n\">out_fn<\/span><span class=\"p\">(<\/span><span class=\"n\">tokens<\/span><span class=\"p\">[<\/span><span class=\"n\">i<\/span><span class=\"o\">+<\/span><span class=\"mi\">1<\/span><span class=\"p\">:])]<\/span> <span class=\"p\">)<\/span>\n            <span class=\"k\">return<\/span> <span class=\"n\">new_tokens<\/span>\n    <span class=\"k\">return<\/span> <span class=\"n\">out_fn<\/span>\n\n<span class=\"k\">def<\/span> <span class=\"nf\">make_parse_tree<\/span><span class=\"p\">(<\/span><span class=\"n\">tokens<\/span><span class=\"p\">):<\/span>\n    <span class=\"n\">cur_tokens<\/span> <span class=\"o\">=<\/span> <span class=\"n\">deepcopy<\/span><span class=\"p\">(<\/span><span class=\"n\">tokens<\/span><span class=\"p\">)<\/span>\n    <span class=\"k\">for<\/span> <span class=\"n\">operand<\/span> <span class=\"ow\">in<\/span> <span class=\"p\">(<\/span><span class=\"s2\">&quot;^&quot;<\/span><span class=\"p\">,<\/span><span class=\"s2\">&quot;\/&quot;<\/span><span class=\"p\">,<\/span><span class=\"s2\">&quot;*&quot;<\/span><span class=\"p\">,<\/span><span class=\"s2\">&quot;+&quot;<\/span><span class=\"p\">,<\/span><span class=\"s2\">&quot;-&quot;<\/span><span class=\"p\">):<\/span>\n       <span class=\"n\">parse_fn<\/span> <span class=\"o\">=<\/span> <span class=\"n\">nest_operation<\/span><span class=\"p\">(<\/span><span class=\"n\">operand<\/span><span class=\"p\">)<\/span>\n       <span class=\"n\">cur_tokens<\/span> <span class=\"o\">=<\/span> <span class=\"n\">parse_fn<\/span><span class=\"p\">(<\/span><span class=\"n\">cur_tokens<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<p>The basic idea is that we're iterating through the list of tokens as many times\nas there are operands and grouping together tokens based on the priority of each\noperand. This is what makes this a <em>shift-reduce<\/em> parser - we <em>shift<\/em> along one\ntoken at a time, and <em>reduce<\/em> 3 tokens at a time to a single operation.<\/p>\n<p>With the parsing algorithm complete, all that was left to do was make the AST do some useful work. The first thing I wrote was an interpreter in Python:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">def<\/span> <span class=\"nf\">evaluate<\/span><span class=\"p\">(<\/span><span class=\"n\">node<\/span><span class=\"p\">):<\/span>\n\n    <span class=\"n\">ops<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span>\n        <span class=\"s1\">&#39;^&#39;<\/span> <span class=\"p\">:<\/span> <span class=\"k\">lambda<\/span> <span class=\"n\">x<\/span><span class=\"p\">,<\/span> <span class=\"n\">y<\/span> <span class=\"p\">:<\/span> <span class=\"n\">x<\/span> <span class=\"o\">**<\/span> <span class=\"n\">y<\/span><span class=\"p\">,<\/span>\n        <span class=\"s1\">&#39;+&#39;<\/span> <span class=\"p\">:<\/span> <span class=\"k\">lambda<\/span> <span class=\"n\">x<\/span><span class=\"p\">,<\/span> <span class=\"n\">y<\/span> <span class=\"p\">:<\/span> <span class=\"n\">x<\/span> <span class=\"o\">+<\/span> <span class=\"n\">y<\/span><span class=\"p\">,<\/span>\n        <span class=\"s1\">&#39;\/&#39;<\/span> <span class=\"p\">:<\/span> <span class=\"k\">lambda<\/span> <span class=\"n\">x<\/span><span class=\"p\">,<\/span> <span class=\"n\">y<\/span> <span class=\"p\">:<\/span> <span class=\"n\">x<\/span> <span class=\"o\">\/<\/span> <span class=\"n\">y<\/span><span class=\"p\">,<\/span>\n        <span class=\"s1\">&#39;*&#39;<\/span> <span class=\"p\">:<\/span> <span class=\"k\">lambda<\/span> <span class=\"n\">x<\/span><span class=\"p\">,<\/span> <span class=\"n\">y<\/span> <span class=\"p\">:<\/span> <span class=\"n\">x<\/span> <span class=\"o\">*<\/span> <span class=\"n\">y<\/span>\n    <span class=\"p\">}<\/span>\n\n    <span class=\"k\">if<\/span> <span class=\"nb\">isinstance<\/span><span class=\"p\">(<\/span><span class=\"n\">node<\/span><span class=\"p\">,<\/span> <span class=\"nb\">str<\/span><span class=\"p\">):<\/span>\n        <span class=\"k\">return<\/span> <span class=\"nb\">float<\/span><span class=\"p\">(<\/span><span class=\"n\">node<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"k\">elif<\/span> <span class=\"nb\">isinstance<\/span><span class=\"p\">(<\/span><span class=\"n\">node<\/span><span class=\"p\">,<\/span> <span class=\"n\">ParseNode<\/span><span class=\"p\">):<\/span>\n        <span class=\"k\">if<\/span> <span class=\"n\">node<\/span><span class=\"o\">.<\/span><span class=\"n\">token<\/span> <span class=\"ow\">in<\/span> <span class=\"n\">adme<\/span><span class=\"p\">:<\/span>\n            <span class=\"n\">left<\/span> <span class=\"o\">=<\/span> <span class=\"n\">evaluate<\/span><span class=\"p\">(<\/span><span class=\"n\">node<\/span><span class=\"o\">.<\/span><span class=\"n\">children<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">])<\/span>\n            <span class=\"n\">right<\/span> <span class=\"o\">=<\/span> <span class=\"n\">evaluate<\/span><span class=\"p\">(<\/span><span class=\"n\">node<\/span><span class=\"o\">.<\/span><span class=\"n\">children<\/span><span class=\"p\">[<\/span><span class=\"mi\">1<\/span><span class=\"p\">])<\/span>\n            <span class=\"k\">return<\/span> <span class=\"n\">ops<\/span><span class=\"p\">[<\/span><span class=\"n\">node<\/span><span class=\"o\">.<\/span><span class=\"n\">token<\/span><span class=\"p\">](<\/span><span class=\"n\">left<\/span><span class=\"p\">,<\/span> <span class=\"n\">right<\/span><span class=\"p\">)<\/span>\n\n    <span class=\"k\">elif<\/span> <span class=\"n\">node<\/span><span class=\"o\">.<\/span><span class=\"n\">token<\/span> <span class=\"o\">==<\/span> <span class=\"n\">minus<\/span><span class=\"p\">:<\/span>\n        <span class=\"k\">return<\/span> <span class=\"n\">evaluate<\/span><span class=\"p\">(<\/span><span class=\"n\">node<\/span><span class=\"o\">.<\/span><span class=\"n\">children<\/span><span class=\"p\">[<\/span><span class=\"mi\">0<\/span><span class=\"p\">])<\/span> <span class=\"o\">*<\/span> <span class=\"o\">-<\/span><span class=\"mi\">1<\/span>\n<\/code><\/pre><\/div>\n\n<p>It's only 20 lines! Building up the parse tree is the more difficult part of the code.<\/p>\n<p>The interpreter goes through the parse tree starting from the root and checks the children of each node. When it reaches a number, it returns that number as a float. It then climbs back up the parse tree until it's performed all the math necessary. You can look at this as the reverse of our previous process of building the tree:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>(10 + (((10 ^ 3) \/ 5) * 3)) \/\/ evaluate 10 ^ 3\n(10 + ((1000 \/ 5) * 3)) \/\/ evaluate 1000 \/ 5\n(10 + (200 * 3)) \/\/ evaluate 200 * 3\n(10 + 600) \/\/ evaluate 10 + 600\n610\n<\/code><\/pre><\/div>\n\n<p>After writing the interpreter, I was curious if I could turn it into a compiler. This was a bit more difficult, but still simpler than writing the parser itself. By using a similar process to the interpeter, I turned my parse tree into the LLVM intermediate representation language (IR). This is a special assembly language which can compile to many different CPU and operating system combinations. It looks like this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"vg\">@.str<\/span><span class=\"w\"> <\/span><span class=\"p\">=<\/span><span class=\"w\"> <\/span><span class=\"k\">private<\/span><span class=\"w\"> <\/span><span class=\"k\">unnamed_addr<\/span><span class=\"w\"> <\/span><span class=\"k\">constant<\/span><span class=\"w\"> <\/span><span class=\"p\">[<\/span><span class=\"m\">3<\/span><span class=\"w\"> <\/span><span class=\"k\">x<\/span><span class=\"w\"> <\/span><span class=\"kt\">i8<\/span><span class=\"p\">]<\/span><span class=\"w\"> <\/span><span class=\"k\">c<\/span><span class=\"s\">&quot;%f\\00&quot;<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"k\">align<\/span><span class=\"w\"> <\/span><span class=\"m\">1<\/span>\n\n<span class=\"k\">declare<\/span><span class=\"w\"> <\/span><span class=\"kt\">i32<\/span><span class=\"w\"> <\/span><span class=\"vg\">@printf<\/span><span class=\"p\">(<\/span><span class=\"kt\">i8<\/span><span class=\"p\">*,<\/span><span class=\"w\"> <\/span><span class=\"p\">...)<\/span>\n\n<span class=\"k\">define<\/span><span class=\"w\"> <\/span><span class=\"kt\">i32<\/span><span class=\"w\"> <\/span><span class=\"vg\">@main<\/span><span class=\"p\">()<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">    <\/span><span class=\"nv\">%x1<\/span><span class=\"w\"> <\/span><span class=\"p\">=<\/span><span class=\"w\"> <\/span><span class=\"k\">fadd<\/span><span class=\"w\"> <\/span><span class=\"kt\">float<\/span><span class=\"w\"> <\/span><span class=\"m\">4.0<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"m\">5.0<\/span>\n<span class=\"w\">    <\/span><span class=\"nv\">%x2<\/span><span class=\"w\"> <\/span><span class=\"p\">=<\/span><span class=\"w\"> <\/span><span class=\"k\">fmul<\/span><span class=\"w\"> <\/span><span class=\"kt\">float<\/span><span class=\"w\"> <\/span><span class=\"m\">2.0<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"nv\">%x1<\/span>\n<span class=\"w\">    <\/span><span class=\"nv\">%x3<\/span><span class=\"w\"> <\/span><span class=\"p\">=<\/span><span class=\"w\"> <\/span><span class=\"k\">fdiv<\/span><span class=\"w\"> <\/span><span class=\"kt\">float<\/span><span class=\"w\"> <\/span><span class=\"nv\">%x2<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"m\">3.0<\/span>\n<span class=\"w\">    <\/span><span class=\"nv\">%x4<\/span><span class=\"w\"> <\/span><span class=\"p\">=<\/span><span class=\"w\"> <\/span><span class=\"k\">fpext<\/span><span class=\"w\"> <\/span><span class=\"kt\">float<\/span><span class=\"w\"> <\/span><span class=\"nv\">%x3<\/span><span class=\"w\"> <\/span><span class=\"k\">to<\/span><span class=\"w\"> <\/span><span class=\"kt\">double<\/span>\n<span class=\"w\">    <\/span><span class=\"nv\">%x5<\/span><span class=\"w\"> <\/span><span class=\"p\">=<\/span><span class=\"w\"> <\/span><span class=\"k\">call<\/span><span class=\"w\"> <\/span><span class=\"kt\">i32<\/span><span class=\"w\"> <\/span><span class=\"p\">(<\/span><span class=\"kt\">i8<\/span><span class=\"p\">*,<\/span><span class=\"w\"> <\/span><span class=\"p\">...)<\/span><span class=\"w\"> <\/span><span class=\"vg\">@printf<\/span><span class=\"p\">(<\/span><span class=\"kt\">i8<\/span><span class=\"p\">*<\/span><span class=\"w\"> <\/span><span class=\"k\">getelementptr<\/span><span class=\"w\"> <\/span><span class=\"k\">inbounds<\/span><span class=\"w\"> <\/span><span class=\"p\">([<\/span><span class=\"m\">3<\/span><span class=\"w\"> <\/span><span class=\"k\">x<\/span><span class=\"w\"> <\/span>\n<span class=\"w\">            <\/span><span class=\"kt\">i8<\/span><span class=\"p\">],<\/span><span class=\"w\"> <\/span><span class=\"p\">[<\/span><span class=\"m\">3<\/span><span class=\"w\"> <\/span><span class=\"k\">x<\/span><span class=\"w\"> <\/span><span class=\"kt\">i8<\/span><span class=\"p\">]*<\/span><span class=\"w\"> <\/span><span class=\"vg\">@.str<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"kt\">i64<\/span><span class=\"w\"> <\/span><span class=\"m\">0<\/span><span class=\"p\">,<\/span><span class=\"w\"> <\/span><span class=\"kt\">i64<\/span><span class=\"w\"> <\/span><span class=\"m\">0<\/span><span class=\"p\">),<\/span><span class=\"w\"> <\/span><span class=\"kt\">double<\/span><span class=\"w\"> <\/span><span class=\"nv\">%x4<\/span><span class=\"p\">)<\/span>\n<span class=\"w\">    <\/span><span class=\"k\">ret<\/span><span class=\"w\"> <\/span><span class=\"kt\">i32<\/span><span class=\"w\"> <\/span><span class=\"m\">0<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n<p>You'll notice that lines 6-8 describe basic math operations such as adding,  multiplying, and subtracting - this code follows the same logic as the previous example, albeit in a much more verbose way.<\/p>\n<p>The most important principle when writing assembly or intermediate representations like LLVM is to use <em>static single assignment form<\/em>. In most languages you can assign to a variable more than once. For example, in C you could write the above assembly as something like:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"kt\">float<\/span><span class=\"w\"> <\/span><span class=\"n\">x<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"mf\">4.0f<\/span><span class=\"w\"> <\/span><span class=\"o\">+<\/span><span class=\"w\"> <\/span><span class=\"mf\">5.0f<\/span><span class=\"p\">;<\/span>\n<span class=\"n\">x<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"n\">x<\/span><span class=\"w\"> <\/span><span class=\"o\">*<\/span><span class=\"w\"> <\/span><span class=\"mi\">2<\/span><span class=\"p\">;<\/span>\n<span class=\"n\">x<\/span><span class=\"w\"> <\/span><span class=\"o\">=<\/span><span class=\"w\"> <\/span><span class=\"n\">x<\/span><span class=\"w\"> <\/span><span class=\"o\">\/<\/span><span class=\"w\"> <\/span><span class=\"mi\">3<\/span><span class=\"p\">;<\/span>\n<span class=\"n\">printf<\/span><span class=\"p\">(<\/span><span class=\"n\">x<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<p>However, in LLVM IR you can't modify variables which you've already declared. Instead of using a single variable called <code>x<\/code> we need to keep multiple versions, which are labelled as <code>%x1<\/code> and so on in the code above.<\/p>\n<p>Once I'd generated LLVM from my math, all I needed to do to get a binary program was run the <code>llvm<\/code> and <code>clang<\/code> compilers on them, then...<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>chmod<span class=\"w\"> <\/span>+x<span class=\"w\"> <\/span>math\n.\/math\n<span class=\"m\">6<\/span>\n<\/code><\/pre><\/div>\n\n<h1>Moving On Up<\/h1>\n<p>I'd written a basic math parser and compiler, but being limited to one-line math expressions is no fun. I wanted to add a few features to build a new language, <em>Infix Plus<\/em>:<\/p>\n<ul>\n<li>Multiple lines in the program<\/li>\n<li>Python-style comments, <code># written like this.<\/code><\/li>\n<li>Assigning variables like this <code>a = 10<\/code>, the same way as Python<\/li>\n<li>Being able to use variables in expressions and get a result: <code>a + b + c<\/code><\/li>\n<\/ul>\n<p>To get there I'd need to learn more about how formal grammars work and a new type of parser: recursive descent.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"programming"}}]},{"title":"Lexing On My Haters: How to Design a Programming Language I","link":{"@attributes":{"href":"https:\/\/fd93.me\/language-design-1.html","rel":"alternate"}},"published":"2023-07-12T00:00:00+08:00","updated":"2023-07-12T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2023-07-12:\/language-design-1.html","summary":"<p><img alt=\"\" src=\"images\/parsing-i.webp\"><\/p>\n<p>Trying to build a complex program in Python is like trying to build a house out of jello. I love it, but while Python's delicious, flexible, and lacks the annoying quirks of most languages, this relaxed nature is a dire problem for complex projects. Python uses\u00a0<strong>duck typing<\/strong>:<\/p>\n<blockquote>\n<p>If it \u2026<\/p><\/blockquote>","content":"<p><img alt=\"\" src=\"images\/parsing-i.webp\"><\/p>\n<p>Trying to build a complex program in Python is like trying to build a house out of jello. I love it, but while Python's delicious, flexible, and lacks the annoying quirks of most languages, this relaxed nature is a dire problem for complex projects. Python uses\u00a0<strong>duck typing<\/strong>:<\/p>\n<blockquote>\n<p>If it walks like a duck and quacks like a duck, it's a duck.<\/p>\n<\/blockquote>\n<p>This means that you can write a program like:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"n\">my_set<\/span> <span class=\"o\">=<\/span> <span class=\"p\">{<\/span><span class=\"s2\">&quot;a&quot;<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&quot;b&quot;<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&quot;c&quot;<\/span><span class=\"p\">}<\/span>\n<span class=\"n\">my_dict<\/span><span class=\"o\">=<\/span> <span class=\"p\">{<\/span> <span class=\"s2\">&quot;a&quot;<\/span><span class=\"p\">:<\/span> <span class=\"mi\">1<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&quot;b&quot;<\/span><span class=\"p\">:<\/span> <span class=\"mi\">2<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&quot;c&quot;<\/span><span class=\"p\">:<\/span> <span class=\"mi\">3<\/span> <span class=\"p\">}<\/span>\n\n<span class=\"k\">for<\/span> <span class=\"n\">obj<\/span> <span class=\"ow\">in<\/span> <span class=\"p\">(<\/span><span class=\"n\">my_set<\/span><span class=\"p\">,<\/span> <span class=\"n\">my_dict<\/span><span class=\"p\">):<\/span>\n    <span class=\"nb\">print<\/span><span class=\"p\">(<\/span><span class=\"n\">obj<\/span><span class=\"o\">.<\/span><span class=\"n\">get<\/span><span class=\"p\">(<\/span><span class=\"s2\">&quot;a&quot;<\/span><span class=\"p\">))<\/span>\n<\/code><\/pre><\/div>\n\n<p>Despite\u00a0<code>my_set<\/code>\u00a0and\u00a0<code>my_dict<\/code>\u00a0being different types, Python has no problem with this code. In complex programs where you want safe code, this means you need to annotate every type, and check objects' types before using them:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"k\">def<\/span> <span class=\"nf\">print_this<\/span><span class=\"p\">(<\/span><span class=\"n\">x<\/span> <span class=\"p\">:<\/span> <span class=\"nb\">str<\/span><span class=\"p\">):<\/span>\n    <span class=\"k\">if<\/span> <span class=\"ow\">not<\/span> <span class=\"nb\">isinstance<\/span><span class=\"p\">(<\/span><span class=\"n\">x<\/span><span class=\"p\">,<\/span> <span class=\"nb\">str<\/span><span class=\"p\">):<\/span>\n        <span class=\"k\">raise<\/span> <span class=\"ne\">TypeError<\/span><span class=\"p\">()<\/span>\n    <span class=\"nb\">print<\/span><span class=\"p\">(<\/span><span class=\"nb\">str<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div>\n\n<p>This is both verbose and annoying. However, the alternatives are:<\/p>\n<ul>\n<li>\n<p>Trust future developers to write code conforming to your annotations.<\/p>\n<\/li>\n<li>\n<p>Don't bother with types and let your program collapse under its own weight.<\/p>\n<\/li>\n<\/ul>\n<p>The first one sounds reasonable, but I don't trust\u00a0<em>myself<\/em>\u00a0to stick to type annotations, let alone other people. I could have switched to a strongly-typed language like C++ or Rust, which require you to declare all your types:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"c1\">\/\/ If you call this with a non-string type, it will throw an error.<\/span>\n<span class=\"kt\">void<\/span><span class=\"w\"> <\/span><span class=\"nf\">printThis<\/span><span class=\"p\">(<\/span><span class=\"n\">string<\/span><span class=\"w\"> <\/span><span class=\"n\">x<\/span><span class=\"p\">)<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span>\n<span class=\"w\">    <\/span><span class=\"n\">std<\/span><span class=\"o\">::<\/span><span class=\"n\">cout<\/span><span class=\"w\"> <\/span><span class=\"o\">&lt;&lt;<\/span><span class=\"w\"> <\/span><span class=\"n\">x<\/span><span class=\"p\">;<\/span><span class=\"w\"> <\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div>\n\n<p><em>Thanks to Reddit user Human-Bathroom-2791 for catching a minor error in this code.<\/em><\/p>\n<p>However, strongly-typed languages are usually more verbose and can be troublesome. One of the features that I love about Python is how productive I can be when writing it, due to its generous interpreter. I've also begun to prefer writing\u00a0<strong>pure functions<\/strong>, which are functions which will always return the same output from a given input. This means that\u00a0<strong>object-oriented languages<\/strong>\u00a0like C++, which encourage using functions to manipulate state of objects, aren't a good fit for my current preferences.<\/p>\n<p>Did I learn an existing functional language like Haskell or OCaml? Of course not. In my infinite wisdom, I decided the best choice was to create my own. I knew a bit about language design, but not enough to make my own language. I decided to change that.<\/p>\n<h1>Finite State Machines<\/h1>\n<p>To design a programming language, you need to understand\u00a0<strong>state machines<\/strong>. I already knew the basics of state machines from experience and from high school computing. However, I hadn't used state machines for language parsing before, so I had to do some research. I asked Discord. Here's what I learned.<\/p>\n<p>A finite state machine isn't a real machine - it's an abstract idea of a machine. A state machine consists of two concepts: a\u00a0<strong>state<\/strong>, and a\u00a0<strong>transition<\/strong>. For example, when you want to read a file on your computer, there are a few states it can be in:<\/p>\n<ul>\n<li>\n<p>Closed<\/p>\n<\/li>\n<li>\n<p>Open and ready to read<\/p>\n<\/li>\n<li>\n<p>End of file - no more reading is possible<\/p>\n<\/li>\n<\/ul>\n<p>It can transition between these three states in different ways:<\/p>\n<ul>\n<li>\n<p>When we open a file<\/p>\n<\/li>\n<li>\n<p>When we close a file<\/p>\n<\/li>\n<li>\n<p>When we reach the end of our file<\/p>\n<\/li>\n<li>\n<p>When we successfully read some data from the file<\/p>\n<\/li>\n<\/ul>\n<p>We can draw out this state machine as a diagram, and can see which state transitions are\u00a0<strong>invalid<\/strong>. For example, we can't go from a closed file to the end of file directly. We also can't continue to read from the end of a file. This is very helpful for modelling which inputs are valid and invalid in a given state.<\/p>\n<p><img alt=\"\" src=\"images\/image-4.png\"><\/p>\n<p>I very quickly learned that parsing complex languages required a pushdown automaton, which is a special type of state machine. If you've looked into the history of computing before you might have heard of a\u00a0<strong>Turing Machine<\/strong>, which is the most minimal machine which can perform any computable task. A\u00a0<strong>pushdown automaton<\/strong>\u00a0is closely related to a Turing Machine, but a little simpler.<\/p>\n<p>A Turing Machine has a movable roll of tape with cells, each of which can contain a token such as\u00a0<code>1<\/code>\u00a0or\u00a0<code>&gt;<\/code>\u00a0or\u00a0<code>burger<\/code>. It also has a head which can read from or write to the tape. Every time the machine steps, it reads one symbol from the tape, and based on its current state can move the tape left or right, write a symbol, or stop. Turing machines are simple but can perform any computation, and are the model for the CPUs in computers.<\/p>\n<p><img alt=\"\" src=\"images\/image.png\"><\/p>\n<p>The Turing Machine in the go_right state will go right until it reaches\u00a0<code>&lt;<\/code>\u00a0and reverses direction.<\/p>\n<p>A pushdown automaton (PA) is similar to a Turing Machine, with two important differences. First, a PA cannot move or write to its tape: it just reads one symbol per step. Second, a PA has a stack which it can manipulate by pushing a symbol or popping a symbol from the top. While a PA is not as powerful as a Turing Machine, it's capable of parsing most common computer languages.<\/p>\n<p><img alt=\"\" src=\"images\/image-3.png\"><\/p>\n<p>The current state of the pushdown automaton is\u00a0<code>go_right<\/code>. Unlike a Turing Machine, it has no tape.<\/p>\n<p>With my new knowledge of abstract machines, I felt ready to tackle a very basic language: math! I wanted to write math expressions like\u00a0<code>(10 + 10) * 4 - -10.5<\/code>\u00a0and get the correct result as output.<\/p>\n<p>My first step was writing a\u00a0<strong>lexer<\/strong>, also known as a lexical or syntactic analyser. I flirted with writing a\u00a0<strong>lexer generator<\/strong>, which is a piece of software which can generate\u00a0<em>any<\/em>\u00a0lexer, but decided not to after reading this:<\/p>\n<blockquote>\n<p>The work of building a lexer is the same as designing a language.<\/p>\n<\/blockquote>\n<p>Lexers take a string of characters and turn it into a series of\u00a0<strong>tokens<\/strong>, which are more abstract symbols and make the job of a parser easier. For example, the string\u00a0<code>10 + 10<\/code>\u00a0might be lexed into three tokens:\u00a0<code>[number(10), ADD, number(10)]<\/code>.<\/p>\n<p>Unfortunately math (technically: infix arithmetic) presents a few challenges for a language designer.<\/p>\n<p>First, arithmetic expressions use\u00a0<strong>parentheses<\/strong>:\u00a0<code>(1 + 2) * 2<\/code>\u00a0should evaluate to\u00a0<code>6<\/code>. However, simple forms of parsing, including those supported by regular expressions, do not allow parentheses. Supporting nested expressions is a major motivation for developing parsers in the first place, and requires our\u00a0<strong>pushdown automata<\/strong>.<\/p>\n<p>A PA can push the current state to the stack when it reaches a\u00a0<code>(<\/code>\u00a0symbol and pop it when it reaches the\u00a0<code>)<\/code>\u00a0symbol, then continue with its previous state intact. In theory we could evaluate the whole expression using this method, but I just used it to output tokens.<\/p>\n<p>The second challenge is distinguishing\u00a0<strong>negative numbers<\/strong>\u00a0from\u00a0<strong>subtraction<\/strong>. Most numbers are simple: they're either a set of digits, or two sets of digits separated by a dot. But negative numbers are ambiguous:\u00a0<code>1-1<\/code>\u00a0can be interpreted as\u00a0<code>1 + -1<\/code>\u00a0(correct) or as\u00a0<code>1, -1<\/code>\u00a0(incorrect). My solution to this was hacky, but I later discovered that it's the usual approach for simple parsers. I set up my lexer to do the following when it discovered a\u00a0<code>-<\/code>\u00a0symbol:<\/p>\n<ul>\n<li>\n<p>Count how many\u00a0<code>-<\/code>\u00a0symbols there are in a row.<\/p>\n<\/li>\n<li>\n<p>If there's an odd number and the next symbol is a valid expression, then turn the\u00a0<code>-<\/code>\u00a0into\u00a0<code>+ -expr<\/code>.<\/p>\n<\/li>\n<li>\n<p>If there's an even number, then:<\/p>\n<ul>\n<li>\n<p>If we're at the start of an expression, or after a\u00a0<code>(<\/code>, output\u00a0<code>expr<\/code>.<\/p>\n<\/li>\n<li>\n<p>If we're not at the start of an expression, output\u00a0<code>+ expr<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>All\u00a0<code>-<\/code>\u00a0symbols now mean\u00a0<code>NEGATE<\/code>: i.e. do\u00a0<code>expr * -1<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>Based on these considerations, my lexer ended up with a set of rules for turning input into a set of tokens. These were:<\/p>\n<ul>\n<li>\n<p>Ignore any spaces.<\/p>\n<\/li>\n<li>\n<p>If you see a digit\u00a0<code>[0-9]<\/code>, keep adding digits to the current number until you reach something that's not a number, then add the number as a token.<\/p>\n<\/li>\n<li>\n<p>If you see a regular operator,\u00a0<code>[+\/*]<\/code>, make it into a token.<\/p>\n<\/li>\n<li>\n<p>If you see a\u00a0<code>-<\/code>\u00a0sign, count how many there are in a row and make them into\u00a0<code>NEGATE<\/code>\u00a0tokens.<\/p>\n<\/li>\n<li>\n<p>If you see\u00a0<code>(<\/code>, push the current state to the stack and return to the start of the inner expression.<\/p>\n<\/li>\n<li>\n<p>If you see\u00a0<code>)<\/code>\u00a0or reach the end of the input, finalise the current token and output it, then pop the state on the stack or exit.<\/p>\n<\/li>\n<\/ul>\n<p>Let's step through this with a real example:\u00a0<code>(10 + 10) \/ -5<\/code>. In addition to the stack and input required by a pushdown automaton, I added a tape to my lexer. This makes it easier to deal with long numbers and strings of\u00a0<code>-<\/code>\u00a0symbols. I'll ignore the steps which are skipping whitespace as they're uninteresting.<\/p>\n<table>\n<thead>\n<tr>\n<th>Step<\/th>\n<th>Input<\/th>\n<th>Tape<\/th>\n<th>Stack<\/th>\n<th>Tokens<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0<\/td>\n<td><code>(10 + 10) \/ -5<\/code><\/td>\n<td><code>[empty]<\/code><\/td>\n<td><code>[expect_expr]<\/code><\/td>\n<td><code>[empty]<\/code><\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td><code>10 + 10 \/ -5<\/code><\/td>\n<td><code>(<\/code><\/td>\n<td><code>[expect_expr, expect_operator]<\/code><\/td>\n<td><code>[empty]<\/code><\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td><code>0 + 10) \/ -5<\/code><\/td>\n<td><code>1<\/code><\/td>\n<td><code>[parse_number, expect_operator]<\/code><\/td>\n<td><code>[(]<\/code><\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td><code>+ 10) \/ -5<\/code><\/td>\n<td><code>10<\/code><\/td>\n<td><code>[parse_number, expect_operator]<\/code><\/td>\n<td><code>[(]<\/code><\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td><code>10) \/ -5<\/code><\/td>\n<td><code>+<\/code><\/td>\n<td><code>[expect_expr, expect_operator]<\/code><\/td>\n<td><code>[(,10]<\/code><\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td><code>0) \/ -5<\/code><\/td>\n<td><code>1<\/code><\/td>\n<td><code>[parse_number, expect_operator]<\/code><\/td>\n<td><code>[(,10,+]<\/code><\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td><code>) \/ -5<\/code><\/td>\n<td><code>10<\/code><\/td>\n<td><code>[parse_number, expect_operator]<\/code><\/td>\n<td><code>[(,10,+]<\/code><\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td><code>\/ -5<\/code><\/td>\n<td><code>)<\/code><\/td>\n<td><code>[expect_operator]<\/code><\/td>\n<td><code>[(,10,+,10,)]<\/code><\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td><code>-5<\/code><\/td>\n<td><code>\/<\/code><\/td>\n<td><code>[expect_expr]<\/code><\/td>\n<td><code>[(,10,+,10,)]<\/code><\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td><code>5<\/code><\/td>\n<td><code>-<\/code><\/td>\n<td><code>[minus]<\/code><\/td>\n<td><code>[(,10,+,10,),\/]<\/code><\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td><code>[empty]<\/code><\/td>\n<td><code>5<\/code><\/td>\n<td><code>[parse_number]<\/code><\/td>\n<td><code>[(,10,+,10,),\/,NEGATE,]<\/code><\/td>\n<\/tr>\n<tr>\n<td>11<\/td>\n<td><code>[empty]<\/code><\/td>\n<td><code>[empty]<\/code><\/td>\n<td><code>FINISHED<\/code><\/td>\n<td><code>[(,10,+,10,),\/,NEGATE,5]<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>With a small number of states and a pushdown automaton, we can turn a complex expression into useful tokens!<\/p>\n<p>After writing the lexer I could turn any math expression into a set of tokens. However, they were still just a list and couldn't do any useful work. To go from a list of tokens to a program, I needed to write a\u00a0<strong>parser<\/strong>.<\/p>\n<p>The main reason for this is\u00a0<strong>operator precedence<\/strong>. The result of\u00a0<code>1 + 2 * 2<\/code>\u00a0should be\u00a0<code>5<\/code>, because multiplication has higher precedence than addition. However, if we naively left-to-right like my lexer, then we will output\u00a0<code>6<\/code>\u00a0from this sum. We need something more complex: we need an\u00a0<strong>operator-precedence parser<\/strong>. More on that next time.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"programming"}},{"@attributes":{"term":"software"}}]},{"title":"Programming as a Craft","link":{"@attributes":{"href":"https:\/\/fd93.me\/programming-as-a-craft.html","rel":"alternate"}},"published":"2023-06-25T00:00:00+08:00","updated":"2023-06-25T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2023-06-25:\/programming-as-a-craft.html","summary":"<p><img alt=\"\" src=\"images\/programming-as-craft.jpeg\"><\/p>\n<p>Many of my students ask questions like:<\/p>\n<ul>\n<li>How long does it take to get your first job?<\/li>\n<li>How do I know I'm ready to apply for jobs?<\/li>\n<li>What do I need to know to get my first programming job?<\/li>\n<\/ul>\n<p>They are often frustrated when I say \"it depends\". But this \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/programming-as-craft.jpeg\"><\/p>\n<p>Many of my students ask questions like:<\/p>\n<ul>\n<li>How long does it take to get your first job?<\/li>\n<li>How do I know I'm ready to apply for jobs?<\/li>\n<li>What do I need to know to get my first programming job?<\/li>\n<\/ul>\n<p>They are often frustrated when I say \"it depends\". But this is the only honest answer. You need to know the basics: variables, functions, control flow, etc. Different roles need different technologies. But there's no fixed set of knowledge that will get you a job. <strong>This is because programming is not a profession, but a craft.<\/strong><\/p>\n<p>What is a profession? Think about traditional middle-class jobs: a doctor, a teacher, an accountant. What these roles share is the need for certification and examination. To be a doctor you need a medical license; to be a lawyer you must pass the bar. Normally these certificates are awarded by institutions like the state, a college, or a medical board. To become a professional is to professionalise: to pass exams, earn certain skills and receive recognition from your peers. If you have a license you can practice the profession: if you don't, you can't.<\/p>\n<p>A craft is different. Traditional crafts are blue-collar or mercantile: carpentry, interior decorating, tailoring. It might help, but you don't <em>need<\/em> a license to paint a house. Your work speaks for itself. Crafts do not come from the academy, but the guild system. In a guild, a master craftsman would employ a number of journeymen and apprentices. Journeymen would be paid a fair wage for their labor, while apprentices would be paid just enough to live on, with the understanding they were there to learn. The guild system is still alive in Europe today: often tradesmen work in pairs of a master and an apprentice.<\/p>\n<blockquote>\n<p>Programming is a craft more than it is a profession. You don't need to pass an exam to be a programmer. You don't need a Computer Science degree, or even a 12-hour certificate. All you need are skills and the ability to market yourself.<\/p>\n<\/blockquote>\n<p>For most new programmers, this means that:<\/p>\n<ul>\n<li>You can get your first job very early if you'll settle for low pay.<\/li>\n<li>If you can create useful output, you are ready to apply for jobs.<\/li>\n<li>You only need to know the basics to apply.<\/li>\n<\/ul>\n<p>If you only have basic skills, you can only find basic roles: you're an apprentice. Given you're getting paid to learn, this is an okay deal. The bigger problem is many developers want the same entry-level roles as you. Some are more qualified than you, and some are the hiring manager's cousin. Unless you're a luminous personality your odds are slim. <strong>You should still apply.<\/strong> If your odds of success are 0.1%, then if you apply to 700 jobs, you have a greater than 50% chance of success.<\/p>\n<p>You probably don't want to apply for hundreds of jobs before success. That's okay. A much more relaxed strategy is to increase your odds of success with each application. If you increase your odds to 1% for a role, you only need to apply to 70 before you break even. There are two ways you can do this: <strong>improve your skills, or improve your marketing.<\/strong><\/p>\n<p>To improve your skills, you need to know which skills to focus on. Most developers choose web development because there are so many roles out there. In 2023 this is the path most taken. If you're passionate about something else, like making games, building robots, or trading, then do that. There are fewer jobs in those fields, but there are also fewer people to compete with.<\/p>\n<p>The skill level you want to reach in any of these areas is one where you can demonstrate understanding. Just like a traditional craft, producing work is the simplest way to do this. In web development, you can make a portfolio website. In games, you should make some playable demos. In robotics, you can <a href=\"https:\/\/www.youtube.com\/watch?v=9n1SHUh11yU\">make a turtle<\/a> and blog about it. Like any craft, your work should speak for itself.<\/p>\n<p>The other key factor in finding a job is <strong>marketing<\/strong>. Finding a job is about sales: you are selling yourself. Part of this is showing your skills, the other is networking. You can do this in person, online, or both. By networking with other developers you:<\/p>\n<ul>\n<li>Hear about new opportunities. In sales this is called 'finding leads'.<\/li>\n<li>Have people to discuss technical issues with.<\/li>\n<li>Gain a greater understanding of your skills and where you can improve.<\/li>\n<li>Make friends and connections for the future.<\/li>\n<\/ul>\n<p>Stepping away from the computer and into developer meetups is usually worth it. I found several jobs through meetups and social media. My students usually find <em>their<\/em> first roles through networking rather than by sending off CVs online. Like a medieval guild, the best way to succeed in the craft of programming is to share with your peers and learn from masters of the craft.<\/p>\n<p>You can improve your skills and network while applying for roles. If you apply all through the apprenticeship process, your odds are higher than if you wait until you feel ready.<\/p>\n<p>The three questions I asked at the top of this article were:<\/p>\n<ul>\n<li>How long does it take to get your first job?<\/li>\n<li>How do I know I'm ready to apply for jobs?<\/li>\n<li>What do I need to know to get my first programming job?<\/li>\n<\/ul>\n<p>Here are my answers:<\/p>\n<ul>\n<li>You can find your first job in a few months if you're willing to be an apprentice. To become a journeyman will take a year or so of study and practice.<\/li>\n<li>You should apply for entry-level jobs as soon as you have a basic grasp of programming.<\/li>\n<li>There is no fixed set of skills needed for a programming job, but demonstrating your knowledge in your chosen field is helpful when selling yourself.<\/li>\n<\/ul>\n<p>Good luck out there!\nFrank<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"career"}}]},{"title":"Will AI Make Me Obselete?","link":{"@attributes":{"href":"https:\/\/fd93.me\/will-ai-take-my-job.html","rel":"alternate"}},"published":"2023-04-07T00:00:00+08:00","updated":"2023-04-07T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2023-04-07:\/will-ai-take-my-job.html","summary":"<p><img alt=\"\" src=\"images\/ai-obselete.jpeg\"><\/p>\n<p><strong>If you want the short answer: <\/strong>probably not. \nIf you want the long answer, read on.<\/p>\n<p>I recently had an interesting conversation with one of my clients. They were very concerned about the impact that advanced AI like GPT-4 would have on the market for programming jobs. In other words \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/ai-obselete.jpeg\"><\/p>\n<p><strong>If you want the short answer: <\/strong>probably not. \nIf you want the long answer, read on.<\/p>\n<p>I recently had an interesting conversation with one of my clients. They were very concerned about the impact that advanced AI like GPT-4 would have on the market for programming jobs. In other words, they were worried they wouldn't be able to find a job. As someone who tutors developers, is a developer myself, and runs a company that could benefit from applications of generative AI, I feel like I'm in a fairly good position to see several different sides of this issue.<\/p>\n<p>To think about who's likely to be affected by generative AI, let's think about who is involved in the software development industry and what they do.<\/p>\n<h2>Business Owners<\/h2>\n<p><strong>AKA: Your clients.<\/strong><\/p>\n<p>If the application works, meets the business needs and it's cheap, then it's usually not that important to the client what process happened to produce it. To give an example, this blog is being hosted on Ghost's servers. I could host it myself but then I'd have to deal with self-hosting, server outages, content distribution, etc - and it'd only save me about $5 a month to do so. <\/p>\n<p>In other words, your clients (assuming they're rational actors) are likely to be less concerned with if humans made the product than whether it meets their needs and is cheap. This can make a compelling case for using AI, but it can equally make a case against it. Since AI is such a black-box process, it's hard for clients to shape specific details of a product generated by an AI. In order to do that they'd need to understand the inner workings of the product, which is more a task for our next group.<\/p>\n<h2>Senior Developers, Architects, etc.<\/h2>\n<p>Many college grads and junior developers are surprised to learn that a lot of senior developers spend relatively little time writing code. This is because the job of a senior developer generally involves <strong>understanding, designing, and integrating code according to business requirements.<\/strong> In other words, senior developers are likely to be doing things like:<\/p>\n<ul>\n<li>Designing the tech stack for an application<\/li>\n<li>Reviewing junior engineers' code and accepting or rejecting merge requests<\/li>\n<li>Training other developers in specific technologies<\/li>\n<li>Learning about new technologies: their capabilities and limitations<\/li>\n<li>Communicating technical challenges to other stakeholders<\/li>\n<\/ul>\n<p>Unlike the role of a junior developer, these kinds of tasks tend to involve less time in front of a computer and more time sitting in meetings (to the disappointment of many greybeards).<\/p>\n<p>So these types of roles are unlikely to be particularly affected by AI. The key role of a senior developer is <em>advisory<\/em> rather than <em>mechanical<\/em>: their ability to write good code (while helpful) isn't the main reason they're hired. While generative AI can provide research help to these kinds of roles, the amount of context and communication needed to successfully navigate technical challenges is beyond what current AI are capable of.<\/p>\n<h2>Junior Developers<\/h2>\n<p>As alluded to above, the role of a junior developer is often, to a large degree, to write code. But junior developers aren't just code monkeys, they should also be doing other tasks which move them towards becoming good senior developers (sidebar: if you feel like the song '<a href=\"https:\/\/www.youtube.com\/watch?v=AEBld6I_AKs\">Code Monkey<\/a>' applies to you, start looking for a new job).<\/p>\n<p>Depending on what exactly a junior works on, they might have a range of different responsibilities. But let's consider a frontend web developer as an easy-to-understand (and very common) example. A junior frontend developer's responsibilities might include:<\/p>\n<ul>\n<li>Translating designs or prototypes by UX designers into working code<\/li>\n<li>Taking responsibility for specific sections of a web application (the notorious login page)<\/li>\n<li>Understanding technical and business requirements and writing code that complies with them<\/li>\n<li>Understanding how to use some specific technologies such as React or Vue to meet the requirements of a client<\/li>\n<\/ul>\n<p>You'll note that the last two requirements involve elements of social orientation just like the role of the senior developer, and of course it's these capabilities that need to be developed (rather than just raw coding skills) for a junior to be successful in the long run.<\/p>\n<p>AI can augment the task of a typical junior developer but it can't replace the social aspects of that work as again, this requires a deep and ongoing awareness of social context which current AI lacks.<\/p>\n<p>In the future, perhaps we will see the training and role of a junior developer becoming less focused on the task of writing code and more focused on the social and design aspects of coding.<\/p>\n<h2>Outsourcing Companies<\/h2>\n<p>These guys are going to have problems. Since their main role is to produce a working product from a clients' spec and they're notorious for being slow to adapt to changes to that spec, they have pretty much the same capabilities as a generative AI, except with slower turnaround and a much higher cost.<\/p>\n<p>It's possible then that outsourcing companies, who mostly just provide a cost-effective way for clients to get a lot of working code, find themselves outcompeted by AI in the next few years.<\/p>\n<p>The companies that survive will be the ones that take a more creative and collaborative approach to working with clients, and specifically those which can provide value beyond selling a ton of code and a functional product.<\/p>\n<h2>Conclusion<\/h2>\n<p>This is a fairly brief consideration of the role that AI will play in the tech industry in the next few years, but one thing seems fairly clear: <strong>being able to write code is now not the most important factor for developer job security<\/strong>. What's less clear is whether this represents as huge a shift as some outlets claim. The role of some of the most skilled professionals in the industry is already mainly <strong>social<\/strong> rather than <strong>mechanical<\/strong>, and generative AI tools like GPT-4 are just likely to accelerate that trend.<\/p>\n<p>Perhaps the best effect generative AI will have in the industry, then, is to return our focus to humans: their wants, needs, and complexities.<\/p>\n<p>Frank, Director @ Milk Tea Tech<\/p>","category":{"@attributes":{"term":"general"}}},{"title":"How to Make Slax Your Ultimate Portable PC","link":{"@attributes":{"href":"https:\/\/fd93.me\/how-to-make-slax-your-ultimate-portable-pc.html","rel":"alternate"}},"published":"2023-03-04T00:00:00+08:00","updated":"2023-03-04T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2023-03-04:\/how-to-make-slax-your-ultimate-portable-pc.html","summary":"<p><img alt=\"\" src=\"images\/slax-small.webp\"><\/p>\n<p>If you search the internet, you'll find a ton of information about portable\nLinux distros such as Slax. But most articles just give a list of what's out\nthere and popular without taking the time to explain how to set them up - and\nbelieve me, the set up process for \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/slax-small.webp\"><\/p>\n<p>If you search the internet, you'll find a ton of information about portable\nLinux distros such as Slax. But most articles just give a list of what's out\nthere and popular without taking the time to explain how to set them up - and\nbelieve me, the set up process for some of these distros can be far from simple.<\/p>\n<p>Portable Linux distros are any distro that's designed to run from a USB stick or\nexternal drive, without being installed. These are a bit different to the\ntypical Linux LiveCDs used to install \/ preview Linux distributions. As a daily\ndriver of Pop! OS and a huge advocate of using the technology that works for\nyour use case, I think there's a few reasons you might be interested in portable\nLinux distributions:<\/p>\n<ul>\n<li>\n<p>You don't own or don't want to carry around a laptop - maybe you're a\n  backpacker, maybe you live out of internet cafes, maybe you just travel a\n  bunch.<\/p>\n<\/li>\n<li>\n<p>You're interested in being able to use any hardware and still have a reliable,\n  known environment.<\/p>\n<\/li>\n<li>\n<p>You want to have an OS that you can use for debugging other devices or Linux\n  installs.<\/p>\n<\/li>\n<li>\n<p>You have old hardware and want to revive it without committing to using it\n  permanently.<\/p>\n<\/li>\n<\/ul>\n<p>In my case, it's a combination of these: my daily driver Pop! OS install offers\na lot of opportunities to get distracted by messaging and I travel around quite\na lot, so having to carry the daily driver whenever I go out can be annoying. I\nalso have an old ASUS laptop without a storage drive which is a prime candidate\nto run a portable OS from a drive. My goals with this install were to make a USB\nstick I could plug into most computers and do productive work with minimal\ndowntime. The USB stick I'm using for this is only 16GB, so any setup had to\nalso be fairly lightweight.<\/p>\n<p><strong>Why Slax?<\/strong> Slax is minimal and Debian-based, which means it uses familiar\ntools and comes with only very basic apps by default. This contrasts with other\npopular portable distros such as Puppy Linux, which is an older portable distro\nand comes pre-loaded with more niche apps, or Porteus, which is based on the\nolder Slackware distribution of Slax. Unfortunately, even most Linux users\naren't as familiar with Slackware distributions, so the minimal Debian\ndistribution is likely to work for the majority of users with some Linux\nexperience.<\/p>\n<h2>Preparing to Install (from Linux)<\/h2>\n<p>I'm writing under the assumption you're already using Linux, because I assume\nmost people who want to use portable distributions have already tried it. If\nyou're installing from Windows some of these steps (like dealing with filesystem\npermissions) won't be relevant to you.<\/p>\n<p>If you visit the official Slax website you'll get\n<a href=\"https:\/\/www.slax.org\/starting.php\">a pretty decent setup guide<\/a>. Unfortunately,\nthis guide doesn't really cover certain difficulties you might have. In any\ncase, our first step is to <strong><a href=\"https:\/\/www.slax.org\/\">download the Slax ISO<\/a>.<\/strong><\/p>\n<p>My daily driver doesn't support booting from non-FAT32 partitions, so I had to\nformat my USB stick to this in order to get the BIOS to recognise the USB stick\nas a bootable drive. FAT32 is also the most widely supported filesystem on most\nhardware, so for a portable distro like Slax it makes sense to format your drive\nthis way. However, there's a couple of problems with using FAT on Linux.<\/p>\n<ul>\n<li>\n<p>FAT isn't POSIX-compliant. This means that Slax itself will complain loudly\n  about being installed on a FAT drive and will need to store its data in files\n  rather than directly on your USB drive. However, this isn't that big a deal;\n  Slax handles saving its data to files pretty handily. The only real\n  consequence of this are you have to wait for data to finish writing whenever\n  you make changes and you can't store single files bigger than 4GB (why would\n  you need to on a portable distro?) The much bigger problem is...<\/p>\n<\/li>\n<li>\n<p>FAT doesn't have support for filesystem permissions. This means that by\n  default it'll be mounted as a read-only filesystem, making it impossible to\n  load the Slax files onto the USB stick.<\/p>\n<\/li>\n<\/ul>\n<p>Luckily the filesystem permission problem is easily overcome with a couple of\ntweaks to our fstab file, which I'll share later.<\/p>\n<p>For now, just <strong>format your whole USB stick with a single FAT32 partition<\/strong>\nusing whatever software you prefer. <strong>Do not<\/strong> try to load the Slax ISO directly\nonto the USB stick - by default, Slax acts as a CD-ROM, which means you can't\nedit anything once it's burned.<\/p>\n<p><img alt=\"\" src=\"images\/Screenshot-from-2023-03-04-23-22-11-1024x769.png\"><\/p>\n<p>On most Linux distros, your FAT32 partition will be immediately detected.\nHowever, it won't be writable. This is because FAT32 has no concept of\npermissions, so the permissions of the drive are decided by your Linux\ndistribution when you mount the USB stick. The easiest way to deal with this is\nto <strong>edit your \/etc\/fstab file to allow writing and execution to the device<\/strong>.\nYou just need to add one line to your fstab file. Depending on exactly how you\nwant to set it up, your exact line will vary but will look something like this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"nv\">LABEL<\/span><span class=\"o\">=<\/span><span class=\"nv\">slax<\/span><span class=\"w\"> <\/span><span class=\"o\">\/<\/span><span class=\"nv\">mnt<\/span><span class=\"o\">\/<\/span><span class=\"nv\">slax<\/span><span class=\"w\"> <\/span><span class=\"nv\">auto<\/span><span class=\"w\"> <\/span><span class=\"nv\">nosuid<\/span>,<span class=\"nv\">nodev<\/span>,<span class=\"nv\">nofail<\/span>,<span class=\"nv\">noauto<\/span>,<span class=\"nv\">x<\/span><span class=\"o\">-<\/span><span class=\"nv\">gvfs<\/span><span class=\"o\">-<\/span><span class=\"k\">show<\/span>,<span class=\"k\">exec<\/span>,<span class=\"nv\">dmask<\/span><span class=\"o\">=<\/span><span class=\"mi\">000<\/span>,<span class=\"nv\">fmask<\/span><span class=\"o\">=<\/span><span class=\"mi\">000<\/span><span class=\"w\"> <\/span><span class=\"mi\">0<\/span><span class=\"w\"> <\/span><span class=\"mi\">0<\/span>\n<\/code><\/pre><\/div>\n\n<p>The important parts are the exec, dmask, and fmask options. These allow you to\nexecute programs on the filesystem, edit directories, and edit files\nrespectively. For more info on fstab formatting\n<a href=\"https:\/\/man7.org\/linux\/man-pages\/man5\/fstab.5.html\">see the fstab manual<\/a>.<\/p>\n<p>Now we can finally follow the official guide. First, <strong>mount the Slax iso<\/strong>\nsomehow. I simply used GNOME's built in Disk Image Mounter utility. You should\nsee the main slax folder and the readme.<\/p>\n<p><img alt=\"\" src=\"images\/Screenshot-from-2023-03-04-22-47-45.png\"><\/p>\n<p><strong>Next, copy the entire slax folder to your USB drive<\/strong>, <strong>then, open up the\n\/slax\/boot\/ folder from the USB drive in your terminal and execute\nbootinst.sh.<\/strong> You might need to use sudo for this.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>sudo .\/bootinst.sh\n<\/code><\/pre><\/div>\n\n<p><img alt=\"\" src=\"images\/Screenshot-from-2023-03-04-23-30-13.png\"><\/p>\n<p>Now we have a valid slax install!<\/p>\n<h2>Booting Into Slax<\/h2>\n<p>Assuming you want to use Slax on the same device you used to flash the USB\nstick, the next step is to <strong>restart your computer and open up your BIOS<\/strong>. Make\nsure that Secure Boot and probably also Fast Boot are disabled (I found the\nformer blocked Slax from loading, but the latter has no real impact on my\nhardware). From there you should be able to select the USB stick you just set up\nas boot media, and you'll be greeted with the Slax boot screen:<\/p>\n<p><img alt=\"\" src=\"images\/Screenshot-from-2023-03-04-23-35-32.png\"><\/p>\n<p>You have a couple of options here. You can use the 'Fresh Start' option, which\ngives you a totally static install with no files saved to disk. However, this is\na bit harder to use as it requires you to manually save any changes you make to\nmodules (I may write another article about this later). Assuming you chose to\nboot with persistent changes, you just need to wait a little while and you\nshould be greeted with the Slax desktop.<\/p>\n<p>If your boot freezes before getting into the desktop you might need to modify\nthe GRUB boot options. You can do this either by pressing tab at the Slax\nbootscreen or by modifying sysconfig.cfg in your USB's boot folder. The most\nlikely issue is with acpi, so you can change the APPEND lines of your boot\noptions to address this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code><span class=\"n\">APPEND<\/span><span class=\"w\"> <\/span><span class=\"n\">vga<\/span><span class=\"o\">=<\/span><span class=\"n\">normal<\/span><span class=\"w\"> <\/span><span class=\"n\">initrd<\/span><span class=\"o\">=\/<\/span><span class=\"n\">slax<\/span><span class=\"o\">\/<\/span><span class=\"n\">boot<\/span><span class=\"o\">\/<\/span><span class=\"n\">initrfs<\/span><span class=\"o\">.<\/span><span class=\"n\">img<\/span><span class=\"w\"> <\/span><span class=\"n\">load_ramdisk<\/span><span class=\"o\">=<\/span><span class=\"mi\">1<\/span><span class=\"w\"> <\/span><span class=\"n\">prompt_ramdisk<\/span><span class=\"o\">=<\/span><span class=\"mi\">0<\/span><span class=\"w\"> <\/span><span class=\"n\">rw<\/span><span class=\"w\"> <\/span><span class=\"n\">printk<\/span><span class=\"o\">.<\/span><span class=\"n\">time<\/span><span class=\"o\">=<\/span><span class=\"mi\">0<\/span><span class=\"w\"> <\/span><span class=\"n\">consoleblank<\/span><span class=\"o\">=<\/span><span class=\"mi\">0<\/span><span class=\"w\"> <\/span><span class=\"n\">slax<\/span><span class=\"o\">.<\/span><span class=\"n\">flags<\/span><span class=\"o\">=<\/span><span class=\"n\">automount<\/span><span class=\"w\"> <\/span><span class=\"n\">acpi<\/span><span class=\"o\">=<\/span><span class=\"n\">off<\/span>\n<\/code><\/pre><\/div>\n\n<h2>Making Slax Fun<\/h2>\n<p>Here's our current Slax setup:<\/p>\n<p><img alt=\"\" src=\"images\/Screenshot-from-2023-03-04-23-42-59.png\"><\/p>\n<p>You may notice it's looking a bit... plain right now. First, it's running in VGA\nmode 640x480. Second, it's running a very minimal window manager as its desktop\nenvironment. However, neither of these are hard limitations of Slax, just\ndefaults designed to get you up and running with minimal overhead for your\ndevice. <strong>You might need a wired internet connection for this part<\/strong>, either via\nUSB adapter or ethernet port on your device.<\/p>\n<h3>Get Up To Date<\/h3>\n<p>Some of the default behaviours of Slax can be a bit strange. For example, when\nit shuts down it might not actually power off your device. Luckily, this issue\nseems to have already been patched; we can update our packages in the normal way\nfor Debian. Open a terminal and write the following:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>apt update\napt upgrade\n<\/code><\/pre><\/div>\n\n<p>Wait for the update to finish, then restart and you should have better firmware\non Slax.<\/p>\n<h3>Get the Basics<\/h3>\n<p>Slax comes with AMD, Nvidia, and Intel graphics drivers from the stable release\nof Debian preinstalled. These might be a bit dated, but they should work just\nfine. However, it doesn't necessarily use them. On my device this was the main\nreason I was locked to the default 640x480 resolution. In order to get them to\nactually work, you'll likely need to install the\n<a href=\"https:\/\/packages.debian.org\/bullseye\/firmware-linux\">firmware-linux Debian package<\/a>.\nCrack open a terminal to do this:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>apt install firmware-linux\n<\/code><\/pre><\/div>\n\n<p>It might be worth restarting after this step just to make sure it worked.<\/p>\n<p>Assuming you're on modern hardware, you probably want to be able to use\nbluetooth. The easiest way I found to do this was to install two packages:\nbluez, the default Linux bluetooth service, and blueman, a GUI for managing your\nbluetooth connections. These will give you both an easy interface and a more\nadvanced and reliable interface for connecting to your bluetooth devices.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>apt install bluez blueman\nsystemctl enable bluetooth.service\n<\/code><\/pre><\/div>\n\n<p>Finally, you likely want a proper interface for wireless networks. Unfortunately\nI only got this working on my older devices as my newer laptop appears to have a\nwifi card that's not yet supported by Debian stable. However,\n<a href=\"https:\/\/wiki.debian.org\/NetworkManager\">good old network-manager<\/a> will provide\nus with a good-enough graphical interface<\/p>\n<p>Restart your computer up again. This time it should load the bluetooth service\nby default.<\/p>\n<p>Finally, we probably want a friendlier text editor than the default vi for\ntweaking our system. If you're familar with terminal editors, install whatever\nyou prefer: I chose <a href=\"https:\/\/packages.debian.org\/buster-backports\/micro\">micro<\/a>\nas it's easy to use.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>apt install micro\n<\/code><\/pre><\/div>\n\n<p>Optionally, you can install any terminal emulator you prefer. I like\n<a href=\"https:\/\/packages.debian.org\/sid\/tilix\">tilix<\/a> for its easy-to-use GUI.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>apt install tilix\n<\/code><\/pre><\/div>\n\n<h3>Get A Proper Desktop<\/h3>\n<p>By default, Slax uses the fluxbox window manager as its desktop environment.\nThis is great for very low-end hardware and for making the burden on the USB\nstick we're using as low as possible, but if you're used to conventional desktop\nenvironments it might feel a bit <em>too<\/em> minimal.<\/p>\n<p>The first step is to choose what desktop environment you want. As always, choose\nbased on your use case and preferences. As a rough guide:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/buster\/gnome-core\">GNOME<\/a> (package gnome-core) if\n  you want a slick Mac-style environment and don't care about disk usage<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/bullseye\/kde-plasma-desktop\">KDE Plasma<\/a> (package\n  kde-plasma-desktop) if you want a very customisable desktop and don't care\n  about disk usage<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/sid\/cinnamon-core\">Cinnamon<\/a> (package\n  cinnamon-core) if you want a more Windows-like environment and don't care\n  about disk usage<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/buster\/mate-desktop-environment-core\">MATE<\/a>\n  (package mate-desktop-environment-core) if you want a lighter Windows-like\n  experience<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/bullseye\/xfce4\">XFCE<\/a> (package xfce4) if you want\n  a lightweight desktop without too much fuss<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/packages.debian.org\/bullseye\/lxde\">LXDE<\/a> (package lxde) if you want\n  the lightest possible desktop short of a window manager<\/p>\n<\/li>\n<\/ul>\n<p>(If you're a hardcore window manager enthusiast you likely don't need my help.)<\/p>\n<p>Despite being a massive GNOME fan, I selected XFCE for my setup because my USB\nstick is only 16GB, and even the base install of GNOME is 1GB. XFCE is much\nlighter and should run on a variety of hardware with little issue. There are two\nsteps you need to take to setup your desktop: first, install the package you\nwant above:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>apt install YOUR_DESKTOP_HERE\n<\/code><\/pre><\/div>\n\n<p>If you restart now, you'll notice you still boot into the same old fluxbox\nenvironment. This is because slax, being a lightweight distro, doesn't ship with\na login screen by default. Luckily it's easy to change our desktop environment\nmanually. Open up a terminal and type in:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>micro ~\/.xinitrc\n<\/code><\/pre><\/div>\n\n<p>xinitrc is the first thing that the x display server calls when it opens; in\nslax it's used to control the desktop environment we boot into.<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>startfluxbox\n<\/code><\/pre><\/div>\n\n<p>All we need to do is change this line to the appropriate command to start our\ndesktop environment:<\/p>\n<div class=\"highlight\"><pre><span><\/span><code>startxfce4\n<\/code><\/pre><\/div>\n\n<p>Finally, restart your computer and enjoy your new desktop environment!<\/p>\n<p><img alt=\"\" src=\"images\/xfce-slax-1024x646.png\"><\/p>\n<p>Ain't she a beaut?<\/p>\n<p>From here, the world is your oyster. We've set up a desktop environment that's\nalmost identical to a typical Linux desktop install, except it runs off a simple\nUSB stick. You can try running your new 'computer' on any available devices just\nby plugging them in and using the BIOS to boot from USB stick.<\/p>\n<p>Have fun, and enjoy being able to carry your new computer in your pocket!<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"blog"}},{"@attributes":{"term":"linux"}}]},{"title":"In Defence of the ToDo List","link":{"@attributes":{"href":"https:\/\/fd93.me\/todo-i.html","rel":"alternate"}},"published":"2022-03-19T00:00:00+08:00","updated":"2022-03-19T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2022-03-19:\/todo-i.html","summary":"<p><img alt=\"\" src=\"images\/todo-list.webp\"><\/p>\n<p>I was overwhelmed. I\u2019d made a kanban board with fifty cards, each beautifully\ncolor-coded and allocated story points. I\u2019d organised my calendar beautifully,\nmapping out the free time to write code every day that week. I\u2019d constructed a\nburn-down chart and factored in my doctors\u2019 appointment, sleep \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/todo-list.webp\"><\/p>\n<p>I was overwhelmed. I\u2019d made a kanban board with fifty cards, each beautifully\ncolor-coded and allocated story points. I\u2019d organised my calendar beautifully,\nmapping out the free time to write code every day that week. I\u2019d constructed a\nburn-down chart and factored in my doctors\u2019 appointment, sleep cycle, and a\ndate.<\/p>\n<p>But I still didn\u2019t know where to start.<\/p>\n<p>Whether you have a lot of free time or very little, it\u2019s tempting to reach for\nthe most complicated tools you know to solve your problem. But sometimes the\nhumble ToDo list is quicker, easier, and more flexible than anything else.<\/p>\n<h2>Advantages of the ToDo List<\/h2>\n<p>The ToDo list is so common that it\u2019s easy to ignore its numerous advantages in\nfavour of more complex methods, so let\u2019s outline what those advantages are.<\/p>\n<p><strong>It\u2019s simple.<\/strong> Everyone can write a list of things they need to do. Everyone\ncan go down a list and check off items as they go. It\u2019s easy to see what you\nneed to do next on a ToDo list.<\/p>\n<p><strong>It\u2019s quick.<\/strong> Coming up with a list of things you need to do might take a\nlittle while, but compared to allocating story points to a list of user stories\nin Scrum methodology, it\u2019s trivial.<\/p>\n<p><strong>It\u2019s flexible.<\/strong> To represent completing a task, tick a box \u2611\ufe0f. To represent a\ntask that can\u2019t be completed or you\u2019ve decided against, do a barrel roll cross\nit out. If you write your tasks on post-it notes you can also move them around\neasily.<\/p>\n<p><strong>It\u2019s time-agnostic<\/strong>. If you have a list of things to do but you don\u2019t care\nexactly when they happen, a ToDo list lets you prioritise them. This is really\nhelpful if you have time blocked out for \u201cgeneral tasks\u201d but don\u2019t want to spend\nthe time to allocate specific tasks to specific time slots like in a timeboxing\napproach.<\/p>\n<p><strong>It provides a clear reference.<\/strong> This is important when you\u2019re making a\nchecklist, for example for a safety or bug check. In these cases <em>everything<\/em> in\nthe list needs to be completed in order for something else to happen.<\/p>\n<p><img alt=\"Checklists are a special form of ToDo list which can help clarity.\" src=\"images\/pexels-pixabay-416322-1.jpg\"><\/p>\n<p>Photo\nby\u00a0<a href=\"https:\/\/www.pexels.com\/@pixabay?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Pixabay<\/a>\nfrom\u00a0<a href=\"https:\/\/www.pexels.com\/photo\/person-marking-check-on-opened-book-416322\/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Pexels<\/a><\/p>\n<h2>Limitations of the ToDo List<\/h2>\n<p>The ToDo list doesn\u2019t have disadvantages so much as limitations: it\u2019s such a\nsimple tool that it lacks certain features needed for complex projects.<\/p>\n<p><strong>No dependencies.<\/strong> It\u2019s difficult to have sub-tasks as part of a ToDo list.\nWhile there are software solutions that allow this (and you can always just\nindent sub-tasks on an app like <a href=\"https:\/\/notion.so\">Notion<\/a>), knowing how to\ntreat sub-tasks is often difficult. For example, in\n<a href=\"https:\/\/todoist.com\/\">ToDoist<\/a> the dates of tasks and sub-tasks are separate,\nmeaning they can get out of sync with one another and require manual upkeep.\nAlso, forget about more complex requirements: for that you need something like a\nGantt Chart.<\/p>\n<p><strong>It\u2019s time-agnostic.<\/strong> This is a strength but also a weakness. Since ToDo lists\nare generally sorted by <em>priority<\/em> not <em>time<\/em>, relying on them for time-bound\ntasks is a mistake. However, it\u2019s relatively easy to make a template (or use an\napp) which will allow you to sort by time.<\/p>\n<p><strong>Only one project.<\/strong> You could maintain ToDo lists for different projects, but\nthen you\u2019d lose the main advantage of them over other methods: simplicity. The\nonly time this really makes sense is having different lists by <em>context<\/em> - one\nfor work, one for home, and one for school, for example.<\/p>\n<p><strong>Only one person.<\/strong> Because ToDo lists only have one time sequence, they\u2019re\nvery poor at handling situations where multiple people are working at the same\ntime. If you\u2019re working independently, this doesn\u2019t matter, but if you\u2019re\nworking on a team you probably want more than one person to work on different\nthings at the same time.<\/p>\n<h2>When to Use ToDo Lists<\/h2>\n<p>From the advantages and disadvantages I\u2019ve outlined above, here are a few times\nit makes sense to use ToDo lists.<\/p>\n<p><strong>When time isn\u2019t important.<\/strong> This can happen because you don\u2019t have strict\ndeadlines, or because you are only going to use the list for one day.<\/p>\n<p><strong>When you want clear priorities.<\/strong> ToDo lists simplify priorities at the cost\nof making other factors, such as time irrelevant.<\/p>\n<p><strong>When you\u2019re working independently.<\/strong> ToDo lists aren\u2019t ideal when you\u2019re\nworking on a team because they only allow for one thing to happen at a time. A\nmore complex tool like a kanban is far more useful than a simple ToDo list for\nteams, as they make it a lot easier for different team members to progress tasks\nat different rates.<\/p>\n<p><strong>When you need everything to be completed.<\/strong> This is mostly the case when\nyou\u2019re going through a process like deep cleaning or bug testing where it\u2019s\nimportant for every step to be followed.<\/p>\n<h2>How To Make ToDo Lists Work For You<\/h2>\n<p><img alt=\"\" src=\"images\/pexels-karolina-grabowska-7680088-1024x683.jpg\"><\/p>\n<p>Post-its are helpful for changing priorities. Photo\nby\u00a0<strong><a href=\"https:\/\/www.pexels.com\/@karolina-grabowska?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Karolina Grabowska<\/a><\/strong>\nfrom\u00a0<strong><a href=\"https:\/\/www.pexels.com\/photo\/woman-in-pink-long-sleeve-shirt-sticking-post-its-on-the-wall-7680088\/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Pexels<\/a><\/strong><\/p>\n<p>A list on paper is easy to write but it\u2019s not the best possible version of a\nToDo list. Here are some suggestions to make ToDo lists work better for you.<\/p>\n<p><strong>Try using post-its.<\/strong> Post-it notes are easier to move around and throw away\nthan writing on a piece of paper, making changes to your priorities a lot easier\nto deal with. You can also use magnetic notes or an app, depending on your\npreference and your workspace.<\/p>\n<p><strong>Prioritise by what\u2019s important to you. I<\/strong>f you have a list of tasks that need\nto happen at certain times in a week, prioritising by <em>time<\/em> makes more sense.\nIf you\u2019re working on creating a product, then you need to prioritise by the\n<em>needs of the product<\/em>.<\/p>\n<p><strong>Avoid subtasks.<\/strong> Sometimes a task can be broken down into several smaller\ntasks. Do they need to be grouped together? For example, writing a draft of a\nblog post is one task, editing it is another, and posting about it on social\nmedia is a third \u2014 but you might want to take a break between writing and\nediting. In this case, grouping the tasks together might make it harder to\nunderstand what order you\u2019re doing things in.<\/p>\n<h2>Summary<\/h2>\n<p>ToDo lists are quick to make, easy to understand, and flexible. However, they\ndon\u2019t allow dependencies, they\u2019re mostly useful for working alone on small\nprojects, and don\u2019t work well with complicated deadlines.<\/p>\n<p><em>The best times to use ToDo lists are:<\/em><\/p>\n<ul>\n<li>When deadlines aren\u2019t important, or you\u2019re only planning for a day or two.<\/li>\n<li>When you want clear priorities, not complex dependencies.<\/li>\n<li>When you\u2019re working independently, not on a team.<\/li>\n<li>When you need everything on the list to be completed before something else can\n  happen.<\/li>\n<\/ul>\n<p><em>To help you use ToDo lists more effectively, you can:<\/em><\/p>\n<ul>\n<li>Try using post-its or other movable media for each task.<\/li>\n<li>Prioritise by what\u2019s important to you, whether that\u2019s deadlines or logical\n  steps for a project.<\/li>\n<li>Avoid subtasks and try to break up complex tasks into several smaller tasks.<\/li>\n<\/ul>\n<p><strong>I <a href=\"todo-ii\">wrote a follow-up to this article<\/a> about the Eisenhower Matrix and\nhow it can help manage complex task lists.<\/strong><\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"handbook"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"study"}}]},{"title":"Laziness Does Not Exist: 3 Questions to be More Productive","link":{"@attributes":{"href":"https:\/\/fd93.me\/laziness-does-not-exist-3-questions-to-be-more-productive.html","rel":"alternate"}},"published":"2022-03-13T00:00:00+08:00","updated":"2022-03-13T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2022-03-13:\/laziness-does-not-exist-3-questions-to-be-more-productive.html","summary":"<p><img alt=\"\" src=\"images\/procrastination.drawio-4.png\"><\/p>\n<p><em>This is part of a series of short articles on rational tools to help you be\nmore productive while still practicing self-care. To jump to the summary,\n<a href=\"https:\/\/fd93.me\/2022\/03\/13\/laziness-does-not-exist-3-questions-to-be-more-productive#summary\" title=\"Laziness Does Not Exist: 3 Questions to be More Productive\">click here<\/a>.<\/em><\/p>\n<p>Do you procrastinate? How much? Do you feel like you could achieve more if you\nprocrastinated less? Wouldn\u2019t it be \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/procrastination.drawio-4.png\"><\/p>\n<p><em>This is part of a series of short articles on rational tools to help you be\nmore productive while still practicing self-care. To jump to the summary,\n<a href=\"https:\/\/fd93.me\/2022\/03\/13\/laziness-does-not-exist-3-questions-to-be-more-productive#summary\" title=\"Laziness Does Not Exist: 3 Questions to be More Productive\">click here<\/a>.<\/em><\/p>\n<p>Do you procrastinate? How much? Do you feel like you could achieve more if you\nprocrastinated less? Wouldn\u2019t it be great to have more motivation?<\/p>\n<p>This is how the pitches for a lot of self-help books read. If you follow a\nguru\u2019s chosen methods, you\u2019ll never procrastinate again, and if you do, it\u2019s\nyour fault for not following the methods correctly.<\/p>\n<p><strong>However,\n<a href=\"https:\/\/humanparts.medium.com\/laziness-does-not-exist-3af27e312d01\">according to Dr Devon Price in <em>Laziness Does Not Exist<\/em><\/a>,\nthere are only two main causes of procrastination on a given activity.<\/strong><\/p>\n<ol>\n<li>Not knowing what to do.<\/li>\n<li>Anxiety (or other negative feelings) about the activity.<\/li>\n<\/ol>\n<p>To these two I\u2019d also add <em>being physically exhausted.<\/em> However, if you find\nyourself falling asleep when you need to work, broader lifestyle issues might be\nat play \u2014 those are beyond the scope of this article.<\/p>\n<p>\u201cBeing lazy\u201d is not on this list. Negative self-talk around productivity is not\nhelpful for actually completing anything, and may contribute to anxiety, which\nis likely to make procrastination worse. The method in this article has helped\nme deal with my own tendencies to procrastinate, which I suffered with through\nhigh school and college, and it doesn\u2019t involve blaming yourself or trying to\nwork harder.<\/p>\n<p><strong>The first thing you need to do is figure out which causes of procrastination\nare relevant to you.<\/strong><\/p>\n<p>This is fairly easy to do: just ask yourself a series of questions, in the\nfollowing order:<\/p>\n<h3><strong>Am I physically unable to complete the task?<\/strong><\/h3>\n<p><img alt=\"\" src=\"images\/pexels-karolina-grabowska-4959800-1-1024x683.jpg\"><\/p>\n<p>Photo\nby\u00a0<strong><a href=\"https:\/\/www.pexels.com\/@karolina-grabowska?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Karolina Grabowska<\/a><\/strong>\u00a0from\u00a0<strong><a href=\"https:\/\/www.pexels.com\/photo\/photograph-of-an-exhausted-woman-in-a-white-shirt-4959800\/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Pexels<\/a><\/strong><\/p>\n<p>This comes first because it\u2019s normally easy to figure out when you\u2019re tired,\nhungry or in pain. If none of these apply, you also know that your problem can\nbe solved relatively quickly. If they <em>do<\/em> apply then you should try to solve\nyour physical problem before forcing yourself to continue working. This probably\nmeans taking a nap, resting or eating something.<\/p>\n<p>A quick note on tiredness. If you feel tired, ask yourself what you\u2019d rather be\ndoing. If the answer is \u201csleeping\u201d or \u201cresting\u201d, you should take a break. If the\nanswer is something more active like \u201cplaying video games\u201d then you\u2019re not\n<em>physically<\/em> tired and this is likely a response to one of the other causes of\nprocrastination. If you find that you always get \u2018tired\u2019 when you need to work,\nconsider moving this question from first to third.<\/p>\n<h3><strong>Do I know what I need to do?<\/strong><\/h3>\n<p><img alt=\"\" src=\"images\/pexels-andrea-piacquadio-941555-1024x683.jpg\"><\/p>\n<p>Photo\nby\u00a0<strong><a href=\"https:\/\/www.pexels.com\/@olly?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Andrea Piacquadio<\/a><\/strong>\u00a0from\u00a0<strong><a href=\"https:\/\/www.pexels.com\/photo\/photo-of-a-woman-thinking-941555\/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Pexels<\/a><\/strong><\/p>\n<p>If you don\u2019t know what to do, how can you do it?<\/p>\n<p>To be clear, I don\u2019t mean \u201cknowing what to do\u201d in the abstract sense but in the\nsense of concrete actions you can take now. For example, you might know that you\nneed to write a dissertation for your BA, but do you know what you need to do\n<em>now<\/em>? You might want to start a business selling scented linen, but where to\nstart?<\/p>\n<p>There are two approaches we can take to this problem. If the process is\n<em>knowable<\/em>, we can write it out and complete it step by step. In the\ndissertation example, there is a clear set of steps: we begin with a literature\nreview, formulate a research question, conduct research, write up our results,\nand edit. As an undergraduate, I didn\u2019t understand the full research process and\nlearned it the hard way, but I could have asked my professors or read a book\nabout it and mapped out the process.<\/p>\n<p>In the example of starting a business, the process is <em>unknowable<\/em>. There are so\nmany complexities and particularities to making a business profitable that there\nis no single process that can guarantee you profits. Instead you need to <em>start\nfrom the basics<\/em>. This means brainstorming a set of actions you can take that\nwill bring you closer to what you want to achieve, and just doing them. For\nexample:<\/p>\n<ol>\n<li>I can ask on social media to find out what types of people buy scented linen.<\/li>\n<li>I can conduct a survey with the types of people who buy scented linen to see\n   how much they\u2019re willing to pay, what\u2019s good quality for them and what scents\n   they like.<\/li>\n<li>I can find out ways to get scented linen and see which works with my\n   customers\u2019 preferences and the price they\u2019re willing to pay.<\/li>\n<li>I can research online platforms which allow me to list and sell my linen at a\n   reasonable price.<\/li>\n<\/ol>\n<p>If the process of figuring out what to do feels a little overwhelming at first,\ndon\u2019t worry! <em>The entire field of strategy is based on figuring out what to do\nin complicated situations, and it gets easier with practice.<\/em><\/p>\n<h3><strong>Am I anxious about the task?<\/strong><\/h3>\n<p><img alt=\"\" src=\"images\/pexels-andrea-piacquadio-3755761-1024x683.jpg\"><\/p>\n<p>Photo\nby\u00a0<strong><a href=\"https:\/\/www.pexels.com\/@olly?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Andrea Piacquadio<\/a><\/strong>\u00a0from\u00a0<strong><a href=\"https:\/\/www.pexels.com\/photo\/woman-in-red-t-shirt-looking-at-her-laptop-3755761\/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels\">Pexels<\/a><\/strong><\/p>\n<p>This comes last because navigating anxiety can be complicated, and there\u2019s a\nwhole approach to therapy (cognitive behavioural therapy) which is based on\nunpacking how our negative thoughts can cause distress.<\/p>\n<p>These approaches to handling work anxiety come from my own experience with\nanxiety and some tools I\u2019ve picked up from therapy, but I\u2019m not a therapist. If\nanxiety is a frequent and serious issue for you, please consider attending\ntherapy to figure out the best course of action for <em>you<\/em>.<\/p>\n<p>If your anxiety is related to a specific outcome, then it might be worth\nthinking through that outcome. For example, I am often anxious when writing\narticles because I\u2019m worried about the response I will get. I worry that I\u2019ll\neither get a massive negative response to my writing, or that nobody will care\nwhat I write. Realistically, the response I get to any given article will likely\nbe somewhere in the middle of those two extremes. But ultimately, whether I get\na large negative response or no response at all, I can manage both of those\noutcomes.<\/p>\n<p>If your anxiety is not related to a specific outcome but is more existential,\nthen it might be worth unpacking those feelings too. For example, I sometimes\nworry that time I spend writing articles is a waste of my time because I can\u2019t\ncontrol other people\u2019s reactions to my work. By recognizing that I don\u2019t have\ncontrol over what others think of my work, I no longer need to worry about it.\nThe anxiety has no specific cause or solution, so it\u2019s not worth worrying about.<\/p>\n<p><em>For me<\/em>, I find that the most likely cause of procrastination is anxiety,\nfollowed by not knowing what to do, followed by physical exhaustion. However, I\nhave the privilege of working a regular schedule and not having extensive\ncommitments outside of work. If you regularly work 60+ hour weeks and make the\ncompromises on diet and sleep needed to do so, as I\u2019ve done at certain times of\nmy life, you might find that your \u201cprocrastination\u201d is really your body telling\nyou to slow down. In which case, <em>listen to your body<\/em>. Burning yourself out is\nnot going to help you achieve your goals, regardless of how frustrated you might\nbe.<\/p>\n<hr>\n<h2>Summary<\/h2>\n<p><em>There are 3 causes of procrastination on activities:<\/em><\/p>\n<ol>\n<li>Not knowing what to do.<\/li>\n<li>Anxiety about the activity.<\/li>\n<li>Physical exhaustion and other distractions.<\/li>\n<\/ol>\n<h3><strong>Process to resolve procrastination:<\/strong><\/h3>\n<ol>\n<li>Don\u2019t panic! Avoid thoughts like \u201cI\u2019m lazy.\u201d or \u201cI always do this.\u201d<\/li>\n<li>Determine which of the 3 causes is relevant to your situation. Ask yourself:<\/li>\n<li>Am I exhausted and require food, drink, or sleep? If not...<\/li>\n<li>What is the first thing I need to do?<\/li>\n<li>How do I feel about doing it?<\/li>\n<li>Figure out a plan to resolve the problem based on which causes apply to you.<\/li>\n<\/ol>\n<p><img alt=\"\" src=\"images\/procrastination.drawio-4.png\"><\/p>\n<p><strong>If you don\u2019t know what to do, you can:<\/strong><\/p>\n<ul>\n<li>Break your problem down into smaller tasks and figure out a process.<\/li>\n<li>Figure out a small task that gets you started in the right direction.<\/li>\n<li>Reach out to others for advice or guidance on the process, or look for\n  information about the problem you\u2019re trying to solve.<\/li>\n<\/ul>\n<p><strong>If you feel anxious about the task, you can:<\/strong><\/p>\n<ul>\n<li>Examine the causes of your anxiety. Are they rational? Do they bear on the\n  problem at hand? Can you resolve your anxieties about the task? (Cognitive\n  therapies like CBT specialise in this process.)<\/li>\n<li>If you can\u2019t resolve your anxieties, can you accept them and continue?<\/li>\n<li>Talk to people with experience with the task. How did they overcome their\n  anxieties? What was their process?<\/li>\n<\/ul>\n<p><strong>If you are exhausted, you can:<\/strong><\/p>\n<ul>\n<li>Take a break from the work. If you are on a deadline you may need to timebox\n  your breaks.<\/li>\n<li>Take a power nap or eat a snack.<\/li>\n<li>Consider physical causes: your sleep cycle, diet, and level of physical\n  exertion are the most likely.<\/li>\n<li>If relevant and possible, ask for an extension on the activity to avoid\n  burnout.<\/li>\n<\/ul>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"handbook"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"study"}}]},{"title":"How to Use Notion as Your Personal Chinese Handbook","link":{"@attributes":{"href":"https:\/\/fd93.me\/how-to-use-notion-as-your-personal-chinese-handbook.html","rel":"alternate"}},"published":"2021-06-25T00:00:00+08:00","updated":"2021-06-25T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2021-06-25:\/how-to-use-notion-as-your-personal-chinese-handbook.html","summary":"<p><img alt=\"\" src=\"images\/notion-handbook.webp\"><\/p>\n<p>Learning Chinese from textbooks and school courses can be a weird experience\nwhen you try to apply it in the real world. Sure, you just learned the grammar\nto say \"My friend cooks poorly\" w\u01d2 de p\u00e9ngy\u01d2u zu\u00f2 f\u00e0n zu\u00f2 b\u00f9\nh\u01ceo; \u6211\u7684\u670b\u53cb\u505a\u996d\u505a\u4e0d \u2026<\/p>","content":"<p><img alt=\"\" src=\"images\/notion-handbook.webp\"><\/p>\n<p>Learning Chinese from textbooks and school courses can be a weird experience\nwhen you try to apply it in the real world. Sure, you just learned the grammar\nto say \"My friend cooks poorly\" w\u01d2 de p\u00e9ngy\u01d2u zu\u00f2 f\u00e0n zu\u00f2 b\u00f9\nh\u01ceo; \u6211\u7684\u670b\u53cb\u505a\u996d\u505a\u4e0d\u597d, but how useful is that in real life? What you really\nneed to talk about is what you like to do on the weekend, what kind of food you\nlike, and so on. But a textbook or academic course can't cover all those\npossibilities - maybe you like to play squash on weekends, maybe you like to get\ndrunk and sing KTV, maybe you like to go to the internet cafe for an all-night\nLeague of Legends tournament. The point is, you're going to need a lot more\nwords than your class about ordering beef noodles covered.<\/p>\n<p>In language teaching we call vocabulary that students need to know, but that\naren't really part of the course, <em>emergent lexis<\/em>. In Taiwan, there's quite a\nlot of picture handbooks around with Pinyin and Chinese (Hanzi) next to common\nthings you see in Taiwan. But as cool as these books are, they're kind of a pain\nto carry around with you and it can take a while to find the words you need.<\/p>\n<p>What if we had a handbook that we could search like a dictionary, add our own\nnotes or pictures to, and adapt for our own uses?<\/p>\n<p>The good news is, it's not too hard to get <a href=\"https:\/\/notion.so\">Notion<\/a> to act\nlike this, and to set it up for ease of use on the go. In this article, I'll\nwalk you through how to set up Notion to act as your Chinese handbook. At the\nend, I'll also tell you a bit about how I use Notion with my tutor and some\nsoftware I use to make the process easier for both of us.<\/p>\n<h2>Step 1: What is Notion?<\/h2>\n<p><em>If you already have a Notion account, feel free to scroll down to Step 2.<\/em><\/p>\n<p><a href=\"https:\/\/www.notion.so\/\">Notion<\/a> is a great tool for organising information and\nconnecting it in useful ways. On the surface, it's pretty similar to note-taking\napps like <a href=\"https:\/\/evernote.com\/\">Evernote<\/a> or\n<a href=\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/onenote\/digital-note-taking-app\">Microsoft Onenote<\/a>.\nIf you've used those or any note-taking app like them you'll be familiar with\nhow the Notion app is organised. But Notion has one killer feature which makes\nit really useful for our purposes as tech-savvy language learners: <em>it has\neasy-to-use databases.<\/em><\/p>\n<p>Databases are scary for a lot of people - the word conjures up images of\nGoogle's servers spinning through millions of user records a second - but really\na database is just any piece of software that lets you easily create and access\ndata records. For most people, the most familiar database app is a spreadsheet\nlike Google Sheets or Microsoft Excel. Don't get me wrong, those are great apps\nfor handling numbers - I use spreadsheets to do my finances and track my\nfitness.<\/p>\n<p>But spreadsheets aren't the best for language learners, for a few reasons:<\/p>\n<ul>\n<li>They make it hard to reference words in a useful way for language learners:\n  it's hard to have a subsection for food, for hobbies, and so on.<\/li>\n<li>Their search and filter options are hard to use, and more complicated searches\n  need you to write out formulas.<\/li>\n<li>They don't support tags (the easiest way to filter words) unless you hack\n  together your own method of using them.<\/li>\n<\/ul>\n<p>This is where Notion comes in. Notion gives you an easy-to-use way to add and\norganise your language information in a way that makes it easy to search and\nreview. There's a ton of other powerful features that you can exploit in Notion,\nbut those aren't really what we're interested here.<\/p>\n<p>Head over to <a href=\"https:\/\/notion.so\">notion.so<\/a> to create an account, and play\naround a little.<\/p>\n<h2>Step 2: Setup Your Main Pages<\/h2>\n<p>First, create a main page called \"Chinese\". This will hold all your sub-pages\nand subtopics.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/chinese-main-page.png\"><img alt=\"\" src=\"images\/chinese-main-page.png\"><\/a><\/p>\n<p>Type \/table and select Table - Full Page from the drop-down menu. This will be\nour main database for Chinese vocabulary.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/make-table.png\"><img alt=\"\" src=\"images\/make-table.png\"><\/a><\/p>\n<p>This'll take you to a new, empty database page. Give it a title: I've called\nmine \"All Words\".<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/empty-database.png\"><img alt=\"\" src=\"images\/empty-database-1024x272.png\"><\/a><\/p>\n<p>Next, set up your table with the following fields by experimenting with the +\nbutton on the right-hand side of your table.<\/p>\n<ul>\n<li><strong>Title Field: Hanzi.<\/strong> This is the field to enter Chinese characters into.\n  It's best to use this as your title field because you're unlikely to repeat\n  the same characters, whereas Pinyin can be ambiguous.<\/li>\n<li><strong>Text: English.<\/strong> Holds the English translation of the Chinese.<\/li>\n<li><strong>Text: Pinyin<\/strong>.<\/li>\n<li><strong>Text: Zhuyin.<\/strong> Also known as Bopomofo. Optional if you're not studying in\n  Taiwan.\n  <a href=\"https:\/\/fd93.me\/2021\/05\/29\/3-reasons-you-should-learn-zhuyin-for-better-chinese\/\" title=\"3 Reasons You Should Learn Zhuyin for Better Chinese\">Here's why it's worth learning.<\/a><\/li>\n<li><strong>Text: Examples &amp; Usage.<\/strong> Make sure you set this up - it's invaluable for\n  when you put grammar into the table.<\/li>\n<li><strong>Multi-select: Tags.<\/strong> This is in the database by default.<\/li>\n<li><strong>Multi-select: Subtags.<\/strong> This will be useful later on, when we set up pages\n  for different topics or areas.<\/li>\n<\/ul>\n<p>After you've set up your table it should look like this:<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/full-table.png\"><img alt=\"\" src=\"images\/full-table-1024x257.png\"><\/a><\/p>\n<p>Feel free to add in your favorite words or vocabulary you've recently learned.\nIt should look like this:<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/all-words-filled.png\"><img alt=\"\" src=\"images\/all-words-filled-1024x563.png\"><\/a><\/p>\n<h2>Step 3: Set Up A Card View For Mobile Devices<\/h2>\n<p>If the most useful feature of Notion is its easy-to-use databases, the second\nmost useful is that you can use it on multiple devices. That means you can carry\nNotion around on your phone or review on your iPad. However, the default table\nview isn't ideal for quickly checking vocab with, especially with all that\ninformation.<\/p>\n<p>To get around this, go back to your main Chinese page and create a new subpage\ncalled Mobile Search.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/mobile-search-check.png\"><img alt=\"\" src=\"images\/mobile-search-check.png\"><\/a><\/p>\n<p>On the new page, type \/link and choose \"Create Linked Database\". Then select\n\"All Words\".<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/linked-database.png\"><img alt=\"\" src=\"images\/linked-database.png\"><\/a><\/p>\n<p>Congratulations, you've just set up your first linked database! We'll exploit\nthis feature of Notion heavily when we set up our sub-pages, but for now we're\njust using it to simplify the main table for use on mobile devices.<\/p>\n<p>Your new linked database should look the same as \"All Words\" did:<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/mobile-search-table.png\"><img alt=\"\" src=\"images\/mobile-search-table-1024x596.png\"><\/a><\/p>\n<p>Hover over the top of the table and select \"Add a View\". Select \"Gallery\" and\nclick the Create button.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/add-gallery-view.png\"><img alt=\"\" src=\"images\/add-gallery-view-1024x654.png\"><\/a><\/p>\n<p>Check out our new card view! It's pretty minimal at the moment, and not too\nhelpful.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/card-view-bare.png\"><img alt=\"\" src=\"images\/card-view-bare.png\"><\/a><\/p>\n<p>At the moment we can only see the title field of our table, which happens to be\nHanzi. Let's change that. Go to the ... menu and select \"Properties\".<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/properties-select.png\"><img alt=\"\" src=\"images\/properties-select-1024x385.png\"><\/a><\/p>\n<p>This will let us change the properties we show on our cards. Turn on Hanzi,\nPinyin, English, and Tags. You can also turn on Examples and Usage if you like.\nAlso, set \"Card Preview\" to \"None\". This will stop the cards from trying to show\nimages, which takes up extra space. The card size is up to you: I've set mine to\n\"Small\".<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/properties-cards.png\"><img alt=\"\" src=\"images\/properties-cards.png\"><\/a><\/p>\n<p>Now our cards look a lot better for mobile and small screens. In fact, on\nmobile, we get a large search bar.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/S__9756717.jpg\"><img alt=\"\" src=\"images\/S__9756717-603x1024.jpg\"><\/a><\/p>\n<p>I like Taiwanese corn omelettes, but I can never remember the correct word for\nthem in Taiwan. Let me check that real quickly...<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/S__9756718.jpg\"><img alt=\"\" src=\"images\/S__9756718-596x1024.jpg\"><\/a><\/p>\n<p>Oh, right, it's \u7389\u7c73 \u714e\u86cb (y\u00f9m\u01d0 ji\u0101nd\u00e0n)!<\/p>\n<p>Now you know how to set up your basic word list to check when you're on the\nmove, let's try setting up some pages for reviewing different topics.<\/p>\n<h2>Step 4: Create Pages for Different Topics<\/h2>\n<p>Our basic setup above is great for quickly checking up on words we need to know\nwhen we're on the move - I use it during my tutoring sessions and when I'm\nordering from shops in Taiwan. But it's not so great for use in a focused study\nroutine. For that, we need to lay out our information more like a page in a\ntextbook.<\/p>\n<p>In order to make our new page and keep it updating as we add new words to our\nhandbook, we're going to take advantage of the filter options in Notion's\ndatabases.<\/p>\n<p>First, make a new subpage. Call it whatever you like (mine's called Sports \/\nHobbies) and add a linked database like above.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/sports-hobbies.png\"><img alt=\"\" src=\"images\/sports-hobbies-1024x584.png\"><\/a><\/p>\n<p>Go to the ... menu and choose \"Filter\". You'll get a box that looks like this:<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/filter-menu.png\"><img alt=\"\" src=\"images\/filter-menu.png\"><\/a><\/p>\n<p>Select \"Add a filter\". By default, the menu will make a filter on our Title\nproperty - Hanzi.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/filter-menu-2.png\"><img alt=\"\" src=\"images\/filter-menu-2.png\"><\/a><\/p>\n<p>Since this page is all about sports and hobbies, we're only going to include\nentries where Tags contains \"hobbies\".<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/hobbies-filtered.png\"><img alt=\"\" src=\"images\/hobbies-filtered-1024x558.png\"><\/a><\/p>\n<p>This is good enough for a simple page, but if we want to study in a more\nin-depth way, we probably want to separate out sports vocabulary from other\nkinds of hobbies, like video games. This is where the subtags column is useful.<\/p>\n<p>Add another filter on the \"Subtags\" column. Mine are named with the format\nMAINTAG-SUBTAG. In this case it's hobbies-sports. You can also add a nice title\nto this section of your page.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/subtag-filter.png\"><img alt=\"\" src=\"images\/subtag-filter.png\"><\/a><\/p>\n<p>That should give you a table that <em>only<\/em> contains sports.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/filtered-with-subtags.png\"><img alt=\"\" src=\"images\/filtered-with-subtags-1024x500.png\"><\/a><\/p>\n<p>You can keep adding sections to your page until you're happy with how it looks.\nOne useful thing we can do to stop our pages geting too long is to add toggle\nlists to hold your tables. To do this, type \/toggle and drag your table into the\nnew toggle list.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/sports-toggle-list.png\"><img alt=\"\" src=\"images\/sports-toggle-list.png\"><\/a><\/p>\n<p>Here's the finished product. You can add more and more sections to surround your\nvocabulary. For example, here's my time and date page, where I put a reference\nfor how to say the full date in Pinyin above my vocabulary.<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/time-date-page.png\"><img alt=\"\" src=\"images\/time-date-page-1024x658.png\"><\/a><\/p>\n<h2>Using Notion in a Study Routine<\/h2>\n<p>I'm fortunate enough to have a private tutor for Chinese, and using a shared\nNotion workbook is really helpful for both of us. It's a lot smoother for my\ntutor to update Hanzi characters than for me to try and figure out the correct\none for a given word or spend hours on Google translate. It's also a lot quicker\nto search a Notion database while we're talking than it is to reference a\nphysical notebook. The Notion workbook's personalised to me, so I know it only\ncovers content that we've covered in class. Even better than that, because the\ncontent's coming from my tutor, I know that the language is appropriate and\nlocalised for Taiwan.<\/p>\n<p>On the other hand, in a typical one-hour class there's not a lot of time to type\nthings into the database, and typing out Pinyin or Bopomofo can be a real\nhassle, even for native speakers. Most Chinese keyboards focus on turning\nphonics into characters, not the other way round.<\/p>\n<p>To solve this problem and avoid my poor tutor slaving away on phonetic\ntranscriptions for hours after each session, I wrote a basic python program to\nconvert Hanzi characters into Pinyin and Zhuyin and insert them back into the\ndatabase.<\/p>\n<p>Here's a quick screencap of the program in action:<\/p>\n<p><a href=\"https:\/\/fd93.me\/wp-content\/uploads\/2021\/06\/automap-dragonmap.png\"><img alt=\"\" src=\"images\/automap-dragonmap.png\"><\/a><\/p>\n<p>What it's doing is taking the Hanzi for the English phrases above and\ntranscribing them into Pinyin and Zhuyin, so I can put them back into my \"All\nWords\" database. This is a huge time-saver for me and my tutor. I also use it\nfor copying my vocabulary into\n<a href=\"https:\/\/fd93.me\/2021\/05\/26\/how-to-study-chinese-characters-with-anki\/\" title=\"How to Study Chinese Characters With Anki\">Anki so that I can study our key words using that app<\/a>.\nI'll soon be releasing this software, either as a public github, as a web app\nyou can use for free, or both. For updates on the software's progress, consider\n<a href=\"https:\/\/fd93.me\/get-the-newsletter\/\" title=\"Get the Newsletter\">signing up for my newsletter<\/a>.<\/p>\n<p>My routine for updating Notion with my software is:<\/p>\n<ol>\n<li>Take a class with my tutor, discover a bunch of new words and grammar I don't\n   know<\/li>\n<li>My tutor updates the Notion database with the new words sometime after our\n   class<\/li>\n<li>I process the new words using my software and re-import them to Notion<\/li>\n<li>Next time, we review the new words I updated with Notion<\/li>\n<\/ol>\n<p>I hope using Notion can help your study routine as much as it's helped mine.\nLet's improve in Chinese together!<\/p>\n<h2>Get the Template<\/h2>\n<p><a href=\"https:\/\/www.notion.so\/Chinese-2978873545bc4165bfae3209857c1580\">You can find the template I made in this article here.<\/a>\nI hope it helps you set up your Chinese handbook quickly and efficiently.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"chinese"}},{"@attributes":{"term":"notion"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"software"}}]},{"title":"3 Reasons You Should Learn Zhuyin for Better Chinese","link":{"@attributes":{"href":"https:\/\/fd93.me\/3-reasons-you-should-learn-zhuyin-for-better-chinese.html","rel":"alternate"}},"published":"2021-05-29T00:00:00+08:00","updated":"2021-05-29T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2021-05-29:\/3-reasons-you-should-learn-zhuyin-for-better-chinese.html","summary":"<p><img alt=\"\" class=\"article-head\" src=\"images\/zhuyin-chart.webp\"><\/p>\n<p>Zhuyin (or Bopomofo) is the main phonetic writing system in Taiwan. But a lot of\nlanguage schools in both Taiwan and the West don't teach it. This is because\nZhuyin is harder to learn for English speakers, and only used in Taiwan. Rather\nthan being a reading and writing system \u2026<\/p>","content":"<p><img alt=\"\" class=\"article-head\" src=\"images\/zhuyin-chart.webp\"><\/p>\n<p>Zhuyin (or Bopomofo) is the main phonetic writing system in Taiwan. But a lot of\nlanguage schools in both Taiwan and the West don't teach it. This is because\nZhuyin is harder to learn for English speakers, and only used in Taiwan. Rather\nthan being a reading and writing system for Chinese, Zhuyin is more similar to a\nphonetic alphabet: it transcribes the sounds of individual words really\naccurately, but is too verbose for daily reading and writing. So why should you\nbother to learn Zhuyin? Well, here are three reasons why Zhuyin is a great tool\nto add to your Chinese toolkit.<\/p>\n<h3>Reason 1: It Makes Your Pronunciation Better<\/h3>\n<p>In language teaching, there's a concept called linguistic interference. This is\nthe way that quirks of your native language and other languages you're fluent in\n<strong>interfere<\/strong> <strong>with learning a new language.<\/strong> Pinyin is great for reading\nlonger texts where you don't know characters, but because Pinyin looks a lot\nlike English writing, you can become complacent if you're not focused on how to\npronounce a new word. Bopomofo makes you use the correct Chinese pronunciation\nof a word, and it makes the differences between sounds clearer. Also, Taiwanese\nMandarin has quite a few differences from Chinese Mandarin in pronunciation, and\nmost Pinyin sources focus on Chinese Mandarin. On the other hand, Zhuyin is\n<em>only<\/em> used in Taiwan, so you know Zhuyin sources will always be accurate for\nTaiwanese Mandarin.<\/p>\n<p>Here's one very simple example: \u597d\u5403 (delicious \/ tasty). In Pinyin you write\n<em>h\u00e0o ch\u012b<\/em>. Look at the end of <em>ch\u012b<\/em>. Your English-speaking brain might tell you\nthat this sounds like \u4e00 <em>y\u012b<\/em> (one). They're totally different sounds - but\nthey're transcribed identically in Pinyin. This is one reason why English\nspeakers who only learn Pinyin can be hard to understand for Chinese speakers:\nas well as the challenges of learning a tonal language, they mix up sounds that\nare distinct for Chinese speakers.<\/p>\n<p>In Zhuyin, we transcribe \u597d\u5403 as \u310f\u3120\u02c7 \u3114 and \u4e00 as... \u4e00. \u3114 sounds like \"che\",\na little sneeze, while \u4e00 sounds like \"ee\" as in bee. Zhuyin makes this really\neasy to understand and practice when you're reviewing flashcards, while in\nPinyin there are a lot of quirks which can easily trip up your pronunciation.\nTry learning Zhuyin for when you're practicing vocabulary words\n(<a href=\"https:\/\/fd93.me\/2021\/05\/26\/how-to-study-chinese-characters-with-anki\/\" title=\"How to Study Chinese Characters With Anki\">try using Anki!<\/a>)\nand using Pinyin for longer dialogues. With that said...<\/p>\n<h3>Reason 2: It's Not A Crutch<\/h3>\n<p>Pinyin's greatest strength is also its greatest weakness: it's easy to read and\nwrite long sentences and dialogues in Pinyin. As\n<a href=\"https:\/\/mandarincompanion.com\/blog\/pinyin-over-characters-the-crippling-crutch\/\">this article from Mandarin Companion<\/a>\nsays, this can easily become a crutch for language learners. When characters are\nnext to Pinyin, your eye will naturally wander to the Pinyin transcription,\nbecause it's more similar to English. This stops you from focusing on what you\nactually want to learn -- the characters -- and makes it very easy to get\ncomplacent.<\/p>\n<p><img alt=\"\" src=\"images\/pinyin-hanzi-meme.jpg\"><\/p>\n<p>Learning Zhuyin stops this from happening...<\/p>\n<p>However, even if you learn Zhuyin and use it a lot, it's almost impossible to\nuse it as a crutch in the same way as Pinyin. Because Zhuyin uses a different\nset of characters to English and because it's more verbose than Pinyin, your\nbrain won't immediately decode it on sight. Often, Zhuyin is also written in\ntiny 'rubies' beside characters, making it even harder to read by accident. This\nlets you be a lot more <em>intentional<\/em> in your use of Zhuyin. If you don't know a\ncharacter, you can read the Zhuyin and see if you know the spoken word: if you\nknow the character, you can easily ignore the Zhuyin. This is a lot harder to do\nwith Pinyin.<\/p>\n<p>Just like a workout, the more challenging you make your reading practice within\nyour abilities, the faster you'll improve. Don't push yourself too hard, but\nalso don't make things too easy on yourself. Having Pinyin next to characters\ncan easily become a crutch unless you also transcribe a copy of a text <em>without<\/em>\nPinyin. But who has time for that?<\/p>\n<h3>Reason 3: You Can Read Kids' Books<\/h3>\n<p>It's pretty common knowledge that the best way to learn a new language is\n<strong>immersion learning<\/strong>. That means using the language you're trying to learn as\nmuch as possible, reading books in the language, watching media in the target\nlanguage, and so on. This can be really hard for people learning Chinese,\nbecause written Chinese has little relationship to spoken Mandarin and watching\nChinese media with English subtitles can be pretty challenging, given the\ndramatic grammar differences between the two languages.<\/p>\n<p>In Taiwan, kids in kindergarten and elementary school learn to read Chinese\ncharacters by using Bopomofo transcriptions next to the characters. What this\nmeans is that <strong>if you learn Zhuyin you can use the same resources as Taiwanese\nstudents.<\/strong> One of my favourite language resources to use with my classes and\nfor myself is a book called <em>Baby's First Study Guide<\/em>, which has a range of\ncommon words like \"penguin\", \"hamburger\", and \"train\" written in English,\nChinese, and Bopomofo with big, bold colors. I'm pretty sure it's designed for\nTaiwanese elementary school students to learn basic words in English, but it's\nreally helpful for when I realise I don't know what a dolphin or a temple is\ncalled. When you know some basic characters, you can start to read basic\nchildren's books. Peppa Pig (\u4f69\u4f69\u732a) is reliable for learning <em>any<\/em> language,\nand other children's book series use basic characters with Zhuyin to help kids\nlearn to read.<\/p>\n<p><img alt=\"\" src=\"images\/baby-first-study-1024x1004.jpg\"><\/p>\n<p>One of my favourite reference books: \"Baby's First Study Book\". Check out the\nZhuyin rubies next to the characters.<\/p>\n<p>Of course, not every children's book is good to learn characters: some have\ncomplex grammar or unusual words that aren't likely to show up in a Chinese\nlanguage curriculum, and some cover topics that just aren't that relevant to\nadult language learners, like going to the circus. One great way to get around\nthis is to use graded readers\n<a href=\"https:\/\/mandarincompanion.com\/\">like those from Mandarin Companion<\/a>. But\nthere's not a ton of these available, and while Mandarin Companion's works are\naffordable and available on Kindle, other graded reader sets are more expensive\nand harder to get.<\/p>\n<p>With a bit of shopping around in Taiwan, you can find kids' books that are\nsuitable for foreign language learners as well. It's really fun to browse the\nkids' section of bookstores and see what books appeal to you, as well as which\nones are cute or interesting. In the end, our goal is to get a small collection\nof fun kids' books that can help us learn Chinese.<\/p>\n<h3>In the End, Just Challenge Yourself<\/h3>\n<p>What's really important isn't whether you choose to learn Zhuyin or not. If\nPinyin by itself works fine for you, then that's fine. What's most important is\nnot falling into a few traps:<\/p>\n<ul>\n<li>Reading Pinyin the way you'd read English (or whatever your first language\n  is).<\/li>\n<li>Learning the Pinyin for a word before you hear the word.<\/li>\n<li>Relying on Pinyin to read longer texts.<\/li>\n<li>Ignoring characters altogether and only reading Pinyin.<\/li>\n<\/ul>\n<p>While learning and using Zhuyin makes these common mistakes almost impossible,\nyou can get the same results from discipline and focus. But who has unlimited\namounts of those? We use technology like Anki to make studying easier so we\ndon't have to work as hard by ourselves. Learning Zhuyin, especially if you live\nin Taiwan, can make studying easier too -- so give it a try. You might be\nsurprised by the results.<\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"chinese"}}]},{"title":"How to Study Chinese Characters With Anki","link":{"@attributes":{"href":"https:\/\/fd93.me\/how-to-study-chinese-characters-with-anki.html","rel":"alternate"}},"published":"2021-05-26T00:00:00+08:00","updated":"2021-05-26T00:00:00+08:00","author":{"name":"Frank Davies"},"id":"tag:fd93.me,2021-05-26:\/how-to-study-chinese-characters-with-anki.html","summary":"<p><img alt=\"\" class=\"article-head\" src=\"\/images\/study-chinese.webp\"><\/p>\n<h3>Or: 8 Tips To Not Burn Out<\/h3>\n<p>If you're not familiar with it, <a href=\"https:\/\/apps.ankiweb.net\/\">Anki<\/a> is a flashcard\napp which can help you memorise any kind of information. It's a great tool for\nsituations where you need to focus on remembering details, facts, or pieces of\ninformation. A lot of language \u2026<\/p>","content":"<p><img alt=\"\" class=\"article-head\" src=\"\/images\/study-chinese.webp\"><\/p>\n<h3>Or: 8 Tips To Not Burn Out<\/h3>\n<p>If you're not familiar with it, <a href=\"https:\/\/apps.ankiweb.net\/\">Anki<\/a> is a flashcard\napp which can help you memorise any kind of information. It's a great tool for\nsituations where you need to focus on remembering details, facts, or pieces of\ninformation. A lot of language learners swear by it. You can embed images and\nvoice clips right into the flashcards themselves and make special decks for\nreviewing information in your own way.<\/p>\n<p>I started using Anki not long after I moved to Taiwan, but it took a while to\nreally click with me. In fact, I quit using Anki after a month because it was\ngiving me too much stress. I was plugging away at Traditional Chinese characters\n(Hanzi) in most of my free time and it never stuck with me. I started studying\nmore and more, on the bus on the way to work and in my lunch break, but still\nnothing stuck. One night, after trying to review 100 flashcards for over an\nhour, I tossed my phone down on the bed and swore never to use Anki again.<\/p>\n<p>I realised after giving Anki another try that the problem was the way I was\nusing Anki, not the app itself. Here's a secret a lot of Anki enthusiasts won't\ntell you: <strong>Anki works best as part of a balanced study routine.<\/strong> So here are\nsome tips for using Anki to study Chinese characters and avoid repeating my\nmistakes:<\/p>\n<h3>Tip 1: Pace Yourself<\/h3>\n<p>By default, Anki has you study 20 new flashcards a day. I figured that was fine\nbased on my experience learning French. I was wrong. 20 traditional characters a\nday means spending a significant amount of time each day studying characters,\nlet alone speaking. Unless you're lucky enough to be a full-time Chinese\nstudent, this probably isn't a great way to spend your time. Instead, try to\ntake it easy. I study with the\n<a href=\"https:\/\/www.amazon.com\/Course-Contemporary-Chinese-Textbook\/dp\/9570845694\/\">NTNU Course in Contemporary Chinese<\/a>,\nwhich has about 50 words per lesson, and try to learn around 12 characters every\ncouple of days, reviewing old characters every time I practice. Learning a\nlanguage is a marathon, not a sprint. Even if you only learn 5 characters a day,\nin a year you'll have learned 1500 - more than enough to read Chinese texts.<\/p>\n<h3>Tip 2: Practice Writing, Not Just Reading<\/h3>\n<p>The main thing that helps me remember the characters I'm studying is <em>writing\nthem<\/em>. By writing them, I mean writing them <em>a lot<\/em>. If you only see the\ncharacters you're trying to memorise, then you don't remember the differences.\nFor example, look at \u59d3 (xing) and \u59d0 (jie). They share the radical 'woman', but\ntheir right-hand sides are totally different. But if you're studying a set of\ncharacters that doesn't look like \u59d3 or \u59d0, it's easy to get lazy and only look\nat the left side of the character. <strong>Writing the character forces you to learn\nthe whole character, not just what makes it different from characters around\nit.<\/strong><\/p>\n<p><img alt=\"\" src=\"images\/S__8929324-1024x768.jpg\"><\/p>\n<p>Say hello to your new best friend.<\/p>\n<p>Your best friend when learning to write Chinese characters is a small\nwhiteboard. This stops you wasting notepads and paper. If you're in Taiwan (or a\nfew US cities), you can pick up fine whiteboard markers and small whiteboards at\n<a href=\"https:\/\/www.daisojapan.com\/\">Daiso<\/a>, which is cheap and in most malls. If\nyou're not, you might need to shop around but\n<a href=\"https:\/\/www.amazon.com\/Magnetic-Whiteboard-Portable-Double-Sided-Students\/dp\/B08PTQRWSV\/ref=sxin_6_pa_sp_search_thematic_sspa?cv_ct_cx=whiteboard+small&amp;dchild=1&amp;keywords=whiteboard+smal&amp;pd_rd_i=B08PTQRWSV&amp;pd_rd_r=c2dcef71-9710-4805-be2c-f5be5e766d70&amp;pd_rd_w=JeZER&amp;pd_rd_wg=LQztI&amp;pf_rd_p=314a237a-d34f-47d8-b665-e40f44696eb7&amp;pf_rd_r=8YKK84Z7ZBCRDZPBNTTF&amp;qid=1621940055&amp;sr=1-1-8ccddd62-8c44-4608-a43c-b7e11931f7b8-spons&amp;psc=1&amp;spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFSV0hBQzhGSEU5RE0mZW5jcnlwdGVkSWQ9QTA4MzA2NTIzQ0xINE5SS1JQUEUyJmVuY3J5cHRlZEFkSWQ9QTAzNDcyMjYxTEwwSkVJOTcySE5aJndpZGdldE5hbWU9c3Bfc2VhcmNoX3RoZW1hdGljJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==\">Amazon carries a lot of options<\/a>.<\/p>\n<h3>Tip 3: Focus Your Study<\/h3>\n<p>For the same reason that studying a ton of new flashcards every day is a bad\nidea, piling more and more characters on your vocabulary each day is just going\nto burn you out, especially if you're studying part-time. But this is Anki's\ndefault option. The solution? Make heavy use of\n<a href=\"https:\/\/docs.ankiweb.net\/filtered-decks.html\">filter decks<\/a>. I use filtered\nstudy to break each chapter of my textbook into 2 dialogues with 2 parts each:\nabout 12 characters for each study period of 4-6 hours. I write the characters\nin each part of the dialogue, then review all the characters from the dialogue\nafter I've studied them once. I keep reviewing this small set of characters\nuntil I can write them all perfectly.<\/p>\n<p>Focused study is the way forward for almost every skill we want to improve, but\nChinese writing is almost purely about memorisation which makes study extra\nimportant. There are tricks to make it easier, and the more radicals you're\naware of the easier it is to remember characters (I'll always think of \u5ba2 as\n\"hungry hat man\"). But while you can use memory tricks and mnemonics to make\nstudying easier, you're still just memorising characters. Get studying!<\/p>\n<h3>Tip 4: Add Voices<\/h3>\n<p>Anki lets you add voice clips. Take advantage of this!<\/p>\n<p>There's a great addon called\n<a href=\"https:\/\/ankiweb.net\/shared\/info\/1436550454\">AwesomeTTS<\/a> which can generate\nspeech from flashcards for your whole collection. Even if you have hundreds of\ncards, AwesomeTTS can generate voice clips for all of them. I attach male and\nfemale Taiwanese voices to my cards using the Google Cloud Text-To-Speech add\non, but AwesomeTTS includes a wide selection of different voice synthesis\nproviders.<\/p>\n<p>Adding voices to your cards is helpful because you're learning the correct\npronunciation (including tones) every time you practice writing the word. This\nhelps your brain associate the Chinese character to speech more quickly and has\nthe bonus of improving your pronunciation.<\/p>\n<h3>Tip 5: Set Up Your Cards Wisely<\/h3>\n<p>The way I set up my Anki cards is to have the Zhuyin \/ Bopomofo on the front and\nthe Hanzi character and Pinyin on the back. This does a few things:<\/p>\n<ol>\n<li><strong>It forces me to read the Zhuyin<\/strong>. This helps me remember how to read\n   Zhuyin characters, which is really important for accessing Taiwanese language\n   resources.<\/li>\n<li><strong>It associates the character with the Chinese pronunciation<\/strong>, not the\n   English. This is really important for helping my language fluency.<\/li>\n<li><strong>It gives me time to write the character.<\/strong><\/li>\n<\/ol>\n<p>Although formatting cards like this makes them more challenging to start with,\nwhen it comes time to review them you'll be glad you pushed yourself!<\/p>\n<h3>Tip 6: Be Tough On Yourself<\/h3>\n<p><img alt=\"\" src=\"images\/radical-130-1.png\"><\/p>\n<p>Radical 130, \"meat\"<\/p>\n<p><img alt=\"\" src=\"images\/radical-74-1-3.png\"><\/p>\n<p>Radical 74, \"moon\"<\/p>\n<p>I don't mean beating yourself up over your mistakes or forcing yourself to learn\n100 characters a day (see tip 1). But <strong>don't let yourself get complacent.<\/strong> The\ndifferences between Chinese characters, especially in traditional Chinese, can\nbe pretty small, and if you don't pay attention to them then you won't write\nthings correctly.<\/p>\n<p>For example, look at these characters. The first is radical 130, \"meat\". The\nsecond is radical 74, \"moon\". You can tell they're different characters because\nthey're big and by themselves. Now look at \u9f8d (<em>long<\/em>) and \u8acb (<em>qing<\/em>). Can you\ntell the difference? Not unless you were really paying attention. But writing\n\"meat\" when you mean \"moon\" is a bad habit that'll stick with you unless you're\ncareful.<\/p>\n<p>On the other hand, getting into the habit of writing characters neatly will\nreally help when you're writing more complex characters with several radicals.\nJust like with how you set up your cards, you might find it tough at first, but\nyou'll thank yourself later.<\/p>\n<h3>Tip 7: Don't Just Use Anki<\/h3>\n<p>Anki is a fantastic tool for learning characters, but it's best used with other\nstudy techniques. Trying to learn to write a character for the first time with\nAnki can't teach you stroke order and aiming for perfection the first few times\nyou write a character is just going to make you feel bad about yourself.<\/p>\n<p>Instead make your Anki study part of a balanced routine including transcribing\nand reading Chinese texts, practicing character stroke order, and matching\nZhuyin pronunciation with Hanzi characters. This helps keep a healthy variety in\nyour studies and lets you improve your reading and writing skills in a more\nrounded way than grinding out characters.<\/p>\n<p><img alt=\"\" src=\"images\/S__8929322-1024x771.jpg\"><\/p>\n<p>Here are some of the dialogues I've copied. Copying texts is useful because it\nlets you practice reading and writing at the same time.<\/p>\n<h3>Tip 8: Be Lazy<\/h3>\n<p>This doesn't mean be lazy when you're studying, but <strong>don't waste time making\ncards.<\/strong> Typing Pinyin into new cards in particular is a huge waste of valuable\nstudy time. While there's a school of thought that argues making your own\nflashcards helps you learn, for Chinese characters you get most benefit out of\nhandwriting practice, not typing characters on a keyboard. The exception to this\nmight be if you're learning to type with a Zhuyin keyboard.<\/p>\n<p>My workflow means I rarely type in my flashcards by hand, but even if you do,\nthere are excellent add-ons like\n<a href=\"https:\/\/ankiweb.net\/shared\/info\/1128979221\">Chinese Support Redux<\/a> which can\nautomatically fill out Pinyin and Zhuyin fields for you. Don't spend any more\ntime than you absolutely have to on data entry.<\/p>\n<h3>Good Luck!<\/h3>\n<p>I hope some of these tips can help or inspire you to improve your study routine\nin Anki. <strong>Best of luck in your studies!<\/strong><\/p>","category":[{"@attributes":{"term":"general"}},{"@attributes":{"term":"anki"}},{"@attributes":{"term":"chinese"}},{"@attributes":{"term":"productivity"}},{"@attributes":{"term":"software"}},{"@attributes":{"term":"study"}}]}]}