<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Go Figure (by Keith Nicholson) : FAQ</title><link>http://msmvps.com/blogs/keith/archive/tags/FAQ/default.aspx</link><description>Tags: FAQ</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Is the SqlDependency Attribute in OutputCache Directives Required Like VaryByParam Attribute?</title><link>http://msmvps.com/blogs/keith/archive/2005/04/14/42040.aspx</link><pubDate>Thu, 14 Apr 2005 08:19:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:42040</guid><dc:creator>Keith Nicholson</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/keith/rsscomments.aspx?PostID=42040</wfw:commentRss><comments>http://msmvps.com/blogs/keith/archive/2005/04/14/42040.aspx#comments</comments><description>&lt;P&gt;This question came up during a presentation on ASP.NET v2.0, &amp;#8220;Is the SqlDependency Attribute in OutputCache Directives Required Like VaryByParam Attribute?&amp;#8220;&lt;/P&gt;
&lt;P&gt;After doing some searching through the MSDN Library for Visual Studio 2005 (Beta 1), I discovered very little documentation about using the OutputCache directive.&amp;nbsp; So, what is a boy to do?&amp;nbsp; Go to code!&lt;/P&gt;
&lt;P&gt;I added the &lt;FONT color=#006400&gt;&amp;lt;% OutputCache %&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;to a page and watched what happened when I tried to preview it in a browser.&amp;nbsp; As expected, the parser stated that I had to have the Duration attribute.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;So I then tried &lt;FONT color=#006400&gt;&amp;lt;% OutputCache Duration=&amp;#8221;1&amp;#8221; %&amp;gt;.&lt;/FONT&gt;&amp;nbsp;Of course the parser had trouble with this as well--&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;Parser Error Message: The directive is missing a 'VaryByParam' attribute.&lt;/FONT&gt;&lt;FONT color=#000000&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;As we walk down the path &lt;FONT color=#006400&gt;&amp;lt;% OutputCache Duration=&amp;#8221;1&amp;#8221; VaryByParam=&amp;#8220;None&amp;#8220; %&amp;gt;.&lt;/FONT&gt;&amp;nbsp;The page made it pass the Parser and rendered.&lt;/P&gt;
&lt;P&gt;Conclusion---SqlDependency is not a required attribute.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=42040" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/keith/archive/tags/FAQ/default.aspx">FAQ</category></item><item><title>Does the Stereotype have to be a 'T'?</title><link>http://msmvps.com/blogs/keith/archive/2005/04/12/41786.aspx</link><pubDate>Wed, 13 Apr 2005 04:13:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:41786</guid><dc:creator>Keith Nicholson</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/keith/rsscomments.aspx?PostID=41786</wfw:commentRss><comments>http://msmvps.com/blogs/keith/archive/2005/04/12/41786.aspx#comments</comments><description>&lt;P&gt;Now that .NET developers have access to Generics in both VB.NET and C#, questions are being asked about an approach often used by C++ developers called Templates.&amp;nbsp; When we define a Generic class we must follow the class definition with a Stereotype (also referred to as a Parameter Type).&lt;/P&gt;
&lt;P&gt;Such as (VB.NET):&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Public&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Class&lt;/FONT&gt; MyStackTvb(&lt;FONT color=#0000ff&gt;Of&lt;/FONT&gt; T)&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Private&lt;/FONT&gt; frames &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; T()&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Private&lt;/FONT&gt; pointer &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Integer&lt;/FONT&gt; = 0&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Public&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Sub&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;New&lt;/FONT&gt;(&lt;FONT color=#0000ff&gt;ByVal&lt;/FONT&gt; size &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Integer&lt;/FONT&gt;)&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;frames = &lt;FONT color=#0000ff&gt;New&lt;/FONT&gt; T(size) {}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;End&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Sub&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Public&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Sub&lt;/FONT&gt; Push( &lt;FONT color=#0000ff&gt;ByVal&lt;/FONT&gt; frame &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; T)&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;frames(pointer) = frame&lt;/P&gt;
&lt;P&gt;pointer += 1&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;End&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Sub&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Public&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Function&lt;/FONT&gt; Pop() &lt;FONT color=#0000ff&gt;As&lt;/FONT&gt; T&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;pointer -= 1&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Return&lt;/FONT&gt; frames(pointer)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;End&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;Function&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;End&lt;/FONT&gt; &lt;FONT color=#0000ff size=5&gt;&lt;FONT size=3&gt;Class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=5&gt;&lt;FONT color=#000000 size=3&gt;or in C#:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=5&gt;&lt;FONT size=3&gt;&lt;FONT color=#0000ff size=5&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT size=3&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff&gt;class&lt;/FONT&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;B&gt;&lt;FONT color=#000080&gt;MyStackTcs&lt;/B&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&amp;lt; T &amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;private&lt;/FONT&gt; T[] frames;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;private&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;int&lt;/FONT&gt; pointer = 0;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt; &lt;B&gt;&lt;FONT color=#000080&gt;MyStackTcs&lt;/B&gt;&lt;/FONT&gt;( &lt;FONT color=#0000ff&gt;int&lt;/FONT&gt; size )&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr&gt;{frames = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; T[ size ];}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;void&lt;/FONT&gt; Push( T frame )&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;{frames[ pointer++ ] = frame;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt; T Pop()&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;{&lt;FONT color=#0000ff&gt;return &lt;/FONT&gt;&lt;FONT size=5&gt;&lt;FONT size=3&gt;frames[--pointer];&lt;/FONT&gt;&lt;FONT size=3&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=3&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P dir=ltr&gt;We are not required to use the name 'T' for the template parameter.&amp;nbsp; You could use 'Z' for all anyone might care.&amp;nbsp; But trust me, programmers will care to follow a standard that has been in use for over a decade.&amp;nbsp; Think of 'T' as 'Type' if this helps.&lt;/P&gt;
&lt;P dir=ltr&gt;Until next time........&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=41786" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/keith/archive/tags/FAQ/default.aspx">FAQ</category></item><item><title>No More Old Icons</title><link>http://msmvps.com/blogs/keith/archive/2005/04/11/41685.aspx</link><pubDate>Mon, 11 Apr 2005 23:06:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:41685</guid><dc:creator>Keith Nicholson</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/keith/rsscomments.aspx?PostID=41685</wfw:commentRss><comments>http://msmvps.com/blogs/keith/archive/2005/04/11/41685.aspx#comments</comments><description>&lt;P&gt;Back on March 11, 2005, I was asked at a session on Visual Studio 2005 overview whether we might finally get some new icons (tired of the old Office 95 icons?).&lt;/P&gt;
&lt;P&gt;Well last week, MSDN provided the answer.&amp;nbsp; Go to&amp;nbsp;&lt;A href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20050331VSTUDIOAB/manifest.xml"&gt;MSDN TV&lt;/A&gt;&amp;nbsp;for more info.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=41685" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/keith/archive/tags/FAQ/default.aspx">FAQ</category></item><item><title>What code works best for the Stack Overrun Demo?</title><link>http://msmvps.com/blogs/keith/archive/2005/03/01/37360.aspx</link><pubDate>Wed, 02 Mar 2005 02:09:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:37360</guid><dc:creator>Keith Nicholson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/keith/rsscomments.aspx?PostID=37360</wfw:commentRss><comments>http://msmvps.com/blogs/keith/archive/2005/03/01/37360.aspx#comments</comments><description>&lt;P&gt;In some recent classes for security from Microsoft's 2805 and 2806 courses, I demonstrated the ability to make a buffer overrun hack.&amp;nbsp; The information on page 11 of the 2805 courseware does not show the appropriate text to really demonstrate the power of the hack.&lt;/P&gt;
&lt;P&gt;The demonstration itself originates in Michael Howard's&amp;nbsp; and David LeBlanc's must read book, Writing Secure Code.&amp;nbsp; In their second edition they begin a wonderful example on page 129 of a stack overrun.&amp;nbsp; On page 135, in order to throw the the program flow into the bar function, they use a Perl script named HackOverrun.pl to exploit the issue.&lt;/P&gt;
&lt;P&gt;Not being a Perl scripter, I was curious how to make it work in a straight command window environment as originally demonstrated up till this page.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It occurred to me after seeing a friend type their password in with special Unicode characters how to make this work.&amp;nbsp; The secret to strong password security is to take advantage of the extreme number of characters available.&amp;nbsp; Try this at home!&amp;nbsp; Change your password to something like BobIsReallyCool, but before pressing 'Enter' or 'Tab', hold your 'Alt' key down and type on your number keypad 0064 then release your 'Alt' key.&amp;nbsp; You will see the following string, &lt;A href="mailto:'BobIsReallyCool@'"&gt;'BobIsReallyCool@'&lt;/A&gt;.&amp;nbsp; By typing in 0064 you referenced the Unicode character &lt;A href="mailto:'@'"&gt;'@'&lt;/A&gt;.&amp;nbsp; Now try the same password with a&amp;nbsp;2251 at the end.&amp;nbsp; This time you get 'BobIsReallyCool-'.&amp;nbsp; Of course you have '*' or bullets covering all of the characters, but you get the idea.&lt;/P&gt;
&lt;P&gt;So what do we type in to make the StackOverrun demo sound like Charlie Brown?&amp;nbsp; Type the following at the command prompt after the executable file:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;ABCDEFGHIJKLMNOPE(Alt+0016)(Alt+0064)&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;&lt;FONT color=#000000&gt;I actually find it rather humorus that the final four letters, before the 'Alt' characters spells 'NOPE'.&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;If you have not picked up the book that Bill Gates referres to as &amp;#8220;Required reading at Microsoft&amp;#8221;, the get out to your favorite book seller and pick up &amp;#8220;Writing Secure Code.&amp;#8221;&amp;nbsp; It's ISBN is 07-7356-1722-8.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=37360" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/keith/archive/tags/FAQ/default.aspx">FAQ</category></item></channel></rss>