Programming Rants

The art of doubt
11 Nov 2015
I run into the same story time and time again. Someone stumbles upon a bug that they cannot explain. All plausible reasons are eliminated, but it still does not work. They call me for help. When all plausible reasons are eliminated, what’s the next logical step? Start looking into less plausible reasons. The amazing thing […]

Big Brother is seriously watching you
05 Nov 2015
4:18PM: Went to Google Maps and entered “Tirana” in the search box. This was a random act of curiosity: we recently had a conversation about Albania at work, and I was wondering how the city looks. I am certain I haven’t mentioned Tirana anywhere on the Internet within the last two or three months at […]

Cannot return JToken from WCF Web Service
17 Sep 2015
This blog entry is mostly for documentation purposes, so I don’t forget what happened. TL;DR: WCF’s DataContractJsonSerializer cannot deal with JToken or JObject. If you attempt to include those in your data contract, you will get InvalidDataContractException at runtime, and zero bytes response. I have a WCF web service written in C# that returns an […]

Dock panel for Angular.js
03 Sep 2015
It sounds unbelievable, but modern HTML applications seem to lack proper support for dock panels. So, I created one for Angular.js. See the code in Plunker My solution is based on ngDock by Dardino, with a number of changes: – added support for hiding and showing the docked panels: existing ngDock gets thoroughly confused in […]

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 […]