This file contains hidden or 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
indianRed | |
lightCoral | |
salmon | |
darkSalmon | |
lightSalmon | |
crimson | |
red | |
fireBrick | |
darkRed | |
pink |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# Arithmetic coding compressor and decompressor for binary strings. | |
# via: http://www.inference.org.uk/mackay/python/compress/ac/ac_encode.py | |
# main page: http://www.inference.org.uk/mackay/python/compress/ | |
# this has been cleaned up (passes pycodestyle) and ported to python 3. | |
# default prior distribution | |
BETA0 = 1 | |
BETA1 = 1 | |
M = 30 |
This file contains hidden or 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
// arbitrary terminology i made up on the spot: | |
// "entry" = code as exposed to user, in ASCII. | |
// "code" = code as indices into lut, used internally. | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef uint32_t u32; |
This file contains hidden or 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 | |
# set this as needed! | |
rom="Legend of Zelda, The - Ocarina of Time (U) (V1.0) [!].z64" | |
output="reconstructed.z64" | |
gcc_flags="-std=gnu11 -Wall -O3 -s" |
This file contains hidden or 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 autograd.numpy as np | |
import autograd.numpy.random as npr | |
from autograd.misc.flatten import flatten | |
from autograd.misc.optimizers import unflatten_optimizer | |
import itertools, types | |
def iterize(iterable): | |
if type(iterable) in (tuple, list): | |
iterator = iter(iterable) | |
elif np.isscalar(iterable): |
This file contains hidden or 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 Huffman coding implementation | |
# Distributions are represented as dictionaries of { 'symbol': probability } | |
# Codes are dictionaries too: { 'symbol': 'codeword' } | |
def huffman(p): | |
'''Return a Huffman code for an ensemble with distribution p.''' | |
# Base case of only two symbols, assign 0 or 1 arbitrarily | |
if len(p) == 2: | |
return dict(zip(p.keys(), ['0', '1'])) |
This file contains hidden or 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
-- This is free and unencumbered software released into the public domain. | |
-- For more information, please refer to <http://unlicense.org/> | |
local charset = ("\ | |
\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼\ | |
►◄↕‼¶§▬↨↑↓→←∟↔▲▼\ | |
!\"#$%&'()*+,-./\ | |
0123456789:;<=>?\ | |
@ABCDEFGHIJKLMNO\ | |
PQRSTUVWXYZ[\\]^_\ |
This file contains hidden or 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
/* Clocks (v1) | |
* Portable Snippets - https://github.com/nemequ/portable-snippets | |
* Created by Evan Nemerson <[email protected]> | |
* | |
* To the extent possible under law, the authors have waived all | |
* copyright and related or neighboring rights to this code. For | |
* details, see the Creative Commons Zero 1.0 Universal license at | |
* https://creativecommons.org/publicdomain/zero/1.0/ | |
* | |
* Modified by Connor Olding, 2017 |
This file contains hidden or 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
int validate(const char *key) { | |
int magic = 3; | |
int count = 0; | |
for (char c; (c = *key); key++) { | |
if (c < '0' || c > '9') continue; | |
int v = c - '0'; | |
if (++count == 13) { | |
// final character. | |
return magic % 10 == v; | |
} else { |