Skip to content

Instantly share code, notes, and snippets.

View andrioni's full-sized avatar

Alessandro Andrioni andrioni

  • Nubank
  • Berlin, Germany
View GitHub Profile
@andrioni
andrioni / evasao.ipynb
Last active December 28, 2015 14:58
Evasão Unicamp (teste do Gadfly)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrioni
andrioni / mpfr.rs
Last active December 24, 2015 21:48
MPFR bindings for Rust
#![crate_id = "mpfr#0.0.0"]
#![comment = "MPFR bindings for Rust"]
#![license = "MIT"]
#![allow(non_camel_case_types)]
use std::libc::{c_char, c_double, c_int, c_long, c_ulong, c_void, size_t};
use std::num::Float;
use std::intrinsics::uninit;
@andrioni
andrioni / lll.jl
Last active December 16, 2015 22:39
A sample implementation of the LLL algorithm in Julia which outputs δLLL-reduced bases.
function lll(mat::Matrix{Int}, delta=0.75)
matrix = copy(mat)
n = size(matrix,2)
function projection(v, i, Q)
sum([dot(v, Q[:,j])/dot(Q[:,j], Q[:,j]) for j = i:n])
end
while true
# Size reduction
@andrioni
andrioni / complexbench.jl
Last active December 16, 2015 12:48
Small benchmark to compare using MPC and using the julian native complex type with MPFR for the components
function old_complex(n)
a = complex(MPFRFloat(1.1), MPFRFloat(1.1))
sum = complex(MPFRFloat(0))
for i = 1:n
sum += a
end
product = complex(MPFRFloat(1))
for i = 1:n
product *= a
end
@andrioni
andrioni / mysql-bin.000004
Last active October 23, 2015 03:45
binlog
The binlog is below.
@andrioni
andrioni / dominance.py
Created October 7, 2012 04:07
Dominance-based solution concepts
"""
This is a first (and ugly) sketch of an implementation of
dominance-based solution concepts according to [1], with yet
severe limitations (only works for bimatrix games, doesn't really
support a set dominating a strategy), but it does serve as a nice
prototype for future refinements.
[1]: http://dss.in.tum.de/files/brandt-research/dombased.pdf
"""
@andrioni
andrioni / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@andrioni
andrioni / catalogo.json
Created June 28, 2014 23:11
Unicamp - Catálogo dos Cursos de Graduação 2014
This file has been truncated, but you can view the full file.
[
{
"code": "AM016",
"name": "Educação Ambiental",
"prerequisites": [
[
]
],