It could always be worse

OccasionallyVery infrequently, with help from my caffeine addiction and Intense Focus On Writing Awesome Code For Employers Who May Read This, empty Coke Zero cans will slowly accumulate in my vicinity. I couldn’t say how many. In the worst of times enough to not want to know how many.

This morning I stumbled across a 1995 photo of Netscape programmer Jamie Zawinski‘s cubicle, or the “Tent of Doom“.

pic of workstation with many soda cans

The awareness of more severe dysfunction in others is a cold comfort.

On the FairTax

I’ve not read the original FairTax book, and have only flipped through the follow-up written to answer the critics, but I have spent many hours reading about it online over the years, and back when I listened to Boortz of course he pushed it. At the moment, I don’t see it as workable and I think its rollout could be disastrously disruptive to the economy. Many of the goals and incentives set up by the FT are good, but there are a number of critiques I’ve read more recently that have not been adequately answered IMO.

Primarily, there’s Bruce Bartlett’s excellent piece “Why the FairTax Won’t Work” (pdf). This should be the first stop for those who’ve only read pro-FT literature. It begins with a decent description of the FT, but obviously it shouldn’t be the only thing you read about the FT to make an informed opinion.

Several folks commenting at the Fair Tax Blog make some compelling arguments against the FT, including weighing in on Bartlett’s critique. Many agree with him that a VAT would be a better consumption tax. This post has some lively discussion worth reading.

A lot of the selling points of the FT just seem too good to be true:

  • You keep 100% of your paycheck. This is the most obvious deception—a mechanical truth of the FT system with the emotional appeal of effectively raising your income. Of course, your paycheck would be either be smaller or your expenses larger, too. With the FT’s guarantee of being revenue-neutral, the FT cannot be a win for everyone, and when you start to look at who would greatly benefit from it, it should be obvious who the losers will be. This is not to say that everyone’s current tax level is just, but this particular line of rhetoric seems targeted towards the middle class, who I think would end up paying more under the FT. And retirees living off savings—having already been taxed on earnings—will be taxed again to get by.
  • It’s under 200 pages. Does anyone really believe that suddenly Congress would just have no way of cutting breaks for special interests? The problems of loopholes, unfairness, and the ballooning of the tax code is due to the people who amend it, and the FT won’t replace them. With not even most Republicans willing to touch it, getting a FT through Congress would take a number of sweetheart deals right off the bat and probably provisions making it easier to tamper with going forward. Remember there would be $485B going to citizens yearly in “prebate” checks, and Congress would determine who gets what; more room for deal-cutting.
  • No more IRS! For those who strongly believe federal taxation is out-of-control, the notion of sticking it to the IRS will sound satisfying, but if a national consumption tax became the sole source of revenue for the federal government, you’d better believe it would build a new, huge bureaucracy to ensure compliance. Also, since the FT would no longer allow state and local governments tax-free purchasing, the states would likely need to jack up their income taxes to compensate.

Bartlett’s piece really is well-researched and a must-read, and if you know of a serious critique that takes on his arguments head-on, I’d love to read it.

It wasn’t torture when America did it.

Suuure. Salon’s Mark Benjamin on what our last Vice President has described as “a dunk in the water”. Disturbing.

Also looks like Obama’s (unsurprisingly) caving on civilian trials. Nothing says “rule of law” like pre-trial torture sessions and determining location and rule of court by political theater. KSM may be a mass murdering bastard, but aren’t we supposed to be better than regimes who use show trials? Don’t we usually sanction or invade regimes like that?

Cheers for Ruins

If you too love urban ruins, Opacity.us has awesome photography of abandoned hospitals, churches, libraries, factories—you name it—with all structures well categorized and documented. Don’t miss the wallpaper.

A decent Gainesville find is in the woods directly South of where Shealy Dr. ends. My coworkers and I used to walk the mile along Shealy Dr. and Ritchy Rd. every day and I finally convinced them it was a Great Idea to explore the trail into the woods where Shealy Dr. ends. It runs South along the edge of the open field and down to Bivens Arm, but if you head Southwest when you see water you’ll come across an abandoned brick house in the middle of the woods. The roof is caved in and kids have spray painted pentagrams and nonsense on the walls, but still awesome. A trail also heads West along the North side of Bivens Arm.

I just got life insurance; who’s up for some misguided exploring and documentation of “Satan House”?

Guitar Tuning By Ear

(This is edited from an answer I posted to KeyMinor, a music Q&A site. They need more users!)

A lot of recordings end up slightly higher/lower than standardized pitch (I always called this “in the cracks” but don’t google it!), and this is the quickest way I’ve found to tune a guitar to them.  This method seems simplistic but has several advantages going for it:

  • All strings are tuned to the same reference pitch, so there’s no accumulation of error as you move from string to string (and you can tune any of the top 5 in any order).
  • The higher the frequency, the easier it is to notice the beat when two identical notes differ slightly in pitch. Matching high pitches yields lower error.
  • All pitch matching is done with notes in the same octave; this also helps you notice the beat

Here it is. Continue reading  

SQL Server Mgmt Studio Can’t Export CSV

I’m trying to export large (e.g. 16M rows) SQL Server 2008 views for eventual import into MySQL. The underlying setup for these views is bizarre: A SELECT for a single row can take over two minutes, a SELECT * FROM view with no WHERE clause is much faster, but still too slow to finish an export in any client we’ve connected with. The only reasonable solution I’ve found is to use SQL Server Management Studio, right-click the DB > Tasks > Export Data… and target a flat file. This seriously seems about 100x as fast as a direct query in SSMS and 200x as fast as an ODBC connection.

There’s only one (major) gotcha: The flat file writer in SQL Server Management Studio (ver 10.0.2531.0) is broken for CSV output. There’s no configuration I can find that will correctly escape characters that need to be. By default it doesn’t enclose any values in quotes, but even if you specify the double quote as “Text Qualifier” (yay for obscure proprietary descriptions), double quotes within values won’t be escaped in any way. Not with \" nor "" (the CSV standard). This means you can either export fixed-width columns, or try to find chars that never exist in your data to use as field/line delimiters. The escape char \ is also not escaped, so you could end up with a line feed character in your import when the original data was literally “foo\road”. Stupid.

Again, I can’t just select all rows in the tool and then save the resulting recordset as CSV (which isn’t broken) because the views are so big that the queries time out (the resultsets would probably crash the tool anyway) and because there’s no way to partition the query that doesn’t destroy performance. I’m going to have to create a local SQL Server DB and do a DB to DB transfer, then use a client connection to export.

Update: You can at least use obscure Unicode chars as delimiters, though it outputs invalid UTF-8 chars after the first row. You have to export as “Unicode” (UTF-16 little-endian. 2-byte chars with a leading \xFF\xFE BOM). If you pick delimiters like ʖ and ʁ and go this path, you won’t be able to use traditional line-by-line file reading functions. You’ll have to stream a fixed number of bytes at a time, building up columns (and validating that the number of columns/row stays constant) and converting to rational CSV that can be handled by MySQL. Another vote for setting up a local SQL Server instance.

Bash: unbom (to remove UTF-8 BOMs)

Tests for and removes UTF8 BOMs.

#!/bin/bash
for F in $1
do
  if [[ -f $F && `head -c 3 $F` == $'\xef\xbb\xbf' ]]; then
      # file exists and has UTF-8 BOM
      mv $F $F.bak
      tail -c +4 $F.bak > $F
      echo "removed BOM from $F"
  fi
done

USAGE: ./unbom *.txt

The magic is tail -c +4 which strips the first 3 bytes.

Could this be an OpenSSH bug?

Last week I tried to SSH into my webhost account (on Site5) from work and—forgetting my password—it locked me out after several failed attempts. SSHd would just close the connection without asking my password.

work:~$ ssh user@example.com
Connection closed by xx.xx.xx.xx

I could log in from any other location, so I figured it was an IP ban and after a few days and a support ticket, I’d be in, but things got strange.

  1. The Site5 techs could not find any evidence of a block on my account. They were pretty responsive.
  2. It couldn’t be an IP block because I could log in from a virtual machine which used my workstation IP as gateway.
  3. When connected to VPN (different public IP) it still refused me.
  4. It couldn’t be a port 22 block because I could attempt a login to a different account on the same host and it would give me a password prompt.
  5. Could it be Snow Leopard? I could log in from another workstation running it.
  6. My machine? I could log in to several other hosts, including another account on a different Site5 host.

On the server I had an ~/.ssh/authorized_keys file with an old public key—the file hadn’t been touched for 2 years. I deleted it and—voila—SSHd would again ask for my password and log me in fine.

Why would the presence of authorized_keys cause SSHd to refuse to give a password prompt to one particular client’s connection to one particular account? OSX did give me a default RSA keypair, but even if the public key had been forwarded, SSHd should revert to password auth if it doesn’t find it in authorized_keys.

Chord Theory: 13 is probably 7(13)

A 7th add 13 chord is often voiced r-5-7-3-13, sometimes leaving out the fifth. To pin this to a key, a G7(13)—G⁷⁽¹³⁾ if your chart can handle Unicode—is usually voiced G-D-F-B-E and is a common (in jazz and standards anyway) way to make the resolution from G7 to C more subtle and harmonically interesting. In G7 – C, the F resolving to E is hard to ignore, but in G7(13) – C, the E is already present, making the removal of the F more subtle. The dissonance between F and E (a major seventh interval) gives the G7(13) a richer sound.

The consensus on the web seems to be that this is actually a 13th chord, even though there’s no 9th or 11th present:

“In modern pop/jazz harmony … a thirteenth chord does not imply the quality of the ninth or eleventh scale degrees.” [Thirteenth on Wikipedia]

I disagree. Since the true 13th chord is an extension of the 11th chord, it should sound more like an 11th than a 7th. Elevenths almost always imply a suspended, missing, or nearly inaudible 3rd, but the 3rd in 7(13) is usually very prominent. If you really think G13 and G7(13) are the same chord, play these two voicings one after one another on guitar:

  • G13 3-x-3-2-1-0 →  G7(13) 3-x-3-0-0-0

Clearly there is movement; they are different chords. If you see a 13th chord in a pop music chart, know that it is really a 7(13).

Some easy V7(13) to I resolutions on guitar (with the 3rd kept on top)

  • A7(13) x-0-5-6-7-xD x-x-0-2-3-2
  • G7(13) 3-x-3-0-0-0C x-3-2-0-1-0
  • D7(13) x-5-4-5-0-xG 3-2-0-0-0-x
  • E7(13) 0-5-6-6-x-xA x-0-2-2-2-x

About the Eleventh (and its third)

As I mentioned, 11th chords almost never have the 3rd present*. You will almost never hear a B in a G11 chord. Some people write these as F/G, and, for voicing purposes this OK, but I dislike the notion that G11 should be thought of as an F chord. 1) it has a D in it. We could write it as F6/G or Dm7/G, but that’s taking us down the wrong path. 2) “G11” gives the reader a better impression that the chord will resolve to (and that our key is) major C.

*So it might really be a 9sus4, but writing it is as 11 seems a less egregious error than writing 7(13) as 13.