Thursday, March 27, 2008

Sunday, March 23, 2008

First touch TeamCity

Yesterday I tried TeamCity the first time, and also it's the first time for CI (continuous integration). My first impression about TeamCity is it's very easy to use. But if you're new to TeamCity and CI (like me), you need to read the description for each fields carefully and consult TeamCity document when creating a build configuration.

After creating a build configuration, I fire up VS2008, write a test, run the build but it fail with an error message "Could not locate the assembly nunit.framework...". I don't understand why. I added reference to NUnit assembly to test project. I could compile and run the test on my PC. But why TeamCity cannot locate NUnit assembly?

After some tries, I found that I can fix the problem by adding nunit.framework.dll to test project manually (create a "lib" folder, copy nunit.framework.dll into it, add reference to the "local" nunit.framework.dll and commit to server). Seems TeamCity cannot resolve dependencies if the assemblies were not in GAC.

OK, now I'm happy with adding NUnit assembly to project manually. But it will better if TeamCity can resolve it for me.

And one thing maybe you will interested in, JetBrains is now developing their own issues tracker. I imagine that someday when I go to office I will fire up my favorite IDE (IntelliJ IDEA), receive my tasks, reports from my issues tracker (in my IDE), write code and run tests in conjunction with my CI server (Team City). I think that day will come soon ;-)

Let's continue with CI :-)

PS: You can read here to find out how TeamCity roooocks.

Friday, March 21, 2008

Next version of the most intelligent Java IDE

The first EAP build of IntelliJ IDEA 8, the most intelligent Java IDE, has just been released. In this version, JetBrains brought to you:
  • Seam support

  • FreeMaker support

  • JavaScript debugging

  • Flex debugging

  • SQL support

  • Struts 2 support
and many more. You can grab it here to have fun :-)

But where is the road map? I cannot find it now but hope that they will post it soon and we will have many big suprises.

How to fix NAntAddin to run with Visual Studio 2008

I can install NAntAddin v1.0.3 for Visual Studio 2005, and it's OK, at office, I only need to use Visual Studio 2005. But it's really annoying when I cannot install it for Visual Studio 2008 at home.

Play with NAntAddin.AddIn I found that I can fix it to install NAntAddin for Visual Studio 2008. And if you want, you can do it easily. Just open NAntAddin.AddIn in a text edtior, you will find this XML fragment:
<Name>Microsoft Visual Studio</Name>
then just replace "8.0" by "9.0" and restart your Visual Stusio 2008, NAntAddin will start. (Of course, you need to configure NAntAddin in your Visual Stusio 2008 first via Tools|Options...|Environment|Add-in/Macro Security)

Another information relates with NAnt: If you want to get NAnt intellisense in Visual Studio, just copy nant.xsd from NAnt to [VS_HOME]\Xml\Schemas. VS_HOME is the path to Visual Studio folder, in case of Visual Studio 2008, it is "C:\Program Files\Microsoft Visual Studio 9.0" and add a custom namespace to your build file as below
    <?xml version="1.0" encoding="utf-8" ?>
<project name="NAnt Build Sample"


Wednesday, March 19, 2008

Wi-Fi trolley? We did it, but...

I've just found an interesting information. You can read it here (in English) and here (in Vietnamese).

For this kind of Wi-Fi trolley, we did it about 2 years ago (even it doesn't have voice recognition function) but... it wasn't successful yet ;-)

Monday, March 10, 2008

Fixed VS 2008 ASP.NET MVC Templates

After trying VS 2008 MVC Templates, I found that the test project cannot resolve references to System.Web.Mvc, System.Web.Routing and System.Web.Abstractions (and Rhino.Mocks if you use the NUnit & Rhino Mocks template). The reason is, in project template, they used relative path while the absolute path should be used (or maybe it has another way but I don't know).

You can easily fix the templates by extract the ZIP file, open the CSPROJ file and replace relative path to MVC and Rhino assemblies by absolute path. But you can download fixed version of the templates here. (For installation these templates, you can follow the same steps as in "ASP.NET MVC Test Framework Integration Walkthrough")

Remember, if you install Rhino Mocks and ASP.NET MVC assemblies in different folders than "C:\Program Files\Rhino.Mocks-3.4" and "C:\Program Files\Microsoft ASP.NET MVC Preview 2", you need to fix them yourself.

Thursday, March 06, 2008

A powerful tool for Subversion

Are you tired with setting up Subversion (and integrate it with Apache) on Windows? If the answer is "Yes", you should check VisualSVN Server.

What does it provide?
  • An all-in-one installer with up-to-date components (Subversion 1.4.6, Apache 2.2.8 - for VisualSVN Server v1.0.3)
  • Supports SSL out of box
  • An UI for administration repositories and security - a superior feature, right?
  • It doesn't use port 80 so it cannot conflict with IIS
And it's completely FREE.

Check some screenshots.

Figure 1. Setup

Figure 2. Administration UI

Figure 3. Create repository

Figure 4. Browse repository

Wednesday, March 05, 2008

GS1 Check Digit Calculator

I wrote a check digit calculator, maybe somebody will need it.
public static class CheckDigitCalculator {

public static int CalculateCheckDigit(string input) {
int sum = CalculateSum(input);
int checkDigit = CalculateCheckDigit(sum);
return checkDigit;

private static int CalculateSum(string input) {
int factor = 3;
int sum = 0;
for (int i = input.Length; i > 0; i--) {
sum += Convert.ToInt32(input[i - 1].ToString())
* factor;
factor = 4 - factor;
return sum;

private static int CalculateCheckDigit(int sum) {
if (sum % 10 == 0) {
return 0;
} else {
int nearestEqualOrHigherMultipleOfTen =
(sum / 10) * 10 + 10;
return nearestEqualOrHigherMultipleOfTen - sum;

Note: The perfect one should check for the input string only contains numeric values.