<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.devhammer.net/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Devhammer Blog</title><link>http://devhammer.net:80/blog</link><description>Devhammer Blog</description><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.devhammer.net/devhammer" /><feedburner:info uri="devhammer" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Dave Ward's Advice to Programmers</title><link>http://feeds.devhammer.net/~r/devhammer/~3/UIuaB-76mOI/dave-ward-s-advice-to-programmers</link><description>&lt;p&gt;In a nutshell…&lt;a href="http://encosia.com/read-my-interview-with-the-code-project/" target="_blank"&gt;"write about programming."&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Encosia-Dave-Ward_85DF/blanknotebook_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="blanknotebook" border="0" alt="blanknotebook" align="left" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Encosia-Dave-Ward_85DF/blanknotebook_thumb.jpg" width="404" height="304"&gt;&lt;/a&gt;Longer version (the quote comes from an &lt;a href="http://www.codeproject.com/Articles/327251/A-Coder-Interview-With-Dave-Ward" target="_blank"&gt;interview Dave did with The Code Project&lt;/a&gt;):&lt;/p&gt; &lt;p&gt;"&lt;strong&gt;What advice would you offer to an up-and-coming programmer?&lt;/strong&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Write about programming. Start a blog, answer questions on The Code Project or Stack Overflow, or whatever else suits you, but find some way to write about programming.  &lt;p&gt;I can’t count how many times I began writing about something I thought I knew thoroughly, only to find that I had to fill in several important gaps in my knowledge to write about it competently. Just as important, you have to learn topics more comprehensively to distill and teach them in simple terms. The combination of writing about programming and making that writing as clear and simple as you can is a powerful exercise."&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;br clear="all"&gt;I couldn't agree more with Dave's advice, though I would expand it to "teach about programming." Some folks enjoy writing, some enjoy making videos, some talking at user groups. All of these are fantastic ways to share what you know with others, and can also be a great forcing factor to make you fill those gaps in your knowledge. &lt;p&gt;I even recommend to folks that they present or write on topics that they know little about. Knowing that you have to get up in front of an audience and talk about a subject can be a very powerful motivator for learning that subject more deeply than you might if you were learning it for your sake only. &lt;p&gt;The &lt;a href="http://www.codeproject.com/Articles/327251/A-Coder-Interview-With-Dave-Ward" target="_blank"&gt;full interview is worth a read&lt;/a&gt;, and don't miss the comments on &lt;a href="http://encosia.com/read-my-interview-with-the-code-project/" target="_blank"&gt;Dave's blog post&lt;/a&gt;, particularly Dave's observations on distractions. I identify all too well with the ability to get easily distracted, and I think being aware of that tendency and putting in place strategies for short-circuiting it is critical if you want to get anything accomplished in this…SQUIRREL! &lt;p&gt;(h/t &lt;a href="https://twitter.com/#!/tommx" target="_blank"&gt;Thomas L. McGrath&lt;/a&gt;)&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/UIuaB-76mOI" height="1" width="1"/&gt;</description><pubDate>Fri, 10 Feb 2012 14:56:35 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/dave-ward-s-advice-to-programmers</guid><feedburner:origLink>http://devhammer.net:80/blog/dave-ward-s-advice-to-programmers</feedburner:origLink></item><item><title>Curious about Windows 8 on ARM?</title><link>http://feeds.devhammer.net/~r/devhammer/~3/EOMJjnN3gww/curious-about-windows-8-on-arm</link><description>&lt;p&gt;Then you'll definitely want to check out &lt;a href="http://blogs.msdn.com/b/b8/archive/2012/02/09/building-windows-for-the-arm-processor-architecture.aspx" target="_blank"&gt;the in-depth post by Steven Sinofsky today&lt;/a&gt; on the &lt;a href="http://blogs.msdn.com/b/b8/" target="_blank"&gt;Building Windows 8 blog&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/EOMJjnN3gww" height="1" width="1"/&gt;</description><pubDate>Thu, 09 Feb 2012 21:28:08 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/curious-about-windows-8-on-arm</guid><feedburner:origLink>http://devhammer.net:80/blog/curious-about-windows-8-on-arm</feedburner:origLink></item><item><title>A new Gadgeteer blog - VB Magic</title><link>http://feeds.devhammer.net/~r/devhammer/~3/Tkvry-Smg10/a-new-gadgeteer-blog---vb-magic</link><description>&lt;p&gt;Well, so &lt;a href="http://blog.vbmagic.net/" target="_blank"&gt;the blog&lt;/a&gt; isn't &lt;em&gt;only&lt;/em&gt; about Gadgeteer, but I love the title, and the fact that &lt;a href="http://blog.vbmagic.net/2012/02/08/have-the-starts-of-a-game-running-on-the-fez-spider/" target="_blank"&gt;his most recent post shows the beginnings of an RPG&lt;/a&gt; (&lt;a href="http://tyranntmicro.codeplex.com/" target="_blank"&gt;open source&lt;/a&gt;, no less) running on the FEZ Spider Gadgeteer board, is Awesome in my book. A definite Critical Hit.&lt;/p&gt; &lt;p&gt;&lt;a href="http://youtu.be/S-z6crGyiu8" target="_blank"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/A-new-Gadgeteer-blogger--_7ADE/image_3.png" width="604" height="304"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I love Gadgeteer, and I love RPGs, so it's a great combo in my book. He's also got some good posts on &lt;a href="http://www.windowsazure.com/" target="_blank"&gt;Windows Azure&lt;/a&gt; as well, so don't just stop at the Gadgeteer posts…lots to learn here.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/Tkvry-Smg10" height="1" width="1"/&gt;</description><pubDate>Wed, 08 Feb 2012 13:54:51 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/a-new-gadgeteer-blog---vb-magic</guid><feedburner:origLink>http://devhammer.net:80/blog/a-new-gadgeteer-blog---vb-magic</feedburner:origLink></item><item><title>Gadgeteer Hello World</title><link>http://feeds.devhammer.net/~r/devhammer/~3/3d4Crfp6fX4/gadgeteer-hello-world</link><description>&lt;h2&gt;Introduction&lt;/h2&gt; &lt;p&gt;Some time ago, I &lt;a href="http://devhammer.net/blog/are-you-a-gadgeteer" target="_blank"&gt;posted an unboxing video&lt;/a&gt; for something new, my &lt;a href="http://www.ghielectronics.com/catalog/product/297" target="_blank"&gt;FEZ Spider .NET Gadgeteer starter kit&lt;/a&gt;. Since then, I've been busy with both my day job, and spending a lot of my "free" time playing with my Gadgeteer stuff, learning about breadboarding, and generally diving head-first into the world of electronics hardware and microcontrollers.&lt;/p&gt; &lt;p&gt;At first, working in this world was quite indimidating, and I felt almost completely lost. I plugged my first board into my computer with the LCD screen hooked up, and all it showed was some debug information. OK. Where do I go from here, I asked myself?&lt;/p&gt; &lt;p&gt;To help other folks who might be in the same boat (whether you're a software geek just jumping into Gadgeteer, or someone experienced with other electronics work, but not familiar with Gadgeteer), I'm going to start posting some blog/video posts walking you through the basics of working with &lt;a href="http://netmf.com/gadgeteer/" target="_blank"&gt;.NET Gadgeteer&lt;/a&gt;. Some of this information (such as breadboarding, for example, which I'll cover in a future post) may be applicable to other microcontroller environments, while some will be Gadgeteer-specific.&lt;/p&gt; &lt;p&gt;In this post, I'm going to take you from receiving a .NET Gadgeteer mainboard to the "Hello, World" of embedded electronics, which is flashing an LED.&lt;/p&gt; &lt;h3&gt;Video Experiment&lt;/h3&gt; &lt;p&gt;A side note on the videos…I'm trying an experiment here and recording and posting these videos quickly, with little or no processing or editing, in hopes that keeping the process lightweight will help me get more videos out more quickly. Set your expectations on the video quality appropriately.&lt;/p&gt; &lt;h2&gt;I Just Got My FEZ Spider Starter Kit (or similar Gadgeteer-compatible mainboard)…Now What?&lt;/h2&gt; &lt;p&gt;If, like me, you go the starter kit route, you've spent a little more money, but you now have a mainboard, and a bunch of modules, most of which you probably have no idea what they do, or what to do with them. DON'T PANIC! We'll start slow with the first video.&lt;/p&gt; &lt;h3&gt;Prerequisites&lt;/h3&gt; &lt;p&gt;Since I already have the necessary software (Visual Studio, .NET Micro Framework, Drivers, etc.) on my machine, I'm not going to show installing those as part of the video. If you're working with GHI gear, you want to head over to:&lt;/p&gt; &lt;p&gt;&lt;a title="http://www.tinyclr.com/support" href="http://www.tinyclr.com/support"&gt;http://www.tinyclr.com/support&lt;/a&gt;&lt;/p&gt; &lt;p&gt;and download and install the items under "System Preparation" before going further. This will give you the tools and SDKs you need to get started. It may even open the local version of the &lt;a href="http://www.ghielectronics.com/downloads/Gadgeteer/Mainboard/Spider_GettingStarted/" target="_blank"&gt;Getting Started guide&lt;/a&gt;, but don't leap into that project just yet…watch this first:&lt;/p&gt; &lt;p&gt;&lt;iframe height="480" src="http://player.vimeo.com/video/36310941?byline=0&amp;amp;portrait=0&amp;amp;color=ffffff" frameborder="0" width="640" allowfullscreen webkitallowfullscreen mozallowfullscreen&gt;&lt;/iframe&gt; &lt;p&gt;&lt;a href="http://vimeo.com/36310941"&gt;Gadgeteer Hello World&lt;/a&gt; from &lt;a href="http://vimeo.com/devhammer"&gt;G. Andrew Duthie&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;That was pretty simple, and required very few lines of code. Adding a display is easy, too. We can modify the original project to also write a message out to a &lt;a href="http://www.seeedstudio.com/depot/oled-display-module-net-gadgeteer-compatible-p-1019.html?cPath=203" target="_blank"&gt;Seeed Studio OLED Display module&lt;/a&gt; with just a single line of code, thanks to the SimpleGraphics API (Mike Dodaro has a neat demo of SimpleGraphics with the GHI LCD Display module &lt;a href="http://mikedodaro.net/2011/10/28/net-gadgeteer-more-simple-graphics/" target="_blank"&gt;here&lt;/a&gt;). Here's a video of this in action:&lt;/p&gt; &lt;p&gt;&lt;iframe height="480" src="http://player.vimeo.com/video/36312903?byline=0&amp;amp;portrait=0&amp;amp;color=ffffff" frameborder="0" width="640" allowfullscreen webkitallowfullscreen mozallowfullscreen&gt;&lt;/iframe&gt; &lt;p&gt;&lt;a href="http://vimeo.com/36312903"&gt;Hello Gadgeteer - OLED edition&lt;/a&gt; from &lt;a href="http://vimeo.com/devhammer"&gt;G. Andrew Duthie&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Here's my design view for the final project:&lt;/p&gt; &lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Gadgeteer-Hello-World_B819/image_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Gadgeteer-Hello-World_B819/image_thumb.png" width="604" height="399"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Here's the code from the final version of Program.cs:&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Threading;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.SPOT;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.SPOT.Presentation;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.SPOT.Presentation.Controls;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.SPOT.Presentation.Media;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.SPOT.Touch;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Gadgeteer.Networking;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; GT = Gadgeteer;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; GTM = Gadgeteer.Modules;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Gadgeteer.Modules.GHIElectronics;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Gadgeteer.Modules.Seeed;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; HelloGadgeteer&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Program&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsLedOn = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="rem"&gt;// This method is run when the mainboard is powered up or reset.   &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span class="kwrd"&gt;void&lt;/span&gt; ProgramStarted()&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;            &lt;span class="rem"&gt;// Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;            Debug.Print(&lt;span class="str"&gt;"Program Started"&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;            GT.Timer timer = &lt;span class="kwrd"&gt;new&lt;/span&gt; GT.Timer(1000); &lt;span class="rem"&gt;// every second (1000ms)&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;            timer.Tick += &lt;span class="kwrd"&gt;new&lt;/span&gt; GT.Timer.TickEventHandler(timer_Tick);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;            timer.Start();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;            oledDisplay.SimpleGraphics.DisplayTextInRectangle(&lt;span class="str"&gt;"Hello, Gadgeteer!"&lt;/span&gt;, 2, 2, 100, 30, &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;                GT.Color.Red, Resources.GetFont(Resources.FontResources.NinaB));&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;            Debug.Print(&lt;span class="str"&gt;"Timer Started"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;        &lt;span class="kwrd"&gt;void&lt;/span&gt; timer_Tick(GT.Timer timer)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;            Mainboard.SetDebugLED(!IsLedOn);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;            IsLedOn = !IsLedOn;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Hope you enjoyed this quick stroll through Hello World for Gadgeteer. In my next post, I'll explore some of the many neat things you can do with .NET Gadgeteer, and the many modules that are already available (with more on the way!).&lt;/p&gt;
&lt;p&gt;Another nice thing about Gadgeteer is that there's a thriving community of Gadgeteer enthusiasts (myself included) that hang out over on &lt;a href="http://www.tinyclr.com/forum/21/" target="_blank"&gt;the TinyCLR.com Gadgeteer forum&lt;/a&gt;. If you have questions, stop by and ask, or just say hello!&lt;/p&gt;
&lt;p&gt;If you enjoyed this post, why not &lt;a href="http://twitter.com/home?status=Gadgeteer%20Hello%20World%20by%20Devhammer%20-%20http://http://bit.ly/z4VMqV" target="_blank"&gt;share it with your friends&lt;/a&gt;? You can also &lt;a href="http://feeds.devhammer.net/devhammer"&gt;subscribe to my RSS feed&lt;/a&gt;, and &lt;a href="http://twitter.com/devhammer"&gt;follow me on twitter&lt;/a&gt; for more frequent updates. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/3d4Crfp6fX4" height="1" width="1"/&gt;</description><pubDate>Tue, 07 Feb 2012 23:55:21 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/gadgeteer-hello-world</guid><feedburner:origLink>http://devhammer.net:80/blog/gadgeteer-hello-world</feedburner:origLink></item><item><title>Upcoming Events - February 6th, 2012</title><link>http://feeds.devhammer.net/~r/devhammer/~3/GYV_KO_FfZU/upcoming-events---february-6th-2012</link><description>&lt;p&gt;Here are the events listed in &lt;a href="http://www.communitymegaphone.com/"&gt;Community Megaphone&lt;/a&gt; for the next week (or so) for the Mid-Atlantic area, as well as webcasts of interest…this list includes events imported from the &lt;a href="https://www.technicalcommunity.com/Pages/eventcal.aspx"&gt;UGSS event calendar&lt;/a&gt;, and user group events entered in Community Megaphone are also automatically synced to the UGSS event calendar:&lt;/p&gt; &lt;h2&gt;MD&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=5029"&gt;&lt;strong&gt;CMAP Main Meeting - Getting Started with SignalR - Kevin Griffin&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, February 07, 2012 6:30 PM, Columbia, MD&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=6751+Columbia+Gateway+Drive%2c+Columbia%2c+MD&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View CMAP Main Meeting - Getting Started with SignalR - Kevin Griffin on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=5029&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Topic: Getting Started with SignalR&lt;br&gt;SignalR is an asynchronous signaling library for ASP.NET. It's designed to help you build real-time web applications without a lot of hassle. In the past, developers would have to wire up "real-time" applications as a series of polls to a webserver, waiting for it to receive data back that was useful. This approach usually cost more in bandwidth than we wanted it to. SignalR simplifies this process, and makes it more useful for the ASP.NET developer. In this presentation, Kevin Griffin will guide you through implementing SignalR into your applications, and how you can take advantage of everything it has to offer.&lt;br&gt;Presenter: Kevin Griffin&lt;br&gt;Kevin Griffin has been working as a professional developer since 2006, where his first job was working on components for the Symantec security suites. Now Kevin works as a Technical Evangelist for ComponentOne. As an Microsoft ASP.NET MVP and ASPInsider, Kevin spends a lot of time teaching and mentoring developers to learn new technologies and to be better developers. Over three years ago, Kevin started the Hampton Roads .NET Users Group and now serves as a Senior Mentor for INETA. You can find Kevin speaking at conferences, code camps, and user groups across the country.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=5029"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=5029"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/5029.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4818"&gt;&lt;strong&gt;An Introduction to Expression Blend&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, February 08, 2012 6:30 PM, Rockville, MD&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=51+Mannakee+Street%2c+Rockville%2c+MD&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View An Introduction to Expression Blend on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4818&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Abstract:&lt;br&gt;Microsoft Expression Blend is the premier GUI editor for WPF and Silverlight applications.In this presentation you will receive an introduction to the Blend UI and how to use it to quickly and easily build an application interface. Topics will include Configuration, Layout Controls, how to leverage Blend with Visual Studio, and more.&lt;br&gt;Bio:&lt;br&gt;Joel Cochran is an Expression Blend MVP, an INETA Community Champion, and a Microsoft Certified Technology Specialist (MCTS) in Windows Forms and WPF. He is the founder of BlendSIG, a virtual Special Interest Group focused on Expression Blend and author of "Expression Blend in Action" by Manning Publications. He is also the author of "The Practical MVVM Manifesto" (http://practicalmvvm.com). He has been developing for Windows since 2003 and is a self-proclaimed "Blend Evangelist". A frequent speaker at User Groups and Code Camps, he enjoys teaching and writing about .NET and other topics. You can find him online at http://www.developingfor.net or on Twitter at http://twitter.com/joelcochran. Joel has served as the Director of Operations for Stonewall Technologies, Inc., an ISV, in Staunton, VA, since 2000.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4818"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4818"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4818.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;Online&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=5032"&gt;&lt;strong&gt;Automated Unit Testing - Testing Dependencies and Legacy Code&lt;/strong&gt; &lt;/a&gt;&lt;br&gt;Wednesday, February 08, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; You may have already started unit testing or at least understand the basics. But there’s one large obstacle that stands in your way: dependencies. Most code was not written to be easy to test. How can you test dependencies? Join this webinar and learn different methods and tools that help create unit tests to test dependencies and legacy code.&lt;br&gt;Learn:&lt;br&gt;• Why you are writing legacy code&lt;br&gt;• Hand rolled mocks&lt;br&gt;• Mocking frameworks&lt;br&gt;• What makes a good unit test&lt;br&gt;This webinar is intended for .NET developers interested in automated unit testing who want to learn how to develop better code.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=5032"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/5032.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4976"&gt;&lt;strong&gt;Developing Applications Using Data from Microsoft Windows Azure Marketplace&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, February 14, 2012 2:00 PM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; The Windows Azure Marketplace is an online market buying and selling finished Software as a Service (SaaS) applications and premium datasets. There is a wide variety of data including demographic, environment, financial, retail and sports. In this webcast, we will take a look at the application development features of the Windows Azure Marketplace and discuss how you can develop web and Windows Phone applications that consume data from the Marketplace.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4976"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4976.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4991"&gt;&lt;strong&gt;SSWUG Free Expo: Understanding Database Security Threats and Countermeasures&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Friday, February 17, 2012 9:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; SSWUG.ORG’s free virtual expo will review ways for information technology (IT) professionals who work with enterprise environments to design and monitor security for database systems.&lt;br&gt;Through our in-depth sessions with some of the leading functional specialists in the IT field, you will see many examples and case studies on understanding database forensics, encrypting data, preventing SQL injection hacks and more.&lt;br&gt;By the end of our free event, you should have the tools and understanding needed to develop database security solutions for protecting business-critical databases.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4991"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4991.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;VA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4984"&gt;&lt;strong&gt;Managing Privileged Account Passwords, Windows Azure, Virtualization/Hyper-V with Windows Server 2008 R2 SP1, and System Center Virtual Machine Manager 2012&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, February 16, 2012 6:30 PM, Arlington, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1501+Lee+Highway%2c+Suite+400%2c+Arlington%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Managing Privileged Account Passwords, Windows Azure, Virtualization/Hyper-V with Windows Server 2008 R2 SP1, and System Center Virtual Machine Manager 2012 on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4984&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Windows Azure is an open cloud platform that enables developers to quickly build, deploy and manage applications across a global network of Microsoft-managed datacenters. Our guest speaker, Zhiming Xue, Microsoft architect evangelist, will provide an update on the new release of Microsoft Windows Azure, including its support for Node.js, java and PHP.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4984"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4984"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4984.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;Want your events listed? You can &lt;a href="http://www.communitymegaphone.com/AddEvent.aspx"&gt;add them here.&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can also add your events via the Community Megaphone web service API. You can get more information on the API, and how to sign up, at &lt;a href="http://www.communitymegaphone.com/API.aspx"&gt;http://www.communitymegaphone.com/API.aspx&lt;/a&gt;. You can also &lt;a href="http://blogs.msdn.com/gduthie/contact.aspx"&gt;email me&lt;/a&gt; for more information.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/GYV_KO_FfZU" height="1" width="1"/&gt;</description><pubDate>Mon, 06 Feb 2012 15:41:54 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/upcoming-events---february-6th-2012</guid><feedburner:origLink>http://devhammer.net:80/blog/upcoming-events---february-6th-2012</feedburner:origLink></item><item><title>MADExpo 2012 Call for Speakers is Open!</title><link>http://feeds.devhammer.net/~r/devhammer/~3/AjXJUF8HZak/madexpo-2012-call-for-speakers-is-open</link><description>&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/MADExpo-2012-Call-for-Speakers-is-Open_12AF6/MADExpo_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="MADExpo" border="0" alt="MADExpo" align="left" src="http://devhammer.net/Media/Default/Windows-Live-Writer/MADExpo-2012-Call-for-Speakers-is-Open_12AF6/MADExpo_thumb.png" width="260" height="100"&gt;&lt;/a&gt;Last year, it was my privilege to be a part of the team that brought a new conference to the Mid-Atlantic, the Mid-Atlantic Developer Expo (or &lt;a href="http://madexpo.us/" target="_blank"&gt;MADExpo&lt;/a&gt; for short). The conference was born of many conversations and discussions in the community from folks wanting to do something a little bigger and bolder than some of the usual events we were used to. So I, Steve Bodnar, Steve Presley, &lt;a href="http://www.kevgriffin.com/blog/" target="_blank"&gt;Kevin Griffin&lt;/a&gt;, Sara Faatz. Kevin Hazzard, &lt;a href="http://10rem.net/blog" target="_blank"&gt;Pete Brown&lt;/a&gt;, Rich Dudley, and a &lt;a href="http://madexpo.us/about" target="_blank"&gt;team of volunteers&lt;/a&gt; planned and executed the first event last summer.&lt;/p&gt; &lt;h2&gt;Why We Did It&lt;/h2&gt; &lt;p&gt;Our goal was to create a fun and informative conference with some unique aspects. We included a full-day kids conference called &lt;a href="http://madexpo.us/madkidz" target="_blank"&gt;MadKidz&lt;/a&gt;, run by Kevin Hazzard (with help from his family), which was a big hit. We included a dedicated room for hardware and NUI demonstrations, featuring a local FIRST robotics team, Chiptunes demo, Kinect and Surface demonstrations, the founder of Secret Labs, maker of Netduino, and all the geeky toys Pete Brown could pack into one table.&lt;/p&gt; &lt;p&gt;We had a keynote by &lt;a href="http://www.wintellect.com/Company/Bios/Jeff-Prosise" target="_blank"&gt;Jeff Prosise&lt;/a&gt;, a &lt;a href="http://www.wintellect.com/" target="_blank"&gt;Wintellect&lt;/a&gt; co-founder, on his passion for radio controlled flying, including a 1/6th-scale F-16 onstage. We brought folks to one of the finest facilities on the east coast, the Hampton Roads Convention Center, in the heart of Virginia's Tidewater, a short drive from the beach, theme parks, and all the history you could want for a summer vacation. And with the assistance of great sponsors, we kept it affordable enough that just about anyone could come.&lt;/p&gt; &lt;p&gt;And now, it's time to do it all over again.&lt;/p&gt; &lt;h2&gt;Announcing MADExpo 2012&lt;/h2&gt; &lt;p&gt;I'm pleased to announce that the 2012 Mid-Atlantic Developer Expo will be held from &lt;strong&gt;&lt;em&gt;June 27th-29th, 2012&lt;/em&gt;&lt;/strong&gt; at the Hampton Roads Convention Center in Hampton Roads, VA. That's right…we're adding a third day to make sure we can pack in more content, including repeated sessions so that attendees won't have to miss out when there's more than one session they want to see in the same time slot.&lt;/p&gt; &lt;h2&gt;Call for Speakers&lt;/h2&gt; &lt;p&gt;Speaking of sessions…now's the time to get yours in. The Call for Speakers for MADExpo 2012 is officially open. Simply visit &lt;a href="http://madexpo.us/speakers"&gt;http://madexpo.us/speakers&lt;/a&gt;, and click the link at the top of the page to submit your session (you'll need to create an account if you didn't already do so last year). As was the case last year, the conference is open to all technologies that software developers, hardware hackers, and geeks in general would be interested in. The list below is provided to give you some guidance, but if you have an idea that's not on the list, please submit it anyway. You never know, yours might be the next great keynote idea (our day 2 keynote last year, by James Ashley, was originally submitted as a breakout talk).&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Web Development  &lt;li&gt;Database Development  &lt;li&gt;Client Development  &lt;li&gt;Mobile Development  &lt;li&gt;Cloud Development  &lt;li&gt;Hardware Hacking and Microcontroller Programming  &lt;li&gt;Natural User Interface (NUI) Development  &lt;li&gt;Agile Methodologies  &lt;li&gt;Best Practices  &lt;li&gt;Open Source Development  &lt;li&gt;Beginner Topics  &lt;li&gt;Robotics  &lt;li&gt;Portal and Content Management System administration and development  &lt;li&gt;Infrastructure management and development  &lt;li&gt;UX/UI and Design  &lt;li&gt;Soft Skills&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The Call for Speakers will remain open until mid-March, but don't wait to submit your sessions, as you'll want to be first in line to get your sessions selected!&lt;/p&gt; &lt;p&gt;We are asking potential speakers to submit several sessions, with the goal being that each selected speaker will do at least 2 talks over the 3-day conference (with each talk potentially being repeated to allow attendees two chances to see the session). Both beginners and experienced speakers are welcome. If you've got something cool to talk about, we want to hear from you. And if you only have one session to submit, that's fine, too. 2 talks per speaker is a goal, not a hard and fast rule. This is all about having great content, and making it worth your time and travel as a speaker. Speakers will receive a free pass to the conference, and an opportunity to share their knowledge with their peers from the Mid-Atlantic and beyond.&lt;/p&gt; &lt;p&gt;If you have questions, feel free to drop an email to &lt;a href="mailto:info@madexpo.us"&gt;info@madexpo.us&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I'm excited to see things moving forward for this year's MADExpo, and can't wait to see all the great session ideas!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/AjXJUF8HZak" height="1" width="1"/&gt;</description><pubDate>Fri, 03 Feb 2012 03:18:02 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/madexpo-2012-call-for-speakers-is-open</guid><feedburner:origLink>http://devhammer.net:80/blog/madexpo-2012-call-for-speakers-is-open</feedburner:origLink></item><item><title>Exploring HTML5 Canvas: Part 3 - Paths and Text</title><link>http://feeds.devhammer.net/~r/devhammer/~3/KPSVkex2e7A/exploring-html5-canvas-part-3---paths-and-text</link><description>&lt;p&gt;[This is part 3 of an ongoing series of posts examining the HTML5 Canvas element. In &lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-1---introduction"&gt;Part 1 of this series&lt;/a&gt;, I introduced Canvas and prepared a template to make further explorations a bit simpler, and also introduced &lt;a href="http://jsfiddle.net/"&gt;JsFiddle&lt;/a&gt;, a neat tool for experimenting with and sharing web code. In &lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-2---basic-shapes" target="_blank"&gt;Part 2&lt;/a&gt;, I demonstrated the ability of Canvas to allow your page background to shine through, and showed you how to render simple shapes on the drawing surface.]&lt;/p&gt; &lt;p&gt;For part 3 of our exploration of HTML5 Canvas, I'm going to introduce you to a couple of additional ways to draw…the path APIs and the text APIs. Actually, if you've read part 2, you already met one of the important path APIs, namely &lt;strong&gt;context.arc&lt;/strong&gt;, which provides the ability to draw circles (or portions of circles). But circles aren't the only thing we can draw with paths…not by a long shot…&lt;/p&gt; &lt;h2&gt;Starting a Path and Drawing a Line&lt;/h2&gt; &lt;p&gt;There are a couple of things you'll need to do before you actually start drawing with the path APIs. The first is to move the starting point for your path to where you want it using &lt;strong&gt;context.moveTo()&lt;/strong&gt;:&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;    &lt;/span&gt;context.moveTo(50, 50);&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Here, I move the drawing context to 50 pixels right, and 50 pixels down from the upper left corner of the canvas element. Now, I can start drawing. The simplest drawing API is for drawing straight lines, &lt;strong&gt;context.lineTo()&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;    &lt;/span&gt;context.lineTo(150, 150);&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Here, I'm drawing a straight line from the origin set by moveTo to a point at 150 pixels right and 150 pixels down from the upper left corner of the element. But I'm not quite done. In order to actually render the line, I need to call &lt;strong&gt;context.stroke()&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.stroke();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;The result is a serviceable, if unspectacular, diagonal straight line:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_1_comp_1.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Pt3_lineTo_1_comp" border="0" alt="Pt3_lineTo_1_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_1_comp_thumb_1.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, that line is a little on the thin size, so let's beef it up, shall we? A simple call to &lt;strong&gt;context.lineWidth&lt;/strong&gt; prior to drawing the line will work swimmingly, and while we're at it, we can use the &lt;strong&gt;context.lineCap&lt;/strong&gt; API to make the ends of the line rounded rather than the default square (butt) end:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.lineWidth = 5;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;context.lineCap = &lt;span class="str"&gt;"round"&lt;/span&gt;;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br&gt;Zoom in to 400%, and you can clearly see how the lineCap API has rounded the end of our line:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_2_comp.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Pt3_lineTo_2_comp" border="0" alt="Pt3_lineTo_2_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_2_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Next, we'll add a couple more lines to make a triangle:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.moveTo(50, 50);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;context.lineTo(150, 150);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.lineTo(150, 50);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.lineTo(50, 50);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.stroke();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;And we'll also add a call to &lt;strong&gt;context.lineJoin&lt;/strong&gt; to ensure our joins match our caps, and for fun we'll fill the triangle with red…here's the full rendering code so far:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.lineWidth = 5;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;context.lineCap = &lt;span class="str"&gt;"round"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.lineJoin = &lt;span class="str"&gt;"round"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.moveTo(50, 50);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.lineTo(150, 150);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;context.lineTo(150, 50);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;context.lineTo(50, 50);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;context.stroke();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;context.fillStyle = &lt;span class="str"&gt;"#F00"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;context.fill();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;which gives us the following result:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_3_comp.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Pt3_lineTo_3_comp" border="0" alt="Pt3_lineTo_3_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_3_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So far, so good. But what if you want to draw something other than a straight line?&lt;/p&gt;
&lt;h2&gt;Drawing Arcs and Bezier Curves&lt;/h2&gt;
&lt;p&gt;We already saw in part 2 how to use the arc API to draw circle shapes, but sometimes you need more than just a circle (or part of one). Suppose instead of all straight lines for our triangle above, we want to make one side curved? We could use the &lt;strong&gt;context.quadraticCurveTo&lt;/strong&gt; or &lt;strong&gt;context.bezierCurveTo&lt;/strong&gt; APIs to draw a curve instead of one of the straight lines, like so:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.lineWidth = 5;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;context.lineCap = &lt;span class="str"&gt;"round"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.lineJoin = &lt;span class="str"&gt;"round"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.moveTo(50, 50);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.bezierCurveTo(50,50, 150,50, 150,150);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="rem"&gt;//context.lineTo(150, 150);&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;context.lineTo(150, 50);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;context.lineTo(50, 50);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;context.stroke();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;context.fillStyle = &lt;span class="str"&gt;"#F00"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;context.fill();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Above, we've replaced the code that previously drew the diagonal line with a call to bezierCurveTo. This API starts drawing at the location specified by the previous line's call to moveTo, and ends at 150, 150, the value of the last 2 parameters. The first two parameters are the X and Y coordinates of the 2 bezier curve control points, in this case, 50, 50 and 150, 50, which gives us the following output:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_4_comp.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Pt3_lineTo_4_comp" border="0" alt="Pt3_lineTo_4_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/Pt3_lineTo_4_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The only difference between bezierCurveTo and quadraticCurveTo is that the latter only has one control point, rather than two.&lt;/p&gt;
&lt;h2&gt;Additional Path APIs&lt;/h2&gt;
&lt;p&gt;I'm not going to show full examples of each and every API for drawing paths and shapes, but here are a few more you may want to be aware of (there's a pretty good &lt;a href="http://www.w3schools.com/html5/html5_ref_canvas.asp" target="_blank"&gt;reference for the Canvas APIs available over at W3Schools&lt;/a&gt;, where you can get more info):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;context.beginPath() – begins a new path or clears the current path. 
&lt;li&gt;context.closePath() – closes the current path. 
&lt;li&gt;context.clip() – creates a clipping area using the current path or shape information. Only pixels within the clipping area will be visible after calling this function. 
&lt;li&gt;context.clearRect(x, y, width, height) – clears a rectangular space matching the provided x and y origin and width and height, removing all pixels. Useful for clearing only a portion of the canvas. 
&lt;li&gt;arcTo(x1, y1, x2, y2, radius) – draws an arc between two specified points of the specified radius.&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;Drawing Text&lt;/h2&gt;
&lt;p&gt;One very positive thing about drawing text with the canvas APIs is that it's very simple, and can take as little as one line of code:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;context.strokeText(&lt;span class="str"&gt;"Hello, Canvas!"&lt;/span&gt;, 50, 150);&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;In fact, the only other API specifically for drawing text is &lt;strong&gt;context.fillText&lt;/strong&gt;. The remaining APIs are all relating to the font, location, and alignment of the text. Adding the above line of code to our existing page (with a quick call to context.lineWidth to set it back to 1 pixel), gives the following result:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/image_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This simplicity is great if all you want to do is drop a quick annotation onto a chart, or something similar, but there are some significant downsides to using the text APIs in canvas to be aware of.&lt;/p&gt;
&lt;h3&gt;Reasons not to use Canvas for Text&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Once you draw text in canvas, it's simply a part of the bitmap data, and no longer distinct in any way from shapes, lines, fills, etc. So the only way to manipulate text once drawn is to redraw it. By comparison, text created using plain HTML or SVG becomes a distinct part of the DOM, and can be individually selected and manipulated without having to redraw it. 
&lt;li&gt;While you can change the orientation of canvas-based text using transformations (more on this feature in a future post), this doesn't give you as much flexibility as the text APIs in SVG. For example, SVG makes it possible to flow text along a path, which is difficult if not impossible to do using any other available text technique. One downside of this technique is that it can be pretty involved, so you may want to use a vector graphics editor such as the free &lt;a href="http://inkscape.org/" target="_blank"&gt;InkScape&lt;/a&gt; to create your SVG. You can see an example of flowing text on a path below. 
&lt;li&gt;Text rendered using canvas is not accessible. Screen readers won't see it, so those who are visually impaired will not know what the text says. So if your text is critical to the semantic meaning of your page, it should probably be in the markup, not in canvas, or even SVG.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;br&gt;One nice thing about text in an HTML5 world is that you don't have to choose one or the other, you can easily use HTML markup, SVG, and Canvas, all in the same application. Here's &lt;a href="http://ie.microsoft.com/testdrive/HTML5/Blizzard/Default.html" target="_blank"&gt;one example from the Internet Explorer team&lt;/a&gt; (warning…plays audio, may want to turn your speakers down).&lt;/p&gt;
&lt;p&gt;As in Part 2, I'll leave you with a jsFiddle of the code from today's exploration:&lt;/p&gt;
&lt;p&gt;&lt;iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/devhammer/ZFK65/embedded/" frameborder="0" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;I hope you enjoyed this foray into the wonderful world of the HTML5 Canvas path and text APIs!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/HAND_comp.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="HAND_comp" border="0" alt="HAND_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_BEBF/HAND_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you found this useful, why not &lt;a href="http://twitter.com/home?status=Exploring%20HTML5%20Canvas%20-%20Paths%20and%20Text%20by%20Devhammer%20-%20http://bit.ly/wYPhWb" target="_blank"&gt;tell your friends&lt;/a&gt;? You can also &lt;a href="http://feeds.devhammer.net/devhammer"&gt;subscribe to my RSS feed&lt;/a&gt;, and &lt;a href="http://twitter.com/devhammer"&gt;follow me on twitter&lt;/a&gt; for more frequent updates. 
&lt;p&gt;More parts in the series: 
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-1---introduction"&gt;Part 1 – Introduction&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-2---basic-shapes" target="_blank"&gt;Part 2 – Basic Shapes&lt;/a&gt; 
&lt;li&gt;Part 3 – this post&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Up next, I'll &lt;a href="http://bit.ly/zsGdPs" target="_blank"&gt;tackle Transformations&lt;/a&gt;…don't miss it!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/KPSVkex2e7A" height="1" width="1"/&gt;</description><pubDate>Tue, 31 Jan 2012 16:39:15 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/exploring-html5-canvas-part-3---paths-and-text</guid><feedburner:origLink>http://devhammer.net:80/blog/exploring-html5-canvas-part-3---paths-and-text</feedburner:origLink></item><item><title>Exploring HTML5 Canvas: Part 2 - Basic Shapes</title><link>http://feeds.devhammer.net/~r/devhammer/~3/22rVU9voUBY/exploring-html5-canvas-part-2---basic-shapes</link><description>&lt;p&gt;[This is part 2 of an ongoing series of posts examining the HTML5 Canvas element. In &lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-1---introduction" target="_blank"&gt;Part 1 of this series&lt;/a&gt;, I introduced Canvas and prepared a template to make further explorations a bit simpler, and also introduced &lt;a href="http://jsfiddle.net/" target="_blank"&gt;JsFiddle&lt;/a&gt;, a neat tool for experimenting with and sharing web code.]&lt;/p&gt; &lt;p&gt;The HTML5 Canvas element holds much promise in terms of making it easier for web developers and designers to create rich animated elements for their sites, without the need for additional browser plug-ins. In this post, we'll look at the basics of drawing shapes in Canvas, and a little bit about CSS and Canvas.&lt;/p&gt; &lt;h2&gt;Canvas and Backgrounds&lt;/h2&gt; &lt;p&gt;One thing I wanted to explore in this post, prompted by a comment by Ian Lee on the previous part, is how Canvas interacts with the rest of your page. Ian asked in his comment whether or not it was possible to make a Canvas element transparent. Another commenter, "dhimanvikas," helpfully offered that this is the default. We can see this by adding a background color to our page using CSS, like so:&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;   body {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;      background-color: #f00;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;(note that I'm using inline styles for now to keep everything in a single file for simplicity…in a production site, it's a best practice to separate styles into one or more external style sheets, to help keep your pages smaller, and make your styles reusable)&lt;/p&gt;
&lt;p&gt;Now, if we browse our page without actually drawing anything using the Canvas drawing context, all we'll see is a red background on our page. Not terribly interesting. But if we add the script from the end of part 1 (leaving out the first line, which draws a black box the size of the canvas), we get the result below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb.png" width="404" height="366"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Looks a little strange, because the fill color and the background color are the same. Let's change the background color of the page to black:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;   body {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;      background-color: #000;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;br&gt;This gives us a little better-looking result:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb_1.png" width="404" height="366"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But background colors aren't all you can do. You can also use canvas over a background image as well:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;   body {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;      background-image: url(images/Andrew_Borg_Santa.jpg);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;      background-size: 100%;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;      background-repeat: no-repeat;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;   }&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;This gives us a nice festive background to work against, and further demonstrates the default transparency of the Canvas element:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb_2.png" width="404" height="366"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;While the default for the canvas is transparency, we can draw a background that's the full size of the canvas, and still show some of our background color or image by using alpha values for the fillStyle, like so:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;function renderContent()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;   context.fillStyle = &lt;span class="str"&gt;"rgba(255, 255, 255, 0.5)"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   context.fillRect(0, 0, canvas.width, canvas.height);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;   var text = &lt;span class="str"&gt;"Hello, Canvas!"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;   context.fillStyle = &lt;span class="str"&gt;"#FF0000"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;   context.strokeStyle = &lt;span class="str"&gt;"#0000FF"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;   context.font = &lt;span class="str"&gt;"36px sans-serif"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;   context.strokeText(text, 10, 50);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;   context.fillText(text, 10, 50);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;This results in a semi-transparent background of white for our Canvas element, which allows our background image to show through:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_8.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb_3.png" width="404" height="366"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Styling, Filling, and Stroking&lt;/h2&gt;
&lt;p&gt;To do any drawing in HTML5 Canvas, you'll generally want to set the style of the drawing context API that you plan to use, either fill (the inside of a shape) or stroke (the outline of the shape). By default, the style for each is simply the color black expressed in hash notation ("#000000"). To set a different fill color, you simply call &lt;strong&gt;context.fillStyle&lt;/strong&gt; = &lt;em&gt;color value&lt;/em&gt;, where &lt;em&gt;color value&lt;/em&gt; is a color in any valid CSS format. Similarly, to set the stroke for the context prior to outlining a shape, you call &lt;strong&gt;context.strokeStyle&lt;/strong&gt; = &lt;em&gt;color value&lt;/em&gt;. You can see examples of both of these in the preceding code snippet. Note that there are additional properties that define the style for a shape's outline, but we'll cover these in a future post.&lt;/p&gt;
&lt;p&gt;Once you have the fill and stroke set to the desired colors, you can start drawing.&lt;/p&gt;
&lt;h2&gt;Drawing Shapes&lt;/h2&gt;
&lt;p&gt;It may seem odd, but there's really only one type of shape that you can draw directly with a canvas API, and that's a rectangle. The canvas API has two methods specifically for drawing rectangles, &lt;strong&gt;context.fillRect&lt;/strong&gt; and &lt;strong&gt;context.strokeRect&lt;/strong&gt;. Of course, what fun would it be if we only draw boxes? So we'll also take a look at how we can draw circles using &lt;strong&gt;context.arc&lt;/strong&gt;, and a few other methods.&lt;/p&gt;
&lt;p&gt;To spare your eyes, we'll go back to drawing on a black background, using CSS as in the earlier example. And we'll start out by simply drawing a red rectangle:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; renderContent()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;   context.fillStyle = &lt;span class="str"&gt;"#ff0000"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   context.fillRect(5, 5, 200, 100);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;The fillRect function takes 4 arguments, the first two of which are the x, y, coordinates of the top left corner of the rectangle, and the second two of which are the width and height of the rectangle. This results in the following output:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_10.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb_4.png" width="404" height="397"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can also draw a border around the rectangle using &lt;strong&gt;context.strokeStyle&lt;/strong&gt; and &lt;strong&gt;context.strokeRect&lt;/strong&gt;, like so:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; renderContent()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;   context.fillStyle = &lt;span class="str"&gt;"#ff0000"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   context.fillRect(5, 5, 200, 100);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;   &lt;strong&gt;context.strokeStyle = &lt;span class="str"&gt;"#00ff00"&lt;/span&gt;;&lt;/strong&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;   &lt;strong&gt;context.strokeRect(5, 5, 200, 100);&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;which gives us a nice 1px green border:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_12.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb_5.png" width="404" height="397"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Drawing circles is actually just a specialized case of drawing paths, using the &lt;strong&gt;context.arc&lt;/strong&gt; function. Here's the code required to draw a red circle with a 3 pixel blue border:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; renderContent()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;   context.lineWidth = 3;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   context.fillStyle = &lt;span class="str"&gt;"#0000FF"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;   context.strokeStyle = &lt;span class="str"&gt;"#FF0000"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;   context.beginPath();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;   context.arc(55, 55, 50, 0, Math.PI * 2, &lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;   context.closePath();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;   context.fill();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;   context.stroke();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;there's a fair amount that's new here, so we'll go through it line by line. In line two, we introduce &lt;strong&gt;context.lineWidth&lt;/strong&gt;, which as you might guess, allows us to specify the thickness of the border we're going to draw. fillStyle and strokeStyle work just as they do for rectangles, so we'll skip over them. Next we call &lt;strong&gt;context.beginPath()&lt;/strong&gt;. This tells the canvas element that we want to start drawing a path, but beginPath itself does not do any actual drawing.&lt;/p&gt;
&lt;p&gt;The meat of our circle code comes from &lt;strong&gt;context.arc()&lt;/strong&gt;. This function allows us to draw any portion of a circle. The first two arguments are the x and y coordinates of the center of the circle. Note that this differs from fillRect, so you will need to offset your xy position by the radius of the circle (plus any padding you want). We're using the values 55 and 55, so that the circle which uses a radius of 50 (that's the next argument), will be slightly to the bottom and right of the top left corner of the canvas element. The 3rd argument, as already mentioned, is the radius for our arc/circle, and we've set that to 50. The 4th and 5th arguments, respectively, are the beginning and ending angle for our circle, expressed in radians. We start from 0, and go to Math.PI * 2, which is equivalent to 360 degrees, giving us a full circle. The 6th and final argument determines whether or not we're drawing the circle counterclockwise…by passing the value false, we're saying to draw clockwise. Obviously, this matters a lot more when you're only drawing part of a circle.&lt;/p&gt;
&lt;h4&gt;&lt;/h4&gt;
&lt;h4&gt;Tip: Converting Degrees to Radians&lt;/h4&gt;
&lt;p&gt;If you're not a fan of doing conversion math to work with the context.arc function, here's a tip…the Calculator app in Windows 7 has built-in conversion features, including the ability to convert from degrees to radians and vice-versa. Just select View &amp;gt; Unit conversion, and you get a view like the following (you may have to manually change the unit to Angle):&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_14.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb_6.png" width="404" height="217"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The result of our circle code is shown below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_16.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/845b4555fde3_D1F9/image_thumb_7.png" width="404" height="397"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The output is simple, but we've only just gotten started exploring what you can do with the HTML5 Canvas. Stick around, because in Part 3 of this series, I'll delve deeper into drawing with paths, and text.&lt;/p&gt;
&lt;p&gt;To wrap things up, here's a JsFiddle with the code for our final example, which you can use as a starting point for experimentation:&lt;/p&gt;
&lt;p&gt;&lt;iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/devhammer/SHa7X/embedded/" frameborder="0" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;If you found this useful, why not &lt;a href="http://twitter.com/home?status=Exploring%20HTML5%20Canvas%20-%20Basic%20Shapes%20by%20Devhammer%20-%20http://bit.ly/w887mJ" target="_blank"&gt;tell your friends&lt;/a&gt;? You can also &lt;a href="http://feeds.devhammer.net/devhammer" target="_blank"&gt;subscribe to my RSS feed&lt;/a&gt;, and &lt;a href="http://twitter.com/devhammer" target="_blank"&gt;follow me on twitter&lt;/a&gt; for more frequent updates.&lt;/p&gt;
&lt;p&gt;More parts in the series:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-1---introduction" target="_blank"&gt;Part 1 – Introduction&lt;/a&gt; 
&lt;li&gt;Part 2 – this post 
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-3---paths-and-text" target="_blank"&gt;Part 3 – Paths and Text&lt;/a&gt;
&lt;li&gt;&lt;a href="http://bit.ly/zsGdPs" target="_blank"&gt;Part 4 – Transformations&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/22rVU9voUBY" height="1" width="1"/&gt;</description><pubDate>Tue, 31 Jan 2012 16:38:05 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/exploring-html5-canvas-part-2---basic-shapes</guid><feedburner:origLink>http://devhammer.net:80/blog/exploring-html5-canvas-part-2---basic-shapes</feedburner:origLink></item><item><title>Exploring HTML5 Canvas: Part 1 - Introduction</title><link>http://feeds.devhammer.net/~r/devhammer/~3/6nZeD3tEAeQ/exploring-html5-canvas-part-1---introduction</link><description>&lt;p&gt;In this post, I'm going to begin an examination of one of the hottest new features of HTML5, namely the Canvas element.&lt;/p&gt; &lt;h2&gt;What is Canvas, anyway?&lt;/h2&gt; &lt;p&gt;The best place to start is at the beginning, and that's with an explanation of what Canvas actually is. Canvas is a new element that is part of the HTML5 specification, and can be added to your markup as simply as this:&lt;/p&gt; &lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;canvas&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="myCanvas"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="500"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="500"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;canvas&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;OK, we're done. Let's go home.&lt;/p&gt;
&lt;p&gt;Of course, it's not that easy. By adding the canvas element to the markup, if we browse the page containing the element in a modern browser that supports canvas (you can find out &lt;a href="http://caniuse.com/#search=canvas" target="_blank"&gt;which browsers support canvas using caniuse.com&lt;/a&gt;), you'll see a great big nothing. Why? Because all that the &amp;lt;canvas&amp;gt; tag gives you is a blank slate, and unless you've changed the background color of your page, both the page background and the canvas will be white. Not terribly interesting to look at, so I'll spare you the screen shot of the blank canvas. Just take my word that the above markup gives you a drawing surface that is 500 pixels wide by 500 pixels tall, and (assuming it's the only element in the body of your page) will appear at the top left of your page.&lt;/p&gt;
&lt;h2&gt;Building a Template&lt;/h2&gt;
&lt;p&gt;To make life easier as we explore the HTML5 Canvas, I'm going to start with a basic set of markup and script, and in future posts in this series, I'll add to that basic template. Since this will consist solely of HTML markup, CSS, and Javascript, you can use any text editor you like to follow along. I'll be working with the Microsoft WebMatrix 2 beta, which &lt;a href="http://bit.ly/getwebmatrix" target="_blank"&gt;you can download here&lt;/a&gt; (you can choose either the current v1 release, or the v2 beta, using the big green buttons in the upper right).&lt;/p&gt;
&lt;p&gt;Here's the basic template I'm going to use:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;DOCTYPE&lt;/span&gt; &lt;span class="attr"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;lang&lt;/span&gt;&lt;span class="kwrd"&gt;="en"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;meta&lt;/span&gt; &lt;span class="attr"&gt;charset&lt;/span&gt;&lt;span class="kwrd"&gt;="utf-8"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;HTML5 Canvas Template&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            /* styles here */&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;canvas&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="myCanvas"&lt;/span&gt; &lt;span class="attr"&gt;width&lt;/span&gt;&lt;span class="kwrd"&gt;="500"&lt;/span&gt; &lt;span class="attr"&gt;height&lt;/span&gt;&lt;span class="kwrd"&gt;="500"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Canvas not supported.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;canvas&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/javascript"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &amp;lt;script type=&lt;span class="str"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            $(document).ready(&lt;span class="kwrd"&gt;function&lt;/span&gt;() {&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;                &lt;span class="kwrd"&gt;var&lt;/span&gt; canvas = $(&lt;span class="str"&gt;"#myCanvas"&lt;/span&gt;).get(0);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;                &lt;span class="kwrd"&gt;var&lt;/span&gt; context = canvas.getContext(&lt;span class="str"&gt;"2d"&lt;/span&gt;);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;                &lt;span class="kwrd"&gt;function&lt;/span&gt; renderContent()&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;                {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;                    &lt;span class="rem"&gt;// we'll do our drawing here...&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;                }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;                renderContent();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;            });&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;&lt;br&gt;Some things to note:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On line 7, I'm setting up a &amp;lt;style&amp;gt; block where we'll put CSS rules. 
&lt;li&gt;On line 13, I've added some content in between the &amp;lt;canvas&amp;gt; and &amp;lt;/canvas&amp;gt; tags. Any browser that does not support Canvas will ignore the canvas tags, and will instead render the content within them. In this case, I'm simply displaying a message, but I could also provide a fallback solution using &lt;a href="http://silverlight.net/" target="_blank"&gt;Silverlight&lt;/a&gt; or Flash, if I chose. 
&lt;li&gt;On line 16, I'm importing the &lt;a href="http://www.jquery.com/"&gt;jQuery&lt;/a&gt; script library, which can help simplify and speed my Javascript development. I am placing my script references at the end of the page, just prior to the closing &amp;lt;/body&amp;gt; element, to ensure that my page content loads without being blocked by script loading. 
&lt;li&gt;On line 18, I am telling jQuery to execute an anonymous function when the page is ready for scripting, using jQuery's built-in &lt;a href="http://api.jquery.com/ready/" target="_blank"&gt;ready event&lt;/a&gt;. This is where I kick off processing, first getting a reference to the canvas element and its 2d drawing context (more on this in a bit), and calling the renderContent function, which is currently empty. 
&lt;li&gt;A final note…in a production site, I would separate out the CSS and JavaScript into separate files, to keep my markup nice and clean. For the sake of this blog series, I will largely keep the CSS and JavaScript in the same file, so you'll be able to see it all at once.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;br&gt;All of the parts of this template will be useful moving forward, so you may want to copy the above code and save it to a file. I'm calling mine CanvasTemplate.html:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas-Part-1---Introduc_115AA/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas-Part-1---Introduc_115AA/image_thumb.png" width="804" height="434"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;A Brief Digression – JsFiddle&lt;/h2&gt;
&lt;p&gt;Another useful tool I want to introduce, since I'll probably use it from time to time to post example code, is &lt;a href="http://jsfiddle.net/" target="_blank"&gt;JsFiddle&lt;/a&gt;. JsFiddle is, as the &lt;a href="http://doc.jsfiddle.net/" target="_blank"&gt;JsFiddle docs&lt;/a&gt; state,"&lt;em&gt;a playground for web developers, a tool which may be used in many ways.&lt;/em&gt;" It supports multiple JavaScript libraries, such as jQuery, MooTools, Prototype, and many more, and makes it easy to experiment with, and share, your web code. You can see an example in the code snippet I posted for making a grid in canvas as an aid to visualizing layout:&lt;/p&gt;
&lt;p&gt;&lt;iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/devhammer/ttEmd/11/embedded/" frameborder="0" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;It's important to note that JsFiddle is an alpha release as of this writing, and I've found a few issues when editing scripts, particularly when using tabs. But overall, it's very functional, and quite convenient for brief forays into web monkeying. For deeper development, I definitely prefer an environment like &lt;a href="http://www.microsoft.com/web/webmatrix/" target="_blank"&gt;WebMatrix&lt;/a&gt; or Visual Studio that provide a more robust editing experience.&lt;/p&gt;
&lt;h2&gt;A Blank Slate&lt;/h2&gt;
&lt;p&gt;Back to the code…as noted above, even with the addition of our JavaScript in the template, our canvas still isn't doing anything useful. In order to start drawing, we need the canvas equivalent of a pencil (or pen, or paintbrush, depending on which metaphor you prefer). And that's where the Context comes in. The HTML5 Canvas element exposes a function called getContext, which you can call like so:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; context = myCanvasElement.getContext(&lt;span class="str"&gt;"2d"&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Note that in the snippet above, I've already gotten a reference to the canvas element (you'll see how momentarily), and I'm passing in the string argument "2d" to the function. This is required, although in the current specification, there is only one drawing context, which is 2d (there may be a 3d context in future versions of the specification, which is why you have to specify 2d, even though it's the only context). It is this context that exposes all of the functions you'll call to draw on your canvas.&lt;/p&gt;
&lt;p&gt;Getting the drawing context takes just 2 lines, one to get a reference to the canvas element you want to draw on, and another to get the context itself. We'll use jQuery to grab the element, using its ID selector syntax:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; canvas = $(&lt;span class="str"&gt;"#myCanvas"&lt;/span&gt;).get(0);
&lt;span class="kwrd"&gt;var&lt;/span&gt; context = canvas.getContext(&lt;span class="str"&gt;"2d"&lt;/span&gt;);&lt;/pre&gt;
&lt;p&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
In the first line, I ask jQuery for the element with the id of "myCanvas" and call .get(0) to get the underlying element (by default, jQuery returns a set of elements wrapped with some of its useful functionality…but we just need the element itself), then in the second line I grab the canvas drawing context and stick it into a variable called, appropriately enough, "context". In our template above, I define and populate these variables at the beginning of the anonymous function called by jQuery's &lt;em&gt;ready&lt;/em&gt; event handler. Since the renderContent function is also defined within the anonymous function, it will have access to the &lt;em&gt;canvas&lt;/em&gt; and &lt;em&gt;context&lt;/em&gt; variables, while keeping both the variables and function from polluting the global namespace (that is, unintentionally exposing variables and/or functions as global to the page).&lt;/p&gt;
&lt;p&gt;We'll get into the ins and outs of the canvas drawing API in the next installment, but I'll leave you with a simple example of what you can do with Canvas, by adding the following code to the renderContent function:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; renderContent()&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    context.fillRect(0, 0, canvas.width, canvas.height);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; text = &lt;span class="str"&gt;"Hello, Canvas!"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    context.fillStyle = &lt;span class="str"&gt;"#FF0000"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    context.strokeStyle = &lt;span class="str"&gt;"#0000FF"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    context.font = &lt;span class="str"&gt;"36px sans-serif"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    context.strokeText(text, 10, 50);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    context.fillText(text, 10, 50);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Which results in the following being rendered:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas-Part-1---Introduc_115AA/image_4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas-Part-1---Introduc_115AA/image_thumb_1.png" width="404" height="399"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope you enjoyed the first installment of Exploring HTML5 Canvas. &lt;/p&gt;
&lt;p&gt;If you found this useful, why not &lt;a href="https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fdevhammer.net%2Fblog%2Fexploring-html5-canvas-part-1---introduction&amp;amp;source=tweetbutton&amp;amp;text=Exploring%20HTML5%20Canvas%3A%20Part%201%20-%20Introduction&amp;amp;url=http%3A%2F%2Fdevhammer.net%2Fblog%2Fexploring-html5-canvas-part-1---introduction%23.Tw3VjGjDgRk.twitter&amp;amp;via=AddThis" target="_blank"&gt;tell your friends&lt;/a&gt;? You can also &lt;a href="http://feeds.devhammer.net/devhammer" target="_blank"&gt;subscribe to my RSS feed&lt;/a&gt;, and &lt;a href="http://twitter.com/devhammer" target="_blank"&gt;follow me on twitter&lt;/a&gt; for more frequent updates.&lt;/p&gt;
&lt;p&gt;More parts in the series:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-2---basic-shapes" target="_blank"&gt;Part 2 – Basic Shapes&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-3---paths-and-text" target="_blank"&gt;Part 3 – Paths and Text&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://bit.ly/zsGdPs" target="_blank"&gt;Part 4 - Transformations&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/6nZeD3tEAeQ" height="1" width="1"/&gt;</description><pubDate>Tue, 31 Jan 2012 16:37:08 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/exploring-html5-canvas-part-1---introduction</guid><feedburner:origLink>http://devhammer.net:80/blog/exploring-html5-canvas-part-1---introduction</feedburner:origLink></item><item><title>Exploring HTML5 Canvas: Part 4 - Transformations</title><link>http://feeds.devhammer.net/~r/devhammer/~3/3-3rpk-mz5o/exploring-html5-canvas-part-4---transformations</link><description>&lt;p&gt;[This is part 4 of an ongoing series of posts examining the HTML5 Canvas element. In &lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-1---introduction"&gt;Part 1 of this series&lt;/a&gt;, I introduced Canvas and prepared a template to make further explorations a bit simpler, and also introduced &lt;a href="http://jsfiddle.net/"&gt;JsFiddle&lt;/a&gt;, a neat tool for experimenting with and sharing web code. In &lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-2---basic-shapes"&gt;Part 2&lt;/a&gt;, I demonstrated the ability of Canvas to allow your page background to shine through, and showed you how to render simple shapes on the drawing surface. In &lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-3---paths-and-text" target="_blank"&gt;Part 3&lt;/a&gt;, I showed how to draw paths and text in Canvas.]&lt;/p&gt; &lt;p&gt;Transformations in HTML5 Canvas are surprisingly straightforward, but come with a twist if you're used to other platforms. For example, in both SVG and &lt;a href="http://silverlight.net/" target="_blank"&gt;Silverlight&lt;/a&gt;, transforms are applied by applying additional markup elements or attributes to specific elements or groups of elements. This means that you have pretty fine-grained control of transformations, and can apply them even after a given element has been rendered, by using code to add the necessary attributes.&lt;/p&gt; &lt;p&gt;In Canvas, transformations are applied &lt;strong&gt;&lt;em&gt;before&lt;/em&gt;&lt;/strong&gt; you start drawing the path, shape, or text that you want transformed. That's because what you're transforming isn't an element at all…remember that Canvas doesn't render elements, it renders pixels, and once the pixels are drawn, they're just part of the canvas.&lt;/p&gt; &lt;p&gt;So what does this mean in practice? Well, probably best to show an example. Here's some JavaScript that draws a simple shape on our canvas (if you are new to this series, check out Part 1 to see the basic template I use to render all the examples…the code below is just dropped into the renderContent function, which is executed automatically when the page is loaded):&lt;/p&gt; &lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.beginPath();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;context.fillStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.strokeStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.arc(100,75,50,0.25*Math.PI,1.75*Math.PI);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.lineTo(100, 75);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;context.stroke();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;context.fill();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;(note that while we used hex color codes in earlier examples, you can also use named colors for the fillStyle and strokeStyle properties)&lt;/p&gt;
&lt;p&gt;The above code, used with our template, results in the following output:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://youtu.be/kBdAPkk8yMM" target="_blank"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_1_comp" border="0" alt="Transformations_1_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_1_comp_1.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now let's say we want to rotate what we've drawn by 45 degrees. Canvas exposes a rotate function for just this purpose, and it accepts one argument, which is the angle, in radians, for the rotation. We can get the radians by multiplying degrees by PI/180, so 45*PI/180 = 0.79 (rounded). If we want an exact number, we can simply send the entire equation as the argument, like so:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.rotate(45*Math.PI/180);&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;You might assume that adding this before the previous code would give the desired result. You'd be wrong. Here's what we end up with if we insert the call to rotate before calling beginPath:
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_2_comp.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_2_comp" border="0" alt="Transformations_2_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_2_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;
&lt;p&gt;Woah! Clearly that wasn't quite what we had in mind. We seem to have both rotated &lt;strong&gt;&lt;em&gt;and&lt;/em&gt;&lt;/strong&gt; translated (i.e. moved) our shape. Well, not really. In fact, this highlights one of the challenges of Canvas transformations, namely that we're not transforming our shape, we're transforming the entire canvas. In calling the rotate function, we've rotated the entire coordinate system for our canvas with the center of rotation being the 0, 0 point of the canvas (top left) which results in the shape being drawn at the angle desired, but in a different location. D'oh!
&lt;p&gt;To better illustrate what's happening, we can draw some gridlines before we draw our shape:
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; renderGrid(gridPixelSize, color)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;   context.save();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;   context.lineWidth = 0.5;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;   context.strokeStyle = color;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;   &lt;span class="rem"&gt;// horizontal grid lines&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;   &lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 0; i &amp;lt;= canvas.height; i = i + gridPixelSize)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;   {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;      context.beginPath();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;      context.moveTo(0, i);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;      context.lineTo(canvas.width, i);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;      context.closePath();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;      context.stroke();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;   }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;   &lt;span class="rem"&gt;// vertical grid lines&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;   &lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; j = 0; j &amp;lt;= canvas.width; j = j + gridPixelSize)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;   {&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;      context.beginPath();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;      context.moveTo(j, 0);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;      context.lineTo(j, canvas.height);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;      context.closePath();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;      context.stroke();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;   }&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;   context.restore();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The code above simply renders a grid of the specified size and color to the canvas. We can call it from our rendering code like so:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.rotate(45*Math.PI/180);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;strong&gt;renderGrid(20, &lt;span class="str"&gt;"red"&lt;/span&gt;)&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.beginPath();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.fillStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.strokeStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;context.arc(100,75,50,0.25*Math.PI,1.75*Math.PI);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;context.lineTo(100, 75);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;context.stroke();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;context.fill();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;The result should make it a little clearer what's going on with our Canvas transformations:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_3_comp.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_3_comp" border="0" alt="Transformations_3_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_3_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
&lt;hr&gt;
Saving and Restoring the Current Context&lt;/h3&gt;
&lt;p align="left"&gt;You might have noticed in the renderGrid function calls to the &lt;strong&gt;save&lt;/strong&gt; and &lt;strong&gt;restore&lt;/strong&gt; functions on the context object. These functions do pretty much exactly what they sound like, save the current context and restore it, so that you can apply style and transformation changes to the context and still be able to get back to where you started. Without saving and restoring the context, any transformations applied are cumulative, and you could quickly reach a point at where it would literally be impossible to figure out which way is up. One point to keep in mind is that the Canvas save state is stack-based. So if you call &lt;strong&gt;context.save()&lt;/strong&gt; twice, you now have two 2d context states saved on the stack. When you call &lt;strong&gt;context.restore()&lt;/strong&gt;, the most recently saved state will be applied to the context object. Calling &lt;strong&gt;context.restore()&lt;/strong&gt; again would apply the first saved state to the context object, and the stack would be empty.&lt;/p&gt;
&lt;p&gt;
&lt;hr&gt;
&lt;/p&gt;
&lt;p&gt;Now that it's hopefully clearer &lt;em&gt;why&lt;/em&gt; we ended up with the result we did, we might want to figure out how to compensate for this before moving on to other transformations. Probably the simplest way to go about compensating for a pending rotation transformation is to change the origin by using another available transformation, the translation. Calling &lt;strong&gt;context.translate(x, y)&lt;/strong&gt; moves the origin of your Canvas by the specified amount. So to compensate for the translation inherent in a rotate transformation, we simply need to figure out the center of the shape we are rotating, and translate the Canvas origin by that amount, then translate it back once we've done the rotation. Here's what the code looks like (note that I've added a call to context.save at the beginning and to context.restore at the end, so that when we're done drawing this shape, the context is back to its original state):&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.save();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;strong&gt;context.translate(100, 75);&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.rotate(45*Math.PI/180);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;strong&gt;context.translate(-100, -75);&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;renderGrid(20, &lt;span class="str"&gt;"red"&lt;/span&gt;)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;context.beginPath();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;context.fillStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;context.strokeStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;context.arc(100,75,50,0.25*Math.PI,1.75*Math.PI);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;context.lineTo(100, 75);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;context.stroke();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;context.fill();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;context.restore();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;The result is almost, but not quite, right:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_4_comp.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_4_comp" border="0" alt="Transformations_4_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_4_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now our shape is rotated 45 degrees as desired, but obviously it wasn't our desire to rotate our reference grid. Moving the call to renderGrid earlier in the code will do the trick:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.save();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;renderGrid(20, &lt;span class="str"&gt;"red"&lt;/span&gt;)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.translate(100, 75);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.rotate(45*Math.PI/180);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.translate(-100, -75);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;context.beginPath();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="rem"&gt;// remaining code omitted for brevity&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;context.restore();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;Much better:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_5.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_5" border="0" alt="Transformations_5" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_5_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So now that we've seen the rotate and translate transforms in action, what's left?&lt;/p&gt;
&lt;p&gt;Another useful member of the transformation crew is &lt;strong&gt;context.scale()&lt;/strong&gt;. This function, as you might expect, scales the drawing context. It takes two parameters, the x and y scale factors. If you call context.scale(2, 2) you effectively double the scale of the drawing context in both directions, as shown in the code below:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.save();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;renderGrid(20, &lt;span class="str"&gt;"red"&lt;/span&gt;)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;strong&gt;context.scale(2, 2);&lt;/strong&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.beginPath();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.fillStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;context.strokeStyle = &lt;span class="str"&gt;"Yellow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;context.arc(100,75,50,0.25*Math.PI,1.75*Math.PI);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;context.lineTo(100, 75);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;context.stroke();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;context.fill();&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;context.restore();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;which results in the following output:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_6_comp.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_6_comp" border="0" alt="Transformations_6_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_6_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note that since the call to renderGrid() is made prior to the call to context.scale(), the size of our grid has not changed, while the size of our shape has doubled (note, too, that the distance of the drawn shape from the top left corner of the canvas has also doubled).&lt;/p&gt;
&lt;p&gt;I've saved the most interesting transformations for last, &lt;strong&gt;context.transform(a,b,c,d,e,f)&lt;/strong&gt;, and &lt;strong&gt;context.setTransform(a,b,c,d,e,f)&lt;/strong&gt;. Each of these functions accept 6 parameters, which represent a matrix by which the drawing context is transformed (more on this in a moment), and each allows you to scale, rotate, translate, and skew the drawing context with a single API call. That's a lot of power packed into one function call! The major difference between transform and setTransform is that the latter clears any existing transformations prior to applying the parameters passed to it.&lt;/p&gt;
&lt;p&gt;The transformation matrix can be visualized like this:&lt;/p&gt;
&lt;p&gt;
&lt;table border="0" cellspacing="2" cellpadding="5" width="300"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="100"&gt;&lt;strong&gt;a &lt;/strong&gt;= ScaleX&lt;/td&gt;
&lt;td valign="top" width="100"&gt;&lt;strong&gt;b&lt;/strong&gt; = SkewX&lt;/td&gt;
&lt;td valign="top" width="100"&gt;&lt;strong&gt;c&lt;/strong&gt; = SkewY&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="100"&gt;&lt;strong&gt;d&lt;/strong&gt; = ScaleY&lt;/td&gt;
&lt;td valign="top" width="100"&gt;&lt;strong&gt;e&lt;/strong&gt; = TranslateX&lt;/td&gt;
&lt;td valign="top" width="100"&gt;&lt;strong&gt;f&lt;/strong&gt; = TranslateY&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;Looking at the parameters that make up the transformation matrix you might ask yourself, "how can I rotate the drawing context using this function when there aren't any rotate parameters?" Well, it turns out that if you skew the X and Y values the same amount, but skew one in the negative direction, the result is effectively a rotation. So let's take our shape after the rotate example above, and skew it with the transform function:&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.save();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;renderGrid(20, &lt;span class="str"&gt;"red"&lt;/span&gt;)&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.translate(100, 75);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;context.rotate(45*Math.PI/180);&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;context.translate(-100, -75);&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;strong&gt;context.transform(1, 0, 1, 1, 0, 0);&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;context.beginPath();&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="rem"&gt;// Drawing code omitted for brevity&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;context.restore();&lt;/pre&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;p&gt;this gives us the following output:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_7_comp.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_7_comp" border="0" alt="Transformations_7_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_7_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Notice that although we applied a skew of 1 in the +Y direction, that's not the way our skew appears to be being applied. The reason for this is that the transform function simply applies our transformation matrix to any existing transforms previously applied to the drawing context. Because our rotate transform is still in effect, "Y" is effectively 45 degrees turned from what we'd normally expect to see. If instead we call setTransform with the exact same parameters, the output will look like the following:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_8_comp.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Transformations_8_comp" border="0" alt="Transformations_8_comp" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Exploring-HTML5-Canvas_8B56/Transformations_8_comp_thumb.png" width="404" height="379"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Because setTransform removes any existing transforms, the skew now does what you might have originally expected. So while the simpler APIs of translate, rotate, and scale are great when you need a simple API for transformations, some time spent playing with the transform and setTransform functions will be of great benefit in maximizing your drawing flexibility.&lt;/p&gt;
&lt;p&gt;Here's a JsFiddle with the code from this post, if you want to play with the APIs:&lt;/p&gt;
&lt;p&gt;&lt;iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/devhammer/mkc8y/embedded/" frameborder="0" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;The HTML5 Canvas element provides some very powerful APIs for transforming the drawing context. Those coming to HTML5 from other technologies like SVG and Silverlight may need to get used to the way that transformations are applied, since they're a bit different than in those technologies, but with a little practice, you'll be applying transformations like a pro.&lt;/p&gt;
&lt;p&gt;If you found this useful, why not &lt;a href="http://twitter.com/home?status=Exploring%20HTML5%20Canvas%20-%20Transformations%20by%20Devhammer%20-%20http://bit.ly/zsGdPs" target="_blank"&gt;tell your friends&lt;/a&gt;? You can also &lt;a href="http://feeds.devhammer.net/devhammer"&gt;subscribe to my RSS feed&lt;/a&gt;, and &lt;a href="http://twitter.com/devhammer"&gt;follow me on twitter&lt;/a&gt; for more frequent updates. &lt;/p&gt;
&lt;p&gt;More parts in the series: 
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-1---introduction"&gt;Part 1 – Introduction&lt;/a&gt;
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-2---basic-shapes"&gt;Part 2 – Basic Shapes&lt;/a&gt;
&lt;li&gt;&lt;a href="http://devhammer.net/blog/exploring-html5-canvas-part-3---paths-and-text" target="_blank"&gt;Part 3 – Paths and Text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part 4 – Transformations (this post)&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Up next, I'll get moving with simple animations…don't miss it!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/3-3rpk-mz5o" height="1" width="1"/&gt;</description><pubDate>Tue, 31 Jan 2012 16:14:31 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/exploring-html5-canvas-part-4---transformations</guid><feedburner:origLink>http://devhammer.net:80/blog/exploring-html5-canvas-part-4---transformations</feedburner:origLink></item><item><title>Upcoming Events for January 30th, 2012</title><link>http://feeds.devhammer.net/~r/devhammer/~3/BlbAc89ZRzs/upcoming-events-for-january-30th-2012</link><description>&lt;p&gt;Here are the events listed in &lt;a href="http://www.communitymegaphone.com/"&gt;Community Megaphone&lt;/a&gt; for the next week (or so) for the Mid-Atlantic area, as well as webcasts of interest…this list includes events imported from the &lt;a href="https://www.technicalcommunity.com/Pages/eventcal.aspx"&gt;UGSS event calendar&lt;/a&gt;, and user group events entered in Community Megaphone are also automatically synced to the UGSS event calendar:&lt;/p&gt; &lt;h2&gt;MD&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4818"&gt;&lt;strong&gt;An Introduction to Expression Blend&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, February 08, 2012 6:30 PM, Rockville, MD&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=51+Mannakee+Street%2c+Rockville%2c+MD&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View An Introduction to Expression Blend on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=4818&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Abstract:&lt;br&gt;Microsoft Expression Blend is the premier GUI editor for WPF and Silverlight applications.In this presentation you will receive an introduction to the Blend UI and how to use it to quickly and easily build an application interface. Topics will include Configuration, Layout Controls, how to leverage Blend with Visual Studio, and more.&lt;br&gt;Bio:&lt;br&gt;Joel Cochran is an Expression Blend MVP, an INETA Community Champion, and a Microsoft Certified Technology Specialist (MCTS) in Windows Forms and WPF. He is the founder of BlendSIG, a virtual Special Interest Group focused on Expression Blend and author of "Expression Blend in Action" by Manning Publications. He is also the author of "The Practical MVVM Manifesto" (http://practicalmvvm.com). He has been developing for Windows since 2003 and is a self-proclaimed "Blend Evangelist". A frequent speaker at User Groups and Code Camps, he enjoys teaching and writing about .NET and other topics. You can find him online at http://www.developingfor.net or on Twitter at http://twitter.com/joelcochran. Joel has served as the Director of Operations for Stonewall Technologies, Inc., an ISV, in Staunton, VA, since 2000.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4818"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4818"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4818.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;Online&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4977"&gt;&lt;strong&gt;SSWUG Online Course: Introduction to Windows Azure&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 31, 2012 12:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; SSWUG.ORG's virtual class will provide you with the knowledge of Window Azure's components and aspects to run applications without the expense needed to maintain the hardware and save money on licensing costs.&lt;br&gt;Scott Klein, who is a Microsoft SQL Azure MVP and the co-founder of Blue Syntax Consulting, will showcase the different types of services that can be hosted in Windows Azure such as web and worker roles, and then move on to the basics of Azure's durable storage solution, which include Azure queues, blobs and tables.&lt;br&gt;He will also provide a introduction on SQL Azure - Microsoft's cloud-based relational database, and how you can use SQL Azure to store your relational data on the cloud. This will be followed up by sessions dealing with Azure AppFabric, cloud computing patterns and practices, as well as diagnostics and service management.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4977"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4977.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=5017"&gt;&lt;strong&gt;Introduction to Unit Testing &lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, February 01, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Software testing isn’t just a task for QA. In order to prevent bugs and release quality code to market, you also need developer testing, including unit testing. &lt;br&gt;Learn the difference between unit tests, integration tests, manual tests and acceptance tests.&lt;br&gt;Learn:&lt;br&gt;• QA vs. Developer Testing&lt;br&gt;• Benefits of unit testing&lt;br&gt;• xUnit Frameworks&lt;br&gt;• The difference between unit testing and test driven development (TDD).&lt;br&gt;Join this webinar to learn what you need to know in order to start testing today.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=5017"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/5017.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4999"&gt;&lt;strong&gt;SSWUG Webcast: SSRS Data-driven Subscription using SSIS&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, February 01, 2012 11:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; SQL Server Reporting Services provides a powerful tool to render report based on information in a database table. However, you are required to purchase an Enterprise license of SQL Server in order to use this feature.&lt;br&gt;In this session, Russel Loski, who is a Microsoft Certified Trainer and an independent software developer, will create an SQL Server Integration Services (SSIS) package that renders reports to the file system based on values stored in the database.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4999"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4999.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;VA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4899"&gt;&lt;strong&gt;In-Person Training: Advanced SharePoint BI Security and Configuration (Metro Washington D.C.)&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Monday, January 30, 2012 8:30 AM, Reston, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1805+Library+Street%2c+Reston%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View In-Person Training: Advanced SharePoint BI Security and Configuration (Metro Washington D.C.) on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4899&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; In a partnership agreement between SSWUG.ORG and SolidQ, a fast-paced, in-person seminar on configuring and securing SharePoint 2010 and business intelligence services will be offered on Jan. 30-31 from 8:30 a.m. to 4:30 p.m. in Reston, Virginia.&lt;br&gt;Carl Rabeler, course instructor and director of SolidQ's BI Center of Excellence, will review the SharePoint 2010 security architecture for authentication and authorization, particularly as it relates to connectivity to external data sources. He will also provide information on configuring administrative access to SharePoint 2010, configuring service application accounts, and user permissions.&lt;br&gt;Additionally, you will learn about the nuances of configuring and security each of the core business intelligence components of SharePoint 2010: Excel Services, PerformancePoint Services, Reporting Services and PowerPivot Services. Finally, you will also learn about changes to Reporting Services security and configuration with SQL Server 2012.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4899"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4899"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4899.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4943"&gt;&lt;strong&gt;February Meeting - What You Need to Know about Parallelism&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, February 02, 2012 6:00 PM, Roanoke, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=5925+Cove+Rd%2c+Roanoke%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View February Meeting - What You Need to Know about Parallelism on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4943&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; The Free Lunch is Over: What You Need to Know about Parallelism&lt;br&gt;Presented by Stuart Leitch:&lt;br&gt;Single thread CPU performance improvements have largely stalled out. The sequential performance “free lunch” most developers enjoyed from hardware advances is over. With the industry shift to multiple core systems, performance has to be realized through concurrency and many developers will find themselves building applications designed to scale as the number of cores increases. This session will provide a broad review of the trends in parallelism and an overview of major patterns for parallelizing your applications.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4943"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4943"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4943.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;Want your events listed? You can &lt;a href="http://www.communitymegaphone.com/AddEvent.aspx"&gt;add them here.&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can also add your events via the Community Megaphone web service API. You can get more information on the API, and how to sign up, at &lt;a href="http://www.communitymegaphone.com/API.aspx"&gt;http://www.communitymegaphone.com/API.aspx&lt;/a&gt;. You can also &lt;a href="http://blogs.msdn.com/gduthie/contact.aspx"&gt;email me&lt;/a&gt; for more information.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/BlbAc89ZRzs" height="1" width="1"/&gt;</description><pubDate>Mon, 30 Jan 2012 20:20:47 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/upcoming-events-for-january-30th-2012</guid><feedburner:origLink>http://devhammer.net:80/blog/upcoming-events-for-january-30th-2012</feedburner:origLink></item><item><title>CapArea.NET Follow-up: HTML5 Metro apps resources</title><link>http://feeds.devhammer.net/~r/devhammer/~3/racsE4Tco14/caparea.net-follow-up-html5-metro-apps-resources</link><description>&lt;p&gt;&lt;a href="http://caparea.net/Default.aspx"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" border="0" alt="CapArea.Net" align="left" src="http://caparea.net/Portals/0/capnet.gif"&gt;&lt;/a&gt;My thanks to everyone who came out tonight for the &lt;a href="http://www.caparea.net/"&gt;Capital Area .NET User Group&lt;/a&gt; for my presentation on developing Windows 8 Metro style applications using HTML5 and JavaScript. Great questions and lots of great discussion. Thanks for keeping me on my toes!&lt;/p&gt; &lt;p&gt;As promised, I wanted to share pointers to some additional recorded sessions from BUILD that you may find useful, as well as a link to the sample Canvas Paint app that I used for my demos. If you're interested in getting the additional tweaks I added to the sample to support persisting the brush color and size, etc. please &lt;a href="http://devhammer.net/Contact"&gt;drop me a note via my contact page&lt;/a&gt;, and I will be happy to share it.&lt;/p&gt; &lt;h2&gt;Additional Related BUILD Sessions:&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://bit.ly/w8app476" target="_blank"&gt;APP-476T Code with confidence: dynamic web content in Metro style apps using HTML5&lt;/a&gt;&amp;nbsp; &lt;li&gt;&lt;a href="http://bit.ly/w8app512" target="_blank"&gt;APP-512T The web-to-Windows journey: turning your web assets into a Windows app&lt;/a&gt;&amp;nbsp; &lt;li&gt;&lt;a href="http://bit.ly/w8app929" target="_blank"&gt;APP-929T Best practices for writing safe and secure Metro style apps using HTML5&lt;/a&gt;  &lt;li&gt;&lt;a href="http://bit.ly/w8plat475" target="_blank"&gt;PLAT-475T Create experiences that span devices&lt;/a&gt;  &lt;li&gt;&lt;a href="http://bit.ly/w8app162" target="_blank"&gt;APP-162T Building high performance Metro style apps using HTML5&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;and the presentation on which my talk tonight was based:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://bit.ly/w8app740" target="_blank"&gt;APP-740T Metro style apps using HTML5 from start to finish&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Nevin House, who attended last night's talk, got in touch with me via email, and recommended the following two talks on JavaScript, and I heartily agree…both are great talks and are highly recommended for anyone wishing to better understand JavaScript in the context of Metro style apps in Windows 8:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://bit.ly/w8tool533" target="_blank"&gt;Using the Windows Runtime from JavaScript&lt;/a&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;a href="http://bit.ly/w8tool501" target="_blank"&gt;Introducing the Windows libraries for JavaScript&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Both presentations feature some of the best presenters from BUILD. Enjoy!&lt;/p&gt; &lt;h2&gt;Canvas Paint Sample App&lt;/h2&gt; &lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Cap.NET-Follow-up-HTML5-Metro-apps-resou_13F4F/canvasPaintLogo_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="canvasPaintLogo" border="0" alt="canvasPaintLogo" align="left" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Cap.NET-Follow-up-HTML5-Metro-apps-resou_13F4F/canvasPaintLogo_thumb.png" width="260" height="83"&gt;&lt;/a&gt;The Canvas Paint sample app, along with many other samples and demos, may be downloaded from the &lt;a href="http://code.msdn.microsoft.com/windowsapps" target="_blank"&gt;Samples area for Windows 8&lt;/a&gt;. The direct link to the Canvas Paint sample is:&lt;/p&gt; &lt;p&gt;&lt;a title="http://code.msdn.microsoft.com/windowsapps/CanvasPaint-878fa5d5" href="http://code.msdn.microsoft.com/windowsapps/CanvasPaint-878fa5d5"&gt;http://code.msdn.microsoft.com/windowsapps/CanvasPaint-878fa5d5&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Note that you can browse the code directly online, or download the sample and run it locally (if you have installed the &lt;a href="http://msdn.microsoft.com/en-us/windows/apps/br229516/" target="_blank"&gt;Windows 8 developer preview&lt;/a&gt;).&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/racsE4Tco14" height="1" width="1"/&gt;</description><pubDate>Wed, 25 Jan 2012 14:22:09 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/caparea.net-follow-up-html5-metro-apps-resources</guid><feedburner:origLink>http://devhammer.net:80/blog/caparea.net-follow-up-html5-metro-apps-resources</feedburner:origLink></item><item><title>Upcoming Events for January 23rd, 2012</title><link>http://feeds.devhammer.net/~r/devhammer/~3/3uaZ-jdqAMk/upcoming-events-for-january-23rd-2012</link><description>&lt;p&gt;Here are the events listed in &lt;a href="http://www.communitymegaphone.com/"&gt;Community Megaphone&lt;/a&gt; for the next week (or so) for the Mid-Atlantic area, as well as webcasts of interest…this list includes events imported from the &lt;a href="https://www.technicalcommunity.com/Pages/eventcal.aspx"&gt;UGSS event calendar&lt;/a&gt;, and user group events entered in Community Megaphone are also automatically synced to the UGSS event calendar:&lt;/p&gt; &lt;h2&gt;Online&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4970"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone:Session 1-Fast Track Your First App&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 24, 2012 11:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" align="left" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Government and citizen-oriented apps represent a huge emerging market for mobile developers. These “Let’s Build Something Mobile” Workshops will walk you through the basics of creating, testing and deploying a Public Sector app, so that No Developer is Left Behind taking advantage of this new market. As a participant you will have the opportunity to create your own unique Public Sector Windows Phone app that is ready to be deployed to the Windows Phone Marketplace. During each of the two sessions, experts from Microsoft and ComponentOne will be available to answer questions and offer guidance.&lt;br&gt;During this workshop, you’ll be exposed to the basics of creating a Windows Phone App and deploying to the Marketplace. As an attendee, you will be given some time during the session to use what you’ve learned to develop your own apps which access freely-available Public Sector data. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio® for Windows Phone&lt;br&gt;Pre-requisite: Download/Install &lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone &lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4970"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4970.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4973"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone Series: Session 1 - Fast Track Your First App&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 24, 2012 4:00 PM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; During this workshop, you’ll be exposed to the basics of creating a Windows Phone App and deploying to the Marketplace. As an attendee, you will be given some time during the session to use what you’ve learned to develop your own apps which access freely-available Public Sector data. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio(r) for Windows Phone&lt;br&gt;Pre-requisite: Download/Install&lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone&lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4973"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4973.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4988"&gt;&lt;strong&gt;Testing the Untestable: Unit Testing Legacy Code &lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 25, 2012 9:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Webinar Registration&lt;br&gt;Everybody has legacy code. How do you apply unit testing to existing code? Code that wasn’t meant to testing. &lt;br&gt;This is a hardcore session, where we take an open source application and add tests to it. In the process, we’ll refactor the code, discuss readability, and where to even begin. &lt;br&gt;This is an intensive demonstration of automated testing hard-core legacy code. If you are a legacy ninja, check it out.&lt;br&gt;Sign up and you will get a sneak preview of the latest that's brewing in Typemock's labs  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4988"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4988.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4992"&gt;&lt;strong&gt;Online - Azure Florida Association: Demystifying SQL Azure with SQL Azure MVP Vikas Sahni&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 25, 2012 6:30 PM, , Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; 01/25/2012 - 4:00 PM - Online Meeting - What is SQL Azure, Value Proposition, Usage scenarios, Concepts and Architecture, What is there and what is not, Tips and Tricks  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4992"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4992.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4974"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone Series: Session 2 - Give Your App Some POP&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 26, 2012 11:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Enhance the look and functionality of your existing Windows Phone app (or one created in the Fast Track Your First App session) by leveraging capabilities specific to the Windows Phone API and by using advanced UI controls. You’ll get a feel for Microsoft’s Expression Blend design tools too. As an attendee, you will be given some time during the session to use what you’ve learned in order to make improvements to your apps. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio(r) for Windows Phone&lt;br&gt;Pre-requisite: Download/Install&lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone&lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4974"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4974.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4983"&gt;&lt;strong&gt;SharePoint ShopTalk&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 26, 2012 12:30 PM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt;&lt;br&gt;REGISTER FOR A SPECIAL EDITION OF SHAREPOINT SHOPTALK: PANELIST SPOTLIGHT - TIPS &amp;amp; TRICKS WITH K2! &lt;br&gt;Sharepoint ShopTalk is a live, dynamic discussion held weekly amongst SharePoint Professionals. It is an excellent source for users who need to discuss challenges or are looking for answers to pressing contemporary SharePoint questions. All are welcome to take advantage of this forum that features leading experts in the field.&lt;br&gt;K2: No Code Solutions for Building Workflow Applications in SharePoint&lt;br&gt;See how K2 offers an easier way to build and automate process-driven solutions in SharePoint, plus provides the tools necessary to support the entire life cycle of your business processes, including workflow design and modeling, business data and enterprise system integration, reporting and analysis, and process administration. All without code!&lt;br&gt;Benefits:&lt;br&gt;· Learn about key concepts and best practices of Business Process Management&lt;br&gt;· See how the K2 platform can be used to reduce time and costs through rapid workflow creation and deployment&lt;br&gt;· Learn how K2 can leverage and enhance your existing Microsoft investments&lt;br&gt;Speaker Bio&lt;br&gt;Greg Sanderson has 15 years of experience in application design, architecture, analysis, training, and project management. He is currently a technical sales engineer for K2 in the Eastern US and Canada regions. Prior to K2, Greg was responsible for managing application development projects for News America Marketing's internal and external online presence. He oversaw multiple development teams and areas of responsibility, including SharePoint and related .NET applications.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4983"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4983.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4975"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone Series: Session 2-Give Your App Some POP&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 26, 2012 4:00 PM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Enhance the look and functionality of your existing Windows Phone app (or one created in the Fast Track Your First App session) by leveraging capabilities specific to the Windows Phone API and by using advanced UI controls. You’ll get a feel for Microsoft’s Expression Blend design tools too. As an attendee, you will be given some time during the session to use what you’ve learned in order to make improvements to your apps. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio(r) for Windows Phone&lt;br&gt;Pre-requisite: Download/Install&lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone&lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4975"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4975.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4977"&gt;&lt;strong&gt;SSWUG Online Course: Introduction to Windows Azure&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 31, 2012 12:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; SSWUG.ORG's virtual class will provide you with the knowledge of Window Azure's components and aspects to run applications without the expense needed to maintain the hardware and save money on licensing costs.&lt;br&gt;Scott Klein, who is a Microsoft SQL Azure MVP and the co-founder of Blue Syntax Consulting, will showcase the different types of services that can be hosted in Windows Azure such as web and worker roles, and then move on to the basics of Azure's durable storage solution, which include Azure queues, blobs and tables.&lt;br&gt;He will also provide a introduction on SQL Azure - Microsoft's cloud-based relational database, and how you can use SQL Azure to store your relational data on the cloud. This will be followed up by sessions dealing with Azure AppFabric, cloud computing patterns and practices, as well as diagnostics and service management.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4977"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4977.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;VA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4972"&gt;&lt;strong&gt;High Availability and Disaster Recovery for SQL 2012&lt;/strong&gt; &lt;/a&gt;&lt;br&gt;Monday, January 23, 2012 7:00 PM, Vienna, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1900+Gallows+Road+%2c+Vienna%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View High Availability and Disaster Recovery for SQL 2012  on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4972&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; NOVA SQL User Group Meeting&lt;br&gt;SQL 2012 introduces a multitude of changes in the HA and DR stacks. We will review the options we currently have available in SQL 2008 R2, and discuss what changes both in clustering and the big new feature of SQL 2012 AlwaysOn Availability Groups. Joe will give a demo of the Availability Groups feature, and show how you can have a multi-site DR scenario without even talking to your SAN admin.&lt;br&gt;Joey D'Antoni is a DBA with over a decade of experience working in both Fortune 500 and smaller firms. He is currently working at Comcast. He holds a BS in Computer Information Systems from Louisiana Tech University, and a MBA from North Carolina State University. He is the Vice President of the Philadelphia SQL Server Users Group, and a member of the board of the SQL/Oracle and Health Care PASS VCs. Joe is a frequent speaker a local user groups, Code Camps, and SQL Saturdays.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4972"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4972"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4972.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4993"&gt;&lt;strong&gt;Windows 8 Metro Apps using HTML 5 From Start to Finish - G. Andrew Duthie (Microsoft)&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 24, 2012 6:30 PM, Vienna, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1900+Gallows+Road%2c+Vienna%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Windows 8 Metro Apps using HTML 5 From Start to Finish - G. Andrew Duthie (Microsoft) on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4993&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Get started writing Metro style apps using your HTML5, JavaScript, and CSS skills today! Come dive into the specifics of this exciting platform and see how you can use your Web skills to build deeply-integrated Windows apps. You’ll discover how this mirrors or differs from traditional Web programming and how to harness the rich capabilities of Windows 8 through JavaScript and the Windows Runtime.&lt;br&gt;&lt;br&gt;G. Andrew Duthie, aka devhammer, is the Developer Evangelist for Microsoft’s Mid-Atlantic States district, where he provides support and education for developers working with the .NET development platform. In addition to his work with Microsoft, Andrew is the author of several books on ASP.NET and web development, and has spoken at numerous industry conferences from VSLive! and ASP.NET Connections, to Microsoft’s Professional Developer Conference (PDC) and Tech-Ed. Andrew has been participating in the user group community since way back in 1997, when one of his co-workers dragged him out to the Internet Developers User Group in Tyson's Corner, VA, and he's been hooked ever since.&lt;br&gt;Andrew is also the creator and developer of Community Megaphone, a site designed for promoting and finding developer community events.&lt;br&gt;In addition to his work in software development, Andrew has enjoyed some recent forays into the world of hardware experimentation, including developing for Kinect and .NET Gadgeteer, using his newly-formed hardware chops to do everything from blinking LEDs and making strange noises, to flying a helicopter with his bare hands.&lt;br&gt;Andrew can be reached through his blog at http://devhammer.net/. You can also follow Andrew on twitter @devhammer.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4993"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4993"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4993.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4899"&gt;&lt;strong&gt;In-Person Training: Advanced SharePoint BI Security and Configuration (Metro Washington D.C.)&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Monday, January 30, 2012 8:30 AM, Reston, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1805+Library+Street%2c+Reston%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View In-Person Training: Advanced SharePoint BI Security and Configuration (Metro Washington D.C.) on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4899&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; In a partnership agreement between SSWUG.ORG and SolidQ, a fast-paced, in-person seminar on configuring and securing SharePoint 2010 and business intelligence services will be offered on Jan. 30-31 from 8:30 a.m. to 4:30 p.m. in Reston, Virginia.&lt;br&gt;Carl Rabeler, course instructor and director of SolidQ's BI Center of Excellence, will review the SharePoint 2010 security architecture for authentication and authorization, particularly as it relates to connectivity to external data sources. He will also provide information on configuring administrative access to SharePoint 2010, configuring service application accounts, and user permissions.&lt;br&gt;Additionally, you will learn about the nuances of configuring and security each of the core business intelligence components of SharePoint 2010: Excel Services, PerformancePoint Services, Reporting Services and PowerPivot Services. Finally, you will also learn about changes to Reporting Services security and configuration with SQL Server 2012.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4899"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4899"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4899.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4943"&gt;&lt;strong&gt;February Meeting - What You Need to Know about Parallelism&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, February 02, 2012 6:00 PM, Roanoke, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=5925+Cove+Rd%2c+Roanoke%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View February Meeting - What You Need to Know about Parallelism on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4943&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; The Free Lunch is Over: What You Need to Know about Parallelism&lt;br&gt;Presented by Stuart Leitch:&lt;br&gt;Single thread CPU performance improvements have largely stalled out. The sequential performance “free lunch” most developers enjoyed from hardware advances is over. With the industry shift to multiple core systems, performance has to be realized through concurrency and many developers will find themselves building applications designed to scale as the number of cores increases. This session will provide a broad review of the trends in parallelism and an overview of major patterns for parallelizing your applications.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4943"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4943"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4943.ics"&gt;Add To Calendar&lt;/a&gt; ]&lt;/p&gt; &lt;p&gt;Want your events listed? You can &lt;a href="http://www.communitymegaphone.com/AddEvent.aspx"&gt;add them here.&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can also add your events via the Community Megaphone web service API. You can get more information on the API, and how to sign up, at &lt;a href="http://www.communitymegaphone.com/API.aspx"&gt;http://www.communitymegaphone.com/API.aspx&lt;/a&gt;. You can also &lt;a href="http://blogs.msdn.com/gduthie/contact.aspx"&gt;email me&lt;/a&gt; for more information.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/3uaZ-jdqAMk" height="1" width="1"/&gt;</description><pubDate>Mon, 23 Jan 2012 14:36:05 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/upcoming-events-for-january-23rd-2012</guid><feedburner:origLink>http://devhammer.net:80/blog/upcoming-events-for-january-23rd-2012</feedburner:origLink></item><item><title>Introducing Devhammer's Garage</title><link>http://feeds.devhammer.net/~r/devhammer/~3/voiSHWDZBf4/introducing-devhammer-s-garage</link><description>&lt;p&gt;Over the last few months, I've spent a good bit of my free time (and some of my not-so-free time) learning about hardware and microcontrollers. One product of this will be a series of blog posts I'm working on detailing one of the projects I've built using Kinect, &lt;a href="http://netmf.com/gadgeteer/" target="_blank"&gt;.NET Gadgeteer&lt;/a&gt;, and a few other odds and ends. I also just started working on my first from-scratch robot with my kids yesterday. So I figured there might be a need for a specific landing point on my site for my hardware-related adventures, and I've decided to call it &lt;a href="http://devhammer.net/hardware"&gt;Devhammer's Garage&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;In the garage, you'll find information about my current hardware projects, including photos, links to other interesting sites, and more. If you're a geek who's into making stuff, I hope that you'll find Devhammer's Garage a useful addition, and I welcome comments, questions, and suggestions. And to whet your appetite, here's a picture of my next build-in-progress, which I call the Hydrabot (so named for the fact that it's powered by &lt;a href="http://www.ghielectronics.com/" target="_blank"&gt;GHI&lt;/a&gt;'s &lt;a href="http://www.ghielectronics.com/catalog/product/328" target="_blank"&gt;FEZ Hydra&lt;/a&gt; .NET Gadgeteer mainboard):&lt;/p&gt; &lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Introducing-Devhammers-Garage_90C0/Hydrabot_2.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Hydrabot" border="0" alt="Hydrabot" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Introducing-Devhammers-Garage_90C0/Hydrabot_thumb.jpg" width="404" height="304"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The gearbox is a &lt;a href="http://www.pololu.com/catalog/product/114" target="_blank"&gt;Tamiya double gearbox&lt;/a&gt; geared at 114.7:1, and powered by two separate motors. The wheels are from a LEGO Mindstorms NXT set, attached using &lt;a href="http://www.pololu.com/catalog/product/1011" target="_blank"&gt;adapters that Tamiya offers&lt;/a&gt; for their hex shafts. The Hydra mainboard and &lt;a href="http://www.ghielectronics.com/catalog/product/343" target="_blank"&gt;Seeed Studios OLED Display module&lt;/a&gt; are mounted to a &lt;a href="http://www.pololu.com/catalog/product/86" target="_blank"&gt;Tamiya Universal Plate kit&lt;/a&gt;, and not visible in the photo above is a &lt;a href="http://www.pololu.com/catalog/product/66" target="_blank"&gt;ball caster&lt;/a&gt; which will allow the robot to turn easily based on difference in speed between the two front wheels. &lt;/p&gt; &lt;p&gt;I'm early in the build process, and I'm kind of designing this first robot as I go along, so I'm still deciding on what kind of sensors to use to help it navigate, etc. The Tamiya parts are very easy to work with. Assembling the gearbox took about 40 minutes or so, in part because I was showing my kids what I was doing as I was doing it, and in part because I took my time to ensure that both sides were geared identically. One advantage of using a gearbox like this is that you can get pretty good torque from even the small DC motors that come with the gearbox, which should help power over any obstacles in the way.&lt;/p&gt; &lt;p&gt;I'll post more pics and videos as the project progresses, and will have more detailed build information over at &lt;a href="http://devhammer.net/hardware"&gt;the Garage&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/voiSHWDZBf4" height="1" width="1"/&gt;</description><pubDate>Sat, 21 Jan 2012 15:27:50 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/introducing-devhammer-s-garage</guid><feedburner:origLink>http://devhammer.net:80/blog/introducing-devhammer-s-garage</feedburner:origLink></item><item><title>Upcoming Events for January 16th, 2012</title><link>http://feeds.devhammer.net/~r/devhammer/~3/nx3TrGvANDw/upcoming-events-for-january-16th-2012</link><description>&lt;p&gt;Here are the events listed in &lt;a href="http://www.communitymegaphone.com/"&gt;Community Megaphone&lt;/a&gt; for the next week (or so) for the Mid-Atlantic area, as well as webcasts of interest…this list includes events imported from the &lt;a href="https://www.technicalcommunity.com/Pages/eventcal.aspx"&gt;UGSS event calendar&lt;/a&gt;, and user group events entered in Community Megaphone are also automatically synced to the UGSS event calendar:&lt;/p&gt; &lt;h2&gt;DC&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4876"&gt;&lt;strong&gt;Break the If Habit&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 17, 2012 6:30 PM, Washington, DC&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=2400+N+Street+NW%2c+Washington%2c+DC&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Break the If Habit on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=4876&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Branching logic is one of the foundations of computer programming. But like vodka, the If statement is best consumed in moderation. While the first If is harmless, and maybe even a little thrilling, soon there's a second, a third, a fourth and before you know it -- you wake up under your desk with a method you don't even recognize much less understand.&lt;br&gt;In this session we'll explore some of the common If abuses and learn how to refactor them into more readable and adaptable code. We'll use design patterns to put the demon If back in its bottle and keep it there. Saner code is within reach, and this is the first step to break the the If habit.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4876"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4876"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4876.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;Online&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4906"&gt;&lt;strong&gt;Testing the Untestable: Unit Testing Legacy Code &lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 18, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Everybody has legacy code. How do you apply unit testing to existing code? Code that wasn’t meant to testing. &lt;br&gt;This is a hardcore session, where we take an open source application and add tests to it. In the process, we’ll refactor the code, discuss readability, and where to even begin. &lt;br&gt;This is an intensive demonstration of automated testing hard-core legacy code. If you are a legacy ninja, check it out.&lt;br&gt;Everyone is welcome but it is most appropriate for people with a background in unit testing and medium to advanced skills. If you’re a unit testing ninja, this webinar is for you!  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4906"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4906.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4970"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone:Session 1-Fast Track Your First App&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 24, 2012 11:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Government and citizen-oriented apps represent a huge emerging market for mobile developers. These “Let’s Build Something Mobile” Workshops will walk you through the basics of creating, testing and deploying a Public Sector app, so that No Developer is Left Behind taking advantage of this new market. As a participant you will have the opportunity to create your own unique Public Sector Windows Phone app that is ready to be deployed to the Windows Phone Marketplace. During each of the two sessions, experts from Microsoft and ComponentOne will be available to answer questions and offer guidance.&lt;br&gt;During this workshop, you’ll be exposed to the basics of creating a Windows Phone App and deploying to the Marketplace. As an attendee, you will be given some time during the session to use what you’ve learned to develop your own apps which access freely-available Public Sector data. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio® for Windows Phone&lt;br&gt;Pre-requisite: Download/Install &lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone &lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4970"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4970.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4973"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone Series: Session 1 - Fast Track Your First App&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 24, 2012 4:00 PM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; During this workshop, you’ll be exposed to the basics of creating a Windows Phone App and deploying to the Marketplace. As an attendee, you will be given some time during the session to use what you’ve learned to develop your own apps which access freely-available Public Sector data. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio(r) for Windows Phone&lt;br&gt;Pre-requisite: Download/Install&lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone&lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4973"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4973.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4974"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone Series: Session 2 - Give Your App Some POP&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 26, 2012 11:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Enhance the look and functionality of your existing Windows Phone app (or one created in the Fast Track Your First App session) by leveraging capabilities specific to the Windows Phone API and by using advanced UI controls. You’ll get a feel for Microsoft’s Expression Blend design tools too. As an attendee, you will be given some time during the session to use what you’ve learned in order to make improvements to your apps. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio(r) for Windows Phone&lt;br&gt;Pre-requisite: Download/Install&lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone&lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4974"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4974.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4975"&gt;&lt;strong&gt;Microsoft-ComponentOne Hands-On-Workshops for Windows Phone Series: Session 2-Give Your App Some POP&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 26, 2012 4:00 PM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Enhance the look and functionality of your existing Windows Phone app (or one created in the Fast Track Your First App session) by leveraging capabilities specific to the Windows Phone API and by using advanced UI controls. You’ll get a feel for Microsoft’s Expression Blend design tools too. As an attendee, you will be given some time during the session to use what you’ve learned in order to make improvements to your apps. The presenter along with resources from Microsoft and ComponentOne will be available to support you along the way.&lt;br&gt;*Attendees will receive a complimentary 1-year subscription for ComponentOne Studio(r) for Windows Phone&lt;br&gt;Pre-requisite: Download/Install&lt;br&gt;* Visual Studio Express &amp;amp; Tools http://aka.ms/getphone&lt;br&gt;* ComponentOne Studio(r) for Windows Phone (Trial Edition) http://www.componentone.com/SuperProducts/StudioWindowsPhone/  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4975"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4975.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;PA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4967"&gt;&lt;strong&gt;Philly .NET Monthly Meeting: ALM&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 18, 2012 5:30 PM, Malvern, PA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=45+Liberty+Boulevard+%2c+Malvern%2c+PA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Philly .NET Monthly Meeting: ALM on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4967&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; This month we will be discussing Application Lifecycle Management  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4967"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4967"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4967.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;VA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4624"&gt;&lt;strong&gt;The Blackboard Advanced Platform Environment (A performance based private cloud solution)&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 19, 2012 6:30 PM, Arlington, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1501+Lee+Highway%2c+Suite+400%2c+Arlington%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View The Blackboard Advanced Platform Environment (A performance based private cloud solution) on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4624&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; A discussion on the private cloud hosting platform deployed to support Blackboard Managed Hosting. The Blackboard Advanced Platform Environment (APE) is a performance based cloud platform supporting more than 1000 clients and 10’s of millions of educational clients around the globe.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4624"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4624"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4624.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4830"&gt;&lt;strong&gt;CapArea Silverlight SIG - The XNA Framework and Windows Phone 7 - Franklin Balaguer&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 19, 2012 7:00 PM, Arlington, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=2300+Wilson+Blvd%2c+Arlington%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View CapArea Silverlight SIG - The XNA Framework and Windows Phone 7 - Franklin Balaguer on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4830&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Abstract:&lt;br&gt;XNA Game Studio and the XNA Framework are designed for cross-platform gaming scenarios with support for Windows Phone 7, Xbox 360, and Windows-based PCs. This allows you to target more platforms from the same code base. XNA Game Studio includes the XNA Framework, a set of managed libraries designed for game development based on the Microsoft .NET Framework.&lt;br&gt;In this workshop, I will go over some free resources available to help you create your own Windows Phone 7 game and then sell it on the WindowsPhone MarketPlace. I will also touch on the basics of XNA (drawing a sprite, handling of input touch, playing sounds, and game state management). Lastly, I will discuss the certification process for getting your game approved and placed on the MarketPlace.&lt;br&gt;Bio:&lt;br&gt;Franklin Balaguer is U.S. Air Force veteran. He spent 8 years in the Air Force managing vehicle fleets at various bases in the United States and while deployed overseas. Frank got his start with computers writing programs to automate tasks and processes everywhere he encountered them. While in the Air Force, he also acquired several certifications including the Microsoft Certified System Engineer, which help him land a job at Accenture. Frank has been with Accenture for the past 11 years helping to write and deliver software to thier clients.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4830"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4830"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4830.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4972"&gt;&lt;strong&gt;High Availability and Disaster Recovery for SQL 2012 &lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Monday, January 23, 2012 7:00 PM, Vienna, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1900+Gallows+Road+%2c+Vienna%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View High Availability and Disaster Recovery for SQL 2012  on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4972&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; NOVA SQL User Group Meeting&lt;br&gt;SQL 2012 introduces a multitude of changes in the HA and DR stacks. We will review the options we currently have available in SQL 2008 R2, and discuss what changes both in clustering and the big new feature of SQL 2012 AlwaysOn Availability Groups. Joe will give a demo of the Availability Groups feature, and show how you can have a multi-site DR scenario without even talking to your SAN admin.&lt;br&gt;Joey D'Antoni is a DBA with over a decade of experience working in both Fortune 500 and smaller firms. He is currently working at Comcast. He holds a BS in Computer Information Systems from Louisiana Tech University, and a MBA from North Carolina State University. He is the Vice President of the Philadelphia SQL Server Users Group, and a member of the board of the SQL/Oracle and Health Care PASS VCs. Joe is a frequent speaker a local user groups, Code Camps, and SQL Saturdays.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4972"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4972"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4972.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;Want your events listed? You can &lt;a href="http://www.communitymegaphone.com/AddEvent.aspx"&gt;add them here.&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can also add your events via the Community Megaphone web service API. You can get more information on the API, and how to sign up, at &lt;a href="http://www.communitymegaphone.com/API.aspx"&gt;http://www.communitymegaphone.com/API.aspx&lt;/a&gt;. You can also &lt;a href="http://blogs.msdn.com/gduthie/contact.aspx"&gt;email me&lt;/a&gt; for more information.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/nx3TrGvANDw" height="1" width="1"/&gt;</description><pubDate>Mon, 16 Jan 2012 16:59:52 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/upcoming-events-for-january-16th-2012</guid><feedburner:origLink>http://devhammer.net:80/blog/upcoming-events-for-january-16th-2012</feedburner:origLink></item><item><title>Upcoming Events for January 9th, 2012</title><link>http://feeds.devhammer.net/~r/devhammer/~3/dTNXeQVe_q8/upcoming-events-for-january-9th-2012</link><description>&lt;p&gt;Here are the events listed in &lt;a href="http://www.communitymegaphone.com/"&gt;Community Megaphone&lt;/a&gt; for the next week (or so) for the Mid-Atlantic area, as well as webcasts of interest…this list includes events imported from the &lt;a href="https://www.technicalcommunity.com/Pages/eventcal.aspx"&gt;UGSS event calendar&lt;/a&gt;, and user group events entered in Community Megaphone are also automatically synced to the UGSS event calendar:&lt;/p&gt; &lt;h2&gt;DC&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4876"&gt;Break the If Habit&lt;/a&gt;&lt;br&gt;Tuesday, January 17, 2012 6:30 PM, Washington, DC&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=2400+N+Street+NW%2c+Washington%2c+DC&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Break the If Habit on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=4876&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Branching logic is one of the foundations of computer programming. But like vodka, the If statement is best consumed in moderation. While the first If is harmless, and maybe even a little thrilling, soon there's a second, a third, a fourth and before you know it -- you wake up under your desk with a method you don't even recognize much less understand.&lt;br&gt;In this session we'll explore some of the common If abuses and learn how to refactor them into more readable and adaptable code. We'll use design patterns to put the demon If back in its bottle and keep it there. Saner code is within reach, and this is the first step to break the the If habit.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4876"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4876"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4876.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;MD&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4896"&gt;RockNUG Release 5.7&lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 6:30 PM, Rockville, MD&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=51+Mannakee+Street%2c+Rockville%2c+MD&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View RockNUG Release 5.7 on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4896&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Montgomery College, Rockville&lt;br&gt;ROOM TC 232&lt;br&gt;Mobile Development in MVC4&lt;br&gt;by Kevin Jones&lt;br&gt;The next version of MVC4 will include new functionality making it easy to display different content for different devices. We'll learn about this functionality and extending it even further, allowing you to create rich MVC4 applications that look great no matter what you use to look at them on any device.&lt;br&gt;Kevin Jones is an Team Lead and Senior Consultant for LogicBoost, a leading software development company based in Washington DC.&lt;br&gt;6:30 - 7:00 n00b Presentation TBA&lt;br&gt;7:00 - 7:30 Pizza/Announcements &lt;br&gt;7:30 - 9:00 Featured Presentations Mobile Development in MVC4 - Kevin Jones  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4896"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4896"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4896.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;Online&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4905"&gt;How to Test Dependencies and Legacy Code &lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; You may have already started unit testing or at least understand the basics. But there’s one large obstacle that stands in your way: dependencies. Most code was not written to be easy to test. How can you test dependencies? Join this webinar and learn different methods and tools that help create real unit tests.&lt;br&gt;Learn:&lt;br&gt;• Why you are writing legacy code&lt;br&gt;• Hand rolled mocks&lt;br&gt;• Mocking frameworks&lt;br&gt;• What makes a good unit test  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4905"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4905.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4871"&gt;SSWUG Webcast: Creating Dynamic Reports in Excel 2010 using PowerPivot&lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 11:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; This introductory session explores PowerPivot's ability to create dynamic reports in Excel 2010.&lt;br&gt;Javier Guillén, who is a Business Intelligence consultant for Mariner, will explore PowerPivot technology through concrete examples that explain how to create dynamic reports by importing data from multiple sources, re-shaping the inherent data model and creating powerful calculations using Data Analysis Expressions (DAX).  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4871"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4871.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4950"&gt;KnoxSQL Virtual Meeting:Patrick Leblanc-Build Your First SSAS Tabular Model&lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 12:00 PM, Knoxville, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; In this session I will demonstrate how to use the new features in SQL Server 2012 to develop a BI Semantic Tabular Model in Analysis Services. In addition, I will demonstrate how to visualize the model using SSRS, Power View, Excel and Performance Point.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4950"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4950.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4906"&gt;Testing the Untestable: Unit Testing Legacy Code &lt;/a&gt;&lt;br&gt;Wednesday, January 18, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Everybody has legacy code. How do you apply unit testing to existing code? Code that wasn’t meant to testing. &lt;br&gt;This is a hardcore session, where we take an open source application and add tests to it. In the process, we’ll refactor the code, discuss readability, and where to even begin. &lt;br&gt;This is an intensive demonstration of automated testing hard-core legacy code. If you are a legacy ninja, check it out.&lt;br&gt;Everyone is welcome but it is most appropriate for people with a background in unit testing and medium to advanced skills. If you’re a unit testing ninja, this webinar is for you!  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4906"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4906.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;PA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4953"&gt;Philly .NET Hands on&lt;/a&gt;&lt;br&gt;Monday, January 09, 2012 5:30 PM, Fort Washington, PA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1140+Virginia+Dr.%2c+Fort+Washington%2c+PA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Philly .NET Hands on on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4953&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Monthly hands-on meeting at DeVry Univ. We will be continuing our discussion on Windows 8 and Metro style development with HTML5, JavaScript and Expression Blend.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4953"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4953"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4953.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4951"&gt;Philadelphia VFP User Group&lt;/a&gt;&lt;br&gt;Tuesday, January 10, 2012 7:00 PM, Fort Washington, PA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=Room+158%2c+1140+Virginia+Drive%2c+Fort+Washington%2c+PA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Philadelphia VFP User Group on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4951&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; The next meeting of the Philadelphia VFP User Group will be Tuesday, January 10. As usual, feel free to bring some dinner and come as early at 6:30 PM.&lt;br&gt;Our speaker this month will be Bob Pierce. He will demonstrate building a small VFP project that can be used to display status info and data that is simple to build yet has a modern App/Gadget feel using just basic VFP controls and classes. If there is time he will discuss his recent adventures in bar-coding and lot control and some of the issues he ran into as well as the advantages it has delivered already and future planned enhancements.&lt;br&gt;We’re looking for speakers for upcoming meetings. If you have something to share with the group (whether it’s 10 minutes or the whole session), please get in touch with Bob, rpierce@smooth-on.com.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4951"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4951"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4951.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;h2&gt;VA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4877"&gt;DC Alt.Net: "Overcoming the Obstacles, Pitfalls, and Dangers of Automated Testing"&lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 6:30 PM, Arlington, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=4301+Wilson+Blvd%2c+Arlington%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View DC Alt.Net: &amp;quot;Overcoming the Obstacles, Pitfalls, and Dangers of Automated Testing&amp;quot; on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4877&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Overview: Have you ever bumped into a wall with your automated tests? Many developers bump into various roadblocks and hurdles when writing test code. Are your test methods starting to fail because the code-under-test uses DateTime.Now? Are your automated integration tests failing because the database they integrate with keeps changing? Do you have an explosion of test methods, with the ratio of test code to code-under-test way too high? Is your effort to refactor and improve code overwhelmed by the time it takes to rewrite all those failing unit tests?&lt;br&gt;This presentation is about clearing away automated testing obstacles, avoiding common pitfalls, and staying away from dangerous practices.&lt;br&gt;About the Author: Stephen Ritchie brings over 20 years of development experience and is the author of the soon-to-be-released Pro .NET Best Practices.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4877"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4877"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4877.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4624"&gt;The Blackboard Advanced Platform Environment (A performance based private cloud solution)&lt;/a&gt;&lt;br&gt;Thursday, January 19, 2012 6:30 PM, Arlington, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1501+Lee+Highway%2c+Suite+400%2c+Arlington%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View The Blackboard Advanced Platform Environment (A performance based private cloud solution) on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4624&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; A discussion on the private cloud hosting platform deployed to support Blackboard Managed Hosting. The Blackboard Advanced Platform Environment (APE) is a performance based cloud platform supporting more than 1000 clients and 10’s of millions of educational clients around the globe.  &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4624"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4624"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4624.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4830"&gt;CapArea Silverlight SIG - The XNA Framework and Windows Phone 7 - Franklin Balaguer&lt;/a&gt;&lt;br&gt;Thursday, January 19, 2012 7:00 PM, Arlington, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=2300+Wilson+Blvd%2c+Arlington%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View CapArea Silverlight SIG - The XNA Framework and Windows Phone 7 - Franklin Balaguer on Bing Maps" src="https://www.communitymegaphone.com/MapTile.ashx?id=4830&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Abstract:&lt;br&gt;XNA Game Studio and the XNA Framework are designed for cross-platform gaming scenarios with support for Windows Phone 7, Xbox 360, and Windows-based PCs. This allows you to target more platforms from the same code base. XNA Game Studio includes the XNA Framework, a set of managed libraries designed for game development based on the Microsoft .NET Framework.&lt;br&gt;In this workshop, I will go over some free resources available to help you create your own Windows Phone 7 game and then sell it on the WindowsPhone MarketPlace. I will also touch on the basics of XNA (drawing a sprite, handling of input touch, playing sounds, and game state management). Lastly, I will discuss the certification process for getting your game approved and placed on the MarketPlace.&lt;br&gt;Bio:&lt;br&gt;Franklin Balaguer is U.S. Air Force veteran. He spent 8 years in the Air Force managing vehicle fleets at various bases in the United States and while deployed overseas. Frank got his start with computers writing programs to automate tasks and processes everywhere he encountered them. While in the Air Force, he also acquired several certifications including the Microsoft Certified System Engineer, which help him land a job at Accenture. Frank has been with Accenture for the past 11 years helping to write and deliver software to thier clients.  &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4830"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4830"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4830.ics"&gt;Add To Calendar&lt;/a&gt; ]  &lt;p&gt;Want your events listed? You can &lt;a href="http://www.communitymegaphone.com/AddEvent.aspx"&gt;add them here.&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can also add your events via the Community Megaphone web service API. You can get more information on the API, and how to sign up, at &lt;a href="http://www.communitymegaphone.com/API.aspx"&gt;http://www.communitymegaphone.com/API.aspx&lt;/a&gt;. You can also &lt;a href="http://blogs.msdn.com/gduthie/contact.aspx"&gt;email me&lt;/a&gt; for more information.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/dTNXeQVe_q8" height="1" width="1"/&gt;</description><pubDate>Mon, 09 Jan 2012 23:38:26 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/upcoming-events-for-january-9th-2012</guid><feedburner:origLink>http://devhammer.net:80/blog/upcoming-events-for-january-9th-2012</feedburner:origLink></item><item><title>GHI (non-beta) .NET Gadgeteer SDK released!</title><link>http://feeds.devhammer.net/~r/devhammer/~3/0RBcpRdHn3s/ghi-non-beta-.net-gadgeteer-sdk-released</link><description>&lt;p&gt;&lt;strike&gt;UPDATE: I'm hearing reports that the link to the SDK is broken at the moment. I think GHI may be updating it to link in an installer they're including for the Gadgeteer SDK produced by Seeed Studio, another maker of Gadgeteer Modules. I will update the post again when the SDK is available again.&lt;/strike&gt;&lt;/p&gt; &lt;p&gt;UPDATE 2: Turns out, the reason the link was down temporarily was that, in typical GHI fashion, the GHI crew was fixing a couple issues, one of which was one I reported late last night when the initial OSH SDK was released. Talk about a quick turnaround! Kudos to Gus and crew for the great customer support they provide. They also integrated an installer for the SDK for Seeed Studio Gadgeteer modules, so you can use one installer to get support for all GHI hardware, plus all the modules currently available from Seeed Studio (which GHI sells on their website). Nice!&lt;/p&gt; &lt;p&gt;Note that if you installed the bits from last night, you only need to run the Seeed Studio SDK installer (it's in the Installers folder, IIRC) and update the firmware for the FEZ Hydra, if that's the board you have. Everything else is the same.&lt;/p&gt; &lt;p&gt;Details at &lt;a title="http://www.tinyclr.com/forum/12/5368" href="http://www.tinyclr.com/forum/12/5368"&gt;http://www.tinyclr.com/forum/12/5368&lt;/a&gt;&lt;/p&gt; &lt;hr&gt;  &lt;p&gt;For folks who've been following my Gadgeteer adventures, if you have a FEZ Spider or FEZ Hydra Gadgeteer board, you'll want to check out the following forum thread:&lt;/p&gt; &lt;p&gt;&lt;a title="http://www.tinyclr.com/forum/12/5358/" href="http://www.tinyclr.com/forum/12/5358/"&gt;http://www.tinyclr.com/forum/12/5358/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Or just jump on over to the support page:&lt;/p&gt; &lt;p&gt;&lt;a title="http://tinyclr.com/support/" href="http://tinyclr.com/support/"&gt;http://tinyclr.com/support/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;to download the new SDK. You can view the release notes at:&lt;/p&gt; &lt;p&gt;&lt;a title="http://www.tinyclr.com/release-notes/" href="http://www.tinyclr.com/release-notes/"&gt;http://www.tinyclr.com/release-notes/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Here's a pic of my Spider running a demo project (you can &lt;a href="http://code.tinyclr.com/project/411/glide-buttons-and-gadgeteer-demo/" target="_blank"&gt;get the project here&lt;/a&gt;), using the updated SDK and firmware:&lt;/p&gt; &lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/GHI-non-beta-.NET-Gadgeteer-SDK-released_1068C/NewSDK_2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="NewSDK" border="0" alt="NewSDK" src="http://devhammer.net/Media/Default/Windows-Live-Writer/GHI-non-beta-.NET-Gadgeteer-SDK-released_1068C/NewSDK_thumb.jpg" width="804" height="604"&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/0RBcpRdHn3s" height="1" width="1"/&gt;</description><pubDate>Fri, 06 Jan 2012 20:41:52 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/ghi-non-beta-.net-gadgeteer-sdk-released</guid><feedburner:origLink>http://devhammer.net:80/blog/ghi-non-beta-.net-gadgeteer-sdk-released</feedburner:origLink></item><item><title>Upcoming Events for January 3rd, 2012</title><link>http://feeds.devhammer.net/~r/devhammer/~3/yBEGWL2dliw/upcoming-events-for-january-3rd-2012</link><description>&lt;p&gt;Here are the events listed in &lt;a href="http://www.communitymegaphone.com/"&gt;Community Megaphone&lt;/a&gt; for the next week (or so) for the Mid-Atlantic area, as well as webcasts of interest…this list includes events imported from the &lt;a href="https://www.technicalcommunity.com/Pages/eventcal.aspx"&gt;UGSS event calendar&lt;/a&gt;, and user group events entered in Community Megaphone are also automatically synced to the UGSS event calendar:&lt;/p&gt; &lt;h2&gt;DC&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4919"&gt;&lt;strong&gt;SharePoint 2010 Event Receivers (Presentation)&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 05, 2012 7:00 PM, Washington, DC&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=1200+18th+St.%2c+NW+Suite+%23LL-100%2c+Washington%2c+DC&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View SharePoint 2010 Event Receivers (Presentation) on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=4919&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Presentation Description: This presentation titled SharePoint 2010 Event Receivers, is a beginning to intermediate look at Event Receivers and Event Handlers in SharePoint 2010. We will discus the different types of event receivers but focus on those related to list item events. Some basic C# code will be shown and explained followed by a demo. Throughout the presentation real world examples and stories will be used in order to show the ease of use and power of list item event receiver features in SharePoint 2010.&lt;br&gt;Bio: Tim Ferro is an energetic developer/architect/consultant that provides SharePoint 2010 and MOSS 2007 solutions on high impact government projects. He is currently working with SharePoint 2010, WSS 3.0, and MOSS 2007, architecting enterprise solutions and environments. He provides expertise in both out-of-the-box and custom SharePoint solutions as well as user interface enhancements.&lt;br&gt;www.timferro.com&lt;br&gt;Twitter: @timferro&lt;br&gt;Transportation Info: Our new location is one block from the Farragut North Metro station and 3 blocks from the Farragut West Metro station. Address: 1200 18th St., NW Suite #LL-100, Washington, DC&lt;br&gt;Can't make it in person? Don't worry! We broadcast all of our sessions online too! Details to be sent the day of the this event. &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4919"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4919"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4919.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4896"&gt;&lt;strong&gt;RockNUG Release 5.7&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 6:30 PM, Rockville, MD&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=51+Mannakee+Street%2c+Rockville%2c+MD&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View RockNUG Release 5.7 on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=4896&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Montgomery College, Rockville&lt;br&gt;ROOM TC 232&lt;br&gt;Mobile Development in MVC4&lt;br&gt;by Kevin Jones&lt;br&gt;The next version of MVC4 will include new functionality making it easy to display different content for different devices. We'll learn about this functionality and extending it even further, allowing you to create rich MVC4 applications that look great no matter what you use to look at them on any device.&lt;br&gt;Kevin Jones is an Team Lead and Senior Consultant for LogicBoost, a leading software development company based in Washington DC.&lt;br&gt;6:30 - 7:00 n00b Presentation TBA&lt;br&gt;7:00 - 7:30 Pizza/Announcements &lt;br&gt;7:30 - 9:00 Featured Presentations Mobile Development in MVC4 - Kevin Jones &lt;p&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4896"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4896"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4896.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;h2&gt;Online&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4907"&gt;&lt;strong&gt;Free 30 minute Webcast: A DBA’s Guide to ORMs&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Tuesday, January 03, 2012 12:30 PM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" align="left" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Developers often use tools, like Entity Framework or NHibernate, to make it easier to work with the database. These tools sometimes cause problems for developers and DBAs alike. In this talk, we’ll talk about the terminology and techniques used with an ORM. We’ll also uncover ways to help DBAs work with developers, detect problematic queries, and improve performance in both the database and the application. Register today.&lt;br&gt;Jeremiah Peschka: http://www.brentozar.com/consultants/jeremiah-peschka &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4907"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4907.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4903"&gt;&lt;strong&gt;Introduction to Unit Testing&lt;/strong&gt; &lt;/a&gt;&lt;br&gt;Wednesday, January 04, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" align="left" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Software testing isn’t just a task for QA. In order to prevent bugs and release quality code to market, you also need developer testing, including unit testing. Discover why you should start unit testing, and how you can get started with automated tests quickly.&lt;br&gt;Learn:&lt;br&gt;• Benefits of unit testing&lt;br&gt;• xUnit Frameworks&lt;br&gt;• The difference between unit testing and test driven development (TDD).&lt;br&gt;Join this webinar to learn what you need to know in order to start testing today.&lt;br&gt;You may also win a free Typemock Isolator license &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4903"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4903.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4904"&gt;&lt;strong&gt;How to Test Dependencies and Legacy Code &lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 04, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" align="left" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; Software testing isn’t just a task for QA. In order to prevent bugs and release quality code to market, you also need developer testing, including unit testing. Discover why you should start unit testing, and how you can get started with automated tests quickly.&lt;br&gt;Learn:&lt;br&gt;• Benefits of unit testing&lt;br&gt;• xUnit Frameworks&lt;br&gt;• The difference between unit testing and test driven development (TDD).&lt;br&gt;Join this webinar to learn what you need to know in order to start testing today.&lt;br&gt;You may also win a free Typemock Isolator license &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4904"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4904.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4905"&gt;&lt;strong&gt;How to Test Dependencies and Legacy Code&lt;/strong&gt; &lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 10:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" align="left" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; You may have already started unit testing or at least understand the basics. But there’s one large obstacle that stands in your way: dependencies. Most code was not written to be easy to test. How can you test dependencies? Join this webinar and learn different methods and tools that help create real unit tests.&lt;br&gt;Learn:&lt;br&gt;• Why you are writing legacy code&lt;br&gt;• Hand rolled mocks&lt;br&gt;• Mocking frameworks&lt;br&gt;• What makes a good unit test &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4905"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4905.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4871"&gt;&lt;strong&gt;SSWUG Webcast: Creating Dynamic Reports in Excel 2010 using PowerPivot&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 11:00 AM, Online&lt;br&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="Online Event Icon" align="left" src="https://www.communitymegaphone.com/Images/Logo_200x200.png"&gt; This introductory session explores PowerPivot's ability to create dynamic reports in Excel 2010.&lt;br&gt;Javier Guillén, who is a Business Intelligence consultant for Mariner, will explore PowerPivot technology through concrete examples that explain how to create dynamic reports by importing data from multiple sources, re-shaping the inherent data model and creating powerful calculations using Data Analysis Expressions (DAX). &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4871"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4871.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;h2&gt;VA&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4655"&gt;&lt;strong&gt;Unleashing your code-fu with code katas&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Thursday, January 05, 2012 6:00 PM, Roanoke, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=5925+Cove+Rd%2c+Roanoke%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View Unleashing your code-fu with code katas on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=4655&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; We've all heard that it takes 10,000 hours of practice to "master" a skill. What they neglect to mention is that it takes 10,000 quality, effective hours of practice to master that skill. In software development, we "practice" on the job. And, usually, it's doing the same things, over and over, day in and day out. In this presentation you'll be provided with resources and techniques that will help you "practice" software development more effectively - in only 30 minutes a day! &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4655"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4655"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4655.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;p&gt;&lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4877"&gt;&lt;strong&gt;DC Alt.Net: "Overcoming the Obstacles, Pitfalls, and Dangers of Automated Testing"&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;Wednesday, January 11, 2012 6:30 PM, Arlington, VA&lt;br&gt;&lt;a href="http://www.bing.com/maps/?v=2&amp;amp;where1=4301+Wilson+Blvd%2c+Arlington%2c+VA&amp;amp;lvl=16&amp;amp;sty=r&amp;amp;encType=1"&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" alt="View DC Alt.Net: &amp;quot;Overcoming the Obstacles, Pitfalls, and Dangers of Automated Testing&amp;quot; on Bing Maps" align="left" src="https://www.communitymegaphone.com/MapTile.ashx?id=4877&amp;amp;w=200&amp;amp;h=200"&gt;&lt;/a&gt; Overview: Have you ever bumped into a wall with your automated tests? Many developers bump into various roadblocks and hurdles when writing test code. Are your test methods starting to fail because the code-under-test uses DateTime.Now? Are your automated integration tests failing because the database they integrate with keeps changing? Do you have an explosion of test methods, with the ratio of test code to code-under-test way too high? Is your effort to refactor and improve code overwhelmed by the time it takes to rewrite all those failing unit tests?&lt;br&gt;This presentation is about clearing away automated testing obstacles, avoiding common pitfalls, and staying away from dangerous practices.&lt;br&gt;About the Author: Stephen Ritchie brings over 20 years of development experience and is the author of the soon-to-be-released Pro .NET Best Practices. &lt;p&gt;&lt;br clear="all"&gt;[ &lt;a href="http://www.communitymegaphone.com/ShowEvent.aspx?EventID=4877"&gt;Event Details&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/GetMapEventID.aspx?EventID=4877"&gt;Map &amp;amp; Directions&lt;/a&gt; | &lt;a href="http://www.communitymegaphone.com/ICS/4877.ics"&gt;Add To Calendar&lt;/a&gt; ] &lt;p&gt;Want your events listed? You can &lt;a href="http://www.communitymegaphone.com/AddEvent.aspx"&gt;add them here.&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can also add your events via the Community Megaphone web service API. You can get more information on the API, and how to sign up, at &lt;a href="http://www.communitymegaphone.com/API.aspx"&gt;http://www.communitymegaphone.com/API.aspx&lt;/a&gt;. You can also &lt;a href="http://blogs.msdn.com/gduthie/contact.aspx"&gt;email me&lt;/a&gt; for more information.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/yBEGWL2dliw" height="1" width="1"/&gt;</description><pubDate>Tue, 03 Jan 2012 18:12:17 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/upcoming-events-for-january-3rd-2012</guid><feedburner:origLink>http://devhammer.net:80/blog/upcoming-events-for-january-3rd-2012</feedburner:origLink></item><item><title>Visualizing Layout in HTML5 Canvas with Gridlines</title><link>http://feeds.devhammer.net/~r/devhammer/~3/fCl3ZJt-rNw/visualizing-layout-in-html5-canvas-with-gridlines</link><description>&lt;p&gt;I'm in the process of finalizing my preparations for tomorrow's &lt;a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032496697&amp;amp;Culture=en-US" target="_blank"&gt;HTML5 Game Camp in New York City&lt;/a&gt;, and figured I'd share one of the functions I put together to help in the process of visualizing some of the different ways you can draw and manipulate objects on an HTML5 Canvas object. It's a simple function called renderGrid, which takes as arguments the ID of the canvas you want to draw on, the pixel interval for the gridlines, and the color of the lines, and draws out a grid just like you'd see on graph paper. Call this function before you start drawing objects on your canvas, and you'll have a nice reference grid to help you more easily visualize the layout. You can customize it to your liking by tweaking the pixel interval, and it's relatively unobtrusive in your code.&lt;/p&gt; &lt;p&gt;Here's what it looks like, with a Bezier curve drawn with the function, &lt;em&gt;context.quadraticCurveTo(250, 100, 450, 250);&lt;/em&gt;, with a grid pixel interval of 10:&lt;/p&gt; &lt;p&gt;&lt;a href="http://devhammer.net/Media/Default/Windows-Live-Writer/Visualizing-Layout-in-HTML5-Canvas-with-_A1C9/image_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://devhammer.net/Media/Default/Windows-Live-Writer/Visualizing-Layout-in-HTML5-Canvas-with-_A1C9/image_thumb.png" width="404" height="382"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;And here's a fiddle with the code:&lt;/p&gt;&lt;iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/devhammer/ttEmd/11/embedded/" allowfullscreen="allowfullscreen" frameborder="0"&gt;&lt;/iframe&gt;&lt;p&gt;&lt;br&gt;Hope you find it useful!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/fCl3ZJt-rNw" height="1" width="1"/&gt;</description><pubDate>Tue, 20 Dec 2011 03:21:54 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/visualizing-layout-in-html5-canvas-with-gridlines</guid><feedburner:origLink>http://devhammer.net:80/blog/visualizing-layout-in-html5-canvas-with-gridlines</feedburner:origLink></item><item><title>Great Sites and Blogs for Learning about .NET Gadgeteer</title><link>http://feeds.devhammer.net/~r/devhammer/~3/oi-PJPJCJ2w/great-sites-and-blogs-for-learning-about-.net-gadgeteer</link><description>&lt;p&gt;As anyone following my blog or &lt;a href="http://twitter.com/devhammer" target="_blank"&gt;twitter feed&lt;/a&gt; could probably tell, in between HTML5 Web Camps and Game Camps, I've been doing a fair amount of work (and play) with &lt;a href="http://netmf.com/gadgeteer/" target="_blank"&gt;.NET Gadgeteer&lt;/a&gt;. It's a great platform for learning about electronics and microcontrollers, and since the code is in C# and based on the .NET Micro Framework, it's familiar territory, at least on the software side.&lt;/p&gt; &lt;p&gt;As I've been moving from complete newb to a bit more experienced, I've had the pleasure of presenting some talks on .NET Gadgeteer with fellow Mid-Atlantic Microsoftie &lt;a href="http://10rem.net/blog" target="_blank"&gt;Pete Brown&lt;/a&gt;, including at &lt;a href="http://www.cmap-online.org/CodeCamp/"&gt;CMAP Code Camp&lt;/a&gt; last month (Pete &lt;a href="http://10rem.net/blog/2011/11/18/our-net-micro-framework-and-net-gadgeteer-talk-at-cmap-code-camp-2011"&gt;has a post up on his blog with a series of videos of our talk&lt;/a&gt;, recorded by Lewis Berman, from Loyola University, where the code camp was held).&lt;/p&gt; &lt;p&gt;Pete's blog is a great resource for all kinds of geekiness, from &lt;a href="http://silverlight.net/" target="_blank"&gt;Silverlight&lt;/a&gt; and WPF tips, to posts about his adventures in synthesizer assembly and programming, with of course a healthy dose of .NET Gadgeteer for spice.&lt;/p&gt; &lt;p&gt;I've also run across a few other sites and blogs that are extremely valuable for any folks looking for more information on .NET Gadgeteer, so I figured I'd post them here. &lt;/p&gt; &lt;h2&gt;&lt;/h2&gt; &lt;h2&gt;Manufacturers&lt;/h2&gt; &lt;p&gt;First, a list of the folks building Gadgeteer boards and modules:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.ghielectronics.com/catalog/category/265/" target="_blank"&gt;GHI Electronics&lt;/a&gt; – One of the first companies to release a .NET Gadgeteer mainboard, the FEZ Spider, and supplier of many modules as well.  &lt;li&gt;&lt;a href="http://www.seeedstudio.com/depot/gadgeteer-c-203.html" target="_blank"&gt;Seeed Studio&lt;/a&gt; (note the extra "e") – Maker of numerous sensor modules, from gyro and compass to accelerometer and GPS.  &lt;li&gt;&lt;a href="http://sytechdesigns.com/GadgeteerProduct.html" target="_blank"&gt;Sytech Designs, Ltd.&lt;/a&gt; – Makers of the Nano mainboard and several modules. &lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Community and Microsoft Sites&lt;/h2&gt; &lt;p&gt;Here are some good places to go to ask questions about .NET Gadgeteer hardware or software:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.tinyclr.com/forum/21/" target="_blank"&gt;TinyCLR Gadgeteer Forum&lt;/a&gt; – Run by GHI, this forum is dedicated to .NET Gadgeteer topics, and is very active, with a number of smart and friendly folks from the community pitching in to help newcomers get started. I'm grateful to the many folks who've patiently answered my questions there.  &lt;li&gt;&lt;a href="http://www.seeedstudio.com/forum/" target="_blank"&gt;Seeed Studio Forum&lt;/a&gt; – here you can find tech support for Seeed products.  &lt;li&gt;&lt;a href="http://www.netmf.com/gadgeteer/forum/" target="_blank"&gt;Official .NET Gadgeteer Forums&lt;/a&gt; – Several members from the Microsoft Research team responsible for Gadgeteer post here, so this is a good place to get info straight from the source. &lt;li&gt;&lt;a href="http://www.netmf.com/gadgeteer/docs/gadgeteercore/index.html" target="_blank"&gt;Core Gadgeteer API documentation&lt;/a&gt; – when you need to know what an API is for, this is a good place to start. &lt;li&gt;&lt;a href="http://gadgeteer.codeplex.com/" target="_blank"&gt;Gadgeteer Source on Codeplex&lt;/a&gt; – when documentation alone isn't enough, you can always check out the source code to see what's really happening under the covers. &lt;li&gt;&lt;a href="http://www.skewworks.com/" target="_blank"&gt;Skewworks&lt;/a&gt; – run by Thomas W. Holtquist, and supplies additional software useful in .NET MF and Gadgeteer projects, including UI libraries and operating environments that allow for running multiple applications without reflashing.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Blogs&lt;/h2&gt; &lt;p&gt;Here are some good blogs I've found that you should bookmark:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/net_gadgeteer/" target="_blank"&gt;Official .NET Gadgeteer blog&lt;/a&gt;  &lt;li&gt;&lt;a href="http://10rem.net/blog?filterby=Gadgeteer" target="_blank"&gt;Pete Brown's Blog – filtered to his Gadgeteer Posts&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.breakcontinue.com/" target="_blank"&gt;Valentin Ivanov's Blog – BreakContinue&lt;/a&gt; – Valentin has actually built not one, not two, but THREE Gadgeteer modules. impressive stuff! &lt;li&gt;&lt;a href="http://mikedodaro.net/" target="_blank"&gt;Michael Dodaro's blog – Integral Design&lt;/a&gt;  &lt;li&gt;&lt;a href="http://gotoloop.wordpress.com/" target="_blank"&gt;Michael Ashby's blog – GOTO Loop&lt;/a&gt; &lt;li&gt;&lt;a title="http://blog.ianlee.info/" href="http://blog.ianlee.info/"&gt;http://blog.ianlee.info/&lt;/a&gt; – Ian only has a couple of posts that are specific to Gadgeteer, but there's a ton of great info on .NET Micro Framework that will be helpful to folks ready to move to intermediate topics.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Supplies&lt;/h2&gt; &lt;p&gt;Although you can do a great deal with just a mainboard and a few modules, eventually you're going to want to go beyond, and for that you'll probably want some additional supplies, things like a breadboard, jumper wires, etc. While I've gotten a good bit of my supplies from the local Radio Shack (rumor has it that the new leadership at the company is looking to take them back to their roots of actually supplying a useful selection of electronic components rather than just being another consumer electronics and cell phone retailer), one of the best places I've found to get just about anything you might need for your Gadgeteer projects is &lt;a href="http://www.sparkfun.com/" target="_blank"&gt;Sparkfun&lt;/a&gt;. While they don't sell Gadgeteer mainboards or modules, they do have all kinds of cool supplies, from LEDs to header pins for your &lt;a href="http://www.ghielectronics.com/catalog/product/273" target="_blank"&gt;Extender Module&lt;/a&gt;, jumper wires, servos, motors, and more. You can even make a wish list, so that those who know what a geek you are can help you with your habit…here's mine:&lt;/p&gt; &lt;p&gt;&lt;script src="https://www.sparkfun.com/wish_lists/30559.js"&gt;&lt;/script&gt;&lt;/p&gt; &lt;p&gt;.NET Gadgeteer is shaping up as a neat and easy way to take the plunge into electronics and microcontrollers. I know for me, the higher-level API that Gadgeteer favors eased the learning curve and kept me interested by making it easy to succeed. Now that I've spent some time with the hardware, I'm digging deeper and getting into breadboarding circuits and learning even more. I'll be sharing some of my adventures in hardware, along with my usual fare of .NET, HTML5 and Javascript.&lt;/p&gt; &lt;p&gt;Have I missed anything…know of additional resources for Gadgeteer? Drop me a note and &lt;a href="http://devhammer.net/contact" target="_blank"&gt;let me know&lt;/a&gt;!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/devhammer/~4/oi-PJPJCJ2w" height="1" width="1"/&gt;</description><pubDate>Sat, 17 Dec 2011 07:21:59 GMT</pubDate><guid isPermaLink="false">http://devhammer.net:80/blog/great-sites-and-blogs-for-learning-about-.net-gadgeteer</guid><feedburner:origLink>http://devhammer.net:80/blog/great-sites-and-blogs-for-learning-about-.net-gadgeteer</feedburner:origLink></item></channel></rss>

