Notes to Self

This page lists information I find interesting, amusing, or useful.
If any of this material strikes other people similarly, that's delightful!

Mathematics

I am a mathematical realist. I might even be a budding mathematical monist (related to my attempt to cash out what it means for a physicalist to call some abstract objects "real"), but I am still allowing that question to ripen.

Peano Axioms

The symbol 0 is adopted as a constant representing the ancestor of all natural numbers, and S is the successor function. In short, 0 denotes 0, S(0) denotes 1, S(S(0)) denotes 2, etc. (Rendered in set-theoretic terms, 0 is represented by the null set, , S(0) becomes the singleton set {∅}, S(S(0)) is the nested set {{∅}}, and so on.)

  • [Existence] The natural number 0 is assumed.
  • [Closed] For every natural number n, S(n) is also a natural number.
  • [Injective] For any natural numbers n and m, m = n iff S(m) = S(n).
  • [Ancestral] For every natural number n, S(n) ≠ 0.
  • 4 [Equality] axioms, now subsumed under first-order logic with equality, also apply:
    • [Reflexive] For every natural number x, x = x.
    • [Symmetrical] For natural numbers x and y, if x = y then y = x.
    • [Transitive] For natural numbers x, y, and z, if x < y and y < z, then x < z.
    • [Closed] For any a and b, if b is a natural number and a = b, then a is a natural number.
  • [Induction (second-order)] If K is a set which contains 0 and for which every natural number n that it contains, K also contains S(n), then K contains every natural number.

Kurt Gödel's second incompleteness theorem proved that these axioms cannot be proven within the system they create, so we just have to take the consistency of N for granted. That is, it cannot be proven mathematically that you can't derive the result "0 = 1" from these axioms.

Arithmetic

To quell any niggling doubts out there...

Fractions
a / (b / c) = (a / b)(c) = ac / b (a / b) / c = a / bc (a / b)(c / d) = ac / bd (a / b) / (c / d) = (a / b)(d / c) = ad / bc (a / b) + (c / d) = (ad + bc) / bd (a + b) / c = (a / c) + (b / c) (a - b) / (c - d) = (b - a) / (d - c) (ab + ac) / a = b + c
Exponents
b^0 = 1 [b ≠ 0] b^(m + n) = b^(m) b^(n) b^(m - n) = b^(m) / b^(n) (bc)^(n) = b^(n) c^(n) (b / c)^(n) = b^(n) / c^(n) (b^(m))^(n) = b^(mn) b^(-n) = 1 / b^(n) b^(m/n) = ^(n){(b^(m))} ^(n){bc} = ^(n){b} ^(n){c} ^(n){b / c} = ^(n){b} / ^(n){c}
Divisibility
0: No 1: Yes 2: If last digit is even (0, 2, 4, 6, 8) 3: If digits' sum is (recursive) 4: If last two digits, halved, remain even 5: If last digit is 0 or 5 6: If divisible by 2 and 3 7: If last three digits minus the previous three digits plus the three digits before those (etc.) is;
 or if the last digit, separated, doubled, and subtracted from the rest is;
 or if the last digit, separated, quintupled, and added to the rest is
8: If last three digits, halved twice, remain even 9: If digits' sum is (recursive) 10: If last digit is 0 11: If the first digit minus the second plus the third (etc.) is;
 or if the sum of each pair of digits (from right to left) is;
 or if the last digit, separated and subtracted from the rest, is
12: If divisible by 3 and 4 13: If sum of the last three digits minus the previous three digits plus the three digits before those (etc.) is;
 or if the last digit, separated, multiplied by 9, and subtracted from the rest is;
 or if the last digit, separated, quadrupled, and added to the rest is

Algebra

This review of algebra brought to you by the inside cover of [my calculus book].

Quadratic Formula
(-b ± {b^2 - 4ac}) / 2a = 0 [(b^2 - 4ac) must be non-negative]
Special Factors
x^2 - a^2 = (x - a)(x + a) x^3 - a^3 = (x - a)(x^2 + ax + a^2) x^3 + a^3 = (x + a)(x^2 - ax + a^2) x^4 - a^4 = (x^2 - a^2)(x^2 + a^2)
Binomial Theorem
(x + y)^2 = x^2 + 2xy + y^2 (x + y)^3 = x^3 + 3x^2y + 3xy^2 + y^3 (x + y)^4 = x^4 + 4x^3y + 6x^2y^2 + 4xy^3 + y^4 (x + y)^(n) = x^(n) + nx^(n-1) + (n(n - 1) / 2!)x^(n-2)y^2 + ... + nxy^(n-1) + y^(n) (x - y)^2 = x^2 - 2xy + y^2 (x - y)^3 = x^3 - 3x^2y + 3xy^2 - y^3 (x - y)^4 = x^4 - 4x^3y + 6x^2y^2 - 4xy^3 + y^4 (x - y)^(n) = x^(n) - nx^(n-1) + (n(n - 1) / 2!)x^(n-2)y^2 - ... ± nxy^(n-1) ∓ y^(n)
Rational Zero Theorem
If the formula: p(x) = a_nx^(n) + a_(n-1)x^(n-1) + ... + a_1x + a_0 [Fix subscripting!] has integer coefficients, then every rational zero of p is of the form: x = r / s [r is a factor of a_0, s is a factor of a_n]
Factoring by Grouping
acx^3 + adx^2 + bcx + bd = ax^2(cx + d) + b(cx + d) = (ax^2 + b)(cx + d)

Geometry

Praise be unto Euclid for his development of constructive proofs.

Euclid's Axioms

Euclid presented these "common notions" in the first book of his Elements.

  1. Things which are equal to the same thing are also equal to each other.
  2. If equals are added to equals, then the wholes are also equal.
  3. If equals are subtracted from equals, then the remainders are also equal.
  4. Things which coincide with each other are equal to each other.
  5. The whole is greater than the part.

Euclid's Postulates

The preceding axioms are then expanded by postulating that the following are also true.

  1. Any two points can be joined by a straight line segment.
  2. Any line segment can be extended without limit.
  3. Any line segment can define a circle centered on one end with a radius equal to the segment.
  4. All right angles are equal.
  5. If a straight line intersects two other straight lines such that the interior angles on one side sum to less than two right angles, the two lines will eventually meet on that side.

The last postulate cannot be proven. ¡Viva non-Euclidean geometries!

Shapes

Triangle
h = a sinTHETA A = bh / 2 c^2 = a^2 + b^2 - 2ab cosTHETA [Law of Cosines]
Right Triangle
c^2 = a^2 + b^2 [Pythagorean Theorem]
Equilateral Triangle
h = {3}s / 2 A = {3}s^2 / 4
Parallelogram
A = bh
Trapezoid
A = (h / 2)(a + b)
Circle
A = PIr^2 C = 2PIr = PID
Sector of Circle
A = THETAr^2 / 2 s = rTHETA
Circular Ring
A = PI(R^2 - r^2) = 2PIpw [p = avg. radius, w = ring width]
Sector of Circular Ring
A = THETApw [p = avg. radius, w = ring width]
Ellipse
A = PIab C ≈ 2PI{(a^2 + b^2) / 2}
Cone
V = Ah / 3 [A = area of base]
Right Circular Cone
V = PIr^2h / 3 Lateral Surface Area = PIr{r^2 + h^2}
Frustum of Right Circular Cone
V = PI(r^2 + rR + R^2)h / 3 Lateral Surface Area = PIs(R + r) [s = length of side]
Right Circular Cylinder
V = PIr^2h Lateral Surface Area = 2PIrh
Sphere
V = 4PIr^3 / 3 Surface Area = 4PIr^2
Wedge
Area of Upper Face = B secTHETA [B = area of base]
Regular Polygon
r = s cot(PI / n) / 2 [r = inscribed radius (apothem), s = side length, n = num sides] R = s csc(PI / n) / 2 [R = circumscribed radius] A = nsr / 2 = ns^2 cot(PI / n) / 4 = nr^2 tan(PI / n) = nR^2 sin(2PI / n) / 2 Interior Angle = ((n - 2) / n)PI
Convex Polygon
A = ((x_1y_2 + x_2y_3 + ... + x_ny_1) - (y_1x_2 + y2_x3 + ... + y_nx_1)) / 2 [the n points must be taken in counterclockwise order]

Analysis

One often finds oneself comparing lines to other lines and to circles when one is me.

Side of Line
s = (x_2 - x_1)(y_3 - y_1) - (y_2 - y_1)(x_3 - x_1) [(x_3,y_3) = external point; if s < 0, left; if s > 0, right; if s = 0, coincident] (If line is vertical, compare x values instead, of course.)
Closest Point on Line
x = x_1 + u(x_2 - x_1) [(x_1,y_1) and (x_2,y_2) give the segment] y = y_1 + u(y_2 - y_1) [(x_3,y_3) is the external point] u = ((x_3 - x_1)(x_2 - x_1) + (y_3 - y_1)(y_2 - y_1)) / ((x_2 - x_1)^2 + (y_2 - y_1)^2) [if u < 0 or u > 1, (x,y) falls outside segment]
2D Segment Intersection
x = x_1 + u_a(x_2 - x_1) = x_3 + u_b(x_4 - x_3) y = y_1 + u_a(y_2 - y_1) = y_3 + u_b(y_4 - y_3) u_a = ((x_4 - x_3)(y_1 - y_3) - (y_4 - y_3)(x_1 - x_3)) / u [if value between 0 & 1, segment contains intersection point] u_b = ((x_2 - x_1)(y_1 - y_3) - (y_2 - y_1)(x_1 - x_3)) / u [if u_a = u_b = 0, lines are coincident] u = (y_4 - y_3)(x_2 - x_1) - (x_4 - x_3)(y_2 - y_1) [if u = 0, lines are parallel]
Line-Circle Intersection
a = (x_2 - x_1)^2 + (y_2 - y_1)^2 [(x_1,y_1) and (x_2,y_2) give the line segment] b = 2((x_2 - x_1)(x_1 - x_3) + (y_2 - y_1)(y_1 - y_3)) [(x_3,y_3) = circle center] c = x_3^2 + y_3^2 + x_1^2 + y_1^2 - 2(x_3x_1 + y_3y_1) - r^2 [r = radius] Plug into quadratic formula for points. If b^2 - 4ac is negative, no intersection; if 0, line is tangent to circle; else it's secant. Bourke's page gives more rules for testing segment collision.

Trigonometry

I find sine & cosine to be essential for 2D graphics programming. It probably doesn't hurt to keep the rest of these formulas on hand, either.

Unit Conversion
a° = 180°THETA / PI [THETA radians to a°] THETA = PIa° / 180° [a° to THETA radians]
Basic Identities ("SOHCAHTOA")
sinTHETA = opp / hyp = y / r = 1 / cscTHETA cosTHETA = adj / hyp = x / r = 1 / secTHETA tanTHETA = opp / adj = y / x = 1 / cotTHETA = sinTHETA / cosTHETA
Pythagorean Identities
sin^2x + cos^2x = 1 ["sin^2x" = "(sin x)^2"] 1 + tan^2x = sec^2x 1 + cot^2x = csc^2x
Cofunction Identities
sin((PI / 2) - x) = cos x [and vice-versa] csc((PI / 2) - x) = sec x [and vice-versa] tan((PI / 2) - x) = cot x [and vice-versa]
Reduction Formulas
sin(-x) = -sinx, csc(-x) = -cscx, tan(-x) = -tanx, cot(-x) = -cotx cos(-x) = cosx, sec(-x) = secx
Sum/Difference Formulas
sin(u ± v) = sin u cos v ± cos u sin v cos(u ± v) = cos u cos v ∓ sin u sin v tan(u ± v) = (tan u ± tan v) / (1 ∓ tan u tan v)
Double-Angle Formulas
sin(2u) = 2 sin u cos u cos(2u) = cos^2u - sin^2 u = 2 cos^2u - 1 = 1 - 2 sin^2u tan(2u) = 2 tan u / (1 - tan^2u)
Power-Reducing Formulas
sin^2u = (1 - cos(2u)) / 2 cos^2u = (1 + cos(2u)) / 2 tan^2u = (1 - cos(2u)) / (1 + cos(2u))
Sum→Product Formulas
sinu + sinv = 2 sin((u + v) / 2) cos((u - v) / 2) sinu - sinv = 2 cos((u + v) / 2) sin((u - v) / 2) cosu + cosv = 2 cos((u + v) / 2) cos((u - v) / 2) cosu - cosv = 2 sin((u + v) / 2) sin((u - v) / 2)
Product→Sum Formulas
sinu sinv = (cos(u - v) - cos(u + v)) / 2 cosu cosv = (cos(u - v) + cos(u + v)) / 2 sinu cosv = (sin(u + v) + sin(u - v)) / 2 cosu sinv = (sin(u + v) - sin(u - v)) / 2

Statistics

Permutations and combinations alone provide a great basis for strategic thought. I also find binomial probability to be an indispensible tool in game design.

Permutations
nPr = n! / (n - r)! nPn = n!
Combinations
nCr = n! / (r! (n - r)!)
Sample Mean
xBAR = (SUMx_i) / n
Sample Variance
s^2 = (SUM(x_i - xBAR)^2) / (n - 1) = (SUM x_i^2 - (SUM x_i)^2 / n) / (n - 1)
Standard Deviation
s = {s^2}
Population Mean
MU = SUMx_ip(x_i)
Population Variance
SIGMA^2 = SUM(x_i - MU)^2 p(x_i) = SUM x_i^2 p(x_i) - MU^2
Probability for Normal Distribution
P(a < X < b) = P((a - MU) / SIGMA < Z < (b - MU) / SIGMA) [X has normal distribution; MU = mean, SIGMA^2 = variance]
Binomial Probability
P(x successes) = (n! / (x! (n - x)!)) p^(x) (1 - p)^(n - x) [n = trials; p = individual probability of success; x = 0, 1, ..., n] b(x; n, p) ≈ P(((x - ½) - np) / {npq} < Z < ((x + ½) - np) / {npq})
Central Limit Theorem
P(a < xBAR < b) ≈ P((a - MU) / (SIGMA / {n}) < Z < (b - MU) / (SIGMA / {n}))
Sample Coefficients
r = (nSUMx_iy_i - SUMx_i · SUMy_i) / {(nSUMx_i^2 - (SUMx_i)^2)(nSUMy_i^2 - (SUMy_i)^2)} [Correlation] b = (nSUMx_iy_i - SUMx_i · SUMy_i) / (nSUMx_i^2 - (SUMx_i)^2) [Regression] a = yBAR - bxBAR [Y-intercept]
Chebyshev's Rule
For any data set, irrespective of its frequency distribution, at least some percentage of observed results are within a few standard deviations from the mean:
  • At least 0% are within 1 standard deviation,
  • At least 75% are within 2 standard deviations,
  • At least 89% are within 3 standard deviations.
The Empirical Rule
For a data set with a symmetrical frequency distribution, approximately some percentage of observed results are within a few standard deviations from the mean:
  • Approximately 68.3% are within 1 standard deviation,
  • Approximately 95.4% are within 2 standard deviations,
  • Approximately 99.7% are within 3 standard deviations.

The Probability Calculus

My gut feeling is that I am a frequentist about probability, but I haven't really given the question its due consideration.

Restricted Conjunction
P(A AND B) = P(A) · P(B) [A and B must be independent]
General Conjunction
P(A AND B) = P(A) · P(B | A)
Restricted Disjunction
P(A OR B) = P(A) + P(B) [A and B must be mutually exclusive]
General Disjunction
P(A OR B) = P(A) + P(B) - P(A AND B)
Negation
P(A) = 1 - P(NOTA)

Probability

Ever beware the base rate fallacy!

Bayes' Rule
P(A | B) = (P(B | A) · P(A)) / P(B) [P(B) ≠ 0]
Odds Conversion
Odds = Probability / (1 - Probability) [No upper limit] Probability = Odds / (1 + Odds) [Will not exceed 1]

What else... Noise functions? Matrix/vector math? Some basic formulas from the calculus?

Science

Summaries of what little I know.. plus notions of webapps & visualizations...

Astronomy

Until I get to any of the stuff I'd like to do with this page, how about I list some of the major data about our solar system, basically a reskin of NASA's fact sheet plus a few of the more significant satellites out there (Enceladus, Titan, etc.). (I never remember any of these numbers, yet I frequently want to compare them.)

Geology

World map stuff, planetary composition visualizers .. geologic timescales

Physics

I've only studied basic physics (not quantum mechanics or optics or any of that cool stuff), but these basic mechanics are more than enough to handle simple interactions between objects for the kinds of games I like to make.

Kinematics & Mechanics

One-dimensional equations can be used on each axis independently if you split multi-dimensional vectors into their component vectors. (SOHCAHTOA!)

Kinematics
v_f = v_i + at v_f^2 = v_i^2 + 2ad d = v_it + at^2 / 2 = t(v_i + v_f) / 2 = x_f - x_i
Projectiles
a_y = g APPROX 9.80665 m/s^2 [g = standard Earth gravity]
Center of Mass
X = SUM(m_ix_i) / SUMm_i
Angular Velocity
OMEGA = 2PI / T = dTHETA / dt [in radians/second; T = period of rotation] v = 2PIr / T = OMEGAr [speed of point on circle] THETA = 2PIt / T [angle swept in time t]
Density
D = RHO = mass / volume = weight / volume [in Kg/L]
Force
F = ma = mv / t = p / t = dp / dt [in Newtons: Kgm/s^2] a = CHANGEv / t [acceleration] p = mv [inertia/momentum]
Angular Acceleration
ALPHA = dOMEGA / dt a = v^2 / r [acceleration due to direction change]
Gravity
F = Gm_1m_2 / r^2 [G APPROX 6.67408(31)·10^-11 m^3kg^-1s^-2]
Energy
PE = mgh [in Joules: KgN/m; h = height displaced above reference] KE = mv^2 / 2 [in Kgm^2/s^2]
Power
P = E / t = W / t P = VI = I^2R = V^2/R [in Watts; V = voltage, I= current, R = resistance]
Work
W = Fd [in Nm; d = displacement caused by force F]
Friction
F_f = MUF_n [MU = coefficient of friction (depends on surfaces and wetness)] F_n = mg [magnitude of normal force, i.e., weight]
Heat
Q = CmCHANGET [in Joules; C = specific heat]
Stress
SIGMA = F / A [in N/m^2; A = area on which force acts]
Strain
EPSILON = x / L [x = change in dimension; L = original dimension] EPSILON_l = CHANGEl / l [longitudinal strain: ratio of change in length] EPSILON_s = CHANGEl / l [shearing strain: ratio of change in angle of turn to distance from foundation] EPSILON_v = CHANGEV / V [volumetric strain: ratio of change in volume]
Hooke's Law
F = -kx [k = spring/force constant; x = displacement (m)]
Capacitance
C = Q / V [Q = charge on conductor; V = potential applied across conductor] 1 / C_s = SUM(1 / C_i) [serial capacitance] C_p = SUMC_i [parallel capacitance]
Ohm's Law
V = IR [in Volts; I = current (amperes); R = resistance (ohms)]
Current Density
J = I / A [I = current (amperes); A = cross sectional area (m^2)]
Electrical Field
E = F / q [in N/C; Force (F) experienced by single charge (q)] F = kqQ / r^2 [Force of two charges, Q & q, separated by distance r] E = kQ / r^2 [combination of prior formulas] E = V / r [V = voltage]

Haven't listed collision-resolution equations, especially related to changing angular velocity for off-center collisions. (Maybe a whole section on collision handling--probably as a tutorial article linked from here.) Also, could stick some physical constants (fundamental forces) up top.

Chemistry

What do I know about chemistry? Not much, but there are several fun things I'd like to know better, so I'm going to put that information at hand. Of course, could throw in a few constants (Avogadro's number, charge/mass of electrons and other particles, etc).

Biology

Genes, alleles ? some evolution definition thing.. visualizer of some evolutionary tree dataset? mass extinction summary..

Ecology

Biome type data from textbooks and such

History

I wish I had been more interested in history while I was in high school. Then again, if I had been a better student of history back then, maybe I would not since have developed the urge to draw these nifty timelines to help myself learn it better!

  • International Treaties
  • US Presidents
  • US Supreme Court
  • Colonial America
  • Indigenous Americas
  • British Crown
  • Roman Emperors
  • Chinese Dynasties
  • Ancient Egypt
  • Geologic (earth) & Cosmological timelines
  • Various histories of scientific theories

I'd also like to create some animated maps showing territorial changes over time.

Philosophy

I never tip my barber, because he cuts every man's hair in this house and I don't support monopolies.

I've

Mathematical realist. Scientific realist. Mereological universalist. "4D ist."

Logic

Principle (or whatever) of explosion.

DeMorgan's. Logical fallacy list? Overly complete truth table list? (The main ones, the main extensions, and "on beyond zebra" ["never" and "despite" etc].) (Mention the stuff at end of LPL about what's sufficient for a complete system...)

Ethics

My ethical foundation is something I need to contemplate a bit more. Utilitarianism is tempting, but it strikes me as merely a way to quantify one's own prejudices. Nihilism is tempting, yet I seem to be quite persuaded that there are such things as good and evil actions. (I'm willing to make the controversial claim that murder and rape are bad.)

I should at least list the main divisions as I understand them (maybe in a "this poster child would say..." kind of way), and maybe I'll manage to clear a few things up for myself.

Music

Each note is a pitch at some particular sustained frequency. (Standard human hearing is 20-20,000 Hz, with best discrimination from 2,000-4,000 Hz.) Each octave is twice a base ("tonic") note's frequency. Each octave is divided logarithmically into 12 semitones, which we perceive as even divisions of the frequencies. Semitones are further logarithmically divided into 100 cents each.

Equal Temperament

A4 = 440 Hz

Given frequency f, the frequency f' that is n semitones above f is: f' = f * 2^(n/12) Given frequency f' and fundamental frequency f, their difference in cents is: cents = log2( freq / tonic ) * 1200

Diatonic Scales (Modes)

Click the diagrams to change modes.

T 1 2 3 4 5 6 7 8 9 10 11 O I II III IV V VI VII Ionian

Volume: Octave:

Could list frequencies, maybe show a full keyboard's worth of notes to play. Option to switch between equal temperament and just intonation? Also, sections for eastern music scales?

Programming

It's easy to forget niggling details after spending a bit of time apart from a language. As I find myself looking things up, I'll put 'em here for my own convenience.

JavaScript

The main thing I have to remind myself after spending time away from JavaScript is what order to provide drawing arguments. I also occasionally have to check around to rediscover OOP patterns (but I plan to mention those in a mini-tutorial, which I'll link here.)

Canvas (2D)

ctx = canvas.getContext("2d")

Styles
ctx.fillStyle = [color/gradient/pattern]
ctx.strokeStyle = [color/gradient/pattern]
Shadows
ctx.shadowColor = "black"
ctx.shadowBlur = 16
ctx.shadowOffsetX = 2
ctx.shadowOffsetY = 2
Lines
moveTo(x, y)
lineTo(x, y)
ctx.lineWidth = 2
ctx.lineCap = "butt"|"round"|"square"
ctx.lineJoin = "miter"|"bevel"|"round"
ctx.miterLimit = 10
Rectangles
rect(x, y, w, h)
fillRect(x, y, w, h)
strokeRect(x, y, w, h)
clearRect(x, y, w, h)
Circles
arc(x, y, r, 0, Math.PI * 2)
Arcs
arc(x, y, r, start, end)
Text
ctx.font = "normal 10px sans-serif" [per CSS font]
ctd.textAlign = "start"|"end"|"center"|"left"|"right"
textBaseline = "alphabetic"|"top"|"middle"|"bottom"|"hanging"|"ideographic"
fillText(str)
strokeText(str)
measureText(str).width
Images
drawImage(img, x, y[, w, h])
drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh)
createImageData(w, h), createImageData(data)
getImageData(x, y, w, h)
putImageData(data, x, y, dirtyX, dirtyY, dirtyW, dirtyH)
Paths
beginPath(), closePath()
fill(), stroke(), clip()
arcTo(x1, y1, x2, y2, r)
quadraticCurveTo(cpx, cpy, x, y)
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
isPointInPath(x, y)
Gradients
createLinearGradient(x0, y0, x1, y1)
createRadialGradient(x0, y0, r0, x1, y1, r1)
grd.addColorStop(pos, color)
Patterns
createPattern(image[, "repeat"|"repeat-x"|"repeat-y"|"no-repeat"])
Compositing
globalAlpha = 1
globalCompositeOperation = "source-over"|"source-atop"|"source-in"|"source-out"|"destination-over"|"destination-atop"|"destination-in"|"destination-out"|"lighter"|"copy"|"xor" [extended values: "screen"|"multiply"|"overlay"]
Transformations
save(), restore()
scale(hScale, vScale) [1 = 100%]
rotate(radians)
translate(x, y)
transform(hScale, hSkew, vSkew, vScale, hTranslate, vTranslate)
setTransform(a,b,c,d,e,f) [resets to identity matrix first]

Not listed: createEvent(), toDataURL()

SVG (Scaled Vector Graphics)

XMLNS = "http://www.w3.org/2000/svg"

document.createElementNS("SVG", "http://www.w3.org/2000/svg");

[List of shapes and their params.]

SMIL, the more or less built-in animation support for SVGs, is deprecated. Dan Wilson's tutorial is a pretty good starting point for web animations. CSS animations are quite powerful and easier to work with than web animations if your animations generally run forever or to completion. For instance, if you want DOM elements to pop into view in entertaining ways, use a CSS animation. I find that for more "gamey" pursuits--animating something turning between arbitrary rotations for an unknown amount of time, for instance--CSS animations are too restrictive.

CSS (Cascading Style Sheets)

[List the more abstruse values--at least transform choices. Or list the properties I personally always expand.. Maybe a more complete, collapsible property list if I get really aggressive (but browsers provide enough help there).]

Pseudo Classes

  • :active
  • :checked
  • :disabled
  • :empty
  • :enabled
  • :first-child
  • :first-of-type
  • :focus
  • :hover
  • :in-range
  • :invalid
  • :lang(language)
  • :last-child
  • :last-of-type
  • :link
  • :not(selector)
  • :nth-child(n)
  • :nth-last-child(n)
  • :nth-last-of-type(n)
  • :nth-of-type(n)
  • :only-of-type
  • :only-child
  • :optional
  • :out-of-range
  • :read-only
  • :read-write
  • :required
  • :root
  • :target
  • :valid
  • :visited

Pseudo Elements

::before
{ content }
::after
{ content }
::selection
{ color, background, cursor, outline }
::first-line
{ font, color, background, word-spacing, letter-spacing, text-decoration, text-transform, line-height, clear, vertical-align }
::first-letter
{ font, color, background, margin, padding, border, text-decoration, text-transform, line-height, float, clear, vertical-align (if float="none") }

::first-line and ::first-letter may only be applied to block-level elements.

Experimental (Mozilla) pseudo elements:

  • ::backdrop
  • ::placeholder
  • ::marker
  • ::spelling-error
  • ::grammar-error

CSS Animations

[Small notes on CSS animations, with reference to web animations mentioned in SVG stuff. (Animation rules, keyframe at-notation...)]

HTML (Hypertext Markup Language)

Might list a few categories of tags (semantic stuff, media stuff, maybe deprecated stuff, etc).

Document Template

To save myself some typing, in case I happen to be on this page when I create an HTML file:

<!doctype HTML>
<html language="en">
<head>
  <meta charset="utf-8" />
  <title></title>
  <link rel="stylesheet" type="text/css" href="base.css" />
</head>
<body>
<header>
  <nav>
    <a href="#">[ top ]<a>
  </nav>
</header>
<main>
  <section id="">
    <div>
      <p>
        [fortune]
      </p>
    </div>
  </section>
</main>
<footer>
  <address></address>
</footer>
<script type="text/javascript" src="base.js"></script>
</body>
</html>

/Regular Expressions/

Characters
. any single character \char match non-alphanumeric character literally (e.g. \.) \n newline \r carriage return \t tab [···] any single character listed [··· - ···] any single character in range [^···] any single character not listed [^··· - ···] any single character not in range
Anchors
^ beginning of line $ end of line \b word boundary \B word non-boundary
Quantifiers
* zero or more of previous RE + one or more of previous RE ? exactly one or zero of previous RE {n} exactly n of previous RE {n,m} from n to m of previous RE {n,} at least n of previous RE
Shortcuts
\d any digit \D any non-digit \w any alphanumeric/underscore \W any non-alphanumeric/underscore \s any whitespace \S any non-whitespace

I've left out groups (and whatchacallem, the non-capturing groups). Suffixes (g, i)? Replacements (perl only?)? Mention differences between perl, js, shell..?

Other

Other language tricks? PHP stuff, C++ templates, various LaTeX reminders...

A few of the most useful ascii keycodes (a, A, 0, space, tab, return, escape, etc.), maybe.