<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>prakasht</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/prakasht/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/prakasht/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:08:16 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Reverse words in a string</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/reverse-words-in-a-string</link>
      <pubDate>Mon, 16 Dec 2013 20:54:18 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/12/16/reverse-words-in-a-string/</guid>
      <description><![CDATA[Hi folks,
I am here with another example, how to reverse words in a string or sentence?
I have...]]></description>
      <content:encoded><![CDATA[<p>Hi folks,</p>
<p>I am here with another example, how to reverse words in a string or sentence?</p>
<p>I have tried with a approach. I would welcome other approaches, please share..</p>
<p>////// Complexity: O(n) + O(n)/2 ~ O(n)</p>
<p>public static string ReverseWordsInString(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string reverse = ReverseString(str);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string temp = "";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (string s in reverse.Split(' '))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; temp += ReverseString(s) + ' ';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return temp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>private static string ReverseString(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] chars = str.ToCharArray();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int j = str.Length-1;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i&lt;str.Length/2; i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char c = chars[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[i] = chars[j];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[j] = c;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j--;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new string(chars);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>]]></content:encoded>
    </item>
    <item>
      <title>Reverse a string in different ways</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/reverse-a-string-in-different-ways</link>
      <pubDate>Mon, 16 Dec 2013 20:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/12/16/reverse-a-string-in-different-ways/</guid>
      <description><![CDATA[Hi folks,
I am here with another example,&nbsp;how to reverse a string in different ways?
Below...]]></description>
      <content:encoded><![CDATA[<p>Hi folks,</p>
<p>I am here with another example,&nbsp;how to reverse a string in different ways?</p>
<p>Below are the different ways to do it.</p>
<p>&nbsp;</p>
<p>/// Need one extra array for result, need to traverse full array.</p>
<p>public static string ReverseString1 (string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] chars = str.ToCharArray();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] result = new char[chars.Length];</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0, j = str.Length - 1; i &lt; str.Length; i++, j--)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result[i] = chars[j];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new string(result);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>-----------------------------------------------------------------</p>
<p>/// Uses swap method to reverse; need to traverse only half of the array.</p>
<p>public static string ReverseString2(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] chars = str.ToCharArray();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0, j = str.Length - 1; i &lt; j; i++, j--)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char c = chars[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[i] = chars[j];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[j] = c;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new string(chars);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>------------------------------------------------------------------</p>
<p>/// Here is the use of in-place swap without any temp variable</p>
<p>public static string ReverseString3 (string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] chars = str.ToCharArray();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0, j = str.Length - 1; i &lt; j; i++, j--)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[i] = str[j];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[j] = str[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new string(chars);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>---------------------------------------------------------------------</p>
<p>/// String Reversal without Copy to Char Array it's i &lt;= j as we need to get the middle character in case of odd number of characters in the string</p>
<p>public static string ReverseString3b(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] chars = new char[str.Length];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0, j = str.Length - 1; i &lt;= j; i++, j--)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[i] = str[j];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[j] = str[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new string(chars);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>--------------------------------------------------------------------</p>
<p>&nbsp;/// String reversal with stack [Please note here Stack_Array is my custom Stack class, you can replace this with provided by .NET]</p>
<p>public static string ReverseString4(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stack_Array stk1 = new Stack_Array(str.Length);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (char c in str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stk1.Push(c);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string revString = null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (char c in str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; revString += stk1.Pop();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return revString;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>-------------------------------------------------------------------</p>
<p>/// String reversal with XOR (^); interesting way to reversal<br />/// A [i] = A[i] ^ A[len] -&gt; A[i]&nbsp; = 80 ^ 73 -&gt; A[i] = 25<br />/// A [len] = A[len] ^ A[i] -&gt; A[len]&nbsp; = 73 ^ 25 -&gt; A[len] = 80<br />/// A [i] = A[i] ^ A[len] -&gt; A[i]&nbsp; = 25 ^ 80 -&gt; A[i] = 73</p>
<p>public static string ReverseString5(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] inputstream = str.ToCharArray();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int length = str.Length - 1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; length; i++, length--)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputstream[i] ^= inputstream[length]; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputstream[length] ^= inputstream[i]; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inputstream[i] ^= inputstream[length]; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new string(inputstream);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>-------------------------------------------------------------------</p>
<p>&nbsp;/// Recursion method; simple and regular performance for small strings</p>
<p>public static string ReverseString_Rec(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (str.Length &lt;= 1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return str;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ReverseString_Rec(str.Substring(1)) + str[0];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>------------------------------------------------------------------</p>
<p>/// Another way of recursion; need to pass index as 0</p>
<p>public static string ReverseString_Rec2(string str, int index)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] chars = str.ToCharArray();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int len = chars.Length;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (index &lt; len / 2)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char c = chars[index];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[index] = chars[len - index - 1];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[len - index - 1] = c;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; index++;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ReverseString_Rec2(new string (chars), index);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new string(chars);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;</p>
<p>Please let me know your comments/ suggestions or if you have better ways :)</p>]]></content:encoded>
    </item>
    <item>
      <title>Find first non-repeated character in a string</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/find-first-non-repeated-character-in-a-string</link>
      <pubDate>Sun, 15 Dec 2013 07:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/12/15/find-first-non-repeated-character-in-a-string/</guid>
      <description><![CDATA[Hi folks,
This doesn't look difficult right :) however can u think of different ways to find first...]]></description>
      <content:encoded><![CDATA[<p>Hi folks,</p>
<p>This doesn't look difficult right :) however can u think of different ways to find first non-repeated character in a string?</p>
<p>I tried 3 different ways in C#. One with O(n^2) and 2 ways with O(n). Please suggest if you can think of better ways :)</p>
<p>&nbsp;///Complexity: O(n^2)</p>
<p>public static char FirstNonRepeatedCharInString (string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int i, j;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool isRepeted = false;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char[] chars = str.ToCharArray();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=0; i&lt;chars.Length;i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isRepeted = false;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (j=0;j&lt;chars.Length;j++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((i!=j) &amp;&amp; (chars[i]==chars[j]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isRepeted = true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (isRepeted ==false)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return chars[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ' ';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;---------------------------------------------------------------------------------------------</p>
<p>&nbsp;///Complexity: O(n)</p>
<p>public static char FirstNonRepeatedCharInString2(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dictionary&lt;char, int&gt; l1 = new Dictionary&lt;char, int&gt;();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int temp = 0;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (char c in str.ToCharArray())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (l1.Keys.Contains(c))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; temp = l1[c];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l1[c] = temp + 1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l1.Add(c,1);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (l1.Values.Contains(1))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return l1.First(x =&gt; x.Value == 1).Key;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ' ';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>----------------------------------------------------------------------------------------------</p>
<p>///Complexity: O(256) + O(n) + O(n) = O(n)</p>
<p>public static char FirstNonRepeatedCharInString3(string str)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[] chars = new int[256];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; chars.Length; i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[i] = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; str.Length; i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chars[str[i]]++;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; str.Length; i++)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (chars[str[i]] == 1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return str[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ' ';<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;</p>
<p>Happy Programming!!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>What's new is VS 2013 (RC) for web developers?</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/whats-new-is-vs-2013-rc-for-web-developers</link>
      <pubDate>Sun, 20 Oct 2013 02:53:53 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/10/20/whats-new-is-vs-2013-rc-for-web-developers/</guid>
      <description><![CDATA[Hello folks
Let's discuss some of the amazing enhancements and new features of VS 2013 (RC) in...]]></description>
      <content:encoded><![CDATA[<p>Hello folks</p>
<p>Let's discuss some of the amazing enhancements and new features of VS 2013 (RC) in general and&nbsp;mostly related to web technologies.</p>
<ul>
<li><strong>VS IDE Changes:</strong></li>
<ul>
<li>
<div>Feedback Icon</div>
</li>
<li>
<div>Notification symbol</div>
</li>
<li>
<div>Sign In option to save your profile</div>
</li>
<li>
<div>Tools-&gt;Options is now searchable and resizable</div>
</li>
</ul>
<li>&nbsp;<strong>Productivity Improvements:</strong></li>
<ul>
<li>
<div>Enhanced Scroll Bar</div>
</li>
<li>
<div>Auto Brace Completion</div>
</li>
<li>
<div>Move the code by ALT + UP/Down Aero key</div>
</li>
<li>
<div>Peek Definition</div>
</li>
</ul>
<li>
<div><strong>ASP.NET Enhancements:</strong></div>
</li>
<ul>
<li>
<div>
<div>Browsers Link (Bi-direction connection between VS and browser using Signal-R)</div>
</div>
</li>
<li>
<div>
<div>Signal-R internally uses Web Sockets(HTML 5 API) when it's available of Injects through java script.</div>
</div>
</li>
<li>
<div>
<div>Browsers Link Dashboard to manage tasks.</div>
</div>
</li>
<li>
<div>
<div>Unused CSS can be identified using Snapshot CSS USES option in browser link</div>
</div>
</li>
</ul>
<li>
<div>
<div><strong>Java Script Editor Changes:</strong></div>
</div>
</li>
<ul>
<li>
<div>
<div>Methods lookup like C# Editor</div>
</div>
</li>
<li>
<div>
<div>
<div>IntelliSense inside JavaScript for CSS/Html</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>Enforce Coding Standard by JSHint (comes with Web Essentials, setting can be modified)</div>
</div>
</div>
</li>
</ul>
<li>
<div>
<div>
<div><strong>HTML Editor Changes:</strong></div>
</div>
</div>
</li>
<ul>
<li>
<div>
<div>
<div>
<div>IntelliSense Inside quotes.</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>Auto HTML entities popup when type &amp;</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>Zen Coding supported using Web Essentials</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>Move to HTML using ALT+1 and ALT+2 using Web Essentials</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>Insert parent tags using ALT+SHIFT+W using Web Essentials</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>
<div>Improved Smart tags to do regular tasks (e.g. Remove and Keep Children) uniformed across VS using CTRL + .</div>
</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>
<div>Auto Formatting of tag when inserted in new line using Web Essentials (instead of CTRL+K, CTRL+D.</div>
</div>
</div>
</div>
</div>
</li>
</ul>
<li>
<div>
<div>
<div>
<div>&nbsp;<strong>CSS Editor Changes:</strong></div>
</div>
</div>
</div>
</li>
<ul>
<li>
<div>
<div>
<div>
<div>
<div>IntelliSense for CSS Ids inside file.</div>
</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>
<div>IntelliSense for Class name inside file</div>
</div>
</div>
</div>
</div>
</li>
<li>
<div>
<div>
<div>
<div>
<div>IntelliSense for html elements across project</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</ul>
<div>
<div>
<div>
<div>I have&nbsp;explored these features by downloading Visual Studio 2013 (RC). You can also try the same by downloading from below link</div>
<div><a href="https://www.microsoft.com/visualstudio/eng/downloads#d-2013-editions">https://www.microsoft.com/visualstudio/eng/downloads#d-2013-editions</a></div>
<div>&nbsp;</div>
<div>You can also download Web Essentials from below link.</div>
<div><a href="https://visualstudiogallery.msdn.microsoft.com/56633663-6799-41d7-9df7-0f2a504ca361">https://visualstudiogallery.msdn.microsoft.com/56633663-6799-41d7-9df7-0f2a504ca361</a></div>
<div>&nbsp;</div>
<div>Please let me know which feature u like the most :)</div>
<div>Look forward to your comments/suggestions.</div>
<div>&nbsp;</div>
<div>Thanks</div>
<div>&nbsp;</div>
</div>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>How to fix error "You can't pass property, indexer or dynamic member with out or ref parameter"</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/how-to-fix-error-you-cant-pass-property-indexer-or-dynamic-member-with-out-or-ref-parameter</link>
      <pubDate>Sat, 21 Sep 2013 09:36:00 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/09/21/how-to-fix-error-you-cant-pass-property-indexer-or-dynamic-member-with-out-or-ref-parameter/</guid>
      <description><![CDATA[Hi Folks,
I happened to encounter this trouble while trying to pass reference of a...]]></description>
      <content:encoded><![CDATA[<p>Hi Folks,</p>
<p>I happened to encounter this trouble while trying to pass reference of a Property.</p>
<p>&nbsp;public class LinkedListQ : QNode<br />&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: #ffff00;">private</span> QNode head = null;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public QNode Head<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return head;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;class Program<br />&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static void Main(string[] args)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LinkedListQ que = new LinkedListQ();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;que.ReverseList(ref que.<span style="background-color: #ffff00;">Head</span>);&nbsp;&nbsp;&nbsp;//Error "<strong>A property, indexer or dynamic member access may not be passed as an out or ref parameter</strong>"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>The reason as per MSDN is - Properties are not variables. They are methods, and cannot be passed to <span><span class="input">ref</span></span> parameters.</p>
<p>The workaround I figured out is to change the head variable to <span style="background-color: #00ff00;">internal</span> in order to be accessible from Program class and&nbsp;pass&nbsp;head variable reference instead Property.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: #00ff00;">internal</span> QNode head = null;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; que.ReverseList(ref que.<span style="background-color: #00ff00;">head</span>);&nbsp;&nbsp;//Works fine</p>
<p>&nbsp;</p>
<p>Reference: <a href="https://msdn.microsoft.com/en-us/library/14akc2c7.aspx">https://msdn.microsoft.com/en-us/library/14akc2c7.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>What’s new in SQL Server 2014 (CTP1)?</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/whats-new-in-sql-server-2014-ctp1</link>
      <pubDate>Thu, 29 Aug 2013 01:35:00 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/08/29/whats-new-in-sql-server-2014-ctp1/</guid>
      <description><![CDATA[The release of SQL Server 2014 (CTP1) has brought good amount of new features and enhancements. Some...]]></description>
      <content:encoded><![CDATA[<p>The release of SQL Server 2014 (CTP1) has brought good amount of new features and enhancements. Some of the notable features are presented below.</p>
<ul>
<li>Database Engine Enhancement:</li>
<ul>
<li><strong>In-Memory OLTP</strong> for ~10X performance gains by moving most used tables into memory.</li>
<li><strong>Updatable and clustered column store indexes </strong>for faster retrieval.</li>
<li><strong>Enhanced query processing</strong> for better performance without app changes.</li>
<li><strong>Buffer Pool extension to SSDs</strong> for faster paging.</li>
<li><strong>Resource Governor controls IO</strong> along with CPU and memory.</li>
<li><strong>Enhanced Always On</strong> now supports 8 secondary for better HA (High Availability)</li>
</ul>
</ul>
<ul>
<li>Business Intelligence Enhancement:</li>
<ul>
<li><strong>Power Query</strong> (formally codename &ldquo;Data Explorer&rdquo;) in Excel makes easy to access Internal and External data (both Relational and Non-Relational).</li>
<li><strong>Power Map</strong> (formally&nbsp;codename &ldquo;Geo Flow&rdquo;) in Excel can be used to get insights with 3D visualization.</li>
<li><strong>Parallel Data Warehouse with Polybase</strong> to support querying Big Data with T-SQL.</li>
</ul>
</ul>
<ul>
<li>Cloud support Enhancement:</li>
<ul>
<li><strong>Simplified cloud Backup</strong> <strong>and Deployment</strong> lets you Backup and Restore from SQL Azure/Windows Azure VM to SQL Server and vice-versa.</li>
<li><strong>HA/Always On in Azure </strong>helps to handle disaster recovery.</li>
</ul>
</ul>
<p>What's you most favorite feature :) let me know..&nbsp;</p>
<p>Reference: <a href="https://download.microsoft.com/download/8/4/F/84F00BE4-DAFE-4BA4-92AC-5D1080127984/SQL_Server_2014_CTP1_Product_Guide.zip">https://download.microsoft.com/download/8/4/F/84F00BE4-DAFE-4BA4-92AC-5D1080127984/SQL_Server_2014_CTP1_Product_Guide.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Change the default route in ASP.NET MVC</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/change-the-default-route-in-asp-net-mvc</link>
      <pubDate>Thu, 08 Aug 2013 07:56:24 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/08/08/change-the-default-route-in-asp-net-mvc/</guid>
      <description><![CDATA[Hello folks,
As we know that ASP.NET MVC by default takes following setting available in...]]></description>
      <content:encoded><![CDATA[<p>Hello folks,</p>
<p>As we know that ASP.NET MVC by default takes following setting available in <strong>RouteConfig</strong> file (under App_Start folder).</p>
<p>&nbsp;routes.MapRoute(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: "Default",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url: "{controller}/{action}/{id}",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaults: new { controller = "<strong>Home</strong>", action = "<strong>Index</strong>", id = UrlParameter.Optional }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</p>
<p>This means when you run the application, <strong>Home</strong> controller will be invoked and it's <strong>Index</strong> method will be executed by taking&nbsp;parameter&nbsp;id (if any).</p>
<p>you can change this behavior, if it's making sense to you.</p>
<p>For example if you want to invoke <strong>Store</strong> controller and It's <strong>Browse </strong>method while loading the application, you just need to change few things (controller and action values) as below.</p>
<p>routes.MapRoute(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: "Default",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; url: "{controller}/{action}/{id}",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaults: new { controller = "<strong>Store</strong>", action = "<strong>Browse</strong>", id = UrlParameter.Optional }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</p>
<p>Optionally you may also change the id parameter but I would personally recommend not to change (to keep it generic) unless there is some unavoidable reason.</p>
<p>Look forward for your comments!!</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Limits the number of records per page in SSRS 2012.</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/limits-the-number-of-records-per-page-in-ssrs-2012</link>
      <pubDate>Thu, 04 Jul 2013 02:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/07/04/limits-the-number-of-records-per-page-in-ssrs-2012/</guid>
      <description><![CDATA[Hello folks,
While working on the requirement to fix the number of records per&nbsp;page in the...]]></description>
      <content:encoded><![CDATA[<p>Hello folks,</p>
<p>While working on the requirement to fix the number of records per&nbsp;page in the report, I found that there is no such out of the box (OOB) property in SSRS 2012 to do so, However this can be achieved by some workarounds :). Below are the steps.</p>
<ul>
<li>
<div style="line-height: 1.5; font-size: 12px;">Navigate to the Rows Groups section and then Details. Select Add Group -&gt; Parent Group -&gt; Choose Expression in Group By (Leave Add group header/Add group footer as unchecked)</div>
</li>
<li>
<div style="line-height: 1.5; font-size: 12px;">Paste the following code into the expression box.</div>
</li>
</ul>
<p>=int((RowNumber(nothing)-1)/25)</p>
<ul>
<li>
<div style="font: 12px/18px 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-bottom: 15px; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">In the group property navigate to Page Breaks option and select "<strong>Between each instance of a group</strong>" and leave the other options below unchecked.</div>
</li>
<li>
<div style="font: 12px/18px 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; margin-bottom: 15px; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;">If you run your report, you could get error saying "A sort expression for tablix &lsquo;Tablix...&rsquo; uses the RowNumber<span class="Apple-converted-space">&nbsp;</span>function. RowNumber cannot be used in sort expressions."<strong style="font-weight: bold;">&nbsp;</strong>&nbsp;To fix the error <strong>remove the default sorting expression</strong> created in the group properties.</div>
</li>
<li>
<div style="line-height: 1.5; font-size: 12px;">By default the added SSRS group&nbsp;also gets added in Tablix column, if you wish not to keep this, you can remove this (Be careful to delete <strong>columns only</strong> and not the columns and associated groups.</div>
</li>
</ul>
<p style="line-height: 1.5; font-size: 12px;">Since it's a workaround, it has some constraint too :) which is when you export the report to excel, it exports different pages into different sheets which may not acceptable in all the cases but if export to excel is not a requirement, you may live with it.</p>
<p style="line-height: 1.5; font-size: 12px;">Please share your comments...&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Difference between Direct casting, is and as operator in C#</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/difference-between-direct-casting-is-and-as-operator-in-c</link>
      <pubDate>Tue, 23 Apr 2013 06:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2013/04/23/difference-between-direct-casting-is-and-as-operator-in-c/</guid>
      <description><![CDATA[Hi guys, below are the available ways in C# when you cast one data type to...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Hi guys, below are the available ways in C# when you cast one data type to another.</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><strong><span style="text-decoration: underline;">Direct casting</span></strong></span></p>
<p><span style="font-size: medium;"><span style="font-family: arial,helvetica,sans-serif;">Direct </span><span style="font-family: arial,helvetica,sans-serif;">cast is most common way of casting one type to another, however it yields exception </span><span style="font-family: arial,helvetica,sans-serif;">if casting can&rsquo;t be done.</span></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Below is the example to demonstrate the same.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">object length = 3.2;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">int test = (int)length; //Fails in runtime</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">Console.WriteLine(test);</span></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><strong><span style="text-decoration: underline;">is operator</span></strong></span></p>
<p><span style="font-size: medium;"><span style="font-family: arial,helvetica,sans-serif;">is operator checks whether an object is compatible with a </span><span style="font-family: arial,helvetica,sans-serif;">given type (on the right side) and the result of the evaluation is either true </span><span style="font-family: arial,helvetica,sans-serif;">(if casting can be done) or false (if casting can&rsquo;t be done) and since the </span><span style="font-family: arial,helvetica,sans-serif;">result is always a Boolean value so there is no chance of runtime exception. </span></span></p>
<p><span style="font-size: medium;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Below is the example to demonstrate the same.</span></span></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">object length = 3.2;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">if (length is int) //Check if length can </span><span style="font-family: arial,helvetica,sans-serif;">be cast to int</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">{</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; Console.WriteLine(length);</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><strong><span style="text-decoration: underline;">as operator</span></strong></span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">The <strong>as</strong> operator </span><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">is like a casting except that it yields null on conversion failure instead of </span><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">raising an exception. So runtime exception can be avoided using null check.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;"><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Below is the example to demonstrate the same.</span></span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">class MyClass //Sample class to test the scenario</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;{</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;int a;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string b;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;}</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;static void CastMe()</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="font-family: arial,helvetica,sans-serif;">&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object name = new MyClass();</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string test = name as </span><span style="font-family: arial,helvetica,sans-serif;">string;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (test != null) //Check if test is&nbsp;not null means i.e. casting can be done</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine(name);</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: arial,helvetica,sans-serif;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: medium;">Look forward to see your comments...&nbsp;</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>WPF Data Grid tips</title>
      <link>https://docs.microsoft.com/archive/blogs/prakasht/wpf-data-grid-tips</link>
      <pubDate>Wed, 14 Nov 2012 08:46:00 GMT</pubDate>
      <dc:creator><![CDATA[Prakash Tripathi]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/prakasht/2012/11/14/wpf-data-grid-tips/</guid>
      <description><![CDATA[Hi folks,
While working on WPF, I came to know some good Data grid tips and wanted to share you the...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Hi folks,</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">While working on WPF, I came to know some good Data grid tips and wanted to share you the same.</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: small;"><strong>Issue</strong>: WPF Data Grid is not reflecting the changed Item Source.</span></li>
</ul>
<p style="text-align: left;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Solution</strong>: If using MVVM pattern, Refresh the item source by below command.</span></p>
<p><span style="font-size: small;"><em><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CollectionViewSource.GetDefaultView(&lt;Your Data Grid collection name&gt;).Refresh(); </span></em></span></p>
<p>&nbsp;</p>
<ul>
<li><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;"><strong>Issue</strong>: How to open a context menu from data grid and assign event handler after clicking on menu item.</span></span></li>
</ul>
<p><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Solution</strong>: </span></span></p>
<p><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Step A: create context menu by inserting the following code.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Window.Resources&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;ContextMenu x:Key="<strong>mnuAddList</strong>" Name="mnuAddList"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;MenuItem Name="mnuAdd" Header="Edit"&nbsp; Command="{Binding <strong>PopUpAddCommand</strong>}"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/MenuItem&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ContextMenu&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Window.Resources&gt;</span></span></p>
<p><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please note that here Context menu key (i.e. mnuAddList) will be used to attach with data grid in the next step. Also PopUpAddCommand is a </span></span><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">property (defined&nbsp;in View Model)&nbsp;</span></span><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">of</span></span><span style="font-size: small;">&nbsp; DelegateCommand type which will have reference of event handler.</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Step B: Attach the menu created in step 1 with grid.</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DataGrid Name="grdAdd" ContextMenu ="{StaticResource mnuAddList}" &gt;</span></p>
<p>&nbsp;</p>
<ul>
<li><span style="font-size: small;"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;"><strong>Issue</strong>: Visibility property is not setting for Grid column and by doing so getting error as "</span></span></span><em>System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for&nbsp; target element. BindingExpression:Path=IsMyColumnVisibile; DataItem=null; target element is'DataGridTextColumn' (HashCode=7395880); target property is 'Visibility' (type'Visibility')</em>"<span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">&nbsp;</span></span></li>
</ul>
<p><strong><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Solution: </span></span></strong><span style="font-family: arial,helvetica,sans-serif; font-size: small;">DataGridColumns are not part of visual tree so they are not connected to the data context of the DataGrid due to that their visibility binding can't be done straight forward. To achieve this, following&nbsp; steps needs to performed.</span></p>
<ol>
<li>
<div style="text-align: left;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Add a proxy FrameworkElement in your ancestor panel's Resources.</span></div>
</li>
<li>
<div style="text-align: left;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Host it into an invisible ContentControl bound to its Content.</span></div>
</li>
<li>
<div style="text-align: left;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Use this ProxyElement as StaticResource for data context source in your visibility binding.</span></div>
</li>
</ol>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Code snippet</strong>:</span></p>
<p>&lt;StackPanel&gt;<br />&nbsp;&nbsp;&nbsp; &lt;StackPanel.Resources&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;FrameworkElement x:Key="ProxyElement" DataContext="{Binding}"/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/StackPanel.Resources&gt;<br />&nbsp;&nbsp;&nbsp; &lt;ContentControl Visibility="Collapsed" Content="{StaticResource ProxyElement}"/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;DataGrid AutoGenerateColumns="False"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DataGrid.Columns&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DataGridTextColumn Visibility="{Binding DataContext.IsMyColumnVisibile, Source={StaticResource ProxyElement}, Converter={StaticResource BooleanToVisibilityConverter}}" Binding="{Binding MyColumn}"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/DataGrid.Columns&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/DataGrid&gt;<br />&lt;/StackPanel&gt;&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Appreciate your comments!</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>