An experiment in flow visualisation and the mathematical transformation of vector fields. Visual style obviously influenced by the classic http://hint.fm/wind/
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Double stumbling blocks</title> | |
<script src="http://bl.ocks.org/robinhouston/raw/6096562/rAF.js" charset="utf-8"></script> | |
<script src="http://bl.ocks.org/robinhouston/raw/6096562/doyle.js" charset="utf-8"></script> | |
<canvas width=960 height=500></canvas> | |
<script> | |
// Initialisation | |
var canvas = document.getElementsByTagName("canvas")[0], | |
context = canvas.getContext("2d"); |
The velocity at point z in the complex plane is proportional to z^2 - z + c for a constant c.
There is a family of pseudocylindrical equal-area projections that starts with the cylindrical equal area and ends with the sinusoidal, parameterised by t ∈ [0,1].
The formulas are:
x = λ cos^t φ
y = ∫_0^φ cos^(1-t) φ
#!/usr/bin/python | |
# -*- encoding: utf-8 -*- | |
# See http://shadabahmed.com/blog/2013/08/16/bang-bang for context. | |
# A string of single and double quotes may be interpreted as an element | |
# of the symmetric group S3, since there are three quotation states when | |
# lexing a shell command: unquoted, single-quoted, and double-quoted, | |
# and each string permutes the quotation state. A single quote mark | |
# switches between unquoted and single-quoted, and a double quote mark |
/* Solve a variant of the “Question 2” homework exercise from a previous | |
* iteration of the course, proposed by Brian Meyer: | |
* | |
* https://class.coursera.org/crypto-008/forum/thread?thread_id=59#post-445 | |
*/ | |
#include <stdio.h> | |
#include <stdbool.h> | |
#define N 9 |
#!/usr/bin/python2.7 | |
# -*- encoding: utf-8 -*- | |
from __future__ import division | |
import sys | |
P = 0xFFFFFFFFFFFFFFC5 # The largest 64-bit prime | |
def f(n): | |
return (2*n) ^ ((3*n + 7) % P) |
Emacs is a text editor that is installed on most Unix-like computers. It has a long history and a devoted following, and contains unusually many bizarre jokes for a piece of ostensibly serious software.
One of these is the doctor
command, which implements the famous ELIZA algorithm: a primitive but surprisingly convincing simulation of a Rogerian psychotherapist.
Another used to be the yow
command, which would print a quotation from the 70s underground comic strip Zippy the Pinhead. These quotations are typically strange non-sequiturs.
So perhaps it is inevitable that someone had the idea of combining the two, creating the command psychoanalyze-pinhead
, which runs the yow
command and feeds its output to the doctor
command, creating an unending stream of random nonsense alternating with formulaic responses that appear to be taking the nonsense seriously. This is amusing
with n as ( | |
select a.state_name a, b.state_name b | |
from usa_state_shapefile a | |
, usa_state_shapefile b | |
where ST_Dimension(ST_Intersection(a.the_geom, b.the_geom)) > 0 | |
) | |
select w.a w, x.a x, y.a y, z.a z | |
from n w | |
join n x on x.a = w.b | |
join n y on y.a = x.b |
from PIL import Image | |
def splitnum(k, x): | |
parts = [0] * k | |
for n in range(24): | |
parts[n % k] |= ((x >> n) & 1) << (n // k) | |
return tuple(parts) | |
im = Image.new("RGB", (4096, 4096)) | |
pix = im.load() |