Archive for the ‘Software’ Category

Searching MSDN Using Google

Friday, November 13th, 2009

I sometimes find it useful to search MSDN directly using Google, so I wrote a search plugin using OpenSearch to make this easier. Firefox should discover the search plugin automatically – it should appear in the search drop down at the top right. Otherwise, you can just install the plugin directly. For more details, see Creating OpenSearch plugins for Firefox.

Using Merged ResourceDictionaries in Silverlight Themes

Wednesday, July 29th, 2009

Silverlight 3.0 moved its featureset closer to that of WPF by adding support for merged Resource Dictionaries and Style Inheritance. Without these features, developing custom templates and styles for Silverlight controls can become a bit of a copy-and-paste nightmare. Since I have used the implicit theming feature built into the Silverlight Toolkit to make my Silverlight controls fit into the overall look and feel of this site, I was hoping that these features would enable me to refactor my themes developed for Silverlight 2.0 to be a bit less unwieldy.

(more…)

Implementation of the Reaction Diffusion Simulation

Thursday, April 2nd, 2009

blood.png Update – This post was written before the release of Silverlight 3.0b, which provides a number of enhancements relevant to this implementation, such as a WriteableBitmap and Pixel Shaders

Rendering

The first obstacle to implementing the RD simulation is that Silverlight 2.0 does not by default provide a means of generating dynamic images. WPF has a WriteableBitmap, but no equivalent exists in Silverlight. However, it does support PNG streams so we can dynamically update a bitmap by encoding it to PNG on the fly. For this I have used Joe Stegman’s PNGEncoder class, which I have modified slightly to deal with RGB data and to reduce memory usage.
(more…)

Reaction-Diffusion Models

Monday, March 23rd, 2009

maze.png

One of Alan Turing’s many contributions to mathematics and science during the 20th century was his 1952 paper on “The Chemical Basis of Morphogenesis” in which he suggested that a simple model of coupled differential equations could account for pattern formation in natural processes such as those found on animal coats. Such models are known as Reaction-Diffusion models, and take the following general form

\frac{\partial}{\partial t}\mathbf{q}=\mathbf{D}\nabla^2\mathbf{q}+\mathbf{R}(\mathbf{q})

(more…)