<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Anthony Trudeau</title>
        <link>http://geekswithblogs.net/tonyt/Default.aspx</link>
        <description />
        <language>en-US</language>
        <copyright>Anthony Trudeau</copyright>
        <managingEditor>agrt.home@hotmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Anthony Trudeau</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/tonyt/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Memory Access Patterns are Important</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/10/16/125891.aspx</link>
            <description>&lt;p&gt;The latest MSDN magazine has an article by Stephen Toub, Igor Ostrovsky, and Huseyin Yildiz called "False Sharing" (&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc872851.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc872851.aspx&lt;/a&gt;).  Early in the article the author puts out the argument that memory access patterns are important.  And he provides an example.&lt;/p&gt;
&lt;p&gt;The example (listed below) is a simple program that creates a multi-dimensional array, iterates through it, and displays the time it took.  The program first goes through each row and each column of each row for the first test and then through each column and each row of the column for the second test.  The results are eye opening.  The latter test runs over 2x slower on my computer (your results may vary).  Specifically, the first test runs in just less than a second whereas the second test runs consistently over 2.5 seconds.&lt;/p&gt;
&lt;p&gt;The reason the second test is slower is that the memory in the array is laid out continguously.  When you access the array the value as well as values around it will be loaded into the cache line.  The more often you navigate to different rows the more penalty you incur in memory access.&lt;/p&gt;
&lt;p&gt;I know I'm guilty of focusing on other issues besides memory access.  I think we get lulled into the believe that we're not dealing with C++ so we don't have to consider memory in the same ways.  This example proves otherwise.&lt;/p&gt;
&lt;div style="FONT-SIZE: 11pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;using&lt;/span&gt; System;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;using&lt;/span&gt; System.Diagnostics;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;&lt;span style="COLOR: blue"&gt;namespace&lt;/span&gt; MemoryAccessTest&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;{&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Program&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Main(&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;const&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; size = 10000;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;[,] matrix = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: blue"&gt;int&lt;/span&gt;[size, size];&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: #2b91af"&gt;Stopwatch&lt;/span&gt; sw;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;while&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;true&lt;/span&gt;)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;// faster loop&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                sw = &lt;span style="COLOR: #2b91af"&gt;Stopwatch&lt;/span&gt;.StartNew();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: blue"&gt;for&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; row = 0; row &amp;lt; size; row++)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    &lt;span style="COLOR: blue"&gt;for&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; column = 0; column &amp;lt; size; column++)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                        matrix[row, column] = (row * size) + column;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="COLOR: #a31515"&gt;"elapsed: {0}"&lt;/span&gt;, sw.Elapsed.ToString());&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                sw.Reset();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: green"&gt;// slower loop&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                sw.Start();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: blue"&gt;for&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; column = 0; column &amp;lt; size; column++)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                    &lt;span style="COLOR: blue"&gt;for&lt;/span&gt; (&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; row = 0; row &amp;lt; size; row++)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                        matrix[row, column] = (row * size) + column;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="COLOR: #a31515"&gt;"elapsed: {0}"&lt;/span&gt;, sw.Elapsed.ToString());&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                sw.Stop();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;'='&lt;/span&gt;, 20));&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                &lt;span style="COLOR: #2b91af"&gt;Console&lt;/span&gt;.ReadLine();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;    }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;}&lt;!--EndFragment--&gt;&lt;/p&gt;
&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125891"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125891" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/125891.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/10/16/125891.aspx</guid>
            <pubDate>Thu, 16 Oct 2008 21:28:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/125891.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/10/16/125891.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/125891.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/125891.aspx</trackback:ping>
        </item>
        <item>
            <title>Cannot start with 'Log'</title>
            <category>SQL Server</category>
            <category>bugs</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/09/24/125431.aspx</link>
            <description>&lt;p&gt;I found another oddity that seems to be undocumented today.  This one in SQL Server 2005.  Apparently, you cannot start objects (at least stored procedures) with the word "Log".&lt;/p&gt;
&lt;p&gt;I have a table called ShipNoticeLog and a stored procedure called LogShipNotice.  The table is the noun and the stored procedure is the action -- this is how I prefer to do the naming.  My code quickly failed with the message, "Invalid object name 'LogShipNotice'..."  I ended up solving my issue by renaming the stored procedure as AddShipNoticeLogEntry.  A little more verbose, but it'll suffice.&lt;/p&gt;
&lt;p&gt;By the way, I classify this as a bug not because there's anything wrong with the restriction, but the fact that it isn't documented or at the least clearly documented.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125431"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125431" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/125431.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/09/24/125431.aspx</guid>
            <pubDate>Wed, 24 Sep 2008 18:21:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/125431.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/09/24/125431.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/125431.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/125431.aspx</trackback:ping>
        </item>
        <item>
            <title>EDI Update</title>
            <category>.NET</category>
            <category>EDI</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/09/20/125332.aspx</link>
            <description>&lt;p&gt;My EDI project is plodding along as planned.  We flirted with the possibility of having our VAN do the translation after a couple of issues came up:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Customer provided a shorter than expected deadline &lt;/li&gt;
    &lt;li&gt;Customer increased the number of forms required &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;However, at the end of the day the VAN didn't look like they could deliver the forms in the alloted time and the customer  decided they weren't ready for the deadline -- they're phasing their vendors in different waves.  Based on all of these criteria I am approaching this from a quick and dirty standpoint using an EAI tool that uses VBA-compatible scripting.  I know this approach is dangerous, because I could get pulled away later from finishing it the right way.&lt;/p&gt;
&lt;p&gt;One thing I've found is that the information out there for EDI is highly fragmented.  Occasionally I have difficulty finding the information I need.  The ANSI ASC X12 standards document is out there, but costs several hundred dollars.  What a scam.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125332"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125332" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/125332.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/09/20/125332.aspx</guid>
            <pubDate>Sun, 21 Sep 2008 00:21:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/125332.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/09/20/125332.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/125332.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/125332.aspx</trackback:ping>
        </item>
        <item>
            <title>EDI here I come</title>
            <category>EDI</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/09/05/124975.aspx</link>
            <description>&lt;p&gt;I got an interesting project today.  Not only does it look to be pretty fun, but it should be a challenge and give me a chance to learn something new and add another thing to my resume.  The project is the implementation of a solution to pass off EDI documents through a VAN to one of our customers -- of course more customers will follow.&lt;/p&gt;
&lt;p&gt;The customer is only dictating three forms 830, 856, and 862 which are material releases, advanced shipping notices, and shipping schedules respectively.  My solution will involve not only the processing of the business system data, but also the translation of the data into the specific EDI forms.  I presented a benefits analysis between doing the translation or outsourcing the translation to our VAN, but our President decided that we would do it all to save the money.  (I was a good little developer and explained that although it would be more fun to do it in-house the benefits of outsourcing overruled that.)  Doing it ourself will save us the additional bandwidth fees as well as the $1500 development fee for each map.&lt;/p&gt;
&lt;p&gt;I think I'll use this as an opportunity to post a little more consistently to the blog.  I don't know if the information will be terribly useful to anyone that is versed in EDI -- I am not; however, it does have the possibility of being entertaining.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124975"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124975" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/124975.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/09/05/124975.aspx</guid>
            <pubDate>Fri, 05 Sep 2008 23:57:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/124975.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/09/05/124975.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/124975.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/124975.aspx</trackback:ping>
        </item>
        <item>
            <title>Expression Web: Not Enough Disk Space</title>
            <category>bugs</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/07/28/124071.aspx</link>
            <description>&lt;p&gt;Whenever I run into a weird bug or workaround I like to do a short post about it.  Doing so helps the community and it is also self-serving in case I run into it a year or so later after I've long forgot about it.  Today is one of those times.&lt;/p&gt;
&lt;p&gt;My latest disk batch came for my MSDN subscription and I decided to upgrade Expression Blend and Web to version 2.  Granted I haven't really used these tools too much, but I plan on doing so in the future.  The installation of Blend went without a hitch, but Web failed indicating that I was out of disk space.  I have about 40 GB free so I know that's not the issue.&lt;/p&gt;
&lt;p&gt;A quick Web search on &lt;a href="http://search.live.com"&gt;http://search.live.com&lt;/a&gt; (I don't like Google) led me to a forum post somewhere that explained that the problem seemed to be with Office.  I wasn't going to go through that today, so I decided that perhaps it was something &lt;em&gt;about&lt;/em&gt; the Office installation.  The only thing that stood out to me was an add-in for saving to a PDF document.  (My company is in love with the PDF format for same reason.)&lt;/p&gt;
&lt;p&gt;Removing that would be easy enough, so I uninstalled it and tried the Expression Web installation again.  Sure enough the installation completed without a problem.  I then reinstalled the save to PDF add-in for Office and I was on my way again.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124071"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124071" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/124071.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/07/28/124071.aspx</guid>
            <pubDate>Mon, 28 Jul 2008 09:40:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/124071.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/07/28/124071.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/124071.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/124071.aspx</trackback:ping>
        </item>
        <item>
            <title>Why I hate Microsoft Access...</title>
            <category>bugs</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/07/15/123804.aspx</link>
            <description>&lt;p&gt;Today has been one of those days to hate Microsoft Access.  My company has dozens of Microsoft Access applications in the enterprise that do everything under the sun.  Eventually those will be replaced by me, but in the meantime I have to deal with them.  Today was one of those days.  In fact today I had two circumstances to reinforce those feelings.&lt;/p&gt;
&lt;p&gt;The first came when I had to correct an ordering of results on a form that wasn't matching a report.  The report was deemed correct, so I needed to view the design of its query to see how it was different.  Immediately, I'm greeted by the warning that the designer cannot represent the join.  (Not unexpected since the query is complex.)  I click okay, get the information I want, close the query, fix the form ordering, and go on my merry way.  That is until the email later.&lt;/p&gt;
&lt;p&gt;The email with the attached report showing 18 pages for what should be two was the problem.  What happened?  Microsoft Access decided to fix the problem of its own volition.  And not only that.  Microsoft Access decided to save the query definition without a peep, prompt, or otherwise.  And to make things worse, it did the same thing when I imported the query from a shadow copy and every other method I could think of.  Eventually I had to manually change it.  (I promptly made a backup that I can plop in place if needed; hopefully, Microsoft Access didn't silently fix my backup.)&lt;/p&gt;
&lt;p&gt;The second was in relation to an Access project that is being put in place as I push the current data from Microsoft Access into Microsoft SQL Server.  One of the constructs is a report with a simple subreport.  The subreport represents a one-to-many relationship with a simple list of items corresponding to the main report.  This shoud have been easy.  My queries were tested in Management Studio and they run individually in the reports.  However, when the subreport was added to the main report and run I got the error "Syntax error or access denied".  Thanks for the information Microsoft.  Obviously, the problem is in the subreport, because the main report shows.&lt;/p&gt;
&lt;p&gt;Well, I start simplifying the reports and eventually get down to one with no joins in each.  I still got the error.  The problem?  The SQL statement on my subreport is terminated with a semi-colon (by ANSI standards interestingly).  I guess that's a syntax error, but in of itself it's not -- just when combined with another SQL statement through the main report.&lt;/p&gt;
&lt;p&gt;So at the end of the day, Microsoft decided to change and save a query I didn't change myself, and inconsistently decided not to change the SQL statement that it could have easily changed on the subreport.  My choice is for it not to change anything without me explicitly telling it, but if anything I would like some consistency.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123804"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123804" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/123804.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/07/15/123804.aspx</guid>
            <pubDate>Tue, 15 Jul 2008 11:56:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/123804.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/07/15/123804.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/123804.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/123804.aspx</trackback:ping>
        </item>
        <item>
            <title>Unit testing on events</title>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/06/26/123403.aspx</link>
            <description>&lt;p&gt;Here's a little method I came up with recently to test the execution of events.  You may not ever need to test to see that an event fires, because you have some other state that you can check.  However, that is not always the case.  Here is how I approached it using the unit testing provided with the developer's team editon of Visual Studio.&lt;/p&gt;
&lt;p&gt;The first thing I did was add a wait handle object inside the definition of my unit test class.  Specifically, I chose a ManualResetEvent for the most control, but other types of wait handles may work fine.&lt;/p&gt;
&lt;div style="FONT-SIZE: 11pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ManualResetEvent&lt;/span&gt; _waitHandle;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The next step was to add code for the class initialize and cleanup methods.  I need to create my wait handle and after I finish running my tests I want to make sure that I release any resources tied-up by the wait handle.  Additionally, after a test is run I want to make sure that the wait handle is in an unsignalled state.  Therefore, I need to provide a test cleanup method.&lt;/p&gt;
&lt;div style="FONT-SIZE: 11pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: green"&gt;//Use ClassInitialize to run code before running the first test&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        [&lt;span style="COLOR: #2b91af"&gt;ClassInitialize&lt;/span&gt;()]&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; MyClassInitialize(&lt;span style="COLOR: #2b91af"&gt;TestContext&lt;/span&gt; testContext)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            _waitHandle = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;ManualResetEvent&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;false&lt;/span&gt;);&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: green"&gt;//Use ClassCleanup to run code after all tests in a class have run&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        [&lt;span style="COLOR: #2b91af"&gt;ClassCleanup&lt;/span&gt;()]&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;static&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; MyClassCleanup()&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (_waitHandle != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;                _waitHandle.Close();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: green"&gt;//Use TestCleanup to run code after each test has run&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        [&lt;span style="COLOR: #2b91af"&gt;TestCleanup&lt;/span&gt;()]&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; MyTestCleanup()&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            _waitHandle.Reset();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;That's pretty much it except for the logic in the code itself.  In that code, you create your event handler, run the action that will trigger the event, and then wait for the ManualResetEvent to be signalled.  It is advisable to provide an arbitrary yet realistic value for a timeout so that your test doesn't run forever if the event isn't fired.&lt;/p&gt;
&lt;div style="FONT-SIZE: 11pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Consolas"&gt;
&lt;p style="MARGIN: 0px"&gt;        [&lt;span style="COLOR: #2b91af"&gt;TestMethod&lt;/span&gt;()]&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; EventExecutedTest()&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: #2b91af"&gt;MyObject &lt;/span&gt;target = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;MyObject&lt;/span&gt;();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;           &lt;span style="COLOR: green"&gt;// TODO: add additional declarations as needed for test&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            target.EventExecuted += (sender, e) =&amp;gt; _waitHandle.Set();&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;           &lt;span style="COLOR: green"&gt;// TODO: perform actions that need to trigger the event&lt;/span&gt;&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: blue"&gt;bool&lt;/span&gt; result = _waitHandle.WaitOne(3000, &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;);&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;            &lt;span style="COLOR: #2b91af"&gt;Assert&lt;/span&gt;.IsTrue(result);                                  &lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; As you can see there's not too much to it.  This is a simple mechanism to unit tests events when it makes sense.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123403"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123403" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/123403.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/06/26/123403.aspx</guid>
            <pubDate>Thu, 26 Jun 2008 12:52:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/123403.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/06/26/123403.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/123403.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/123403.aspx</trackback:ping>
        </item>
        <item>
            <title>Infragistics support with SCSF -- April 2008</title>
            <category>Infragistics</category>
            <category>.NET</category>
            <link>http://geekswithblogs.net/tonyt/archive/2008/05/23/122345.aspx</link>
            <description>&lt;p&gt;I just recently installed the new version of the Smart Client Software Factory (SCSF) and wanted to utilize the Composite UI Application Block (CAB) support within my Infragistics components with it within Visual Studio 2008.  Luckily, the process is easy and these steps are all you have to do:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Open Visual Studio 2008 &lt;/li&gt;
    &lt;li&gt;Open the Infragistics.CompositeUI.WinForms solution and allow the conversion &lt;/li&gt;
    &lt;li&gt;Add references to the following Microsoft libraries from the SCSF installation:
    &lt;ul&gt;
        &lt;li&gt;Microsoft.Practices.CompositeUI.dll &lt;/li&gt;
        &lt;li&gt;Microsoft.Practices.CompositeUI.Winforms.dll &lt;/li&gt;
        &lt;li&gt;Microsoft.Practices.ObjectBuilder.dll &lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;Specify a key file for signing in the project settings if desired &lt;/li&gt;
    &lt;li&gt;Build the solution &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The Infragistics composite UI solution is located in the C:\Documents and Settings\All Users\Shared Documents\&lt;font face="Arial"&gt;Infragistics\NetAdvantage for .NET 2008 Vol. 1 CLR 2.0\&lt;font face="Arial"&gt;CAB Extensibility Kit folder (folder may vary based on the version of the Infragistics controls).  You must have at least 2008 Vol 1. controls.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122345"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122345" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/tonyt/aggbug/122345.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Anthony Trudeau</dc:creator>
            <guid>http://geekswithblogs.net/tonyt/archive/2008/05/23/122345.aspx</guid>
            <pubDate>Fri, 23 May 2008 08:03:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/tonyt/comments/122345.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/tonyt/archive/2008/05/23/122345.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/tonyt/comments/commentRss/122345.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/tonyt/services/trackbacks/122345.aspx</trackback:ping>
        </item>
    </channel>
</rss>