View TeX.inputplugin
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
# | |
METHOD: TABLE | |
ENCODE: Unicode | |
PROMPT: TeX 1.1 | |
VERSION: 1.1 | |
DELIMITER: , | |
MAXCODE: 6 | |
VALIDINPUTKEY: ^,.?!:;"'/\()[]{}<>$%&@*01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz | |
TERMINPUTKEY: | |
BEGINCHARACTER |
View main.cpp
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
#include <cmath> | |
#include <iostream> | |
#include <numeric> | |
#include <valarray> | |
#include <vector> | |
// Motivated by | |
// Computing the Minimum-Phase filter using the QL-Factorization | |
// Hansen, Morten; Christensen, Lars P.b.; Winther, Ole | |
// https://backend.orbit.dtu.dk/ws/portalfiles/portal/5161145/Hansen.pdf |
View infill.glsl
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
// See https://www.cs.cmu.edu/~kmcrane/Projects/MonteCarloGeometryProcessing/ | |
// Random numbers using code at | |
// https://stackoverflow.com/a/17479300 | |
// A single iteration of Bob Jenkins' One-At-A-Time hashing algorithm. | |
uint hash( uint x ) { | |
x += ( x << 10u ); | |
x ^= ( x >> 6u ); | |
x += ( x << 3u ); |
View init.m
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
(** User Mathematica initialization file **) | |
(** See https://reference.wolfram.com/language/tutorial/ConfigurationFiles.html for info on instaling this file **) | |
(** Display graphics inline in iTerm2. I don't know an easy way to test if we're running in iTerm2 without looking at the process table. **) | |
imgcat[image_Graphics]:=( | |
WriteString[$Output, "\033]1337;File=inline=1:"<>ExportString[ExportString[image,"PNG"],"Base64"]<>"\007"]; | |
Null | |
) |
View coupling.c
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <time.h> | |
int bernoulli(float p, float r) | |
{ | |
return r > 1 - p; | |
} |
View branch.py
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
import math | |
import numpy as np | |
import random | |
import matplotlib.pyplot as plt | |
medium_size = 1024 | |
x = np.linspace(-1., 1., medium_size) | |
y = np.linspace(-1., 1., medium_size) | |
x, y = np.meshgrid(x, y, indexing='ij') |
View example.cpp
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
// Some platforms import from experimental/coroutine | |
// rather than coroutine. | |
#define REQUIRES_EXPERIMENTAL 1 | |
// Controls whether the coroutine starts in a suspended state | |
// or runs to the first suspension point on construction. | |
// The two implementations should match. | |
#ifndef INITIAL_RUN | |
#define INITIAL_RUN 1 | |
#endif |
View schedule.py
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
# From https://www.python-mip.com/ | |
from mip import * | |
m = Model(sense = MAXIMIZE) | |
num_slots = 10 | |
num_workers = 5 | |
num_tasks = 3 | |
def slot_to_time(slot): |
View main.lhs
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
Here's a block of code in some imaginary assembly language: | |
jmp A | |
block1 | |
jmp A | |
block2 | |
jmp A | |
block3 | |
.A ... |
View benford.py
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
import csv | |
import math | |
import matplotlib.pyplot as plt | |
import locale | |
def frac(x): | |
return x - math.floor(x) | |
def first_digit(x): | |
return int(math.floor(math.pow(10, frac(math.log10(x))) + 0.0001)) |
NewerOlder