Programming
Programming techniques etc.
I just got done with a long afternoon of implementing a Windows Service to self-host my WCF service. It was a bit trickier than I thought it would be so if I can save you the headache I'll be happy. A good place to start is by reading these two MSDN articles: http://msdn.microsoft.com/m... http://msdn.microsoft.com/m... Next, you'll want to understand these support articles: http://msdn2.microsoft.com/... ......
If asynchronous programming in ASP.NET is something you haven't been doing, then you'll want to check this article out: http://msdn.microsoft.com/msdnmag/issues/07/03/WickedCode/. Instead of spending more $ on new servers or hardware you might be able to utilize async Pages, Handlers, and Modules to lessen the amount of threads waiting to execute.
This article proposes some great ways of making common sequences of operations on lists more reusable in .NET: http://msdn2.microsoft.com/en-us/vcsharp/bb264519.aspx. It reminds me of some of the built-in set operations that are available in the SmallTalk programming language.
Here is a useful article containing an overview of the new simplified thread synchronization capabilities in Windows Vista:
http://www.codeguru.com/columns/kate/article.php/c13387/. These include CONDITION_VARIABLE, AcquireSRWLockExclusive/ReleaseSRWLockExclusive, and AcquireSRWLockShared/ReleaseSRWLockShared.
I came across this simple, but useful article demonstrating how to use the built-in .NET GZip compression/decompression capabilities. It also mentioned this SharpLibZip open-source compression/decompression library that would allow you to open the file easily using WinZip. UPDATE: forgot to post the article link (whoops!) http://www.codeguru.com/csh... ......
http://msdn.microsoft.com/m... Richter describes how to use the Concurrency and Coordination Runtime (CCR), a lightweight distributed services-oriented architecture and a common language runtime (CLR)-based library included in the Microsoft Robotics Studio toolkit. "The CCR library is a managed DLL that greatly simplifies these tasks for the programmer. The CCR offers a number of classes allowing developers a simple object model that they can ......
Here is a quick and simple intro to Python for those of you who are new to it like me: http://www.builderau.com.au... If you're a .NET developer and feeling inspired give IronPython a spin: http://www.codeplex.com/Wik... ......
A short and sweet article about writing “nested functions” in C#: http://www.codeguru.com/columns/vb/article.php/c12749/.
CSP.NET introduction taken from http://www.cspdotnet.com/: CSP.NET is a Microsoft.NET 2.0 library developed to ease concurrent and distributed programming and it provides a more intuitive and simple alternative to the well known thread paradigm. A simple and secure platform for writing and understanding concurrent programs is necessary because concurrent programs are much more complex than sequential programs. The most common difficulties inherent in concurrent programs are nondeterminism, deadlocks ......
Maybe you don't think that what the world needs is another programming language, but F# combines a number of interesting elements nonetheless. interactive scripting like Python, the foundations for an interactive data visualization environment like MATLAB, the strong type inference and safety of ML, a cross-compiling compatible core shared with the popular OCaml language, a performance profile like that of C#, easy access to the entire range of powerful .NET libraries and database tools, a foundational ......
I came across a few useful articles on AMD's developer website about programming Windows applications to take advantage of multi-core machines: Taking Advantage of Concurrent Programming for Windows, Part 1: The Simplest Multi-core Parallelism That Could Possibly Workhttp://www.devx.com/amd... Taking Advantage of Concurrent Programming for Windows, Part 2: Multi-core Programming in .NEThttp://www.devx.com/amd... ......
Today I came across a set of sweet little atomic operations for manipulating integers in .NET: http://msdn2.microsoft.com/... So instead of doing this: private object counterLock = new Object(); lock (counterLock){ counter++;} You just do this: Interlocked.Increment(ref counter); This has two advantages. First, the code is much cleaner. Second, the performance is much faster. Why? I think the interlocked method is all executed within user mode whereas the other would require ......
This article provides a nice introduction to Test-Driven Development (TDD) and a fair assesment of its advantages and disadvantages: http://www.developer.com/de... It also included this nice little reference list of unit testing tools available for different programming languages: C++ cppUnit .Net csUnit C CUnit Borland Delphi DUnitDelphi JUnit extension for database projects DBUnit Java JUnit .Net library for database projects NDbUnit Oracle Unit Tester OUnit PHP PHPUnit Python ......
I was just helping a buddy of mine do some cross-site scripting (XSS) prevention and came across some good resources. If you don't know what XSS is, there is decent introduction here: http://www.counterhack.net/... Now on to the ones that I really wanted to post: This one is from Microsoft Patterns & Best Practices. How To: Protect From Injection Attacks in ASP.NEThttp://msdn.microsof... Here is a download for Microsoft ......
I discovered Joseph Albahari's e-book on Threading in C# late last night. It helped me finish up and go home earlier than I would have! His paper covers the following topics: Getting Started Overview and Concepts Creating and Starting Threads Basic Synchronization Synchronization Essentials Locking and Thread Safety Interrupt and Abort Thread State Wait Handles Synchronization Contexts Using Threads Apartments and Windows Forms BackgroundWorker ReaderWriterLock Thread Pooling Timers Local Storage ......
Here is a useful article on deadlocks--something I'm sure we all have nightmares about at night: http://msdn.microsoft.com/msdnmag/issues/06/04/Deadlocks/default.aspx.
So it seems that pretty much everyone has decided to release some sort of AJAX framework. Microsoft: http://atlas.asp.net/ Sun: https://ajax.dev.java.net/ Adobe: http://labs.adobe.com/techn... Google: http://goog-ajaxslt.sourcef... Yahoo: http://developer.yahoo.com/... UPDATE (20 May 2006): There's more Oracle: http://www.oracle.com/techn... Google (a more comparable one this time): http://code.google.com/webt... Tibco: http://www.tibco.com/softwa... ......
A concise article that provides rich insight into multithreaded application programming with some references to available libraries in .NET: http://msdn.microsoft.com/msdnmag/issues/05/08/Concurrency/default.aspx
Here is a technique that I only recently came to know as “lazy loading“. First, it is useful when the variable will not always necessarily be used and therefore will not always need to be loaded. Second, since it checks to see if the variable has already been loaded, it will not reload the data multiple times. This is especially important to do performance-wise for variables that may load large amounts of data so that it does not needlessly allocate extra space in memory. In this example, ......