Totzkeeeeee's Blog

Just because I can...

  Home  |   Contact  |   Syndication    |   Login
  216 Posts | 4 Stories | 345 Comments | 321 Trackbacks


My blog is worth $14,678.04.
How much is your blog worth?

Tag Cloud


Post Categories

Blog Roll

Cool Sites


There are 2 entries for the tag LINQ
Let’s say that you have a list of objects that contains duplicate items and you want to extract a subset of distinct items. This is pretty straight forward in the trivial case where the duplicate objects are considered the same such as in the following example: List<int> ages = new List<int> { 21, 46, 46, 55, 17, 21, 55, 55 }; IEnumerable<int> distinctAges = ages.Distinct(); Console.WriteLine("Distinct ages:"); foreach (int age in distinctAges) { Console.WriteLine(age); } /* This ......

I've seen some really bad SQL in my day. Hell, I've even written some in my earlier days. But I've NEVER seen anything like this. Over on the Daily WTF there are plenty of examples of bad code. Most of them just make you shake your head and say What the F**k? I've never been moved to share them with others but this one just crys out for it. The person submitting this particular WTF relates that they are not licenced to modify the source (it's in SQL) or the ASP code and asks for suggestions. I would ......