From OSNews:
Microsoft has released source code from the Singularity research project onto Codeplex under an academic, non-commercial license. "The Singularity Research Development Kit is based on the Microsoft Research Singularity project. It includes source code, build tools, test suites, design notes, and other background materials. The Singularity RDK is for academic non-commercial use only and is governed by this license."
How cool is that? I'm going to download it and play with it! For those who don't already know, here's a description of what Singularity is.
Singularity is a research project focused on the construction of dependable systems through innovation in the areas of systems, languages, and tools. We are building a research operating system prototype (called Singularity), extending programming languages, and developing new techniques and tools for specifying and verifying program behavior.
Advances in languages, compilers, and tools open the possibility of significantly improving software. For example, Singularity uses type-safe languages and an abstract instruction set to enable what we call Software Isolated Processes (SIPs). SIPs provide the strong isolation guarantees of OS processes (isolated object space, separate GCs, separate runtimes) without the overhead of hardware-enforced protection domains. In the current Singularity prototype SIPs are extremely cheap; they run in ring 0 in the kernel’s address space.
Singularity uses these advances to build more reliable systems and applications. For example, because SIPs are so cheap to create and enforce, Singularity runs each program, device driver, or system extension in its own SIP. SIPs are not allowed to share memory or modify their own code. As a result, we can make strong reliability guarantees about the code running in a SIP. We can verify much broader properties about a SIP at compile or install time than can be done for code running in traditional OS processes. Broader application of static verification is critical to predicting system behaviour and providing users with strong guarantees about reliability.
For those who has been getting the ultimate crashes from SharePoint Designer, and many weird oddities with it, this is something that you should know while working with Data View Web Parts. Occasionally, SharePoint Designer will NOT allow you to add a Data View Web Part no matter what you do, as shown below, and the main reason is... *drum roll*... your file is not saved.

The first screen shot shows a "changed but not saved file" and "Insert Selected Fields As..." not working and the second screen shot shows the "Insert Selected Fields as..." working after saving.
Here's a tip for those people getting & instead of & (and all those other fancy html encodes) from your XSLT variables. You just need to add disable-output-escaping and set that to "yes" when you do a value-of.
<xsl:value-of select="$Site" disable-output-escaping="yes"/>
While working with SharePoint, I found that I sometimes need to replace strings with some characters or strings, for example, replacing "&" with "&", or replacing "_x0020_" with " ". This is a useful template to do so. I got this template from here.
1: <!-- here is the template that does the replacement -->
2: <xsl:template name="replaceCharsInString">
3: <xsl:param name="stringIn"/>
4: <xsl:param name="charsIn"/>
5: <xsl:param name="charsOut"/>
6: <xsl:choose>
7: <xsl:when test="contains($stringIn,$charsIn)">
8: <xsl:value-of select="concat(substring-before($stringIn,$charsIn),$charsOut)"/>
9: <xsl:call-template name="replaceCharsInString">
10: <xsl:with-param name="stringIn" select="substring-after($stringIn,$charsIn)"/>
11: <xsl:with-param name="charsIn" select="$charsIn"/>
12: <xsl:with-param name="charsOut" select="$charsOut"/>
13: </xsl:call-template>
14: </xsl:when>
15: <xsl:otherwise>
16: <xsl:value-of select="$stringIn"/>
17: </xsl:otherwise>
18: </xsl:choose>
19: </xsl:template>
And here's how you'll call it.
1: <!-- pretend this is in a template -->
2: <xsl:variable name="myString" select="'This%20is%20Test'"/>
3: <xsl:variable name="myNewString">
4: <xsl:call-template name="replaceCharsInString">
5: <xsl:with-param name="stringIn" select="string($myString)"/>
6: <xsl:with-param name="charsIn" select="'%20'"/>
7: <xsl:with-param name="charsOut" select="' '"/>
8: </xsl:call-template>
9: </xsl:variable>
10: <!-- $myNewString is a result tree fragment, which should be OK. -->
11: <!-- If you really need a string object, do this: -->
12: <xsl:variable name="myNewRealString" select="string($myNewString)"/>
And there you have it. Very useful indeed.
I've just installed this to try it out. Here's a description of what it is from jkOnTheRun.
Anyone who has been using mobile devices for very long knows too well the hit and miss scenario caused by multi-tasking. You have too much running in the background and the CPU grinds up to 100% and it's hard to do much of anything. Today's Freeware of the Moment is a utility that aims to end that problem once and for all. Process Lasso sets some rules and runs (with very little resources) in the background and prevents bad things from happening when too much gets going at once. It watches your CPU resources and when they get tapped out it steps the priority down for processes until the system is running at an even keel. I have heard many people praise this program but none so well as Steven Hughes of BostonPocket PC who has published a very thorough review of Process Lasso. Check out the review and then give Process Lasso a try and see how well your older system runs with today's programs. Note that Process Lasso runs under Windows 2000, XP and Vista and there are both 32 bit and 64 bit versions available. Be sure and get the right one and you'll be hauling buns in short order. Don't be intimidated, while Process Lasso has all sorts of technical settings to give you total control over your running environment the defaults will pretty much sort your system out with ease.
Well, the next version of XNA Game Studio is released. Download it here.
What’s New with XNA Game Studio?
- XNA Game Studio 2.0 works in all versions of Visual Studio 2005. This includes Standard and Professional, as well as many other specific editions.
- The new and improved interface makes it easier for you to manage your Xbox 360 console.
- You’ll find that managing and building content is easier and more consistent in XNA Game Studio.
- We’ve included project templates for content importers and processors.
- You can configure how content is processed with the new ability to set parameters on Content Processors.
What’s new in the XNA Framework? Now you can:
- Create rich multiplayer games over Xbox LIVE using the new networking APIs.
- Create Audio more effectively with the new XACT editor!
- Host XNA Framework games easily inside a Windows Form.
- Use the virtualized GraphicsDevice: no more special code to handle device reset and recreate!
- Take advantage of render targets that are more flexible, consistent, and easier to use. Xbox 360 and Windows now support multiple render targets (MRTs) as well.
- Easily nest one component inside another thanks to improvements in GameComponent.
- Enjoy many more enhancements and tweaks!
Reading Mads Torgersen old blog post on Recursive Lambda Expressions, I decided it was time for me to seriously play with his code and try out the fixed point generator to create recursive lambda expressions (together with the fact that I was sick and felt bored).
Taking lessons from that blog post, I created a reusable fixed point generator which we can use for anything that uses recursion. Here's the code, simply.
1: public static Func<T, T> Fix<T>(Func<Func<T, T>, Func<T, T>> F)
2: { 3: return x => F(Fix<T>(F))(x);
4: }
5:
6: public static Func<T, T, T> Fix<T>(Func<Func<T, T, T>, Func<T, T, T>> F)
7: { 8: return (x, n) => F(Fix<T>(F))(x, n);
9: }
10:
11: public static Func<T1, T2, T1> Fix<T1, T2>(Func<Func<T1, T2, T1>, Func<T1, T2, T1>> F)
12: { 13: return (x, n) => F(Fix<T1, T2>(F))(x, n);
14: }
15:
16: public static Func<T, T, T, T> Fix<T>(Func<Func<T, T, T, T>, Func<T, T, T, T>> F)
17: { 18: return (x, n, k) => F(Fix<T>(F))(x, n, k);
19: }
Static Fix methods are the actual Fixed Point Generator as described in Mads' blog. This simplifies the code and makes it reusable. The method at lines 11-14 shows how 2 different input can be used. I will be using this method for the sine and cosine lambda expressions I've written.
1: Func<double, double> factorial = Fix<double>(fac => x => x == 0 ? 1 : x * fac(x - 1));
2: Func<double, int, double> sine = Fix<double, int>(sin => (x, n) => n == 0 ? x :
3: sin(x, n - 1) + Math.Pow(-1, n) * Math.Pow(x, 2 * n + 1) / factorial(2 * n + 1));
4: Func<double, int, double> cosine = Fix<double, int>(cos => (x, n) => n == 0 ? 1 :
5: cos(x, n - 1) + Math.Pow(-1, n) * Math.Pow(x, 2 * n) / factorial(2 * n));
The factorial lambda expression is the same as in Mads' blog. I've created both sine and cosine lambda expressions learning from how the fixed point generator works. I have to keep factorial as double instead of int because it'll make the precision wrong.
I used the Taylor Series in order to generate the sine and cosine function. x is the angle in radians, and n is the number of recursion to do (i.e. the more recursion, the more precision).
The basic recursion is as follows:

So that's that! Plug in your lambda expression into the Fix static method and you're done, you've got recursion.
Further testing out whether if it actually works, here's a simple testing code:
1: for (int i = 0; i < 20; i++)
3: Console.WriteLine(factorial(i));
6: Console.WriteLine(sine(Math.PI / 4, 10));
7: Console.WriteLine(Math.Sin(Math.PI / 4));
9: Console.WriteLine(cosine(Math.PI / 3, 10));
10: Console.WriteLine(Math.Cos(Math.PI / 3));
Here, what I do is I check my sine and cosine output with the actual Math.Sin and Math.Cos methods from the framework. It looks like it works well with n = 10 or higher, achieving the same precision as the framework.
That's that. I will play around with more of this, and create more methods out of this.
I tried generalizing the method itself to make it look better and easier to read, but the limits of Generics in C# stopped me from doing anything further. Here's what I tried to do, but failed of course.
1: // I need a constraint operator- to make this work, but Generics does not support this
2: public static Func<T, T> Factorial<T>() where T : struct, IEquatable<T>, operator-
3: { 4: return Fix<T>(fac => x => x.Equals(0) ? 1 : x * fac(x - 1));
5: }
If that was successful, then the code would have been reduced to simply like this.
Doesn't that look better? If only, but there must be come other way to do this.
If Google can do it, so can Microsoft. Volta is the GWT of .NET. Enough said. Here's a description of what it is.
The Volta technology preview is a developer toolset that enables you to build multi-tier web applications by applying familiar techniques and patterns. First, design and build your application as a .NET client application, then assign the portions of the application to run on the server and the client tiers late in the development process. The compiler creates cross-browser JavaScript for the client tier, web services for the server tier, and communication, serialization, synchronization, security, and other boilerplate code to tie the tiers together.
Developers can target either web browsers or the CLR as clients and Volta handles the complexities of tier-splitting for you. Volta comprises tools such as end-to-end profiling to make architectural refactoring and optimization simple and quick. In effect, Volta offers a best-effort experience in multiple environments without any changes to the application.
Download it here.
You need Visual Studio 2008 and .NET Framework 3.5.
InfoQ has a very good article for those who need to override the equality operator. Quote from InfoQ:
In this deep dive article on equal operator overloading Jonathan Allen clears the air on overriding the equality operator. In the article Jonathan provides code samples in both VB and C# to demonstrate the nuances of each .NET language. He also covers usage in both structures and classes.
Areas covered include:
- The initial Class signature
- Fields and Properties
- Type-Safe Equality
- Hash Codes
- Overriding the base class Equals method
- Performance and Testing
Enjoy this well-thought through tutorial on Equality Operator overloading.
Microsoft IT and Microsoft Research released a Line Of Code (LOC) counter that counts the number of lines of code in your software development project to determine the size and status of your project, predicting system defects, providing measurements of productivity and quality, accessing code stability, and using these metrics to measure the success of your project.
LOC Counter can be used as a stand-alone client or as a Visual Studio 2005 add-in. The tool has the following features:
- It handles many different programming languages.
- It performs many different kinds of code counts.
- It handles comments, system-generated code, blank lines, and code churn.
- It connects to many different repositories.
- It provides an estimated defect density that is based on code churn.
- It is customizable. A user can change the kinds of objects that are counted during a counting task.
- It generates detailed reports. In addition, a user can export the report information to a Microsoft Office Excel® worksheet or to a Portable Document Format (PDF) file.
- It is fast. The tool can parse 10 million lines of code in less than one hour.
It uses a Defect Density Algorithm developed from Microsoft Research that uses the following version control history of a file to estimate the software defect density with an accuracy of 89 percent:
- The number of times that the selected files has been modified
- The time period in which the modifications have occurred
- The number of files that were actually modified
"Use of Relative Code Churn Measures to Predict System Defect Density" is a PDF document from Microsoft Research that describes this.
An IT Showcase web cast called How Microsoft IT Uses Visual Studio Team System 2005 to Measure Software Code Stability includes a discussion on how code changes, also known as code churn, may affect the code stability of a programming project.
Parallel Extensions to the .NET Framework is a managed programming model for data parallelism, task parallelism, and coordination on parallel hardware unified by a common work scheduler. Parallel Extensions makes it easier for developers to write programs that scale to take advantage of parallel hardware by providing improved performance as the numbers of cores and processors increase without having to deal with many of the complexities of today’s concurrent programming models.
Parallel Extensions provides library based support for introducing concurrency into applications written with any .NET language, including but not limited to C# and Visual Basic.
ParallelFX runs on .NET FX 3.5, and relies on features available in C# 3.0 and VB 9.0 and includes:
- Imperative data and task parallelism APIs, including parallel for and foreach loops, to make the transition from sequential to parallel programs simpler.
- Declarative data parallelism in the form of a data parallel implementation of LINQ-to-Objects. This allows you to run LINQ queries on multiple processors. (PLINQ)
- First class tasks that can be used to schedule, wait on, and cancel parallel work.
- New concurrency runtime used across the library to enable lightweight tasks and effectively map and balance the concurrency expressed in code to available concurrent resources on the execution platform.
- Several great examples of how to use parallelism in real world problems to obtain impressive speedups, including a raytracer, Sudoku puzzle generator, and other simple puzzle solvers and smaller samples.
Resources:
Download Here
Parallel Extensions Team Blog
MSDN Parallel Computing Developer Center
MSDN Magazine Article: Parallel Performance: Optimize Managed Code for Multi-Core Machines
MSDN Magazine Article: Parallel LINQ: Running Queries on Multi-Core Processors
The Manycore Shift whitepaper
MSDN Forums: Parallel Extensions to the .NET Framework
MSDN Forums: Parallel Computing General forum
Parallel Extensions to the .NET Framework Connect Site
Channel9 Parallel Extension Videos