<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Blog</title><link>http://www.dotnetdave.net:80/blog</link><description>Blog</description><item><title>Netduino LED control with the TLC5490</title><link>http://www.dotnetdave.net:80/blog/netduino-led-control-with-the-tlc5490</link><description>&lt;p&gt;This is the result of a couple of hours tinkering with my new netduino and an LED controller chip. Not very impressive yet but with a few tweaks and a lot of swear words I will be able to post a video of some flashing lights. &lt;/p&gt;

![enter image description here][1]

![enter image description here][2]


  [1]: /Media/Default/BlogPost/blog/netduino-led-control-with-the-tlc5490/wpid-2010-12-03-06.48.51.jpg
  [2]: /Media/Default/BlogPost/blog/netduino-led-control-with-the-tlc5490/wpid-2010-12-03_06.48.34.jpg</description><pubDate>Tue, 20 Dec 2011 00:47:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/netduino-led-control-with-the-tlc5490</guid></item><item><title>Jack Busts Some moves</title><link>http://www.dotnetdave.net:80/blog/jack-busts-some-moves</link><description>&lt;iframe width="576" height="323" src="http://www.youtube.com/embed/KgAgT-Cl92s?rel=0&amp;amp;hd=1" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;</description><pubDate>Mon, 19 Dec 2011 16:13:28 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/jack-busts-some-moves</guid></item><item><title>Fix the Missing webapplication.targets Error on a Build Server</title><link>http://www.dotnetdave.net:80/blog/fix-the-missing-webapplication-targets-error-on-a-build-server</link><description>&lt;h3&gt;The Issue&lt;/h3&gt;
I recently upgraded and converted my first solution to VS2010.On doing so I discovered that the continuous build was failing for this solution.  The error that I was receiving was that the webapplication.targets file for VS2010 could not be found. Oh oh!
&lt;blockquote&gt;
The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\ WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the &amp;lt;Import&amp;gt; declaration is correct, and that the file exists on disk.
&lt;/blockquote&gt;
 The targets file is essentially a build that file gives MSBuild the information it needs to kick off a web application build.

&lt;h3&gt;The Fixes&lt;/h3&gt;
There are two solutions to this issue both of which are not ideal.

The first is to install VS2010 in the build server this will put all the right files in all the right places and the build will 

The other is to just copy the v10.0\WebApplications\Microsoft.WebApplication.targets files from your machine where the v10.0\ WebApplications\Microsoft.WebApplication.targets are located to the directory reported in the error. The files will be located at &lt;strong&gt;&lt;em&gt;C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\ Microsoft.WebApplication.targets&lt;/em&gt;&lt;/strong&gt;

I went with the second option as the lesser of two evils, a simple fix that is easy to repeat. This fixed the issue and the build returned to being green. Happy lead developer.

Have you had this issue? Did you find a more long term fix. Leave a comment here to let me know.</description><pubDate>Fri, 09 Dec 2011 11:24:13 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/fix-the-missing-webapplication-targets-error-on-a-build-server</guid></item><item><title>LINQ and Joined Tables</title><link>http://www.dotnetdave.net:80/blog/linq-and-joined-tables</link><description>&lt;h4&gt;Introduction&lt;/h4&gt;
I have had an introduction into the world of LINQ today.  I have been aware of LINQ for some time but today was the first day that I have had to use it to do some real world queries.  I wanted to do a standard joined table selection. the SQL would have been somthing like:
&lt;pre name="code" class="SQL"&gt;
SELECT * FROM table1 INNER JOIN table2 ON table1.ID = table2.FKID WHERE table1.ID = @ID
&lt;/pre&gt;
&lt;h4&gt;LINQ&lt;/h4&gt;
The LINQ to Entities method of performing this join has proved hard to find but I found a &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/linqprojectgeneral/thread/6dd736a9-6ae5-4570-8ca6-6426d9a1f67f#"&gt;helpful post on a MSDN Forum&lt;/a&gt; that pointed me in the right direction.
&lt;pre name="code" class="C#"&gt;
Entities db = new Entities();
int Id = 4; //Hardcoded for example
var result = db.Entity1.Where(e =&gt; e.Entity2.Any(f =&gt; f.ID == Id));
&lt;/pre&gt;
The result of this joined query was the Entity1 rows where the joining table connected it to Entity2. Result

Hope this helps!</description><pubDate>Sun, 16 Oct 2011 21:27:03 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/linq-and-joined-tables</guid></item><item><title>dotnetdave.net is put to a use at last</title><link>http://www.dotnetdave.net:80/blog/dotnetdave.net-is-put-to-a-use-at-last</link><description>&lt;p&gt;Here we go then I have just started my career as a blogger. I will be blogging about web development and IT related topics from design patterns through to JQuery. I hope to gain an understanding of the world of blogging please be gentle with me as this is officially my first blog post ever. The kinds of posts that you can expect from me will be related to web development in some way. Tutorials on the tasks I get stuck with in my work that I just cant find an answer to anywhere, or links to interesting articles, information and anything that catches my wondering eye related to IT and web development.&lt;/p&gt;</description><pubDate>Sun, 02 Oct 2011 13:25:38 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/dotnetdave.net-is-put-to-a-use-at-last</guid></item><item><title>ASP.Net Interview Question Resource</title><link>http://www.dotnetdave.net:80/blog/asp.net-interview-question-resource</link><description>&lt;p&gt;During my career I have been on many interviews and now that I have taken the plunge and relocated to Toronto, Canada I have looked at my interview technique and seeing if I need to change my approach. I have found these ASP.Net related questions that are used in interviews. &lt;a href="http://www.hanselman.com/blog/ASPNETInterviewQuestions.aspx"&gt;Scott Hansleman's blog post&lt;/a&gt; highlights some questions that he has used. &lt;a href="http://geekswithblogs.net/mahesh/archive/2008/01/10/asp.net-2.0-interview-questions.aspx"&gt;Mahesh Singh&lt;/a&gt; has some 2.0 questions &lt;a href="http://www.geekinterview.com/interview-questions/microsoft/asp-net"&gt;Geek Interview&lt;/a&gt; offers a long lis t of interview questions. &lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=63"&gt;Dotnetcurry.com&lt;/a&gt; another list. I found these useful hope you do too.&lt;/p&gt;</description><pubDate>Sun, 02 Oct 2011 12:36:45 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/asp.net-interview-question-resource</guid></item><item><title>Google Translate API vs Resource Files</title><link>http://www.dotnetdave.net:80/blog/google-translate-api-vs-resource-files</link><description>&lt;p&gt;This is probably not a new idea but I was copy / pasting content into Google translate as a rough French resource file to test the localization that I was building. I thought I could use the translate API to do this for me. The result is this really quick file auto translator.&lt;/p&gt;
&lt;h2&gt;Translator class&lt;/h2&gt;
&lt;pre name="code" class="brush: csharp;"&gt;namespace TranslatorBot
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Google.API.Translate;

    public class Translator
    {
        public string TranslateEngToFr(string txt)
        {
            TranslateClient client = new TranslateClient("http://cfpc.ca");
            string translated = client.Translate(txt, Language.English, Language.French);
            Console.WriteLine(txt + " =&amp;gt; " + translated);
            return translated;
        }
    }
}
&lt;/pre&gt;
&lt;h2&gt;Main class&lt;/h2&gt;
&lt;pre name="code" class="brush: csharp;"&gt;namespace TranslatorBot
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Google.API.Translate;
    using System.Xml.Linq;
    using System.Xml;
    using System.Text.RegularExpressions;

    class Program
    {
        static void Main(string[] args)
        {           
            string path = "C:\\inetpub\\wwwroot\\cfpcDev\\App_GlobalResources\\";

            //load the doc to be trsanslated 
            XDocument doc = XDocument.Load(path + "Global.resx");

            //load the doc to be changed
            XDocument docTranslated = XDocument.Load(path + "Global.resx");

            //remove all the data elements
            docTranslated.Descendants("data").Remove();

            Translator bot = new Translator();
            var ListToTranslate = doc.Descendants("data");
            var root = doc.Element("root");
            var rootTrans = docTranslated.Element("root");
            XNamespace xsi = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance");
            // &lt;data name="txtDirectories" xml:space="preserve"&gt; // &lt;value&gt;Directories&lt;/value&gt; //&lt;/data&gt;
            foreach (var node in ListToTranslate)
            {
                if (node.Attribute("name").Value.StartsWith("img") || node.Attribute("name").Value.StartsWith("lnk") || node.Attribute("name").Value.ToLower().Contains(@"image"))
                {
                    node.Value = Regex.Replace(node.Value, @"\s", @"");
                    node.Value = node.Value.Replace(@"/en/", @"/fr/");
                    var datanode = new XElement("data");
                    datanode.Add(new XAttribute("name", node.Attribute("name").Value));
                    datanode.Add(new XAttribute(XNamespace.Xml + "space", "preserve"));
                    var valueNode = new XElement("value");
                    valueNode.Value = node.Value;
                    datanode.Add(valueNode);
                    rootTrans.Add(datanode);
                }
                else
                {
                    var datanode = new XElement("data");
                    datanode.Add(new XAttribute("name", node.Attribute("name").Value));
                    datanode.Add(new XAttribute(XNamespace.Xml + "space", "preserve"));
                    var valueNode = new XElement("value");
                    valueNode.Value = bot.TranslateEngToFr(node.Value);
                    valueNode.Value = Regex.Replace(valueNode.Value, @"\((\d{1,3})\)", @"{$1}");

                    datanode.Add(valueNode);
                    rootTrans.Add(datanode);
                }


            }
            docTranslated.Save(path + "Global.fr-CA.resx");
        }
    }
}
&lt;/pre&gt;
&lt;p&gt;I will tidy it up and add command line switches and use it in my Continuous Integration build in the future to localize my content.&lt;/p&gt;</description><pubDate>Fri, 30 Sep 2011 16:12:18 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/google-translate-api-vs-resource-files</guid></item><item><title>ASP.Net and the Elastic Compute Cloud example</title><link>http://www.dotnetdave.net:80/blog/asp.net-and-the-elastic-compute-cloud-example</link><description>For a project that  I am currently working on I have a requirement to use the Amazon Elastic Compute Cloud.  I have had some difficulty finding resources explaining how to interact with the cloud via ASP.Net.  I have tried two methods to get something basic up and running with success coming after a long night with the Red Bull.  The methods I have tried are:
&lt;ol&gt;
	&lt;li&gt;Web Resource&lt;/li&gt;
	&lt;li&gt;Third Party Libary&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
Web Resource
&lt;/h4&gt;
This option was the one that I thought I would get going in a few minutes and be creating servers in the cloud before you could say "describe instances".  However I was mistaken, I set up the web reference as I have done 100's of times than started to use the proxy in order to start a security group in the cloud. First problem!!!!  I could not find how to identify myself to EC2 I am sure you have to use the access keys somewhere or the security certificate.  After several hours of head scratching I moved on.

&lt;h4&gt;
Third Party Library
&lt;/h4&gt;
I found the &lt;a href="http://www.ds-76.com/tohy6c"&gt;C# wrapper for ASP.Net&lt;/a&gt; which proved to be much easier to set up and use.  Included the Amazon.EC2 project in my solution and wrote the code that created a security group and opened external ports.  Soo much easyer than trying to get to grips with the SOAP interface.

&lt;h4&gt;
Code
&lt;/h4&gt;
Whoops nearly forgot to include the code!!
&lt;pre name="code" class="c#"&gt;
AmazonEC2 ec2 = new AmazonEC2Client(awsKey, seceret);

//create a security group
CreateSecurityGroupRequest request = new CreateSecurityGroupRequest();
request.GroupName = groupName;
request.GroupDescription = "Group Created for user 1";

CreateSecurityGroupResponse secg = ec2.CreateSecurityGroup(request);
string reqid = secg.ResponseMetadata.RequestId;

AuthorizeSecurityGroupIngressRequest ingressrequest = new AuthorizeSecurityGroupIngressRequest();
ingressrequest.FromPort = Convert.ToDecimal(80);
ingressrequest.ToPort = Convert.ToDecimal(80);
ingressrequest.IpProtocol = "tcp";
ingressrequest.CidrIp = "0.0.0.0/0";
ingressrequest.GroupName = groupName;

AuthorizeSecurityGroupIngressResponse inreag = c2.AuthorizeSecurityGroupIngress(ingressrequest);

string inreqid = inreag.ResponseMetadata.RequestId;

ingressrequest = new AuthorizeSecurityGroupIngressRequest();
ingressrequest.FromPort = Convert.ToDecimal(3389);
ingressrequest.ToPort = Convert.ToDecimal(3389);
ingressrequest.IpProtocol = "tcp";
ingressrequest.CidrIp = "0.0.0.0/0";
ingressrequest.GroupName = groupName;
inreag = ec2.AuthorizeSecurityGroupIngress(ingressrequest);

inreqid = inreag.ResponseMetadata.RequestId;
&lt;/pre&gt;
&lt;h4&gt;
Conclusion
&lt;/h4&gt;
It has taken me hours of head scratching to get this far, due to the lack of decent examples for .Net developers, I feel that I am on the right track now I will keep you Informed of any more issues that I have in this interesting and frustrating journey.

 I hope this post helps someone to get started with EC2 quicker than I did and feel free to share this post via the social bookmark sights below.  Any constructive comments welcomed on this article content and structure.

[ad#postad] </description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/asp.net-and-the-elastic-compute-cloud-example</guid></item><item><title>ASP.Net MVC Resources</title><link>http://www.dotnetdave.net:80/blog/asp.net-mvc-resources</link><description>&lt;h4&gt;Introduction&lt;/h4&gt;
I have created a list of resources for those of you that want to learn about the ASP.Net MVC framework.  I have watched the Mix 09 videos and I will update this post once I have watched the other MVC related videos.

&lt;h4&gt;Mix 09 Videos&lt;/h4&gt;
&lt;a href="http://videos.visitmix.com/MIX09/T50F"&gt;ASP.NET MVC: America's Next Top Model View Controller Framework&lt;/a&gt;
&lt;a href="http://videos.visitmix.com/MIX09/T23F"&gt;Choosing between ASP.NET Web Forms and MVC&lt;/a&gt;
&lt;a href="http://videos.visitmix.com/MIX09/T44F"&gt;Microsoft ASP.NET Model View Controller (MVC): Ninja on Fire Black Belt Tips&lt;/a&gt;


&lt;h4&gt;Tutorials&lt;/h4&gt;
This is a interesting tutorial from &lt;a href="http://www.c-sharpcorner.com"&gt;c-sharpcorner.com&lt;/a&gt;
&lt;a href="http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/ControllerMVC04092009081709AM/ControllerMVC.aspx"&gt;Controller in ASP.Net MVC Framework&lt;/a&gt;
&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/03/10/free-asp-net-mvc-ebook-tutorial.aspx"&gt;Scott Gus MVC Nerd Dinner Tutorial Chapter&lt;/a&gt;
There are many helpful articles in David Hayden's site. On the left hand site.
&lt;a href="http://www.davidhayden.com/articles.aspx"&gt;David Hayden's article page.&lt;/a&gt;


&lt;h4&gt; Conclusion &lt;/h4&gt;
I will update this post with all interesting MVC related goodies that I come across.  Hope this helps</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/asp.net-mvc-resources</guid></item><item><title>10 reasons why well see a new iPhone this June</title><link>http://www.dotnetdave.net:80/blog/10-reasons-why-well-see-a-new-iphone-this-june</link><description>A quick and interesting one for all you iPhone lovers out there.
&lt;a href="http://www.techradar.com/news/phone-and-communications/mobile-phones/10-reasons-why-we-ll-see-an-iphone-this-june-591411"&gt;10 reasons why well see a new iPhone this June | News | TechRadar UK&lt;/a&gt;.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/10-reasons-why-well-see-a-new-iphone-this-june</guid></item><item><title>ASP.Net Background Queue with SmartThreadPool</title><link>http://www.dotnetdave.net:80/blog/asp.net-background-queue-with-smartthreadpool</link><description>&lt;h4&gt;Introduction&lt;/h4&gt;
While I was searching for a example of an C# Background Queue for asynchronous long running tasks in asp.net. I found this framework for managing a thread pool.  &lt;a href="http://www.codeproject.com/KB/threads/smartthreadpool.aspx"&gt;Smart thread pool&lt;/a&gt; is a project on the c# corner site. This seems to be what I am looking for in that I can send jobs to a queue and have a number of threads process them in the background and return the results once completed.
&lt;h4&gt;Smart Thread Pool&lt;/h4&gt;
Smart Thread Pool can set-up a queue of work items and process them in order until the queue is empty. The pool of threads can be set up to have a minimum and maximum number of workers and also these numbers can be changed once the pool is running. items can be added to the queue at any time and by creating a static wrapper class for the pool I can get all the sites users to add into a central queue.  The processing can then be defers to a set of classes that do the actual work.

I am using a ASP.Net MVC site to test the static class functionality where their is a button on a page which can be pressed to queue a work item.  This seems to be working as I have run the site in different browsers and can add to the shared queue from each browser.

I will post any updates once I have something more exciting to show.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/asp.net-background-queue-with-smartthreadpool</guid></item><item><title>Queueing with the Smart Thread Pool - Update</title><link>http://www.dotnetdave.net:80/blog/queueing-with-the-smart-thread-pool---update</link><description>[ad#postad]
&lt;h4&gt;Introduction&lt;/h4&gt;
After posting this on the Smart Thread Pool (STP) I have created a small example on its usage in an ASP.Net MVC project.  Using a wrapper class that implements the singleton pattern I now have a way to use the STP to share a queue across all of the sites users.  Ideal for submitting jobs to a set number of consumer processes for fast processing.
&lt;h4&gt;STP Usage&lt;/h4&gt;
Just a quick mention of the suggested usage for the STP.  This is what Ami Bar (STP creator) suggests.
&lt;blockquote&gt;The Smart Thread Pool is good when your work items don't do too much, but wait for events, IOs, sockets, etc. This means that the work items don't use CPU, but run for a long time. It is also good when you don't need to keep alive too many threads in the air all the time. If your work items do a short time work, then use the .NET ThreadPool. If you have a constant heavy load of work, then use Toub's thread pool and define the maximum number of threads accordingly.&lt;/blockquote&gt;
&lt;h4&gt;Wrapper Class&lt;/h4&gt;
This class gets instanced in the global.asax and then wheneaver it is needed it is called with a call to:
&lt;pre name="code" class="csharp"&gt; Singleton s = Singleton.Instance;&lt;/pre&gt;
The singleton pattern ensures that only one instance of the wrapper class exists and is shared at an application level.  Jobs are then added to the queue using the AddJob method, which returns the index in the handles property where the IWorkItResult is located.
&lt;pre name="code" class="c#"&gt; int job1Index = s.AddJob(inttime);&lt;/pre&gt;
Singleton Class
&lt;pre name="code" class="csharp"&gt;  public sealed class Singleton
    {
        static readonly Singleton instance = new Singleton();
        private static Queue Queues;
        private static SmartThreadPool pool;
        private static ArrayList handles;
        public ArrayList Handles
        {
            get { return handles; }
            set { handles = value; }
        }
        public int ActiveThreads
        {
            get { return pool.ActiveThreads; }
        }
        public int InUseThreads
        {
            get { return pool.InUseThreads; }
        }
        public int AddJob(object job)
        {
            IWorkItemResult wir = pool.QueueWorkItem(new WorkItemCallback(DoRealWork), job);
            handles.Add(wir);
            return handles.IndexOf(wir);
        }
        private object DoRealWork(object job)
        {
            object res = "Not Done";
            int time = (int)job;
            //do the work
            Thread.Sleep(time * 1000);
            res = "done";
            return res;
        }
        public static Singleton Instance
        {
            get
            {
                return instance;
            }
        }
        // Explicit static constructor to tell C# compiler
        // not to mark type as beforefieldinit
        static Singleton()
        {
            handles = new ArrayList();
            STPStartInfo sinfo = new STPStartInfo();
            sinfo.MaxWorkerThreads = 10;
            sinfo.MinWorkerThreads = 0;
            sinfo.UseCallerHttpContext = true;
            pool = new SmartThreadPool(sinfo);
        }
        Singleton()
        {
        }
    }&lt;/pre&gt;
&lt;h4&gt;Usage&lt;/h4&gt;
In this example the singleton takes in an &lt;code&gt;int&lt;/code&gt; as its input and the Singleton DoRealWork method halts the thread for that many seconds.  This is just to show the functionality of the threads being added.
&lt;pre name="code" class="csharp"&gt; [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult Index(string time)
        {
            Singleton s = Singleton.Instance;
            int inttime;
            ViewData["handles"] = s.Handles;
            if (!int.TryParse(time, out inttime))
                ViewData.ModelState.AddModelError("time", "Please enter a number!");
            if (ViewData.ModelState.IsValid)
            {
                int job1Index = s.AddJob(inttime);
                string message = "There are " + s.ActiveThreads + " active threads and " + s.InUseThreads + " in use threads";
                ViewData["Message"] = message;
            }
            if (Request.IsAjaxRequest())
            {
                return PartialView("QueueList");
            }
            else
            {
                return View();
            }
        }&lt;/pre&gt;
&lt;h4&gt;Conclution&lt;/h4&gt;
The STP in this example is shared to all users of the site and any user can add to the queue and see what the queue contains.  I hope to take this and implement it in a project that I am curently working on where the usese submit work to a system and this gets processed and the result returned.  More on that in future blog posts.

As always any comments on this article are welcomed and happy coding.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/queueing-with-the-smart-thread-pool---update</guid></item><item><title>Ninject - Dependancy Injection you dont want to fight with.</title><link>http://www.dotnetdave.net:80/blog/ninject---dependancy-injection-you-dont-want-to-fight-with</link><description>&lt;a href="http://ninject.org"&gt;&lt;img class="aligncenter" title="Ninject (DI Framework)" src="http://ds-76.com/images/ninject.png" alt="" width="605" height="200" /&gt;&lt;/a&gt;

&lt;a href="http://ninject.org"&gt;Ninject&lt;/a&gt; is a Depencancy Injection Container for asp.net, that provides the developer with the tools to decouple the architecture of an asp.net web application.  Decoupling is the process of reducing the dependancies between the components of a project.  Especaly when the component is used throughout the other components, like logging, utility and data access classes.

I will be using Ninject in the near future to allow mocking of a data access class in a new project.  This will allow me to use a common interface to create two data access classes one of which talks to the application database and the other that uses the Rhino Mocks framework coupled with Ninject to substitute a fake data access class into the application and run the unit tests against it.  This ensures that I am testing the code in my application rather than the connection to the database and the data. But what about testing the database I hear you cry.  I will be using another set of unit tests to test the real data access class which includes testing the connection and expected results from the database.

Back to Ninject.  I have had a look at the syntax and have looked at some of &lt;a href="http://davidhayden.com/blog/dave/archive/2008/06/20/NinjectDependencyInjectionASPNETWebPagesSample.aspx"&gt;David Hayden's posts&lt;/a&gt; on Ninject which all seam quite simple and easy to understand.  I will let you all know how it turns out.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/ninject---dependancy-injection-you-dont-want-to-fight-with</guid></item><item><title>Awesome Google Chrome advert</title><link>http://www.dotnetdave.net:80/blog/awesome-google-chrome-advert</link><description>&lt;div style="width:100%; text-align:center;"&gt;
&lt;object width="640" height="505"&gt;&lt;param name="movie" value="http://www.youtube.com/v/PqfwNbB0QqQ&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0xe1600f&amp;color2=0xfebd01"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/PqfwNbB0QqQ&amp;hl=en&amp;fs=1&amp;rel=0&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;/div&gt;
&lt;p&gt;
Just found this on Youtube I love it!! The ad is so slick and shows off features and has a obligatory singer / songwriter soundtrack.
&lt;/p&gt;
&lt;p&gt;
Nice legitimate usage for Incognito (Porn) mode. Buying a ring!!
&lt;/p&gt;</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/awesome-google-chrome-advert</guid></item><item><title>Getting Started</title><link>http://www.dotnetdave.net:80/blog/getting-started</link><description>Well here I go another attempt at marketing myself with an on-line presence.   My aim for this blog is to have a place to share anything that I find interesting, useful, fun or enjoyable.   I write code for my job and in my spare time so I will be posting lots of useful .Net, PHP and rails tit bits,  sharing my experiences with the world.  My first attempt at a blog was too focused on being informative so there will be lots of fun posts on various topics other than web development.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/getting-started</guid></item><item><title>Big Day For Rob</title><link>http://www.dotnetdave.net:80/blog/big-day-for-rob</link><description>I have a fun filled weekend ahead, today is my mate Robin's wedding day.  Good luck and all the best for the future Rob.  Tomorrow I have the christening of a friends's baby to go to.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/big-day-for-rob</guid></item><item><title>Teamcity &amp; NAnt - How to copy files to another server.</title><link>http://www.dotnetdave.net:80/blog/teamcity-nant---how-to-copy-files-to-another-server</link><description>So you have done your continuous integration, all the tests pass and the metrics all pass.  So the next task is to get your code onto a test server for the test team to examine with there fine toothed comb.  Getting the code from one server to another can be tricky.  So here is the solution that I found.

&lt;pre name="code" class="xml"&gt;
	&lt;property name="UNCsharepath" value="\\{{SERVERNAME HERE}}\{{PATH TO FOLDER}}" /&gt;
		&lt;property name="cmduse.output" value="${path::get-temp-file-name()}" /&gt;
	    &lt;property name="netdrive" value="" /&gt;

		&lt;exec program="cmd" commandline="/c net use * &amp;quot;${UNCsharepath}&amp;quot; new0rder /USER:{{SERVERNAME HERE}}\{{USERNAME HERE}}  " output="${cmduse.output}" verbose="false" /&gt;

		&lt;foreach item="Line" in="${cmduse.output}" property="cmduse.output.line"&gt;
			&lt;do&gt;
				&lt;echo message="Line : ${cmduse.output.line}"/&gt;
				&lt;regex pattern="Drive (?'netdrive'[A-Za-z]\:)" input="${cmduse.output.line}" failonerror="false" /&gt;
			&lt;/do&gt;
		&lt;/foreach&gt;

		&lt;echo message="netdrive: ${netdrive}" /&gt;

		&lt;!-- ${netdrive} is the shared drive path (eg Z:) --&gt;

	&lt;copy todir="${netdrive}" verbose="false"&gt;
			&lt;fileset basedir="{{CODE WORKING DIR HERE}}"&gt;
				&lt;include name="**/*" /&gt;
			&lt;/fileset&gt;
		&lt;/copy&gt;

		&lt;exec program="cmd" commandline="/c net use ${netdrive} /delete" /&gt;
&lt;/pre&gt;
This uses the net use command line to create a shared directory and pipe the response to a temporary file.  With some regular expression magic to extract the drive letter from the response into a property.  Then copy the code from the server using the NAnt copy task with the new mapped drive.  Finally user the net use command to remove the mapped drive.  Once and permissions issues are resolved then this works like a dream.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/teamcity-nant---how-to-copy-files-to-another-server</guid></item><item><title>How Tarantino Can Sort Out Your Database</title><link>http://www.dotnetdave.net:80/blog/how-tarantino-can-sort-out-your-database</link><description>&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;
One problem that I have met with Continuous Integration is that the code is really well looked after but if your project uses a database then there is really no common way to version your database.  Some choose to write custom tools to do the job of creating scripts to put into your version control software of choice and untill recently that is what I did as well.  Then I found the &lt;a href="http://code.google.com/p/tarantino/"&gt;Tarantino project&lt;/a&gt;.
&lt;/p&gt;
&lt;h3&gt;What is the Tarantino Project?&lt;/h3&gt;
&lt;p&gt;
Well Tarantino is a framework that allows the developer to script an existing database and have developers work on their own local copy of the database. The developers can then check-in their local changes to source control and the Continuous Integration process can migrate the changes to the build and the test server automatically.
&lt;/p&gt;

[ad#postad]

&lt;h3&gt;The Database Manager&lt;/h3&gt;
The Database Manager (DBM) allows the developers to sync their local database with the latest version.  After checking out the latest code the developer points the DBM at the database updated scripts folder and the DBM runs all the new scripts against the developers local database copy.  The DBM can create, update or drop and recreate a database in seconds.  All the changes are tracked in the source control and unwanted changes can be rolled back to any point.
&lt;a href="http://dotnetdave.net/wp-content/uploads/2010/04/tdbm.png"&gt;&lt;img src="http://dotnetdave.net/wp-content/uploads/2010/04/tdbm-300x165.png" alt="" title="Database Manager" width="300" height="165" class="aligncenter size-medium wp-image-232"&gt;&lt;/a&gt;

&lt;p&gt;
In the next post I will look at the Nant task that comes with Tarantino and how to integrate it in to your CI process.
&lt;/p&gt;</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/how-tarantino-can-sort-out-your-database</guid></item><item><title>Upgraded to Visual Studio 2010</title><link>http://www.dotnetdave.net:80/blog/upgraded-to-visual-studio-2010</link><description>I upgraded to VS2010 today. The install was painless enough but once I opened a 2008 project in VS2010 the expected fun began.  

Our build server immediately failed the newly converted solution as msbuild could not find the webapplication.targets file.  I fixed this and will outline how in &lt;a href="http://dotnetdave.net/2010/04/23/fix-the-missing-webapplication-targets-error-on-a-build-server/"&gt;this post&lt;/a&gt;.   Also there are some other issues with membership classes moving in to a new namespace. I will keep posting other issues as I get to them.

What issues have you had upgrading to VS2010? Add a comment on this post so I know what to expect in the next few days.</description><pubDate>Sat, 30 Jul 2011 05:24:57 GMT</pubDate><guid isPermaLink="true">http://www.dotnetdave.net:80/blog/upgraded-to-visual-studio-2010</guid></item></channel></rss>
