The Daily Parker

Politics, Weather, Photography, and the Dog

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.

Zipadee doo frickin da

Sigh. Zipcar, short-term rental car service that has occasionally made my life a lot easier, just got swallowed by Avis:

Zipcar Inc. has been growing as more people in urban areas forgo owning a car and instead tap car-sharing and hourly rental services when they need a vehicle. The company’s third-quarter sales grew 15% to $78.2 million while its membership (renters) grew 18% to more than 767,000. Zipcar earned $4.3 million in the three-month period and has said it expected 2012 to be the first full year for which it posts a profit.

Avis Budget, the nation’s third-largest car rental company -- after Enterprise Holdings and Hertz -- will pay $12.25 a share in cash for Zipcar, a 49% premium over the stock's closing price Monday.

Avis believes it can whittle $50 million to $70 million of expenses out of the combined operations of the companies by eliminating duplication of functions such as the cost of maintaining Zipcar as a publicly traded company.

Just once I'd like to see a cool, niche company grow to a sustainable size without being acquired by a huge corporation.

Defense against tyranny

The Atlantic's Conor Friedersdorf takes on the troubling contradiction between right-wing support of the 2nd Amendment at the expense of a few others:

It's one thing to argue that gun control legislation is a nonstarter, despite tens of thousands of deaths by gunshot per year, because the safeguards articulated in the Bill of Rights are sacrosanct. I can respect that... but not from people who simultaneously insist that 3,000 dead in a terrorist attack justifies departing from the plain text of the Fourth, Fifth, Sixth and Eighth amendments, and giving the president de-facto power to declare war without Congressional approval.

[I]f you're a conservative gun owner who worries that gun control today could make tyranny easier to impose tomorrow, and you support warrantless spying, indefinite detention, and secret drone strikes on Americans accused of terrorism, what explains your seeming schizophrenia?

Think of it this way.

If you were a malign leader intent on imposing tyranny, what would you find more useful, banning high-capacity magazines... or a vast archive of the bank records, phone calls, texts and emails of millions of citizens that you could access in secret? Would you, as a malign leader, feel more empowered by a background check requirement on gun purchases... or the ability to legally kill anyone in secret on your say so alone? The powers the Republican Party has given to the presidency since 9/11 would obviously enable far more grave abuses in the hands of a would be tyrant than any gun control legislation with even a minuscule chance of passing Congress. So why are so many liberty-invoking 2nd Amendment absolutists reliable Republican voters, as if the GOP's stance on that issue somehow makes up for its shortcomings? And why do they so seldom speak up about threats to the Bill of Rights that don't involve guns?

I've always wondered these things, too. I keep getting to the conclusion that extreme-right-wingers don't actually think about anything, they just believe stuff.