Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View facundoq's full-sized avatar

Facundo Quiroga facundoq

View GitHub Profile
@facundoq
facundoq / mandelbrot-julia-fractal-js
Created August 14, 2013 00:29
Draw fractals based on Mandelbrot and Julia sets in Javascript. Could use some cleanup. Change line 149 by calling other functions to change the fractal drawn.
<!DOCTYPE html>
<html>
<head>
<title>Mandelbrot</title>
<style>
html, body { width: 100%; height: 100%; margin: 0; padding: 0}
#leap-overlay { position: fixed; top: 0; left: 0;}
</style>
</head>
@facundoq
facundoq / poligon_from_set_of_points
Created August 3, 2015 00:33
Order set of 2d points to convert to a poligon
function [poligon,indices]=poligon_from_set_of_points(points,max_distance)
%
% Note that a subset of the points may be selected if the distance between
% two points exceeds max_distance
dist = pdist2(points,points);
N = size(points,1);
indices = NaN(1,N);
indices(1) = 1; % first point is first row in x matrix
@facundoq
facundoq / mnist-lenet-without-fit.jl
Last active April 19, 2017 14:46
Training a lenet on mnist using MXNet.jl, without using the `fit` function
using MXNet
function accuracy(predicted_probability::mx.NDArray,label::mx.NDArray)
predicted_label=copy(mx.argmax(predicted_probability,axis=1))
julia_label=copy(label)
result=sum(predicted_label.==julia_label)
result
end
@facundoq
facundoq / synthetic2d_dataset.py
Created April 20, 2018 18:24
Create synthetic 2D dataset with gaussian centers to test clustering algorithms
import numpy as np
import matplotlib.pyplot as plt
n=200 # samples per center
centers= [ [10,5], [-2,4], [13,-25], [11,20], [15,-30], [3,-2], ] # centers
#centers= [ [10,5], [-2,4], [11,20], [15,-34], ]
dataset=np.zeros((0,3))
sigma=2
for i in range(len(centers)):
@facundoq
facundoq / video_from_image.py
Created April 16, 2020 16:45
Generate a video by applying affine transformations to an image
# IMPORTANT install packages from command line
# pip install numpy scikit-video scikit-image
import skvideo.io
import numpy as np
from skimage import transform
import skimage.io
import os
# read original image
@facundoq
facundoq / greekLettersXmodmap
Created August 12, 2020 15:30
Xmodmap definitions for greek letters when typing AltGr+<letter>. Not all greek letters included. Can add more by getting letter names from https://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt
keycode 26 = e E e E Greek_epsilon Greek_EPSILON Greek_epsilon Greek_EPSILON
keycode 27 = r R r R Greek_rho Greek_RHO Greek_rho Greek_RHO
keycode 28 = t T t T Greek_theta Greek_THETA Greek_theta Greek_THETA
keycode 33 = p P p P Greek_pi Greek_PI Greek_pi Greek_PI
keycode 38 = a A a A Greek_alpha Greek_ALPHA Greek_alpha Greek_ALPHA
keycode 39 = s S s S Greek_sigma Greek_SIGMA Greek_sigma Greek_SIGMA
keycode 40 = d D d D Greek_delta Greek_DELTA Greek_delta Greek_DELTA
keycode 41 = f F f F Greek_phi Greek_PHI Greek_phi Greek_PHI
keycode 42 = g G g G Greek_gamma Greek_GAMMA Greek_gamma Greek_GAMMA
keycode 56 = b B b B Greek_beta Greek_BETA Greek_beta Greek_BETA