Skip to content

Instantly share code, notes, and snippets.

View johnwickerson's full-sized avatar

John Wickerson johnwickerson

View GitHub Profile
@johnwickerson
johnwickerson / comments.tex
Created March 27, 2024 12:07
Some simple LaTeX macros for commenting on a document
\newif\ifCOMMENTS
\COMMENTStrue
\usepackage{soul}
\ifCOMMENTS
\newcommand{\Comment}[3]{\textcolor{#1}{{\bf [\![#2:}~#3{\bf ]\!]}}}
\else
\newcommand{\Comment}[3]{}
\fi
\newcommand\JW[2][]{{\Comment{red!75!black}{JW}{\st{#1} #2}}}
@johnwickerson
johnwickerson / conferences.md
Last active January 17, 2024 16:05
Some conferences
conference most recent submission deadline topic JW ranking
FCCM 16 Jan 2023 FPGA A
ICFP 01 Mar 2023 PL A
FPL 27 Mar 2023 FPGA B
ASPLOS (r1) 13 Apr 2023 Arch A
OOPSLA (r1) 14 Apr 2023 PL A
ICCAD 22 May 2023 EDA A
FMCAD 22 May 2023 formal+EDA A
POPL 11 Jul 2023 PL A

The following makes a nice introductory tutorial for first-year EIE students.

Suppose we are given four infinite piles of dominoes:

    b       abc       ca       a
1: ---   2: ---   3: ---   4: ---
    ca       c        a        ab

Each has a sequence of letters on the top and a sequence of letters on the bottom. You can take dominoes from these piles and make a chain, like:

@johnwickerson
johnwickerson / mailmerge.scpt
Last active December 8, 2023 22:19
Mail-merge from a CSV file using Apple Mail
-- Mail-merge script
-- Assembled by John Wickerson (using various parts pasted from the internet, credited individually below) in April 2021.
-- Instructions:
---- 1. Select a message in Mail (probably one that has been saved as a Draft) and then run this script.
---- 2. The script will ask you for a CSV file containing the data to be mail-merged. The first column of this CSV file must be named "email".
---- 3. The script will substitute $FOO in the contents of the message with the contents of column FOO in the CSV file.
---- 4. Any to/cc/bcc recipients in the original message will be preserved.
---- 5. Unfortunately, any attachments in the original message are not preserved, but if you want an attachment, you can add it
---- using this script by uncommenting one of the lines below.
// Convert a tree into a dag
// Author: John Wickerson
//
// Instructions:
// gcc dagify.c
// ./a.out
#include <stdlib.h> // for NULL
#include <stdio.h> // for printf
@johnwickerson
johnwickerson / typechecker.pl
Created January 28, 2020 10:26
A type-inference engine for a simple programming language
% A type-inference engine for a simple programming language
% John Wickerson, January 2020
% Install Prolog using `brew install swi-prolog` (Mac)
% Run using `swipl typechecker.pl`
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 1. The language we want to type %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Types, T ::= int | bool | T → T
@johnwickerson
johnwickerson / scatterplots.tex
Last active October 28, 2019 16:52
LaTeX code for creating some scatter plots and bar charts using pgfplots
\documentclass[margin=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\usetikzlibrary{calc}
\usepackage{filecontents}
\begin{filecontents}{foo.dat}
theirs ours1 ours2 label
@johnwickerson
johnwickerson / parallelogram.tex
Created February 16, 2019 21:02
Area of a parallelogram
% convert -delay 200 -loop 0 -dispose previous -density 300 parallelogram.pdf parallelogram.gif
\documentclass[border=5pt,tikz]{standalone}
\usetikzlibrary{intersections, calc, through}
\usepackage{pagecolor}
\begin{document}