This blog post has been published on the Preferred Networks Tech Blog.
Pattern matching on algebraic data types is a powerful technique to process a given input and many programming languages have adopted it in one way or another. In this blog post I will first briefly explain the concept of sum types and give examples of pattern matching on these types in Rust and Scala. Then I will show how to define sum types in recent Python versions, and I will explain how the mypy type checker can (to a limited degree) be used to add exhaustiveness checks to Python code working with these types.
This blog post has been published on the Preferred Networks Tech Blog.
Most computer applications can be configured to behave a certain way, be it via command line flags, environment variables, or configuration files. For you as a software developer, dealing with configuration comes with challenges such as parsing untrusted input, validating it, and accessing it on all layers of your program. Using Python as an example, I want to share some best practices to help you handle configuration safely and effectively.
When working in Japan as a salaried employee, most tax payments are handled silently by the employer and there is no need to file a tax return (with some exceptions). However, certain types of expenses are tax-deductible and it may make sense to file a tax return and get some of the paid income tax back. In this post I will share some details about that and show an example of how to file a tax return.
When working in Japan as a salaried employee, most tax payments are handled silently by the employer and there is no need to dig deep into details of tax legislation. In some cases it may still be beneficial to understand how income tax works in Japan and which expenses are tax-deductible. In this post I will explain what the end-of-year adjustment is and how your income tax is computed from your total salary.
Setting up a Linux server to host a certain software is easier than ever before. One challenge that the average user will most likely not be able to solve as easily is the continued maintenance of such systems. How do you get the latest security updates, how do you make sure your configuration still works after an upgrade, what if the underlying OS does not receive updates any more, …? This blog post presents a set of related ideas and one possible approach how it could be done.
Like most software developers, once in a while I need to write not only program code, but also text for humans to read, for example README files, tutorials, or software manuals. This post presents requirements that a markup language should fulfill to be usable for software documentation and presents one possible approach using Docbook XML generated from Scaml.
Timestamps in Apache access log files have, by default, the format 27/Oct/2013:06:33:40 +0100
. This can not be parsed in Python using the strptime()
function from the time
/datetime
modules because there is no %z
placeholder in strptime()
to match the timezone (only %Z
). Also, using the parse()
function from dateutil.parser
...
Seit Juni wird Deutschland von den Enthüllungen Edward Snowdens umgetrieben. Die deutsche Bundeskanzlerin hat sich dazu in den ersten Monaten fast gar nicht geäußert und ihre Minister vorgeschickt, die Affäre kleinzureden, zu beschwichtigen und sich von einem amerikanischen Geheimdienst, der das eigene Parlament belügt, mündlich und schriftlich versichern zu lassen, ...
Gerade bin ich für einige Monate in Japan, aber die Servicewüste Deutschland verfolgt mich bis hierher. Eigentlich wollte ich nur gelegentlich mit meinem deutschen Handy, das ich mit einer Fonic-SIM-Karte benutze, SMS in Japan empfangen – das hat auch einen guten Monat lang geklappt. Danach habe ich allerdings von einen ...
Durch Deutschland geht gerade ein Sturm der Empörung über unsere angelsächsischen Verbündeten, vornehmlich wegen Prism und Tempora. Ein paar Anmerkungen dazu: Falls Tempora tatsächlich das gesamte Internet abfangen und speichern sollte, ist das die Voraussetzung, von der man beim Design sämtlicher sicherer Internetprotokolle ausgeht und ausgehen muss. Beispielsweise hat ...