Vectorized Longest Increasing Subsequence

In the problem of Longest Increasing Subsequence, the aim is to find an increasing sequence of elements in a given input. This new subsequence does not need to be continuous. The longest such sequence is the solution to the Longest Increasing Subsequence (LIS) problem.

For example, for input sequence of 0,8,4,5,2, the LIS will return 3 as the longest subsequence is 0,4,5.

In this post I will not focus on the most efficient implementation of LIS. Instead, I will present the most common approach to solve the problem using Dynamic Programming and then present a vectorized version of the algorithm.

The Base Solution

Find out more


CHttpExec Extension

I have been recently working on CHttp which is a tool to send HTTP requests and to measure the performance of REST APIs.

The primary goal of the tool is the ability to measure GET HTTP requests using version HTTP/2 and HTTP/3. As the tool is based on .NET (currently version 9), it requires a reasonably up-to-date Windows installation or the libmsquic package in case of Linux.

The tool exists of 3 components

  • CHttp

  • Chttp Visual Studio Code Extension

  • CHttpExec

Find out more


Using Local LLM with .NET

In this post I explore how one can run a LLM locally to create a chat assistant with .NET 8. I use two libraries:

There is an excellent blog post on Demystifying Retrieval Augmented Generation with .NET by Stephen Toub describing how to use the SemanticKernel library to create a chat agent.

LLamaSharp is a library that can run local LLaMA/GPT model easily and fast in C#. It uses llama.cpp under the hood. I use version 10.0.0 along with semantic kernel version 1.3.0.

Find out more


Range Kata

I have recently come across the Range kata. In this post I dive into a variation of this kata using integer numbers. One implementation is A Range kata implementation in C# by Mark Seemann focuses on property testing and comparing Haskell, F# and C# implementations.

The referenced post has chosen using Church encoding as the implementation which results in a more complicated code in C#. In this post I will focus on building on the recently added features of .NET 8: IBinaryInteger<T>.

My test cases cover the samples described by the kata. Although I don't find these test cases extensive, they give a good enough starting point. That said, do not expect the code below to handle edge-cases that has no test case detailed in the kata.

This implementation utilizes the following relatively new C# features:

Find out more