Skip to content

Instantly share code, notes, and snippets.

View jasonreich's full-sized avatar

Jason Reich jasonreich

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jasonreich
jasonreich / Age Disaggregated .ipynb
Last active June 6, 2021 15:50
Age Disaggregated
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jasonreich
jasonreich / Log Cases.ipynb
Last active June 7, 2021 16:41
England and York
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jasonreich
jasonreich / LFD.ipynb
Created April 5, 2021 10:46
Positive LFDs finding positive PCRs in England
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jasonreich
jasonreich / Quasi.hs
Created November 10, 2014 09:45
QuasiQuoting
{-# LANGUAGE TemplateHaskell #-}
{- This works in GHC 7.8.3 -}
import Control.Monad
import Language.Haskell.TH
data DB = DB { couples :: [Couple], people :: [People] }
type Couple = (String, String)
type People = (String, Int)
@jasonreich
jasonreich / .project-settings.yml
Last active December 12, 2015 10:49 — forked from copumpkin/gist:4759099
How to write `zipWith` for the Fold/List datatype.
module-template: ! 'module MODULE_NAME where
'
extensions: {}
environment: null
cabal-file: project.cabal
modules:
Main(gistfile1.hs):
filename: gistfile1.hs
version: 1
@jasonreich
jasonreich / OneDCA.hs
Last active December 12, 2015 07:49
One Dimensional CA
-- Based on http://blog.sigfpe.com/2006/12/evaluating-cellular-automata-is.html
-- But uses the Gloss (http://hackage.haskell.org/package/gloss) library to draw the image.
module OneDCA where
import Data.Bits
import Data.Word
import Graphics.Gloss
-- Universes
@jasonreich
jasonreich / SmallerCheck.hs
Last active October 5, 2015 01:28
SmallerCheck – Example for ES talk
import Control.Parallel.Strategies (using, parBuffer, rseq)
import Data.List (partition)
-- *** Example Haskell functions ***
-- Is a list of integers sorted?
isOrdered :: [Int] -> Bool
isOrdered (x:y:zs) = x <= y && isOrdered (y:zs)
isOrdered _ = True
@jasonreich
jasonreich / Buffer.lhs
Created February 24, 2012 13:44
Buffer with Monoids
Fun with monoids
================
We'll need the monoid library.
> import Data.Monoid
Difference lists
----------------
@jasonreich
jasonreich / puzzle.lhs
Created November 9, 2011 12:44
Memoization of problem
Michaels solution
=================
> a 0 y = 1
> a x 0 = 1
> a x y = a (x-1) y + a x (y-1)
> result = map (\x -> a x x) [0..]
Memoised form