Hex Dump using LINQ (in 7 Lines of Code)

At one point while debugging the HtmlConverter class, when I found certain situations in the XML, I wanted to dump the XML in binary to see the actual hex values of characters being used.  I got tired of stopping and examining the values in the debugger.  I did a couple of searches, and found some…

10

Ad-Hoc String Concatenation using LINQ

I regularly use functional programming and LINQ in two contexts – when writing code that is part of an example or tool that will potentially execute millions of times, and when writing ad-hoc queries.  These days, I use C# and LINQ as my ‘scripting language’, to iterate through directory structures, open and process Open XML…

6

Rollup Extension Method: Create Running Totals using LINQ to Objects

Recently, I had need for a new extension method for IEnumerable<T>, which I call “Rollup”.  This extension method is sort of a cross between the Select and Aggregate extension methods.  Like Select, when using this extension method you write a lambda expression to project the new value in a new collection.  Unlike Select, in the…

2

Recursive Approach to Pure Functional Transformations of XML

Writing pure functional transformations a in a recursive style enables us to put together interesting transformations in a very small amount of code.  Using some specific techniques that allow us to write this code very concisely, this approach takes advantage of some perhaps obscure semantics of LINQ to XML.  I’ve used this approach to write…

3

Microsoft Promises No Patent Prosecution for the MONO Project

Peter Galli, Senior Product Manager at Microsoft, has posted that Microsoft will be applying the Community Promise to the ECMA 334 and ECMA 335 specs.  In his post, he says, “It is important to note that, under the Community Promise, anyone can freely implement these specifications with their technology, code, and solutions.”  Very cool. This…

1