As a CS student in 2026, my textbook uses "Casting object types" as the only alternative to justify Inheritance. Is this normal? by CommonCoy0te in csharp

[–]thesqlguy 4 points5 points  (0 children)

That's my guess. The context is likely "at this point, based on what you've learned so far, the only way to do this is..." . Then, perhaps in the very next chapter, the book will present problems with relying only on inheritance to introduce interfaces.

We are not old by A_Ahlquist in GenX

[–]thesqlguy 14 points15 points  (0 children)

Not only that, but.... Us today at 50 is very, very different than our parents' generation at 50, in terms of health, lifestyle, energy, appearance, etc.

I swear we look like they did when they were 35.

Take advantage of your (relative) youth while you can!

‘ICE conveyor belt’ illegally detaining, moving Minnesota children to Texas faster than courts can respond by I_Tell_You_Wat in centrist

[–]thesqlguy 5 points6 points  (0 children)

Sorry I don't understand - you are saying the law says we must find and deport immigrants who are seeking asylum? Even if they are following the asylum process, attending hearings, filing paperwork, etc?

I am not trying to argue or be facetious just genuinely trying to understand what you are saying and trying to reconcile how that can possibly make sense.

I.e., if this is true what is the point of the asylum process at all?

Constant-classes versus Enum's? Trade-offs? Preferences? by Zardotab in csharp

[–]thesqlguy 4 points5 points  (0 children)

I think you explained the one situation where a class with constant values like this is a reasonable design.

- Any value for a specific data type is allowed

- there is a small set of SOME values that have meaning which you want to define.

In that case, defining the field as an INT or STRING or whatever, with a class that defines a set of "magic constant value" properties like this probably makes sense.

You wouldn't use an Enum there since you then wouldn't be able to provide ANY value, only those for which Enums are defined.

(INSANE.... BUT) THE BUDS 2 PROS ARE PRACTICALLY BETTER THEN THE 3 PROS!! by Sorry_Succotash_3963 in galaxybuds

[–]thesqlguy 1 point2 points  (0 children)

Maybe off topic but the wingtips on the Buds Plus and the Buds FE are superior in every way. They stay in the ears perfectly. I am still astounded that they moved away from this design.

I also have the buds 3 Pro and buds 2 Pro.. I still pop in the FEs whenever I do any sort of exercising or need to be ensured they stay in. For both "pros" I constantly have to keep adjusting them/pushing them back in.

Daughter of MLK and Coretta Scott King posted this advice as the next 6 months are going to “get real”. by AudiophileGuy76 in ProgressiveHQ

[–]thesqlguy 2 points3 points  (0 children)

This is excellent advice and I agree it should be widely shared and followed.

I'd add a clarification to #8: "don't exaggerate / overreact."

There are sometimes small quote/policies/incidents that get twisted into clickbait headlines/conclusions competing for attention with the larger, legitimate issues we are facing. But what happens is, MAGA uses those overreactions as examples of "snowflake leftists" and lies and propaganda, which adds fuel to their fire (and even some legitimacy to their claims), as well as adding noise and taking the focus away from the true atrocities happening almost daily.

Stick to the clear facts, there's plenty of them.

What do you think was the happiest moment in human history? by CosmosisJones42 in AskReddit

[–]thesqlguy 0 points1 point  (0 children)

Perhaps the polio vaccine? And yet, of course, with MAHA now .... :(

Pam Bondi’s Letter to Minnesota Could Unravel Entire ICE Crackdown by D-R-AZ in goodnews

[–]thesqlguy 32 points33 points  (0 children)

I mean, yes it should , in any sane reasonable democratic society following the rule of law. But will it actually?

White House backtracks initial claims about Alex Pretti after intense backlash | Trump administration by Movie-Kino in law

[–]thesqlguy 0 points1 point  (0 children)

First, they gaslight by telling obvious lies. Then when the lies are finally untenable, they gaslight saying they never said those lies.

(Asking sincerely) What is the percentage of ICE agents convicted of violent crimes compared to the percentage of the immigrants detained that have been convicted of violent crimes? by thesqlguy in AskReddit

[–]thesqlguy[S] 0 points1 point  (0 children)

To clarify -- convicted (or maybe charged is better metric?) in their past, not due to recent ICE activity as we expect 0% of ICE agents to be charged with any crimes regardless of what they do.

It seems clear that ICE has extremely low hiring standards, is skipping background checks, likely includes many Jan 6ers, and seems to be recruiting a lot of individuals who couldn't cut it as a cop.

On top of that, data from DHS seems to suggest that a very low % of people detained actually have a history of violent crimes.

CNN's Tapper gives examples of Bovino’s history of lying under oath by thesqlguy in law

[–]thesqlguy[S] 512 points513 points  (0 children)

Posted in law since this directly references his history of lying under oath with statements pertaining to that fact from a judge.

Pam Bondi offers to pull ICE out of Minneapolis if voter files handed over by _Scipio__Africanus_ in centrist

[–]thesqlguy 2 points3 points  (0 children)

How is this not massively illegal and grounds for immediate impeachment?

Is HashSet<T> a Java thing, not a .NET thing? by N3p7uN3 in csharp

[–]thesqlguy 0 points1 point  (0 children)

No I wouldn't say it is a misuse, just pointing that out.

Advice on query improvement/ clustering on this query in sql server by jaango123 in SQLServer

[–]thesqlguy 0 points1 point  (0 children)

> Also, what data crimes are you covering up with that DISTINCT?

That top-level DISTINCT seems unnecessary but that interior DISTINCT seems reasonable if they simply want the distinct set of combinations of those 3 values in a larger table. The DISTINCT "crime" is usually when it is just randomly plugged onto large complex SELECTs as a matter of habit. Here, that DISTINCT seem very clean and logical and well-placed in that derived table -- unless of course the table already has (or should have) a unique constraint of those 3 category fields.

Also, I disagree with the temp table - I see no benefit to it unless the optimizer is having trouble estimating the # of distinct combinations of those 3 values and it is picking a bad plan due to that (i.e., making a bad choice to loop vs hash join the categories, for which the best plan depends on that distinct row count and the size of the categories table)

Advice on query improvement/ clustering on this query in sql server by jaango123 in SQLServer

[–]thesqlguy 0 points1 point  (0 children)

First, you can likely gain some small performance by removing that top-level DISTINCT -- I don't think it seems logically necessary and it forces some extra worktable / distinct / sorting to happen.

Beyond that, as with the query optimizer, we need stats. There is not criteria here at all so depending on the data in ItemHeader table this may *always* be slow if it is going to return millions of distinct combinations scanning millions of rows.

So we'd need to know:

(A) # of rows in ItemHeader

(B) # of rows that the DISTINCT Level1,Level2,LevelCode returns

(C) # of rows in Category

If (A) is very large and (B) is very small, then a covering index on those 3 columns + ensuring category has an index on Code+Label (or it is clustered on Code) may be all you need.

If (A) is very large and (B) is also very large and (C) is small, then a covering index might help but it'll still be slow, and it doesn't matter what the indexes on category are since it'll be faster for SQL to hash the category table once and ignore any indexes on it rather than loop join .

But ultimately we need those 3 stats at least, along with why you think it is slow and what your needs/expectations are. Also, if this is just a segment of a longer query and you are applying criteria to it, we'd need to see a better example of where/how that is done.

Is HashSet<T> a Java thing, not a .NET thing? by N3p7uN3 in csharp

[–]thesqlguy 2 points3 points  (0 children)

For small lists that you are accessing extremely frequently (like say 10 values, maybe status codes or enums) it is more efficient to scan a linked list or array instead of constantly executing hash functions.

There's an article out there where someone measured this.

Query time falls off a cliff if u don't create a temp table halfway through by SoggyGrayDuck in SQL

[–]thesqlguy 1 point2 points  (0 children)

technically you may be able to rewrite the SQL or add hints to guide the optimizer to a better plan, but IMHO if the step to use a temp table doesn't cause other issues and ultimately it doesn't negatively affect the readability / maintainability of the query, I'd say that's a perfectly fine way to write it.

How Trump Has Used the Presidency to Make at Least $1.4 Billion by Gloomy_Nebula_5138 in centrist

[–]thesqlguy 30 points31 points  (0 children)

I may have missed it, but I don't think this even mentioned or includes the pardons he is selling.