Skip to content

Instantly share code, notes, and snippets.

View avesus's full-sized avatar
🎯
Focusing

Brian Greenforest avesus

🎯
Focusing
View GitHub Profile
@avesus
avesus / convert.sh
Created August 23, 2016 17:25
Convert png to pdf
sudo apt-get install imagemagick
# To rename files with spaces:
find -name "* *" -type f | rename 's/ /_/g'
ls page*.png | sort -n | tr '\n' ' ' | sed 's/$/\ mydoc.pdf/' | xargs convert
@avesus
avesus / fold.ml
Created October 15, 2020 16:31 — forked from keleshev/fold.ml
let (=>) left right = print_char (if left = right then '.' else 'F')
open Printf
let id x = x
let const x = fun _ -> x
let sum = List.fold_left (+) 0
let (>>) f g x = g (f x)
let () =
@avesus
avesus / levmarq.c
Created July 10, 2023 16:33 — forked from maasencioh/levmarq.c
A simple implementation of the Levenberg-Marquardt algorithm in plain C
/*
* levmarq.c
*
* This file contains an implementation of the Levenberg-Marquardt algorithm
* for solving least-squares problems, together with some supporting routines
* for Cholesky decomposition and inversion. No attempt has been made at
* optimization. In particular, memory use in the matrix routines could be
* cut in half with a little effort (and some loss of clarity).
*
* It is assumed that the compiler supports variable-length arrays as