A brief Twitter thread about long term changes post Covid

I don’t know him, but this thread of predictions from Chris Herd (@chris_herd) came across my Twitter feed and I wanted to save it. A lot of his thoughts are right on and aligned with mine (perhaps we should have bought an RV before Covid hit!).

https://twitter.com/chris_herd/status/1334842553561198593?s=12

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | Leave a comment

What seven ICU nurses want you to know about the battles against Covid-19

This is just gut wrenching. I don’t understand people who think it’s a hoax.

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> | Leave a comment

Using variables across blocks in Azure Data Studio for SQL

I do a lot of troubleshooting using SQL data and while I find the Jupyter notebooks in Azure Data Studio (ADS) useful, one thing that is frustrating is the inability to pass variables across code blocks. I will frequently need to limit queries to a date range, or a customer, and since variables can’t be passed across blocks (each one is completely independent), I end up having to edit variables in each block, which slows things down.

After a bit of searching around, I found a solution that seems to work pretty well. It uses a feature I hadn’t heard of before, which are session context settings.

https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-set-session-context-transact-sql

The idea is that we will store the variable value that we want to access inside the session context in the first code block, and then retrieve it in following code blocks wherever we need it. It is a couple more lines of code, but if we’re creating a notebook, presumably the value is there!

First we need to figure out what values we want to be able to re-use across blocks. In this case, I’m going to use StartDate and EndDate. These will be start and end date / times that I can use to bracket the data in the query with a BETWEEN in the WHERE clause.


A sample query I might be wanting to spread across blocks:

DECLARE @StartDate AS DATETIME
DECLARE @EndDate AS DATETIME

SET @StartDate = '11/01/2020'
SET @EndDate = '11/01/2020 23:59:59.99'

/* Get the basic info we need... */
SELECT
    *
FROM
    table
WHERE
    CreatedOn BETWEEN @StartDate AND @EndDate

/* Instructions go here on how to troubleshoot related stuff */
SELECT
    *
FROM
    AnotherTable
WHERE
    CreatedOn > @StartDAte

With a Session Context setting, we can store the values using sp_set_session_context…

EXEC sp_set_session_context 'StartDate', '11/01/2020'
EXEC sp_set_session_context 'EndDate', '11/01/2020 23:59:59.99'

…and then retrieve and use them in another code block:

DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SELECT @StartDate = CAST(SESSION_CONTEXT(N'StartDate') AS DATETIME)
SELECT @EndDate = CAST(SESSION_CONTEXT(N'EndDate') AS DATETIME)

SELECT
    *
FROM
    YourTable
WHERE
    CreatedOn BETWEEN @StartDate AND @EndDate

Since these settings are session based, when you close out the notebook, or change the connection, they are discarded.

There are some important caveats regarding the amount of data that can be stored in the context session so be sure to read the above linked documentation – it’s one of the shorter ones from Microsoft, so it’s pretty digestible.

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> SQL | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , | 1 Comment

This is why I have a “Kindle Over $10” list for Kindle books

The fact that paperback and sometimes hardcover books are cheaper than ebooks is just wrong. The costs of distribution are negligible for ebooks.

When I see an ebook that I like (that isn’t time sensitive) and it is over $10, I put it in a list that I have on Amazon. I periodically revisit the list to see if anything has dropped below $10. The good news is that sometimes they do. The bad news is that sometimes I no longer care – so the publisher and author lose out on the revenue from me forever.

Note: My wife and I have over 700 ebooks in our library – we are power buyers.

https://www.vox.com/culture/2019/12/23/20991659/ebook-amazon-kindle-ereader-department-of-justice-publishing-lawsuit-apple-ipad

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | Leave a comment

This is supposed to be funny, right?

https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | Leave a comment

Another Covid tracker

This one has information such as the positivity rate, and more concerningly, the ICU utilization percentage. As of the day I’m posting this, Montana and Oklahoma have no available ICU beds.

That’s pretty scary.

https://covidactnow.org/?s=1330330

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> | Leave a comment

Apple System Status Web Page

Never needed this until today: https://www.apple.com/support/systemstatus/

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Mac | Leave a comment

Did the Sturgis motorcycle get together spread Covid?

I’m saving this mostly as it’s an interesting item, and it has come up in discussions with my friends before.

While it seems like it has ‘been too long’ for Sturgis to be at fault for this explosion in cases in the Midwest, it can just be an instance of “and they tell two friends, and they tell two friends…”

The Washington Post – How the Sturgis Motorcycle Rally may have spread coronavirus across the Upper Midwest

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> | Leave a comment

Is Covid getting less dangerous?

<shakes Magic 8 Ball>Signs Point to Yes.

As we learn how to treat the infections, overall lethality and impact appears to be going down. That’s great news. Now let’s get a vaccine going and get back to normal…. does anyone remember what normal is?

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | Leave a comment

Putting a halt to dining out

Indoor dining has a lot of risk right now, and with Florida opening back up to full capacity, we have decided to eliminate dining at places that don’t provide well spaced outdoor seating.

https://elemental.medium.com/read-this-before-you-even-consider-dining-indoors-be8ef1d24d8c

We are still ordering for delivery a bunch, with ‘touchless’ delivery, but that is getting very expensive so we will be rolling that back a bit. I hope that the local businesses get enough business to keep going, but I think they are going to struggle with outbreaks if they pack people in (and I’ve seen some videos of local bars where they are doing exactly that).

We have re-subscribed to DirecTV so that my wife can get her Sunday football fill, without going to a bar. This isn’t the experience any of us want, but it’s the world we live in for another six months to a year.

Stay safe!

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized | Leave a comment