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
;; Closed-over macro demo | |
;; | |
;; To answer a question, yes, you can close over macro definitions. | |
;; There's lots of ways to do that! | |
;; | |
;; The key is to remember that macros are "code-rewriting" functions. | |
;; When code is compiled, each time the macro is used, the macro | |
;; definition runs. Whatever it returns is what gets compiled. | |
;; Here's some examples. |
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
// Useful link: | |
// http://www.personal.kent.edu/~sbirch/Music_Production/MP-II/MIDI/an_introduction_to_midi_contents.htm | |
#include <assert.h> | |
#include <err.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
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 python3 | |
import base64 | |
import gzip | |
import math | |
import random | |
import sys | |
import time | |
# This requires Pillow, a fork of PIL. Please uninstall PIL if you have |
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 debian:stretch-slim | |
RUN apt-get update && apt-get install -y texlive-binaries build-essential | |
# Note that ADD will automatically extract tarballs. | |
ADD cwebbin-22p.tar.gz /tmp/ | |
ADD cweb-3.64c.tar.gz /tmp/cwebbin-cwebbin-22p/ | |
ADD cwebbin.diff /tmp/cwebbin-cwebbin-22p/ | |
WORKDIR /tmp/cwebbin-cwebbin-22p/ | |
RUN patch -p1 < cwebbin.diff |
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
/* HTTP GET Example using plain POSIX sockets | |
This example code is in the Public Domain (or CC0 licensed, at your option.) | |
Unless required by applicable law or agreed to in writing, this | |
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | |
CONDITIONS OF ANY KIND, either express or implied. | |
*/ | |
#include <string.h> | |
#include "freertos/FreeRTOS.h" |
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
// Today I learned that if you are sloppy with your parts bin | |
// organization, and mean to grab a piezo speaker and instead grab a | |
// piezo buzzer with a built-in oscillator, you get an interesting | |
// spectrum from a frequency sweep. The sum-and-difference signals | |
// and their harmonics make neat patterns in a spectrogram! | |
// | |
// This originally was supposed to use a piezo speaker, so the | |
// amplifier below is based around that. However, I grabbed the wrong | |
// part; I grabbed a buzzer with an internal 2 kHz oscillator, similar | |
// to Adafruit's part 1536. (1536 is 5v tolerant, but I meant to grab |
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
#! ./venv/bin/python3 | |
# Q to quit | |
# R to randomize | |
# S to make a simple initial state | |
# + or - to change rule number by 1 (watch the title bar) | |
# Digits to enter the rule number; you may need to prefix it with some 0s. | |
# Space to pause / resume | |
import random |
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
//--------------------- .text._Z4testmmPm -------------------------- | |
.section .text._Z4testmmPm,"ax",@progbits | |
.sectioninfo @"SHI_REGISTERS=14" | |
.align 64 | |
.global _Z4testmmPm | |
.type _Z4testmmPm,@function | |
.size _Z4testmmPm,(.L_28 - _Z4testmmPm) | |
.other _Z4testmmPm,@"STO_CUDA_ENTRY STV_DEFAULT" | |
_Z4testmmPm: | |
.text._Z4testmmPm: |