Skip to content
/

I recently joined the Advent of Code 2021.
During the first 25 days of December, the challenges made me (re)discover many possibilities with C#, some that are long available but maybe not that well known.

I share my code and list of concepts that might inspire you to discover a feature you were not aware of yet!

Although Eric Wastle has been organizing the Advent of Code since 2015. I only discovered it recently when some colleagues invited me to join the 2021 edition.

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

About

During the first 25 days of December, the challenges made me (re)discover many possibilities with C#, some that are long available but maybe not that well known.

Solutions

I had a blast (and some frustration ;)) solving the challenges, starting early morning, every day.

Some of the noteworthy concepts I have used:

  • Records, both class (C# 9.0) and struct (C# 10.0) based
  • Converting data (bits to int with bit shifting, char to decimal using addition or subtraction, etc.)
  • Efficiently read and slice strings, arrays, and lists using Index and Range (C# 8.0)
  • Work with Stack<T> (.NET Framework 2.0), SortedSet<T> (.NET Framework 4.0), and HashSet<T> (.NET Framework 4.7.2)
  • Using init only setters, with expressions and target typed new expressions (all C#9.0)
  • Many, many more...

I have put all my code and descriptions in my AdventOfCode2021 repo on GitHub. I hope this might inspire you to discover a feature you were not aware of yet!

Filed under C#
Last update:
/

In a previous article I described how to configure an Azure SQL database failover group for high availability across multiple regions.

But what if you want to limit network traffic to a database in this failover group to only your private networks?

In this article I show how to make a SQL database failover group reachable via the Private Link service and make sure the database stays reachable after a failover.

In a previous article I described how to configure an Azure SQL database failover group for high availability across multiple regions.

But what if you want to limit network traffic to a database in this failover group to only your private networks?

In this article I show how to make a SQL database failover group reachable via the Private Link service and make sure the database stays reachable after a failover.

read more...
Filed under Azure, SQL
Last update:
/

Last week I received an invitation for a social work meeting about "Pixel art in spreadsheets".

I thought: "How hard can it be".

Well, it is about 25 lines of C# 9.0 hard! 😀

Last week I received an invitation for a social work meeting about "Pixel art in spreadsheets". I thought: "How hard can it be".

Well, it is about 25 lines of C# 9.0 hard! 😀

read more...
Filed under C#, Office
Last update:
/

With an Azure SQL Database, Microsoft is already providing high availability with an SLA of at least 99.99%. But if you want to prevent to be affected by a large regional event or want to meet regulatory demands to be able to execute failovers to another region, enabling a failover group is the solution for you.

In this article I will show you how to create a SQL database failover group in two regions using the Azure CLI.

With an Azure SQL Database, Microsoft is already providing high availability with an SLA of at least 99.99%. But if you want to prevent to be affected by a large regional event or want to meet regulatory demands to be able to execute failovers to another region, enabling a failover group is the solution for you.

In this article I will show you how to create a SQL database failover group in two regions using the Azure CLI.

read more...
Filed under Azure, SQL
Last update:
/

To capture images in my applications, I use the VideoCapture class of the EmguCV library, an OpenCV wrapper for .NET.

To choose a specific camera, you need to supply an index value. But getting this number is not straightforward, and as this number can change over time, it might break your application in the future.

So, what if we could use the actual name of the camera instead of the index value?

In this article I will show how to achieve this.

To capture images in my applications, I use the VideoCapture class of the EmguCV library, an OpenCV wrapper for .NET.

To choose a specific camera, you need to supply an index value. But getting this number is not straightforward, and as this number can change over time, it might break your application in the future.

So, what if we could use the actual name of the camera instead of the index value?

In this article I will show how to achieve this.

read more...
Filed under C#
Last update: