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

<channel>
	<title>Marius Bancila's Blog &#187; .NET</title>
	<atom:link href="http://mariusbancila.ro/blog/category/it/software/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://mariusbancila.ro/blog</link>
	<description>Sharing my opinions and ideas!</description>
	<lastBuildDate>Fri, 06 Apr 2012 13:45:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WinRT and winmd Files</title>
		<link>http://mariusbancila.ro/blog/2011/10/30/winrt-and-winmd-files/</link>
		<comments>http://mariusbancila.ro/blog/2011/10/30/winrt-and-winmd-files/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 19:15:40 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[CTPs & Betas]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WinRT]]></category>
		<category><![CDATA[C++/CX]]></category>
		<category><![CDATA[ildasm]]></category>
		<category><![CDATA[managed]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[win8]]></category>
		<category><![CDATA[winmd]]></category>
		<category><![CDATA[winrt]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=1162</guid>
		<description><![CDATA[If you tried the Win8 Developer Preview and built WinRT components (native or managed) you noticed the .winmd files. The name stands for Windows Meta Data and the format of these files is the same used by the .NET framework for the CLI, i.e. ECMA-335. That means you can actually read these files with a [...]]]></description>
			<content:encoded><![CDATA[<p>If you tried the Win8 Developer Preview and built WinRT components (native or managed) you noticed the <strong>.winmd</strong> files. The name stands for Windows Meta Data and the format of these files is the same used by the .NET framework for the CLI, i.e. <a href="http://www.ecma-international.org/publications/standards/Ecma-335.htm">ECMA-335</a>. That means you can actually read these files with a tool such as ILDASM or Reflector, or of course, through .NET Reflection.</p>
<p>If you look in C:\Windows\System32\WinMetadata folder you&#8217;ll find the WinMD files for the Windows Runtime. You can browse the content of these files with one of the aforementioned disassemblers.<br />
<img alt="" src="/blog/wp-content/uploads/2011/10/winmetadatafolder.png" title="WinMetadata folder" class="alignnone" width="856" height="601" /></p>
<p>Here are two dummy WinRT components, one developed in C++/CX and one in C#.</p>
<table>
<tr>
<td>Native WinRT component in C++/CX</td>
<td>Managed WinRT component in C#</td>
</tr>
<tr valign="top">
<td>
<pre class="cpp" name="code">
namespace WinRTNativeComponent
{
    public ref class MyWinRTComponent sealed
    {
        int _id;
		String^ _name;

    public:
		MyWinRTComponent () {}
		~MyWinRTComponent () {}

        property int Id
        {
            int get() { return _id; }
            void set(int value) { _id = value; }
        }

		property String^ Name
		{
			String^ get() {return _name;}
			void set(String^ value) { _name= value; }
		}

        bool Update(int id, String^ name)
		{
			{
				if(_id == id)
				{
					_name = name;
					return true;
				}

				return false;
			}
		}
    };
}
</pre>
</td>
<td>
<pre class="csharp" name="code">
namespace WinRTManagedComponent
{
    public sealed class MyWinRTComponent
    {
        public int Id { get; set; }
        public string Name { get; set; }

        bool Update(int id, string name)
        {
            if (Id == id)
            {
                Name = name;
                return true;
            }

            return false;
        }
    }
}
</pre>
</td>
</tr>
</table>
<p>In the case of the native component, the output includes a DLL and a WINMD file (and of course a PDB file). In the case of the managed component, the output is either a DLL only or a WINMD only (plus the associated PDB file), depending on the Output type as defined in the project properties. If the type is <strong>Class Library</strong> the output is a DLL; this is enough if your component is supposed to be consumed from a managed language. However, if the component should be consumed from C++/CX or Javascript, then the project type must be set to <strong>WinMD File</strong>. In this case the DLL is replaced by a WinMD file, that contains, at least in the current version, both the matadata (as implied by the name) and the implementation.</p>
<table>
<tr>
<td>Native WinRT component in C++/CX</td>
<td>Managed WinRT component in C#</td>
</tr>
<tr valign="top">
<td><img alt="" src="/blog/wp-content/uploads/2011/10/winmdnative.png" title="WinMD for native component" class="alignnone" width="419" height="600" /></td>
<td><img alt="" src="/blog/wp-content/uploads/2011/10/winmdmanaged.png" title="WinMD for managed component" class="alignnone" width="419" height="600" /></td>
</tr>
</table>
<p>It should be possible to use reflection with winmd files. However, the reflection capabilities of .NET 4.5 in this developer preview seem to be very limited. The only available Load method in the Assembly class is</p>
<pre class="csharp" name="code">
public static Assembly Load(AssemblyName assemblyRef);
</pre>
<p>Trying to load the winmd file fails with a FailLoadException with the message &#8220;Could not load file or assembly &#8216;Winmdreflection, ContentType=WindowsRuntime&#8217; or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0&#215;80131515)&#8221;.</p>
<pre class="csharp" name="code">
try
{
    var assembly = Assembly.Load(
        new AssemblyName()
        {
            Name = "WinRTManagedComponent",
            ContentType = AssemblyContentType.WindowsRuntime
        });
}
catch (Exception ex)
{
}
</pre>
<p>It is possible though to read information for the types described in an winmd file in native code using the  <a href="http://msdn.microsoft.com/en-us/library/ms230172.aspx">IMetaDataImport</a>/<a href="http://msdn.microsoft.com/en-us/library/ms232953.aspx">IMetaDataImport2</a> COM interfaces. You can find an example <a href="http://social.msdn.microsoft.com/Forums/en-AU/winappswithnativecode/thread/211ef583-db11-4e55-926b-6d9ab53dbdb4">here</a>. But this has the drawback that you have to instantiate an object first and then query for its type information.</p>
<p>To use a Windows Runtime component in a Metro application (managed or native) you have to add a reference to it. That is pretty straight forward. In the following example I&#8217;m adding a reference in a C++ Metro application to the two WinRT components, one native and one managed, shown earlier. To do this, you can go to the project&#8217;s property page and open the Common Properties > Frameworks and References page, or use the References command from the project&#8217;s context menu which opens that page directly. You can add a reference to a project from the same solution, to a Windows component or you can browse for the winmd file.<br />
<img alt="" src="/blog/wp-content/uploads/2011/10/winmdreference.png" title="Adding a references to an winmd file" class="alignnone" width="800" height="556" /></p>
<p>Having done that you can instantiate the WinRT components.</p>
<pre class="cpp" name="code">
auto obj1 = ref new WinRTManagedComponent::MyWinRTComponent();
obj1->Id = 1;
obj1->Name = L"marius";

auto obj2 = ref new WinRTNativeComponent::MyWinRTComponent();
obj2->Id = 1;
obj2->Name = L"marius";
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2011/10/30/winrt-and-winmd-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accessing 64-bit Native COM Server From a Managed Client</title>
		<link>http://mariusbancila.ro/blog/2011/10/19/accessing-64-bit-native-com-server-from-a-managed-client/</link>
		<comments>http://mariusbancila.ro/blog/2011/10/19/accessing-64-bit-native-com-server-from-a-managed-client/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 07:26:43 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[interop]]></category>
		<category><![CDATA[managed]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[tlbimp]]></category>
		<category><![CDATA[VisualStudio]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=1147</guid>
		<description><![CDATA[Not long ago I ran into a COM interop problem that was a bit tricky to fix. So I&#8217;m sharing the problem and the solution here in case others encounter the same problem. I had this native in-proc COM server that initially was built only for x86. It was used in a native MFC application [...]]]></description>
			<content:encoded><![CDATA[<p>Not long ago I ran into a COM interop problem that was a bit tricky to fix. So I&#8217;m sharing the problem and the solution here in case others encounter the same problem.</p>
<p>I had this native in-proc COM server that initially was built only for x86. It was used in a native MFC application as well as a C# Windows Forms application, where it was added as a COM reference. Both worked nicely. But then I needed to port the MFC app to the x64 platform, so I had to do the same with the in-proc COM server. They both worked correctly, but the managed app, which had to be available also both as 64-bit and 32-bit (even on 64-bit machines), was broken. Eventually I traced the problem to some COM method calls which were a bit atypical, because the arguments to the methods were not COM &#8220;native&#8221; types, but custom structures.</p>
<p>These structures looked like this:</p>
<pre class="cpp" name="code">
[uuid(6F13C84D-0E01-48cd-BFD4-F7071A32B49F)] struct S
{
      long a;
      BSTR b;
      long c;
      BSTR d;
      long e;
      BSTR f;
      BSTR g;
      BSTR h;
      BSTR i;
      long j;
      BSTR k;
      long l;
      BSTR m;
      long n;
};
</pre>
<p>and the COM method signature:</p>
<pre class="cpp" name="code">
[id(42)] HRESULT GetListOfStructs(SAFEARRAY(struct S)* arrRes);
</pre>
<p>When you add a COM reference to a .NET assembly, Visual Studio runs <a href="http://msdn.microsoft.com/en-us/library/tt0cf3sx.aspx">tlbimp.exe</a> to generate a .NET assembly with equivalent definitions to the type definitions found in the COM type library. This interop assembly is used to access the COM server. It contains Runtime Callable Wrappers that bridge the two worlds together. By default, the interop assembly, generated in the project&#8217;s output folder, is called <strong>Interop.&lt;comname&gt;Lib.dll</strong>. For instance if the COM server is called NativeCOMServer, the interop assembly is called Interop.NativeCOMServerLib.dll.</p>
<p>The wrapper that was generated in the interop assembly had the following signature for the aforementioned method:</p>
<pre class="cpp" name="code">
[DispId(42)]
void GetListOfStructs(ref Array arrRes);
</pre>
<p>and therefore used like this:</p>
<pre class="cpp" name="code">
System.Array result = null;
obj.GetListOfStructs(ref result);
</pre>
<p>The call was performed correctly, the native code was executing, but as soon as it was returning an access violation exception was occurring. Thanks to <a href="http://stackoverflow.com/questions/7517474/accessing-64-bit-com-server-from-managed-assembly-fails">Hans Passant</a> I figured the problem was rooted in the way Visual Studio generates the interop assembly. The generated RCW didn&#8217;t know how to handle the custom structure correctly. Probably different padding on the two sides generated the access violation. </p>
<p>The trick was to generate the interop assembly directly, as a custom build step in the COM server project, and include it as an assembly reference in the managed project. Here are the commands for the custom build (must to make sure you have the correct path to the 32-bit and the 64-bit version of tlbimp.exe):</p>
<pre>
<pathto32bittool>\TlbImp.exe $(TargetPath) /out:$(TargetDir)\NativeCOMLib.Interop.dll /primary  /keyfile:mykey.snk /machine:x86
<pathto64bittool>\TlbImp.exe $(TargetPath) /out:$(TargetDir)\NativeCOMLib.Interop.dll /primary  /keyfile:mykey.snk /machine:x64
</pre>
<p>The result was a wrapper with methods like this:</p>
<pre class="cpp" name="code">
[DispId(42)]
void GetListOfStructs(ref S[] arrRes);
</pre>
<p>which of course had to be called like this:</p>
<pre class="cpp" name="code">
S[] result = null;
obj.GetListOfStructs(ref result);
</pre>
<p>To include either one or the other in the C# project I had to manually change the project file, since Visual Studio does not know conditional references, a feature available in MSBuild. I didn&#8217;t build the managed app for Any CPU because it had to be able to run as 32-bit on 64-bit machines, so I had two configurations, one for x86 and one fore x64.</p>
<pre class="xml" name="code">
    &lt;Reference Condition=" '$(Platform)' == 'x86' " Include="NativeCOMServer.Interop,
               Version=1.0.0.0, Culture=neutral, PublicKeyToken=f5b9312191a42d52, processorArchitecture=x86">
      &lt;SpecificVersion>False&lt;/SpecificVersion>
      &lt;HintPath>..\Bin\NativeCOMServer.Interop.dll&lt;/HintPath>
    &lt;/Reference>
    &lt;Reference Condition=" '$(Platform)' == 'x64' " Include="NativeCOMServer.Interop,
               Version=1.0.0.0, Culture=neutral, PublicKeyToken=f5b9312191a42d52, processorArchitecture=x64">
      &lt;SpecificVersion>False&lt;/SpecificVersion>
      &lt;HintPath>..\Bin64\NativeCOMServer.Interop.dll&lt;/HintPath>
    &lt;/Reference>
</pre>
<p>But this time the wrappers were able to bridge the call and everything worked smoothly. </p>
<p>The lesson learned is that when you have COM custom structures you should not rely on the way Visual Studio generates the interop assembly. You should build the interop explicitly (maybe as a custom build step, like I did) and include it as an assembly reference to your managed project.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2011/10/19/accessing-64-bit-native-com-server-from-a-managed-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++, WinRT and Partial Classes</title>
		<link>http://mariusbancila.ro/blog/2011/10/13/cpp-winrt-and-partial-classes/</link>
		<comments>http://mariusbancila.ro/blog/2011/10/13/cpp-winrt-and-partial-classes/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 20:46:05 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[WinRT]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[C++/CX]]></category>
		<category><![CDATA[partial classes]]></category>
		<category><![CDATA[VisualStudio]]></category>
		<category><![CDATA[VS11]]></category>
		<category><![CDATA[winrt]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=1131</guid>
		<description><![CDATA[Partial classes are finally available to C++. Sort of. It&#8217;s not part of the new C++11 standard, it&#8217;s part of the C++/CX language developed by Microsoft for targeting WinRT on Windows 8. Partial classes mean that you can define a class spanned across several files. Why is this great? Because it allows developers and automatic [...]]]></description>
			<content:encoded><![CDATA[<p>Partial classes are finally available to C++. Sort of. It&#8217;s not part of the new C++11 standard, it&#8217;s part of the C++/CX language developed by Microsoft for targeting WinRT on Windows 8.</p>
<p>Partial classes mean that you can define a class spanned across several files. Why is this great? Because it allows developers and automatic code generator tools (such as designers) to edit parts of the same class without interfering one with another. WinRT allows C++ developers to write UI in XAML. This could not have been possible without the support for partial classes. </p>
<p>Partial classes:</p>
<ul>
<li>are available only for ref classes; native classes are not supported</li>
<li>are introduced with the <strong>partial</strong> keyword in all definitions but one</li>
</ul>
<p>Here is an example:</p>
<pre class="cpp" name="code">
// foo.private.h
#pragma once

partial ref class foo // <- here the partial keyword is used
{
private:
   int _id;
   Platform::String^ _name;
};
</pre>
<pre class="cpp" name="code">
// foo.public.h
#pragma once
#include "foo.private.h"

ref class foo // <- partial keyword is not used here
{
public:
   int GetId();
   Platform::String^ GetName();
};
</pre>
<pre class="cpp" name="code">
// foo.cpp
#include "pch.h"
#include "foo.public.h"

int foo::GetId() {return _id;}
Platform::String^ foo::GetName {return _name;}
</pre>
<p>What happens when you add a new page to a C++ Metro style application? The wizard generates three files: a XAML file and a header and cpp file as the code behind. Let's say the page is called MainPage. In this case the three files are MainPage.xaml (code below is a dummy example), MainPage.xaml.h and MainPage.xaml.cpp.</p>
<pre class="cpp" name="code">
&lt;UserControl x:Class="DemoApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1366"&gt;

    &lt;StackPanel Name="firstPanel"&gt;
        &lt;Button Name="firstButon" /&gt;
    &lt;/StackPanel&gt;

&lt;/UserControl&gt;
</pre>
<pre class="cpp" name="code">
//
// MainPage.xaml.h
// Declaration of the MainPage.xaml class.
//

#pragma once

#include "pch.h"
#include "MainPage.g.h"

namespace DemoApp
{
   public ref class MainPage
   {
      public:
         MainPage();
         ~MainPage();
   };
}
</pre>
<pre class="cpp" name="code">
//
// MainPage.xaml.cpp
// Implementation of the MainPage.xaml class.
//

#include "pch.h"
#include "MainPage.xaml.h"

using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Data;
using namespace DemoApp;

MainPage::MainPage()
{
   InitializeComponent();
}

MainPage::~MainPage()
{
}
</pre>
<p>You can notice that the objects <em>firstPanel</em> and <em>firstButton</em> are not defined in the header for MainPage and second, MainPage.xaml.h includes MainPage.g.h. So what is this? This is a designer generated file, which together with MainPage.g.cpp completes the definition of the MainPage ref class. These files are not generated until you start a build. After you do that you can find them in the output folder (Debug or Release for instance). This is how they look:</p>
<pre class="cpp" name="code">
#pragma once
//------------------------------------------------------------------------------
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
//------------------------------------------------------------------------------

namespace Windows {
    namespace UI {
        namespace Xaml {
            namespace Controls {
                ref class StackPanel;
                ref class Button;
            }
        }
    }
}

namespace DemoApp
{
    partial ref class MainPage : public Windows::UI::Xaml::Controls::UserControl,
                                                     public Windows::UI::Xaml::Markup::IComponentConnector
    {
    public:
        void InitializeComponent();
        void Connect(int connectionId, Platform::Object^ pTarget);

    private:
        Windows::UI::Xaml::Controls::StackPanel^ firstPanel;
        Windows::UI::Xaml::Controls::Button^ firstButon;
    };
}
</pre>
<pre class="cpp" name="code">
//------------------------------------------------------------------------------
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
//------------------------------------------------------------------------------
#include "pch.h"

#include "MainPage.xaml.h"

using namespace Windows::Foundation;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Markup;
using namespace MyDemoApplication1;

void MainPage::InitializeComponent()
{
    // Call LoadComponent on ms-resource://DemoApp/Files/MainPage.xaml
    Windows::UI::Xaml::Application::LoadComponent(this, ref new Windows::Foundation::Uri("ms-resource://DemoApp/Files/MainPage.xaml"));

    // Get the StackPanel named 'firstPanel'
    firstPanel = safe_cast&lt;Windows::UI::Xaml::Controls::StackPanel^&gt;(static_cast&lt;IFrameworkElement^&gt;(this)->FindName("firstPanel"));

    // Get the Button named 'firstButon'
    firstButon = safe_cast&lt;Windows::UI::Xaml::Controls::Button^&gt;(static_cast&lt;IFrameworkElement^&gt;(this)->FindName("firstButon"));

}

void MainPage::Connect(int connectionId, Platform::Object^ pTarget)
{
}
</pre>
<p>The following image illustrates the grouping of these files:<br />
<img alt="" src="/blog/wp-content/uploads/2011/10/cpppartialclass.png" title="C++/CX partial classes" class="alignnone" width="771" height="410" /><br />
MainPage.xaml is a XAML files, which can be edited both by the designer or manually by the developer (basically with the designer is still the developer that models the UI). The other files are C++/CX files. MainPage.xaml.h and MainPage.xaml.cpp are the files the developer writes, while MainPage.g.h and MainPage.g.cpp are edited by the designer. Do not modify the code in these files, because you could either mess up the designer, or all your changes would get lost when the file is regenerated.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2011/10/13/cpp-winrt-and-partial-classes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Quick Start Developer Guide</title>
		<link>http://mariusbancila.ro/blog/2011/09/07/windows-phone-7-quick-start-developer-guide/</link>
		<comments>http://mariusbancila.ro/blog/2011/09/07/windows-phone-7-quick-start-developer-guide/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 21:01:55 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[codeguru]]></category>
		<category><![CDATA[eBook]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=1107</guid>
		<description><![CDATA[Earlier this year I published a series of articles on Codeguru about WP7 Silverlight development. Later on I have remastered them a bit and merged them together with a couple of articles by Vipul Patel into a small eBook that was published on internet.com, called Windows Phone 7 Quick Start Developer Guide. There is also [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://files.internet.com/ebook/WindowsPhone7QuickStartDeveloperGuide.jpg" title="Windows Phone 7 Quick Start Developer Guide" class="alignleft" width="100" height="129" />Earlier this year I <a href="http://mariusbancila.ro/blog/2011/02/02/windows-phone-7-tutorials/">published a series of articles</a> on Codeguru about WP7 Silverlight development. Later on I have remastered them a bit and merged them together with a couple of articles by Vipul Patel into a small eBook that was published on internet.com, called <a href="http://www.internet.com/ebook/SSOTarget/40890">Windows Phone 7 Quick Start Developer Guide</a>. There is also a ZIP archive with the <a href="http://www.codeguru.com/img/2010/12/WP7book_sourcecode.zip">source code</a> for all the sample projects presented throughout the book. While you can still find the articles online on the site, I recommend the eBook as a better learning material as it puts the various topics together.</p>
<p>The eBook is intended for developers with a fair knowledge of .NET programming that want to start developing Silverlight applications for Windows Phone 7. However, it is not a complete guide to Silverlight development for Windows Phone 7. The eBook covers a smaller set of Silverlight topics that is intended to prepare the reader for the most common challenges a Windows Phone 7 developer faces.</p>
<p>Here is the table of contents of the eBook. </p>
<ul>
<li>Preface</li>
<li>Where to Start</li>
<li>Creating a Simple Windows Phone Application: &#8220;Hello World!&#8221;</li>
<li>The Application Bar</li>
<li>Page Navigation</li>
<li>Tombstoning and Data Persistence</li>
<li>Pivot and Panorama</li>
<li>Launchers and Choosers</li>
<li>Touch</li>
<li>Using Bing Maps Control</li>
<li>App Hub: Application Submission Walkthrough</li>
<li>References</li>
<li>About the Authors</li>
</ul>
<p>Download the eBook from <a href="http://www.internet.com/ebook/SSOTarget/40890">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2011/09/07/windows-phone-7-quick-start-developer-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Colors Game in WPF</title>
		<link>http://mariusbancila.ro/blog/2011/05/10/new-colors-game-in-wpf/</link>
		<comments>http://mariusbancila.ro/blog/2011/05/10/new-colors-game-in-wpf/#comments</comments>
		<pubDate>Tue, 10 May 2011 20:48:54 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[ColorsGame]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=960</guid>
		<description><![CDATA[Last year I posted a small MFC application on my blog, called Colors Game, about covering with a single color a grid initially colored in six colors. It wasn&#8217;t a big deal of an application, but it was fun and recently I decided to write a WPF version of that MFC game. This is the [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I posted a small MFC application on my blog, called <a href="http://mariusbancila.ro/blog/2010/08/04/colors-game/">Colors Game</a>, about covering with a single color a grid initially colored in six colors. It wasn&#8217;t a big deal of an application, but it was fun and recently I decided to write a WPF version of that MFC game. This is the result:</p>
<p><img alt="" src="http://www.mariusbancila.ro/games/colorsgame/colorsgamescreenshot.png" title="ColorsGame screenshot" class="alignnone" width="800" height="600" /></p>
<p>The game is about covering in a single color a grid that starts with each cell colored randomly with one of six possible colors. You must expand the working region initially defined my the top-left cell throughout the entire grid. You select to color this working region with a new color that should match the color of neighboring cells. These cells are then merged into the working region. The game ends when you covered the grid in a single color. However, each level has a maximum allowed number of moves (or colorings) that you can do, and you only complete (or win) the level if you don’t exceed this number.</p>
<p>The image below shows how the working region expands towards the entire grid.<br />
<img alt="" src="http://www.mariusbancila.ro/games/colorsgame/colorgamesprogress.png" title="ColorsGame progress" class="alignnone" width="612" height="402" /></p>
<p>This new game has a more appealing interface and a richer set of features:</p>
<ul>
<li>can select any of the available levels</li>
<li>you can change color themes for windows and for the grid</li>
<li>view statistics about your previous plays in any level</li>
<li>progress and settings are stored on disk and automatically reloaded when starting the application again</li>
</ul>
<p>The game is described in details on this dedicated <a href="http://mariusbancila.ro/blog/games/colors-game/">page</a>. If you download an install the game, you should read that before playing.</p>
<p>If you find the game too easy, then I propose to use one of the more challenging color themes such as the Back and White one. Here is a screenshot:<br />
<img alt="" src="/blog/wp-content/uploads/2011/05/colorsgameblackandwhite.png" title="Black and White" class="alignnone" width="800" height="600" /></p>
<p>Download the latest version of the game from <a href="http://mariusbancila.ro/blog/games/colors-game/">here</a> and enjoy it!</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2011/05/10/new-colors-game-in-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Tutorials</title>
		<link>http://mariusbancila.ro/blog/2011/02/02/windows-phone-7-tutorials/</link>
		<comments>http://mariusbancila.ro/blog/2011/02/02/windows-phone-7-tutorials/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 13:15:44 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=838</guid>
		<description><![CDATA[Throughout January I have published on codeguru.com a series of articles about developing Silverlight applications for Windows Phone 7. Here is the list of articles: Windows Phone 7 Quick Tutorials: Part 1 &#8211; Hello World Windows Phone 7 Quick Tutorials: Part 2 &#8211; The Application Bar Windows Phone 7 Quick Tutorials: Part 3 &#8211; Page [...]]]></description>
			<content:encoded><![CDATA[<p>Throughout January I have published on codeguru.com a series of articles about developing Silverlight applications for Windows Phone 7. Here is the list of articles:</p>
<ul>
<li><a href="http://www.codeguru.com/csharp/.net/net_silverlight/article.php/c18349/">Windows Phone 7 Quick Tutorials: Part 1 &#8211; Hello World</a></li>
<li><a href="http://www.codeguru.com/csharp/.net/net_silverlight/article.php/c18375/">Windows Phone 7 Quick Tutorials: Part 2 &#8211; The Application Bar</a></li>
<li><a href="http://www.codeguru.com/csharp/.net/net_silverlight/article.php/c18389/">Windows Phone 7 Quick Tutorials: Part 3 &#8211; Page Navigation</a></li>
<li><a href="http://www.codeguru.com/csharp/.net/net_silverlight/article.php/c18397/">Windows Phone 7 Quick Tutorials: Part 4 &#8211; Tombstoning and Data Persistence</a></li>
<li><a href="http://www.codeguru.com/csharp/.net/net_silverlight/article.php/c18413/">Windows Phone 7 Quick Tutorials: Part 5 &#8211; Pivot and Panorama</a></li>
<li><a href="http://www.codeguru.com/csharp/.net/net_silverlight/article.php/c18419/">Windows Phone 7 Quick Tutorials: Part 6 &#8211; Launchers and Choosers</a></li>
<li><a href="http://www.codeguru.com/csharp/.net/net_silverlight/article.php/c18445/">Windows Phone 7 Quick Tutorials: Part 7 &#8211; Touch</a></li>
</ul>
<p>If you want to develop for WP7 you need to install the Windows Phone 7 Developer Tools. They are available to download for free at <a href="http://create.msdn.com/">AppHub</a>, or using this direct <a href="http://go.microsoft.com/fwlink/?LinkId=185584">link</a>. You might also want to install the <a href="http://silverlight.codeplex.com/">Silverlight for Windows Phone Toolkit</a> that provides additional controls (such as WrapPanel, DatePicker, TimePicker, etc.) and higher-level support for touch.</p>
<p>Here is a list of recommended additional readings:</p>
<ul>
<li>Charles Petzold&#8217;s <a href="http://www.charlespetzold.com/phone/index.html">Programming Windows Phone 7</a></li>
<li>Scott Guthrie&#8217;s <a href="http://weblogs.asp.net/scottgu/archive/2010/09/16/windows-phone-7-developer-tools-released.aspx">Windows Phone 7 Developer Tools Released</a></li>
<li><a href="http://go.microsoft.com/fwlink/?LinkID=183218">UI Design and Interaction Guide for Windows Phone 7 v2.0</a></li>
<li>Vincent Leung&#8217;s <a href="http://vincenthomedev.wordpress.com/2010/10/30/windows-phone-7-cheat-sheet/">Windows Phone 7 Cheat Sheet</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ff426934%28v=VS.95%29.aspx">Silverlight for Windows Phone (MSDN)</a></li>
<li><a href="http://refcardz.dzone.com/refcardz/developing-silverlight">Developing a Silverlight Application for Windows Phone 7</a></li>
<li>Cheryl Simmons&#8217; <a href="http://blogs.msdn.com/b/silverlight_sdk/archive/2011/01/07/windows-phone-7-design-guidelines-cheat-sheet.aspx?wa=wsignin1.0">Windows Phone 7 Design Guidelines – Cheat Sheet</a></li>
<li>Adam Kinney&#8217;s <a href="http://adamkinney.com/blog/2010/09/23/windows-phone-7-gestures-cheat-sheet/">Windows Phone 7 Gestures Cheat Sheet</a></li>
</ul>
<p>Enjoy the tutorials!</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2011/02/02/windows-phone-7-tutorials/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How To Determine the Platform Architecture for a .NET Assembly</title>
		<link>http://mariusbancila.ro/blog/2010/10/29/how-to-determine-the-platform-architecture-for-a-net-assembly/</link>
		<comments>http://mariusbancila.ro/blog/2010/10/29/how-to-determine-the-platform-architecture-for-a-net-assembly/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 07:15:40 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[reflector]]></category>
		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=770</guid>
		<description><![CDATA[I&#8217;m using Red Gate&#8217;s .NET Reflector for decompiling .NET assemblies. It&#8217;s a great tool but it lacks, at least in the free version I&#8217;m using, information about the platform architecture of an assembly. Sometimes I want to know whether an assembly was built for Any CPU, x86 or x64. The tool that help you find [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://www.red-gate.com/products/reflector/">Red Gate&#8217;s .NET Reflector</a> for decompiling .NET assemblies. It&#8217;s a great tool but it lacks, at least in the free version I&#8217;m using, information about the platform architecture of an assembly. Sometimes I want to know whether an assembly was built for Any CPU, x86 or x64. </p>
<p>The tool that help you find this information is <a href="http://msdn.microsoft.com/en-us/library/ms164699%28VS.80%29.aspx">CorFlags.exe</a> from Windows SDK. It displays or configures the corflags section of a PE image. Here is an example of the output of corflags.exe:</p>
<pre class="prettyprint">
Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 1
ILONLY    : 1
32BIT     : 0
Signed    : 0
</pre>
<p>The platform architecture is encoded in a combination of the PE and 32BIT flags:</p>
<ul>
<li><strong>Any CPU</strong>: PE=PE32 and 32BIT=0</li>
<li><strong>x86</strong>: PE=PE32 and 32BIT=1</li>
<li><strong>64-bit</strong>: PE=PE32+ and 32BIT=0</li>
</ul>
<p>So for the example above, PE is PE32 and 32BIT is 0, thus the platform architecture is Any CPU.</p>
<p>You can read more about this tool on <a href="http://blogs.msdn.com/b/gauravseth/archive/2006/03/07/545104.aspx">Gaurav Seth&#8217;s blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2010/10/29/how-to-determine-the-platform-architecture-for-a-net-assembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alchemy Update: 50 New Elements and Hints</title>
		<link>http://mariusbancila.ro/blog/2010/10/06/alchemy-update-50-new-elements-and-hints/</link>
		<comments>http://mariusbancila.ro/blog/2010/10/06/alchemy-update-50-new-elements-and-hints/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 19:22:15 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[Alchemy]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[alchemy]]></category>
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=730</guid>
		<description><![CDATA[Alchemy 1.3 is the latest update of Alchemy for Windows that brings 50 new exciting elements (taking the total to 350) and new features such as hints. The new elements in this release are focused on games; they include games such as Starcraft, Warcraft, Need For Speed, Tomb Rider, Resident Evil, characters such as Mario, [...]]]></description>
			<content:encoded><![CDATA[<p>Alchemy 1.3 is the latest update of Alchemy for Windows that brings 50 new exciting elements (taking the total to 350) and new features such as hints. The new elements in this release are focused on games; they include games such as Starcraft, Warcraft, Need For Speed, Tomb Rider, Resident Evil, characters such as Mario, Luigi, Yoshi, Jim Raynor, Zeratul, Queen of Blades, Lich King, and the races Zerg, Protoss, Terran, Fire Elemental.</p>
<p><img alt="Alchemy 1.3 new elements" src="/blog/wp-content/uploads/2010/10/alchemy_13.png" class="alignnone" width="386" height="408" /></p>
<p>The new elements are:</p>
<table border=0 cellpadding=0 cellspacing=0 width=300 style='border-collapse:<br />
 collapse;table-layout:fixed;width:226pt'><br />
<col width=150 span=2 style='mso-width-source:userset;mso-width-alt:5485;<br />
 width:113pt'><br />
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 width=150 style='height:15.0pt;width:113pt'>Aluminium</td>
<td class=xl1519377 width=150 style='width:113pt'>Phoenix</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Ant</td>
<td class=xl1519377>Protoss</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Boo mushroom</td>
<td class=xl1519377>Queen of Blades</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Computer game</td>
<td class=xl1519377>Resident Evil</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Diet</td>
<td class=xl1519377>Robot</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Easter egg</td>
<td class=xl1519377>Rust</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Faberge egg</td>
<td class=xl1519377>Salamander</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Fire elemental</td>
<td class=xl1519377>Sniper</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Frog</td>
<td class=xl1519377>Spinning wheel</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Infestation</td>
<td class=xl1519377>Starcraft</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Insects</td>
<td class=xl1519377>Sushi</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Jim Raynor</td>
<td class=xl1519377>Team</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>King</td>
<td class=xl1519377>Termite</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Lara Croft</td>
<td class=xl1519377>Terran</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Leach</td>
<td class=xl1519377>Tomb Raider</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Lich King</td>
<td class=xl1519377>Undead</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Lighthouse</td>
<td class=xl1519377>Vinegar</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Luigi</td>
<td class=xl1519377>Vulture</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Mantis</td>
<td class=xl1519377>Warcraft</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Mario</td>
<td class=xl1519377>Weevil</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Mosquito</td>
<td class=xl1519377>Yarn</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Need for Speed</td>
<td class=xl1519377>Yoshi</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Obesity</td>
<td class=xl1519377>Yoshi egg</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>OneUP</td>
<td class=xl1519377>Zeratul</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1519377 style='height:15.0pt'>Paint</td>
<td class=xl1519377>Zerg</td>
</tr>
</table>
<p>You can find the list with all the 350 elements in Alchemy 1.3 <a href="http://www.mariusbancila.ro/blog/wp-content/uploads/2010/10/alchemyelementsv13.txt">here</a>.</p>
<p>One new cool feature is the availability of hints. Press the new Hints button and a window pops-up displaying one possible element you can create, indicating also one of the two elements used to create it. To close the hints window, just click anywhere on it.<br />
<img alt="" src="/blog/wp-content/uploads/2010/10/alchemy_hints.png" title="Alchemy 1.3 hints" class="alignnone" width="250" height="170" /></p>
<p>Another feature available in version 1.3 is adding elements to the desktop area by double clicking on them in the unlocked elements list. Terminal elements cannot be added to the desktop.</p>
<p><strong>Note</strong>: if you already played Alchemy, just replace the old executable with the new one. Don’t delete the user settings file having your account name and extension .aus, or you loose the elements and combinations you unlocked so far.</p>
<p>Download the latest version from <a href="http://mariusbancila.ro/blog/games/alchemy/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2010/10/06/alchemy-update-50-new-elements-and-hints/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Alchemy for Windows</title>
		<link>http://mariusbancila.ro/blog/2010/09/20/alchemy-for-windows/</link>
		<comments>http://mariusbancila.ro/blog/2010/09/20/alchemy-for-windows/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 18:44:02 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[Alchemy]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[alchemy]]></category>
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=675</guid>
		<description><![CDATA[I have played recently a great game on Android, called Alchemy, created by Andrey Zaikin. You start with four basic elements, Fire, Water, Air and Earth and you can combine them to get more and more elements. The game was so catching that after finishing it I decided to write my own version for Windows. [...]]]></description>
			<content:encoded><![CDATA[<p>I have played recently a great game on Android, called <a href="http://www.androidtapp.com/alchemy/">Alchemy</a>, created by <a href="http://zed.0xff.me/">Andrey Zaikin</a>. You start with four basic elements, Fire, Water, Air and Earth and you can combine them to get more and more elements. The game was so catching that after finishing it I decided to write my own version for Windows. I chose WPF because I wanted to learn it and because I realized the stuff I wanted to create was too hard to do in MFC. This is my first real application in WPF, and what you see is the result of 4 days of work; in MFC it could have been 4 months, I believe.</p>
<p><a href="/blog/wp-content/uploads/2010/09/alchemy1.png"><img alt="" src="/blog/wp-content/uploads/2010/09/alchemy1.png" title="Alchemy for Windows" class="alignnone" width="850" /></a></p>
<p>You start with the four basic elements: air, earth, fire and water. You can combine them by dragging onto each other on the central area of the window, &#8220;the desktop&#8221;. When new elements are created they are added to one of the two lists from the left area. The top list has elements that can be combined again. The bottom list contains terminal elements, i.e. elements that can no longer be combined. You can drag elements from the non-terminals list back to the desktop area, but not from the terminals list.</p>
<p>You can quickly bring onto the desktop the four basic elements by double clicking on an empty area of it. Double clicking on an element from the desktop creates a duplicate of it. You can remove an element from the desktop by dragging it over the trash can icon. You can remove all the elements from the desktop by double clicking on the trash can.</p>
<p>When the number of elements gets too big scrolling through the list might be cumbersome. You can use the search textbox to filter the elements in the list. As you type only the elements that contain the typed text are displayed. It you press the X button of the textbox or clear its content, the list displays again all the unlocked elements.</p>
<p><img alt="" src="/blog/wp-content/uploads/2010/09/alchemy3.png" title="Filter the elements list" class="alignnone" width="306" height="176" /></p>
<p>On the right area of the window you find a help pane. When you select an element from one of the two lists on the left side, you can see a list of all the unlocked combinations in which the elements appears (either as input or output). </p>
<p>There are also several buttons: Cheat, Wikipedia, Help and About. Button Cheat opens a new window that displays the list of all available elements. So if you get stuck and don&#8217;t know what elements are left to discover you can cheat and see the list.</p>
<p><img alt="" src="/blog/wp-content/uploads/2010/09/alchemy2.png" title="Cheat window" class="alignnone" width="380" height="502" /></p>
<p>Button Wikipedia starts a search on Wikipedia for the currently selected element. Buttons Help and About display information about the game.</p>
<p>Note that your game progress is saved when you close the game and loaded when you start again. The information is stored in a file with your Windows user name and extension .aus. Don&#8217;t delete the file or you lose your game progress.</p>
<p>Here is the alphabetical list of all the 210 elements available in version 1.0:</p>
<table border=0 cellpadding=0 cellspacing=0 width=657 style='border-collapse:<br />
 collapse;table-layout:fixed;width:494pt'><br />
<col width=134 style='mso-width-source:userset;mso-width-alt:4900;width:101pt'>
<col width=125 style='mso-width-source:userset;mso-width-alt:4571;width:94pt'>
<col width=129 style='mso-width-source:userset;mso-width-alt:4717;width:97pt'>
<col width=142 style='mso-width-source:userset;mso-width-alt:5193;width:107pt'>
<col width=127 style='mso-width-source:userset;mso-width-alt:4644;width:95pt'>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 width=134 style='height:15.0pt;width:101pt'>Air</td>
<td class=xl1516279 width=125 style='width:94pt'>Cochineal</td>
<td class=xl1516279 width=129 style='width:97pt'>Gunpowder</td>
<td class=xl1516279 width=142 style='width:107pt'>Ozone</td>
<td class=xl1516279 width=127 style='width:95pt'>Soldier</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Airplane</td>
<td class=xl1516279>Coffin</td>
<td class=xl1516279>Hippopotamus</td>
<td class=xl1516279>Panda</td>
<td class=xl1516279>Star</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Alcohol</td>
<td class=xl1516279>Combustion engine</td>
<td class=xl1516279>Hourglass</td>
<td class=xl1516279>Paper</td>
<td class=xl1516279>Starfish</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Algae</td>
<td class=xl1516279>Computer</td>
<td class=xl1516279>House</td>
<td class=xl1516279>Pearl</td>
<td class=xl1516279>Steam</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Arable</td>
<td class=xl1516279>Concrete</td>
<td class=xl1516279>Hunter</td>
<td class=xl1516279>Penguin</td>
<td class=xl1516279>Steam engine</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Arm</td>
<td class=xl1516279>Continent</td>
<td class=xl1516279>Hut</td>
<td class=xl1516279>Penicillin</td>
<td class=xl1516279>Steamer</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Ash</td>
<td class=xl1516279>Corpse</td>
<td class=xl1516279>Hydrogen</td>
<td class=xl1516279>Perfume</td>
<td class=xl1516279>Stone</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Assassin</td>
<td class=xl1516279>Country</td>
<td class=xl1516279>Ice</td>
<td class=xl1516279>Petroleum</td>
<td class=xl1516279>Storm</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Bacteria</td>
<td class=xl1516279>Darth Vader</td>
<td class=xl1516279>Jedi</td>
<td class=xl1516279>Pie</td>
<td class=xl1516279>Sulfur</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Barbeque</td>
<td class=xl1516279>Desert</td>
<td class=xl1516279>Kerogen</td>
<td class=xl1516279>Pinocchio</td>
<td class=xl1516279>Sun</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Beach</td>
<td class=xl1516279>Diamond</td>
<td class=xl1516279>Knife</td>
<td class=xl1516279>Pizza</td>
<td class=xl1516279>Swamp</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Bear</td>
<td class=xl1516279>Dinosaur</td>
<td class=xl1516279>Lava</td>
<td class=xl1516279>Planet</td>
<td class=xl1516279>Tequila</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Beast</td>
<td class=xl1516279>Dough</td>
<td class=xl1516279>Library</td>
<td class=xl1516279>Plankton</td>
<td class=xl1516279>The Beatles</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Beer</td>
<td class=xl1516279>Dragon</td>
<td class=xl1516279>Lichen</td>
<td class=xl1516279>Plesiosaur</td>
<td class=xl1516279>Thunderstorm</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Beetle</td>
<td class=xl1516279>Dragonfly</td>
<td class=xl1516279>Life</td>
<td class=xl1516279>Poison</td>
<td class=xl1516279>Tiger</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Bicycle</td>
<td class=xl1516279>Dust</td>
<td class=xl1516279>Light</td>
<td class=xl1516279>Poisoned weapon</td>
<td class=xl1516279>Time</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Bird</td>
<td class=xl1516279>Earth</td>
<td class=xl1516279>Lightbulb</td>
<td class=xl1516279>Polar Bear</td>
<td class=xl1516279>Tom and Jerry</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Bitumen</td>
<td class=xl1516279>Egg</td>
<td class=xl1516279>Lightsaber</td>
<td class=xl1516279>Pressure</td>
<td class=xl1516279>Tool</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Boat</td>
<td class=xl1516279>Electricity</td>
<td class=xl1516279>Lime</td>
<td class=xl1516279>Pterosaur</td>
<td class=xl1516279>Tornado</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Boiler</td>
<td class=xl1516279>Energy</td>
<td class=xl1516279>Limestone</td>
<td class=xl1516279>Radar</td>
<td class=xl1516279>Tortoise</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Book</td>
<td class=xl1516279>Fern</td>
<td class=xl1516279>Livestock</td>
<td class=xl1516279>Radio</td>
<td class=xl1516279>Transistor</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Bread</td>
<td class=xl1516279>Fire</td>
<td class=xl1516279>Lizard</td>
<td class=xl1516279>Rain</td>
<td class=xl1516279>Tree</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Brick</td>
<td class=xl1516279>Firearm</td>
<td class=xl1516279>Locomotive</td>
<td class=xl1516279>Rainbow</td>
<td class=xl1516279>Turtle</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Butterfly</td>
<td class=xl1516279>Fish</td>
<td class=xl1516279>Man</td>
<td class=xl1516279>Sand</td>
<td class=xl1516279>Uncut diamond</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Cactus</td>
<td class=xl1516279>Fisherman</td>
<td class=xl1516279>Manure</td>
<td class=xl1516279>Santa claus</td>
<td class=xl1516279>Universe</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Car</td>
<td class=xl1516279>Flour</td>
<td class=xl1516279>Meat</td>
<td class=xl1516279>Scarab</td>
<td class=xl1516279>Vodka</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Carbon dioxide</td>
<td class=xl1516279>Flower</td>
<td class=xl1516279>Metal</td>
<td class=xl1516279>Scientist</td>
<td class=xl1516279>Volcano</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Carmine</td>
<td class=xl1516279>Flu</td>
<td class=xl1516279>Milk</td>
<td class=xl1516279>Scissors</td>
<td class=xl1516279>Wagon</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Cat</td>
<td class=xl1516279>Fly</td>
<td class=xl1516279>Mite</td>
<td class=xl1516279>Scorpion</td>
<td class=xl1516279>Warrior</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Caviar</td>
<td class=xl1516279>Fondue</td>
<td class=xl1516279>Mold</td>
<td class=xl1516279>Seed</td>
<td class=xl1516279>Water</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Cement</td>
<td class=xl1516279>Forest</td>
<td class=xl1516279>Monkey</td>
<td class=xl1516279>Shark</td>
<td class=xl1516279>Watermelon</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Cheese</td>
<td class=xl1516279>Fossil</td>
<td class=xl1516279>Moon</td>
<td class=xl1516279>Shell</td>
<td class=xl1516279>Whale</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Chicken</td>
<td class=xl1516279>Fruit</td>
<td class=xl1516279>Moss</td>
<td class=xl1516279>Silicon</td>
<td class=xl1516279>Wheat</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Chip</td>
<td class=xl1516279>Fugu</td>
<td class=xl1516279>Motorboat</td>
<td class=xl1516279>Sith</td>
<td class=xl1516279>Wheel</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Christmas tree</td>
<td class=xl1516279>Galaxy</td>
<td class=xl1516279>Motorcycle</td>
<td class=xl1516279>Sky</td>
<td class=xl1516279>Wind</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>City</td>
<td class=xl1516279>Gasoline</td>
<td class=xl1516279>Mouse</td>
<td class=xl1516279>Skyscraper</td>
<td class=xl1516279>Wine</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Clay</td>
<td class=xl1516279>Geyser</td>
<td class=xl1516279>Mud</td>
<td class=xl1516279>Snail</td>
<td class=xl1516279>Wood</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Cloth</td>
<td class=xl1516279>Ghost</td>
<td class=xl1516279>Mushroom</td>
<td class=xl1516279>Snake</td>
<td class=xl1516279>Wooden ship</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Clothing</td>
<td class=xl1516279>Glass</td>
<td class=xl1516279>Ocean</td>
<td class=xl1516279>Snow</td>
<td class=xl1516279>Wool</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Cloud</td>
<td class=xl1516279>Grape</td>
<td class=xl1516279>Old man</td>
<td class=xl1516279>Snowman</td>
<td class=xl1516279>Worm</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Coal</td>
<td class=xl1516279>Grass</td>
<td class=xl1516279>Omelette</td>
<td class=xl1516279>Soda water</td>
<td class=xl1516279>Yeast</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=xl1516279 style='height:15.0pt'>Coca cola</td>
<td class=xl1516279>Grove</td>
<td class=xl1516279>Oxygen</td>
<td class=xl1516279>Solar system</td>
<td class=xl1516279>Yogurt</td>
</tr>
</table>
<p><strong>Note</strong>: In order to run the game you need .NET framework 3.5 SP1.</p>
<p>Stay tuned, updates with more elements are coming!</p>
<p><strong>Update</strong>: Download the latest version from <a href="http://mariusbancila.ro/blog/games/alchemy/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2010/09/20/alchemy-for-windows/feed/</wfw:commentRss>
		<slash:comments>163</slash:comments>
		</item>
		<item>
		<title>Resources for the F# Presentation at Ronua Roadshow</title>
		<link>http://mariusbancila.ro/blog/2010/07/18/resources-for-the-f-presentation-at-ronua-roadshow/</link>
		<comments>http://mariusbancila.ro/blog/2010/07/18/resources-for-the-f-presentation-at-ronua-roadshow/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 08:51:49 +0000</pubDate>
		<dc:creator>Marius Bancila</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[ronua]]></category>
		<category><![CDATA[VS2010]]></category>

		<guid isPermaLink="false">http://mariusbancila.ro/blog/?p=641</guid>
		<description><![CDATA[For those that attended my last evening presentation about F# at Ronua Roadshow in Timisoara (but not only), here is the demo I&#8217;ve shown, and one that I planned to show but didn&#8217;t due to lack of time. The purpose of these demos was to shown simple Windows Forms applications written in F#. Mandelbrot Fractal [...]]]></description>
			<content:encoded><![CDATA[<p>For those that attended my last evening presentation about F# at Ronua Roadshow in Timisoara (but not only), here is the demo I&#8217;ve shown, and one that I planned to show but didn&#8217;t due to lack of time. The purpose of these demos was to shown simple Windows Forms applications written in F#.</p>
<p><strong>Mandelbrot Fractal</strong><br />
A Mandelbrot set is a set of points in the complex plane, whose boundary forms a fractal. The fractal, known as Mandelbrot fractal, is obtain by associating a color with each point in the complex plane (or rather a subset of it). The color is chosen based on the result of computing the value of the complex quadratic polynomial Z(n+1) = Z(n)^2 + c for a number of iterations (100, 200, etc.). You can read more about it on <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Wikipedia</a>.</p>
<p>The program that I shown exhibits traits of both functional (for computing the fractal) and object oriented (for displaying the fractal) paradigms. It is a variation of the program available <a href="http://secretgeek.net/fsharp_mandelbrot2.asp">here</a>, for which I kept the functional part (computing the Mandelbrot set is not very fast, I must warn you), but redone the user interface part. You can use the mouse to drag the fractal and the wheel to zoom in and out.</p>
<p><img alt="" src="/blog/wp-content/uploads/2010/07/fsharp_mandelbrot.png" title="Mandelbrot fractal" class="alignnone" width="600" height="414" /></p>
<p>You can download it from <a href="http://www.mariusbancila.ro/blog/wp-content/uploads/2010/07/mandelbrot.zip">here</a>.</p>
<p><strong>Game of Life</strong><br />
I <a href="http://mariusbancila.ro/blog/2008/05/08/game-of-life-in-f/">blogged</a> about this two years ago, when F# was still far from a final release. In the meantime, syntax has changed, classes have changed, so if you try to run that implementation of mine you&#8217;ll run into some errors. I have updated the code to run correctly with Visual Studio 2010.</p>
<p><img alt="" src="/blog/wp-content/uploads/2010/07/fsharp_gameoflife.png" title="Game of Life" class="alignnone" width="641" height="483" /></p>
<p>You can download it from <a href="http://www.mariusbancila.ro/blog/wp-content/uploads/2010/07/mandelbrot.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mariusbancila.ro/blog/2010/07/18/resources-for-the-f-presentation-at-ronua-roadshow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

