<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Jim Galasyn's Learning Curve</title><subtitle type="html">Adventures with Windows Presentation Foundation (WPF), formerly known as Avalon.</subtitle><id>http://blogs.msdn.com/jgalasyn/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/jgalasyn/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2008-10-16T16:34:22Z</updated><entry><title>WPF and Bling</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/10/27/wpf-and-bling.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/10/27/wpf-and-bling.aspx</id><published>2009-10-28T01:00:43Z</published><updated>2009-10-28T01:00:43Z</updated><content type="html">&lt;p&gt;Here is one of the coolest applications of WPF ever: &lt;a href="http://bling.codeplex.com/"&gt;Bling&lt;/a&gt;. It’s a completely new way to leverage the WPF platform for high-performance graphics development. Bling experiments with a programming model that combines the ease of programming provided by a retained graphics model with the flexibility and performance provided by custom pixel and vertex shaders. Shaders are expressed in pure C# code rather than HLSL code. At run-time, the C#-encoded shaders are dynamically translated into HLSL code that is then compiled into DirectX 10 shaders. You get the speed of shaders running on the GPU without the HLSL goo, hooray!&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/AndnowforsomethingWPFthatscompletelydiff_F553/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Glass shader effect from Bling example project." border="0" alt="Glass shader effect from Bling example project." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/AndnowforsomethingWPFthatscompletelydiff_F553/image_thumb.png" width="663" height="499" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Glass shader effect in Bling. It runs really fast.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;To give you an idea of what pixel shader code looks like in Bling, here’s a simple lens effect:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 61.53%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; height: 350px; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;// A lens pixel effect.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;At = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ButtonBl( canvas )&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    LeftTop = At,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    Content = &lt;span style="color: #006080"&gt;&amp;quot;Lens&amp;quot;&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    Click = () =&amp;gt; UseImage.Effect.Custom = ( input, uv ) =&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        slider.Visibility = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        slider.LabelName = &lt;span style="color: #006080"&gt;&amp;quot;light&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        PointBl v = ( ( uv * UseImage.Size ) - ( thumbA - UseImage.LeftTop ) );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        DoubleBl l = ( v.Length / 100 );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        l = ( l &amp;lt;= 1 ).Condition( l.Pow( 1d + slider.Value ), l );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        var n = v.Normalize;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        var clr = input[uv + ( l * n * .1 )];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        var clrB = input[uv - ( l * n * .1 )];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        var antiAlias = 1d - ( ( l - 1 ) / .01 ).Saturate;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; ( l &amp;lt;= 1 ).Condition( l.Lerp( clr, Colors.LightGray ), antiAlias.Lerp( input[uv], Colors.LightGray ) );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}.RightTop;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p align="left"&gt;Here’s what the shader looks like:&lt;/p&gt;

&lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/AndnowforsomethingWPFthatscompletelydiff_F553/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Lens pixel shader from Bling example project." border="0" alt="Lens pixel shader from Bling example project." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/AndnowforsomethingWPFthatscompletelydiff_F553/image_thumb_1.png" width="665" height="499" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p align="center"&gt;&lt;font size="1"&gt;Lens pixel shader in Bling.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;In addition, the UI is expressed by sophisticated declarative constraints that maintain dynamic relationships in the UI without event handling. But that’s a topic for another post. Just go download &lt;a href="http://bling.codeplex.com/"&gt;Bling&lt;/a&gt;.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7eadf0ac-b07a-4730-a6e3-c3b7c2aa9a5c" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;,&lt;a href="http://technorati.com/tags/pixel+shader" rel="tag"&gt;pixel shader&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.NET+Framework" rel="tag"&gt;.NET Framework&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9913828" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF/default.aspx" /><category term=".NET Framework" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/.NET+Framework/default.aspx" /><category term="pixel shader" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/pixel+shader/default.aspx" /></entry><entry><title>WPF samples now available at Code Gallery</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/10/23/wpf-samples-now-available-at-code-gallery.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/10/23/wpf-samples-now-available-at-code-gallery.aspx</id><published>2009-10-23T20:43:59Z</published><updated>2009-10-23T20:43:59Z</updated><content type="html">&lt;p&gt;In past versions of our Visual Studio and .NET Framework documentation, you may have experienced frustration when you tried to access our WPF sample code. &lt;/p&gt;  &lt;p&gt;No more. We’ve picked the best samples, hoisted them out of the docs, updated them for Visual Studio 2010, and uploaded them to Code Gallery: &lt;a href="http://code.msdn.microsoft.com/wpfsamples/"&gt;WPF Documentation Samples&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You’ll see example code for creating custom controls, 3D graphics, data binding, and lots of other stuff. Almost all samples have Visual Basic parity with C#. Go install &lt;a href="http://www.microsoft.com/visualstudio/en-us/try/default.mspx#download"&gt;Visual Studio Beta 2&lt;/a&gt; and then &lt;a href="http://code.msdn.microsoft.com/wpfsamples/"&gt;check them out&lt;/a&gt;.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFsamplesnowavailableatCodeGallery_BBE1/BrushesIntroduction.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Brushes Introduction screenshot" border="0" alt="Brushes Introduction screenshot" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFsamplesnowavailableatCodeGallery_BBE1/BrushesIntroduction_thumb.png" width="640" height="360" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Screenshot from the &lt;/font&gt;&lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=wpfsamples&amp;amp;DownloadId=7736"&gt;&lt;font size="1"&gt;Brushes&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt; sample&lt;/font&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:40dcf1a4-36d8-4951-ab31-f3a2878d9a7e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET+Framework" rel="tag"&gt;.NET Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Visual+Studio" rel="tag"&gt;Visual Studio&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9912228" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF/default.aspx" /><category term="Visual Studio" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Visual+Studio/default.aspx" /><category term=".NET Framework" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/.NET+Framework/default.aspx" /></entry><entry><title>Fun with brainwaves, part 2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/10/18/fun-with-brainwaves-part-2.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/10/18/fun-with-brainwaves-part-2.aspx</id><published>2009-10-18T21:11:35Z</published><updated>2009-10-18T21:11:35Z</updated><content type="html">&lt;p&gt;As I promised in &lt;a href="http://blogs.msdn.com/jgalasyn/archive/2009/09/28/fun-with-brainwaves-part-1.aspx"&gt;Fun with brainwaves, part 1&lt;/a&gt;, I’ve written a little WPF application that displays realtime data from &lt;a href="http://www.emotiv.com/"&gt;Emotiv’s&lt;/a&gt; Epoc neuroheadset. It’s a very simple monitoring app, named WPFEmotivClient, that displays the data stream from either EmoComposer or Emotiv Control Panel. The idea is to demonstrate that WPF can consume and display Epoc data easily, and this enables many high-performance visualization scenarios. &lt;/p&gt;  &lt;p&gt;Code is posted at Code Gallery: &lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=jgalasyn&amp;amp;ReleaseId=3350"&gt;WPF and realtime neural data&lt;/a&gt;.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart2_C793/WPFEmotivClient_blink_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="WPFEmotivClient and Emotiv Control Panel applications displaying realtime Epoc neuroheadset data." border="0" alt="WPFEmotivClient and Emotiv Control Panel applications displaying realtime Epoc neuroheadset data." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart2_C793/WPFEmotivClient_blink_thumb.jpg" width="1024" height="515" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;WPFEmotivClient (left) and Emotiv Control Panel (right) displaying realtime data form the Epoc neuroheadset. The expression corresponds to Blink, Furrow, and Clench. &lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart2_C793/WPFEmotivClient_smile_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="WPFEmotivClient and Emotiv Control Panel applications displaying realtime Epoc neuroheadset data." border="0" alt="WPFEmotivClient and Emotiv Control Panel applications displaying realtime Epoc neuroheadset data." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart2_C793/WPFEmotivClient_smile_thumb.jpg" width="1024" height="510" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;WPFEmotivClient (left) and Emotiv Control Panel (right) displaying realtime data form the Epoc neuroheadset.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:40b1ffcc-b66c-48f7-a0fa-b1c9bb91456c" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/EEG" rel="tag"&gt;EEG&lt;/a&gt;,&lt;a href="http://technorati.com/tags/brainwave" rel="tag"&gt;brainwave&lt;/a&gt;,&lt;a href="http://technorati.com/tags/chaos" rel="tag"&gt;chaos&lt;/a&gt;,&lt;a href="http://technorati.com/tags/nonlinear+dynamics" rel="tag"&gt;nonlinear dynamics&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9908823" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF/default.aspx" /><category term="Chaos" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Chaos/default.aspx" /><category term="nonlinear dynamics" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/nonlinear+dynamics/default.aspx" /><category term="brainwave" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/brainwave/default.aspx" /><category term="EEG" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/EEG/default.aspx" /></entry><entry><title>Fun with brainwaves, part 1</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/09/28/fun-with-brainwaves-part-1.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/09/28/fun-with-brainwaves-part-1.aspx</id><published>2009-09-29T02:09:54Z</published><updated>2009-09-29T02:09:54Z</updated><content type="html">&lt;p&gt;For years, I’ve been interested in human brainwaves, especially the possibility of using nonlinear dynamics (“chaos theory”) to analyze them. But affordable EEG devices simply have not been available. Back in the early 90s, I built a little device from a kit, but the data had only 6-bit resolution, and there were issues with signal-to-noise ratio, so I didn’t make any progress.&lt;/p&gt;  &lt;p&gt;But now, we have &lt;a href="http://www.emotiv.com/"&gt;Emotiv&lt;/a&gt;, a company that intends to bring high-resolution brainwave data to the desktop. Their first consumer-grade neuroheadsets rolled off the assembly line and shipped last week, and I was fortunate enough to receive mine on Tuesday. So here’s a little tour of what we know so far.&lt;/p&gt;  &lt;p&gt;The device arrived from the Philippines in a compact box. Shipping had been delayed by &lt;a href="http://en.wikipedia.org/wiki/Typhoon_Morakot_%282009%29"&gt;Typhoon Morakot&lt;/a&gt;, the deadliest typhoon to hit Taiwan in recorded history.&lt;/p&gt;  &lt;p&gt;Here’s how it shipped:&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/IMAG0356%5B1%5D_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Packaging for Epoc neuroheadset." border="0" alt="Packaging for Epoc neuroheadset." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/IMAG0356%5B1%5D_thumb.jpg" width="1024" height="768" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Packaging for Emotiv’s Epoc neuroheadset.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Here’s a shot with the cat, for scale:&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/IMAG0353_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Packaging for Epoc neuroheadset, with Lord Azrael." border="0" alt="Packaging for Epoc neuroheadset, with Lord Azrael." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/IMAG0353_thumb.jpg" width="1024" height="768" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;The neuroheadset packaging, with Lord Azrael for scale. We didn’t name him.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;The Epoc device peeks out of its packaging. Very &lt;em&gt;Videodrome&lt;/em&gt;:&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/Epoc%20neuroheadset%20in%20packaging_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Epoc neuroheadset in packaging." border="0" alt="Epoc neuroheadset in packaging." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/Epoc%20neuroheadset%20in%20packaging_thumb.jpg" width="576" height="768" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Epoc neuroheadset peeks out of its packaging.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Here it is, fully revealed:&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/IMAG0360_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Epoc neuroheadset in packaging." border="0" alt="Epoc neuroheadset in packaging." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/IMAG0360_thumb.jpg" width="1024" height="768" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Epoc neuroheadset, one of the first off the assembly line.&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;And now for a gratuitous montage of movies that inspired me to go down this path.&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table border="0" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top"&gt;           &lt;h3&gt;&lt;a href="http://rawdrugraps.com/blog/2009/08/ill-throw-a-tv-at-you/"&gt;&lt;/a&gt;&lt;/h3&gt;            &lt;p&gt;&lt;img title="videodrome" alt="videodrome" src="http://rawdrugraps.com/blog/wp-content/uploads/2009/08/videodrome.png" width="625" height="336" /&gt;&lt;/p&gt;            &lt;p align="center"&gt;&lt;font size="1"&gt;James Woods gets up close and personal with the Videodrome signal.&lt;/font&gt; &lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top"&gt;&lt;img alt="http://bluemoviereviews.files.wordpress.com/2009/06/strange-days.jpg" src="http://bluemoviereviews.files.wordpress.com/2009/06/strange-days.jpg" /&gt;             &lt;br /&gt;&lt;font size="1"&gt;Ralph Fiennes deals in illegal virtual experiences. Okay, I couldn’t find a shot of the cool headset.&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top"&gt;           &lt;p align="center"&gt;&lt;img alt="http://www.sofacinema.co.uk/guardian/images/products/8/39328-large.jpg" src="http://www.sofacinema.co.uk/guardian/images/products/8/39328-large.jpg" /&gt;               &lt;br /&gt;&lt;/p&gt;            &lt;p align="center"&gt;&lt;font size="1"&gt;Christopher Walken records human experiences, featuring the famous “orgasm loop.”&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top"&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/Mind%20Snatchers_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Mind Snatchers" border="0" alt="Mind Snatchers" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/Mind%20Snatchers_thumb.jpg" width="281" height="397" /&gt;&lt;/a&gt;             &lt;br /&gt;            &lt;p align="center"&gt;&lt;font size="1"&gt;A younger Christopher Walken gets a dose of early-70s mind-control technology.&lt;/font&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;It took some figuring out, but we finally got the neuroheadset on the the right way. Okay, it was my wife who said we had it on backward. YOU WERE RIGHT, HONEY&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/headset2_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Jim Galasyn wears the neuroheadset for the first time. Photo: Isobel Alexander" border="0" alt="Jim Galasyn wears the neuroheadset for the first time. Photo: Isobel Alexander" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Funwithbrainwavespart1_8E7D/headset2_thumb.jpg" width="1029" height="683" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;My friend Scott applies the saline solution to the electrodes. Liberally.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;In Part 2: A &lt;a href="http://blogs.msdn.com/jgalasyn/archive/2009/10/18/fun-with-brainwaves-part-2.aspx"&gt;WPF client&lt;/a&gt; for realtime Epoc headset data!&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0803b7c8-a349-4253-b530-1668e0aacd0a" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/EEG" rel="tag"&gt;EEG&lt;/a&gt;,&lt;a href="http://technorati.com/tags/brainwave" rel="tag"&gt;brainwave&lt;/a&gt;,&lt;a href="http://technorati.com/tags/chaos" rel="tag"&gt;chaos&lt;/a&gt;,&lt;a href="http://technorati.com/tags/nonlinear+dynamics" rel="tag"&gt;nonlinear dynamics&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9900540" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="Chaos" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Chaos/default.aspx" /><category term="nonlinear dynamics" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/nonlinear+dynamics/default.aspx" /><category term="brainwave" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/brainwave/default.aspx" /><category term="EEG" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/EEG/default.aspx" /></entry><entry><title>WPF Designer sample code is posted</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/09/17/wpf-designer-sample-code-is-posted.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/09/17/wpf-designer-sample-code-is-posted.aspx</id><published>2009-09-17T19:30:31Z</published><updated>2009-09-17T19:30:31Z</updated><content type="html">&lt;p&gt;If you want to author custom design-time experiences for your WPF controls, this is a good place to start. &lt;/p&gt;  &lt;p&gt;We have samples for custom adorners, context menus, property value editors, and advanced scenarios. This code is written for Visual Studio 2010 Beta 2, but you should have luck with the Beta 1 bits. A Silverlight example is in preparation but isn’t posted yet.&lt;/p&gt;  &lt;p&gt;Check out the code here: &lt;a href="http://code.msdn.microsoft.com/DesignerExtensbility"&gt;WPF and Silverlight Designer Extensibility Samples&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Property Editors&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3133"&gt;Custom Dialog Property Value Editor&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Dialog%20property%20value%20editor%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Dialog property value editor detail" alt="Dialog property value editor detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Dialog%20property%20value%20editor%20detail_thumb.jpg" width="284" height="388" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom dialog property editor that launches a dialog to set a FileName property&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3139"&gt;Custom Inline Value Editor&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Inline%20property%20value%20editor%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Inline property value editor detail" alt="Inline property value editor detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Inline%20property%20value%20editor%20detail_thumb.jpg" width="286" height="391" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;/p&gt;  &lt;p align="center"&gt;Custom inline property value editor&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3134"&gt;Custom Extended Property Value Editor&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Extended%20property%20value%20editor%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Extended property value editor detail" alt="Extended property value editor detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Extended%20property%20value%20editor%20detail_thumb.jpg" width="290" height="415" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom extended property value editor&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Adorners&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3126"&gt;Custom Autosize Adorner&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Autosize%20adorner%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Autosize adorner detail" alt="Autosize adorner detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Autosize%20adorner%20detail_thumb.jpg" width="356" height="310" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom adorner that sets the Autosize property&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3137"&gt;Custom Rail Adorner&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Opacity%20slider%20adorner%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Opacity slider adorner detail" alt="Opacity slider adorner detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Opacity%20slider%20adorner%20detail_thumb.jpg" width="347" height="344" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom rail adorner that adjusts the opacity of a control&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3140"&gt;Custom Inner Rail Adorner&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Skew%20slider%20adorner%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Skew slider adorner detail" alt="Skew slider adorner detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Skew%20slider%20adorner%20detail_thumb.jpg" width="338" height="317" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom rail adorner that adjusts the RenderTransform of a control&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3136"&gt;In-place Editing&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/In-place%20editing%20detail_2.jpg"&gt;&lt;img style="display: inline" title="In-place editing detail" alt="In-place editing detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/In-place%20editing%20detail_thumb.jpg" width="334" height="336" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom adorner that enables in-place text editing&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Advanced&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3127"&gt;Custom Context Menu&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Context%20menu%20provider%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Context menu provider detail" alt="Context menu provider detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Context%20menu%20provider%20detail_thumb.jpg" width="462" height="420" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom context menu that sets the Background of a control&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3135"&gt;Custom Feature Connector&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Feature%20connector%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Feature connector detail" alt="Feature connector detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Feature%20connector%20detail_thumb.jpg" width="459" height="622" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Custom feature connector that displays the pending and activated designer features&lt;/p&gt;  &lt;p&gt;&lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=DesignerExtensbility&amp;amp;ReleaseId=3138"&gt;Custom Surrogate Policy&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Primary%20selection%20policy%20detail_2.jpg"&gt;&lt;img style="display: inline" title="Primary selection policy detail" alt="Primary selection policy detail" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFDesignersamplecodeisposted_AD7B/Primary%20selection%20policy%20detail_thumb.jpg" width="492" height="420" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;Surrogate policy that enables a custom primary selection policy&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:94183e42-4dde-4e63-b78b-3440bde9ae6d" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET+Framework" rel="tag"&gt;.NET Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF+Designer" rel="tag"&gt;WPF Designer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Visual+Studio" rel="tag"&gt;Visual Studio&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9896403" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF/default.aspx" /><category term="Visual Studio" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Visual+Studio/default.aspx" /><category term=".NET Framework" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/.NET+Framework/default.aspx" /><category term="WPF Designer" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF+Designer/default.aspx" /></entry><entry><title>TestApi v0.3 Posted</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/09/15/testapi-v0-3-posted.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/09/15/testapi-v0-3-posted.aspx</id><published>2009-09-15T20:50:57Z</published><updated>2009-09-15T20:50:57Z</updated><content type="html">&lt;p&gt;Ever wondered how to test your WPF, Windows Forms, .Net Framework, and Win32 applications programmatically? Of course you have. &lt;/p&gt;  &lt;p&gt;Now there’s the &lt;a href="http://testapi.codeplex.com"&gt;TestApi&lt;/a&gt;, a library of test and utility APIs that enables developers and testers to create automated tests for .NET and Win32 applications. TestApi provides a set of common test building blocks -- data-structures and algorithms -- in a simple, layered, componentized and documented stack. &lt;/p&gt;  &lt;p&gt;New in TestApi v0.3:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Managed code fault Injection API &lt;/li&gt;    &lt;li&gt;Combinatorial Variation Generation API &lt;/li&gt;    &lt;li&gt;New application control API (experimental) &lt;/li&gt;    &lt;li&gt;Visual verification additions &lt;/li&gt;    &lt;li&gt;Acceptance tests &lt;/li&gt;    &lt;li&gt;New namespace and binary naming &lt;/li&gt;    &lt;li&gt;New samples &lt;/li&gt;    &lt;li&gt;Updated documentation&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Get the TestApi here: &lt;a href="http://testapi.codeplex.com"&gt;http://testapi.codeplex.com&lt;/a&gt;.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/ivo_manolov/archive/2009/04/20/9557563.aspx"&gt;Visual Verification&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/ivo_manolov/archive/2009/04/20/9557563.aspx"&gt;&lt;img title="Master0-expected" border="0" alt="Master0-expected" src="http://blogs.msdn.com/blogfiles/ivo_manolov/WindowsLiveWriter/IntroductiontoTestApiPart3VisualVerifica_8E1B/Master0-expected_thumb.png" width="504" height="304" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Expected Client-Area Snapshot&lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/ivo_manolov/archive/2009/04/20/9557563.aspx"&gt;&lt;img title="Master0-actual" border="0" alt="Master0-actual" src="http://blogs.msdn.com/blogfiles/ivo_manolov/WindowsLiveWriter/IntroductiontoTestApiPart3VisualVerifica_8E1B/Master0-actual_thumb.png" width="504" height="304" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Actual Client-Area Snapshot&lt;/font&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/ivo_manolov/archive/2009/04/20/9557563.aspx"&gt;&lt;img title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/ivo_manolov/WindowsLiveWriter/IntroductiontoTestApiPart3VisualVerifica_8E1B/image_thumb.png" width="504" height="304" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Difference Snapshot&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Get the TestApi here: &lt;a href="http://testapi.codeplex.com"&gt;http://testapi.codeplex.com&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1f59b131-e22b-42a1-9345-bfdbf5154e0e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET+Framework" rel="tag"&gt;.NET Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Windows+Forms" rel="tag"&gt;Windows Forms&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9895500" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF/default.aspx" /><category term="Windows Forms" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Windows+Forms/default.aspx" /><category term=".NET Framework" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/.NET+Framework/default.aspx" /></entry><entry><title>WPF and the Parallel Extensions, Updated</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/09/11/wpf-and-the-parallel-extensions-updated.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/09/11/wpf-and-the-parallel-extensions-updated.aspx</id><published>2009-09-11T21:01:11Z</published><updated>2009-09-11T21:01:11Z</updated><content type="html">&lt;p&gt;At the request of the Parallel .NET team, I’ve cleaned up the code from my earlier post, &lt;a href="http://blogs.msdn.com/jgalasyn/archive/2009/03/01/wpf-and-the-parallel-extensions.aspx"&gt;WPF and the Parallel Extensions&lt;/a&gt;. &lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensionsUpdated_9AF2/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensionsUpdated_9AF2/image_thumb.png" width="399" height="399" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Reaction-diffusion visualization&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;You can download the code from here: &lt;a href="http://code.msdn.microsoft.com/jgalasyn/Release/ProjectReleases.aspx?ReleaseId=3198"&gt;WPF and Parallel .NET&lt;/a&gt;. Have fun!&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1bdc0f7e-a57c-423b-b3cd-ac99f4cd5293" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET+Framework" rel="tag"&gt;.NET Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Parallel" rel="tag"&gt;Parallel&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Chaos" rel="tag"&gt;Chaos&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Fractal" rel="tag"&gt;Fractal&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9894309" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF/default.aspx" /><category term="Fractal" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Fractal/default.aspx" /><category term="Chaos" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Chaos/default.aspx" /><category term=".NET Framework" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/.NET+Framework/default.aspx" /><category term="Parallel" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Parallel/default.aspx" /></entry><entry><title>Sensors in my Pocket PC</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/06/29/sensors-in-my-pocket-pc.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/06/29/sensors-in-my-pocket-pc.aspx</id><published>2009-06-30T05:37:14Z</published><updated>2009-06-30T05:37:14Z</updated><content type="html">&lt;p&gt;I like to play around with the occasional new Microsoft technology, and since I recently traded my old Treo for an &lt;a href="http://www.htc.com/www/product/touchpro/overview.html"&gt;HTC Touch Pro&lt;/a&gt;, it seemed like it might be fun to check out the onboard accelerometers. &lt;/p&gt;  &lt;p&gt;Fortunately, courageous bloggers have probed the secrets of HTCSensorSDK.dll, culminating in the &lt;a href="http://sensorapi.codeplex.com/"&gt;.NET wrapper by Koush&lt;/a&gt;. This makes developing a mobile app that uses the device’s sensors a snap. &lt;/p&gt;  &lt;p&gt;My first thought was to see what the data stream from the sensors looks like, so I wrote a primitive real-time graphing app by using the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=06111a3a-a651-4745-88ef-3d48091a390b&amp;amp;displaylang=en"&gt;Windows Mobile 6 SDK&lt;/a&gt;. The WinMo SDK has nice integration with Visual Studio, so it’s painless to create a Smart Device project.&lt;/p&gt;  &lt;p&gt;Koush’s sample code is great, and it was easy to adapt it to draw waveforms. Here’s the app in the designer:&lt;/p&gt;  &lt;p align="center"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="The TiltData main form in the Visual Studio designer. " border="0" alt="The TiltData main form in the Visual Studio designer. " src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/SensorsonmyPocketPC_137C6/image_3.png" width="307" height="472" /&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;The TiltData main form in the Visual Studio designer. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;There are three panels, one for each component of the tilt vector. The tilt vector is the vector, in device space, that measures the alignment of the device relative to the gravity vector. When the device is held upright, the Y value is maximum (at around 9.8, units are m/sec/sec), and the X and Z values are zero.&lt;/p&gt;  &lt;p&gt;To produce some interesting signal, I taped my phone to the spokes of a bicycle wheel. Here are the traces that result from a good spin:&lt;/p&gt;  &lt;p align="center"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TiltData running on my HTC Touch Pro." border="0" alt="TiltData running on my HTC Touch Pro." src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/SensorsonmyPocketPC_137C6/tiltdata_3.png" width="312" height="411" /&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;TiltData running on my HTC Touch Pro.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;The X-Y plane of the phone is parallel to the radial plane of the wheel, which is vertical. Most of the signal shows up as oscillations in the X-Y plane, but some Z-axis wobble is detectable.&amp;#160; &lt;/p&gt;  &lt;p&gt;Code is &lt;a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=jgalasyn&amp;amp;ReleaseId=2903"&gt;here&lt;/a&gt;. You’ll need Visual Studio 2008 SP1, &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=06111a3a-a651-4745-88ef-3d48091a390b&amp;amp;displaylang=en"&gt;Windows Mobile 6 SDK&lt;/a&gt;, and &lt;a href="http://sensorapi.codeplex.com/"&gt;Koush’s Windows Mobile Unified Sensor API&lt;/a&gt;. Add Koush’s Sensors project to the TiltData Solution, compile, and deploy to your device. I don’t recommend swinging it around by the USB cable, by the way.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:36d66160-c72d-430d-bc2b-6c3133458d49" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Windows+Mobile" rel="tag"&gt;Windows Mobile&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Visual+Studio" rel="tag"&gt;Visual Studio&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Pocket+PC" rel="tag"&gt;Pocket PC&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Smart+Device" rel="tag"&gt;Smart Device&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809141" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="Visual Studio" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Visual+Studio/default.aspx" /><category term="Pocket PC" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Pocket+PC/default.aspx" /><category term="Windows Mobile" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Windows+Mobile/default.aspx" /><category term="Smart Device" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Smart+Device/default.aspx" /></entry><entry><title>Microsoft and Earth Week</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/04/23/microsoft-and-earth-week.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/04/23/microsoft-and-earth-week.aspx</id><published>2009-04-23T21:04:57Z</published><updated>2009-04-23T21:04:57Z</updated><content type="html">&lt;p&gt;&lt;img style="margin: 0px; display: inline" alt="CoverImage" align="right" src="http://i.technet.microsoft.com/cc165445.cover(en-us).gif" /&gt;I have to say I’ve been impressed with Microsoft’s recent efforts to green up. All the cafeterias have compostable dining ware now – it’s quite a blast to dump everything on my tray into a single receptacle labeled “Compost.” &lt;/p&gt;  &lt;p&gt;Now Microsoft is publicly announcing new technologies for managing power consumption.&lt;/p&gt;  &lt;p&gt;Check out &lt;a href="http://technet.microsoft.com/en-us/magazine/default.aspx"&gt;TechNet&lt;/a&gt; magazine’s &lt;a href="http://technet.microsoft.com/en-us/magazine/default.aspx"&gt;“Going Green” issue&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Also, Microsoft’s &lt;a href="http://www.microsoft.com/environment/default.aspx"&gt;Environment&lt;/a&gt; site has been updated for Earth Week. The revisions reflect the following content and technology updates:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/environment/windows7.aspx"&gt;Launch of Windows 7 Landing Page&lt;/a&gt;&amp;#160; &lt;ul&gt;       &lt;li&gt;Marks Release of the Windows 7 Power Management White Paper &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/environment/news/rss.xml"&gt;Launch of RSS Feed&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/environment/unified_communications.aspx"&gt;Launch of Unified Communications Landing Page&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/environment/telework.aspx"&gt;Launch of Flexible Work Landing Page&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.youtube.com/microsoftgreen"&gt;Launch of YouTube Channel (Beta)&lt;/a&gt;&amp;#160; &lt;/li&gt;    &lt;li&gt;Opening of Registration for Green IT Webcast Series on TechNet      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://bit.ly/46mEr%20"&gt;Improving Energy Efficiency with Windows 7&lt;/a&gt;&amp;#160; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://bit.ly/18hsgU"&gt;Green Cloud Computing with Microsoft Research&lt;/a&gt;&amp;#160; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://bit.ly/12CFzf%20"&gt;Data Center Energy Efficiency with Global Foundation Services&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Revision of Data Center Best Practices &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Steve Ballmer has committed Microsoft to reduce its corporate carbon footprint by 30% by 2012. I hope to see solar panels and green roofs on campus buildings by then! &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/environment/windows7.aspx"&gt;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" alt="Microsoft Dynamics" src="http://www.microsoft.com/environment/assets/images/Home_Page/0142_2009-04_001_ID010_246x140_windows7_F.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1e85abd3-230c-4eaf-bc4d-41365d61b7ad" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/green+power" rel="tag"&gt;green power&lt;/a&gt;,&lt;a href="http://technorati.com/tags/alternative+energy" rel="tag"&gt;alternative energy&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Microsoft" rel="tag"&gt;Microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/environment" rel="tag"&gt;environment&lt;/a&gt;,&lt;a href="http://technorati.com/tags/green+computing" rel="tag"&gt;green computing&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9565200" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="green power" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/green+power/default.aspx" /><category term="alternative energy" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/alternative+energy/default.aspx" /><category term="green computing" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/green+computing/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Microsoft/default.aspx" /><category term="environment" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/environment/default.aspx" /></entry><entry><title>Live streaming from MIX ‘09</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/03/18/live-streaming-from-mix-09.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/03/18/live-streaming-from-mix-09.aspx</id><published>2009-03-18T19:54:00Z</published><updated>2009-03-18T19:54:00Z</updated><content type="html">&lt;p&gt;Don’t miss the &lt;a href="http://live.visitmix.com/"&gt;live stream&lt;/a&gt; from MIX ‘09. Scott Guthrie is on right now. Lots of exciting new announcements coming today.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/LivestreamingfromMIX09_8B09/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="970" alt="image" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/LivestreamingfromMIX09_8B09/image_thumb.png" width="1121" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9487314" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author></entry><entry><title>WPF and the Parallel Extensions</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2009/03/01/wpf-and-the-parallel-extensions.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2009/03/01/wpf-and-the-parallel-extensions.aspx</id><published>2009-03-02T05:03:35Z</published><updated>2009-03-02T05:03:35Z</updated><content type="html">&lt;p&gt;It’s been over six months since the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=348F73FD-593D-4B3C-B055-694C50D2B0F3&amp;amp;displaylang=en"&gt;Parallel Extensions to .NET Framework 3.5, June 2008 CTP&lt;/a&gt; release, and I’ve been wanting to play around with that stuff for awhile. It’s all shipping in .NET Framework 4.0 and is considered by Soma to be a key cloud-enabling technology. So I finally jumped in and decided to “parallelize” the reaction-diffusion visualizer I discussed in &lt;a href="http://blogs.msdn.com/jgalasyn/archive/2008/04/17/using-writeablebitmap-to-display-a-procedural-texture.aspx"&gt;Using WriteableBitmap to Display a Procedural Texture&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Here’s a snapshot:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/image_10.png" width="398" height="399" /&gt; &lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;Reaction-diffusion visualizer&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;My first implementation used a single worker thread to compute each frame. Here’s how the single-thread implementation uses the CPU resources on my dual-core Inspiron laptop. Frame time averages about 127 ms. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/image_5.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/image_thumb_1.png" width="1054" height="687" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One processor is at nearly 100% usage, but the other is underutilized.&amp;#160; &lt;/p&gt;  &lt;p&gt;To parallelize my reaction-diffusion visualizer, I simply replace the outer &lt;font size="2" face="Lucida Console"&gt;&lt;strong&gt;for&lt;/strong&gt;&lt;/font&gt; loop with a &lt;strong&gt;Parallel.For&lt;/strong&gt; method call:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;            &lt;span class="rem"&gt;//for (int i = 1; i &amp;lt; vesselHeight - 1; i++)&lt;/span&gt;
            &lt;strong&gt;Parallel.For(1, vesselHeight - 1, i =&amp;gt;
&lt;/strong&gt;            {
                &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; j = 1; j &amp;lt; vesselWidth - 1; j++)
                {
                    c = -W1 / weight(2, i, j, reaction);
                    f = -W2 * weight(1, i, j, reaction);

                    e_to_c = Math.Exp(c);
                    e_to_f = Math.Exp(f);
                    d = 1.0 + K1 * e_to_c;
                    g0 = (K1 * K2 * e_to_c * e_to_f) / d;
                        
                    Xc = b * (g0 / (g0 + 1));
                    Xb = (K1 * e_to_c / (1 + K1 * e_to_c)) * (b - Xc);
                    Xa = b - Xb - Xc;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;                    // The out buffer is shared among processors/threads.&lt;/span&gt;
                    reactionOut[2, i, j] = Xc;
                    reactionOut[1, i, j] = Xb;
                    reactionOut[0, i, j] = Xa;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;                }; 
            }); &lt;/pre&gt;

&lt;p&gt;Of course, it can’t be quite this simple. Here’s the output after a few frames:&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/image_3.png" width="398" height="400" /&gt; &lt;/p&gt;

&lt;p align="center"&gt;&lt;font size="1"&gt;Reaction-diffusion visualizer with thread contention&lt;/font&gt; &lt;/p&gt;

&lt;p&gt;The problem, of course, is that access to the out buffer, &lt;font face="Lucida Console"&gt;reactionOut&lt;/font&gt;, is not synchronized &lt;strong&gt;(Not so! See UPDATE below)&lt;/strong&gt;. I can put the inner loop inside a &lt;font face="Lucida Console"&gt;lock&lt;/font&gt;, and this produces correct behavior again, but the frame rate is actually &lt;em&gt;slower&lt;/em&gt; than in the single-thread case. &lt;/p&gt;

&lt;p&gt;Fortunately, it’s easy to solve the problem without the performance penalty caused by lock overhead. I factored the inner loop code into a &lt;font face="Lucida Console"&gt;ComputeConcentrations&lt;/font&gt; method – I hadn’t done this before, because I didn’t want the method-call overhead.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;            &lt;span class="rem"&gt;//for (int i = 1; i &amp;lt; vesselHeight - 1; i++)&lt;/span&gt;
            Parallel.For(1, vesselHeight - 1, i =&amp;gt;
            {
                &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; j = 1; j &amp;lt; vesselWidth - 1; j++)
                {
                        Concentrations c = ComputeConcentrations(i, j, reaction);
                        reactionOut[2, i, j] = c._Xc;
                        reactionOut[1, i, j] = c._Xb;
                        reactionOut[0, i, j] = c._Xa;
                }; 
            }); &lt;/pre&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now the output is correct and both cores are fully engaged. Frame time averages about 83 ms, which is a 35% improvement.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/image_7.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/image_thumb_2.png" width="1054" height="687" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now I need to get my hands on a quad-core machine. &lt;/p&gt;

&lt;p&gt;UPDATE: Stephen Toub, lead PM for our concurrency development platform team, kindly reviewed my code and corrected my misconception about access to the out buffer. In fact, the problem is with closure; specifically, I had declared all my variables outside the outer loop. This meant that all threads were sharing those registers, which is almost never what you want. The colors were pretty, though.&lt;/p&gt;

&lt;p&gt;UPDATE 2: Here’s the same code running on my 3.6GHz quadcore. Average frame rate is 62ms, which is slightly over 50% faster than the 2GHz single-thread case.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/RD%20Performance_2.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="RD Performance" border="0" alt="RD Performance" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/WPFandtheParallelExtensions.NETFramework_DC33/RD%20Performance_thumb.png" width="1004" height="759" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;strong&gt;UPDATE 3&lt;/strong&gt;: The code is now posted on my Code Gallery page: &lt;a href="http://code.msdn.microsoft.com/jgalasyn/Release/ProjectReleases.aspx?ReleaseId=3198"&gt;WPF and Parallel .NET&lt;/a&gt;.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:aa11022a-9f7b-406f-b805-a5f1c59b1d7e" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET+Framework" rel="tag"&gt;.NET Framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/parallel" rel="tag"&gt;parallel&lt;/a&gt;,&lt;a href="http://technorati.com/tags/chaos" rel="tag"&gt;chaos&lt;/a&gt;,&lt;a href="http://technorati.com/tags/fractal" rel="tag"&gt;fractal&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9453382" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/WPF/default.aspx" /><category term="Fractal" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Fractal/default.aspx" /><category term="Chaos" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Chaos/default.aspx" /><category term=".NET Framework" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/.NET+Framework/default.aspx" /><category term="Parallel" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Parallel/default.aspx" /></entry><entry><title>A simple particle system</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2008/12/19/a-simple-particle-system.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2008/12/19/a-simple-particle-system.aspx</id><published>2008-12-19T21:21:31Z</published><updated>2008-12-19T21:21:31Z</updated><content type="html">&lt;p&gt;For no obvious reason, I had a sudden need to write a particle system that simulates a &lt;a href="http://en.wikipedia.org/wiki/Boltzmann_Distribution"&gt;Maxwell-Boltzmann&lt;/a&gt; gas, which forms the basis for the kinetic theory of gases. The trick is to implement momentum-conserving collisions as the particles bang into each other. When setting the initial conditions, the particles get uniformly random velocity vectors. The cool and somewhat counterintuitive result is that regardless of the initial conditions, the system equilibrates to the asymmetric Maxwell-Boltzmann distribution, shown in the histogram below. The histogram shows the cumulative number of particles binned by speed. The colors follow a heat map, with the fastest particle speeds rendered with the hottest colors.&lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Asimpleparticlesystem_91A7/Maxwell-Boltzmann%20gas%2001.png"&gt;&lt;img height="400" alt="Maxwell-Boltzmann gas" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Asimpleparticlesystem_91A7/Maxwell-Boltzmann%20gas%2001_thumb.png" width="640"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p align="center"&gt;&lt;font size="1"&gt;Colliding particles and histogram of speeds.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Here's what the particle speed distribution looks like for four different kinds of atoms. My particles are qualitatively most similar to Xenon atoms and therefore model heavier atoms (those with higher atomic number).&lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://en.wikipedia.org/wiki/Boltzmann_Distribution"&gt;&lt;img height="444" alt="Maxwell-Boltzmann noble gases" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/Asimpleparticlesystem_91A7/Maxwell-Boltzmann%20noble%20gases_1.png" width="640"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;font size="1"&gt;The speed probability density functions of the speeds of a few noble gases at a temperature of 298.15 K (25 °C). &lt;/font&gt;&lt;/p&gt; &lt;p&gt;Just something to entertain myself while we're snowed in.&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:790d1f15-351f-4d0e-b709-8d4bec971624" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Maxwell" rel="tag"&gt;Maxwell&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Boltzmann" rel="tag"&gt;Boltzmann&lt;/a&gt;,&lt;a href="http://technorati.com/tags/kinetic%20theory" rel="tag"&gt;kinetic theory&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9242595" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author><category term="Maxwell" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Maxwell/default.aspx" /><category term="Boltzmann" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/Boltzmann/default.aspx" /><category term="kinetic theory" scheme="http://blogs.msdn.com/jgalasyn/archive/tags/kinetic+theory/default.aspx" /></entry><entry><title>Silverlight designer extensibility</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2008/11/18/silverlight-designer-extensibility.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2008/11/18/silverlight-designer-extensibility.aspx</id><published>2008-11-18T23:38:13Z</published><updated>2008-11-18T23:38:13Z</updated><content type="html">&lt;p&gt;I haven't even &lt;em&gt;started&lt;/em&gt; writing the docs for SL designer extensibility, and here's Justin Angel with a great blog post that's worthy of the Visual Studio documentation. Maybe I can steal it without anybody noticing...&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.net/blogs/justinangel/archive/2008/11/17/silverlight-design-time-extensibility.aspx"&gt;Siverlight Design Time Extensibility&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://silverlight.net/blogs/justinangel/image_21991B25.png"&gt;&lt;img title="image" height="146" alt="image" src="http://silverlight.net/blogs/justinangel/image_thumb_0111DB73.png" width="281" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;font size="1"&gt;A custom editor running in Blend.&lt;/font&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f17e7153-deeb-4150-9af9-fec074a85e9b" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/designer" rel="tag"&gt;designer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/extensibility" rel="tag"&gt;extensibility&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Visual%20Studio" rel="tag"&gt;Visual Studio&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9120118" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author></entry><entry><title>WPF developers take note: WPF Designer Hotfix is posted</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2008/11/10/silverlight-developers-take-note-wpf-designer-hotfix-is-posted.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2008/11/10/silverlight-developers-take-note-wpf-designer-hotfix-is-posted.aspx</id><published>2008-11-10T23:24:37Z</published><updated>2008-11-10T23:24:37Z</updated><content type="html">&lt;p&gt;If you're writing WPF code, be sure to run the new Hotfix. &lt;/p&gt;  &lt;p&gt;Details at the &lt;a href="http://blogs.msdn.com/wpfsdk/archive/2008/11/10/wpf-designer-hotfix-is-posted.aspx"&gt;WPF SDK blog&lt;/a&gt;.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:19a5ce07-daef-4537-80f5-ab3ab3a15333" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/WPF%20Designer" rel="tag"&gt;WPF Designer&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight%20Toolkit" rel="tag"&gt;Silverlight Toolkit&lt;/a&gt;,&lt;a href="http://technorati.com/tags/XAML" rel="tag"&gt;XAML&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9058642" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author></entry><entry><title>Visualizing Climate Data in Phase Space, Part 2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/jgalasyn/archive/2008/10/16/visualizing-climate-data-in-phase-space-part-2.aspx" /><id>http://blogs.msdn.com/jgalasyn/archive/2008/10/16/visualizing-climate-data-in-phase-space-part-2.aspx</id><published>2008-10-17T02:34:22Z</published><updated>2008-10-17T02:34:22Z</updated><content type="html">&lt;p&gt;I promised in an &lt;a href="http://blogs.msdn.com/jgalasyn/archive/2008/08/01/visualizing-climate-data-in-phase-space.aspx"&gt;earlier post&lt;/a&gt; to implement a visualizer for Poincaré sections. This is a new feature for my phase-space visualizer, and it displays a cross-sectional view of a (usually) tangled phase-space trajectory. If you haven't read the &lt;a href="http://blogs.msdn.com/jgalasyn/archive/2008/08/01/visualizing-climate-data-in-phase-space.aspx"&gt;first post&lt;/a&gt;, you might want to, or the following discussion will make absolutely no sense. &lt;/p&gt; &lt;p&gt;A Poincaré section is a slice through phase space. It can reveal interesting structures, called &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Attractor"&gt;attractors&lt;/a&gt;&lt;/em&gt;, which constrain the orbits through phase space. The following diagram shows a Poincaré section with two different orbits: one is periodic and intersects a single point on the section repeatedly; the other is non-periodic and intersects at many different points. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="center"&gt;&lt;img title="A Poincar&amp;eacute; section, or map

[Credits : Encyclop&amp;aelig;dia Britannica, Inc.]" height="300" alt="A Poincar&amp;eacute; section, or map

[Credits : Encyclop&amp;aelig;dia Britannica, Inc.]" src="http://media-2.web.britannica.com/eb-media/88/26988-004-F5AB3E80.gif" width="593"&gt;&lt;/p&gt; &lt;p align="center"&gt;&lt;font size="1"&gt;A Poincaré section in phase space (&lt;/font&gt;&lt;a href="http://www.britannica.com/EBchecked/topic-art/22486/19638/A-Poincare-section-or-map-The-trajectory-or-orbit-of"&gt;&lt;font size="1"&gt;Encyclopedia Britannica&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;).&lt;/font&gt;&lt;/p&gt; &lt;p&gt;The periodic signal has a &lt;em&gt;fixed-point&lt;/em&gt; attractor. The non-periodic signal may have one of any number of attractors. If the signal is &lt;a href="http://en.wikipedia.org/wiki/Chaos_theory"&gt;chaotic&lt;/a&gt;, the attractor will appear as a &lt;a href="http://en.wikipedia.org/wiki/Fractal"&gt;fractal&lt;/a&gt; distribution on the Poincaré section. These are commonly called &lt;em&gt;strange&lt;/em&gt; attractors. If everything were to come together perfectly, I'd hope to see something like the following attractors in my insolation sections:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://www.ari.uni-heidelberg.de/mitarbeiter/ernst/movies.html"&gt;&lt;img height="453" src="http://www.ari.uni-heidelberg.de/mitarbeiter/ernst/hh1.jpg" width="640"&gt;&lt;/a&gt;&lt;a href="http://www.maia.ub.es/dsg/hidra/vcl1.html"&gt;&lt;img height="457" src="http://www.maia.ub.es/dsg/hidra/vcl1.gif" width="571"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;font size="1"&gt;Fractal ("strange") attractors revealed in Poincaré sections.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Keep in mind that "chaotic" does not mean random; it refers to random&lt;em&gt;like&lt;/em&gt; variations that are purely deterministic, but sensitive to initial conditions. Chaotic oscillations occur in systems with nonlinear feedbacks, and Earth's climate system definitely fits this description.&lt;/p&gt; &lt;p&gt;In Part 1, I embedded climate data in a three-dimensional phase space and looked for interesting patterns. There were tantalizing hints of structure, but no smoking gun. The data sets generated by Dr. Raymo were too short for much detail to be visible in a Poincaré section, so I needed to generate my own. &lt;/p&gt; &lt;p&gt;I especially wanted to look for attractors in the insolation signal. Insolation drives Earth'[s climate system, and understanding this input signal gives us a better chance of understanding the system's response to it. In particular, if we can show that the input signal is &lt;a href="http://en.wikipedia.org/wiki/Chaos_theory"&gt;chaotic&lt;/a&gt;, we can expect to find chaotic oscillations in the climate system's response.&lt;/p&gt; &lt;p&gt;The insolation signal is generated from a mathematical model of Earth's orbital dynamics. Dr. Raymo kindly pointed me to a handy Mac implementation named &lt;a href="http://www.ncdc.noaa.gov/paleo/softlib/softlib.html"&gt;AnalySeries&lt;/a&gt;, so I didn't have to reverse-engineer a FORTRAN implementation named &lt;a href="http://www.bdl.fr/Equipes/ASD/insola/earth/earth.html"&gt;Insola&lt;/a&gt;. To see any interesting patterns in a Poincaré section typically requires a very large data set, so I used AnalySeries to generate 100 million years of data. Data points occur at 1000-year intervals, so there are 100,000 data points. The 3D phase-space portrait with an embedding delay of 7 samples (7,000 years) looks like this:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="center"&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/NH%20insolation%20phase%20portrait%20100mybp%20delay%207.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="NH insolation phase portrait 100mybp delay 7" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/NH%20insolation%20phase%20portrait%20100mybp%20delay%207_thumb.png" width="476" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;font size="1"&gt;Phase space portrait of 100 million years of insolation data.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Not very helpful. But if we take a slice along the XY-plane, we may see more detail. The following images show the Poincaré sections for two phase-space portraits, with 6- and 7-sample embedding delays. Each orbit makes a dot when it crosses the plane. Downward-traveling crossings make an orange dot, and upward-traveling crossings make a yellow dot. There are 9063 crossings shown in each of the following Poincaré sections. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20100mybp%20delay%206.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="772" alt="poincare map 100mybp delay 6" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20100mybp%20delay%206_thumb.png" width="483" border="0"&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20100mybp%20delay%207.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="772" alt="poincare map 100mybp delay 7" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20100mybp%20delay%207_thumb.png" width="717" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;font size="1"&gt;Poincaré sections for delays of 6 samples (left) and 7 samples (right). &lt;/font&gt;&lt;/p&gt; &lt;p&gt;Here are the sections along the YZ-plane:&lt;/p&gt; &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20YZ%20100mybp%20delay%206.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="472" alt="poincare map YZ 100mybp delay 6" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20YZ%20100mybp%20delay%206_thumb.png" width="644" border="0"&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20YZ%20100mybp%20delay%207.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="poincare map YZ 100mybp delay 7" src="http://blogs.msdn.com/blogfiles/jgalasyn/WindowsLiveWriter/VisualizingClimateDatainPhaseSpacePart2_A0F7/poincare%20map%20YZ%20100mybp%20delay%207_thumb.png" width="505" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p align="center"&gt;&lt;font size="1"&gt;Poincaré sections along the YZ-plane for delays of 6 samples (left) and 7 samples (right).&lt;/font&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I find these sections to be highly suggestive of fractal structure, but there's nothing as clear as in the previous example plots. A fractal attractor might be more visible with a longer data set, but unfortunately AnalySeries generates only 100 million years of insolation data. &lt;/p&gt; &lt;p&gt;All is not lost, however. It's possible visualize the flow by rotating the Poincaré section around an axis and animating the intersection points as it moves. This isn't hard in principle, but it requires more coding. Because the data set is so large, realtime animation is out of the question, so I need to make a WMV out of successive snapshots. That's some more coding. I'll get back to you when I have something that works.&amp;nbsp; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9002535" width="1" height="1"&gt;</content><author><name>jgalasyn</name><uri>http://blogs.msdn.com/members/jgalasyn.aspx</uri></author></entry></feed>