Table of Contents

Reading is forgetting

Knowledge, wisdom even, lies in depth, not extension.

Bitwise Gotcha

I’ve been working on porting some bitwise logic from Java to Python
and it’s been as awful as that sentence sounds.

The main gotcha that I’ve run into has something to do with the fact
that an int in Java is 32-bits so the logical NOT of an integer is
different in Python vs Java.

So in python you get:

>>> bin(~0x000000ff)

Whereas with java:

public class BitWise {
    public static void main(String[] args) {
	System.out.format("%s\n", Integer.toBinaryString(~0x000000ff));  // Prints: 11111111111111111111111100000000

I ran into a problem because I was trying to XOR the output of a
NOT which, obviously, comes out differently if you have different
expecations what comes from NOT, i.e.:

assert(0b11111111111111111111111100000000 != -0b100000000)

The way around this for me, was to AND the NOT output with
0xffffffff. There are probably some weird edge-cases here ¯\_(ツ)_/¯.

Dumb git ref tricks

I’m always learning and losing dumb git tricks. Here are a few I might
lose if I don’t keep them someplace:

Store a random, named blob in a repo

In this case it’s a GPG key

wget https://tylercipriani.com/018FAC02.asc
export obj=$(git hash-object -w --stdin < 018FAC02.asc)
git tag tyler-cipriani-gpg-key "$obj"
rm 018FAC02.asc
git cat-file -p $(git show-ref -s tyler-cipriani-gpg-key)
git show tyler-cipriani-gpg-key

Create a local symbolic reference to some reference

Like that gpg key tag, for instance

git symbolic-ref GPG_KEY refs/tags/tyler-cipriani-gpg-key
git show GPG_KEY

Create a whole new kind of ref, to track something and share it around

Could even store the gpg keys of lots of folks

wget https://tylercipriani.com/018FAC02.asc
export obj=$(git hash-object -w --stdin < 018FAC02.asc)
git update-ref refs/keys/tyler "$obj"
wget https://uniontownlabs.org/toddtreece.gpg.txt
export toddgpg=$(git hash-object -w --stdin < toddtreece.gpg.txt)
git update-ref refs/keys/todd "$toddgpg"
rm 018FAC02.asc toddtreece.gpg.txt
git show refs/keys/todd
git show refs/keys/tyler

You can even push them to a remote (github even) and fetch them back
down on the other side:

git push origin refs/keys/*:refs/keys/*
git clone [repo]
git fetch origin refs/keys/*:refs/keys/*
git show refs/keys/tyler

Former Plan Files

In ancient days, on the computer networks of the Sumerians and
Hittites, people kept .plan files as a way to disseminate useful
and/or amusing information.

Dave Loffredo


Deep in him, beneath his memory, was the knowledge of hardship and
hunger and endurance and pain. Though he seldom thought of his early
years on the Booneville farm, there was always near his consciousness
the blood knowledge of his inheriteance, give him by forefathers whose
lives were obscure and hard and stoical and whose common ethic was to
present to an oppressive world faces that were expressionless and hard
and bleak

– John Williams, Stoner

What I learned about email addresses today

I burrowed into RFC 5322’s Address Spec for a long time today. This
resulted in a fun side-trip into Augmented BNF for Syntax
Specifications: ABNF.

Email addresses break down to their Core Rules like this:

addr-spec       =   local-part "@" domain

addr-spec       =   dot-atom / quoted-string / obs-local-part
		    dot-atom / domain-literal / obs-domain

addr-spec       =   [CFWS] dot-atom-text [CFWS] / [CFWS]  DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS] / word *("." word)
		    [CFWS] dot-atom-text [CFWS] / [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS] /  atom *("." atom)

addr-spec       =   [(1*([FWS] comment) [FWS]) / FWS] 1*atext *("." 1*atext) [(1*([FWS] comment) [FWS]) / FWS] /
		    [(1*([FWS] comment) [FWS]) / FWS] DQUOTE *([([*WSP CRLF] 1*WSP) /  obs-FWS] qtext / quoted-pair) [([*WSP CRLF] 1*WSP) /  obs-FWS] DQUOTE [(1*([FWS] comment) [FWS]) / FWS] /
		    (atom / quoted-string) *("." (atom / quoted-string))
		    /me dies

The density of local-part "@" domain weighs on me.

What was impressed upon me is how viscous all communication is: a
means to deliever a message becomes a dense message of its own.

A valid domain is:

atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
		    "!" / "#" /        ;  characters not including
		    "$" / "%" /        ;  specials.  Used for atoms.
		    "&" / "'" /
		    "*" / "+" /
		    "-" / "/" /
		    "=" / "?" /
		    "^" / "_" /
		    "`" / "{" /
		    "|" / "}" /

dtext           =   %d33-90 /          ; Printable US-ASCII
		    %d94-126 /         ;  characters not including
		    obs-dtext          ;  "[", "]", or "\"

domain          =  dot-atom / domain-literal / obs-domain

domain          =  ([CFWS] dot-atom-text [CFWS]) /                 ; dot-atom
		   ([CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]) /  ; domain-literal
		   (atom *("." atom))                              ; obs-domain

domain          =  ([CFWS] 1*atext *("." 1*atext) [CFWS]) /                   ; dot-atom
		   ([CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]) /             ; domain-literal
		   (([CFWS] 1*atext [CFWS]) *("." ([CFWS] 1*atext [CFWS])))   ; obs-domain

If we get rid of the Content Folding White Space which has a lot of rules and seems to be everywhere and is a context-free grammar we get something like:


Org-mode to publish a site

A Manifesto of sorts

This single org-mode file is a blog. The org-mode file in which
I am writing this text is filled with material that either isn’t
substantive or focused enough to be published on my normal blog.

This material should be less ephemeral than things on a wiki (e.g.
The movies section, the RFCs section, the Wikipedia pages section
should be moved the Wiki).

I tend to experiment more with format in this file than in my notes
directory (which I keep using Deft and org-mode) which means I
learn more org-mode and that is a Good Thing™.

Other org-related things

Can I just say: org-babel looks awesome as fuck.

A literate programming environment that can be used to configure a lisp-machine.

To paraphrase one of the authors below: that’ll earn you a lot of nerd merit-
badges. I should maybe consider moving my Linux Tips
repo over to this. Also, I should move my repos off of github and onto
something self-hosted :( Too. Many. Projects. Le. Sigh.

How I generated this page

This is a weird, psuedo literate way of updating this file on the
squiggle.city site.

First I ssh into squiggle using a src block with a :session identifier.
The actual code in the org file can be seen on github.

For what it’s worth, I am executing this file to generate this HTML.

ssh squiggle

I can make sure I’m on the server, by checking the hostname, again, in
the same :session. One important note that it took a while to figure out:
I have to use the :exports both argument for the source block to show
the results in the HTML output.


I Have a file that exists as a local hack in my dotfiles on squiggle.city
server, but don’t take my word for it:

file "/home/thcipriani/bin/squigglegen"
/home/thcipriani/bin/squigglegen: C source, ASCII text

Now, locally, without using the :session. I can save and commit this file
to my .dotfiles repo:

/usr/bin/git -C /home/tyler/.dotfiles add plan
/usr/bin/git -C /home/tyler/.dotfiles commit -m '.plan spelling fixes'
/usr/bin/git -C /home/tyler/.dotfiles push
[master 2655be0] Add plan from org-mode
 1 file changed, 30 insertions(+), 18 deletions(-)

Then, back on my remote session, I can pull this code down, and regenerate my
page using the squigglegen command.

First, rewinding head to replay your work on top of it...
Applying: [LOCAL HACK] Generate my squiggle city file :)
Applying: [LOCAL HACK] Emacs publish squigglegen

Typographically Perilous

“rock ‘n’ roll 7"s from the ‘80s”

Thanksgiving vocabulary

Variadic Function – a function of indefinite airity.
Considered complimentary to the apply function which
is central to languages derived from lambda calculus.

Use in ES2015:

var printAwards = function(...places) {
    for (var place of places) {

Bitwise shifts are like dividing by 2

Never thought about it:

  • x >> 2 == x / 2
  • x << 2 == x * 2

RFCs I have known and loved

XSS String


Two quotes I saw and liked

I Didn’t particuarly enjoy this talk, but this quote was good:

Good judgment comes from experience, and experience comes from bad judgment.
So if things aren’t going well, it probably means you’re learning a lot
and things will go better later.

Randy Pausch
Time Management

Security at the expense of usability comes at the expense of security.



The Magic Words are Squeamish Ossifrage

Taylor Swift for the Brave and True

You held your head like a hero
On a history book page
It was the end of a decade
But the start of an age

  • Taylor Swift, Voice of Our Age

Gall’s Law

A complex system that works is invariably found to have evolved from a simple
system that worked. A complex system designed from scratch never works and
cannot be patched up to make it work. You have to start over with a working
simple system.

– John Gall (Systemantics: How Systems Really Work and How They Fail.)

A recent Amazon.com order about which I feel a certain joy


Surprising things found in the 85 tabs open on my phone

Currently Reading

Wikipedia Articles I enjoy

Thomas Jefferson to Isaac McPherson

If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the
possession of every one, and the receiver cannot dispossess himself of it.

Thomas Jefferson

Nobody Understands Punctuation

If make his point clear, Yoda could, give a shit about Oxford commas,
nobody should.
– Peter Huntwelch

Nobody Understands Punctuation

The Programmer

The programmer, like the poet, works only slightly removed from pure
thought-stuff. He builds his castles in the air, from air, creating by
exertion of the imagination. Few media of creation are so flexible, so easy
to polish and rework, so readily capable of realizing grand conceptual
structures… Yet the program construct, unlike the poet’s words, is real
in the sense that it moves and works, producing visible outputs separate
from the construct itself. […] The magic of myth and legend has come
true in our time. One types the correct incantation on a keyboard, and a
display screen comes to life, showing things that never were nor could be.

– Fred Brooks

TODO Things to look at, when I have time


Title Year
Old Joy 2006
Sunset Boulevard 1950


Title Artist Year
Rhinoceros Albrecht Dürer 1515
Carcass of Beef Chaïm Soutine c. 1925
The Knight’s Dream Antonio de Pareda 1655
The Death of Marat Jacques-Louis David 1793
Homage to a Square Josef Albers 1962

TV Shows

Title Date
Civilisation 1969

Thomas Edison was an awful human being

There ain’t no rules around here. We’re trying to accomplish something.

– Thomas Edison

All Good Slides Are Slippery

Poetry is like a curvy slide in a playground - an odd object, available
to the public - and, as I keep explaining to my local police force,
everyone should be able to use it, not just those of a certain age.

– Lemony Snicket


Discourse on Inequality

The first man who, having fenced in a piece of land, said ‘This is mine,’
and found people naïve enough to believe him, that man was the true
founder of civil society. From how many crimes, wars, and murders, from
how many horrors and misfortunes might not any one have saved mankind, by
pulling up the stakes, or filling up the ditch, and crying to his fellows:
Beware of listening to this impostor; you are undone if you once forget
that the fruits of the earth belong to us all, and the earth
itself to nobody.

– Jean-Jacques Rousseau, Discourse on Inequality, 1754


ASCII Magic Eye

The following block of characters is an ASCII “Magic Eye” Random-Dot Stereogram.
Stare at it with your eyes focused at infinity and you will eventually see a
diamond suspended between two rows of columns.

               O               O               O               O

                                               (created by helder@ci.ua.pt)

The Phonetic Alphabet

A - Alpha    G - Golf    N - November  U - Uniform
B - Bravo    H - Hotel   O - Oscar     V - Victor
C - Charlie  I - India   P - Papa      W - Whiskey
D - Delta    J - Julia   Q - Quebec    X - X-Ray
E - Echo     K - Kilo    R - Romeo     Y - Yankee
F - Foxtrot  L - Lima    S - Sierra    Z - Zulu
             M - Mike    T - Tango

Author: Tyler Cipriani

Created: 2017-05-05 Fri 19:19

Emacs 24.4.1 (Org mode 8.2.10)