<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>codesling</title>
        <link>http://geekswithblogs.net/Erik/Default.aspx</link>
        <description>[FP, cores] |&gt; future</description>
        <language>en-US</language>
        <copyright>Erik Araojo</copyright>
        <managingEditor>erik_araojo@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>codesling</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/Erik/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>WCFStorm version 1.1 is released</title>
            <link>http://geekswithblogs.net/Erik/archive/2009/07/30/133826.aspx</link>
            <description>&lt;p&gt;A few months ago I've promised that version 1.1 will be released in July.  Today I make good on that promise and am happy to announce that version 1.1 is ready for download!&lt;/p&gt;
&lt;p&gt;A very big thanks goes out to those who not only have purchased WCFStorm but also provided valuable feedback in terms of feature requests and bug reports.  Thank you very much guys.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Below are the &lt;strong&gt;main features of version 1.1&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Loading of existing client App.config files into WCFStorm &lt;/li&gt;
    &lt;li&gt;One-click execution of all functional test cases under a method or of the whole WCF service. &lt;/li&gt;
    &lt;li&gt;A plugin interface for custom validations of functional test cases. &lt;/li&gt;
    &lt;li&gt;A plugin interface for randomizing requests or re-using the previous response as input to the next request. &lt;/li&gt;
    &lt;li&gt;A plugin interface for programmatically modifying the ServiceEndpoint instance &lt;/li&gt;
    &lt;li&gt;A plugin interface to support Duplex services &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here's the full list of &lt;a href="http://www.wcfstorm.com/wcf/whats-new-in-version-11.aspx"&gt;what's new in 1.1&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133826"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133826" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/133826.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2009/07/30/133826.aspx</guid>
            <pubDate>Fri, 31 Jul 2009 03:44:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/133826.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2009/07/30/133826.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/133826.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/133826.aspx</trackback:ping>
        </item>
        <item>
            <title>WCFStorn : How to create and execute a functional test case</title>
            <link>http://geekswithblogs.net/Erik/archive/2009/04/07/130799.aspx</link>
            <description>If you're not yet familiar on how to add a service and invoke a method, please see &lt;font size="3"&gt; &lt;a href="../../../../Erik/archive/2009/04/04/130731.aspx"&gt;Getting Started&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;The short video below shows how to create and execute a functional test case in WCFStorm.  Towards the end of the video, it shows one of the main features of functional testing with WCFStorm - which is the ability to visually view the difference between the expected and actual responses in a test.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;font size="3"&gt;&lt;/font&gt;&lt;embed src="http://www.youtube.com/v/SHpvL5DGSgU&amp;amp;hl=en&amp;amp;fs=1" width="425" height="344" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"&gt;&lt;/embed&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130799"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130799" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/130799.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2009/04/07/130799.aspx</guid>
            <pubDate>Wed, 08 Apr 2009 02:48:51 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/130799.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2009/04/07/130799.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/130799.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/130799.aspx</trackback:ping>
        </item>
        <item>
            <title>WCFStorm : How to create and run a performance test case</title>
            <link>http://geekswithblogs.net/Erik/archive/2009/04/07/130793.aspx</link>
            <description>&lt;p&gt;If you're not yet familiar on how to add a service and invoke a method, please see  &lt;font style="FONT-WEIGHT: bold" size="3"&gt;&lt;a href="http://geekswithblogs.net/Erik/archive/2009/04/04/130731.aspx"&gt;Getting Started&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The video below shows the steps on how to create and run performance test cases.  When a performance test case is executed, WCFStorm captures the responses and displays a graph in real-time the actual and average response times as well the rate at which the service is responding the method invocations.&lt;/p&gt;
&lt;h3&gt;The following are the performance test parameters&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Number of agents&lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;This is the number of background workers that will repeatedly invoke the service method until the test is stopped or the test duration has completed. &lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Rampup &lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;This is the interval in seconds at which the agents are created.  For example, if the rampup value is "1", every second, WCFStorm will create an agent until it has reached the specified number of agents&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Test duration&lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;This is the test duration in seconds&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Invoke interval&lt;/span&gt;
    &lt;ul&gt;
        &lt;li&gt;This is the interval in &lt;span style="BACKGROUND-COLOR: rgb(255,255,153)"&gt;milliseconds &lt;/span&gt;at which an agent repeatedly invokes a service method&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sample Perf Test setup&lt;/strong&gt;&lt;/p&gt;
&lt;ol style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
    &lt;ol&gt;
        &lt;li&gt;Constant Load
        &lt;ul&gt;
            &lt;li&gt;This can be achieved by setting the "Rampup" value to &lt;font color="#800000"&gt;zero&lt;/font&gt;&lt;/li&gt;
        &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li&gt;Incrementing number of users
        &lt;ul&gt;
            &lt;li&gt;Set "Rampup" and "Number of Agents" to a non-zero value.&lt;/li&gt;
        &lt;/ul&gt;
        &lt;/li&gt;
    &lt;/ol&gt;
&lt;/ol&gt;
&lt;p dir="ltr"&gt; &lt;/p&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;object width="425" height="344"&gt;
&lt;p&gt;&lt;embed height="344" type="application/x-shockwave-flash" width="425" src="http://www.youtube.com/v/PEO88hvXAew&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xcfcfcf&amp;amp;hl=en&amp;amp;feature=player_embedded&amp;amp;fs=1" allowfullscreen="true"&gt;&lt;/embed&gt;&lt;/p&gt;
&lt;/object&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;Some screenshots&lt;/h3&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="639" height="386" src="/images/geekswithblogs_net/Erik/WcfStorm/WcfStormPerfTest2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="634" height="384" src="/images/geekswithblogs_net/Erik/WcfStorm/WcfStormPerfTest.jpg" /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130793"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130793" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/130793.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2009/04/07/130793.aspx</guid>
            <pubDate>Tue, 07 Apr 2009 21:52:50 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/130793.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2009/04/07/130793.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/130793.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/130793.aspx</trackback:ping>
        </item>
        <item>
            <title>WCFStorm : Testing a service having multiple bindings</title>
            <link>http://geekswithblogs.net/Erik/archive/2009/04/04/130732.aspx</link>
            <description>&lt;p&gt;In order for &lt;a href="http://geekswithblogs.net/Erik/archive/2009/04/02/130664.aspx"&gt;WCFStorm&lt;/a&gt; to invoke a service having a netTcp endpoint, the service must be configured to expose the WSDL via http.  A sample config for the WCF service will be,&lt;/p&gt;
&lt;p&gt; &lt;img alt="" src="http://www.fileden.com/files/2009/4/1/2388287/MultipleBinding.Png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In above configuration, the service is using 3 bindings.  mexHttpBindings is used to expose the WSDL, while netTcpBinding and wsHttpBinding are for the actual methods calls. To test the serivice using WCFStorm, use the mexHttpBinding url to add the service.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.fileden.com/files/2009/4/1/2388287/AddServiceEndpoint.Png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.fileden.com/files/2009/4/1/2388287/DiscoverMultipleLog.Png" /&gt;  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;As  can be seen from the log, the tool detected both the netTcpBinding and WsHttpBindings.  If we select a method and invoke it ( (please see &lt;a href="http://geekswithblogs.net/Erik/archive/2009/04/04/130731.aspx"&gt;getting started&lt;/a&gt; on the steps to invoke a method) , the tool will select the endpoint that was declared first (which is NetTcpBinding).  If you'd like to use the other endoint, wsHttpBinding, right-click the service and select "ModifyEndpoint"  &lt;/p&gt;
&lt;p&gt;           &lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.fileden.com/files/2009/4/1/2388287/modifyEndpoint.png" /&gt;&lt;/p&gt;
&lt;p&gt;     &lt;/p&gt;
&lt;p&gt; This will bring up a form which lets you choose the binding that you'd like to use.  Click on the dropdown to select a new binding.  You can also specify a new endpoint address in this form.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.fileden.com/files/2009/4/1/2388287/selectBinding.png" /&gt;  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; Click OK to use the selected binding.  This will trigger WCFStorm to regenerate a proxy class that uses the new binding. All subsequent method invocations will now use the new proxy (and hence the new binding).&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130732"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130732" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/130732.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2009/04/04/130732.aspx</guid>
            <pubDate>Sat, 04 Apr 2009 19:57:39 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/130732.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2009/04/04/130732.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/130732.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/130732.aspx</trackback:ping>
        </item>
        <item>
            <title>WCFStorm : How To's</title>
            <link>http://geekswithblogs.net/Erik/archive/2009/04/04/130731.aspx</link>
            <description>&lt;p&gt;&lt;em&gt;EDIT : Please visit &lt;/em&gt;&lt;a href="http://www.wcfstorm.com/wcf/learn-more.aspx"&gt;&lt;em&gt;www.wcfstorm.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt; for th updated tutorials.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This is a first in a series for post describing the tasks and the features available in&lt;a href="http://geekswithblogs.net/Erik/archive/2009/04/02/130664.aspx"&gt;WCF Storm&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt; 1. Getting Started&lt;/p&gt;
&lt;p&gt;2. &lt;a href="http://geekswithblogs.net/Erik/archive/2009/04/04/130732.aspx"&gt;Invoking a service having multiple endpoints.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. &lt;a href="http://geekswithblogs.net/Erik/archive/2009/04/07/130793.aspx"&gt;How to create and run a performance test&lt;/a&gt;&lt;/p&gt;
4. &lt;a href="javascript:void(0);/*1239114171625*/"&gt;How to create and execute a functional test&lt;/a&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;Ok, so lets get started....&lt;/p&gt;
&lt;h2&gt; Getting Started : (Invoking a method of  a WCF/Web service)&lt;/h2&gt;
&lt;ol&gt;
    &lt;li&gt;
    &lt;h3&gt;Add a service.&lt;/h3&gt;
    &lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
&lt;p&gt;This can be done by either clicking "File --&amp;gt; Service --&amp;gt; Add" or by clicking the Add button in the menu bar.&lt;/p&gt;
&lt;p&gt;This will bring up a form where you can type in the metadata exchange endpoint (i.e. WSDL endpoint). WcfStorm will then read the wsdl, generate the client code and compile it. If all goes well, the service and its method will be displayed on the left hand side.&lt;/p&gt;
&lt;p&gt; &lt;img alt="" width="654" height="175" src="/images/geekswithblogs_net/Erik/WcfStorm/AddServiceEndpoint(1).Png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;  Now go ahead and select on method&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;h3&gt;           2.  Select a method&lt;/h3&gt;
&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
&lt;p&gt; If a method is selected, its parameters will be read and displayed in the "RequestPane'.  In the screenshot below I've selected the method "GetDataUsingContract" which takes parameter of type "CompositeType"&lt;/p&gt;
&lt;p&gt; &lt;img alt="" width="635" height="283" src="/images/geekswithblogs_net/Erik/WcfStorm/MethodSelected.Png" /&gt;&lt;/p&gt;
&lt;p&gt; The structure of CompositeType is shown below.  As you can see, what's displayed in the request pane matches exactly the defined type. &lt;/p&gt;
&lt;p&gt; &lt;img alt="" width="311" height="396" src="/images/geekswithblogs_net/Erik/WcfStorm/CompositeTypeClass.Png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now, select a field of the composite type parameter.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;h3&gt;            3.  Edit a field in the parameter&lt;/h3&gt;
&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
&lt;p&gt; This will bring up the Object Editor which will let you edit the field.  If the type is not primitive, the "Set to null' checkbox will be enabled.  If the tye of the selected field is polymorphic, the object editor will display the subtypes that can be assigned to the field.&lt;/p&gt;
&lt;p&gt; Here I've selected the string field.&lt;/p&gt;
&lt;p&gt; &lt;img alt="" width="386" height="292" src="/images/geekswithblogs_net/Erik/WcfStorm/EditObject(1).Png" /&gt;&lt;/p&gt;
&lt;p&gt;  Clicking OK will assign the value "my string" to the StringValue field of the CompositeType parameter.&lt;/p&gt;
&lt;p&gt; Now Click Send (Green arrow)&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;h3&gt;          4.  Invoking the service method&lt;/h3&gt;
&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
&lt;p&gt; Click on send to invoke the web method.   The test service we are invoking merely echoes back the input parameters it has received ( a convenient way of checking that the object editor in the previous step worked). This is shown in the screenshot below&lt;/p&gt;
&lt;p&gt; &lt;img alt="" src="http://www.fileden.com/files/2009/4/1/2388287/InvokeMethodWithResult.Png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Looking at the log, we can see that WCFStorm used the &lt;strong&gt;NetTcpBinding&lt;/strong&gt; endpoint.  Recall that when we added the service, we used &lt;a href="http://localhost:8080/httpEndpoint?wsdl"&gt;http://localhost:8080/httpEndpoint?wsdl&lt;/a&gt; - obvoiusly an endpoint that uses http. So how come the tool is now using NetTcpBinding?  In this case, the service that we are using declared 3 endpoints in its config.  An http endpoint for the metadata exchange (to expose the wsdl)  a NetTcpBinding and a WsHttpBinding endpoint for the actual method calls.  By default WCFStorm uses 1st endpoint that was declared by the service (which was the NetTcpBinding.)&lt;/p&gt;
&lt;p&gt; &lt;img alt="" width="753" height="331" src="/images/geekswithblogs_net/Erik/WcfStorm/MultipleBinding.Png" /&gt;&lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;         That's it! we have now successfully invoked the WCF service.&lt;/p&gt;
&lt;ol&gt;  &lt;/ol&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130731"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130731" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/130731.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2009/04/04/130731.aspx</guid>
            <pubDate>Sat, 04 Apr 2009 19:19:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/130731.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2009/04/04/130731.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/130731.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/130731.aspx</trackback:ping>
        </item>
        <item>
            <title>WCF Service Functional and Performance Testing Tool : WCFStorm</title>
            <link>http://geekswithblogs.net/Erik/archive/2009/04/02/130664.aspx</link>
            <description>&lt;p&gt;During the last few months I've been working on a commercial tool for testing WCF services.  The knowledge I learned building &lt;a href="http://codeplex.com/storm"&gt;STORM&lt;/a&gt; really helped alot in building this tool.  So here it is my fellow coders,&lt;strong&gt; WCF Storm&lt;/strong&gt;.  It has more features than its open source cousin, STORM and the best part is &lt;strong&gt;&lt;font color="#339966"&gt;it works on both WCF and Web services&lt;/font&gt;&lt;/strong&gt;&lt;font color="#339966"&gt;!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966"&gt;&lt;font size="3"&gt;&lt;em&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966"&gt;&lt;font size="3"&gt;&lt;em&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966"&gt;&lt;font size="3"&gt;&lt;em&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#339966"&gt;&lt;font size="3"&gt;&lt;em&gt;&lt;font color="#000000"&gt;EDIT :&lt;/font&gt; &lt;/em&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;em&gt;&lt;a href="http://www.wcfstorm.com/wcf/home.aspx"&gt;www.wcfstorm.com&lt;/a&gt;&lt;/em&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;em&gt; &lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="3"&gt;&lt;em&gt;is up! Please visit the site for updates and to purchase WCFStorm online&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;h3&gt; &lt;/h3&gt;
&lt;h3&gt;System Requirement:&lt;/h3&gt;
&lt;ul style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
    &lt;ul&gt;
        &lt;li&gt; .NET Framework 3.0 or higher. &lt;/li&gt;
    &lt;/ul&gt;
&lt;/ul&gt;
&lt;h3&gt; Features at a glance:&lt;/h3&gt;
&lt;p&gt;         &lt;strong&gt;General:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;ul&gt;
        &lt;li&gt;Dynamically invoke and test WCF Services &lt;/li&gt;
        &lt;li&gt;Dynamically invoke and test Web services written in any language &lt;/li&gt;
        &lt;li&gt;Save your opened service and its test cases into a "project" which can be reloaded anytime &lt;/li&gt;
        &lt;li&gt;Dynamically invoke service methods even those containing complex data types &lt;/li&gt;
        &lt;li&gt;UI-based, dynamic editing of complex data types &lt;/li&gt;
        &lt;li&gt;Test multiple WCF and Web services within a single UI. &lt;/li&gt;
        &lt;li&gt;Multiple-tabbed interface &lt;/li&gt;
        &lt;li&gt;Basic and windows authentication &lt;/li&gt;
        &lt;li&gt;Test services sitting behind a proxy &lt;/li&gt;
        &lt;li&gt;Dynamically modify the URL endpoint of a WCF or Web service. &lt;/li&gt;
        &lt;li&gt;Dynamically edit the service binding. &lt;/li&gt;
    &lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;         &lt;strong&gt;Functional Testing:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;ul&gt;
        &lt;li&gt;Create functional test cases and save it as part of a project &lt;/li&gt;
        &lt;li&gt;Create and save functional test cases containing Expected results. &lt;/li&gt;
        &lt;li&gt;Graphically compare (side-by-side) the expected results with the actual response of a service. &lt;/li&gt;
    &lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;          &lt;strong&gt;Performance Testing:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;ul&gt;
        &lt;li&gt;Create performance test cases and save it as part of a project &lt;/li&gt;
        &lt;li&gt;Graphically display charts in real-time as the performance test progresses. &lt;/li&gt;
        &lt;li&gt;Configurable test parameters (# of Agents, Test duration, interval etc.).  You can stress out your service as much as you want. &lt;/li&gt;
    &lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;          What all these features mean is that testing WCF/Web services becomes a breeze and you'll have plenty of time to spend on writing the logic of your service (which is what you should be really doing).&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;  &lt;u&gt;Performance testing screenshot:&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;                &lt;img alt="WCF Storm Performance Testing" width="634" height="384" src="/images/geekswithblogs_net/Erik/WcfStorm/WcfStormPerfTest.jpg" /&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;              &lt;u&gt;Functional testing screenshot:&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;               &lt;img alt="WCF Storm Functional Testing" width="620" height="317" src="/images/geekswithblogs_net/Erik/WcfStorm/WcfStormFunctionalTest(1).jpg" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;               Check out the &lt;a href="http://geekswithblogs.net/Erik/gallery/9896.aspx"&gt;gallery&lt;/a&gt; for more screenshots.&lt;/p&gt;
&lt;p&gt;            &lt;/p&gt;
&lt;p&gt;           Try it out!  Download the trial version below.&lt;/p&gt;
&lt;h3&gt;       &lt;a href="http://www.wcfstorm.com"&gt;&lt;img alt="" width="135" height="34" src="/images/geekswithblogs_net/Erik/WcfStorm/downloadNowButton.png" /&gt;&lt;/a&gt;   &lt;font size="3"&gt;or &lt;a href="http://www.wcfstorm.com/wcf/buynow.aspx"&gt;Buy Now&lt;/a&gt; or&lt;a href="http://www.wcfstorm.com/wcf/learn-more.aspx"&gt;&lt;/a&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;a href="javascript:void(0);/*1239774284042*/"&gt;Learn more&lt;/a&gt;&lt;/font&gt;&lt;/h3&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;So how much does it cost?&lt;/h3&gt;
&lt;p&gt;              Short answer is ... Not so much!  I've priced the tool for the budget conscious. Consider this, I used to work for a company that bought a license for a soap testing tool that costs almost &lt;strong&gt;700 &lt;/strong&gt;USD (that's right7 hundred!) annually per seat. It was a great tool. It had tons of features but the problem was, we rarely used them.  We mainly used it to invoke web service methods and verify that the results are correct.  All the other features that the company paid (dearly) for, were rarely or sometimes never used.  Why pay so much for unused features? &lt;/p&gt;
&lt;p&gt;            So how much does WCF Storm cost? &lt;/p&gt;
&lt;ul&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Personal Edition&lt;/strong&gt;     : &lt;strong&gt;&lt;font size="3"&gt;14.99&lt;/font&gt;&lt;/strong&gt; USD only (annually/seat ) &lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Enterprise Edition&lt;/strong&gt;   : &lt;strong&gt;&lt;font size="3"&gt;49.99&lt;/font&gt;&lt;/strong&gt; USD only (annually for 10 seats!)&lt;/li&gt;
        &lt;li&gt; &lt;/li&gt;
    &lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;em&gt;(EDIT : I've finalized the pricing structure for WCFStorm. Please visit &lt;font face="Arial"&gt;&lt;a href="http://www.wcfstorm.com/wcf/buynow.aspx"&gt;http://www.wcfstorm.com/wcf/buynow.aspx&lt;/a&gt;&lt;/font&gt; to view the offers)&lt;/em&gt;&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;                       Not bad, huh? :) For such a low price not only can you test WCF services, it even works on Web services.  if you buy now and be part of the first 100 to purchase WCF Storm, I'd extend your license for 2 years!&lt;/p&gt;
&lt;p&gt;                      &lt;/p&gt;
&lt;p&gt;However, if you think that the price is expensive, drop me an email and we can discuss the price we're both comfortable with.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;I love the price, but why didn't you just open source it like &lt;a href="http://codeplex.com/storm"&gt;STORM&lt;/a&gt;?&lt;/h3&gt;
&lt;p&gt;           I think these words are sufficient to answer that question:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;
    &lt;h4&gt;          Recession &lt;/h4&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
&lt;p&gt;This recession that we all are experiencing right now has also affected myself and my family.  I still have my job but I can't tell whether next month I'd still have it.  Some people had already been let go and management has been awfully quiet on when the next round of layoffs will be.  I have a wife and a lovely  5 year-old daughter to care for.  I also have a mortgage and credit card bills to pay.  My job, which is our main source of income is in an unstable state right now.&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;ul&gt;
    &lt;li&gt;
    &lt;h4&gt;          9 millimeter&lt;/h4&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;&lt;blockquote style="MARGIN-RIGHT: 0px" dir="ltr"&gt;
&lt;p&gt;My wife is 2 months pregnant. During our last visit to the doctor, we found out our baby is about 9 mm in length already. In programmer-speak, our baby is in the Alpha or Beta state right now.  But he/she has already achieved a major project milestone- he/she has a heartbeat!  Oh I am the happiest person in the world right now! We can't wait for him/her to come join us in November later this year.&lt;/p&gt;
&lt;p&gt;     &lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;            &lt;/strong&gt;I had a DONATE button on the codeplex site of STORM and even added it to the Storm application itself.  Its been there for more than 6 months and inspite of the 6000+ downloads, I have yet to receive a single donation.  I know, you'd say, open source doesn't work like that.  One cannot expect donations on open source projects.  It's the spirit of giving and sharing code that matters. Yes, that is true, I believe that as well.&lt;/p&gt;
&lt;p&gt;            But as you can see, I simply can't afford to give out WCF Storm for free right now.  If my family is to weather this difficult time we need to have another source of income. I hope people understand.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;       &lt;a href="http://www.wcfstorm.com"&gt;&lt;img alt="" width="135" height="34" src="/images/geekswithblogs_net/Erik/WcfStorm/downloadNowButton.png" /&gt;&lt;/a&gt;  &lt;font size="3"&gt;or  &lt;a href="http://www.wcfstorm.com/wcf/buynow.aspx"&gt;Buy Now&lt;/a&gt; or &lt;/font&gt;&lt;font size="3"&gt;&lt;a href="http://www.wcfstorm.com/wcf/learn-more.aspx"&gt;Learn more&lt;/a&gt;&lt;/font&gt; &lt;/h3&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130664"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=130664" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/130664.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2009/04/02/130664.aspx</guid>
            <pubDate>Thu, 02 Apr 2009 18:16:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/130664.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2009/04/02/130664.aspx#feedback</comments>
            <slash:comments>15</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/130664.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/130664.aspx</trackback:ping>
        </item>
        <item>
            <title>F#: Making records behave like objects</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/10/09/125732.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;The Goal &lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Simulate a class using the Record type&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;How we'll do this&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Create a tool that can translate a number into another format. In particular, we'll convert a number into &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Roman Numerals or &lt;/li&gt;
    &lt;li&gt;multiply it by 10 &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;Why are you doing this?&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;No particular reason. I was just curious.  I was just thinking that if F# did not support OOP, how can I still achieve the same things I was used to doing in C#?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;font size="2"&gt;Ok so here we go..&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;F# record types are simple named types. We can pattern match over it and it is also constructed quite easily. For example&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="435" height="69" src="/images/geekswithblogs_net/Erik/Recordssample.Png" /&gt;&lt;/p&gt;
&lt;p&gt;The record Person contains 2 named fields, which are both strings. Most of the time records are used to hold data but since F# is an FP language, we can also have the fields of the record carry a function.  For example, we can modify the Person record type to instead of having the "LastName" as a string, we'll turn it into a function that computes the last name. Something like, &lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="594" height="67" src="/images/geekswithblogs_net/Erik/Recordssample2.Png" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see we have changed the signature of LastName from "string" to "unit-&amp;gt;string". The function "fun -&amp;gt; Guid.NewGuid().ToString() " matches this new signature. (Side note: as a C# coder, this was a big mind shift for me)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Going back to our example, lets define a Converter record type as&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="402" height="41" src="/images/geekswithblogs_net/Erik/CropperCapture[2].Png" /&gt;&lt;/p&gt;
&lt;p&gt;this type holds a string field "x" and "ToNewFormat" field with the signature unit-&amp;gt;string.  The function does not take any parameter because we'll have it use the value assigned to "x" i.e. it will convert the value in "x" into a different format.  If we were using a class, our code (C#) will be something like&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="287" height="163" src="/images/geekswithblogs_net/Erik/CSharpClassrecord2.Png" /&gt;&lt;/p&gt;
&lt;p&gt;and to use it we'd write&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="283" height="74" src="/images/geekswithblogs_net/Erik/CropperCapture[3].Png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So how do we contsruct our F# Converter record so that it would behave essentially like the C# Converter class?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;like this.&lt;/p&gt;
&lt;p&gt;&lt;img width="441" height="250" alt="" src="/images/geekswithblogs_net/Erik/FSRecInstance.Png" /&gt;&lt;/p&gt;
&lt;p&gt;We create a converter function that takes 2 parameters, "numStr" and "myConverterFunction".  NumStr gets assigned to the field "x" while the myconverterFunction is wrapped inside the "intToNewFormat" function which has the signature unit-&amp;gt;string.&lt;/p&gt;
&lt;p&gt;MyConverterFunction was wrapped inside intToNewFormat function because we want this function to work on the value of field "x".  Well actually myConverter function uses the value of "positiveNum" (an int) which was derived from the string value of temp.x.  The "temp" value is of course of type Converter.&lt;/p&gt;
&lt;p&gt;The important part here is that in order for us to acces the instance value of "x" we need add the "rec" keyword in the definition of the value temp.  If we didn't do that we won't be able to access temp.x!&lt;/p&gt;
&lt;p&gt;&lt;img width="441" height="250" alt="" src="/images/geekswithblogs_net/Erik/FSRecInstance2.png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;To call this createConverter function, all we need to do is pass a string and a function that has the signature int-&amp;gt;string&lt;/p&gt;
&lt;p&gt;&lt;img width="859" height="251" alt="" src="/images/geekswithblogs_net/Erik/fsRecordCall.png" /&gt;&lt;/p&gt;
&lt;p&gt;In the code above, we create a romanConverter function that takes a string and creates the instance of the Converter record by passing the string and "RomanConverterFunction.romanConverter" function. The "RomanConverterFunction.romanConverter" function takes an integer and converts it to Roman numerals. For example, if you pass it "1980" it will output "MCMLXXX"&lt;/p&gt;
&lt;p&gt;That's it! whenever we call, &lt;strong&gt;romanNumeralConverter.ToNewFormat(),&lt;/strong&gt; it is converting its instance value of "x" into roman numerals exactly the same way the C# Converter class is working.&lt;/p&gt;
&lt;p&gt;Note that because we are passing around functions we can easily create different kinds converters.  In the above code we created another converter, "multiplier10converter" which merely multiplies a number by 10 (yes, this example is not very good. :-p ).  If we needed a different converter all we need to do is write the code for that converter and pass the new conversion function to "createConverter". Simple.  If we had to do this in OO, we have to through the inheritance-override route.&lt;/p&gt;
&lt;p&gt;Here's the tool in action&lt;/p&gt;
&lt;p&gt;&lt;img width="529" height="235" alt="" src="/images/geekswithblogs_net/Erik/ToolRunning.png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125732"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125732" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/125732.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/10/09/125732.aspx</guid>
            <pubDate>Thu, 09 Oct 2008 21:29:57 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/125732.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/10/09/125732.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/125732.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/125732.aspx</trackback:ping>
        </item>
        <item>
            <title>Should F# be open sourced?</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/09/17/125226.aspx</link>
            <description>&lt;p&gt;F# is an awesome language.  I'd choose to write F# code any day over any language if my work allows it.  The way you are able to concisely and cleanly write code with it is what brought me over. Sure there is an initial overhead (if you we are an OO programmer) in learning all the functional constructs but in the end its all worth it.  Even though you might not be able to use it at work (read : management only wants C#/VB.NET), the way you are writing OO code will definitely be improved.  I for example have come to appreciate Generics and delegates more because of F#.&lt;/p&gt;
&lt;p&gt;Microsoft Research has done such a great job with it and I'm quite sure they will continue to do so.  &lt;/p&gt;
&lt;p&gt;There is no question that &lt;em&gt;"F# as a language&lt;/em&gt;" is great. People do however have a gripe about "&lt;em&gt;F# as a Microsoft product&lt;/em&gt;".  It is not open source nor is it standard like C#. There is a technology-lockin which I presume some fear will later on will translate into a vendor-lockin.&lt;/p&gt;
&lt;p&gt;F# targets mainly the research and financial institutions.  I can not say much about financial companies but research instituions and technology companies are big Linux users.  There is very high likelihood that these people are also open-source advocates.  It will be in their best interest to ensure that the language works perfectly on both Windows and non-windows systems.  This is both a win for the users and for Microsoft.  It would also propel the language forward at a much quicker pace.&lt;/p&gt;
&lt;p&gt;It might be too early to ask this given that the F# CTP was only recently released, but should Microsoft open source F# and get the community involved?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125226"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125226" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/125226.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/09/17/125226.aspx</guid>
            <pubDate>Wed, 17 Sep 2008 19:05:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/125226.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/09/17/125226.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/125226.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/125226.aspx</trackback:ping>
        </item>
        <item>
            <title>Observer Pattern in F# : Simplified/Enhanced</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/05/22/122302.aspx</link>
            <description>&lt;p&gt;One of the commonly used design pattern is the &lt;strong&gt;Observer Pattern&lt;/strong&gt; because its just so easy to use and implement.  The classic OO way of implementing it is to have a Subject class having the methods "Attach", "Detach"  and "Notify". The Subject class usually stores the observers in an ArrayList and then when it needs to update the observers then iterates on the list and invokes the "Update" method of each observer. See diagram below.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dofactory.com/Patterns/Diagrams/observer.gif"&gt;&lt;img alt="Classic Observer Pattern" src="http://dofactory.com/Patterns/Diagrams/observer.gif" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In C#, a more elegant way of implementing this is with &lt;strong&gt;Events and Delegates&lt;/strong&gt;.  Here's a nice &lt;a href="http://spellcoder.com/blogs/bashmohandes/archive/2007/03/10/6212.aspx"&gt;sample&lt;/a&gt; implementation.  By using using events and delegates, the code became a lot shorter and straight-forward &lt;/p&gt;
&lt;p&gt;In F#, implementation of the observer pattern became even more concise and elegant.  How come? Take a look at the code below.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;font color="#333399"&gt;line 11&lt;/font&gt;&lt;/u&gt; : A clean and simple (&lt;strong&gt;one-liner!&lt;/strong&gt;) way of creating events and triggers.  A call to IEvent.create is all it takes&lt;/p&gt;
&lt;p&gt;&lt;font color="#333399"&gt;&lt;u&gt;lines 16 &amp;amp; 17&lt;/u&gt; &lt;/font&gt;: calling "trigger" and passing the correct parameters notifies all listeners of the changeEvent.  We don't even need to check if there are listeners attached. If this is in C# we need to make &lt;em&gt;changeEvent  != null&lt;/em&gt; otherwise a NullReferenceException will be raised.&lt;/p&gt;
&lt;p&gt;&lt;font color="#333399"&gt;&lt;u&gt;lines 28 &amp;amp; 30&lt;/u&gt;.&lt;/font&gt;  In F# Events are &lt;strong&gt;first-class values &lt;/strong&gt;, that means we can pass it around and more importantly we can do all sorts of wonderful things with it using the IEvent module.  For example,  in line 28, we filtered the event, basically saying that we are only interested in events of the &lt;em&gt;Remove&lt;/em&gt; operation.  Now imagine if the Operation type (an enum actually, lines 5-7 ) contains more items such as Update, Delete, AddedThenRemoved, AddedThenUpdated, RemovedAddedAgainThenFinallyUpdated ... (you get what I mean).  If we want to a handle only the Remove operation then we'd have no choice but to break it down using an if-elseif-else or switch-case construct.  It would work but its not going to be pretty.  And this is where &lt;em&gt;IEvent.filter&lt;/em&gt; shines. With just a single line of code (line 28, please ignore the comment above it.), we were able to filter out the event that we are only interested in. Apart from filtering, IEvent also allows us to map, partition, fold, split etc. events.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;font color="#333399"&gt;lines 25 &amp;amp; 30&lt;/font&gt;&lt;/u&gt; : 2 ways of attaching to an Event.  I'm not very sure what's the difference between these 2. (TODO : Investigate)&lt;/p&gt;
&lt;p&gt;&lt;img height="564" alt="F# Observer Pattern Code" width="622" src="/images/geekswithblogs_net/Erik/fsharpOberserverPatern.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here's the output! Notice that the "observerForRemove" printed out only the message related to the Remove operation even though the Subject class raised 2 events (one for Add, another one for Remove) in the Notify() method at line 15.  Sweet.&lt;/p&gt;
&lt;p&gt;&lt;img height="138" alt="output" width="613" src="/images/geekswithblogs_net/Erik/fsharpOberserverPaternOutput.PNG" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122302"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122302" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/122302.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/05/22/122302.aspx</guid>
            <pubDate>Thu, 22 May 2008 20:36:52 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/122302.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/05/22/122302.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/122302.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/122302.aspx</trackback:ping>
        </item>
        <item>
            <title>SoapBits is now open source!</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/05/10/122038.aspx</link>
            <description>To everyone who've either sent me an email  or posted a comment asking whether &lt;a href="http://geekswithblogs.net/Erik/archive/2007/09/01/115109.aspx"&gt;SoapBits &lt;/a&gt;can be made into an open source project, well here I am pleased to let you all know that finally it has happened! &lt;br /&gt;
&lt;br /&gt;
SoapBits is now open source and is available at codeplex!&lt;br /&gt;
&lt;br /&gt;
In line with this change, it have given it a new name,&lt;span style="font-weight: bold;"&gt;STORM&lt;/span&gt;. (I meant "STORM"  to be an acronym but I can only come up with &lt;span style="font-weight: bold;"&gt;S&lt;/span&gt;oap &lt;span style="font-weight: bold;"&gt;T&lt;/span&gt;esting for "ST" .  The "ORM"  part I have yet to figure out, so please do suggest if you think of a clever meaning. ;)  )  Another major change is that the tool is now written &lt;span style="font-style: italic;"&gt;mostly&lt;/span&gt; in &lt;span style="font-weight: bold;"&gt;F#&lt;/span&gt;, a language which I believe is a lot more expressive and powerful than C# because of the ease with which it has combined Object Oriented and Functional programming. The user interface part though is still written in C# mainly because F# is not yet fully integrated into Visual Studio.&lt;br /&gt;
&lt;br /&gt;
STORM site : &lt;a href="http://codeplex.com/storm"&gt;http://codeplex.com/storm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As you all can see below, the UI has also changed a bit but the old functionalities are still there&lt;br /&gt;
&lt;br /&gt;
&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=storm&amp;amp;DownloadId=34052" alt="" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy the tool everyone! And don't forget to give back and contribute to the project.&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122038"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122038" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/122038.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/05/10/122038.aspx</guid>
            <pubDate>Sun, 11 May 2008 04:12:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/122038.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/05/10/122038.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/122038.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/122038.aspx</trackback:ping>
        </item>
        <item>
            <title>String.Replace() in XSLT</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx</link>
            <description>&lt;p&gt;Here's a sample template that lets you have the String.Replace() functionality in XSLT 1.0.   The template "string-replace-all" takes 3 parameters and recursively processes the input text string.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;     text         : main string &lt;/li&gt;
    &lt;li&gt;     replace : the string fragment to be replaced &lt;/li&gt;
    &lt;li&gt;    by           :  the replacement string  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;img height="350" alt="" width="610" src="/images/geekswithblogs_net/Erik/xsl-str-replace.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Here's how it is called:  &lt;/p&gt;
&lt;p&gt;&lt;img height="162" alt="" width="667" src="/images/geekswithblogs_net/Erik/xsl-str-replaceCalling.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;The resulting value of $myVar after {ReplaceMe} is replaced is &lt;em&gt;&lt;strong&gt;"This is a sample text : &lt;font style="BACKGROUND-COLOR: #ccffcc"&gt;String.Replace() in XSLT&lt;/font&gt; and &lt;font style="BACKGROUND-COLOR: #ccffcc"&gt;String.Replace() in XSLT&lt;/font&gt;"&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;For those who are not familiar with XSLT syntax and here's the C# equivalent.  An excellent material for the &lt;a href="http://thedailywtf.com"&gt;thedailywtf!&lt;/a&gt; :)&lt;/p&gt;
&lt;p&gt;&lt;img height="177" alt="" width="727" src="/images/geekswithblogs_net/Erik/xsl-str-replaceCallingCSharpTWF.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; (Note: I'm not so sure, but I think in XSL 2.0 there is already a built-in replace function on strings)&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120915"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120915" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/120915.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx</guid>
            <pubDate>Wed, 02 Apr 2008 01:36:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/120915.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/04/01/120915.aspx#feedback</comments>
            <slash:comments>21</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/120915.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/120915.aspx</trackback:ping>
        </item>
        <item>
            <title>F# Solution (By Factorization) : Project Euler Problems 5</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/02/19/119734.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem&lt;/u&gt;&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt; 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;What is the smallest number that is &lt;dfn title="divisible with no remainder"&gt;evenly divisible&lt;/dfn&gt; by all of the numbers from 1 to 20?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Finding the LCM can be done via factorization.  Below is an excerpt from the wikipedia article.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The &lt;a title="Fundamental theorem of arithmetic" href="http://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic"&gt;unique factorization theorem&lt;/a&gt; says that every positive integer number greater than 1 can be written in only one way as a product of &lt;a title="Prime number" href="http://en.wikipedia.org/wiki/Prime_number"&gt;prime numbers&lt;/a&gt;. The prime numbers can be considered as the atomic elements which, when combined together, make up a &lt;a title="Composite number" href="http://en.wikipedia.org/wiki/Composite_number"&gt;composite number&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;dl&gt;&lt;dd&gt;&lt;img class="tex" alt="90 = 2^1 \cdot 3^2 \cdot 5^1 = 2 \cdot 9 \cdot 5. \,\!" src="http://upload.wikimedia.org/math/e/b/c/ebc4693ad71eeca52e4700c6d627385b.png" /&gt; &lt;/dd&gt;&lt;/dl&gt;
&lt;p&gt;Here we have the composite number 90 made up of one atom of the prime number &lt;strong&gt;2&lt;/strong&gt;, two atoms of the prime number &lt;strong&gt;3&lt;/strong&gt; and one atom of the prime number &lt;strong&gt;5&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This knowledge can be used to find the lcm of a set of numbers.&lt;/p&gt;
&lt;p&gt;Example: Find the value of lcm(8,9,21).&lt;/p&gt;
&lt;p&gt;First, factor out each number and express it as a product of prime number &lt;a class="mw-redirect" title="Power (mathematics)" href="http://en.wikipedia.org/wiki/Power_%28mathematics%29"&gt;powers&lt;/a&gt;.&lt;/p&gt;
&lt;dl&gt;&lt;dd&gt;&lt;img class="tex" alt="8\; \, \; \,= 2^3 \cdot 3^0 \cdot 5^0 \cdot 7^0 \,\!" src="http://upload.wikimedia.org/math/5/9/7/597afba824704eb2657be1ceb07952a5.png" /&gt; &lt;/dd&gt;&lt;dd&gt;&lt;img class="tex" alt="9\; \, \; \,= 2^0 \cdot 3^2 \cdot 5^0 \cdot 7^0 \,\!" src="http://upload.wikimedia.org/math/8/1/2/8129b6f619af1cb23f83f569a33159e1.png" /&gt; &lt;/dd&gt;&lt;dd&gt;&lt;img class="tex" alt="21\; \,= 2^0 \cdot 3^1 \cdot 5^0 \cdot 7^1. \,\!" src="http://upload.wikimedia.org/math/2/8/6/286e62edc6d8e5f63a6480f0d16a2b68.png" /&gt; &lt;/dd&gt;&lt;/dl&gt;
&lt;p&gt;The lcm will be the product of multiplying the highest power in each prime factor category together. Out of the 4 prime factor categories 2, 3, 5, and 7, the highest powers from each are 2&lt;sup&gt;3&lt;/sup&gt;, 3&lt;sup&gt;2&lt;/sup&gt;, 5&lt;sup&gt;0&lt;/sup&gt;, and 7&lt;sup&gt;1&lt;/sup&gt;. Thus,&lt;/p&gt;
&lt;dl&gt;&lt;dd&gt;&lt;img class="tex" alt="\operatorname{lcm}(8,9,21) = 2^3 \cdot 3^2 \cdot 5^0 \cdot 7^1 = 8 \cdot 9 \cdot 1 \cdot 7 = 504. \,\!" src="http://upload.wikimedia.org/math/b/4/7/b47946164dbb6cb560b13571f9adfa5c.png" /&gt; &lt;/dd&gt;&lt;/dl&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/p&gt;
&lt;div style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 600px; BACKGROUND-COLOR: #ffffcc"&gt;  module Prob5 = begin &lt;br /&gt;
  open System&lt;br /&gt;
  open Microsoft.FSharp.Math&lt;br /&gt;
  &lt;br /&gt;
  let primeFactors (num:float) =&lt;br /&gt;
    //let num = 50.0&lt;br /&gt;
    let divSeq = num |&amp;gt; Seq.unfold (fun x -&amp;gt;&lt;br /&gt;
      let rec get num2  =&lt;br /&gt;
        let sq = Math.Sqrt (num2)&lt;br /&gt;
        let div = ref 2.0 &lt;br /&gt;
        while( (not(num2 % !div = 0.0)) &amp;amp;&amp;amp; (!div &amp;lt; sq) ) do&lt;br /&gt;
          if (!div = 2.0) then&lt;br /&gt;
            div  := !div + 1.0&lt;br /&gt;
          else&lt;br /&gt;
            div  := !div + 2.0&lt;br /&gt;
        div&lt;br /&gt;
               let sq = Math.Sqrt (x) &lt;br /&gt;
      let divisor = get x &lt;br /&gt;
             if (x = 1.0) then&lt;br /&gt;
         None&lt;br /&gt;
      else if (sq &amp;lt; !divisor) then&lt;br /&gt;
        Some (x, 1.0)  // x is prime!&lt;br /&gt;
      else&lt;br /&gt;
        Some(!divisor, x/(!divisor))&lt;br /&gt;
      )&lt;br /&gt;
           divSeq&lt;br /&gt;
       let pFactors = (2,20) |&amp;gt; Seq.unfold (fun (x,limit) -&amp;gt; &lt;br /&gt;
    let y = float_of_int x&lt;br /&gt;
    let s =  (primeFactors y) |&amp;gt; Seq.map (fun x -&amp;gt; Convert.ToInt32(x))&lt;br /&gt;
           if x &amp;lt;=limit then &lt;br /&gt;
      Some ( (x,s), (x+1, limit))&lt;br /&gt;
    else&lt;br /&gt;
      None&lt;br /&gt;
    )&lt;br /&gt;
    &lt;br /&gt;
  let factorSort x y = &lt;br /&gt;
    let (num1, _) = x&lt;br /&gt;
    let (num2,_) = y&lt;br /&gt;
      &lt;br /&gt;
    if (num1 &amp;lt; num2)  then&lt;br /&gt;
      -1&lt;br /&gt;
    else if num1 &amp;gt; num2 then&lt;br /&gt;
      1&lt;br /&gt;
    else&lt;br /&gt;
      0&lt;br /&gt;
       let powSort x y = &lt;br /&gt;
    let (_,num1) = x&lt;br /&gt;
    let (_,num2) = y&lt;br /&gt;
    &lt;br /&gt;
    if num1 &amp;lt; num2 then&lt;br /&gt;
      1&lt;br /&gt;
    else if num1 &amp;gt; num2 then       -1&lt;br /&gt;
    else&lt;br /&gt;
      0&lt;br /&gt;
     &lt;br /&gt;
    &lt;br /&gt;
  let all =   pFactors |&amp;gt; Seq.map (fun (num,s) -&amp;gt; s |&amp;gt;  Seq.countBy (fun x -&amp;gt; x ) )  |&amp;gt; Seq.concat&lt;br /&gt;
  let allList =  (Seq.to_list all) |&amp;gt; List.sort factorSort |&amp;gt; List.sort powSort&lt;br /&gt;
    &lt;br /&gt;
  let a = ref 0&lt;br /&gt;
  let b = ref 0&lt;br /&gt;
  let filtered = allList |&amp;gt; List.filter (fun (x,y) -&amp;gt; &lt;br /&gt;
          let (factor,pow) = allList |&amp;gt;  List.find (fun (r,s) -&amp;gt; r=x ) &lt;br /&gt;
            &lt;br /&gt;
          if (factor = x ) &amp;amp;&amp;amp; (pow = y) &amp;amp;&amp;amp; ( (!a &amp;lt;&amp;gt; x) || (!b &amp;lt;&amp;gt; y) ) then&lt;br /&gt;
            a := factor&lt;br /&gt;
            b := pow          &lt;br /&gt;
            true&lt;br /&gt;
          else&lt;br /&gt;
            false&lt;br /&gt;
        &lt;br /&gt;
      )&lt;br /&gt;
      &lt;br /&gt;
  let main() =&lt;br /&gt;
    let lcm = filtered |&amp;gt; List.fold_left (fun a (x,y) -&amp;gt; a * Math.Pow(float_of_int x, float_of_int y ) ) 1.0&lt;br /&gt;
    printfn "\n\nLCM = %f" lcm&lt;br /&gt;
    &lt;br /&gt;
  end&lt;br /&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;My solution for this one follows the steps outlined in the wikipedia excerpt above. It is a bit long but essentially it can be broken down into the following stages...&lt;/p&gt;
&lt;p&gt;1 - &lt;strong&gt;Factor out the number 1 to 20.&lt;/strong&gt;   &lt;/p&gt;
&lt;p&gt;      This is done on function &lt;em&gt;pFactors.  pFactors &lt;/em&gt;outputs a sequenct of tuples wherein the first value is the number being factored while the second value is a sequence of its prime factors. For example, the output of this function when applied to the numbers 2 to 20&lt;/p&gt;
&lt;p&gt;      { (2, {2}); (3, {3}; (4, {2;2}) ; (5, {5}) ...,&amp;lt;snip&amp;gt; .. (12, {2;2;3}) ...&amp;lt;snip&amp;gt; .. (20, {2;2;5})       }  &lt;/p&gt;
&lt;p&gt;    type : seq&amp;lt; int * seq&amp;lt;int&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2 - Count the number of occurrences of each prime factor and consolidate into just one sequence&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;    This is done on line  &lt;font color="#0000ff" size="2"&gt;let&lt;/font&gt;&lt;font size="2"&gt; all = pFactors |&amp;gt; Seq.map (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;fun&lt;/font&gt;&lt;font size="2"&gt; (num,s) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;-&amp;gt;&lt;/font&gt;&lt;font size="2"&gt; s |&amp;gt; Seq.countBy (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;fun&lt;/font&gt;&lt;font size="2"&gt; x &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;-&amp;gt;&lt;/font&gt;&lt;font size="2"&gt; x ) ) |&amp;gt; Seq.concat&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;   Seq.countBy counts the number of occurences of an item in a sequence.  For example, if we apply to the sequence of prime factors of the number 20, the output will be&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;   (20, {2;2;5} ) -&amp;gt; (2,2),(5,1) : where the 2nd value of the tuple is the number of occurences&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;   So for the number 2 to 20 the output is&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;  (2, 1)(3, 1)(2, 2)(5, 1)(2, 1)(3, 1)(7, 1)(2, 3)(3, 2)(2, 1)(5, 1)(11, 1)(2, 2)(3, 1)(13, 1)(2, 1)(7, 1)(3, 1)(5, 1)(2, 4)(17, 1)  &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;  (2, 1)(3, 2)(19, 1)(2, 2)(5, 1)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;  type : seq&amp;lt;int * int &amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;3 - Sort the output of stage 2.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;    &lt;/strong&gt;The output of stage 2 obviously contains duplicates.  Referring back to the wikipedia excerpt above, what we need only are those factors with the highest power (or most number of occurences).  So in order for us to identify those factors, first we sort the sequence.  This is done on line &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;         &lt;font color="#0000ff" size="2"&gt;let&lt;/font&gt;&lt;font size="2"&gt; allList = (Seq.to_list all) |&amp;gt; List.sort factorSort |&amp;gt; List.sort powSort&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;     The output (though a bit confusing) guarantees that the for any number, the one with the highest number of occurences comes out on top.  For example (2,4) is on top of all the other tuple entries with first value of 2. And so is (3,2) for tuple values with first value of 3.&lt;/font&gt;&lt;/font&gt;&lt;font face="Arial"&gt;                        &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;                         (2, 4)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 3)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 2)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 2)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 2)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(3, 2)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(3, 2)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(2, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(3, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(3, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(3, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(3, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(5, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(5, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(5, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(5, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(7, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(7, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(11, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(13, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;                         &lt;/font&gt;(17, 1)&lt;br /&gt;
&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;                         &lt;/font&gt; &lt;/font&gt;(19, 1)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;             type : seq&amp;lt;int * int&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.  Filter the resulting sequence of stage 3 and take only those with the highest 2nd element.&lt;/strong&gt;  This is done on line&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;   let &lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;filtered = allList |&amp;gt; List.filter (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;fun&lt;/font&gt;&lt;font size="2"&gt; (x,y) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;-&amp;gt; ...&lt;/font&gt;&lt;font size="2"&gt;  &amp;lt;snip&amp;gt;...&lt;/font&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;     output is :  seq&amp;lt;int*int&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;                   &lt;/font&gt;&lt;font face="Arial" color="#000000"&gt;(2, 4)&lt;br /&gt;
                   (3, 2)&lt;br /&gt;
                   (5, 1)&lt;br /&gt;
                   (7, 1)&lt;br /&gt;
                   (11, 1)&lt;br /&gt;
                   (13, 1)&lt;br /&gt;
                   (17, 1)&lt;br /&gt;
                   (19, 1)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;5.&lt;/font&gt; &lt;font color="#000000"&gt;And finally we can compute the LCM.  This is done on the line&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;   let&lt;/font&gt; &lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;lcm = filtered |&amp;gt; List.fold_left (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;fun&lt;/font&gt;&lt;font size="2"&gt; a (x,y) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;-&amp;gt;&lt;/font&gt;&lt;font size="2"&gt; a * Math.Pow(float_of_int x, float_of_int y ) ) 1.0&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;Total execution time on my machine is &lt;strong&gt;0.17 seconds&lt;/strong&gt;  which a great improvement from the &lt;strong&gt;25 seconds&lt;/strong&gt; using the brute force approach described &lt;/font&gt;&lt;a href="http://www.fsharp.it/2008/02/07/project-euler-in-f-problem-5/"&gt;here&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119734"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119734" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/119734.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/02/19/119734.aspx</guid>
            <pubDate>Tue, 19 Feb 2008 07:15:57 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/119734.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/02/19/119734.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/119734.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/119734.aspx</trackback:ping>
        </item>
        <item>
            <title>F# Solution : Project Euler Problems 4 &amp; 6</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/02/18/119727.aspx</link>
            <description>&lt;p&gt;These 2 problems have very short solutions so I'll put them together &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem 3:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Find the largest palindrome made from the product of two 3-digit numbers.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;div style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 200px; BACKGROUND-COLOR: #ffffcc"&gt;  let prodOf3digit = &lt;br /&gt;
     (100,100) |&amp;gt; Seq.unfold (fun (x,y) -&amp;gt; &lt;br /&gt;
             match y with &lt;br /&gt;
             | y when y &amp;lt; 0 -&amp;gt; None&lt;br /&gt;
             | y when x &amp;lt;= 999-&amp;gt; &lt;br /&gt;
                  if (y &amp;lt;= 999) then&lt;br /&gt;
                    Some(x*y, (x,y+1))&lt;br /&gt;
                  else if (x+1) &amp;lt;= 999 then&lt;br /&gt;
                    Some ( (x+1)*(x+1), (x+1, x+2) )&lt;br /&gt;
                  else&lt;br /&gt;
                    None&lt;br /&gt;
             | y -&amp;gt; None )&lt;br /&gt;
     &lt;br /&gt;
           &lt;br /&gt;
  let palindromes = &lt;br /&gt;
   prodOf3digit &lt;br /&gt;
    |&amp;gt; Seq.filter (fun x -&amp;gt;&lt;br /&gt;
     let intStr = Int32.to_string x&lt;br /&gt;
     let rev (s:string) =&lt;br /&gt;
       let chunks =s.ToCharArray()&lt;br /&gt;
       let reversed = Array.rev chunks&lt;br /&gt;
       let r = new string(reversed)&lt;br /&gt;
       r&lt;br /&gt;
     let newNum = System.Convert.ToInt32 ( rev intStr )&lt;br /&gt;
      &lt;br /&gt;
     newNum = x &lt;br /&gt;
    )&lt;br /&gt;
let largest = &lt;br /&gt;
    palindromes |&amp;gt; Seq.fold (fun a x -&amp;gt; if x &amp;gt; a then x else a) 0 &lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The problem asked for the largest palindrome of 3-digit numbers, hence the magic number 100 and 999.  The rest of the code is pretty much self-explanatory&lt;strong&gt;&lt;u&gt;.&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem 6:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The sum of the squares of the first ten natural numbers is,&lt;/em&gt;&lt;em&gt;1&lt;sup&gt;2 &lt;/sup&gt;+ 2&lt;sup&gt;2 &lt;/sup&gt; + ... + 10&lt;sup&gt;2 &lt;/sup&gt;= 385&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The square of the sum of the first ten natural numbers is, &lt;/em&gt;&lt;em&gt;(1 + 2 + ... + 10)&lt;sup&gt;2 &lt;/sup&gt; = 55&lt;sup&gt;2 &lt;/sup&gt;= 3025&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 − 385 = 2640.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 150px; BACKGROUND-COLOR: #ffffcc"&gt;let sumOfSq (n:bigint) =&lt;br /&gt;
   let rec getSum (x:bigint) =&lt;br /&gt;
     match x with&lt;br /&gt;
     | x when x = 1I -&amp;gt; 1I&lt;br /&gt;
     | x -&amp;gt; x*x + getSum (x - 1I)&lt;br /&gt;
    getSum n&lt;br /&gt;
 &lt;br /&gt;
 let sqOfSum n =&lt;br /&gt;
   let s = [ 1I .. n ] |&amp;gt; Seq.fold (fun a x -&amp;gt; a+x) 0I&lt;br /&gt;
   s*s&lt;br /&gt;
   &lt;br /&gt;
 let main2() =&lt;br /&gt;
   let diff = (sqOfSum 100I) - (sumOfSq 100I) &lt;br /&gt;
   print_any diff&lt;br /&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;To compute the sum of squares, I've decided to use recursion,  which apart from lists and sequences, is another workhorse of functional programming.   One thing to remeber when using recursion is to always make sure you cover the base case in order to avoid looping indefinitely.  In this case it is the line &lt;font size="2"&gt;x &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;when&lt;/font&gt;&lt;font size="2"&gt; x = 1I &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;-&amp;gt;&lt;/font&gt;&lt;font size="2"&gt; 1I&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Because of the large resulting values, the type used was BigInt.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119727"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119727" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/119727.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/02/18/119727.aspx</guid>
            <pubDate>Tue, 19 Feb 2008 05:36:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/119727.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/02/18/119727.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/119727.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/119727.aspx</trackback:ping>
        </item>
        <item>
            <title>F# Solution : Project Euler Problems 1-3</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/02/11/119454.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem 1 :&lt;/u&gt;&lt;/strong&gt;  &lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. &lt;/em&gt;&lt;/font&gt;&lt;font face="Arial"&gt;&lt;em&gt;Find the sum of all the multiples of 3 or 5 below 1000.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/u&gt; :&lt;/p&gt;
&lt;div style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 50px; BACKGROUND-COLOR: #ffffcc"&gt;
&lt;p&gt;let mySeqP1 = [ 1 .. 999 ] |&amp;gt; Seq.filter (fun x -&amp;gt; ( (x % 5 = 0) || (x % 3 = 0)) ) |&amp;gt; Seq.fold(+) 0 &lt;br /&gt;
printfn "sum = %i" mySeqP1 &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem 2:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &lt;/em&gt;&lt;font face="Arial"&gt;&lt;em&gt;Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed one million.&lt;/em&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Solution :&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;div style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 150px; BACKGROUND-COLOR: #ffffcc"&gt;
&lt;p&gt;let sumofEven =   (1,1) |&amp;gt; Seq.unfold (fun (x,y) -&amp;gt; &lt;br /&gt;
     match y with&lt;br /&gt;
     | y when y &amp;lt; 0 -&amp;gt; None&lt;br /&gt;
     | _ -&amp;gt; Some(y, (y, x+y)))&lt;br /&gt;
     |&amp;gt; Seq.filter ( fun x -&amp;gt;      x &amp;gt; 0 &amp;amp;&amp;amp; x &amp;lt; 1000000 &amp;amp;&amp;amp; (x % 2 = 0)) &lt;br /&gt;
     |&amp;gt; Seq.fold (+) 0&lt;br /&gt;
&lt;br /&gt;
   printfn "Sum of even = %i" sumofEven &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;For this solution I had to put the guard statement "when y &amp;lt;  0" so that negative numbers won't be included in the generated sequence.  If that guard istatement s not there, negative numbers will be included when it goes over the maximum value of Int32.&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;&lt;u&gt;Problem 3:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &lt;font face="Arial"&gt;Find the largest prime factor of 317584931803.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 470px; BACKGROUND-COLOR: #ffffcc"&gt;
&lt;p&gt;let primefactorsOf (num:float)=&lt;br /&gt;
    let divSeq = num |&amp;gt; Seq.unfold (fun x -&amp;gt;&lt;br /&gt;
      let rec get num2  =&lt;br /&gt;
        let sq = Math.Sqrt (num2)&lt;br /&gt;
        let div = ref 2.0 &lt;br /&gt;
        while( (not(num2 % !div = 0.0)) &amp;amp;&amp;amp; (!div &amp;lt; sq) ) do&lt;br /&gt;
          if (!div = 2.0) then&lt;br /&gt;
            div  := !div + 1.0&lt;br /&gt;
          else&lt;br /&gt;
            div  := !div + 2.0&lt;br /&gt;
        div&lt;br /&gt;
        &lt;br /&gt;
      let sq = Math.Sqrt (x) &lt;br /&gt;
      let divisor = get x &lt;br /&gt;
      &lt;br /&gt;
      if (Int32.of_float(x) = 1) then&lt;br /&gt;
         None&lt;br /&gt;
      else if (Int32.of_float( sq ) &amp;lt; Int32.of_float( !divisor )) then&lt;br /&gt;
        Some ( Int32.of_float( x ) , 1.0)  // x is prime!&lt;br /&gt;
      else&lt;br /&gt;
        Some(Int32.of_float !divisor, x/(!divisor))&lt;br /&gt;
      )&lt;br /&gt;
      &lt;br /&gt;
    divSeq&lt;br /&gt;
    &lt;br /&gt;
  let primefactors =  (primefactorsOf 317584931803.0)   &lt;br /&gt;
  &lt;br /&gt;
  let mainp3() = &lt;br /&gt;
    primefactors |&amp;gt; Seq.iter (fun x -&amp;gt; printfn "%i " x)&lt;br /&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The function "&lt;strong&gt;primefactorsOf&lt;/strong&gt;" takes a number and returns a sequence containing the prime factors of that number.  The prime factors are determined using Trial Division.  This of course is not very fast for ver large numbers but is sufficient enough for &lt;font face="Arial"&gt;317584931803.0 &lt;/font&gt;If it's not clear why the square root of the number being factored out was used instead of directly using the number itself, the wikipedia article explaining Trial Division is &lt;a href="http://en.wikipedia.org/wiki/Trial_division"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;If you want to output only the largest primefactor you can just pass the value &lt;em&gt;primefactors&lt;/em&gt; to &lt;strong&gt;Seq.fold&lt;/strong&gt; like so&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;let&lt;/font&gt;&lt;font size="2"&gt; largestFactor = primefactors |&amp;gt; Seq.fold (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;fun&lt;/font&gt;&lt;font size="2"&gt; a x &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;-&amp;gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; x &amp;gt; a &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;then&lt;/font&gt;&lt;font size="2"&gt; x &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/font&gt;&lt;font size="2"&gt; a ) 0&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Next time I'll post my solution to problems 4-6. &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119454"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=119454" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/119454.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/02/11/119454.aspx</guid>
            <pubDate>Tue, 12 Feb 2008 05:58:38 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/119454.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/02/11/119454.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/119454.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/119454.aspx</trackback:ping>
        </item>
        <item>
            <title>F# Solution : Project Euler Problem 25</title>
            <link>http://geekswithblogs.net/Erik/archive/2008/01/18/118664.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;The Problem :  &lt;strong&gt;&lt;em&gt;What is the first term in the Fibonacci sequence to contain 1000 digits?&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;The sweet solution : &lt;/font&gt;&lt;/p&gt;
&lt;div style="OVERFLOW: auto; WIDTH: 600px; HEIGHT: 180px; BACKGROUND-COLOR: #ffffcc"&gt;
&lt;p&gt;&lt;font size="2"&gt;#light&lt;br /&gt;
&lt;br /&gt;
open System&lt;br /&gt;
&lt;br /&gt;
let fib = &lt;br /&gt;
   (1I,1I) |&amp;gt; Seq.unfold ( fun (sqEntry, acc) -&amp;gt; Some (acc, (acc, acc + sqEntry)) )&lt;br /&gt;
              |&amp;gt; Seq.filter (fun x -&amp;gt; x.ToString().Length = 1000) &lt;br /&gt;
              |&amp;gt; Seq.nth 0&lt;br /&gt;
&lt;br /&gt;
print_any fib&lt;br /&gt;
Console.ReadLine()&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;ahh... such power and elegance....&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Let me breakdown the solution&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;em&gt;(1I,1I) |&amp;gt; Seq.unfold ( fun (sqEntry, acc) -&amp;gt; Some (acc, (acc, acc + sqEntry)) )&lt;/em&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;This line creates an &lt;strong&gt;inifinite&lt;/strong&gt; list of fibonacci numbers using Seq.unfold.  Let me say that again, it creates a in &lt;strong&gt;INFINITE&lt;/strong&gt; list.  How is that possible, you'd ask ? The reason is that F# performs &lt;em&gt;Lazy Evaluation&lt;/em&gt;. By that, I mean the program will perform only the computation it needs to do. So in our case, the program will actually compute only the parts of the list that it will need.   Here we used &lt;em&gt;&lt;strong&gt;Seq.unfold&lt;/strong&gt;&lt;/em&gt; to perform the computation.  The unfold function creates a list and uses an accumulator to maintain the state between computations.  The accumulator in this case is the tuple that contains the last 2 entries of the sequence&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;Seq.filter( fun x -&amp;gt; x.ToString().Length = 1000&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;This line applies the filter function to the sequence.  This function returns a subset of the original list that matches the condition.  In this case, the resulting list will contain only those numbers that is made up 1000 digits.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;Seq.nth 0&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;This line retrieves the nth element in the sequence.  Since the problem ask for the 1st term, naturally we retrieved the 0th element.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;And finally the construct that ties everything together and makes the code such a wonder to look at is the&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;&lt;strong&gt;|&amp;gt;  &lt;/strong&gt;(the Pass-forward operator)&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;As its name implies, it passes forward the argument behind it to the function in front of it.  So the solution in essence means&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;Pass the tuple (1I, 1I) to Seq.Unfold, then pass the resulting infinite list to Seq.filter, then pass the filtered list to Seq.nth which finally retrieves the 1st element!&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118664"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118664" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/Erik/aggbug/118664.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Erik Araojo</dc:creator>
            <guid>http://geekswithblogs.net/Erik/archive/2008/01/18/118664.aspx</guid>
            <pubDate>Fri, 18 Jan 2008 23:24:03 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/Erik/comments/118664.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/Erik/archive/2008/01/18/118664.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/Erik/comments/commentRss/118664.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/Erik/services/trackbacks/118664.aspx</trackback:ping>
        </item>
    </channel>
</rss>