The Daily Parker

Politics, Weather, Photography, and the Dog

Brief visit to April ending soon

It's 12°C in Chicago right now, a temperature perfectly normal for April 1st, and 12.2°C above normal for January 13th.

This week's spring-like temperatures and the medium-term climate forecast make it likely that January 2013 will be the 335th consecutive month of above-normal temperatures. That means, if you're under 28 years old and lived in the U.S., you have never experienced a normal month.

Sadly, tonight things get back to normal:

Here's the forecast graph:

Boy, I can't wait for the freezing rain and sleet coming in 15 hours.

White House petition response of the Millenium

Via TPM, the White House has responded to the petition to build a Death Star:

This Isn't the Petition Response You're Looking For

The Administration shares your desire for job creation and a strong national defense, but a Death Star isn't on the horizon. Here are a few reasons:

  • The construction of the Death Star has been estimated to cost more than $850,000,000,000,000,000. We're working hard to reduce the deficit, not expand it.
  • The Administration does not support blowing up planets.
  • Why would we spend countless taxpayer dollars on a Death Star with a fundamental flaw that can be exploited by a one-man starship?

Perhaps the previous administration would have been more amenable?

Making my argument for me

How many of you have seen this floating around the Intertubes?

President Obama walking to inauguration

This purports to show how guns make us safer by depicting the President of the United States walking down Pennsylvania Avenue, flanked by the Secret Service and the D.C. Police, all of whom were armed with guns. The implicit argument is that the President is safer because he's surrounded by all those concealed firearms.

I'm kind of busy today, so I don't have time to examine all of the ways that the argument makes no sense, but here are the highlights:

  1. From what, exactly, are these police and agents protecting the President? Could it possibly be: guns?
  2. Does anyone seriously doubt that having dozens of armed bodyguards might make anyone safer? (Unless, for example, you can't trust your bodyguards.)
  3. Does it matter that the President is a hugely-valuable military and political target whose assassination could jeopardize the interests of the United States (not to mention millions of lives), and therefore is especially vulnerable to gun violence without his guards?
  4. Did the presence of armed bodyguards prevent people from shooting at presidents Reagan, Ford, Kennedy, Franklin Roosevelt, Teddy Roosevelt, McKinley, Garfield, Lincoln, or Jackson?
  5. Could the presence of millions of guns make an attempt on someone's life more likely in the U.S. than elsewhere?
  6. Continuing the thought, the United Kingdom's Prime Minister is similarly a high-value target, but...well, here is the PM and deputy PM walking down Whitehall in broad daylight with, it appears, a single armed guard (who's staying discretely back from the ministers):
Top two guys in UK government walk with minimal protection to Whitehall

Even better, here's David Cameron walking to Parliament surrounded by random tourists:

UK Prime Minister walks to Westminster unescorted

Now, you have to remember, the Prime Minister's residence has actually been shelled, from a mortar emplacement right in front of the Ministry of Defence. So why isn't the UK's political leader at all worried when he walks down Whitehall?

Pointing to the President's bodyguards and saying we're all safer when armed is like pointing to David Vetter and saying we're all safer from disease when in a sterile environment. (I'm sure some gun nut will say "guns are like antibodies." That only shows the problems with similes.)

I'm sure I'll come back to this. I will leave you with this photo of another head of government, Canada's Stephen Harper, surrounded by complete strangers at a public event with no visible security (though I'm sure he had at least one Mountie guarding him):

Record heat up here, record heat down there

As Chicago today goes through its record 321st day without a 25 mm snowfall on its way to 13°C temperatures this weekend, we can take some comfort knowing that this summer's weather in Australia has been unimaginably worse:

Heat is part of the national mythology. It killed some of the country’s first white explorers, and has sparked many devastating fires. The worst, “Black Saturday” in Victoria, killed 173 people four years ago. Thanks to better preparation, firefighting skills and a good dose of luck, fires raging in four states in the latest heatwave have spared humans. Yet Australia is getting ever hotter. The 2013 heatwave has set a new record, 40.3°C, for the highest national average temperature. So far, Leonora, a town in Western Australia, has been the hottest place of all, at 49°C on January 9th. That is still below the highest temperature ever recorded in Australia, 50.7°C at Oodnadatta 53 years ago.

The punchline: the Australian weather service has added colors to its map to account for the heat:

The scorching conditions are set to continue into the coming week and prompted the national Bureau of Meteorology to take the extraordinary measure of revamping its weather charts. New colours have been added to forecasting maps — deep purple and pink — to mark out areas experiencing peaks above 50°C.

The colours have come in for immediate use, with large purple blotches appearing on the weather map for next Sunday and Monday. Temperatures in parts of the state of South Australia are tipped to exceed 50°C.

But hey, New Zealand looks perfectly comfortable on that map...

Race against the machine

My efforts to move Weather Now up to Microsoft Azure took on some new urgency today when I noticed this:

That particular error code means the RAID battery has less than 24 hours of charge in it. Fortunately, this means only that the disk will slow down if the battery dies, unless there's a sudden power failure, in which case I could lose the entire RAID volume.

This is exactly the sort of thing that made me want to move all my applications to the Cloud in the first place.

I just hope I can finish the port before...well, before ol' Sparky dies...

The best legislature we have

Ah, Illinois. I got so excited that we could become the 10th state to formalize marriage equality this week, even as I knew we'd probably not solve our pension problems in one go. Nope:

The gay marriage bill seemed unlikely to make it to a final vote during the waning hours of the Illinois legislature's lame-duck session which ended Tuesday. And with a new legislature about to be sworn in, one sure local vote for the measure will be lost as Skip Saviano, a Republican from Elmwood Park, leaves Springfield after an election loss.

Three other local legislators will continue in the new session and have pledged their support of the Religious Freedom and Marriage Fairness Act. State Sen. Don Harmon and State Reps LaShawn Ford and Camille Lilly will back the bill according to a gay rights advocacy organization. State Rep. Kimberly Lightford reportedly remains undecided on the issue.

The Tribune is livid:

On Tuesday, as their lame-duck session became their dead-duck session, the Illinois General Assembly made it official: House Speaker Michael Madigan, Senate President John Cullerton and their Democratic majorities want you to know they simply are not capable of agreeing on any law that would begin to fix their terrible pension debacle. Nor do Gov. Pat Quinn, Senate Minority Leader Christine Radogno or House Minority Leader Tom Cross have the means to compel them.

So as the state's unfunded pension liability of $96.8 billion rises by some $17.1 million a day, Tuesday's $17.1 million was especially exasperating. Exasperating, that is, for everyone but Squeezy the Pension Python, the mythical creature Quinn's office begat in order to illustrate how pension costs are squeezing the lifeblood out of state government's other missions.

Tuesday was the last in a series of days when lawmakers of both parties could have bucked the public employees unions that dictate so much of state government's policy and spending decisions.

("Squeezy the Pension Python?" At least this governor, unlike his two immediate predecessors, isn't a criminal.)

Anyway, at some point, Illinois' pension system will just collapse, because no one involved is willing to save it. As Tom Lehrer said, "I'm beginning to feel like a Christian Scientist with appendicitis."

"Banning guns won't prevent murder"

There's a meme going around the gun-rights folks right now that banning assault weapons won't keep people from killing each other. Think of the thousands of people stabbed to death every year! Just look at this graphic:

While their specific numbers are wrong, the basic assertion is correct: Very few people get killed by rifles in the U.S. No, our eye-watering murder rate comes mainly from handguns, which are second only to cars in the league table of man-made health risks in the U.S.

Start with the raw numbers. There were 14,612 murders in the U.S. in 2011, of which about 11,500 were by guns. That gives us a homicide rate around 5 per 100,000 population. (Source: FBI)

Compare that with the 39 gun murders in the UK, out of their total 550, for roughly the same period. That's a rate of 1.4 murders per 100,000, somewhat lower than the U.S. rate. (Source: UK Home Office)

It turns out, if you take out a proportional number of gun murders—imagine if the U.S. had only 2,000 gun murders in 2011, out of 5,500 total—that would put our murder rate at 1.7, slightly higher than the UK but still within the norm for OECD countries.

Fascinating. It's almost as if having more than 250 million guns lying around made it easier to kill people.

So, if your point is that banning high-capacity firearms won't do much to stop murders in the U.S., you're absolutely right. In the last 12 months, an assault-weapons ban would only have saved 21 children in Connecticut and 45 young people in Colorado—a drop in the homicidal bucket. That's why we should restrict handguns as well, don't you think?

More weather records

Today is the 319th day since Chicago has had a 25 mm snowfall, tying the record set in 1940. As our forecast calls for 10°C-plus temperatures this coming weekend, the record will just get harder to beat.

Unfortunately, the lack of snowfall is also a general lack of precipitation, so water levels in Lake Michigan has hit an all-time low:

he U.S. Army Corps of Engineers reported water levels in Lakes Michigan and Huron hit record lows in December, at nearly two and a half feet below average. Army Corps projections for lake levels have been dire since September, when it became clear that a relatively warm, dry fall and winter would not provide relief from a long drought and one of the the hottest summers ever.

Now the water is an inch below its record low for this time of year in 1964, and continues to drop. Shippers, fishermen, and small-town tourist harbors say federal help with digging out channels and repairing infrastructure could keep the low water problem from becoming a crisis.

The water will likely go back up in spring and summer, as it does every year; late winter is generally the lowest time in the lakes’ yearly cycle. But another summer of extreme heat or drought, and this winter’s woes will seem like kid stuff.

Also announced today, 2012 was the hottest year ever in the United States: "The average temperature for 2012 was 12.9°C, 1.8°C above normal and a full degree [Fahrenheit] higher than the previous warmest year recorded -- 1998 -- NOAA said in its report Tuesday."

Performance improvement; or, how one line of code can change your life

I'm in the home stretch moving Weather Now to Azure. I've finished the data model, data retrieval code, integration with the existing UI, and the code that parses incoming weather data from NOAA, so now I'm working on inserting that data into the database.

To speed up development, improve the design, and generally make my life easier, I'm using Entity Framework 5.0 with database-first modeling. The problem that consumed me yesterday afternoon and on into this morning has been how to ramp up to realistic volumes of data.

The Worker Role that will go out to NOAA and put weather data where Weather Now can use it will receive somewhere around 60,000 weather reports every hour. Often, NOAA repeats reports; sometimes, NOAA sends truncated copies of reports; sometimes, NOAA sends garbled reports. The GetWeather application (soon to be Azure worker task) has to handle all of that and still function in bursts of up to 10,000 weather reports at once.

The WeatherStore class takes parsed METARs and stores them in the CurrentObservations, PastObservations, and ClimateObservations tables, as appropriate. As I've developed the class, I've written unit tests for each kind of thing it has to do: "Store single report," "Store many reports" (which tests batching them up and inserting them in smaller chunks), "Store duplicate reports," etc. Then yesterday afternoon I wrote an integration test called "Store real-life NOAA file" that took the 600 KB, 25,000-line, 6,077-METAR update NOAA published at 2013-01-01 00:00 UTC, and stuffed it in the database.

Sucker took 900 seconds—15 minutes. In real life, that would mean a complete collapse of the application, because new files come in about every 4 minutes and contain similarly thousands of lines to parse.

This morning, I attached JetBrains dotTrace to the unit test (easy to do since JetBrains ReSharper was running the test), and discovered that 90% of the method's time was spent in—wait for it—DbContext.SaveChanges(). As I dug through the line-by-line tracing, it was obvious Entity Framework was the problem.

I'll save you the steps to figure it out, except to say Stack Overflow is the best thing to happen to software development since the keyboard.

Here's the solution:

using (var db = new AppDataContext())
{
	db.Configuration.AutoDetectChangesEnabled = false;

// do interesting work

	db.SaveChanges();
}

The result: The unit test duration went from 900 seconds to...15. And that is completely acceptable. Total time spent on this performance improvement: 1.25 hours.

Chicago sunrise chart, 2013

Here's the semi-annual Chicago sunrise chart. (You can get one for your own location at http://www.wx-now.com/Sunrise/SunriseChart.aspx.)

Date Significance Sunrise Sunset Daylight
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
2 Jul 8:30pm sunset 05:20 20:30 15:09
16 Jul 5:30am sunrise 05:30 20:24 14:53
9 Aug 8pm sunset 05:53 19:59 14:06
16 Aug 6am sunrise 06:00 19:49 13:49
29 Aug 7:30pm sunset 06:14 19:29 13:15
14 Sep 6:30am sunrise 06:30 19:02 12:31
15 Sep 7pm sunset 06:31 19:00 12:28
22 Sep Equinox, 15:44 CDT 06:39 18:48 12:09
25 Sep 12-hour day 06:42 18:43 12:00
2 Oct 6:30pm sunset 06:50 18:30 11:41
12 Oct 7am sunrise 07:00 18:14 11:13
21 Oct 6pm sunset 07:11 18:00 10:49
2 Nov Latest sunrise until 2 Nov 2016
Latest sunset until Mar 3rd
07:25 17:44 10:18
4 Nov Standard time returns
Earliest sunrise until Mar 1st
06:26 16:42 10:16
6 Nov 6:30 sunrise 06:30 16:39 10:09
15 Nov 4:30pm sunset 06:41 16:30 9:48
2 Dec 7am sunrise 07:00 16:21 9:20
8 Dec Earliest sunset of the year 07:06 16:20 9:13
21 Dec Solstice, 11:11 CST 07:15 16:23 9:07

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