After hours browsing the Internet, I couldn’t get my hands on a working tutorial to simply extract audio samples from a file using libavcodec. So here’s to you, a full working example! Warning FFMPEG and the libraries it depends on are often updated, and their API can drastically change between versions. This code works with … Read more

Background While using ORMs in Python offers a great deal of flexibility in many respects, one of the biggest drawbacks is database maintenance. What happens if you just alter the models in your code? If you do so, you will have to either: manually alter/drop/create the tables in your database – can seriously decrease maintainability, … Read more

Why wouldn’t we use Django ORM? Using Django ORM is not suited for real database operations. Sure, it might look okay(ish) when you are only performing basic CRUD operations. But it will force you to perform database queries in the least optimized way (see N+1 SELECT issue)… Its syntax is inconsistent, and its lack of … Read more

What is this all about? Graphs are becoming more and more popular to represent interconnected data. We’ll see here how to make a simple program taking the weights of the relations between the nodes as an input, and outputs the coordinates of the nodes as an output. For example, imagine we have in a graph … Read more

What is a chatbot? A chatbot, or chatterbot, is a computer program aiming at simulating a written conversation with a human user. Why making one? Well, first… because it’s fun! Since Alan Turing, chatbot programming has been a way to test computer’s ability to pretend like they are human (see Turing test). Also, chatbots can … Read more

Why? In a recent code golf contest, the goal was to write a useful program within 100 characters tops… What does the program do? This program can encode and decode any kind of data (text, binary data…), using a user-defined key (passphrase) of any desired length. It has been adaptated from the Vigenère cypher, replacing … Read more