atlas news
    
Improve and Repeat
09  décembre     19h00
How to Configure InternalsVisibleTo in the .csproj File
   As we moved from .Net Full Framework to .NET 6, we had to use the little hack of creating a AssemblyInfo.cs file and put this content into it to access the internal classes and methods from our test project: csharp using System.Runtime.CompilerServices; [assembly:InternalsVisibleTo( Logic.Tests )]
02  décembre     19h00
How to Fix the Context Menu of Windows 11
   With Windows 11 came a new context menu in the file explorer. What before was a one click action, now takes us two steps: We right-click on the file to open the first context menu: Now we need to click on Show more options to get the Windows 10 context menu: So far, I accepted this extra step as...
25  novembre     19h00
The Notable Difference in Dictionary Initialisation in C
   In C# we have two ways to initialise a dictionary. While both give us a dictionary in the end, there is a small but important difference when it comes to duplicated values. Let us explore the difference.
18  novembre     19h00
Create Sortable GUIDs With UUID Version 7 in .NET
   GUIDs are great for generating unique identifiers across distributed systems, since they need no centralised coordination and are globally unique. But their randomness comes with a price tag when we use them in relational databases: fragmented indexes, slower inserts, and no sense of order. Since ...
11  novembre     19h00
A Shorter Way for Null Guard Clauses in C
   When we want to make sure that our method only accepts values that are not null, we can write guard clauses like these on top of the method: csharp string Combine(string address, string city, string zipCode) if(address null) throw new ArgumentNullException(nameof(address)); if(String.IsNullOrEmpty...
04  novembre     19h00
Do Not Mix Test Code With Production Code
   A few months back I reviewed an application. It was sad to see in how little time you could create a mess that is not only hard to work with, but that can only be changed with a lot of effort. In this post we focus on one tiny little detail that can help you as a warning sign early on: having test...
28  octobre     19h00
What Linux Terminal Am I Currently Using?
   When we run Linux on a Docker container, we may not know what terminal application or shell currently runs. If we want to find out, we can run two commands to get an answer.
21  octobre     18h00
How to Connect From a Docker Container to the Host
   When we want to connect from the host system to an API inside a Docker container, we can map the port with the -p option and then access it through localhost. So far, so good. But what do we need to do if we want to make the connection in the reverse direction?
14  octobre     18h00
Move Partitions Around With MiniTool Partition Wizard
   As I moved to a larger SSD, I had a problem: How can I move the systems partition of Windows at the end of the SSD so that I can use the free space to extend my existing C: drive on Windows?
07  octobre     18h00
Fix Permissions in Windows With takeown and icacls
   In Windows, we sometimes run into files or folders we can not access, even with elevated privileges. The takeown tool helps us solve this problem by letting us take ownership of those files or directories. Once we own them, we can adjust permissions or grant access as needed. The basic command...
30  septembre     18h00
Little SQL Server Tricks: Escape in LIKE Queries
   If you search for a value with an in the name, you learn something new about SQL Server, but end up with a result that does not match your expectation: sql SELECT FROM [dbo].[DatabaseLog] WHERE Object LIKE ’% %’ If we run this query, we do not get back everything with an in it. Instead, we get back...
23  septembre     18h00
Repository Aliases in GitHub Desktop
   If you have two repositories with the same name in GitHub Desktop, you have a hard time to figure out which one is which: This can happen when we need to work on a fork of the project and the original one at the same time or when we have a backup in a different folder where we need to check...
16  septembre     18h00
The Core Folder Anti-Pattern
   There is an interesting pattern that you can find in many projects, that usually starts with a good idea and turns into a dump in no time: the core folder. You start with an application and think about the core business, the important stuff. So, you go on and create a core folder. Here is now the...
09  septembre     18h00
Windows 11 Installer Stuck at 42% - Now What?
   There is an annoying bug in the Windows 11 Installer that catches me way too often. If you select something different than the pre-selected values in the first screen for the language options, the installer starts but then stays forever at this progress level: 42%
02  septembre     18h00
How to Back up Your GitHub Repositories
   Many developers use GitHub to share their code. It is convenient, offers a lot of features and works without any noticeable problems for years. Did you ever thought on creating a backup for your repositories? Git helps us to ignore that task a bit. With every git clone we create a full copy of the...
26  août     18h00
Use the required Keyword in C to Enforce Property Initialisation
   Last week we saw how much code we can get rid of when we use the [init keyword to create immutable objects]. The only downside we found was that we cannot enforce that all properties get a value. To solve this problem, we can use the required keyword of C# 11: The required modifier indicates that...
19  août     18h00
The init Keyword for Immutable Properties in C
   With C# 9 we got the new init keyword. You may have heard of it when it was introduced, but probably not used it much at the time. Then as with so many new things in the C# language, the new syntax did not offer new functionality but syntactic sugar to get the same results faster. Why should we...
12  août     18h00
Little Git Tricks: Revert Changes in a File
   If you want to revert a change in a file with Git, you can use this command: text linenums 0 git checkout -- . path to file The double-hyphen (--) tells Git to take what follows as its second argument (the path to the file). This makes it clear that you did not specify a branch. While this works,...
05  août     17h00
5 Things to Test With List Parameters
   Whenever we have a method that accepts a list as a parameter, we should test these 5 cases to see if the method handles the input correctly: Null Empty One A few Many Let us take a closer look at each of those inputs and what they can check for us. The list is not my invention, but so far, I was...
29  juillet     18h00
How to Fix the Multiple Entry Points Error in .Net Applications
   Before I start making changes, I usually run the template code to see if everything works so far. Even when it only has the template code, problems could happen. A few weeks ago, I skipped this step and after I made my changes, I got this error: Error (active) CS0017 Program has more than one entry...