Simple exercises with grep, sed and awk in org-mode

For text processing, I had never bothered to learn classic Unix tools such as sed and awk, because I can always use Python's regular expression library. The syntax of sed and awk just appeared to be too arcane to me. However, recently I realize that for many simple ad-hoc tasks, even writing a Python script is too much overhead. This motivated me to learn to use regular expressions directly in the command line.
Read more

Use basic data science skills to debunk a myth about koalas!

Did you know that the koala is the dumbest animal in the world? According to an Internet meme, koalas have really tiny brains because the eucalyptus leaves that they eat are toxic and poor in nutrition. That seems plausible to me, but you shouldn’t believe in Internet memes. Let’s turn to the most authoritative source of knowledge in the world, the Wikipedia, instead. This is what the Wikipedia has to say about koala’s brain:
Read more

Writing the Emacs configuration script in org-mode: a simple example of literate programming

Program like writers do Programming is traditionally seen as an exercise that translates human thoughts into a format that computers can understand. As a result, the ideas behind the program can become obscured and fragmented in the source code. This is why reading code requires so much mental effort. For me, reading code often feels like solving a puzzle, or reading modernist/postmodernist novels where events are narrated out of sequence. The concept of literate programming was introduced by Donald Knuth in the 80’s to address this issue.
Read more

How this website was built - a tutorial

I started this website in 2018, because I wanted to collect all my content in one single place. I decided to built it with simple tools, so I could understand how everything works, and fix problems if needed. It’s a hobby like how some people like to build their own kitchens. Lots of tutorials are available on building personal websites, but I still want to write my own, because when I got started, I could never find one that explained every step needed to build a complete website.
Read more

How I run emacs in client/server mode under macOS

Many articles are available about running Emacs in client/server mode. However, when I tried to do it in my particular environment (macOS 11.0.1 Big Sur, using zsh), some tweaks were still needed. So I figured that it’s probably useful to document my setup. In macOS, the Emacs executable is /Applications/Emacs.app/Contents/MacOS/Emacs. To run Emacs in its regular (non-server) operation mode, I defined two shell commands in .zshrc: emacs runs Emacs in GUI mode in a macOS window, whereas emacsnw runs Emacs in text mode within the terminal.
Read more