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

<channel>
	<title>the echothis blog &#187; projects</title>
	<atom:link href="http://blog.echothis.com/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.echothis.com</link>
	<description>HelloWorld() shouldn't be so hard</description>
	<lastBuildDate>Mon, 30 Jan 2012 21:35:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Building a Vista Media Center plugin</title>
		<link>http://blog.echothis.com/2009/02/27/building-a-vista-media-center-plugin/</link>
		<comments>http://blog.echothis.com/2009/02/27/building-a-vista-media-center-plugin/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 16:45:27 +0000</pubDate>
		<dc:creator>Rolf</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[Vista Media Center]]></category>

		<guid isPermaLink="false">http://blog.echothis.com/?p=29</guid>
		<description><![CDATA[All I want to do is watch hulu.com movies on my TV instead of my laptop. This is much easier said than done though. The development tools seem to have stalled a few years ago. Is anyone else writing these things these days? This post gives bad news: Flash is not coming to MCE anytime [...]]]></description>
			<content:encoded><![CDATA[<p>All I want to do is watch hulu.com movies on my TV instead of my laptop.  This is much easier said than done though.  The development tools seem to have stalled a few years ago.  Is anyone else writing these things these days?</p>
<p>This post gives bad news: <a href="http://blog.milliesoft.co.uk/2009/02/flash-in-windows-media-center/">Flash is not coming to MCE anytime soon</a>.  So in order to get the Flash videos playing you have to render the ordinary Flash object inside a page, and have the plugin navigate to that page.</p>
<p>First off, I&#8217;m not the only one doing this.  <a href="http://www.milliesoft.co.uk/index.php?option=com_content&amp;view=article&amp;id=9:iplayer-mce&amp;catid=1:software&amp;Itemid=11">TunerFreeMCE</a>, a closed-source plugin written by the author of the blog above, does the same thing for BBC shows and Hulu.  Unfortunately it seems broken at the moment for Hulu content, but that&#8217;s probably easily fixed.  Perhaps they changed their HTML format or something.  </p>
<p>Main things I learned in the writing of my first plugin:</p>
<p><strong>The Media Center SDK version 5.3 (which I think is the latest) has some issues.</strong></p>
<ol>
<li>It contains a solution (MCMLSampler) that doesn&#8217;t build in VS 2008.  It can&#8217;t find any of the MediaCenter DLL references, and try as I might I couldn&#8217;t add them manually either.  So you can use the solution to browse the code but you can&#8217;t build it.</li>
<li>There are hardcoded WiX binary paths in the MSI build batch file Build.bat.  Sloppy, Redmond!</li>
<li>Don&#8217;t forget to edit DevInstall.cmd if you add any non-DLL&#8217;s to your plugin; otherwise they won&#8217;t get copied to Program Files.</li>
<li><code>DevInstall.cmd /u /debug </code>works but <code>DevInstall.cmd /debug /u</code> does not.</li>
</ol>
<p><strong>The design and debugging process leaves a lot to be desired.</strong></p>
<ol>
<li>I haven&#8217;t found any way to F5-debug the application directly.  I can install the plugin into MCE via DevInstall.cmd (which installs it into the GAC) and then attach to the process but that&#8217;s it.  If you set the registry key in <code>C:\Program Files\Microsoft SDKs\Windows Media Center\v5.0\Tools </code>you end up spawning a dialog window upon launch to give time to attach to the process.  This post recommends <a href="http://www.samsaffron.com/archive/2009/01/28/Simpler+debugging+of+Vista+Media+Center+plugins">a macro to make it quicker </a>but I haven&#8217;t tried it.</li>
<li>You can debug your markup via F5-debug but it will crash if you have any code-behind dependencies. This makes it fairly useless IMHO.</li>
<li>There&#8217;s no visual designer (at least that I&#8217;ve found).  So you have to lay out the markup manually, like in the early WPF days.  And <a href="http://blog.retrosight.com/WhyOurLookFeelIsntAvailableToApplications.aspx">when you don&#8217;t have any good-looking templates to start from</a>, the results look like crap.</li>
<li>I did find the MCMLookalike project to develop open-source templates plugin developers could use to better match the MCE UI.  It ceased last year due to a lack of community support but it was really helpful to see how a good MCE developer would write the MCML.  You have to dig for the source code, <a href="http://mcmlookalike.svn.sourceforge.net/viewvc/mcmlookalike/">but it&#8217;s there</a>.  I had to rebuild the VS 2008 project to get it running; that&#8217;s available here: <a href="http://blog.echothis.com/wp-content/uploads/2009/02/minimalmce.zip">mcmlookalike-vs2008.zip</a></li>
<li>You can set several command-line options in MCMLPad during debugging.  I added screen resolution, for example, so in the &#8220;Command-line arguments&#8221; under the Debug tab, I have the following to test 1280&#215;720 (what the default &#8220;windowed&#8221;) launch of MCE is on Vista):</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-load:<span style="color: #ff0000;">&quot;resx://HuluMCE/HuluMCE.Resources/Test&quot;</span> -assemblyredirect:<span style="color: #ff0000;">&quot;C:\shared\projects\hulu\HuluMCE\bin\Debug&quot;</span> -markupredirect:<span style="color: #ff0000;">&quot;resx://HuluMCE/HuluMCE.Resources/,file://C:\shared\projects\hulu\HuluMCE\Markup\,.mcml&quot;</span> -size:<span style="color: #000000;">1280</span>,<span style="color: #000000;">720</span></pre></div></div>

</ol>
<p>When I get a bit further along I&#8217;ll post the code, and built project, so you can see it in action.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.echothis.com/2009/02/27/building-a-vista-media-center-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NukeboxPerl, a web-based music jukebox</title>
		<link>http://blog.echothis.com/2009/02/27/nukebox-v1-a-web-based-music-jukebox-in-perl/</link>
		<comments>http://blog.echothis.com/2009/02/27/nukebox-v1-a-web-based-music-jukebox-in-perl/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 16:34:11 +0000</pubDate>
		<dc:creator>Rolf</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://blog.echothis.com/?p=22</guid>
		<description><![CDATA[I originally wrote this in 2004. This was built with some pretty old-school stuff (e.g., running PostgreSQL and Apache on cygwin). Yikes. I&#8217;ve since rewritten it for WAMP. There is some interesting stuff in that zipfile though, such as a hack to remove DRM from WMA files and a metadata database that include AMG tags [...]]]></description>
			<content:encoded><![CDATA[<p><em>I originally wrote this in 2004.  This was built with some pretty old-school stuff (e.g., running PostgreSQL and Apache on cygwin).  Yikes.  I&#8217;ve since rewritten it for WAMP.  There is some interesting stuff in that zipfile though, such as a hack to remove DRM from WMA files and a metadata database that include AMG tags and song lyrics&#8230;  Not bad for the time.</em></p>
<p>iTunes and WMP choking on your library? This is a web-based music jukebox designed for really large catalogs.</p>
<p>There are a ton of jukeboxes out there (from iTunes, to Windows Media Player, to Songbird, to about a zillion others), and they all look beautiful, have album metadata, etc. Unfortunately, the problem with all of them is they come to a chokling halt once you have more than, say, a few thousand songs. XMLdata storage is just not efficient enough to support the large record sets that arise if you have tens of thousands of songs to manage.</p>
<p>My solution to this is NukeboxPerl &#8211; a frontend to a RDBMS (in this case, PostgreSQL, but MySQL etc. would work just as well). I started this in 2002. It actually began life as a desktop .NET app but I switched to a server-based LAMP platform.</p>
<p>This Apache/modPerl/PostgreSQL web application was built to:</p>
<ul>
<li>Handle collections of tens of thousands of files without noticeable performance degradation.</li>
<li>Transparently handle MP3, WMA and optionally unprotected MPEG-4 files. DRM-protected WMA files can even have the DRM removed for your convenience</li>
<li>Run on old, slow hardware. I run it on a 500 MHZ Pentium II, circa 1999.</li>
<li>Be entirely, 100% free to use.</li>
<li>I haven&#8217;t had time to work on this for awhile. If I was to pick it up again, the first thing I would do would be port it to PHP5 and make it completely object-based.</li>
</ul>
<p>Operating System Requirements: Windows 2000/XP with Cygwin Linux-emulation package installed.</p>
<p>Download it: <a href="http://echothis.com/files/nukebox/nukebox.zip">NukeboxPerl</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.echothis.com/2009/02/27/nukebox-v1-a-web-based-music-jukebox-in-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing with the Windows peer-to-peer framework</title>
		<link>http://blog.echothis.com/2009/01/28/developing-with-the-windows-peer-to-peer-framework/</link>
		<comments>http://blog.echothis.com/2009/01/28/developing-with-the-windows-peer-to-peer-framework/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 21:06:07 +0000</pubDate>
		<dc:creator>Rolf</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[P2P]]></category>

		<guid isPermaLink="false">http://blog.echothis.com/?p=67</guid>
		<description><![CDATA[A few months ago I investigated various options to build P2P apps that could be run across the internet, regardless of hardware and ISPs. The research started with Java, which is JXTA (aka Juxtapose) &#8211; the framework started by Sun in 2001. I suspect the open-source P2P filesharing clients all use it (since they all [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I investigated various options to build P2P apps that could be run across the internet, regardless of hardware and ISPs.</p>
<p>The research started with Java, which is JXTA (aka Juxtapose) &#8211; the framework started by Sun in 2001. I suspect the open-source P2P filesharing clients all use it (since they all seem to be Java). It has been ported to C/C++ (which I was eventually able to compile on Win32). I was unable to get the .NET wrapper running (which is known to be incomplete anyway).</p>
<p>Thus I was stuck.  Research continued and I eventually got to the WCF P2P framework.  I&#8217;m not sure of the additions in 3.5 vs. 3.0. For starters check out:</p>
<ol>
<li><a class="ext-link" href="http://www.codeproject.com/KB/WCF/WPFWCF_Chat_App_via_P2P.aspx"><span class="icon">this project on CodeProject</span></a> which is the basis of WPFChat</li>
<li><a class="ext-link" href="http://msdn.microsoft.com/en-us/magazine/cc188685.aspx"><span class="icon">This MSDN blog</span></a> which describes the PictureViewer project (interesting forum post <a class="ext-link" href="http://www.vistax64.com/indigo/43930-wcf-p2p-pnrp-version-2-connections-questions.html"><span class="icon">here</span></a>)</li>
<li><a class="ext-link" href="http://en.wikipedia.org/wiki/Windows_Meeting_Space"><span class="icon">Windows Meeting Space</span></a> uses it (at least for Vista), so it is a scenario that Redmond is aware of.</li>
</ol>
<p>That said, is this supposed to be possible for 3rd-party developers? See <a class="ext-link" href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/86869e8d-d5a7-4ce7-813d-47e2ce448850/#sort=recent&amp;page=0&amp;filter=allcontent"><span class="icon">my forum post</span></a> where I asked around &#8211; net consensus was &#8220;sort of&#8221;, which I eventually confirmed.  Read on.</p>
<p id="RunningthePNRPservice"><strong>Running the PNRP service</strong></p>
<p>PNRP is the name resolution protocol. Service is running by default on Vista, <a class="ext-link" href="http://blog.int64.org/2008/05/14/enabling-ipv6-and-pnrp-in-windows-vista"><span class="icon">but if it&#8217;s not do this</span></a>.  On XP, you need the Advanced Networking Pack (if you&#8217;re pre-SP2). If you are SP2+, you get it but need to enable it. But according to <a class="ext-link" href="http://blogs.msdn.com/p2p/archive/2008/06/23/pnrp-in-xp-sp3.aspx"><span class="icon">this post</span></a>, though, maybe SP2 doesn&#8217;t get it for free after all? Who knows.</p>
<p>From <a class="ext-link" href="http://msdn.microsoft.com/en-us/library/ms751534(VS.85).aspx"><span class="icon">MSDN</span></a>:</p>
<p class="wiki">To install PNRP on Windows XP SP2 (one-time setup):</p>
<ol>
<li>In the Control Panel, double-click Add or Remove Programs.</li>
<li>In the Add or Remove Programs dialog box, click Add/Remove Windows Components.</li>
<li>In the Windows Components Wizard, select the &#8220;Networking Services&#8221; check box and click &#8220;Details&#8221;.</li>
<li>Check the &#8220;Peer-to-Peer&#8221; check box and click &#8220;OK&#8221;.</li>
<li>Click &#8220;Next&#8221; in the Windows Components Wizard.</li>
<li>When the installation completes, click &#8220;Finish&#8221;.</li>
<li>From a command shell prompt, start the PNRP service with the following command: net start pnrpsvc.</li>
</ol>
<p>Then you can check install by running</p>
<pre class="wiki">&gt; netsh p2p pnrp cloud show list</pre>
<p>You should see at least a link local and a global PNRP cloud. If you’re missing the Global_ cloud, you&#8217;ll need to take some extra steps to get IPv6 working. In that case see <a class="ext-link" href="http://blogs.msdn.com/p2p/archive/2007/07/24/pnrp-debugging-guide-part-1.aspx"><span class="icon">this debugging guide</span></a>.</p>
<p><strong>Troubleshooting the PNRP service</strong></p>
<p>If you run:</p>
<pre>&gt; netsh p2p pnrp cl sh st *</pre>
<p>and get:</p>
<pre>Scope  Id     Addr   State             Name
-----  -----  -----  ----------------  -----
    1      0      1  Virtual           Global_

Synchronize server:     pnrpv2.ipv6.microsoft.com;pnrpv21.ipv6.microsoft.com
Use Server:             Not used
Use SSDP:               Not used
Use Persisted cache:    Not used

Scope  Id     Addr   State             Name
-----  -----  -----  ----------------  -----
    3      4      1  Virtual           LinkLocal_{C3D2D7B6-FEF3-4CA2-9238-4EC716
142528}

Synchronize server:
Use Server:             Disabled
Use SSDP:               Not used
Use Persisted cache:    Not used</pre>
<p>then run</p>
<pre>&gt; netsh p2p pnrp cloud start Global_</pre>
<p id="Firewall"><strong>Opening ports in the firewall</strong></p>
<p>Manually opening ports (may not be needed).The above steps seem to set up PNRP outside the Windows Firewall (since they don&#8217;t show as exceptions). 3rd party products like Norton could be another story. The ports necessary to be open are TCP (2869) and UDP (1900).</p>
<p id="AllowingedgetraversalinthefirewallruleVistaonly"><strong>Allowing edge traversal in the firewall rule</strong></p>
<p>(Vista only) The first time you run a PNRP-enabled executable you should get a Windows Firewall warning. That&#8217;s all you need for XP, but this however is not sufficent if you&#8217;re on Vista! As per the <a class="ext-link" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2259451&amp;SiteID=1"><span class="icon">answer on this post</span></a>, then open up the Windows Firewall Advanced control panel, select the UDP rule that just got created, right-click to get the properties, and then under the Advanced tab, check &#8220;Allow edge traversal&#8221;. Then OK out and repeat for the TCP rule.</p>
<p>Fortunately <a class="ext-link" href="http://technet.microsoft.com/en-us/library/cc771920.aspx#bkmk_3"><span class="icon">this can be done via netsh</span></a> and <a class="ext-link" href="http://www.codeproject.com/KB/vista-security/VistaFirewallNet.aspx"><span class="icon">programmatically</span></a> as well.</p>
<p id="EnablingIpv6Ping"><strong>Enabling Ipv6 Ping</strong></p>
<p>See <a class="ext-link" href="http://blogs.msdn.com/p2p/archive/2007/07/03/ping.aspx"><span class="icon">this MSDN post</span></a> &#8211; looks like the magic command (on Vista anyway) is</p>
<pre>netsh advfirewall firewall add rule name="ICMPv6 Inbound" dir=in action=allow enable=yes \
   profile=any localip=any remoteip=any protocol=icmpv6:128,any interfacetype=any edge=yes</pre>
<p id="Troubleshooting"><strong>Troubleshooting WCF and netsh</strong></p>
<p>This <a class="ext-link" href="http://blogs.msdn.com/peerchan/archive/2006/10/01/Tip_3A00_-PeerChannel-diagnostics-using-WCF-Tracing_2F00_Message-Logging.aspx"><span class="icon">blog posting</span></a> has a technique for piping WCF debug output to a file. Immensely helpful. The file can be viewed by the ServiceTraceViewer, a tool located in &#8220;C:\Program Files\Microsoft SDKs\Windows\v6.1\bin\&#8221;</p>
<p>Also here is the TechNet page for the <a class="ext-link" href="http://technet.microsoft.com/en-us/library/cc772249.aspx"><span class="icon">netsh command syntax</span></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.echothis.com/2009/01/28/developing-with-the-windows-peer-to-peer-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

