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
// Example usage: | |
// let bsix = b0(b1(b1(bend()))) | |
// let nseven = add1(add1(add1(add1(add1(add1(add1(zero()))))))) | |
// let bseven = ntob(nseven) | |
// eval @inspect(bmul(bsix, bseven)) // -> takes 75 steps; doing the same with Nat mul takes 123 steps | |
// Type defitinion | |
type Bin |
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
require "./SymbolMap.i" // Diamond imports don't work | |
// import { List, null } from "./List.i" | |
// import { del, delOut, dup, dupOut } from "./Generic.i" | |
type Edge | |
type Connection | |
node pos( | |
edge: Edge, |
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 bash | |
set -e | |
if [ "$#" -ne 4 ]; then | |
echo "Usage: $0 source-file silencedetect-args speedup-factor output-file" | |
echo " E.g.: $0 file.mkv n=-35dB:d=0.25 2.5 file.mlt" | |
exit 1; | |
fi |
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
# Go to Colemak | |
kwriteconfig6 --file kxkbrc --group Layout --key Model pc104awide | |
kwriteconfig6 --file kxkbrc --group Layout --key LayoutList us,bg | |
kwriteconfig6 --file kxkbrc --group Layout --key Options grp:alt_shift_toggle,grp:win_space_toggle,caps:backspace,lv3:ralt_switch_multikey,compose:menu | |
kwriteconfig6 --file kxkbrc --group Layout --key VariantList cmk_ed_dh,colemak_dh | |
dbus-send --session --type=signal --reply-timeout=100 --dest=org.kde.keyboard /Layouts org.kde.keyboard.reloadConfig | |
# Back to QWERTY |
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/python | |
import sys | |
import argparse | |
import dbus | |
import random | |
import time | |
import signal | |
def seconds(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
# A simple program which shows a procedurally-animated worm that can be moved around by clicking on the screen. | |
# References: https://mcsp.wartburg.edu/zelle/python/graphics/graphics/graphref.html, https://tkdocs.com/shipman/index-2.html | |
from random import random | |
from math import sqrt | |
from graphics import * # https://mcsp.wartburg.edu/zelle/python/graphics.py | |
class FollowerCircle(Circle): | |
""" |
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
#![feature(specialization)] | |
// feature(specialization) is still unstable as per https://github.com/rust-lang/rust/issues/31844>, but min_specialization is not enough for what we want to do, unless we use dyn. | |
struct VecOrBitset<T: MaybeSpecializedOn> { | |
inner: T::VecOrBitsetType | |
} | |
impl<T: MaybeSpecializedOn> VecOrBitset<T> { | |
fn new(x: impl IntoIterator<Item = T>) -> Self { |
OlderNewer