Monday, July 29, 2013

Nice C# Helper Class for working with POST or GET web requests

You need the following namespaces:

System
System.Collections.Generic
System.IO
System.Linq
System.Net
System.Text

The code is here, shared as via LinqPad's instant share feature.

Saturday, July 20, 2013

Nice task management tool

I've been using Google Tasks for a long time but needed something better and am glad I stumbled across Trello. I wanted to use a kanban board style list and collaborate with other people.  Thanks Trello for a great product.

Monday, May 13, 2013

Examine sp_who2 with LinqPad

This script gets for you just the list of blockers and the list of blockees separately

Prerequisite: Make sure you check Include System Views and SPs in the SQL connection dialog.


var v= sys.sp_who2().Tables[0].AsEnumerable();//.Dump("SP_WHO2");

var blockers = v
 .Where(x=>x.Field("BlkBy") != "  .")
 .Select (x => x.Field("BlkBy")).Distinct();//.Dump("Blockers");  
  
var blockerDetails = v
 .Where (x =>blockers.Contains(x.Field("SPID")) ).Dump("Blockers");
 
var blockees = v.Where(x=> x.Field("BlkBy") != "  .").Dump("Blockees");

Wednesday, October 10, 2012

Getting started with MassTransit - a .net message queueing system

The instruction on the mass transit project gets you started with how to setup mass transit within a single application publishing messages to itself. But this example shows you how to do messaging between applications.

http://www.codewrecks.com/blog/index.php/2012/08/03/quick-start-on-mass-transit-and-msmq-on-windows/

Sunday, September 02, 2012

Creating classes and extension methods in LINQPAD

A very good thing to know is that you can actually define your own classes in LinqPad. The trick to it is that you must put a closing bracket to the linqpad code and start your class, but omit the last bracket.

This post explains why.