<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1749097333287701414</id><updated>2012-02-16T04:21:05.811-08:00</updated><title type='text'>Yordan Pavlov's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-8951684025343984617</id><published>2009-08-19T06:24:00.001-07:00</published><updated>2009-08-19T06:31:33.136-07:00</updated><title type='text'>LGPL Python binding for Qt backed by Nokia released</title><content type='html'>&lt;p&gt;That’s right, just yesterday the first version of the &lt;a href="http://www.pyside.org/"&gt;PySide&lt;/a&gt; project was released.    &lt;br /&gt;The &lt;a href="http://www.pyside.org/"&gt;PySide&lt;/a&gt; project “provides LGPL-licensed Python bindings for the Qt cross-platform application and UI framework”. &lt;/p&gt;  &lt;p&gt;As you may already know, some months ago &lt;a href="http://labs.trolltech.com/blogs/2008/01/28/nokia-to-acquire-trolltech/"&gt;Nokia acquired Trolltech&lt;/a&gt;, the makers of &lt;a href="https://qt.nokia.com/"&gt;the Qt cross platform UI framework&lt;/a&gt; and made it    &lt;br /&gt;available under the LGPL license. That made a lot of people think of Qt again, and think about switching to it,     &lt;br /&gt;now that it comes with this liberal license.     &lt;br /&gt;One little problem remained, however (at least for the many people that use Python out there). The nice &lt;a href="http://www.riverbankcomputing.co.uk/software/pyqt/intro"&gt;PyQt&lt;/a&gt; binding was still dual licensed with either a non free commercial license or a GPL one.    &lt;br /&gt;There were some people that asked the makers of the PyQt python bindings if they were going to provide an LGPL licensing option. Many people thought that it is natural that there will be an LGPL licensed Python binding for Qt sooner or later. And if that was not going to be PyQt then the community was going to make a new one. Even Nokia considered PyQt, but as described in the &lt;a href="http://www.pyside.org/faq/"&gt;PySide FAQ&lt;/a&gt; “common agreement could not be found”.&lt;/p&gt;  &lt;p&gt;Well, it seems that the guys at Nokia, like the Python community, thought that they need an LGPL licensed Python bindings for Qt. After doing some research, they “decided that building our own bindings was the best option”.&lt;/p&gt;  &lt;p&gt;Currently the bindings are available only for Linux, but the project “aims to support all the platforms Qt does”. The &lt;a href="http://www.pyside.org/faq/"&gt;PySide FAQ&lt;/a&gt; is an interesting read if you have questions about the project and Nokia’s involvement in it (as I’m sure you have). &lt;/p&gt;  &lt;p&gt;Now we only need someone to make PySide available for Windows (and other platforms of course:)).&lt;/p&gt;  &lt;p&gt;Will Qt become the standard for cross platform development of the open source world?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-8951684025343984617?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/8951684025343984617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=8951684025343984617' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/8951684025343984617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/8951684025343984617'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/08/lgpl-python-binding-for-qt-backed-by.html' title='LGPL Python binding for Qt backed by Nokia released'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-5197889744585555873</id><published>2009-07-27T11:30:00.001-07:00</published><updated>2009-07-27T12:46:32.380-07:00</updated><title type='text'>Returned home after a week at the EEC</title><content type='html'>&lt;p&gt;&lt;a href="http://lh6.ggpht.com/__3gWe43GWgQ/Sm3ySZnL7lI/AAAAAAAABzM/Egnv-bQtn8c/s1600-h/IMG_0133%5B4%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="IMG_0133" border="0" alt="IMG_0133" align="left" src="http://lh5.ggpht.com/__3gWe43GWgQ/Sm3yS3vQ4PI/AAAAAAAABzQ/rXICGJncqxc/IMG_0133_thumb%5B2%5D.jpg?imgmax=800" width="277" height="331" /&gt;&lt;/a&gt; I know, I know that quite a long time has passed since my last post. But I have a reason. &lt;/p&gt;  &lt;p&gt;Just a week ago I returned from a visit at the Microsoft EEC, where I had one of the most interesting experiences in my life. You may not remember, but in &lt;a href="http://yordanpavlov.blogspot.com/2008/08/hello-world.html"&gt;my opening post&lt;/a&gt; I wrote about me and my team winning the Imagine Cup 2008 competition. You can freely skip this post. There is actually not anything interesting in it except a link to &lt;a href="http://shop.lego.com/Product/?p=8292"&gt;the Lego Technic set I found in Paris&lt;/a&gt;. Oh and form Redmond I got &lt;a href="http://shop.lego.com/ByTheme/Product.aspx?p=8265&amp;amp;cn=57&amp;amp;d=70"&gt;another one&lt;/a&gt;. Ok, ok, I will cut to the point, we can talk about Lego later. &lt;/p&gt;  &lt;p&gt;So the reason for all the silence on my blog lately is that I was busy working on my Imagine Cup project “EOS.NET” (sorry, no link here, hope to have one soon). &lt;/p&gt;  &lt;p&gt;Shameless plug: EOS.NET is a modular system (of course &lt;a href="http://mef.codeplex.com/"&gt;MEF&lt;/a&gt; is used for the “modular” part) that can process satellite data from multiple satellites (currently NASA MODIS) and look for interesting events, like for example fires and deforestation (and in the future oil spill in the oceans, floods and what not). And yes it can send emails when such an event is discovered. It can also do many other interesting things but I will keep these as a surprise for now. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The main functionality that we had to work on was to make the thing run on a &lt;a href="http://www.microsoft.com/hpc/en/us/default.aspx"&gt;Microsoft Windows HPC&lt;/a&gt; cluster. We had to to that, so that when time comes to collect our prize and go the &lt;a href="http://www.microsoft.com/windowsserver/evaluation/eec/default.mspx"&gt;the Microsoft Enterprise Engineering Center&lt;/a&gt; (EEC) we are able to use this baby: &lt;/p&gt;  &lt;p&gt;&lt;/p&gt; &lt;a href="http://lh4.ggpht.com/__3gWe43GWgQ/Sm3yTUCV9-I/AAAAAAAABzU/TOLt1QFI_7U/s1600-h/IMG_9292%5B5%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px; display: inline; border-top: 0px; border-right: 0px" title="IMG_9292" border="0" alt="IMG_9292" align="left" src="http://lh4.ggpht.com/__3gWe43GWgQ/Sm3yUGPK03I/AAAAAAAABzY/Ohd3JT6xtcs/IMG_9292_thumb%5B3%5D.jpg?imgmax=800" width="184" height="244" /&gt;&lt;/a&gt;  &lt;p&gt;This is a 32 compute node cluster, and even though it is not the biggest cluster on Earth (there is another much bigger cluster at the EEC, I hope that I will get to use it next time) it can help you process your data many times faster. Oh, and with the latest version of the Windows HPC stack you do not even have to write complex MPI applications. With &lt;a href="http://yordanpavlov.blogspot.com/2009/01/application-models-for-windows-hpc.html"&gt;the new SOA model&lt;/a&gt;, if you know WCF you will be able to relatively easy write scalable HPC applications that can run on powerful clusters.&lt;/p&gt;  &lt;p&gt;Of course we had some issues with our system at the beginning – a completely normal thing given the fact that we were not able to test on a real cluster before. But after some work we had amazing results – the data processing was orders of magnitude faster compared to when the application processes the data locally. One can easily imagine how the system will easily process data for the whole world and from different satellites at the same time using a large enough cluster.&lt;a href="http://lh4.ggpht.com/__3gWe43GWgQ/Sm3yUnWwlMI/AAAAAAAABzc/uM2iEKqJBHc/s1600-h/DSC02784%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px; display: inline; border-top: 0px; border-right: 0px" title="DSC02784" border="0" alt="DSC02784" align="right" src="http://lh6.ggpht.com/__3gWe43GWgQ/Sm3yVVMDY8I/AAAAAAAABzg/H7vTqM4a8T8/DSC02784_thumb%5B1%5D.jpg?imgmax=800" width="244" height="139" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After things settled a bit (although work continued with fast pace until the end of the week) and EOS.NET was able to run successfully on the cluster I even had a little time to play with the &lt;a href="http://www.microsoft.com/surface/"&gt;Microsoft Surface&lt;/a&gt; they had at the EEC. It’s really fun, you should try too:) I hope that soon these devices will be cheap enough so that everyone can afford them.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Generally the time that I spent at the EEC and at the Microsoft campus in Redmond was wonderful and I will remember it for many years.That was all for now. See you soon.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-5197889744585555873?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/5197889744585555873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=5197889744585555873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/5197889744585555873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/5197889744585555873'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/07/returned-home-after-week-at-eec.html' title='Returned home after a week at the EEC'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/__3gWe43GWgQ/Sm3yS3vQ4PI/AAAAAAAABzQ/rXICGJncqxc/s72-c/IMG_0133_thumb%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-6754372992416945968</id><published>2009-07-10T00:13:00.001-07:00</published><updated>2009-07-10T00:13:15.898-07:00</updated><title type='text'>Silverlight 3 RTW available for download</title><content type='html'>&lt;p&gt;The much awaited release of Silverlight 3 is now available for download at:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://silverlight.net/GetStarted/" href="http://silverlight.net/GetStarted/"&gt;http://silverlight.net/GetStarted/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you haven’t already, you can learn more about the new features in this release in &lt;a href="http://timheuer.com/blog/archive/2009/03/18/silverlight-3-whats-new-a-guide.aspx"&gt;Tim’s guide here&lt;/a&gt;. There is also a &lt;a href="http://silverlight.net/GetStarted/overview.aspx"&gt;overview&lt;/a&gt; which compares the different Silverlight versions.&lt;/p&gt;  &lt;p&gt;So, go play with the new bits. And don’t forget to share which are your favorite features in this new release.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-6754372992416945968?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/6754372992416945968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=6754372992416945968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/6754372992416945968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/6754372992416945968'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/07/silverlight-3-rtw-available-for.html' title='Silverlight 3 RTW available for download'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-6419654676689087318</id><published>2009-03-29T13:06:00.001-07:00</published><updated>2009-03-29T13:06:16.781-07:00</updated><title type='text'>Precode plugin for Live Writer now has support for SyntaxHighlighter 2.0</title><content type='html'>&lt;p&gt;I wrote about the excellent &lt;a href="http://precode.codeplex.com/"&gt;Precode plugin for Windows Live Writer&lt;/a&gt; in &lt;a href="http://yordanpavlov.blogspot.com/2009/02/using-syntaxhighlighter-with-live.html"&gt;this blog post&lt;/a&gt;. Until recently there was no support for Syntaxhighlighter 2.0 and after inserting a snippet with Precode I had to manually modify the generated HTML. Finally, support for &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter"&gt;Syntaxhighlighter 2.0&lt;/a&gt; was added with the just released version 4.0.2 and this inconvenience is now gone. &lt;/p&gt; &lt;p&gt;This new release also includes a standalone desktop application that will allow you to paste formatted code in other applications:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/__3gWe43GWgQ/Sc_UtjR8JiI/AAAAAAAABx8/RbE3zSg_h-M/s1600-h/precode_desktop%5B2%5D.jpg"&gt;&lt;img title="precode_desktop" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="196" alt="precode_desktop" src="http://lh3.ggpht.com/__3gWe43GWgQ/Sc_UuO8D2OI/AAAAAAAAByA/t4MFncF4P2Y/precode_desktop_thumb.jpg?imgmax=800" width="244" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;NOTE: This release of Precode only has support for Syntaxhighlighter 2.0.&lt;/p&gt; &lt;p&gt;Now, go &lt;a href="http://precode.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25426"&gt;get Precode&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-6419654676689087318?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/6419654676689087318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=6419654676689087318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/6419654676689087318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/6419654676689087318'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/03/precode-plugin-for-live-writer-now-has.html' title='Precode plugin for Live Writer now has support for SyntaxHighlighter 2.0'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/__3gWe43GWgQ/Sc_UuO8D2OI/AAAAAAAAByA/t4MFncF4P2Y/s72-c/precode_desktop_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-8085972952684681640</id><published>2009-03-21T02:47:00.001-07:00</published><updated>2009-03-21T02:53:32.049-07:00</updated><title type='text'>Using the Silverlight Charting control with WPF</title><content type='html'>&lt;p&gt;You have probably already seen the great charting control that is part of the &lt;a href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/a&gt;. I don’t know for you, but I have on many occasions looked at these beautiful charts with envy. And really, who doesn’t want to have impressive charts in his application these days. And I wondered if I could use these nice charts in my WPF applications. The first idea that occurred to me was that I could host a Silverlight application in my WPF application using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx"&gt;WebBrowser&lt;/a&gt; control. However, this approach seemed somewhat hacky to me so I started looking if I could build the Silverlight charting control against WPF. It seems, however that &lt;a href="http://blogs.msdn.com/delay/archive/2009/03/20/silverlight-charting-remains-just-a-click-away-and-runs-on-wpf-too-chartbuilder-sample-and-source-code-updated-for-charting-s-march-09-release.aspx"&gt;the guys from the Silverlight team had also thought of that&lt;/a&gt; and they even have their daily builds setup to build the Silverlight charting against WPF.&lt;/p&gt; &lt;p&gt;So here is &lt;a href="http://blogs.msdn.com/delay/default.aspx"&gt;Delay&lt;/a&gt;’s &lt;a href="http://delay.members.winisp.net/ChartBuilder/ChartBuilder.zip"&gt;chart builder sample&lt;/a&gt; that you have already probably seen running on Silverlight, but this time running on my desktop with WPF:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/__3gWe43GWgQ/ScS3tkDDJHI/AAAAAAAABx0/PTVy2Kfpsu4/s1600-h/ChartBuilder%5B2%5D.jpg"&gt;&lt;img title="ChartBuilder" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="175" alt="ChartBuilder" src="http://lh6.ggpht.com/__3gWe43GWgQ/ScS3ufvwiwI/AAAAAAAABx4/DE9WOiUyDl4/ChartBuilder_thumb.jpg?imgmax=800" width="244" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The sample includes all assemblies necessary.&lt;/p&gt; &lt;p&gt;You should note that to use the Silverlight charting control with WPF you must have a reference not only to the DataVisualization assembly, but to the &lt;a href="http://wpf.codeplex.com/"&gt;WPFToolkit&lt;/a&gt; assembly or you will get some strange errors. This is because the control uses the the Visual State Manager that is being ported to WPF.&lt;/p&gt; &lt;p&gt;Happy charting.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-8085972952684681640?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/8085972952684681640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=8085972952684681640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/8085972952684681640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/8085972952684681640'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/03/using-silverlight-charting-control-with.html' title='Using the Silverlight Charting control with WPF'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/__3gWe43GWgQ/ScS3ufvwiwI/AAAAAAAABx4/DE9WOiUyDl4/s72-c/ChartBuilder_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-5871600501474904902</id><published>2009-02-19T12:50:00.001-08:00</published><updated>2009-02-19T13:48:51.814-08:00</updated><title type='text'>Using SyntaxHighlighter with Live Writer</title><content type='html'>&lt;p&gt;After trying some other Windows Live Writer plug-ins without much success (as you can see from my previous post) I finally found the &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter"&gt;SyntaxHighlighter&lt;/a&gt; which is really great. The new version has support for blogger through the bloggerMode setting and is also kindly hosted by Alex (the creator of SyntaxHighlighter) so that you do not need to host it yourself. An excellent blog post that explains how you can enable SyntaxHighlighter for your Blogger blog can be found &lt;a href="http://dirkdev.blogspot.com/2009/02/moved-to-syntaxhighlighter-20.html"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;There is also a&amp;nbsp; plug-in for WLW named &lt;a href="http://www.codeplex.com/precode"&gt;Precode&lt;/a&gt; that has excellent support for SyntaxHighlighter and also looks quite nice:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/__3gWe43GWgQ/SZ3GBcbz4GI/AAAAAAAABxc/CcxezaWiO0E/s1600-h/precode%5B2%5D.jpg"&gt;&lt;img title="precode" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="187" alt="precode" src="http://lh4.ggpht.com/__3gWe43GWgQ/SZ3GB8yv-UI/AAAAAAAABxg/1M3xP28fjs0/precode_thumb.jpg?imgmax=800" width="244" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;EDIT: It seems that the Precode plug-in does not have support for the latest version of SyntaxHighlighter and I has to manually edit the generated HTML and add “brush: ” before c#&amp;nbsp; in the pre tag.&lt;/p&gt; &lt;p&gt;So I can finally have my snippets here beautifully formatted like this:&lt;/p&gt;&lt;pre class="brush: c#" name="code"&gt;[TaskCapabilities(IsSpecial = true)]&lt;br /&gt;[ExportMetadata("IsSpecial", true)]&lt;br /&gt;[Export(typeof(ITask))]&lt;br /&gt;public class AnotherTask : ITask&lt;br /&gt;{&lt;br /&gt;    #region ITask Members&lt;br /&gt;&lt;br /&gt;    public bool Process(string input)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine("Another task");&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    #endregion&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;May the syntax-highlighter be with you!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-5871600501474904902?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/5871600501474904902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=5871600501474904902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/5871600501474904902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/5871600501474904902'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/02/using-syntaxhighlighter-with-live.html' title='Using SyntaxHighlighter with Live Writer'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/__3gWe43GWgQ/SZ3GB8yv-UI/AAAAAAAABxg/1M3xP28fjs0/s72-c/precode_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-5856585800224604492</id><published>2009-02-04T10:10:00.001-08:00</published><updated>2009-02-04T10:43:38.155-08:00</updated><title type='text'>Virtual methods, interfaces and the strategy pattern</title><content type='html'>&lt;p&gt;The other day while refactoring some code that was called quite often I thought “Oh, this looks like a candidate for a strategy”. Here is a simplified version of the code:&lt;/p&gt;  &lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;   &lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;     &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;a = 0;&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; i = 0; i &amp;lt; count; i++)&lt;br /&gt;&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.SomeBoolProperty)&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt;    &lt;span style="color: rgb(51, 51, 51);"&gt; {&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt;         a += 2;&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   7:&lt;/span&gt;   &lt;span style="color: rgb(51, 51, 51);"&gt;  }&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   8:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   9:&lt;/span&gt;    &lt;span style="color: rgb(51, 51, 51);"&gt; {&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  10:&lt;/span&gt;         a += 1;&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  11:&lt;/span&gt;    &lt;span style="color: rgb(51, 51, 51);"&gt; }&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  12:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;//a += (this.SomeBoolProperty) ? 2 : 1;&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  13:&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;}&lt;/span&gt;&lt;/pre&gt;  &lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;And what I wanted to do is something like:&lt;/p&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;virtual&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;SomeBoolProperty&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 51);"&gt;get&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt;         &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.boolValue;&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   7:&lt;/span&gt;    &lt;span style="color: rgb(51, 51, 51);"&gt; set&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   9:&lt;/span&gt;         &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.boolValue != &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;value&lt;/span&gt;)&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  11:&lt;/span&gt;             &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.boolValue = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;value&lt;/span&gt;;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  12:&lt;/span&gt;             &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.boolValue)&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  13:&lt;/span&gt;            &lt;span style="color: rgb(51, 51, 51);"&gt; {&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  14:&lt;/span&gt;                 &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.calculatorVirtual = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; TrueCalculator();&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  15:&lt;/span&gt;            &lt;span style="color: rgb(51, 51, 51);"&gt; }&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  16:&lt;/span&gt;             &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  17:&lt;/span&gt;            &lt;span style="color: rgb(51, 51, 51);"&gt; {&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  18:&lt;/span&gt;                 &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.calculatorVirtual = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; FalseCalculator();&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  19:&lt;/span&gt;            &lt;span style="color: rgb(51, 51, 51);"&gt; }&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  20:&lt;/span&gt;         }&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  21:&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 51);"&gt;}&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  22:&lt;/span&gt; }&lt;/pre&gt;  &lt;/div&gt;&lt;/div&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; height: 124px; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; height: 134px; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;a = 0;&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt; ParameterClass param = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; ParameterClass();&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;for&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; i = 0; i &amp;lt; count; i++)&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt; {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 51);"&gt;a += &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.calculatorVirtual.TestMethod(param);&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;  &lt;/div&gt;&lt;/div&gt;&lt;p&gt;I was just about to start refactoring that piece of code into a couple of little strategy classes when my inner voice asked: “Wait, will it really be more effective?”. Why is this you ask. Because virtual method calls can be expensive, and if statements are supposed to be cheap. &lt;/p&gt;&lt;p&gt;But I didn’t stop there, I wanted to know just how much each option would cost me. And I prepared a simple program to test the two options. I even added a third option. I thought “If virtual method are so expensive, let’s not use them, we’ll use interfaces and the problem will be gone.” Interfaces don’t need virtual methods to work and so there won’t be any virtual tables involved, right? It turned out that I couldn't be more wrong.&lt;/p&gt;&lt;p&gt;The results speak for themselves:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/__3gWe43GWgQ/SYnaIdnzqeI/AAAAAAAABxU/SntEjmvY1dQ/s1600-h/PerformanceTest%5B3%5D.jpg"&gt;&lt;img title="PerformanceTest" style="border: 0px none ; display: inline;" alt="PerformanceTest" src="http://lh3.ggpht.com/__3gWe43GWgQ/SYnaI_s2i7I/AAAAAAAABxY/Z7JlNVf2wEM/PerformanceTest_thumb%5B1%5D.jpg?imgmax=800" border="0" width="436" height="118" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;It turns out that just adding the virtual keyword before a method or a property makes it’s call about three times more expensive. The other interesting thing is that interface method calls are about 1,5 times more expensive than virtual method calls. Even though the IL code that is generated is the same. I wonder what is the reason for this.&lt;/p&gt;&lt;p&gt;Here is the code that starts the tests, in each test method there is code similar to the code above, count = 100 000 000:&lt;/p&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; TestClass testClass = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; TestClass();&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; btnTestIf_Click&lt;/span&gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; sender, EventArgs e)&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt; {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.RunTest(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; Action(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.testClass.RunIfTest), &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.lblTimeIf);&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   7:&lt;/span&gt;  &lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   8:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; btnTestVirtualIf_Click(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   9:&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;{&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  10:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.RunTest(&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; Action(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.testClass.RunVirtualIfTest), &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.lblTimeVirtualIf);&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  11:&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;}&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  12:&lt;/span&gt;  &lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  13:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; btnTestVirtual_Click(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;sender, EventArgs e)&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  14:&lt;/span&gt; {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  15:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.RunTest(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; Action(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.testClass.RunVirtualTest),&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;.lblTimeVirtual);&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  16:&lt;/span&gt; }&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  17:&lt;/span&gt;  &lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  18:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; btnTestInterface_Click(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  19:&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;{&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  20:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.RunTest(&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; Action(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.testClass.RunInterfaceTest), &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.lblTimeInterface);&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  21:&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; }&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  22:&lt;/span&gt;  &lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  23:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; RunTest(Action testMethod, Label label)&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  24:&lt;/span&gt; {&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  25:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; &lt;span style="color: rgb(51, 51, 51);"&gt;start = Environment.TickCount;&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  26:&lt;/span&gt;     testMethod();&lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  27:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(51, 51, 51);"&gt; end = Environment.TickCount;&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  28:&lt;/span&gt;  &lt;/pre&gt;    &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  29:&lt;/span&gt;     &lt;span style="color: rgb(51, 51, 51);"&gt;label.Text =&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt;.&lt;span style="color: rgb(51, 51, 51);"&gt;Format(&lt;/span&gt;&lt;span style="color: rgb(0, 96, 128);"&gt;"{0} ms"&lt;/span&gt;, &lt;span style="color: rgb(51, 51, 51);"&gt;(end - start).ToString());&lt;/span&gt;&lt;/pre&gt;    &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  30:&lt;/span&gt; }&lt;/pre&gt;  &lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Finally, here are my key take aways:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Use the virtual keyword wisely. Only when you need it.&lt;/li&gt;  &lt;li&gt;Use base classes with virtual methods. Especially if you have some common logic that you can put in the base class.&lt;/li&gt;  &lt;li&gt;In most cases replacing a sequence of if statements that is used in many places with a strategy / template method is worth it because it makes the code much more cleaner, easier to understand and change.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p&gt;That was all for now, see you next time&lt;/p&gt;&lt;p&gt;Yordan, the curious&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-5856585800224604492?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/5856585800224604492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=5856585800224604492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/5856585800224604492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/5856585800224604492'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/02/virtual-methods-interfaces-and-strategy.html' title='Virtual methods, interfaces and the strategy pattern'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/__3gWe43GWgQ/SYnaI_s2i7I/AAAAAAAABxY/Z7JlNVf2wEM/s72-c/PerformanceTest_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-1163808815799711243</id><published>2009-01-11T10:29:00.001-08:00</published><updated>2009-01-12T10:27:53.483-08:00</updated><title type='text'>Application models for Windows HPC Server 2008</title><content type='html'>&lt;p&gt;There are two application models that you could use to write parallel programs that run on a Window HPC Server 2008 cluster.The first is the more classical &lt;a href="http://en.wikipedia.org/wiki/Message_Passing_Interface"&gt;MPI&lt;/a&gt; model. This model has been used for quite some time not only on the Windows platform but also on various other platforms like Linux and flavors of BSD. However in the 2008 version of Windows HPC Server some nice improvements were made that allow for 30% increase in effectiveness compared to the previous version (which I think was named Windows Compute Cluster 2003) which is very impressive.&lt;/p&gt;  &lt;p&gt;If you want to know more about the MPI application model I recommend that you take a look at the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=D5838485-507C-45CD-8AA6-6D6B383D1071&amp;amp;displaylang=en"&gt;Windows HPC Server 2008 - Using MS-MPI white paper&lt;/a&gt; and also watch &lt;a href="http://channel9.msdn.com/shows/The+HPC+Show/Windows-HPC-Server-Development-the-MPI-Application-Model/"&gt;that video on channel 9&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There is also the newly introduced WCF based, SOA application model which allows you to write your parallel applications using your favorite managed language (like for example C#) and WCF in Visual Studio.&lt;/p&gt;  &lt;p&gt;Again, if you want to know more you can take a look at the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=99742128-4C8C-4ADB-872E-C4099206C78D&amp;amp;displaylang=en"&gt;Overview of Service-Oriented Architecture Programming Model and Runtime System for Windows HPC Server 2008 white paper&lt;/a&gt; and watch &lt;a href="http://channel9.msdn.com/shows/The+HPC+Show/Windows-HPC-Server-Development-the-WCF-Application-Model/"&gt;this video at channel 9&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There are also &lt;a href="http://www.microsoft.com/hpc/en/us/white-papers.aspx"&gt;other white papers&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/hpctrekker/archive/2008/12/31/say-goodbye-to-2008-with-10-hpc-web-casts.aspx"&gt;more videos&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;But how to decide which of the two models to use? Besides, of course your preference of C# over C, or WCF over MPI. Well, if your parallel algorithms are such that the worker processes need to communicate with one another you will most probably need to use the MPI model. However, if they are of the &lt;a href="http://en.wikipedia.org/wiki/Embarrassingly_parallel"&gt;embarrassingly parallel&lt;/a&gt; kind you could take advantage of the new SOA model.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-1163808815799711243?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/1163808815799711243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=1163808815799711243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/1163808815799711243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/1163808815799711243'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2009/01/application-models-for-windows-hpc.html' title='Application models for Windows HPC Server 2008'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-7164826016200529300</id><published>2008-08-25T21:19:00.000-07:00</published><updated>2008-08-25T22:53:11.363-07:00</updated><title type='text'>Importing ESRI Shapefile data in SQL Server 2008</title><content type='html'>Hi again. For my Imagine Cup project I needed GIS data about US cities so that I can make some interesting spatial queries. Actually finding the GIS data was the easy part. Moreover it was in a ESRI Shapefile format which has become standard for exporting/distributing GIS data.&lt;br /&gt;So far, so good.&lt;br /&gt;Now here comes the more interesting part - how do I import that Shapefile into SQL Server 2008. Fortunately, &lt;a href="http://www.sharpgis.net/"&gt;Morten Nielsen&lt;/a&gt; has made the very helpful &lt;a href="http://www.sharpgis.net/page/SQL-Server-2008-Spatial-Tools.aspx"&gt;SQL Server 2008 Spatial Tools&lt;/a&gt;. There were some problems with the SQL Server 2008 RC0 due to &lt;a href="http://blogs.msdn.com/isaac/archive/2007/12/27/latitude-longitude-ordering.aspx"&gt;the change of (latitude, longitude) ordering&lt;/a&gt;.  However, recently Morten updated his tools and now they work again (thank you Morten).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__3gWe43GWgQ/SLOIXU4PS4I/AAAAAAAABEw/cxXf7SShWq0/s1600-h/shape2sql.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/__3gWe43GWgQ/SLOIXU4PS4I/AAAAAAAABEw/cxXf7SShWq0/s320/shape2sql.png" alt="" id="BLOGGER_PHOTO_ID_5238680725884980098" border="0" /&gt;&lt;/a&gt;With these tools importing the Shapefile data into SQL Server 2008 is easy. You just connect to your SQL Server and then select the .shp file and some other options like the type of the geom field (in my case Geography), SRID, etc.&lt;br /&gt;&lt;br /&gt;Here the magic SRID number means that the WGS 84 spatial reference system should be used.&lt;br /&gt;You can easily see that by executing the following query:&lt;br /&gt;&lt;br /&gt;select * from sys.spatial_reference_systems where spatial_reference_id = 4326&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you are ready, just press the "Upload to Database" button and wait a little.&lt;br /&gt;And now after your ESRI Shapefile data is finally in your SQL Server 2008 you can do some interesting queries like for example:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;declare @p geography&lt;br /&gt;set @p = geography::STPointFromText('POINT(-121.7944 38.1172)', 4326)&lt;br /&gt;select top(50) CITY_NAME, geom.STDistance(@p) as Distance, geom.STStartPoint().ToString() as StartPoint from USTowns order by Distance asc&lt;br /&gt;&lt;br /&gt;That was all for now. I hope that I will be able to blog more often in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-7164826016200529300?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/7164826016200529300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=7164826016200529300' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/7164826016200529300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/7164826016200529300'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2008/08/importing-esri-shapefile-data-in-sql.html' title='Importing ESRI Shapefile data in SQL Server 2008'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__3gWe43GWgQ/SLOIXU4PS4I/AAAAAAAABEw/cxXf7SShWq0/s72-c/shape2sql.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1749097333287701414.post-4299555084802357468</id><published>2008-08-12T15:19:00.000-07:00</published><updated>2008-08-12T15:53:45.615-07:00</updated><title type='text'>Hello, world!</title><content type='html'>I know, I know that I should have started blogging long ago but I could not find time for this until now. I have been pretty busy with my work and my &lt;a href="http://imaginecup.com/"&gt;Imagine Cup&lt;/a&gt; project. My team "Atlas" competed in the Software Design category and we won &lt;a href="http://www.microsoft.com/presspass/press/2008/jul08/07-08ICWINNERSPR.mspx"&gt;&lt;span id="ctl00_MainContentPlaceholder_ctl01_ctl00_lblEntry"&gt;&lt;span style="font-family:Segoe UI;font-size:85%;"&gt;&lt;strong&gt;&lt;u&gt;The Engineering Excellence Achievement Award&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. Being in Paris for the Imagine Cup 2008 World Finals was an amazing experience. We even got the opportunity to chat with &lt;a href="http://blogs.msdn.com/somasegar/"&gt;S. Somasegar&lt;/a&gt; (who by the way is a great guy) in person. We met lots of interesting people, saw lots of interesting things and even I managed to buy &lt;a href="http://shop.lego.com/Product/?p=8292"&gt;my new LEGO Technic set&lt;/a&gt;.&lt;br /&gt;You can take a look at&lt;a href="http://bmiloshevska.blogspot.com/"&gt; the blog of my team mate Boryana&lt;/a&gt; where she writes about her experience with the Imagine Cup competition.&lt;br /&gt;&lt;br /&gt;So, now that things are now a bit more settled and I finally managed to find some time for my first blog post. From now on here I will post things that I found interesting. Mostly about programming, .NET, C#, technology, etc...you know...computer geek stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1749097333287701414-4299555084802357468?l=yordanpavlov.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yordanpavlov.blogspot.com/feeds/4299555084802357468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1749097333287701414&amp;postID=4299555084802357468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/4299555084802357468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1749097333287701414/posts/default/4299555084802357468'/><link rel='alternate' type='text/html' href='http://yordanpavlov.blogspot.com/2008/08/hello-world.html' title='Hello, world!'/><author><name>Yordan Pavlov</name><uri>http://www.blogger.com/profile/16258333792127611963</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/__3gWe43GWgQ/SKIC7ZY0dOI/AAAAAAAABEk/fwbyG5tfQYc/s1600-R/Dan4o.JPG'/></author><thr:total>0</thr:total></entry></feed>
