« first day (4355 days earlier)      last day (514 days later) » 

12:45 AM
Once every few years blogging is worth it
5
 
@PaulWhite I do say this quite often.
Sleep on the job for 4 years, get a memo about how you need to do better.
 
1:13 AM
> the employee misused more than 2,200 hours of work time as a result of sleeping on the job, costing the state more than $40,000
At least they won the fight for fifteen
 
@ErikDarling that's amazing.
 
😎
 
 
1 hour later…
2:49 AM
@ErikDarling Sounds like what ChatGPT would say
 
3:26 AM
 
 
3 hours later…
6:53 AM
@PaulWhite really bad
Morning
@ErikDarling ran through for me
 
7:16 AM
Morning
 
 
1 hour later…
8:41 AM
A chairde - Morning all!
 
 
1 hour later…
9:49 AM
Heapers - what is the MS SQL Server safe comparison function for to_number(blah) - if blah is text, it just produces NULL - if you try that in PostgreSQL, your SQL will fail - looking for "safe" conversion function...
 
10:13 AM
Got it - it's TRY_CAST and TRY_CONVERT!
 
you've found it before I've noticed the message
Riddle me this: is there a way for a set-based solution (without recursion) to update a row and then refer to the updated version in the next row? Sort of like running total

This is the challenge https://adventofcode.com/2022/day/5
 
10:38 AM
@Zikato I think you'll need a recursive CTE.
 
in SQL yes, but I'm thinking about KQL solution and that doesn't have recursion (or loops)
 
i know 0 things about KQL
 
that's not true
you know that KQL has no recursion or loops
hmm, I thought of a workaround, generate a dynamic code. It will be ugly, but doable (unless KQL has a limit of number of instructions)
I've tried over 600 pipeline operations and it works (albeit slow)
 
I was going to suggest generating dynamic SQL as well
But tail recursion is just looping and dynamic SQL would be loop unrolling
I don't know if it would count as being set-based
 
11:01 AM
Thank you. I would consider the resulting dynamic code to be set-based. But really the criteria is that it should run in Kusto, I misspoke
 
Well, a dynamic sequence of UPDATE statements, or nested SELECTs performing one operation per statement or level doesn't seem very set based. But yes, ok, I understand.
No cursors or GOTO statement in KQL either?
 
Not as far as I know, but I've only been using KQL for a few weeks now. But I would be surprised if it was there, given the lack of other control commands
 
Just out of interest, what does one need in order to use KQL?
 
11:27 AM
nvm I looked it up
 
11:45 AM
For others: Cluster - There is a free tier provided by azure, and there are a few sample ones. Then a client, either through azure data explorer or download a Kusto explorer client locally.
 
 
1 hour later…
1:12 PM
@Zikato My SQL Server solution dbfiddle.uk/i59zz33L
 
I usually find the first way that works and then don't have the time to go back and refactor
 
same
well, except I didn't mind adding the parameter to reverse order or not
I suppose that's a bit of refactoring
anyway, I wanted to do it without loops
 
1:45 PM
yeah, yours is more elegant.
I saw a recursion solution somewhere
 
I wouldn't say so. They're just different implementations of the same idea
 
I only glanced through today's challenge, but it will also require some looping I assume
https://adventofcode.com/2022/day/7
 
2:23 PM
@Zikato Should be able to count by indent (& DIR) and break/output when the indent changes?
 
there is no ident. Input is the list of commands; you have to create the nested structure first
 
@Zikato Yeah, just seeing that now. My answer is "I've got kids"
 
and no coffee, apparently
 
You are exactly right.
My solution is buy a bigger hard drive
 
deadly combination
 
2:28 PM
brb, buying hard drive and making coffee
 
I see a home contents insurance claim in your future
 
If you're buying drives, I'll take one please
 
@PaulWhite Especially if the cat is around
Everyone wants data model homework help and it boils down to "do it for me"
Like, don't wait until the last second to do your semester-long project?
 
3:06 PM
Yes, why can't people be more organised like we were at that age
3
oh
 
3:31 PM
Got to catch up with Joe Sack, I miss working with him.
 
I was of good mind to take 10 years and 3 majors to complete my college education
 
Today's advent of code really ramped up the difficulty from yesterday.
Although it probably just feels that way to me because I find recursion so difficult.
 
Today is day 7?
 
Yeah.
 
4:02 PM
@PaulWhite I find it helps to use your fingernails to make scratches on the walls to count the days... that's just me though.
 
4:18 PM
everything's fine
fire, etc
 
So many parentheses. Is that Access? ... ;)
 
@ypercubeᵀᴹ No - it's Lisp!
 
linq
 
4:44 PM
I've managed the day 5 kusto solution. Generate dynamic KQL and then run it
 
@Zikato Nice!
 
Well, this was a fun trip down to Oracle nonsense. SELECT * FROM <table> WHERE Create_Date = '2022-10-08' yields NULL, even though 1. Create_Date is DATE format 2. There is a row with '2022-10-08'. HOWEVER, SELECT * FROM <table> WHERE TRUNC(Create_Date) = '2022-10-08' does return rows.
JFC oracle
yields NULL = no rows, sorry for the imprecision
 
 
2 hours later…
7:12 PM
@bbaird is the type of the column date?
 
@ypercubeᵀᴹ Yes, which is the source of confusion
I did an update and used TRUNC on the column and... wtf it works like it should now
 
does this return rows?
WHERE Create_Date = DATE '2022-10-08'
 
No, that was my first attempt to account for the behavior
 
oh, apologies
the DATE time in Oracle does store hour, min and sec.
so the behaviour is expected ;)
 
@ypercubeᵀᴹ (swears in ANSI)
 
7:21 PM
so your UPDATE destroyed all evidence. I hope no one needed that data
 
Enh, copying from another source so there's nothing lost
 
WHERE Create_Date >= DATE '2022-10-08'
  AND Create_Date <  DATE '2022-10-09'
 
Oh, this is fun 2021-07-24 10.37.45.000000000 AM Everything has the same timepart.
 
would be more index-friendly
@bbaird that is weird
 
@ypercubeᵀᴹ I blame someone not knowing what they were doing when they inserted the data.
Ok, it's that way for most of the data... wtf
Ok, I see now - all the rows for the same date get the same timepart and 90% of the rows were created on one day.
Well, considering the time zone of whatever that is and what data it's being joined to I don't think anything of value is lost if I truncate it on my end.
@ypercubeᵀᴹ Thanks for enlightening me to the pitfalls of Oracle's "date" type
 
7:37 PM
hth
invoice incoming (I'd say if my name was Erik ;)
 
7:58 PM
i can send an invoice on your behalf
for a price, of course
 
8:15 PM
Invoiception
 
Invoice recursion
 
Invursion
 
8:57 PM
Recursinvoice, cursinvoice... curse the damn invoice!
 
9:18 PM
cursing the invoice costs extra
 
9:43 PM
I spent too much time on this
user image
9
probably needs a bent barbell
 
 
1 hour later…
11:15 PM
@Vérace not if you have enough guns, sure
 

« first day (4355 days earlier)      last day (514 days later) »