NET Framework 6 adds the long-awaited Priority Queue to the list of collections. An example of usage of Priority Queues is getting the k-highest value in an array without sorting the array: the algorithm is keeps k values in the…
SortedSet uses a custom comparer for sorting items. The comparer serves two purposes: define a criterion for ordering items in the set (e.g. the Length property in the sample below), AND identify duplicate items, so that only one is present…
In this example, we will import video from a Yi security camera into YouTube. The same process, with eventual adjustment to the naming of directories in the SD card used by the camera to record videos, will also apply to…
There are many ways to extract data elements from web pages, almost all of them prettier and cooler than the method proposed here, but as we are in an hurry, let’s get that data quickly, ok? Suppose we have to…
One of the most common roadblocks when scraping the content of web sites is getting the full contents of the page, including JS-generated data elements (probably, the ones you are looking for). So, when using CEFSharp to scrape a site,…
Two good news: file I/O is unit-testable, and it is surprisingly easy to do. Let’s see how it works! A software no-one asked for First, we need a piece of software that deals with files and that has to be…
If you encounter the following error when pulling a repository in SourceTree: VirtualAlloc pointer is null, Win32 error 487 it is due to to the Cygwin system failing to allocate a 5 MB large chunk of memory for its heap…
Some might say that testing private methods should be avoided because it means not testing the contract, that is the interface implemented by the class, but the internal implementation of the class itself. Still, not all classes were designed with…
In the “2016 .NET Community Report” just released by Telerik, the answers to the question “What technology would you choose if building for Windows Desktop?” were as follows: So roughly half of new desktop developments would be based on Windows…
It is not easy to monitor how our code behaves on a vast array of different machines. A myriad of different configurations can lead to errors that are difficult to reproduce and even more difficult to anticipate. And when the…