<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>Thursday Night</title>
	
	<link>http://blog.paulbetts.org</link>
	<description>Paul Betts's personal website / blog / what-have-you</description>
	<lastBuildDate>Fri, 26 Feb 2010 22:41:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/paulbetts/entries" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="paulbetts/entries" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>39.990764</geo:lat><geo:long>-83.001179</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><item>
		<title>This is how I should be creating</title>
		<link>http://blog.paulbetts.org/index.php/2010/02/26/this-is-how-i-should-be-creating/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/02/26/this-is-how-i-should-be-creating/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 22:41:21 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=411</guid>
		<description><![CDATA[
VONNEGUT
I said in Slapstick that she was the person I wrote for—that every successful creative person creates with an audience of one in mind. That&#8217;s the secret of artistic unity. Anybody can achieve it, if he or she will make something with only one person in mind. I didn&#8217;t realize that she was the person [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
VONNEGUT</p>
<p>I said in Slapstick that she was the person I wrote for—that every successful creative person creates with an audience of one in mind. That&#8217;s the secret of artistic unity. Anybody can achieve it, if he or she will make something with only one person in mind. I didn&#8217;t realize that she was the person I wrote for until after she died.
</p></blockquote>
<p>Via <a href="http://theparisreview.org/viewinterview.php/prmMID/3605">The Paris Review</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=mvvxAboRJ8s:4HMabCnzGSY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=mvvxAboRJ8s:4HMabCnzGSY:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=mvvxAboRJ8s:4HMabCnzGSY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=mvvxAboRJ8s:4HMabCnzGSY:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/02/26/this-is-how-i-should-be-creating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing an Email client is Hard</title>
		<link>http://blog.paulbetts.org/index.php/2010/02/03/writing-an-email-client-is-hard/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/02/03/writing-an-email-client-is-hard/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:00:54 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=407</guid>
		<description><![CDATA[
Here&#8217;s a great Email post about how to write a proper Email client. Certain classes of software are just fundamentally difficult to do a complete job on, things you wouldn&#8217;t necessarily expect like a Textbox control or a build system. An Email client is one of these categories &#8211; even today if you discard legacy [...]]]></description>
			<content:encoded><![CDATA[<p>
Here&#8217;s a <i>great</i> Email post about how to write a proper Email client. Certain classes of software are just fundamentally difficult to do a complete job on, things you wouldn&#8217;t necessarily expect like a Textbox control or a build system. An Email client is one of these categories &#8211; even today if you discard legacy protocols and standards, you&#8217;ve still got a Mount Everest to climb. <a href="http://lists.ranchero.com/pipermail/email-init-ranchero.com/2010-January/001969.html">Here&#8217;s the epic mail</a>, written by <a href="http://bynkii.com/">John C. Welch</a>. Which is a shame, because at least on Windows and Mac, most of the desktop mail clients are sorely lacking in my opinion, with little hope of truly improving.
</p>
<h2>Some Quotes:</h2>
<blockquote><p>
Stop thinking about IMAP as if it were some cohesive standard with a consistent implementation. It is not. It&#8217;s a bloody mess that manages to work in spite of its implementations, and Google&#8217;s IMAP implementation is one of the worst I&#8217;ve seen in the last 12 years I&#8217;ve been working with IMAP servers.
</p></blockquote>
<blockquote><p>
Regardless of who this project is aimed at, people using it are going to get email from &#8220;icky&#8221; sources, like Outlook users who have no control over their email format. (You think I&#8217;m kidding about this. I&#8217;m not. You should see how bizarre an overly locked-down windows shop can be.) They won&#8217;t have the option to get the sender to change format, so in addition to &#8220;normal&#8221; HTML, you should start thinking about building in TNEF decoding. In fact, if you do this well, it would be a monster point in the application&#8217;s favor, since that&#8217;s a major problem for people in the real world.
</p></blockquote>
<blockquote><p>
Power User != Programmer, Power User != Programmer, Power User !=<br />
Programmer, Power User != Programmer, Power User != Programmer, Power User<br />
!= Programmer, Power User != Programmer. There, point made.
</p></blockquote>
<blockquote><p>
HTML editor. Yes, I know text, blah, blah. Again, as the non-programmer power user, HTML is a reality, and it needs to be properly managed. There&#8217;s no reason to have the entire spec, but things like fonts, bold/italic/underline, alignment, real lists, and &#8216;real&#8217; indents/tabs are not the work of satan. And that includes images. Welcome to the modern world, pretending it&#8217;s not there helps no one.
</p></blockquote>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=JP4GMiCADro:WIkCCP5vL0g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=JP4GMiCADro:WIkCCP5vL0g:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=JP4GMiCADro:WIkCCP5vL0g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=JP4GMiCADro:WIkCCP5vL0g:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/02/03/writing-an-email-client-is-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Blend Sample data at Design time and real data at Runtime</title>
		<link>http://blog.paulbetts.org/index.php/2010/02/02/using-blend-sample-data-at-design-time-and-real-data-at-runtime/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/02/02/using-blend-sample-data-at-design-time-and-real-data-at-runtime/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 13:00:22 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[WPF / Silverlight]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=402</guid>
		<description><![CDATA[Sample Data is Awesome

Here&#8217;s a clever trick that I found out the other day &#8211; one of Blend 3&#8217;s best features is Sample Data, which allows you to generate basic data structures in Blend, create sample arrays of them, and mock up UIs so that your DataTemplates actually show something useful. This is a huge [...]]]></description>
			<content:encoded><![CDATA[<h2>Sample Data is Awesome</h2>
<p>
Here&#8217;s a clever trick that I found out the other day &#8211; one of Blend 3&#8217;s best features is <a href="http://www.85turns.com/2009/07/12/overview-of-sample-data-in-blend-3/">Sample Data</a>, which allows you to generate basic data structures in Blend, create sample arrays of them, and mock up UIs so that your DataTemplates actually show something useful. This is a huge improvement over Blend 2 and VS, where important parts of your UI would basically be invisible until you actually could build the project and populate it with real data.
</p>
<h2>Keep Sample Data all the time</h2>
<p>
One thing I always struggled with though is, that you always had to switch the binding back and forth between the sample data and the real data &#8211; even though Blend has a &#8220;Only enable sample data at design time&#8221; feature, you could still only bind the data to one place. But there&#8217;s a clever hack to get around this, <a href="http://github.com/xpaulbettsx/InstallQueuer/commit/b9427f2">you can see me applying it in this Github commit</a>.
</p>
<p>
Basically, say you had a Listbox:</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .sc0 {color: #00bbdd;}.ch_code_container .sc1 {color: #ddbb00;}.ch_code_container .sc2 {color: #339933;}.ch_code_container .sc3 {color: #009900;}.ch_code_container .re0 {color: #000066;}.ch_code_container .re1 {font-weight: bold; color: black;}.ch_code_container .re2 {font-weight: bold; color: black;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="sc3"><span class="re1">&lt;grid</span> x:<span class="re0">Name</span>=<span class="st0">&quot;LayoutRoot&quot;</span> <span class="re0">DataContext</span>=<span class="st0">&quot;{Binding ViewModel, ElementName=Window}&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="coMULTI">&lt;!&#8211; Sample Version<br />
&nbsp; &nbsp; &lt;ListBox ItemsSource=&quot;{Binding Path=Data, Source={StaticResource SampleData}}&quot; /&gt;</span></span><br />
&nbsp; &nbsp; &nbsp;&#8211;&gt;</p>
<p>&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;listbox</span> <span class="re0">ItemsSource</span>=<span class="st0">&quot;{Binding Path=TheData}&quot;</span> <span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;/grid<span class="re2">&gt;</span></span></span></div>
</p>
<p>
Here&#8217;s the trick &#8211; Blend doesn&#8217;t let you redirect the binding at Design time, but it <i>will let you redirect the context</i>. So all you have to do, is group the ItemsControl in a meaningless container, then rig the DataContext; <code>d:DataContext</code> is what Blend will use at Design time and will be ignored by WPF / Silverlight.
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .sc0 {color: #00bbdd;}.ch_code_container .sc1 {color: #ddbb00;}.ch_code_container .sc2 {color: #339933;}.ch_code_container .sc3 {color: #009900;}.ch_code_container .re0 {color: #000066;}.ch_code_container .re1 {font-weight: bold; color: black;}.ch_code_container .re2 {font-weight: bold; color: black;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="sc3"><span class="re1">&lt;grid</span> x:<span class="re0">Name</span>=<span class="st0">&quot;LayoutRoot&quot;</span> <span class="re0">DataContext</span>=<span class="st0">&quot;{Binding ViewModel, ElementName=Window}&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;border</span> <span class="re0">DataContext</span>=<span class="st0">&quot;{Binding Path=TheData}&quot;</span> d:<span class="re0">DataContext</span>=<span class="st0">&quot;{Binding Path=Data, Source={StaticResource SampleData}&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;listbox</span> <span class="re0">ItemsSource</span>=<span class="st0">&quot;{Binding}&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/border<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/grid<span class="re2">&gt;</span></span></span></div>
<h2>Et, Voila!</h2>
<p>
Now, whenever we edit in Blend we see our sample data so we can edit the UI, then when we run it, we&#8217;ll use the live data instead.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=7-KYSlErgoI:VWbaHbByYf4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=7-KYSlErgoI:VWbaHbByYf4:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=7-KYSlErgoI:VWbaHbByYf4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=7-KYSlErgoI:VWbaHbByYf4:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/02/02/using-blend-sample-data-at-design-time-and-real-data-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5’s Video tag already works in IE</title>
		<link>http://blog.paulbetts.org/index.php/2010/02/01/html5s-video-tag-already-works-in-ie/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/02/01/html5s-video-tag-already-works-in-ie/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 14:53:11 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=399</guid>
		<description><![CDATA[
Just add these two lines to the top of your page:


&#60;script src=&#34;http://visitmix.com/dlr/dlr.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; 
&#60;script src=&#34;http://visitmix.com/dlr/gestaltmedia.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;

Of course, this is a hack workaround that uses Silverlight to emulate the Video object, but going from &#8220;doesn&#8217;t work at all&#8221; to &#8220;make users install a plugin, once&#8221; is a pretty good deal. Here&#8217;s the original post describing it.
]]></description>
			<content:encoded><![CDATA[<p>
Just add these two lines to the top of your page:
</p>
<style type="text/css"></style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">&lt;script src=&quot;http://visitmix.com/dlr/dlr.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; <br />
&lt;script src=&quot;http://visitmix.com/dlr/gestaltmedia.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</div>
<p>
Of course, this is a hack workaround that uses Silverlight to emulate the Video object, but going from &#8220;doesn&#8217;t work at all&#8221; to &#8220;make users install a plugin, <i>once</i>&#8221; is a pretty good deal. <a href="http://visitmix.com/LabNotes/HTML5-video-tag-with-H264-codec">Here&#8217;s the original post describing it</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=BQhEhgYWNpU:dDFBAwcE5sY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=BQhEhgYWNpU:dDFBAwcE5sY:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=BQhEhgYWNpU:dDFBAwcE5sY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=BQhEhgYWNpU:dDFBAwcE5sY:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/02/01/html5s-video-tag-already-works-in-ie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>You can get the crash reports from Windows Error Reporting (Watson)</title>
		<link>http://blog.paulbetts.org/index.php/2010/01/11/you-can-get-the-crash-reports-from-windows-error-reporting-watson/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/01/11/you-can-get-the-crash-reports-from-windows-error-reporting-watson/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 16:43:29 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=396</guid>
		<description><![CDATA[
One of the things I see pop up on Stack Overflow all the time is, people wanting to hide or suppress the Windows Error Reporting dialog &#8211; the feature of Windows where crash reports are sent to Microsoft when your app crashes. Developers say, &#8220;MS doesn&#8217;t care about my app, what&#8217;s the point?&#8221; If they&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>
One of the things I see pop up on <a href="http://stackoverflow.com">Stack Overflow</a> all the time is, people wanting to hide or suppress the Windows Error Reporting dialog &#8211; the feature of Windows where crash reports are sent to Microsoft when your app crashes. Developers say, &#8220;MS doesn&#8217;t care about <i>my</i> app, what&#8217;s the point?&#8221; If they&#8217;re not so bright, they&#8217;ll write a try/catch block around their main() and hide all errors, then they&#8217;ll never find out why their apps crash in the field. Smarter developers will essentially write their own hacked-up version of WER with varying degrees of success. However, there&#8217;s a 3rd option that is superior:
</p>
<h2>Register with Microsoft, and get the WER Reports</h2>
<p>
Microsoft doesn&#8217;t just trash your reports, we will automatically aggregate them into distinct crashes (called &#8216;buckets&#8217;) and show you a &#8216;popularity contest&#8217; of crashes &#8211; you can find out a <i>ton</i> of detailed information about what is happening in the field. <a href="http://msdn.microsoft.com/en-us/isv/bb190483.aspx">Here&#8217;s the MSDN article</a> detailing how to sign up. It takes a bit of leg work, but if you&#8217;re writing any sort of production-quality application, it&#8217;s 100% worth it.
</p>
<h2>But here&#8217;s what to do if you don&#8217;t believe me</h2>
<p>
Alright, so you have some super-good reason as to why you really don&#8217;t want this dialog to show up. Here&#8217;s what works on Win2k and higher (Vista has an API to do this explicitly though):
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="kw4">LONG</span> KillSelfOnUnhandledException<span class="br0">&#40;</span>LPEXCEPTION_POINTERS WhyGodWhy<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; TerminateProcess<span class="br0">&#40;</span>GetCurrentProcess<span class="br0">&#40;</span><span class="br0">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WhyGodWhy-&gt;ExceptionRecord-&gt;ExceptionCode<span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="co1">// Never gonna get here</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> EXCEPTION_EXECUTE_HANDLER;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw4">int</span> main<span class="br0">&#40;</span><span class="kw4">int</span>, <span class="kw4">char</span>**<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; SetUnhandledExceptionFilter<span class="br0">&#40;</span>KillSelfOnUnhandledException<span class="br0">&#41;</span><br />
<span class="br0">&#125;</span></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=kHrSw4GCcfI:mGcCAGGYhZg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=kHrSw4GCcfI:mGcCAGGYhZg:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=kHrSw4GCcfI:mGcCAGGYhZg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=kHrSw4GCcfI:mGcCAGGYhZg:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/01/11/you-can-get-the-crash-reports-from-windows-error-reporting-watson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expression Blend Glitches in VMWare / Parallels?</title>
		<link>http://blog.paulbetts.org/index.php/2010/01/10/expression-blend-glitches-in-vmware-parallels/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/01/10/expression-blend-glitches-in-vmware-parallels/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 02:37:02 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=392</guid>
		<description><![CDATA[WPF hardware acceleration dies under VMWare

Just as a note since this comes up a lot from designers who use Macs and are getting into Silverlight / Expression Blend &#8211; if you are trying to use VMWare Fusion or Parallels and are coming up with weird graphics glitches or black screens while trying to use Blend, [...]]]></description>
			<content:encoded><![CDATA[<h2>WPF hardware acceleration dies under VMWare</h2>
<p>
Just as a note since this comes up a lot from designers who use Macs and are getting into Silverlight / Expression Blend &#8211; if you are trying to use VMWare Fusion or Parallels and are coming up with weird graphics glitches or black screens while trying to use Blend, it is because WPF doesn&#8217;t get along well with these products&#8217; graphics virtualization (I imagine because both products are focused on gaming / full-screen graphics).
</p>
<p>
WPF can be forced to run under Software-only rendering however, which clears all of these glitches up (and for Blend, doesn&#8217;t seem to have a huge impact on its usability). To do this, check out <a href="http://msdn.microsoft.com/en-us/library/aa970912.aspx">this MSDN page</a> &#8211; you&#8217;ll need to open up the Registry Editor (regedit.exe), find the  <code>HKEY_CURRENT_USER\SOFTWARE\Microsoft</code> key, create a new folder called <code>Avalon.Graphics</code>, then in that folder, create a new DWORD value called <code>DisableHWAcceleration</code> and set its value to <code>1</code>. Close Blend and restart it, and everything should work now</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=HhuUyq7p_YQ:FHN-Yn7mp9A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=HhuUyq7p_YQ:FHN-Yn7mp9A:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=HhuUyq7p_YQ:FHN-Yn7mp9A:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=HhuUyq7p_YQ:FHN-Yn7mp9A:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/01/10/expression-blend-glitches-in-vmware-parallels/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A C# 3.5 pattern – the Accept Block pattern</title>
		<link>http://blog.paulbetts.org/index.php/2010/01/10/a-c-3-5-pattern-the-accept-block-pattern/</link>
		<comments>http://blog.paulbetts.org/index.php/2010/01/10/a-c-3-5-pattern-the-accept-block-pattern/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 02:25:35 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Mono / .NET]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=390</guid>
		<description><![CDATA[
A coworker pointed me towards this blog post as a useful trick to make code read cleaner. I&#8217;ve been using this trick in C# for quite some time, as it&#8217;s a very fundamental pattern in Ruby programming. In my head I call this the &#8220;Accept Block&#8221; pattern, but I&#8217;m fairly certain its just a syntactic [...]]]></description>
			<content:encoded><![CDATA[<p>
A coworker pointed me towards <a href="http://msdnrss.thecoderblogs.com/2009/12/07/silencing-exceptions-in-a-little-better-way/">this blog post</a> as a useful trick to make code read cleaner. I&#8217;ve been using this trick in C# for quite some time, as it&#8217;s a <i>very</i> fundamental pattern in Ruby programming. In my head I call this the &#8220;Accept Block&#8221; pattern, but I&#8217;m fairly certain its just a syntactic version of an existing pattern (the Strategy pattern?). In some sense, it&#8217;s like being able to write your own version of the &#8220;using&#8221; or &#8220;lock&#8221; statements.
</p>
<p>Here&#8217;s the old imperative way you might write some code:</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="kw4">void</span> Foo<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; SetupTheDatabase<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; bool ShouldExit = SomeFunctionThatNeedsADatabase<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; TeardownTheDatabase<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>ShouldExit<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span>;</p>
<p>&nbsp; &nbsp; DoOtherStuff<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<p>
And here&#8217;s how you&#8217;d rewrite it using the pattern:
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="kw4">void</span> WithEnsureDatabaseIsSetup<span class="br0">&#40;</span>Action block<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; SetupTheDatabase<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; try <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; block<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> finally <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; TeardownTheDatabase<span class="br0">&#40;</span><span class="br0">&#41;</span>;&nbsp; <span class="co1">// Note: Make sure this doesn&#8217;t throw!</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw4">void</span> Foo<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; bool ShouldExit;</p>
<p>&nbsp; &nbsp; WithEnsureDatabaseIsSetup<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#41;</span> =&gt; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ShouldExit = SomeFunctionThatNeedsADatabase<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>ShouldExit<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; DoOtherStuff<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<p>
In my opinion, the 2nd version is better to read, and more importantly, allows you to encapsulate the &#8220;setup/teardown&#8221; pattern &#8211; this way, this block of code is consistent, removes copy-paste errors from writing the same thing over and over again, and is easily updated if you want to do additional work when setting up the database.
</p>
<h2>But there&#8217;s a gotcha!</h2>
<p>
There&#8217;s a bug in the above code though that&#8217;s quite subtle, and that has bitten me a few times &#8211; the syntax <code>() => { }</code> is defining a <a href="http://en.wikipedia.org/wiki/Closure_(computer_science)">closure</a>, an anonymous function who can use variables bound inside its lexical environment (to understand the difference, take a look at that ShouldExit variable &#8211; even though it&#8217;s not a parameter of the function, we were still able to use it). When you call <code>return</code>, in the original example we will exit <code>Foo()</code> &#8211; in the new version, we will exit the closure and still execute <code>DoOtherStuff()</code>!  Here&#8217;s how we should fix it:
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw2 {color: #000000; font-weight: bold;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .kw4 {color: #993333;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .co2 {color: #339933;}.ch_code_container .coMULTI {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .me1 {color: #202020;}.ch_code_container .me2 {color: #202020;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="kw4">void</span> Foo<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; bool ShouldExit;</p>
<p>&nbsp; &nbsp; WithEnsureDatabaseIsSetup<span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#41;</span> =&gt; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ShouldExit = SomeFunctionThatNeedsADatabase<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>ShouldExit<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span>; &nbsp; &nbsp; <span class="co1">// Now we&#8217;ll return properly</span></p>
<p>&nbsp; &nbsp; DoOtherStuff<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
<h2>Ruby doesn&#8217;t have this problem</h2>
<p>
This is a fundamental pattern in Ruby and built into the language and the runtime, so much so that it has special syntax to make it happen. However in Ruby a &#8220;block&#8221; is a slightly different syntactic structure than a function, so <code>return</code> will do what you expect:
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color:#9966CC; font-weight:bold;}.ch_code_container .kw2 {color:#0000FF; font-weight:bold;}.ch_code_container .kw3 {color:#CC0066; font-weight:bold;}.ch_code_container .co1 {color:#008000; font-style:italic;}.ch_code_container .coMULTI {color:#000080; font-style:italic;}.ch_code_container .es0 {color:#000099;}.ch_code_container .br0 {color:#006600; font-weight:bold;}.ch_code_container .st0 {color:#996600;}.ch_code_container .nu0 {color:#006666;}.ch_code_container .me1 {color:#9900CC;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;"><span class="kw1">def</span> Foo<span class="br0">&#40;</span>an_array<span class="br0">&#41;</span><br />
&nbsp; &nbsp; an_array.<span class="me1">each</span> <span class="br0">&#123;</span> |item|&nbsp; <span class="co1"># This is a block with 1 param</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">print</span> item<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw1">if</span> item &gt; <span class="nu0">2</span>&nbsp; <span class="co1"># Actually returns from Foo, not from block</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="kw1">end</span></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=VfYEze8gZo8:yfVtSIgb8pU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=VfYEze8gZo8:yfVtSIgb8pU:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=VfYEze8gZo8:yfVtSIgb8pU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=VfYEze8gZo8:yfVtSIgb8pU:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2010/01/10/a-c-3-5-pattern-the-accept-block-pattern/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to move Windows to another computer</title>
		<link>http://blog.paulbetts.org/index.php/2009/12/04/how-to-move-windows-to-another-pc/</link>
		<comments>http://blog.paulbetts.org/index.php/2009/12/04/how-to-move-windows-to-another-pc/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 14:00:52 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=379</guid>
		<description><![CDATA[Moving a Linux install is easy

One of the awesome things about Linux was always, that it&#8217;s so incredibly easy to move your stuff to another machine &#8211; just stick the drive in another computer and it boots right up; if you do this directly with Windows, it will probably blow up in your face. Installing [...]]]></description>
			<content:encoded><![CDATA[<h2>Moving a Linux install is easy</h2>
<p>
One of the awesome things about Linux was always, that it&#8217;s so incredibly easy to move your stuff to another machine &#8211; just stick the drive in another computer and it boots right up; if you do this directly with Windows, it will probably blow up in your face. Installing everything from scratch takes forever and generally sucks.
</p>
<h2>Windows can do this too, but with some more work</h2>
<p>
So, if you&#8217;re a Dell or a Toshiba or a Lenovo, here&#8217;s how you operate &#8211; you have a lot of different machines you&#8217;re trying to sell, but you don&#8217;t want to maintain an OS image for every one. OEMs didn&#8217;t like this, so they asked MS to help out, and Microsoft gave them Sysprep. </p>
<p>
One of the main features of Sysprep is called &#8220;generalize&#8221;, where we&#8217;ll keep the installed stuff, but &#8220;forget&#8221; everything about the specific hardware of the machine. The next boot, Windows will go through the same process as when it was first installed, and reinstall everything.
</p>
<h2>This is where you come in, intrepid reader</h2>
<p>
<del datetime="2009-12-04T20:14:54+00:00">So basically, you need to download the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34&#038;displaylang=en">Windows Automated Installation Kit</a> for Win7.</del> <b>Update:</b> Apparently this tool comes in-box, no download needed! This gives you Sysprep (and ImageX, which is an interesting tool itself). Then, run the following magic command:
</p>
<style type="text/css">/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */.ch_code_container  {font-family: monospace;font-size: 10pxheight:100%;}.ch_code_container .imp {font-weight: bold; color: red;}.ch_code_container .kw1 {color: #b1b100;}.ch_code_container .kw3 {color: #000066;}.ch_code_container .co1 {color: #808080; font-style: italic;}.ch_code_container .es0 {color: #000099; font-weight: bold;}.ch_code_container .br0 {color: #66cc66;}.ch_code_container .st0 {color: #ff0000;}.ch_code_container .nu0 {color: #cc66cc;}.ch_code_container .re0 {color: #0000ff;}.ch_code_container .re1 {color: #0000ff;}.ch_code_container .re2 {color: #0000ff;}</style>
<div class="ch_code_container" style="font-family: monospace;font-size: 10pxheight:100%;">%SystemRoot%\System32\Sysprep\sysprep /generalize /shutdown</div>
<p>
Windows shuts down, and then you move the drive to another computer.
</p>
<h2>Moving a VM to a Native Boot-to-VHD</h2>
<p>
The same trick is also how you can take a VHD image of a machine and run it using Windows&#8217;s <a href="http://blogs.technet.com/virtualization/archive/2009/05/14/native-vhd-support-in-windows-7.aspx">&#8220;Native VHD boot&#8221; feature</a>. You know, where you can take a VHD and just run it, on your machine, full speed. Awesome. While it&#8217;s a VM, Sysprep it, then boot from it &#8211; you won&#8217;t have any of the STOP 0&#215;7F problems that you might have if you ran it natively, and you just saved yourself a ton of time versus waiting for Windows to install.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=ZMiTTeP927Y:gLEeUCI1WCQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=ZMiTTeP927Y:gLEeUCI1WCQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=ZMiTTeP927Y:gLEeUCI1WCQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=ZMiTTeP927Y:gLEeUCI1WCQ:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2009/12/04/how-to-move-windows-to-another-pc/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Running Hyper-V on Windows 7 Client</title>
		<link>http://blog.paulbetts.org/index.php/2009/12/03/running-hyper-v-on-windows-7-client/</link>
		<comments>http://blog.paulbetts.org/index.php/2009/12/03/running-hyper-v-on-windows-7-client/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 14:00:38 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=373</guid>
		<description><![CDATA[Run Hyper-V on Windows 7? Unpossible!

Ok, so I lured everyone in with a provocative title, and I can&#8217;t exactly deliver &#8211; there is no way as far as I know to directly run Hyper-V on any client version of Windows 7. But there&#8217;s an important bit of software that has an obscure name that can [...]]]></description>
			<content:encoded><![CDATA[<h2>Run Hyper-V on Windows 7? Unpossible!</h2>
<p>
Ok, so I lured everyone in with a provocative title, and I can&#8217;t exactly deliver &#8211; there is <i>no</i> way as far as I know to <b>directly</b> run Hyper-V on any client version of Windows 7. But there&#8217;s an important bit of software that has an obscure name that can really help you out.
</p>
<p>
The caveat is, you need a machine that&#8217;s free and supports <b>hardware virtualization</b> (i.e. AMD-V or VT-x). Not all machines support it, and a lot of them need some BIOS fiddling to make it work properly.
</p>
<h2>Hyper-V Server 2008 R2 costs exactly zero dollars</h2>
<p>
Nobody knows about this, and I don&#8217;t know why it&#8217;s not more popular &#8211; Microsoft <i>gives away</i> the Server Core Hyper-V SKU. For free. No dollars. <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=48359dd2-1c3d-4506-ae0a-232d0314ccf6&#038;displaylang=en">Go over here and download it</a>. Set this up on a machine and it should drop you at a command prompt &#8211; that&#8217;s all there is to Server Core, just a cmd prompt; that&#8217;s all you need for Hyper-V though.
</p>
<h2>Remote Server Administration Tools for Windows 7</h2>
<p>
A lot of people think that you need to have Windows Server installed to be able to administer other servers &#8211; otherwise you don&#8217;t have the MMC snap-ins, so people resort to TSing into their boxes to administer them. Ever since Vista, we&#8217;ve made a package called the Remote Server Administration Tools (RSAT), which brings all of the snap-ins like the Active Directory admin page, the DNS page, everything that&#8217;s on Server &#8211; only on Vista / Win7.
</p>
<p>
This won&#8217;t magically make your Windows 7 box be able to be a Domain Controller though, you&#8217;ll only be able to connect to <i>other</i> machines. However, this includes all of the Hyper-V client components &#8211; you&#8217;ll be able to view the console, manage/add machines, etc. Here&#8217;s the only trick though, the installer is kind of goofy &#8211; installing the package only adds <b>the entry</b> in the Add Optional Features list. Then, you have to actually choose what to install.
</p>
<h2>Combine these two, and you&#8217;ve got Hyper-V on Win7 for free</h2>
<p>
Just like the heading says, if you combine these two, you&#8217;ve got Hyper-V for free. Yahtzee! Combine this with <a href="http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx">disk2vhd</a>, and you can get rid of a bunch of test machines and move them to VMs. Move VHDs using the SMB admin shares, like <code>\\mycoolbox\C$\Users\Public\Documents\Hyper-V Disks</code></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=YCYFURoa-5w:4WdjUtJvEAQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=YCYFURoa-5w:4WdjUtJvEAQ:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=YCYFURoa-5w:4WdjUtJvEAQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=YCYFURoa-5w:4WdjUtJvEAQ:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2009/12/03/running-hyper-v-on-windows-7-client/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert a .NET 2.0 DLL to 4.0 (VS2010) without source</title>
		<link>http://blog.paulbetts.org/index.php/2009/12/03/convert-a-net-2-0-dll-to-net-4-0-without-sourc/</link>
		<comments>http://blog.paulbetts.org/index.php/2009/12/03/convert-a-net-2-0-dll-to-net-4-0-without-sourc/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 05:36:04 +0000</pubDate>
		<dc:creator>Paul Betts</dc:creator>
				<category><![CDATA[Mono / .NET]]></category>

		<guid isPermaLink="false">http://blog.paulbetts.org/?p=366</guid>
		<description><![CDATA[Converting .NET DLLs to 4.0 by hand is too much work

One of the blockers for upgrading a project to .NET 4.0 is that your old .NET 2.0/3.0/3.5 DLLs will have some difficulty running in .NET 4.0. I&#8217;m far too lazy to track down all the 3rd party DLLs like Moq or log4net, download the source, [...]]]></description>
			<content:encoded><![CDATA[<h2>Converting .NET DLLs to 4.0 by hand is too much work</h2>
<p>
One of the blockers for upgrading a project to .NET 4.0 is that your old .NET 2.0/3.0/3.5 DLLs will have some difficulty running in .NET 4.0. I&#8217;m far too lazy to track down all the 3rd party DLLs like Moq or log4net, download the source, switch the project to 4.0, then recompile the DLL.
</p>
<h2>Hackery makes life easier</h2>
<p>
Instead of doing this, for a <i>lot</i> of DLLs, you can get away with roundtripping the DLL using ildasm/ilasm; the only tricky part is changing the assembly references so that they point to .NET 4.0 DLLs instead of the old and busted 2.0 <code>System.*</code> assemblies.
</p>
<p>
The good news is, I&#8217;ve written an IronRuby (or MRI, or JRuby, etc) script to handle this automagically. Here&#8217;s how to use it:
</p>
<h2>How to use:</h2>
<ol>
<li>Download IronRuby from <a href="http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35312">CodePlex</a> (You can use the .NET 4.0 release too, doesn&#8217;t matter), and copy it to <code>C:\IronRuby</code></li>
<li>Download <a href="http://paulbetts.org/projects/dotnet4ify_dll.rb">dotnet4ify_dll.rb from my website</a></li>
<li>Launch the VS Command Prompt <b>(2010)</b> &#8211; don&#8217;t launch the 2008 one by accident!</li>
<li><code>set path=%path%;C:\ironruby\bin</code></li>
<li><code>mkdir v4dlls</code></li>
<li><code>ir dotnet4ify_dll.rb C:\path\to\an\old\assembly.dll .\v4dlls\assembly.dll</code></li>
</ol>
<h2>Some caveats</h2>
<ul>
<li>While I&#8217;ve tested this on some pretty complex DLLs (DotNetOpenAuth, ParallelFramework_3_5.dll), it&#8217;s definitely in the &#8220;Works on My Machine&#8221; class of software; in particular, C++/CLI DLLs will probably not work. Embedded resources <b>do</b> still get embedded in the new binary</li>
<li>.NET Assemblies get upset if you rename them, so you can&#8217;t do something like &#8220;ir dotnet4ify_dll.rb foo.dll foo_v4.dll&#8221; &#8211; just put all your v4 assemblies in a separate directory</li>
</ul>
<p align="center">
	<img src="http://paulbetts.org/works-on-my-machine-starburst.png" /><br />
	<i>Worked for me, but I make no guarantees it won&#8217;t replace DLLs with a lolcat</i></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=KWr3QsnE1t0:PHPLgLEM5qw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=KWr3QsnE1t0:PHPLgLEM5qw:YwkR-u9nhCs"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?d=YwkR-u9nhCs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/paulbetts/entries?a=KWr3QsnE1t0:PHPLgLEM5qw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/paulbetts/entries?i=KWr3QsnE1t0:PHPLgLEM5qw:V_sGLiPBpWU" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.paulbetts.org/index.php/2009/12/03/convert-a-net-2-0-dll-to-net-4-0-without-sourc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
