Nick Kewney

Software Architect & Product Builder

Month: October 2011

Pre-generating views to improve query performance in Entity Framework

If you have used .NET Entity Framework, there’s a chance you will have run into performance issues when first loading your application.  One way to reduce this overhead is by pre-generating your view metadata as per this Microsoft guide. I had a few problems using this resource so have prepared this step-by-step guide on how …

Pre-generating views to improve query performance in Entity Framework Read More »

Using regular expressions to get initials from a string in C#

Here is a really simple string extension to help you get initials from a string in C# public static string ToInitials(this string str) { return Regex.Replace(str, @”^(?’b’w)w*,s*(?’a’w)w*$|^(?’a’w)w*s*(?’b’w)w*$”, “${a}${b}”, RegexOptions.Singleline) } Here’s a breakdown on what the expression is doing: ^ matches beginning of the string (?‘b’w) captures first character of a word and stores in …

Using regular expressions to get initials from a string in C# Read More »

Father’s anti-terror row over Braehead phone camera snap

A Glasgow man received a warning yesterday after being caught blatantly taking a photograph of his own daughter innocently eating an ice cream at Braehead Shopping Centre.  After an alert from centre security, Strathclyde Police anti-terrorism unit was quick to arrive at the scene to investigate the incident. An ‘operation Whippy’ spokesman told me:   “By …

Father’s anti-terror row over Braehead phone camera snap Read More »