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/python3 | |
| from sys import stdin | |
| import argparse | |
| """Utility to convert the standard columnar output of | |
| many UNIX commands (ls, ps, who) into a csv format that other | |
| programs can parse. | |
| Reads input on stdin, produces output on stdout. |
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
| (set-bounds! [-14 -10 -10] [14 10 10]) | |
| (set-quality! 8) | |
| (set-resolution! 10) | |
| (define super-egg (lambda-shape (x y z) | |
| (- (sqrt (sqrt (+ (* x x x x) | |
| (* y y y y) | |
| (* z z z z)))) 1))) | |
| (define semi-egg (lambda-shape (x y z) |
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
| #version 100 | |
| #ifdef GL_ES | |
| precision mediump float; | |
| #endif | |
| varying vec2 v_texcoord; | |
| uniform sampler2D tex; | |
| uniform float time; | |
| uniform float width; | |
| uniform float height; |
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
| # run this one *after* running setup_virtual_webcam.sh | |
| # it will require a variety of gstreamer plugins | |
| # it will also take over your main webcam. | |
| # Kill the process(es) this launches to regain control of your main webcam | |
| gst-launch-1.0 --gst-debug -v v4l2src device=/dev/video0 ! video/x-raw,width=640,height=360 ! videoconvert ! video/x-raw,format=RGBA ! glupload ! glshader fragment="\"`cat myshader.frag`\"" ! gldownload ! video/x-raw,width=640,height=360 ! queue ! videoconvert ! video/x-raw,format=I420,framerate=30/1 ! v4l2sink device=/dev/video10 |
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
| Python 3.6.9 (default, Apr 18 2020, 01:56:04) | |
| [GCC 8.4.0] on linux | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> import wave | |
| >>> writer = wave.open("foo.wav", "wb") | |
| >>> writer.setnchannels(2) | |
| >>> from math import sin, cos | |
| >>> writer.setsampwidth(1) | |
| >>> writer.setframerate(44100) | |
| >>> vals_left = [sin(3.0 * sin(3.14159265 * 440 * i / 44100)) for i in range(44100)] |
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
| [Unit] | |
| Description=Dronezone (somafm) music player | |
| Conflicts=sonic-universe.service groove-salad.service silence.service | |
| [Service] | |
| Type=simple | |
| WorkingDirectory=/home/pi | |
| ExecStart=/usr/bin/mplayer http://ice3.somafm.com/dronezone-128-mp3 | |
| KillMode=process | |
| Restart=on-failure |
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
| (ns sound-sample-server (:import | |
| (java.net InetAddress | |
| DatagramPacket | |
| DatagramSocket))) | |
| (use 'overtone.core) | |
| (boot-server) | |
| (defn make-udp-trigger [sound-file port extra-args] | |
| (let [sample-buf (load-sample sound-file) |
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
| (ns sound-sample-server (:import | |
| (java.net InetAddress | |
| DatagramPacket | |
| DatagramSocket))) | |
| (use 'overtone.core) | |
| (boot-server) | |
| (defn make-udp-trigger [sound-file port] | |
| (.start |
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
| (use 'overtone.core) | |
| (boot-server) | |
| (def samp1 (sample "power_melody.wav")) ; see http://alumni.soe.ucsc.edu/~mds/amp_testing/power_melody.wav | |
| ;;; Play the same sample a bunch of times with overlap | |
| (loop [n-remaining 10 delay-to-use 0] | |
| (after-delay delay-to-use samp1) | |
| (if (> n-remaining 0) (recur (- n-remaining 1) (+ delay-to-use 1800)) '())) | |
| ;;; to play the sample once, just enter |
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
| ;;; Every time I read about information theory, gambling, and the optimal | |
| ;;; way to bet on horse races, I am sufficiently surprised by what the math is | |
| ;;; telling me that I develop a desire to run experiments to double-check it | |
| ;;; for myself. | |
| ;;; | |
| ;;; See : http://en.wikipedia.org/wiki/Gambling_and_information_theory | |
| ;;; See : http://en.wikipedia.org/wiki/Kelly_criterion | |
| ;;; | |
| ;;; Note that my notion of "odds" might not exactly match up with the | |
| ;;; conventional notion. Mine are easier to compute with. |