Chris's coding blog

I'm Chris Small, a software engineer working in London. This is my tech blog. Find out more about me via GithubStackoverflowResume

AI

Midjourney prompts examples

November 11, 2022

Overview I decided to try out as many prompt variations as I could think of using the Discord-based AI art/image generation tool midjourney…

ANTI-XSS

Anti-XSS .NET libraries in 2013

October 11, 2013

One of the more important parts in Roadkill Wiki is removing malicious HTML from the markup that’s entered, even when the markup (Creole and…

APACHE

Apache - adding a new site in under 2 minutes.

March 16, 2016

There’s a great guide on Digital Ocean for setting up new sites in Apache on Linux. Once you’ve done it a few times though it can be…

APPVEYOR

Using Appveyor as Roadkill's CI to run acceptance tests

June 11, 2014

A while ago Roadkill’s CI solution was hosted on Appharbor, which was a great solution (and free for a single project), but the…

ARTIFICIAL-INTELLIGENCE

Introduction to Genetic Algorithms in C#

May 14, 2013

Get the code A long time ago I mentioned in this post that I was planning on writing up some notes I made at university about Genetic…

Genetic Algorithms in C#

February 21, 2011

A .NET 3.5 upgrade to Barry Lapthorn's original C# example found on codeproject.

ASPNET

Anti-XSS .NET libraries in 2013

October 11, 2013

One of the more important parts in Roadkill Wiki is removing malicious HTML from the markup that’s entered, even when the markup (Creole and…

Listing all mime types without using OLE and IIS in .NET

April 04, 2011

An ASP.NET example of mapping file extensions to their mime types, without needing to query IIS via COM.

ASP.NET control event order/lifecycle

March 24, 2010

A very concise reference for the order which events are fired when you subclass a control

Using JQuery with ASP.NET

January 01, 2010

This post is all about calling and parsing data from an ASP.NET web service using jQuery.

GZip and Deflate page compression in ASP.NET

July 13, 2009

A re-packaged version of Bart De Smet's ASP.NET page compression using GZIP.

ASPNET-MVC

Roadkill reaches the magical 1000 unit test mark

December 23, 2013

Warning: this post contains large amounts of pro-automated-testing propaganda. Roadkill is now up to over 1000 tests (around 1150) as it…

Installing MVC3 on Mono with Ubuntu

April 22, 2013

I managed to get the wiki engine I spend a lot of more spare time writing, Roadkill working on Ubuntu with Mono this weekend. Unfortunately…

Object, Donut, OutputCache and Browser Caching in ASP.NET MVC

April 15, 2013

I’ve spent the last week working on sorting out the caching in Roadkill as prior to 1.6 it relied on NHibernate’s second level in memory…

Razor: Defining a section inside a HTML helper extension method

April 04, 2012

If you need to inject a generic section of code to your view you’d typically write an extension method for the HtmlHelper class and return…

403 Forbidden errors with ASP.NET MVC 3

November 20, 2011

Have you just created an ASP.NET MVC 3 site on your local/developer box to use Windows authentication, mapped it correctly and then…

ASSEMBLIES

Inside .NET assemblies (part 1)

July 12, 2010

The first of a set of reference blog posts covering .NET assemblies + modules, structure of a .NET assembly and metadata tables.

String.Equals(), == and String.Compare()

March 02, 2010

What's the difference between ==, .equals and string.Compare()? This post explores the three ways of comparing strings in C#/.NET.

BASH

Change your Powershell prompt to look like bash

February 23, 2017

The script below changes your Powershell prompt to look a bit more like a Bash one. Update your file to add the code below. If you aren’t…

BEST-PRACTICES

ApplicationException versus Exception

April 05, 2010

The two often repeated phrases about Exceptions in .NET is they should be used for 'exceptional behaviour' and sparingly; they are a performance hit on your application and aren't a replacement for logging. This post goes into some details about Exceptions and ApplicationExceptions.

BIT-MANIPULATION

C# Bit manipulation by example (part 2)

February 02, 2011

The second part of a two-part blog series looking at bit manipulation in C#.

C# Bit manipulation by example (part 1)

December 22, 2010

This is the first part of two blog posts trying demystify bit manipulation in C/C#.

BRAIN

Podcast of the month - Sept 2016

September 09, 2016

A weekly favourite podcast doesn’t really work on this site, as I only end up adding them every month or two. So I’m switching to a monthly…

CHEATSHEET

Git cheatsheet for ninjas

January 08, 2016

A slowly increasing list of advanced and everyday Git command line usage.

UML cheat sheet

January 04, 2010

This is a small reference sheet for UML class diagrams

CHOCOLATEY

Creating a Chocolately package for Chromedriver

November 11, 2015

My first Chocolatey package: creating the chromedriver-latest Chocolatey package that grabs the latest Chomedriver and installs it.

CHROMEDRIVER

Creating a Chocolately package for Chromedriver

November 11, 2015

My first Chocolatey package: creating the chromedriver-latest Chocolatey package that grabs the latest Chomedriver and installs it.

CLEAN-CODE

Applying the Gestalt Principles to your code

April 25, 2019

It’s one of the most repeated phrases in software, but is also quite easy to forget - you spend more time reading code than you do writing…

CODE-QUALITY

Applying the Gestalt Principles to your code

April 25, 2019

It’s one of the most repeated phrases in software, but is also quite easy to forget - you spend more time reading code than you do writing…

Measuring the quality of code in Roadkill

July 31, 2013

One of the subjects I recently studied in my part time university course was how to measure a software system’s complexity, including…

COMMAND-LINE

CommandOptions - interactive console application command parser

August 08, 2010

This is a class based on the Novell Options class for easily parsing commands and their arguments for console applications that sit and wait for input. I've tried to keep it as elegant the Novel Options class, which is aimed at console applications that exit immediately. My adaption is for interactive apps, and restricts you to two types of handler methods - no arguments, and an array of strings as params.

Command line arguments parser

June 17, 2009

There are already 2 or 3 command line arguments in C#, two of which are found on the codeproject.com website. Both of these didn't match my exact needs so I decided to write my own one.

CONTINUOUS-INTEGRATION

.NET Core continuous integration and deployment with Gitlab, Docker, Kubernetes and Google Cloud

February 01, 2017

Over the past few months I’ve put Roadkill on hold in my free time, to get some .NET core projects working inside Docker. They’re mostly…

Continuous Integration cloud services

August 26, 2016

I’ve probably missed a couple, but this is a list I’ve compiled of all the CI services I know about, geared towards cheapo devs on a budget…

Using Appveyor as Roadkill's CI to run acceptance tests

June 11, 2014

A while ago Roadkill’s CI solution was hosted on Appharbor, which was a great solution (and free for a single project), but the…

CSHARP

Object-oriented theory you may not care or know about, but are doing

October 04, 2016

Floating around in note form, I thought I'd write up a few principles that most good devs will already be doing, but unaware of their formal names in object-oriented theory.

Do you write unit tests before code, or after?

May 05, 2016

One of the biggest omissions in the TDD literature is the concept of code first vs test first. The discussion doesn’t seem to surface very…

C# Unit test generator

April 24, 2016

This small Javascript pen generates a C# file for an object you want to test, using a list of test cases you specify in the textbox in this…

Unit test naming conventions

November 04, 2015

Choosing a naming convention for unit tests method names.

.NET logging libraries compared

August 08, 2014

This is a short presentation I created for the company I work for, and gives my thoughts on the state of .NET logging libraries in 2014. My…

A C# UK bank holiday calculator

May 21, 2014

In the UK we’re fortunate enough to get 5 free holidays a year, under the guise of “Bank Holidays”. These are mostly on Mondays and come in…

Introduction to Genetic Algorithms in C#

May 14, 2013

Get the code A long time ago I mentioned in this post that I was planning on writing up some notes I made at university about Genetic…

How to Write a Spelling Corrector in C#

April 05, 2013

Github repository - feel free to send improvements Peter Norvig’s spelling corrector is fairly famous in nerd-circles as it describes the…

Moqs versus Stubs (2013 edition)

February 25, 2013

This is an age old debate which I’ll chirp in with my opinion. According to Gojko Adzic there’s two types of TDD people in the world…

Serializing an object to XML snippet

March 14, 2012

I’ve written this same snippet so many times I’ve decided to shove it here to save my fingers a few calories in future. It’s nothing special…

Filtering System.Diagnostics Trace messages

February 13, 2012

One of the biggest points earners for me on Stackoverflow has been this question about Error logging in C#/.NET. Having been fairly…

Parsing XFDF (PDF annotations) in C#

February 07, 2012

I’m in the middle of doing the final two modules of the 3rd year of my part-time Computer Science degree, which means going back to the…

Genetic Algorithms in C#

February 21, 2011

A .NET 3.5 upgrade to Barry Lapthorn's original C# example found on codeproject.

C# Bit manipulation by example (part 2)

February 02, 2011

The second part of a two-part blog series looking at bit manipulation in C#.

Linked list and Double linked list in C#

December 22, 2010

Two examples of implementing a linked and double linked list in C# from scratch.

C# Bit manipulation by example (part 1)

December 22, 2010

This is the first part of two blog posts trying demystify bit manipulation in C/C#.

6 ways to get the current directory in C#

August 17, 2010

Different approaches to getting the assembly or application's current directory

Password Generator

August 16, 2010

This Silverlight-based tool produces either prounceable or alphanumeric passwords of the length you want, and quantity.

CommandOptions - interactive console application command parser

August 08, 2010

This is a class based on the Novell Options class for easily parsing commands and their arguments for console applications that sit and wait for input. I've tried to keep it as elegant the Novel Options class, which is aimed at console applications that exit immediately. My adaption is for interactive apps, and restricts you to two types of handler methods - no arguments, and an array of strings as params.

Extracting all links from a HTML page

July 30, 2010

The code below is a small class that extracts all links from a HTML page using a regular expression. The method returns a list of URLs…

An extension method for converting a byte array to a string (reading its BOM)

July 19, 2010

An extension method that adapts Rick Strahl's code (and the comments too) to stop you having to guess or read the byte order mark of a byte array or text file each time you convert it to a string.

Silverlight JSON WebClient wrapper/helper

June 06, 2010

This is a small class that uses the NewtonSoft JSON.NET library to make JSON requests to a URL. It handles both requests that require parameters, and those that just return results.

Delegates, Funcs and Actions by example

May 03, 2010

This is a small set of reference examples of the various ways of declaring delegates, funcs and actions across the different versions of the framework and C#

Listing Windows users and groups in C#

April 16, 2010

One method of listing Windows users and groups in C#.

Syntax highlighter for C#

April 07, 2010

This is small class for color coding, syntax highlighting, pretty printing, prettifying (any of the above) C# source code. It produces HTML with span tags and a css class. It's not perfect and undoubtedly has bugs in it, but on the whole works

ApplicationException versus Exception

April 05, 2010

The two often repeated phrases about Exceptions in .NET is they should be used for 'exceptional behaviour' and sparingly; they are a performance hit on your application and aren't a replacement for logging. This post goes into some details about Exceptions and ApplicationExceptions.

Using Google maps with C#

March 16, 2010

How to parse a website and then plot a set of addresses onto an embedded google map using C#.

String.Equals(), == and String.Compare()

March 02, 2010

What's the difference between ==, .equals and string.Compare()? This post explores the three ways of comparing strings in C#/.NET.

Using XmlTextWriter to produce a XML string

February 16, 2010

This is a small snippet showing an example of using a XmlTextWriter to produce Xml that validates.

Other Design Patterns

February 08, 2010

Here's a few more design patterns I left out from my design patterns series.

Simplified C# Atom and Rss feed parser

February 08, 2010

A set of snippets for parsing RSS and ATOM feeds.

IConfigurationSectionHandler example

January 01, 2010

This is a small snippet for the basics of writing a ConfigurationHandler to read a configuration section from your web.config or app.config.

Value types, reference types, boxing and unboxing in C#

December 14, 2009

There's hundreds of posts and articles out there about value vs reference types, boxing and unboxing, the stack and the heap. Here's another!

Embedded resources example

November 15, 2009

This is a small example showing the discover and reading of all embedded resources in your assembly. On a slight but vaguely related tangent…

Abstract methods vs Virtual methods

October 20, 2009

Many moons I was curious about the difference in IL that is produced between abstract and virtual methods. This post gives the details.

Export to Excel in C#

October 12, 2009

This is a very simple snippet showing how to use the Microsoft.Office.Interop.Excel assembly (version 12 for this example).

LDAP/Active directory tree in C#

October 12, 2009

Download This winforms application from 2004 shows the basics of querying an Active Directory and LDAP server, including OpenLDAP, Netscape…

Equals vs IEqualityComparer, IEquatable<T>, IComparable, IComparer

September 27, 2009

A look at the difference between Equals vs IEqualityComparer, IEquatable, IComparable, IComparer, used for sorting and comparisons.

Format XML in C#

September 09, 2009

Below is a small snippet showing how to format (or re-format) XML so it’s indented. XML isn’t stored in this humanly readable way in…

3 ways to leave your exception

September 08, 2009

3 ways to deal with throwing/re-throwing exceptions in C#

Const vs Readonly in C#

September 06, 2009

The differences between const and readonly, including some ILASM.

C# Symmetric encryption wrapper

July 24, 2009

The original class for this post can be found at codeproject.com. This class is a tidied up version (and disposes more aggressively).

GZip and Deflate page compression in ASP.NET

July 13, 2009

A re-packaged version of Bart De Smet's ASP.NET page compression using GZIP.

Objective C by example for a C# developer

June 22, 2009

This is a small set of code snippets that may assist as a quick reference when switching between C# and Objective-C concepts. It's all beginner level and I've skipped some major concepts that a book will explain, as well as any C related tasks.

Wake up from Sleep (CreateWaitableTimer) in C#

June 18, 2009

The code illustrates how to set a timer to wake your computer up having been sleep'd. It's tested on Vista and Windows 7 with sleep mode.

Command line arguments parser

June 17, 2009

There are already 2 or 3 command line arguments in C#, two of which are found on the codeproject.com website. Both of these didn't match my exact needs so I decided to write my own one.

Dynamically compiling XSL in C#

June 07, 2009

This post shows an alternative to using XSLTC.exe to compile XSL, when the XSLT you're using is dynamically generated from the database.

Your base class: Abstract or Interface?

May 18, 2009

One thing that is often overlooked by the tutorials and books is deciding when to use an abstract class vs an interface. The fashion for using interfaces for everything often rejects abstract classes outright. This post goes into a bit of detail about it.

C# Design Patterns: the Façade pattern

April 14, 2009

A summary and example of the façade design pattern.

Image conversion in C#

April 13, 2009

Download This old application from 2004 demonstrates image conversion using the built in classes in the BCL. Like all the old C# code here…

Automated browser screenshot capture

March 18, 2009

BrowserCapture.exe.zip Project source (Visual Studio 2008) This small windows forms application does the following: Opens a website you…

Pronounceable password generator

March 15, 2009

A c# password generator which creates both random alpha-numeric and the more useful prounceable passwords.

C# Design Patterns: the State pattern

March 09, 2009

A summary and example of the state design pattern.

Friendly Unique Id Generation part 2

March 05, 2009

The second of two blog posts about generating url-friendly alternatives to the guid.

Friendly Unique Id Generation Part 1

March 03, 2009

The first of two blog posts about generating url-friendly alternatives to the guid.

C# Design Patterns: the Observer pattern

February 28, 2009

A summary and example of the observer design pattern.

Output from the Uri class

February 27, 2009

This shows the output from all the properties of the URI class for the current request. The Uri has been hardcoded as:

C# Design Patterns: the Mediator pattern

February 10, 2009

A summary and example of the mediator design pattern.

C# and .NET type visibility

February 03, 2009

This post is a reference article about visibility in C# and .NET.

C# Design patterns: the Strategy pattern

January 28, 2009

A summary and example of the strategy design pattern.

C# Design Patterns: the Iterator pattern

January 23, 2009

A summary and example of the iterator design pattern.

C# MD5 and SHA encryption wrapper class

January 14, 2009

This is a simple utility class for MD5 (128bit) or SHA-2 (256bit,384bit and 512bit) hash encryption. It outputs the string using 2 byte hex values, e.g. AB12FE. It doesn't include SHA-1 but that's trivial to add.

C# Design Patterns: the Singleton pattern

January 13, 2009

A summary and example of the singleton design pattern.

C# Design Patterns: the Abstract Factory Pattern

January 02, 2009

A summary and example of the abstract factory design pattern.

C# Design Patterns: the Factory pattern

December 03, 2008

A summary and example of the factory design pattern in C#.

Whois, DNS, CName, MX record lookup in C#

October 06, 2008

This is the source code from the network tools page that use to exist on the previous domain (when the site was hosted on a dedicated server). A good replacement site is [who.is][6], however the source for the tools is below.

Sending messages to windows in C# via winapi

September 16, 2008

Download This windows demo app from 2004 shows you how to use the winapi EnumWindows function in association with SendMessage to send…

C# Design Patterns

September 02, 2008

This is the introduction to a series of 7 blog posts describing and illustrating common design patterns in C#, based on those found in the Gang of Four book.

Serialization as a database

August 05, 2008

Using serialization as persistent object store (in non bs-bingo: a database)

XML Browser (demo app)

February 05, 2008

Download This simplistic demo app from 2004 works as a simple XML browser, showing all XML nodes in an XML document in a treeview, the value…

Streaming binary/text data via the web in C#

May 24, 2007

An dated example of downloading binary data to autoupdate an application.

Binary upload to SQL Server in

February 24, 2006

Download This tool from 2004 is useful if you need to do a quick update of a binary column in a SQL server 2000 table. It could be easily…

Changing a Richtextbox caret

February 16, 2006

Download This old bit of code from 2004 is an unfinished (i.e. not that pretty to read) demo project for changing the caret in a rich text…

DESIGN-PATTERNS

Other Design Patterns

February 08, 2010

Here's a few more design patterns I left out from my design patterns series.

C# Design Patterns: the Façade pattern

April 14, 2009

A summary and example of the façade design pattern.

C# Design Patterns: the State pattern

March 09, 2009

A summary and example of the state design pattern.

C# Design Patterns: the Observer pattern

February 28, 2009

A summary and example of the observer design pattern.

C# Design Patterns: the Mediator pattern

February 10, 2009

A summary and example of the mediator design pattern.

C# Design patterns: the Strategy pattern

January 28, 2009

A summary and example of the strategy design pattern.

C# Design Patterns: the Iterator pattern

January 23, 2009

A summary and example of the iterator design pattern.

C# Design Patterns: the Singleton pattern

January 13, 2009

A summary and example of the singleton design pattern.

C# Design Patterns: the Abstract Factory Pattern

January 02, 2009

A summary and example of the abstract factory design pattern.

C# Design Patterns: the Factory pattern

December 03, 2008

A summary and example of the factory design pattern in C#.

C# Design Patterns

September 02, 2008

This is the introduction to a series of 7 blog posts describing and illustrating common design patterns in C#, based on those found in the Gang of Four book.

DOCKER

High performance and scaling ASP.NET Core 1.1 and Docker

August 17, 2018

For a recent project I was part of, we were given the NFR (non-functional requirement) of having a cluster of ASP.NET Core Docker containers…

.NET Core continuous integration and deployment with Gitlab, Docker, Kubernetes and Google Cloud

February 01, 2017

Over the past few months I’ve put Roadkill on hold in my free time, to get some .NET core projects working inside Docker. They’re mostly…

Using letsencrypt and certbot inside a Docker cluster

November 16, 2016

Letsencrypt.org is a free SSL certificate service. This post explains creating and renewing using its certbot for Docker containers.

First impressions of Docker on Windows

October 31, 2016

Not to be confused with Docker for Windows (Docker inside a Linux Hyper-V VM on Windows 10), these are my initial opinions on Microsoft’s…

Bash vs Powershell vs Python - Docker automation with Python

September 09, 2016

Today I became a Python developer (writing a single script counts as a being a Python developer doesn’t it?!). This was born from getting…

Running cron jobs inside a Docker container

September 07, 2016

Probably the most basic use of a Docker image is to run it, and let it exist - like . If you want to do this on a regular schedule, you have…

DOCKER-WINDOWS

First impressions of Docker on Windows

October 31, 2016

Not to be confused with Docker for Windows (Docker inside a Linux Hyper-V VM on Windows 10), these are my initial opinions on Microsoft’s…

DOTCOVER

Roadkill reaches the magical 1000 unit test mark

December 23, 2013

Warning: this post contains large amounts of pro-automated-testing propaganda. Roadkill is now up to over 1000 tests (around 1150) as it…

DOTNET-CORE

High performance and scaling ASP.NET Core 1.1 and Docker

August 17, 2018

For a recent project I was part of, we were given the NFR (non-functional requirement) of having a cluster of ASP.NET Core Docker containers…

ENCRYPTION

C# Symmetric encryption wrapper

July 24, 2009

The original class for this post can be found at codeproject.com. This class is a tidied up version (and disposes more aggressively).

C# MD5 and SHA encryption wrapper class

January 14, 2009

This is a simple utility class for MD5 (128bit) or SHA-2 (256bit,384bit and 512bit) hash encryption. It outputs the string using 2 byte hex values, e.g. AB12FE. It doesn't include SHA-1 but that's trivial to add.

GATSBY

From Jeykll to Gatsby

April 22, 2019

My blog, or site full of random programming content really (blogs didn’t really exist in 2001 when I started it), began with the domain…

GESTALT-PRINCIPLES

Applying the Gestalt Principles to your code

April 25, 2019

It’s one of the most repeated phrases in software, but is also quite easy to forget - you spend more time reading code than you do writing…

GIT

Git cheatsheet for ninjas

January 08, 2016

A slowly increasing list of advanced and everyday Git command line usage.

GITHUB

Syncing Github with Codeplex

June 30, 2013

Assuming you have used the Github Windows gui (or the console) to clone a Github repository, you can push it up to Codeplex in the console…

GITLAB

.NET Core continuous integration and deployment with Gitlab, Docker, Kubernetes and Google Cloud

February 01, 2017

Over the past few months I’ve put Roadkill on hold in my free time, to get some .NET core projects working inside Docker. They’re mostly…

GOLDPARSER

Spruce: From Irony.NET to GoldParser

February 21, 2011

In the last post I was all geared up and ready to write my search engine parser with the Irony framework. As has happened a fews times to me in with searching out solutions with development, shortly after writing the post I stumbled upon Gold Parser and Calitha. I'm not usually that fickle with frameworks that I’ll ditch one straight away, however Gold Parser was exactly what I was looking for originally, that ANTLR failed to provide.

GOOGLE-CLOUD

.NET Core continuous integration and deployment with Gitlab, Docker, Kubernetes and Google Cloud

February 01, 2017

Over the past few months I’ve put Roadkill on hold in my free time, to get some .NET core projects working inside Docker. They’re mostly…

IIS

IPHONE

UINavigationController by example

September 12, 2010

A look at the UINavigationController in Monotouch.

Objective C by example for a C# developer

June 22, 2009

This is a small set of code snippets that may assist as a quick reference when switching between C# and Objective-C concepts. It's all beginner level and I've skipped some major concepts that a book will explain, as well as any C related tasks.

IRONYNET

Spruce: From Irony.NET to GoldParser

February 21, 2011

In the last post I was all geared up and ready to write my search engine parser with the Irony framework. As has happened a fews times to me in with searching out solutions with development, shortly after writing the post I stumbled upon Gold Parser and Calitha. I'm not usually that fickle with frameworks that I’ll ditch one straight away, however Gold Parser was exactly what I was looking for originally, that ANTLR failed to provide.

Starting on Spruce's irony-powered search parser

February 14, 2011

After a few months off to eat a lot of food, I’m returning to do more dev work on Spruce. Picking up where I left off, the first “subsystem” I’m focusing on is the search. The UI and search I have in mind is fairly simple, but also powerful. I’m aiming to keep it google-esque in its search results and allow you to search the important fields of a work item, plus its core fields.

JEKYLL

From Wordpress to Wyam

November 01, 2015

Converting this blog from Wordpress to the Jekyll-like .NET tool, Wyam.

JEYKLL

From Wyam to Jekyll

November 09, 2015

Converting the blog over to Jekyll for free Github hosting.

KUBERNETES

.NET Core continuous integration and deployment with Gitlab, Docker, Kubernetes and Google Cloud

February 01, 2017

Over the past few months I’ve put Roadkill on hold in my free time, to get some .NET core projects working inside Docker. They’re mostly…

Using letsencrypt and certbot inside a Docker cluster

November 16, 2016

Letsencrypt.org is a free SSL certificate service. This post explains creating and renewing using its certbot for Docker containers.

LALR

Spruce: From Irony.NET to GoldParser

February 21, 2011

In the last post I was all geared up and ready to write my search engine parser with the Irony framework. As has happened a fews times to me in with searching out solutions with development, shortly after writing the post I stumbled upon Gold Parser and Calitha. I'm not usually that fickle with frameworks that I’ll ditch one straight away, however Gold Parser was exactly what I was looking for originally, that ANTLR failed to provide.

LETSENCRYPT

Using letsencrypt and certbot inside a Docker cluster

November 16, 2016

Letsencrypt.org is a free SSL certificate service. This post explains creating and renewing using its certbot for Docker containers.

LINUX

Creating a Linux shell on a Windows box in 1 minute (or 7 lines of Powershell)

April 07, 2016

Through the magic of Vagrant (it works well with Linux, not so well with Windows thanks mainly to Windows), you can create a virtual Ubuntu…

Apache - adding a new site in under 2 minutes.

March 16, 2016

There’s a great guide on Digital Ocean for setting up new sites in Apache on Linux. Once you’ve done it a few times though it can be…

LOG4NET

UdpTraceListener - a UDP TraceListener compatible with log4net/log4j

March 13, 2013

This class is a TraceListener implementation that uses the log4j XML format and sends the XML to a UDP socket. This means you can configure…

MIDJOURNEY

Midjourney prompts examples

November 11, 2022

Overview I decided to try out as many prompt variations as I could think of using the Discord-based AI art/image generation tool midjourney…

MISC

Starting and stopping all IIS sites in Powershell

November 17, 2014

This is just a boring Powershell 4 snippet for starting and stopping IIS websites:

Why I'm so Tired (UK edition)

January 12, 2012

This is a modification of this page that I adjusted for 2012 UK statistics. I’m tired because I’m overworked. Let me explain… The population…

SOPA: How to transfer your domains from Godaddy.com

December 26, 2011

I’m not really fuming about the SOPA issue as I live in the UK, however given the amount of DNS control the US has, it is worth giving a…

Installing Windows 7 from a USB stick

April 04, 2011

Update: There is now this Microsoft tool to do this for you. This is borrowed from Dennis Chung’s page about the same title. I’ve adapted it…

How to restore the new text file option in the windows context menu

October 18, 2010

This small registry snippet can be used if you’ve lost the Windows context menu’s (right click menu inside explorer and your desktop) New…

Google chrome about pages

March 03, 2009

Inside the amazing world of Chrome about pages.

MONOTOUCH

A review of Mike Bluesteins Learning Monotouch'

September 21, 2011

I have been lucky enough to receive a review copy of Mike Bluestein’s 'Learning Monotouch'. This is a mini review of the book.

UITableViewController by example

October 18, 2010

This article focuses on XIB-free UITableViewControllers. The entire article focuses on adding controllers and views programatically and is completely Interface Builder free

Monotouch Controllers by example

October 10, 2010

The first of a few posts about using XIB-free Controllers in Monotouch.

Monotouch tips and snippets

October 10, 2010

This page is full of discoveries and snippets I'm accruing as I slowly learn my way around Monotouch. Originally my plan was to write objective-C, but just as I had finished my first Objective-C book I heard Monotouch presentation at a Devdays conference...

UINavigationController by example

September 12, 2010

A look at the UINavigationController in Monotouch.

MVC

Upgrading an MVC StructureMap 2 app to StructureMap 4

December 01, 2015

A well-known scientist (some say it was Bertrand Russell) once gave a public lecture on astronomy. He described how the earth orbits around the sun and how the sun, in turn, orbits around the center of a vast collection of stars called our galaxy. At the end of the lecture, a little old lady at the back of the room got up and said...

NDEPEND

Measuring the quality of code in Roadkill

July 31, 2013

One of the subjects I recently studied in my part time university course was how to measure a software system’s complexity, including…

NET

Inside The System.IO Namespace Part 3

October 26, 2010

The final part to a series of posts looking at the System.IO namespace.

Inside The System.IO Namespace Part 2

October 19, 2010

The second in a series of posts looking at the System.IO namespace.

A Look At .NET ORMs - Part 2

September 09, 2010

Part two of the ORM series looks at Persister.NET, NPersist, Paladin and Subsonic

A Look At .NET ORMs - Part 3

September 09, 2010

The final part of .NET orm series, looking at ODX, NHibernate, CoolStorage and Lightspeed.

Inside .NET Assemblies (part 2)

July 29, 2010

The second of a set of reference blog posts covering .NET assemblies + modules, structure of a .NET assembly and metadata tables.

Inside .NET assemblies (part 1)

July 12, 2010

The first of a set of reference blog posts covering .NET assemblies + modules, structure of a .NET assembly and metadata tables.

.NET Formatting Strings Reference

February 17, 2010

This post is aimed at being a reference and a code-by-example guide to format strings in C# (and .NET), plus delving a little deeper into custom formatting strings and what goes on internally

Inside The System.IO Namespace Part 1

October 13, 2009

The first in a series of posts looking at Streams,Writers and Readers in System.IO

A look at .NET Object Relational Mappers (ORM)s

September 09, 2009

This post looks at the many different ORM (object relational mappers) that exist for C#/.NET. These Object Relational Mappers aim to bridge the gap that exists between database servers and their native SQL, and the object-oriented world of non-tabular data. My main source for the ORMs I chose to look at were from csharp source and wikipedia along with a codeplex search, and just general knowledge of the products out there. I've excluded dead links from wikipedia, commercial ORMs (of which lots also exist) and narrowed it down the ones that seemed fairly mature and easy to assess from available walkthroughs.

A Look At .NET ORMs - Part 1

September 09, 2009

Part one of look at .NET ORMs, including examples of using db4o, Linq to Entities, Sooda,

.NET XML Comment Cheat Sheet

May 19, 2009

If you like to give your code meaningful XML comments and want the output to look vaguely like the MSDN documentation, then below are a few templates you can use for consistency. These aren't 'how to write XX method' but just how the textual descriptions appear in most of the .NET framework documentation, for example you'll find 'Raises the ... event' in almost all event descriptions.

C# and .NET type visibility

February 03, 2009

This post is a reference article about visibility in C# and .NET.

NET-CORE

Converting PFX to PEM files in .NET Core

November 14, 2020

Before reading this post, it’s worth reading the post I did on public private key glossary of terms and public private key by example in…

SSL and Public private key (PEM/X509) cryptography by example in .NET Core

November 05, 2020

Introduction This post illustrates examples of the two uses of public key cryptography in .NET Core: Encrypting and decrypting data. Signing…

.NET Core continuous integration and deployment with Gitlab, Docker, Kubernetes and Google Cloud

February 01, 2017

Over the past few months I’ve put Roadkill on hold in my free time, to get some .NET core projects working inside Docker. They’re mostly…

Running cron jobs inside a Docker container

September 07, 2016

Probably the most basic use of a Docker image is to run it, and let it exist - like . If you want to do this on a regular schedule, you have…

Fixing .NET Core package restore problems

August 29, 2016

I had this problem today where a was failing on a Linux CI server, but working on my Windows 10 dev machine. The error was: Unable to…

.NET Core and .NET Standard simplified and explained by Scott Hunter

July 18, 2016

With all the changes to .NET that have happened this year, and the constantly evolving .NET core/standard (and the bombshell that project…

NEWS

Shorter blog posts

February 14, 2016

I listen to a lot of podcasts from a small clique of online “life hackers” (a cringey term), most of which I’ve discovered via Joe Rogan…

From Wyam to Jekyll

November 09, 2015

Converting the blog over to Jekyll for free Github hosting.

From Wordpress to Wyam

November 01, 2015

Converting this blog from Wordpress to the Jekyll-like .NET tool, Wyam.

From Squarespace to WordPress

February 23, 2013

The site is now powered by WordPress, having tried it out a few years ago and rejected it, I’ve come to like it and its plugin architecture…

To Squarespace.com and Beyond!

November 20, 2011

As you’ve probably noticed if you’re one of the 10 people who don’t browse the site for less than 40 seconds (that’s 99% of the traffic…

NHIBERNATE

Moving away from NHibernate in Roadkill

March 25, 2013

In the next version of Roadkill (1.6) I’ve moved away from NHibernate, the ORM that has been powering it for two years since version 1 and…

NODEJS

How to fix yarn global add command not found on Windows

November 04, 2020

If you try to run on Windows and then try to run you might get an error message “command not found”. This is because the yarn bin folder…

NPM

How to fix yarn global add command not found on Windows

November 04, 2020

If you try to run on Windows and then try to run you might get an error message “command not found”. This is because the yarn bin folder…

NUGET

Fixing .NET Core package restore problems

August 29, 2016

I had this problem today where a was failing on a Linux CI server, but working on my Windows 10 dev machine. The error was: Unable to…

NUTRITION

A list of my wacky diets

July 28, 2018

Over the past three or four years I’ve tried a number of different diets, mostly to aid my running: this is my experience with all of them…

Podcast of the Month Oct 2016

October 16, 2016

The first 30 minutes of this podcast are worth a listen alone, Chris Kresser discusses how your stomach biome is linked to depression, your…

Podcast of the week - May 2016

May 08, 2016

Not really a podcast, more of a vodcast, the discussion talks about fasting (Ray Cronise had just been on a 30 day water fast), hot/cold…

OAUTH

Learn OAuth, the hard way

September 28, 2020

Update: No more than 2 days after writing this post, IdentityServer 4 has been announced as duel license again. Looking back to the…

OBJECT-ORIENTED

Object-oriented theory you may not care or know about, but are doing

October 04, 2016

Floating around in note form, I thought I'd write up a few principles that most good devs will already be doing, but unaware of their formal names in object-oriented theory.

OPEN-SOURCE-PROJECTS

MicroRest, a simplified REST framework for .NET 3.5+

March 08, 2012

Update 2: Now it’s 2015 and WebApi is almost in version 3 (vNext edition), I’ve removed the Microrest source from Bitbucket. Update: You can…

OPINION

What does a principal developer do?

May 30, 2015

Or to word it another way, What is a Principal Developer? I recently got asked this question at an internal (non-technology-based) event…

ORM

A Look At .NET ORMs - Part 2

September 09, 2010

Part two of the ORM series looks at Persister.NET, NPersist, Paladin and Subsonic

A Look At .NET ORMs - Part 3

September 09, 2010

The final part of .NET orm series, looking at ODX, NHibernate, CoolStorage and Lightspeed.

A look at .NET Object Relational Mappers (ORM)s

September 09, 2009

This post looks at the many different ORM (object relational mappers) that exist for C#/.NET. These Object Relational Mappers aim to bridge the gap that exists between database servers and their native SQL, and the object-oriented world of non-tabular data. My main source for the ORMs I chose to look at were from csharp source and wikipedia along with a codeplex search, and just general knowledge of the products out there. I've excluded dead links from wikipedia, commercial ORMs (of which lots also exist) and narrowed it down the ones that seemed fairly mature and easy to assess from available walkthroughs.

A Look At .NET ORMs - Part 1

September 09, 2009

Part one of look at .NET ORMs, including examples of using db4o, Linq to Entities, Sooda,

PASSWORD-GENERATOR

Password Generator

August 16, 2010

This Silverlight-based tool produces either prounceable or alphanumeric passwords of the length you want, and quantity.

PHILOSOPHY

Podcast of the week - April 2016

April 23, 2016

My podcast recommendation for this week comes from Sam Harris’s discussion with David Chalmers about consciousness. The 2nd half gets a…

Podcast of the week - April 2016

April 23, 2016

My podcast recommendation for this week comes from Sam Harris’s discussion with David Chalmers about consciousness. The 2nd half gets a…

PHOTO

Photo of the month

July 28, 2018

It’s been a long time, but here’s a nice photo of Valencia Opera House from pxhere.com, on my list of places to visit.

PHOTOS

Random photo of the month 3

November 09, 2011

One of the posters found at occupy St Pauls.

Random photo of the month

February 01, 2010

The Ballagio, Las Vegas.

PODCAST

Podcast of the Month Oct 2016

October 16, 2016

The first 30 minutes of this podcast are worth a listen alone, Chris Kresser discusses how your stomach biome is linked to depression, your…

Podcast of the week - April 2016

April 23, 2016

My podcast recommendation for this week comes from Sam Harris’s discussion with David Chalmers about consciousness. The 2nd half gets a…

Podcast of the week - April 2016

April 23, 2016

My podcast recommendation for this week comes from Sam Harris’s discussion with David Chalmers about consciousness. The 2nd half gets a…

PODCASTS

Podcast of the month - Sept 2016

September 09, 2016

A weekly favourite podcast doesn’t really work on this site, as I only end up adding them every month or two. So I’m switching to a monthly…

Podcast of the week - May 2016

May 08, 2016

Not really a podcast, more of a vodcast, the discussion talks about fasting (Ray Cronise had just been on a 30 day water fast), hot/cold…

POWERSHELL

Change your Powershell prompt to look like bash

February 23, 2017

The script below changes your Powershell prompt to look a bit more like a Bash one. Update your file to add the code below. If you aren’t…

Powershell - the good parts

February 15, 2016

I’ve been using Powershell on a daily basis for about 2 years now, mostly with Chocolatey and provisioning servers (the devops movement…

PRINCIPAL-DEVELOPER

What does a principal developer do?

May 30, 2015

Or to word it another way, What is a Principal Developer? I recently got asked this question at an internal (non-technology-based) event…

PUBLIC-PRIVATE-KEY

Converting PFX to PEM files in .NET Core

November 14, 2020

Before reading this post, it’s worth reading the post I did on public private key glossary of terms and public private key by example in…

Public key crytography glossary of terms for .NET Core developers

November 09, 2020

Big disclaimer: I’m by no means an expert in Cryptography. All these definitions are my own, rewritten from Wikipedia, Stackoverflow and…

SSL and Public private key (PEM/X509) cryptography by example in .NET Core

November 05, 2020

Introduction This post illustrates examples of the two uses of public key cryptography in .NET Core: Encrypting and decrypting data. Signing…

PYTHON

Bash vs Powershell vs Python - Docker automation with Python

September 09, 2016

Today I became a Python developer (writing a single script counts as a being a Python developer doesn’t it?!). This was born from getting…

ROADKILL-WIKI

Learn OAuth, the hard way

September 28, 2020

Update: No more than 2 days after writing this post, IdentityServer 4 has been announced as duel license again. Looking back to the…

Upgrading an MVC StructureMap 2 app to StructureMap 4

December 01, 2015

A well-known scientist (some say it was Bertrand Russell) once gave a public lecture on astronomy. He described how the earth orbits around the sun and how the sun, in turn, orbits around the center of a vast collection of stars called our galaxy. At the end of the lecture, a little old lady at the back of the room got up and said...

Roadkill reaches the magical 1000 unit test mark

December 23, 2013

Warning: this post contains large amounts of pro-automated-testing propaganda. Roadkill is now up to over 1000 tests (around 1150) as it…

Anti-XSS .NET libraries in 2013

October 11, 2013

One of the more important parts in Roadkill Wiki is removing malicious HTML from the markup that’s entered, even when the markup (Creole and…

Measuring the quality of code in Roadkill

July 31, 2013

One of the subjects I recently studied in my part time university course was how to measure a software system’s complexity, including…

Installing MVC3 on Mono with Ubuntu

April 22, 2013

I managed to get the wiki engine I spend a lot of more spare time writing, Roadkill working on Ubuntu with Mono this weekend. Unfortunately…

Object, Donut, OutputCache and Browser Caching in ASP.NET MVC

April 15, 2013

I’ve spent the last week working on sorting out the caching in Roadkill as prior to 1.6 it relied on NHibernate’s second level in memory…

Moving away from NHibernate in Roadkill

March 25, 2013

In the next version of Roadkill (1.6) I’ve moved away from NHibernate, the ORM that has been powering it for two years since version 1 and…

UdpTraceListener - a UDP TraceListener compatible with log4net/log4j

March 13, 2013

This class is a TraceListener implementation that uses the log4j XML format and sends the XML to a UDP socket. This means you can configure…

Creating an instance from a string or type name in StructureMap

March 06, 2013

As part of the refactor I’m doing for Roadkill, I’m loading custom types from the config file as default instances, via StructureMap. The…

Moqs versus Stubs (2013 edition)

February 25, 2013

This is an age old debate which I’ll chirp in with my opinion. According to Gojko Adzic there’s two types of TDD people in the world…

RSA

SSL and Public private key (PEM/X509) cryptography by example in .NET Core

November 05, 2020

Introduction This post illustrates examples of the two uses of public key cryptography in .NET Core: Encrypting and decrypting data. Signing…

SECURITY

Converting PFX to PEM files in .NET Core

November 14, 2020

Before reading this post, it’s worth reading the post I did on public private key glossary of terms and public private key by example in…

Public key crytography glossary of terms for .NET Core developers

November 09, 2020

Big disclaimer: I’m by no means an expert in Cryptography. All these definitions are my own, rewritten from Wikipedia, Stackoverflow and…

SSL and Public private key (PEM/X509) cryptography by example in .NET Core

November 05, 2020

Introduction This post illustrates examples of the two uses of public key cryptography in .NET Core: Encrypting and decrypting data. Signing…

Learn OAuth, the hard way

September 28, 2020

Update: No more than 2 days after writing this post, IdentityServer 4 has been announced as duel license again. Looking back to the…

SELENIUM

Creating a Chocolately package for Chromedriver

November 11, 2015

My first Chocolatey package: creating the chromedriver-latest Chocolatey package that grabs the latest Chomedriver and installs it.

Fixing 'No response from server for url http://localhost:7055/hub/session/' problems with Selenium

December 08, 2012

If you're using a Windows Server 2008 R2 for your CI builds and tests, you may run into issues with running Selenium tests that Server 2003 didn't have.

SERIALIZATION

Serialization as a database

August 05, 2008

Using serialization as persistent object store (in non bs-bingo: a database)

SILVERLIGHT

Creating a custom silverlight installation the jQuery way

November 11, 2010

The default Silverlight installation and upgrade experience is fairly jarring compared to its counter-part Flash. If you target version 4.0 of Silverlight and the user has 3.0 installed, they will receive an ugly and annoying modal dialog forcing them to upgrade...

Silverlight JSON WebClient wrapper/helper

June 06, 2010

This is a small class that uses the NewtonSoft JSON.NET library to make JSON requests to a URL. It handles both requests that require parameters, and those that just return results.

SPRUCE

Spruce 1.1 released

December 12, 2011

I’ve just released a new minor version of Spruce - my open source ASP.NET MVC project for Team Foundation Server. The minor increment fixes…

A new Spruce UI, a big refactor and a release candidate!

October 22, 2011

It’s been roughly a year since I started the Spruce project, back in November 2010. Over the course of a year it’s had a lot of hold-ups and could be mistaken for yet another open source project where the author excitedly starts the project and then ditches it after about 3 beta releases. It’s also understandably not had much interest – I would guess that small .NET/C++ teams generally use Fogbugz, JIRA and other web-based bug and task tracking tools, while larger teams will either use TFS with the CMMI project type or the Scrum dashboards via tools like Urban Turtle and the Scrum Dashboard, or just Visual Studio.

Using Spruce on a different web server from TFS

October 16, 2011

One of the big issues I’ve come up against when developing Spruce has been using the website on a different web server from the one TFS runs as. By default TFS creates itself as ‘Team Foundation Server’ as a separate site inside IIS. As its API is entirely web services based, this is where your calls are made to, the .NET assemblies simply wrap these HTTP calls up in an easy to use package.

A brand new Spruce filter UI (that I then made redundant)

June 05, 2011

After feedback from both developers and non-developers in my company about the current filter UI in Spruce, it was obviously time to ditch it. It was failure #2 in my attempt at creating a simpler way of showing TFS's vast set of work item options.

Three months later in Spruce…

June 01, 2011

Not much has changed on this blog since March, no new posts have appeared. The main reason for this has been, amongst other things, my focus being shifted towards another FOSS project I’ve been doing called Roadkill Wiki. It’s a .NET wiki engine which I wrote to take the place of Screwturn. The primary motivator for this was that Screwturn had fairly poor Windows auth support, and used its own Wiki syntax. Roadkill addresses both of these, supporting Markdown, Media Wiki and Creole syntaxes and allows you to import from a Screwturn database.

The new Spruce solution structure

March 02, 2011

I’m quite anally retentive when it comes to folder structure in Visual Studio projects: I like to keep all C# source and site assets in a structured way that will avoid me having to spend (accumulated) hours doing pointless searches and treasure hunts through the solution explorer...

Supported search syntax in Spruce

February 28, 2011

For anyone reading the blog you may be wondering and be slightly bemused as to why there’s so many blog posts and yet such a painstaking pace to the source code checkins. The main reason for this is I want to save myself the slightly boring documenting task (that many open source projects neglect) that will come later by doing it in small chunks now. The plan is to to use these blog posts as the core material for the documentation and also explain some of the design decisions.

Spruce: From Irony.NET to GoldParser

February 21, 2011

In the last post I was all geared up and ready to write my search engine parser with the Irony framework. As has happened a fews times to me in with searching out solutions with development, shortly after writing the post I stumbled upon Gold Parser and Calitha. I'm not usually that fickle with frameworks that I’ll ditch one straight away, however Gold Parser was exactly what I was looking for originally, that ANTLR failed to provide.

Starting on Spruce's irony-powered search parser

February 14, 2011

After a few months off to eat a lot of food, I’m returning to do more dev work on Spruce. Picking up where I left off, the first “subsystem” I’m focusing on is the search. The UI and search I have in mind is fairly simple, but also powerful. I’m aiming to keep it google-esque in its search results and allow you to search the important fields of a work item, plus its core fields.

A UI redesign for Spruce

January 27, 2011

After spending a week with the existing design, and having a sniff around the web at project management sites I began to realise the original design was in a nutshell, crap and ugly. It was too designery and not functional enough, and most importantly contained far too much complication in the form of jQuery dialogs, fancy tooltips and pointless fluff.

Spruce features from 0.1 to 0.9

January 05, 2011

The following list is the features I’m aiming to implement between version 0.1 and 0.9. Search is a fairly critical one so this will be top…

Installing the Spruce alpha

December 08, 2010

The installation of (the current version of Spruce when this post was written) is very straightforward: You need TFS 2010, it won’t work…

Spruce screenshots

November 29, 2010

Nothing says progress like screenshots, so here’s 6 that give a general flavour of Spruce. It’s currently making heavy use of jQuery including the following plugins...

WorkItems that spruce supports: tasks, bugs, issues

November 09, 2010

The flexibility and arguably the over complexity of TFS versus other online bug tracking software is its ability to create custom work item…

Some base principles for Spruce

November 04, 2010

Here's 7 guiding principles I'm sticking to with the development of the Spruce front end for TFS.

A new web front end for Team Foundation Server

November 03, 2010

Team Foundation Server has had some great improvements since the 2005 and 2008 versions, including a plethora of new link types for workitems, an API that is a lot more dev friendly and some improvements to the Visual Studio UI. It is, however, still not really close to the easy of use and user experience you get from competitor bug tracking software...

SQL-SERVER

Avoiding Unicode issues when inserting XML into a SQL Database

December 29, 2010

If you have to insert XML into a SQL Server (2005+) XML column, there's three ways of doing it...

SQL create table reference

December 20, 2010

Here’s a quick reference for scripting table creation in SQL server by hand, where the text is readable and pretty rather than an…

Printing all tables in a database with Management.Smo

February 18, 2010

The Microsoft.SqlServer.Management.Smo namespace and assembly is used by Management Studio for its interogation of the database. If you have…

Binary upload to SQL Server in

February 24, 2006

Download This tool from 2004 is useful if you need to do a quick update of a binary column in a SQL server 2000 table. It could be easily…

SSL

Public key crytography glossary of terms for .NET Core developers

November 09, 2020

Big disclaimer: I’m by no means an expert in Cryptography. All these definitions are my own, rewritten from Wikipedia, Stackoverflow and…

SSL and Public private key (PEM/X509) cryptography by example in .NET Core

November 05, 2020

Introduction This post illustrates examples of the two uses of public key cryptography in .NET Core: Encrypting and decrypting data. Signing…

STRUCTUREMAP

Upgrading an MVC StructureMap 2 app to StructureMap 4

December 01, 2015

A well-known scientist (some say it was Bertrand Russell) once gave a public lecture on astronomy. He described how the earth orbits around the sun and how the sun, in turn, orbits around the center of a vast collection of stars called our galaxy. At the end of the lecture, a little old lady at the back of the room got up and said...

Creating an instance from a string or type name in StructureMap

March 06, 2013

As part of the refactor I’m doing for Roadkill, I’m loading custom types from the config file as default instances, via StructureMap. The…

TALKS

Talk: Software has become too complicated

May 04, 2019

Below is an entertaining talk by Joe Armstrong from 2014, one of the creators of Erlang (the language behind WhatsApp). He talks about how…

TESTING

Do you write unit tests before code, or after?

May 05, 2016

One of the biggest omissions in the TDD literature is the concept of code first vs test first. The discussion doesn’t seem to surface very…

C# Unit test generator

April 24, 2016

This small Javascript pen generates a C# file for an object you want to test, using a list of test cases you specify in the textbox in this…

Unit test naming conventions

November 04, 2015

Choosing a naming convention for unit tests method names.

Moqs versus Stubs (2013 edition)

February 25, 2013

This is an age old debate which I’ll chirp in with my opinion. According to Gojko Adzic there’s two types of TDD people in the world…

Fixing 'No response from server for url http://localhost:7055/hub/session/' problems with Selenium

December 08, 2012

If you're using a Windows Server 2008 R2 for your CI builds and tests, you may run into issues with running Selenium tests that Server 2003 didn't have.

TFS

TFS tip of the day - cloning an existing workspace

March 16, 2012

Open visual studio command line prompt, and type:

TFS Template types

October 13, 2011

One of the main features of using TFS for bug and backlog tracking is the power it gives you to edit work item templates. A work item is simply a bag of properties/fields grouped together, like a class in C#/Java/every other OO language. You can customise these fields, and you also get a set of core fields, but you also get to choose the workflow of each field. For example you can’t set a bug to closed, before it’s been resolved.

Spruce screenshots

November 29, 2010

Nothing says progress like screenshots, so here’s 6 that give a general flavour of Spruce. It’s currently making heavy use of jQuery including the following plugins...

TFS Caching work items

November 16, 2010

A few days ago I bulk inserted 1000 work items for one iteration and area. The performance of the main bug list after this wasn’t too bad…

WorkItems that spruce supports: tasks, bugs, issues

November 09, 2010

The flexibility and arguably the over complexity of TFS versus other online bug tracking software is its ability to create custom work item…

Templates in TFS 2010

November 05, 2010

One of the things I wanted to establish early on with Spruce was whether it was feasible to build an editor for TFS that could handle work items, without the software needing too many variations for each template type...

Some base principles for Spruce

November 04, 2010

Here's 7 guiding principles I'm sticking to with the development of the Spruce front end for TFS.

A new web front end for Team Foundation Server

November 03, 2010

Team Foundation Server has had some great improvements since the 2005 and 2008 versions, including a plethora of new link types for workitems, an API that is a lot more dev friendly and some improvements to the Visual Studio UI. It is, however, still not really close to the easy of use and user experience you get from competitor bug tracking software...

TOOLS

Powershell snippet: running your own Powershell scripts

March 30, 2012

If you try to run your own powershell scripts via the console, they won’t be allowed by Powershell by default due to its paranoid security…

Using Team City for staging and test builds with ASP.NET and Selenium

March 06, 2012

I've been meaning to write this up for a while, to share my ongoing experience with using Team City for our build, test and staging server, but I've only finally got round to writing something up. I stumbled upon Team City in 2011, after looking around for an alternative to Team Foundation Server's Build server, which wasn't working well with Selenium tests. It's amazing that the product is free for up to 20 or so projects given how polished it is. My workplace doesn't have a huge test coverage setup, mostly down to time constraints (if you want an example of huge test coverage, check out the Team City build server, with over 5000 CI tests running), but the prime motive for using Team City is to automate the following...

Visual Studio 2010 plugin and tools

December 07, 2010

A long list of Visual Studio 2008/2010 plugins and productivity tools. Since the extension manager arrived in 2010, the plugins on the list are a bit redundant.

TRACELISTENER

UdpTraceListener - a UDP TraceListener compatible with log4net/log4j

March 13, 2013

This class is a TraceListener implementation that uses the log4j XML format and sends the XML to a UDP socket. This means you can configure…

TURTLES-ALL-THE-WAY-DOWN

Upgrading an MVC StructureMap 2 app to StructureMap 4

December 01, 2015

A well-known scientist (some say it was Bertrand Russell) once gave a public lecture on astronomy. He described how the earth orbits around the sun and how the sun, in turn, orbits around the center of a vast collection of stars called our galaxy. At the end of the lecture, a little old lady at the back of the room got up and said...

TYPESCRIPT

Using the this keyword with Typescript and a jQuery function

November 23, 2013

When you write Typescript, you’re forced by the compiler to use the “this” keyword when you want to access member variables or methods. If…

UMBRACO

Umbraco hacks for developers

May 05, 2010

A lot of the tips below are relevant for Umbraco 3.0, issues such as the debug builds have been resolved in 4.0

UML

UML cheat sheet

January 04, 2010

This is a small reference sheet for UML class diagrams

UNIT-TESTS

Do you write unit tests before code, or after?

May 05, 2016

One of the biggest omissions in the TDD literature is the concept of code first vs test first. The discussion doesn’t seem to surface very…

C# Unit test generator

April 24, 2016

This small Javascript pen generates a C# file for an object you want to test, using a list of test cases you specify in the textbox in this…

Unit test naming conventions

November 04, 2015

Choosing a naming convention for unit tests method names.

UNIX

Running cron jobs inside a Docker container

September 07, 2016

Probably the most basic use of a Docker image is to run it, and let it exist - like . If you want to do this on a regular schedule, you have…

Unix Cheat Sheet

February 02, 2009

This post is a command reference card for some regularly used unix commands, tested on linux (Redhat 6, a while ago) but should hopefully work on most unix command shells.

URL-GENERATION

Friendly Unique Id Generation part 2

March 05, 2009

The second of two blog posts about generating url-friendly alternatives to the guid.

Friendly Unique Id Generation Part 1

March 03, 2009

The first of two blog posts about generating url-friendly alternatives to the guid.

VAGRANT

Creating a Linux shell on a Windows box in 1 minute (or 7 lines of Powershell)

April 07, 2016

Through the magic of Vagrant (it works well with Linux, not so well with Windows thanks mainly to Windows), you can create a virtual Ubuntu…

WCF

Configuring WCF in code

May 06, 2015

One of the main issues I have with WCF, compared to say a WebApi or a NancyFX based API, are the ridiculously large configuration options…

WEBCLIENT

Silverlight JSON WebClient wrapper/helper

June 06, 2010

This is a small class that uses the NewtonSoft JSON.NET library to make JSON requests to a URL. It handles both requests that require parameters, and those that just return results.

WINFORMS

LDAP/Active directory tree in C#

October 12, 2009

Download This winforms application from 2004 shows the basics of querying an Active Directory and LDAP server, including OpenLDAP, Netscape…

Wake up from Sleep (CreateWaitableTimer) in C#

June 18, 2009

The code illustrates how to set a timer to wake your computer up having been sleep'd. It's tested on Vista and Windows 7 with sleep mode.

Image conversion in C#

April 13, 2009

Download This old application from 2004 demonstrates image conversion using the built in classes in the BCL. Like all the old C# code here…

Automated browser screenshot capture

March 18, 2009

BrowserCapture.exe.zip Project source (Visual Studio 2008) This small windows forms application does the following: Opens a website you…

Sending messages to windows in C# via winapi

September 16, 2008

Download This windows demo app from 2004 shows you how to use the winapi EnumWindows function in association with SendMessage to send…

Changing a Richtextbox caret

February 16, 2006

Download This old bit of code from 2004 is an unfinished (i.e. not that pretty to read) demo project for changing the caret in a rich text…

WORDPRESS

From Wordpress to Wyam

November 01, 2015

Converting this blog from Wordpress to the Jekyll-like .NET tool, Wyam.

WYAM

From Wordpress to Wyam

November 01, 2015

Converting this blog from Wordpress to the Jekyll-like .NET tool, Wyam.

XML

Configuring WCF in code

May 06, 2015

One of the main issues I have with WCF, compared to say a WebApi or a NancyFX based API, are the ridiculously large configuration options…

Avoiding Unicode issues when inserting XML into a SQL Database

December 29, 2010

If you have to insert XML into a SQL Server (2005+) XML column, there's three ways of doing it...

Using XmlTextWriter to produce a XML string

February 16, 2010

This is a small snippet showing an example of using a XmlTextWriter to produce Xml that validates.

Format XML in C#

September 09, 2009

Below is a small snippet showing how to format (or re-format) XML so it’s indented. XML isn’t stored in this humanly readable way in…

Dynamically compiling XSL in C#

June 07, 2009

This post shows an alternative to using XSLTC.exe to compile XSL, when the XSLT you're using is dynamically generated from the database.

.NET XML Comment Cheat Sheet

May 19, 2009

If you like to give your code meaningful XML comments and want the output to look vaguely like the MSDN documentation, then below are a few templates you can use for consistency. These aren't 'how to write XX method' but just how the textual descriptions appear in most of the .NET framework documentation, for example you'll find 'Raises the ... event' in almost all event descriptions.

XML Browser (demo app)

February 05, 2008

Download This simplistic demo app from 2004 works as a simple XML browser, showing all XML nodes in an XML document in a treeview, the value…

Streaming binary/text data via the web in C#

May 24, 2007

An dated example of downloading binary data to autoupdate an application.

YARN

How to fix yarn global add command not found on Windows

November 04, 2020

If you try to run on Windows and then try to run you might get an error message “command not found”. This is because the yarn bin folder…