Friday, August 18, 2023

Buggish: Tesla Account Locked, Then Locked Out of Car

I regret purchasing a Tesla.

Account Lock Out, Now I cannot Drive My Car

So, I am trying to lookup my insurance info and try to log in. I sign in, I get to the 2 factor-authentication where it sends a code to my phone. AND IT NEVER COMES! 

Whatever the case... I tried to reset my password to maybe reset the 2FA. WORST MISTAKE! This signs me out of my app and now I cannot use my car at all.



Saturday, August 5, 2023

C# SMO: Unable to get objects by name but able to get by index

Replicating Issue

StoredProcedure sp = db.StoredProcedures["spName"]; // Returns null

Does not return the same as 
StoredProcedure sp = db.StoredProcedures[0]; // Returns object


If I traverse the array (technically a collection), I will find spName. Even if I do:
StoredProcedure sp = db.StoredProcedures[0]; // Returns object
StoredProcedure spByName = db.StoredProcedures[sp.Name]; // returns null


Possible Solution

First I tried. https://www.tek-tips.com/viewthread.cfm?qid=1736324
StoredProcedure storedProcedure =
db.StoredProcedures.Cast<StoredProcedure>().SingleOrDefault(sp => sp.Schema == "YourSchemaName" && sp.Name == "YourSprocName"); 

This worked and this caused me to see that the schema is explicitly entered. After some more research, I could not find how you would provide the schema to the stored procedure name.

Later I tried to look under Database which has a property, DefaultSchema. After setting this, this also returned the correct result.

So the simplest solution:

db.DefaultSchema = "schemaName";
StoredProcedure sp = db.StoredProcedures["spName"]; 

Root Cause Analysis

For my specific case, our DBA changed the default schema of the user. 

Thursday, July 27, 2023

EXCEL: Create new lists of data that contains both (A and B), only A, and only B

 Both

=FILTER(A2:A1019,ISNUMBER(XMATCH(A2:A1019,B2:B1119,0)))


Only A

=FILTER(A2:A1019,ISNA(XMATCH(A2:A1019,B2:B1119,0)))


Only B

=FILTER(B2:B1119,ISNA(XMATCH(B2:B1119,A2:A1019,0)))



Setup

1. Column A includes the data for Table A with a header
2. Column B includes the data for Table B with a header
3. User equation for "Both" in Cell C2
4. User equation for "Only A" in Cell D2
5. User equation for "Only B" in Cell E2
6. Modify data size