This Blog is Moving

Hello readers, the time has come for me to move my blog to my own server and some nice new Graffiti CMS software.  Anyone reading this feed either in the direct RSS feed or the old FeedBurner one, please change to the new one:

http://feeds.feedburner.com/AccidentalTechnologist

The old site will remain up but all the content is on the shiny new web site.  So please head on over.  See you there.

Advertisement

Great Conversation with Chris Tavares about Microsoft Unity

I had a really great conversation recently with Chris Tavares, the lead developer of the Unity Application Block for Microsoft.  The chat was for my weekly article on InfoQ.  Please check it out. patternspractices

Some information on Unity to get going:

There are certainly a good number of Dependency Injection contains for .NET which have either been around for a long time or have sprung up recently.  I am planning a post covering them in a bit of detail for those interested in learning about DI containers or understanding what is available.

Finally Ordered a New Office Chair

I have been using the same Staples special office task chair for the last 8 years, yes 8 years.  It has served me very well but the cloth was starting to wear out heavily on the seat and it was time to get something new.aeron

I considered many options as my analytical mind does and contemplated long and hard.  The decision was influenced from many factors including:

  • Cost – I am, let’s say..frugal and I didn’t want to spend too much.  I learned from looking at the chairs that cost was so subjective and it was not easy to make good comparisons.  There really were three general categories of chairs.
    • $50-$200 – These were mainly sold at Staples and this is the category I picked last time.  They seem mostly very consumer-oriented and sold simply based on cost.  I had one of these at one of my jobs and it did not last.
    • $200-$400 – This category was the hardest to really determine the value of the chair, most were names I had not heard of and was hard to distinguish between the low-end and these.  The only real difference I could see was the price.
    • $400-$1200 – This is the chair for someone really trying to find a long-lasting and good chair.  This is where Herman-Miller, Steelcase, Humanscale and others fall into.
  • Comfort – I tried out a lot of chairs and the low-end today felt very low-end.  The others had so many adjustments it was hard not to find a comfort zone.
  • Durability – I really wanted a chair which will last a long time and not be falling apart 6 months from now.
  • Brand – Brand is often an important factor, beyond recognition, brand is a great way to pick a chair on reputation alone.
  • Psychological Benefits – If I buy a great chair I will write better code and more interesting articles, right?
  • Adjustability – This goes in line with comfort but is important to have adjustable everything, arms, back, height, etc.

I spent about 4 weeks on and off trying to determine the best path to go down.  In the end, it came down to getting what you pay for, so I had to bump my budget up a bit.

I am not an office chair expert and frankly, I don’t want to be.  My new chair is the Herman Miller Aeron purchased from Sit4less.com, they had great customer service and great prices, free shipping and a month to use the chair and decide if it’s right for me. 

Technorati Tags: ,

Ruby on Rails and IIS7 Playing Nicely Together

Ruby on Rails has been around for a few years now and has become a hugely popular web development framework, but not on Windows and Internet Information Server (IIS).  Rails has run on Linux and Max OSX almost exclusively, until recently. 

The Ruby on Rails Wiki has a very good article on setting up Ruby on Rails using IIS7.

Enter FastCGI

FastCGI is the key to getting Rails running in IIS.  The FastCGI web site describes FastCGI as:

FastCGI  is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. See the docs for more details.

Dave Scruggs has a nice short tutorial about his experience getting Rails running on Windows Visata SP1 and IIS 7 with FastCGI.  One of the really nice features of Vista SP1 is that it includes FastCGI built-in. 

In the event you are running IIS7 without FastCGI built in, Dave points out a good tutorial from Carlos Caneja called Install FAST CGI on IIS7.

FastCGI is used to serve applications on IIS7 for languages such as:

  • Ruby
  • Python
  • PHP
  • and others….

What about IIS6?

Most of the recent resources on the web I have seen show FastCGI applications running on IIS7, mainly because it is built-into Vista SP1 and that avoids some configuration difficulties but IIS6 does has FastCGI support for it.  I have not personally attempted it but I may in the future.   The IIS.NET site has some information about using FastCGI on IIS6.

It seems the primary support for FastCGI from Microsoft is on IIS7 but not everyone may be at the point where their web servers are running IIS7 just yet. 

Personal Setup

The tutorials given here are very good and work really well with Vista.  I have a VMWare VM setup on my MacBook Pro running Vista SP1, the setup was flawless.  I have an advantage of many years of IIS experience with a couple years of Ruby on Rails experience, which I think does help.

I would like to see some performance numbers of running Rails or any FastCGI hosted application under IIS.  I am not aware of any but would like to hear back from someone putting IIS and FastCGI through it paces.

Technorati Tags: ,,,

Laptop Screaming Fan Syndrome

crazyman.jpg

My current laptop I use most of the day either in my home office or on the road is a Dell Latitude D820. I have had it about a year and half with the exception of the last month or so I have been very happy with it.

The last month the fan has been getting louder and louder to the point I almost bought a new Lenovo Thinkpad T61 but it sounded a bit irrational, clear evidence of how crazy it has been making me. The fan is running at maximum speed most of time and almost screaming.  I was at one of my clients this week and people even commented how loud it was and asking if that annoying sound was my laptop.  Embarrassingly enough, I had to admit that it certain was my laptop.

I started searching the Internet a bit and found others who had the same problem in both the same and different Latitude models.  I also decided to check out the Dell Support Site to see if any problems like this had been reported.  It turns out there is a new BIOS version, A07, which addressed the problem because the quiet mode of the laptop could not be set correctly.  Unfortunately, I already had version A07 of the BIOS installed.

D820

There were a few forum posts I came across that shed some light on the solution; cleaning the fan.  It had never dawned on me that this would be a problem.  One bit of information was on Devshed and made me think a bit about how and where I use my laptop.

My work environment is either the home office or a client and it’s never dusty.   I figured it was worth a shot to clean the fan.  I grabbed my trusty can of compressed air and, while the system was still running, blew the air into as many different angles as I could.  I was surprised to see the amount of dust coming out of the fan.

Once I was done the fan took about 2 minutes to slow down and become extremely quiet.  I would never have guessed the solution would be so simple.  One gentleman takes his D600 apart once every 6 months and cleans the fan and heat sink.

I think I will have to start making this as part of my system maintenance routine to keep my fan quiet and my clients happy.

Technorati Tags: ,,,

Reblogging – Enemy of the Blogger and Writer

I have been a .NET and Ruby editor for InfoQ since the end of the Summer of 2007, so about 7 months now and have been having a great time.  I have learned a lot about the web publishing industry and about aspects of technology I may not have otherwise been exposed to.  I am grateful to Floyd at InfoQ for the opportunity.rss_icon

Much of my writing comes from the 200 or so blogs I subscribe to and browse on a daily basis.  I say “browse” because I just don’t have time to read them all.  I look for interesting things and often create a news item for InfoQ and publish it for our readers to read, which they may or may not see if they didn’t otherwise read it on InfoQ.

Background

I wrote two news items over the past couple months which has raised a bit of controversy

The news items I wrote was just what it sounds like, a bit of news.  The posts included text from each of the original posts a some commentary explaining about bit more about the technique involved.  I gave full credit to both authors and linked backed to their respective blogs.

Controversy

A few days ago I was alerted to a post on Mike Duncan’s blog titled – How YOUR tech blog posts are RIPPED OFF while you sleep!.  Yikes!!  This post was talking about my news item on InfoQ.   I won’t go into the details of Mike’s post but it is worth reading and understanding his perspective.  The comments are also pretty good too, with two sides of the fence both downing InfoQ and others supporting them. 

I was pretty speechless at first and then couldn’t understand what the problem was, since I didn’t blindly copy Mike’s content and claim it my own.  Mike’s point of view is pretty clear..I plagiarized his hard work.  I certainly didn’t but I had to try to understand his viewpoint.

I am a frequent user of Twitter to chat with friends and associates, as well as keeping up on technology.  I was reading THE SAME NIGHT as I read Mike’s post when there was a Tweet from Scott Hanselman about a copied article on another web site.  I clicked the link and sure enough, it was my news item on InfoQ based on Scott’s post.  I was feeling pretty low at this point and wondered what the heck I had been doing so wrong.

I had been in contact with Scott in the past for various things and decided to send him an email about my InfoQ item.  It didn’t take long for a reply and sure enough, Scott was not really pleased with my work.  I am a bit slow sometimes and it took a few back and forth emails before I finally got the problems for Scott.  One issue was when searching on Google for LINQ and NOLOCK, my InfoQ item came up first, before Scott (the original work).

Needless to say, these two issues were a shock to me and I was very sad to hear it since plagiarism is not part of what I do.

Reblogging

There appears to be a term for the style of writing I did on these two posts, Reblogging.  I don’t know if I agree with the label 100%, since I didn’t copy and paste and call the work my own, but I get the idea.  It is probably a fine line for the two authors effected.

I blog as much as I can and try to get decent content.  I know based on the number of hits for various posts which content is good and which is not.  If one of my posts was reblogged like I did on InfoQ, I would be flattered.  I don’t have the same issues at these guys but maybe I will as I put more time into my posts.

I think summing up what bloggers find acceptable and what they don’t is pretty simple (hindsight):

  • Don’t – use a person’s blog post as the single source of another post or article
  • Don’t – make title so close to the original author’s.
  • Do – reference a post as part of a post which covers more information and references OTHER blog posts.keyboard_controls_writing_238875_l

Lessons Learned

It has been an interesting week and some great lessons learned.  I am thankful for Scott Hanselman who spent the time to explain his point-of-view and made me realize the importance of his writing.   Mike Duncan made some very good points that shows his passion for what he has written.

I will not be writing anymore single-source InfoQ news items without proper and up-front credit to the author.

I think I will also value my blog writing more too and will be writing more thought-out content too.

Technorati Tags: , , ,

Great find – The Thirsty Developer Podcast

I have to admit, I have a problem.   I am addicted to podcasts and I listen to them all, either on a commute to a client or while working.  I stumbled across a new one (to me) recently and I wanted to share it with my readers. ThirstyDeveloper_small

It’s called The Thirsty Developer and it covers development from a fairly platform agnostic view.  Recent shows cover topics such as:

  • Scrum
  • Collaboration between Developers and Designers
  • Continuous Integration
  • Globalization and Localization

They do cover such specific topics such as:

  • Silverlight 2
  • IIS

As I write this there are 16 episodes and just need to check out the podcast feed to see all the episode details.    The sound quality on many podcasts, especially new ones varies a lot but they seem to have gotten it right.  The sound quality is excellent and the conversations good too.

Technorati Tags: , ,

ASP.NET MVC Source Code Now Available – ScottGu’s Blog

As an fan of all things MVC, today’s news of the release of the ASP.NET MVC Source Code was really good news.  I think it shows Microsoft’s continued steps toward being open source. 

Scott Guthrie was the one breaking the news and he has some details on his blog to check out.  The source was released as part of a CodePlex project and can be found as part of the ASP.NET CodePlex project, where the source can be found and downloaded.

Scott Hanselman also has a great post about his thoughts on the ASP.NET MVC source code and goes into some detail in The Weekly Source Code.  It’s really nice to see Scott spend the time pointing us to various areas of the source code.  It’s good stuff and worth the read.

In case you missed one of Scott’s earlier examination of the ASP.NET MVC Source you should also check it out.

Fixing the Toolbox in Visual Studio 2005

I have had the extreme pleasure of working with Microsoft SQL Server 2005 Reporting Services lately (notice the extreme sarcasm in my tone).  I am working on a project for a large client and one part of the project requires I enhance a report to support multiple languages.   This post is not about localization but a rather strange issue I faced today.

I opened up my project in Visual Studio and proceed to open the report I needed to analyze for changes and decided to look at the controls at my disposal to help enhance the report and was greeted by this set of controls:

ReportingServicesToolBoxBefore

Interesting, all the controls are just Textbox.  Obviously this isn’t right and I had to do a bit of searching around the net for a few things to try.  The first suggestion I found was to right click the Toolbox and select Reset ToolBox….this had no effect.  Several suggestions didn’t seem right but I finally tried one which worked.  It involved a few steps:

  1. Shutdown Visual Studio
  2. Locate the directory – C:\Documents and Settings\<user name>\Local Settings\Application Data\Microsoft\VisualStudio\8.0
  3. Delete all files named Toolbox.* (there were 4 of them)
  4. Restart Visual Studio

The directory listing where the Toolbox files live looked like this:

VisualStudioToolBox

When Visual Studio restarts it will recreate the Toolbox files based on what is installed on the system.  After restarting Visual Studio my Toolbox looked like this when editing a report:

ReportingServicesToolBoxAfter

The steps are pretty trivial when you know what they are but finding the solution took a bit of spelunking but it worked like a charm.  I don’t know what actually caused this to happen but I don’t have the time to find out why.  If someone has the reason I would love to know why.

ASP.NET MVC Framework Preview 2 – Changes for the Better

The team providing us with the ASP.NET MVC Framework made available the 2nd preview release during the MIX08 Conference March 5-7, 2008 in Las Vegas, NV.  This release has many great changes as they team works toward an RTM maybe later in the year, but no promises were made.

I just wanted to point out some of the bigger changes in the Preview 2 release.

The ASP.NET MVC Framework can be deployed in the \bin directory of an app and work in partial trust

One of the pain-points in the current CTP of the ASP.NET MVC Framework is the framework is installed with a setup program to register it in the Global Assembly Cache (GAC), this is fine for local installations on development machines but not good when need to deploy to other systems.  Microsoft is fixing this:

Starting with this upcoming preview release we will enable applications to instead directly reference the System.Web.Mvc.dll assembly from the application’s \bin directory.  This means that no setup programs need to be run on a sever to use the ASP.NET MVC Framework – you can instead just copy your application onto a remote ASP.NET server and have it run (no registration or extra configuration steps required).

Requiring  System.Web.Mvc.dll to be in the GAC also made it unlikely to be able to use the MVC framework with shared hosting providers, the new CTP will also fix this potential problem as well:

We are also doing work to enable the ASP.NET MVC framework to run in “partial/medium trust” hosting scenarios.  This will enable you to use it with low-cost shared hosting accounts – without requiring the hosting provider to-do anything to enable it (just FTP your application up and and it will be good to run – they don’t need to install anything).

It’s unlikely anyone would have faced these issues yet, since the MVC is so new, but good to know it was thought out in advance.

Significantly enhanced routing features and infrastructure

URL routing is one of the most powerful features of the MVC framework, letting developers have infinite control over the structure of the URL’s in their applications. 

This upcoming ASP.NET MVC preview release contains even more URL routing features and enhancements.  You can now use named routes (enabling explicit referencing of route rules), use flexible routing wildcard rules (enabling custom CMS based urls), and derive and declare custom route rules (enabling scenarios like REST resources mappings, etc).

We have also factored out the URL routing infrastructure from the rest of the MVC framework with this preview, which enables us to use it for other non-MVC features in ASP.NET (including ASP.NET Dynamic Data and ASP.NET Web Forms).

Improved VS 2008 Tool Support

The initial release of the MVC framework shipped with some useful but simple templates for web projects but improvements are coming:

This upcoming ASP.NET MVC preview release will ship with improved VS 2008 integration.  This includes better project item templates, automatic project default settings, etc.  We are also adding a built-in “Test Framework” wizard that will automatically run when you create a new ASP.NET MVC Project via the File->New Project dialog.  This will enable you to easily name and wire-up a unit test project for your ASP.NET MVC application.

The Test Framework wizard will allow the developer to choose from a list of available unit testing frameworks but is pluggable to allow for additional testing frameworks to be added.

[ControllerAction] Attribute No Longer Required on Controller Action Methods

The first MVC framework required developers to use the [ControllerAction] attribute to distinguish action methods on a controller in order for it to be callable from an application.  Due to developer feedback the new release will do away with this requirement and make all public methods defined on a controller to be action methods and therefore callable.

There will be attributes available to use to make a public method a non-action method.

New Filter Attribute Support for Controllers and Action Methods

A new feature being added to the release are Filter Attributes.  Basically, these attributes are actions a developer may want to execute either before or after a controller or its action executes.

These enable you to inject code interceptors into the request of a MVC controller that can execute before and after a Controller or its Action methods execute.  This capability enables some nice encapsulation scenarios where you can package-up and re-use functionality in a clean declarative way.

HTML Helpers Built-in

Helper methods were limited in the first release of the framework, where a separate download was made available which included a bunch of HTML helper methods.  The new release will have all of the optional helper methods built-in.  Future framework updates will include ASP.NET AJAX support:

Next month we are also going to start to talk about some of the new enhancements to the client-side ASP.NET AJAX libraries we are making, as well as some of the AJAX helper methods we will build to enable it to easily integrate with ASP.NET MVC.

These were the HTML helper methods developed by Rob Conery.

Lots of Refactoring and Design Improvements

As with any public CTP of a product, the idea is to iterate and evolve the product into something people will use.  The team is making design improvements to the existing code base to allow for better extensibility.

In general the team has followed a philosophy where for all features you have three options:

  1. Use the built-in features/implementations “as-is” out of the box
  2. Slightly customize the built-in features/implementations without having to write much code
  3. Completely swap out the built-in features/implementations for custom ones

For example: you can now override the ViewEngine locator logic without having to override the ViewEngine execution logic (and vice-versa) – or alternatively swap out ViewEngines entirely.  The Controller Factory support has been extended to make it even easier to integrated with dependency injection frameworks.  Route rules are now fully extensible.  Controllers are more easily testable, etc.

This type of flexibility gives developers choices, not forcing them into doing things a certain way which can help improve the ability for developers to more quickly adopt the framework.

Downloadable ASP.NET MVC Framework Source that can be Built and Patched

Following the lead of downloadable .NET Framework source code, the team will be making the source code for the MVC framework available with the same methods.

Starting with this next preview, we are also going to make the ASP.NET MVC Framework source code downloadable as a buildable VS project solution.  This will enable you to easily view and debug the ASP.NET MVC Framework source code.  We are also going to include a license that permits you to optionally make patches to the ASP.NET MVC Framework source code in the event that you run into a bug in an application you are developing with it.

The license won’t enable you to redistribute your patched version of ASP.NET MVC (we want to avoid having multiple incompatible ASP.NET MVC versions floating around and colliding with each other).  But it will enable developers who want to get started building ASP.NET MVC applications immediately to make progress – and not have to worry about getting blocked by an interim bug that they can’t work around.

Screencasts Showing-off Features

Scott Hanselman has put out some great screencasts to show off how the ASP.NET MVC works in its current iteration.  At the time I write this there are 4 screencasts available showing increased complexity while working on the same sample code base.

Also available is Scott’s session at MIX08

Developing ASP.NET Applications Using the Model View Controller Pattern

I have taken the time to work with this Preview 2 of the ASP.NET MVC Framework and developed some simple applications, which worked wonderful.  My experience with Ruby on Rails really helps in understanding this framework.  Comparing the first CTP to this one is really a night and day difference, in my opinion.  I am looking forward to future releases and building real applications this way on .NET.