<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sebastian Patten</title>
	<atom:link href="http://sebastianpatten.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebastianpatten.wordpress.com</link>
	<description>...an interesting chap</description>
	<lastBuildDate>Mon, 30 Jan 2012 14:27:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sebastianpatten.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sebastian Patten</title>
		<link>http://sebastianpatten.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sebastianpatten.wordpress.com/osd.xml" title="Sebastian Patten" />
	<atom:link rel='hub' href='http://sebastianpatten.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Node.js sharing JavaScript code between client and server</title>
		<link>http://sebastianpatten.wordpress.com/2011/12/13/node-sharing-javascript-code-between-client-and-server/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/12/13/node-sharing-javascript-code-between-client-and-server/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 00:39:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[NodeJs]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=627</guid>
		<description><![CDATA[I first looked at Node.js because it sounded like they had bridged the gap between client side (browser) and server side (Node.js). Code re-use is one of the core principles of developing software and for some reason it has taken us this long to get to a point where we can write one language that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=627&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I first looked at Node.js because it sounded like they had bridged the gap between client side (browser) and server side (Node.js). Code re-use is one of the core principles of developing software and for some reason it has taken us this long to get to a point where we can write one language that can be reused on both server and client side.</p>
<p>My initial impressions of Node.js bridging this gap weren&#8217;t great. Node.js does a good job of running stuff server side in JavaScript, but finding documentation on how to share code has been a slow process. The documentation on their website doesn&#8217;t mention sharing of code between client and server.</p>
<h1>Current state of affairs</h1>
<p>Node&#8217;s server side code exposes public methods/properties with a <a href="http://www.yuiblog.com/blog/2007/06/12/module-pattern/">module pattern</a></p>
<p>If you want to expose a public method called doCoolStuff in your Awesome.js file you might do this:</p>
<p><pre class="brush: jscript;">
exports.doCoolStuff = function() {

// Cool stuff done here...

};
</pre></p>
<p>However when we go to run Awesome.js on the client &#8211; it&#8217;s not going to know anything about what an exports is.</p>
<h1>Solution</h1>
<p>There are various ways around this such as checking whether exports exists, if it doesn&#8217;t define it etc&#8230; (<a href="http://caolanmcmahon.com/posts/writing_for_node_and_the_browser">read more here</a>)</p>
<p>My preferred solution is to use <a href="http://requirejs.org">Require.js</a> and <strong>kill many birds with one stone</strong>. From the web browser point of view, Require.js is really helpful in that it:</p>
<ul>
<li>Allows us to asynchronously load JavaScript resources</li>
<li>Allows you to get rid of script includes from your HTML</li>
<li>Negates the issue of having to order JavaScript files one after the other</li>
<li>Greatly improves on the ability to test our code by swapping out concrete implementations with mocks/dummys</li>
<li>Cleans up your code a lot</li>
<li>Better way of specifying modules</li>
</ul>
<p>Also we can use the same code on the client and server (Node.js).</p>
<h1>Setting up the Server Side (Node.js)</h1>
<p>I tried to install via NPM a la &#8211; npm install requirejs, however NPM couldn&#8217;t download and unpack the files for some reason. </p>
<p>To get around this I downloaded the r.js code for node directly from the <a href="http://requirejs.org/docs/download.html#rjs">Require website</a>, renamed to index.js and placed it in a folder called Requirejs in the node_modules folder. I renamed it to index.js as node will automatically look for a file called index.js in folders in node_modules. </p>
<h2>Server Side Code &#8211; Server.js</h2>
<p><pre class="brush: jscript;">
var requirejs = require('requirejs');

// Boiler plate stuff - as per r.js's instructions
requirejs.config({
    //Pass the top-level main.js/index.js require
    //function to requirejs so that node modules
    //are loaded relative to the top-level JS file.
    nodeRequire: require
});

// We are requiring Person, instantiating a new Person and then
// reading the name back

// As Person.js is a module, we dont need the .js at the end
requirejs([&quot;/Path/To/Person&quot;], function(Person) {
	var person1 = new Person(&quot;Seb&quot;);
	console.log(person1.getFirstName());
});
</pre></p>
<h2>Code that can live on client or server &#8211; Person.js</h2>
<p><pre class="brush: jscript;">
define(function() {
	return function(firstName) {
		var _firstName = firstName;
		
		this.getFirstName = function() {
			return _firstName;
		};
	}
});
</pre></p>
<h2>HTML Page</h2>
<p><pre class="brush: xml;">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;My Sample Project&lt;/title&gt;
        &lt;!-- data-main attribute tells require.js to load
             scripts/main.js after require.js loads. --&gt;
        &lt;script data-main=&quot;scripts/main&quot; src=&quot;scripts/require.js&quot;&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;h1&gt;My Sample Project&lt;/h1&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre></p>
<h2>JavaScript for the HTML Page &#8211; Main.js</h2>
<p><pre class="brush: jscript;">
// We are requiring Person, instantiating a new Person and then
// reading the name back

// As Person.js is a module, we dont need the .js at the end
require([&quot;/Path/To/Person&quot;], function(Person) {
	var person1 = new Person(&quot;Seb&quot;);
	console.log(person1.getFirstName());
});
</pre></p>
<h1>More Reading</h1>
<p>There are some rules around relative paths for your requires. It&#8217;s well worth spending the time and reading over them at <a href="http://requirejs.org/docs/api.html">the Require.js website</a>.</p>
<p><a href="http://requirejs.org/docs/whyamd.html">Require.js talking about what Asynchronous Module Definition is</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/627/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=627&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/12/13/node-sharing-javascript-code-between-client-and-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>
	</item>
		<item>
		<title>Tips For Writing Software And General Business Heuristics</title>
		<link>http://sebastianpatten.wordpress.com/2011/07/05/tips-for-writing-software-and-general-business-heuristics/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/07/05/tips-for-writing-software-and-general-business-heuristics/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 22:36:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=588</guid>
		<description><![CDATA[The most simple route is the best 99% of the time (this might not be the case with life-critical systems such as space shuttle ) Think about every possible detail before you write one line of code. Plan out all the method names, what they will interact with etc&#8230; Its far quicker and cheaper to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=588&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sebastianpatten.files.wordpress.com/2011/07/simple.jpg"><img src="http://sebastianpatten.files.wordpress.com/2011/07/simple.jpg?w=300&#038;h=268" alt="" title="simple" width="300" height="268" class="aligncenter size-medium wp-image-596" /></a></p>
<ul>
<li>The most simple route is the best 99% of the time (this might not be the case with life-critical systems such as space shuttle <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</li>
<li>Think about every possible detail before you write one line of code. Plan out all the method names, what they will interact with etc&#8230; Its far quicker and cheaper to go through many iterations in your head and on paper than it is to do it on a computer</li>
<li>If you use a technology &#8211; make sure you go and learn every facet and feature of it</li>
<li>When being tasked with something challenging that you don&#8217;t fully understand and need to get clarification on &#8211; question the Subject Matter Expert (or whoever knows the most about the task at hand) as much as you can early on &#8211; till you see the big picture. Personal experience has shown me that by asking a question here or there over a long period of time will aggravate people whereas if you ask the same number of questions in a short period of time, people don&#8217;t get wound up <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Never ask some one a question without asking yourself first. E.g. you should always have your best answer figured out before hand</li>
<li>If you do ask some one a question, don&#8217;t include any answers that you think it might be in your question. Compare their answer with yours. Good example: &#8220;What is the best way to create a widget?&#8221; Bad example: &#8220;Should I create a widget by using a wizard? Or should I download a pre-made widget?&#8221; The Good example leaves a question open ended. The person replying to your question might give you an answer you had not even thought about. You may even learn something new. The bad example pre-loads the question and narrows the scope of available answers.</li>
</ul>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/07/incandescent-light-bulb.png"><img src="http://sebastianpatten.files.wordpress.com/2011/07/incandescent-light-bulb.png?w=180&#038;h=300" alt="" title="incandescent-light-bulb" width="180" height="300" class="aligncenter size-medium wp-image-600" /></a></p>
<ul>
<li>If something feels too tough &#8211; its because you don&#8217;t know enough about it. Go away and read as much as you can about the subject.</li>
<li>If you have any small doubt when approaching a problem, you are likely taking the wrong approach. Tune into your gut feeling</li>
<li>If you see repeating code ignore it the first and second time you see it. Third time &#8211; refactor it and get rid of the repeating code</li>
<li>Don&#8217;t ever follow other people&#8217;s opinions. Read all about it then make up your own mind. This leads to confidence</li>
<li>Use version control systems to check in as often as possible to a branch. Its way quicker to revert back a few steps than to go and undo code manually</li>
<li>Use diff tools such as Beyond Compare to compare two files or two file systems. Don&#8217;t ever do it by eye</li>
<li>Be dependable. If some one asks you to do something. Make it your absolute goal to get it done for them</li>
<li>If you are seriously stuck on something, ask for a colleagues help. A lot of the time it can be something very trivial which you have overlooked</li>
<li>If you are stuck on a complex problem try thinking about it pretty hard just before bed. You will fall asleep and wake up with the problem solved</li>
<li>Teaching is the best way of learning. Write a blog or teach your colleagues something new</li>
<li>Do software projects that you find fun in your own time. Learn new technologies and processes all the time</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/588/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/588/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=588&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/07/05/tips-for-writing-software-and-general-business-heuristics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/07/simple.jpg?w=300" medium="image">
			<media:title type="html">simple</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/07/incandescent-light-bulb.png?w=180" medium="image">
			<media:title type="html">incandescent-light-bulb</media:title>
		</media:content>
	</item>
		<item>
		<title>Highlight the current line in Visual Studio 2010 with Resharper</title>
		<link>http://sebastianpatten.wordpress.com/2011/06/16/highlight-the-current-line-in-visual-studio-2010-with-resharper/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/06/16/highlight-the-current-line-in-visual-studio-2010-with-resharper/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 03:41:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=553</guid>
		<description><![CDATA[Highlighting your current line makes it loads easier to see where you are on the page. I first noticed that I liked the idea of line highlighting when I installed the Productivity Power Tools via NuGet. I ended up turning all the options off except for the highlighted line due to slow performance on my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=553&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Highlighting your current line makes it loads easier to see where you are on the page. I first noticed that I liked the idea of line highlighting when I installed the Productivity Power Tools via NuGet. I ended up turning all the options off except for the highlighted line due to slow performance on my machine. Then I realized that I could get the highlight using ReSharper with Visual Studio.</p>
<h2>Steps</h2>
<p>Step 1) Resharper &gt; Options &gt; Editor &gt; Check the Highlight current line checkbox<br />
Step 2) Tools &gt; Options &gt; Environment &gt; Fonts and Colors &gt; ReSharper Current Line Highlight. Choose the foreground and background colors you want to apply.</p>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/06/highlight.jpg"><img src="http://sebastianpatten.files.wordpress.com/2011/06/highlight.jpg?w=300&#038;h=190" alt="" title="Highlight" width="300" height="190" class="aligncenter size-medium wp-image-554" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/553/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/553/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/553/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=553&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/06/16/highlight-the-current-line-in-visual-studio-2010-with-resharper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/06/highlight.jpg?w=300" medium="image">
			<media:title type="html">Highlight</media:title>
		</media:content>
	</item>
		<item>
		<title>Building a Website Like a Boss (Part 1)</title>
		<link>http://sebastianpatten.wordpress.com/2011/06/10/building-a-website-like-a-boss/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/06/10/building-a-website-like-a-boss/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 22:57:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CQRS]]></category>
		<category><![CDATA[Event Sourcing]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[NServiceBus]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=501</guid>
		<description><![CDATA[Links to tutorial parts Building a Website Like a Boss Background This series of blog posts will cover how I am building my side-project web application. I am documenting it because I am using some technologies and methodologies that are really powerful when used together. And hey, it might be useful to someone . It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=501&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sebastianpatten.files.wordpress.com/2011/06/tumblr_krm7yqbtkf1qz97cwo1_500.png"><img src="http://sebastianpatten.files.wordpress.com/2011/06/tumblr_krm7yqbtkf1qz97cwo1_500.png?w=640" alt="" title="tumblr_krm7yqBTkF1qz97cwo1_500"   class="aligncenter size-full wp-image-525" /></a></p>
<h2>Links to tutorial parts</h2>
<ol>
<li><a href="/">Building a Website Like a Boss</a></li>
</ol>
<h2>Background</h2>
<p>This series of blog posts will cover how I am building my side-project web application. I am documenting it because I am using some technologies and methodologies that are really powerful when used together. And hey, it might be useful to someone <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .</p>
<p>It all started off with me learning ASP.NET MVC and then trying to apply Domain Driven Design (DDD) to it. I conceptually got the ideas talked about in DDD, but found it really troublesome applying the theory to a physical implementation. I spent a good deal of time playing around and researching how this could be achieved. I don&#8217;t think I was the only one struggling with this &#8211; I found <a href="http://blog.wekeroad.com/category/mvc-storefront">a really good series on MVC</a> by Rob Conery where he also struggled with trying to architect a perfect solution.</p>
<p>Soon after my fruitless attempts at creating a text book example of DDD in a web application, I was pointed to CQRS and Event Sourcing in a passing conversation with a colleague. From initially learning these two new words, I went away and did a lot of reading and learning. Learning these new technologies and processes made everything click together and I think that the architecture should really excite you for the following reasons:</p>
<h2>What The Architecture Offers</h2>
<ul>
<li>Any interactions with the system are persisted. This means you can replay the entire system to any point in time. Say the business people come to you with a hypothesis that website users are 95% likely to buy an item that they removed from their shopping cart within 5 minutes of placing their order. You can include this logic, replay all events and see whether it is true or not. Its Business intelligence on roids! Or if a client reports a weird bug that you cannot see, you can just replay the events and step into the code at any point in time!</li>
<li>Data is stored in the database as JSON, which means it can be handed straight to the UI. E.g. a jQuery AJAX call to a URL which MongoDB services the request and returns straight up JSON. No need for request -&gt; back end code -&gt; more back end code -&gt; goes through an asp.net repeater -&gt; rendered in html.</li>
<li>Data in the website is all de-normalized, which means there are no queries going on for requests <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Yes you read that right. Begone Get.all.stuff.where.blah.isnot(5).insersects(something).on(lame==true); (Disclaimer: That wasn&#8217;t code &#8211; but you get the idea).</li>
<li>Utilizes a NoSQL document database which is seriously fast</li>
<li>The system broadcasts all events, which gives you a true SOA foundational architecture</li>
<li>True data ignorance &#8211; start modelling the domain first, you can ignore what the data model looks like</li>
<li>Using <a href="http://en.wikipedia.org/wiki/Behavior_Driven_Development">BDD</a> you can communicate what the application will do in a format that any one can understand (this really helps with documentation too)</li>
<li>The domain objects will not have unnecessary CRUD methods/information in them. They will be purely used for modelling business logic. Nothing more.</li>
<li>I&#8217;ll never need to worry about transactions (in business logic)</li>
<li>The underlying Enterprise Service Bus means that no user intention is lost and everything is transactional</li>
<li>You implicitly get a full blown audit log from the previously mentioned fact</li>
<li>Fully Asynchronous &#8211; which means scalability and speed</li>
<li>Software becomes more scalable &#8211; Faster reads from data lead to a far more responsive website</li>
</ul>
<h2>Sneak Peak/How Do We Do This?</h2>
<p>In the upcoming posts I will be covering the following technologies and approaches (don&#8217;t worry if you are not familiar with some of them &#8211; all will become clear with time).</p>
<ul>
<li>ASP.NET MVC</li>
<li>Domain Driven Design &#8211; DDD</li>
<li>CQRS</li>
<li>MSMQ</li>
<li>NServiceBus</li>
<li>Event Sourcing</li>
<li>Behaviour Driven Development &#8211; BDD</li>
<li>MongoDB &amp; Fluent Mongo</li>
<li>JSON</li>
<li>Knockout.js</li>
<li>JavaScript and jQuery</li>
<li>Some form of caching</li>
</ul>
<h2>Personal Goals for the Web Application</h2>
<ul>
<li>Implementation of best practices</li>
<li>Implementation of some new technologies (might as well try out some of these new technologies that have been coming out)</li>
<li>Robust</li>
<li>Logging/Audits</li>
<li>Scalable</li>
<li>Testable</li>
<li>Localization</li>
<li>Secure</li>
<li>Promote synergy &#8211; Like a Boss</li>
<li>As cheap licencing costs as possible <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </li>
</ul>
<p>We&#8217;ll drill down into the details in the second post.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/501/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=501&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/06/10/building-a-website-like-a-boss/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/06/tumblr_krm7yqbtkf1qz97cwo1_500.png" medium="image">
			<media:title type="html">tumblr_krm7yqBTkF1qz97cwo1_500</media:title>
		</media:content>
	</item>
		<item>
		<title>How to revise for MCTS 70-515 Web Applications with .NET 4.0</title>
		<link>http://sebastianpatten.wordpress.com/2011/05/17/how-to-revise-for-mcts-70-515-web-applications-with-net-4-0/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/05/17/how-to-revise-for-mcts-70-515-web-applications-with-net-4-0/#comments</comments>
		<pubDate>Wed, 18 May 2011 02:48:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=490</guid>
		<description><![CDATA[Updated: I&#8217;ve re-uploaded my flash cards to WordPress. When you download the file, rename it to .anki (see the Anki application below). I wrote them for my personal use, so some might not make perfect sense, however I&#8217;m certain you will find them useful. To prepare for sitting my MCTS the first thing I did [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=490&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#EFD946;font-weight:bold;">Updated: <a href="http://sebastianpatten.files.wordpress.com/2011/06/mcts.doc">I&#8217;ve re-uploaded my flash cards to WordPress.</a> When you download the file, rename it to .anki (see the Anki application below).</span> I wrote them for my personal use, so some might not make perfect sense, however I&#8217;m certain you will find them useful.</p>
<p>To prepare for sitting my MCTS the first thing I did was to ask as many of my colleagues (who have all taken many certification exams) about their approach to passing. The feedback was unanimous in that practise tests are the key to passing. This would be the backbone to my studying. </p>
<p>I bought the <a href="http://www.amazon.com/gp/product/0735627401/ref=s9_simh_gw_p14_d2_i1?pf_rd_m=ATVPDKIKX0DER&amp;pf_rd_s=center-2&amp;pf_rd_r=03RRJFXTF4Y85ENDC2VM&amp;pf_rd_t=101&amp;pf_rd_p=470938631&amp;pf_rd_i=507846">70-515 Microsoft Self Paced training kit</a> as a starting point. I would recommend the book as it was concise and covered 95% of the information that you need to know. Buy the book and read it cover to cover a few times.</p>
<p>After I was about half way through the book I asked around again as to which practise test provider I should use. My feedback was that <a href="http://www.transcender.com/">Transcender</a> was good quality and as it happened at the time had a 40% off deal through Microsoft Partners. I bought the practise tests and got to work running over and over them to get up to close to 100% correct. What I like about the Transcender package is that it comes with Flash cards which make you dig a bit deeper into your knowledge.</p>
<p>The actual MCTS 70-515 test is multiple choice, however with flash cards, you will be given a question and no options. Therefore you have to think. This thinking really strengthens those neural pathways and solidifies your memory.</p>
<p>I started off the process taking detailed, hand written notes. I soon found that was slowing me down and that It was slow to go back on them. With the knowledge that writing stuff down further helps your memory retention, and knowing that Flash cards were beneficial I found <a href="http://ankisrs.net/">Anki</a> which is a free piece of software that allows you to create flash cards. Instead of writing hand written notes I converted to writing them into Anki. I wrote my notes as meaningful questions, so that I could replay the flashcards and test my knowledge. Anki also will shuffle the ones that you get constantly correct to the back of the pack and the ones you get wrong more frequently to the front. /Win</p>
<p>I soon found that the book plus the test exams were not enough to pass. Reading MSDN proved to be very helpful as well as various blog posts. In particular the following post is an awesome listing of a huge swathe of items that you could be tested upon. </p>
<p><a href="http://www.certsandprogs.com/2010/03/mcts-web-applications-net-4-70-515.html#axzz18fUuQT7Y">Part 1</a><br />
<a href="http://www.certsandprogs.com/2010/03/mcts-web-applications-net-4-70-515_22.html#axzz1MfTlC6kk">Part 2</a><br />
<a href="http://www.certsandprogs.com/2010/03/mcts-web-applications-net-4-70-515_5119.html#axzz1MfTlC6kk">Part 3</a><br />
<a href="http://www.certsandprogs.com/2010/03/mcts-web-applications-net-4-70-515_7210.html#axzz1MfTlC6kk">Part 4</a><br />
<a href="http://www.certsandprogs.com/2010/03/mcts-web-applications-net-4-70-515_23.html#axzz1MfTlC6kk">Part 5</a><br />
<a href="http://www.certsandprogs.com/2010/03/mcts-web-applications-net-4-70-515_1117.html#axzz1MfTlC6kk">Part 6</a></p>
<p>Make sure you do timed tests so that you have a feeling for how fast you should go. My test was 51 questions and I had 140 minutes to complete the test with the questionnaire and evaluation. It will take you around 10 mins to fill out the questionnaire and evaluation. Also worth noting, you can go forward and backward in the exam, whilst marking questions you want to come back to later. My approach was to go through all the ones I easily knew, marking down the ones I didn&#8217;t know or was unsure about. This meant I didn&#8217;t get anxious that I was spending too long on a hard question. I came back at the end to tackle all the odds and sods.</p>
<p>I found a decent approach to answering the multiple choice questions is that they usually give you 4 or 5 options. 2 of them will be blatantly wrong and the remaining possibilities will have subtle syntactical differences. </p>
<p>Each question in the exam is weighted differently and some of the questions aren&#8217;t even used in your score! The pass mark for the 70-515 was 700 out of 1000.</p>
<p>I hope this helps some one pass!<br />
Good luck!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/490/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=490&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/05/17/how-to-revise-for-mcts-70-515-web-applications-with-net-4-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>
	</item>
		<item>
		<title>Difference between ASP.NET Data Controls</title>
		<link>http://sebastianpatten.wordpress.com/2011/05/10/difference-between-asp-net-data-controls/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/05/10/difference-between-asp-net-data-controls/#comments</comments>
		<pubDate>Tue, 10 May 2011 16:35:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=443</guid>
		<description><![CDATA[Totally lame post, but I&#8217;m studying for my MCTS and thought this might help some one. Keep in mind the values in the matrices below are for out of the box ASP.NET &#8211; it doesn&#8217;t mean you can&#8217;t achieve certain functionality, by extending them. Single Item Display FormView Property Value Multiple Items No Templated Yes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=443&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Totally lame post, but I&#8217;m studying for my MCTS and thought this might help some one. Keep in mind the values in the matrices below are for out of the box ASP.NET &#8211; it doesn&#8217;t mean you can&#8217;t achieve certain functionality, by extending them. </p>
<h1>Single Item Display</h1>
<h2>FormView</h2>
<table>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>Multiple Items</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Templated</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Create</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Read</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Update</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Delete</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Sorting</td>
<td style="background-color:#F94545;">No. It is a single item view, so there is no need.</td>
</tr>
<tr>
<td>Pagination</td>
<td style="background-color:#74FAAC;">Yes, but it&#8217;s only one page at a time. Use the AllowPaging=&#8221;true&#8221; attribute to turn it on. Use the PagerSettings-Mode attribute to state the type (NextPrevious, NextPreviousFirstLast, Numeric, NumericFirstLast). Use the PagerSettings element within the FormView to specify paging options such as the text for the previous and next buttons.</td>
</tr>
</table>
<p>References:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms227992.aspx">http://msdn.microsoft.com/en-us/library/ms227992.aspx</a></p>
<h2>DetailsView</h2>
<table>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>Multiple Items</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Templated</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Create</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Read</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Update</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Delete</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Sorting</td>
<td style="background-color:#F94545;">No. It is a single item view, so there is no need.</td>
</tr>
<tr>
<td>Pagination</td>
<td style="background-color:#74FAAC;">Yes, but it&#8217;s only one page at a time. Use the AllowPaging=&#8221;true&#8221; attribute to turn it on. Use the PagerSettings-Mode attribute to state the type (NextPrevious, NextPreviousFirstLast, Numeric, NumericFirstLast). Use the PagerSettings element within the FormView to specify paging options such as the text for the previous and next buttons.</td>
</tr>
</table>
<p>References:<br />
<a href="http://msdn.microsoft.com/en-us/library/s3w1w7t4.aspx">http://msdn.microsoft.com/en-us/library/s3w1w7t4.aspx</a></p>
<h1>Multiple Item Display</h1>
<h2>Repeater</h2>
<table>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>Multiple Items</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Templated</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Create</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Read</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Update</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Delete</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Sorting</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Pagination</td>
<td style="background-color:#F94545;">No</td>
</tr>
</table>
<p>References:<br />
<a href="http://msdn.microsoft.com/en-us/library/x8f2zez5.aspx">http://msdn.microsoft.com/en-us/library/x8f2zez5.aspx</a></p>
<h2>ListView</h2>
<table>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>Multiple Items</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Templated</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Create</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Read</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Update</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Delete</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Sorting</td>
<td style="background-color:#74FAAC;">Yes. You add a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listview.layouttemplate.aspx">LayoutTemplate</a> and set the button&#8217;s command name to &#8220;Sort&#8221;. Set the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.ibuttoncontrol.commandargument.aspx">CommandArgument</a> to the direction that you want sorting.</td>
</tr>
<tr>
<td>Pagination</td>
<td style="background-color:#74FAAC;">Yes, use the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datapager.aspx">DataPager</a> control</td>
</tr>
</table>
<p>References:<br />
<a href="http://msdn.microsoft.com/en-us/library/bb398790.aspx">http://msdn.microsoft.com/en-us/library/bb398790.aspx</a></p>
<h2>DataList</h2>
<table>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>Multiple Items</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Templated</td>
<td style="background-color:#74FAAC;">Yes, but it does wrap the output in a table.</td>
</tr>
<tr>
<td>Create</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Read</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Update</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Delete</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Sorting</td>
<td style="background-color:#74FAAC;">Yes, but you have to take care of this manually in your code behind.</tr>
<tr>
<td>Pagination</td>
<td style="background-color:#74FAAC;">Yes, but you have to take care of this manually in your code behind.</td>
</tr>
</table>
<p>References:<br />
<a href="http://msdn.microsoft.com/en-us/library/es4e4e0e.aspx">http://msdn.microsoft.com/en-us/library/es4e4e0e.aspx</a></p>
<p>References:<br />
<a href="http://msdn.microsoft.com/en-us/library/bb398790.aspx">http://msdn.microsoft.com/en-us/library/bb398790.aspx</a></p>
<h2>GridView</h2>
<table>
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>Multiple Items</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Templated</td>
<td style="background-color:#F94545;">No</td>
</tr>
<tr>
<td>Create</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Read</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Update</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Delete</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
<tr>
<td>Sorting</td>
<td style="background-color:#74FAAC;">Yes</tr>
<tr>
<td>Pagination</td>
<td style="background-color:#74FAAC;">Yes</td>
</tr>
</table>
<p>References:<br />
<a href="http://msdn.microsoft.com/en-us/library/2s019wc0.aspx">http://msdn.microsoft.com/en-us/library/2s019wc0.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/443/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=443&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/05/10/difference-between-asp-net-data-controls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>
	</item>
		<item>
		<title>Netduino Transistor Switch</title>
		<link>http://sebastianpatten.wordpress.com/2011/02/23/netduino-transistor-switch/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/02/23/netduino-transistor-switch/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 16:20:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[NetDuino]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=416</guid>
		<description><![CDATA[A transistor switch allows you to use a smaller flow of electrons to control a much larger flow of electrons. In this case, we are using the Netduino&#8217;s 3.3V output to control turning on and off a 9v supply. It took me a while to figure out how this should be wired up, but after [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=416&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A transistor switch allows you to use a smaller flow of electrons to control a much larger flow of electrons. In this case, we are using the Netduino&#8217;s 3.3V output to control turning on and off a 9v supply.</p>
<p>It took me a while to figure out how this should be wired up, but after a lot of looking around I found some arduino examples. <a href="http://www.danielsoltis.com/notdatasheets/BC547.pdf">This one in particular was very helpful</a></p>
<p>My take away is that you should have your circuit set up like this. Effectively your transistor is blocking the current from going to ground until some input to the base is given from the Netduino.</p>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/02/transistor-switch-logical-entities.jpg"><img class="alignnone size-medium wp-image-418" title="Transistor Switch Logical Entities" src="http://sebastianpatten.files.wordpress.com/2011/02/transistor-switch-logical-entities.jpg?w=300&#038;h=259" alt="" width="300" height="259" /></a></p>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/02/transistor-switching.jpg"><img class="alignnone size-medium wp-image-417" title="Transistor Switching" src="http://sebastianpatten.files.wordpress.com/2011/02/transistor-switching.jpg?w=300&#038;h=163" alt="" width="300" height="163" /></a></p>
<p>Some notes on the switch: There is a formula for figuring out the value of the resistor going to base is, however it is outside the scope of this tutorial. I&#8217;ve just used 1k and it works fine. Also be sure to connect both the ground from your power, and the ground from your Netduino. For the longest time I didn&#8217;t have my Netduino grounded like in the images above and could not figure out why it was not working!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/416/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=416&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/02/23/netduino-transistor-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/02/transistor-switch-logical-entities.jpg?w=300" medium="image">
			<media:title type="html">Transistor Switch Logical Entities</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/02/transistor-switching.jpg?w=300" medium="image">
			<media:title type="html">Transistor Switching</media:title>
		</media:content>
	</item>
		<item>
		<title>Netduino Pull up and Pull down Resistor</title>
		<link>http://sebastianpatten.wordpress.com/2011/02/20/netduino-pull-up-and-pull-down-resistor/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/02/20/netduino-pull-up-and-pull-down-resistor/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 19:12:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[NetDuino]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=386</guid>
		<description><![CDATA[The idea of a pull up and pull down resistor initially confused me. After reading around the web a bit I found a description that helped me. Pull up and pull down resistors are used when you have something on your board that is not connected between the Vcc and ground (this is also known [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=386&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The idea of a pull up and pull down resistor initially confused me. After reading around the web a bit I found a description that helped me. Pull up and pull down resistors are used when you have something on your board that is not connected between the Vcc and ground (this is also known as an open circuit). Say for example when we wire up a motion sensor to our circuit, there will be a period of time when it is an open circuit or <a href="http://en.wikipedia.org/wiki/Open_collector">open collector</a>. Whilst something is not connected directly between Vcc and ground it is susceptible to external electrical noise &#8211; which means you might get random erratic readings. For this reason &#8211; we use the pull up or pull down resistor.</p>
<h1>Pull Up Resistor Example on the Netduino</h1>
<p>The pull up resistor will make the input read as high/Vcc and when triggered go low to 0/ground.</p>
<h3>Pull Up &#8211; Not Connected</h3>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/02/pull-up-resistor-floating1.jpg"><img class="alignnone size-medium wp-image-411" title="Pull Up Resistor Floating" src="http://sebastianpatten.files.wordpress.com/2011/02/pull-up-resistor-floating1.jpg?w=300&#038;h=177" alt="" width="300" height="177" /></a></p>
<p>Here we have the input port d0 being pulled up to Vcc by the 10k resistor. If we didn&#8217;t have the resistor you might get the event handler being randomly fired by electric fluctuations in the circuit.</p>
<h3>Pull Up &#8211; Connected</h3>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/02/pull-up-resistor-closed1.jpg"><img class="alignnone size-medium wp-image-412" title="Pull Up Resistor Closed" src="http://sebastianpatten.files.wordpress.com/2011/02/pull-up-resistor-closed1.jpg?w=300&#038;h=177" alt="" width="300" height="177" /></a></p>
<p>Now when we complete the circuit by connecting to ground, we will fire the event handler. Our pin was being held at Vcc (3.3v) and now will be pulled to ground (0v). So our second parameter in the event handler will read as a low of 0.</p>
<h3>Pull Up &#8211; Source Code</h3>
<p><pre class="brush: csharp;">
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

namespace _3_Digital_Input
{
    public class Program
    {
        public static void Main()
        {
            InterruptPort input = new InterruptPort(Pins.GPIO_PIN_D0, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
            input.OnInterrupt += new NativeEventHandler(input_OnInterrupt);

            Thread.Sleep(Timeout.Infinite);
        }

        static void input_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            string s = &quot;&quot;;
        }
    }
}
</pre></p>
<h1>Pull Down Resistor Example on the Netduino</h1>
<p>The pull down resistor will make the input read as 0. When it is triggered it will go high to Vcc (3.3v).</p>
<h3>Pull Down &#8211; Not Connected</h3>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/02/pull-down-resistor-floating.jpg"><img class="alignnone size-medium wp-image-394" title="Pull Down Resistor Floating" src="http://sebastianpatten.files.wordpress.com/2011/02/pull-down-resistor-floating.jpg?w=300&#038;h=177" alt="" width="300" height="177" /></a></p>
<p>Here we now are connected via the 10k ohm resistor to ground, bringing the pin to 0v.</p>
<h3>Pull Down &#8211; Connected</h3>
<p><a href="http://sebastianpatten.files.wordpress.com/2011/02/pull-down-resistor-closed.jpg"><img class="alignnone size-medium wp-image-397" title="Pull Down Resistor Closed" src="http://sebastianpatten.files.wordpress.com/2011/02/pull-down-resistor-closed.jpg?w=300&#038;h=177" alt="" width="300" height="177" /></a></p>
<p>When I complete the circuit the event handler fires. The pin was being held at 0v and now has been pulled high to 3.3v. If you breakpoint on the event handler and inspect the second parameter (data2) you should see the value come in as 1.</p>
<h3>Pull Down &#8211; Source Code</h3>
<p><pre class="brush: csharp;">
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

namespace _3_Digital_Input
{
    public class Program
    {
        public static void Main()
        {
            InterruptPort input = new InterruptPort(Pins.GPIO_PIN_D0, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);
            input.OnInterrupt += new NativeEventHandler(input_OnInterrupt);

            Thread.Sleep(Timeout.Infinite);
        }

        static void input_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            string s = &quot;&quot;;
        }
    }
}

</pre></p>
<p><span style="color:#ff0000;">Side note: The Netduino does also have an inbuilt Pull up resistor that you can turn on and off by the software. This is an enumeration that you can see as one of the parameters when creating the interrupt port. I didn&#8217;t include it on this example, as I wanted to show mirror symmetry between the pull up and pull down circuits. </span></p>
<p><span style="color:#ff0000;">The Netduino does not have an inbuilt Pull down resistor. So you will always have to wire it like the example above.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/386/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=386&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/02/20/netduino-pull-up-and-pull-down-resistor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/02/pull-up-resistor-floating1.jpg?w=300" medium="image">
			<media:title type="html">Pull Up Resistor Floating</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/02/pull-up-resistor-closed1.jpg?w=300" medium="image">
			<media:title type="html">Pull Up Resistor Closed</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/02/pull-down-resistor-floating.jpg?w=300" medium="image">
			<media:title type="html">Pull Down Resistor Floating</media:title>
		</media:content>

		<media:content url="http://sebastianpatten.files.wordpress.com/2011/02/pull-down-resistor-closed.jpg?w=300" medium="image">
			<media:title type="html">Pull Down Resistor Closed</media:title>
		</media:content>
	</item>
		<item>
		<title>Building a DIY Home Alarm Part 2 (Netduino Plus WebServer)</title>
		<link>http://sebastianpatten.wordpress.com/2011/02/18/building-a-diy-home-alarm-part-2-netduino-plus-webserver/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/02/18/building-a-diy-home-alarm-part-2-netduino-plus-webserver/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 16:01:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[NetDuino]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=368</guid>
		<description><![CDATA[For this second part in the series I wanted to prototype the network connectivity of the Netduino. Why? Because I want the alarm to message me some how if some one breaks in AND I want to be able to interact with it from my phone. Prototype Features Run a threaded web server, capable of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=368&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For this second part in the series I wanted to prototype the network connectivity of the Netduino. Why? Because I want the alarm to message me some how if some one breaks in AND I want to be able to interact with it from my phone.</p>
<h1>Prototype Features</h1>
<ul>
<li>Run a threaded web server, capable of returning 200 OK with the HTTP body of &#8220;Hello World&#8221;</li>
<li>Flash the onboard LED whenever the webserver services an inbound request</li>
<li>Trigger a sound (I&#8217;ll cover this sound in more detail later in my posts). I was using a transistor switch to trigger a 555 timer which makes a 3khz sound to the speaker</li>
</ul>
<h1>Approach</h1>
<p>I started off using any old network cable to connect to the Netduino. After some thought and discussion on the NetDuino chat I realized I <span style="color:#ff0000;">should be using a Crossover cable</span>. Luckily I had one to hand. (Good thing I hoard my electronics stuff <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). I made sure the network cable was connected before I turned the NetDuino on. I think I read somewhere that with certain versions of the flashed software, it can be troublesome connecting the network cable afterwards.</p>
<p>I discovered that the Netduino&#8217;s network configuration can be configured programatically or through the tool that comes with the microframework MFDeploy.exe (I found it in C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.1\Tools). Through a lot of experimentation I figured the easiest way of me connecting the pc and the netduino would be to manually assign ip addresses on the same subnet mask. My laptop was initially setup for DHCP assigned ip on the physical network connection and the netduino was pre-wired with an ip. I set the pc to be a manually assigned IP of 10.5.0.1 and the netduino to 10.5.0.2 and both on a subnet mask of 255.0.0.0.</p>
<p>Using <a href="http://www.fiddler2.com/fiddler2/">Fiddler</a> I sent HTTP Get Requests to the web server and received 200 OK messages back with the content &#8220;Hello World&#8221;.</p>
<h1>Demo</h1>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/tHoAhvLKs5o?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<h1>Source Code</h1>
<p>Note: I used the <a href="http://mftoolkit.codeplex.com/">.Net Micro Framework Networking Toolkit</a> to run the web server.<br />
PS: Make sure you use the assembles found in the folders prefixed with &#8220;Micro&#8221; as they are compiled for the micro framework.<br />
PPS: I used port 8080 as my machine is running IIS on port 80.</p>
<p><pre class="brush: csharp;">
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using MFToolkit.Net.Web;
using Microsoft.SPOT.Net.NetworkInformation;

namespace WebServer
{
    public class Program
    {
        public static void Main()
        {
            HttpServer httpServer = new HttpServer(8080, new MyHttpHandler());
            httpServer.Start();
        }
    }

    public class MyHttpHandler : IHttpHandler
    {
        private OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
        private OutputPort sound = new OutputPort(Pins.GPIO_PIN_D5, false);
        private bool playSound = false;

        public void ProcessRequest(HttpContext context)
        {
            led.Write(true);
            BuildHttpResponse(context.Response);
            led.Write(false);

            if (playSound == false)
            {
                playSound = true;
            }
            else
            {
                playSound = false;
            }

            sound.Write(playSound);
        }

        public void BuildHttpResponse(HttpResponse httpResponse)
        {
            httpResponse.HttpStatus = HttpStatusCode.OK;
            httpResponse.WriteLine(&quot;Hello World&quot;);
        }
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/368/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/368/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/368/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=368&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/02/18/building-a-diy-home-alarm-part-2-netduino-plus-webserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>
	</item>
		<item>
		<title>Building a DIY Home Alarm Part 1 (Learning electronics)</title>
		<link>http://sebastianpatten.wordpress.com/2011/02/15/building-a-diy-home-alarm-part-1-learning-electronics/</link>
		<comments>http://sebastianpatten.wordpress.com/2011/02/15/building-a-diy-home-alarm-part-1-learning-electronics/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 16:04:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[NetDuino]]></category>

		<guid isPermaLink="false">http://sebastianpatten.wordpress.com/?p=357</guid>
		<description><![CDATA[Background After listening to Scott Hanselman&#8217;s podcast on the NetDuino I was really interested in the idea of building my own hobby projects and learning electronics. I&#8217;ve got two projects that I want to build, both of them rather ambitious The first idea was to build a Snowbot (snow blowing robot) and the other idea [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=357&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Background</h1>
<p>After listening to Scott Hanselman&#8217;s podcast on the <a href="http://www.netduino.com/">NetDuino</a> I was really interested in the idea of building my own hobby projects and learning electronics. I&#8217;ve got two projects that I want to build, both of them rather ambitious <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>The first idea was to build a Snowbot (snow blowing robot) and the other idea was to build a home alarm system. I&#8217;m starting with the home alarm system as it in theory should be easier to build.</p>
<p>This is what I would ideally have in a home alarm system:</p>
<ul>
<li>Networked, so that I can arm/disarm and check the status over the web</li>
<li>Email alerts</li>
<li>Sensors on all the doors and windows</li>
<li>2x Motion sensors (main floor and basement)</li>
<li>Bloody loud alarm system</li>
</ul>
<h1>Starting Point</h1>
<p>So looking at the best places to start learning how to do all of this I decided it would be best to start learning electronics. The best resources I have found so far are:</p>
<ul>
<li><a href="http://www.allaboutcircuits.com">allaboutcircuits.com &#8211; an education website about electronics</a></li>
<li><a href="http://www.amazon.com/MAKE-Electronics-Learning-Through-Discovery/dp/0596153740/ref=sr_1_1?ie=UTF8&amp;qid=1297784959&amp;sr=8-1">MAKE: Electronics the book (totally awesome)</a></li>
<li>MAKE: Magazine videos on youtube are really well done and entertaining</li>
</ul>
<p>I tried using software to model circuits but found them really confusing. I tried <a href="http://focus.ti.com/docs/toolsw/folders/print/tina-ti.html">Tina-TI</a>, while it is really good for certain learning, I have found that actual hands on with components is easier to learn from.</p>
<p>I decided to buy some basic electronics components. Looking through the Make electronics book and searching on the web i found this product, <a href="http://www.makershed.com/ProductDetails.asp?ProductCode=MECP1">a starter electronics kit for the first few chapters of the MAKE: Electronics book</a>. I noted down what i thought were the key components and went to the local electronics shop and bought them for around $150 including digital multimeter.</p>
<p>The main components I bought were the multimeter, a $15 dollar pack of assorted resistors (definitely worth the money), various capacitors, some NPN transistors, breadboard and 9v supply, assorted LEDs and wires.</p>
<p>After reading up on DC theory at allaboutcircuits.com I started building some really simple circuits, with the home alarm system in mind.</p>
<p>I tried to visualize what components the alarm would need to have to make this alarm system. At its simplest it would need the following:</p>
<ul>
<li>Blinking LED</li>
<li>Siren</li>
<li>Circuit that would break when a window/door was opened</li>
<li>Some sort of keypad interface (ideally touchscreen)</li>
<li>Netduino as the microcontroller</li>
</ul>
<p>The next post in this series will cover the alarm&#8217;s blinking LED.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sebastianpatten.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sebastianpatten.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sebastianpatten.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sebastianpatten.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sebastianpatten.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sebastianpatten.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sebastianpatten.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sebastianpatten.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sebastianpatten.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sebastianpatten.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sebastianpatten.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sebastianpatten.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sebastianpatten.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sebastianpatten.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sebastianpatten.wordpress.com&amp;blog=7482386&amp;post=357&amp;subd=sebastianpatten&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sebastianpatten.wordpress.com/2011/02/15/building-a-diy-home-alarm-part-1-learning-electronics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5036ea99bacea034b63374f8d299f8bc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sebastianpatten</media:title>
		</media:content>
	</item>
	</channel>
</rss>
