Skip to content

Instantly share code, notes, and snippets.

View andreabedini's full-sized avatar
☺️

Andrea Bedini andreabedini

☺️
View GitHub Profile
@andreabedini
andreabedini / my_array.hpp
Created May 15, 2012 07:03
my minimal multi array library
// Created by Andrea Bedini on 7/May/2012.
// Copyright 2012 Andrea Bedini.
#ifndef MY_ARRAY_HPP
#define MY_ARRAY_HPP
#include <algorithm>
#include <vector>
template<typename ValueType, size_t D>
class my_array {
#
# put this into your ~/.ssh/config
Host *.domain !gateway.domain
ProxyCommand ssh -q gateway.domain nc %h 22
@andreabedini
andreabedini / gist:6419975
Created September 3, 2013 05:23
warnings I get compiling hdf5-1.8.11/src/H5detect.c with gcc-4.8.0
Script started on Tue 03 Sep 2013 14:49:11 EST
CC H5detect-H5detect.o
../../src/H5detect.c:115:19: warning: size of ‘d_g’ is 12800 bytes [-Wlarger-than=]
static detected_t d_g[MAXDETECT];
^
In file included from ../../src/H5detect.c:57:0:
../../src/H5detect.c: In function ‘find_bias’:
../../src/H5private.h:309:38: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
^
Script started on Fri Oct 18 12:47:49 2013
Cythonizing sources
scipy/cluster/_vq_rewrite.pyx has not changed
scipy/interpolate/interpnd.pyx has not changed
scipy/io/matlab/mio5_utils.pyx has not changed
scipy/io/matlab/mio_utils.pyx has not changed
scipy/io/matlab/streams.pyx has not changed
scipy/ndimage/src/_ni_label.pyx has not changed
scipy/signal/_spectral.pyx has not changed
scipy/sparse/csgraph/_min_spanning_tree.pyx has not changed
@andreabedini
andreabedini / build-log
Created October 24, 2013 00:36
PyTables master (at c30c6f4) failures
Script started on Thu Oct 24 11:10:06 2013
Obtaining file:///Users/andreabedini/Development/py27-numpy-1.8.x/PyTables
Running setup.py egg_info for package from file:///Users/andreabedini/Development/py27-numpy-1.8.x/PyTables
/var/folders/hb/qzq08w3d7k7cdgw0j6zntxgr0000gn/T/lzo_version_date6UwwEL.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
/var/folders/hb/qzq08w3d7k7cdgw0j6zntxgr0000gn/T/lzo_version_date6UwwEL.c:2:5: warning: implicit declaration of function 'lzo_version_date' is invalid in C99 [-Wimplicit-function-declaration]
lzo_version_date();
^
2 warnings generated.
@andreabedini
andreabedini / test-log-numpy17
Created October 24, 2013 00:55
PyTables master (at c30c6f4) failures
Script started on Thu Oct 24 11:45:28 2013
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PyTables version: 3.1.0dev
HDF5 version: 1.8.11
NumPy version: 1.7.1
Numexpr version: 2.2.2 (not using Intel's VML/MKL)
Zlib version: 1.2.5 (in Python interpreter)
BZIP2 version: 1.0.6 (6-Sept-2010)
Blosc version: 1.2.3 (2013-05-17)
Cython version: 0.19.2
Script started on Thu Oct 24 13:03:14 2013
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
PyTables version: 3.1.0dev
HDF5 version: 1.8.12-pre1
NumPy version: 1.7.1
Numexpr version: 2.2.2 (not using Intel's VML/MKL)
Zlib version: 1.2.5 (in Python interpreter)
BZIP2 version: 1.0.6 (6-Sept-2010)
Blosc version: 1.2.3 (2013-05-17)
Cython version: 0.19.2
@andreabedini
andreabedini / gist:acc3c9c18eb148533273
Created June 20, 2014 08:25
Mathematica snippet to mass-export to pdf all notebooks in a directory.
myPrintNotebook[filename_String] := Block[{nbo, pdfnamne},
nbo = NotebookOpen[ToFileName[Directory[], filename],
Visible -> False];
FrontEndExecute[FrontEndToken[nbo, "SelectAll"]];
FrontEndTokenExecute[nbo, "SelectionOpenAllGroups"];
pdfname = StringReplace[filename, ".nb" -> "_nb.pdf"];
Export[pdfname, nbo, "PDF"];
Print["saving to ", pdfname];
NotebookClose[nbo];
]
@andreabedini
andreabedini / keybase.md
Created February 25, 2015 22:53
keybase.md

Keybase proof

I hereby claim:

  • I am andreabedini on github.
  • I am andreabedini (https://keybase.io/andreabedini) on keybase.
  • I have a public key whose fingerprint is 17D5 FB49 FA18 A068 CF53 C5C2 9503 64C1 B2D5 9591

To claim this, I am signing this object:

import System.Random
import Control.Monad.Random
import qualified Data.Map.Lazy as Map
import Data.Map.Lazy (Map)
import Data.Maybe
import Data.Traversable as T
-- for the moment consider this a constant
max_speed = 2