<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>jaybaz [MS] WebLog</title><link>http://blogs.msdn.com/jaybaz_ms/default.aspx</link><description>We believe in nothing.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Parting words for dear friends</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/11/09/parting-words-for-dear-friends.aspx</link><pubDate>Fri, 09 Nov 2007 19:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6022873</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/6022873.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=6022873</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=6022873</wfw:comment><description>&lt;P&gt;I have a few thoughts that I'd like to express about Microsoft's software development&amp;nbsp;before I go.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Clearest code wins&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Most developers at Microsoft haven't yet learned the incredible value of writing the clearest code possible.&amp;nbsp; Once I saw a someone make a checkin that added 200 lines in the middle of a 600 line function. I'm thinking it was already about 597 lines too long.&amp;nbsp; &lt;STRONG&gt;Use Extract Method&lt;/STRONG&gt; to break them in to bit-sized chunks.&amp;nbsp; &lt;STRONG&gt;Use Extract Class&lt;/STRONG&gt; to manage the plethora of methods you suddenly produce.&amp;nbsp; Don't stop there.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;OO isn't a fad&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Microsoft has pushed hard over the last ~5 years to make its software secure.&amp;nbsp; Security is &lt;EM&gt;hard&lt;/EM&gt;, but there's no reason to make it harder.&amp;nbsp; For example, countless security issues came down to buffer overruns in C++ code where a buffer was passed without a corresponding length.&amp;nbsp; The response?&amp;nbsp; Let's write tools that help you find places you pass buffers, and make sure you pass a length along side.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Hey, when you find yourself passing two or more values around together, why not put them in to a class?&amp;nbsp; Just start there.&amp;nbsp; Polymorhism, inheritance, and encapsulation can come later.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;(Hey Windows: I'm looking at you!)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;It's OK to use someone else's code&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;At one point, the Visual Studio code base had about a dozen implementations of&amp;nbsp;a C++ String class, most of them hacked&amp;nbsp;out of MFC.&amp;nbsp; That's a&amp;nbsp;vast improvement over passing the buffers around, but hey... these library writers&amp;nbsp;are paid to work on these things full time!&amp;nbsp;&amp;nbsp;&amp;nbsp;Why aren't you using STL or ATL yet?&lt;/P&gt;
&lt;P&gt;This isn't just in C++... in the original implementation of the .Net Framework, there were countless implentations of hash tables. Woah, guys!&amp;nbsp; Let's get some libraries!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Design your problems away&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Every time you run in to a problem, step back &amp;amp; ask "How can I make sure this never, ever happens again?"&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Got buffer overruns?&amp;nbsp; Using a buffer class makes them go away.&amp;nbsp; Having trouble with refcounts? Try CComPtr.&amp;nbsp; Is your cache getting corrupted?&amp;nbsp; Remove it, or encapsulate it.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;When we did this in my last C++ project, we found our C++ code started to look remarkably like C#.&amp;nbsp; That's a clue: C# has already designed away most of the tedium of C++.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Most importantly: we can do better.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above complaints are specific, local issues.&amp;nbsp; In time they can be addressed indivdually, and this blog post will become obsolete.&amp;nbsp; But there's one thing that Microsoft developers should always be working on: doing their job better.&amp;nbsp; Ask yourself questions like:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;"How can I make sure this problem goes away forever?"&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;"How can I produce fewer bugs?"&lt;/LI&gt;
&lt;LI&gt;"How can I make it easier to fix the bugs I have?"&lt;/LI&gt;
&lt;LI&gt;"How can I make it easier to respond to change quickly?"&lt;/LI&gt;
&lt;LI&gt;"How can I make it easier to make my software fast enough?"&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;I once managed&amp;nbsp;a team that did this very well.&amp;nbsp; They were largely new hires, mostly straight out of college.&amp;nbsp; But after a year, they were &lt;STRONG&gt;rocking&lt;/STRONG&gt;.&amp;nbsp; They produced features faster, had fewer bugs, fixed bugs faster, and reliably beat the schedule every time.&amp;nbsp; They far outperformed teams of experienced developers working on familiar code bases, often with well-understood problems.&amp;nbsp; It was amazing.&lt;/P&gt;
&lt;P mce_keep="true"&gt;EDIT: I wish I could have addressed these issues while I was at Microsoft, but that's hard, and I wasn't successful.&amp;nbsp; This blog post is about the last chance I have to do anything here; now it's up to you to decide if you can use this.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6022873" width="1" height="1"&gt;</description></item><item><title>Lastday</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/11/09/lastday.aspx</link><pubDate>Fri, 09 Nov 2007 19:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6022252</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/6022252.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=6022252</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=6022252</wfw:comment><description>&lt;P&gt;Today is my last day at Microsoft.&lt;/P&gt;
&lt;P mce_keep="true"&gt;This morning I bike to work &amp;amp; shower.&amp;nbsp; There's a lunch out with the team.&amp;nbsp; In the afternoon there's an "exit interview".&amp;nbsp; Then I leave early for a doctor's appointment, while I'm still insured. :-)&lt;/P&gt;
&lt;P mce_keep="true"&gt;Last night I tried to log in to work from home and couldn't.&amp;nbsp; Looks like they were a little overzealous with the permissions!&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;What's next?&amp;nbsp; &lt;A href="http://jbazuzi.blogspot.com/2007/10/new-adventure.html"&gt;http://jbazuzi.blogspot.com/2007/10/new-adventure.html&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6022252" width="1" height="1"&gt;</description></item><item><title>How to make a bootable USB flash drive</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/10/24/how-to-make-a-bootable-usb-flash-drive.aspx</link><pubDate>Thu, 25 Oct 2007 01:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5659296</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/5659296.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=5659296</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=5659296</wfw:comment><description>&lt;P&gt;This can be useful with Windows Home Server in a number of ways.&lt;/P&gt;
&lt;P&gt;- If you are building your own WHS in a small case, and don't have a DVD drive, you can transfer the WHS software to a USB flash drive of WHS to install from.&lt;/P&gt;
&lt;P&gt;- If you are building your own WHS and require special drivers for your mass storage devices or network connection, you can make a USB flash drive of WHS w/ drivers.&amp;nbsp; You'll especially want this if the primary drive fails, and you want to use the "Server Recovery" option.&lt;/P&gt;
&lt;P&gt;- If your PCs that are connected to the WHS require special drivers for your mass storage devices or network connection, you can make a USB flash drive of the recovery CD which includes these drivers.&lt;/P&gt;
&lt;P&gt;Here are instructions for making such beasts.&amp;nbsp; Written for WinPE, but applicable to WHS. &lt;A href="http://www.realtime-vista.com/general/2007/05/preapring_windows_pe_to_boot_f.htm" mce_href="http://www.realtime-vista.com/general/2007/05/preapring_windows_pe_to_boot_f.htm"&gt;http://www.realtime-vista.com/general/2007/05/preapring_windows_pe_to_boot_f.htm&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5659296" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/Windows+Home+Server/default.aspx">Windows Home Server</category></item><item><title>My Windows Home Server</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/10/17/my-windows-home-server.aspx</link><pubDate>Thu, 18 Oct 2007 02:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5501550</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/5501550.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=5501550</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=5501550</wfw:comment><description>&lt;P&gt;I built my own Windows Home Server box.&amp;nbsp; You can buy some decent pre-built units, but I wanted to build my own.&amp;nbsp; I wanted a small, quiet, low-power device.&amp;nbsp; I was willing to compromise on performance &amp;amp; capacity to get it.&amp;nbsp; I decided that my collection of movies should live on my media center, just because I wanted to have a small WHS.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Dell D600 laptop&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;A laptop meets the small &amp;amp; low-power requirements without effort.&amp;nbsp; They also have a built-in keyboard/mouse/display and battery backup, while still being small.&lt;/P&gt;
&lt;P&gt;Dell leases these to corporations.&amp;nbsp; After the lease expires, they are sold for cheap.&amp;nbsp; I bought mine at a popular auction site for ~$300.&amp;nbsp; It had a 1.4GHz P4 and&amp;nbsp;512MB RAM.&amp;nbsp; Most have USB 2.0 (important for adding storage) and GigE (important for pushing a lot of data back and forth).&amp;nbsp; Many have Wi-Fi, which may be useful.&lt;/P&gt;
&lt;P&gt;D600 parts are easy to come by, and their online manuals are very good.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Pair of 160GB 2.5" drives&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Hard drive prices (per GB)&amp;nbsp;follow a "saddle" curve.&amp;nbsp; At the time of building, 120GB were at the bottom of the curve; 160GB were a bit higher.&amp;nbsp; Above 160GB were much higher.&amp;nbsp; I knew that I wanted space for 100GB today; 160GB would give me a little breathing room.&amp;nbsp; Since replacing drives is expensive (and replacing the primary drive is annoying), breathing room seemed wise.&lt;/P&gt;
&lt;P mce_keep="true"&gt;For the secondary drive, I bought a 2nd HD caddy, which replaces the DVD drive.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Great print server!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;It's small enough that it can fit comforably under my printer on my desk.&amp;nbsp; (I was careful to leave a little venting room.)&amp;nbsp; I like simple, obvious names, so my printer path is now &lt;A href="file://server/Printer" mce_href="file://server/Printer"&gt;\\SERVER\Printer&lt;/A&gt;.&amp;nbsp; The USB cable from server to printer only spans ~6 inches.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;What if I need more storage?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;One of these days I will probably decide that my movies should be moved to the server.&amp;nbsp; I rip my DVDs lossless, and currently have ~400GB, so I'm going to need more room.&amp;nbsp; Upgrading the internal 2.5" drives won't be feasible for a while - they're still too small.&amp;nbsp; Until then, I will need to add external storage.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;I can use the pair of USB 2.0 ports.&amp;nbsp; With these, an external enclosure with a pair of large 3.5" drives are a good choice.&amp;nbsp; (Two drives means I can fully use the USB bandwidth without dramatically overloading it.).&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;Another option is to get a PCMCIA card (there's only one slot) with USB 2.0 or eSATA.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;One downside is that the external drives won't be on the battery that's built in.&amp;nbsp; That means I will need a separate UPS if I want them protected.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5501550" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/Windows+Home+Server/default.aspx">Windows Home Server</category></item><item><title>Windows Home Server on a virtual machine</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/10/17/windows-home-server-on-a-virtual-machine.aspx</link><pubDate>Thu, 18 Oct 2007 02:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5501102</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/5501102.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=5501102</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=5501102</wfw:comment><description>&lt;P&gt;Here at Microsoft, when we talk about Windows Home Server, one of the things that comes up pretty often is a question about hosting WHS in a virtual machine under Virtual Server.&amp;nbsp; Most often people want this because they already have one always-on machine (a doman controller, a media center PC, etc.), and they don't want another.&lt;/P&gt;
&lt;P&gt;In discussing the problem, a few key bits of advice have come up, and I thought it would be a good idea to write them down here.&lt;/P&gt;
&lt;P&gt;One of the key problems appears when you consider using the WHS to back up the host.&amp;nbsp; It can certainly be done, but when the host goes down, restoring it is a catch 22.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Dedicate whole drives&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Take whole drives &amp;amp; put only one file on&amp;nbsp;each - the .VHD.&amp;nbsp;&amp;nbsp;Make it as large as possible.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Use external drives&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Make all of WHS's drives external.&amp;nbsp; Consider putting them all in a single enclosure for convenience.&amp;nbsp; eSATA w/ port multipliers may be a good choice.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Have a 2nd physical&amp;nbsp;machine ready&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It should already have&amp;nbsp;Virtual Server or Virtual PC installed.&amp;nbsp; A laptop is fine.&amp;nbsp; Make sure it has appropriate ports for the WHS drives.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Recovery strategy&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;When the regular host goes down:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Unplug the WHS drives&lt;/LI&gt;
&lt;LI&gt;Carry them to the 2nd host, and plug in&lt;/LI&gt;
&lt;LI&gt;Boot the WHS virtual machine.&amp;nbsp; (You may need to create a new VM with the existing .VHD files.)&lt;/LI&gt;
&lt;LI&gt;Restore the primary host&lt;/LI&gt;
&lt;LI&gt;Unplug the WHS drives&lt;/LI&gt;
&lt;LI&gt;Carry them back to the primary host, and plug in&lt;/LI&gt;
&lt;LI&gt;Boot the WHS virtual machine&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5501102" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/Windows+Home+Server/default.aspx">Windows Home Server</category></item><item><title>Screenshot of Select-GraphicalFilteredObject.ps1 in action</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/09/12/screenshot-of-select-graphicalfilteredobject-ps1-in-action.aspx</link><pubDate>Wed, 12 Sep 2007 22:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4883638</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/4883638.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=4883638</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=4883638</wfw:comment><description>&lt;P&gt;A picture would be helpful in understanding what &lt;A class="" href="http://blogs.msdn.com/jaybaz_ms/archive/2007/09/12/powshell-gui-for-selecting-objects-in-a-pipeline-select-graphiphicalfilteredobject-ps1.aspx" target=_blank mce_href="http://blogs.msdn.com/jaybaz_ms/archive/2007/09/12/powshell-gui-for-selecting-objects-in-a-pipeline-select-graphiphicalfilteredobject-ps1.aspx"&gt;this script&lt;/A&gt; does.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;TT&gt;dir $pshome | Select-GraphicalFilteredObject.ps1 -title "Jay's blog is the best!"&lt;/TT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;gives this UI:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/jaybaz_ms/attachment/4883638.ashx" mce_src="http://blogs.msdn.com/jaybaz_ms/attachment/4883638.ashx"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4883638" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/jaybaz_ms/attachment/4883638.ashx" length="35434" type="image/x-png" /><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>Powshell GUI for selecting objects in a pipeline ("Select-GraphiphicalFilteredObject.ps1")</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/09/12/powshell-gui-for-selecting-objects-in-a-pipeline-select-graphiphicalfilteredobject-ps1.aspx</link><pubDate>Wed, 12 Sep 2007 22:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4883624</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/4883624.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=4883624</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=4883624</wfw:comment><description>&lt;P&gt;This is an enhanced version of a script from Lee Holmes' book &lt;EM&gt;Windows PowerShell Cookbook&lt;/EM&gt; (O'Reilly).&amp;nbsp; The original script takes a pipeline &amp;amp; presents a GUI that lets you select which elements to pass on to the next step in the pipeline.&amp;nbsp; That's unchanged, but my enhanced script does a little more:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Added 'All' and 'None' buttons&lt;/LI&gt;
&lt;LI&gt;A little space around the checked list box&lt;/LI&gt;
&lt;LI&gt;Option to set the title to something domain-specific&lt;/LI&gt;
&lt;LI&gt;Turn off CheckOnClick behavior because I think it's annoying but leave it as an option, if you like that sort of thing.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;EDIT: Fix the attachment.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4883624" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/jaybaz_ms/attachment/4883624.ashx" length="4125" type="text/plain" /><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>Domain-Specific Languages</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/06/19/domain-specific-languages.aspx</link><pubDate>Tue, 19 Jun 2007 19:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3408691</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/3408691.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=3408691</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=3408691</wfw:comment><description>&lt;P&gt;I'm quite attracted by the idea of domain-specific languages, but so far I haven't found a satisfactory way to create them.&lt;/P&gt;
&lt;P&gt;For a while I was writing a lot of MSBuild tasks.&amp;nbsp; I found the programming model for a MSBuild tasks to be a bit awkward.&amp;nbsp; You have to write properties where fields should be sufficient.&amp;nbsp; For MSBuild to see a property accessor, it has to be 'public', even though you don't want anyone else to ever use the accessor (not even yourself!).&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So, I wrote a tool that generates the boilerplate MSBuild task code.&amp;nbsp; (I also took the opportunity to convert T[] to List&amp;lt;T&amp;gt; in your code, which is usually nicer to code against.) I wrote it as an MSBuild task, which is convenient when it comes time to hook it in to the build system. The input language is MSBuild, which is XML.&amp;nbsp; XML is an awkward language for humans to read &amp;amp; write, though, so it wasn't quite satisfactory.&amp;nbsp; &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;(Yes, the task is built with itself.&amp;nbsp; Not the latest version, but a last-known-good ("LKG") version.)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I later needed to write a lot of Windows Workflow Activities.&amp;nbsp; When you want to add a property to an activity, you have to write a lot of code.&amp;nbsp; You want to express a simple idea (type, name, and comment:) and you have to write all this:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 4pt; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt"&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;summary&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; DependencyProperties allow input parameters to be bound at runtime to any class member property&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; of compatible type in the workflow/activity hierarchy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[System.Diagnostics.CodeAnalysis.&lt;SPAN style="COLOR: #2b91af"&gt;SuppressMessage&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"Microsoft.Usage"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;"CA2211:NonConstantFieldsShouldNotBeVisible"&lt;/SPAN&gt;, Justification = &lt;SPAN style="COLOR: #a31515"&gt;"WF requires this."&lt;/SPAN&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; DependencyProperty SkuNameProperty = System.Workflow.ComponentModel.DependencyProperty.Register(&lt;SPAN style="COLOR: #a31515"&gt;"SkuName"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;), &lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(ComputeRpsInputsActivity));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; Input parameter.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The name of the SKU that is being tested.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;E.g., 'vs_vsts'.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[Description(&lt;SPAN style="COLOR: #a31515"&gt;"The name of the SKU that is being tested.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;E.g., 'vs_vsts'."&lt;/SPAN&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[Browsable(&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; SkuName&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;)&lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;.GetValue(MyActivity.SkuNameProperty);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;set&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;.SetValue(MyActivity.SkuNameProperty, &lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; MARGIN: 0in 0in 0pt; BORDER-LEFT: medium none; LINE-HEIGHT: normal; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-layout-grid-align: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 1.0pt 4.0pt 1.0pt 4.0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Consolas; mso-no-proof: yes; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;So, using my task-generating task, I wrote a new MSBuild task that would generate this sort of property definition code.&amp;nbsp; It went pretty quickly, since I already had the task generator code in hand, and CodeCom still fresh in my mind. It was a big win, cleaning up the activity code dramatically.&amp;nbsp; However, I'm still disappointed by the use of XML as an input language.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In both cases, the work of writing the DSL tool was difficult to justify.&amp;nbsp; In a general-purpose programming language, it makes sense to make a big investment in the tools &amp;amp; design of the language.&amp;nbsp; You want the use of the language to go smoothly, the language should be powerful, and the result should be readable.&amp;nbsp; However, in a DSL, you have to balance those goals against the need to make the DSL cheap.&amp;nbsp; Cost of entry is a big deal in DSLs.&lt;/P&gt;
&lt;P&gt;In a couple places (&lt;A class="" href="http://www.manning.com/payette/" target=_blank mce_href="http://www.manning.com/payette/"&gt;his book&lt;/A&gt;, &lt;A class="" href="http://channel9.msdn.com/showpost.aspx?postid=309510" target=_blank mce_href="http://channel9.msdn.com/showpost.aspx?postid=309510"&gt;his interview&lt;/A&gt;), Bruce Payette talks about using PowerShell&amp;nbsp;to create&amp;nbsp;a DSL.&amp;nbsp; I'm&amp;nbsp;hopeful that this technique can meet the goals above.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have you used to create DSLs?&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3408691" width="1" height="1"&gt;</description></item><item><title>PowerShell polyglot</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/04/26/powershell-polyglot.aspx</link><pubDate>Thu, 26 Apr 2007 20:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2288421</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/2288421.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=2288421</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=2288421</wfw:comment><description>&lt;P&gt;Here's an example of a CMD script that is implemented in PowerShell.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: Consolas"&gt;&lt;FONT size=3&gt;@@:: This prolog allows a PowerShell script to be embedded in a .CMD file.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: Consolas"&gt;&lt;FONT size=3&gt;@@:: Any non-PowerShell content must be preceeded by "@@"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: Consolas"&gt;&lt;FONT size=3&gt;@@setlocal&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: Consolas"&gt;&lt;FONT size=3&gt;@@set POWERSHELL_BAT_ARGS=%*&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: Consolas"&gt;&lt;FONT size=3&gt;@@if defined POWERSHELL_BAT_ARGS set POWERSHELL_BAT_ARGS=%POWERSHELL_BAT_ARGS:"=\"%&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="COLOR: black; FONT-FAMILY: Consolas"&gt;&lt;FONT size=3&gt;@@PowerShell -Command Invoke-Expression $('$args=@(^&amp;amp;{$args} %POWERSHELL_BAT_ARGS%);'+[String]::Join(';',$((Get-Content '%~f0') -notmatch '^^@@'))) &amp;amp; goto :EOF&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If you don't need to support quoted arguments, you can even make it a one-liner:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;@PowerShell -Command Invoke-Expression $('$args=@(^&amp;amp;{$args} %*);'+[String]::Join(';',(Get-Content '%~f0') -notmatch '^^@PowerShell.*EOF$')) &amp;amp; goto :EOF&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2288421" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>Is Virtual Memory dead?</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/04/19/is-virtual-memory-dead.aspx</link><pubDate>Thu, 19 Apr 2007 22:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2196042</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/2196042.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=2196042</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=2196042</wfw:comment><description>&lt;P&gt;To figure out whether virtual memory makes sense, you have to look at the following factors:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;RAM size&lt;/LI&gt;
&lt;LI&gt;Disk size&lt;/LI&gt;
&lt;LI&gt;RAM speed&lt;/LI&gt;
&lt;LI&gt;Disk speed&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;It's the relationship between these values that matter.&amp;nbsp; (All of these are considered in the context of a fifth factor: price.&amp;nbsp; For example, you can usually find a way to buy more RAM, but it may mean replacing the motherboard, switching to a 64-bit OS, etc.)&lt;/P&gt;
&lt;P&gt;In the last decade or two, we've seen RAM and disk sizes grow steadily.&amp;nbsp; RAM speed has increased quite a bit, as well, but disk speed has lagged behind.&amp;nbsp; For example, in 1994 I bought a PC for personal use for $3000.&amp;nbsp; Of that, and $1000 was for a 1 GB hard drive (I don't know the speed, let's guess 5400 RPM).&amp;nbsp; I had 16 MB of RAM, and 33 MHz front-side bus.&lt;/P&gt;
&lt;P&gt;Today, if I try to spend the same money on a PC, it's pretty hard to do.&amp;nbsp; If I adjust for today's dollars, it's even harder.&amp;nbsp; But we can look at a high-end PC today.&amp;nbsp; Let's say 4 GB RAM, 500 GB hard drive @ 7200 RPM, 800 MHz FSB.&amp;nbsp; This PC will probably cost $800-$1000.&amp;nbsp; So, by comparison:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;HD size&amp;nbsp;&amp;nbsp; 500X&lt;BR&gt;RAM size 256X&lt;BR&gt;HD speed 1.3X&lt;BR&gt;RAM speed 24X&lt;BR&gt;Price 0.3X&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As you can see, price has dropped dramatically, the HD and RAM sizes have grown at close to the same rate, but their relative speeds have not.&lt;/P&gt;
&lt;P&gt;So, I ask, why is virtual memory still ubiquitous?&amp;nbsp; If I have 4 GB of RAM, I probably only need the virtual memory if I'm doing "big" things, like compiling all of Visual Studio or editing video.&lt;/P&gt;
&lt;P&gt;Perhaps what's missing here is something in between.&amp;nbsp; Some kind of solid-state storage, faster than hard disk, cheaper than RAM.&amp;nbsp; Making up numbers, give me 24 GB of it today, at 100X the speed of a HD, for $100.&amp;nbsp; Use it for page file, and perhaps HD caching.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2196042" width="1" height="1"&gt;</description></item><item><title>A formula for a home platform</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/03/28/a-formula-for-a-home-platform.aspx</link><pubDate>Wed, 28 Mar 2007 23:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1980271</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/1980271.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=1980271</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=1980271</wfw:comment><description>&lt;P&gt;In &lt;A id=bp___ctl00___RecentPosts___postlist___EntryItems_ctl00_PostTitle href="http://blogs.msdn.com/jaybaz_ms/archive/2007/03/12/picking-a-home-pc-platform.aspx"&gt;&lt;FONT color=#006bad&gt;Picking a home PC platform&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;I described my requirements for my ideal home PC platform.&amp;nbsp; I've put together a "system formula" - a list of parts to use when building a machine.&lt;/P&gt;
&lt;P&gt;The first decision to make is to select a CPU socket.&amp;nbsp; This in turn confines you to a certain set of motherboards, a certain set of CPUs, and a certain type of memory.&amp;nbsp; I ended up going with "Socket AM2"..&amp;nbsp; It supports low-power "Manila" processors starting at 1.6GHz ($40), so the cost of entry is low.&amp;nbsp; The fastest AMD processors are AM2, and even processors for the next socket (AM2+) are back-compatible with AM2 motherboards.&amp;nbsp; It is likely to be viable for quite a while, giving my formula a long lifetime.&amp;nbsp; AM2 sockets take DDR2 RAM.&lt;/P&gt;
&lt;P&gt;The next question was motherboard form factor.&amp;nbsp; FlexATX and mini-ITX are interesting, but there are many boards in those sizes.&amp;nbsp; The only mini-ITX AM2 board I found was $300, too expensive for my purposes.&amp;nbsp; There are lots of MicroATX (9.6" x 9.6")&amp;nbsp;boards and cases out there, plus they fit in ATX cases, too.&lt;/P&gt;
&lt;P&gt;With that in mind, I went motherboard shopping, and found the &lt;A class="" href="http://usa.asus.com/products4.aspx?modelmenu=2&amp;amp;model=1138&amp;amp;l1=3&amp;amp;l2=101&amp;amp;l3=296" mce_href="http://usa.asus.com/products4.aspx?modelmenu=2&amp;amp;model=1138&amp;amp;l1=3&amp;amp;l2=101&amp;amp;l3=296"&gt;ASUS M2NPV-VM&lt;/A&gt;&amp;nbsp;($85).&amp;nbsp; This board has a lot going for it:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;GeForce 6150 video&lt;/LI&gt;
&lt;LI&gt;DVI and VGA out, plus TV out on headers&lt;/LI&gt;
&lt;LI&gt;4 memory slots - DDR2 800, 8GB max.&lt;/LI&gt;
&lt;LI&gt;PCI-x16, PCI-x1, and two PCI&lt;/LI&gt;
&lt;LI&gt;2 PATA&lt;/LI&gt;
&lt;LI&gt;4 SATA&lt;/LI&gt;
&lt;LI&gt;onboard RAID&lt;/LI&gt;
&lt;LI&gt;5.1 audio, including digital out&lt;/LI&gt;
&lt;LI&gt;Gigabit ethernet&lt;/LI&gt;
&lt;LI&gt;4 USB jacks + 4 USB headers for the front.&lt;/LI&gt;
&lt;LI&gt;1 1394 jack&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Aside: why do they bother with PS2 and LPT ports on the board?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;With so much built-in to the motherboard, there's not going to be a lot of deviation in the various roles.&lt;/P&gt;
&lt;P&gt;There doesn't seem to be much point in configuring this machine with anything less than 1GB RAM, as buying a pair of 256M sticks doesn't save much money, and buying small RAM is always a waste.&amp;nbsp; However, buying 667MHz RAM is probably find for a low-end machine.&amp;nbsp; $66.&lt;/P&gt;
&lt;P&gt;You can use any good quality case that suits your needs.&amp;nbsp; $90 with PSU is normal.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Small hard disks aren't differentiated by price, so there's not much point in getting a tiny one, no matter what the role.&amp;nbsp; A WD Caviar is a good choice for a basic box.&amp;nbsp; 80GB&amp;nbsp;= $45, although going up to 200GB is perfectly reasonable.&lt;/P&gt;
&lt;P&gt;DVD writers are so cheap that there's not much point in skipping them, no matter what the role of the machine.&amp;nbsp; (CD writers and DVD readers are no savings).&amp;nbsp; You can even get them SATA today for only a couple bucks more.&amp;nbsp; $35.&lt;/P&gt;
&lt;P&gt;That's $360 for a basic machine.&amp;nbsp; (If dollars were really tight, you could squeeze it down to $300, but I don't think it's a good idea.)&lt;/P&gt;
&lt;P&gt;This machine would fill any of the roles I listed before, with only the following modifications:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SERVER &lt;/STRONG&gt;- a slightly larger case + only 500GB or 750GB drives&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;GAMING&lt;/STRONG&gt;&amp;nbsp;- fast CPU, 800MHz RAM.&amp;nbsp; Optionally a very fast CPU, a WD Raptor (10K RPM) system drive or two Caviars in RAID0, more RAM, and a very fast video card.&lt;/P&gt;
&lt;P&gt;I don't know what the minimum requirements are for HD TV and DVD playback, but when the day comes that I care about that, I'm sure this platform will be easily upgradable to support it.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1980271" width="1" height="1"&gt;</description></item><item><title>Picking a home PC platform</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/03/12/picking-a-home-pc-platform.aspx</link><pubDate>Mon, 12 Mar 2007 20:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1866690</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/1866690.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=1866690</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=1866690</wfw:comment><description>&lt;P&gt;In my home, I a bunch of computers.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ENVY&lt;/STRONG&gt;&amp;nbsp;- used by everyone, has the best CPU, RAM, video card, monitor, etc.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;WRATH&lt;/STRONG&gt; - alternate PC for when ENVY is busy.&amp;nbsp; Usually running Age of Mythology for my 5yo.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PRIDE&lt;/STRONG&gt; - sits OFF most of the time, but is available when there are suddenly a lot of people in the house&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;LUST&lt;/STRONG&gt; - a tiny Sony Vaio laptop, usually OFF because it's way too slow running WinXP.&amp;nbsp; Sometimes useful for MS Streets &amp;amp; Trips in the car.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;HTPC1&lt;/STRONG&gt; - The media center PC.&amp;nbsp; Primarily for DVD &amp;amp; music playback.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;JAYBAZ_HOME&lt;/STRONG&gt; - a Microsoft-owned laptop that I use to work from home.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SERVER&lt;/STRONG&gt; - A, uhh, server running Windows Home Server Beta 2 (which is, like, totally awesome)&lt;/P&gt;
&lt;P&gt;Only two of these PCs are the same model (WRATH and PRIDE).&amp;nbsp; Each of the others is something different.&amp;nbsp; Some can boot from USB, some can't.&amp;nbsp; One is free of PS/2 slots, so I keep a spare USB keyboard in the closet just for that one.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Each one has exactly 1 hard drive in it, except for SERVER, which is filled to the gills.&amp;nbsp; Each has exactly one optical drive - some are CD/R, some are DVD.&amp;nbsp; Each desktop is a full-sized tower, which is way overkill for what I'm doing.&lt;/P&gt;
&lt;P&gt;Keeping track of which PC can do what is a hassle.&amp;nbsp; So is making sure they all have the latest BIOS.&amp;nbsp; WRATH has trouble going in to standby on Vista, but the others are fine.&amp;nbsp; Etc.&lt;/P&gt;
&lt;P&gt;I'm thinking&amp;nbsp;I'd like to move to a&amp;nbsp;single&amp;nbsp;PC platform (excluding laptops for now) for the whole home, to keep things simpler.&amp;nbsp;I'm thinking:&lt;/P&gt;
&lt;P&gt;Small is important to me, and shouldn't be hard:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Only one HD required&lt;/LI&gt;
&lt;LI&gt;No floppy allowed!&lt;/LI&gt;
&lt;LI&gt;Optical drive space is optional, as I have an external DVD RW drive that I can card around if needed.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Card readers are not required, as my Dell 2405FPW has them built-in&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;Motherboard with the following features:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;video at least as good as an nVidia FX5200 (DVD playback)&lt;/LI&gt;
&lt;LI&gt;VGA and DVI out&lt;/LI&gt;
&lt;LI&gt;Gigabit ethernet&lt;/LI&gt;
&lt;LI&gt;Generous USB front and back&lt;/LI&gt;
&lt;LI&gt;1 or 2 expansion slots&lt;/LI&gt;
&lt;LI&gt;able to take both cleap &amp;amp; fast CPUs&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I&amp;nbsp;want&amp;nbsp;to be pretty low power, and&amp;nbsp;very, very quiet.&amp;nbsp; (Hey, while&amp;nbsp;I'm at it, can it be cheap, too?)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For most roles that I described above, this PC is fine - add HD, RAM, and CPU and you're done.&lt;/P&gt;
&lt;P&gt;For the main PC, I'd add a strong video card, and upgrade the CPU, HD speed, and RAM size.&amp;nbsp; Some motherboards have onboard multi-channel audio, which might be nice.&amp;nbsp; Alternatives include an internal sound card, and external (USB) sound "card", or a USB speaker set (e.g. &lt;A class="" href="http://www.alteclansing.com/product_details.asp?pID=FX5051" mce_href="http://www.alteclansing.com/product_details.asp?pID=FX5051"&gt;these&lt;/A&gt;).&amp;nbsp; The last one is nice because it leaves me with one less component.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;One day I'm sure I'll want to do HD-DVD playback on the media center, at which point I'll upgrade the video, CPU, RAM, and HD on that box as well.&amp;nbsp; But for now, the basic config is fine.&lt;/P&gt;
&lt;P&gt;In the server role, I would take advantage of the incredible shrinking HDs (750G units are $300 these days), and either 1-2 USB enclosures, or a 4-drive enclosure if I really wanted a lot of space.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm hoping there's a barebones SFF PC that meets these requirements, and has good build quality, works out of the box with Windows XP and Vista, and is generally trouble-free.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;The future&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;We're approaching the end of days for the desktop PC.&amp;nbsp; To be less sensational: the desktop case will continue to be important for both commodity PCs (they're cheap) and high-end PCs (room for high-end components) for a long, long time.&amp;nbsp; However, unless you're playing the latest games (can't wait for HL2:EP2!), or processing lots of video, or something, you don't need the fastest that PCs have to offer.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;For many years, the "good enough" PC was $2000 - that was the minimum you'd spend to get a PC worth spending money on.&amp;nbsp;&amp;nbsp;The&amp;nbsp;PC that you really wanted was $5000.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;Today, the "good enough" is more like $400-$500, and the PC you really want is $1000-$1500.&amp;nbsp; It's hard to get a PC for more than $2000 without getting exotic.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Meanwhile, laptops have come way down, too.&amp;nbsp; Instead of paying $1000 for a laptop that wasn't quite as good as your desktop, now the difference is only a couple hundred bucks. When you consider the savings in space, power, cooling, clutter, etc., the difference looks even smaller.&lt;/P&gt;
&lt;P mce_keep="true"&gt;With that in mind, I think that I'm about 2-3 years away from a strict laptop-only diet.&amp;nbsp; You might think that the media center PC would need to be a desktop to hold a tuner card (I don't watch TV) or lots of storage (I keep it on the server).&amp;nbsp; You might think the server should be an exception, but remember that laptops come with built-in battery backup, and a compact keyboard/mouse/monitor that is good for a console you rarely touch.&amp;nbsp; (Storage goes can go external, still.).&amp;nbsp; Even the gaming PC could be an exception, but consider the &lt;A class="" href="http://www.dell.com/content/products/productdetails.aspx/xpsnb_m2010?c=us&amp;amp;cs=19&amp;amp;l=en&amp;amp;s=dhs" mce_href="http://www.dell.com/content/products/productdetails.aspx/xpsnb_m2010?c=us&amp;amp;cs=19&amp;amp;l=en&amp;amp;s=dhs"&gt;Dell XPS M2010&lt;/A&gt;, with a Core Duo CPU, 20" widescreen LCD, a full-sized bluetooth keyboard, dual DVI out, 7.1 audio out, built-in subwoofer + 8 speakers, up to 4GB RAM, dual hard disks.&amp;nbsp; Sure, it's $4000 when decked out, but that's still less than the $5000 "PC you really want" price of the early 90s.&amp;nbsp; And the specs will continue to improve, and prices will continue to drop.&amp;nbsp; In 2-3 years, it won't seem outrageous to get a laptop like that even for gaming, I suspect.&lt;/P&gt;
&lt;P mce_keep="true"&gt;(Also, note that 3.5" hard disks will probably be phased out, even in desktops, in the next couple years.&amp;nbsp; Consider how price, speed, power draw, noise, and heat are playing together here.)&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1866690" width="1" height="1"&gt;</description></item><item><title>properties vs. fields... again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/02/08/properties-vs-fields-again.aspx</link><pubDate>Fri, 09 Feb 2007 00:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1629830</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/1629830.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=1629830</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=1629830</wfw:comment><description>&lt;P&gt;Eric Gunnerson just posted &lt;A class="" href="http://blogs.msdn.com/ericgu/archive/2007/02/01/properties-vs-public-fields-redux.aspx" mce_href="http://blogs.msdn.com/ericgu/archive/2007/02/01/properties-vs-public-fields-redux.aspx"&gt;Properties vs public fields redux...&lt;/A&gt; It's no secret that I agree with Eric whole-heartedly on this matter.&amp;nbsp; I've posted about this before as well: &lt;A href="http://blogs.msdn.com/jaybaz_ms/archive/2004/04/29/123333.aspx" mce_href="http://blogs.msdn.com/jaybaz_ms/archive/2004/04/29/123333.aspx"&gt;http://blogs.msdn.com/jaybaz_ms/archive/2004/04/29/123333.aspx&lt;/A&gt;.&amp;nbsp; Fundementally, the problem is one of "speculative generality", where you are writing code today that has no use, because you think that it might be needed sometime in the future.&amp;nbsp; Of course, since you can't predict whether it will be used, and you can't predict how it will be used, your guesses are wrong most of the time.&amp;nbsp; That is, most public properties are trivial forever.&lt;/P&gt;
&lt;P&gt;It's interesting that the strongest objection some people have is that it requires a rethinking of some of the common naming conventions to adjust appropriately.&amp;nbsp; Such a minor issue, and so easily resolved.&lt;/P&gt;
&lt;P&gt;Since my original post, I've come across a couple other reasons why the "always use properties" guidance is broken.&amp;nbsp; Specifically, if you are correct that you may need to maintain binary compatibility while changing implementation, then you'll probably need it in other places:&lt;/P&gt;
&lt;P&gt;1. &lt;STRONG&gt;Constructors lock you in to a type. &lt;/STRONG&gt;If you really want binary&amp;nbsp; compatibility, you should stop providing ctors, and start providing factory methods:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyClass&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;MyClass() { }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyClass&lt;/SPAN&gt; New() { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyClass&lt;/SPAN&gt;(); }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;
&lt;P mce_keep="true"&gt;The purpose, of course, is to allow you to return a &lt;EM&gt;different&lt;/EM&gt; object type that derives from MyClass in the future, while maintaining binary compatibility.&lt;/P&gt;
&lt;P mce_keep="true"&gt;2. &lt;STRONG&gt;Types lock you in to a type.&lt;/STRONG&gt;&amp;nbsp; If you really, really want binary compatibilty, you should stop providing types at all, and start dealing only with interfaces:&lt;/P&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;interface&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;IMyInterface&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; F();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyClass&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;IMyInterface&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;MyClass() { }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Factory&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;IMyInterface&lt;/SPAN&gt; New() { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MyClass&lt;/SPAN&gt;(); }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;IMyInterface&lt;/SPAN&gt;.F()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;// ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;
&lt;P mce_keep="true"&gt;Now, I look at this code, and I think I'm writing a lot of lines for nothing.&amp;nbsp; That is, in my domain, this kind of generality is unnecessary.&amp;nbsp; That's why I don't generally use factories, interfaces, or properties.&amp;nbsp; I consider them to be kin.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;There are probably some other constructs that go along with these, for speculative generality.&amp;nbsp; These are just the 2 that come to mind.&lt;/P&gt;
&lt;P mce_keep="true"&gt;If &lt;STRONG&gt;you&lt;/STRONG&gt; still believe that you need to use properties in the trivial cases, I hope you will examine these constructs and consider them seriously in your own code.&amp;nbsp; I suspect you should be choosing all or nothing.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1629830" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/Development+Practices/default.aspx">Development Practices</category></item><item><title>Controlling Virtual Server through Microsoft PowerShell</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/01/22/controlling-virtual-server-through-microsoft-powershell.aspx</link><pubDate>Tue, 23 Jan 2007 00:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1509817</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/1509817.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=1509817</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=1509817</wfw:comment><description>&lt;P&gt;In &lt;A class="" href="http://blogs.msdn.com/virtual_pc_guy/archive/2006/06/13/630165.aspx" mce_href="http://blogs.msdn.com/virtual_pc_guy/archive/2006/06/13/630165.aspx"&gt;his post by the same name&lt;/A&gt;, Ben describe a series of steps required in order to manipulate Virtual Server from PowerShell.&lt;/P&gt;
&lt;P&gt;I'm still a PowerShell novice, so I decided to use this problem as an opportunity to see if I could make things a little easier.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The reason it's hard is that you have to make a call to a native Win32 API, which is not accessible from PowerShell directly.&amp;nbsp; Ben's solution includes a peice of C# code that makes this call via interop, and then you have to compile it &amp;amp; load the assembly before you can do any work.&amp;nbsp; In my solution, my script does that work, as well.&lt;/P&gt;
&lt;P&gt;Here's the code:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;CODE&gt;
&lt;P&gt;$csc = (join-path ($env:windir) Microsoft.NET\Framework\v2.0.50727\csc.exe)&lt;/P&gt;
&lt;P&gt;$code = [IO.Path]::GetTempFileName() + ".cs"&lt;/P&gt;
&lt;P&gt;echo @"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Runtime.InteropServices;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class PowershellComSecurity&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DllImport("Ole32.dll", CharSet = CharSet.Auto)]&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static extern int CoSetProxyBlanket(IntPtr p0, uint p1, uint p2, uint p3, uint p4, uint p5, IntPtr p6, uint p7);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static int EnableImpersonation(object objDCOM) { return CoSetProxyBlanket(Marshal.GetIDispatchForObject(objDCOM), 10, 0, 0, 0, 3, IntPtr.Zero, 0); }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;"@ &amp;gt; $code&lt;/P&gt;
&lt;P&gt;$assembly = [IO.Path]::GetTempFileName() + ".dll"&lt;/P&gt;
&lt;P&gt;&amp;amp; $csc /nologo /target:library /out:$assembly $code&lt;BR&gt;[System.Reflection.Assembly]::LoadFrom($assembly) &amp;gt; $null&lt;/P&gt;
&lt;P&gt;function SetSecurity { [PowershellComSecurity]::EnableImpersonation($args[0]) }&lt;/P&gt;
&lt;P&gt;$vs = new-object -comObject "VirtualServer.Application"&lt;BR&gt;SetSecurity($vs)&lt;/P&gt;
&lt;P&gt;$vm = $vs.FindVirtualMachine("public")&lt;BR&gt;SetSecurity($vm)&lt;/P&gt;
&lt;P&gt;$guest = $vm.GuestOS&lt;BR&gt;SetSecurity($guest)&lt;/P&gt;
&lt;P&gt;$guest&lt;/CODE&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;It could use a little tuning.&amp;nbsp; If I was going to do this a lot, I'd put it all in to a new script.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1509817" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>export environment variables from CMD to PowerShell</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/01/17/export-environment-variables-from-cmd-to-powershell.aspx</link><pubDate>Thu, 18 Jan 2007 03:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1485972</guid><dc:creator>jaybaz_MS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaybaz_ms/comments/1485972.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaybaz_ms/commentrss.aspx?PostID=1485972</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaybaz_ms/rsscomments.aspx?PostID=1485972</wfw:comment><description>&lt;P&gt;If you want to use PowerShell, but already have a CMD script that you want to keep, and that CMD script sets environment variables, you're in a pickle.&amp;nbsp; Now I like pickles of all kinds, but Lee can help you get out of this one, with a script that exports the env. vars. back to the PS host.&lt;/P&gt;
&lt;P&gt;It's all in his post on entitled &lt;A class=TitleLinkStyle href="http://www.leeholmes.com/blog/NothingSolvesEverythingPowerShellAndOtherTechnologies.aspx" rel=bookmark&gt;&lt;FONT color=#000000&gt;Nothing solves everything – PowerShell and other technologies&lt;/FONT&gt;&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1485972" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaybaz_ms/archive/tags/PowerShell/default.aspx">PowerShell</category></item></channel></rss>