Categories

Spring-cleaning your (Arch) Linux system

Disclaimer: Some operations mentioned in this post are potentially destructive and irreversible. Be sure to back up all your important data before proceeding. Note: This post is written from the point of view of an Arch Linux user. Most steps presented below should nevertheless translate well to other distributions. Through the usual course of their […]

Categories

Validating constraints across multiple form fields in Django

After all fields of a Django form have been validated in isolation, the Form().clean(self) method is called to conclude the validation process. This method is meant to house validation logic not associated with one field in particular. For example, let’s suppose we have an application where our users can order gourmet-level cat & dog food. […]

Categories

Where to define and instantiate associated models in Django

For the sake of example, let’s consider the following UML diagram describing two model classes and how they are interrelated: We can see that there are two classes, User and UserProfile, with a one-to-one association between them. That is, each instance of class User is associated with one and only one instance of UserProfile and […]

Categories

Creating a persistent Arch Linux installation on a USB stick

What follows is a list of steps for installing a minimal Arch Linux live USB system. In the spirit of KISS, we will go with a single-partition layout: Create a single Linux type partition with fdisk or another similar tool on your USB device (e.g. /dev/sdc) Set up an ext4 file system on the newly […]

Categories

Building a Java JSON API in 4 minutes (yes, 4 minutes)

So you have written this amazing piece of software solving one of the world’s biggest problems. If only you could quickly & painlessly share the fruits of your labor with the world… Well, actually you can, and it’s not that hard. Quite the contrary: It’s really simple, thanks to Spark1 which (according to its website) […]