Programming Rants

Azure table storage is slow
20 Jul 2015
Simply put, Azure table storage is too slow. The best I could get out of it was about 700 records/second for INSERT and 4600 records second for READ, which was unacceptable for the data sizes I had to deal with – several tables of around 100,000 records each. Admittedly, I did not use batch operations, […]

Win32: Who loads the library that implements LoadLibrary?
04 Jul 2015
I was sitting in a Dairy Queen this afternoon thinking about random stuff and suddenly this question hit me: who loads the library that implements LoadLibrary? Isn’t it some kind of chicken-and-egg situation? Short answer: It’s the loader. Longer answer: Win32 executable contains a list of DLLs and functions it needs to import. When creating […]

The joy of git
03 Jun 2015
Trying to move an SVN repository to git, I discovered a couple of interesting facts: git clone does not really clone. It only copies one branch, so the resulting repository is not identical to the original. Creating a real clone with all branches is possible, but it requires adding a local branch for each remote […]

Your options for async LINQ are very limited (c)
15 May 2015
CodeProject Simply put, async and LINQ don’t coexist very well. With “async all the way” approach, LINQ queries have to be unwound back into loops. Frankly, that’s a shame.

How to break into debugger when specific Windows message is sent or posted
14 May 2015
CodeProject We have recently been fighting a weird problem in our .NET application that was caused by a duplicate WM_KEYDOWN message. It relatively is easy to figure out who receives the message (Spy++ helps a lot), but how to find out who sends it? If you know (or suspect) the process that sends your message, […]

Why identifiers with non-English letters are bad for your health
29 Apr 2015
We just ran into a very funny story with UNICODE identifiers in C#. It turned out that an identifier like ХTranfer was spelled with Russian letter Х (U+0425) instead of Latin X (U+0058). Furthermore, when we tried to build this code on the server, it complained that identifier ÕTransfer was not found. It turns out […]

Windows Store Bundles Blunders
22 Apr 2015
Long, very technical story, interesting only to Windows Store programmers. Recording this mostly to document the experience. Scenario 1. We have a universal app that contains a Windows Store and a Windows Phone project for Windows 8.1. 2. I manually generated packages for both projects in Visual Studio 2013 Update 4. 3. Visual studio changed […]

Async/await: to sum it up
12 Apr 2015
async methods are not executed asynchronously: see Async/await FAQ, Does using the “async” keyword on a method force all invocations of that method to be asynchronous?). await task is not the same as task.Wait(): ibid, Is “await task;” the same thing as “task.Wait()”?. ExecuteSynchronously() may not actually execute synchronously. TaskScheduler.Current may be and frequently is […]

How “async void” actually works
29 Mar 2015
Let’s say I have this code (C#): void SomeFunc() { HandlerOne(); HandlerTwo(); } async void HandlerOne() { DoX(); await DoYAsync(); DoZ(); } In this case HandlerOne() will return to the calling functions the moment it hits its first await. The code is roughly equivalent to: void HandlerOne() { DoX(); Task t= DoYAsync(); t.ContinueWith(task=>DoZ()); } So, […]

Windows Azure: “user friendly” copy utility
25 Feb 2015
Story in a nutshell: I wanted to copy a huge Azure blob from one place to another. Since there are no convenient Azure management tools from Microsoft*, I used command line AzCopy utility. A minute or two into the process, I realized that a) The speed ain’t that great and the copy will take several […]