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

<channel>
	<title>Brad Westness.com</title>
	<atom:link href="http://www.bradwestness.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bradwestness.com</link>
	<description>A Personal Website, Portfolio and Blog</description>
	<lastBuildDate>Fri, 24 May 2013 16:13:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.6-beta3-24298</generator>
		<item>
		<title>Generation Gap</title>
		<link>http://www.bradwestness.com/generation-gap,1971/</link>
		<comments>http://www.bradwestness.com/generation-gap,1971/#comments</comments>
		<pubDate>Thu, 23 May 2013 15:25:13 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1971</guid>
		<description><![CDATA[I recently read a post that was listed on Hacker News titled How to tell a young(ish) person their behavior is inappropriate at work, and I got into it a bit in the comments with the author of the post. It was an interesting read, until I got to his tips for dealing with &#8220;millennials,&#8221; [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p><img src="http://www.bradwestness.com/wp-content/uploads/2013/05/nautilus-shell-394114-xl-e1369411983419-1024x429.jpg" alt="nautilus" /></p>
<p>I recently read a post that was listed on Hacker News titled <a href="http://www.articulateventures.com/articulate-blog/category/how-to-tell-a-youngish-person-their-behavior-is-inappropriate-at-work#comment-905293932">How to tell a young(ish) person their behavior is inappropriate at work</a>, and I got into it a bit in the comments with the author of the post.</p>
<p>It was an interesting read, until I got to his tips for dealing with &#8220;millennials,&#8221; which really rubbed me the wrong way (as does the word &#8220;millennials,&#8221; hence the scare quotes).</p>
<blockquote>
<p><strong>3­. Remember, people who are now young adults have been raised on a steady diet of compliments and praise.</strong></p>
<p>Today&#8217;s young adults grew up searching for just the right post to get “likes” on Facebook, and we were all given trophies for trying. Every generation thrives on praise but there was a marked change in parenting behavior when self-esteem became a high priority in the 80&#8242;s and 90s. This is important to remember if you want to build a connection with a young adult.</p>
<p>-Vance Crowe, ArticulateVentures.com</p>
</blockquote>
<p>First of all, I&#8217;ve never received a trophy in my life, despite participating in many extracurricular activities. My school track meet gave out &#8220;Participant&#8221; ribbons, which everyone knew were worthless, and 1st, 2nd, or 3rd place ribbons for actually placing in an event. Trophies just for showing up? Never. I&#8217;ve never even heard of anyone getting a trophy of any kind outside of like, winning state in a varsity sport or placing in a tournament of some kind.</p>
<p>Here was my reaction to his article:</p>
<blockquote>
<p>I think it&#8217;s dangerous to lump everyone together as though an entire generation all behaves exactly the same way. Sure, there are trends, but individuals are individuals. Applying a bunch of half-baked psychology about why people behave the way they do and ascribing everything to some generational phenomenon is likely to get you nowhere.</p>
<p>Substitute any classic minority group for &#8220;Millennials&#8221; in the sentence &#8220;Remember, Millennials have been raised on a steady diet of compliments and praise&#8221; and you might begin to see the problem.</p>
</blockquote>
<p>Now, as I said in my comment, I do believe that there can be general behavioral trends among generations, especially regarding usage of technology and attitudes about social issues. But this got me thinking&#8230; how do we actually define a generation?</p>
<p>It&#8217;s easy when there&#8217;s a huge bubble, the classic example being the &#8220;Baby Boomer&#8221; generation, the huge class of people who were born shortly after U.S. troops returned from World War II. But it gets increasingly fuzzy after that.</p>
<p>Generation X is supposed to be the generation that followed the Baby Boomers, but is <a href="http://en.wikipedia.org/wiki/Generation_X">generally defined as anyone born between 1965 and 1980</a>. That&#8217;s a pretty large range, making it difficult to draw any meaningful conclusions about the members of that generation. There&#8217;s some commonality to being &#8220;the first generation after the baby boomers,&#8221; but do you consider yourself to have a lot in common with people fifteen years your elder?</p>
<p>It only gets worse from there. Generation Y, increasingly referred to as &#8220;Millennials,&#8221; <a href="http://en.wikipedia.org/wiki/Generation_Y">has no precise start or end date, birth dates ranging from the late 1970s to the early 2000s</a>.</p>
<p>I was born in 1984, which places me toward the upper end of Generation Y. So I guess I&#8217;m in the same generation as people born after George W. Bush was elected president, at which time I was old enough to drive. I don&#8217;t know how many useful inferences you can make about the shared traits of a group when some of its members recall the destruction of the Berlin Wall, and others don&#8217;t remember a time when Facebook didn&#8217;t exist.</p>
<p>To add insult to injury, the steadily increasing globalization of the last century makes it almost impossible to define a cultural epoch or any experience shared broadly enough in order to define a generation. It&#8217;s no longer possible to point to events that only affect U.S. citizens as markers for the start or end of a generation.</p>
<p>So my question is this: is the entire concept of a &#8220;generation,&#8221; in a national or cultural sense, outmoded? Barring another Baby Boomer type bubble, what use do we have for the concept when we can no longer define when one starts or ends, and no useful insight can be gained by assigning someone membership in one?</p>
<p>Believing that someone&#8217;s personality is defined by the year they were born is, at this point, not too far removed from believing in the zodiac. I think it is time to start treating people as individuals rather than trying to assign preferences or behavior to them based on what year they were born.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/generation-gap,1971/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I Program &#8211; Game Genie</title>
		<link>http://www.bradwestness.com/why-i-program-game-genie,1950/</link>
		<comments>http://www.bradwestness.com/why-i-program-game-genie,1950/#comments</comments>
		<pubDate>Wed, 20 Mar 2013 00:27:09 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1950</guid>
		<description><![CDATA[You can ask anyone who knew me when I was little, I was very obsessed with the NES. My childhood reaction to receiving one for Christmas is the sort of thing that your family likes to bring up to embarrass you in front of girls. But, my fascination was always deeper than just playing the [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p>You can ask anyone who knew me when I was little, I was very obsessed with the NES. My childhood reaction to receiving one for Christmas is the sort of thing that your family likes to bring up to embarrass you in front of girls.</p>
<p>But, my fascination was always deeper than just playing the games. The very <em>idea</em> that somewhere inside that cartridge was magic code that made Mario jump and Bowser throw fireballs was a big part of what drew me into playing the games as often as I did.</p>
<p>Nothing solidified that concept in my young brain as much as the <strong>Game Genie</strong>, the dongle that allowed you to enter your own secret codes that would alter the fabric of the game as you played it.</p>
<p><img src="http://www.bradwestness.com/wp-content/uploads/2013/03/GameGenie-SNES-e1363739370973.jpg" alt="Make your magic here." /></p>
<p>The only game I recall actually using it to cheat on was <em>The Legend of Zelda: Link&#8217;s Awakening</em> for the SNES. Infinite hearts allowed my ten-year-old self to get past the difficult boss fights and go dungeon-crawling to solve the puzzles I loved without having to worry about a game over.</p>
<p>Mostly I loved the Game Genie for it&#8217;s other purpose: altering the game in ways the developers never intended, to often hilarious results. Moon Jump. Color palate switches. Debug levels. You were essentially altering the game memory at load-time and could cause all kinds of crazy side-effects.</p>
<p><img src="http://www.bradwestness.com/wp-content/uploads/2013/03/0.jpg" alt="What." /></p>
<p>ZSNES, a Super Nintendo emulator for the PC, even let you pause your game, take note of various memory values that had changed since your last pause, and generate you own Game Genie codes.</p>
<p>This was effectively a sidelong introduction to the concepts of programming for me at a young age. Altering the state of memory of the machine could affect the program as it ran. That means that there is a program. There is memory. <a href="http://en.wikipedia.org/wiki/Finite-state_machine" title="Wikipedia">There is such a thing as &#8220;state&#8221; in the machine</a>. Fascinating.</p>
<p>Of course, today I use much higher-level programming languages, and prefer to do most of my development on the web, since it&#8217;s 2013 and <a href="http://www.hanselman.com/blog/AppsAreTooMuchLike1990sCDROMsAndNotEnoughLikeTheWeb.aspx" title="Scott Hanselman">apps are like CD-ROMs from the 1990s</a>. So I&#8217;m not dealing with low-level memory addressing on a day-to-day basis.</p>
<p>But I still find it fascinating.</p>
<p>Now go read about <a href="http://www.mentalfloss.com/article/12793/how-did-game-genie-work" title="Mental Floss">how the Game Genie worked</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/why-i-program-game-genie,1950/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The IKEA Standing Desk Adapter</title>
		<link>http://www.bradwestness.com/the-ikea-standing-desk-adapter,1938/</link>
		<comments>http://www.bradwestness.com/the-ikea-standing-desk-adapter,1938/#comments</comments>
		<pubDate>Wed, 23 Jan 2013 14:41:46 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Fitness]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1938</guid>
		<description><![CDATA[I&#8217;ve been reading about standing desks for a while now because sitting is killing me, and trying to figure out an inexpensive way to set one up for myself at work. I settled on making a &#8220;standing desk adapter&#8221; out of an IKEA LACK coffee table which only set me back twenty bucks. I measured [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p>I&#8217;ve been reading about <a href="http://www.wired.com/gadgetlab/2012/05/ditch-your-office-chair-for-a-new-standing-desk/">standing desks</a> for a while now because <a href="http://www.medicalbillingandcoding.org/sitting-kills/">sitting is killing me</a>, and trying to figure out an inexpensive way to set one up for myself at work. I settled on making a &#8220;standing desk adapter&#8221; out of an <a href="http://www.ikea.com/us/en/catalog/products/00095036/">IKEA <em>LACK</em> coffee table</a> which only set me back twenty bucks.</p>
<p>I measured the number of inches above my desk that my wrist rests at when standing with my elbow at a ninety degree angle, and then I cut the legs of the coffee table to the same length (taking into account the height of the table top). I then put some little <a href="http://www.amazon.com/s?ie=UTF8&amp;page=1&amp;rh=i%3Aaps%2Ck%3Afurniture%20pads">stick-on furniture pads</a> on each of the legs so that I wouldn&#8217;t scratch up the surface of my desk at work.</p>
<p>Then, it was just a matter of trucking my &#8220;adapter&#8221; in and setting everything up.</p>
<p><img src="http://www.bradwestness.com/wp-content/uploads/2013/01/standing_desk-225x300.jpg" alt="Standing Desk" /></p>
<p>Seems pretty good so far, but I definitely need one of those &#8220;anti-fatigue&#8221; mats for standing in one place for prolonged periods of time. Also my monitors seem just a touch wobbly (likely due to the somewhat flexible plastic stands they are on extending off the back of the adapter a bit).</p>
<p>All in all I think it&#8217;s a pretty workable solution, and vastly cheaper than the pre-made standing desks you can get online or any <a href="http://www.amazon.com/Ergo-Stand-Convert-Desk-Stand-Maple/dp/B007SN8PPO/ref=sr_1_4?ie=UTF8&amp;qid=1358951689&amp;sr=8-4&amp;keywords=standing+desk">pre-made adapter I&#8217;ve found</a>. If I ever feel the need to have my monitors slightly farther away, I might pick up the <a href="http://www.ikea.com/us/en/catalog/products/40198396/">slightly larger square version of the LACK coffee table</a> to give the standing portion of my desk a little more real estate.</p>
<p>Eventually I may also convert it into a <a href="http://www.trekdesk.com/">walking desk</a>, but the desk-friendly treadmills are prohibitively expensive at the moment. I&#8217;m curious how difficult it would be to pick up a cheap standard treadmill and chop the handles off&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/the-ikea-standing-desk-adapter,1938/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Signing and Encoding iOS Configuration Profiles with C#</title>
		<link>http://www.bradwestness.com/signing-and-encoding-ios-configuration-profiles-with-c,1921/</link>
		<comments>http://www.bradwestness.com/signing-and-encoding-ios-configuration-profiles-with-c,1921/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 16:43:49 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1921</guid>
		<description><![CDATA[I&#8217;m currently in the process of developing a Mobile Device Management web application for UW-Whitewater, which has been largely an exercise in trial and error due to the cryptic nature of Apple&#8217;s documentation on the subject (which assume you&#8217;re developing on Mac OS and running a Mac OS server) and the dearth of information available [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p>I&#8217;m currently in the process of developing a Mobile Device Management web application for <a href="http://www.uww.edu">UW-Whitewater</a>, which has been largely an exercise in trial and error due to the cryptic nature of <a href="http://www.apple.com/support/iphone/enterprise/">Apple&#8217;s documentation on the subject</a> (which assume you&#8217;re developing on Mac OS and running a Mac OS server) and the dearth of information available from other sources.</p>
<p>After getting the secure signing and encoding of profiles working, I decided to post my results here, in case they are of use to anyone else. I&#8217;m assuming you&#8217;ve already generated the profile you want to send to the device, so this post will just cover signing and encrypting the profile so the device will show it as <strong>Verified</strong> rather than <strong>Not Verified</strong> or <strong>Unsigned</strong>.</p>
<h2>1. Loading the Signing Certificate</h2>
<p>You need to have an SSL certificate installed on your server, from some Certificate Authority or another (like <a href="http://www.verisigninc.com/">VeriSign</a> or <a href="http://www.entrust.net/">Entrust</a>). The iOS device has an internal list of certificate authorities that it &#8220;trusts&#8221; natively, but that shouldn&#8217;t matter because we&#8217;re going to include the full chain of certificates with the profile. The only thing that won&#8217;t work are <strong>self-signed</strong> certificates, as there&#8217;s no certificate authority present so the device will show the profile as <strong>Not Verified</strong>.</p>
<h3>Specify Which Certificate to Use</h3>
<p>Load up IIS Manager on the server and click on the server node in the tree view on the left. Click on <em>Server Certificates</em> in the content section. Now, double-click the certificate that you want to use to sign the profiles.</p>
<p>Switch to the <strong>Details</strong> tab and note the <em>Subject</em>. We&#8217;ll use this as a key to load the certificate dynamically from within your application. You don&#8217;t need the whole thing, just a portion of it that will allow you to find it uniquely.</p>
<p><img src="http://www.bradwestness.com/wp-content/uploads/2013/01/certificate_details.png" alt="Certificate Details" /></p>
<h3>Find and Load the Certificate</h3>
<p>There are a number of certificate stores and locations that the certificate can be stored in. I decided to just search through all possible combinations so it doesn&#8217;t matter which store my certificate is in. We just need to loop through each store and location combination and find the certificate that matches the subject we just looked up.</p>
<pre><code>    using System.Collections;
    using System.Linq;
    using System.Security.Cryptography.X509Certificates;

    ...

    private static X509Certificate2 GetSigningCertificate(string subject)
    {
        X509Certificate2 theCert = null;
        foreach (StoreName name in Enum.GetValues(typeof (StoreName)))
        {
            foreach (StoreLocation location in Enum.GetValues(typeof (StoreLocation)))
            {
                var store = new X509Store(name, location);
                store.Open(OpenFlags.ReadOnly);
                foreach (X509Certificate2 cert in store.Certificates)
                {
                    if (cert.Subject.ToLower().Contains(subject.ToLower()) &amp;&amp; cert.HasPrivateKey)
                    {
                        theCert = cert;
                        break;
                    }
                }
                store.Close();
            }
        }
        if (theCert == null)
        {
            throw new Exception(
                String.Format("No certificate found containing a subject '{0}'.",
                              subject));
        }

        return theCert;
    }
</code></pre>
<p>*Note: &#8220;<code>subject</code>&#8221; should be set to the certificate subject you looked up above.</p>
<h2>2. Encode and Sign the Profile</h2>
<p>I used the <a href="http://www.bouncycastle.org/csharp/">BouncyCastle</a> cryptographic library to sign the profiles. It&#8217;s available as a <a href="http://nuget.org/">NuGet</a> package, so it&#8217;s easy to add to your project.</p>
<p>This is the same library Apple uses in the <a href="http://support.apple.com/kb/DL1466">iPhone Configuration Utility for Windows</a> so it seemed like a natural choice. I had no luck getting the certificate signing to work using soley the built in <code>System.Security</code> classes provided by the .NET Framework.</p>
<pre><code>using Org.BouncyCastle.Cms;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.X509;
using Org.BouncyCastle.X509.Store;
using X509Certificate = Org.BouncyCastle.X509.X509Certificate;

...

    private static byte[] EncodeAndSign(string input)
    {
        AsymmetricCipherKeyPair keyPair = DotNetUtilities.GetKeyPair(_signingCertificate.PrivateKey);
        X509Certificate bouncy = new X509CertificateParser().ReadCertificate(_signingCertificate.GetRawCertData());
        byte[] content = new UTF8Encoding().GetBytes(input);
        var signedDataGenerator = new CmsSignedDataGenerator();
        var processableByteArray = new CmsProcessableByteArray(content);

        IList certCollection = new ArrayList();
        var chain = new X509Chain();
        chain.Build(_signingCertificate);
        foreach (X509ChainElement link in chain.ChainElements)
        {
            certCollection.Add(DotNetUtilities.FromX509Certificate(link.Certificate));
        }
        IX509Store certStore = X509StoreFactory.Create("Certificate/Collection",
                                                       new X509CollectionStoreParameters(
                                                           certCollection));

        signedDataGenerator.AddCertificates(certStore);
        signedDataGenerator.AddSigner(keyPair.Private, bouncy, CmsSignedGenerator.DigestSha1);

        CmsSignedData signedData = signedDataGenerator.Generate(processableByteArray, true);
        return signedData.GetEncoded();
    }
</code></pre>
<p><em>Note: <code>_signingCertificate</code> is the result from the GetSigningCertificate() method, stored in a static variable so we don&#8217;t have to search for it every time. The <code>input</code> parameter should be a string containing the configuration profile you wish to send to the device.</em></p>
<p>This method will take your configuration profile and return it as a byte array, UTF-8 encoded, signed, and encrypted, just the way the device likes.</p>
<p>The <code>certCollection</code> section retrieves the entire signature chain for your SSL certificate so the Certificate Authority and any intermediate certificates will be included with the profile.</p>
<h2>3. Deliver the Profile to the Device</h2>
<p>I chose to write my application using the <a href="http://www.asp.net/mvc">ASP.NET MVC framework</a>. In order to deliver the signed and encrypted profile to the device, I can return a <code>FileContentResult</code> containing the byte array from the <code>EncodeAndSign()</code> method above.</p>
<p>The MIME-type should be <code>"application/x-apple-aspen-config"</code>. The filename should end with <code>.mobileconfig</code> but you can name the first portion whatever you like.</p>
<pre><code>return File(profile, "application/x-apple-aspen-config", "profile.mobileconfig");
</code></pre>
<p>I intend to leave this post up so anybody else who might having issues developing an MDM application with C# can find it.</p>
<p>If you notice any errors or have a better way of doing things, let me know and I will update the post accordingly.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/signing-and-encoding-ios-configuration-profiles-with-c,1921/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Impressions of The Hobbit &#8211; An Unexpected Journey</title>
		<link>http://www.bradwestness.com/first-impressions-of-the-hobbit-an-unexpected-journey,1907/</link>
		<comments>http://www.bradwestness.com/first-impressions-of-the-hobbit-an-unexpected-journey,1907/#comments</comments>
		<pubDate>Mon, 17 Dec 2012 17:05:22 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Movies]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1907</guid>
		<description><![CDATA[We saw the first of Peter Jackson&#8217;s The Hobbit movies last night in 3D at 48 frames per second. Normally I&#8217;m not a fan of 3D movies because the 3D glasses make the picture darker and the 3D effects tend to make high-action sequences look blurry and hard to follow. However, I thought it was [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p><a href="http://www.bradwestness.com/wp-content/uploads/2012/12/Tolkiens-illustration-of-008.jpg"><img src="http://www.bradwestness.com/wp-content/uploads/2012/12/Tolkiens-illustration-of-008-300x180.jpg" alt="Tolkien&#039;s illustration of Bilbo Baggins&#039;s home" width="300" height="180" class="aligncenter size-medium wp-image-1908" /></a></p>
<p>We saw the first of Peter Jackson&#8217;s The Hobbit movies last night in 3D at 48 frames per second. Normally I&#8217;m not a fan of 3D movies because the 3D glasses make the picture darker and the 3D effects tend to make high-action sequences look blurry and hard to follow. However, I thought it was worth checking out the 48 frames per second version of the film since this is the first movie ever to be released in that format and its unlikely that the 48 frames per second version will ever be available on home video (at least for the foreseeable future).</p>
<p><span id="more-1907"></span></p>
<p>Nearly every review or reaction to the film that I had read online was pretty harshly negative to the 48 frames per second version of the film. <a href="http://www.avclub.com/articles/the-hobbit-an-unexpected-journey,89816/" target="_blank">The AV Club said</a> &#8220;the technique sharpens the picture while producing images that look remarkably video-like and unreal&#8221; and &#8220;the higher frame rate has a flattening effect that makes everything look shallower, more pixelated, and more artificial.&#8221; A lot of people are saying it makes the movie look like a cheaply made soap opera rather than the epic-scaled film it is meant to be.</p>
<p>I held out hope that people were being sticks-in-the-mud and that the effect would look much better than the crappy &#8220;motion-smoothing&#8221; effect that some HDTVs employ due to the fact that it was actually shot at 48 frames per second and not just using interpolation to create a fake 48fps effect from 24fps source video.</p>
<p>A lot of early reviews and reactions to the film also complained about the pacing, citing the fact that Peter Jackson and company decided to make three films out of the book (instead of the initially planned two films) led to a lot of overlong sequences and the inclusion of padded-out extraneous material that should have been left on the cutting room floor. </p>
<p>Again, I kept my hopes up that the filmmakers would exercise the same capability they had showed with the Lord of the Rings films, striking a balance between including everything in the book for the sake of creating a faithful adaptation (which would make for a very boring and long movie) and leaving only the exciting action sequences and none of the prose, dialogue and world-building that make Tolkien&#8217;s writing better than run-of-the-mill fantasy.</p>
<p>After seeing the film, I feel completely affirmed on the latter count, and mixed on the former. The movie felt brisk, exciting and well paced despite only covering the first third of The Hobbit. I think something people forget when grousing about how &#8220;The Hobbit is shorter than any one of the Lord of the Rings books, yet they&#8217;re making the same amount of movies out of it as the entirety of Lord of the rings&#8221; is that The Hobbit is much more action-packed as a novel than Lord of the Rings is. It&#8217;s easier to cut out or condense long scenes of dialog, of which there are many in Lord of the Rings. If you cut too much out of The Hobbit, the films would be little more than a whirlwind tour of familiar places and events for those who had read the book.</p>
<p>That version of The Hobbit already exists, in the form of the Rankin-Bass cartoon from 1977. It&#8217;s only 77 minutes long. It also loses entire portions of the book (Beorn makes no appearance, and neither does the Arkenstone) and doesn&#8217;t do much in the way of establishing any of the characters beyond Bilbo, Gandalf and Thorin, or the relation of their quest to greater events in Middle-Earth.</p>
<p>The cartoon is great, but Jackson was setting out to make a version of The Hobbit that can co-exist along with his Lord of the Rings films (something Tolkien meant to do with the books, but never got around to completing). That means filling in the shared history that connects the events of the two stories and giving more information about each of the characters that take part in it.</p>
<p>I felt the film was well paced and plotted, the extra material (mostly concerning Radagast the Brown) was handled well. In fact, when reading the books I always used to wish there was more details about Radagast since the order of five wizards is an interesting feature of Middle-Earth that never gets much discussion within Tolkien&#8217;s books. Iconic scenes like &#8220;Riddles in the Dark&#8221; get room to breathe and sink in, but don&#8217;t feel overlong or plodding.</p>
<p>As far as the high frame rate and 3D, I will say this: the high frame rate resolved the darkness and blurriness that I normally associate with 3D movies. Even in the action sequences with a lot of quick camera movements, the action was never blurry or incomprehensible like with 3D films shot at a traditional frame rate. The high frame rate combined with the 3D creates a shoebox diorama like deepening illusion that makes it feel like you&#8217;re watching the story unfold through a window rather than having things fly out of the screen at you. </p>
<p>However, at certain times throughout the film, the high framerate gives the movie a &#8220;sped up&#8221; quality, almost like watching a VHS tape while fast forwarding, or watching an old newsreel of Babe Ruth running the bases that the camera operator cranked too quickly. This effect was rather jarring and weirdly seemed to come and go in fits and starts, only for one single shot in the middle of a scene here and there. Also the high framerate causes some of the special effects to look particularly video-gameish, especially during scenes where the characters were walking on a surface that was obviously computer generated, such as the swinging bridges in the Goblin King sequence.</p>
<p>All in all, I&#8217;d say it&#8217;s the start of what looks to be a very good telling of the story of The Hobbit and I&#8217;m looking forward to the next installment. If you like 3D, I&#8217;d recommend the high framerate version since it&#8217;s so much brighter and clearer than 24 frames per second 3D. However, if you&#8217;re indifferent to 3D or actively dislike it I&#8217;d say stick with the 24fps 2D version.</p>
<p><strong>Nerdy Plot Hole:</strong> If Gandalf now has the morgul blade that was made for the Witch King of Angmar, how does the Witch King get it back in order to stab Frodo with it on Weathertop in The Fellowship of the Ring?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/first-impressions-of-the-hobbit-an-unexpected-journey,1907/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>10 Worst Christmas Songs</title>
		<link>http://www.bradwestness.com/worst-christmas-songs,1852/</link>
		<comments>http://www.bradwestness.com/worst-christmas-songs,1852/#comments</comments>
		<pubDate>Fri, 23 Nov 2012 17:30:49 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1852</guid>
		<description><![CDATA[It&#8217;s Black Friday, so in lieu of  waiting in line outside Best Buy for six hours, I thought I&#8217;d post my annual list of Worst Christmas Songs. It&#8217;s not really an annual list, but I made a similar post a couple years ago before losing all my website&#8217;s content due to installing a WordPress plugin that messed [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p>It&#8217;s Black Friday, so in lieu of  waiting in line outside Best Buy for six hours, I thought I&#8217;d post my annual list of Worst Christmas Songs.</p>
<p>It&#8217;s not really an annual list, but I made a similar post a couple years ago before losing all my website&#8217;s content due to installing a WordPress plugin that messed up the database.</p>
<p>Anyway, now that it&#8217;s officially acceptable to listen to Christmas music (and, therefore, we must all be subjected to it non-stop from now until Christmas Day), I thought I&#8217;d highlight a few of the songs that irritate me the most, for one reason or another.</p>
<p>Hopefully it&#8217;s a little unexpected and not just the same 10 songs that everyone hates.</p>
<p><span id="more-1852"></span></p>
<h3>10. Rogers and Hammerstein &#8211; My Favorite Things</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/33o32C0ogVM?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>This song mentions &#8220;brown paper packages tied up with strings&#8221; and general things about winter. It also mentions getting bitten by a dog and stung by a bee, so I&#8217;m not sure how it made it into the pantheon of Christmas songs that get played every year.</p>
<p>It is not a Christmas song. It&#8217;s a song about trying to cheer yourself up when you&#8217;re depressed. It&#8217;s not a bad song, it just doesn&#8217;t belong in the Christmas playlist.</p>
<h3>9. John Lennon &#8211; Happy Xmas (War Is Over)</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/yN4Uu0OlmTg?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>Another one that is not a bad song, but not really a Christmas song. It&#8217;s a song about the year ending and taking stock of what you&#8217;ve done and looking ahead to the next year.</p>
<p>The lyric &#8220;Another year over, a new one just begun&#8221; implies that it&#8217;s actually New Years Day at the earliest, so it doesn&#8217;t make sense for this to be in heavy rotation a month before Christmas.</p>
<h3>8. &#8216;N Sync &#8211; Under My Tree</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/P5-BjzdEsDw?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>This one is, mercifully, not in heavy rotation anymore, but anyone who lived through the nineties has certainly heard it a few times. It&#8217;s basically a song about how all five members of &#8216;N Sync want to mack on you under their (shared?) Christmas tree, and they want Santa to watch.</p>
<p>&#8220;When the party is over / The night&#8217;s just begun&#8221; and &#8220;Two become one / That&#8217;s what we&#8217;ve waited all day for&#8221; are actual lyrics from the song, along with &#8220;I&#8217;ll show you how good it could be / I wish that Santa could be here to see.&#8221;</p>
<p>&#8216;N Sync also tells you to &#8220;relax and enjoy the view,&#8221; which I would assume means staring directly at the floor, if you are laying underneath a Christmas tree.</p>
<h3>7. Frank Loesser &#8211; Baby It&#8217;s Cold Outside</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/pjYUzpdKMZs?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>I actually kind of like the Leon Redbone version from the Elf soundtrack, but that&#8217;s more because Leon Redbone&#8217;s ridiculous voice is fun to listen to than anything about this song in particular.</p>
<p>This is basically a song about a dude roofie-ing a woman, if you listen to the words (&#8220;Say, what&#8217;s in this drink?&#8221;). Gross.</p>
<h3>6. Wham! &#8211; Last Christmas</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/E8gmARGvPlI?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>First of all, what the crap is the deal with this song? The lyrics are a weird combination of &#8220;won&#8217;t get fooled again&#8221; and &#8220;yes I will definitely get fooled again.&#8221;</p>
<p>The chorus is all about how the singer is going to give his heart to someone else this year because last year &#8220;you&#8221; gave it away, causing him tears. However, the first verse contains the lines &#8220;Now I know what a fool I&#8217;ve been / But if you kissed me now / I know you&#8217;d fool me again,&#8221; but later he sings &#8220;Now I found a real love you&#8217;ll never fool me again,&#8221; so this one&#8217;s all over the map. Also, that second line has about 400 too many syllables to fit in the allotted space in the song.</p>
<p>Its incredibly repetitive and full of cornball 80s synth. As far as I can tell, no actual instruments were physically touched in the production of this song.</p>
<h3>5.  Donny Hathaway &#8211; This Christmas (Gloria Estefan Version)</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/rFX05S0dv8E?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>I&#8217;m not sure if this song is a sequel to &#8220;Last Christmas&#8221; from above (or perhaps that one is a prequel to this), but the Gloria Estefan version shares that song&#8217;s lack of any discernible instrumentation that is not played by a MIDI sequencer. It&#8217;s also hard to divine any actual sentiment that would set &#8220;this&#8221; Christmas apart from any other year.</p>
<p>Why is this Christmas special? The only thing the narrator notes that is might be unique to &#8220;this&#8221; Christmas is that &#8220;My world is filled with cheer, and you&#8221; and &#8220;Your eyes outshine the town.&#8221; She then goes on to sing about how the fireside is blazing bright and how it&#8217;s going to be &#8220;very special&#8221; and she&#8217;s going to &#8220;get to know you better,&#8221; complete with funky porno-style wah-wah guitar.</p>
<p>Then a children&#8217;s chorus kicks in, singing about hanging &#8220;all the mistletoe&#8221; and apparently they&#8217;re also going to &#8220;get to know you better&#8221; too.</p>
<p>Nope! Don&#8217;t have a childrens choir sing about doin&#8217; it at Christmas. Go to jail.</p>
<h3>4. Dolly Parton and Kenny Rogers &#8211; A Christmas to Remember</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/hhYEf9TQO0I?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>Originally part of a weird, &#8220;funny&#8221; Christmas special (having trouble getting your boot off equals comedy) that was appropriately filmed in 1984.  This is another one with beyond-corny production and is another song about doin&#8217; it at Christmas time. &#8220;Change the radio and I&#8217;ll turn the lights down dimmer&#8221;? I&#8217;ll do the first thing, whenever this song comes on the radio. Thanks for the suggestion, Kenny.</p>
<p>&#8220;Strangers when we met / Lovers as we leave / Christmas to remember / Too good to believe&#8221; and &#8220;Though it&#8217;s cold outside we&#8217;ll just stroke the burning embers&#8221; are just a couple more lines that we didn&#8217;t need to hear about how much Parton and Kenny Rogers enjoy doin&#8217; it in a ski chalet in Tahoe.</p>
<p>And yes, they say &#8220;stroke&#8221; in the last line, not &#8220;stoke,&#8221; like a human would say.</p>
<h3>3. Katherine Kennicott Davis &#8211; Little Drummer Boy (Trapp Singers version)</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/dZvjPCcHI4g?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<ul>
<li>The Bible makes no mention of a &#8220;drummer boy&#8221; being present at the nativity scene</li>
<li><a href="http://christianity.about.com/od/biblestorysummaries/p/christmasstory.htm" target="_blank">According to The Bible</a>, by the time the Magi visited the baby Jesus he would have actually been about 2 years old</li>
<li>Little red snare drums with drumsticks did not exist in the year zero</li>
<li>Newborn babies do not enjoy having drums played in their faces</li>
<li>Mothers who have just given birth do not enjoy having drums played in their faces</li>
<li>Oxen and lambs do not &#8220;keep time.&#8221;</li>
<li>Also why would they need to keep time because that&#8217;s precisely what drums are for?</li>
<li>This song is a bunch of &#8220;Precious Moments&#8221;-esque revisionist malarkey</li>
<li>As comedian <a href="http://www.avclub.com/articles/kyle-kinane-parumpumpumpums-his-way-through-hating,88986/" target="_blank">Kyle Kinane recently noted on The A.V. Club</a>, why do so many versions have an actual drum playing when there is already a vocal part mimicking the drum?</li>
</ul>
<h3>2. Mykola Leontovych &#8211; Carol of the Bells</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/4vNcGlM8O3I?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>This song, particularly the Trans-Siberian Orchestra&#8217;s arrangement of it, is pretty much the exact opposite of my idea of Christmassy. Bombastic electric guitars and squealing solos make this sound like a crappy band trying way, way too hard to be Led Zeppelin and not like anything a sane person would associate with Christmas.</p>
<p>No matter the version of the song though, it just sets my teeth on edge and makes me feel like I&#8217;m about to get attacked by a Balrog. It&#8217;s one of those songs where the words are all about singing gaily and having good cheer but the pounding rhythm and super-accentuated first syllable of each line make it sound more like a war song that should be sung by a Samoan mens choir during a siege scene in a Lord of the Rings movie.</p>
<h3>1. Newsong &#8211; The Christmas Shoes</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/GJcPVB-we7g?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>This song is hilariously awful and full of such false emotion and a fake &#8220;lesson&#8221; to be learned that <a href="http://www.slantmagazine.com/house/2011/11/10-worst-christmas-songs-of-all-time/" target="_blank">Slant magazine said</a> &#8220;It&#8217;s not just the worst Christmas song ever, it&#8217;s one of the worst songs ever recorded.&#8221; Check out <a href="http://www.youtube.com/watch?v=j5iyV7N5jvI" target="_blank">Patton Oswalt&#8217;s hilarious takedown of this song</a> (contains swears, so headphones up).</p>
<h2>Bonus &#8211; A Good Song!</h2>
<p>I&#8217;ve seen this one <a href="http://entertainment.nbcnews.com/_news/2011/12/22/9583429-11-christmas-songs-we-hope-never-to-hear-again?lite" target="_blank">included</a> in a lot of &#8220;worst of&#8221; <a href="http://www.avclub.com/articles/worst-christmas-music,65888/" target="_blank">lists</a>, but dammit, it&#8217;s fun and catchy and the video is basically people running around in the snow looking infectiously happy. It&#8217;s Paul McCartney&#8217;s <strong>Wonderful Christmastime</strong> and if you don&#8217;t like it you are wrong.</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/pCjhZ_i7k98?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/worst-christmas-songs,1852/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Put a Feed On It</title>
		<link>http://www.bradwestness.com/put-a-feed-on-it,1642/</link>
		<comments>http://www.bradwestness.com/put-a-feed-on-it,1642/#comments</comments>
		<pubDate>Thu, 30 Aug 2012 18:56:10 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1642</guid>
		<description><![CDATA[Did you see this bag before? I didn&#8217;t. Now there&#8217;s a bird on it. It&#8217;s flying, it&#8217;s free! -Lisa Eversman, &#8220;Put a Bird on It&#8221; If you&#8217;re making a webapp that deals with public data, especially timestamped records that are for public display, here&#8217;s a good rule of thumb to follow: put a feed on it. At some [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p><a href="http://www.bradwestness.com/wp-content/uploads/2012/08/imgres.jpg"><img class="aligncenter size-medium wp-image-1644" title="Put a Bird On It" src="http://www.bradwestness.com/wp-content/uploads/2012/08/imgres-300x165.jpg" alt="Put a Bird On It" width="300" height="165" /></a></p>
<blockquote><p>Did you see this bag before? I didn&#8217;t. Now there&#8217;s a bird on it. It&#8217;s flying, it&#8217;s free!</p>
<p>-Lisa Eversman, <em>&#8220;Put a Bird on It&#8221;</em></p></blockquote>
<p>If you&#8217;re making a webapp that deals with public data, especially timestamped records that are for public display, here&#8217;s a good rule of thumb to follow: <strong><em>put a feed on it</em></strong>. At some point, you&#8217;re going to want to pull that data into another place and display it as part of some landing page or aggregate it into some 3rd party service.</p>
<p><span id="more-1642"></span></p>
<p>If you work in a large enough organization, somebody&#8217;s eventually going to want to pull in your data. If you&#8217;ve exposed a feed, you control the business logic of what gets shown. If you don&#8217;t expose a feed, someone&#8217;s eventually going to find a way to pull the data directly from your database, probably without your knowing anything about it, and who knows if they&#8217;re respecting the intended design of your models, which they&#8217;ve probably had to reverse engineer by guess.</p>
<p>Luckily, it&#8217;s incredibly easy to &#8220;put a feed on it.&#8221; I recently did this with an <a href="http://www.asp.net/mvc" target="_blank">ASP.NET MVC</a> webapp that was in the latter situation described above.</p>
<h3>Create Serializable Feed Models</h3>
<p>First, you&#8217;ll want to create some models specifically for using as feed items. I created the following, which enabled me to map our <a href="https://announcements.uww.edu/" target="_blank">Announcement Board application&#8217;s</a> data models into an <a href="http://en.wikipedia.org/wiki/RSS" target="_blank">RSS 2.0</a> compatible feed.</p>
<h5>AnnouncementFeed.cs (Feed Object)</h5>
<p>First we need an object that will allow us to inject some of the required RSS fields into our output. Note that, while some of the elements are essentially read-only, if you don&#8217;t supply a <code class="syntax csharp">set { }</code> definition, the field will be omitted from the feed output.</p>
<p>Attributes allow us to control how elements are named in the feed output.</p>
<pre title="AnnouncementFeed.js" class="syntax csharp">
using System;
using System.Linq;
using System.Xml.Serialization;

namespace Announcements.Web.Models.Feed
{
    [Serializable]
    [XmlRoot(ElementName = &quot;rss&quot;)]
    public class AnnouncementFeed
    {
        [XmlAttribute(&quot;version&quot;)]
        public string version
        {
            get { return &quot;2.0&quot;; }
            set { }
        }

        public string title { get; set; }

        public string language
        {
            get { return &quot;en-us&quot;; }
            set { }
        }

        public string description
        {
            get { return announcements.Count() + &quot; Current Announcements&quot;; }
            set { }
        }

        public string copyright
        {
            get { return String.Format(&quot;All material copyright {0} MySite.com&quot;, DateTime.Now.Year); }
            set { }
        }

        public string webMaster
        {
            get { return &quot;webmaster@mysite&quot;; }
            set { }
        }

        public string link { get; set; }

        public string pubDate { get; set; }

        public string lastBuildDate { get; set; }

        [XmlArray(&quot;channel&quot;)]
        [XmlArrayItem(&quot;item&quot;)]
        public AnnouncementItem[] announcements { get; set; }
    }
}
</pre>
<h5>AnnouncementItem.cs (Feed Item Object)</h5>
<p>We also need an object to display the actual feed items.</p>
<pre class="syntax csharp">
using System;
using System.Xml.Serialization;

namespace Announcements.Web.Models.Feed
{
    [XmlRoot(&quot;item&quot;)]
    [Serializable]
    public class AnnouncementItem
    {
        public string title { get; set; }

        public string description { get; set; }

        public string author { get; set; }

        public string link { get; set; }

        public string guid { get; set; }

        public string pubDate { get; set; }
    }
}
</pre>
<p>&nbsp;</p>
<h3>Use AutoMapper to set up a Feed Profile <strong></strong></h3>
<p><a href="http://automapper.codeplex.com/" target="_blank">AutoMapper</a> is a great tool for mapping one kind of object into another (here we&#8217;re mapping our data objects, or POCOs, into our RSS-compatible feed item objects), it will save you a lot of headaches if you ever change one of names of your fields (perish the thought) and keep your controllers clean.</p>
<p>Plus, we can do a little bit of formatting on things like the dates and author e-mails right here. Later, in the controller, we&#8217;ll call <code class="syntax csharp">Mapper.Map&lt;&gt;</code>, which will translate the objects from one type to the other, using the rules we set up here.</p>
<pre class="syntax csharp">
using AutoMapper;
using Announcements.Core.Data.Entities;
using Announcements.Web.Helpers;
using Announcements.Web.Models.Feed;

namespace Announcements.Web.Bootstrap
{
    public class FeedModelProfile : Profile
    {
        public override string ProfileName
        {
            get { return &quot;FeedModel&quot;; }
        }

        protected override void Configure()
        {
            CreateMap&lt;announcement , AnnouncementItem&gt;()
                .ForMember(d =&gt; d.title, x =&gt; x.MapFrom(s =&gt; s.Title))
                .ForMember(d =&gt; d.author,
                           x =&gt;
                           x.MapFrom(
                               s =&gt;
                               string.Format(&quot;{0} ({1})&quot;,
                                             s.ContactId.Contains(&quot;@&quot;) ? s.ContactId : s.ContactId + &quot;@mysite.com&quot;,
                                             s.Contact)))
                .ForMember(d =&gt; d.description,
                           x =&gt; x.MapFrom(s =&gt; PageHelpers.Description(s.Description.ShortDescription)))
                .ForMember(d =&gt; d.pubDate, x =&gt; x.MapFrom(s =&gt; s.SubmitDate.ToString(&quot;r&quot;)))
                .ForMember(d =&gt; d.guid, x =&gt; x.MapFrom(s =&gt; s.Id.ToString()))
                .ForMember(d =&gt; d.link, x =&gt; x.MapFrom(s =&gt; PathHelpers.AnnouncementDetails(s.Id)));
        }
    }
}
&lt;/announcement&gt;</pre>
<p>The <code class="syntax csharp">PathHelpers.AnnouncementDetails(int id)</code> method is a static helper method that returns an absolute URL to the details of the given announcement. I also created a <code class="syntax csharp">HomeDetails</code> helper method which I&#8217;ll use when constructing the <code class="syntax csharp">AnnouncementFeed</code> object for display.</p>
<pre class="syntax csharp">
using System;
using System.Web;
using System.Web.Mvc;

namespace Announcements.Web.Helpers
{
    public static class PathHelpers
    {
        public static string HomeIndex()
        {
            var helper = new UrlHelper(HttpContext.Current.Request.RequestContext);
            string scheme = HttpContext.Current.Request.Url.Scheme;

            return new Uri(
                helper.RouteUrl(&quot;Default&quot;,
                                new
                                    {
                                        controller = &quot;Home&quot;,
                                        action = &quot;Index&quot;
                                    },
                                scheme
                    )).GetComponents(UriComponents.Scheme | UriComponents.Host | UriComponents.PathAndQuery,
                                     UriFormat.UriEscaped);
        }

        public static string AnnouncementDetails(int announcementId)
        {
            var helper = new UrlHelper(HttpContext.Current.Request.RequestContext);
            string scheme = HttpContext.Current.Request.Url.Scheme;

            return new Uri(
                helper.RouteUrl(&quot;Default&quot;,
                                new
                                    {
                                        controller = &quot;Announcement&quot;,
                                        action = &quot;Details&quot;,
                                        id = announcementId
                                    },
                                scheme
                    )).GetComponents(UriComponents.Scheme | UriComponents.Host | UriComponents.PathAndQuery,
                                     UriFormat.UriEscaped);
        }
    }
}
</pre>
<h3>Create a Controller To Generate the Feed</h3>
<p>I created a controller named <code class="syntax csharp">FeedController</code>, because I wanted the feed to show up at www.myapp.com/feed. I also created a &#8220;Json&#8221; method (using <a href="http://mvccontrib.codeplex.com/" target="_blank">MvcContrib&#8217;s</a> <code class="syntax csharp">XmlResult</code> and <code class="syntax csharp">JsonResult</code> <code class="syntax csharp">ActionResult</code> types), so that one would be available at www.myapp.com/feed/json.</p>
<p>I also used an object cache to cache the results so that the feed would only have to be regenerated once per half-hour, to save on database requests.</p>
<pre class="syntax csharp">
using System;
using System.Collections.Generic;
using System.Runtime.Caching;
using System.Web.Mvc;
using AutoMapper;
using MvcContrib.ActionResults;
using Announcements.Core;
using Announcements.Core.Data;
using Announcements.Core.Data.Entities;
using Announcements.Web.Helpers;
using Announcements.Web.Models.Feed;

namespace Announcements.Web.Controllers
{
    public class FeedController : Controller
    {
        #region Declarations

        private static readonly ObjectCache _cache = MemoryCache.Default;
        private readonly IAnnouncementRepository _announcements;
        private readonly IMappingEngine _mapper;

        public FeedController(
            IAnnouncementRepository announcementRepository,
            IMappingEngine mappingEngine
            )
        {
            _announcements = announcementRepository;
            _mapper = mappingEngine;
        }

        #endregion

        //
        // GET: /Feed/
        public ActionResult Index()
        {
            var result = _cache[&quot;feed&quot;] as XmlResult;

            if (result == null)
            {
                AnnouncementItem[] announcements =
                    _mapper.Map&amp;lt;IList&amp;lt;Announcement&amp;gt;, AnnouncementItem[]&amp;gt;(_announcements.GetCurrent());

                var model = new AnnouncementFeed
                                {
                                    title = &quot;University of Wisconsin-Whitewater - Announcements&quot;,
                                    description = String.Format(&quot;{0} Current Announcements&quot;, announcements.Length),
                                    link = PathHelpers.HomeIndex(),
                                    lastBuildDate = DateTime.Now.ToString(&quot;r&quot;),
                                    pubDate = DateTime.Now.ToString(&quot;r&quot;),
                                    announcements = announcements
                                };

                result = new XmlResult(model);
                var policy = new CacheItemPolicy
                                 {AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(ApplicationSettings.CacheMinutes)};

                _cache.Set(&quot;feed&quot;, result, policy);
            }

            return result;
        }

        //
        // GET: /Feed/Json/
        public ActionResult Json()
        {
            var result = _cache[&quot;json&quot;] as JsonResult;

            if (result == null)
            {
                AnnouncementItem[] announcements =
                    _mapper.Map&amp;lt;IList&amp;lt;Announcement&amp;gt;, AnnouncementItem[]&amp;gt;(_announcements.GetCurrent());

                var model = new AnnouncementFeed
                {
                    title = &quot;University of Wisconsin-Whitewater - Announcements&quot;,
                    description = String.Format(&quot;{0} Current Announcements&quot;, announcements.Length),
                    link = PathHelpers.HomeIndex(),
                    lastBuildDate = DateTime.Now.ToString(&quot;r&quot;),
                    pubDate = DateTime.Now.ToString(&quot;r&quot;),
                    announcements = announcements
                };

                result = new JsonResult{ Data = model, JsonRequestBehavior = JsonRequestBehavior.AllowGet};
                var policy = new CacheItemPolicy { AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(ApplicationSettings.CacheMinutes) };

                _cache.Set(&quot;json&quot;, result, policy);
            }

            return result;
            
        }
    }
}
</pre>
<h3>Enable Cross-Domain Requests (If You Want)</h3>
<p>You also might want to go into your <code class="syntax xml">Web.Config</code> and enable cross-domain requests to your feeds, so people can access them from anywhere (if they&#8217;re truly public, that is):</p>
<pre class="syntax csharp">
    &lt;system .webServer&gt;
        &lt;!-- ... --&gt;
        &lt;httpprotocol&gt;
            &lt;customheaders&gt;
                &lt;clear&gt;&lt;/clear&gt;
                &lt;add name=&quot;Access-Control-Allow-Origin&quot; value=&quot;*&quot;&gt;&lt;/add&gt;
                &lt;add name=&quot;X-UA-Compatible&quot; value=&quot;IE=edge,chrome=1&quot;&gt;&lt;/add&gt;
            &lt;/customheaders&gt;
        &lt;/httpprotocol&gt;
    &lt;/system&gt;
</pre>
<p><em>Note: The &#8220;X-UA-Compatible&#8221; header I&#8217;m setting above just forces Internet Explorer to use it&#8217;s most up-to-date rendering engine when viewing the website. It won&#8217;t affect the feeds at all, but it&#8217;s handy if IE decides to render your site in IE7 mode for whatever reason, so I&#8217;m leaving it in.</em></p>
<h3>That&#8217;s it!</h3>
<p>Now you&#8217;ve got a canonical feed for people to use in order to pull your data into other places, where you control the data that gets displayed, and the formatting of everything in the feed.</p>
<blockquote><p>Did you see this data before? I didn&#8217;t. Now there&#8217;s a feed on it. It&#8217;s flying, it&#8217;s free!</p>
<p>-Brad Westness (me)</p></blockquote>
<h3>Now Watch the Sketch</h3>
<p>Just for good measure, here&#8217;s the original &#8220;Put a Bird On It&#8221; sketch from <a href="http://www.ifc.com/shows/portlandia" target="_blank">Portlandia on IFC</a> in case you haven&#8217;t seen it:</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/0XM3vWJmpfo?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/put-a-feed-on-it,1642/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ayn Rand Was a Not a Republican</title>
		<link>http://www.bradwestness.com/ayn-rand-was-a-not-a-republican,1629/</link>
		<comments>http://www.bradwestness.com/ayn-rand-was-a-not-a-republican,1629/#comments</comments>
		<pubDate>Wed, 15 Aug 2012 00:02:33 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1629</guid>
		<description><![CDATA[In the coming months, you&#8217;re sure to be hearing a lot about the tea party&#8217;s golden boy, Paul Ryan, who was just announced as the Republican candidate for vice-president. He is on record as stating that Ayn Rand is the the reason he got involved in public service. Although he&#8217;s more recently renounced his love [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p><a href="http://www.bradwestness.com/wp-content/uploads/2012/08/rand-2.jpg"><img class="aligncenter size-medium wp-image-1630" title="rand 2" src="http://www.bradwestness.com/wp-content/uploads/2012/08/rand-2-300x300.jpg" alt="" width="300" height="300" /></a><br />
In the coming months, you&#8217;re sure to be hearing a lot about the tea party&#8217;s golden boy, Paul Ryan, who was just announced as the Republican candidate for vice-president.</p>
<p><span id="more-1629"></span></p>
<p>He is on record as stating that Ayn Rand is the the <a href="http://www.cnn.com/2012/08/14/opinion/weiss-ryan-rand/index.html" target="_blank">reason he got involved in public service</a>. Although he&#8217;s more recently <a href="http://articles.latimes.com/2012/aug/12/news/la-pn-vp-paul-ryan-ayn-rand-20120811" target="_blank">renounced his love of Rand</a>, he&#8217;s still on record with the following quote:</p>
<blockquote><p>What’s unique about what’s happening today in government, in the world, in America, is that it’s as if we’re living in an Ayn Rand novel right now,” Ryan said. “I think Ayn Rand did the best job of anybody to build a moral case of capitalism, and that morality of capitalism is under assault.&#8221;</p>
<p>-Paul Ryan</p></blockquote>
<p>I just thought it might be useful to share a couple more facts about Rand that Republicans and tea-partiers generally choose to ignore:</p>
<h2><a href="http://dangerousminds.net/comments/ayn_rand_absolutely_hated_ronald_reagan" target="_blank">She Hated Ronald Reagan</a></h2>
<blockquote><p>What do I think of President Reagan? The best answer to give would be: But I don’t think of him—and the more I see, the less I think. I did not vote for him (or for anyone else) and events seem to justify me. The appalling disgrace of his administration is his connection with the so-called “Moral Majority” and sundry other TV religionists, who are struggling—apparently with his approval—to take us back to the Middle Ages, via the unconstitutional union of religion and politics.</p>
<p>-Ayn Rand</p></blockquote>
<h2><a href="http://aynrandlexicon.com/lexicon/abortion.html" target="_blank">She was Pro Choice</a></h2>
<blockquote><p>Abortion is a moral right—which should be left to the sole discretion of the woman involved; morally, nothing other than her wish in the matter is to be considered. Who can conceivably have the right to dictate to her what disposition she is to make of the functions of her own body?</p>
<p>-Ayn Rand</p></blockquote>
<p>Now, I&#8217;m not saying I agree with Rand. I think her politics were untenable and sophomoric and require tortured, circuitous logic to seem reasonable. They don&#8217;t really hold up at all in the real world. But I think it&#8217;s worth noting that even the people these far-right candidates hold up as their ideologues don&#8217;t support them or agree with vast portions of their policies.</p>
<blockquote><p>Upper classes are a nation&#8217;s past; the middle class is its future.</p>
<p><a href="http://www.brainyquote.com/quotes/quotes/a/aynrand140997.html">-</a>Ayn Rand</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/ayn-rand-was-a-not-a-republican,1629/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple Statement of Fact</title>
		<link>http://www.bradwestness.com/a-simple-statement-of-fact,1620/</link>
		<comments>http://www.bradwestness.com/a-simple-statement-of-fact,1620/#comments</comments>
		<pubDate>Tue, 07 Aug 2012 22:59:41 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1620</guid>
		<description><![CDATA[Thanks for all the birthday wishes, everyone! I had a relaxing staycation and got a lot of projects done around the house, and topped it off with a few games of bowling with my parents, a visit to the State Fair (corndogs! pig races!). I feel lucky to have spent the year going to work [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p><a href="http://www.bradwestness.com/wp-content/uploads/2012/08/tumblr_m5sp8lXAql1qdsi82o1_1280.png"><img class="aligncenter size-medium wp-image-1621" title="It Is Your Birthday" src="http://www.bradwestness.com/wp-content/uploads/2012/08/tumblr_m5sp8lXAql1qdsi82o1_1280-300x187.png" alt="It Is Your Birthday" width="300" height="187" /></a></p>
<p>Thanks for all the birthday wishes, everyone! I had a relaxing staycation and got a lot of projects done around the house, and topped it off with a few games of bowling with my parents, a visit to the State Fair (corndogs! pig races!).</p>
<p><span id="more-1620"></span></p>
<p>I feel lucky to have spent the year going to work doing what I dreamed of since I was in middle school and found out that I could conceivably make a living playing with computers all day, and coming home to my beautiful wife and two nerdy dogs each night.</p>
<p>On to the next trip around the sun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/a-simple-statement-of-fact,1620/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dan Harmon on Dog Ownership</title>
		<link>http://www.bradwestness.com/dan-harmon-on-dog-ownership,1608/</link>
		<comments>http://www.bradwestness.com/dan-harmon-on-dog-ownership,1608/#comments</comments>
		<pubDate>Fri, 27 Jul 2012 15:30:07 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.bradwestness.com/?p=1608</guid>
		<description><![CDATA[Listening to Dan Harmon&#8216;s (the creator of NBC&#8217;s Community) new podcast &#8220;Harmontown,&#8221; and I thought I&#8217;d share this particularly funny quote on dog ownership: You have to have your shit together to some extent to have a dog. It&#8217;s saying &#8220;I want an animal to walk around, I&#8217;m gonna be the sunshine and rain in [&#8230;]]]></description>
				<content:encoded><![CDATA[<!-- google_afm --><p><a href="http://www.bradwestness.com/wp-content/uploads/2012/07/mza_8002962153703698627.600x600-75.jpg"><img class="aligncenter size-medium wp-image-1609" title="Harmontown" src="http://www.bradwestness.com/wp-content/uploads/2012/07/mza_8002962153703698627.600x600-75-276x300.jpg" alt="Harmontown" width="276" height="300" /></a></p>
<p>Listening to <a href="https://twitter.com/danharmon" target="_blank">Dan Harmon</a>&#8216;s (the creator of NBC&#8217;s <a href="http://www.nbc.com/community/" target="_blank"><em>Community</em></a>) new podcast &#8220;<a href="http://podbay.fm/show/542228532" target="_blank">Harmontown</a>,&#8221; and I thought I&#8217;d share this particularly funny quote on dog ownership:</p>
<p><span id="more-1608"></span></p>
<blockquote><p>You have to have your shit together to some extent to have a dog. It&#8217;s saying &#8220;I want an animal to walk around, I&#8217;m gonna be the sunshine and rain in its life. If I forget to look at it, it&#8217;s gonna have a heart attack.&#8221;</p></blockquote>
<p>It&#8217;s a really fun listen, you should check it out, but I will warn you that it&#8217;s pretty &#8220;NSFW,&#8221; so headphones UP.</p>
<p><strong>UPDATE: </strong>Literally as I was typing this my dog started making noises like he was getting murdered in the next room. I went to see what was the matter and he was &#8220;stuck&#8221; (if you catch my meaning) with a friend&#8217;s dog we are watching, who is in heat. So I had to&#8230;. <em>separate</em> them. Don&#8217;t worry though, Otis is fixed. Dog ownership!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradwestness.com/dan-harmon-on-dog-ownership,1608/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
