Printer Friendly Version      Send     
Click to Rate and Give Feedback
Related Articles
This article presents an overview of the motivation behind new techniques that decompose problems into independent pieces for optimal use of parallel programming.

By David Callahan (October 2008)
We take a look at planned support for parallel programming for both managed and native code in the next version of Visual Studio.

By Stephen Toub and Hazim Shafi (October 2008)
Here we describe some of the more common challenges to concurrent programming and present advice for coping with them in your software.

By Joe Duffy (October 2008)
Here is an ASP.NET AJAX data-driven Web application that takes the best features from server- and client-side programming to deliver an efficient, user-friendly experience.

By Bertrand Le Roy (October 2008)
More ...
Articles by this Author
This month Scott shows how to generate realistic test data, visits Dare Obasanjo's blog, and demonstrates color coding code for better readability.

By Scott Mitchell (October 2008)
This month Toolbox provides help with error logging, finds an app that helps you write LINQ queries, and explores the non-technical side of development.

By Scott Mitchell (September 2008)
Serialize and Deserialize Fixed Length and Delimited Files, Scott Allen's blog, inspecting Web Pages, and more.

By Scott Mitchell (August 2008)
Host a wiki the easy way, get the screen shots you need and mark them up, and read about LINQ this month in Toolbox.

By Scott Mitchell (July 2008)
This month test your web site on many platforms and browsers without setting up a test environment, use mock objects for unit testing, and visit Raymond Chen.

By Scott Mitchell (June 2008)
This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

By Scott Mitchell (May 2008)
See how to log Web application errors for better health monitoring, what to read if you’re thinking about LINQ, and which blog Scott recommends reading this month.

By Scott Mitchell (April 2008)
This month, a better design-time experience for Web apps, Scott Guthrie's blog, extending Extend Lutz Roeder's Reflector, and more.

By Scott Mitchell (March 2008)
More ...
Popular Articles
If you're unfamiliar with Windows Presentation Foundation (WPF), building that first Silverlight custom control can be a daunting experience. This article walks through the process.

By Jeff Prosise (August 2008)
Speech Server 2007 lets you create sophisticated voice-response applications with Microsoft .NET Framework and Visual Studio tool integration. Here’s how.

By Michael Dunn (April 2008)
Efficient parallel applications aren’t born by merely running an old app on a parallel processor machine. Tuning needs to be done if you’re to gain maximum benefit.

By Rahul V. Patil and Boby George (June 2008)
We build a Silverlight 2.0 application using the InkPresenter to let users annotate a pre-defined collection of images, perform handwriting recognition, and save the annotations and recognized text into a server-side database.

By Julia Lerman (August 2008)
More ...
Read the Blog
Well designed code keeps things that have to change together as close together in the code as possible and allows unrelated things in the code to change independently, while minimizing duplication in the code. In the October 2008 issue of MSDN Magazine, Jeremy Miller shows you some design ...
Read more!
The process for ink capture and analysis on the Tablet PC is straightforward in managed code. To the uninitiated developer, however, creating unmanaged Tablet PC applications can be rather daunting. In the October 2008 issue of MSDN Magazine, Gus Class a quick introduction to the Tablet PC ...
Read more!
Multicore systems are becoming increasingly prevalent, but the majority of software today will not automatically take advantage of this additional processing ability. And multithreaded programming, for anything but the most trivial of systems, is incredibly difficult and error prone today. In the October 2008 issue of MSDN ...
Read more!
Concurrent programming is notoriously difficult, even for experts. You have all of the correctness and security challenges of sequential programs plus all of the difficulties of parallelism and concurrent access to shared resources. In the October 2008 issue of MSDN Magazine, David Callahan describes ...
Read more!
A major advantage of AJAX and Silverlight applications is that they can transparently and continuously interact with a back-end service. The problem is that they run over HTTP, which wasn't designed with security in mind. In the September 2008 issue of MSDN Magazine, Dino Esposito shows you ...
Read more!
Unhandled exception processing shouldn't be a mystery. It's actually quite useful since it gives a crashing application an opportunity to perform last-minute diagnostic logging about what went wrong. In the September 2008 issue of MSDN Magazine, Gaurav Khanna discusses how ...
Read more!
More ...
Toolbox
Live Chat, Code Conversion, Multiple Monitors, and More
Scott Mitchell


Add Live Help to Your Microsoft ASP.NET Web Site
I was recently visiting a hiking supply Web site searching for a particular piece of equipment. After searching in vain for several minutes, I noticed a link to chat with a sales associate. Clicking it opened a new window, allowing me to chat with a gentleman named Chad. I explained what I was looking for and, just a few moments later, got a link to the item. Such live chat functionality is becoming increasingly common on the Internet. Chat is a more responsive customer service mechanism than e-mail and more cost-effective than telephone support.
Most live chat systems are sold as a service. You add a bit of HTML to your site to display the "Live Chat" link, and your customer service operators go to the service provider's site and wait to assist visitors. The advantage of this approach is that there's nothing to install or maintain on your site. However, such models are usually priced on the volume of customers or the number of concurrent operators, which means the price of your live chat will grow right along with your business!
If you want more control over the chat system's implementation and pricing, check out .netLIVEHELP Version 2.0 by Corporate Web Solutions. Unlike service-based systems, .netLIVEHELP ships as a series of Microsoft® ASP.NET 2.0 Web pages and Web services, along with a desktop application for operators. There's a flat, one-time price per Web site, regardless of the number of customers or operators. Plugging .netLIVEHELP into your site is relatively straightforward: you simply create a virtual directory pointing to the folder containing the ASP.NET files and Web services. Adding a "Live Chat" button to a page is as easy as adding one line of HTML.
When a customer initiates a chat session, the software routes the conversation to the operator with the lightest call load. The contents of the conversation are logged, as are metrics such as the customer's browser, IP address, and the Web pages visited on the site.
I was impressed with the .netLIVEHELP's operator and administrator interfaces. The operator signs on through a desktop application containing a system tray icon that flashes when a customer has been routed there. Clicking the system tray icon opens the chat window, which includes features like spell checking and text formatting. Operators can perform chats with multiple customers simultaneously and can also track visiting customers' current and past chats as well as the pages they've visited. And it is possible to integrate data from external applications, so that, for example, an operator can view the customer's shopping cart.
Administrators can perform the same functions as an operator, but can also view statistics. The statistics can be summarized across the whole company for a given date range or inspected on an operator-by-operator basis. The statistics include metrics like the total number of past and ongoing chats, average chat time, and average waiting time.
Price: $395 per Web site license.
Live Chat Enables More Responsive Customer Service  (Click the image for a larger view)

Quickly Convert between Visual Basic and C# Code
Since all Microsoft .NET Framework applications share a common type system and runtime regardless of the programming language used, the differences between .NET programming languages are only skin deep. This language parity lessens the learning curve for developers and enables seamless integration of .NET components whether or not they were created in the same language. While popular .NET programming languages like Visual Basic® and C# are equivalent in the eyes of the .NET runtime, they are not necessarily so in the eyes of developers, who may be adept in one language but not in the other. Such a language barrier can prove limiting when inheriting code or a legacy application at work or when studying code snippets in books or on the Web that are not in your language of choice.
The optimal solution is to become fluent in both Visual Basic and C#, but that's not always possible. The next-best option is to use an automated code converter like Tangible Software Solution's Instant C# version 2.8 or Instant VB version 2.0. Instant C# quickly converts Visual Basic code to C#, while Instant VB converts C# to Visual Basic. Both products can convert a snippet of code, an ASP.NET page, all the code within a specified folder, or an entire Visual Studio project.
While Visual Basic and C# compile into equivalent intermediate language, there is "syntactic sugar" unique to each language. Instant C# and Instant VB include options that let you specify how to handle these differences when converting. For example, when converting Visual Basic code to C# code, Instant C# allows you to indicate whether to convert Visual Basic functions—InStr, Mid, StrComp, and so on—to .NET Framework equivalents or whether to leave them as is and import the Microsoft.VisualBasic namespace. Likewise, you can also indicate whether to convert the Visual Basic vbCrLf keyword to System.Environment.NewLine or "\r\n" in the resulting C# code. And the code formatting options allow you to dictate whether to include braces for single-line block statements and, if so, whether the opening brace should appear on its own line.
The most powerful configuration options are the post-conversion replacement settings. You can specify an unlimited number of regular expression patterns and corresponding replacement text and Instant C# and Instant VB will apply these substitutions to the converted code.
Despite the underlying similarities between Visual Basic and C#, there are slight but profound differences that make a 100 percent accurate conversion impossible. The good news is that Instant C# and Instant VB have a successful conversion rate—over 99.9 percent—on code samples provided by Microsoft.
Price: $179 for Instant C# or Instant VB.

Manage Multiple Desktop Monitors
One of the most cost-effective ways to improve a developer's productivity is to give him another monitor. Developers often face tasks that involve simultaneously processing information from two windows: a running application and the debugger window is a classic example. Having two (or more) monitors at your workstation is priceless when working on such tasks since it allows you to have both windows on-screen at once without the need for incessant Alt+Tabbing.
While Windows® has long supported multiple monitors, the Windows Shell has never really been adapted to handle more than one screen. The main drawback is that only one monitor can contain the taskbar and thus it houses the icons for all of the apps on all of the monitors. As a result, the taskbar becomes cluttered and searching for a particular application can be frustrating as there's no visual relationship between an application's taskbar icon and the monitor it resides on.
Fortunately, there are third-party window management tools designed to work specifically in multiple-monitor environments. One such tool is UltraMon version 2.7.1 by Realtime Soft. The UltraMon Smart Taskbar extends the taskbar across all screens and locates application icons in the appropriate taskbar. UltraMon also adds two buttons next to each window's Minimize, Maximize, and Close buttons: Maximize to desktop and Move window. The Maximize to desktop maximizes the window to stretch across all of the monitors; with a single click, Move window sends the window to a different monitor.
Other features include the ability to stretch wallpaper across all monitors and to launch a screen saver that spans all monitors. UltraMon also provides an API that can be accessed through the Windows Script Host.
UltraMon is an affordable, lightweight program that greatly enhances the multiple-monitor experience. If you regularly use two or more monitors, you owe it to yourself to give UltraMon a try—you won't be disappointed.
Price: $39.95.
The UltraMan Smart Taskbar Extends the Taskbar across All Screens  (Click the image for a larger view)

Have Fun Learning Design Patterns
At any bookstore, you'll find rows of books on design patterns. Design patterns are general, high-level solutions used by software architects to solve common software design problems. The problem is that most books on design patterns stodgily enumerate key patterns, dryly explaining when and how each is to be used.
A notable exception is Head First Design Patterns by Eric and Elisabeth Freeman (O'Reilly, 2004), which covers all of the essential design patterns in an entertaining manner. It dispenses with pages of boring text and replaces it with humor-filled lists, questions and answer sections, a variety of diagrams, and heavily annotated code snippets. Gone too are the canonical examples. Instead of using employee or product-related examples, Head First Design Patterns illustrates how and when to use a particular design patterns through silly applications involving pizza, ducks, chocolate, and gumball machines.
Despite the book's somewhat cartoonish layout, it is full of useful information. Head First Design Patterns introduces and describes design patterns from the perspective of a common problem all system architects have faced at one time or another: how to add new functionality to an existing object hierarchy. It presents a duck simulator application as an example and steps through the concerns and challenges. It then delves into the strategy pattern and how to implement it to address this challenge. Later chapters cover other essential patterns: the decorator, the observer, the factory, the singleton, the iterator, the adapter, and more.
When designing software, the same sorts of challenges arise again and again. Design patterns provide architects with a repeatable, proven way to tackle these problems. Head First Design Patterns makes it fun and easy to learn some of the most useful patterns and how to apply them.
Price: $44.95.

Send your questions and comments for Scott to toolsmm@microsoft.com.


Scott Mitchell, author of numerous books and founder of 4GuysFromRolla.com, is an MVP who has been working with Microsoft Web technologies since 1998. Scott is an independent consultant, trainer, and writer. Reach him at Mitchell@4guysfromrolla.com or via his blog at ScottOnWriting.NET.

© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker