Skip to content

Instantly share code, notes, and snippets.

View fatfingererr's full-sized avatar
Crafting fast algorithms

Ruei-Ci Wang fatfingererr

Crafting fast algorithms
View GitHub Profile
@fatfingererr
fatfingererr / chekhov.hy
Created February 18, 2017 08:51 — forked from rcarmo/chekhov.hy
map-reduce in hylang
; Packed shepherd together with mincemeat for convenience
(import [mincemeat.shepherd [run_server]])
; chunker is temporarily broken
;(defn chunker [gen size]
; (let [[gen (iter gen)]
; [chunk []]
; (try
; (while True
; (for [_ (xrange size)]
@fatfingererr
fatfingererr / matlab-octave.m
Created January 19, 2017 04:46 — forked from gramian/matlab-octave.m
Octave and Matlab Snippets
%% Math %%
si = @(x) sin(x)./x; % cardinal sine without pi multiplied argument
hsin = @(x) 0.5*(1.0 - cos(x)); % haversed sine
hcos = @(x) 0.5*(1.0 + cos(x)); % haversed cosine
sigm = @(x,k) 0.5*tanh(0.5*k*x) + 0.5; % sigmoid function to (exp(-kx)+1)^-1