Skip to content

Instantly share code, notes, and snippets.

@Kevinpgalligan
Kevinpgalligan / application.txt
Created December 28, 2023 23:22
My Recurse Center application!
### Links
Personal site: https://kevingal.com/
GitHub: https://github.com/Kevinpgalligan
### CracklePop
Common Lisp:
https://gist.github.com/Kevinpgalligan/c75b8d48fd616fb9fa8c2f0fc18dd802
### Something I've written myself
A calculator language with a CLI, GUI, unit conversion, functions and other conveniences. It's about 1400 lines of Python code. I now use it for all my day-to-day calculations!
@Kevinpgalligan
Kevinpgalligan / markov.ijs
Created August 28, 2022 14:56
J code for analysing Markov processes.
NB. Functions for analysing Markov processes through
NB. their transition matrices.
NB. Takes transition matrix as x, number of rounds as y.
calcMarkovDistribution =: dyad define
P =. x
n =. # P
matmul =. +/ . *
((] ,. ((P&matmul @: ,. @: ({:"1))) ) ^: y) ,. 1 , (n-1)$0
)
(defvar *acceptor*)
(defun start-server (&key (doc-root #P"www/"))
(setf *acceptor*
(make-instance
'hunchentoot:easy-acceptor
:port 4242
:document-root doc-root
:error-template-directory (merge-pathnames #P"errors/"
doc-root)))
CL-USER> (load "/home/kg/test.lisp")
To load "random-state":
Load 1 ASDF system:
random-state
; Loading "random-state"
Distribution for range 0..1
0 0.500334
1 0.499666
Distribution for range 0..2