Docker is a fantastic tool that makes our lives much easier offering us standardization, productivity, efficiency, maintainability and compatibility of our code. It allows us to continuously and rapidly deploy and test our code and it is platform-independent.
If you are unsure of what Docker is, what to use it for or how to use it; this is the article for you! I’ll try to give an explanation that’s as clear as possible for people who are new to Docker. At the end of this article you:
If you are not working with migrations in your database you’re missing out. Like Git manages changes to source code, you can use migrations to keep track of changes to your database. Execute and revert changes and get your database back into a previous state.
Setting up migrations is easier than you think and the advantages are huge. Migrations are database-independent, offer one source of the truth, track changes and can even seed your database with some data. When you’ve read this article you’ll be able to:
You have a great python program that you want to make available to the world. With FastAPI you can speedily create a superfast API that’ll allow you to make your Python code available for other users.
In this article we’re going to create an API in 5 lines of code. What? Five lines?! That’s right; FastAPI isn’t called FastAPI because it is many times faster than frameworks like Django or Flask; it’s also super easy and fast to set up.
After we’ve created our initial API we’ll expand it the next part(s), demonstrating all the necessary bits of knowledge you…
Ever wondered how a database engine can return data for your queries that fast? How it can search through many tables, and millions of records in a flash? This article explores how the database engine works under the hood and sheds light on how to design your tables and indices in the most optimal way. No more waiting for queries to finish!
As usual we’ll first set up an example, creating some sample data so we have something to work with. Then we’ll check out how the database engine performs without indices. Then we’ll add indices to speed up our…
What do you do when our table expects id’s but all we have are strings? Let’s imagine we’re a restaurant. We store every menu item and its ingredients into our database so that we can keep track of all kinds of statistics; how often a dish is ordered and which ingredients are most popular e.g.
We want to store a new recipe into the recipes table but there’s a problem: this table expects an ingredient_id and not the ingredient_name that we currently have. How can we insert these IDs into the recipes table while we only have the names?
Imagine we are a restaurant that sells all kinds of dishes. Because we’re smart we keep track of all of our ingredients in a database. The
ingredients table will contain only unique ingredients that each have their own id.
The goal of this article is to create a query that inserts unique ingredients in to the table that are not already in the table. Other tables can refer to the ingredient_id so that we can filter and join on integers, which is a lot faster in large datasets.
First we’ll create the table that’ll contain the ingredients. This article uses…
With Docker, it is easy to package your code into an image that we can run anywhere, anytime; regardless of your hardware or software. It will run on a laptop, Raspberry Pi, Server, Mac, Linux or Windows. This article will detail the process of packaging your script into a Docker image that can be shared and run. It focuses particularly on how to run the programs that exist in the Docker image.
When you upsert data into a table, you update records that already exist and insert new ones. After reading this article, you’ll be able to connect your Python application to a database and upsert data lightning fast. We’ll go through a few practical examples that demonstrate various ways to do this. They are all geared towards handling large sets of data; focusing on high speed and data validity. Let’s code!
P.S. We’ll use SQL Server for this example but the techniques used are applicable to a wide range of databases.
We have a website that sells various musical articles. Every…
In this article we’ll go through the application of a self-learning, evolution-based genetic algorithm that augments its own topology. Confused? I can imagine; those are some big words. Stay with me though, I promise you’ll see the beauty of this algorithm at the end of this article.
In order to understand neuro-evolution-algorithms as clearly as possible I’ve programmed a little game called Dots that will illustrate the way the algorithm works. I’m trying to describe what happens in lay-mans terms, not focusing on programming or math. …
Wow that title contains a lot of terms! Simply said this article offers you the best way to share your Python code privately and easily, even run it in a docker container! In the end you’ll be able to distribute private packages that run everywhere, are easily maintainable and updateable. Let’s code!
You’ve created a Python script with all kinds of handy functions that you want to share with others. You have two choices on how to approach this: