LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

T-SQL Window Functions – Part 3: Aggregate Functions

This is part 3 in my series on SQL window functions. In this post, we will explore using aggregation functions with T-SQL windows. SQL Server supports most of the aggregation functions such as SUM and AVG in this context with the exceptions of GROUPING and GROUPING_ID. However, prior to SQL Server 2012 only the PARTITION BY clause was supported which greatly limited the usability of aggregate window functions. When support for the ORDER BY clause was introduced in SQL Server 2012, more complex business problems such as running totals could be solved without the extensive use of cursors or nested select statement.

Read More...

Resharper plugin: rename class to filename

Introduction We all know Resharper and how it makes our lives as Visual studio users so much better. But alas, sometimes there is this one little thing missing. If you used resharper you will have noticed that if your filename and typename don’t match up it shows you the “rename file to match typename” quick fix. But not the other way around “Rename type to macth filename”. Which is odd because sometimes that can be handy.

Read More...

Topshelf and VB.Net

Introduction So what is TopShelf According to the site. One of the simplest ways to get started with winservice development In other words it’s an easier way to make a windows service. Getting started To get started you create a consoleapplication and add topshelf via nuget (this is 2012 after all). Then we create a class with a stop and start method to begin with. Public Class ServiceClass Public Sub StartService() WriteToEventLog("Service started") End Sub Public Sub StopService() WriteToEventLog("Service stopped") End Sub Private Sub WriteToEventLog(ByVal Message As String) Dim el As New EventLog("Application") el.

Read More...

Continuous Delivery with TeamCity

Over the series of 12 posts, I have built a continuous delivery pipeline around the MVC Music Store tutorial web site. The journey included making changes to support unit testing, creating a CI build, adding automated multi-environment deployment, automated interface testing, automated load testing stage, and static analysis. Up until now, this was entirely on Jenkins, but today I intend to re-implement the pipeline on TeamCity. General Feelings My general feelings towards TeamCity during this process have been good.

Read More...

Taming RSS Feeds with XML::RSS and Template::Toolkit

This is a remarkably simple trick which I’ve found very handy. With a few lines of Perl you can take any RSS feed and format it to your liking. Get the Feed You can do this using LWP::Simple: use LWP::Simple; my $feed_url = 'http://feeds.bbci.co.uk/news/rss.xml'; my $feed = get($feed_url) or die ("Failed to fetch feed."); Process the Raw Result Using XML::RSS, convert the raw feed into a more manageable hash.

Read More...

Good service is nice, not needing service is better.

So last week I posted about the lack of a setup project “Visual studio 2012 has no more Setup project and the alternative they offer is crap.“. A few hours later I got a mail from someone at flexera software. My name is …, and I’m a Senior Technical Support Manager with Flexera Software. Your blog post and tweet were recently brought to my attention, and I wanted to reach out to discuss the situation directly with you.

Read More...

Using a Perl Singleton to Share Values Between Objects

It’s been quite a while since I last posted here. Since my last entry I got a new job, got married, went on honeymoon (got back yesterday!) and spent quite a lot of time maintaining legacy Perl code. One thing I see a lot is sharing objects by passing them to the constructor of a new object. This is fine until you’re dealing with complicated sets of objects within objects.

Read More...

T-SQL Window Functions – Part 2: Ranking Functions

This is part 2 in my series on SQL window functions. In this post, we will explore using ranking functions. SQL Server support four different ranking functions which are supported in SQL Server versions 2005 and forward. All of these functions require the use of the OVER clause. The following functions are classified as ranking functions: • ROW_NUMBER • RANK • DENSE_RANK • NTILE Once again, the following CTE will be used as the query in all examples throughout the post:

Read More...

The 5 minute guide to get started with Windows 8

Windows 8 has been a hot topic of late – especially getting started with it. We already had a post from our very own Denis Gobo (@denisgobo) in how to shut down Windows 8. This led me to write a quick post on some features you may or may not know of. Windows 8 has a great design for touch screens, and some great shortcuts for the PC User as well.

Read More...

My Mobile-Friendly Site Redesign

I built my first website for the NCSA Mosaic browser. A lot has changed since then, and the challenges we had with the original browser wars are upon us again as we try and build sites that work equally well on a variety of mobile phones, tablets, and the desktops that originally gave us so much trouble. Like the browser wars, the two main approaches have been server-side and client-side, with the server-side approach using the browsers User Agent to serve up a browser-specific response and the client-side method being an attempt to serve up one version of HTML that works on all potential browsers.

Read More...