<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-2491715572022173275</atom:id><lastBuildDate>Wed, 04 Sep 2024 13:38:12 +0000</lastBuildDate><category>.Net</category><category>&#39;Extension Methods&#39; InvokeRequied Lambdas WinForms</category><category>AsymmetricAlgorithm</category><category>Design</category><category>IAsyncResult</category><category>ICspAsymmetricAlgorithm</category><category>ISynchronizeInvoke</category><category>Lock objects</category><category>MVC</category><category>Patterns</category><category>RSA</category><category>ReaderWriteLock</category><category>Runtime</category><category>Security</category><category>Sync</category><category>System.Security.Cryptorgraphy</category><category>Thread safe</category><category>private key</category><category>public key</category><title>Programmer To Programmer</title><description></description><link>http://gurkashi.blogspot.com/</link><managingEditor>noreply@blogger.com (Gur Kashi)</managingEditor><generator>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2491715572022173275.post-5318289895645060322</guid><pubDate>Tue, 02 Aug 2011 12:18:00 +0000</pubDate><atom:updated>2011-08-02T05:24:05.146-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Lock objects</category><category domain="http://www.blogger.com/atom/ns#">ReaderWriteLock</category><category domain="http://www.blogger.com/atom/ns#">Thread safe</category><title>Enforcing your object to be thread safe</title><description>Hi everyone, after a long time that i didn&#39;t write because i was on a long vacation, i wanted to share a very cool and simple code for enforcing thread safe calls to an object.&lt;br /&gt;
&lt;br /&gt;
The motive was a lot of race conditions and deadlocks that happened to my team members so i found a solution for them by enforcing all the reading and writing to our model to be thread safe.&lt;br /&gt;
This is how i implemented it:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp; ruler: true;&quot;&gt;
using System;
using System.Threading;
namespace MyCode {
   
   public class ThreadSafeObject&amp;lt;T&amp;gt;{
      private readonly ReaderWriterLockSlim _rwLock;
      private T _value;

      public ThreadSafeObject(T value){
         _rwLock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
         _value = value;
      }

      public void SafeRead(Action&amp;lt;T&amp;gt; readFunction){
         try{
            _rwLock.EnterReadLock();
            readFunction.Invoke(_value);
         }
         finally{
            _rwLock.ExitReadLock();
         }
      }

      public void SafeWrite(Action&amp;lt;T&amp;gt; writeFunction){
         try{
            _rwLock.EnterWriteLock();
            writeFunction.Invoke(_value);
         }
         finally{
            _rwLock.ExitWriteLock();
         }
      }
   }
}
&lt;/pre&gt;&lt;br /&gt;
So as you can see, any access to my model (T) must go through a loch (read or write).&lt;br /&gt;
&lt;br /&gt;
In our team, the T also implements an &#39;Observable&#39; pattern so if a &#39;write&#39; action is made inside read lock i actually throw &#39;IllegalOperationException&#39; and also enforce that no write is performed in read lock.&lt;br /&gt;
&lt;br /&gt;
Here is some code example of how to use it:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp; ruler: true;&quot;&gt;
namespace MyCode {
    class Model {
      public int IntValue { get; set; }
      public string StringValue { get; set; }
   }

   class Example {
      public void ThreadSafeExample() {
         var threadSafeObject = new ThreadSafeObject&amp;lt;Model&amp;gt;(new Model());

         /// Writing values in a safe single transaction
         threadSafeObject.SafeWrite(state =&gt; {
            state.IntValue = 100;
            state.StringValue = &quot;This is very cool design!!&quot;;
         });

         /// Reading values in a safe way (allow also multiple readers)
         var intValueRead = 0;
         var stringValueRead = string.Empty;
         var readingTime = DateTime.MinValue;
         threadSafeObject.SafeRead(state =&gt; {
            readingTime = DateTime.Now;
            intValueRead = state.IntValue;
            stringValueRead = state.StringValue;
         });

         Console.WriteLine(&quot;At {0} the model had in value of {1} and string value of: {2}&quot;, readingTime, intValueRead, stringValueRead);
      }
   }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
This is it...&lt;br /&gt;
&lt;br /&gt;
I hope it will be helpful for you as it was for me.&lt;br /&gt;
&lt;br /&gt;
Gur</description><link>http://gurkashi.blogspot.com/2011/08/enforcing-your-object-to-be-thread-safe.html</link><author>noreply@blogger.com (Gur Kashi)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2491715572022173275.post-8609570383102614965</guid><pubDate>Wed, 26 Jan 2011 23:32:00 +0000</pubDate><atom:updated>2011-01-26T15:32:54.063-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net</category><category domain="http://www.blogger.com/atom/ns#">AsymmetricAlgorithm</category><category domain="http://www.blogger.com/atom/ns#">ICspAsymmetricAlgorithm</category><category domain="http://www.blogger.com/atom/ns#">private key</category><category domain="http://www.blogger.com/atom/ns#">public key</category><category domain="http://www.blogger.com/atom/ns#">RSA</category><category domain="http://www.blogger.com/atom/ns#">Security</category><category domain="http://www.blogger.com/atom/ns#">System.Security.Cryptorgraphy</category><title>How to implement digital signature in .Net using RSA</title><description>Recently I was requested to make a automatic scenario test script for a third party co company.&lt;br /&gt;
I needed to find a way to get the results of the tests and to verify that everything passed the &#39;entry criteria&#39;. In order to do that i made my script to generate a test log file with a result line for every method.&lt;br /&gt;
Before i go on, I must say that i fully trust my colleagues, but i though that it will be very cool if i can really verify that no one messes with that output file and to refresh my memory on things that i haven&#39;t use for a while and even share it with some people...&lt;br /&gt;
&lt;br /&gt;
so... I wanted to make a digital signature of the output file.. i will not explain how the file and all the mechanism works but i&#39;ll give you my code of a simple RSA asymetric encryption algorithm. &lt;br /&gt;
&lt;br /&gt;
In here I will demonstrate a most basic implementation but that should work for a quick dive.&lt;br /&gt;
&lt;br /&gt;
So in my implementation i got 3 parts:&lt;br /&gt;
1. Generating public and private key&lt;br /&gt;
2. Encrypting&lt;br /&gt;
3. Decrypting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp; ruler: true;&quot;&gt;using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace Tester {
   public static class Program {
      public static void Main() {
         const string privateKeyFile = @&quot;C:\private.key&quot;;
         const string publicKeyFile = @&quot;C:\public.key&quot;;

         DigitalSignProvider.GenerateKeysAndStoreOnFileSystem(publicKeyFile, privateKeyFile);

         var data = new byte[] { 1, 2, 3, 4, 5 };
         Console.WriteLine(&quot;Data: {0}&quot;, GetArrayString(data));

         var enData = DigitalSignProvider.Encrypt(publicKeyFile, data);
         Console.WriteLine(&quot;Encrypted Data: {0}&quot;, GetArrayString(enData));

         var deData = DigitalSignProvider.Decrypt(privateKeyFile, enData);
         Console.WriteLine(&quot;Decrypted Data: {0}&quot;, GetArrayString(deData));
      }

      private static string GetArrayString(IEnumerable&lt;byte&gt; array) {
         var str = new StringBuilder();
         foreach (var current in array) {
            str.AppendFormat(&quot;{0} &quot;, current);
         }
         return str.ToString();
      }
   }

   public class DigitalSignProvider {
      const bool fOAEP = false;

      public static void GenerateKeysAndStoreOnFileSystem(string publicKeyPath, string privateKeyPath) {
         const int keyStrength = 512;
         var csp = new RSACryptoServiceProvider(keyStrength);
         var privateKey = csp.ExportCspBlob(true);
         var publicKey = csp.ExportCspBlob(false);

         using (var privateKeyFile = new FileStream(privateKeyPath, FileMode.Create)) {
            privateKeyFile.Write(privateKey, 0, privateKey.Length);
         }
         using (var publicKeyFile = new FileStream(publicKeyPath, FileMode.Create)) {
            publicKeyFile.Write(publicKey, 0, publicKey.Length);
         }
      }

      public static byte[] Decrypt(string keyPath, byte[] encryptedData) {
         var decryptionKey = File.ReadAllBytes(keyPath);
         var csp = new RSACryptoServiceProvider();
         csp.Clear();
         csp.ImportCspBlob(decryptionKey);
         return csp.Decrypt(encryptedData, fOAEP);
      }

      public static byte[] Encrypt(string keyPath, byte[] data) {
         var encryptionKey = File.ReadAllBytes(keyPath);
         var csp = new RSACryptoServiceProvider();
         csp.Clear();
         csp.ImportCspBlob(encryptionKey);
         return csp.Encrypt(data, fOAEP);
      }
   }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
you can of course use your own key size or algorithm abstraction if you use the following&lt;br /&gt;
interface and abstract class: AsymmetricAlgorithm, ICspAsymmetricAlgorithm &lt;br /&gt;
under System.Security.Cryptorgraphy namespace&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gur</description><link>http://gurkashi.blogspot.com/2011/01/how-to-implement-digital-signature-in.html</link><author>noreply@blogger.com (Gur Kashi)</author><thr:total>5</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2491715572022173275.post-3427524766250299345</guid><pubDate>Fri, 07 Jan 2011 10:59:00 +0000</pubDate><atom:updated>2011-01-12T07:46:20.096-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">&#39;Extension Methods&#39; InvokeRequied Lambdas WinForms</category><title>How to wrap InvokeRequired in WinForms using Extension Methods</title><description>Recently I saw a win form application that needs to print data to the UI from different threads.&lt;br /&gt;
&lt;br /&gt;
As you probably know, for changing controls from a different thread other than the UI you need to use the InvokeRequired property of the control and then Control.Invoke method.&lt;br /&gt;
&lt;br /&gt;
My very good friend Assaf had a very nice solution to the problem which is based on Extension Methods and lambdas.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
This is his solution:&lt;br /&gt;
&lt;pre class=&quot;brush: csharp; ruler: true;&quot;&gt;public static class WinformExtenstions {
&amp;nbsp;&amp;nbsp;&amp;nbsp;public static void Write&lt;tcontrol&gt;(this TControl control, Action&lt;tcontrol&gt; action)where TControl:Control{&lt;/tcontrol&gt;&lt;/tcontrol&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (control.InvokeRequired) {
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;control.Invoke(action, control);
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else{
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;action(control);
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}

&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public static TValue SafeRead&lt;tcontrol, tvalue=&quot;&quot;&gt;(this TControl control, Func&lt;tcontrol, tvalue=&quot;&quot;&gt; action) where TControl : Control{&lt;/tcontrol,&gt;&lt;/tcontrol,&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (control.InvokeRequired) {
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return (TValue)control.Invoke(action, control);
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return action(control);
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
}
&lt;/pre&gt;This is an example of how to use:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: csharp; ruler: true;&quot;&gt;public partial class Form1 : Form {
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;readonly Timer _timer;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public Form1() {
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitializeComponent();
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _timer = new Timer(500);
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _timer.Elapsed += TimerElapsed;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}

&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;void TimerElapsed(object sender, System.Timers.ElapsedEventArgs e) {
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textBox1.Write(control =&amp;gt; { control.Text = DateTime.Now.ToString(); });
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}

&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;private void Form1_Load(object sender, EventArgs e) {
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _timer.Start();
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&amp;nbsp;&amp;nbsp; }
&lt;/pre&gt;&lt;br /&gt;
I think this is a very elegant solution to the problem.&lt;br /&gt;
&lt;br /&gt;
Hope this post was helpful&lt;br /&gt;
&lt;br /&gt;
Gur</description><link>http://gurkashi.blogspot.com/2011/01/how-to-wrap-invokerequired-in-winforms.html</link><author>noreply@blogger.com (Gur Kashi)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2491715572022173275.post-8113327954562741843</guid><pubDate>Mon, 03 Jan 2011 22:42:00 +0000</pubDate><atom:updated>2011-01-07T03:18:55.619-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.Net</category><category domain="http://www.blogger.com/atom/ns#">IAsyncResult</category><category domain="http://www.blogger.com/atom/ns#">ISynchronizeInvoke</category><category domain="http://www.blogger.com/atom/ns#">Sync</category><title>How to implement IAsyncResult and ISynchronizeInvoke</title><description>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;In this post I will demonstrate how to implement a sync object using the two .net classes IAsyncResult and&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ISynchronizeInvoke&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;IAsyncResult will be used to store the action result&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ISynchronizeInvoke&amp;nbsp;will be used to synchronize all access to the resource that uses the sync object&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;class SimpleAsyncResult : IAsyncResult {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;object _state;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public bool IsCompleted { get; set; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public WaitHandle AsyncWaitHandle { get; internal set; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public object AsyncState {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Exception != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw Exception;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return _state;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; internal set {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_state = value;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public bool CompletedSynchronously { get { return IsCompleted; } }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;internal Exception Exception { get; set; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; class SimpleSyncObject : ISynchronizeInvoke {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;private readonly object _sync;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public SimpleSyncObject() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _sync = new object();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public IAsyncResult BeginInvoke(Delegate method, object[] args) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var result = new SimpleAsyncResult();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ThreadPool.QueueUserWorkItem(delegate {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;result.AsyncWaitHandle = new ManualResetEvent(false);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.AsyncState = Invoke(method, args);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (Exception exception) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result.Exception = exception;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;result.IsCompleted = true;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return result;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public object EndInvoke(IAsyncResult result) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!result.IsCompleted) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;result.AsyncWaitHandle.WaitOne();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return result.AsyncState;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public object Invoke(Delegate method, object[] args) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lock (_sync) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return method.DynamicInvoke(args);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public bool InvokeRequired {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get { return true; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Hope the post was helpful&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</description><link>http://gurkashi.blogspot.com/2011/01/hi-all-in-this-post-i-will-demonstrate.html</link><author>noreply@blogger.com (Gur Kashi)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2491715572022173275.post-3769837721671906112</guid><pubDate>Sun, 03 Oct 2010 17:41:00 +0000</pubDate><atom:updated>2010-10-03T10:41:10.627-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Design</category><category domain="http://www.blogger.com/atom/ns#">MVC</category><category domain="http://www.blogger.com/atom/ns#">Patterns</category><category domain="http://www.blogger.com/atom/ns#">Runtime</category><title>Using MVC for different server versions</title><description>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Hi all,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;On this blog I will try to suggest and share some design idea that i handled not too long ago. It is a very nice manipulation of MVC pattern which i created.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I will start with some quick description of the solution and problem, and finish with a nice easy example.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;u&gt;&lt;b&gt;The motive&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;I needed to handle the following requests:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;My server should support a very large amount of inputs from several outer sources (sensors - COM connection, TCP connection from remote clients, Http requests from a web application, local GUI and more..)&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The main and first issue was that i needed to implement a state machine that can support all those requests and even be extensible.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Secondly, each type of input can be supported or not supported in different versions of the server.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Some inputs produce the same output, but some doesn&#39;t.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Sounds tricky?&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;u&gt;&lt;b&gt;The Solution&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;As i mentioned earlier, it is based on MVC so let&#39;s dive in:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Model - this is actually the easy part, the model is some data structure that holds only data. No logic is allowed. (can be DB, memory based, file system, etc)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;View - In this section you will find the implementation of the input devices. You will find a Http server, Tcp server, Serial ports and many kinds of interfaces. In my implementation, there are not connected to anything.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Controller - Now this is a little bit similar to the usual implementation of MVC but it&#39;s getting tricky. The controller is actually the core of the system, it is based on objects that has an interface with Methods and Events, but also has access to the &lt;u&gt;Model only&lt;/u&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This is where the magic begins. This is actually an additional layer - Binders. Those binders are the connection between the View and the Controller and also the version of the server. &amp;nbsp;Any input from the view is transfered through the binders to the controller. This way, you can have different binders implementation for each view, version and even replace the input and outputs in real-time without changing the main core of the system. Only binders.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;u&gt;&lt;b&gt;Example: Future Car Wash&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Lets assume that we have a car wash server. The model will be the state of the washing procedure. The controller will be a set of actions that the car wash machine can do:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Drag-In(), Wash(), Stop(), Resume(), Drag-Out().&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The view will be two types of interfaces:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Sensor system - For automatic wash.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Manual local GUI - For operator.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Now, Lets get into action:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Lets assume that we are binding only the automatic mode binder. The vehicle enters the station. Drag-In starts, then Wash. Suddenly the driver gets out and the sensor recognize it. Stop is invoked of course. However, because we are catching the sensor event in a Binder and not in the controller, we can easily launch the Manual Binder. The operator can ask the driver to enter the vehicle and then click Resume in the GUI. The Binder will transfer the command Resume() to the controller, The Auto-Binder will be reloaded again and after the washing stops the Drag-Out() will occur in the controller.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;What a beauty! The core of the system remained the same - all the input was changed in real time!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Best Regards,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Gur Kashi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;gurkashi@gmail.com&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://gurkashi.blogspot.com/2010/10/using-mvc-for-different-server-versions.html</link><author>noreply@blogger.com (Gur Kashi)</author><thr:total>1</thr:total></item></channel></rss>