Monday, November 2, 2009

Development tools

https://browserlab.adobe.com/index.html#

http://viewlike.us

A tool for source-code control that integrates into Basecamp. Very small learning curve, please provide feedback:

https://www.springloops.com/


And a nifty set of tools that might make some jobs easier:

http://web.appstorm.net/roundups/51-web-apps-for-web-designers-and-developers/

Friday, August 28, 2009

Fine Drywall - Home Renovations and Home Additions, Custom Home Building, Drywall Installation, Drywall Contractors

Fine Drywall Ltd - Surrey, BC. Canada | Home Renovations and Home Additions, Custom Home Building, Drywall Installation, Framing Contractors, Drywall Contractors



Fine drywall offers a full suite of drywall related services to its customers.
Fine Drywall specializes in doing new home construction. We also do construction in multifamily units and can readily assist you with updating your home or basement. Furthermore, Fine Drywall has the skills necessary to work on light commercial projects.

New home construction is the primary focus for Fine Drywall. Fine Drywall continues to service many of the top residential builders in the city.

Puneet Singla

As I flow in the river of knowledge throughout my life, I wish to reflect upon & share things that I find fascinating.I have always been passionate about computers & programming. Flying in winds of information overload. keeping a tap on programming, web-design, security and open-source web applications.

Puneet Singla

Thursday, August 13, 2009

.Net Code translation VB.NET to C#.Net And C#.Net to VB.Net



Telrik code convertor

http://www.telerik.com/community/forums/open-source-projects/code-converter.aspx

http://www.carlosag.net/Tools/CodeTranslator/

Puneet Singla

Thursday, August 6, 2009

NUnit Testing Tutorial

NUnit: A tutorial
What is unit testing?

According to Jeff Canna, unit testing ensures that a particular method of a class
successfully performs a set of specific tasks. Each test confirms that a method
produces the expected output when given a known input.

What is NUnit?

NUnit is an open source framework that facilitates unit testing for all .NET languages.

How do I get NUnit?

Download the appropriate file from here and install it. That’s it!!

Writing NUnit tests

One question that crossed my mind when I was learning NUnit was whether I should
create my test project as an executable or as a class library. I finally decided to use a
class library because I wouldn’t be running my test project in a stand-alone manner
anyway. But, creating a test project as an executable would cause no problems. It’s up
to you to decide.

Now, let’s get going. Let us first write the class for which we would write unit test
cases. Our class would be called Arithmetica. It would contain four methods to
perform the basic arithmetic operations – Add, Subtract, Multiply and Divide.
using System;

namespace Arithmetica
{
public class Arithmetica
{
public int Add(int augend, int addend)
{
return augend + addend;
}
public int Subtract(int minuend, int subtrahend)
{
return minuend - subtrahend;
}public int Multiply(int firstFactor, int secondFactor)
{
return firstFactor * secondFactor;
}
public int Divide(int dividend, int divisor)
{
return dividend / divisor;
}
}
}

The above code should be placed in a separate project and compiled into a separate
assembly. That’s how unit testing is performed. The test cases are not a part of the
production code. Implementing unit test within the main assembly not only bloats the
actual code, it will also create additional dependencies to NUnit.Framework.
Secondly, in a multi-team environment, a separate unit test assembly provides the
ease of addition and management. [3]
Now, let’s write the test cases for the Arithmetica class. This would involve the
following steps:
1. Create a new project of “Class Library” type (see discussion above) and name it
Arithmetica.UnitTests.
2. Add the project containing the Arithmetica class into the solution of
Arithmetica.UnitTests.
3. Add reference to nunit.framework.dll. This DLL is located in a directory called bin
under the directory where NUnit is installed.
4. Add the following lines in the class in which you are writing the unit test cases:
using System;
using NUnit.Framework;
5. The class which contains the tests must be declared public and decorated with the
TestFixture attribute as follows:
namespace Arithmetica
{
[TestFixture]
public class ArithmeticaUnitTests
{
}
}
6. Now, you may want to do setup activities which are performed before executing
any test. In our case, we want to create an object of the Arithmetica class. This is done
by decorating the method in which you want to perform the setup activities with the
TestFixtureSetup attribute as follows:
[TestFixture]
public class ArithmeticaUnitTests{
private Arithmetica arithmetica;
[TestFixtureSetUp]
public void SetUp()
{
arithmetica = new Arithmetica();
}
}
Note that a TestFixture can have at most one TestFixtureSetup method.
7. You may also want to perform a set of clean up activities after executing all the
tests. The method which does this is decorated with the TestFixtureTearDown
attribute.
namespace Arithmetica
{
[TestFixture]
public class ArithmeticaUnitTests
{
private Arithmetica arithmetica;
[TestFixtureSetUp]
public void SetUp()
{
arithmetica = new Arithmetica();
}
[TestFixtureTearDown]
public void TearDown()
{
arithmetica = null;
}
}
}
Again, a TestFixture can contain at most one TestFixtureTearDown method. Other
setup and teardown attributes for NUnit include SetUp, TearDown, SetUpFixture and
TearDownFixture. You may refer NUnit documentation for these.
8. Now, let’s write the test for the Add method. Every test method must be decorated
with the Test attribute. You can have as many test methods in a test fixture as you
desire.
[Test]
public void TestAdd()
{
int result = arithmetica.Add(2, 3);
Assert.AreEqual(result, 5);
}
Here, the Add method of Arithmetica class is called with the parameters 2 and 3 and
the sum is stored in result. Then, we check whether result is equal to 5. You can read
more about assertions in NUnit documentation.9. If you are expecting an exception to be thrown in the test method, you can decorate
it with the ExpectedException attribute as follows:
[Test, ExpectedException(typeof(DivideByZeroException))]
public void TestDivide()
{
int result = arithmetica.Divide(2, 0);
}
It must be noted here that the precise type of the exception must be specified in the
ExpectedException attribute. Using Exception instead of DivideByZeroException will
cause the test to fail.
10. Similarly, you may write the other test cases. Here is the listing of the tests that I
wrote:
using System;
using NUnit.Framework;
namespace Arithmetica
{
[TestFixture]
public class ArithmeticaUnitTests
{
private Arithmetica arithmetica;
[TestFixtureSetUp]
public void SetUp()
{
arithmetica = new Arithmetica();
}
[TestFixtureTearDown]
public void TearDown()
{
arithmetica = null;
}
[Test]
public void TestAdd()
{
int result = arithmetica.Add(2, 3);
Assert.AreEqual(result, 5);
}
[Test]
public void TestSubtract()
{
int result = arithmetica.Subtract(3, 2);
Assert.AreEqual(result, 1);
result = arithmetica.Subtract(2, 3);
Assert.AreEqual(result, -1);
}
[Test]
public void TestMultiply(){
int result = arithmetica.Multiply(2, 3);
Assert.AreEqual(result, 6);
}
[Test, ExpectedException(typeof(DivideByZeroException))]
public void TestDivide()
{
int result = arithmetica.Divide(4, 2);
Assert.AreEqual(result, 2);
result = arithmetica.Divide(2, 0);
}
}
}
After this, build the assembly. Please note that the TestFixtureSetUp,
TestFixtureTearDown and Test methods must be defined with the following method
signature:
public void MethodName()


Puneet Singla

Saturday, July 11, 2009

Ten Must-Have Tools Every Developer Should Download Now

NUnit to write unit tests
NDoc to create code documentation
NAnt to build your solutions
CodeSmith to generate code
FxCop to police your code
Snippet Compiler to compile small bits of code
Two different switcher tools, the ASP.NET Version Switcher and the Visual Studio .NET Project Converter
Regulator to build regular expressions
.NET Reflector to examine assemblies


Here is list of must have tools listed by Scott Hanselman's ComputerZen.com




  • THREE WAY TIE: Notepad2 or Notepad++ (Scite also uses the same codebase) or E-TextEditor - The first two are great text editors. Each has first class CR/LF support, ANSI to Unicode switching, whitespace and line ending graphics and Mouse Wheel Zooming. A must. Here's how to completely replace notepad.exe. Personally I renamed Notepad2.exe to "n.exe" which saves me a few dozen "otepad"s a day. Here's how to have Notepad2 be your View Source Editor. Here's how to add Notepad2 to the Explorer context menu. E-TextEditor is new on the block this year, inspired by TextMate in the Macintosh. It includes a "bundle" system that uses the scripting power of the Cygwin Linux-like environment for Windows to provide a more IDE-like experience than Notepad2 or Notepad++. It costs, though, but you should absolutely try it's 30-day trial before you shell out your US$35.


    • Notepad++ is built on the same fundamental codebase as Notepad2, and includes tabbed editing and more language syntax highlighting. Is one better than the other? They are different. I use Notepad2 as a better Notepad, but more and more I find myself using E-TextEditor aka TextMate for Windows when I need to crunch serious text. As with all opinions, there's no right answer, and I think there's room for multiple text editors in my life. These are the three I use.

  • PowerShell - The full power of .NET, WMI and COM all from a command line. PowerShell has a steep learning curve, much like the tango, but oh, my, when you really start dancing...woof. I also use PowerShell Prompt Here.

    • I also recommend after installing PowerShell that you immediately go get PowerTab to enable amazing "ANSI-art" style command-line tab completion.

    • Next, go get the PowerShell Community Extensions to add dozens of useful commands to PowerShell.
    • If you're willing to pay (and wait a little) keep an eye on PowerShell Plus. I'm on the beta, and while it'll cost a reasonable fee, it'll be amazing. Certainly not required, but very shiny.

  • Lutz's Reflector and its Many AddIns - The tool that changed the world and the way we learn about .NET. Download it, select an interesting method and hit the space bar. Take the time to install the Add-Ins and check out the amazing static analysis you can do with things like the Diff and Graph.
  • SlickRun - A free floating dynamic "command prompt" with alias support that continues to amaze. My tips for effective use: read the instructions, edit the slickrun.ini file and bind it to Window-R. Also set ChaseCursor so when you hit Win-R, you'll have a floating transparent command line anywhere your mouse is. I recommend you also use larger fonts! Get to know this little box. It's the bomb. I've tried dozens of launchers, giving each days of actual use, but I keep coming back to SlickRun.

  • FireBug - Arguably the most powerful in-browser IDE available. It's a complete x-ray into your browser including HTML, CSS and JavaScript, all live on the page. A must have.
  • ZoomIt - ZoomIt is so elegant and so fast, it has taken over as my #1 screen magnifier. Do try it, and spend more time with happy audiences and less time dragging a magnified window around. Believe me, I've tried at least ten different magnifiers, and ZoomIt continues to be the best.
  • WinSnap and Window Clippings - I'm torn between two of the finest screenshot utilities I've ever found. Free, clean, fast and tight, WinSnap has as many (or as few) options as you'd like. Also does wonders with rounded corners and transparency. It includes a 32-bit and 64-bit version, as well as a portable no-install version. However, Window Clippings also has no install, includes 32 and 64-bit and is only $10. It's a tough one. I use Window Clippings at least daily, and I use WinSnap a few times a week. Kenny Kerr of Window Clippings is actively adding new features and has a nice clean add-in model on his Developers site. Both these apps are worth your download.

  • CodeRush and Refactor! (and DxCore) - Apparently my enthusiasm for CodeRush has been noticed by a few. It just keeps getting better. However, the best kept secret about CodeRush isn't all the shiny stuff, it's the free Extensibility Engine called DxCore that brings VS.NET plugins to the masses. Don't miss out on free add-ins like CR_Documentor and ElectricEditing.
  • SysInternals - I showed specifically ProcExp and AutoRuns, but anything Mark and Bryce do is pure gold. ProcExp is a great Taskman replacement and includes the invaluable "Find DLL" feature. It can also highlight any .NET processes. AutoRuns is an amazing aggregated view of any and all things that run at startup on your box.


    • A great new addition to the SysInternals Family is Process Monitor, a utility that eclipses both Filemon and Regmon. It runs on any version of Windows and lets you see exactly what a process is doing. Indispensable for developing.
    • It's also worth calling out the legendary Process Explorer as a standout and must-have utility.

  • FolderShare - It takes a minute to grok, but FolderShare lets you synchronize folders between systems, between OS's, behind firewalls. Truly change the way you use your machine. Save a file in a folder and it will always been on your other three machines when you need it. Also access files, if you like, from remote locations. And it's free.



Puneet Singla