Feng Yuan (袁峰)

CLR, Performance, Debugging, Parallel Computing, WPF, XPS, GDI, GDI+, Printing (www.fengyuan.com)

Browse by Tags

Tagged Content List
  • Blog Post: XPS Again

    I needed to generate images for an HTML document I'm generating, for which I use create a DrawingVisual and render it to a RenderTargetBitmap before saving to a PNG file. Now I would like to save the same visual to an XPS document. The benefit of having an XPS document is that you can zoom it at any...
  • Blog Post: Performance Tips: Faster than StringBuilder?

    The web has tons of articles about how StringBuilder is much faster than string concatenation using '+' operator or String.Concat functions when there are enough strings to ber merged. Here is an MSDN article on this topic: http://support.microsoft.com/kb/306822 But actually, if all you want is concatenating...
  • Blog Post: Performance Tips: String.Split

    String.Split methods are provided in .Net as a convenient way of dividing string into parts. Here are two basic forms of String.Split methods: public string [] Split( char [] separator, int count, StringSplitOptions options); public string [] Split( string [] separator, int count, StringSplitOptions...
  • Blog Post: TextWriter.WriteLine(string, object[]) in less memory, less time

    I found myself increasingly generating reports in .csv format, and then use Excel to analyze the reports. With large amount of data written to the .csv file, file generation time becomes more and more noticable. So I took some time to check what is taking so much time and how can it be reduced. For...
  • Blog Post: Problem: Better way to remove characters that aren't 32 to 175

    There is a question on StackOverflow.com about better ways to remove characters in a string that are outside the range of 32 to 175. Quite a few fancy solutions are provided: Regex . Replace ( myString , @"[^\x20-\xaf]+" , "" ); new string ( myString . Where ( c => ( c >= 32 ) &&...
  • Blog Post: Drawing bearing and distance property line using C#/SVG/IE9/Visio (V2)

    Here is expanded version of my little C# program which converts property description in bearing and distance to SVG, which can then be viewed by IE9 or imported into Microsoft Visio: Program.cs (attached) New features: endpath command to end a path with stroking closepath command to end...
  • Blog Post: Drawing bearing and distance property line using C#/SVG/IE9.

    If you read an official property legal desciption, property line are often described using bearing and distance. Here is an example: BEGINGING AT THE NORTHWEST CORNER OF SAID SOUTHWEST QUARTER OF THE SOUTHWEST QUARTER OF SECTION 9; THENCE SOUTH 89°35'11" EAST; 246.35 FEET ALONG THE NORTH LINE...
Page 1 of 1 (7 items)