Author: Peter

Tips for Sql query performance

The following are a list of good practices I follow when querying large sets of data. SELECT * Avoid selecting all columns from a table. Queries should explicitly list each column it requires Changing column definitions on the underlying tables can have an adverse effect on dependencies such as views, name clashes etc Avoid reading and returning unnecessary data Can… Read more →

How to download a nupkg file

You can download nupkg files by navigating directly to the url using the syntax: nuget.org/api/v2/package/<xyw> where <xyz> is the name of the package you are seeking e.g. nuget.org/api/v2/package/NuGet.CommandLine. You can also request earlier versions of the package by specifying the version in the url e.g. http://www.nuget.org/api/v2/package/NuGet.CommandLine/2.8.6/ Read more →

TeamCity: Agent has unregistered (will upgrade)

I have been getting the TeamCity error Agent has unregistered (will upgrade) with an upgraded installation for sometime and today on a new installation. Both installations are configured to run as a dedicated Windows user account. The problem can be resolved by adding the Windows user to the Administrators group, restart the Build Agent service and wait for the upgrade… Read more →

Url Redirect for moved blog

namespace Director { public class HttpModule : IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += new EventHandler(this.context_BeginRequest); } private void context_BeginRequest(object sender, EventArgs e) { HttpApplication application = (HttpApplication)sender; HttpContext context = application.Context; if (context.Request.FilePath.TrimEnd(‘/’).Length > 0 && !File.Exists(context.Request.PhysicalPath)) { context.Response.Redirect( $”http://scrapbook.qujck.com{context.Request.FilePath}”, true); } } public void Dispose() { } } } <system.webServer> <modules runAllManagedModulesForAllRequests=”true”> <add name=”HttpModule” type=”Director.HttpModule” />… Read more →

Holistic Abstractions (Take 2)

In this post I will outline an updated perspective on Commands and Queries with respect to applying cross-cutting concerns (aka Aspects or Decorators). If you are unfamiliar with these two patterns then please see these posts here and here for a great introduction. Bertrand Meyer defines CQS as: every method should either be a command that performs an action, or… Read more →