<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Chris May</title>
  <link rel="alternate" type="text/html" href="http://chrismay.org/" />
  <link rel="self" href="http://chrismay.org/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2010-08-29T20:33:39.928875-05:00</updated>
  <author>
    <name>Christopher May, Inc</name>
  </author>
  <subtitle>{Consulting; .Net Development; IT Services}</subtitle>
  <id>http://chrismay.org/</id>
  <generator uri="http://dasblog.info/" version="2.3.9074.18820">DasBlog</generator>
  <entry>
    <title>ASP.NET Markup Go To Definition and Snippets</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/08/30/ASPNET+Markup+Go+To+Definition+And+Snippets.aspx" />
    <id>http://chrismay.org/PermaLink,guid,5c609508-b2b2-41f1-a767-b138dce33335.aspx</id>
    <published>2010-08-29T20:32:14.928875-05:00</published>
    <updated>2010-08-29T20:33:39.928875-05:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <category term="Programming/.Net/VS.Net" label="Programming/.Net/VS.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetVSNet.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="html">&lt;p&gt;
&lt;span style="FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color=#000000&gt;I
don’t know if this is something new in VS or if it’s because I have the power tools
installed, but I just realized that I can pick “Go to Definition” on an asp.net object
in my code behind, like a label, or an asp.net checkbox, and instead of taking me
to the vb definition of the control, it takes me to the place where the object is
defined in the ASPX markup.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-FAMILY: 'Calibri','sans-serif'; FONT-SIZE: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt; 
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font color=#000000&gt;And, in vs2010 if you auto complete with pressing tab 2 times
when adding aspx markup items it will auto complete the entire element, not just the
little bit you are typing.&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font color=#000000&gt;So for example, if you type “&amp;lt;asp:But” and press tab you get:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: Consolas; COLOR: blue; FONT-SIZE: 10pt"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon; FONT-SIZE: 10pt"&gt;asp&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: blue; FONT-SIZE: 10pt"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon; FONT-SIZE: 10pt"&gt;Button&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; FONT-SIZE: 10pt"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font color=#000000&gt;But if you tab again you get:&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font size=2&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon"&gt;Button&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas"&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="text"&lt;/span&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&lt;/span&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font color=#000000&gt;There are snippets included that are named things like “textbox”
and “button”, so if you type “&amp;lt;bu” or “&amp;lt;hyp” and hit tab 2 times you get:&lt;/font&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;font size=2&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon"&gt;Button&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas"&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="text"&lt;/span&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&lt;/span&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;font color=#000000&gt;Or&lt;/font&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;font size=2&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas; COLOR: maroon"&gt;HyperLink&lt;/span&gt;&lt;span style="FONT-FAMILY: Consolas"&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: red"&gt;NavigateUrl&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="navigateurl"&lt;/span&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&lt;/span&gt;&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=5c609508-b2b2-41f1-a767-b138dce33335" /&gt;</content>
  </entry>
  <entry>
    <title>Repoint Access linked tables to different connection string</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/08/26/Repoint+Access+Linked+Tables+To+Different+Connection+String.aspx" />
    <id>http://chrismay.org/PermaLink,guid,6ff0eba7-1c03-438c-adf0-26b4c21d0895.aspx</id>
    <published>2010-08-26T13:38:24.632-05:00</published>
    <updated>2010-08-26T13:41:21.991375-05:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been looking for a way to do this for a project I'm working on.
</p>
        <p>
The access app has linked tables that are on a SQL server, but it doesn't use a DSN. 
Instead the connection string is somewhere unknown to the user and so repointing it
(like user server1 instead of server2, or db1 instead of db2) was a major pain point.
</p>
        <p>
Finally I found some code that I can use to change it.  I changed some names,
but you get the idea.  
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Private</span>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span> Detail_DblClick(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ByVal</span> Cancel <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Integer</span>) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Dim</span> db <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span> Database, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">source</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span>,
path <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Dim</span> dbsource <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span>,
i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Integer</span>,
j <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Integer</span> db <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> DBEngine.Workspaces(0).Databases(0) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">For</span> i <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> 0 <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">To</span> db.TableDefs.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">count</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">-</span> 1 <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">If</span> db.TableDefs(i).Connect
&lt;&gt; <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"
"</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Then</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">If</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Right</span>(db.TableDefs(i).Connect,
15) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"DbNameHere12345"</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Then</span> db.TableDefs(i).Connect <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> db.TableDefs(i).Connect
&amp; <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"Updated"</span> db.TableDefs(i).RefreshLink() <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">If</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">If</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Next</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span></span>
        </pre>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=6ff0eba7-1c03-438c-adf0-26b4c21d0895" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Convert Spaces To Tabs For A Visual Studio Solution or Project</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/08/19/Convert+Spaces+To+Tabs+For+A+Visual+Studio+Solution+Or+Project.aspx" />
    <id>http://chrismay.org/PermaLink,guid,5421ea3b-0a77-4751-ae16-d7bba5c4c676.aspx</id>
    <published>2010-08-19T13:55:55.991375-05:00</published>
    <updated>2010-08-19T14:17:54.053875-05:00</updated>
    <category term="Code" label="Code" scheme="http://chrismay.org/CategoryView,category,Code.aspx" />
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <category term="Programming/.Net/VS.Net" label="Programming/.Net/VS.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetVSNet.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I recently installed some VS.Net power tools, and 1 of the tools is something that
tells you when you have a file with mixed tabs and spaces, giving you the chance to
convert from one to another.
</p>
        <p>
I decided to stick with Tabs (I know that spaces v. tabs is a religious war for many,
but I won't go into it).  The problem is that this only happens on a file by
file basis.  Furthermore, when you change the whitespace, your source controls
sees that lots and lots of lines in your file have changed, making it hard to see
the 1 or 2 lines that ACTUALLY changed.
</p>
        <p>
I didn't find a single utility out there for converting spaces to tabs, so after some
poking around I've come up with a workaround that does the trick, even if it is a
bit hackish.
</p>
        <p>
I created a Find/Replace regular expression that will find leading groups of 4 spaces
and replace them with tabs.  The problem is: you have to run it recursively. 
So if you have a spot in your code with 10 tabs of indentation, you'll need to run
the find/replace 10 times in a row, which each iteration converting 1 of the groups
of 4 spaces to a tab.
</p>
        <p>
Each time you run the Find/Replace the count will get smaller and smaller, until finally:
0.
</p>
        <p>
The basic pattern you search for is:
</p>
        <p>
^{(\t)*}([ ]^4)
</p>
        <p>
and you replace with:
</p>
        <p>
\1\t
</p>
        <p>
In this example, the ^4 means that I'm treating 4 spaces as a tab.  Change the
number if you want to have 2 spaces = a tab or whatever.
</p>
        <p>
Another thing you can do to make it run faster on a large project is to first try
to replace large sections of spaces before replaces 4 spaces at a time.  For
example, the following stuff will search for 20 spaces and replace with 5 tabs.
</p>
        <p>
You search for:
</p>
        <p>
^{(\t)*}([ ]^20)
</p>
        <p>
and you replace with:
</p>
        <p>
\1\t\t\t\t\t
</p>
        <p>
This way, if you have 1 spot in your code with 60 spaces, you won't have to run the
replace 15 times.
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=5421ea3b-0a77-4751-ae16-d7bba5c4c676" />
      </div>
    </content>
  </entry>
  <entry>
    <title>IPhone BlindType</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/23/IPhone+BlindType.aspx" />
    <id>http://chrismay.org/PermaLink,guid,40811500-25cb-46bd-9bde-b97697c87227.aspx</id>
    <published>2010-07-23T11:11:25.296625-05:00</published>
    <updated>2010-07-23T11:11:50.734125-05:00</updated>
    <category term="Cool" label="Cool" scheme="http://chrismay.org/CategoryView,category,Cool.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Pretty cool:
</p>
        <p>
          <a href="http://blindtype.com/">http://blindtype.com/</a>
        </p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=40811500-25cb-46bd-9bde-b97697c87227" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Facebook isn't even trying anymore are they</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/14/Facebook+Isnt+Even+Trying+Anymore+Are+They.aspx" />
    <id>http://chrismay.org/PermaLink,guid,382bf804-d2ef-41c0-a120-79b04419b7b2.aspx</id>
    <published>2010-07-14T09:27:33.063625-05:00</published>
    <updated>2010-07-14T09:29:34.219875-05:00</updated>
    <category term="Misc" label="Misc" scheme="http://chrismay.org/CategoryView,category,Misc.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
WOW!
</p>
        <p>
          <img border="0" src="http://chrismay.org/content/binary/FacebookPhishing.jpg" />
        </p>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=382bf804-d2ef-41c0-a120-79b04419b7b2" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Beware of the Invisible Shield by ZAGG for Iphone</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/12/Beware+Of+The+Invisible+Shield+By+ZAGG+For+Iphone.aspx" />
    <id>http://chrismay.org/PermaLink,guid,ecacbffb-f600-4fca-b64a-e40ef958ec94.aspx</id>
    <published>2010-07-12T15:45:05.235-05:00</published>
    <updated>2010-07-12T16:08:18.219875-05:00</updated>
    <category term="Misc" label="Misc" scheme="http://chrismay.org/CategoryView,category,Misc.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just coughed up a rediculous amount of money for one of these screen protectors
as I know the iphone 4 tends to scratch easily.
</p>
        <p>
I've owned iphones going all the way back to the original 2G version and I've always
used a screen protector on all of them.
</p>
        <p>
I have never been so disappointed as with this piece of crap ZAGG product.
</p>
        <p>
It looks terrible, it doesn't go one smooth or easy AT ALL, and it's texture is like
rubbery so your finger doesn't slide on it.
</p>
        <p>
I've never had issues with screen protectors on any of my other phones (or my wife's
iphone as well) but this one is the absolute worst.  Garbage!
</p>
        <p>
I hope you can avoid wasting your money like I just did.  Orders something online,
there is no way there could be a worse product b/c I've used half a dozen others and
none come close to being as crappy as this one.
</p>
        <p>
UPDATE: I just tried installing the back protector and it was even worse than the
front.
</p>
        <p>
The way they have you apply the the cover is to lay it out using a larger area applicant
strip.  You then peel away the large area thing and you are left with the protector
in the right place.  Only problem is, the adhesive between the 2 is 100x stronger
than the adhesive between the protector and your iphone.  In order to seperate
the 2 you have to stretch out the protector and then you are left trying to apply
it by hand.  What a total joke.  
</p>
        <p>
Stay clear of this waste.
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=ecacbffb-f600-4fca-b64a-e40ef958ec94" />
      </div>
    </content>
  </entry>
  <entry>
    <title>How to setup port forwarding on the CISCO ASDM 5.2 </title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/12/How+To+Setup+Port+Forwarding+On+The+CISCO+ASDM+52.aspx" />
    <id>http://chrismay.org/PermaLink,guid,d032a03d-3959-473f-862f-2e039e2d66c7.aspx</id>
    <published>2010-07-11T20:27:59.26675-05:00</published>
    <updated>2010-07-11T20:28:44.298-05:00</updated>
    <category term="Networking" label="Networking" scheme="http://chrismay.org/CategoryView,category,Networking.aspx" />
    <category term="Networking/Firewall" label="Networking/Firewall" scheme="http://chrismay.org/CategoryView,category,NetworkingFirewall.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Go to configuration - &gt; security policy
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Add Access Rule
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Interface: outside
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Action: permit
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Source: any
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Destination: type in the public IP address, aka the outside interface IP address
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Service: "tcp/PORT_NUMBER_HERE"
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Click OK (maybe 2 times)
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
 
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Click Apply
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
 
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
 
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Then click on NAT on the left
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Click on Add Static Nat rule
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Under "Original" 
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Interface: Inside
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Source: Internal ip address that you want traffic routed to
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Under Translated
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Interface: outside
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Click the radio button that says "Use Interface IP Address"
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
Check the "Enable PAT" check box
</p>
        <p style="MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
TCP and set both ports to be what you want (i.e. 3389 for RDP)
</p>
        <p style="FONT-STYLE: italic; MARGIN: 0in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt">
This NAT part always seems backwards to me, but it works.
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=d032a03d-3959-473f-862f-2e039e2d66c7" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Manual Testing and Coded UI Testing</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/08/Manual+Testing+And+Coded+UI+Testing.aspx" />
    <id>http://chrismay.org/PermaLink,guid,a1651062-5097-42d7-973e-8403618caabb.aspx</id>
    <published>2010-07-07T23:04:11.407-05:00</published>
    <updated>2010-07-11T20:24:46.39175-05:00</updated>
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here is the video from a session I attended on Manual and Automated Coded UI Testing.  
</p>
        <p>
          <a href="http://www.msteched.com/2010/NorthAmerica/DEV309">http://www.msteched.com/2010/NorthAmerica/DEV309</a>
        </p>
        <p>
It was really impressive and interesting.
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=a1651062-5097-42d7-973e-8403618caabb" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Telerik Radgrid Filtering Error</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/05/Telerik+Radgrid+Filtering+Error.aspx" />
    <id>http://chrismay.org/PermaLink,guid,e89443eb-7e5e-46db-9ad2-206325d86fd0.aspx</id>
    <published>2010-07-05T18:14:47-05:00</published>
    <updated>2010-07-11T20:25:14.594875-05:00</updated>
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
When trying to filter my RadGrid using the built in filtering options, I kept getting
an exception on the server:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px"> Stack:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid
values. Parameter name: index at System.Web.UI.ControlCollection.get_Item(Int32 index)
at Telerik.Web.UI.GridTemplateColumn.GetCurrentFilterValueFromControl(TableCell cell)
at Telerik.Web.UI.GridColumn.RefreshCurrentFilterValue(GridFilteringItem filteringItem)
at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Object</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">source</span>)
at Telerik.Web.UI.RadGrid.OnBubbleEvent(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Object</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">source</span>,
EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Object</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">source</span>,
EventArgs args) at Telerik.Web.UI.GridItem.OnBubbleEvent(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Object</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">source</span>,
EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Object</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">source</span>,
EventArgs args) at Telerik.Web.UI.GridItem.OnBubbleEvent(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Object</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">source</span>,
EventArgs e) at Telerik.Web.UI.GridItem.FireCommandEvent(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span> commandName, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Object</span> commandArgument)
at Telerik.Web.UI.RadGrid.RaisePostBackEvent(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span> eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span> eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Boolean</span> includeStagesBeforeAsyncPoint, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Boolean</span> includeStagesAfterAsyncPoint)</span>
        </pre>
        <p>
Doing some research I found one guy who solved this problem by removing a duplicate
UniqueName on his columns, but unfortunately I didn't have any duplicates :(.
</p>
        <p>
Turned out that the problem was I, in an effort to disable filtering for some columns
that should have a filter option, had stumbled upon a quick solution, which was to
use the following markup in my template column:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">&lt;FilterTemplate <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">/</span>&gt;</span>
        </pre>
        <p>
Instead of:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">AllowFiltering=<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"False"</span></span>
        </pre>
        <p>
Having the empty filter template seemed to do the trick visually, but it was causing
the errors under the covers.
</p>
        <p>
So if you are getting the error above make sure you are dealing with filters in your
template columns correctly.
</p>
        <p>
 
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=e89443eb-7e5e-46db-9ad2-206325d86fd0" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Rhino Mocks VB.NET Extension Methods and Expect compiler problems</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/05/Rhino+Mocks+VBNET+Extension+Methods+And+Expect+Compiler+Problems.aspx" />
    <id>http://chrismay.org/PermaLink,guid,09c435a9-897a-4800-a6cf-ad0e2cd2467c.aspx</id>
    <published>2010-07-04T20:35:46.484-05:00</published>
    <updated>2010-07-05T11:02:26.03125-05:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <category term="Programming/.Net/.Net Framework" label="Programming/.Net/.Net Framework" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetNetFramework.aspx" />
    <category term="Programming/.Net/VB.Net" label="Programming/.Net/VB.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetVBNet.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
So today I updated my Rhino Mocks library to the newest version and bam, all my tests
broke.
</p>
        <p>
The errors were all on lines where I was doing things like:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">Expect.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Call</span>(viewMock.ViewState).<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Return</span>(viewState).Repeat.Any()</span>
        </pre>
        <p>
The error was:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">Overload
resolution failed because no accessible 'Expect' accepts this number of arguments.  </span>
        </pre>
        <p>
I found a few others having the same problem
</p>
        <p>
          <a href="http://groups.google.com/group/RhinoMocks/browse_thread/thread/ebdfc26579f25da1">http://groups.google.com/group/RhinoMocks/browse_thread/thread/ebdfc26579f25da1</a>
        </p>
        <p>
          <a href="http://groups.google.com.ag/group/rhinomocks/browse_thread/thread/a85251a7ad2fae70">http://groups.google.com.ag/group/rhinomocks/browse_thread/thread/a85251a7ad2fae70</a>
        </p>
        <p>
... but no real mention of <strong>why</strong> this was happening.
</p>
        <p>
I found pretty quickly that if I fully qualified things, it would work.  For
example, this works:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">Rhino.Mocks.Expect.<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Call</span>(viewMock.ViewState).<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Return</span>(viewState).Repeat.Any()</span>
        </pre>
        <p>
But I was already importing Rhino.Mocks so why the problem?
</p>
        <p>
 
</p>
        <p>
As it is, the error is that the compiler is trying to call an extension method named
"Expect".  This method extends the class Rhino.Mocks.RhinoMocks and is defined
in Rhino.Mocks.RhinoMocksExtensions.  The "Expect" that I actually want is a <strong>class </strong>defined
in Rhino.Mocks that has a static/shared method "Call".
</p>
        <p>
So why is the extension method of RhinoMocks getting picked up?  I think
it's a combination of 2 different things that are happening here.  The first
issue (I think) is that VB.Net does not support a static class.  Extension
methods are defined in static classes in C# and in <strong>modules </strong>in VB.Net. 
A module is kinda like a static class, except for a big difference: you don't have
to qualify the methods in a module by using the module name.
</p>
        <p>
In other words if you have this in VB.Net
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Module</span> MyMod <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span> DoSomething() <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Module</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Class</span> NotReallyStatic <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Shared</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span> DoThis() <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Class</span></span>
        </pre>
        <p>
The way you would call the 2 methods is:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">'***
Call DoSomething on the module</span> DoSomething() <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">'***
Call DoThis on NotReallyStatic</span> NotReallyStatic.DoThis()</span>
        </pre>
        <p>
So because VB treates the Static Class RhinoMockExtensions as a <strong>Module </strong>all
the extension methods become in scope without any qualification, so you end up with
a name collision on <strong>Expects.</strong></p>
        <p>
The seconde issue is that the Expects extension method in Rhino Mocks is extending
generic classes (e.g. T) where T is any class.  If the extension was happening
on any concrete class, I don't think we'd see this issue, but because it is ANY class,
the VB compiler this it could apply anywhere inside <strong>any</strong> of your classes. 
And remember, even if you DO require some concrete class for the extension, 
</p>
        <p>
Here's an example of this.
</p>
        <p>
Let's say your extension methods are defined like this:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Public</span>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Module</span> SomeClassExtensions
&lt;Runtime.CompilerServices.Extension()&gt; _ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span> ExtensionMethod(Of
T <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Class</span>)(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ByVal</span> o <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span> T, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ByVal</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">str</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span>)
Console.WriteLine(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">""</span>) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span> &lt;Runtime.CompilerServices.Extension()&gt;
_ <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Public</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span> ExtensionMethodString(<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ByVal</span> o <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span>, <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ByVal</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">str</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span>)
Console.WriteLine(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">""</span>) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Sub</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">End</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Module</span></span>
        </pre>
        <p>
Note that the first uses a generic class and then second extends String.
</p>
        <p>
Using these extension methods, basically ANYWHERE in your code (in VB) you could do
the following:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">'***
works</span>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Call</span> ExtensionMethod(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"foo"</span>) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Dim</span> s <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">As</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">String</span> s.ExtensionMethodString(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"foo"</span>) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">'***
won't work</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Call</span> ExtensionMethodString(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"foo"</span>) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">'***
also works!</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Call</span> ExtensionMethodString(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"foo"</span>, <span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"bar"</span>)</span>
        </pre>
        <p>
You can see that we are able to call the generic extension method direct as if it
were an instance method in whatever class we are currently working because (I think)
the compiler is treating <strong>Me</strong> (or <strong>this </strong>in C#) as <strong>T</strong>,
and the method is in scope because it is defined in a Module and not a Static Class
as it would be in C#.  
</p>
        <p>
We can't directly call <strong>ExtensionMethodString </strong>because the class I
am currently in does not inherit from String.  But, you'll see at the end, because
of the whole "Module vs Static Class" scope thing, we can still call the ExtensionMethodString
directly but we have to pass in a string for the first parameter, which is supposed
to be the parameter that tells the compiler what type of class to extend.
</p>
        <p>
So the rule here is, if you have a Class Name (or really anything) and Extension Method
Name that have the same name and are in the same namespace, you can run into this
problem in VB.Net, and those problems get even worse if you are extending a generic
class.
</p>
        <p>
As I mentioned, you can get around this by fully qualifying your calls to Expect.Call,
or you could change the way you do your expectations,  but if you are writing
out these types of tests and don't want to have to fully qualify everything, then
you can use an import alias like this:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">Imports</span> DoExpect <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span> Rhino.Mocks.Expect</span>
        </pre>
        <p>
Then you just change your "Expect.Call" to "DoExpect.Call" and all should work!
</p>
        <p>
I think this could be fixed in Rhino Mocks quite simply.  I believe all that
would need to happen is that RhinoMocksExtensions would just need to move to
a different namespace, like Rhino.Mocks.Extensions.  I don't think this change
would even require additional changes to the Rhino Mocks codebase, but I'm not 100%
sure on that.
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=09c435a9-897a-4800-a6cf-ad0e2cd2467c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SQL Server Unique Constraint</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/04/SQL+Server+Unique+Constraint.aspx" />
    <id>http://chrismay.org/PermaLink,guid,3e0d3a57-b12b-41b4-be78-b2463467a6b5.aspx</id>
    <published>2010-07-04T18:12:07.453125-05:00</published>
    <updated>2010-07-04T18:21:39.890625-05:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/Database" label="Programming/Database" scheme="http://chrismay.org/CategoryView,category,ProgrammingDatabase.aspx" />
    <category term="Programming/Database/SQL Server" label="Programming/Database/SQL Server" scheme="http://chrismay.org/CategoryView,category,ProgrammingDatabaseSQLServer.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
In SQL Server you can create a UNIQUE constraint on a field that is not the primary
key.  The "CLUSTERED" keyword must be removed if you already have a clustered
index on the table.  Here are some examples of a 1 column and 2 column unique
constraint:
</p>
        <p style="MARGIN: 0in 0in 0pt" class="MsoNormal">
          <span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
            <font color="#000000">
            </font>
          </span>
        </p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ALTER</span>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">TABLE</span> [dbo].[item_orders2] <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ADD</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">CONSTRAINT</span> UNIQUE_Table2 <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">UNIQUE</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">CLUSTERED</span> (
order_id ) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ON</span> [<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">PRIMARY</span>] <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ALTER</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">TABLE</span> [dbo].[item_orders3] <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ADD</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">CONSTRAINT</span> UNIQUE_Table3 <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">UNIQUE</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">CLUSTERED</span> (
order_id, item_id ) <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">ON</span> [<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">PRIMARY</span>] </span>
        </pre>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=3e0d3a57-b12b-41b4-be78-b2463467a6b5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>TF26177: The field System.RelatedLinkCount cannot be renamed</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/07/04/TF26177+The+Field+SystemRelatedLinkCount+Cannot+Be+Renamed.aspx" />
    <id>http://chrismay.org/PermaLink,guid,8e47d6f4-f2a9-44d4-a106-0904e7e6da85.aspx</id>
    <published>2010-07-04T17:51:21.312-05:00</published>
    <updated>2010-07-14T09:20:34.39175-05:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/TFS" label="Programming/TFS" scheme="http://chrismay.org/CategoryView,category,ProgrammingTFS.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have been trying to work with the <a href="http://teamreview.codeplex.com/">TeamReview</a> tool
for code reviews.
</p>
        <p>
Problem was, when I tried to install the Work Item templates associated with the code
review items, I would get the error:
</p>
        <pre>
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <font color="#003300" size="2" face="Verdana">TF212018:
Work item tracking schema validation error: TF26177: The field System.RelatedLinkCount
cannot be renamed from 'RelatedLinkCount' to 'Related Link Count'.</font>
          </span>
        </pre>
        <p>
So what's a guy to do?  Turn to google of course.
</p>
        <p>
After some research it becomes clear that between TFS 2008 and 2010 RelatedLinkCount
was renamed "Related Link Count" and this was causing the problems.  It's likely
a result of having upgraded our TFS installation from 08 to 2010 instead of doing
a fresh install.
</p>
        <p>
After some work I found that I could resolve the problem by renaming the offending
bit of XML in the file I was trying to import.  After changing Related Link Count
to RelatedLinkCount and running the import again it gave me a few other items (1 after
another) that I needed to correct:
</p>
        <p>
IterationId
</p>
        <p>
ExternalLinkCount
</p>
        <p>
HyperLinkCount
</p>
        <p>
AttachedFileCount
</p>
        <p>
AreaId
</p>
        <p>
After fixing all of these the import was successful and everything seems to be working
fine.
</p>
        <p>
Here is the XML file with my changes that successfully imported:
</p>
        <p>
          <strike>UPDATE: I somehow had uploaded the wrong file.  I believe this is actually
the one I used successfully: </strike>
          <a href="http://chrismay.org/content/binary/CodeItemenCDMFixed.xml">
            <strike>CodeItemenCDMFixed.xml
(19.02 KB)</strike>
          </a>
        </p>
        <p>
UPDATE 2: Ok I'm stupid.  The confusion worked like this: I downloaded the 2010
version and tried to install on a 2010 server that had been upgraded from 2008. 
Had problems.  Made a file to fix it.  Then later tried to install a fresh
download from codeplex to a new TFS server, ran into similar problems, but really
they were the reverse of what I experienced before (needed remove spaces from words
vs needing to add spaces).  Turns out I had downloaded the 2008 version that
time.  Totally stupid.
</p>
        <p>
So, if you are trying to install to 2010 and you are getting problems like above,
I think using this file will fix your issues:
</p>
        <p>
          <a href="http://chrismay.org/content/binary/Code%20Item%20en%20CDM.xml">http://chrismay.org/content/binary/Code%20Item%20en%20CDM.xml</a>
        </p>
        <p>
if not, maybe try this one:
</p>
        <a href="http://chrismay.org/content/binary/CodeItemenCDMFixed.xml">CodeItemenCDMFixed.xml
(19.02 KB)</a>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=8e47d6f4-f2a9-44d4-a106-0904e7e6da85" />
      </div>
    </content>
  </entry>
  <entry>
    <title>NDepend Resources</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/06/21/NDepend+Resources.aspx" />
    <id>http://chrismay.org/PermaLink,guid,bc9d599a-f234-481c-9ac4-953fdf4fcf66.aspx</id>
    <published>2010-06-21T10:12:37.275125-05:00</published>
    <updated>2010-06-21T10:15:47.087625-05:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <category term="Programming/.Net/.Net Framework" label="Programming/.Net/.Net Framework" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetNetFramework.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I'm in the process of working with <a href="http://ndepend.com">NDepend</a> for the
purpose of evaluating it when it comes to code metrics and helping with visualizing
dependencies to help find areas where we could be combining assemblies into a single
assembly.
</p>
        <p>
To better understand the metrics I found these 3 resources on the NDepend website
quite helpful:
</p>
        <p>
          <a href="http://ndepend.com/Res/NDepend_EN_Public.ppt" target="_blank">A set of <b>Power
Point Slides in English</b> freely re-usable for any NDepend presentation</a>
        </p>
        <p>
          <a href="http://www.hanselman.com/blog/content/binary/NDepend%20metrics%20placemats%201.1.pdf" target="_blank">A
poster representative of NDepend Code Metrics made by Scott Hanselman, Patrick Cauldwell
and Stuart Cellarier </a>
        </p>
        <p>
          <a href="http://realfiction.net/files/NDependMetricsCheatSheet.pdf" target="_blank">Metrics
Cheat Sheet byFrank-Leonardo Quednau </a>
        </p>
        <p>
 
</p>
        <img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=bc9d599a-f234-481c-9ac4-953fdf4fcf66" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Visual Studio 2010 Not Copying DLL References</title>
    <link rel="alternate" type="text/html" href="http://chrismay.org/2010/06/21/Visual+Studio+2010+Not+Copying+DLL+References.aspx" />
    <id>http://chrismay.org/PermaLink,guid,23131a36-fb5b-4765-b7eb-2fddbe78f707.aspx</id>
    <published>2010-06-20T23:04:13.947-05:00</published>
    <updated>2010-06-20T23:11:39.837625-05:00</updated>
    <category term="Programming" label="Programming" scheme="http://chrismay.org/CategoryView,category,Programming.aspx" />
    <category term="Programming/.Net" label="Programming/.Net" scheme="http://chrismay.org/CategoryView,category,ProgrammingNet.aspx" />
    <category term="Programming/.Net/.Net Framework" label="Programming/.Net/.Net Framework" scheme="http://chrismay.org/CategoryView,category,ProgrammingNetNetFramework.aspx" />
    <author>
      <name>Chris May</name>
    </author>
    <content type="html">&lt;p&gt;
I had this issue recently when looking at someone elses solution.
&lt;/p&gt;
&lt;p&gt;
Project A had a reference to project B, but when you tried to compile it would fail
on Project A (because it couldn't find any of the classes in project B) and the assembly
for project B would not be copied to the BIN of Project A!
&lt;/p&gt;
&lt;p&gt;
The errors looked like this:
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;
&lt;span style="FONT-FAMILY: Consolas; FONT-SIZE: 9pt"&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9):
warning MSB3253: The referenced assembly "MyAssemblyName" could not be resolved because
it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".
Please remove references to assemblies not in the targeted framework or consider retargeting
your project.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
After a lot of messing around it turned out that the "Target Framework" for Project
A had been changed to ".NET 4.0 Client Profile" instead of just plain old ".NET 4.0".
&lt;/p&gt;
&lt;p&gt;
Change it back and rebuild: it's that simple.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://chrismay.org/aggbug.ashx?id=23131a36-fb5b-4765-b7eb-2fddbe78f707" /&gt;</content>
  </entry>
</feed>