-
Craig Andera in his blog post showed yet another Fibonacci algorithm, this one with “yeild” operator. private IEnumerable Fibonacci() { yield return 0; yield return 1; int a = 0; int b = 1; while (true) { int temp = a + b; a = b; b = temp; yield return b; } } Now it's possible to fetch Fibonacci...
-
Roy Osherove listed advantages of NUnit over MsTest but also mentioned one MsTest’s strength that can be crucial for many developers: “the integration with other team system tools and reporting is just beyond compare and the reporting alone helps alot to find recurring breaking tests, code churn vs....
-
I like an idea to replace constructor overloads that take optional parameters with more fluent approach, so there will be less (and easier for understanding) constructor overloads and more readable code. Perhaps also more writeable. Let’s take an example, well-known StreamWriter. It has the following...
-
If somebody wants more from the program you wrote, it’s a good sign. It means that at last you did something useful :-) Recently my colleague mentioned that the utility that I wrote to generate project solution file should support creation of solution folders. Our development team has in total...
-
Latest Jeremy Miller’s article in MSDN Magazine will be very helpful for C# developers who haven’t started yet exploring functional programming. What is good about this article is that it gives practical advices on how to inject some fairly small pieces of functional programming into existing C# code...
-
We are often too liberal adding project references. In our team I’ve sent once a warning that every time an assembly reference is added to a project, an angel gets killed, but Norway does not seem to be very religious country. Recently we’ve even had a problem with an assembly loaded in two different...
-
I wanted to analyze our company projects with NDepend and ran NDepend on a couple of our solutions. While it produced very interesting reports (I will try to cover results of NDepend analysis in one of my following posts), I've found that the solution contents were not optimal for such analysis....
-
Introduction A while ago there was quite the discussion about what the differences where between VB.NET and C# and what people should use. After a while it seems that most things where said and it became clear that the C# camp had the most zealous advocates. Now things have quieted down a lot and it...
-
WCF behavior typically can be specified in three ways: using attributes, using configuration files and programmatically. Although KnownType concept also falls in this category, it is impossible to find any reference or example of how to define a WCF known type programmatically. One of the most comprehensive...
-
Kirill Osenkov has posted a simple example showing the code using forthcoming "dynamic" keyword that will come with C# 4.0. His example uses COM. Kirill summarizes the change: Referencing EnvDTE.dll is not required anymore – you also don’t need using EnvDTE – don’t need to reference anything...
-
SPDisposeCheck is a tool to help you to check your assemblies that use the SharePoint API so that you can build better code. It provides assistance in correctly disposing of certain SharePoint objects to help you follow published best practice. This tool may not show all memory leaks in your code. Further...
-
Some time ago I tried to alter a field of a SPListItem right after the moment that the item has been created. A var was stored in the Session so it could be used on the newly created SPListItem (itemAdded). NOT. I figured out that the HttpContext isn't available when during the ItemAdded event. When...
-
Everyone who pastes code into his or her blog has probably used it. If you haven't, then you have to check it out. It allows you to copy code into your blogpost almost instantly, and produces things like this: /// <summary> /// Gets or sets the name of the server. /// </summary> /// <value>...
-
I was running into this just now and found a quick way to solve it, so I just posted it for future reference. I have an ASP.Net web application project in .Net 2.0 which was migrated from .Net 1.1 some time ago. I noticed that a few aspx pages did not have a designer.cs file. All controls on those pages...
-
Ever had the feeling during your presentation that, while you were switching from Powerpoint to Visual Studio to show your demo, there must be an easier way? Like really integrating your demo into your presentation? Well, now there is! Thanks to WPF and Beatriz Costa. For more info go to Beatriz's...