Skip to content

Instantly share code, notes, and snippets.

View loretoparisi's full-sized avatar
🐍
NightShift

Loreto Parisi loretoparisi

🐍
NightShift
View GitHub Profile
@loretoparisi
loretoparisi / english_contractions_dataset.json
Last active June 17, 2023 01:49
List of English contractions from Wikipedia
{
"ain't": "am not / is not / are not / has not / have not / did not",
"amn't": "am not",
"aren't": "are not",
"can't": "cannot",
"'cause": "because",
"could've": "could have",
"couldn't": "could not",
"couldn't've": "could not have",
"daren't": "dare not / dared not",
@loretoparisi
loretoparisi / english_contractions_dataset.js
Last active June 13, 2022 12:20
List of English contractions from Wikipedia
script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script);
function download(name,jsonObject) {
var fileContents = JSON.stringify(jsonObject, null, 2);
var pp = document.createElement('a');
pp.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(fileContents));
pp.setAttribute('download', name+'.json');
pp.click();
}
df={}
$( $('.wikitable')[0] ).find('tr').each((index,item) => {
@loretoparisi
loretoparisi / sanremo_music_festival_dataset_1951-2019.csv
Created January 21, 2020 00:51
Sanremo Music Festival Dataset Tracks 1951 - 2019
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 3.
track_year track_id track_pos artist_name track_name track_writers track_votes
1951 1 Nilla Pizzi Grazie dei Fiori G. C. Testoni, M. Panzeri,S. Seracini 50
1951 1 2 Nilla Pizzi,Achille Togliani "La luna si veste d'argento" V. Mascheroni,Biri 30
1951 2 3 Achille Togliani Serenata a nessuno W. Colì 20
1951 3 F Achille Togliani,Duo Fasano Al mercato di Pizzighettone N. Ravasini,A. Locatelli
1951 4 F Nilla Pizzi,Achille Togliani Eco tra gli abeti E. Bonagura,C. A. Rossi
1951 5 F Achille Togliani,Duo Fasano Famme durmì V. Panzuti,Danpa
1951 6 F Duo Fasano La cicogna distratta Da Rovere, A. Valleroni,Carrel
1951 7 F Nilla Pizzi,Duo Fasano La margherita E. B. Valdes
1951 8 F Achille Togliani Sedici anni L. Gambetti, M. Mariotti,A. Mari
@loretoparisi
loretoparisi / sanremo_music_festival_tracks_dataset.js
Last active August 16, 2023 17:58
Sanremo Music Festival Tracks Dataset
script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script);
function download(name,jsonObject) {
var fileContents = JSON.stringify(jsonObject, null, 2);
var pp = document.createElement('a');
pp.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(fileContents));
pp.setAttribute('download', name+'.json');
pp.click();
}
const title = $('.firstHeading').text().replace(/[aA-zZ]/g,'').trim();
const table = $('.wikitable').length - 1;
@loretoparisi
loretoparisi / mixout.py
Created January 10, 2020 20:22 — forked from stephenroller/mixout.py
Example of mixout on generic modules.
#!/usr/bin/env python3
"""
Example of a generic Mixout implementation. (Lee et al., 2019).
https://arxiv.org/abs/1909.11299
Implementation by Stephen Roller (https://stephenroller.com).
Example output:
@loretoparisi
loretoparisi / mixout.py
Created January 10, 2020 20:22 — forked from stephenroller/mixout.py
Example of mixout on generic modules.
#!/usr/bin/env python3
"""
Example of a generic Mixout implementation. (Lee et al., 2019).
https://arxiv.org/abs/1909.11299
Implementation by Stephen Roller (https://stephenroller.com).
Example output:
#!/usr/bin/env python3
from typing import Any, Callable, Dict, Iterable, Union
import multiprocessing
import queue
import sys
import threading
import time
class ThreadPool:
#! /usr/bin/python
import ctypes
import sys
size = int(sys.argv[1])
class MemoryTest(ctypes.Structure):
_fields_ = [ ('chars' , ctypes.c_char*size * 1024*1024 ) ]
try:
test = MemoryTest()
@loretoparisi
loretoparisi / increase_swap.h
Created November 26, 2019 15:46
Ubuntu increase swap space
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=16
sudo mkswap /swapfile
sudo swapon /swapfile
grep SwapTotal /proc/meminfo
@loretoparisi
loretoparisi / stdc++.h
Created November 18, 2019 15:25
stdc++.h macos
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.