Author: Peter

Benefits of an Enterprise Data Dictionary

source An established data dictionary provides numerous benefits for Federal Student Aid: - Improved data quality: Labelling information consistently, with agreed-upon definitions for data elements and a common set of properties for each data element, makes systems and data analysis easier and business intelligence more effective because of access to high data quality information in the EDD. - Easy access… Read more →

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 →

dynamic code generation in c#

Copied directly from ayende.com Given a Dictionary<string, string>, convert that dictionary into a type in as performant a manner as possible. The conversion will happen many time, and first time costs are acceptable. public static Func<Dictionary<string, string>, T> Generate<T>() where T : new() { var dic = Expression.Parameter(typeof (Dictionary<string, string>), “dic”); var tmpVal = Expression.Parameter(typeof (string), “tmp”); var args =… Read more →

How to find your Windows 10 Product Key after the upgrade

source Save the following as a .vbs Option Explicit Dim objshell,path,DigitalID, Result Set objshell = CreateObject(“WScript.Shell”) ‘Set registry key path Path = “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\” ‘Registry key value DigitalID = objshell.RegRead(Path & “DigitalProductId”) Dim ProductName,ProductID,ProductKey,ProductData ‘Get ProductName, ProductID, ProductKey ProductName = “Product Name: ” & objshell.RegRead(Path & “ProductName”) ProductID = “Product ID: ” & objshell.RegRead(Path & “ProductID”) ProductKey = “Installed Key:… Read more →