-
-
Recent Posts
- Bringing Manufacturing Back to the United States is Hard April 27, 2025
- Squeaking from Bambu Labs printer? April 16, 2025
- Interesting Postgres extensions October 21, 2024
- An interesting use of AI to read text in a video October 18, 2024
- Measuring engineering productivity September 28, 2024
Recent Comments
Archives
- April 2025
- October 2024
- September 2024
- August 2024
- June 2024
- May 2024
- April 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- June 2023
- May 2023
- April 2023
- February 2023
- January 2023
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- August 2020
- June 2020
- May 2020
- April 2020
- February 2020
- December 2018
- November 2018
- October 2018
- September 2018
- May 2018
- March 2018
- February 2018
- January 2018
- December 2017
- September 2017
- July 2017
- December 2016
- May 2016
- December 2015
- August 2015
- January 2015
- December 2014
- October 2014
- September 2014
- August 2014
- May 2014
- March 2013
- February 2013
- September 2012
- July 2012
- March 2012
- January 2012
- December 2011
- November 2011
- August 2011
- May 2010
- March 2010
- February 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- April 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- December 2004
Categories
Meta
A portal listing all of Microsoft portals
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized
Leave a comment
A Notion page explaining almost everything about Git & GitHub
Another find on Twitter (@fateen_alam), that might be of interest: https://www.notion.so/Git-GitHub-61bc81766b2e4c7d9a346db3078ce833
<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> Uncategorized
Leave a comment
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> Covid
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.
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> ADS, Azure Data Studio, SQL
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?
<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> Covid
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…”
<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> Covid
Leave a comment