A list of the most recently updated pages.
| Sep 6, 2022 | » | Fiction Potpourri
10 min; updated Oct 26, 2025
A collection of notes/impressions from titles where I didn’t find enough to necessitate a dedicated page. Usually short works of fiction. Unknown Number Unknown Number. Blue Neustifter. twitter.com . genderdysphoria.fyi . Jul 27, 2021. Accessed Sep 6, 2022. tells the story of a person who has gender dysphoria. In an alternate universe, they never transitioned but went on to become an established physicist who could communicate across parallel universes.... |
| Sep 7, 2025 | » | LLM Instructions for Advent of Code Using C#
1 min; updated Sep 7, 2025
The project uses modern C#. The user is an experienced programmer who has been writing C# for a year. Before that, the user mostly wrote imperative object oriented C++ code. Reference concepts from https://learn.microsoft.com/en-us/dotnet/csharp/ where appropriate. Beware of the user writing non idiomatic code, e.g., being too imperative where a declarative or functional programming approach might be better suited. |
| Sep 7, 2025 | » | LLM Instructions for Advent of Code
1 min; updated Sep 7, 2025
Advent of Code Challenges Advent of Code is an annual programming event comprising of 25 challenges that are tied together by a narrative. The user’s objective is to pick a language and then learn about it by solving the programming challenges. At the end of each event, the user should have a working knowledge of the chosen language. Given a file like advent-of-code/2024/AoC2024/06-guard-gallivant/06-guard-gallivant.md, you can find the source files by searching the containing folder, i.... |
| Sep 6, 2025 | » | Generic and Non-Generic Collection Interfaces in C#
4 min; updated Sep 6, 2025
There are two main types of collections: non-generic (ICollection) and generic (ICollection<T>). Non-generic collections only exist because .NET did not originally have generic data types. They shouldn’t be used because: They are untyped at compile time. The frequent casting from object and the actual type is error-prone; it’s easy to put the wrong type in the wrong collection. Value types need to be boxed as object, e.g., List<int> stores its data in an int[], which is more performant than using object[] as that requires boxing.... |
| Sep 6, 2025 | » | Collection Types in C#
3 min; updated Sep 6, 2025
Choosing a Collection Type In summary, the use cases are: Dictionary<TKey, TValue> for quick look-up by key. List<T> for accessing items by index. Queue<T> for first-in-first-out (FIFO) access where the element is discarded after use. Stack<T> for last-in-first-out (LIFO) access where the element is discarded after use. LinkedList<T> for sequential access from either the head or the tail. ObservableCollection<T> to receive notifications when items are removed/added. SortedList<TKey, TValue> for a collection sorted by keys and accessible by either key or index.... |
| Aug 24, 2025 | » | Random Page
1 min; updated Aug 24, 2025
window.addEventListener("load", () = goToRandomPage()); |
| Aug 23, 2025 | » | AoC 2024 Day 08: Resonant Collinearity
4 min; updated Aug 23, 2025
Parsing Each antenna in the map is tuned to a frequency indicated by a single lowercase letter, uppercase letter, or digit. Two antennas with the same frequency create two collinear antinodes on either side where one of the antennas is twice as far away as the other, e.g. .......... ...#...... .......... ....f..... .......... .....f.... .......... ......#... .......... .......... Antinodes can occur at locations that contain other antennas.... |
| Aug 23, 2025 | » | AoC 2024 Day 07: Bridge Repair
6 min; updated Aug 23, 2025
Parsing Each line represents a single equation, e.g., 292: 11 6 16 20. Part One needs to make a decision based on each line independently. Parsing each line into a data structure and yielding that should suffice. using System.Collections.Immutable; using System.Text.RegularExpressions; namespace AoC2024; public partial class BridgeRepair { public static IEnumerable<CalibrationEquation> Parse(string filePath) { using var inputReader = new StreamReader(filePath); string? line; while ((line = inputReader.ReadLine()) != null) { var numbers = InputLineRegex.... |
| Aug 23, 2025 | » | AoC 2024 Day 06: Guard Gallivant
4 min; updated Aug 23, 2025
Parsing The map shows the current position of the guard with ^ (to indicate the guard is facing up from the perspective of the map). Any obstructions - crates, desks, alchemical reactors, etc., are shown as #. ....#..... .........# .......... ..#....... .......#.. .......... .#..^..... ........#. #......... ......#... using System.Collections.Immutable; namespace AoC2024; public partial class GuardGallivant { public enum Orientation { Up, Right, Down, Left } public readonly record struct Coordinate(int R, int C); public readonly record struct Visit(Coordinate Coordinate, Orientation Orientation); public readonly (int RowCount, int ColCount, HashSet<Coordinate> Obstacles) AreaMap; public readonly Visit StartingPosition; public GuardGallivant(string filePath) { using StreamReader inputReader = new(filePath); HashSet<Coordinate> obstacles = []; Visit?... |
| Aug 23, 2025 | » | AoC 2024 Day 05: Print Queue
3 min; updated Aug 23, 2025
Parsing The notation X|Y means that if both page number X and page number Y are to be produced as part of an update, page number X must be printed at some point before page number Y. The input contains page ordering rules (pairs of X|Y) and print queues (e.g., 75, 47, 61, 53, 29). using System.Collections.Immutable; using System.Text.RegularExpressions; namespace AoC2024; public partial class PrintQueue { public readonly Dictionary<int, HashSet<int>> orderingRules = []; public readonly ImmutableList<ImmutableList<int>> printJobs = []; public PrintQueue(string filePath) { using StreamReader inputReader = new(filePath); string?... |
| Aug 23, 2025 | » | AoC 2024 Day 04: Ceres Search
5 min; updated Aug 23, 2025
Problem This word search allows words to be horizontal, vertical, diagonal, written backwards, or even overlapping other words. Here are a few ways XMAS might appear, where irrelevant characters have been replaced with .: ..X... .SAMX. .A..A. XMAS.S .X.... The actual word search will be full of letters instead. For example: MMMSXXMASM MSAMXMSMSA AMXSXMAAMM MSAMASMSMX XMASAMXAMM XXAMMXXAMA SMSMSASXSS SAXAMASAAA MAMMMXMMMM MXMXAXMASX Parsing namespace AoC2024; public partial class CeresSearch { private readonly char[,] grid; public CeresSearch(string filePath) { using StreamReader inputReader = new(filePath); List<char[]> rows = []; string?... |
| Dec 24, 2019 | » | Investing in Kenya
15 min; updated Aug 8, 2025
Areas to Consider Capital Markets The Central Depository and Settlement Corporation (CDSC) runs the Central Depository System (CDS) that facilitates holding and trading of shares at the Nairobi Stock Exchange (NSE). A Central Depository Agent (CDA) is a Stockbroker, an Investment Bank, or a Custodian Bank, who has been authorized by the CDSC to open accounts in CDS on behalf of investors. In 2006, an Automatic Trading System was introduced so that orders are matched automatically and executed by stockbrokers on a first-come first-served basis.... |
| Jun 6, 2022 | » | Perspectives on Software Engineering
5 min; updated Jul 20, 2025
On the Clean Code Movement Good enough is good enough. The architectural choices and bugs in the implementation tend to be more impactful, so focus more on those. Be conservative in what you consider technical debt. It should be something that slows down current/future changes, and not code that doesn’t “feel nice”. A code base that is free if technical debt is likely over-emphasizing polish over delivery. Abstractions and indirections in the name of future-proofing tend to be wrong especially when treading new paths, where you can’t reliably predict the future.... |
| Jul 19, 2025 | » | Resilient App Development in .NET
6 min; updated Jul 19, 2025
Microsoft.Extensions.Resilience and Microsoft.Extensions.Http.Resilience provide resilience mechanisms against transient failures. These two packages are built on top of the open-source Polly resilience library. Build a Resilience Pipeline Given a ServiceCollection services, configure a keyed resilience pipeline as follows: const string key = "Retry-Timeout"; services.AddResiliencePipeline(key, static builder => { builder.AddRetry(new RetryStrategyOptions { ShouldHandle = new PredicateBuilder().Handle<TimeoutRejectedException>() }); builder.AddTimeout(TimeSpan.FromSeconds(1.5)); }); Other Add* extension methods include AddCircuitBreaker, AddRateLimiter, AddConcurrencyLimiter, AddFallback, and AddHedging.... |
| Mar 22, 2020 | » | Scalability
3 min; updated Jul 19, 2025
Describing Load Load parameters are numbers that describe the load on a system, e.g. number of requests per second to a web server, ratio of reads to writes in a database, number of simultaneously active users in a chat room. Example: Twitter Major operations: Users posting tweets: \(4.6k\) requests/sec on average, \(12k+\) requests/sec at peak. Users viewing timelines: \(300k\) requests/sec. Twitter’s scaling challenge is the fan-out: each user follows many people and each user is followed by many people.... |
| May 17, 2020 | » | Mergeable Replicated Data Types
2 min; updated Jul 19, 2025
On a distributed system, each replica should [eventually] converge to the same state. Commutative Replicated Data Types (CRDTs) can accept updates and achieve consistent without remote synchronization. The Need for Commutativity Say we have a queue \( 1 \to 2 \). Suppose two replicas, \(r_1\) and \(r_2\), independently call pop(). Each replica will have \(2\) on their queue. However, on receiving an update that the other replica popped, each replica will call pop() to be consistent, thereby deleting \(2\).... |
| Mar 22, 2020 | » | Maintainability
1 min; updated Jul 19, 2025
Ongoing maintenance includes: fixing bugs, keeping systems operational, adapting to new platforms, modifying to fit new use cases, etc. Operability: Making Life Easy for Operations Operations teams keep a software system running smoothly. A data system can make life easier for Ops people by: Providing visibility into runtime behavior and system internals. Supporting automation and integration with standard tools. Being tolerant of machines being down for maintenance. Good documentation, e.... |
| Oct 1, 1974 | » | 03. The Surgical Team
4 min; updated Jul 19, 2025
The Dilemma There are wide productivity variations between good programmers and poor ones. Sackman et. al. found 10:1 ratios. The data showed no correlation between experience and performance. The idea of a 10x developer is mostly ridiculed in my online circles. That said, some jobs have X years of experience as a requirement. How can we resolve these contradictions? The major part of the cost of large teams is communication, and system debugging to correct the ill effects of miscommunication.... |
| Oct 1, 1974 | » | 02. The Mythical Man-Month
4 min; updated Jul 19, 2025
More software projects have gone awry for lack of calendar time than for all other causes combined. Why is this cause of disaster so common? Our estimation techniques assume that all will go well, i.e. each task will take only as long as it “ought” to take. Our estimating techniques fallaciously confuse effort with progress, hiding the assumption that men and months are interchangeable. Because we are uncertain of our estimates, software managers often lack the courteous stubbornness - if you’re made to wait, it is to serve you better, and to please you.... |
| Mar 22, 2020 | » | Reliability
2 min; updated Jul 19, 2025
A fault is when a component deviates from its spec, while a failure is when the system no longer provides the required service to the user. Better to design fault-tolerant systems because we can’t reduce the probability of a fault to zero. In fault-tolerant systems, one should trigger faults deliberately in order to test the tolerance, e.g. randomly killing individual processes. However, not all things can be tolerated. For instance, if an attacker gains access to sensitive data, then the damage can’t be undone.... |