Archivi categoria: Programming

My articles

Kryo and FastUtil wrapper

While I was working with Apache Spark, I had a problem to write a FastUtil wrapper with Kryo Serializer. So I passed a day to working on it and I found a solution.
This is an example code that uses a Int2LongOpenHashMap wrapper that has public  long counter attribute.

WrappedInt2LongOpenHashMap p = new WrappedInt2LongOpenHashMap();
p.addTo(220, 20);
p.addTo(30, 5);
p.addTo(30, 15);
p.addTo(220, 5);
p.counter = 10;


The Java default serializer works fine, it serializes HashMap and the counter attribute. Continua a leggere

Machine Learning Framework: link

I vari framework di machine learning delle Big della Tech:

Infine un canale YouTube sul DeepLearning: DeepLearning.TV

Machine Learning: links

Per la rete ho trovato un serie di link utili, li scrivo come nota personale e anche perchè  del materiale  potrebbe servire a molti.

Video Lezioni:

Altro materiale utile:

Microservice: unikernel vs container

Negli ultimi anni per quanto riguarda il cloud si stanno diffondendo sempre più i microservice, per farsi un’idea dell’importanza basta leggere questo post sul blog di Microsoft Azure, oltre che andare su dove i container,l’ambiente dove girano i microservice (di seguito spiego cosa sono), sono uno dei  tranding topics insieme alla blockchain. Continua a leggere

MiniJoystick – UI Component for touch screen

With the  diffusion of mobile devices is important to continue to offer to users the most possible number of functions, but there’re some problems due to little screens.
For example, with a 5’’ screen a UI Designer can’t draw all the buttons that could do for a desktop app. Button group like this below, are not possible on a smartphone:

A button group for a image slider

From this problem I thinked to a possible solution, it’s easy to use and easy to code: a miniJoystick component, a simple button that uses the properties of the touch screens.
MiniJoystick is a button that can be clicked or can be dragged to left/rigth, up/down, like the old joystick!
For example, the same button can be used to go to next image (“>”) o go to the last image (“>>”), just click on it or drag-to-right.

Mini-Joystick demo
Mini-Joystick drag to right

This is a demo code of Mini-Joystick idea

Machine Learning – Alberi di decisione

Google Developers sul suo profilo Youtube sta pubblicando delle  video-tutorial sul machine learning. I primi due video parlano degli alberi di decisione (linko wikipedia inglese perchè è più completa).
Vedendo i video mi è tornata in mente la mia tesi, in cui ho analizzato le firme grafometriche e dove ho usato un albero di decisione “fatto a mano” per classificare. Così mi son messo a scrivere un pò di codice python per far pratica con i metodi automatici. Continua a leggere

How to compile Hadoop 2.7.1 on Raspberry Pi B+

A day I friend of mine give me an old Raspberry B+ and I  found on internet this tutorial by The University of Glasgow’s Raspberry Pi Project Blog . I tried to compile Hadoop on it, in the way that native libraries are loaded (you can check this with hadoop checknative -a) 

But why are native libraries (libhadoop, zlib, snappy, lz4, bzip2 and openssl) so important? I get the answer from the Hadoop page:

“Hadoop has native implementations of certain components for performance reasons and for non-availability of Java implementations.”

Raspberry B+ is not so fast and use more possible native code is better! (Raspberry Zero was also released: it is 40% faster than B+ but it has not ethernet support ).

So I started to compile it on hardware. I started from this tutorial by Headamage for Raspi2 and after some days of experiments, I have successfully compiled Hadoop!
First: I used an external USB disk also because compile projects of this dimension can destroy your SD card. You need at least 1.5GB  of free memory on an ext2  partition  (or some other file system that support symbolic links) only to compile Hadoop without protobuf: so I suggest you 3GB of free memory on disk for everythings. Continua a leggere

Deep learning: links

These are some useful links that I found about Deep Learning: