Tuesday, November 29, 2011

Read Charlie Pierce

If you're not reading Charlie Pierce's blog, you should start. Warning: includes Bad Language and might be offensive to idiots and Republicans.

Friday, October 14, 2011

Amazing Nerdiness

I was listening to Tom Lehrer's "Silent E" (one of my favorites; I'm always happy when that pops up on my iPod), and decided to figure out how many pairs of words differ only by a trailing 'e'.

So I whipped up this nerdstrosity. I felt I had to share:

perl -e 'my %words = (); my @ewords = (); 
while (<>) {
    chomp();
    $words{$_} = 1; 
    push(@ewords, $_) if (/e$/);
} 
foreach my $eword ( @ewords ) { 
    (my $noe = $eword) =~ s/e$//; 
    if ( defined($words{$noe}) ) { 
        print "$noe -> $eword\n";  
    }  
}' /usr/share/dict/words

Monday, October 10, 2011

Things I've Learned, #1751

If you review your Spam/Junk email folder regularly, sort by sender -- it groups together (and hence allows you to easily skip over) the repeated spam. And there's LOTS of repeated spam (in my spam folder, anyway).

(This does require that you either pick a date range -- or otherwise look only at messages that have arrived since your last review; or move everything you've review somewhere else after the review.)

Saturday, June 11, 2011

Paul Krugman Finally Understands

So Paul Krugman finally figured out why the Very Serious PeopleTM Really Really Hate inflation: because it costs the creditor class money.

You can see the penny drop over the past week in the following blog posts: The Rentier Regime, Wir Haben Auch Rentier, and Who Are the Rentiers.

What I find kind of surprising is that I thought this was obvious. If nothing else, Molly Ivins was making this point back in the 1990s, in her inimitable style:

These guys are economic nincompoops; our Federal Reserve Board, composed of people none of us have ever heard of, knows better. They want to slow the economy down, you see. In the world of the Fed (as we cognoscente call it for short), it's bad when the economy grows fast, and it's worse when everyone can find a job. You see. Because these conditions are believed to cause inflation, which the Fed hates worse than anything. Inflation means that rich people's money is worth less and is especially bad for creditors, those make money by loaning money to those of us who have to borrow money. Got it?

So basically, arguments over inflation targets are an interest group struggle: people who make money by loaning it to others want low inflation, because it benefits them. People who borrow money would like higher inflation, because it makes it easier for them to pay the money back.

NOTE: no one is arguing for Weimar Germany/Zimbabwe hyperinflation. This is an argument about whether we should have 1% inflation or 4% inflation.

Saturday, May 21, 2011

I Think I Figured It Out....

I realized why Republicans don't like the Health Care Individual Mandate: because it includes "man date", and that's just too gay.

Tuesday, May 17, 2011

Unix sort Insanity (Or is it Just Me?)

I just discovered (after way too much time poking about) that Unix sort does not split fields the way I naively assumed. I had thought that it split on whitespace, the way that awk does, but it does not. It splits on the zero-length "character" between a non-space and space character -- and then the space characters become part of the next field.

The nasty consequence of this is that whitespace-tabulated data that have a varying number of spaces (or tabs) between fields -- as opposed to fields separated by a single space, or a single tab, or single comma if you use '-t,' -- will not sort the way you might think.

For example:

$ STRING="fibble ab  de\ngorkle  bc cd\n"
$ printf "$STRING"
fibble ab  de
gorkle  bc cd

$ printf "$STRING" | sort -k 2,2
gorkle  bc cd
fibble ab  de

— i.e. the two spaces in front of 'bc' make ' bc' sort ahead of ' ac'.

And

$ printf "$STRING" | sort -k 3,3
fibble ab  de
gorkle  bc cd

— where the two spaces in front of 'de' make ' de' sort ahead of ' cd'.

 

This explains a great deal of bizarre behavior I've dealt with over the years, stuff I never had the time to drill down and deal with.

My usual fix for this sort of situation is to collapse whitespace into a single space character, sort, and then use my ~/bin/tabulate script on the end:

$ printf "$STRING" | 
  perl -pe 's/[ \t]+/ /g' | 
    sort -k 3,3 | 
      ~/bin/tabulate
gorkle bc cd
fibble ab de

I hope someone might find this useful. In other words, I hope I'm not the only one who took this long to understand this. :-)

 


From 'info sort' on Ubuntu:

`-t SEPARATOR'
`--field-separator=SEPARATOR'
     Use character SEPARATOR as the field separator 
     when finding the sort keys in each line.  By 
     default, fields are separated by the empty 
     string between a non-blank character and a 
     blank character.  By default a blank is a space 
     or a tab, but the `LC_CTYPE' locale can change 
     this.

     That is, given the input line ` foo bar', `sort'
     breaks it into fields ` foo' and ` bar'.  The 
     field separator is not considered to be part of 
     either the field preceding or the field following,
     so with `sort -t " "' the same input line has 
     three fields: an empty field, `foo', and `bar'.  
     However, fields that extend to the end of the 
     line, as `-k 2', or fields consisting of a range, 
     as `-k 2,3', retain the field separators present 
     between the endpoints of the range.

     To specify ASCII NUL as the field separator, use 
     the two-character string `\0', e.g., `sort -t '\0''.

Sunday, April 10, 2011

My Favorite Sign from Wisconsin

I know I'm late on this, but here's my favorite sign from the Wisconsin protests:

Imperial Cities

I'm coming more and more to the conclusion that Washington DC is an Imperial City.

I not making the argument here that the US is an empire (although the argument can certainly be made). I'm talking about what it means to HAVE an Imperial City.

I would suggest the following as archetypal Imperial Cities: Versailles, Beijing, and Edo (now Tokyo). (Given China's long history, Beijing is merely the most recent of its Imperial Cities.) I would contrast them with other Imperial Capitals like London and Rome. (Interestingly, Delhi/New Delhi forms an instructive hybrid.)

Imperial Cities are those that were built from the ground up to be capitals; they aren't centers of commerce or art or scholarship, except secondarily. They were often built to avoid commerce and art and scholarship, in fact. Usually they were explicitly created by a strong central ruler (Chinese Emperors, Louis XIV of France, the Tokugawa Shoguns) as a place to hold hostages — nobles would be required to send some members of their families to be in residence at all times in the Imperial City, or be themselves in residence.

Another major feature of these Imperial Cities is that the Court became its own society to the exclusion of almost everything else. Court Society dictated what people did, what they wore, who was in, who was out, usually in obsessive detail. This was directly or indirectly to the benefit of the central ruler, as anything that distracted the courtiers kept them from doing anything to take away from the center of power.

This is not to say that Court life in London, or its equivalent in Rome or other large capitals was not intellectually inbred or navel-gazing. But as an instructive contrast, if you were a courtier in the British government in the 17th century, you could physically leave the court and be watching a play, or in a coffee house discussing the events of the day with Samuel Pepys, or dining with the founders of modern science at the Royal Society, within a matter of minutes. There was nothing comparable at Versailles.

Washington DC was built from the ground up to be the capital city of the United States. There was little or nothing there before the current city was laid out. Whatever art and commerce that is there is a follow-on to the government.

If the capital of the United States had stayed in New York, or Philadelphia, instead of moving to a constructed city that had no other existence before the government arrived, what might have happened? Would various government functionaries feel closer to the people whose lives they affect, closer to some of the modes of life that exist outside of government?

Most importantly, would the press be so much like Versailles courtiers, dependent for their existence on the people they are, in theory, supposed to be challenging and whose statements they are supposed to be verifying instead of merely repeating?

Cynically, I wonder if having our capital in our primary commercial city would actually make that much of a difference. The New York Times certainly has failed in its duty often enough (they pursued the Whitewater "scandal" long after it was clear that there was nothing to find; they were slack-jawed credulous in the runup to the Iraq War, and so on, and they certainly participate in Broderism at a high level, although not quite at the pitch of the Washington Post). But I'm pretty sure that it wouldn't be worse than what we've got now.

I think the biggest sign that we have an Imperial City on our hands is the signal failure of the press "corps" to actually look at the substance of policy proposals, and their propensity to go with the conventional wisdom (especially when it is dependent purely on superficialities), and to go with horse-race or Inside Baseball-type coverage. ("Democrats say Earth is round; Republicans disagree.") And it's quite sad that this hasn't changed much, or has possibly gotten worse, in the five years since Stephen Colbert nailed them at the 2006 White House Correspondents' Dinner.