Skip to content

Instantly share code, notes, and snippets.

View timm's full-sized avatar

Tim Menzies timm

View GitHub Profile
@timm
timm / pick.lisp
Created August 15, 2011 19:16
LISP: selecting with bias from a set of options
#|
for both proj2 and proj3 you'll have to select "things" weighted by some
bias on how much we like "things" (e.g. stinky roads we do *not* like)
it uses a set of useful techniques that i'll walk us through on thursday
the following code is my generic "pick with bias code". here's the output
of the !pick1 and !pick2 demo. each demo is 10000 picks, biased by
the weights within the bias
CL-USER> (!pick1)
@timm
timm / for.lisp
Created February 25, 2012 04:01
LUA for loops (in LISP)
#|
The LUA programming language supports iterators.
The LUA for loop takes some generate function and asks it to
produce a function that can return the next item.
A loop is then entered. The next item is generated. If it
is non-nil, then the body of the loop is called to consume
that item.
@timm
timm / gist:1906426
Created February 25, 2012 04:19
select with bias
#|
for both proj2 and proj3 you'll have to select "things" weighted by some
bias on how much we like "things" (e.g. stinky roads we do *not* like)
it uses a set of useful techniques that i'll walk us through on thursday
the following code is my generic "pick with bias code". here's the output
of the !pick1 and !pick2 demo. each demo is 10000 picks, biased by
the weights within the bias
CL-USER> (!pick1)
@timm
timm / de.lisp
Created February 26, 2012 05:27
Differential evolution in LISP
#|
############################################
de.lisp: Differential evolution
Tim Menzies, tim@menzies.us, http://menzies.us
(C) 2012 GPL 3.0
To use: (load "de.lisp")
For more on differential evolution,
see http://tinyurl.com/83d9daa
@timm
timm / actory.py
Created April 24, 2012 12:48
ACTORY: a python-based domain-specific language (DSL) for finite-state-machines (FSM)
"""
Actory: a Python-based domain-specific language (DSL) for
specifying finite state machines (FSM).
In these machines, actions change state.
Copyright 2012, Tim Menzies,
Creative Commons Attribution 3.0 Unported License.
Share and enjoy.
:-)
@timm
timm / README.md
Last active March 26, 2024 14:05
Gaussian discretization

saas

asd sad asdasas

@timm
timm / gist:3397513
Created August 19, 2012 20:32
ubuntu 12.04 install tricks
set -x
sudo adduser $USER vboxsf
mkdir -p ~/opt/tmp/backup
mkdir -p ~/opt/bin
mkdir -p ~/tmp
cd $HOME
rm -rf Downloads
@timm
timm / relite.py
Created August 21, 2012 12:52
fun with stochastics: randomized elite sampling
import random
"""
DATA: 0.23 0.52 0.91 1.07 1.19 1.54 1.65 1.67 1.68 1.68 1.74 1.75 1.82 1.95 2.01
2.27 2.28 2.47 2.56 2.76 2.80 2.99 3.08 3.27 3.51 3.56 3.65 3.75 3.92 3.93 3.94
3.9 4.07 4.18 4.23 4.24 4.52 4.54 4.68 4.72 4.78 4.81 4.84 4.87 4.95 4.98 5.23 5.32
5.38 5.64 5.64 5.69 5.69 5.91 5.92 6.21 6.24 6.38 6.38 6.39 6.39 6.39 6.49 6.72 6.73
6.77 6.87 6.98 7.01 7.05 7.09 7.09 7.16 7.16 7.18 7.22 7.32 7.32 7.68 7.72 7.75 7.84
7.94 8.04 8.10 8.18 8.37 8.38 8.46 8.50 8.51 8.65 8.70 8.82 9.04 9.09 9.51 9.64 9.83
9.84
@timm
timm / fib-iterate.lisp
Last active December 11, 2015 01:19
iterative fib
(defun fib (n &aux (a 0) (b 1) tmp)
(dotimes (i n a)
(setf tmp a
a b
b (+ tmp b))))
@timm
timm / a12.lisp
Created May 21, 2013 18:48
Non-parametric hypothesis testing using Vargha and Delaney's A12 statistic.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The A12 non-parametric test
; Tim Menzies, (c) 2013, tim@menzies.us
; (c) http://creativecommons.org/licenses/by/3.0/
;
; The Vargha and Delaney's A12 statistics is a non-parametric effect
; size measure. Reference: + A. Vargha and H. D. Delaney. A critique
; and improvement of the CL common language effect size statistics of
; McGraw and Wong. Journal of Educational and Behavioral Statistics,
; 25(2):101-132, 2000