<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sequence 7</title>
	<atom:link href="http://sequence7.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://sequence7.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 19 Nov 2011 15:34:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JavaScript Documentation</title>
		<link>http://sequence7.net/2010/09/27/javascript-documentation/</link>
		<comments>http://sequence7.net/2010/09/27/javascript-documentation/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 20:38:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=133</guid>
		<description><![CDATA[I use JavaScript on a pretty much daily basis so as I haven&#8217;t blogged about anything recently I thought I&#8217;d help promote the great (as in comprehensive) JavaScript docs that the Mozilla foundation provide. Right now this is being pushed via the http://promotejs.com domain which will hopefully make it more likely that anyone searching for [...]]]></description>
			<content:encoded><![CDATA[<p>I use JavaScript on a pretty much daily basis so as I haven&#8217;t blogged about anything recently I thought I&#8217;d help promote the great (as in comprehensive) JavaScript docs that the Mozilla foundation provide. Right now this is being pushed via the <a href="http://promotejs.com">http://promotejs.com</a> domain which will hopefully make it more likely that anyone searching for JS docs will find good quality, in depth docs easily.</p>
<p>The campaign aims to point people to the <a href="https://developer.mozilla.org/en/JavaScript">Mozilla Developer Centre for JavaScript</a> but I&#8217;d also always recommend <a href="http://www.crockford.com/javascript/">Douglas Crockford&#8217;s JavaScript</a>. JavaScript&#8217;s a much maligned and misunderstood languages so hopefully between the two you&#8217;ll appreciate some of it&#8217;s many benefits. Enjoy <img src='http://sequence7.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a title="JavaScript JS Documentation: JS Array every, JavaScript Array every, JS Array .every, JavaScript Array .every" href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array"><img src="http://static.jsconf.us/promotejshs.png" alt="JavaScript JS Documentation: JS Array every, JavaScript Array every, JS Array .every, JavaScript Array .every" width="180" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/09/27/javascript-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seven essential Visual Studio 2010 keyboard shortcuts</title>
		<link>http://sequence7.net/2010/08/15/seven-essential-visual-studio-2010-keyboard-shortcuts/</link>
		<comments>http://sequence7.net/2010/08/15/seven-essential-visual-studio-2010-keyboard-shortcuts/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 14:35:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VisualStudio]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=126</guid>
		<description><![CDATA[Microsoft recently released some reference posters for the default keybindings in Visual Studio 2010 in pdf format. I&#8217;m constantly amazed by how few of these most developers seem to know so I thought I&#8217;d list my favourites. I use C# but the majority should work in VB and all but Ctrl + Comma will work [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft recently released some <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=92CED922-D505-457A-8C9C-84036160639F&amp;displaylang=en">reference posters for the default keybindings in Visual Studio 2010</a> in pdf format. I&#8217;m constantly amazed by how few of these most developers seem to know so I thought I&#8217;d list my favourites. I use C# but the majority should work in VB and all but Ctrl + Comma will work in VS 2008.</p>
<h3>Ctrl + Full Stop (.)</h3>
<p>Displays the available options on the Smart Tag menu. This is by far my favourite, Smart Tags allow you to rename properties/methods/classes throughout your solution, add a required using statement or even create a new class/property/method.</p>
<h3>Ctrl + Comma</h3>
<p>Displays the NavigateTo window, which gives you search-as-you-type support for files, types and members. Scott Gu has a great <a href="http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx">blog post</a> on just how useful this is.</p>
<h3>F12/Shift F12</h3>
<p>F12 will go to the definition of the currently selected symbol. Shift F12 will find all references for the currently selected symbol.</p>
<h3>Ctrl + K, C/Ctrl + K, U</h3>
<p>Ctrl + K, C comments out all currently selected lines of text or the current line if no text is selected. Ctrl + K, U uncomments all currently selected lines of text or the current line if  no text is selected. This works in .js, .cs, .aspx, .config and .xml  files.</p>
<h3>Ctrl + K, D</h3>
<p>Formats the current document according to the indentation and code formatting settings specified on the Formatting pane under Tools | Options | Text Editor | C#. Instantly tidy up a poorly formatted code file!</p>
<h3>Ctrl + M, O</h3>
<p>Collapses all declarations down to an outline to give you a quick high-level overview of your code file.</p>
<h3>Ctrl + M, M</h3>
<p>Toggles the currently selected region, method, class or property between collapsed and expanded view.</p>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/08/15/seven-essential-visual-studio-2010-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Service Broker taking forever</title>
		<link>http://sequence7.net/2010/06/21/enable-service-broker-taking-forever/</link>
		<comments>http://sequence7.net/2010/06/21/enable-service-broker-taking-forever/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 21:13:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=109</guid>
		<description><![CDATA[Today I had to enable Service Broker in SQL 2008 because when using a SqlCacheDependency I was getting the error &#8220;The SQL Server Service Broker for the current database is not  enabled, and as a result query notifications are not supported.  Please  enable the Service Broker for this database if you wish to [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to enable Service Broker in SQL 2008 because when using a SqlCacheDependency I was getting the error &#8220;<strong>The SQL Server Service Broker for the current database is not  enabled, and as a result query notifications are not supported.  Please  enable the Service Broker for this database if you wish to use  notifications.&#8221;</strong></p>
<p>This should be pretty easy just using the following command:</p>
<pre class="brush: sql; title: ; notranslate">ALTER DATABASE 'DatabaseName' SET ENABLE_BROKER</pre>
<p>The problem I had was that it was taking forever for this to execute. The reason it turns out is that other processes were stopping the script from acquiring an exclusive lock. The solution is pretty simple, a script to kill all other processes (warning this will kill all processes if they&#8217;re important that could be a bad thing):</p>
<pre class="brush: sql; title: ; notranslate">
DECLARE @DatabaseName nvarchar(50)

SET @DatabaseName = N'DatabaseName' -- Specify the database we want to run the script against&lt;/p&gt;
DECLARE @SQL varchar(max)

-- Build a SQL script to kill all other processes
SELECT @SQL = COALESCE(@SQL,'') + 'Kill ' + Convert(varchar, SPId) + ';'
FROM MASTER..SysProcesses
WHERE DBId = DB_ID(@DatabaseName)
AND SPId &amp;lt;&amp;gt; @@SPId -- Make sure we don't kill our own process

SELECT @SQL  -- Write out the SQL so you can see what's happening
EXEC(@SQL) -- Kill all the other processes

-- Now we can enable the service broker instantly
ALTER DATABASE WBC_web SET ENABLE_BROKER</pre>
<p>And Service Broker&#8217;s enabled, time for tea.</p>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/06/21/enable-service-broker-taking-forever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some neat features of asp.net mvc 2</title>
		<link>http://sequence7.net/2010/05/07/some-neat-features-of-asp-net-mvc-2/</link>
		<comments>http://sequence7.net/2010/05/07/some-neat-features-of-asp-net-mvc-2/#comments</comments>
		<pubDate>Fri, 07 May 2010 12:05:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=60</guid>
		<description><![CDATA[I&#8217;ve been upgrading an application to MVC 2 recently and I&#8217;m really liking a lot of the new features, so here&#8217;s some of my favourites:
Model validation
Steve Sanderson&#8217;s xVal was great for adding client/server side validation to MVC 1 painlessly. Obviously someone at Microsoft liked it because now pretty much the exact same functionality is baked [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been upgrading an application to MVC 2 recently and I&#8217;m really liking a lot of the new features, so here&#8217;s some of my favourites:</p>
<h2>Model validation</h2>
<p>Steve Sanderson&#8217;s <a href="http://xval.codeplex.com/">xVal</a> was great for adding client/server side validation to MVC 1 painlessly. Obviously someone at Microsoft liked it because now pretty much the exact <a href="http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx">same functionality</a> is baked into MVC 2.</p>
<h2>RequireHttps action filter</h2>
<p>Want a single action or all actions of a controller to always use ssl? You used to have to code this up yourself but now you can just add the <a href="http://www.asp.net/learn/whitepapers/what-is-new-in-aspnet-mvc/#_TOC3_11">RequireHttps</a> attribute to your class or method and, if it isn&#8217;t already, it&#8217;ll automatically be redirected to use ssl. <a href="http://weblogs.asp.net/scottgu/archive/2010/01/10/asp-net-mvc-2-strongly-typed-html-helpers.aspx"></a></p>
<h2>Strongly typed Html Helpers</h2>
<p>I really dislike magic strings which meant that code like this:</p>
<pre class="brush: csharp; title: ; notranslate">
&lt;%= Html.TextBox(&quot;Name&quot;, Model.Name) %&gt;
</pre>
<p>always felt wrong inside a view. Now you can use the the <a href="http://weblogs.asp.net/scottgu/archive/2010/01/10/asp-net-mvc-2-strongly-typed-html-helpers.aspx">strongly typed helper methods</a> instead and do this:</p>
<pre class="brush: csharp; title: ; notranslate">&lt;%= Html.TextBoxFor(m =&gt; m.Name) %&gt;</pre>
<p>No magic string, so much nicer and obviously there are LabelFor, TextAreaFor etc. methods.</p>
<h2>Html.EditorFor() and Html.DisplayFor()</h2>
<p>Even better than strongly typed helpers is <a href="http://www.asp.net/learn/whitepapers/what-is-new-in-aspnet-mvc#_TOC3_1">editor/display templates</a> which lets you create your own views for editing and displaying different object types and then render them using the Html.EditorFor and Html.DisplayFor methods. It&#8217;s difficult to get across how awesome this is without writing a whole post about it, fortunately <a href="http://www.dalsoft.co.uk/blog/index.php/2010/04/26/mvc-2-templates/">someone&#8217;s already done that for me</a> and I can&#8217;t recommend it enough.</p>
<h2>Simpler Http verb attributes</h2>
<p>To specify that a controller action only accepted accepts a Post you used to have to use the following attribute:</p>
<pre class="brush: csharp; title: ; notranslate">
[[AcceptVerbs(HttpVerbs.Post)]]
public ActionResult Edit(int id)</pre>
<p>Now the attributes have been simplified so you can just do:</p>
<pre class="brush: csharp; title: ; notranslate">
[[HttpPost]]
public ActionResult Edit(int id)</pre>
<p>Not a massive change, but it&#8217;s so much tidier and easier to read.</p>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/05/07/some-neat-features-of-asp-net-mvc-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SubSonic 3.0.0.4 is out</title>
		<link>http://sequence7.net/2010/03/22/subsonic-3-0-0-4-is-out/</link>
		<comments>http://sequence7.net/2010/03/22/subsonic-3-0-0-4-is-out/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 14:34:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=56</guid>
		<description><![CDATA[I&#8217;ve been a big fan of SubSonic for a while now, as you can probably tell from my last post and I&#8217;ve been helping out with the project a lot more over the last few months. Yesterday all the hard work paid off and we&#8217;ve released version 3.0.0.4 to the world, see Rob&#8217;s blog for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a big fan of <a href="http://subsonicproject.com/">SubSonic</a> for a while now, as you can probably tell from my <a href="http://sequence7.net/2010/01/25/seven-reasons-you-should-try-subsonic/">last post</a> and I&#8217;ve been helping out with the project a lot more over the last few months. Yesterday all the hard work paid off and we&#8217;ve released version 3.0.0.4 to the world, see <a href="http://blog.wekeroad.com">Rob&#8217;s blog</a> for more details of what&#8217;s included. There&#8217;s a mass of bug fixes but there&#8217;s also some things I&#8217;ve been working on behind the scenes to reduce the friction for everyone involved in the project and make it easier for future releases to be more regular and high quality.</p>
<h2>Making testing less painful</h2>
<p>The SubSonic core is pretty well covered with tests but they were almost all integration tests. In fact to run them you needed to install and configure three databases (SQL2005, SQL2008 and MySQL) and the tests then took over 6 minutes to run. So last month I dived in and reworked a large chunk of them into unit tests. The unit tests run in 6 seconds now and cover about 35% of the SubSonic core, not perfect but it&#8217;s heading in the right direction and combined with a continuous integration server makes it a lot easier to work on the code quickly and safely.</p>
<h2>Continuous integration, like trust but with a blame button &#8230;</h2>
<p>I really like having a continuous integration server that builds and tests code automatically whenever a change is checked into source control. Fortunately for us the nice people at <a href="http://codebetter.com/blogs/james.kovacs/archive/2009/02/24/announcing-teamcity-codebetter-com.aspx">teamcity.codebetter.com</a> provide <a href="http://www.jetbrains.com/teamcity/">TeamCity</a> server hosting for open source projects and they&#8217;re now hosting SubSonic. Right now we&#8217;re only running our unit tests but the plan is to also have all our integration tests run on checkin too. If you want to keep an eye on the SubSonic builds and tests you can check the <a href="http://teamcity.codebetter.com/feed.html?buildTypeId=bt130&amp;itemsType=builds">rss feed</a>. Special thanks to <a href="http://codebetter.com/blogs/kyle.baley/default.aspx">Kyle Baley</a> who has been unswervingly patient and helpful getting everything set up.</p>
<h2>What&#8217;s coming in 3.1</h2>
<p>3.0.0.4 is a maintenance release, fixes a bunch of bugs and sets the project up for the future. So work&#8217;s now starting on version 3.1 which is planned for release on the 22nd of May and should include the following features:</p>
<ul>
<li>Oracle support</li>
<li>Medium Trust support</li>
<li>Automatic foreign keys for SimpleRepository</li>
<li>More/better/smarter attributes for SimpleRepository</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/03/22/subsonic-3-0-0-4-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seven reasons you should try SubSonic</title>
		<link>http://sequence7.net/2010/01/25/seven-reasons-you-should-try-subsonic/</link>
		<comments>http://sequence7.net/2010/01/25/seven-reasons-you-should-try-subsonic/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:50:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SubSonic]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=25</guid>
		<description><![CDATA[SubSonic is a query tool for .Net data access. If you haven&#8217;t tried it out then you really should and here&#8217;s why:
It&#8217;s simpler than, for example, nHibernate
Don&#8217;t get me wrong I like nHibernate a lot it&#8217;s amazingly powerful, flexible and mature. I&#8217;ve worked with it on many projects and admire it a great deal. But [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://subsonicproject.com/">SubSonic</a> is a query tool for .Net data access. If you haven&#8217;t tried it out then you really should and here&#8217;s why:</p>
<h3>It&#8217;s simpler than, for example, nHibernate</h3>
<p>Don&#8217;t get me wrong I like nHibernate a lot it&#8217;s amazingly powerful, flexible and mature. I&#8217;ve worked with it on many projects and admire it a great deal. But if you want to go from nothing to a working project with it you&#8217;re going to have to do some serious work and spend some time understanding the nHibernate way.</p>
<p>You can get started with SubSonic and have data access up and running in half an hour and that includes watching the <a href="http://subsonicproject.com/docs/The_5_Minute_Demo">getting started video</a>. In fact I can summarise that video in 7 steps:</p>
<ul>
<li>Download <a href="http://subsonicproject.com/Download">SubSonic</a></li>
<li>Add a reference to SubSonic.Core to your project</li>
<li>Add a connectionString to your project&#8217;s config file</li>
<li>Modify the Settings.ttinclude file to specify your Namespace, ConnectionStringName and DatabaseName</li>
<li>Add the tt and ttinclude files to your project, if they don&#8217;t run automatically click &#8216;Transform All Templates&#8217; button at the top of Solution Explorer</li>
<li>Start accessing your data from the generated classes</li>
<li>Grab a kabob (I have no idea what a kabob is), this step is optional but apparently Rob thinks they&#8217;re good.</li>
</ul>
<h3>LINQ</h3>
<p>Want to query your data using Linq and lambda expressions, no problem  you get that out of the box.</p>
<h3>You can target databases that aren&#8217;t SQL Server</h3>
<p>OK so you&#8217;re thinking what&#8217;s the point, I&#8217;ve got Linq2Sql if I want a simple  data access method. Well SubSonic works with MySQL, SQLite and there&#8217;s Oracle support almost ready to go.</p>
<h3>t4</h3>
<p>SubSonic is simple to get started but that doesn&#8217;t mean it&#8217;s inflexible, the classes that SubSonic creates for you are generated using t4. If you don&#8217;t like the way your classes are being generated by the standard templates you can dive in and start modifying them yourself. Grab a copy of <a href="http://www.visualt4.com/downloads.html">Clarius&#8217; T4 Generator Toolkit</a> to get syntax highlighting and other editor goodness within Visual Studio.</p>
<h3>Built in testing</h3>
<p>So you&#8217;re writing unit tests that need some data, but you don&#8217;t want to have to build a database dependency into your unit tests. SubSonic&#8217;s got that covered for you if you&#8217;re using the ActiveRecord templates you can simply specify a test database in your connection string.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;add name="MyDatabase"connectionString="Test" providerName="System.Data.SqlClient" /&gt;
</pre>
<p><span><span>You&#8217;ve now got an in memory database that you can populate with whatever you need in your test setup so you can do something like this:</span></span></p>
<pre class="brush: csharp; title: ; notranslate">
[Setup]
public void SetupTest()
{
Person.Setup(new Person { Name = "John Smith", Age="34" });
}

[Test]
public void TestIsOverThirty()
{
// Arrange
Person person = Person.FirstOrDefault(p =&gt; p.Name == "John Smith");

//Act
bool isOverThirty = PersonService.CheckIsOverThirty(person);

// Assert
Assert.Is.True(isOverThirty);
}</pre>
<p><span><span>No need to create a database, runs in memory and you can unit test your code painlessly, what&#8217;s not to like?<br />
</span></span></p>
<h3>SimpleRepository</h3>
<p>Don&#8217;t want to build your database first and then generate classes well you can go the other direction. SubSonic&#8217;s SimpleRepository allows you to build your classes and get them to automatically generate your database schema for you. If you just want to get on and build a really simple app this is a great way to go.</p>
<h3>It&#8217;s not dying and there&#8217;s a lot of help out there</h3>
<p>There&#8217;s a whole load of documentation on the SubSonic site covering everything from getting started to contributing to the project and including FAQs, quickstart videos, how to customise your templates and much much more. There&#8217;s also a community of folks answering questions on <a href="http://stackoverflow.com/questions/tagged/subsonic">stackoverflow.com</a> so if you get stuck you&#8217;ve got a quick way to get help and answers. Oh and <a href="http://stackoverflow.com/questions/2037051/is-subsonic-dying/2038373#2038373">SubSonic&#8217;s not dying</a>.</p>
<p>In conclusion I honestly think SubSonic&#8217;s an amazing tool to have available, I know there&#8217;s plenty of others out there but why not give it a try. If you&#8217;ve got questions about it feel free to comment or send them straight to <a href="http://stackoverflow.com/questions/tagged/subsonic">stackoverflow</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/01/25/seven-reasons-you-should-try-subsonic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Google map to a webpage in less than seven easy steps</title>
		<link>http://sequence7.net/2010/01/17/add-a-google-map-to-your-website/</link>
		<comments>http://sequence7.net/2010/01/17/add-a-google-map-to-your-website/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 19:10:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=31</guid>
		<description><![CDATA[As you may already know the latest version of the Google maps API no longer requires an API key so I thought I&#8217;d see how easy it is to add quick map to a website. The answer turns out to be, very very easy.
Add a reference to the API
So the first thing we need to [...]]]></description>
			<content:encoded><![CDATA[<p>As you may already know the latest version of the <a href="http://code.google.com/apis/maps/">Google maps API</a> no longer requires an API key so I thought I&#8217;d see how easy it is to add quick map to a website. The answer turns out to be, very very easy.</p>
<h3>Add a reference to the API</h3>
<p>So the first thing we need to do is reference the API. This is as easy as adding one javascript include:</p>
<pre class="brush: xml; title: ; notranslate">&lt;script type=&quot;text/javascript&quot; src=&quot;http://maps.google.com/maps/api/js?sensor=false&amp;region=GB&quot;&gt;&lt;/script&gt;</pre>
<p>There&#8217;s two querystring parameters I&#8217;m specifying:</p>
<ul>
<li>sensor=false &#8211; This tells google that I don&#8217;t have  a gps sensor that will be passing coordinates.</li>
<li>region=GB &#8211; This restricts the region that I want to display a map for and means that when I&#8217;m looking up an address it will be constrained to only this region (Great Britain).</li>
</ul>
<h3>Add some html elements</h3>
<p>The body of this page is going to be very simple. We&#8217;re just going to show a textbox where you can enter a postcode, a button that you click to show the map for that postcode and the map itself.</p>
<pre class="brush: xml; title: ; notranslate">&lt;body style=&quot;margin:0px; padding:0px;&quot; onload=&quot;initialize()&quot;&gt;
 &lt;div&gt;
 &lt;input id=&quot;address&quot; type=&quot;textbox&quot; value=&quot;L1171AP&quot;&gt;
 &lt;input type=&quot;button&quot; value=&quot;Show map&quot; onclick=&quot;showMap()&quot;&gt;
 &lt;/div&gt;
 &lt;div id=&quot;mapCanvas&quot; style=&quot;width:300px; height:300px&quot;&gt;&lt;/div&gt;
&lt;/body&gt;</pre>
<h3>Initialise the map</h3>
<p>To show our map we will need a Map object and a Geocoder object. We&#8217;re going to use the geocoder to get the geolocation of our postcode by first creating a new Geocoder instance. Next we specify a few options, a zoom level that specifies how far our map will be zoomed and a mapTypedId which will make our map be shown as a roadmap. Then we create a new Map object passing in the element which will contain the map and the options we&#8217;ve specified. We call this function in the onload event of the page and we&#8217;ve got a google map, but it&#8217;s not showing anything just yet.</p>
<pre class="brush: jscript; title: ; notranslate">var geocoder;
 var map;
 function initialize() {
 geocoder = new google.maps.Geocoder();
 var options = {
 zoom: 13,
 mapTypeId: google.maps.MapTypeId.ROADMAP
 }
 map = new google.maps.Map(document.getElementById(&quot;mapCanvas&quot;), options);
 }</pre>
<h3>Show the map</h3>
<p>So now all we need to do is show the map for our postcode. We call the geocode function of out geocoder passing in the value of our address text box and a function that will center our map on our postcode and add a marker to it.</p>
<pre class="brush: jscript; title: ; notranslate">function showMap() {
 var address = document.getElementById(&quot;address&quot;).value;
 geocoder.geocode( { 'address': address}, function(results, status) {
 if (status == google.maps.GeocoderStatus.OK) {
 map.setCenter(results[0].geometry.location);
 var marker = new google.maps.Marker({
 map: map,
 position: results[0].geometry.location
 });
 } else {
 alert(&quot;Geocode was not successful for the following reason: &quot; + status);
 }
 });
 }</pre>
<h3>That&#8217;s it</h3>
<p>This was meant to be a seven step tutorial but Google have made working with their API so simple that there&#8217;s nothing else to do. The full code is below:</p>
<pre class="brush: xml; title: ; notranslate">&lt;html&gt;
&lt;head&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, user-scalable=no&quot;/&gt;
&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot;/&gt;
&lt;title&gt;Google Maps JavaScript API v3 Example: Geocoding Simple&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://maps.google.com/maps/api/js?sensor=false&amp;region=GB&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
 var geocoder;
 var map;
 function initialize() {
 geocoder = new google.maps.Geocoder();
 var myOptions = {
 zoom: 13,
 mapTypeId: google.maps.MapTypeId.ROADMAP
 }
 map = new google.maps.Map(document.getElementById(&quot;mapCanvas&quot;), myOptions);
 }

 function showMap() {
 var address = document.getElementById(&quot;address&quot;).value;
 geocoder.geocode({ 'address': address }, function(results, status) {
 if (status == google.maps.GeocoderStatus.OK) {
 map.setCenter(results[0].geometry.location);
 var marker = new google.maps.Marker({
 map: map,
 position: results[0].geometry.location
 });
 } else {
 alert(&quot;Geocode was not successful for the following reason: &quot; + status);
 }
 });
 }
&lt;/script&gt;
&lt;/head&gt;
&lt;body style=&quot;margin:0px; padding:0px;&quot; onload=&quot;initialize()&quot;&gt;
 &lt;div&gt;
 &lt;input id=&quot;address&quot; type=&quot;textbox&quot; value=&quot;L171AP&quot;&gt;
 &lt;input type=&quot;button&quot; value=&quot;Show map&quot; onclick=&quot;showMap()&quot;&gt;
 &lt;/div&gt;
 &lt;div id=&quot;mapCanvas&quot; style=&quot;width:300px; height:300px&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>I based all of this on one of the great samples at the <a href="http://code.google.com/apis/maps/documentation/v3/services.html#Geocoding">Google API geocoding docs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/01/17/add-a-google-map-to-your-website/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>My seven favourite, free, Visual Studio plugins</title>
		<link>http://sequence7.net/2010/01/09/my-seven-favourite-free-visual-studio-plugins/</link>
		<comments>http://sequence7.net/2010/01/09/my-seven-favourite-free-visual-studio-plugins/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 23:58:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://sequence7.net/?p=7</guid>
		<description><![CDATA[My favourite free Visual Studio plugins]]></description>
			<content:encoded><![CDATA[<h3>GhostDoc</h3>
<p>This great little plugin, written by <a href="http://roland-weigelt.de/">Roland Weigelt</a>, will automatically generate XML comments for your classes and methods. If you follow the Microsoft coding conventions then it gives great results and I actually find that it&#8217;s a great second opinion on the name of your class or method. Generally if GhostDoc understands the name then it will make sense to another developer, or yourself next time you look at it.</p>
<p><a href="http://submain.com/products/ghostdoc.aspx">download</a></p>
<h3>Regionerate</h3>
<p>Automagically organise your code alphabetically and into logical regions. Regionerate even lets you define your own custom layouts if you want a specific house style. I love this because it enables consistent layouts when working in a team so any developer can quickly and easily get an overview of a class&#8217;s layout.</p>
<p><a href="http://www.rauchy.net/regionerate/">download</a></p>
<h3>Clarius Visual T4</h3>
<p>The Text <a href="http://msdn.microsoft.com/en-us/library/bb126445.aspx">Templating Transformation Toolkit</a> or t4 for short is a code generator built into Visual Studio. However using it is a bit of a dark art because there&#8217;s no tooling in VS to help you work with it. Fortunately the nice people at Clarius have a plugin that provides syntax highlighting and other goodness for t4 files. There&#8217;s a paid version with more features but the free one is great if you want to get started working with/understanding t4.</p>
<p><a href="http://www.visualt4.com/downloads.html">download</a></p>
<h3>CodeRush XPress for C#</h3>
<p>Microsoft and Developer Express have got together to release a free version of the CodeRush plugin which provides  a huge number of refactoring, navigation and declaration features. I know a lot of developers find that Visual Studio is limited in these features and compared to IDEs like Eclipse I&#8217;d have to agree. You get all the following:</p>
<h4>Editor Features</h4>
<ul>
<li>Duplicate Line</li>
<li>Highlight Usages</li>
<li>Clipboard  Features
<ul>
<li>Smart Cut/Copy</li>
<li>Paste Replace</li>
</ul>
</li>
<li>Enhanced  Selection Abilities
<ul>
<li>Extend/reduce selection</li>
<li>Camel-case  selection</li>
</ul>
</li>
</ul>
<h4>Navigation Features</h4>
<ul>
<li>Camel-case  Navigation</li>
<li>Tab to Next Reference</li>
<li>Go to File</li>
<li>Go  to Symbol (QuickNav)</li>
</ul>
<h4>TDD &#8211; Declaration from Usage</h4>
<ul>
<li>Types
<ul>
<li>Declare  Class</li>
<li>Declare Delegate</li>
<li>Declare Enum</li>
<li>Declare  Enum Element</li>
<li>Declare Interface</li>
<li>Declare Struct</li>
</ul>
</li>
<li>Members
<ul>
<li>Declare  Constructor</li>
<li>Declare Event Handler</li>
<li>Declare Getter</li>
<li>Declare  Method</li>
<li>Declare Property</li>
<li>Declare Property  (auto-implemented)</li>
<li>Declare Property (with backing field)</li>
<li>Declare  Setter</li>
</ul>
</li>
<li>Variables
<ul>
<li>Declare Field</li>
<li>Declare  Local</li>
<li>Declare Local (implicit)</li>
</ul>
</li>
</ul>
<h4>Refactorings</h4>
<ul>
<li>Add/Remove  Block Delimiters</li>
<li>Combine Conditionals (merge nested &#8220;If&#8221;  statements)</li>
<li>Compress to Lambda Expression</li>
<li>Compress to  Ternary Expression</li>
<li>Convert to Auto-implemented Property</li>
<li>Convert  to Initializer (use object/collection initialize when possible)</li>
<li>Create  Backing Store (converts Auto-implemented Property to standard Property  with get and set)</li>
<li>Decompose Initializer</li>
<li>Decompose  Parameter</li>
<li>Expand Lambda Expression</li>
<li>Expand Ternary  Expression</li>
<li>Extract Method to Type</li>
<li>Flatten Conditional</li>
<li>Introduce  Local (introduce variable)</li>
<li>Inline Delegate</li>
<li>Inline Temp  (inline variable)</li>
<li>Make Explicit</li>
<li>Make Implicit</li>
<li>Move  Type to File</li>
<li>Name Anonymous Method</li>
<li>Name Anonymous Type</li>
<li>Reverse  Conditional (invert &#8220;if&#8221;)</li>
<li>Split Conditional (split complex &#8220;If&#8221;  statements)</li>
<li>Use StringBuilder</li>
<li>Use String.Format</li>
</ul>
<p>Check out the download link for more details.</p>
<p><a href="http://msdn.microsoft.com/en-us/vcsharp/dd218053.aspx">download</a></p>
<h3>PowerCommands for Visual Studio</h3>
<p>Another free plug-in from Microsoft but this one exposes a load of existing functionality as  menu items and automates some other pre-existing functionality. My personal favourites:</p>
<ul>
<li><strong>Open Command Prompt</strong><br />
Opens a Visual  Studio command prompt pointing to the physical path of a selected item.</li>
<li><strong>Open Containing Folder</strong><br />
Opens a  Windows Explorer window pointing to the physical path of a selected item.</li>
<li><strong>Remove and Sort Usings</strong><br />
Removes and sort  using statements for all classes given a project.</li>
</ul>
<p>Check the download link for more details.</p>
<p><a href="http://visualstudiogallery.msdn.microsoft.com/en-us/df3f0c30-3d37-4e06-9ef8-3bff3508be31">download</a></p>
<p>One issue I&#8217;ve noticed with this plug-in is that the <a href="http://code.msdn.microsoft.com/PowerCommands/WorkItem/View.aspx?WorkItemId=15">Undo  Close window keeps opening</a>. If you&#8217;re having that problem you can  edit the registry as follows to fix this (warning registry edits may do  bad things if they go wrong, backup first):</p>
<p><span id="ctl00_ctl00_Content_TabContentPanel_Content_CommentsRepeater_ctl08_MessageLabel" style="display: inline-block; width: 99%;">Go to   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\ToolWindows\{eccc9e97-fd3b-4c15-af76-ef71a71d8b17}   and delete the Visibility subkey.</span></p>
<h3>DocProject for Sandcastle</h3>
<p>If you&#8217;ve got loads of good comments in your code why not build some docs using them. You&#8217;ll need <a href="http://www.codeplex.com/Sandcastle">Sandcastle</a> but once you have it and this plugin you&#8217;ll be able to automate building comments based on a number of templates directly from within Visual Studio.</p>
<p><a href="http://www.codeplex.com/DocProject">download</a></p>
<h3>TestDriven.net</h3>
<p>This last one is only free for open source, student and trial users but I still think it&#8217;s worth mentioning. Basically it allows you to work with the following all from inside Visual Studio, great for working smarter directly from inside your IDE.</p>
<ul>
<li><a href="http://www.nunit.org/" target="_blank">NUnit</a></li>
<li><a href="http://www.mbunit.com/" target="_blank">MbUnit</a></li>
<li><a href="http://www.adapdev.com/zanebug/" target="_blank">ZaneBug</a></li>
<li><a href="http://msdn.microsoft.com/vstudio/teamsystem/" target="_blank">MSTest</a></li>
<li><a href="http://www.ncover.org/" target="_blank">NCover</a></li>
<li><a href="http://www.ncoverexplorer.org/" target="_blank">NCoverExplorer</a></li>
<li><a href="http://www.aisto.com/roeder/dotnet/" target="_blank">Reflector</a></li>
<li><a href="http://www.typemock.com/" target="_blank">TypeMock</a></li>
<li><a href="http://www.jetbrains.com/profiler/" target="_blank">dotTrace</a></li>
<li><a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=MSBee" target="_blank">MSBee</a></li>
</ul>
<p>Check the download link for more details.</p>
<p><a href="http://www.testdriven.net/">download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sequence7.net/2010/01/09/my-seven-favourite-free-visual-studio-plugins/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

