<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Kinnar Shah | Blog</title>
	<atom:link href="http://www.kinnarshah.in/index.php/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kinnarshah.in</link>
	<description>Just Another Geek With Just Another Blog...</description>
	<lastBuildDate>Fri, 16 Jul 2010 16:50:45 +0530</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on About Me by Kinnar A Shah</title>
		<link>http://www.kinnarshah.in/index.php/about/comment-page-1/#comment-104</link>
		<dc:creator>Kinnar A Shah</dc:creator>
		<pubDate>Fri, 16 Jul 2010 16:50:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?page_id=2#comment-104</guid>
		<description>Nice Site...
How you became microsoft student partner?</description>
		<content:encoded><![CDATA[<p>Nice Site&#8230;<br />
How you became microsoft student partner?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on IIMs say no to Paper Pencil CAT retest &#124; Aggrieved candidates to be rescheduled mid-January by CNA Training</title>
		<link>http://www.kinnarshah.in/index.php/2009/12/17/iims-say-no-to-paper-pencil-cat-retest-aggrieved-candidates-to-be-rescheduled-mid-january/comment-page-1/#comment-71</link>
		<dc:creator>CNA Training</dc:creator>
		<pubDate>Sat, 15 May 2010 03:29:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=102#comment-71</guid>
		<description>My cousin recommended this blog and she was totally right keep up the fantastic work!</description>
		<content:encoded><![CDATA[<p>My cousin recommended this blog and she was totally right keep up the fantastic work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Robotics Studio 2008 Workshop @ Teqnix by <img src='http://www.kinnarshah.in/wp-content/plugins/rpx/images/google.png'/> Kinnar Shah</title>
		<link>http://www.kinnarshah.in/index.php/2010/02/24/robotics-studio-2008-workshop-teqnix/comment-page-1/#comment-55</link>
		<dc:creator><img src='http://www.kinnarshah.in/wp-content/plugins/rpx/images/google.png'/> Kinnar Shah</dc:creator>
		<pubDate>Fri, 02 Apr 2010 17:29:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=216#comment-55</guid>
		<description>@Ayush: 
Can u mail me some high resolutin screenshots of the circuit u assembled??</description>
		<content:encoded><![CDATA[<p>@Ayush:<br />
Can u mail me some high resolutin screenshots of the circuit u assembled??</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Robotics Studio 2008 Workshop @ Teqnix by AYUSH</title>
		<link>http://www.kinnarshah.in/index.php/2010/02/24/robotics-studio-2008-workshop-teqnix/comment-page-1/#comment-44</link>
		<dc:creator>AYUSH</dc:creator>
		<pubDate>Thu, 11 Mar 2010 07:47:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=216#comment-44</guid>
		<description>hey i hav constructed the robot..i get a red light on the circuit..bt it still dont work...can u please guide????
and actually i dont find the drivers of the usb in the disc..can u please mail me...plz reply as soon as u can...m waiting..u cn call me also on 9913606525</description>
		<content:encoded><![CDATA[<p>hey i hav constructed the robot..i get a red light on the circuit..bt it still dont work&#8230;can u please guide????<br />
and actually i dont find the drivers of the usb in the disc..can u please mail me&#8230;plz reply as soon as u can&#8230;m waiting..u cn call me also on 9913606525</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Robotics Studio 2008 Workshop @ Teqnix by <img src='http://www.kinnarshah.in/wp-content/plugins/rpx/images/google.png'/> Kinnar Shah</title>
		<link>http://www.kinnarshah.in/index.php/2010/02/24/robotics-studio-2008-workshop-teqnix/comment-page-1/#comment-37</link>
		<dc:creator><img src='http://www.kinnarshah.in/wp-content/plugins/rpx/images/google.png'/> Kinnar Shah</dc:creator>
		<pubDate>Wed, 03 Mar 2010 04:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=216#comment-37</guid>
		<description>@Chirag: thanks... and watchout this space for info on more events... :)

@Dishang: thanks for the feedback... 

@Shail: have fun making the robot... and yeah... am there if u have any problems...</description>
		<content:encoded><![CDATA[<p>@Chirag: thanks&#8230; and watchout this space for info on more events&#8230; <img src='http://www.kinnarshah.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>@Dishang: thanks for the feedback&#8230; </p>
<p>@Shail: have fun making the robot&#8230; and yeah&#8230; am there if u have any problems&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Robotics Studio 2008 Workshop @ Teqnix by Shail parikh</title>
		<link>http://www.kinnarshah.in/index.php/2010/02/24/robotics-studio-2008-workshop-teqnix/comment-page-1/#comment-36</link>
		<dc:creator>Shail parikh</dc:creator>
		<pubDate>Tue, 02 Mar 2010 09:57:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=216#comment-36</guid>
		<description>Real nice experience..
Im soon going to construct the robot and if i have some doubts i sure am going to contact you. Thanks a ton for the very informative presentation.......</description>
		<content:encoded><![CDATA[<p>Real nice experience..<br />
Im soon going to construct the robot and if i have some doubts i sure am going to contact you. Thanks a ton for the very informative presentation&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Robotics Studio 2008 Workshop @ Teqnix by Dishang Bhavsar</title>
		<link>http://www.kinnarshah.in/index.php/2010/02/24/robotics-studio-2008-workshop-teqnix/comment-page-1/#comment-34</link>
		<dc:creator>Dishang Bhavsar</dc:creator>
		<pubDate>Sat, 27 Feb 2010 09:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=216#comment-34</guid>
		<description>Very nice arrangement.I am very thankfull to all teqnix members who worked so hard to teach us about autonomous robotics.I learnt so many things which r so much useful to us ic people.Thanks a lot again.</description>
		<content:encoded><![CDATA[<p>Very nice arrangement.I am very thankfull to all teqnix members who worked so hard to teach us about autonomous robotics.I learnt so many things which r so much useful to us ic people.Thanks a lot again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Robotics Studio 2008 Workshop @ Teqnix by Chirag Shah</title>
		<link>http://www.kinnarshah.in/index.php/2010/02/24/robotics-studio-2008-workshop-teqnix/comment-page-1/#comment-33</link>
		<dc:creator>Chirag Shah</dc:creator>
		<pubDate>Thu, 25 Feb 2010 19:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=216#comment-33</guid>
		<description>Nice experience... can we have more of these?</description>
		<content:encoded><![CDATA[<p>Nice experience&#8230; can we have more of these?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Visual Studio 2010b2 and .NET Framework 4b2 Training Kit announced by Luffie</title>
		<link>http://www.kinnarshah.in/index.php/2009/10/21/visual-studio-2010b2-and-net-framework-4b2-training-kit-announced/comment-page-1/#comment-31</link>
		<dc:creator>Luffie</dc:creator>
		<pubDate>Sun, 21 Feb 2010 00:43:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/?p=52#comment-31</guid>
		<description>I do a system restore or reboot, whatever its called? Because I do virus scans, I cleaned out any unwanted programs and it is still slow! I was thinking if I restored my computer back to the &quot;out of box&quot; state it will make it faster? I know i&#039;ll lose everything but thats the whole point.  </description>
		<content:encoded><![CDATA[<p>I do a system restore or reboot, whatever its called? Because I do virus scans, I cleaned out any unwanted programs and it is still slow! I was thinking if I restored my computer back to the &#8220;out of box&#8221; state it will make it faster? I know i&#8217;ll lose everything but thats the whole point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Interesting Linq Problem by Sanil</title>
		<link>http://www.kinnarshah.in/index.php/2009/11/04/interesting-linq-problem/comment-page-1/#comment-14</link>
		<dc:creator>Sanil</dc:creator>
		<pubDate>Wed, 04 Nov 2009 20:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.kinnarshah.in/index.php/2009/11/04/interesting-linq-problem/#comment-14</guid>
		<description>Really interesting...
well! IMO that&#039;s correct to me...
the query will return a sorted enumerable collection

though, I will like it to write like this:

using System.Linq; 
namespace solution
{
 class Program 
 { 
  static void Main() 
  { 
    int[] data = { 1, 2, 3, 1, 2, 1 }; 
    foreach (var m in from m in data orderby m select m) 
      System.Console.Write(m); 
  } 
 }
}

Here the foreach block should work like this
foreach (var m in [from m in data orderby m select m] ) 

or

foreach(var m = [from m&#039; in data order by m&#039; select m&#039;])

that would eventually looks like on further abstraction
var m in m&#039; (where m&#039; is enumerable)

take things between [ ] as another block.
Here a block is code construct between braces 
{ /// A block }

when compiler will be working on above given code, it will take the two Ms (read as ams), and will internally create two different variables for this.
actually compiler does this often, where it needs to do things like
variable = variale * something; (here * is an operation)

Let me prove this by running a Reflection (System.Reflection) based Method Body (The main method) analysis:

Let&#039;s assume, if the main() body has construct like this:
public class program
{
    public void main()
    {
        int[ ] data = { 1, 2, 3, 1, 2, 1 }; 
        foreach (var num in data)
        {
            System.Console.Write(num);
        }
    }
}

 We will use above main() block, as given below to get our analysis done

    class Program 
    { 
      static void Main() 
      {  
         int[] data = { 1, 2, 3, 1, 2, 1 };
         foreach (var num in data)
         {
            System.Console.Write(num);
         } 
         
         new Analyse().Run();
      } 
    }

    class Analyse
    {
        public void Run()
        {
            Assembly asm = Assembly.GetAssembly(typeof(Program));
            MethodBody mb = asm.EntryPoint.GetMethodBody();
            System.Console.WriteLine(&quot;\nMethod Name: &quot;+asm.EntryPoint.Name);
            
            foreach (var locals in mb.LocalVariables)
            {
                System.Console.WriteLine(&quot;\n {0}&quot;, locals.LocalType.FullName);
            }
            System.Console.ReadKey();
        }
    }

The Run method would actually list all the variables that are present after actual compilation, this will include the variables we have declared explicitly or implicitly as well as helper variables introduced by compiler to store temporary results and perform calculations.

The output on listing local variables in compiled assembly is:
( The actual variables that are present after compilation)

Method Name: Main

System.Int32[]

System.Int32

System.Int32[]

System.Int32

System.Boolean

A Little explanation:

the first system.Int32[] is this array int[ ] data = { 1, 2, 3, 1, 2, 1 }; 

next System.Int32 will receive value at each iteration and will be used in WriteLine()

the second System.Int32[] refers to ForEach&#039;s copy of array. Remember foreach doesn&#039;t allow changing contents, so it makes a copy.

the second Int32 is an index to track current iterator location

last is a boolean which stores the result of condition check

p.s: this is all guess work :P

How did I decided that Ist System.int32 is what and what&#039;s the role of the second one. Let&#039;s edit our code a bit to play with a char array.

    class Program 
    { 
      static void Main() 
      {  
         char[] ch = { &#039;a&#039;, &#039;b&#039;, &#039;c&#039; };
         foreach (var num in ch)
         {
             System.Console.Write(num);
         }
         
         new Analyse().Run();
      } 
    }

    class Analyse
    {
        public void Run()
        {
            Assembly asm = Assembly.GetAssembly(typeof(Program));
            MethodBody mb = asm.EntryPoint.GetMethodBody();
            System.Console.WriteLine(&quot;\nMethod Name: &quot;+asm.EntryPoint.Name);
            
            foreach (var locals in mb.LocalVariables)
            {
                System.Console.WriteLine(&quot;\n {0}&quot;, locals.LocalType.FullName);
            }
            System.Console.ReadKey();
        }
    }

This time the output appears like this:
 
Method Name: Main

 System.Char[]

 System.Char

 System.Char[]

 System.Int32

 System.Boolean

so you can see that, system.char is getting the assigned value that will be WriteLined (outputted)
and thus comparing the ordinal similiarity between the two outputs it would be a right to think that first system.int32 is getting the current value of data (where iterator is pointing).

Back to our actual code,

    class Program 
    { 
      static void Main() 
      {  
         int[] data = { 1, 2, 3, 1, 2, 1 };

         char[] ch = { &#039;a&#039;, &#039;b&#039;, &#039;c&#039; };

         foreach (var m in from m in data orderby m select m)
             System.Console.Write(m);
         
         new Analyse().Run();
      } 
    }

    class Analyse
    {
        public void Run()
        {
            Assembly asm = Assembly.GetAssembly(typeof(Program));
            MethodBody mb = asm.EntryPoint.GetMethodBody();
            System.Console.WriteLine(&quot;\nMethod Name: &quot;+asm.EntryPoint.Name);
            
            foreach (var locals in mb.LocalVariables)
            {
                System.Console.WriteLine(&quot;\n {0}&quot;, locals.LocalType.FullName);
            }
            System.Console.ReadKey();
        }
    }

running same analysis on this code gives following output (explanation to each line is in corresponding brackets)

Method Name: Main

System.Int32[ ] 
(the actual data[] array)

System.Int32
(that will receive value at each iteration and will be WriteLined/outputted)

System.Collections.Generic.IEnumerator`1[[System.Int32, mscorlib blah blah blah... ]]
( the generic IEnumerator generated from LINQ expression obtained, now all classes implementing IEnumerator has a method called MoveNext( ), hence it will not require any additional Sytem.int32 indexer, hence here it is absent in output)

System.Boolean
(condition check result as previously stated)
From all this we get  that compiler handle duplicate references smartly, until we play by his rules (according to C# language specs)

making that Looong explanation short, here the var m (implicitly of type int32) is completely isolated from IEnumerator type &#039;m&#039; in LINQ query due to somehow invisible scope block that compiler can see and work with when they encounter complex expressions like LINQ queries in such constructs.

Hoping, that I&#039;m here right in what I&#039;m thinking, if you think I&#039;m somewhere wrong do comment your opinion and theory/proofs here.</description>
		<content:encoded><![CDATA[<p>Really interesting&#8230;<br />
well! IMO that&#8217;s correct to me&#8230;<br />
the query will return a sorted enumerable collection</p>
<p>though, I will like it to write like this:</p>
<p>using System.Linq;<br />
namespace solution<br />
{<br />
 class Program<br />
 {<br />
  static void Main()<br />
  {<br />
    int[] data = { 1, 2, 3, 1, 2, 1 };<br />
    foreach (var m in from m in data orderby m select m)<br />
      System.Console.Write(m);<br />
  }<br />
 }<br />
}</p>
<p>Here the foreach block should work like this<br />
foreach (var m in [from m in data orderby m select m] ) </p>
<p>or</p>
<p>foreach(var m = [from m' in data order by m' select m'])</p>
<p>that would eventually looks like on further abstraction<br />
var m in m&#8217; (where m&#8217; is enumerable)</p>
<p>take things between [ ] as another block.<br />
Here a block is code construct between braces<br />
{ /// A block }</p>
<p>when compiler will be working on above given code, it will take the two Ms (read as ams), and will internally create two different variables for this.<br />
actually compiler does this often, where it needs to do things like<br />
variable = variale * something; (here * is an operation)</p>
<p>Let me prove this by running a Reflection (System.Reflection) based Method Body (The main method) analysis:</p>
<p>Let&#8217;s assume, if the main() body has construct like this:<br />
public class program<br />
{<br />
    public void main()<br />
    {<br />
        int[ ] data = { 1, 2, 3, 1, 2, 1 };<br />
        foreach (var num in data)<br />
        {<br />
            System.Console.Write(num);<br />
        }<br />
    }<br />
}</p>
<p> We will use above main() block, as given below to get our analysis done</p>
<p>    class Program<br />
    {<br />
      static void Main()<br />
      {<br />
         int[] data = { 1, 2, 3, 1, 2, 1 };<br />
         foreach (var num in data)<br />
         {<br />
            System.Console.Write(num);<br />
         } </p>
<p>         new Analyse().Run();<br />
      }<br />
    }</p>
<p>    class Analyse<br />
    {<br />
        public void Run()<br />
        {<br />
            Assembly asm = Assembly.GetAssembly(typeof(Program));<br />
            MethodBody mb = asm.EntryPoint.GetMethodBody();<br />
            System.Console.WriteLine(&#8220;\nMethod Name: &#8220;+asm.EntryPoint.Name);</p>
<p>            foreach (var locals in mb.LocalVariables)<br />
            {<br />
                System.Console.WriteLine(&#8220;\n {0}&#8221;, locals.LocalType.FullName);<br />
            }<br />
            System.Console.ReadKey();<br />
        }<br />
    }</p>
<p>The Run method would actually list all the variables that are present after actual compilation, this will include the variables we have declared explicitly or implicitly as well as helper variables introduced by compiler to store temporary results and perform calculations.</p>
<p>The output on listing local variables in compiled assembly is:<br />
( The actual variables that are present after compilation)</p>
<p>Method Name: Main</p>
<p>System.Int32[]</p>
<p>System.Int32</p>
<p>System.Int32[]</p>
<p>System.Int32</p>
<p>System.Boolean</p>
<p>A Little explanation:</p>
<p>the first system.Int32[] is this array int[ ] data = { 1, 2, 3, 1, 2, 1 }; </p>
<p>next System.Int32 will receive value at each iteration and will be used in WriteLine()</p>
<p>the second System.Int32[] refers to ForEach&#8217;s copy of array. Remember foreach doesn&#8217;t allow changing contents, so it makes a copy.</p>
<p>the second Int32 is an index to track current iterator location</p>
<p>last is a boolean which stores the result of condition check</p>
<p>p.s: this is all guess work <img src='http://www.kinnarshah.in/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>How did I decided that Ist System.int32 is what and what&#8217;s the role of the second one. Let&#8217;s edit our code a bit to play with a char array.</p>
<p>    class Program<br />
    {<br />
      static void Main()<br />
      {<br />
         char[] ch = { &#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217; };<br />
         foreach (var num in ch)<br />
         {<br />
             System.Console.Write(num);<br />
         }</p>
<p>         new Analyse().Run();<br />
      }<br />
    }</p>
<p>    class Analyse<br />
    {<br />
        public void Run()<br />
        {<br />
            Assembly asm = Assembly.GetAssembly(typeof(Program));<br />
            MethodBody mb = asm.EntryPoint.GetMethodBody();<br />
            System.Console.WriteLine(&#8220;\nMethod Name: &#8220;+asm.EntryPoint.Name);</p>
<p>            foreach (var locals in mb.LocalVariables)<br />
            {<br />
                System.Console.WriteLine(&#8220;\n {0}&#8221;, locals.LocalType.FullName);<br />
            }<br />
            System.Console.ReadKey();<br />
        }<br />
    }</p>
<p>This time the output appears like this:</p>
<p>Method Name: Main</p>
<p> System.Char[]</p>
<p> System.Char</p>
<p> System.Char[]</p>
<p> System.Int32</p>
<p> System.Boolean</p>
<p>so you can see that, system.char is getting the assigned value that will be WriteLined (outputted)<br />
and thus comparing the ordinal similiarity between the two outputs it would be a right to think that first system.int32 is getting the current value of data (where iterator is pointing).</p>
<p>Back to our actual code,</p>
<p>    class Program<br />
    {<br />
      static void Main()<br />
      {<br />
         int[] data = { 1, 2, 3, 1, 2, 1 };</p>
<p>         char[] ch = { &#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217; };</p>
<p>         foreach (var m in from m in data orderby m select m)<br />
             System.Console.Write(m);</p>
<p>         new Analyse().Run();<br />
      }<br />
    }</p>
<p>    class Analyse<br />
    {<br />
        public void Run()<br />
        {<br />
            Assembly asm = Assembly.GetAssembly(typeof(Program));<br />
            MethodBody mb = asm.EntryPoint.GetMethodBody();<br />
            System.Console.WriteLine(&#8220;\nMethod Name: &#8220;+asm.EntryPoint.Name);</p>
<p>            foreach (var locals in mb.LocalVariables)<br />
            {<br />
                System.Console.WriteLine(&#8220;\n {0}&#8221;, locals.LocalType.FullName);<br />
            }<br />
            System.Console.ReadKey();<br />
        }<br />
    }</p>
<p>running same analysis on this code gives following output (explanation to each line is in corresponding brackets)</p>
<p>Method Name: Main</p>
<p>System.Int32[ ]<br />
(the actual data[] array)</p>
<p>System.Int32<br />
(that will receive value at each iteration and will be WriteLined/outputted)</p>
<p>System.Collections.Generic.IEnumerator`1[[System.Int32, mscorlib blah blah blah... ]]<br />
( the generic IEnumerator generated from LINQ expression obtained, now all classes implementing IEnumerator has a method called MoveNext( ), hence it will not require any additional Sytem.int32 indexer, hence here it is absent in output)</p>
<p>System.Boolean<br />
(condition check result as previously stated)<br />
From all this we get  that compiler handle duplicate references smartly, until we play by his rules (according to C# language specs)</p>
<p>making that Looong explanation short, here the var m (implicitly of type int32) is completely isolated from IEnumerator type &#8216;m&#8217; in LINQ query due to somehow invisible scope block that compiler can see and work with when they encounter complex expressions like LINQ queries in such constructs.</p>
<p>Hoping, that I&#8217;m here right in what I&#8217;m thinking, if you think I&#8217;m somewhere wrong do comment your opinion and theory/proofs here.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
