10 November 2019 15 minutes read
The concept of parsing has always seemed very complicated to me. I thought that to work in this area you had to have access to some secret knowledge brought by an alien race or something. Some time ago, I had to implement proper markdown parsing in DiscordChatExporter so that I could replace the ineffective regular expressions I had been using. I… continue reading
26 January 2019 5 minutes read
I’m sure everyone with at least some background in C# is aware of extension methods — a nice feature that lets developers extend existing classes with new methods. This is extremely convenient in cases where you want to add functionality to types you don’t have control over — I think everyone at some point authored extensions for the base class… continue reading
23 December 2018 4 minutes read
I have always been trying to be a well-organized person, but for the most part I was doing it wrong. I was lacking in ability to plan and stay focused, which made it seem like I was productive, despite not having any tangible progress towards the goals that really matter. It can be very difficult to stay on top of things and have a clearly defined… continue reading
18 February 2018 4 minutes read
Cognitive biases impact our perception of reality, driving us into making incorrect conclusions and irrational decisions. The topic’s relevancy to software development has already been covered in many places (one, two, three) but I would like to add on by discussing a few cases that haven’t been mentioned before. Survivorship bias Survivorship bias… continue reading
15 December 2017 22 minutes read
Almost a year ago, I started developing YoutubeExplode, a library that scraps information on YouTube videos and lets you download them. Originally, my main motivation for developing it was simply gaining experience since this task involved a lot of research and reverse-engineering. Nowadays, YoutubeExplode is arguably the most consistent and robust… continue reading
18 November 2017 4 minutes read
Quite a long time ago I’ve stumbled upon a very interesting open source project called AmmyUI. Its main goal is to make designing XAML apps a lot more fluid by… removing XAML and replacing it with a custom JSON-like layout language with additional features. I’ve never been a big fan of XAML, so it got me interested and I decided to use it for one… continue reading
16 November 2017 1 minute read
Web applications hosted in IIS adhere to the Idle Timeout setting, which defines a time period of inactivity after which an application is shut down. Subsequent requests will trigger the application to start up again, but it usually takes a while — this rather small ASP.net Core website takes around 10 seconds to start and respond to first request… continue reading
05 November 2017 2 minutes read
New csproj format, among other things, has an option to generate a NuGet package on every successful build. It resolves dependencies, target frameworks and documentation automatically and doesn’t require a predefined nuspec file as all metadata is now also part of the csproj file. Sometimes NuGet packages may require additional files to work — a… continue reading
02 February 2017 4 minutes read
GUI applications often offer a way for users to configure hotkeys, typically using a textbox that records combination of key presses inside of it. Such control doesn’t come out of the box with WPF so you’ll have to implement it yourself. Hotkey class WPF has two useful enumerations for this task — System.Windows.Input.Key and System.Windows.Input… continue reading
02 February 2017 3 minutes read
WndProc is a callback function implemented by all windows that takes care of system messages sent from the operating system. In WPF, it’s not directly exposed as it’s hidden by abstraction, however there are times when you may want to process the events yourself — global hotkeys being a common use case. Contrary to what many people seem to think… continue reading
28 January 2017 3 minutes read
Applications commonly employ recurring tasks that need to execute at specific times, irrelevant of when the application started. For example, you might be developing a Windows service that queries a Web API every day at 18:35, processes the data and then saves it locally. There are some libraries that provide a nice interface to register and… continue reading
01 November 2016 6 minutes read
For some unclear reasons, WPF’s ListBox control does not allow two-way binding on SelectedItems property the way it does with SelectedItem. This could have been very useful when using multiselect to bind the whole list of selected items to the model. Interestingly, you can still call Add(), Remove(), Clear() methods on ListBox.SelectedItems which… continue reading
30 October 2016 6 minutes read
The longer I work with WPF, the more I notice how many things it’s missing. Recently I realized that TreeView.SelectedItem property is read-only and non-bindable. I think there’s no point explaining why binding SelectedItem would be useful, so there should be no surprise in my disappointment. I googled the problem and every resource I’ve found was… continue reading
29 October 2016 1 minute read
As any WPF developer knows, XAML can get messy due to all the nested elements and tabulation. One common problematic area is data templates — they are naturally decoupled from the surrounding layout but typically nested quite deep in the hierarchy. To deal with it, you can refactor some of the commonly used objects as resources into a… continue reading
28 October 2016 2 minutes read
Sometimes you may find yourself facing a problem of having to switch between multiple presentations based on some condition — for example, showing a listbox instead of a combobox when multiselect is enabled. The easiest and the most obvious solution is to change the Visibility property of the elements so that one is shown while the other one is… continue reading
26 September 2015 9 minutes read
At some point I was contracted to make a WordPress plugin that displays some basic Steam Market information on an item — its name, image, price, etc. It turned out a bit less trivial than I thought because the Steam API doesn’t offer any endpoints related to the Steam Market, probably to make developing bots slightly harder. After inspecting the… continue reading