Tuesday, October 15, 2024

Windows 11, Edge, ERR_CONECTION_RESET, ping works

Nothing worked, no URL from Edge 

Try reinitialising the network states. Run the following commands in an elevated cmd shell:

  • Reset WINSOCK entries to installation defaults:

    netsh winsock reset catalog

  • Reset TCP/IP stack to installation defaults:

    netsh int ip reset reset.log

  • Reset Firewall to installation defaults:

    netsh advfirewall reset

  • Flush DNS resolver cache:

    ipconfig /flushdns

  • Renew DNS client registration and refresh DHCP leases:

    ipconfig /registerdns

  • Flush routing table (reboot required):

    route /f

did not work

Tried a different wifi network, flalessly worked, installed Chrome, no more issues.
Edge FOR THE WIN

Friday, April 2, 2021

Fastest C# compare string

 Use 


string.Equals(s1, s2, StringComparison.OrdinalIgnoreCase)


instead of toupper or tolower

Monday, February 8, 2021

Split sql with xml

https://stackoverflow.com/questions/697519/split-function-equivalent-in-t-sql/1846561#1846561


DECLARE @xml xml, @str varchar(100), @delimiter varchar(10)
SET @str = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15'
SET @delimiter = ','
SET @xml = cast((''+replace(@str, @delimiter, '')+'') as xml)
SELECT C.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as X(C)



Thursday, April 9, 2020

Parse URL in SQL

I searched a lot, and I did not like anything I found. Then I saw this on sql-server-helper.com That site looks a little odd, I thought I would save this for myself, in case the site goes away, like some I used before stackoverflow.
CREATE FUNCTION [dbo].[ParseURLQueryString]
( @QueryString AS VARCHAR(MAX) )
RETURNS @QueryStringTable TABLE
( [Key] VARCHAR(100), [Value] VARCHAR(1000) )
AS
BEGIN
DECLARE @QueryStringPair VARCHAR(2000)
DECLARE @Key VARCHAR(100)
DECLARE @Value VARCHAR(1000)

WHILE LEN(@QueryString) > 0
BEGIN
SET @QueryStringPair = LEFT ( @QueryString, ISNULL(NULLIF(CHARINDEX('&', @QueryString) - 1, -1),
LEN(@QueryString)))
SET @QueryString = SUBSTRING( @QueryString, ISNULL(NULLIF(CHARINDEX('&', @QueryString), 0),
LEN(@QueryString)) + 1, LEN(@QueryString))

SET @Key = LEFT (@QueryStringPair, ISNULL(NULLIF(CHARINDEX('=', @QueryStringPair) - 1, -1),
LEN(@QueryStringPair)))
SET @Value = SUBSTRING( @QueryStringPair, ISNULL(NULLIF(CHARINDEX('=', @QueryStringPair), 0),
LEN(@QueryStringPair)) + 1, LEN(@QueryStringPair))

INSERT INTO @QueryStringTable ( [Key], [Value] )
VALUES ( @Key, @Value )
END

RETURN
END

And this is how you use it
SELECT * FROM [dbo].[ParseURLQueryString] ( 'fname=Barack&lname=Obama&addr=1600 Pennsylvania Ave NW&city=Washington&st=DC&zip=20500' )

Wednesday, February 26, 2020

WiX undefined preprocessor variable

Not sure how many people will see my small blog, but here I go, maybe it helps someone.

I recently had this WiX undefined preprocessor variable issue.

The actual variable was the same old $(var.MyProject.TargetDir)

After looking through the whole internet and not finding anything, the fix was a simple one.

The "MyProject" HAS TO BE EXACTLY THE SAME NAME as the web project that I added as a reference to the Wix project.
So if your project is called WhatewerWebAll, then you have to have something like:


You can say what you want, but the "undefined preprocessor variable $(var.MyProject.TargetDir)" message is actually not really describing the real issue, but maybe that's just me.