The Daily Parker

Politics, Weather, Photography, and the Dog

It is finished.

I have successfully ported my first (existing) application to the Microsoft Windows Azure platform, and have shut down the running instance on my local Web server. I hope the second one takes less than a week.

It's a funny little site called Boxer's Shorts. Dr. Bob Boxer is a local allergist who likes puns. He worked with a local illustrator, Darnell Towns, and self-published the five paperback pun compilations advertised on the site.

Local web designer Lauren Johnson (née Liss) did the look and feel, and I provided the platform. I think we completed the site in two weeks or so. I've hosted it since it went live in September 2006—just a few days after I got Parker, in fact.

And now it's in the cloud, the first Inner Drive site to be ported. From what I learned doing it, I hope to get two more of my older sites deployed to Azure this week.

Why I haven't finished deploying to Azure

I've spent much of the past week trying to get a single, small website up into the cloud on the Windows Azure platform. Much of this effort revolved around the Azure Website product, mainly because it's free. Well, I got the application up as an Azure website...and there's a big problem with it that means I'll have to redeploy it as a Web role after all.

First, let me just outline how much fun I've had today, starting from this morning when I first tried to publish the application to the cloud:

  • For the first hour or so, I dealt with a missing patch that prevented publishing entirely.
  • My next task, after I got the bits up to Azure, was to track down why the application failed on the method RoleEnvironment.IsAvailable, which you need if you want to deploy something to an Azure Web role. First I got this:
    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.
  • The solution was simply to go to the Solution Explorer and mark the ServiceRuntime assembly as "copy local" instead of "do not copy." That fixed it. Until the next time I tried to run, when I got this:
    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.
  • Fortunately, developer Jake Ginnivan had exactly this problem yesterday. (Wow, who doesn't love Google?) Of course, that required me to compile the whole site as x86, not x64:

At this point, the entire site seemed to work. Except now I wasn't getting any exception messages. Nor was I able to get a "contact us" email. Some digging showed that my code—yes, my code—was swallowing exceptions, and throwing the wrong exceptions.

This is because the Inner Drive Extensible Architecture message system loads configuration if you don't provide it, getting the configuration file spec from the web.config file. Only, in every single instance where the thing is in production, I control the file system, so I've never had a problem knowing where the configuration file actually lives. (I also solved the problem of how to get configuration from Azure storage, as a pain I described earlier today.) The configuration setting looks like this:

<appSettings>
   <add key="messageConfigFile" value="c:\SomeActualPath\MessageConfig.xml"/>
</appSettings>

You can also use a relative path if you know the root. On Azure web sites, it turns out the root is D:\Windows. Seriously. On my little slice of a shared server, the actual path to the application is something like C:\DWASFiles\Sites\Site-Name\VirtualDirectory0\site\wwwroot\. The "virtual" part scares me; this path is not guaranteed. This is what we call in programming "brittle."

So I wound up using a relative path from the application root and adding this code to the application start method:

var configurationFile = ConfigurationManager.AppSettings["messageConfigFile"];
var fileSpec = Server.MapPath(configurationFile);
Publisher.Instance.Load(fileSpec);

I deployed it again and yay! After adding that bit of code, and spending a total of 6.9 non-billable hours on this, I finally got the application to run as a free Azure web site with its azurewebsites.net address. So all I have to do now is add a CNAME record pointing the site's real URL to this one and...

You're kidding me.

Free Azure websites running on shared instances only allow a single hostname per site:

This means that I can't use www.mysitename.com to point to mysitename.azurewebsites.net, which means the whole effort is kind of wasted, except to use the thing as a staging site. Moving to a reserved instance solves the problem, but costs 8c per hour of compute time. But for only 2c and hour, I can use a traditional Web role in an extra-small instance. I'm pretty sure this particular site won't run continuously, but still, why pay any more than required?

Almost everything I did today also applies to publishing the application to a Web role, but now I have to pay money for it. Dang.

Why Parker is disappointed in me right now

Yes, I just said I was taking Parker out for a walk, but I cut it short after five minutes. Here's why:

Just as we got back home the gust front hit. Trees are now moving in ways that trees probably shouldn't. This should be a lot of fun to watch.

...but Parker is sulking. Tant pis, mon bête noir.

Update, 1:25 pm: Huh. The storm just missed us, though reports have come in of 145 km/h gusts in Elmhust and Lombard, which "looks like a war zone" according to the Tribune.

Who may I strangle, please?

In the past week, I've been "on the bench" at work, so I've take the time to get deeply familiar with Microsoft Windows Azure. My company, 10th Magnitude, is a 100% cloud-computing shop, and a Microsoft partner. I've been developing for Azure Web applications for a year, but I haven't had to deal with migrating existing sites, pricing, or configuration on my own; this is why we're a team, right?

So, anyway, I've taken what I've learned at work, and:

  • Selected a simple website to migrate; in this case, Boxer's Shorts, a project I completed in 2006 that has five rows of data and five content pages;
  • Worked for about 16 hours this week creating Azure implementations of the Inner Drive Extensible Architecture features that won't work on Azure—but only the two features (messaging and logging) that Boxer's Shorts needs;
  • Spent 6 hours yesterday and an hour today preparing the application for Azure; and
  • Set up an Azure Web site this morning into which I was about to publish the ready-to-roll Web site.

Remember the messaging and logging services I spent lots of time migrating? Well, it looks like I made the right choice in the long run. The services use Azure tables and blobs for logging, holding the site configuration data, and in this site's case, for holding the list of books. Azure storage is really, really cheap, less than 10c per gigabyte for locally-redundant storage or 12.5c per gigabyte for geo-redundant storage. This is de rigeur for a traditional Azure Web role deployment for everything that can run without relational data. (For relational data you need SQL Server.)

I thought—mistakenly, it turns out—that if it worked in a Web role it would work in a Web site. No, not so much. In the short run, I just discovered this:

Ah. No blob storage for Azure web sites. So now I have to strip out all of the stuff that uses blob storage on this web site, and modify the book list to use SQL Server instead of Azure tables. Two more hours.

So why not just publish the site to a Web role instead? Price. With Azure, you get 10 free Web sites with your subscription; but each Web role costs at least 2c per hour for the smallest possible footprint. There are 720 hours in a month, so even though you only pay for the time the application is actually doing something, you have to plan for about $14 per month. For a site that gets 100 page-views per week, has five content pages, and five pieces of data, that's really a lot of money. And it's infinitely more than free.

All right then. I hope that Azure websites get access to Azure storage soon. For now, I'm just going to rip the logging out of the site and fix the rest of it. But first I'm going to walk the dog.

Azure build error messages aren't helpful

When working with Microsoft Windows Azure, I sometimes feel like I'm back in the 1980s. They've rushed their development tools to market so that they can get us developers working on Azure projects, but they haven't yet added the kinds of error messages that one would hope to see.

I've spent most of today trying to get the simplest website in my server rack up into Azure. The last hour and a half has been spent trying to figure out two related error messages that occurred when trying to debug a Web application project that I converted from a Web site project:

  • Failed to debug the Windows Azure Cloud Service project. The output directory ' { path }\csx\Debug' does not exist.
  • Windows Azure Tools: Can't locate service descriptions.

The first error message seems straightforward enough: when the project got created, it never added the \csx\Debug folder. After creating the empty \csx\Debug folder, the second message occurs.

When an Azure project builds, it's supposed to create the \csx\Debug folder under the Cloud Service project root. It then copies the service definition (.csdef) and configuration (.cscfg) projects into the folder, which the Azure compute emulator can hook into.

In my project, this wasn't happening. So I created a new Cloud solution to see if this was a system problem or a configuration problem. (First I uninstalled and reinstalled all the Azure tools...which wasn't as big a time-suck as it could have been because I walked Parker while that was going on.)

The Deleteme solution built fine; mine still had the problem. So then I started comparing the configuration, project, and solution files...and completely missed the significance of this:

...except it gnawed at me for a few minutes, until I looked at this:

Why it created a configuration and then decided not to build it I just don't know. The solution to my hours of pain is simply to do change the solution platform to Any CPU (or check "build" on the .NET platform):

I am now going to fix the hole in my desk where I've been pounding my head.

When I started getting these messages, I Googled and I Googled, but the technology is so new that no one else appears to have had exactly this problem. I hope this post pays back some of the Karmic debt I've taken on from all the times when someone else had the right answer.

Have the GOP always been like this?

The Texas Republicans published their 2012 platform this week, vowing to stop teaching children critical reasoning skills in the next four years. I was curious about other GOP platforms, to see if Texas was an aberration, and I found this one:

Resolved, That we, the delegated representatives of the Republican electors of the United States, in convention assembled, in discharge of the duty we owe to our constituent and our country, unite in the following declarations:

...

8. That the normal condition of all the territory of the United States is that of freedom; that as our republican fathers, when they had abolished slavery in all our national territory, ordained that no "person should be deprived of life, liberty or property, without due process of law," it becomes our duty, by legislation, whenever such legislation is necessary, to maintain this provision of the constitution against all attempts to violate it; and we deny the authority of congress, of a territorial legislature, or of any individuals, to give legal existence to slavery in any territory of the United States.

12. That while providing revenue for the support of the general government by duties upon imports, sound policy requires such an adjustment of these imposts as to encourage the development of the industrial interests of the whole country, and we commend that policy of national exchanges which secures to the workingmen liberal wages, to agriculture remunerating prices, to mechanics and manufacturers an adequate reward for their skill, labor and enterprise, and to the nation commercial prosperity and independence.

14. That the Republican Party is opposed to any change in our naturalization laws, or any state legislation by which the rights of citizenship hitherto accorded by emigrants from foreign lands shall be abridged or impaired; and in favor of giving a full and efficient protection to the rights of all classes of citizens, whether native or naturalized, both at home and abroad.

The rest of it is pretty interesting, and also short. Obviously I'm quoting their first presidential-election-year platform, from 1860, so much of it applies to the situation that existed right before the Civil War.

Today's Illinois GOP platform, while saner (only just) than the Texas platform, still has these planks:

  • A call to "meet the contractual obligations of our state by properly funding the various state pension systems" without raising revenue to do it;
  • An assertion that kids are better off "within a two-parent family based on the principle of marriage between one man and one woman;" and
  • The anti-science position that "The Illinois Republican Party opposes the fostering of utilitarian experiments which sacrifice human embryos in what appears to be a futile search for medical cures."

On the other hand, some of their planks really surprised me:

  • "We call on the Federal Government to streamline the task of citizenship for legal immigrants to assimilate and complete the process of becoming Americans."
  • "We call for the granting of full citizenship rights to be granted to any immigrant upon the completion of service to the armed forces of the United States."
  • "[W]e endorse...[t]he use of criminal and mental background checks by licensed firearms dealers...."

Finding three planks to support out of the entire platform took some effort, though. A lot of it repeats the right-wing policies of the national GOP, like opposition to taxes in general, support for a concealed-carry firearms law, and one of my favorites, "We call on the United States Senate to reject treaties which cede the powers and rights of the American people to the United Nations and other international agencies." (Because of the black helicopters following some of the more, ah, committed party members, you see.)

I'm sure a careful reading of my party's platform (which, unfortunately, is spread across 14 pages of the party website rather than being written down in any one document) would uncover a few planks I don't support. I expect, though, I've chosen the right bunch for now. When the Republicans shed themselves of the right-wing nutters currently running things for them, maybe I'll take another look.

Texas GOP: To One Over Infinity and Beyond!

The Texas Republican Party has published their platform after their recent convention, and...well:

We decry the appointment of unelected bureaucrats, and we urge Congress to use their constitutional authority to defund and abolish these positions and return authority to duly elected officials, accountable to the electorate.

We strongly support the immediate repeal of the Endangered Species Act. We strongly oppose the listing of the dune sage brush lizard either as a threatened or an endangered species. We believe the Environmental Protection Agency should be abolished.

We oppose the teaching of Higher Order Thinking Skills (HOTS) (values clarification), critical thinking skills and similar programs that are simply a relabeling of Outcome-Based Education (OBE) (mastery learning) which focus on behavior modification and have the purpose of challenging the student’s fixed beliefs and undermining parental authority.

We urge that the Voter Rights Act [sic] of 1965 codified and updated in 1973 be repealed and not reauthorized.

We affirm that the practice of homosexuality tears at the fabric of society and contributes to the breakdown of the family unit. Homosexual behavior is contrary to the fundamental, unchanging truths that have been ordained by God, recognized by our country’s founders, and shared by the majority of Texans.

If you're happy and you know it, clap your eyes.

This makes me curious, actually. I might check out the platforms of other states' Republican parties, particularly Illinois'. And the Democratic Party platform here. Updates as warranted.

Officially hotter than hell

The temperature in downtown Chicago edged up to 100°F (38°C) this afternoon:

At 2:23 pm the temperature at Midway Airport as measured by observer Frank Wachowski reached 37.83°C . Last summer Midway recorded triple-digits on two occasions: July 20, 37.8°C, and July 21, 38.3°C. On both of those days the city's official thermometer at O'Hare International Airport peaked at 37.2°C.

So far today O'Hare's temperature has peaked at 37.2°C but should reach 37.8°C or higher later this afternoon. The city's last official 37.8°C day was on July 24, 2005 when the mercury hit 38.9°C.

I really don't want to go outside...but I have to go home at some point. Maybe I'll do an impromptu pub crawl to and from the El...

Court upholds the individual mandate; overturns Medicaid expansion

In my first pass through National Federation of Independent Business v. Sebelius, I am alternately stunned, fascinated, confused, and relieved. The more I think about it, though, the more I realize that big business was the big winner today.

Chief Justice Roberts delivered the opinion of the Court, upholding nearly all the provisions of the Affordable Care Act (aka "Obamneycare"). Justice Kennedy, usually the swing vote, joined on the right-wing dissent.

In a nutshell, the court ruled:

  • The Anti-Injunction Act didn't bar the suit;
  • The individual mandate can stand; but
  • Congress can't cut off Medicaid funds to states if the states fail to expand Medicare coverage.

The Court decided the first two points on mutually-contradictory grounds. The Anti-Injunction Act prohibits people from filing suit "for the purposeof restraining the assessment or collection of any tax." So if the individual mandate is a tax, then no one can sue to stop it until after it actually takes effect. Under the individual mandate part of the ACA, the law says if you don't buy insurance as mandated starting in 2014, you have to pay a "penalty" to the IRS. Well, said Roberts, if Congress says it's a penalty, then it's not a tax, and so the Anti-Injunction Act doesn't apply. In other words, if Congress says something is a horse, then you can't sue it to keep it from flying.

In law school, we learn a Jedi mind trick called "permissibly advancing mutually-exclusive arguments." That is, a lawyer is not only permitted but expected to offer all reasonable theories of a case when making an appeal, even if they don't make any sense when viewed all together.

Say a lawyer is appealing a murder conviction. She may, with the Court's blessing, argue: "First, the judge used the wrong set of jury instructions. Second, the jury was tainted by the prosecutor. Third, the judge improperly let my client's confession into evidence. Fourth, the eyewitnesses who testified they saw my client kill the guy were tainted by the prosecutor. Fifth, the judge should have allowed my client's rabbi to testify. Sixth..."

Obviously, they can't all be true. And a reasonable person (other than a lawyer) might surmise from the arguments that, really, the client's a murderer. This is the sort of thing that (a) makes people hate lawyers and (b) provides us with safeguards against the legal process running amok. It's not obvious to most people, but the ability to make all possible arguments on appeal, even if some are self-contradictory, is much fairer to everyone than trying to guess which one argument will prevail.

After that explanation, it should come as no surprise that the Court found the individual mandate constitutional because it's a tax. Yes, Congress called it a horse; but it's a duck after all, and ducks gotta fly. "[I]t is well established that if a statute has two possible meanings, one of which violates the Constitution, courts should adopt the meaning thatdoes not do so," Roberts said in the Court's opinion today:

As we have explained, "every reasonable construction must be resorted to, in order to save a statute from unconstitutionality." Hooper v. California, 155 U. S. 648, 657 (1895). The Government asks us to interpret the mandate as imposing a tax, if it would otherwise violate the Constitution. Granting the Act the full measure of deference owed to federal statutes, it can be so read....

I should underscore here that the Court said the individual mandate is not constitutional as a regulation of interstate commerce or as a "necessary and proper" act of Congress. This, I believe, is how the four moderate Justices got Roberts on board. Roberts seems like a true conservative. He generally doesn't want to overturn acts of Congress, but at the same time he generally doesn't to expand Federal power. He writes: "The Federal Government does not have the power to order people to buy health insurance. Section 5000A would therefore be unconstitutional if read as a command. The Federal Government does have the power to impose a tax on those without health insurance. Section 5000A is therefore constitutional, because it can reasonably be read as a tax."

Similarly, he overturns the Medicaid expansion program, with its penalty of withholding substantial Medicaid funding if states don't comply, as:

much more than "relatively mild encouragement"—it is a gun to the head. Section 1396c of the Medicaid Act provides that if a State’s Medicaid plan doesnot comply with the Act’s requirements, the Secretary ofHealth and Human Services may declare that "further payments will not be made to the State." 42 U. S. C. §1396c. A State that opts out of the Affordable Care Act’s expansion in health care coverage thus stands to lose not merely “a relatively small percentage” of its existing Medicaid funding, but all of it.

(Emphasis in the original.) He goes on, rebutting a point Justice Ginsburg makes in her concurrence:

The Medicaid expansion, however, accomplishes a shift in kind, not merely degree. The original program was designed to cover medical services for four particular categories of the needy: the disabled, the blind, the elderly, and needy families with dependent children. See 42 U. S. C. §1396a(a)(10). Previous amendments to Medicaid eligibility merely altered and expanded the boundaries of these categories. Under the Affordable Care Act, Medicaid is transformed into a program to meet the health careneeds of the entire nonelderly population with income below 133 percent of the poverty level. It is no longer aprogram to care for the neediest among us, but rather anelement of a comprehensive national plan to provide universal health insurance coverage.

Ah, there it is. The bugbear. The Policy that Will Not Pass: National health insurance coverage.

Roberts' opinion is a grudging concession to the 21st century, not a victory for progressives. His rationales for overturning Medicaid expansion, and for rejecting two good reasons for the individual mandate are designed to prevent a future Congress from moving to a single-payer system in the future. The opinion holds the line on keeping wealth in private hands, which, after all, is the right's principal goal. Private interests—insurance companies—will continue to profit from what ought to be a public service. (Don't forget: big insurance companies wanted the mandate, because it solves a huge business problem for them.)

Today is a win for the American people, and for President Obama; but Roberts, no idiot he, made sure it was a win for the big-business right as well.

(If I have the stomach for it, I'll read the Alito dissent later today.)

Court upholds main parts of ACA

The New York Times just sent me a bulletin saying the Supreme Court has ruled on the Affordable Care Act, so I rushed to the Court's website to find...U.S. v. Alvarez.

In this case, a man falsely claimed to have won the Medal of Honor, and was convicted under 18 USC 704 (the "Stolen Valor Act"), which makes it a crime to lie about receiving military honors. In a 5-3 decision, the court said the act is unconstitutional under the first amendment. Justice Kennedy wrote the court's opinion, joined by Chief Justice Roberts and Justices Sotomayor and Ginsburg; Justice Breyer concurred (joined by Justice Kagan); and Justices (and Republican party operatives) Alito, Scalia, and Thomas dissented.

I'll come back to that—because the Court just announced National Federation of Independent Business v. Sebelius. Let me read this and follow up. Gimme a second.