From The Blog

How to revert Git repository to a previous commit?

How do I revert git from my current state to a snapshot made on a certain commit? If I do git log, I get the following output: $ git log commit a867b4af366350be2e7c21b8de9cc6504678a61b` Author: Me <> Date:   Thu Nov 4 18:59:41 2010 -0400 blah blah blah… commit 25eee4caef46ae64aa08e8ab3f988bc917ee1ce4 Author: Me <> Date:   Thu Nov 4 05:13:39 […]

HttpWebRequest and GZip Http Responses

I’ve talked a bit about GZip compression (here and here and here) on the server recently. It’s pretty straight forward to use GZip compression either by letting IIS do it for you automatically or by using some simple ASP.NET code to compress content. As a quick review to create GZip content on the server generically I created a couple simple static […]

How do I use LINQ Contains(string[]) instead of Contains(string)

I got one big question. I got a linq query to put it simply looks like this: from xx in table where xx.uid.ToString().Contains(string[]) select xx The values of the string[] array would be numbers like (1,45,20,10,etc…) the Default for .Contains is .Contains(string). I need it to do this instead: .Contains(string[])… EDIT : One user suggested writing an extension class for string[]. I would […]

What is the yield keyword used for in C#?

In the How Can I Expose Only a Fragment of IList<> question one of the answers had the following code snippet: IEnumerable<object> FilteredList() { foreach( object item in FullList ) { if( IsItemInPartialList( item ) yield return item; } } What does the yield keyword do there? I’ve seen it referenced in a couple places, […]

What is a good statistical math package for .Net?

I am looking for a library that does advanced math, statistics, statistical distribution, etc.. Currently I am looking for something that does binomial and poisson distribution. Solution 1: MathDotNet should have the functions you are looking for, although it may be a bit of overkill depending on how much functionality you need. It offers: Bernoulli […]