Skip to content

Instantly share code, notes, and snippets.

View odarbelaeze's full-sized avatar
:shipit:
Studying

Oscar Arbeláez-Echeverri odarbelaeze

:shipit:
Studying
  • NextRoll
  • Dublin, Ireland
View GitHub Profile
# Case 1
val = function(
arga,
argb,
....
)
# Case 2
@odarbelaeze
odarbelaeze / test.py
Last active August 29, 2015 14:04
Test of binary IO using netCDF in python against text IO.
# coding=utf-8
"""
Little example using netfdf-python to store Monte Carlo time-series data.
"""
from netCDF4 import Dataset
from numpy.random import uniform
from numpy.lib.npyio import savetxt
@odarbelaeze
odarbelaeze / rand.cc
Last active March 25, 2021 11:15
Random number generator benchmarks
#include <cstdlib>
#include <iostream>
#include <chrono>
#include <random>
#include<gsl/gsl_rng.h>
class Timer
{
private:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@odarbelaeze
odarbelaeze / Resumen.ipynb
Created March 13, 2017 22:05
Resumen Info III 2017.1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@odarbelaeze
odarbelaeze / Intro TGA.ipynb
Created March 28, 2017 14:45
Intro to TGA for info 3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@odarbelaeze
odarbelaeze / decoradores.py
Created April 8, 2017 14:16
Decoradores y context managers.
import functools
import contextlib
@contextlib.contextmanager
def database():
print("creo una conexion")
db = {}
yield db
print ("cierro la conexion")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@odarbelaeze
odarbelaeze / hanoi.rs
Created May 19, 2017 03:55
A solution to the Hanoi tower problem.
/// One of the posts of the tower of Hanoi
#[derive(Debug, Clone, Copy)]
enum Post {
Left, Middle, Right,
}
/// Helper function to recursively resolve a Tower of Hanoi
fn recursive_hanoi(n: u64, from: Post, to: Post, auxiliar: Post) {
if n > 0 {
recursive_hanoi(n - 1, from, auxiliar, tp);