The journal

Notes from the workbench.

149 articles on building software and understanding how it works.

Template replacement engine

Regex.Replace with a match evaluator plus a case-insensitive dictionary makes a tidy single-pass template engine — faster and more flexible than chaining string.Replace calls.

C# Regex for verifying e-mails

The famous emailregex.com example is horrible, so I made my own C# email regex — loosely based on it, compiled, and good enough for most use cases.

ASP.Net 5 Areas

Visual Studio 2015 has no GUI support for Areas in ASP.Net 5 yet. The workaround is simple: create the folder structure manually and add an area route in Startup.cs — shown here.

Better text console for C#

Console.MoveBufferArea turned out to be dead slow under heavy logging output. So I went to the Win32 console API and built a faster text console for C# — with source and benchmarks.

Optimizing RDP for casual use

A revisit of my 2011 RDP guide, updated for RDP 8.x: what to tweak on client and server for less bandwidth, higher throughput and adaptive transfers — the short story and the dirty details.

Legacy app: Net-Chat 2.0a (Quick Basic 4.5, DOS)

Recovered from old tapes: a network chat program I wrote in Quick Basic 4.5 in 1996, at age 16, chatting over a shared file on a network drive. Recompiled with QB64 to run on modern Windows — executable and source included. Good times.

Alternative directory layout for MVC

The default MVC folder layout scatters one feature across Controllers, Views and Scripts. As the project grows, grouping by feature instead keeps related files together — here is how to bend ASP.Net MVC to that layout.