The Daily Parker

Politics, Weather, Photography, and the Dog

Hunting wabbits

(By way of explanation why I'm being wery wery qwiet today.)

Actually, I'm hunting financial accounting (Duke) and bugs (client). Like this one, which shows one of the perils of refactoring. See if you can spot my stupidity:

Original code

private void OldMethod
{
   bool canChangeThing =
   (
      _isCompany |
      _isClient &
      (
         someConditionA == true |
         someConditionB == true
      )
   );

   if (canChangeThing) 
   { 
      // do stuff 
   }
}

Refactored code

private bool CanChangeThing
{
   get
   {
      return (
         _isCompany |
         _isClient &
         !(null == _thing) &&
      	(
            someConditionA == true |
            someConditionB == true
         )
      );
   }
}

private void OldMethod
{
   if (CanChangeThing) 
   { 
      // do stuff 
   }
}

Fixed bug

private bool CanChangeThing
{
   get
   {
      return (
         _isCompany |
         (_isClient &
            !(null == _thing) &&
            (
               someConditionA == true |
               someConditionB == true
            )
         )
      );
   }
}

private void OldMethod
{
   if (CanChangeThing) 
   { 
      // do stuff 
   }
}

The sound you hear is me hitting my head on my desk until it stops hurting.

Quick hits

Lots to do for the next, oh, 17 months, so I thought I'd get started. My first Duke box arrived today, containing 6 kg of books, course packets, handouts, and more books, all of which have to be read by August 15th. Fortunately I have a few extra hours each day to do all this (I use them to sleep right now, so they're kind of wasted).

Just a couple news stories of note today:

  • President Obama gave an hour-long press conference yesterday in which he spent 50 minutes discussing the single most important domestic-policy issue in the U.S. right now, health care. Since health care policy is complex, full of compromises, difficult to understand, and absolutely imperative to fix, the network talking heads spent all their time today discussing a stupid Cambridge, Mass., police officer who made an ill-advised arrest Monday. This, in turn, is why network talking heads are useless. I can't wait to see Jon Stewart's take.
  • Mark Buehrle, who plays for the other Chicago baseball team, threw a perfect game this afternoon, the 2nd club history and only the 16th time ever in the major leagues. (A perfect game is one in which none of the offensive players gets on base by any means.)
  • Finally, Gidget the Chihuahua, aka the Taco Bell dog, died yesterday at 15.

Back to work...

How green is your city?

Via Beth Filar-Williams, the National Resources Defence Council has ranked U.S. cities by environmental factors. The study ranks 67 large (population 250,000+), 167 medium (100-250k), and 405 small (50-100k) cities on nine factors, including standard of living, water management, transportation, and environmental participation. Seattle comes out on top for big cities; San Francisco, 2nd; Chicago, 10th.

Other leaders include Madison, Wis. (medium) and Bellingham, Wash. Bottom of the pack: Lexington, Ky., Paterson, N.J., and Pine Bluff, Ark.

Amazon explains Orwellian deletion

Yesterday I pondered Amazon's deletion of works by Orwell, and asked for confirmation that they had deleted unauthorized (i.e., stolen) copies of the copyrighted material. Amazon last night confirmed this is, in fact, what happened:

An Amazon spokesman, Drew Herdener, said in an e-mail message that the books were added to the Kindle store by a company that did not have rights to them, using a self-service function. "When we were notified of this by the rights holder, we removed the illegal copies from our systems and from customers' devices, and refunded customers," he said.

Amazon effectively acknowledged that the deletions were a bad idea. "We are changing our systems so that in the future we will not remove books from customers' devices in these circumstances," Mr. Herdener said.

Now, I am not one who believes in perpetual copyright. I hate with a passion the Sonny Bono Mickey-Mouse Protection Copyright Term Extension Act of 1998, passed (seriously, I am not making this up) in part to protect the Disney rodent for another 20 years on the eve of its lapse into public domain. I think it's unconstitutional, making a mockery of the "limited terms" clause, and on top of that I think it's a shining example of the pernicious effects of money on politics.

However, it's a pretty clear law, and in the U.S. the coypright in Orwell's work will not expire until at least 2021, 70 years after his death. Think about that. If I live another 21 years, which I will do even if it kills me, this blog entry will be protected by copyright until the 22nd century���unless the U.S. Congress comes to its senses and returns us to a copyright law that comports with international standards. Orwell's copyrights have expired in other countries, including Canada, but that introduces a web of competing claims that Amazon doesn't want to touch.

In sum: Amazon deleting books off users' Kindles was stupid, but probably within the terms of service and copyright law. However, had the users backed up the affected devices, and if they'd downloaded copies from Canada, they'd still have the book—a loophole in the TOS that, I'm sure, Amazon's partners will want closed very soon.

Creepy Kindle cravenness?

I'd like confirmation on this: the Times' David Pogue reported today that Amazon deleted a particular author from people's Kindles overnight:

[A]pparently the publisher changed its mind about offering an electronic edition, and apparently Amazon, whose business lives and dies by publisher happiness, caved. It electronically deleted all books by this author from people’s Kindles and credited their accounts for the price.

You want to know the best part? The juicy, plump, dripping irony?

The author who was the victim of this Big Brotherish plot was none other than George Orwell. And the books were "1984" and "Animal Farm."

The Kindle forum thread on the topic reads, to me anyway, like the copies deleted were from a publisher that didn't have the rights to sell electronic copies. Like it or not, Orwell's works are still protected by copyright. So if the deleted copies were indeed sold by a publisher illegally, it's not like Barnes & Noble removing the book off your shelf and leaving 99c on the table; it's like Barnes & Noble discovering it had sold you a remaindered book and correcting the error.

On the other hand, perhaps an email explaining the situation might have helped Amazon in this case?

Cool mash-up

I sometimes shop at the Book Depository, a British online bookseller, because I'm a nerd. (Also because they have British editions and free shipping to the U.S.)

Today, I discovered their cool Google Maps mash-up, showing who is buying what on their site.

Did I mention I'm a nerd?

Cubs in Detroit

My cousin turned a very large round number on Wednesday, so, being cruel, I took him to the Cubs game in Detroit. I'll have a rare back-dated entry about that in a little bit, with some kvetching about Amtrak; for now, just some pictures of the game.

But first, a non-sequitur: via Paul Krugman, today is the 35th anniversary of the UPC bar code.

Anyway. The game. Yeah, we didn't see this coming:

Unfortunately, that's what happens when you strand 13 baserunners and go 1-for-15 with runners in scoring position. Sigh.

The park, also, didn't seem to have any character, bad or good. Wikipedia puts Comerica Park in the "Retro Classic" category with AT&T Park and Camden Yards, but somehow it just didn't have the character of those two. Something about the late 1990s just didn't work with baseball parks. I mean, does the baseball park need a merry-go-round? Really?

Even the scoreboard is boring:

And one last thing: I still think my phone is extra-special-cool:

Explanation of previous post; Why you need to read Sullivan

Two unrelated topics in one post? Preposterous. Unacceptable.

And yet.

First: my previous post reflected the difficulties in typing on a tiny G1 keyboard, which magnified the annoyances in maintaining a blog in the first place. Two entries disappeared after unintentional finger sweeps, and don't even get me started on the difficulties of adding an actual hyperlink from my phone. On the other hand, I can post from my phone, which I find so cool it makes me giddy. I do feel like someone living 80 years ago complaining about air travel: yes, ocean liners are more comfortable, and yes, the thing makes a lot of noise, but wake up: you can get from New York to London in one night. At some point the coolness overcomes the annoyance, and a new technology goes critical.

Second, if you're either (a) unaware of the unfolding news from Iran, or (b) not following it on Sullivan, you need to do both. This is what Democracy looks like. I'm more and more hopeful that Iran will prevail, and its unelected dictatorship will fall. It won't look like the U.S., the U.K., or any other European-style democracy, but possibly before the end of this summer, Iran will have an elected leader, and a legitimate government, for the first time in 30 years. There will be a terrific cost, but again: the Iranian people will, ultimately, win this.

I think Thomas Jefferson put it better than I ever could:

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable rights, that among these are life, liberty and the pursuit of happiness. That to secure these rights, governments are instituted among men, deriving their just powers from the consent of the governed. That whenever any form of government becomes destructive to these ends, it is the right of the people to alter or to abolish it, and to institute new government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their safety and happiness.

Wear green this week if you agree.

Not the intended post

I was going to post about the virtues of the Cubs and the T-Mobile G1, but the latter revealed its limitations while I used it to extol the former. Suffice to say: Cubs won, G1 tied, and it's time to go inside.