Friday, April 29, 2022

C# Check if file exists after delete (issue, no solution)

 I seem to have a lot of issues managing files with C#. I have this check to make sure the file is gone after doing a delete. Manually checking, the file is gone but the app check finds the file (but does not find it after I manually check). Maybe timing issue?

fi.Delete does not always delete

Although EXE files will throw an error, there are some scenarios for non-EXE files to not throw an error. In this case, the process will continue as if the delete was executed successfully.

I have not identified why this is the case. More interestingly on the Windows end, I can "sometimes" manually delete the file with Windows explorer. Sometimes I cannot. No clue why or how or when. And when it cannot, I can rename it then delete it with Windows explorer. Why? No clue.

Delete with Process

So, I have a check if the file still exists. If it exists, I execute a command line delete: 
cmd.exe /C del [filepath]

I use Process to execute this with a WaitForExit()


Check if file still exists

Even after all this, the "fi.Exists" still returns true even when the file does not exist anymore. Does it exist when at the time of execution, I don't know. But if I debug it, it does not exist and executes the proper path. There may be some time for the process to execute??


Summary

So somehow after attempting to delete twice, the fi.exists still returns true for some reason in full execution mode but not in debug mode. Why? No clue. 

Wednesday, April 20, 2022

Error only in production "This site can’t be reached" (RCA: Very large data in textbox)

I just get a "This site can't be reached" "The connection was reset" "ERR_CONNECTION_RESET".

There can be many other reasons but hopefully this will help if all other aides did not help.

RCA

Essentially, the problem to this specific problem was the firewall has a limit on the amount data that can be transported. My textboxes contain a lot of data (in the thousands of bytes). If I remove the data in the textbox everything works in production. My local system does not have this limitation so this works in my environment.

Tuesday, April 19, 2022

Upgrading Microsoft C# SMO from 160.2004021.0 to 161.47008.0 "cannot convert from 'system.data.sqlclient.sqlconnection' to 'Microsoft.SqlServer.Management.Common.IRenewableToken'"

 ERROR:

"cannot convert from 'system.data.sqlclient.sqlconnection' to 'Microsoft.SqlServer.Management.Common.IRenewableToken'"


Convert all System.Data.SqlClient to Microsoft.Data.SqlClient


RCA

Updated Microsoft.SqlServer.SqlManagement from 160.2004021.0 to 161.47008.0

Monday, April 18, 2022

Buggish: Canon MX922 printer driver on Windows 10

MP Driver vs XPS Driver (working solution)

Summary: (To print) Download and install MP driver. No problems also installing XPS but it requires MP driver to be installed first.

Detail: They are not the same. XPS does require the MP to be installed first. If XPS is executed first, it will show a message that the MP driver is required. On the same note, I am not sure if security patch is included.

Windows Default Driver (did not work)

I tried the Windows PCL driver and point it directly to the ip address of the printer. This does not work. I can ping the address. I also later installed the MP driver which is also pointed to the same address.

Windows Find Printer (useless and avoid)

It found the printer, but keeps showing missing driver. There is no way to resolve this in Windows only. Click into the option only displays scanner and configuration options, nothing related to printers. It does not show up in the printer options. It is also a little misleading because clicking "Add Printer", you have to wait for Windows to load something. If you close the windows before this happens, the printer does not even show in the list (although still useless after).

Upon initial "setup" it requests to open a printer app (from the Windows app store). Skip this. That app is useless. 

Thursday, April 14, 2022

Work Life: I question developers who cannot figure out tools like Jira filters

I am not sure how many times I have had to show colleagues on how to use Jira or Confluence.

Create a Board

Seriously, it is three clicks to get to the option that literally says "Create a Board". I really have to question the innate abilities of developers when they do not wish to just click on things just to see what is there. Especially, UI developers.

No time? I am literally click on things all the time during meetings. What does this button do? What does that drop down do? 

A developer that doesn't know when to stop? "Are you sure you want to delete the entire history? There is no recover." Then maybe don't click on it?

Create a Filter

Fine, this may be a bit trickier for "normal" people. If a developer cannot figure this out, why are you even a developer? Especially... especially (!!!!) db developers. It looks practically the same! I haven't developed for over 10 years and I can guess the keywords to use in the query. And that is only if you use the advanced mode. The basic filter is just options and click on more options. Then there is a big huge button that says Save.

Figuring Things Out

I just do not understand. Even if you are not a developer, a PM or SM or a manager. It is so insane that I have wrote documents on how to do these simple steps. AND.....

I still get people messaging me, "what do I fill in here." I basically walk them through the steps I provided:
1. Which step are you at?
2. Do you see the nth bullet (usually the first item), is that your question?
3. Do you see what it tells you to fill in?

And this is not a minority of the cases.

Sunday, April 10, 2022

Life: Fixing Squeaky Door Hinge with White Lithium Grease (by inexperienced almost a year later)

Disclaimer: This information is only provided as an anecdote. I have no knowledge of hinges or grease or any carpentry except for the basic usage of a door. This may or may not work for others.

I just used a screw driver to remove the hinge from the door. Placed it in a box, then used a white lithium grease spray () on the hinge. I do a quick spray across the side then put it upside-down and spray into the center pin of the hinge in hopes for it to drip "down" (towards the top of the pin). I also close/open the hinges in hopes to get the grease moved around in the mechanics.

I have done this on five hinges on three separate doors. This solved all squeaky problems for me. I use this particular grease because it was recommended on a site that I looked up too long ago. I have not used any other grease before so I cannot compare whether this is better than other options.

There were no problems with the hinges. I unscrewed and screwed from bottom to top starting with the half on the door frame. I don't think the order really matters.

So far satisfied with the results. I just completed three hinges. I did two about ten months ago and those doors are still ok.


Reference

https://www.amazon.com/gp/product/B000CINVA6/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1

- CRC 5037 White Lithium Grease - 10 Wt Oz.

Sunday, April 3, 2022

Navbar not working with Bootstrap 5.1.3 and Jquery 3.6.1

Resolution

If using newer version of 5.1.3 from older Bootstrap, make sure the parameters are correct. There is a change from data-toggle to data-bs-toggle and data-target to data-bs-target. Jquery version should not matter. It does make a difference in the older version.

Root Cause Analysis (RCA)

I do not use javascript much so I jumped from page to page. It is quite frustrating troubleshooting javascript with VS Community 2022 in a Blazor Project. Each item was somewhat new so it was difficult to figure which one was causing the issue.

The source of my problem was that the first navbar used an older version of bootstrap. After finding the new code sample, I did not copy directly and attempted to modify the missing parts. This did not work, then I had to look up what version of bootstrap came with VS 2022. Eventually, my problem was picked from each step.

Reference

https://getbootstrap.com/docs/5.1/components/navbar/