Disqus Off
So I noticed that the Disqus comments that I’ve been had been displaying a range of scammy ads.
Using System.Text.Json To Enforce API Logic
Assume you have the following type:
Deleting RabbitMQ Queues With EasyNetQ
I recently had to delete all the queues in my RabbitMQ instance.
Fix For Cannot use LINQ in MatchCollection Regex with .NET Standard 2
I have some code where I am running a regex and using LINQ to manipulate the matches.
Handling Null And Empty Strings With System.Text.Json
Assume we have the following class:
Inheritance In Business Logic Is Likely A Code Smell - Part 1
When you were introduced to object oriented programming (OOP), you probably used the canonical example domain of animals.
Handling Exceptions With Refit
Refit is a very brilliant library that allows you to call REST APIs with minimal code.
Consuming REST JSON APIs From Excel
So today I wanted to see if Excel could natively consume JSON APIs.
Fix - error CS8805 Program using top-level statements must be an executable
So today in a rather large project I began getting the following error when I ran a build:
Using Regex MatchEvaluators In C#
Regular expressions (Regexes
) are a powerful tool for solving certain types of problems - and in particular looking for a certain pattern of text in a larger string and (optionally) replacing it with another.
Remember To Encode QueryString Data
Assume you have a controller with this GET
end point
Be Clearer With TimeSpans
Many of the .NET APIs take time intervals as their parameters, and it usually is in milliseconds.
Entity Framework Core - Unique Constraits vs Unique Indexes
In your traditional database, there are two ways to enforce the restriction that “the value of this column should be unique”:
- Unique constraints
- Unique indexes
UI Fails - Oracle VirtualBox 6.1
This is the dialog I saw when I launched Oracle VM VirtualBox today.
Fix For Entity Framework Core Not Generating Indexes & Constraints
If you are using Entity Framework Core, and are configuring your models using configuration classes (as you probably should) you might run into a situation where after adding your migrations and updating your database, you find that the resulting schema does not have indexes or unique constraints.
Fix For Entity Framework Tools Error
While running the entity framework command to add a migration, I got the following error
Fix For pgAdmin Not Loading
Are you attempting to open the pgAdmin web console and it appears to be loading endlessly?
What Do You Actually Agree To When You Accept All Cookies
I have been writing software for exactly twenty years now. In the course of this I have learnt very many things, which I hope to journal over time.
Improving HttpClient Requests
This is another improvement to the logic of making a Http
request using the HttpClient.
Beware of HttpClient Header Validations
I ran into an interesting problem the other day.
Remote Debugging In VS Code
Today we will setup an environment where we can develop and debug code remotely on a Linux environment.
HTTP Redirects Using HttpClient
In a previous post I had mentioned that the HttpClient
does not automatically process HTTP redirects and you would have to write the logic yourself.
Refactoring With Records In C#
I recently had an opportunity to revisit some very old code (to the tune of almost a decade) and saw it as an opportunity to make some improvement and cleanup.
Changing The Default Shell In IntelliJ To PowerShell
The default shell in IntelliJ (and its children IDEs) is the Windows Command Prompt.
Conditional Logic In MSBuild
The Microsoft Build Engine, MSBuild, is responsible for controlling the build process that translates source code to object code and its relevant artifacts.
Getting Now Playing Information From WQXR In .NET
I have recently discovered a glorious online streaming radio station, WXQR - New York’s Classical Music Radio Station. This station streams classical music pretty much 24 hours a day.
Posting Messages To Microsoft Teams With Code
Microsoft Teams makes use of an API, the Microsoft Graph API, that is leveraged to push data into, and pull data out of various Microsoft Products, chiefly Office 365.
Disable SSL Certificate Validation In .NET
If you are invoking a web request from your application, you may get the following error:
Querying & Extracing Data From YouTrack
YouTrack is a robust web based platform for issue tracking, Sprint and Kanban management.
Chrome UI Surprises
Here is a site I am visiting on Chrome.
Joining Strings - Part 4 : String.Format
This is Part 4 in the series of Joining stings
Joining Strings - Part 3 : StringBuilder
This is Part 1 in the series of Joining stings
Joining Strings - Part 2 : String.Concat
This is Part 2 in the series of Joining stings
Upgrading To WSL 2
Good news if you have been running on Windows Subsystem For Linux (WSL) and have wanted to upgrade to version 2 but have not been willing to join the Windows Insider Program - WSL2 is now out in the main release.
Joining Strings - Part 1 : The + Operator
This is Part 1 in the series of Joining stings
Jekyll, Ruby & OpenSSH
So like I mentioned in my last post, I have migrated from WordPress to Jekyll as my content management system.
Goodbye Wordpress
I have been running this blog on WordPress since inception, and using WordPress in general for many years (since 2005).
Using IIS With ASP.NET Core 3.0
Kestrel, the web server that powers ASP.NET Core is highly optimized for running ASP.NET Core code, and running it fast.
Using Curl In PowerShell
A useful tool to have in your toolbelt is an ability to make web requests and retrieve responses from the command line.
Touch In PowerShell
In Unix / Linux land there is a handy command to create an empty file.
How Old Is Your Language?
Ever wonder how old your favourite language is? You might be surprised!
Decimals, Precision And Scale
The .NET framework has a decimal data type.
Extracting Bytes From A F# String
Suppose you need to extract the byte values of a string in F#
Should all bugs be fixed?
On the surface a perfectly reasonable question.
What Is A Software Company?
A software company is an institution that converts money into software that people pay money for.
Count vs Length vs Any - Checking Collection Emptiness
When working with collections there are several ways that you can determine if a collection is empty.
Getting Your Internet IP Address
Suppose, for whatever reason, you need to know your ISP assigned IP address.
Properties Under The Hood
One of the features of C# (and the .NET platform in general) is the support of properties as a first class citizen of the runtime.
Arguments Handling Across Paradigms
One of the interesting things about using an object oriented language (like C#) vs a functional one (like Racket) is you get an opportunity to see first hand how different things are doing in either paradigm.
FizzBuzz In F#
The FizzBuzz problem is one of those ubiquitous industry problems that has been floating around for decades, intended to separate the sheep from the goats.
Using Nuget In F# Scripts
One of the brilliant improvements in F# 4.7 is the ability to make use of Nuget packages in your scripts.
Pinning Nuget Package Versions
The Nuget package management system has been a godsend when it comes to managing libraries and dependencies in your projects.
Controlling Creation Of .NET Core Projects
Many of us create .NET Core projects in the following way:
Fun With Tuples In C# 7 & Above
Tuples, or to use their correct name, ValueTuples
, were introduced in C#.
Verifying File Hashes With PowerShell
It is often a good idea to verify the file hashes of downloaded files, whether it is to detect that the file you download was actually the one that the developers intended (see what happened to Handbrake for OSX) or to detect corruption of a download.
AsReadOnly() May Not Be Doing What You Think!
You have probably come across the AsReadOnly()
extension method, and have probably made liberal use of it.
Beware Of Controller Name Typos In ASP.NET Core Controllers
The other day I spent the better part of an hour trying to figure out why a particular controller action was not being hit by a request.
Copy SSH Key In Windows 10
Did you know that Windows 10 has a proper SSH client, and has had one for a while?