Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
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
;;; Slime/Swank Setup | |
(defun multiline? (string) | |
"True if the string has multiple lines." | |
(position ?\n string)) | |
(defun multiline-comment (string) | |
"Return string formatted as a multi-line Lisp comment" | |
(concat "#||\n" string "\n||#\n")) |
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
-- discipline + punish | |
-- | |
-- four outputs (subjects) process input 1 through randomized transfer functions (disciplines) | |
-- a trigger in input 2 selects a subject based on a fifth, secret discipline, | |
-- and punishes it, altering its transfer function | |
function rand10vpp() | |
return math.random() * 10 - 5 | |
end |
I have a pet project I work on, every now and then. CNoEvil.
The concept is simple enough.
What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?
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
# If you, like me, have all of your various source-code-like projects in ~/src/ | |
# this is how to give yourself per-project shell history. | |
# | |
# I wish I'd done this years ago. | |
# | |
# First, in your .bashrc file, you redefine the cd, pushd and popd builtins to be "do the builtin bit, | |
# then do one other thing (set_src_history.sh, below) like so: | |
cd () { |
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
#!/bin/bash | |
IN=$1 | |
OUT=$2 | |
true ${SD_PARAMS:="-55dB:d=0.3"}; | |
true ${MIN_FRAGMENT_DURATION:="20"}; | |
export MIN_FRAGMENT_DURATION | |
if [ -z "$OUT" ]; then |
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
#!/bin/sh | |
#|-*- mode:lisp -*-|# | |
#| | |
exec ros -Q -- $0 "$@" | |
|# | |
(progn ;;init forms | |
(ros:ensure-asdf) | |
#+quicklisp (ql:quickload '(:alexandria :trivia :iterate) :silent t)) | |
(defpackage :ros.script.case.3724474528 |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
There are three main concepts with Rust:
- Ownership (only one variable "owns" the data at one time, and the owner is in charge of deallocating)
- Borrowing (you can borrow a reference to an owned variable)
- Lifetimes (all data keeps track of when it will be destroyed)
These are fairly simple concepts, but they are often counter-intuitive to concepts in other languages, so I wanted to give a shot at
NewerOlder