The Daily Parker

Politics, Weather, Photography, and the Dog

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.

America as Dory the fish

To refresh your memory of the movie Finding Nemo, Dory had a cognitive deficiency:

To refresh your memory of last month, so do most American news media:

Blame it on the fiscal cliff, blame it on Christmas, blame it on our ability to forget, but the national discussion about gun control has once again ebbed. Mentions of the term "gun control" on television, in newspapers, and in online media are down to pre-Sandy Hook levels, according to the Nexis database.

Barring a post-holidy resurgence -- which is certainly possible -- the gun control discussion has once again gone the way of... the gun control discussion.

Hat tip: reader MP.

Snow where to be seen

Nearly 65% of the lower 48 United States has snow cover, including parts of every state except for the seven between Louisiana and South Carolina.

Chicago, for reasons not well understood, has just a trace on the ground and has gone 314 days without 25 mm of snow, 4 days short of the record set in 1940. Since we have no significant snow in the forecast, it looks like we'll break that record too.

Other records threatened: number of days without 25 mm total snowfall accumulation, 312 (record is 313); latest date without a 25 mm snowfall, ranked 10th (record is 17 January 1899; 9th is 5 January 1994); and latest day for total 25 mm accumulation for the season, ranked 4th (record is 8 January 1944; 3rd is 6 January 1913).

And the forecast for March-like weather next week has gotten clearer, with the National Weather Service now predicting 8°C on Wednesday.

Weird weather continues.

Next week, March

The 6-10 day outlook for the U.S. looks warm:

Forecasters predict temperatures above 10°C in Chicago by Wednesday before the weather cools to more normal January levels the following weekend. This comes after 2012 officially became Chicago's warmest year ever (or at least since we started keeping records in 1871), and during a continuing drought that has nearly shut down the Mississippi River.

Well, you know, warm, dry springs are very nice in Chicago...so are mild winters...

More on Illinois marriage equality

It seems I got ahead of events in my post last night. Chicago Public Radio clarified this morning what's going on in the General Assembly:

Before it even went to committee, legislators debated not gay marriage, but the process they’ll use to discuss the issue.

Republican State Sen. Dale Righter said it’s hard for the public to follow bills as they move around the Statehouse, and the issue shouldn’t be rushed.

Senators voted 28-24, in effect stalling the bill. But the gay marriage issue could still be addressed again Thursday. It comes as the chairman of the Illinois Republican Party said in a statement that he supports gay marriage while Cardinal Francis George of the Archdiocese of Chicago wrote a letter explaining why he opposes it and urging Catholics to actively fight it.

The Tribune has more:

Gay marriage is but one issue on a crowded agenda of the final days of the outgoing General Assembly. Lawmakers also are looking at pension reform, driver's licenses for illegal immigrants, gambling expansion and gun control before the reset button is hit when the new Legislature is sworn in Wednesday.

Given the political complexities, it will be a tall order for lawmakers to complete a comprehensive pension overhaul by the time the clock runs out. Same goes for chances of passing a major gambling expansion to meet Mayor Rahm Emanuel's desire to have a Chicago casino.

And Lt. Gov. Sheila Simon had a good response to the Cardinal's idiotic "legal fiction" canard: "Simon argued that adoption is similarly a "legal fiction" that helps citizens form a family unit — and one that she also supports."

Illinois could be 10th

House Bill 5170 will very likely go to the Illinois House for a vote before Tuesday, and if it does, it will pass and receive Governor Quinn's signature a few hours later:

The Illinois Marriage and Dissolution of Marriage Act is amended by changing Sections 201, 209, and 212 and by adding Section 220 as follows:

(750 ILCS 5/201) (from Ch. 40, par. 201)
Sec. 201. Formalities.) A marriage between 2 persons a man and a woman licensed, solemnized and registered as provided in this Act is valid in this State.

The Illinois Senate may vote on it tomorrow. That fact explains why Francis Cardinal George wrote a letter to his rapidly-dwindling flock yesterday saying, "Civil laws that establish 'same sex marriage' create a legal fiction. The State has no power to create something that nature itself tells us is impossible."

I understand that the Cardinal is not a lawyer, but in this country, and in this state, marriage is defined by law first. I should also draw the Cardinal's attention to the second purpose of HB5170:

(a-5) Nothing in this Act shall be construed to require any religious denomination, Indian Nation or Tribe or Native Group, or any officiant acting as a representative of a religious denomination, Indian Nation or Tribe or Native Group, to solemnize any marriage. Instead, any religious denomination, Indian Nation or Tribe or Native Group is free to choose which marriages it will solemnize.

In other words, Cardinal, we're bound by the First Amendment to get our laws out of your church. Now please get your religion out of our legislature.