Still looking for a sponsor Max Paulousky is looking for a Silverlight/.Net job in the Commonwealth

Test from Windows Phone

Test from phone. I hope, it will help posting updates to the blog quicker and keep it up to date.

Single-line Solution: Fibonacci number

As I mention in my previous post, next single-line function to implement is Fibonacci number. By definition, the first two Fibonacci numbers are 0 and 1, and each remaining number is the sum of the previous two. Some sources omit the initial 0, instead beginning the sequence with two 1s. (by Wikipedia) There are some variants to calculate Fibonacci number. First one is recursion: Func<int, int> fib = null; fib = n => (n < 2) ? 1 : fib(n-1) +...

Single-Line Solution: Factorial

Recently my colleagues started a dispute whether it is possible to calculate a factorial using just one line of code. In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. (by Wikipedia) One line means a line that ends with a semicolon: bla-bla-bla; Of course, following sample is not the single-row code: for(;;;) bla-bla-bla; First idea is using recursion (let’s arrange, it is the single-line...

Visual Studio 2010 release candidate is available

Visual Studio 2010 RC is available since February 10th, 2010 for the public. Great improvements were made, especially in performance. But this changes are not available for Silverlight 4 developers because that RC does not support Silverlight 4 applications, only Silverlight 3. If you want to continue working with Silverlight 4, you should stay with Visual Studio 2010 Beta 2 until new Silverlight Runtime/Tools/Toolkit etc is available. BTW, it is not possible to run VS 2010 beta 2 and VS 2010 RC side-by-side. Tagged: Visual Studio 2010 , Silverlight 4 This...

How to get Xml InnerText in a Silverlight application – 2

There is an easier way to remove all xml tags from the document – regular expressions: Regex.Replace(text, @"<\/?[^>]*\/?>", string.Empty); Tagged: Silverlight , Xml , InnerText , Regular Expressions This work is licensed under a Creative Commons Attribution By license.

Performance of Visual Studio 2010 Beta 2

The performance of my instance of VS2010 beta 2 was not well. Especially, start of debugging process for silverlight applications was not fast enough. Loading of symbols files (to enable debugging) was taking about two-three minutes. BTW, there are a lot of complains on performance in beta 2. The situation was the same for silverlight 3 and 4 applications. The performance issue has been solved after installing MS Expression Blend Preview for .Net 4. The symbols loading time is almost the same as  for VS2008. I am absolutely sure, Microsoft will improve performance in the release. ...

How to get Xml InnerText in a Silverlight application

The Silverlight framework is restricted in comparison with .Net framework. It does not provide the XmlDocument class, that has the InnerText property. Silverlight applications should use XDocument instead of XmlDocument. Following code is an extension method for the XNode class that implements InnerText functionality. public static string InnerText(this XNode xNode) { bool isContainer = xNode is XContainer; if (!isContainer) { switch (xNode.NodeType) ...