This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
pkgs.stdenv.mkDerivation { | |
pname = "inweb"; | |
version = "7.2.0"; | |
srcs = [ ./inweb-7.2.0.tar.gz ./intest-2.1.0.tar.gz ]; | |
setSourceRoot = '' | |
mkdir work | |
mv inweb-7.2.0 ./work/inweb | |
mv intest-2.1.0 ./work/intest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedLists #-} | |
import Data.IntMap ((!?)) -- safe lookup | |
import qualified Data.IntMap as M -- data structure for assignments | |
import qualified Data.Set as S | |
import Control.Applicative | |
import Data.Maybe | |
import Control.Monad (replicateM) | |
newtype E = E Char deriving (Eq,Show,Ord) -- type for individuals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data PropL = PVar String | PNot PropL | PropL `PAnd` PropL | PropL `POr` PropL deriving Eq | |
instance Show PropL where | |
show (PVar s) = s | |
show (PNot p) = "~" ++ show p | |
show (p `PAnd` q) = "(" ++ show p ++ " & " ++ show q ++ ")" | |
show (p `POr` q) = "(" ++ show p ++ " | " ++ show q ++ ")" | |
-- recursive de Morgan's |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TemplateHaskell #-} | |
-- Xp format specification: https://steveasleep.com/rexpaint_manual.html#appendix-b:-.xp-format-specification-(and-import-libraries) | |
module Data.Xp where | |
import Data.Colour.RGBSpace | |
import qualified Codec.Compression.GZip as GZip | |
import qualified Data.ByteString.Lazy as BL | |
import Data.Binary.Get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computeQ :: TileMap -> Transform -> Slope -> Slope -> Int -> Visible () | |
computeQ m t s e y = do | |
let xmin = roundTiesUp (fromIntegral y * s) -- compute the initial x coordinate bounded by the starting slope | |
let xmax = roundTiesDown (fromIntegral y * e) -- compute the ending x coordinate bounded by the ending slope | |
let xys = (coord . (,y)) <$> [xmin..xmax] -- create a list of coordinates to recurse through by pairing xs with the depth | |
-- a helper function to recurse through a list of coordinates, and potentially create branching row computations | |
-- the first argument is a Maybe Bool which tracks whether the previous coordinate was a wall | |
-- Nothing indicates that there was no previous coordinate (we're at the beginning of the list) | |
-- s indicates the starting slope; this can change as the recursion proceeds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# exit as soon as any line in the script fails, print each command that's going to be executed | |
set -ex | |
# wipe disk | |
sgdisk --zap-all ${DISK} | |
# create GPT partition table | |
parted ${DISK} -- mklabel gpt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun patrl/org-latex-special-block (special-block contents info) | |
"Transcode a SPECIAL-BLOCK element from Org to LaTeX. | |
CONTENTS holds the contents of the block. INFO is a plist | |
holding contextual information." | |
(let ((type (org-element-property :type special-block)) | |
(opt (org-export-read-attribute :attr_latex special-block :options)) | |
(caption (org-latex--caption/label-string special-block info)) | |
(caption-above-p (org-latex--caption-above-p special-block info))) | |
(if | |
(equal (format "%s" type) "exe") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\RequirePackage{microtype} | |
\RequirePackage{fontspec} | |
\defaultfontfeatures{Scale=MatchLowercase} | |
\setmainfont[% | |
UprightFeatures={ | |
SizeFeatures={ | |
{Size={-8.4},Font=MinionPro-Capt}, | |
{Size={8.4-13},Font=MinionPro-Regular}, | |
{Size={13-19.9},Font=MinionPro-Subh}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE NoMonomorphismRestriction #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE ParallelListComp #-} | |
{-# LANGUAGE OverloadedLists #-} | |
module Data.Logic.Final where | |
import Control.Applicative ( Applicative(liftA2) ) | |
import Control.Monad ( replicateM ) | |
import Data.Biapplicative ( (<<*>>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
type E = Int | |
type G = [Int] | |
newtype W = W Int deriving (Integral,Real,Enum,Num,Ord,Eq,Show) | |
type T = Bool |
NewerOlder