Random Data Generator

Posted by Seth on December 1st, 2006

Just stumbled across an interesting .NET library for randomly generating data.  Useful for building large datasets for load testing.  Check it out at http://www.codeplex.com/datagenerator.

Related posts

appSettings, type-safety and default values — all in 5 minute’s work

Posted by Seth on October 27th, 2006

I recently wanted to have a method I could call to get a type-safe AppSetting, with an optional default value if the AppSetting wasn’t set. In C# 2.0, I came up with this:
public static T GetSetting<T>(string name, T defaultValue)
{
string input = ConfigurationManager.AppSettings[name];
if (input != null)
{
return (T)Convert.ChangeType(input, typeof(T));
}
else
{
return defaultValue;
}
}

Related posts

Using Enums to drive DropDownLists

Posted by Seth on October 1st, 2006

Mark came up with an idea to use Enums to drive lookups. I told him I could go one better by providing user-friendly names instead of programmer-friendly enum value names. The idea is to loop through the literal fields of the enum type and check for a DescriptionAttribute on each field. Anyway, here’s the source, with caching for top performance.

Related posts

Free REST Web Services eBook

Posted by Seth on April 23rd, 2006

Apress have released a free downloadable PDF eBook on REST Web Services: Google, Amazon, and Beyond: Creating and Consuming Web Services. Its an interesting read if you’re into RESTful Web Services. The only downside (for me atleast) is that the book has a very heavy Java bend. Would have been nice to see a bit more of a balanced view.

Related posts

IIS7 Features and APIs

Posted by Seth on April 21st, 2006

Scott Guthrie writes about some cool new IIS7 features and APIs:

  1. The ability to now have HttpModules and HttpHandlers participate in all requests to a server.
  2. Integration of the ASP.NET configuration system with IIS. IIS now uses the same web.config configuration model as ASP.NET, which means you can have both ASP.NET and IIS configuration settings in the same file together.
  3. An integrated Admin UI tool that manages both IIS and ASP.NET settings together.
  4. Much better request auditing and error debugging.
  5. Much better configuration APIs and command-line tools.

#5 especially is great. Finally, we can build some rich programs to administer IIS and web applications without having to resort to ADSI or WMI..yuck!).

#1 will also be interesting in relation to url rewriting. This would mean that you wouldn’t have to use wildcard mapping to send every request to ASP.NET.

Related posts

New UrlRewriter .NET release

Posted by Seth on April 8th, 2006

A few new features added to the open source url rewriter, including:

  • Logging support (you can add adapters for log4net, etc)
  • The rewriter now adds the original and final querystring as Items in the HttpContext. To access, you would use:
    RewriterHttpModule.OriginalQueryString
    RewriterHttpModule.QueryString
  • FIXED: Added checking for too many restarts
  • FIXED: Case sensitivity in pattern matching

Download UrlRewriter.NET 1.6 here.

Related posts

Building Your Own Start-up Technology Company

Posted by Seth on March 14th, 2006

No, I’m not going to proffer any sage advice because I’m still banging away trying to do this myself, but Dirk Knemeyer at Digital Web has a great article with some insights for budding tech entrepreneurs, including “Five Steps Before Making the Leap”:

  1. Test the business viability of what you want to do
  2. Decide whether you want to run your company solo, or enlist the help of business partners
  3. Set and articulate a vision
  4. Create a powerful identity
  5. If you are creating a services firm, try to start with clients you already have

Sound advice for any business, really, not specifically a Web 2.0 startup.

Related posts

Installing Subversion the Easy Way

Posted by Seth on March 14th, 2006

I installed Subversion tonight. Took about five minutes and I was up and running with all the latest and greatest. I used the Subversion 1-Click Setup at Tigris. It installs Subversion as a service, TortoiseSVN and all the command-line utilities.

The Subversion Book is surprising well written for open-source documentation and provides a good Subversion for CVS Users guide.
Another great resource is James Higg’s blog. Drop by his blog if you need some pointers to more information.

Related posts

UrlRewriter.NET is now open source

Posted by Seth on March 13th, 2006

I’ve decided to release the UrlRewriter.NET product for free now, and make it open source. Hopefully with it being free and open source, it will receive the coverage it deserves.

Related posts

Custom configuration using TestDriven.NET

Posted by Seth on March 11th, 2006

The TestDriven.NET tool is fantastic. I love the agility it gives you, as you can quickly build your unit tests, write your code and at a right-click, you can run your unit tests from Visual Studio.

One of the problems it currently has (I notice somebody has asked for this in their wishlist) is custom configuration. If the code you’re testing requires settings that would normally be in your web.config or App.config file, you have to ensure these settings are in a file called <your-assembly-name>.dll.config in your bin\Debug directory. A bit inconvenient. NUnit allows you to have a .config file in the root of your project with the same name as your project (e.g., Foo.Bar.config), so why should you do without this feature in Visual Studio?
Well, until the author adds this enhancement (hopefully soon), one workaround I’ve come across for this is to create a Post-Build event in Visual Studio.NET, which copies the config file from the root of your project to the required place in your bin directory.

To set this up, right-click Properties on your Project in Visual Studio.NET. Under Common Properties, click on Build Events. In the Post-build Event Command Line property, add the following: copy $(ProjectDir)$(ProjectName).config $(TargetPath).config

Then, whenever you have a successful build, your latest config changes will be available to TestDriven.NET’s in-built TestRunner.

Related posts


Copyright © 2008 Seth Yates. All rights reserved.