Skip to content

Instantly share code, notes, and snippets.

@lachrimae
lachrimae / ccc.scm
Last active August 5, 2020 04:12
Solution to special count-change challenge
;;;;;;;;;;;;;Code hastily-copy-pasted from SICP
(define (count-change-old amount) (cc-old amount 5))
(define (cc-old amount kinds-of-coins)
(cond ((= amount 0) 1)
((or (< amount 0) (= kinds-of-coins 0)) 0)
(else (+ (cc-old amount
(- kinds-of-coins 1))
(cc-old (- amount
(first-denomination
kinds-of-coins))
@lachrimae
lachrimae / street_grabbing.R
Created July 30, 2019 15:45
Trying to create distance matrices in R for streets.
# this is modified from the following stackexchange script:
# https://gis.stackexchange.com/questions/218072/how-can-i-use-roads-from-osm-data-in-r
# Load libraries
library('osmar')
library('geosphere')
library('mapview')
library('spatstat')
library('maptools')
library('shp2graph')
@lachrimae
lachrimae / dmat
Created June 4, 2019 01:00
Distance matrix causing Eirene and JLD issues
0 8 28 28 28 28 24 24 6 20 20 14 26 14 26 24 18 24 26 14 26 24 18 24 6 24 24 14 20 20 22 24 26 22 24 26 20 20 14 24 26 24 26 18 14 20 22 24 12 12 6 22 20 24 20 20 14 14 20 20 20 22 24 12 12 6 22 20 24 20 20 14 14 20 20 20 20 14 24 22 26 24 22 26 18 14 24 26 24 26 22 22 16 22 16 22 22 16 22 16 8 22 26 22 26
8 0 28 28 28 28 26 26 14 24 24 18 24 6 24 20 14 20 24 6 24 20 14 20 14 26 26 18 24 24 22 20 24 22 20 24 12 12 6 20 20 20 20 14 14 24 22 26 20 20 14 22 24 26 24 26 18 14 24 26 24 22 26 20 20 14 22 24 26 24 26 18 14 24 26 12 12 6 20 22 24 20 22 24 14 14 20 20 20 20 22 22 16 22 16 22 22 16 22 16 8 22 26 22 26
28 28 0 8 28 28 26 14 26 24 18 24 24 24 6 20 20 14 14 26 26 18 24 24 24 6 24 20 14 20 20 22 24 12 12 6 22 20 24 20 20 14 14 20 20 22 24 26 22 24 26 20 20 14 24 26 24 26 18 14 12 12 6 20 22 24 20 22 24 14 14 20 20 20 20 24 22 26 20 20 14 22 24 26 24 26 18 14 24 26 22 16 22 22 22 16 16 22 22 22 26 16 8 22 26
28 28 8 0 28 28 24 6 24 20 14 20 26 26 14 24 24 18 6 24 24 14 20 20 26 14 26 24 18 24 24 22 26 20 20