<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://codebetter.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>Grant Killian's Blog</title><link>http://codebetter.com/blogs/grant.killian/default.aspx</link><description>No, this has nothing to do with beer -- but maybe it should?</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Following Up on Brendan's Crystal Post</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/05/05/62816.aspx</link><pubDate>Thu, 05 May 2005 08:26:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:62816</guid><dc:creator>grant.killian</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=62816</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/05/05/62816.aspx#comments</comments><description>&lt;P&gt;&lt;a href="http://codebetter.com/blogs/brendan.tompkins/archive/2005/05/05/62812.aspx"&gt;Brendan has an interesting post about Crystal "from an insiders perspective."&amp;nbsp;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Crystal Reports is reporting software that's marketed well to business decision-makers;&amp;nbsp;Crystal is a&amp;nbsp;household name when it comes to reports!&amp;nbsp; Most developers, however,&amp;nbsp;work to avoid Crystal Reports like the plague.&amp;nbsp; Crystal is marketed well to people who write the checks, but not to people who write and implement the reports.&amp;nbsp; I think a "perception of value" scenario is sometimes at work, too, where something that costs a lot &lt;STRONG&gt;must &lt;/STRONG&gt;be very valuable -- therefore expensive Crystal Reports &lt;STRONG&gt;must&lt;/STRONG&gt; be a great reporting tool.&amp;nbsp; Following that logic: if we charged people a membership fee to read the blogs on CodeBetter.com they'd percieve the content to be more valuable and worthwhile.&lt;/P&gt;
&lt;P&gt;&lt;a href="http://codebetter.com/blogs/brendan.tompkins/archive/2005/05/05/62812.aspx"&gt;Brendan's post &lt;/A&gt;has another little kernel of wisdom in there . . . the guru points out that Crystal wants to stay ahead of Cognos.&amp;nbsp;&amp;nbsp;If that's the gauge Crystal uses, developers don't do handstands over working with Cognos either.&amp;nbsp; If it's between Cognos and Crystal, I'll gladly take Excel and custom charts any day!&lt;/P&gt;
&lt;P&gt;Which&amp;nbsp;brings me to Reporting Services from Microsoft and what a welcome addition it is to the enterprise reporting landscape.&amp;nbsp; Is it perfect?&amp;nbsp; No.&amp;nbsp; Is it better than the alternatives?&amp;nbsp; Seems to be -- although I'm no Reporting Services guru.&amp;nbsp; They work fine on my machine, though, which is more than I can say for my frustrations with Crystal!&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=62816" width="1" height="1"&gt;</description></item><item><title>Option Strict On Salvation</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/04/28/62602.aspx</link><pubDate>Thu, 28 Apr 2005 09:54:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:62602</guid><dc:creator>grant.killian</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=62602</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/04/28/62602.aspx#comments</comments><description>&lt;P&gt;Yeah, I should have put this in&amp;nbsp;my earlier post but I didn't have time.&amp;nbsp; Maybe I'm crazy, but the whole &lt;a href="http://www.codebetter.com/blogs/grant.killian/archive/2005/04/25/62442.aspx"&gt;Option Strict stuff with the TimeTracker starter kit&lt;/A&gt; is something I lose sleep over.&amp;nbsp; The solution is easy: just add a few ToString() and DateTime.Parse() functions&amp;nbsp;where necessary . . . and then you have the whole ubiquitous IIF() function to wrestle with.&amp;nbsp;&amp;nbsp; There's dozens of calls to the Option-Strict-On-hating Visual Basic IIF() function scattered all through the starter kit so &lt;STRONG&gt;fight&lt;/STRONG&gt; that initial urge to do a search and replace approach.&amp;nbsp;&amp;nbsp;And no, VB.Net doesn't have a ? operator either.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Instead, overload IIF() with the appropriate strongly typed&amp;nbsp;parameters and you'll be all set.&amp;nbsp; This is an example:&lt;/P&gt;&lt;FONT&gt;
&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;Public Class&lt;/FONT&gt; IIFHelper&lt;BR&gt;&amp;nbsp;&lt;FONT&gt;Public Shared Function&lt;/FONT&gt; IIF( Condition &lt;FONT&gt;as Boolean&lt;/FONT&gt;, TrueResult &lt;FONT&gt;as String&lt;/FONT&gt;, FalseResult &lt;FONT&gt;as String&lt;/FONT&gt; ) &lt;FONT&gt;as String&lt;/FONT&gt; &lt;BR&gt;&lt;FONT&gt;&amp;nbsp;&amp;nbsp;If &lt;FONT&gt;Condition &lt;/FONT&gt;Then &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &lt;FONT&gt;TrueResult&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;Else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return &lt;FONT&gt;FalseResult&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;End If&lt;BR&gt;&amp;nbsp;End Function&lt;BR&gt;End Class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Repeat as necessary and start using IIFHelper.IIF() instead of just IIF() -- I found only a handful of IIFHelper.IIF permutations necessary to get to Option Strict On salvation.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;Now I can rest&amp;nbsp;easier.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=62602" width="1" height="1"&gt;</description></item><item><title>NHibernate</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/04/28/62591.aspx</link><pubDate>Thu, 28 Apr 2005 06:34:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:62591</guid><dc:creator>grant.killian</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=62591</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/04/28/62591.aspx#comments</comments><description>&lt;P&gt;Anyone having fun with &lt;A href="http://nhibernate.sourceforge.net/"&gt;NHibernate&lt;/A&gt;?&amp;nbsp; &lt;A href="http://www.theserverside.net/articles/showarticle.tss?id=NHibernate"&gt;This article from TheSeverSide gives a nice NHibernate&amp;nbsp;overview&lt;/A&gt;, but I'm curious about how people are finding the config file management and the tool in general after a bit of real world use.&lt;/P&gt;
&lt;P&gt;I've used a home grown version that did the same thing; it&amp;nbsp;used a combination of .Net Reflection and &lt;A href="http://www.ericjsmith.net/codesmith/"&gt;CodeSmith&lt;/A&gt;.&amp;nbsp; I wonder if NHibernate is the way to progress in the future . . .&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=62591" width="1" height="1"&gt;</description></item><item><title>No Option Strict For You</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/04/25/62442.aspx</link><pubDate>Mon, 25 Apr 2005 12:30:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:62442</guid><dc:creator>grant.killian</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=62442</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/04/25/62442.aspx#comments</comments><description>&lt;P&gt;I'm looking at sample apps for some newer .Net web developers to learn from . . . I figured the ASP.Net starter kits would be a good place to start.&amp;nbsp; One of the things we wanted to include&amp;nbsp;was the importance of Option Strict On vs Option Strict Off and wouldn't you know it:&amp;nbsp;the &lt;A href="http://www.asp.net/TimeTrackerStarterKit/"&gt;TimeTracker Starter Kit app&lt;/A&gt; doesn't use Option Strict On.&amp;nbsp; I guess I shouldn't consider a "&lt;A href="http://www.asp.net/Default.aspx?tabindex=8&amp;amp;tabid=47"&gt;starter kit&lt;/A&gt;" to be the same as a best-practice "reference application" but it would be better for everyone if these sorts of samples stuck to some fundamentals.&amp;nbsp; Oh well . . . I can use this as an exercise in &lt;EM&gt;why they aren't using Option Strict On&lt;/EM&gt; and &lt;EM&gt;how we can correct it&lt;/EM&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I won't even go into what happens&amp;nbsp;when I run &lt;A href="http://www.gotdotnet.com/team/fxcop/"&gt;FxCop&lt;/A&gt; against the starter kit.&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=62442" width="1" height="1"&gt;</description></item><item><title>Making a Copy of ASP.Net Application -- Best Practices?</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/04/01/60966.aspx</link><pubDate>Fri, 01 Apr 2005 03:31:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:60966</guid><dc:creator>grant.killian</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=60966</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/04/01/60966.aspx#comments</comments><description>&lt;P&gt;Somewhere between &lt;A href="http://www.codeproject.com/aspnet/VSNETcopyproject.asp"&gt;this&amp;nbsp;article on the .webinfo file&lt;/A&gt; and &lt;A href="http://www.aspnetresources.com/blog/sourcesafe_aggravation.aspx"&gt;this post about the .csproj file&lt;/A&gt; (that incorrectly presumes it's a Visual SourceSafe problem -- I'm no big fan of VSS but it's not the issue in this case) I successfully made a local copy of a web app we've been working on.&amp;nbsp; Copy the directory . . . make it a virtual directory in IIS, modify the .webinfo file, rename as necessary (webinfo must be same name as the csproj file it seems).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;My question&lt;/STRONG&gt;: what are the best practices around duplicating a web app on the same box (for running side-by-side as different instances with slightly different interfaces, etc?).&amp;nbsp; I &lt;STRONG&gt;KNOW &lt;/STRONG&gt;that one can deploy the app to different virtual directories, but what I'm after is a form of &lt;EM&gt;branching&lt;/EM&gt; the codebase into a totally new web application on a dev machine with the least amount of effort.&amp;nbsp; We'll use VS.Net to make some changes to the&amp;nbsp;UI code&amp;nbsp;for each customer (but reuse the same core assemblies for&amp;nbsp;business logic etc); we're talking more than just&amp;nbsp;style sheets, here, also.&amp;nbsp;&amp;nbsp;Too bad "deploying" the app to the same machine (and checking the "include source code" option") doesn't configure IIS for you and the other manual work . . .&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3"&gt;Writing this post has reminded me of a few projects I've been on where &lt;STRONG&gt;all&lt;/STRONG&gt; the UI stuff was configured from a database . . . the text of every label, x and y positioning on the screen,&amp;nbsp;presence of dropdown lists and other user input widgets, graphics, etc.&amp;nbsp; This&amp;nbsp;would solve my&amp;nbsp;particular problem of changing the UI stuff for each customer but introduce a whole host of other&amp;nbsp;architecture issues -- think about doing web layout from a set of related SQL Server tables and you'll get the idea.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maybe this would be a handy utility to throw up on something like&amp;nbsp;GotDotNet . . . if &lt;A href="http://pluralsight.com/blogs/craig/archive/2004/03/24/1279.aspx"&gt;GDN didn't have so many issues&lt;/A&gt;.&amp;nbsp; I guess &lt;A href="http://www.SourceForge.net"&gt;SourceForge&lt;/A&gt; is the main player in the shared project space -- but for something as minor as I'm suggesting it might be better off just posted as an EXE somewhere on &lt;A href=""&gt;CodeBetter&lt;/A&gt;.&amp;nbsp; I'll give it some thought.&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=60966" width="1" height="1"&gt;</description></item><item><title>Schiavo and VB6 expire on the same day</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/03/31/60939.aspx</link><pubDate>Thu, 31 Mar 2005 12:20:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:60939</guid><dc:creator>grant.killian</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=60939</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/03/31/60939.aspx#comments</comments><description>&lt;P&gt;Today, March 31st 2005, marks &lt;A href="http://msdn.microsoft.com/vbasic/support/vb6.aspx"&gt;the final day of free support for VB 6 by Microsoft&lt;/A&gt;.&amp;nbsp; It's caused quite a stir in some circles, most notably &lt;A href="http://classicvb.org/petition/"&gt;the petition for Microsoft to re-align "it's long-term strategies with those of its customers."&lt;/A&gt;&amp;nbsp; Signatories would rather have Microsoft invest money in keeping a parallel VB6 compiler and IDE current (this is&amp;nbsp;part of&amp;nbsp;what the petition suggests)&amp;nbsp;instead of pursuing innovation and improvement in the .Net direction -- and don't give me the "Microsoft should do both" talk because &lt;STRONG&gt;you, too,&amp;nbsp;can do both&lt;/STRONG&gt;: keep your VB6 CDs and service packs around and you'll be able to continue to do VB6 stuff until all the DLLs rot away sometime in 2030.&amp;nbsp; They run side-by-side with the newer toys, at least &lt;A href="http://weblogs.asp.net/jkey/"&gt;it works on my machine&lt;/A&gt;.&amp;nbsp; A company the size of Microsoft &lt;STRONG&gt;can&lt;/STRONG&gt; do what&amp;nbsp;the petition&amp;nbsp;proposes, but I'd rather have them looking forward and sort out performance in .Net and improve on SQL Server and enhance the Web Service architecture.&amp;nbsp; It's a zero-sum game folks: energy spent on VB6 stuff is energy &lt;STRONG&gt;not&lt;/STRONG&gt; spent on all the other products.&lt;/P&gt;
&lt;P&gt;We've already seen Java saddled with backward compatibility woes (&lt;A href="http://weblogs.java.net/blog/schaefa/archive/2004/10/proposal_to_fix.html"&gt;just one example here but there are myriad&lt;/A&gt;) and .Net already has some of it's own (&lt;A href="http://msdn.microsoft.com/msdnmag/issues/04/08/GridView/"&gt;DataGrid replaced by GridView&lt;/A&gt;&amp;nbsp;and . . . maybe someday in .Net 3.0 we'll get the DataGridView that combines the two -- the point being a cluttering of the object model and controls).&amp;nbsp; Let's not bring VB 6 back from the dead and into the .Net IDE equation.&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;just&amp;nbsp;saw where Schiavo&amp;nbsp;was&amp;nbsp;declared dead a few hours&amp;nbsp;ago . . . that's a ghastly situation that's now behind us [hopefully].&amp;nbsp; In the same spirit, hasn't VB6 been through enough?&amp;nbsp; Yes, that's an insensitive comparison -- but a bizarre coincidence -- just send your comments to &lt;a href="http://www.codebetter.com/blogs/brendan.tompkins/"&gt;Brendan&lt;/A&gt; because he lets me keep this blog around.&amp;nbsp; Yes, I've drank the .Net kool-aid but why haven't you?&amp;nbsp; I'm much more productive with .Net and my apps are more professionally developed, tested, deployed, and maintained thanks to the .Net family.&amp;nbsp; Any new development I do is &lt;STRONG&gt;almost always in .Net&lt;/STRONG&gt; unless the customer is extending an existing legacy app and &lt;STRONG&gt;even then&lt;/STRONG&gt; &lt;a href="http://www.codebetter.com/blogs/grant.killian/archive/2004/09/08/24830.aspx"&gt;I'm always looking for ways of strangling the old app with .Net&lt;/A&gt;.&amp;nbsp; As a last resort, I fire up the VB6 IDE and take a trip down memory lane.&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=60939" width="1" height="1"&gt;</description></item><item><title>3 Lessons from TechEd (and Secret TechEd)</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/03/28/60719.aspx</link><pubDate>Mon, 28 Mar 2005 04:19:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:60719</guid><dc:creator>grant.killian</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=60719</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/03/28/60719.aspx#comments</comments><description>&lt;P&gt;I agree with &lt;a href="http://www.codebetter.com/blogs/brendan.tompkins/archive/2005/03/25/60624.aspx"&gt;Brendan that TechEd is too pricey for my blood&lt;/A&gt;.&amp;nbsp; Thanks to &lt;A href="http://www.ineta.org/"&gt;INETA&lt;/A&gt;, I got to go &lt;a href="http://www.codebetter.com/blogs/grant.killian/archive/2004/05.aspx"&gt;last year and I had a great time&lt;/A&gt;, but it wasn't my dime.&amp;nbsp;&amp;nbsp;Let me share some insight and demistify the TechEd experience.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Lesson 1:&amp;nbsp; There are lots of salespeople at TechEd and, apparently, lots of people keen to collect all the cheesy free things the salespeople are giving away.&amp;nbsp;&amp;nbsp;I don't get it since the salespeople must &lt;STRONG&gt;know&lt;/STRONG&gt; the leads they get at TechEd are mostly junk, but it must pay off on some level.&amp;nbsp; Does the company get a viral marketing buzz?&amp;nbsp; Maybe the salespeople are just as happy to be in a sunny and pleasant town for a week?&lt;/P&gt;
&lt;P&gt;Lesson 2:&amp;nbsp; There are lots of casual techies there -- project managers or junior developers, ones who don't open a technical book or read weblogs or explore technology on their own time very much.&amp;nbsp; For these folks, the sessions on "what is Sharepoint" and "DataSets vs Custom Objects" are ground breaking and truly new news.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To me, lesson 1 and 2 are NOT worth the $2,000 price tag; &lt;STRONG&gt;especially &lt;/STRONG&gt;if you are already up on the latest in technology.&amp;nbsp; Most of the sessions will be review, but there will still be a few great sessions that you&amp;nbsp;should catch like &lt;A href="http://www.wintellect.com/"&gt;Jeffrey Richter&lt;/A&gt;, &lt;A href="http://blogs.msdn.com/ericgu"&gt;Eric Gunnerson&lt;/A&gt;, and &lt;A href="http://www.pluralsight.com/blogs/dbox/default.aspx"&gt;Don Box&lt;/A&gt;&amp;nbsp;-- do the math, and even if those 3 guys do 2 sessions each (which they probably don't), thats 6 great talks for $2,000 . . . I can wait for the DVD.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Lesson 3:&amp;nbsp; There is a Secret TechEd that takes place beyond the conference rooms.&amp;nbsp; This is the lunches and&amp;nbsp;after-hours parties, some invite-only, where authors, speakers,&amp;nbsp;and Microsoft big shots talk shop and build relationships.&amp;nbsp; Sometimes it's a group of 2 or&amp;nbsp;3,&amp;nbsp;other times it's a hotel room overflowing with&amp;nbsp;50 people.&amp;nbsp; &lt;STRONG&gt;This is the good stuff&lt;/STRONG&gt;, the stuff you can't get from reading MSDN or taking a few hours each weekend to play with ASP.Net 2.0.&amp;nbsp; This is fun!&amp;nbsp; I know many tech-ed attendees who never experience this, and I was only on the periphery of this secret TechEd.&amp;nbsp; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;The catch is, you can't buy admission to Secret TechEd and you have to be in the right mindset to take advantage of it&lt;/STRONG&gt;.&amp;nbsp; Between WeProgram.Net, CodeBetter.com, and some other projects I'm feeling connected enough to save my money and time for other things.&amp;nbsp; For example, I will attend the&amp;nbsp;&lt;A href="http://www.Devscovery.com"&gt;Devscovery&lt;/A&gt;&amp;nbsp;conference in Reston where nearly every session is a ball-buster from the likes of Jeffrey Richter and Johnnie "Flash" Robbins and the price tag is closer to Brendan's $600 threshhold.&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=60719" width="1" height="1"&gt;</description></item><item><title>Landscape printing your XSL transformed XML</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/03/22/60415.aspx</link><pubDate>Tue, 22 Mar 2005 16:13:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:60415</guid><dc:creator>grant.killian</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=60415</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/03/22/60415.aspx#comments</comments><description>&lt;P&gt;A friend of mine was trying to force a web browser to print in landscape for a specific XSL transformed XML page.&amp;nbsp; I mulled this over while on my lunch break and put together this little proof-of-concept when I got back; while it doesn't do ANYTHING to the printer, it renders the page at a different 90 degree angle so when printed it appears to be landscape format:&lt;BR&gt;First, a very simple XML data file (data.xml):&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;BR&gt;&amp;lt;?xml-stylesheet type="text/xsl" href="Style.xsl"?&amp;gt;&lt;BR&gt;&amp;lt;data&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;quote&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;author&amp;gt;Socrates&amp;lt;/author&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;text&amp;gt;I drank what?&amp;lt;/text&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/quote&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;quote&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;author&amp;gt;Anonymous&amp;lt;/author&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;text&amp;gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;BR&gt;incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis &lt;BR&gt;nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. &lt;BR&gt;Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu &lt;BR&gt;fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in &lt;BR&gt;culpa qui officia deserunt mollit anim id est laborum.&amp;lt;/text&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/quote&amp;gt;&lt;BR&gt;&amp;lt;/data&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Second, an XSL file that will transform the XML into our landscape view (Style.xsl):&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt; &lt;BR&gt;&amp;lt;xsl:stylesheet version="1.0" xmlns:xsl="&lt;A href="http://www.w3.org/1999/XSL/Transform"&gt;http://www.w3.org/1999/XSL/Transform&lt;/A&gt;"&amp;gt; &lt;BR&gt;&amp;lt;xsl:template match="/"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;html&amp;gt;&lt;BR&gt;&amp;lt;head&amp;gt;&lt;BR&gt;&amp;lt;style&amp;gt;&lt;BR&gt;div.page {&lt;BR&gt;&amp;nbsp;&amp;nbsp; writing-mode: tb-rl;&lt;BR&gt;&amp;nbsp;&amp;nbsp; height: 80%;&lt;BR&gt;&amp;nbsp;&amp;nbsp; margin: 10% 0%;&lt;BR&gt;}&lt;BR&gt;div.page p {&lt;BR&gt;&amp;nbsp;&amp;nbsp; margin-right: 80pt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=1);&lt;BR&gt;}&lt;BR&gt;&amp;lt;/style&amp;gt;&lt;BR&gt;&amp;lt;/head&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;body&amp;gt;&lt;BR&gt;&amp;lt;div class="page"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;h2&amp;gt;Quotes&amp;lt;/h2&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;xsl:apply-templates/&amp;gt; &lt;BR&gt;&amp;lt;/div&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/html&amp;gt;&lt;BR&gt;&amp;lt;/xsl:template&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;xsl:template match="quote"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;p&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;xsl:apply-templates select="author"/&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;xsl:apply-templates select="text"/&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;BR&gt;&amp;lt;/xsl:template&amp;gt;&amp;lt;xsl:template match="author"&amp;gt;&lt;BR&gt;&amp;nbsp; Author: &amp;lt;span style="color:darkgreen"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;xsl:value-of select="."/&amp;gt;&amp;lt;/span&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&amp;lt;/xsl:template&amp;gt;&amp;lt;xsl:template match="text"&amp;gt;&lt;BR&gt;&amp;nbsp; Text: &amp;lt;span style="color:navy"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;xsl:value-of select="."/&amp;gt;&amp;lt;/span&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;BR&gt;&amp;lt;/xsl:template&amp;gt;&lt;BR&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's it.&amp;nbsp; It's just a matter of having a DIV tag styled with the appropriate attributes.&amp;nbsp; The "DXImageTransform.Microsoft.BasicImage . . ." is the critical bit of the style and, unfortunately, locks us into a browser with ActiveX support (basically just Internet Explorer).&amp;nbsp; The full docs on this BasicImage approach are here: &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/basicimage.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/basicimage.asp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I've put these filters to good use on other projects, creating gradient backgrounds for tables (&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/gradient.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/gradient.asp&lt;/A&gt;) and other clever UI stuff.&amp;nbsp; Remember, it's Internet Explorer specific.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=60415" width="1" height="1"&gt;</description></item><item><title>If you tolerate something, you insist upon it</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/03/15/59873.aspx</link><pubDate>Tue, 15 Mar 2005 16:36:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:59873</guid><dc:creator>grant.killian</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=59873</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/03/15/59873.aspx#comments</comments><description>&lt;P&gt;Bob "Not Just The &lt;A href="http://www.CodingSlave.com"&gt;Coding Slave&lt;/A&gt; Guy" Reselman &lt;A href="http://codingslave.blogspot.com/2005/03/q-when-is-last-time-you-behaved.html"&gt;blogs about his interview with Microsoft&lt;/A&gt;&amp;nbsp;and sneaks a real gem of a quote in near the end: &lt;STRONG&gt;If you tolerate something, you insist upon it&lt;/STRONG&gt; (by the way, Reselman cites &lt;A href="http://www.mccarthy-tech.com"&gt;Jim McCarthy&lt;/A&gt; as being the source for this remark).&lt;/P&gt;
&lt;P&gt;This really got me thinking.&amp;nbsp; So often in work -- and life in general -- we're tempted to settle for the easy way out or to take the path of short term convenience.&amp;nbsp; In programming it usually bites you in the ass, turning January's easy fix into March's nightmare code overhaul.&amp;nbsp; Since we've recently added a new puppy to our household I'm hyper-sensitive to what we let the dog get away with; we can't &lt;STRONG&gt;tolerate&lt;/STRONG&gt; her eating our cats, for example -- to the malleable puppy brain it's the same as if we're &lt;STRONG&gt;insisting&lt;/STRONG&gt;&amp;nbsp;upon her eating the cats!&amp;nbsp; &lt;STRONG&gt;If you tolerate something, you insist upon it&lt;/STRONG&gt; speaks on many levels!&lt;/P&gt;
&lt;P&gt;In a way we're all these malleable puppy brains running amok . . .&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=59873" width="1" height="1"&gt;</description></item><item><title>Powerful Web Charting with NPlot</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/03/09/59501.aspx</link><pubDate>Wed, 09 Mar 2005 17:56:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:59501</guid><dc:creator>grant.killian</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=59501</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/03/09/59501.aspx#comments</comments><description>&lt;P&gt;I previously considered the free web charting component from &lt;A href="http://www.carlosag.net/"&gt;Carlos Aguilar&lt;/A&gt; to be my main web chart tool . . . but I recently strayed and found a new web chart component.&amp;nbsp;&amp;nbsp;&lt;A href="http://netcontrols.org/nplot/"&gt;NPlot&lt;/A&gt; has become my new &lt;STRONG&gt;main&lt;/STRONG&gt; web charting &lt;STRONG&gt;squeeze&lt;/STRONG&gt; because it gives me more control over the chart surface area, plotting behaviour, etc.&amp;nbsp;&amp;nbsp;Carlos Aguilar's&amp;nbsp;component is quick and simple&amp;nbsp;and will still be useful for basic web charting, but NPlot&amp;nbsp;is the more sophisticated alternative.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's hard to describe unless you've worked with both charting tools, but I've got considerably more control when I use NPlot.&amp;nbsp;&amp;nbsp;NPlot is&amp;nbsp;still in development so you have to make due without much documentation and other polishes, but&amp;nbsp;I really like what they've got so far.&amp;nbsp; NPlot has&amp;nbsp;a much more scientific aspect to it, with &lt;A href="http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&amp;amp;va=abscissa"&gt;Abscissa&lt;/A&gt;&amp;nbsp;and other slick &lt;STRONG&gt;math nerdy &lt;/STRONG&gt;things.&amp;nbsp; A project I'm working on requires some scientific data presentation and NPlot gives me the control I need and the customer wants.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Since the docs aren't available yet, here's a snippet that will get you up and running:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set a reference to the NPlot assembly (NPlot.dll) -- assuming you've downloaded the files from &lt;A href="http://netcontrols.org/nplot/"&gt;http://netcontrols.org/nplot/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Add a PlotSurface2D control on your web form (drag and drop it or manually add it with the Register ASPX Page directive and add the control tag "&amp;lt;cc1:PlotSurface2D id="surface" runat="server" Width="200px" Height="100px"/&amp;gt;" to your web form&lt;/LI&gt;
&lt;LI&gt;Here is the quick-and-dirty sample code for your page Load event&amp;nbsp;(in VB -gasp- since our customer requested we work in it):&lt;/LI&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;surface.Title = "My Title"&lt;BR&gt;Dim lp As LinePlot = New LinePlot&lt;BR&gt;lp.DataSource = New Integer() {1, 5, 3, 4}&lt;BR&gt;lp.Color = Color.RosyBrown&lt;BR&gt;Dim dates As ArrayList = New ArrayList&lt;BR&gt;dates.Add( CDate( "11/1/2004" ) )&lt;BR&gt;dates.Add( CDate( "11/11/2004" ) )&lt;BR&gt;dates.Add( CDate( "11/27/2004" ) )&lt;BR&gt;dates.Add( CDate( "12/1/2004" ) )&lt;BR&gt;lp.Color = Color.Blue&lt;BR&gt;lp.AbscissaData = dates&lt;BR&gt;surface.Add(lp)&lt;BR&gt;surface.XAxis1.Label = "x-axis label"&lt;BR&gt;surface.Refresh()&lt;BR&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;Oh yeah, if you want another reason to check out NPlot, it looks like the developers&amp;nbsp;(Matt Howlett and Paolo Pierini) are&amp;nbsp;into the &lt;A href="http://www.mono-project.com/about/index.html"&gt;Mono project&lt;/A&gt; after a fashion -- I don't know the full pedigree, I just know I can get great web reports out of it.&amp;nbsp; Keep up the great work!&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=59501" width="1" height="1"&gt;</description></item><item><title>Blog Quandary</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/03/04/56493.aspx</link><pubDate>Fri, 04 Mar 2005 11:07:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:56493</guid><dc:creator>grant.killian</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=56493</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/03/04/56493.aspx#comments</comments><description>&lt;P&gt;Here's&amp;nbsp;the scenario:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The blog helps secure a contract with a customer; the blog's tech content helped to sell the customer.&amp;nbsp; This is wonderful! 
&lt;LI&gt;The contract with the customer has aggressive timeframes that involve overtime etc.&amp;nbsp; Project can't be done soon enough.&amp;nbsp; This isn't wonderful, but fairly typical. 
&lt;LI&gt;The blog is now used as a barometer of how busy the blogger is: if the blogger has time to &lt;EM&gt;blog&lt;/EM&gt; then they have time to rename these columns and tackle all the other items on the todo list.&amp;nbsp; Translation: time spent blogging is time not spent on the contract and, therefore, time wasted in the eyes of the customer.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Has anybody else been stuck in this quandary?&amp;nbsp; Blogging is good for business . . . but blogging is bad for the blogger.&amp;nbsp; I don't think a frequent blogger is an unproductive worker (necessarily!),&amp;nbsp;but I've heard of Human Resource issues around bloggers posting and so on.&lt;/P&gt;
&lt;P&gt;I'm thinking one approach is to queue up all the blog posts until the contract ends and then let them loose like a dam breaking . . . maybe one every 12 hours or so until they're all out there.&amp;nbsp; The problem is, what happens when the contract renews . . . I think a more sustainable compromise is necessary.&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=56493" width="1" height="1"&gt;</description></item><item><title>Are you an Enterprise Manager Addict?</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/02/14/50930.aspx</link><pubDate>Mon, 14 Feb 2005 17:46:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:50930</guid><dc:creator>grant.killian</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=50930</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/02/14/50930.aspx#comments</comments><description>&lt;P&gt;I sure am.&amp;nbsp; It's so much easier than remembering all the SQL syntax for editing tables, setting up indexes, etc.&amp;nbsp; I learned this -for about the 100th time in my career- over the last week when we started to get the invalid cursor state errors identified in this KB article: &lt;A href="http://support.microsoft.com/default.aspx?scid=kb;en-us;831997"&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;831997&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;We're not sure why it started, but last week any data schema changes we made through Enterprise Manager would fail and give us the above error.&amp;nbsp; We could make our changes in SQL Query Analyzer, sure, but using that philosophy I should be writing my .Net code in Notepad and compiling from the command line instead of using VS.Net.&amp;nbsp; &lt;STRONG&gt;Just because you can do something doesn't mean you should&lt;/STRONG&gt;.&amp;nbsp; SQL Enterprise Manager is a huge productivity boost and frees my brain from remembering the SQL syntax for indexing and other dba minutia.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It took about 3 days of prodding before the powers-that-be relented and decided getting the hotfix was the way to go; they were understandably concerned about having a non-standard database build on the server, but I dare you to show me a truly "standard" db build except for one that comes straight from the installation disk.&amp;nbsp; Applications are installed, uninstalled, and updated over time and&amp;nbsp;dlls, the registry, and other services get configured so that eventually a server is a complicated spider web of deviations from "the norm."&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It does concern me, however, that this hotfix isn't freely down-loadable from the web . . . just the sort of thing that might bite us in the butt when we're making changes to other parts of the server.&amp;nbsp; Regardless, we jumped through the hoops with Microsoft Dev Support (&lt;STRONG&gt;1-800-936-5800&lt;/STRONG&gt;) and got the hotfix and resolved the issue.&amp;nbsp; Enterprise manager is back and I can dump any of that SQL admin syntax that my short term memory may still be storing!&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=50930" width="1" height="1"&gt;</description></item><item><title>CodingWorse (at least slightly) with MsgBox</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/02/02/50387.aspx</link><pubDate>Thu, 03 Feb 2005 01:36:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:50387</guid><dc:creator>grant.killian</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=50387</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/02/02/50387.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;My &lt;A href="http://codebetter.com/blogs/grant.killian/archive/2005/01/27/48340.aspx"&gt;previous post&lt;/A&gt; pointed out the shortcomings of using Try-Catch blocks to handle situations that are not truly &lt;EM&gt;exceptional&lt;/EM&gt;.&amp;nbsp; In the same vein I offer this opinion on the VB.Net MsgBox() function -- note I say &lt;EM&gt;opinion&lt;/EM&gt; because this time I don't have the astounding perf numbers to back me up.&amp;nbsp; Here goes . . .&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I was eating dinner tonight and showing a friend of mine a little VB.Net code.&amp;nbsp; Yes, that's right -- a buddy stopped by and we were huddled around the laptop for a little nerdery and eggplant parmesan.&amp;nbsp; This friend of mine does some&amp;nbsp;Access development and I've been working on bringing him into the .Net fold.&amp;nbsp; We got sidetracked for about 30 minutes on why I don't use MsgBox() and, instead,&amp;nbsp;use MessageBox.Show().&amp;nbsp; While some will&amp;nbsp;say it's&amp;nbsp;only a matter of preference, I think it's more than that.&amp;nbsp; MsgBox is the Visual Basic&amp;nbsp;wrapper around the .Net Framework's MessageBox.Show&amp;nbsp;method -- there is a tiny bit more overhead to MsgBox, but it's negligible especially when you consider you're halting your program to display a dialog box to the user!&amp;nbsp; I can't really play the perf card here.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I think my two main issues with MsgBox are:&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;It reminds me of old VB6 and VBA days (like with Access); it carries a stigma of belonging to a bygone era.&amp;nbsp;&amp;nbsp;Comparing the IL for functions&amp;nbsp;with MsgBox()&amp;nbsp;and MessageBox.Show() is strikingly different: the MsgBox alternative calls into Microsoft.VisualBasic while MessageBox.Show()&amp;nbsp;calls System.Windows.Forms.&amp;nbsp; This might be a very &lt;EM&gt;very&lt;/EM&gt; academic point, but I just get a warm and fuzzy feeling with System.Windows.Forms compared to Microsoft.VisualBasic.&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;I do a lot of C# programming and there's no MsgBox there!&amp;nbsp; By learning the true .Net Framework I'm making my life easier -- it's more like I'm programming in only &lt;STRONG&gt;one language&lt;/STRONG&gt; instead of VB.Net sometimes and C# at other times.&amp;nbsp; I think Jeff Richter of &lt;A href="http://wintellect.com/WEBLOGS/wintellect/"&gt;Wintellect&lt;/A&gt; was the first to proclaim that all .Net developers are really programming in the same language.&amp;nbsp; The Base Class Library is common to all .Net developers and the type systems &lt;EM&gt;can be&lt;/EM&gt; coded the same (I could use System.Int32 instead of int or Integer -- and I did that for a while until I decided that was taking things too far).&amp;nbsp; I can use the Show method of the MessageBox object in any .Net compliant language (even with &lt;A href="http://codebetter.com/blogs/darrell.norton/archive/2005/01/07/42340.aspx"&gt;Darrell's recent Python fixation&lt;/A&gt;!).&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Call me a snob, but I know if I was reviewing code for a new hire and saw MsgBox() in their VB.Net code, I'd have a slightly -- just ever so slightly -- lesser opinion of the code.&amp;nbsp; If it came down to two identical candidates, one &lt;STRONG&gt;MsgBox&lt;/STRONG&gt;er and one &lt;STRONG&gt;MessageBox.Show&lt;/STRONG&gt;er, I'd hire the &lt;STRONG&gt;MessageBox.Show&lt;/STRONG&gt;er for sure.&amp;nbsp; &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskdisplayingmessageboxes.asp"&gt;MSDN even says MessageBox.Show is preferred&lt;/A&gt;.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I realize this is hardly a CodingWorse scenario on par with the &lt;A href="http://codebetter.com/blogs/grant.killian/archive/2005/01/27/48340.aspx"&gt;previous try-catch transgression&lt;/A&gt;, but MsgBox just rubs me the&amp;nbsp;wrong way.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=50387" width="1" height="1"&gt;</description></item><item><title>CodingWorse with a try{}catch{} solution?</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/01/27/48340.aspx</link><pubDate>Thu, 27 Jan 2005 13:48:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:48340</guid><dc:creator>grant.killian</dc:creator><slash:comments>20</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=48340</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/01/27/48340.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I used to teach in a technology program at ODU (until the university sold the program . . . but that's another story); I still get questions emailed from students about the &amp;#8220;right&amp;#8221; way to program things etc.  The latest question was about the lack of an &amp;#8220;IsNumeric&amp;#8221; function in C#; as you probably know, VB.Net has an IsNumeric() function that returns a boolean for if a number is numeric or not.  While VB.Net's IsNumeric() function is hardly rocket science, it is a very useful function for testing your strings.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Anyway, C# is a little more &amp;#8220;roll-up-your-sleeves&amp;#8221; and solve your own problem, so there is no equivalent IsNumeric function in C#.  This former student of mine asked if the following was an acceptable alternative:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;public static bool isNumeric( string strText ) &lt;BR&gt;{ &lt;BR&gt; try&lt;BR&gt; {&lt;BR&gt;  int i = int.Parse( strText ) ;&lt;BR&gt;  return true ;&lt;BR&gt; }&lt;BR&gt; catch&lt;BR&gt; {&lt;BR&gt; return false ;&lt;BR&gt; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;What's wrong with this picture?  This is classic lazy-programming (or, in this case, just inexperienced programming) because t&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;he person knows enough about C# to use try{}catch{}, but is using it inappropriately.  Exceptions are for &lt;STRONG&gt;exceptional &lt;/STRONG&gt;situations -- not for avoiding some real thinking through the issue.  Catching exceptions is hard work on your programs and &lt;STRONG&gt;performance will&lt;/STRONG&gt; &lt;STRONG&gt;really suffer&lt;/STRONG&gt;: this try{}catch{} isNumeric() function is over 2,000 times &lt;STRONG&gt;slower &lt;/STRONG&gt;than this alternative:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;public static bool isNumeric( string strText ) &lt;BR&gt;{ &lt;BR&gt;    char[] chars = strText.ToCharArray() ; &lt;BR&gt;    for ( int i = 0; i &lt; chars.Length; i++ ) &lt;BR&gt;    { &lt;BR&gt;        if( !Char.IsDigit( chars[ i ] ) ) //could also explore IsNumber&lt;BR&gt;        {&lt;BR&gt;            return false ;&lt;BR&gt;        }&lt;BR&gt;    } &lt;BR&gt;    return true ; &lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The good ol' Char class has a baked in IsDigit() function that will also handle localized definitions of numbers; this version of isNumeric() will work with Cyrillic defined numbers as well as our &amp;#8220;conventional&amp;#8221; numerals -- assuming the system is setup for the appropriate region/locale.  This function requires a bit more typing, but iterating over every character in a string and testing for that character's &amp;#8220;IsDigit-ness&amp;#8221; is 2,000 times faster than the try{}catch{} solution.  Of course, your mileage may vary based on the length of the string you're comparing etc (I used strings of 10 characters in my tests).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;If blinding perf is what you're after, this is the alternative isNumeric function you want:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;public static bool isNumeric( string strText ) &lt;BR&gt;{ &lt;BR&gt;    char[] chars = strText.ToCharArray() ; &lt;BR&gt;    for ( int i = 0; i &lt; chars.Length; i++ ) &lt;BR&gt;    { &lt;BR&gt;        if ( chars[ i ] &gt; 57 || chars[ i ] &lt; 48 ) &lt;BR&gt;        {&lt;BR&gt;            return false ; &lt;BR&gt;        }&lt;BR&gt;    } &lt;BR&gt;    return true ; &lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;You lose the universal comparison logic built into Char.IsDigit(), but this is over twice as fast as the previous alternative (and fully 5000+ times faster than the original try{}catch{} function).  Exact statistics are at the bottom of this post.  If your app will only run on machines where characters 48-57 will be numeric -- like with our western number system -- this is the &lt;A href="http://www.moet.com"&gt;moet et chandon&lt;/A&gt; of the IsNumeric() world.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Yes, you can call into the VB.Net library to get to that IsNumeric() function; this will be slow, too.  Besides, I know some C# die-hards that would rather eat their own young than call a VB.Net library intentionally.  I've also omitted a Regex isNumeric() alternative and a few others, but I didn't set out to write the definitive study on isNumeric for C#.  Originally, I wanted to demonstrate that the &amp;#8220;quick-and-dirty&amp;#8221; try{}catch{} coding solution to this problem is for those who want to &lt;STRONG&gt;CodeWorse&lt;/STRONG&gt; -- and since my blog is now on &lt;A href="http://www.CodeBetter.com"&gt;www.CodeBetter.com&lt;/A&gt; I figured I better get with the program!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;So, using &lt;A href="http://codebetter.com/blogs/grant.killian/archive/2004/12/03/34834.aspx"&gt;perf monitoring like in this post&lt;/A&gt; and a little &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials/html/il_dasm_tutorial.asp"&gt;ILDasm&lt;/A&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;The try{}catch{} CodeWorse approach took 43 seconds to run through 30,000 test calls to IsNumeric where 66% of the strings were not numeric (meaning, 66% return false).  That's a lot of exceptions!  The IL for the function has 2 calls into MSCorLib and the perf-crushing IL try-catch handlers.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;The Char.IsDigit approach took only .0171 seconds to run through the same 30,000 test calls.  This approach still has 2 calls into MSCorlib in the IL, but none of the try-catch handlers to cause pain and perf agony.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;The simple character comparison array loop was the fastest for these 30,000 calls at .0078 seconds.  Only 1 MSCorLib call.  No try-catch nonsense.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Can you hear me in the back?&lt;/STRONG&gt;  The time it takes the try{}catch{} &amp;#8220;solution&amp;#8221; to work in a loop situation can be measured in whole seconds (perhaps minutes!) while the other approaches only take fractions &lt;EM&gt;of fractions&lt;/EM&gt; of seconds. I can literally type the entire &amp;#8220;verbose&amp;#8221; character comparison array loop solution in Visual Studio in the time it takes the try{}catch{} &amp;#8220;solution&amp;#8221; to run -- so don't give me any &amp;#8220;quick and dirty is fine&amp;#8221; stuff here.  It's just inexperience or laziness that would have you CodingWorse with try{}catch{} blocks.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=48340" width="1" height="1"&gt;</description></item><item><title>the Bob's blog</title><link>http://codebetter.com/blogs/grant.killian/archive/2005/01/27/48332.aspx</link><pubDate>Thu, 27 Jan 2005 10:25:00 GMT</pubDate><guid isPermaLink="false">d21fbbc9-c112-4f32-ad14-95939a2c53d4:48332</guid><dc:creator>grant.killian</dc:creator><slash:comments>39</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://codebetter.com/blogs/grant.killian/rsscomments.aspx?PostID=48332</wfw:commentRss><comments>http://codebetter.com/blogs/grant.killian/archive/2005/01/27/48332.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Author of &lt;/FONT&gt;&lt;A href="http://www.CodingSlave.com"&gt;&lt;FONT face=Arial size=2&gt;Coding Slave&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;, Bob Reselman (aka &amp;#8220;the Bob&amp;#8220;), is joining the blog community with his Coding Slave blog: &lt;/FONT&gt;&lt;A href="http://codingslave.blogspot.com/"&gt;&lt;FONT face=Arial size=2&gt;http://codingslave.blogspot.com/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;.&amp;nbsp; It's &amp;#8220;the Bob Blog.&amp;#8221;&amp;nbsp; Say it&amp;nbsp;10 times fast . . .&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp; It's part socratic introspection, part social commentary, with a dose of technology thrown in.&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;Rosa Luxembourg would be proud (google it if you don't know who she is): &amp;#8220;Love of your own country is patriotism; love a country owned by others is &lt;STRONG&gt;not&lt;/STRONG&gt; patriotism, but something else.&amp;#8220;&amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Check it out if you're in the mood for something smart and semi-colon free (meaning, it's not just about programming).&amp;nbsp; I was lucky to grab a meal with &amp;#8220;the Bob&amp;#8220; last year and he is an unabashed deep thinker in a world that could use a lot more deep thinking.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;In my opinion, one great reason to follow blogs is to foster critical thinking about topics you may not otherwise consider.&amp;nbsp; This may come as a surprise, but &lt;STRONG&gt;it's not just about finding code you can copy-and-paste&lt;/STRONG&gt;.&amp;nbsp; Go on and take the &lt;FONT color=#ff0000&gt;&lt;STRONG&gt;red&lt;/STRONG&gt;&lt;/FONT&gt; pill . . . or was it the &lt;FONT color=#000080&gt;&lt;STRONG&gt;blue&lt;/STRONG&gt;&lt;/FONT&gt; pill? &amp;nbsp;I forget.&amp;nbsp; Check out &lt;A href="http://codingslave.blogspot.com/"&gt;The Bob's blog&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://codebetter.com/aggbug.aspx?PostID=48332" width="1" height="1"&gt;</description></item></channel></rss>