CODEX

How much a byte really cost?
The question is detrimental, paralyzin’ my thoughts.

Image for post
Image for post
Photo by Adi Goldstein on Unsplash

You may be wondering what’s the topic of this article. Perhaps you spotted the reference to Kendrick Lamar’s How Much A Dollar Cost.
So, what do Kendrick’s song and bytes have in common? Nothing, to be honest.

This whole article’s a mere storytelling experiment. Now, without further ado, let’s begin our story.

An Expensive Lesson

How much a byte really cost?
The question is detrimental, paralyzin’ my thoughts

It was 1996 — June the 4th precisely — and the European Space Agency was ready to launch a brand new rocket named Ariane 5 from its base in Kourou, French Guiana. …


A beginner-friendly introduction to cybersecurity fundamental principles

Image for post
Image for post
Photo by Michael Dziedzic on Unsplash

The CIA triad is a widely used acronym in information security standing for:

  • Confidentiality
  • Integrity
  • Availability.

These three are the fundamental properties of information to protect.

Thinking about these three when designing for security is crucial to build a robust system.

Let’s briefly analyze them in the order proposed by the acronym.

Confidentiality

Confidentiality is the property of data to remain secret between the sender and the receiver.

The most mechanism to maintain confidentiality is encryption.

When you encrypt a message, you obscure it by transforming it into a seemingly meaningless one.

After encryption, the only way to restore a message…


How to create a cool bar chart race animation the easiest way.

Image for post
Image for post
Final result.

Prerequisites: having Python installed on your pc or being registered for Google Colaboratory.

Step 0

First of all, create a new directory for the project (if you use Google Colaboratory skip to step 1)

mkdir my_bar_chart_race

And create a new virtual environment, and activate it:

python3 -m venv venv
source venv/bin/activate

Step 1

If you haven’t already, install pandas

pip3 install pandas

Install the library we’ll use to create the bar chart race named, you won’t guess it, bar_chart_race

pip3 install bar_chart_race

Step 2

Now that we have the necessary libraries installed, let’s load our data.

In this tutorial, we’ll create a bar chart animation of…


A practical introduction to git basic concepts.

Image for post
Image for post
Photo by Yancy Min on Unsplash

Git is a DVCS: Distributed Version Control System.

Basically, with git you and your team can cooperate to create, modify, extend, maintain code working in parallel on the same codebase, without worrying about “breaking” the code.

When you want to develop a project using git you create a repository — a directory containing your project’s code and a .git subdirectory used by git itself to keep track of everything.

Note: repositories are often called repo for brevity.

The command to initialize a folder is:

git init 

to initialize the current folder, or

git init <directory_name>

to initialize a specific directory.

Keep Track Of a File


Like functions, but shorter…more or less. Let’s find out!

Image for post
Image for post
Photo by Steinar Engeland on Unsplash

Arrow functions are those weird functions using a funny syntax mimicking how humans write or draw them on paper:

(param1, param2) => { /* do something */ }

Are they just a shorter way to write function, or is there more?

The answer is yes, they’re mostly a shorter way to write functions, but there are some little differences.

Arrow functions are anonymous

The first thing you may note from the above snippet is that arrow functions haven’t got a name — they’re anonymous.

For instance, you cannot write something like this:

functionName(param) => { /* do smth */ }

But you can get…


A brief and practical introduction to their functioning and use

Image for post
Image for post
Photo by Oskar Yildiz on Unsplash

What are JavaScript closures?

MDN web docs give this great definition of what a closure is:

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.

A practical example

This example comes from this series about closures that I’ve made, but with a simpler syntax to be more beginner-friendly, and with some improvements, because in series you must be short:

In this example, the…


A SIR model simulator using p5.js library

Covid-19 spread map
Covid-19 spread map
Photo by Giacomo Carra on Unsplash

Being forced at home due to Italy’s lockdown, I had to find something to do, then finally someone gave me the idea: why don’t you create a SIR Model simulator? He was suggesting to create something like the simulations you can find here. The idea was interesting so I decided to give it a try (here’s the final result, and here’s the code).

Lorenzo Felletti

Computer Engineering student at the University of Bologna

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store