Skip to content

Instantly share code, notes, and snippets.

View MatteoRagni's full-sized avatar
🎱

Matteo Ragni MatteoRagni

🎱
View GitHub Profile
@MatteoRagni
MatteoRagni / blender_net.py
Created April 2, 2016 14:59
This is a simple Python module for Blender - Game network communication. This allow UDP connections in which `json` object are sent.
# Server
# To use it:
# - Load this script in Blender Note editor as `net.py`
# - Select the objects that should handle the network logic (for example an empty or the camera)
# - Add an Always sensor with only raise up
# - Add a python controller as a module, that calls `net.serve`
# - connect sensor and controller
# - enjoy
import bge
@MatteoRagni
MatteoRagni / update_gnome_extensions.rb
Last active April 21, 2016 19:48
Update "shell-variable" in "manifest.json" for Gnome Extensions
#!/usr/bin/env ruby
require "json"
# Changes the shell-version variable for all local active extensions
$EXTENSIONS_LIST = eval(`gsettings get org.gnome.shell enabled-extensions`)
if not $EXTENSIONS_LIST.is_a?(Array)
raise RuntimeError "Cannot read extension list"
end
$SHELL_VERSION = `gnome-shell --version`
@MatteoRagni
MatteoRagni / atlas-lapack.md
Last active April 27, 2016 18:41
Some passage to update `atlas-lapack` AUR package on my intel machine...

atlas-lapack on Arch

Poweroff, on grub screen press e on Arch entry to add on the linux line (after quiet option) the option:

intel_pstate=disable

and boot. Login and run in a terminal:

@MatteoRagni
MatteoRagni / metropolis.css
Last active May 11, 2016 10:30 — forked from vhodges/metropolis.css
A version of the Beamer theme Metropolis for reveal.js
/**
* A simple theme for reveal.js presentations, derived from serif.css
* It's in the spirit of the Metropolis theme for beamer https://github.com/matze/mtheme
*
* This theme is Copyright (C) 2016 Vince Hodges, http://sourdoughlabs.com - it is MIT licensed.
*/
@import url(../../lib/font/fira/fira.css);
.reveal a {
@MatteoRagni
MatteoRagni / Makefile.config
Last active November 25, 2016 09:00
Makefile configuration for CAFFE on my system (Arch Linux - GCC 6.1 - cuDNN - Cuda7.1 - Python3.5m - Matlab R2015b)
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
@MatteoRagni
MatteoRagni / test.py
Last active June 3, 2016 14:28
Timer in python, that implements a tic - toc in a context
from timer import Timer
with Timer():
print("do something")
with Timer():
print("do something else")
@MatteoRagni
MatteoRagni / tictoc.rb
Created June 2, 2016 16:27
A simple tic toc timer in ruby. Timed operations are wrapped in a proc
def tictoc
tic = Time.now
yield
toc = Time.now
ret = toc - tic
puts "Time elapsed #{'%.3f' % ret}"
return ret
end
@MatteoRagni
MatteoRagni / PKGBUILD
Created June 3, 2016 10:04
GCC-4.9 for CUDA as secondary compiler on Linux Arch. Compiled as a package with `makepkg -sri`. Edited version of AUR package `gcc49`
# $Id$
# Maintainer: Matteo Ragni <[email protected]>
# Contributor: Matteo Ragni <[email protected]>
# Based on the original package by:
# Ruben Van Boxem <[email protected]>
# Allan McRae <[email protected]>
pkgname=('gcc49-cuda')
_pkgver=4.9
@MatteoRagni
MatteoRagni / TelegramNotifier.m
Last active June 9, 2016 10:08
A simple telegram notifier to send a message via bot when a simulation is completed, without the need to load an entire library for telegrams bot.
classdef TelegramNotifier
%TELEGRAMNOTIFIER is an extremely simple class to send a notification
% when a long simulation is ended.
properties
conf_file
config
end
methods
function self = TelegramNotifier(path)
%TELEGRAMNOTIFIER create a new telegram notifier object.
@MatteoRagni
MatteoRagni / ad.h
Last active October 29, 2016 20:35
Automatic Differentiation in C
/* Test for Automatic differentiation in C */
/* MIT License - Ragni Matteo 2016 */
#include <math.h>
typedef double number;
// Math constants
#define AD_PI 3.141592653589793
#define AD_E 2.718281828459045