Richard W. Hamming
January 1969
One Man's View of Computer Science
Abstract
A number of observations and comments are directed toward suggesting that more than the usual engineering flavor be given to computer science. The engineering
# This file demonstrates how to use midi codes to control the color of the | |
# keypads on a Novation LaunchKey mini; There is no official documentation of | |
# it as far as I can tell | |
# | |
# the LaunchKey MK2 Programmer's guide is useful, though not accurate to | |
# details on the MK3 mini: | |
# https://customer.novationmusic.com/sites/customer/files/novation/downloads/10535/launchkey-mk2-programmers-reference-guide.pdf | |
import random | |
import time |
package main | |
import ( | |
"fmt" | |
"html/template" | |
"log" | |
"net/http" | |
"os" | |
) |
package main | |
// An extremely simple web application skeleton | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
) |
Richard W. Hamming
January 1969
A number of observations and comments are directed toward suggesting that more than the usual engineering flavor be given to computer science. The engineering
#!/usr/bin/env bash | |
# assume that if an `nb` dir (presumably a virtualenv) exists, then we don't | |
# need to do any of the time-consuming stuff | |
if [ ! -d nb ]; then | |
python -mvenv nb | |
# # ipykernel is required for bash_kernel \ | |
nb/bin/pip install \ | |
bash_kernel \ | |
ipykernel \ |
# make a temporary directory and push it on to the stack | |
tmp=$(mktemp -d); pushd $tmp && \ | |
# get a US map at 20m resolution and unzip it | |
curl -s https://www2.census.gov/geo/tiger/GENZ2018/shp/cb_2018_us_region_20m.zip -o us.zip && \ | |
unzip -q us.zip && \ | |
# rasterize the map's only layer, using the `ALAND` feature. Restrict the | |
# bounding box (-te) to the continental US, because the map includes Alaska | |
# and Hawaii and Guam, and we're not going to bother with those here | |
# (sorry!). -ts sets the output size to 1200x800, then we give the input and | |
# output files. |
#!/usr/bin/env bash | |
# import an MS SQL .bak backup file to an MS SQL database, then export all | |
# tables to csv. run this script as `import.sh <filename>`. It expects to be | |
# run in the same directory as the backup file. | |
# this is only tested on my mac (OS X Catalina). I tried to stick to posix, but | |
# It will probably require some tweaking for you. I hope it gives a general | |
# sense of what you need to do at the very least. |
import pyglet | |
class AWindow(pyglet.window.Window): | |
def __init__(self): | |
super(AWindow, self).__init__(100, 100) | |
self.batch = pyglet.graphics.Batch() | |
self.circle = pyglet.shapes.Circle( |
import pyglet | |
class AWindow(pyglet.window.Window): | |
def __init__(self): | |
super(AWindow, self).__init__(100, 100) | |
self.batch = pyglet.graphics.Batch() | |
self.circle = pyglet.shapes.Circle( |
import pyglet | |
window = pyglet.window.Window() | |
batch = pyglet.graphics.Batch() | |
label = pyglet.text.Label( | |
"Hello, world", | |
font_name="Times New Roman", | |
font_size=36, | |
x=window.width // 2, | |
y=window.height // 2, |