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.

Generic List Provider in C#

Since this is probably the most-often reused piece of code I’ve written recently, I thought it may be worth sharing. It is pretty raw still, so I will post it to the wiki as well, and hopefully people will see ways to improve it (and show us!). Here is the link to the wiki page: Generic List Provider in C#. I wrote this because I found myself constantly writing code to fill lists of objects from database commands.

Read More...

Information Unity in the Canonical Form

So what is a CDM ?… A Canonical Data Model is most simply explained as a standardised way of representing data that generically applies to multiple systems and data models – kind of like the master data model, but for semantics aswell as content. It can be used as a data model standard template for new systems development, or as an intermediary serialised data format – which is the aspect I’ll focus on mostly here.

Read More...

ASP.NET Beginner Resources

If you are just starting out in ASP.NET development, there are some very useful resources that will give you a good start. First of all, I’d suggest going to Microsoft’s ASP.NET website and browsing through some of the sections there. You may want to: Watch some of the Getting Started Videos Follow the Quickstart Tutorials Read the ASP.NET Documentation You may also want to bookmark and read through some of these websites:

Read More...

Microsoft Source Analysis for C# Announced

Microsoft Source Analysis for C# has been announced. Here is what I found on the Microsoft site: This tool is known internally within Microsoft as StyleCop, and has been used for many years now to help teams enforce a common set of best practices for layout, readability, maintainability, and documentation of C# source code. Source Analysis is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions.

Read More...

Good SQL Articles To Read If You Can't Afford Books

You have only $50 left and you can buy two DVDs or one SQL book, what do you do? I would buy the book but not every person has the same idea of a fun time. This is the reason why I present you with a bunch of links to articles which will give you very good info. Some of this you won’t be able to find in a book anyway.

Read More...

Send Action Queries to Your Database in Batches

Coming from a database background, I should’ve known better. But, I didn’t. Recently I found myself needing to write a GUI wrapper for a new Address Standardization component we got at work. This was purchased in order to clean addresses for a variety of data processing tasks we do on the way into the database, allowing us to completely automate these processes, so the DLL I wrote around it was designed with that in mind.

Read More...

Php sucks

I already knew it, since I helped write this site in php, but Jeff Atwood just confirms it php sucks. But these days you can also write nice OO things in php, sometimes a little clunky but still very good. In some other post I will let you see the dal I wrote for our master page, it uses a dao layer like you would write in java or .net, it even uses interfaces.

Read More...

How to get the selectivity of an index

The selectivity of an index is extremely important. If your index is not selective enough then the optimizer will simply have to do a scan. This is also a reason why creating an index on a gender column does not make a lot of sense. First create this table USE tempdb go CREATE TABLE TestCompositeIndex (State char(2),Zip Char(5)) INSERT TestCompositeIndex VALUES('NJ','08540') INSERT TestCompositeIndex VALUES('NJ','08540') INSERT TestCompositeIndex VALUES('NY','10028') INSERT TestCompositeIndex VALUES('NY','10021') INSERT TestCompositeIndex VALUES('NY','10021') INSERT TestCompositeIndex VALUES('NY','10021') INSERT TestCompositeIndex VALUES('NY','10001') INSERT TestCompositeIndex VALUES('NJ','08536') INSERT TestCompositeIndex VALUES('NJ','08540') If you have a composite index (composite means the index contains more than one column) you need to run this code.

Read More...

Unused references

Sometimes we just add references and never use them or use them and then remove it all again. And sometimes it is hard to say which reference we don’t use anymore. Well MS has provided us with a button that looks up the unused references and if it finds one, you can remove the unused references. So how do we do it? First we right click on our project and select properties.

Read More...

Resharper Template Nunit TestFixture for VB.Net

I made a file template for resharper to make it easier to create a TestClass. It looks like this. ``` Imports Nunit.FrameWork Namespace $NAMESPACE$ “’ <summary> “’ A TestClass “’ </summary> “’ <remarks></remarks> <TestFixture()> _ Public Class $CLASSNAME$ #Region “ Setup and TearDown “ “’ <summary> “’ Sets up the Tests “’ </summary> “’ <remarks></remarks> <Setup()> _ Public Sub Setup() End Sub ''' &lt;summary&gt; ''' Tears down the test. Is executed after the Test is Completed ''' &lt;/summary&gt; ''' &lt;remarks&gt;&lt;/remarks&gt; &lt;TearDown()&gt; _ Public Sub TearDown() End Sub #End Region

Read More...