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/awk -f | |
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff | |
# My copy here is written in awk instead of C, has no compelling benefit. | |
# Public domain. @thingskatedid | |
# Run as awk -v x=xyz ... or env variables for stuff? | |
# Assumptions: the data is evenly spaced along the x-axis | |
# TODO: moving average |
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
/* | |
* John Conway's Game of Life. | |
* | |
* This is written for POSIX, using Curses. Resizing of the terminal is not | |
* supported. | |
* | |
* By convention in this program, x is the horizontal coordinate and y is | |
* vertical. There correspond to the width and height respectively. | |
* The current generation number is illustrated when show_generation is set. | |
* |
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 | |
# Dichotomic search in bash | |
# This is a bash-specific function that uses bash features. | |
# This is not guaranteed to work in other shells. | |
# | |
# Usage: | |
# source dichotomic-bash.sh | |
# result=$(dichotomic_search min max command) | |
# | |
# Returns the largest i for which `command i` succeeds (exits with a null exit code) |