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
<html> | |
<title> Equation Mixer </title> | |
<body> | |
<canvas id="grid" width="600" height="600"> </canvas> <br/> | |
x(t): <input id="func_x" type="text" value="Math.sin(t)"> </input> | |
y(t): <input id="func_y" type="text" value="Math.cos(t)"> </input> <br/> | |
X Min: <input id="xmin" type="text" value="-1"> </input> | |
X Max: <input id="xmax" type="text" value="1"> </input> <br/> |
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 small meta-object protocol for describing a Python-like class system in | |
* Javascript. | |
* | |
* In this MOP, objects are (at bottom) represented as a mapping of three things: | |
* | |
* - a list of parent classes | |
* - a list representing the object's MRO | |
* - a mapping of attribute names to attributes | |
* |
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
/** | |
* An implementation of an API similar to ncurses, but which instead runs on | |
* HTMl5 canvas. | |
* | |
* Specifically, this is designed to duplicate the following elements of ncurses: | |
* | |
* - Basic text printing | |
* - Colors | |
* - Handling window hierarchies, which respect their parents bounds (so that | |
* drawing doesn't occur outside of a window's boundaries). They have their own |
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
""" | |
Inserts C code directly into Python files, which can then be dynamically linked | |
in and called via ctypes. | |
""" | |
import atexit | |
import ctypes | |
import os | |
import shlex | |
import sys | |
import tempfile |
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
# This is free and unencumbered software released into the public domain. | |
# | |
# Anyone is free to copy, modify, publish, use, compile, sell, or | |
# distribute this software, either in source code form or as a compiled | |
# binary, for any purpose, commercial or non-commercial, and by any | |
# means. | |
# | |
# In jurisdictions that recognize copyright laws, the author or authors | |
# of this software dedicate any and all copyright interest in the | |
# software to the public domain. We make this dedication for the benefit |
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
""" | |
Converts a tree of wiki pages into a tree of HTML pages. | |
""" | |
from collections import defaultdict | |
import configparser | |
import glob | |
import itertools | |
import os, os.path | |
import re | |
import shutil |
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
""" | |
This implements a fairly simple expression language via a Pratt-style parser. | |
The language supports fairly standard floating point literals, such as: | |
5 | |
1.09 | |
.16 | |
12e7 |
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 | |
set -u | |
USAGE='Usage: usm COMMAND ... | |
usm help | |
usm init | |
usm copy-script | |
usm add SOFTWARE VERSION | |
usm set-current SOFTWARE VERSION |
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
<canvas id="canvas" width="600" height="600"> | |
</canvas> </br> | |
Method: <input id="algorithm" type="text"> </input> <br/> | |
Timestep (Hz): <input id="timestep" type="text"> </input> <br/> | |
<input id="start_stop" type="button" value="Start" onclick="run()"> </input> <br/> | |
<script> | |
//////////////////// | |
var PERSON_RADIUS = 1; | |
var PERSON_SPEED = 5; |
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
// FizzBuzz in x86 assembly - written on 32-bit Linux using the GNU ASsembler | |
.data | |
FIZZSTR: | |
.asciz "Fizz" | |
BUZZSTR: | |
.asciz "Buzz" | |
NEWLINE: | |
.asciz "\n" | |
// strtoa stores its data here. Since FizzBuzz runs 1-100, it won't need more than 3 bytes |