|
|
October 2006 - Posts
-
I’ve been working closely with the IE team leading up to the release of IE7 and looking at the use of XML in the browser. During this investigation one thing has become immediately obvious – there is a lot of confusion around the versioning story for MSXML and how to instantiate the “right” MSXML object in the browser. Here’s a quick snippet of code that I’ve seen all too often out on the web: What NOT to do... if (Web.Application.get_type() == Web.ApplicationType.InternetExplorer) { var progIDs Read More...
|
-
I just added a new topic in the Functional Programming Tutorial , Procedural Analogs . This introduces the Switch extension method, which you would use in certain circumstances. It is somewhat analogous to the C# switch statement, except that this extension method implementation of switch can be applied to every member of a collection. This is basically a re-casting of the World's Smallest RPN Token Processor blog entry . Read More...
|
-
You can implement common procedural constructs in the Functional Programming (FP) style. For instance, the FP tutorial showed how to loop using a ForEach extension method. We can do something similar to implement something analogous to the C# switch statement. To do this, we'll write an extension method that takes as parameters, 1) a delegate that returns an integer, and 2) an array of delegates (declared using the params keyword). The extension method indexes into the array using the integer, and Read More...
|
-
Dear Linq, is there a more elegant way in Linq to perform this query? Let's say I have an array of ID's that I am interested in, int[] employeesToSelect = {10,11,12}; A naive attempt, which does compile: from e in db.Employees where e.ID==10 || e.ID==11 || e.ID==12 select e; I can't get more sophisticated approaches to compile, for example: var q2 = from e in db.Employees where Array.IndexOf(employeesToSelect , e) select e; Read More...
|
-
We were very happy to note that "DonXml" Demsak won the Visual Studio Extensibility Plugin Contest with his XPathMania plugin. This enhances the VS 2005 XML editor to highlight the nodes that would be selected by an XPath expression. A great way to learn XPath, or debug a tricky expression in your SelectNodes() or XSLT code. I'd also like to recognize a very useful article that our colleague Sinan Uşşaklı wrote for MSDN. This addresses one of the most frequently asked questions in the XML world - Read More...
|
-
Tomas P has a nice post on the concepts behind the C# 3.0 language . Read More...
|
-
Troy Magennis has been posting a lot of interesting content on Linq. He recently posted about the limitations that he ran into when working with the Standard Query Operators, and how he's looking to overcome those limitations by writing a set of "Extra Linq Extension Methods" that do what he wants. It will be interesting to see how many alternate implementations and extensions for the Standard Query Operators are released as people find flaws or shortcomings in the default set. tags: linq , sqo , Read More...
|
-
Ayende has been doing some cool stuff with operator overloading in ActiveRecord queries . As I mentioned in some of my previous posts we've done a lot of the same things with our "Query API". While it's not as nice as Linq, its a decent substition for the time being. The Evolution of a Query API Our Query API Explained Overloading the && and || operators Technorati tags: activerecord , linq , query api Read More...
|
-
Eric White has put together a nice tutorial on Functional Programming using C# 3.0 . Eric walks through the steps that he took while trying to learn about functional programming. On my way to and from work I read Eric's tutorial and I really enjoyed it. Eric talks a lot about the language features in C# 3.0 that allow functional programming, as well as how Linq takes advantage of ideas such as lazy evaluation. Anyway, its well worth the read. Technorati tags: linq , linq to xml , xlinq Read More...
|
-
A couple of months ago, I wrote some code that used LINQ to XML to parse WordML files. It was interesting to do, and relatively easy. I posted it on this blog, and some other people here at MS used it for various purposes. Then it came to the attention of one of the Gurus at MS, and he (kindly) pointed out that I didn't quite understand how to compose query expressions properly. Specifically, what he said is that anytime he sees someone writing imperative code after declarative code, it shows that Read More...
|
|
|
|