Skip to content

Instantly share code, notes, and snippets.

View dorchard's full-sized avatar

Dominic Orchard dorchard

View GitHub Profile
@dorchard
dorchard / scrub.hs
Last active September 17, 2021 10:57
Scrub e-mail addresses from HTML page
module Main where
import System.Environment (getArgs)
import System.Exit (exitFailure)
import Data.List (intercalate)
-- Scrub automata
scrub :: String -> [String]
scrub [] = []
scrub ('m':'a':'i':'l':'t':'o':':':rest) =
@dorchard
dorchard / Empty.agda
Created July 23, 2021 16:13
Some facts about empty types
module Empty where
open import Data.Empty
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary
open import Function.Inverse
-- Empty type has only unequal elements
uneq : (x y : ⊥) -> x ≢ y
uneq () y prf
@dorchard
dorchard / esop-2021-notes.md
Last active April 1, 2021 14:20
ESOP 2021 notes

My (partial and personal) notes from ESOP 2021.

Disclaimer: There may well be errors and omissions here, so please do read the original papers instead of relying on my notes! Apologies to the author's for any misrepresentation. Due to other pressures I am not able to take notes on all the talks, and some notes are partial.

Session 1 - Probabilistic Programming and Verification (Chaired by Sam Staton)

Automated Termination Analysis of Polynomial Probabilistic Programs - Marcel Moosbrugger et al.

@dorchard
dorchard / happy-birthday-hanne-and-flemming.rb
Last active February 17, 2021 17:01
Sonic Pi Happy Birthday for Nielsons' Festschrift 2016
# Sonic Pi code used in the intro of my talk on
# "Effect Systems Revisited — Control-Flow Algebra and Semantics" (Mycroft, Orchard, Petricek)
# https://kar.kent.ac.uk/61623/1/effects-revisited.pdf
# for Hanne and Flemming Nielson's Festschrift, January 2016.
# Not the prettiest or most modern SonicPi code!
use_transpose(6)
use_bpm(146)
use_synth :piano
@dorchard
dorchard / OrdersAndEquivClasses.agda
Last active January 30, 2020 09:24
The quotient set of a preorder is a partial order (proof - wip)
module OrdersAndEquivClasses where
open import Level
open import Data.Product
-- X is the base
-- S is a set of things drawn from X
record PreOrder {l l' : Level} {X : Set l} {S : X -> Set l'} : Set (Level.suc l ⊔ l') where
field
_<_ : Σ X S -> Σ X S -> Set l
@dorchard
dorchard / newpaper
Created September 7, 2019 14:50
newpaper - A script that generate a fresh paper stub
#!/bin/bash
cp ~/template.tex paper.tex
@dorchard
dorchard / aide-memoire.tex
Created September 13, 2018 09:32
LaTeX for creating the 'aide-memoire' page at the back of my lecture notes. To help students with their learning.
\documentclass[a4paper]{article}
\usepackage[table,x11names]{xcolor}
\usepackage{afterpage}
\usepackage{colortbl}
\usepackage{forloop}
\usepackage{geometry}
\begin{document}
@dorchard
dorchard / ott-advice.md
Last active March 26, 2025 09:32
Dealing with Ott "! LaTeX Error: Too many math alphabets used in version normal."

Whilst using the Ott tool for defining programming languages and semantics (http://www.cl.cam.ac.uk/~pes20/ott/) I have noticed that I sometimes get the following error when compiling its generated LaTeX:

  ! LaTeX Error: Too many math alphabets used in version normal.

This is a difficult to track down error (but also mildly amusing)! Here are the solutions/reasons I've found so far:

  • Using pdflatex? Try switching to xelatex which can support up 256 math fonts.
@dorchard
dorchard / advice.md
Last active February 3, 2026 13:56
Some exam advice for students.

(by Dominic Orchard, School of Computing, University of Kent, 2018)

Disclaimer: this advice is non exhaustive, and every piece of advice might not suit you. At least, I hope it helps you to think about how you can develop your own strategy for exam preparation.

My top tip is to see exams as formative rather than purely about assessment. This is an opportunity to force yourself to learn a topic deeply, which will then benefit you in the future, rather than a box ticking exercise to get a fancy piece of paper at the end. This will orient your attitude to maximising your potential.

Exams are hard. They occupy a short space of time in your whole life but they can have a big impact on the rest of it, so make the most of them. Study well and study wisely.

Exam preparation

@dorchard
dorchard / gist:18837114c92a2dd0ab696dae497e85ce
Created March 7, 2018 15:30
Atom snippets for adding infinity alias in Granule
'.source.idris':
'∞':
'prefix': 'Inf'
'body': '∞'
'.source.haskell':
'∞':
'prefix': 'Inf'
'body': '∞'