This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EXCLUDES Comments | |
from pptx import Presentation | |
import sys | |
prs = Presentation(sys.argv[1]) | |
for i,slide in enumerate(prs.slides): | |
print("---------------------- Slide %d" % (i+1)) | |
for shape in slide.shapes: | |
if hasattr(shape, "text"): | |
print(shape.text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% based on combination of online info | |
git clone https://github.com/opencv/opencv.git -b "4.5.2" --depth 1 | |
git clone https://github.com/opencv/opencv_contrib.git -b "4.5.2" --depth 1 | |
set "opencvSource=opencv-4.5.2" | |
set "opencvExtraModules=opencv_contrib-4.5.2/modules" | |
set "opencvBuild=%opencvSource%\build" | |
set "compiler=Visual Studio 16 2019" | |
set "buildType=Release" | |
set python3_executable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Testedt with GCC and CLang | |
// Not working with ICC due to the UTF-8 | |
// MSVC requires /utf-8 option | |
#include <iostream> | |
// from https://riptutorial.com/cplusplus/example/23817/named-operators | |
// modified to use < > instead of * | |
// modified for adding unary version | |
namespace named_operator { | |
template<class D>struct make_operator{constexpr make_operator(){}}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mido import MidiFile | |
import mido | |
import sys | |
def ntof(n): | |
return 440*(2**((n-69)/12)) | |
def main(): | |
mid = MidiFile(sys.argv[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cppPosit 7b7b5ecde436a65923d679d91ddb1b29b711af27 | |
/** | |
* Emanuele Ruffaldi (C) 2017-2018 | |
* | |
* My personal bit hip pop using BMI extensions and a bit of constexpr! | |
*/ | |
#if defined(__SDSVHLS__) && !defined(FPGAHLS) | |
#define FPGAHLS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function s64toc64(a::Int64)::Int64 | |
return a < 0 ? -(a & 9223372036854775807) : a; | |
end | |
function c64tos64(a::Int64)::Int64 | |
return a < 0 ? ((-a) | -9223372036854775808) : a; | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#1) on https://console.developers.google.com/ register project and associate API from library | |
# OUTPUT: client_id,client_secret | |
client_id="..." | |
client_secret="...." | |
#2) get authorization code at the following link using web browser | |
# OUTPUT: code | |
scope="https://www.googleapis.com/auth/drive" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os,sys | |
people = [x.split(" ") for x in """1 10 name""".split("\n")] | |
print (people) | |
for f,n,name in people: | |
f = int(f) | |
n = int(n) | |
print (f,f+n-1,name) | |
os.system("gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=%d -dLastPage=%d -sOutputFile=%s.pdf \"%s\"" % (f,f+n-1,name,sys.argv[1])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# parses KML from Google Timeline to obtain places | |
# Emanuele Ruffaldi 2018 | |
import os,sys | |
import csv | |
import datetime | |
import xml.etree.ElementTree as ET | |
from collections import defaultdict | |
import time | |
from dateutil import tz | |
from_zone = tz.tzutc() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find / -mtime -1 -not \( -path "/proc/*" -o -path "/sys/*" -o -path "/dev/*" \) -print |