Wednesday, January 18, 2012

Why I Oppose SOPA and PIPA

I oppose SOPA and PIPA. Here's a good summary why: http://nielsenhayden.com/503_sopa.html.

The argument I included in my notes to my Congressional reps was this:

Imagine that Walmart and Target got up in front of Congress and argued that since people shoplift, they should be able to stop cars and trucks randomly on the streets and highways looking for stolen goods, and to take away drivers licenses at will. They would (I hope!) be laughed out of Washington. But that's effectively what the RIAA and the MPAA are demanding with SOPA and PIPA -- except that it's not just roads, it's the Internet they're demanding police powers over (with no oversight or appeal).

The Internet is the greatest force for free speech since the printing press. It is the medium through which a huge fraction of our news, entertainment, political discussion, and, indeed, of our economy flows.

Intellectual property piracy may be a problem -- although all independent research says that the RIAA and MPAA are exaggerating the problem by several orders of magnitude. Giving the five Hollywood studios, four multinational record labels, and six global publishers the keys to the Internet is an awful idea.

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''.