Creating a LUKS-encrypted DVD/BD data disc

I’ve been backing up some of my larger files to Bluray lately, instead of trying to upload them over a 10 Mbps uplink.

In the past, I used GPG (on a .tar or compressed .tar.xz) or Veracrypt (on a file container) to encrypt at rest, before burning those files onto a standard UDF/ISO9660 optical disc. Now that I use a Linux desktop, I wanted something slightly more native — a method that

  1. protects the directory structure and filenames without needing to use an archive file (like .tar);
  2. would be generally unintelligible on a Windows PC (this is a feature, not a bug); and
  3. could be scripted on the command line for server backups, without requiring a GUI.

Based on some resources online, I settled on using LUKS.

Continue reading “Creating a LUKS-encrypted DVD/BD data disc”

Microsoft derps on Excel ad

Original resolution of Excel ad showing treemap chart

Microsoft’s Facebook ad for new features in Excel highlights the Treemap visualization, but gets it totally wrong.

Ad for Excel visualization features

A treemap is supposed to visualize relative size in a hierarchy. But in the illustration here, the data don’t fit this type of visualization (it’s a time series of one flat variable—without hierarchy).

Original resolution of Excel ad showing treemap chart

But it’s even worse than that. The relative sizes don’t make sense! Why would the 31 MPG box for January be so much larger than the 32 MPG box for May?

This seems like a great illustration of why math/statistical education should be required for everyone—even visual designers and marketers. Or at least, the people selling the product should understand what the software actually does.

Privacy in the home

Privacy comes up a lot nowadays in the context of technology. But legal conceptions of privacy predate the information age.

From a recent reading for Property law:

The freedom of association is often inextricably entwined with the constitutionally guaranteed right of privacy. The right to ‘establish a home’ is an essential part of the liberty guaranteed by the Fourteenth Amendment. Meyer v. Nebraska, 262 U.S. 390, 399 (1923); Griswold v. Connecticut, 381 U.S. 479, 495 (1965) (Goldberg, J., concurring). And the Constitution secures to an individual a freedom ‘to satisfy his intellectual and emotional needs in the privacy of his own home.’ Stanley v. Georgia, 394 U.S. 557, 565 (1969); see Paris Adult Theatre I v. Slaton, 413 U.S. 49, 66–67 (1973). Constitutionally protected privacy is, in Mr. Justice Brandeis’ words, ‘as against the Government, the right to be let alone . . . the right most valued by civilized man.’ Olmstead v. United States, 277 U.S. 438, 478 (1928) (dissenting opinion). The choice of household companions—of whether a person’s ‘intellectual and emotional needs’ are best met by living with family, friends, professional associates, or others—involves deeply personal considerations as to the kind and quality of intimate relationships within the home. That decision surely falls within the ambit of the right to privacy protected by the Constitution. See Roe v. Wade, 410 U.S. 113, 153 (1973) . . .

Vill. of Belle Terre v. Boraas, 416 U.S. 1, 15–16 (1974) (Marshall, J., dissenting) (emphasis added).

This was a case about a local ordinance that regulated what kinds of homes could be kept, not about, for example, sexual conduct or faith. But the passage illustrates the extent to which “privacy” is implicated any time any level of government attempts to regulate private conduct within a home—foreshadowing the social progress that would follow, particularly with same-sex rights.

Justice Marshall cited, as would later be recognized as the seminal line of cases finding privacy in the Constitution, Fourth Amendment cases like Olmstead and abortion/contraceptive cases like Roe and Griswold. And what he criticized in the ordinance was its attempt to keep out people who had different “lifestyle choices”:

The instant ordinance discriminates on the basis of just such a personal lifestyle choice as to household companions. It permits any number of persons related by blood or marriage, be it two or twenty, to live in a single household, but it limits to two the number of unrelated persons bound by profession, love, friendship, religious or political affiliation, or mere economics who can occupy a single home. Belle Terre imposes upon those who deviate from the community norm in their choice of living companions significantly greater restrictions than are applied to residential groups who are related by blood or marriage, and compose the established order within the community. The village has, in effect, acted to fence out those individuals whose choice of lifestyle differs from that of its current residents.

Belle Terre, 416 U.S. at 16–17 (Marshall, J., dissenting) (emphasis added).

Zoning officials properly concern themselves with the uses of land—with, for example, the number and kind of dwellings to be constructed in a certain neighborhood or the number of persons who can reside in those dwellings. But zoning authorities cannot validly consider who those persons are, what they believe, or how they choose to live, whether they are Negro or white, Catholic or Jew, Republican or Democrat, married or unmarried.

Belle Terre, 416 U.S. at 14–15 (Marshall, J., dissenting) (emphasis added).

So why was Justice Marshall alone in his dissent?

CRA PDF form validation frustrations

While trying to file my Canadian taxes as a nonresident, using the “Income Tax and Benefit Return for Non-residents … of Canada” — since I live in the United States and am a tax resident of the United States — I ran into a really frustrating bug in the first 5 form fields.

The form doesn’t accept non-Canadian provinces/territories and postal codes!

Can't put Massachusetts as a state
MA? not allowed.
Can't input a ZIP code
ZIP code? not allowed.

It’s really foolish, because many of the people who would be filing this form are likely residing outside of Canada. That’s why this version of the T1 return has an added Country field in the address block.

This is the kind of situation when PDF forms should just step back and allow free-form, unvalidated input.

Pretty sure the IRS made a typo in Publication 519

There’s a provision that allows aliens in the U.S.[1] to choose to be treated as a U.S. resident for tax purposes even if they would not otherwise qualify as a resident. Income tax rules themselves are already really confusing — and they are even more complicated for foreigners in the U.S. — so a typographic error could really confuse a taxpayer.

I think the IRS made a typographic error, but I’m not even sure how to get in touch with them to fix this.

Motivating example

Suppose you arrive in the U.S. for the very first time on October 1, 2015 to work for the foreseeable future on a TN-1 (NAFTA Professional) visa. Because the period from 2015-10-01 to 2015-12-31 is insufficient to meet the Substantial Presence Test,[2] you would otherwise be a nonresident alien for tax year 2015. This would mean your income in the United States might be subject to taxation in the U.S. as well as in your home country. What if you wanted to be treated as a resident alien starting on October 1, 2015 — despite not satisfying the Substantial Presence Test?

This is the First-Year Choice, and it’s documented in Publication 519 (“U.S. Tax Guide for Aliens”) by the IRS.

The error

I got a little confused when I first read the rule, because it seemed to require an impossibility:

2015 Publication 519 typo on page 7

Let me excerpt that to show why it’s so self-contradictory: “If you do not meet either the [GCT] or the [SPT] for 2014 … but you meet the [SPT] for 2014.”

Huh? Clearly they meant 2016 there. Moreover, if you met the SPT for 2014, the current tax year — 2015 — wouldn’t be your first year in the U.S.

This is confirmed by the bulleted list on the following page:

2015 Publication 519 excerpt from page 8

Motivating example resolved

If you are going to satisfy the Substantial Presence Test in the following tax year — 2016 — you can choose to pretend to be a U.S. resident from 2015-10-01 to 2015-12-31 as well, if you meet all of the requirements in the bulleted list above.


Footnotes   [ + ]

1. Foreigners, not extraterrestrials.
2. The Substantial Presence Test (SPT) requires, in its simplest form, at least 183 days of physical presence within the United States in a three-year period.

What’s in that USPS postage barcode?

pbSmartPostage test stamp

I am publishing this post as a hobbyist, because I find barcodes cool (as demonstrated by a prior open source project using 2D barcodes that I worked on). Do not attempt to use this information for any illegitimate purpose. Counterfeiting postage is a federal crime. 18 U.S.C. § 501.

Blogs don’t really have to be about a single theme, but it’s nice when they let the blogger’s personality shine through. This post ties together some of my favourite things: 2D barcodes, high speed automation, printers, cryptographic signatures (!), postal mail and postage, fraud prevention, and even a little bit about patents! If you know me at all, you’ll understand why I find this stuff so ridiculously cool.

Continue reading “What’s in that USPS postage barcode?”