Introduction to Machine Learning

AI is a long game. What is there right now is good enough, but in a couple of years, it will be very good. In about five years, it will be excellent. And in ten years, it will be impossible to work without it.

There’s no turn back, Artificial Intelligence (AI) will be part of our future. From resolving simple day-to-day pain points, such as house choirs or laundry and clothes folding, to more existential problems such as the cleaning of our oceans and the preservation of our environments, to the exploration of new worlds, it will shape the future of our society.

But what is AI and what does it means and how does it fits with the other buzzwords? This article will review the most commons subfields related to this topic to attempt to clarify how all work together. Continue reading “Introduction to Machine Learning”

Access MariaDB (MySQL) from Python code

On the host machine, it is required to install the driver to connect to the database from the Python code.

On Ubuntu or Debian-based Linux systems:

apt-get install python-mysql.connector

On Redhat or CentOS Linux systems:

yum install python-mysql.connector

Connect to the database server using the command line client, then  the database to connect to:

CREATE DATABASE flask DEFAULT CHARACTER SET utf8 DEFAULT collate utf8_bin;

GRANT ALL PRIVILEGES ON flask.* to flaskuser@'%' IDENTIFIED BY 'flaskuser';
GRANT ALL PRIVILEGES ON flask.* to flaskuser@'localhost' IDENTIFIED BY 'flaskuser';

SET PASSWORD FOR 'flaskuser'@'localhost' = PASSWORD('<PASSWORD>!');

Finally, from the Python script, import the connector, connect to the database, and start querying the records:

#!/usr/bin/env python

import mysql.connector as mariadb

mariadb_connection = mariadb.connect(user='flaskuser', password='<PASSWORD>', database='flask')
cursor = mariadb_connection.cursor()