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
#!/usr/bin/env python3 | |
from itertools import chain | |
from math import atan2, pi as PI | |
from random import choice | |
# A point is (y, x) | |
def angleDiff(t1, t2): | |
if t2 < t1: |
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
sudo nixos-rebuild switch --upgrade --show-trace | |
[sudo] password for reuben: | |
unpacking channels... | |
building Nix... | |
building the system configuration... | |
error: while evaluating the attribute 'config.system.build.toplevel' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:275:5: | |
while evaluating 'foldr' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:52:20, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:139:12: | |
while evaluating 'fold'' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:55:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:59:8: | |
while evaluating the attribute 'assertions' at undefined position: | |
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:84:45, called from undefined position: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Background | |
# This was from a while back when I was playing around with exercises in Nonlinear Dynamics and Choas. | |
# This is an interactive plot that shows the trajectory of a test particle in an electric field | |
# starting from where the cursor is. | |
# Both euler and rk4 integration was implemented | |
from itertools import count, product | |
import numpy as np | |
from numpy.linalg import norm |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
$(shell mkdir -p dist sim syn) | |
SRC= | |
.PRECIOUS: dist/%_syn.v dist/%.blif dist/%.asc dist/%.bin | |
.PHONY: clean upload-% build-% wave-% run-%-sim | |
clean: | |
-rm -rf dist | |
-rm -rf sim |
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
-- Exercise: prove Peirce’s law <=> law of excluded middle in Haskell | |
{-# LANGUAGE Rank2Types #-} | |
import Data.Void | |
type Not a = a -> Void | |
type Peirce = forall a b. ((a -> b) -> a) -> a | |
type LEM = forall a. Either (Not a) a |