Archives

Archives / 2003 / June
  • The Caching Pattern

    Here's a little something that I term "the caching pattern" for using the ASP.NET cache object: Object cacheItem = Cache[key] as DataTable; if(cacheItem == null) {   cacheItem = GetData();   Cache.Insert(key, cacheItem, null, DateTime.Now.AddHours(1), TimeSpan.Zero); } return (DataTable)cacheItem;   The as keyword will try to cast Cache[key] to DataTable and if unsuccessful it will return null.  If it is null, it will return null.  The rest of it is pretty straightforward.  This is the best practice way to get something from the cache, but look at it!  It's huge!  I'm trying to come up with a helper class that will encapsulate this logic in a reusable fashion so that reading something from … more

  • Trying out w.bloggar 3.01

    I just installed w.bloggar 3.01 and the WMPAmplog Plug-In. Let's see how it works... I used Daniel Bright's setup instructions to get set up in about 20 seconds. If you're reading this, everything must have worked. Ah, something for the wmpamplog FAQ - it doesn't work until you exit and restart Winamp. Pretty easy one to troubleshoot, though. Also looks like I'll have to set up my own CSS file to define class "media" for the music link... [Listening to: Send the Pain Below - Chevelle - Wonder What's Next (04:12)] more

  • Caching Application Block Released

    News if you haven't heard, another application block has been released (actually a couple): Caching Application Block (the other one is Aggregation) I've read over the docs for the Caching block and at first glance it looks like it doesn't offer anything to ASP.NET developers that the built-in Cache API doesn't have, unless you're looking to store your cached data in a database (and suffer big perf penalties). It's missing features that the intrinsic Cache object supports, such as providing access to the just-expired object in a CacheItemRemovedCallback (the app block only passes in the key, not the value), and it doesn't go further with than the intrinsic Cache object where the Cache object … more

  • DotNetBips Interview

    Bipin Joshi interviewed me (virtually) for his website, DotNetBips.com.  You may read the interview here if you're interested: DotNetBips Inteviews Steve Smith more

  • Hosting

    I've had enough people ask me for hosting advice lately to write up my thoughts in an article.  You can read about my experience with the people who make up ORCSWeb in this ASPAlliance article: Hosting Review: ORCSWeb.com Listening To: Saliva - Rest In Pieces more

  • Handy Tracing Utility

    There are three features I wish ASP.NET tracing had out of the box: Check for a null context and gracefully disable if context is null (e.g. at design time) If I don't specify a category, default to the name of the method in which the trace is being called. Automatically compile out of production code via the Conditional("DEBUG") attribute or something similar.  Today, Trace routines carry overhead even when tracing is turned off. To provide these features, I have a simple wrapper class.  You can name the class itself whatever you like but I recommend it be something short so that you don't have to type much to get Tracing into your code.  Feel free to use this wherever you like. I tried … more

  • Outlook 2003 Beta 2 (was Outlook Express)

    I'm finally upgrading from OE to Outlook on the advice of Brian Tinkler of the Wisconsin .NET User Group (among many others over the past few years).  The main reason that I stuck with/chose OE over Outlook was that Outlook97 didn't have an easy way to select which FROM address to use for emails, and I was frequently switching between several POP3 accounts from several organizations.  OE had a nifty little dropdown, Outlook didn't.  Outlook97 combined with Visual Studio 1.0 also tended to totally slow down my P2-300 laptop that I had a few years back... So, I'm installing the Beta that came with my MSDN subscription and hoping that it is pretty stable.  If not, I'll blame Brian since he told … more

  • NUnit 2.0 And .NET 1.1 Together

    I spoke at the Wisconsin .NET User Group last night and had a good time.  A small part of my talk was on using NUnit to do unit testing and an introduction to Test Driven Development(TDD).  In the course of preparing my samples I upgrade to VS.NET 2003 from VS.NET 2002 and thus from .NET v1.0 to v1.1.  Unfortunately, I had a heck of a time getting NUnit to work after doing this, and was getting a security exception any time I tried to load a 1.1 compiled assembly. There are couple of resources I was directed to related to this when I asked the community at ASPAdvice.com for help.  Rachel Reese directed me to Robert McLaws blog on the subject, which in turn linked this very detailed article. … more

  • Easier ADO.NET Parameters using Enums and Attributes

    DonXML has a cool article I just read on how to use Attributes to extend Enums to create strongly typed parameter objects for ADO.NET commands.  You can read the whole article here: http://www.donxml.com/FunwithAttributeBasedProgramming.htm The article is cool for two reasons: It makes it so that adding a parameter is a very simple one line of code (not 2-3 with a bunch of parameters to mess with) It allows common parameters that should be the same everywhere (like, customerID) to be defined in one place.  This way, you know everyone is using the same definition for the parameter, and if you switch from an int to a guid for customerID, you only have one place you need to change in your code … more

  • SCSI Information

    Aaron Seet posted a link to this very long and very detailed analysis of SCSI vs. IDE hard drives, which I'm posting here for others to reference and also so I know where the link is so I can finish this long article. http://scsi.radified.com/ more