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.

Mediawiki and how to get the latest articles

For some reason the mediawiki database is really hard to get a hold of. In retrospect, it turns out to be a very good reason, but it takes a lot of research to find out why. Mediawiki does just save a page as you see it on the screen, it saves a page the first time you make it and then it save all the changes. When it is time to show the page it reconstructs the page using the changes and the original, a process that can be a bit time consuming when you don’t use a cache.

Read More...

VB.Net: Single Instance application the better way

Based on Scott Hanselman’ s blogpost named The Weekly Source Code 31- Single Instance WinForms and Microsoft.VisualBasic.dll We all know about this little setting, right? At least now you do ;-). For you C# lovers don’t search for it, it’s only there in VB.Net. And this little nasty side effect. <p> That meant you had to have all your startupcode in the constructor or loadevent of that form (:'() </p> <p> So Scott gave me the inspiration to do this.

Read More...

.NET Framework 3.5 SP1: LINQ perf improvements (LINQ to Objects and LINQ to SQL)

Dinesh wrote a blogpost about .NET Framework 3.5 SP1: LINQ perf improvements (LINQ to Objects and LINQ to SQL). There are three perf improvements in the just released SP1 Specialized enumerable: The new implementation recognizes queries that apply Where and/or Select to arrays or Lists and fold pipelines of multiple enumerable objects into single specialized enumerables. This produces substantial improvement in base overhead of common LINQ to Objects queries (at times 30+%).

Read More...

ISO-11179 Naming Conventions

Straight from the man himself comes this statement posted in the microsoft.public.sqlserver.programming forum: “_You need to read ISO-11179 so you use proper data element names. You actually had “tbl-“on the table names! Sometimes “id” id a prefix and sometimes it is a postfix._” Of course you know who I am talking about? No? Joe Celko of course. So what is ISO-11179? The 11179 standard is a multipart standard that includes the following parts:

Read More...

Microsoft SQL Server 2008 Feature Pack, August 2008 Available for download

The 2008 Feature Pack for Microsoft SQL Server 2008, a collection of stand-alone install packages that provide additional value for SQL Server 2008 is available for download. One of these components is Microsoft SQL Server 2008 Policies Microsoft SQL Server 2008 Policies are examples of how you can take advantage of Policy Based Management. These policies will help you follow some of the SQL Server best practices and avoid common pitfalls.

Read More...

SQL Server 2008 cannot be installed if you have Visual Studio 2008 RTM installed

Visual Studio 2008 does not support having both Visual Studio 2008 without a service pack and Visual Studio 2008 with SP1 installed on the same computer. Because certain SQL Server 2008 features install components that are also part of the release version of Visual Studio 2008 SP1, SQL Server 2008 requires Visual Studio 2008 with SP1. If Visual Studio 2008 without a service pack is installed instead, it may not work correctly after you install SQL Server 2008.

Read More...

Meeting up with Oren Eini aka Ayende Rahien

Last Tuesday (August 5 2008) Oren was in Belgium and he invited people to come along to a beer night/meeting in Brussels. It is funny how people jump at a chance like that to meet up with somebody they have never seen before. But after reading his blog, seeing his screencasts, using all the software he has created and noticing all the other things he does for the community, you just want to see and talk to him in person.

Read More...

Getting The Percentage Of NULLS And Values In A SQL Server Table

Sometimes you want to know what the percentage is of null values in a table for a Column Or you might want to know what the percentage of all values in a Column is grouped by value You can get these answers by running the code below First create this table CREATE TABLE #perc ( Column1 INT,Column2 INT,Column3 INT) INSERT INTO #perc SELECT NULL,1,1 UNION ALL SELECT 1,1,1 UNION ALL SELECT NULL,NULL,1 UNION ALL SELECT NULL,1,NULL UNION ALL SELECT NULL,1,1 UNION ALL SELECT 1,1,NULL UNION ALL SELECT NULL,1,1 UNION ALL SELECT 2,1,2 UNION ALL SELECT 3,1,1 Get the percentage of nulls in all the Columns in my table

Read More...

How Are Dates Stored In SQL Server?

Internally dates are stored as 2 integers. The first integer is the number of dates before or after the base date (1900/01/01). The second integer stores the number of clock ticks after midnight, each tick is 1⁄300 of a second. So if we run the following code for the base date (1900/01/01) DECLARE @d DATETIME SELECT @d = '1900-01-01 00:00:00.000' SELECT CONVERT(INT,SUBSTRING(CONVERT(VARBINARY(8),@d),1,4)) AS DateInt, SUBSTRING(CONVERT(VARBINARY(8),@d),1,4) AS DateBinary SELECT CONVERT(INT,SUBSTRING(CONVERT(VARBINARY(8),@d),5,4)) AS TimeInt, SUBSTRING(CONVERT(VARBINARY(8),@d),5,4) AS TimeBinary Go The results are

Read More...

Visual Studio: Working with the designer

We all know by now that the designer uses the empty constructor to show the form on the screen and the usercontrols. But you want to make a constructor to inject your presenter and you want everyone to use that constructor. And perhaps you want to do some other things in the constructor. But you know this will make the designer choke on your form and never show it again. Now you could just write all the code by hand from then on in… or not.

Read More...