Per Søderlind

I code for fun

Page 27 of 33

Safe, Simple Multithreading in Windows Forms

“It all started innocently enough. I found myself needing to calculate the area of a circle for the first time in .NET. This called, of course, for an accurate representation of pi. System.Math.PI is handy, but since it only provides 20 digits of precision, I was worried about the accuracy of my calculation (I really needed 21 digits to be absolutely comfortable). So, like any programmer worth their salt, I forgot about the problem I was actually trying to solve and I wrote myself a program to calculate pi to any number of digits that I felt like. “

This is the start of an excellent article series describing how to handle multithreading in windows forms. It’s in three parts:

  1. How to perform long-running operations while still showing progress and keeping the UI responsive to user interaction
  2. How to leverage multiple threads to split the user interface (UI) from a long-running operation while communicating further user input to the worker thread to adjust its behavior
  3. How to more cleanly communicate between a UI thread and a worker thread, and how to call Web services asynchronously in a Windows Forms application

more …

HTML Dog Guides – HTML Dog

“There are six guides covering the length and breadth of HTML and CSS. The Beginner’s Guides are step-by-step tutorials, whereas the Intermediate and Advanced Guides contain stand-alone tips, tricks and best-practice techniques”

more …

String formatting in C#

Here’s an excellent article showing how to utilize the String.Format() to the max.

Example taken from the article:
String.Format("{0:$#,##0.00;($#,##0.00);Zero}", value);

This will output “$1,240.00” if passed 1243.50. It will output the same format but in parentheses if the number is negative, and will output the string “Zero” if the number is zero.

more …

XmEdiL – free document editor

“XmEdiL is free document editor for XML and other languages.
The primary use of XmEdiL is to quickly and easily author XML documents and XML related projects. XmEdiL contains everything you need to write, process, and debug XML documents. XmEdiL provide well-formedness check, validation and transformions of XML documents. The XPath builder helps you to construct and evaluate XPath queries. “

more …

The saga continues – Part 3: Binary Trees and BSTs

Anyone working with datastructures should follow Scott Mitchell’s serie An Extensive Examination of Data Structures. In part three he looks at a common data structure that’s not included in the .NET Framework, the binary trees.

more …

Page 27 of 33

Powered by WordPress & Theme by Anders Norén