The Poirot Effect – Overstating the Case

I really enjoy watching the ITV television series “Agatha Christie’s Poirot”, starring David Suchet as Poirot and with enjoyable regular performances from Hugh Fraser, Philip Jackson, and Pauling Moran. The shows themselves are great fun, especially the lighter episodes; but that isn’t what makes this show such compelling viewing. The part of this show I […]

Intermittent Replication Issue – Distribution Agent Failed to Create Temporary Files

This will seem like a strange issue, because everything will work perfectly well for a period of time – but then it will all go wrong and you’ll get an error such as: Error messages: The distribution agent failed to create temporary files in ‘C:\Program Files\Microsoft SQL Server\110\COM’ directory. System returned errorcode 5. (Source: MSSQL_REPL, […]

Shorten Your Linq Expressions

There is an interesting style of Linq expression that I am seeing a lot in code, including open source projects. It isn’t a big deal, but it damages readability. It looks like this: var result = someEnumerable.Where(e => e.IsCondition).FirstOrDefault(); var result = someEnumerable.Where(e => e.IsCondition).SingleOrDefault(); var result = someEnumerable.Where(e => e.IsCondition).Count(); Can you spot it? […]