Author Archives: Mads Klinkby

Shrink all SQL Server logfiles

After backing up the log files on a SQL server, the logs are truncated and you might want to reclaim the disk space held by those empty log files. This little Transact-SQL script will do just that. DBCC SQLPERF(logspace) GO DECLARE @logsize AS INT = 256; — MB DECLARE @databasename AS VARCHAR(256); DECLARE @filename VARCHAR(256); [...]

Minimalist’s build script for ASP.NET projects

When deploying ASP.NET web sites you have a number of options ranging from full blown (up) MSI installers, MSDeploy or the KISS option: xcopy deployment. If the target IIS set up this is a very clean way to redistribute your application. First download a 7za.exe archiver and put it in your solution root. Then create a [...]

SharePoint List Performance (or how I saved 94%)

In a recent performance test session, I had created a thousand documents in a document library. They all had a 20 custom metadata fields filled out with data. The unit under test read all this data along with the common file information like this: SPUser user = listItem.File.CheckedOutByUser; result.CheckedOutBy = user != null ? user.LoginName [...]

DecoratorStream

In scenarios where you want to extend functionality of a simple System.IO.Stream instance, it is convenient to have a decorator. Neither the original stream or the client instance will have to know anything about the extension as it is still just a Stream. This can be used to add position tracking or to manage lifetime. [...]

JavaScript commas in IE

While working with JQuery UI DataTables I got some strange JS errors in IE. And not from any-better-browser. ‘style’ is null or not an object My Google cortex provided the answer: IE javascript engine treats array/object initialization different from other engines. While other browsers simply ignores if the initialization has a trailing comma, IE don’t. [...]

Follow

Get every new post delivered to your Inbox.