Swift as a viable Python alternative?

Recently Swift for Tensorflow has picked up some steam, so I wanted to explore the Swift programming language a bit. The main advantage over Python for Swift is that Swift is very fast by directly using the LLVM compiler infrastructure. Python itself relies a lot on C to make code run fast, but if you write Python code you can get very slow code if it’s not optimized. However, the main disadvantage for Swift is that it’s ecosystem when it comes to machine learning and data processing libraries is currently a lot less powerful than Python’s ecosystem.
Read more →

Bash: Keep Script Running - Restart on Crash

When you are prototyping and developing small scripts that you keep running, it might be annoying that they quit when an error occurs. If you want very basic robustness against these crashes, you can at least use a bash script to automatically restart your script on error. The tool to use here is called until and makes this a breeze. Let’s use a dumb example Python script called test.py: import time while True: print('Looping') time.
Read more →

Writing command-line tools in Python: argument parsing

Python is a great language to build command-line tools in as it’s very expressive and concise. You want to have the ability to parse arguments in your scripts as you don’t want to hard-code the relevant variable values to make the tool useful. So how do we go about this in Python? It’s easily done using the argparse module. With argparse, you define the different arguments which you expect, their default values and their shortcuts to call them.
Read more →

How To Unfreeze Vim

Sometimes it happens that Vim freezes / gets stuck / doesn’t react and you might wonder what is going on. Recently, I figured out that this happens for me when I accidentally pressed Ctrl + S. It turns out that this is an old legacy features back from the slow days of computing where ressources were really scarce and you sometimes wanted to freeze the output of one program to help with your ressources.
Read more →

Build Your Own Javascript Game in 5 Minutes

Hello Phaser.io (version 3) Phaser is a JavaScript library which makes it super easy for you to build games. It builds on top of WebGL, but if your browser doesn’t support that, falls back to canvas support. In this quick post, I will show you how to get up and running with your first game in literally 5 minutes (if you take mine as a starter). Note that I use the new version 3 while many tutorials and example games are written in version 2.
Read more →