.NET type forwarding
This feature has apparently existed for years, but I found out only now. CLR has an equivalent of HTTP redirect for types, it is called You can move a class […]
This feature has apparently existed for years, but I found out only now. CLR has an equivalent of HTTP redirect for types, it is called You can move a class […]
I was experimenting with creating new projects out of templates in VS 2019, and to my surprise ran into a lot of trouble and error messages. One time it told […]
“Any sufficiently advanced technology is indistinguishable from magic” Athur C. Clarke While reviewing some code, I stumbled upon a class that receives an ObservableCollection<ILogFormatter> in the constructor. I discovered that this […]
I’ve been using Whatsapp for about 2 years now, and it was more or less OK, until I bought a new phone and tried to move my account there. This […]
TL;DR: wrapping existing method DoSomething(MyData data), with an identically named generic extension method DoSomething<T>(T data) is a bad idea, since it erases compile-time type checking. DoSomething() may now be called […]
Today I spent several hours trying to find out why this code does not work: function doit() { return someObject .method1() .method2(); } but this one does: function doit() { […]
Coming back from .NET Framework, it feels like Win32 API was invented by some rather cold people with total disregard for the well being of the application programmers. Every other […]
This Friday I wrote a unit test and to my astonishment I have found that “a” < “A” < “ab”, with .NET InvariantCulture and InvariantCultureIgnoreCase string comparers. That means that .NET […]
I have just spent a few fun hours fighting Apache rewrite rules in an .htaccess file. It turns out that temporary redirects just work, but permanent redirects require RewriteBase! Frankly, […]
Over the week-end I created the TaskTimer class that allows to execute code on timer in an async method: static async Task DoStuffOnTimer() { using (var timer = new TaskTimer(1000).Start()) { foreach (var task in timer) { await task; DoStuff(); } } } Source […]