Tuesday, December 03, 2024

MySQL 8.0.39 Grant problem.

A user with all privileges wasn't able to update a Procedure, got error below.

ERROR 1227: Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation.

We fixed it by running 

GRANT SYSTEM_USER ON *.* TO 'userWithProblem'; 

Still connected as user 'userWithProblem'



Sunday, September 15, 2024

 DELL bios update problem.

Fixed by removing
  • “Microsoft System Management BIOS Driver”
  • “Microsoft Windows Management Interface for ACPI” (there will be several)
found in Device Manager -> System Devices

see source Dell Bios problem



Wednesday, March 06, 2024

 ShiftLeft vs multiply in .Net

    Converting 2 bytes to a UINT16
Which is fastest? multiply or shiftLeft


       Dim a As Byte = 3
        Dim b As Byte = 7
        Dim c As UInt16
        For i = 0 To 100000
            'c = a + b * 256
            c = a + (CInt(b) << 8)
        Next

Multiply wins, 10 % faster.

NB!
ShiftLeft << isn't calculated first so you need the () around 
Shift left a byte, need to convert it to a uINT16 first.
 
c=1795
if you calc it 
c=b<<8 +3 = 56
c=a+ b<<8 = 10
c=cint(b)<<8+3 = 14336
c=a+cint(b)<<8 = 2560
c=a+(cint(b) <<8) =1795 

So I will stay away from ShiftLeft/Right !

Wednesday, February 21, 2024

Filezilla Server versus ClickOnce applications problem.

 Filezilla Server versus ClickOnce applications problem.

Suddenly I wasn't able to deploy .Net applications using ClickOnce.
I got a FileZilla Server as the publisher Folder Locations. One day it stopped working, complaining on Passive Mode didn't work.
 I figure out the problem was at the server side.

On Filezilla the minimum allowed TLS version was set to v1.2 ???
I'm not sure if this was the default setting or if VS2017 had done some changes regarding minimum TLS level.
But after changing it to minimum v1.3, ClickOnce deployment start working :)

To find the Minimum TLS level settings in FileZilla:
  • Open 'Administration Interface for FileZilla'
  • Click Menu 'Server'
  • Click 'Configure..'
  • Select 'FTP and FTP over TLS (FTPS)' under 'Protocol Settings'
  • On the 'Connection Security' tab, set 'Minimum allowed TLS version' to v1.3
  • Click OK
  • We are done, at least I was 😁

Thursday, January 18, 2024

Removing ZWSP 'Zero Width Space' using VB.Net

 Sometimes user will copy in a string from a web sites.

It can contain a Zero Width Space character that will not be seen and will make your life a mess.

Pasting the string into Notepad++ 

<PLCsymbol SignalName="​.bNewAMTG_Clutch_Cal" Value="true" />

and enable show all characters you will see

<PLCsymbol SignalName="​ZWSP.bNewAMTG_Clutch_Cal" Value="true" />

The ZWSP character is UniCode Char &H200B

so

Dim CleanStr as string

CleanStr=messyStr.Replace(ChrW(&H200B), "")

This will remove any ZWSP's

MySQL DateTime from .Net

 I learn the hard way that different Windows Region settings will screw up your life.

If user has a DateTime region setting not what you have as a devoloper you have to convert DateTime in your .Net program to send DateTime in MySQL format while doing UPDATE or INSERT INTO.

dim myDate as Date

myDate=now

Sending this to MySQL use following format string

INSERT INTO myTable bla bla 

Values ( myDate.ToString("yyyy-MM-dd HH:mm:ss")










MySQL to MariaDB

 Here is a good description how to migrate to MariaDb MySQL to MariaDb Example of how to dump data from MySQL port=3307: mysqldump --user=ro...