Archives

Archives / 2008 / July
  • DevExpress Earthquake Video

    DevExpress is one of several companies I work with via Lake Quincy Media, and it seems like a very fun place to work.  Recently they launched a video site to help showcase their products, and earlier this week they made a video showing the reaction of some of their employees to the 5.4 scale earthquake in LA earlier this week.  Check it out, and then check out some of their other videos as well. Incidentally, Mark Miller (Miller in the video - the bald one...) also has his own blog and spoke at this year's TechEd.  He's the brains behind CodeRush and Refactor and is a good guy to keep tabs on if you're interested in optimizing your coding experience (though he's not much of a … more

  • There are no single developer projects

    Oren wrote today, There is no such thing as a single developer project.  At first this sounds like an obviously false statement, but read on: There are always at least two people in any software project: The developer who wrote the code. The developer who read the code. They are never the same person, even if just by temporal dissonance. This is a very clever thing to point out, and worth remembering when you're tempted to take shortcuts using the excuse "I'm the only one working on this code so I can wing it."  Who you are today is not who you were yesterday, nor will you be the same person tomorrow.  Write your code with the knowledge that someone else is going to have … more

  • Batch JavaScript Libraries for Increased Performance

    I've been meaning to set up batched loading of the JavaScript libraries used by Lake Quincy Media's administration application for some time, and finally had a chance this past weekend.  The site uses a variety of third-party tools such as DevExpress, ComponentArt, AJAX Control Toolkit, Overlib, PeterBlum, Dundas Charts, and probably a couple of others I'm forgetting at the moment.  As a result, the site's initial load tended to be pretty sluggish.  JavaScript libraries are loaded and executed serially by the browser, resulting in a pretty significant bottleneck to page load time, as shown here: Once loaded the first time, most of these scripts are cached in the client, so … more

  • Avoid appSettings Usage in Controls or Shared Libraries

    Since .NET 1.0, there has been a built-in appSettings section in configuration files.  Many developers use this space to store application settings, such as the name of the site or (before <connectionStrings />) database connection information.  However, many third party tools also make use of this collection, which is a bad practice.  Third party tools should use their own configuration section, which is incredibly easy to do today (and wasn't all that hard in past versions), in my opinion.  I'm curious to know why more companies don't do this, however, as the only thing I can see is that it's laziness or just "the way we've always done it" that's the reason. … more

  • VS Tip - Incremental Search in Visual Studio

    If you're looking to navigate through the current file in Visual Studio, the typical approach is ctrl-F, which is the shortcut for Find and brings up a dialog like the one at right to locate instance of a string.  Bertrand just let me know about another shortcut, ctrl-I, which does Incremental Search.  The nice thing about this is that it's faster (there is a measurable delay before ctrl-F loads) and doesn't pop up a window that gets in the way of seeing your code.  After pressing ctrl-i, as you type the cursor will move to the next string that matches what you've typed.  Finding additional instances of the string is simply a matter of hitting F3. more

  • Travel Gadget - Power Splitter

    Something I always keep in my laptop bag is a Liberator power splitter.  All this does is split one power outlet into two, with a little bit of extension cord thrown in for added convenience.  You can find a wide variety of such things here. Always Enough Power For You So, what's the big deal about having one of these?  Well, you could throw a whole power strip in your bag, but that's more bulk and weight.  If you don't mind that, then go for it.  Assuming you don't want to carry that, though, the benefit of a Y-splitter is that if you walk into a room (or conference session, where power outlets are always in short supply at geek conferences) you can simply unplug … more

  • Speaking in Toledo Tonight

    I'll be presenting at the Northwest Ohio .NET User Group this evening at 6pm.  The talk will be a slightly modified version of my Black Belt ASP.NET Performance talk that I gave earlier this month at Tech Ed in Orlando.  According to their web site, the user group will also be giving away a Zune to one of the attendees of tonight's meeting (and I have a book and some shirts, too...), so if nothing else, you can come for the free stuff. The main topics covered in this talk are performance testing with load testing tools, caching, and asynchronous programming. more

  • JungleDisk as Service on Windows Server 2003

    I'm a big fan of JungleDisk, a $20 utility that makes using Amazon's S3 storage solution easy and backups cheap.  I'm also a big fan of Red Gate's tools, and in particular SQL Backup, which makes backing up SQL Server databases much easier and compresses them down to almost nothing.  I've been manually backing up my one server that isn't hosted with ORCS Web (who take care of such things for me quite well for the servers there) for way too long.  And it has only been backed up to a separate drive in the same box, so there wasn't any offsite backup happening.  Circumstances finally conspired to drive me to prioritize getting off-site backups set up. You see, not long ago … more

  • Getting Started with TDD

    Recently DannyT wrote on the altdotnet list: On our next project I really want to nail unit testing and possibly even test driven development. My issue however is none of our team has any experience of either so we will be starting totally green. ... My question however is, with a goal of wanting to adopt TDD eventually, are we better off starting this next project by writing some unit tests and getting a feel for it and leaving TDD til next time or would it be more advantageous to go balls out and try and hit the ground running with TDD? I think this is a pretty common question, and I answered it on the list with what I hope was a useful response, but I want to reiterate and elaborate on … more

  • Word 2007 Search Commands

    I recently complained on Twitter that the UI in Office 2007 (and specifically Word in this case) makes it incredibly difficult to find many of the things that I knew how to find in Word 2003/2000/XP/97/Every. Other. Version.  This is understandably frustrating and I don't really see the Ribbon UI as a quantum leap forward in UI design.  I do think it's nice, in many ways, and does make it easier to find the common elements, but at the expense of making it darn near impossible to find a lot of the less-often-used commands. Jon Galloway was quick to give me a helpful answer to my plight.  Office Search Commands, from Microsoft Office Labs, is a plugin for Office 2007 that … more

  • How I Got Started in Software Development

    Keyvan tagged me for the latest meme (started by Michael Eaton) going round the developer blogger space.  I'm not sure how much people actually care to read about these things, so I'll oblige but will attempt to keep it brief, and if you want more like this, check out my Five Things You Didn't Know About Me post from early 2007 (wow, time flies). How old were you when you started programming? In fourth grade (age 10 or so) one of my classrooms had a Commodore VIC-20 that I remember writing graphics on (ASCII art) and password-protected "club" programs (you needed a password to get in to the main menu, which then let you participate in the "club" but really beyond the password part I … more

  • Blog Roll

    I want to update my blog reading habits and make sure there aren't really great bloggers out there of whom I'm unaware (I'm sure there are plenty).  If you'd like to help out, please email me with your top 3 bloggers whom you actually read on a regular basis.  Please *leave out* the really big and obvious names like ScottGu, Jeff Atwood, ScottHa, and Phil Haack.  I'm already subscribed :). You're also welcome to comment here but I'll have an easier time collating the results from email. more

  • Ann Arbor Give Camp

    The Ann Arbor Give Camp is happening this weekend.  I think this is really cool, and I'm bummed that other plans have prevented my being able to participate directly.  That said, I would like to personally thank all of the developers who are participating.  I think it's really cool and I hope you have a lot of fun this weekend.  Even though it's in Ann Arbor, Michelle (we're both buckeyes) is seriously thinking about trying to do something similar in the Northeast Ohio area perhaps next year.  Thanks also to all of the sponsors, many of whom I've worked with.  It's great to see such a diverse group come together for a good cause (actually, a bunch of good … more

  • Show Similar Posts in Graffiti

    I couldn't find this with Google Live Search but ScottW hooked me up.  If you want to show related or similar posts in your posts in Graffiti, just add this script to your post.view file (which, amazingly enough, you can do via the admin tool without FTPing any files to your blog - how cool is that?). #set($similarPosts = $data.SimilarSearch($post.Id,3)) #foreach($sp in $similarPosts) #beforeall<h3>Similar Posts</h3><ol id="similarPosts" class="list"> #each<li><a href="$sp.Url">$sp.Title</a></li> #afterall</ol>#end   In theory, at the bottom of this post, you now see a Similar Posts section...  I'm not 100% sure … more

  • Velocity CTP1 Install

    Finally have a few minutes to play with Velocity, Microsoft's new distributed cache offering that's currently in CTP1 status (since a month ago at TechEd Developers in Orlando).  Read the official announcement here.  The installation immediately asks you to configure your machine as a Cache Host: To proceed, create a shared folder that grants Everyone Read and Write permissions (per the README this will be addressed in a future release). When complete: Note that the Cluster Name must be a single word, no spaces or special characters. YES! Now that that's over with, we can start doing stuff with the cache using its console-style Administration Tool.  Here are a few … more

  • Run Tests By Project With MSTest

    An annoyance I used to have with unit testing in Visual Studio is that it was often difficult to limit the number of tests I wanted to run.  In VS 2008 there are some improvements here, and the nicest one is the ability to right-click in a test and select Run Tests and have it run that unit test (or do so in a test class, and it will run all the tests in the class).  However, go over to the solution explorer and right click on a test project, and you won't find any Run Tests link there.  And trying Run Tests in a file but outside of a test class will kick off every test in the solution.  Sometimes that's what you want, but sometimes you just want to run the tests in one … more

  • Testing Around ASP.NET Cache Features

    It's still quite painful to try and test code that relies on ASP.NET Caching.  Now, I love caching.  Ask anybody.  But testing around it can pretty much suck.  The biggest source of pain for me at the moment is the SqlCacheDependency, which is freaking awesome in terms of functionality but freaking annoying in terms of testing around it.  I have integration tests that, for some reason, occasionally fail claiming that "table X is not configured for SQL Cache dependency."  This, despite a SQL script that runs before every test and ensures that yes, in fact, those tables are configured.  But even leaving integration tests out of the picture, unit testing … more

  • Getting RSS Right

    Just made some updates to the aggregate RSS feed on DevMavens.com so that it's more correct.  We weren't displaying the author correctly before (and we're still not complying with the RFC that wants <author /> to contain an email address, but I see no reason to increase the spam these folks get as it is).  I also noticed that our dates weren't formatted correctly, though I had thought originally they were.  Here's the code we had: <pubDate><%= rssItem.DatePublished.ToUniversalTime() %></pubDate> Can you spot the problem? Turns out that even after converting to UniversalTime you still need to format it correctly, which in this case means using  the … more

  • Show Page Load Time

    When testing performance for an individual ASP.NET page, it's often useful to be able to see how long the page took to render.  The bar-none easiest way to achieve this is to simply add Trace="true" to the <%@ Page %> directive, which will yield results like this: However, often times this won't play nicely with CSS on the page, so you can achieve similar results on a separate URL by adding <trace enabled="true" pageOutput="false" /> to your web.config's <system.web /> section.  Then, simply navigate to your web application folder path and add /trace.axd to the request and you'll be able to choose from a list of requests. In addition to the timings, the trace … more

  • Visual Studio Break When Exception Thrown

    By default, Visual Studio will only break when an exception is unhandled in user code.  This is often some distance from where the actual exception took place, as several try...catch blocks might have been involved in the meantime before the exception goes unhandled.  A recent thread on the ALT.NET mailing list discussed some techniques for getting round this issue if you the developer would really like to see exactly the line of code that is failing.  One such technique (Jon Davis) used precompilation directives to conditionally add the try-catch statements, like so: void MyMethod(){#if !DEBUG try {#endif // the … more

  • Unit Testing Time

    Oren has a post showing how he deals with time sensitive code in his unit tests.  One thing that's interesting is that, like my previous post, deals with the System.Func<T> construct introduced in .NET 3.5.  I see this convention more and more and it's really growing on me.  I've dealt with timing issues in my own code using a convention similar to the one Ayende demonstrates, which is to create a singleton or static property for the system time, and consistently reference this time everywhere rather than DateTime.Now().  References to DateTime.Now() are dependencies that should be abstracted away through some form of Dependency Injection or similar technique.  … more

  • Cache Access Pattern Revised

    Karl Seguin has an interesting post about using System.Func to fight repetitive code blocks, which actually addresses a pain point I've had for quite some time but had never acted on to fix.  Whenever one access the Cache or a similar statebag that might or might not contain the value sought after, it is important to check if the value exists first, and if it doesn't, go and retrieve it from wherever its authoritative repository is (typically the database).  This can be done poorly, so I show the correct way to do it frequently in my talks about caching or performance.  The unfortunate thing about this pattern, however, is that you're always stuck writing the same code, which … more

  • Mavens in the Developer Community

    Since launching DevMavens this week, I've had a few folks tell me they didn't previously know what a maven was.  The site shows some definitions, but the concept that led to my choosing that name is from the excellent book, The Tipping Point: The Tipping Point: How Little Things Can Make a Big Difference Mavens are one of the key players that Gladwell describes in this book about the way ideas are spread and certain products catch on.  Wikipedia has a summary of some of the book's ideas, one of which is The Law of the Few, which specifies three kinds of people important to the social success of an idea: Connectors, Mavens, and Salesmen.  Mavens are "information … more

  • DDD Quickly

    I picked up the print version of Domain Driven Design Quickly on Amazon recently.  I didn't realize at the time that it was also available as a free e-book, which wouldn't have stopped me from buying except for the fact that it's less than 100 pages and $30!  That's a bit pricey, in my opinion, for what is essentially Cliff Notes of a larger, more in-depth book (at least, that's what I'm lead to believe).  I'm about halfway through the book and while the content is good, the number of grammar errors and obvious omissions is pretty bad.  Like, enough that you notice and are sometimes confused by it.  You'd think that with only 95 pages a copy editor could have done a … more

  • Search Stored Procedures

    Sometimes, especially on very old applications that have gone through several rewrites but are still using the original database, I find myself wondering which stored procedures reference a given table, or each other, or whether changing the name of a view or column name will break something somewhere in the database.  There are some tools out there to help this kind of thing, such as Red Gate's Refactor tool, but at a simpler level if you just need to search your stored procedures for a particular string, you can do it using this query that I just saw come across the Sql Server SQL list on SQL Advice: SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE … more

  • IsNull Extension Method

    I'm strongly considering adopting the use of an IsNull extension method in my .NET 3.5 coding projects.  A quick search to see what others have to say about this revealed a new web site dedicated to extension methods, which includes this IsNull method ready to go: public static bool IsNull(this object source) { return source == null; } The String class supports the IsNullOrEmpty() method now, but you have to pass it your instance yourself.  This is another good candidate for Extension Method treatment.  Brad Wilson posted about this earlier this year, and received some good comments, none of which seem to indicate that these are evil or icky. From the … more

  • Setting up Windows Live Writer With Graffiti

    So now I've set up Windows Live Writer to point to my new Graffiti blog.  The docs were true to the task and it was pretty painless.  Assuming this post goes through, everything worked on the first try.  Theoretically it will even have a custom URL of graffiti-windows-live-writer. Related Links: http://graffiticms.com/support/advanced-options/windows-live-writer-application/ http://graffiticms.com/support/advanced-options/configuring-windows-live-writer/ more

  • Announcing DevMavens

    This month marks the launch of a new site we’ve been working on to help recognize and support a number of influential bloggers in the .NET developer community.  Please help me welcome the initial members of the DevMavens!  These bloggers have been invited to be a part of this small but hopefully growing group based on their influence in the community, and the DevMavens site has been set up (using ASP.NET MVC, no less) specifically to provide a portal to reach these influentials.  It aggregates and displays their most recent blog and twitter entries, and will hopefully provide a useful, easily accessible view of these influentials for the community. We’re very … more

  • Blog Move

    Please join me as I move my blog to my own URL, SteveSmithBlog.com.  I'll continue to post there about more or less the same things I did here, but with a bit more control over the site layout and other features.  The new blog is running on Telligent's new Graffiti CMS, which really is as easy to get up and running as they claim.  The look is currently a stock template, but should be updated to be a bit more unique in the next few days.  If you're already subscribed to my feed, then you'll continue to get updates as my RSS will be updated (though I've followed ScottW's advice and set up a CNAME for my Feedburner feeds - they now go through … more

  • About Steve

    Hi, I'm Steve Smith.  I go by Ardalis online because, well, you'd understand if your name was Steve Smith.

    This is now the fifth place I've had a blog, if you don't count my initial home page and articles on ASPAlliance.com, which were somewhat blog-like but preceded the term.  Unlike my past blog moves (from the ASP.NET/blogs site to AspAdvice.com/blogs and my ArmySteve.com / ArmyAdvice.com/blogs/ArmySteve blogs, and then from there to SteveSmithBlog.com), this time I'm pulling everything into one place.  So far I only have the most recent stuff here, but soon you should see content dating back to 10 years ago, all in one easy to find location.

    If you're here, you've found … more

  • Contact Steve

    I'm easy to find online. http://friendfeed.com/ssmith http://twitter.com/ardalis Feel free to send me an email directly.  For technical questions, I prefer things go to the mailing lists or forums on AspAdvice.com. more

  • New Blog Home

    I'm updating my blog's home and moving to Graffiti and my own domain, SteveSmithBlog.com.  I'm hoping that I'll be able to be a bit better about blogging as well, as my total volume of posts has dropped off of late (10 in June, 9 in May, 16 in April for a total of 35 for the quarter - compared to 52 in Q1).  Anyway, this is mainly a test post so we'll keep it short. more