Skip to content

Instantly share code, notes, and snippets.

View mapio's full-sized avatar
🎯
Focusing

Massimo Santini mapio

🎯
Focusing
View GitHub Profile
@mapio
mapio / Printing trees.ipynb
Last active January 9, 2019 11:34
Some recursive code to print trees
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / (Sort of) busy wait workaround for SpeechSynthesisUtterance.onend bug.markdown
Created November 29, 2015 19:52
(Sort of) busy wait workaround for SpeechSynthesisUtterance.onend bug
@mapio
mapio / ArgMax.java
Created February 23, 2015 23:32
An implementation of an argmax collector using the Java 8 stream APIs
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collector;
class ArgMaxCollector<T> {
private T max = null;
private ArrayList<T> argMax = new ArrayList<T>();
@mapio
mapio / viva.ipynb
Created March 27, 2018 11:47
VivaGraphJS in Jupyter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / install_jdk_osx.sh
Last active March 27, 2018 06:44
A couple of scripts for unattended install of Oracle JDK 8 on Ubuntu and OS X
#!/bin/bash
echocol() { echo -e "\033[32m*** $@...\033[0m"; }
echocol "Attempting to download the JDK installer disk image"
attempts=5
while ! curl -H "Cookie: oraclelicense=accept-securebackup-cookie" -C - -#LO http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-macosx-x64.dmg; do
if [[ $attempts == 0 ]]; then break; fi
echo "[restarting an interruped download]"
sleep 1;
@mapio
mapio / FAW.ipynb
Last active December 4, 2017 01:11
Find A Way
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / install_firma.sh
Last active October 16, 2017 08:38
Installa "firma" nel file .bashrc
#!/bin/bash
rc="$HOME/.bashrc"
jars="$HOME/.labprog-jars"
if [ ! -w "$rc" ]; then
echo "Attenzione, il file .bashrc non era presente, l'installazione potrebbe fallire"
fi
if grep -q "### labprog-firma (non cancellare questa riga e le seguenti)" "$rc"; then
@mapio
mapio / config
Created March 17, 2017 21:01
How to smudge Jupyter notebooks in git
[filter "handle-ipynb-output"]
clean = "jupyter nbconvert --to notebook --NbConvertApp.from_stdin=True --ClearOutputPreprocessor.enabled=True --NbConvertApp.writer_class=StdoutWriter"
smudge = cat
@mapio
mapio / Dijkstra.ipynb
Last active November 23, 2016 12:00
Apparently not so nice…
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapio
mapio / HOWTO-ML4A-OSX-GPU.md
Last active November 22, 2016 22:10
How to install the required libs for ML4A on OS X with GPU support

How to setup a virtualenv for ml4a on OS X with GPU support

Requirements

This is tested on OS X 10.11.6 running on a MacBook Pro with NVIDIA GeForce GT 750M as of Tuesday, November 22, 2016; if you are note sure about your system, run

sw_vers