Skip to content

Instantly share code, notes, and snippets.

View jisantuc's full-sized avatar

James Santucci jisantuc

View GitHub Profile
module Main where
newtype Foo = Foo { module :: String }
-- fine but the syntax highlighter hates it
foo :: Foo
foo = Foo { module: "hi" }
-- also fine but the syntax highlighter hates it
getModule :: Foo -> String
@jisantuc
jisantuc / laws-based-testing.md
Created January 16, 2020 02:21
patat presentation on laws-based testing
title author patat
Laws-based Testing
James Santucci
wrap margins
true
left right
40
40
{
"id": "testexperiment",
"evalUri": "/tmp/eval/testexperiment",
"trainUri": "/tmp/train/testexperiment",
"predictUri": "/tmp/predict/testexperiment",
"chipUri": "/tmp/chip/testexperiment",
"task": {
"taskType": "OBJECT_DETECTION",
"predictBatchSize": 10,
"objectDetectionConfig": {
nix-env -i hello
nix-env --uninstall hello
# sandboxing
nix-shell -p hello
# time traveling
nix-env --list-generations
nix-env --switch-generation 1
;;; packages.el --- scala-metals layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: James <james@shenzhen.internal.azavea.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
  • goal: pluggability, so that if someone wants to write the akka-http routes, it's easy for them

  • other question: what's the abstraction? Like -- Meta, or En/Decoder, or...

  • Define Tile Fetching Interface

    • based on layer id
    • something that produces a (Int, Int, Int) => Tile
    • also like Extent => Tile, Extent => Geotiff
    • like TileResolver in existing tile server
  • Cacheing interface -- mostly done, failing tests

;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
module FiveMinuteFP where
data Option a = Nope | Yup a deriving (Eq, Show)
-- try to make a number odd by adding 1 to it
oddify1 :: Int -> Option Int
oddify1 x =
case (x `mod` 2) of
0 -> Yup (x + 1)
_ -> Nope

Chapter 29 - IO

tl;dr: IO doesn't do anything, it's just a way of describing getting a value from somewhere

  • we should be proud
  • some examples of effects:
    • printing st stdout (putStrLn)
  • reading from stdin (getChar)
"""
The goal of this software is to run a simulation of a model presented by
Moon Duchin in the math session at the Austin regional site for the Metric
Geometry and Gerrymandering Group
In broad strokes, it takes an input shape of some sort and splits it
in four at some point in the polygon (don't talk to me about points out
of the polygon, you degenerate). It assumes that the polygon has some proportion
of one delegate's worth of population, and that the shapes resulting from the split