• C# and .NET - Programming

    Clearing the NuGet cache

    NuGet is the package manager used by .NET to download, restore, and manage package dependencies. Most of the time it works quietly in the background: you add a package, restore the project, and NuGet downloads what is needed. However, NuGet also stores packages and metadata locally. This is good for…

  • C# and .NET - OOD / OOP - Programming

    PriorityQueue in .NET 6: a practical guide

    .NET 6 added a long-missing collection to the base class library: PriorityQueue<TElement, TPriority>. A priority queue is useful when you do not want to process items in the order they were inserted, but in the order of their priority. Typical examples include job scheduling, pathfinding, graph algorithms, simulations, message processing,…

  • C# and .NET - OOD / OOP - Programming

    Custom comparer of a SortedSet in C#

    SortedSet in .NET manages ordered, unique elements using a custom comparer that defines both sorting order and element uniqueness. A common pitfall occurs when two different instances with the same value are treated as duplicates. To avoid this, a tie-breaker is needed, ensuring both order and distinctness among elements.

  • C# and .NET - Programming - Web

    Web page scraping, the easy way

    Scraping content from websites can be a useful tool for gathering information or automating certain tasks. In C#, there are several libraries available that can help make this process easier. In this blog post, we will cover how to use the HtmlAgilityPack library to scrape content from websites in C#.…

  • C# and .NET - Programming - Web

    Scraping dynamic page content

    Scraping dynamic content from websites has become an important task in data collection and analysis. With the advancements in web technologies, websites are now using dynamic content that cannot be easily scraped with traditional web scraping techniques. In this blog post, we will explore how to scrape dynamic content from…

  • C# and .NET - Programming - Testing

    Unit-testing file I/O in .NET

    File I/O looks like one of those things that cannot be unit-tested properly. A method that reads directories, scans files, compares extensions, and deletes files seems tied to the real machine where the test is running. That creates all the usual problems: tests become slow, fragile, dependent on local paths,…

  • C# and .NET - Programming - Software

    Windows Forms smells funny, but…

    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 Forms, a technology declared dead multiple times. The Telerik report…