<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Jan Schepens</title>
        <link>http://geekswithblogs.net/JanS/Default.aspx</link>
        <description>Software Developer</description>
        <language>nl-BE</language>
        <copyright>Jan Schepens</copyright>
        <managingEditor>jan.schepens@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Jan Schepens</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/JanS/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Moved my blog!</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/07/08/moved-my-blog.aspx</link>
            <description>&lt;p&gt;Just wanted to say that all the posts I made in here have been moved to a new url, namely &lt;a href="http://www.dotnetjack.com"&gt;http://www.dotnetjack.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This move will hopefully push myself to make more posts and do more crazy stuff to write about. Hopefully some of you out there will have a peek and again hopefully some of those will even come back or put it in their feed :)&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133333"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133333" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/133333.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/07/08/moved-my-blog.aspx</guid>
            <pubDate>Wed, 08 Jul 2009 05:56:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/133333.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/07/08/moved-my-blog.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/133333.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Beware of spacing in Windows7 hosts file</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/06/17/beware-of-spacing-in-windows7-hosts-file.aspx</link>
            <description>&lt;p&gt;The hosts file of Windows, by default located in %SystemRoot%\System32\drivers\etc, can be a bitch to edit, so it seems.&lt;/p&gt;  &lt;p&gt;I had an XP machine running just fine with the entries from my hosts file. I then made a Windows7 partition on the same machine, with the same entries in the hosts file. Didn’t work at all. It seemed as if the hosts file was completely ignored. So I did some searches on that and tried a lot of stuff. Even up to checking out the registry entry for the path, and the system variables, if they were set to correct values.&lt;/p&gt;  &lt;p&gt;However, nothing seemed to work. Until I saw some other example hosts files that were formatted as &amp;lt;ip address&amp;gt;&amp;lt;single space&amp;gt;&amp;lt;value&amp;gt;&lt;/p&gt;  &lt;p&gt;Notice the single space. In my own hosts file, all entries were nicely outlined by use of multiple spaces, to make it easier to read. So it seems now that in Windows7, unneeded whitespace is not thrown away anymore. Threw away the “markup whitespace” and everything worked in an instance.&lt;/p&gt;  &lt;p&gt;I don’t have any clue on how many people use the hosts file intensively, but it might not be such a bad thing for the folks in Redmond to have a look at that.&lt;/p&gt;  &lt;p&gt;Word to the wise: beware of spacing :)&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132874"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132874" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/132874.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/06/17/beware-of-spacing-in-windows7-hosts-file.aspx</guid>
            <pubDate>Wed, 17 Jun 2009 10:39:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/132874.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/06/17/beware-of-spacing-in-windows7-hosts-file.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/132874.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Dude, I found my Fixedsys!</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/06/16/dude-i-found-my-fixedsys.aspx</link>
            <description>&lt;p&gt;Allright, so my last short post was about the fixedsys font not being available in the RC version of Windows 7. However, it’s there, but it seems to be depending on your language settings. &lt;/p&gt;  &lt;p&gt;Now, being the proud little Belgian that I am, I have my language set to Belgain period. Not a good thing it seems, when you are a big fan of Fixedsys. But it can be solved :)&lt;/p&gt;  &lt;p&gt;So basically what you need to do is go to the installed fonts window, you can see the Fixedsys font is already installed, but hidden for certain languages. That’s why you need to go to the font settings window and uncheck the hide checkbox:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/DudeIfoundmyFixedsys_DA60/image_2.png" rel="lightbox"&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://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/DudeIfoundmyFixedsys_DA60/image_thumb.png" width="443" height="388" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/DudeIfoundmyFixedsys_DA60/image_4.png" rel="lightbox"&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://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/DudeIfoundmyFixedsys_DA60/image_thumb_1.png" width="448" height="392" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And all of a sudden the font is available in notepad again:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/DudeIfoundmyFixedsys_DA60/image_6.png" rel="lightbox"&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://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/DudeIfoundmyFixedsys_DA60/image_thumb_2.png" width="318" height="343" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Apparantly, Visual Studio does not take this little rule into account, that’s how I found out the font was actually installed. I was able to select the font from the Visual Studio   &lt;br /&gt;font selector. DAMN YOU WINDOWS :)&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132848"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132848" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/132848.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/06/16/dude-i-found-my-fixedsys.aspx</guid>
            <pubDate>Tue, 16 Jun 2009 13:31:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/132848.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/06/16/dude-i-found-my-fixedsys.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/132848.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Dude, where&amp;rsquo;s my fixedsys?</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/06/10/dude-wherersquos-my-fixedsys.aspx</link>
            <description>&lt;p&gt;It’s been only a few days now since Windows7 made it to the point of full-time OS on my toys, but as a huge fan of the good old FixedSys font I am shocked.&lt;/p&gt;  &lt;p&gt;WHERE is the fixedsys font in windows7? And don’t you dare tell me you threw it out!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132731"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132731" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/132731.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/06/10/dude-wherersquos-my-fixedsys.aspx</guid>
            <pubDate>Wed, 10 Jun 2009 07:37:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/132731.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/06/10/dude-wherersquos-my-fixedsys.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/132731.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Incorporate LINQ in your BizTalk projects</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/04/24/incorporate-linq-in-your-biztalk-projects.aspx</link>
            <description>&lt;p&gt;LINQ is something that has had my full attention ever since it was released. And I’ve been wanting to do something on this blog with LINQ, but never really found the inspiration to do something “special” with it. Up until now.&lt;/p&gt;  &lt;p&gt;So it occurred to me that there is not (to my knowledge) anything available that allows you to incorporate your LINQ way-of-work with BizTalk. And why not? There are purposes enough to use LINQ in a BizTalk environment, and it doesn’t even have to be rocket science to get there. On the contrary, using LINQ for BizTalk is about as easy as it can get really. And the means of use for this are limitless. Let’s go through some of the possibilities.&lt;/p&gt;  &lt;p&gt;NOTE: Throughout this article, you will see a few different ways of how we could incorporate LINQ in our day-to-day BizTalk development. Iin good practice, we will NOT try to re-invent hot water. Instead, we will gratefully use existing functionality through LINQ to objects, and LINQ to XML.&lt;/p&gt;  &lt;p&gt;A first example of LINQ usage in BizTalk is re-using BizTalk objects to provide a central BizTalk Administration Console. The advantages of this are obvious: we don’t have a need for a local Windows application to view our ports, locations, orchestrations and schemas. Instead, we can incorporate all BizTalk hubs from an infrastructure into one administration site where we can query administration information, start and stop our ports, and so on. One way we can do this, is through LINQ. The following will show you how.&lt;/p&gt;  &lt;p&gt;When you install BizTalk Server, a number of assemblies are installed to the install location. By default, this is C:\Program Files\Microsoft BizTalk Server 2006. In this directory, there is one particular assembly that draws attention, namely Microsoft.BizTalk.ExplorerOM.dll. When we would take a look at this assembly through the Reflector tool (&lt;a href="http://www.red-gate.com/products/reflector/"&gt;http://www.red-gate.com/products/reflector/&lt;/a&gt;), we would typically see a definition like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image002_2.jpg"&gt;&lt;img title="clip_image002" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="398" alt="clip_image002" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image002_thumb.jpg" width="301" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The BtsCatalogExplorer object is the central part of this project, that is because of the following properties it holds:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image004_2.jpg"&gt;&lt;img title="clip_image004" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="287" alt="clip_image004" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image004_thumb.jpg" width="354" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And these are just a glimpse of the properties. In general, you can say that the BtsCatalogExplorer object “represents” one Administration Console, or one BizTalk Management instance. &lt;/p&gt;  &lt;p&gt;So what is the problem? We could just take those collections and fire up some LINQ queries on that, right?&lt;/p&gt;  &lt;p&gt;Well, unfortunately no. The collection objects in the BizTalk assembly are all implementing the IEnumerable and ICollection interface. No surprises, but unfortunately, also no LINQ available with extension methods. Yet this really is the key to where we want to go to, and the solution is as easy as a HelloWorld solution. We simply have to create our own object that contains a BtsCx atalogExplorer object, and cast the collection properties to generic list objects that implement IEnumerable&amp;lt;T&amp;gt;, which we need when we want to use LINQ methods in LINQ to object. When we take the SendPort collection as an example, basically what we need to do is this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image006_2.jpg"&gt;&lt;img title="clip_image006" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="66" alt="clip_image006" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image006_thumb.jpg" width="486" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;What we do here, is take the BtsCatalogExplorer object, and instantiate it through btsex. In order, we then cast the SendPortCollection to an IEnumerable&amp;lt;SendPort&amp;gt; through the OfType&amp;lt;T&amp;gt; method, which we then convert to a List&amp;lt;SendPort&amp;gt; through the ToList&amp;lt;T&amp;gt; method. The result is a generic List object of SendPort object, that implements IEnumerable&amp;lt;T&amp;gt;. Now that we have this LINQable object, we can do something like the following in any client environment:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image008_2.jpg"&gt;&lt;img title="clip_image008" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="119" alt="clip_image008" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image008_thumb.jpg" width="479" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is a very basic, very simple example, but it shows how easy it is to introduce LINQ into the administration side of BizTalk. &lt;/p&gt;  &lt;p&gt;Now there also is a processing side to BizTalk. Wouldn’t it be great to incorporate LINQ to that side as well? Now you can. The following example will demonstrate a simple tool to promote properties through LINQ, and I call it the LINQPromotor Pipeline Component. For this example, I will show the results first, and then the method used. &lt;/p&gt;  &lt;p&gt;So let’s start off by summarizing the requirements. For this demo it is sufficient that we use one component per property we want to use. So the component needs to take in a property name to promote, a namespace, and a LINQ query to retrieve the value to promote. So typically, we want a configuration like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image010_2.jpg"&gt;&lt;img title="clip_image010" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="clip_image010" hspace="12" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image010_thumb.jpg" width="186" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image012_2.jpg"&gt;&lt;img title="clip_image012" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="185" alt="clip_image012" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image012_thumb.jpg" width="482" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;When we use this pipeline on an incoming message, we see the following when we query the message context:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image014_2.jpg"&gt;&lt;img title="clip_image014" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="148" alt="clip_image014" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image014_thumb.jpg" width="484" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note that there are some things marked with red to draw attention. First of all, in the pipeline configuration properties, you see the PropertyName and PropertyNamespace values configurable. These are values are shown in the context where you see Name = PromotedByLinq and Namespace = &lt;a href="http://schemas.linq.com/promotions/"&gt;http://schemas.linq.com/promotions/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;But the key here is the LINQ statement property. Instead of an XPath query that we would fill in to retrieve the value to promote, we actually write a LINQ statement to do that query. This makes the query easier to read and to configure.&lt;/p&gt;  &lt;p&gt;One way to do this is through runtime compilation. Take the linq query in as a string, add it to a method that takes in an XElement object, compile it at runtime, execute and promote the returned string. That summarizes the way of work in this example. Now we will take a closer look.&lt;/p&gt;  &lt;p&gt;First of all, the linq statement gets inserted in a stringbuilder that builds up a piece of code that contains one method with one parameter of type XElement, and that returns a string as the value:&lt;/p&gt;  &lt;p&gt;public string GetVal(XElement element){}.&lt;/p&gt;  &lt;p&gt;We then compile that piece of code using the CSharpCodeProvice object, that is located in the Microsoft.CSharp namespace.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image016_2.jpg"&gt;&lt;img title="clip_image016" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="58" alt="clip_image016" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image016_thumb.jpg" width="500" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note that in order to use LINQ, you need to specify the CompilerVersion to v3.5. MSDN documentation will specify a version “3.5”, but “v3.5” is what you want to use.&lt;/p&gt;  &lt;p&gt;The code is compiled in memory, so we can just return an assembly ob ject, create an instance of the class we generated, and invoke the method:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image018_2.jpg"&gt;&lt;img title="clip_image018" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="127" alt="clip_image018" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/IncorporateLINQinyourBizTalkprojects_A1D4/clip_image018_thumb.jpg" width="495" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The string that is returned contains the value that we can simply promote in our IBaseMessage object through outMessage.Context.Promote(PropertyName, PropertyNamespace, value);&lt;/p&gt;  &lt;p&gt;And the results speak for themselves.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131424"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131424" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/131424.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/04/24/incorporate-linq-in-your-biztalk-projects.aspx</guid>
            <pubDate>Fri, 24 Apr 2009 13:58:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/131424.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/04/24/incorporate-linq-in-your-biztalk-projects.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/131424.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Terminating BizTalk instances: WMI vs Operations</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/04/17/terminating-biztalk-instances-wmi-vs-operations.aspx</link>
            <description>&lt;p&gt;The Administration console that is delivered with the installation of BizTalk allows a user to query suspended service instances and resume or terminate them accordingly. However, when you want to go “outside the box”, and I often do :) you might want to consider finding out possibilities of doing those actions yourself, for instance from a web based managing platform. (note: the following methods work for both BTS2006 and 2009)&lt;/p&gt;  &lt;p&gt;When you install BizTalk, there is a WMI provider installed on your machine as well, located in the root/MicrosoftBizTalkServer namespace. That namespace actually provides just about every functionality you need for administration purposes. But in this case, I typically want to focus on the MSBTS_ServiceInstance class. (this is a snapshot taken from server explorer in VS2008)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="169" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_thumb.png" width="243" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you right click the class and generate an instance, your current project will get an extra class called ROOT.MicrosoftBizTalkServer.MSBTS_ServiceInstance.cs. When you take a look at that class, you will see the three methods that I’m interested in at this moment: Suspend, Resume, and Terminate. Let’s focus on the Terminate example for this case.&lt;/p&gt;  &lt;p&gt;If you want to terminate a service instance through WMI (and there are examples of that over the entire web, so let’s NOT get into that deeply), you can simply use the generated class and say something like:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_6.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="33" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_thumb_2.png" width="709" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When you provide the InstanceID of your service instance, together with the name and server of the BizTalk Management Database of the BizTalk environment you are working on, the generated class will construct the WMI query for you and execute behind the scenes. So what you need to keep in mind with this method is that you need to go through the entire WMI architecture before actually taking an action.&lt;/p&gt;  &lt;p&gt;To me, it sounds easier if I could do the same action in a more direct approach to BizTalk. And lucky for both me as the people who read this (at least I hope people read this :)) we can do that!&lt;/p&gt;  &lt;p&gt;When you go to the root install directory of BizTalk (typically that’s C:\Program Files\Microsoft BizTalk Server) you will notice an assembly called Microsoft.BizTalk.Operations.dll, which in this case you can compare to a holy grail :) Let’s take a quick peek at the assembly with Reflector:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_8.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="383" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_thumb_3.png" width="468" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Of course now every still-awake reader notices the same methods I previously stated. And using these methods are of the same ease as the WMI methods. It goes as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_10.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="54" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/TerminatingBizTalkinstancesWMIvsOperatio_8693/image_thumb_4.png" width="607" border="0" /&gt;&lt;/a&gt;  &lt;/p&gt;  &lt;p&gt;Parameters stay the same. Create an instance of the BizTalkOperations class using the servername and database name of the BizTalk Management Database, and terminate your instance using the InstanceID of the Service Instance object.&lt;/p&gt;  &lt;p&gt;Not much difference at first sight, but the thing here really is that when using the BizTalk.Operations, you have a more direct database approach to your action, instead of going through the entire WMI system before actually doing something. Sounds like that could save some performance when you would terminate instances with 500 at a time.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131260"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=131260" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/131260.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/04/17/terminating-biztalk-instances-wmi-vs-operations.aspx</guid>
            <pubDate>Fri, 17 Apr 2009 15:08:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/131260.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/04/17/terminating-biztalk-instances-wmi-vs-operations.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/131260.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Persist message context when re-injecting a message in BizTalk</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/04/08/persist-message-context-when-re-injecting-a-message-in-biztalk.aspx</link>
            <description>&lt;p&gt;There are many cases in BizTalk environments when one want to re-inject a message into their system. I’m mainly referring to testing environments where it doesn’t really matter if a message is repeated. &lt;/p&gt;  &lt;p&gt;However, it can also be preferred to copy the context of the message into the newly injected message, because your system might want to do some processing of that context while re-injecting. When you do this from code, it’s a snap!&lt;/p&gt;  &lt;p&gt;First of all, we need to load up our message body and context:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Persistmessagecontextwhenreinjectingames_A248/image_2.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="71" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Persistmessagecontextwhenreinjectingames_A248/image_thumb.png" width="490" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Note that you need to specify the sql server name and database name of the BizTalk Tracking Database (commonly named BizTalkDTADb, but you can configure any database name). The System.GUID attribute should be replaced with the message id of the message you want to re-inject.&lt;/p&gt;  &lt;p&gt;Now that we have an IBaseMessage object, we can access the context and copy it to the context of a new out IBaseMessage object.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Persistmessagecontextwhenreinjectingames_A248/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="130" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Persistmessagecontextwhenreinjectingames_A248/image_thumb_1.png" width="487" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;This way we can keep a difference between promoted context properties and standard context properties. And that’s the only thing to it, msg_out is ready to be re-injected   &lt;br /&gt;to the BizTalk system &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130829"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130829" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/130829.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/04/08/persist-message-context-when-re-injecting-a-message-in-biztalk.aspx</guid>
            <pubDate>Wed, 08 Apr 2009 15:58:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/130829.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/04/08/persist-message-context-when-re-injecting-a-message-in-biztalk.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/130829.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Uppercase access levels in WiX</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/04/06/uppercase-access-levels-in-wix.aspx</link>
            <description>&lt;p&gt;My shortest blog post ever, but just so you know: if you don’t name your properties in WiX fully uppercased (eg INSTALLOCATION) WiX won’t recognize them as global properties. &lt;/p&gt;  &lt;p&gt;If I had known this from the beginning, it would have saved me about two days… *F-word*&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130776"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130776" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/130776.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/04/06/uppercase-access-levels-in-wix.aspx</guid>
            <pubDate>Mon, 06 Apr 2009 21:12:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/130776.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/04/06/uppercase-access-levels-in-wix.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/130776.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Mathematical nostalgy</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/03/05/mathematical-nostalgy.aspx</link>
            <description>&lt;p&gt;There is a time in every person’s life where one likes to recap about long lost projects. Little pieces of code that made you happy inside once it was completed. Well today, I had this moment.&lt;/p&gt;  &lt;p&gt;The project I’m talking about is something I came up with after a school lesson on fractals. I won’t be getting much into that, as I am assuming everyone knows what that is. But once that session was done, I grabbed my laptop and went to work. The fractal that originated from that piece of free time is something that made me proud up until today. &lt;/p&gt;  &lt;p&gt;Note: I completely made this fractal up from my imagination, if the same fractal already exists, and I’m sure it does, I don’t know about it but would like more info on it.&lt;/p&gt;  &lt;p&gt;So anyhow, I was browsing through some old folders on my external disk and discovered that I had deleted that entire project to make room for other stuff. Disappointment went through my entire body and mind. But that didn’t take too long, as I decided to re-write it. Here’s  how I did it:&lt;/p&gt;  &lt;p&gt;Basically, the top design of the fractal would be something like this&lt;/p&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Mathematicalnostalgy_AF35/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="280" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Mathematicalnostalgy_AF35/image_thumb.png" width="316" border="0" /&gt;&lt;/a&gt;   &lt;p&gt;&lt;/p&gt;  &lt;p&gt;A tree-like structure that keeps getting smaller in a repetitive pattern. The tricky part is of course always defining your endpoint. The start point is never a problem, because that’s the endpoint of the previous branch. But the endpoints… they make it a little hard on my head :)&lt;/p&gt;  &lt;p&gt;Now there are probably a lot more solutions available to this problem, but in my own case, I decided to go with good old trigonometry. Since the tree is built up using rectangular triangles, it’s pretty easy to come up with a formula that calculates the points needed.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Mathematicalnostalgy_AF35/image_4.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="301" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Mathematicalnostalgy_AF35/image_thumb_1.png" width="318" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;x2 = x1 + (cos(alfa) * branchlength)    &lt;br /&gt;y2 = y1 - (sin(alfa) * branchlength)&lt;/p&gt;  &lt;p&gt;Since I have a left part and a right part, I’m starting off with alfa = 135 and beta = 45. So I’m already done with the formula, on to the code translation!&lt;/p&gt;  &lt;p&gt;First of all, it’s fairly logical that I declared a brush, a pen, and a graphics object, in my case called b, p, and g. Nothing fancy there :)&lt;/p&gt;  &lt;p&gt;Next part is a littly cooler; in order to implement a configurable nesting level and draw everything with as little effort as possible, I chose to make a recursive method that takes a few parameters, namely a current X position, current Y position, current length, nesting level, an alfa angle and a beta angle, signatured as: private void DrawFrac(int xCur, int yCur, int lenCur, int nestCur, int alfa, int beta){}&lt;/p&gt;  &lt;p&gt;So now the rest of the implementation is pretty easy (afterwards :) I busted my head on it for a while because the mathematical part had been a while since I used it)&lt;/p&gt;  &lt;p&gt;if (_nestinglevel &amp;gt;= nestCur)    &lt;br /&gt;            {     &lt;br /&gt;                Point start = new Point(xCur, yCur);     &lt;br /&gt;                Point leftEnd = new Point((xCur + Convert.ToInt32(Math.Cos(alfa * (Math.PI / 180)) * lenCur)), (yCur - Convert.ToInt32(Math.Sin(alfa * (Math.PI / 180)) * lenCur)));     &lt;br /&gt;                g.DrawLine(p, start, leftEnd); &lt;/p&gt;  &lt;p&gt;                Point rightEnd = new Point((xCur + Convert.ToInt32(Math.Cos(beta * (Math.PI / 180)) * lenCur)), (yCur - Convert.ToInt32(Math.Sin(beta * (Math.PI / 180)) * lenCur)));    &lt;br /&gt;                g.DrawLine(p, start, rightEnd); &lt;/p&gt;  &lt;p&gt;                nestCur++;    &lt;br /&gt;                DrawFrac(leftEnd.X, leftEnd.Y, (lenCur / 4) * 3, nestCur, alfa+45, beta+45);     &lt;br /&gt;                DrawFrac(rightEnd.X, rightEnd.Y, (lenCur / 4) * 3, nestCur, alfa-45, beta-45);     &lt;br /&gt;            }&lt;/p&gt;  &lt;p&gt;the result? a nice little fractal :)&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Mathematicalnostalgy_AF35/frac_2.gif"&gt;&lt;img title="frac" style="display: inline" height="359" alt="frac" src="http://geekswithblogs.net/images/geekswithblogs_net/JanS/WindowsLiveWriter/Mathematicalnostalgy_AF35/frac_thumb.gif" width="478" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129852"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129852" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/129852.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/03/05/mathematical-nostalgy.aspx</guid>
            <pubDate>Thu, 05 Mar 2009 18:27:51 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/129852.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/03/05/mathematical-nostalgy.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/129852.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Joining TechDays!</title>
            <link>http://geekswithblogs.net/JanS/archive/2009/01/12/joining-techdays.aspx</link>
            <description>&lt;p&gt;10, 11, and 12 March 2009, Microsoft is hosting TechDays ‘09 in our beloved Antwerp. Last year I was unable to attend all days, but this year I’ll be there from start to end.&lt;/p&gt;  &lt;p&gt;The agenda hasn’t been published yet, so I hope there will be lots of developer sessions planned.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128595"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128595" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/JanS/aggbug/128595.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jan Schepens</dc:creator>
            <guid>http://geekswithblogs.net/JanS/archive/2009/01/12/joining-techdays.aspx</guid>
            <pubDate>Tue, 13 Jan 2009 01:20:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/JanS/comments/128595.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/JanS/archive/2009/01/12/joining-techdays.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/JanS/comments/commentRss/128595.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>