<?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>Random Agile Thoughts</title>
	<atom:link href="http://vcsjones.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vcsjones.com</link>
	<description>Warranty void.</description>
	<lastBuildDate>Mon, 20 May 2013 19:56:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Scaling WordPress Part 2: CDN</title>
		<link>http://vcsjones.com/2013/05/20/scaling-wordpress-part-2-cdn/</link>
		<comments>http://vcsjones.com/2013/05/20/scaling-wordpress-part-2-cdn/#comments</comments>
		<pubDate>Mon, 20 May 2013 19:43:51 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[cloudfront]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=507</guid>
		<description><![CDATA[Last time we looked at the performance of my site, we discovered that the DNS was a source of the problem due to slow resolution time. In this next part, we&#8217;ll try and tackle two things at the same time. &#8230; <a href="http://vcsjones.com/2013/05/20/scaling-wordpress-part-2-cdn/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://vcsjones.com/2013/05/20/scaling-wordpress-part-1-dns/">Last time</a> we looked at the performance of my site, we discovered that the DNS was a source of the problem due to slow resolution time. In this next part, we&#8217;ll try and tackle two things at the same time.</p>
<h1>A CDN and Cookie-Free Domains</h1>
<p>I&#8217;m doing this a bit out-of-order compared with how I actually configured my server, this I&#8217;m presenting this in a way that will require the least amount of backtracking. If setting up a CDN seems like too much work, you can skip this one and wait for the next part (GZipping).</p>
<p>One of the things YSlow gave me an &#8220;E&#8221; on (wow, worse than an F) was cookie-free domains. I&#8217;m using Google Analytics to track visitors on my site, and the way it accomplishes this is with cookies.</p>
<p>Cookies are a perfectly valid thing these days, however setting a cookie for my domain, <em>vcsjones.com</em>, meant that all static content like CSS, JavaScript, and images were sent with the cookie. Analytics was setting cookies when someone hit my site, and the web server was happy enough to send along the cookie header with this static content.</p>
<p>The typical solution for this is to use a cookie free domain, i.e. use a different domain for your static content. I couldn&#8217;t use a subdomain like <em>static.vcsjones.com</em> because cookies set at vcsjones.com also apply to all child domains. My only option to using a cookie free domain was to purchase another domain and serve static content from there, like staticvcsjones.com.</p>
<p>However, before I did any of that, YSlow suggested I use a Content Delivery Network, or CDN, for my static content. If I moved my static content to a CDN, then I would be taking care of the cookie free domains problem as well.</p>
<p>On the theme of using Amazon for everything, I settled on giving CloudFront a shot. CloudFront is Amazon&#8217;s content delivery network solution.</p>
<p>I had a couple of choices on how I wanted to set this up.</p>
<h2>Host my static content elsewhere (bad)</h2>
<p>I had originally gone the route of trying to move all of my static content to Amazon&#8217;s S3 solution. CloudFront is easy to configure to serve content from an S3 bucket, but this turned out to be a troublesome approach from a maintenance standpoint. I would not only need to move all of my uploads to S3, but also the theme content, and other &#8220;innards&#8221; of WordPress. This would be difficult keeping things up-to-sync. I wasn&#8217;t able to find a WordPress plugin that could keep all of that in sync for me, and manually uploaded content to S3 seemed tiresome. It would also mean any time I upgraded a plugin, theme, or WordPress itself, I would need to move all of those files to S3 again. This didn&#8217;t seem like a workable approach.</p>
<h2>Leave my static content as is (good)</h2>
<p>I could leave my static content exactly where it is, and set up CloudFront to use my own server as a source of static content. This seemed like the best approach. If my file content changed, the CDN would pick it up (eventually). Any new files would instantly be picked up by CloudFront, and I wouldn&#8217;t have to change where WordPress&#8217;s physical files were. That would better for upgrading and plugin changes.</p>
<h2>Making it all work</h2>
<p>I had initially set up CloudFront to point to vcsjones.com. That worked well enough, CloudFront served anything from my server in its edge cache. This however, left me with a bit of a yucky feeling: any <em>dynamic</em> content could possibly end up in CloudFront&#8217;s cache. I wasn&#8217;t a big fan of that, so I decided to truly separate my static content from my dynamic content, even if they were all in the same place.</p>
<p>I first brought up a new subdomain, <em>static.vcsjones.com</em>. I had it pointed to the same physical location as vcsjones.com. At first, this was a true 100% copy of vcsjones.com. My next intention was to configure nginx, my server, to only serve static content from static.vcsjones.com, and block it from vcsjones.com. As a last step, I would configure CloudFront to use static.vcsjones.com as an origin.</p>
<h2>Configuring NGINX</h2>
<p>NGINX is a great server, and I love its flexibility and speed. My static content virtual site configuration looked like this:</p>
<pre class="prettyprint">
server {
    listen          80;
    server_name     static.vcsjones.com;
    root            /var/www/wordpress/;

    location ~* \.(?:js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        add_header Pragma public;
        access_log off;
        break;
    }

    location / {
        return 404;
    }
}
</pre>
<p>This is an abbreviated version of what I currently have running now. So static.vcsjones.com will only serve static content, which helps mitigate the possibility of an search engine finding this domain somehow and dinging my SEO rankings for serving duplicate content.</p>
<p>So, vcsjones.com is being used to serve dynamic content, static.vcsjones.com is used to serve only static content, and my CloudFront CDN is using static.vcsjones.com.</p>
<p>Finally, I blocked static content from vcsjones.com with a few exceptions.</p>
<pre class="prettyprint">
location ~* \.(?:js|css|png|jpg|jpeg|gif|ico)$ {
    if ($http_referer ~ "wp-admin") {
        break;
    }
    if ($request_filename ~* jquery\.js$) {
        break;
    } 
    return 404;
}
</pre>
<p>This blocks static content from vcsjones.com unless it is jquery, or if the referer contains wp-admin.</p>
<p>jQuery is a bit of a special beast in WordPress. It doesn&#8217;t appear to be easy to cache via a CDN because WordPress dynamically builds it depending on what the extensions ask for.</p>
<p>wp-admin is whitelisted as a referer because we don&#8217;t want to break the admin section of WordPress, which appears to be a little more difficult to fix URLs in.</p>
<h2>Fixing URLs in WordPress</h2>
<p>So now with this fancy-pants CDN, I actually needed to use it. For now, I am using two WordPress plugins to accomplish this.</p>
<p><em>CDN Rewrite</em> works well to rewrite content from WordPress&#8217;s themes and includes. This changes my theme to load its CSS, images, and JS from CloudFront. The exception to this is jQuery. jQuery in WordPress is an odd beast, it appears that WordPress dynamically builds jQuery depending on what pieces of it is needed. For that purpose, jQuery is not served over my CDN to my site, which is rather unfortunate (though it is gzipped).</p>
<p><em>Real Time Find and Replace</em> works well to rewrite content in actual post bodies, that CDN Rewrite doesn&#8217;t seem to do.</p>
<p>My intention is to eventually eliminate both by fixing the actual links in post bodies, and creating a child theme. This will be a small improvement such that WordPress has less processing to do on the rendered HTML.</p>
<p>Due to the odd handling of jQuery in WordPress, neither of them catch the URL for jQuery, so jQuery is served outside the CDN, which is actually rather unfortunate.</p>
<h2>CloudFront CNAME</h2>
<p>One option CloudFront has is the ability to specify a CNAME in your DNS to CloudFront. I initially took this approach because it allowed more control over where my static content was located. If I use my CDN endpoint, dsdujlkb89x0f.cloudfront.net, that would mean if I spent all that time fixing static content URLs, I would have to fix them again if I opted to not use CloudFront. Initially I had setup cdn.vcsjones.com to point to CloudFront, but because it is a subdomain of vcsjones.com, it was getting Google Analytics cookies. Instead I opted to just use CloudFront&#8217;s domain. This keeps my static content cookie free, and also means I won&#8217;t pay for DNS lookups in Route 53.</p>
<h2>Gotchas</h2>
<p>This CDN approach works well for me, with a few issues that are acceptable trade offs, or is easy to work around.</p>
<p>Because I disabled static content on vcsjones.com to better separate the static content, the Administration bar is a little broken when used outside of wp-admin.</p>
<p>CloudFront has no easy to purge all of its cache. If you need purge something from CloudFront, you need to specify the path you want to purge, including the query string.</p>
<h1><em>More of this series</em></h1>
<ol>
<li><a href="http://vcsjones.com/2013/05/20/scaling-wordpress-part-1-dns/">Scaling WordPress Part 1: DNS</a></li>
<li>Scaling WordPress Part 2: CDN</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/05/20/scaling-wordpress-part-2-cdn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaling WordPress Part 1: DNS</title>
		<link>http://vcsjones.com/2013/05/20/scaling-wordpress-part-1-dns/</link>
		<comments>http://vcsjones.com/2013/05/20/scaling-wordpress-part-1-dns/#comments</comments>
		<pubDate>Mon, 20 May 2013 18:35:35 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=506</guid>
		<description><![CDATA[A week ago a friend told me that my website was a little slow to load. &#8220;Great&#8221; I thought, I guess I need to improve the specs of my little website server. As I was looking at my server&#8217;s details &#8230; <a href="http://vcsjones.com/2013/05/20/scaling-wordpress-part-1-dns/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A week ago a friend told me that my website was a little slow to load. &#8220;Great&#8221; I thought, I guess I need to improve the specs of my little website server.</p>
<p>As I was looking at my server&#8217;s details and utilization, I came to the realization that whatever reason my site was slow, it was <em>not</em> because the server was overworked. In fact, it was sitting there idling most of the time.</p>
<p>When I gave it some thought, I realized that while my website was working just fine, I had never spent any amount of time tweaking the server for performance. I decided to see if tweaking some caching settings would improve things a bit.</p>
<p>And man, did they improve. I started by using a browser extension called <a href="http://yslow.org" target="_blank">YSlow</a> to determine where I needed to focus my improvements, and start with some low-hanging fruit. Initially, YSlow gave my site a big orange D as a grade. I decided over the weekend to see how high I could improve things. My journey required tweaking of WordPress, DNS, and getting a CDN involved.</p>
<h1>DNS Matters</h1>
<p>The first thing that got pointed out to me was that my DNS was slow. Several hundred milliseconds to resolve my site. I never really gave DNS performance that much thought. I had just went with the free DNS that my domain registrar provided. While free, I got what I paid for.</p>
<p>Almost all of my infrastructure is on Amazon AWS, so I looked at <a href="http://aws.amazon.com/route53/">Route 53</a> to transfer my DNS to. This would increase my costs slightly, but it boiled down to hardly a dollar extra a month. The zone costs $0.50 per month, plus another $0.50 per <em>million</em> queries. This won&#8217;t break the bank, if my site ever gets that popular, I have bigger problems I need to worry about. Additionally, later on, we&#8217;ll be offloading a lot of DNS queries to a CDN.</p>
<p>One thing with Route 53 that you may want to tweak is the default TTL (Time-To-Live). It defaults to 300 seconds, which is rather low considering my DNS settings don&#8217;t change that much. Rather I set it to 2 hours (7200 seconds) so the DNS would be cached longer, thus reducing the number of lookups. I&#8217;d be surprised if I paid more than $0.50 a month for DNS queries.</p>
<p>This had a moderate, measurably small improvement on the performance of my site, but only the first time you hit it if the DNS isn&#8217;t cached. I still had a ways to go, but it was a step in the right direction.</p>
<p>Next time, we&#8217;ll look at setting up a CDN (Content Delivery Network) for serving static content.</p>
<h1><em>More of this series</em></h1>
<ol>
<li>Scaling WordPress Part 1: DNS</li>
<li><a href="http://vcsjones.com/2013/05/20/scaling-wordpress-part-2-cdn/">Scaling WordPress Part 2: CDN</a>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/05/20/scaling-wordpress-part-1-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing Public Keys Between Objective-C OpenSSL and .NET</title>
		<link>http://vcsjones.com/2013/05/16/passing-public-keys-between-openssl-and-net/</link>
		<comments>http://vcsjones.com/2013/05/16/passing-public-keys-between-openssl-and-net/#comments</comments>
		<pubDate>Thu, 16 May 2013 16:06:11 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[RSA]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=501</guid>
		<description><![CDATA[I had a bit of a fun time working on a simple key exchange mechanism between C# and Objective-C using OpenSSL. My goal was on the Objective-C side to generate a public/private key pair, and pass the public key to &#8230; <a href="http://vcsjones.com/2013/05/16/passing-public-keys-between-openssl-and-net/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I had a bit of a fun time working on a simple key exchange mechanism between C# and Objective-C using OpenSSL. My goal was on the Objective-C side to generate a public/private key pair, and pass the public key to C# in a way that I could use it to encrypt small amounts of data (like a symmetric key).</p>
<p>This proved to be a little challenging to me, as I didn&#8217;t want to resort to using a 3rd party solution in .NET like BouncyCastle or a managed OpenSSL wrapper. Turns out, it&#8217;s not that hard, if just a little under-documented. Starting with Objective-C, here&#8217;s how I am generating an RSA key pair.</p>
<p>Assuming you have an RSA* object from OpenSSL, you can export the public key like so:</p>
<pre class="prettyprint">
-(NSData*)publicKey {
    int size = i2d_RSAPublicKey(_rsa, NULL);
    unsigned char* temp = OPENSSL_malloc(size);
    //the use of a temporary variable is mandatory!
    unsigned char* copy = temp;
    int keySize = i2d_RSAPublicKey(_rsa, &amp;copy);
    NSData* data = nil;
    if (keySize > 0) {
        data = [[NSData alloc] initWithBytes:temp length:keySize];
    }
    OPENSSL_free(temp);
    return data;
}
</pre>
<p><em>For illustrative purposes: Don&#8217;t forget to do error checking!</em></p>
<p>So now we have an NSData, but how is this public key actually stored? How can I use this in .NET?</p>
<p>The first thing to understand is the format by what format i2d_RSAPublicKey exports data. This exports the data in ASN.1 DER format, and getting that into an RSACryptoServiceProvider is possible with no 3rd party support.</p>
<pre class="prettyprint">
private static readonly byte[] _nullAsnBytes = new byte[] {0, 5};

public RSACryptoServiceProvider GetCryptoServiceProvider(byte[] asnDerPublicKey)
{
    const string RSA_OID = "1.2.840.113549.1.1.1";
    var oid = new Oid(RSA_OID);
    var asnPublicKey = new AsnEncodedData(oid, asnDerPublicKey);
    var nullAsnValue = new AsnEncodedData(_nullAsnBytes);
    var publicKey = new PublicKey(oid, nullAsnValue, asnPublicKey);
    return publicKey.Key as RSACryptoServiceProvider;
}
</pre>
<p>The 1.2.840.113549.1.1.1 value is the <a target="_blank" href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa381133(v=vs.85).aspx">OID for RSA</a>, or the actual header name szOID_RSA_RSA. We use a ASN.1 value of null ({0, 5}) for the parameters, and then we pass the AsnEncodedData to the PublicKey class, from which we can obtain an RSACryptoServiceProvider from the public key.</p>
<p>Together, these two code snippets allow working with RSA public keys in Objective-C (iOS or Mac) and in .NET.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/05/16/passing-public-keys-between-openssl-and-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MADExpo 2013</title>
		<link>http://vcsjones.com/2013/05/14/madexpo-2013/</link>
		<comments>http://vcsjones.com/2013/05/14/madexpo-2013/#comments</comments>
		<pubDate>Tue, 14 May 2013 22:58:21 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Non-Code]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[MADExpo]]></category>
		<category><![CDATA[TypeScript]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=497</guid>
		<description><![CDATA[MADExpo 2013 is getting close, and it&#8217;s getting exciting! I&#8217;ve had the pleasure of speaking there the past few years, and it&#8217;s one of my favorite community events of the year. *What is it?* You might ask? MADExpo is a &#8230; <a href="http://vcsjones.com/2013/05/14/madexpo-2013/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>MADExpo 2013 is getting close, and it&#8217;s getting exciting! I&#8217;ve had the pleasure of speaking there the past few years, and it&#8217;s one of my favorite community events of the year.</p>
<p>*What is it?* You might ask? MADExpo is a conference in Virginia Beach (yes, by the beach!), Virginia focusing on a wide variety of software and hardware, such as Ruby, .NET, Gadgeteer, or whatever might be trending. It provides a great chance to learn about new things, and interact with people in a friendly environment.</p>
<p>Registration is <a href="http://madexpo.us/register">open</a>, and the <a href="http://madexpo.us/speakers">speaker lineup</a> is sure worth looking at.</p>
<p>And not to mention, MADExpo is kid-friendly with the <a href="http://madexpo.us/madkidz">MADKidz</a> mini-conference where kids get a chance to tinker with coding, robotics, and electronics.</p>
<p>I&#8217;ll be there talking about CoffeeScript and TypeScript, two of my favorite things to work with these days.</p>
<p>If you have the opportunity to come to MADExpo, don&#8217;t miss it!</p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/05/14/madexpo-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Giving Parallels and Windows VMs For Mac Users to test Internet Explorer</title>
		<link>http://vcsjones.com/2013/04/02/microsoft-giving-parallels-and-windows-vms-for-mac-users/</link>
		<comments>http://vcsjones.com/2013/04/02/microsoft-giving-parallels-and-windows-vms-for-mac-users/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 15:02:37 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=493</guid>
		<description><![CDATA[I noticed on twitter today that Barry Dorrans (aka blowdart) mentioned that the Internet Explorer team updated their modern.IE site with a really incredible deal. They&#8217;re offering a copy of Parallels Desktop 8 with a Windows 8 VM for testing &#8230; <a href="http://vcsjones.com/2013/04/02/microsoft-giving-parallels-and-windows-vms-for-mac-users/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I noticed on twitter today that Barry Dorrans (aka blowdart) mentioned that the Internet Explorer team updated their modern.IE site with a really incredible deal. They&#8217;re offering a copy of Parallels Desktop 8 with a Windows 8 VM for testing your site in Internet Explorer.</p>
<blockquote class="twitter-tweet"><p>Mac usersneed to test your sites under IE10 and IE8? Donate to charity and MS will send you Parallels and VMs <a href="http://t.co/Gmc0SLAgvt" title="http://bit.ly/11h6lrV">bit.ly/11h6lrV</a></p>
<p>&mdash; Barry Dorrans (@blowdart) <a href="https://twitter.com/blowdart/status/319098823735648256">April 2, 2013</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>All you have to do is donate $25 to a charity of your choosing and they&#8217;ll ship you a USB key. Frankly this is a hard deal to pass up, and I really applaud Microsoft&#8217;s support of charities. Parallels itself retails for more than $25, so to get a copy of that plus Windows for testing your site in Internet Explorer is nothing short of awesome.</p>
<p>You can learn more from the <a href="http://blogs.msdn.com/b/ie/archive/2013/04/02/new-on-modern-ie-free-vm-downloads-windows-8-quickstart-kits-enhanced-code-scanning-tools-and-more.aspx" target="_blank">IE team&#8217;s blog post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/04/02/microsoft-giving-parallels-and-windows-vms-for-mac-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2013 ASP.NET MVP</title>
		<link>http://vcsjones.com/2013/04/01/2013-asp-net-mvp/</link>
		<comments>http://vcsjones.com/2013/04/01/2013-asp-net-mvp/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 15:46:42 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Non-Code]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVP]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=492</guid>
		<description><![CDATA[I&#8217;m happy to say I was re-awarded ASP.NET MVP today, making it my seventh consecutive award. Thank you Microsoft, for putting so much effort and value into the software development community.]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m happy to say I was re-awarded ASP.NET MVP today, making it my seventh consecutive award. Thank you Microsoft, for putting so much effort and value into the software development community.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/04/01/2013-asp-net-mvp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Boot Camp 5.0 Drivers for Windows 8</title>
		<link>http://vcsjones.com/2013/03/16/bootcamp-5-0-drivers-for-windows-8/</link>
		<comments>http://vcsjones.com/2013/03/16/bootcamp-5-0-drivers-for-windows-8/#comments</comments>
		<pubDate>Sat, 16 Mar 2013 22:02:55 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[Non-Code]]></category>
		<category><![CDATA[Bootcamp]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=490</guid>
		<description><![CDATA[Apple as part of their 10.8.3 update, added official support for Windows 8 in Boot Camp. However, if like me, you didn&#8217;t wait for official support for Windows 8 and ran Windows 8 anyway in Boot Camp, you might have &#8230; <a href="http://vcsjones.com/2013/03/16/bootcamp-5-0-drivers-for-windows-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Apple as part of their 10.8.3 update, added official support for Windows 8 in Boot Camp. However, if like me, you didn&#8217;t wait for official support for Windows 8 and ran Windows 8 anyway in Boot Camp, you might have an extra hoop to jump through to update the drivers.</p>
<p>The driver updates fix a few little issues, like the volume indicator not appearing on screen when using the function keys for volume.</p>
<p>The first thing I did was check for driver updates with the Apple Software Update utility, where I did not get any luck. I&#8217;d check there first incase they add them later. If they aren&#8217;t there, you can update them by downloading them here from <a href="http://support.apple.com/downloads/" target="_blank">Apple&#8217;s Support Downloads</a>. Download the latest Boot Camp drivers, unzip them, and run setup.exe in the &#8220;BootCamp&#8221; directory, and the Boot Camp software will update the drivers that are already installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/03/16/bootcamp-5-0-drivers-for-windows-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RockNUG &#8220;Beginning With TypeScript&#8221; available on GitHub</title>
		<link>http://vcsjones.com/2013/03/14/rocknug-beginning-with-typescript-available-on-github/</link>
		<comments>http://vcsjones.com/2013/03/14/rocknug-beginning-with-typescript-available-on-github/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 20:15:09 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[rockNUG]]></category>
		<category><![CDATA[TypeScript]]></category>
		<category><![CDATA[user group]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=489</guid>
		<description><![CDATA[I&#8217;ve posted my code and slides from &#8220;Beginning With TypeScript&#8221; to GitHub here: https://github.com/vcsjones/Presentations/tree/master/RockNUG.2013.03 PowerPoint and Keynote slides are available, as well as the sample code we worked through. All code and slides are Creative Commons Attribution 3.0 Unported License.]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve posted my code and slides from &#8220;Beginning With TypeScript&#8221; to GitHub here:</p>
<p><a href="https://github.com/vcsjones/Presentations/tree/master/RockNUG.2013.03" target="_blank">https://github.com/vcsjones/Presentations/tree/master/RockNUG.2013.03</a></p>
<p>PowerPoint and Keynote slides are available, as well as the sample code we worked through.</p>
<p>All code and slides are <a href="https://github.com/vcsjones/Presentations/blob/master/readme.md#license" target="_blank">Creative Commons Attribution 3.0 Unported License.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/03/14/rocknug-beginning-with-typescript-available-on-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CoffeeScript 1.5 &#8220;Literate Programming&#8221;</title>
		<link>http://vcsjones.com/2013/02/26/coffeescript-1-5-literate-programming/</link>
		<comments>http://vcsjones.com/2013/02/26/coffeescript-1-5-literate-programming/#comments</comments>
		<pubDate>Wed, 27 Feb 2013 01:31:57 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[CoffeeScript]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=486</guid>
		<description><![CDATA[CoffeeScript 1.5 was recently released, and has some new things that look interesting, and some look a little problematic. The one that stands out the most is CoffeeScript&#8217;s new Literate Programming feature. The literate programming feature introduces a new file &#8230; <a href="http://vcsjones.com/2013/02/26/coffeescript-1-5-literate-programming/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>CoffeeScript 1.5 was recently released, and has some new things that look interesting, and some look a little problematic.</p>
<p>The one that stands out the most is CoffeeScript&#8217;s new Literate Programming feature. The literate programming feature introduces a new file extension for CoffeeScript, &#8220;.litcoffee&#8221;, that behaves the same as regular CoffeeScript, with one detail: unless the code is indented, it is ignored. This allows you to put documentation in your CoffeeScript without obtrusive comment regions, and probably without coincidence, plays well with the Markdown syntax as well since code in markdown is indented. An example .litcoffee file:</p>
<div>
<h3>example.litcoffee</h3>
<pre class="prettyprint">
This is documentation about a class called **Foo**.
The Foo class does many things, such as supply bars.
If the Foo class runs out of bars, it returns
**Baz** objects until there are more bars.

    class Foo
        constructor:() ->
            @foo = 'bar'
</pre>
</div>
<p>When compiled, it results in the following JavaScript:</p>
<div>
<h3>example.js</h3>
<pre class="prettyprint">
var Foo;
Foo = (function() {
  function Foo() {
    this.foo = 'bar';
  }
  return Foo;
})();
</pre>
</div>
<p>The original documentation text is no where to be found. However when run through a Markdown parser, the result is this:</p>
<pre class="prettyprint">
&lt;p&gt;This is documentation about a class called &lt;strong&gt;Foo&lt;/strong&gt;.
The Foo class does many things, such as supply bars.
If the Foo class runs out of bars, it returns
&lt;strong&gt;Baz&lt;/strong&gt; objects until there are more bars.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class Foo
    constructor:() -&gt;
        @foo = 'bar'
&lt;/code&gt;&lt;/pre&gt;
</pre>
<p>This makes it very easy to treat your CoffeeScript files as both a markdown file and a CoffeeScript file. This is a nice feature, though I can&#8217;t honestly say I find myself making excessive use of the feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/02/26/coffeescript-1-5-literate-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;this&#8221; Issue in TypeScript</title>
		<link>http://vcsjones.com/2013/02/21/this-issue-in-typescript/</link>
		<comments>http://vcsjones.com/2013/02/21/this-issue-in-typescript/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 15:51:13 +0000</pubDate>
		<dc:creator>vcsjones</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[TypeScript]]></category>

		<guid isPermaLink="false">http://vcsjones.com/?p=481</guid>
		<description><![CDATA[TypeScript&#8217;s arrow functions are something of a wonder. They look like C# lambdas, and have a nice clean syntax. For example, in jQuery if I had wanted a done callback, and I used an arrow function from TypeScript, it would &#8230; <a href="http://vcsjones.com/2013/02/21/this-issue-in-typescript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>TypeScript&#8217;s arrow functions are something of a wonder. They look like C# lambdas, and have a nice clean syntax. For example, in jQuery if I had wanted a done callback, and I used an arrow function from TypeScript, it would look like this:</p>
<pre class="prettyprint">
$.ajax({
 //URL and settings
}).done(() => {
	alert('all done!');
});
</pre>
<p>This <a href="http://www.typescriptlang.org/Playground/#src=%24.ajax(%7B%0A%7D).done(()%20%3D%3E%20%7B%0A%09alert('all%20done!')%3B%0A%7D)%3B" target="_blank">compiles</a> to this JavaScript:</p>
<pre class="prettyprint">
$.ajax({
 //URL and settings
}).done(function () {
    alert('all done!');
});
</pre>
<p>Which really isn&#8217;t all that surprising. TypeScript borrowed that arrow function syntax from <a href="http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts" target="_blank">ECMAScript 6&#8242;s</a> current draft. Buried deep in ES 6&#8242;s definition, it talks about how &#8220;this&#8221; is bound to the &#8220;this&#8221; of the outer function. Douglas Crockford has a <a href="http://www.yuiblog.com/blog/2012/03/30/what-is-the-meaning-of-this" target="_blank">great write up</a> covering all of that.</p>
<p>TypeScript follows ECMAs rule and binds the &#8220;this&#8221; to the outer this. Notice how this TypeScript compiles:</p>
<div style="float: left; width: 49%">
<h3>TypeScript</h3>
<pre class="prettyprint">
$.ajax({
 //URL and settings
}).done(() => {
	alert(this);
});
</pre>
</div>
<div style="float: right; width: 49%">
<h3>JavaScript</h3>
<pre class="prettyprint">
var _this = this;
$.ajax({
 //URL and settings
}).done(function () {
    alert(_this);
});
</pre>
</div>
<div style="clear:both"></div>
<p>The resulting JavaScript captures the value of &#8220;this&#8221; and uses the &#8220;this&#8221; outside the function. Now, if you you&#8217;ve CoffeeScript at all, this probably feels right at home to you, but I have concerns about this in TypeScript, and to an extent ES 6 too.</p>
<p>My concern around this stems from that many JavaScript frameworks make good use of &#8220;this&#8221; in their callback functions. jQuery is a prime example of this. The settings object of the <a href="http://api.jquery.com/jQuery.ajax/" target="_blank">$.ajax</a> function takes a context value:</p>
<blockquote><p>
This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax)</p></blockquote>
<p>This no longer works if I were to use arrow functions as part of my jQuery done callback:</p>
<pre class="prettyprint">
$.ajax({
	url: "http://example.com",
	context: "astring"
}).done(() => {
	alert(this);
});
</pre>
<p>One would expect that to alert &#8220;astring&#8221;, but of course it won&#8217;t because the meaning of &#8220;this&#8221; is no longer what we expect. The only way to work around this behavior in TypeScript at the moment is to fall back to a plain function:</p>
<pre class="prettyprint">
$.ajax({
	url: "http://example.com",
	context: "astring"
}).done(function() {
	alert(this);
});
</pre>
<p>So be careful when you start using TypeScript&#8217;s arrow functions. You can&#8217;t just go around replacing functions with arrow functions, unless you want &#8220;this&#8221; to break.</p>
<p>My concern around arrow functions is many people won&#8217;t understand that it isn&#8217;t just syntactic sugar &#8211; it&#8217;s a change in behavior and many will gloss over that fact at first. Arrow functions have a cleaner syntax to me, but I can&#8217;t use them everywhere because of that change.</p>
<p>TypeScript has a unique advantage where it doesn&#8217;t have to completely align itself with ES. ES 6 makes absolutely no mention of types variables or parameters, or interfaces. I would propose that TypeScript adopt &#8220;skinny arrows&#8221;, similar to CoffeeScript. For example:</p>
<pre class="prettyprint">
$.ajax({
	url: "http://example.com",
	context: "astring"
}).done(() -> {
	alert(this);
});
</pre>
<p>Now our callback works as expected.</p>
<p>This is well known in the CoffeeScript community. Skinny arrows don&#8217;t capture this, while fat arrows do (though in CoffeeScript you would use &#8220;@&#8221; instead of &#8220;this&#8221;).</p>
<p>Now I can have that cleaner syntax while having the flexibility to control how &#8220;this&#8221; behaves.</p>
]]></content:encoded>
			<wfw:commentRss>http://vcsjones.com/2013/02/21/this-issue-in-typescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: vcsjones.com @ 2013-05-23 21:05:01 by W3 Total Cache -->