Per gestire l’emergenza Covid-19 è necessario elaborare e trasmettere diversi flussi informativi a diverse piattaforme (piattaforme aziendali, bucket regionali, in formato csv o excel, applicativi di gestione casi, dashboard di aggregazione o analisi dei dati, etc.).

# Pandas da SQL

Pandas è una libreria per Python, che offre strutture dati per manipolare tabelle ed effettuare analisi. Si tratta di uno strumento molto flessibile: io lo considero, facendo un paragone forse un po’ azzardato, una specie di Excel per Python.

Ho un video nel mio canale youtube che recentemente è stato marcato come non monetizzabile, causa violazione dei diritti d’autore:

# Essere Informatico

Quando mi chiedono quale lavoro svolgo nella vita, mi vergogno di dire che sono un informatico (anche se in realtà, sto più dalla parte degli “sviluppatori”): l’informatico è visto come quello che sistema le stampanti, i videoproiettori ed installa i cd di windows craccati, tutte attività che spesso e volentieri sa fare anche male.

# New Template

Quando ho iniziato questo blog su GitHub, oltre 2 anni fa, mi sono basato semplicemente sul modulo Jekyll Now che, una volta clonato, permette di disporre di un template subito pronto per la pubblicazione degli articoli del blog, scritti con sintassi markdown.

# Mathjax

Nel mio post precedente avevo necessità di scrivere delle formule per rappresentare delle probabilità. Le formule erano molto semplici, del tipo $$p = \frac{1}{(n-1)}$$, ma volevo che fossero esteticamente belle ed eleganti, evitando però di doverle includere come immagine embedded.

Problema:

Problem:

Problem:

# Show text files width

I am often working with fixed width text files. Sometimes text files aren’t produced properly, so I have to make sure that all rows share the same width.

# Cut a fixed width text file in CMD

I recently had the need to cut a fixed width text file at a certain column, and I had to do it in the Windows 10 world, without any particular utility.

# Pratical use of Sql::Textify

I know that perl is considered out of fashion nowadays, but for some tasks it’s still a good and handy choice. Here’s a practical use of my module Sql::Textify. Every morning I need to check the status of some tasks, like the number of times my web services have been called the day before, with some performance analysis and the number of errors. At the same time I want to know if my pentaho tasks are all finished. And I want to know if all my backups are updated.

# Dump Markdown plugin for Adminer

Few months ago I started working on a Markdown dump plugin for Adminer, now I can finally write a post about it.

# Postgresql: detect record changes

In MySQL we can have a timestamp column which is automatically set to the current date/time whenever the record is inserted or updated:

# Postgresql: Detect Status Changes in a Table

This is another challenging problem I had, and it took me some hours of work to find out how to solve it. I was very tempted to use a script in a procedural language like Perl, which would make the problem easy and the solution straightforward, but there had to be a pure SQL way and here’s how I did it!

# Appointments Table and Recursive Query in PostgreSQL

My company uses a booking table like this simplified one:

# Markdown filter for Mason2

Mason comes with some built-in filters that can be used to process portions of content in a component. The standard way to invoke a filter is in a block:

# Pentaho BI integration with Active Directory

This is a quick guide of how to integrate the Pentaho BI platform with Active Directory. It has been tested on version 5 and 6, it’s not yet tested on version 7.

I’m becoming a fan of Adminer, a database management tool written in PHP, with lots of features and consisting only of a single PHP file, and very easy to deploy to an Apache web server. I have started to develop a plugin adminer-plugin-dump-markdown so I can quickly convert queries and tables to Markdown format, ready to be included in my e-mails or in my blog posts.

# Scheduling Kettle Jobs

Pentaho Data Integration is an open source tool that provides Extraction, Transformation, and Loading (ETL) capabilities. While it’s an essential DWH tool, I use it quite a lot also as an integration tool, where it performs well.

# Moving to GitHub Pages

I have never been a big fan of the WYSIWYG paradigm: it looks fast and convenient at first, but it becomes unmanageable at a later time. This applies to almost everything, like Word processors, Web Pages editors, Grapgical programs, but also to blogging platforms. Have you ever tried to insert some programming code in your articles, and edit the code at a later time? Chances are that the code will become messed up, sooner or later.

# MySQL and Full Outer Join

In SQL, a full outer join is a join that returns all records from both tables, wheter there’s a match or not:

# Shared Recordset Definition

I think that the modules I developed for Sentosa Autoforms are quite elegant and flexible (expecially the Sentosa::SQL module, and the DataDatables and JSON modules) so I decided to reuse them! However I don’t like the fact that Sentosa Autoforms is all driven by database data.. while it’s sometimes very convenient, I don’t like the layer of complexity that it adds.

# Sentosa Widgets

Query and Forms are provided by the query.mi and the form.mi components.

# Custom Sentosa System Database

Sentosa Autoforms by default stores all of its users, settings and objects in a local SQLite database. The default connection is defined in lib\Sentosa\Import.pm module:

# SQL Markdown Builder

I like text editors, especially Sublime Text. And I like to work at the command line (on Linux, on Mac… but even on Windows 10 it has become very nice).

# Systemctl start sentosa.service

I just started to publish my Sentosa web portal and users of my company are now starting to use it. Great!

# DB.pm Library

Hello, I’m finally back! Yes not much posts lately, but lots of coding - it’s a lot considering that I’m working full time and that this is only a side project on my spare time.

# Base.mc: Basic template

On my own machine I’m using a HTML Admin template I bought from themeforest.net: it’s just a few dollars, and I can concentrate on my Mason code, forgetting for a while about HTML, CSS, and JavaScript libraries. Of course I had to choose a template that supports DataTables, we are going to use that a lot later.

# Global variables between components? No! Sessions!

I didn’t post much recently because I wanted to focus on coding: even if it’s still to early, even if a lot of functions I want to implement are still missing, and even if the code is not too robust, I want to start using the application within my company and I want to publish a limited but working version on GitHub, so anyone can download it and see it in action.

# Sentosa Autoforms on GitHub

I finally managed to open a repository on GitHub:

# User authentication

Okay I know already that the code I’m going to post here is quite a big mess: it will work under some circumstances but it’s buggy and insecure. I will update this post as soon as I figure out how to make this code better (expecially the UserSession part).

On my previous posts we saw how to to create and use true global variables. Their usage is limited to $dbh at the moment. But I also need a “global” variable, shared between all components of the same request. Here’s one of my first tries, and this is how the Base.mc will look like: Read More # Global variable$dbh

The name of my project is “Sentosa AutoForms”, and it is going to be driven by a SQL database. I’m using SQLite but it can be changed at a later time to MySQL or Postgresql.

# True Global Variable for Mason in Poet

A few days ago, while I was roaming around Singapore, I offered a bounty (twice) on an already existing question on StackOverflow Global Variable mason2 in Poet where the poster was asking how to use global variables in Mason. And I got a very nice and useful answer :)

# Installing and testing Poet and Mason, on Windows!

Good news about Mason2 is that it can be easily installed using cpanm: