CleanCode logo
NAVIGATION: first page in sectionprevious pageup one levelnext pagefinal page in section


Source Control

Subversion and TortoiseSVN Cookbook
This is a developer's cookbook, full of a wide assortment of recipes for working more effectively with Subversion, mostly through TortoiseSVN but with a sprig of command line SVN and a dash of PowerShell mixed in.
Part 1: The Basics, November 3, 2011
Part 2: File Operations and Subversion Filtering, November 21, 2011
Part 3: In, Out, and Around, Janaury 16, 2012
Part 4: Sharing Common Code, February 13, 2012
Part 5: Instrumenting Files with Version Information, February 21, 2012
Part 6: Snapshots, March 19, 2012
Part 7: Managing Revisions, May 30, 2012
Part 8: Log Messages, September 11, 2012
Part 9: Servers, Repositories, Statistics, February 11, 2013
Part 10: Source controlling SQL Server, plus complementary clients, February 12, 2013
Part 11: Subversion and Oracle, April 3, 2013
Database Source Control Basics
Subtitled You"ve Been Doing Source Control Wrong... and How to Fix It, this series discusses how you need to source control both your code and your database, and how to do it in SQL Server Management Studio (with SQL Source Control), Visual Studio (with SQL Connect and AnkhSVN), and your file system (with TortoiseSVN).
Part 1: Getting Started, October 9, 2012
Part 2: The Essential Operations, October 9, 2012
Part 3: The Unified Solution, October 9, 2012
Wallchart reference


PowerShell Data Basics
It's all about the data. This series shows you how to work with line-oriented data (by line, by index, by filter), field-oriented data (fixed width, ragged right, variable width), string data (hash tables, property lists, ini files, json), excel data, and XML data (with either XPath or object accessors).
Part 1: File-Based Data, December 2, 2013
Part 2: XML, January 3, 2014
How To Document Your PowerShell Library,, June 25, 2013
PowerShell lets you decorate your functions with documentation comments to give documentation per function via Get-Help. But to document a whole library you need this documentation generator.
Practical PowerShell for SQL Server Developers and DBAs
This series gives you a running start at setting up and using PowerShell, showing how easy it is to run queries with the sqlcmd equivalent in PowerShell and how to navigate in "SQL Server space" just like you can in "file system space".
Part 1: Configuration and Queries, July 23, 2012
Part 2: Navigating and Working in SQL Server Space, August 15, 2012
Practical PowerShell: Pruning File Trees and Extending Cmdlets,, April 23, 2012
Understand how to extend cmdlets with a practical example: extending Get-ChildItem to take an -ExcludeTree parameter to let you prune whole subtrees.
Further Down the Rabbit Hole: PowerShell Modules and Encapsulation,, August 24, 2011
Modules allow you to use standard libraries that extend PowerShell's functionality. They are easier to use than to create, but if you get the hang of creating them, your code will be more easily-maintained and re-usable.
Down the Rabbit Hole- A Study in PowerShell Pipelines, Functions, and Parameters,, July 14, 2011
For an experienced programmer to learn a new language can be a journey quite like Alice's in wonderland. Paradoxes, unexpected twists, blind tangents, bafflements and nice surprises. This examination of practices and pitfalls of functions yields some fascinating results.
Harnessing PowerShell's String Comparison and List-Filtering Features,, June 7, 2011
When you are first learning PowerShell, it often seems to be an 'Alice through the looking-glass' world. Just the simple process of comparing and selecting strings can seem strangely obtuse. This handy wallchart illuminates everything you need to know.


The Manual That Time Forgot
A primer on Red Gate's new foray into the MySql space, mirroring their outstanding products from SQL Server and Oracle:
MySql Compare, May 3, 2013
MySql Data Compare, May 28, 2013
The Definitive SqlDiffFramework,, April 30, 2010
I literally wrote the book on SqlDiffFramework--plus the application itself! This 150+ page user guide for SqlDiffFramework reveals everything you need to know to get the most out of comparing dissimilar data sources including SQL Server, Oracle, MySql, and any ODBC data source (e.g. Access, Excel, CSV, etc.).
Build a Generic Histogram Generator for SQL Server,, July 3, 2008
Histograms help people analyze large amounts of data, whether you display them as tables or as charts. This article shows you how to do both.
Add Custom XML Documentation Capability To Your SQL Code,, January 23, 2008
By adding XML-based documentation capability to your SQL code, you can automatically extract tagged comments and format them into truly useful documentation. Unlike other SQL documentation generators that document the schema and structure of a database, this article discusses a tool to generate a true API for the procedures and functions in your database.
Bring Array Mapping Capabilities to SQL,, November 1, 2007
Simplify your SQL tasks by giving your queries and stored procedures the ability to iterate over arrays of table names or values.
See also:
A Unified Approach to Multi-DataBase Query Templates
.NET Building Blocks: Build a Configurable Database Credential Selector


LINQ Lycanthropy: Transformations into LINQ,, January 5, 2011
In this article I attempt an explanation of my thought process as I convert conventional code into LINQ code.
LINQ Secrets Revealed: Chaining and Debugging,, December 1, 2010
LINQ has the capabilities of providing a great productivity boost. LINQ Chaining is particularly powerful magic, giving your code greater clarity and brevity. Using it, and debugging it, can be tricky without the right tools and techniques. In this article I talk about the standalone LINQPad utility, with its amazing Dump method, plus several techniques to use within Visual Studio, including a similar Dump method, and even using LINQPad's data visualization capability inside of Visual Studio.
Using LINQ Lambda Expressions to Design Customizable Generic Components,, January 27, 2010
The traditional means for making a generic component that is customizable is the callback method. With LINQ one can do the same thing with just a bit more panache. I like to present my ideas grounded in specific, practical applications: in this case, I chose a file masking user control, allowing a user to filter a list of files from a directory by specifying one--or more--file masks and displaying a dynamic list of matching files. I then add on top of that a thorough discussion--with sample projects!--for injecting additional, arbitrary constraints in the form of LINQ lambda expressions.
Using LINQ to Manage File Resources and Context Menus,, May 8, 2009
This article takes a fairly simple technique involving both LINQ-to-Objects and extension methods (both new concepts in C# 3.0) and uses it as the heart of two moderate complexity components that could themselves be immediately incorporated as building blocks in a production application. What is interesting is that the two components are quite different on the surface: one involves managing an application's external (file) resources; the other involves initializing choices in a context menu upon a right-click to open the menu. I present a thorough discussion of the LINQ and extension methods that comprise the key portions of the code.
See also:
Using Three Flavors of LINQ To Populate a TreeView

Windows Presentation Foundation (WPF)

Mixing WPF and WinForms,, August 10, 2010
One of the earliest-but still important-tenets of software engineering is the concept of reuse with "software building blocks". In the .NET framework, user controls are the quintessential building blocks, giving you a simple yet powerful way to encapsulate a set of visual components into a more complex one. This holds true both in the WinForms realm and the WPF realm. What is not well known, nor particularly obvious, is that you can build hybrids, embedding WPF controls in a WinForms application or WinForms controls in a WPF application, using simple adapters. And you can do this either with your custom user controls, or with the set of the full set of .NET controls if the "other" technology has a control you need.
Creating WPF Prototypes with SketchFlow,, June 18, 2010
Typical prototypes take too long, cost too much, or achieve too little (or some combination of those). Think back to when you were designing and writing code before Visual Studio. And then, one day, you discovered the capabilities that Visual Studio provides. You could create WinForm applications by dragging and dropping controls from a toolbox and editing their properties! You could create and connect data sources; develop class diagrams; etc. Visual Studio was an earthshaking paradigm shift in design and development. With the advent of SketchFlow the landscape for creating prototypes has changed. SketchFlow is new, not very well known, not even a standalone product. But it is earthshaking in a similar way.
Essential Tools for the WPF Novice,, May 19, 2010
WPF is simultaneously enticing and intimidating. It offers potential for amazing flexibility in UI design but there is a mountain of learning to climb. In this article I present a collection of little known but useful utility applications that can assist you as you learn and develop WPF code.
From WinForm to WPF: A Quick Reference Guide,, March 23, 2010
A handy wallchart to help migration between WinForm / WPF, VS 2008 / 2010, and .NET 3.5 / 4.0.


Acceptance Testing with FitNesse
While a reasonably good tool and I like to use it, FitNesse has a lot of "pain points". With my latest plunge into FitNesse I put in the effort to alleviate many of these pain points and wrote it all down. This is a seven-part series; here is what has been published so far:
Part 1: Overview of FitNesse, July 31, 2013
Part 2: Documentation and Infrastructure, August 23, 2013
Part 3: Naming and Layout, October 15, 2013
Part 4: Debugging, Control Flow, and Tracing, November 15, 2013
Part 5: Symbols, Variables and Code-behind Styles, January 16, 2014
Part 6: Multiplicities and Comparisons, February 6, 2014
XPath, CSS, DOM and Selenium: The Rosetta Stone,, April 4, 2011
This article presents a wallchart (in two versions) that is a cookbook; It includes an extensive recipe list for--and cross-reference between--XPath, CSS, and DOM, with attention for any Selenium considerations (since Selenium uses all three technologies). It is a useful reference for any of the separate technologies on its own merits, though!
Web Testing with Selenium Sushi: A Practical Guide and Toolset,, February 9, 2011
Selenium is a powerful, flexible, yet easy-to-use web testing platform. This article illustrates how to stretch Selenium's boundaries with my open-source extension Selenium Sushi, providing both a support library and a .NET project framework, to make Selenium more useful and make you more productive. It lets you, among other things: retarget different browsers and different application servers without recompiling, handle file URLs automatically and, most importantly, convert a standard code file emitted by the IDE into a substantially smaller piece of source code.

Visualization, Documentation, and XML

Taming Sandcastle: A .NET Programmer's Guide to Documenting Your Code
The most effective way to document .NET code so that others can understand and use it is with XML Documentation and SandCastle. But the documentation for creating documentation is--quite ironically--hard to come by! This article and wallchart is a guide to the process and the pitfalls.
Taming Sandcastle article, September 13, 2010
Wallchart on Sandcastle Help File Builder, October 11, 2010
Taking XML Validation to the Next Level: Content Assembly Mechanism (CAM)
Part 1:Introducing CAM, March 5, 2009
Part 2:XSD Schema vs. CAM, March 13, 2009
Part 3:Explore CAM's Expressive Power, March 16, 2009
XmlTransform:A General-Purpose XSLT Pre-Processor,, January 23, 2008
Use this XmlTransform application to generate sets of HTML pages, SQL documentation, or apply it to your own particular needs. XmlTransform is a general-purpose XML transformer and validator that operates on an arbitrarily deep directory tree containing files you want to transform, optionally generating multi-level indices and adding navigational linkages.
Visualizing Data: Self-Documenting Ant files,, October 10, 2007
How one visualizes a concept can greatly impact how well one understands it or, perhaps more importantly, how well one may communicate the concept to others. In this case study I focus on Ant build files and show how different perspectives on the same code allow you to absorb more information faster, reduce errors, and provide intuitive methods to help you comprehend, modify, and test build targets.

User Controls for .NET Windows Forms

A Unified Approach to Multi-DataBase Query Templates,, September 30, 2009
Part 1 (of 3) of my series on the QueryPicker control: No matter how good your SQL skills are, walking into a new situation with unfamiliar databases is only going to make that task trickier; and most large companies - and many small ones, too - will have a heterogeneous database environment, unless you are very fortunate. Mixtures of SQL Server and Oracle are fairly common, and every database type will have different structures and different syntax to remember. This article describes a .NET control called a QueryPicker, a cross-platform query template solution to make life easier.
How to build a Query Template Explorer,, October 23, 2009
Part 2 (of 3) of my series on the QueryPicker control: This article presents the technical details on how to integrate the QueryPicker into applications both simple and complex. With screenshots and code samples, this has everything you need to build your own powerful SQL editor or query template explorer.
Using Three Flavors of LINQ To Populate a TreeView,, December 2, 2009
Part 3 (of 3) of my series on the QueryPicker control: For LINQ lovers, this provides a treatment of how the QueryPicker populates its TreeView from XML using LINQ to Objects, LINQ to XML, and LINQ to XSD.
.NET Building Blocks: Custom User Controls
Part 1 delves into the nitty gritty details required to create, test, use, inherit, install, and distribute .NET User Controls of all types. Part 2 explores the differences between the various types of custom controls, and shows how to integrate your controls into Visual Studio and make them easy to use.
Part 1: Custom User Control Fundamentals, May 15, 2008
Part 2: Custom User Controls In Practice, July 9, 2008
.NET Building Blocks: Build a Configurable Database Credential Selector,, September 14, 2007
This handy control provides a complete solution for interactive handling of database credentials, giving you everything you need to control how users input usernames and passwords, select servers, and choose connection types. After I created a few different proprietary applications where I had to create a custom login form for each, I decided it was time to make one generic enough to be flexible and configurable with just a few lines to set properties.
.NET Building Blocks: Build a RichTextBox-Based Syntax-Highlighting Editor and IDE,, August 1, 2007
By using a SyntaxHilightTextBox control, you can build an editor for the language of your choice that highlights keywords, quoted strings, and comments. The article further shows just one example (a VBScript interpreter) of how easy it is to build an IDE leveraging this control.

Explorations into .NET

.NET Reflector: Through the Looking Glass
.NET Reflector is a tremendous productivity tool but is not very strong in documentation. This series fills in the gaps.
Part 1: Installation and Basic Usage, January 14, 2013
Part 2: Meat and Potatoes, January 15, 2013
Part 3: Analysis and Exploration, January 18, 2013
Part 4: Extending Reflector, January 21, 2013
Creating Tray Applications in .NET: A Practical Guide,, November 4, 2010
This article is different: you can read it backwards or forwards. If you have seen those old books-with two books literally pasted together back to back so that if you flip it over you have a different book to read-this article is like that. It discusses tray applications in WinForms or WPF or both, with consideration of three techniques for mutual exclusion, and presents a tray application framework that you can put to immediate use. It also presents--as a real-world example of the framework--a utility to switch your host file servers from development to staging to production with one click, called HostSwitcher. So you can download either source or an installer for HostSwitcher.
Exploring Secrets of .NET Keystroke Handling,, October 23, 2008
If you've ever been frustrated trying to figure out how to intercept or assign specific keystrokes to specific controls, you'll be glad you found this article. It reveals not only the fundamentals about how keystroke handling is exposed in the .NET framework, but also provides a handy Keystroke Sandbox to actually observe how keystrokes flow through an application, and concludes with a "cook book" detailing how to instrument your code for all the common key handling hooks.
Exploring Secrets of .NET Diagnostics,, March 14, 2008
Diagnostics, or program tracing, is a crucial-and often overlooked and underappreciated-component of application development. It is useful not only during program development but even more so once your application is deployed. Ongoing maintenance costs are one of the largest segments of software's true cost, and well-instrumented diagnostics can reduce maintenance costs significantly.
Exploring Secrets of the .NET DataGridView and Dynamic Data Manipulation,, June 22, 2007
Find out how to use a single DataGridView to display dynamic queries, adjusting columns automatically, and how to format individual cells exactly the way you want users to see them.
Exploring Secrets of BindingSource Filters,, April 23, 2007
Visual Studio gives developers the extraordinary capability to build a database application with a working graphical user interface using just a few mouse clicks. Populating the DataGridView requires a round-trip to the database every time the underlying query needs to be refreshed. This article discusses a technique to eliminate that round-trip, dynamically updating the underlying query of a DataGridView virtually instantaneously. The perceived performance difference is dramatic (akin to the difference between browser-embedded JavaScript updating versus page refreshing from a web server).
Exploring Secrets of Persistent Application Settings,, March 6, 2007
The MSDN documentation includes a lot of material on persisting application settings in a Windows application. But like much documentation, it's primarily a reference rather than a practical implementation guide, giving the complex and intricate usage details of settings without giving a clear and concise discussion of typical simple uses--exactly what a large number of users will be interested in. This article attempts to provide some tips on implementation.
Exploring Secrets of Windows Form Validation,, January 12, 2007
Input validation is something that every program needs, and every programmer dreads. Most developers craft hard-coded program logic to verify that a phone number consists of 7 or 10 digits; that an IP address consists of 4 octets; that a country name matches 1 of 193 choices, etc. While .NET 2.0 provides some support for streamlining input validation, it barely scratches the surface of automating and simplifying the input validation process.
Valid XHTML 1.0!Valid CSS!Get CleanCode at Fast, secure and Free Open Source software downloads
Copyright © 2001-2013 Michael Sorens • Contact usPrivacy Policy
Usage governed by Mozilla Public License 1.1 and CleanCode Courtesy License
CleanCode -- The Website for Clean DesignRevised 2013.11.30