Posts
Iterative and Incremental implementation of Code Reviews
Extreme Programming (XP) advocates for a pair-programming, taking the code review to its extreme. I have also found that pair programming generates a lot of speed and also helps producing better quality product in the first time. But, at the same time it's difficult to impress the management or prove return on investment associated with pair programming to the business people. So, what is the best possible solution? I believe, we can implement frequent peer code reviews to mimic the pair programming to some extent and get the benefit out of it.
Posts
CruiseControl.Net (CCNet) configuration example for NCover
CruiseControl.Net is a great continuous integration tool for .Net projects. It not only continuously builds your software but provides some really helpful reports to monitor your project's progress.
In agile world, we all speak of self-testing code or test driven development (TDD). If we really want to ensure our code has enough test coverage, we need to use some tool to ease our lives and NCover is a good one for this purpose.
Posts
BDD - My First BDD Code using RSpec in Ruby
I am really really happy to see people putting so much efforts for building high quality, nearly all avoidable error free software. I am a big believer of Test Driven Development and doing TDD for about two years now. I have always had the feeling that TDD is a kind of a misnomer because to some people the term 'Test' refers to finding bugs. For this very reason, when people gets started with TDD, they consider it as a waste of time to write so much extra code that doesn't necessarily find bugs!
Posts
Set and Compile using C# Language Version 2.0 in Visual Studio 2008
I know, while most of you are very happy with the new features in Visual Studio 2008, its sad that not all your deployment environments are upgraded to .Net framework 3.5. I had a similar situation as well on one of my projects.
Its great that you can just navigate to a VS 2008 project file properties and from the Application Tab select the Target .Net Framework version to use one of .
Posts
My Target items still in the 2008 learning Queue
1. Windows Workflow foundation.
2. Study about ERP and take a good look into a popular open-source ERP application.
3. Study on SOA.
4. Study on Smart Client applications.
Posts
Unit Testing using Mocks - FillWithMocks, Fill all or only selected properties with Mocks using only a single method call
I have been doing TDD for about two years now and using mock testing for interaction based unit testing in my projects. What I have learned over this time is, a unit testable design leads to introduction of interfaces and dependency injection for testing a code in isolation. And when I want to perform tests on my interactions, I need to create mock objects and inject these mock instances to my object under test.
Posts
XDocument.ToStringWithXmlDeclaration() - Get the string representation of XDcoument with its Xml Declaration
The System.Xml.Linq.XDocument.ToString() produces a serialized string version of the XDocument object. But unfortunately, while doing so, it leaves the xml declaration in the serialized version which may be required in your application.
Again, there is another method called Save that produces the serialized version including xml declaration. So, I think we can write a simple extension method for producing the xml declaration as shown in the following -
14 class Program
Posts
Simple Wildcard replacement on the Rendered Html of Asp.Net Page
This is a simple solution for implementing wildcard replacements in your asp.net pages. You may use this, if you want to replace some tokens / merge codes in the asp.net generated html by your personalized values. System.Web.UI.Control has a virtual method called 'Render' of the following signature - protected internal virtual void Render( HtmlTextWriter writer )
Since, all your ASP.Net pages and server controls are subclasses of this Control class, you can override this method and manipulate the html that's rendered from this control.
Posts
Log4Net SmtpAppender and sending emails with log messages
Since my client asked me if it was possible to generate emails for log entries on an error/fatal level I took a look into the Log4Net SmtpAppender. In your project you may need to implement a similar function and in that case you may use a log4net configuration like the following one- 93 <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
94 <to value="" />
95 <from value="" />
96 <Username value=""></Username>
97 <password value="
Posts
Comparing with NULL in where clause using Linq to SQL
In SQL Server, a SQL statement like 'NULL=NULL' evaluates to false. however 'NULL IS NULL' evaluates to true. So, for NULL values in your database columns, you need to use the 'IS' operator instead of the regular '=' operator.
The problem is, in Linq to SQL, there is no such 'IS' operator since 'IS' is already used as a C# language keyword. So, when you are invoking an equality check in your Linq to SQL where clause to a nullable column you need to be alert on this behavior.