When teaching recursion in an introductory computer science course, one of the most common examples used involves a tree data structure. Trees are useful in this regard as they are simple and recursive in nature, with a tree's children also being trees, and allow for teaching different kinds of traversals (in-order, pre-order, post-...
Introduced in Visual Studio 2005, Code Snippets allow you to quickly insert reusable blocks of code into your project. For example, if you want to quickly write a for loop in C#, you can simply type "for" into your code file, and IntelliSense shows you the "for" code snippet:
(image)
Now you press the tab key twice, and ...
Consider a simplified version of Luke Hoban's LINQ ray tracervar Xs = Enumerable.Range(1, screenWidth);var Ys = Enumerable.Range(1, screenHeight); var sequentialQuery = from x in Xsfrom y in Ysselect new { X = x, Y = y, Color = TraceRay(x, y) }; If the screen width is much larger than the screen height, we would choose to...
If you look in the PLINQ samples in the December 2007 CTP, you'll see a parallel implementation of Luke Hoban's LINQ ray tracer. The sample parallelizes the ray tracer by changing very few lines of code. Luke's original query started as follows:
from y in Enumerable.Range(0, screenHeight)For our sample, we've changed that to...
Back in the October 2007 issue of MSDN Magazine, we published an article on the beginning stages of what has become the Task Parallel Library (TPL) that's part of the Parallel Extensions to the .NET Framework. While the core of the library and the principles behind it have remained the same, as with any piece of software in the ...