Tuesday, June 1, 2010

Manage a Project Overseas. Part II

[Code: 3AU6YJTYGE3Q G9B5PHTC5VUX ]
A while ago, I wrote about Redmine and VisualSVN Server, as the first recommendation for managing a software development project overseas.

What about the quality of the applications you develop? How do you control that any change in source code won't affect the rest of the application or cause another bug?

The answer is pretty simple, use the TDD technique and create tests for everything: your core framework, business layer objects, repositories, web services, etc...


To create these tests there are plenty of unit testing frameworks. @HexaSystems we prefer MBUnit or NUnit.

Tip: 
Teach your developers, not just how important is to actually create the tests, but to run them before any change is committed to the source version control system of your choice.

Hope it helps...

Wednesday, May 26, 2010

HexaSystems & HiringBox.

HexaSystems announces that is working with HiringBox, providing them with the technology needed for their business: A service designed to help people find a job, through free, easy to use, multi-language kiosks that offers, the unemployed, quick uncomplicated access to job opportunities, discount coupons, training and social service needs.

You can follow their progress @facebook. or their webpage: www.hiringbox.com

Thursday, May 20, 2010

Manage a Project Overseas

Some people ask me about how we manage software development projects overseas.

I first will tell you that a good version control, bug tracking and project management platform must be in place. We @HexaSystems recommend the following free tools:
  1. Source Control: VisualSVNServer
  2. Bug Tracking and Project Management: Redmine
Both systems work together and let you keep track of any changes in the projects code, milestones, versions, etc...

But remember you always need to improve your management skills therefore I recommend the following blog:
Project Shrink

Hope it helps!!!


Thursday, May 6, 2010

netDumbster another .Net Fake SMTP server based on Dumbster

Today I've released netDumbster (http://netdumbster.codeplex.com/)

netDumbster is a .Net Fake SMTP Server clone of the popular Dumbster (http://quintanasoft.com/dumbster/)

netDumbster is based on the API of nDumbster (http://ndumbster.sourceforge.net/default.html) and the nice C# Email Server (CSES) writen by Eric Daugherty.

Hope it helps!!!

NHibernate.Linq Issue when a query is executed having the same alias but with different associations paths

When running a query like the following:

var query = nhib.Arms.Where(a => a.LeftHand.Thumb.Length == 1 || a.RightHand.Thumb.Length == 1);

Thumb alias was always taken as part of the a.LeftHand association path, therefore leading to wrong results.

I've worked on patch and test to fix this issue, so Thumb alias is once part of the a.LeftHand association path and once as part of the a.RightHand association path.

You can find a patch file for this issue here: http://github.com/cmendible/nhibernate-contrib/downloads#download_31118

Or you can also download pruiz's already patched version of nhiberante-contribut project here: http://github.com/pruiz/nhibernate-contrib/commit/eada73cce086a6457e5e64b0413b97a8f53863ac

Hope it helps!!!

Tuesday, February 23, 2010

Running Apache behind an IIS server. .Net Solution

Yesterday I had the challenge to redirect - rewrite an url from my public IIS7 server to an internal Apache server. For instance a request to http://www.mysite.com/app handled by IIS should be redirected (using a reverse proxy) to  http://127.0.0.1:8080/app where the internal Apache is listening.

Trying to configure it with the new Application Request Routing (ARR) module from Microsoft was a disappointing task. Once installed, my server stopped serving pages, and I could not find a way to make it work.

So I started googling for another solution, finding out that most of the internet articles tell you that is almost impossible to do the work the way  I wanted, recommending to use Apache as your public server and then redirect - rewrite requests to an internal IIS server.

Finally I crossed my eyes over a page that talked about Managed Fusion URL Rewriter that was exactly what I was looking for: a simple, fast and easy to configure solution.

Managed Fusion URL Rewriter is a really small ASP.NET assembly based on Apache mod_rewrite which provides nice url rewrite and reverse proxy capabilities.

So to solve my issue I created an ASP.Net application to handle requests for http://www.mysite.com/app on my IIS server, following the examples provided with Managed Fusion URL Rewriter download,  and changing the provided ManagedFusion.Rewriter.txt configuration file to:

RewriteEngine On
#RewriteLog c:\log.txt 
#RewriteLogLevel 9

RewriteBase /app
RewriteRule ^(.*)$    http://127.0.0.1:8080/app$1 [QSA, P]


The configuration simply tells to the Managed Fusion URL Rewriter that any call to /app should be redirected to the internal Apache server.

Hope it helps!!!

Thursday, December 10, 2009

Rhino Mocks Method 'YYY' requires a return value or an exception to throw.

Yesterday I found myself stucked with a strange exception while programming a unit test using Rhino Mocks.

Supose you have an interface like the following one.

public interface ITest
{
    object Freak();
}

You can try a mock like the following:

var test = MockRepository.GenerateMock < ITest >();

test.Expect
(t => t.Freak()).IgnoreArguments()
  .WhenCalled(x => x.ReturnValue = "THIS IS A RETURN VALUE")
  .Repeat.Any();


Calling test.Freak(); will result in a return value of "THIS IS A RETURN VALUE"

Now change the interface to be:

public interface ITest
{
    string Freak();
}

Calling test.Freak(); results in the following exception: Method 'ITest.Freak();' requires a return value or an exception to throw.

The solution is easy, just change the Expexct call to look like this one:

test.Expect (t => t.Freak()).IgnoreArguments()
  .WhenCalled(x => x.ReturnValue = "THIS IS A RETURN VALUE")

  .Return(string.Empty) // THIS IS NEEDED SO RHINO MOCKS KNOWS THE TYPE RETURNED FROM THE METHOD CALL.
  .Repeat.Any();


The fake return value is ignored in favor of the given by the WhenCalled delegate!!!

Hope it helps.

Thursday, November 19, 2009

Officially now I´m part of xVal.WebForms developers team.

I've been working on xVal.WebForms for the last month, as a consecuence it´s Project Coordinator John Rummel has decided to add me as an official developer.

So now I´m on board. Thanks John.

xVal.WebForms Team.

Wednesday, October 28, 2009

xVal.WebForms, Validation Groups and CausesValidation Part II

A friend came with two issues concerning my recent post about xVal.webForms ValidationGroups and CausesValidation support.

1.- Supress Validation was being rendered as many times as ModelValidators where in the page.
2.- When more than one ModelValidator control was in place, xVal.AttachValidator script options could be incomplete, specifically the valgroups, cause the loop through page collections was done in the OnInit method of the controls before the page control tree was complete.

So I made the changes in a way that all the code called from ModelValidator´s render methods is now called in the page´s PreRenderComplete event to which the control subscribes in its OnInit stage.

This changes allows to render only one call to SupressValidation if needed, and ensures that all calls to xVal.AttachValidator method has the complete set of valgroups added.

The patch file can be downloaded here: http://xvalwebforms.codeplex.com/SourceControl/PatchList.aspx Patch ID: 4250

Monday, October 26, 2009

xVal.WebForms, Validation Groups and CausesValidation

In one of our recent projects we needed a behavior like the ASP.Net ValidationGroups and also be able to relay on the CausesValidation of all controls implementing IButtonControl interface control.

So the first issue I faced was that jquery-validate plugin version 1.5.1 (The one that xVal.WebForms uses) does not support grouping in an ASP.Net way. I found the solution to this first problem in this article: http://plugins.jquery.com/node/7044. I did some tests on worldspawn work and did not find any problem with the implementation.

The groups must be defined as in the following sample:
valgroups : {
test : { buttons : [ '<%= SaveButton.UniqueID %>' ], fields : [ '<%= Firstname.UniqueID %>', '<%= Surname.UniqueID %>' ] },
foo : { buttons : [ '<%= SaveButton2.UniqueID %>' ], fields : ['<%= Company.UniqueID %>', '<%= Postcode.UniqueID %>' ] }
}

So the next issue was making xVal know about this valgroups options and passing it as a parameter to the patched version of jquery-validate. For this I patched again file xVal.jquery.validate.js adding the following lines:

if (options.valgroups) {
validationOptions.valgroups = options.valgroups;
}

Then it was all about changing xVal.WebForms.ModelValidator control to render the needed javascript to suppress validation when controls have the CausesValidation == false, and render the groups options for xVal.

The complete patch can be found here: http://xvalwebforms.codeplex.com/SourceControl/PatchList.aspx ID: 4232

Enjoy.