Z

Z0

The Einstein field equations rendered in Libreoffice Math

R Rsub{%mu%nu}-1 over 2 g rsub{%mu%nu}R+%LAMBDA g rsub{%mu %nu}~=~{8%pi`G} over c^4 T rsub{%mu%nu}



Z1


Z2

Use Python and to calculate the circumference of the orbit of Mercury in AU from the semi-major and semi-minor axes.

from scipy import special
a=.466697
b=.307499
e=1.0-b**2/a**2
4*a*special.ellipe(e)


Z3

Calculate intersection of two lines from four points


#!/usr/bin/env python3
import sys
import numpy as np

def line_intersection(p1, p2, q1, q2, tol=1e-10):
    A = np.array([p1, p2], dtype=float)
    B = np.array([q1, q2], dtype=float)
    matrix = np.array([A[1]-A[0], B[0]-B[1]]).T
    rhs = B[0]-A[0]

    det = np.linalg.det(matrix)
    if abs(det) < tol:
        if np.linalg.norm(np.cross(A[1]-A[0], B[0]-A[0])) < tol:
            return "Coincident (lines overlap)"
        else:
            return "Parallel (no intersection)"
    else:
        t, s = np.linalg.solve(matrix, rhs)
        return (1-t)*A[0] + t*A[1]

if __name__ == "__main__":

    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, sys.argv[1:])
    point = line_intersection((x1,y1), (x2,y2), (x3,y3), (x4,y4))

    print(f"Result: {point}")


Z4

10. URA cowgirl if you spend more time cleaning your horse than your house.

9. URA cowgirl if your mother suggests you need a male companion to quiet some of the rumors going around and you get a stallion.

8. URA cowgirl if your horse gets the tent and you sit out in the rain.

7. URA cowgirl if your horse is groomed better than your girlfriend.

6. URA cowgirl if your girlfriend finds hair on your coat and you have the horse to match.

5. URA cowgirl if you cluck to your car when you go up a hill.

4. URA cowgirl if your horse’s hair is in better condition than your own.

3. URA cowgirl if the most common present you receive at your bridal shower is actual bridles.

2. URA cowgirl if your house is a mess but the barn is as neat as a pin.

1. URA cowgirl if you show up at your own wedding wearing riding clothes because you took too long at the barn.


Z5


Z6


Z7


Z8 – LOTR


Z9 – Time


ZA – Math


ZB – LOTR

“Not idly do the Leaves of Lórien fall.”


ZC – Recursion


ZD – Functy

3D graph drawing package. Render Cartesian, spherical and parametric curve functions on the GPU.


ZE – Plots


ZF – Python

Print the longest and shortest lines in a text file with Python:

#!/usr/bin/python3
with open("kjv.txt") as file:
    print("Shortest verse: ",min(file,key=len))
with open("kjv.txt") as file:
    print("Longest verse: ",max(file,key=len))


ZG

abs

Awk has no built-in absolute value function, but modulus is simply root n squared.

awk '{print sqrt($1 ** 2)}' data


ZH

Capitol Peak in Washington


ZI


ZJ

KLatexFormula makes writing LaTeX easy, but don’t forget, you lose half of your potential book buyers with each equation you include.


ZK

Don’t sail into the shark shredders!


ZL – Math

If you divide 1 by 998,001 you get all three digit numbers from 000 to 999 in order, with the exception of 998


ZM – Streamripper

Me: I wanna rip what you’re streaming like I did when I was a girl with a tape recorder and a radio.

Radio Station: Fuck you, no streamripper because that’s piracy pure and simple.

Me: Oh, silly me, I didn’t mean rip, I meant I just want to listen on WinAmp.

Radio Station: Okay then.


ZN – WinFF front-end for ffmpeg


ZO

VMPK – Virtual MIDI Piano Keyboard, set up the way I like it.


ZP

The Unix tool called more lets you browse text files but you can’t go backwards so there’s another tool called less that has more options, on the theory that less is more. Now there’s still another tool called most that has even more features than less! I’m holding out for least.


ZQ – Weather

curl wttr.in/Seattle


ZR


ZS


ZT


ZU – Primes

With list comprehension you can write a Python one-liner that prints all the primes less than n at the expense of readability. My experience with computers goes all the way back to 1978 when RAM was sold by the kilobyte so this sort of thing makes my tail wag faster.

python3 -c "print([i for i in range(2,5000) if all(i%j for j in range(2,int(i**0.5)+1))])"



ZV


ZW


ZX

Build thumbnails with the same basename from a directory of video files using ffmpegthumbnailer and bash:

for oldfile in *.mp4; do
    filename="${oldfile%.*}"
    ffmpegthumbnailer -i "$filename.mp4" -o "$filename.jpg"
done


ZY – Sudo


ZZ – Shuffle and rename a directory of images

$ echo '#!/bin/bash' > files; chmod 744 files; ls -1 | shuf | nl -i1 -s' ' -nrz -w5 | awk '{print "mv " $2 " " $1 ".jpg"}' >> files ; ./files