The Daily Parker

Politics, Weather, Photography, and the Dog

And hey, a bug

Not five minutes after my last post, I discovered a completely borked feature, caused by a change to the way Azure.Data.Tables executes queries.

The Daily Temperatures feature stores data in the same table as the History feature. Each row represents a weather report, where the table partition key is the weather station identifier and the row key is the date and time of the report. So, for example, the first row of data for Chicago-O'Hare in the 2023 table has a partition key of KORD and a row key of 20230101-0051.

Climate records use a row key of "Climate-" and the date. So yesterday's climate data for Chicago-O'Hare has a partition key of KORD and a row key of "Climate-20230415". Easy to remember, and easy to construct queries.

To that end, the original (.NET 6) code looked like this:

var query = 
	from entity in table.CreateQuery<ClimateRecordTableServiceEntity>()
	where entity.PartitionKey == locationId
		&& string.Compare(entity.RowKey, lowerRowKey, StringComparison.InvariantCultureIgnoreCase) >= 0
		&& string.Compare(entity.RowKey, upperRowKey, StringComparison.InvariantCultureIgnoreCase) <= 0
	select entity;

When I upgraded to .NET 7, I naïvely just changed the first line, to this:

var query = 
	from entity in table.Query<ClimateRecordTableServiceEntity>()
	where entity.PartitionKey == locationId
		&& string.Compare(entity.RowKey, lowerRowKey, StringComparison.InvariantCultureIgnoreCase) >= 0
		&& string.Compare(entity.RowKey, upperRowKey, StringComparison.InvariantCultureIgnoreCase) <= 0
	select entity;

When confronted with a 30-day query, though, it spun off into the abyss and crashed the whole app.

The correct code looks like this:

var query = table.QueryAsync<ClimateRecordTableServiceEntity>(entity =>
	entity.PartitionKey == locationId
		&& string.Compare(entity.RowKey, lowerRowKey, StringComparison.InvariantCultureIgnoreCase) >= 0
		&& string.Compare(entity.RowKey, upperRowKey, StringComparison.InvariantCultureIgnoreCase) <= 0);

See, now the filter part of the query goes inside the method call. (There's an extra step in reading the async results back, too.)

So the effect of the naïve fix was to hit the table 30 times getting back the entire partition each time. Remember that all of the weather reports go into the table? So, yeah, the 2023 table already has something like 7.5 million rows, or about 2,500 in each partition. So it tried to read 75,000 rows just to bring back 30. Oopsi.

I'm deploying the fix now.

New Weather Now build

It took a few weeks at odd hours, but I have finally deployed the latest version of Weather Now (5.0.8507). I didn't update anything visual, but all the plumbing got a refresh. It's now running in .NET 7 (until November, when .NET 8 comes out), and I did a top-to-bottom review of its asynchronous code.

The app now runs noticeably faster, and I believe the corrections to the async bits will cure the nagging (but invisible) problem of thread exhaustion that happened from time to time.

Now I can start making some other fixes and adding some long-missing features. Really, I just needed to get back into the swing of it.

My domain name is 25 years old

On this day in 1998, I registered braverman.org, and just a few weeks later built the first draft of what became this blog. When I registered it, only about a million domain names existed, though 1998 turned out to be the year the Internet exploded worldwide. Just seven years earlier, only 100 .org names existed, so braverman.org may be one of the oldest .orgs out there. (For comparison, there are just about 350 million registered domain names today.)

Of course, the 25th anniversary of braverman.org hasn't yet become a global holiday, so a few other things happened in the last 24 hours:

  • The Democratic Party really wants US Senator Diane Feinstein (D-CA) to retire, as it has become painfully clear she can no longer perform her duties in the Senate, preventing us from confirming new judges. Seriously, ma'am, go.
  • We also want Justice Clarence Thomas (R) to go, especially after a new revelation that he sold property to the billionaire "friend" who has taken him on half-million-dollar vacations. Seriously, sir, go.
  • At least his colleagues on the Supreme Court all seem unimpressed with the "independent state legislature" bullshit espoused by some right-wing Republican state legislators.
  • New Republic's Timothy Noah thinks "remote work sucks," but (our hero writes from his open and airy home office just steps from his dog and refrigerator) not all of us do.
  • Paul Krugman explains how immigrants are saving America's economy.
  • The New York Times has a lot of good things to say about Chicago hosting next year's Democratic National Convention.
  • Your local, urban apiary might actually be hurting your neighborhood.

Finally, we have another gorgeous day in Chicago, a bit cooler than yesterday where I live thanks to delightful lake breeze, but still more like July than April. 

Record temperatures

Chicago hit 28.3°C yesterday afternoon, breaking the record of 27.7°C set in 1887 and tied in 1941:

The new high mark lasted for at least three hours Thursday and towered above typical temperatures for mid-April, weather service data showed.

Standard April 13 high marks average 15°C, with lows usually [just above freezing].

But despite summer warmth waiting in the wings, the beach-worthy weather is poised to soon go away, if only temporarily, as another system brings cooler weather to Chicago.

Despite the chilly change, warmth-loving Chicagoans have little to complain about this year. Temperatures were 2.1°C above normal throughout the winter months, another National Weather Service meteorologist told the Tribune last week.

I can't remember turning on the air conditioning this early before, at least not in Chicago. (I've spent time in Richmond, Va., and Houston, Texas before.)

It all goes away tomorrow night, though. Pity.

Happy dog

Yesterday's temperature at O'Hare got up to 17°C, with a forecast of 17°C again today. Just perfect for a 4 km walk (in each direction) to Horner Park DFA, where Cassie met tons of new friends and stole dozens of their toys (she gave them back):

Today's plan calls for a Ride in the Car! (I need groceries) and another 10 km or so of walkies.

We get about 30 days a year this perfect, so we use them. Pity I have to go into my downtown office tomorrow...

Spring is here, spring is here

Life is skittles and life is beer!

Seriously, just check out this forecast:

Today
Sunny, with a high near 7. East northeast wind 15 to 20 km/h.
Tonight
Mostly clear, with a low around 3. Northeast wind 10 to 15 km/h becoming southeast after midnight.
Saturday
Sunny, with a high near 12. South southeast wind 15 to 20 km/h becoming east northeast in the afternoon. Winds could gust as high as 30 km/h.
Saturday Night
Mostly clear, with a low around 4. East wind 10 to 15 km/h.
Sunday
Sunny, with a high near 13. Southeast wind 10 to 15 km/h, with gusts as high as 25 km/h.
Sunday Night
Partly cloudy, with a low around 7.
Monday
Partly sunny, with a high near 18.
Monday Night
Mostly clear, with a low around 9.
Tuesday
Sunny, with a high near 21.
Tuesday Night
Mostly clear, with a low around 12.
Wednesday
Sunny, with a high near 23.
Wednesday Night
Clear, with a low around 12.
Thursday
Sunny, with a high near 24.

That's about as perfect an April week as we can get.

Oh, and check out this girl, who lost 3.6 kg since her last vet visit. That means she only has 800 grams to go before hitting her ideal weight:

She's fitting into her harness again. Now, if I could just lose 5 kg, that would be great.

Asyncing feeling

I spent all day updating my real job's software to .NET 7, and to predominantly asynchronous operation throughout. Now I have four stubbornly failing unit tests that lead me to suspect I got something wrong in the async timing somewhere. It's four out of 507, so most of today's work went fine.

Meanwhile, the following stories have backed up:

Finally, a very rich person is very annoyed after his or her private jet got stuck in the mud at Aspen's airport. It seems the guy sent to pull it out of the mud maybe needed another lesson on how planes work, because he managed to snap the nose gear right off the $3.5 million airplane. Oopsi. (There's video!)

Ah, spring...

Cassie and I ran the last block of our first walk of the day because I underestimated how fast a squall line was moving. You know what comes after a squall line? A cold front:

Because who doesn't love a 10°C temperature drop in 2 hours?

The forecast for the rest of the week is for gradually warming temperatures and dry skies.

In other news

Stuff read while waiting for code to compile:

Finally, Chicago Tribune food critic Louisa Chu says I should take a 45-minute drive down to Bridgeview to try some Halal fried chicken—just, maybe, after Ramadan ends.