IDictionary Options - Performance Test - SortedList vs. SortedDictionary vs. Dictionary vs. Hashtable Please note that the advantage of Hashtable over generic Dictionary for insert and search operations demonstrated here is actually because the tests are based on NON generic IDictionary interface, so each insert or search action is accompanied with check for the key type. For more information see the Sean's comment below. (Thanks Sean!) This is a sequence of tests comparing the performance results for four different implementations of IDictionary and in particular generic Dictionary, generic SortedDictionary, the old non-generic Hashtable and generic SortedList. I performed several tests, comparing the following parameters: memory used in bytes, time for the insertion in ticks, time for the item search in ticks, and the time for looping with foreach in ticks. I performed the tests in five stages, to observe the relationship between the number of entries and the performance. In this particular test, lower numbers of memory usage or time taken for the execution means better performance.
Fluid Code » Refactoring in C# Fluid Code A blog about refactoring, .Net and all things agile by Danijel Arsenovski Home Archive for the ‘Refactoring in C#’ Category Telerik announces (yet another) .NET refactoring tool Thursday December 3rd, 2009 in Refactoring , Refactoring in C# , Refactoring in VB , Visual Studio 2010 | No Comments » Another Free C# Refactoring Tool from Devexpress Tuesday May 26th, 2009 in Refactoring in C# | No Comments » Professional Refactoring in C# and ASP.NET published! Wednesday April 15th, 2009 in Refactoring in C# | No Comments » “Professional Refactoring in C# and ASP.NET” available with discount for pre-order at Amazon Sunday February 1st, 2009 in Programming , Refactoring , Refactoring in C# | No Comments » It’s official! Saturday August 9th, 2008 in Refactoring , Refactoring in C# | No Comments » Translate Categories Tags Recent Comments Blogroll Free Chapter My Articles Personal Refactoring Tools Sites of interest Archives © 2013 Fluid Code Design by Arcsin Wordpress Themes
C# Preprocessor Directives (C#) This section contains information about the following C# preprocessor directives. #if #else #elif #endif #define #undef #warning #error #line #region #endregion #pragma #pragma warning #pragma checksum See the individual topics for more information and examples. Although the compiler does not have a separate preprocessor, the directives described in this section are processed as if there were one. A preprocessor directive must be the only instruction on a line. WPF Command-Pattern Applied Download source - 79.5 KB Introduction WPF Commanding offers the base for integration of the GoF Command pattern into an application. Program Architecture Creation of functional units in hierarchies Reduction of complexity in large applications Automated testing Reusability of the pattern and the commands Command Description Description of a command should be neutral to the GUI in use Commands should be easy to localize Command Runtime Behaviour Static parameter (per command instance) Context sensitive runtime data Source provided runtime parameters (ICommandSource.CommandParameter) UI Integration Images and ToolTips with Gestures for existing command sources (Button and MenuItem) Visualization of a Disabled state for Button controls Selectable binding via XAML or Code-Behind Integration of existing WPF commands as for example the System.Windows.Documents.EditingCommands Command Repository The attached example demonstrates how to use the Command pattern in an RTF editor: Command Usage
.NET Design Patterns in C# and VB.NET - Gang of Four (GOF) - DoFactory Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects. The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. To give you a head start, the C# source code for each pattern is provided in 2 forms: structural and real-world. A third form, .NET optimized, demonstrates design patterns that fully exploit built-in .NET 4.5 features, such as, generics, attributes, delegates, reflection, and more.
XAML Overview (WPF) XAML is a declarative markup language. As applied to the .NET Framework programming model, XAML simplifies creating a UI for a .NET Framework application. You can create visible UI elements in the declarative XAML markup, and then separate the UI definition from the run-time logic by using code-behind files, joined to the markup through partial class definitions. XAML directly represents the instantiation of objects in a specific set of backing types defined in assemblies. This is unlike most other markup languages, which are typically an interpreted language without such a direct tie to a backing type system. When represented as text, XAML files are XML files that generally have the .xaml extension. The following example shows how you might create a button as part of a UI. Much of the material in the next few sections will be elementary to you, if you have previous familiarity with the XML language. An object element typically declares an instance of a type. Consider this example:
Complex Systems Chapter 1: Authentication Patterns Web Service Security: Scenarios, Patterns, and Implementation Guidance for Web Services Enhancements (WSE) 3.0 Microsoft Corporation patterns & practices Developer CenterWeb Service Security: Home December 2005 Contents IntroductionImportant ConceptsDirect Authentication vs. Introduction As computer systems have increased in complexity, the challenge of authenticating users has also increased. This chapter provides architectural patterns for direct authentication and brokered authentication, along with three brokered authentication design patterns that illustrate authentication using the Kerberos protocol, X.509, and a Security Token Service (STS). Figure 1. Authentication is considered to be a primary security feature because mechanisms used for authentication often influence mechanisms used for enabling other security features, such as data confidentiality and data origin authentication. Important Concepts Authentication. Direct Authentication vs. Figure 2. Figure 3. Table 1. Table 2.
Layouts Inside Tabs Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Sed Non Urna Donec et ante. Vivamus non quam. Nam enim risus, molestie et, porta ac, aliquam ac, risus. Phasellus ac libero ac tellus pellentesque semper. List item one List item two List item three Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Cras dictum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. Suspendisse eu nisl.
Layouts Inside Tabs Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Sed Non Urna Donec et ante. Vivamus non quam. Nam enim risus, molestie et, porta ac, aliquam ac, risus. Phasellus ac libero ac tellus pellentesque semper. List item one List item two List item three Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Another Item Cras dictum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. Suspendisse eu nisl.