The Daily Parker

Politics, Weather, Photography, and the Dog

Bloodletting and leeches

Krugman yesterday reminded us that people are so desperate for the security that investing in the U.S. brings them, they're paying us to take their money, at alarming rates of negative interest:

That’s right: for every maturity of bonds under 20 years, investors are paying the feds to take their money — and in the case of maturities of 10 years and under, paying a lot.

What’s going on? Investor pessimism about prospects for the real economy, which makes the perceived safe haven of US debt attractive even at very low yields. And pretty obviously investors do consider US debt safe — there is no hint here of worries about the level of debt and deficits.

Now, you might think that there would be a consensus that, even leaving Keynesian things aside, this is a really good time for the government to invest in infrastructure and stuff: money is free, the workers would otherwise be unemployed.

But no: the Very Serious People have decided that the big problem is that Washington is borrowing too much, and that addressing this problem is the key to … something.

Conservatives here and in the UK (another country with unprecedented low government interest rates) have either a delusion or a willfully dishonest belief in the dangers of deficits. Yes, both countries have long-term deficit problems that need resolution, and both countries will need lower defense and entitlement spending to close their gaps. But that's in 20 years.

Right now, we need to take this free money (five-year Treasuries are at -1.18%; ten year notes are at -0.68%) and abundant labor (nationally still around 9% unemployment) and rebuild. We need to repair our roads, upgrade our trains, fix our sewers and electric grids, and restore our countries to the economic strengths they have had in decades past.

Those on the right, however, want to continue bloodletting, draining us of our strength when we're weakest. Or, put another way, if someone is starving, withholding food won't help him. Lending him some food might just get him feeling better again.

Ten years from now we're going to look back on this period of Republican and Tory intransigence, laugh nervously, and change the subject. If we're supremely lucky, we'll be out of the economic traps that their misguided policies have created for us.

Dual Microsoft Azure deployment: Project synchronization

Last week I offered developers a simple way to simultaneously deploy a web application to a Microsoft Azure web site and an Azure Cloud Services web role. Today I'm going to point out a particular pain with this approach that may make you reconsider trying to deploy to both environments.

Just to recap: since Azure web sites are free, or nearly so, you can save at least $15 a month by putting a demo instance of your app there rather than having a second web role for it. You'll still use a web role for your staging and production environments, of course.

While reading my last post, though, sharp-eyed developers might have noticed that the dual approach creates some additional maintenance overhead. Specifically, you'll need to keep both solution (.sln) files and both web project (.csproj) files in sync. This becomes part of your staging deployment task list, which means you probably only have to synchronize the files once every few weeks, not such a big deal. Still, if you've never hand-edited a solution or project file before, it can be a little daunting.

The solution file probably won't require much synchronization, unless you've added new projects—or new files outside of projects—to the solution. For example, at 10th Magnitude we like to keep all of our database scripts in the solution tree, for easy access. (We also use the open-source RoundhousE tool for database deployment, which I'll talk about in a subsequent post.) If we add new database files to the web site solution, they won't automatically show up in the web role solution. Same with the web project file: adding new controllers, views, or web forms to a project is very common. So you'll have to make sure all the changes in the web site project get migrated over to the web role project.

Keep in mind, though, that some things will remain different between the two pairs of files. The web role solution will have a Cloud Services project, mapping the web and worker role entry points, which the web site won't have. And the web site project file will have references to Microsoft.WindowsAzure.ServiceRuntime.dll and msshrtmi.dll that the web role project won't have. Here's a synchronized pair of solution files, using Beyond Compare to show the deltas:

And here are the two project files, also synchronized, showing the differences you need to wind up with:

One final thing to consider: if you have a paying client, they might not want to pay for development time to synchronize the two deployment environments. If you're charging $125 an hour, and you spend 30 minutes every four weeks—$62.50—to save the client $15 for an additional cloud services instance, that isn't good value. But for an internal application (like the 10th Magnitude brochure site), or for a personal project, the savings might be worth the hassle.

Why airline fees will only get worse

Via Gulliver, airlines earned $22.6 bn from ancillary fees in 2011 (pdf), up 66% from 2009:

Once largely limited to low fare airlines, ancillary revenue is now a priority for many airlines worldwide, and the Review announced today shows how far the industry’s approach to ancillary revenue has developed in recent years.

Jay Sorensen, President of IdeaWorksCompany, says: “Our first report into ancillary revenue was issued in 2007, when only 23 airlines worldwide disclosed ancillary revenue activity in financial filings, and the result was a modest €1.72 billion ($2.45 billion). Four years later, 50 airlines today disclose ancillary revenue activity of €18.23 billion ($22.6 billion). It’s clear that airlines recognize the importance of ancillary revenue and are developing increasingly innovative ways to generate this.”

"Increasingly innovative." Nice. Anyone remember this ditty from Fascinating Aida, which now applies as much to United as it did to Ryanair?

Complete lacks of terror

Two examples of how Europeans handle things differently than we do. First, Norway's refusal to be terrorized by lunatics with guns:

The car-bomb in Oslo designed to kill the leadership of the country, and the shootings on the island of Utoeya designed to destroy the next generation of Labour party politicians, left 77 people dead, the majority of them teenagers.

But even in the first days of shock after the attacks, it was clear the response of the Norwegian people and their government to this act of terrorism would be unique.

"The Norwegian response to violence is more democracy, more openness and greater political participation," [Prime Minister Jens Stoltenberg] said.

A year later it seems the prime minister has kept his word.

There have been no changes to the law to increase the powers of the police and security services, terrorism legislation remains the same and there have been no special provisions made for the trial of suspected terrorists.

On the streets of Oslo, CCTV cameras are still a comparatively rare sight and the police can only carry weapons after getting special permission.

Even the gate leading to the parliament building in the heart of Oslo remains open and unguarded.

Meanwhile, just across the Baltic, Germany and the ECB seem frighteningly nonchalant about the possibility of Greece exiting the euro:

I’m not saying that Greece should be kept in the euro; ultimately, it’s hard to see how that can work. But if anyone in Europe is imagining that a Greek exit can be easily contained, they’re dreaming. Once a country, any country, has demonstrated that the euro isn’t necessarily forever, investors — and ordinary bank depositors — in other countries are bound to take note. I’d be shocked if Greek exit isn’t followed by large bank withdrawals all around the European periphery.

To contain this, the ECB would have to provide huge amounts of bank financing — and it would probably have to buy sovereign debt too, especially given the spiking yields on Spanish and Italian debt that are taking place as you read this. Are the Germans ready to see that?

My advice here is to be afraid, be very afraid.

Don't even get me started on anthropogenic climate change theory, which predicted just about everything we're experiencing in North American weather this year.

Oh, Cubs

I hung out with some very old friends yesterday, and throughout our barbecue we checked up on the Cubs. By the time we went inside, it was top of the 7th, no score.

Then this happened:

Rafael Furcal's go-ahead single in the seventh turned out to be a mere appetizer as the Cardinals also matched an 86-year-old franchise record for runs in an inning. St. Louis totaled 10 hits with multiple hits by three players including pinch-hitter Allen Craig, who doubled twice with an RBI.

The Cardinals totaled nine doubles for the first time in franchise history since setting a modern major league record with 13 doubles on July 12, 1931, against the Cubs.

Cubs starter Matt Garza was taken out after three scoreless innings with cramping in his right triceps, an injury that wasn't obvious and prompted speculation that he had been traded. The Cubs added a bit of intrigue, waiting until the bottom of the sixth to announce the injury and the fact X-rays -- as a precaution for possible elbow issues -- were negative.

Germano got unlimited warmups in the fourth, an indication he was entering because of an injury or ejection, although the rule book also allows for an unspecified sudden emergency. Germano allowed a run in three-plus innings before the roof caved in on the Cubs, who allowed 12 runs in an inning for the first time since July 30, 2010, at Colorado.

Twelve runs. One half of an inning. Twelve runs. Only the presence of one friend's 11-year-old daughter kept us from expressing our true feelings about what we were watching unfold before us.

After 35 years of watching them do things like that, I'm starting to think of moving on.

Too-brief reprieve

After seven days above 32°C in a row, Thursday gave us a humid, rainy 28°C before yesterday's perfect, dry 27°C. We've had a record 32 days above 32°C since June 1st, six more than we had by this time in the previous-hottest summer I remember, 1988.

The forecast for the next few days looks grim: 32°C today, 34°C Sunday, and 39°C Monday.

Welcome to the new normal: in just a couple of years, Chicago has gone from hard winters and mild summers to mild winters and broiling summers. And the climate is still changing...

Dual Microsoft Azure deployment, part 1

(This is cross-posted on the 10th Magnitude blog.)

In my last post, I talked about using Azure web sites to save beaucoup bucks over Azure Cloud Services web roles on nonessential, internal, and development web applications. In this post I'll go over a couple of things that bit me in the course of deploying a bunch of applications to Azure web sites in the last two weeks.

First, let me acknowledge that engineering a .NET application to support both types of deployment is a pain. Azure web sites can't use Cloud Storage, including tables, blobs, and queues. You'll need to architect (or refactor) your application to get its data from different sources based on whether it's running inside Cloud Services or not.

Once you've done all that (simple, right?), one line of code will let the application know where it is:

if (RoleEnvironment.IsAvailable) { DoCloudServicesStuff(); }

But here's the catch. Azure web sites don't have access to the RoleEnvironment class by default. The class lives in the Microsoft.WindowsAzure.ServiceRuntime assembly, which Cloud Services applications get through their VM's GAC and which website applications do not.

So even for your application to determine whether it's running in Cloud Services or not, you'll have to add two assemblies to the website project file: Microsoft.WindowsAzure.ServiceRuntime.dll and msshrtmi.dll. If you don't, you'll get one of these runtime errors:

Could not load file or assembly 'Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Could not load file or assembly 'msshrtmi, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

(On my computer, the ServiceRuntime assembly is in "C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-06\ref" and msshrtmi is in "C:\...\2012-06\bin\runtimes\base\x86\".)

Once you have added those two references to your web project, find them in the References list under the project root, select both, right-click, and open the Properties tab. Then set both of them to Copy Local = true, like this:

Copy msshrtmi local image

This tells the Publisher to include them in the deployment to Azure web sites. Note that you'll have to include these in your web application if any of the satellite assemblies uses the RoleEnvironment class (like our time zone handler, for example).

But now you have a new problem if you have dual deployments: you need two web project files, because the Cloud Services deployment will crash when the web role starts if you have those two assemblies referenced explicitly. And if you have two different web application project files, you'll need two solution files as well.

Of course, it only takes about two minutes to:

  • Make a copy of the solution file (usually "MyApplication-WebRole.sln" or "MyApplication-Website.sln" for the new copy);
  • Make a copy of the Web project file (you don't need different versions of your other assembly projects);
  • Manually edit the new solution file to point to the new project file.

(You could, I suppose, accomplish the same thing with build scripts and lots of conditional compile regions, but I can't call that an improvement. Like I said, this approach has more PITA than a falafel stand.)

We also find it helpful to wait until late in the development cycle to create the second solution/project pair of files, because you'll need to keep the two project files identical except for the two assembly references.

You have to do one more thing, unfortunately. You need to build your website deployment for the x86 platform target:

Visual Studio 2010 example of building as x86

The msshrtmi assembly requires explicitly building the application for x86 or x64 deployments, depending on whether you grab it from "C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-06\bin\runtimes\base\x86\" or "...\x64\". But we've run into other problems trying to use the x64 version, so we don't recommend it.

Chicago sunrise chart, 2012-13

I'm a little late getting the semi-annual Chicago sunrise chart out this summer. Sorry. (You can get one for your own location at http://www.wx-now.com/Sunrise/SunriseChart.aspx.)

Date Significance Sunrise Sunset Daylight
2012
2 Jul 8:30pm sunset 05:20 20:30 15:09
16 Jul 5:30am sunrise 05:30 20:24 14:53
8 Aug 8pm sunset 05:53 20:00 14:06
16 Aug 6am sunrise 06:00 19:48 13:48
28 Aug 7:30pm sunset 06:13 19:30 13:16
13 Sep 6:30am sunrise 06:30 19:03 12:33
15 Sep 7pm sunset 06:33 19:00 12:28
22 Sep Equinox, 09:49 CDT 06:39 18:48 12:08
25 Sep 12-hour day 06:42 18:42 12:00
2 Oct 6:30pm sunset 06:50 18:30 11:40
13 Oct 7am sunrise 07:01 18:13 11:10
21 Oct 6pm sunset 07:11 18:00 10:48
3 Nov Latest sunrise until 2 Nov 2013
Latest sunset until Mar 2nd
07:27 17:42 10:15
4 Nov Standard time returns
Earliest sunrise until Feb 28th
06:28 16:41 10:13
6 Nov 6:30 sunrise 06:30 16:39 10:08
15 Nov 4:30pm sunset 06:41 16:30 9:49
1 Dec 7am sunrise 07:00 16:21 9:21
7 Dec Earliest sunset of the year 07:06 16:20 9:14
21 Dec Solstice, 05:12 CST 07:16 16:23 9:07
2013
3 Jan Latest sunrise until Oct 28th 07:19 16:33 9:13
27 Jan 5pm sunset 07:08 17:00 9:52
4 Feb 7am sunrise 07:00 17:10 10:10
20 Feb 5:30pm sunset 06:39 17:31 10:52
26 Feb 6:30am sunrise 06:30 17:38 11:08
9 Mar Earliest sunrise until Apr. 14th
Earliest sunset until Oct. 28th
06:12 17:51 11:38
10 Mar Daylight savings time begins
Latest sunrise until Oct. 22nd
Earliest sunset until Sept. 20th
07:11 18:52 11:41
17 Mar 7am sunrise, 7pm sunset
12-hour day
06:59 19:00 12:01
20 Mar Equinox 06:02 CDT 06:54 19:04 12:10
3 Apr 6:30am sunrise (again) 06:30 19:19 12:49
13 Apr 7:30pm sunset 06:13 19:30 13:16
22 Apr 6am sunrise 06:00 19:39 13:39
10 May 8pm sunset 05:36 20:00 14:24
15 May 5:30am sunrise 05:30 20:05 14:36
14 Jun Earliest sunrise of the year 05:15 20:28 15:12
21 Jun Solstice 00:04 CDT
8:30pm sunset
05:16 20:30 15:14
26 Jun Latest sunset of the year 05:17 20:31 15:13

You can get sunrise information for your location at wx-now.com.

Sing along with Parker

A couple of days ago I discovered a new behavior in Parker. While listening to Martha Berner's song "A Town Called Happiness," which has an extensive harmonica part, Parker started to howl. Not in pain, though: he stayed in the room, and even got closer to the noise, tail wagging.

Apparently this is common dog behavior, and it really does mean he's just singing along.

So I dug out my dad's old harmonica and, yes, he sang along with that, too. In the upper ranges he really put his heart into it, too.

I know the behavior came out of those ancient days when wolves roamed free and men cowered at their howls...but this is Parker, and it's freaking adorable.