Why Hitler Really Lost World War II

I thought I would ease out of my two month blogging black-out by helping to promote a humorous YouTube gem that I found through Max’s blog.

A while ago I’ve blogged about my admiration for the emerging creative RWness that mediums like YouTube help foster, but adding subtitles to a foreign film as a form of remix humor is particularly brilliant.

I especially appreciated the build humor since I was banging my head against a nasty build failure involving version incompatibilities between MbUnit and NCover when I took a break to watch it.

Enjoy.

Here’s the link if you can’t see the embedded player.

No related posts.

Oh, so THAT’s why SSL is the default for SVN…

It appears as though I made a rather bone-headed mistake when configuring Subversion at work a few weeks ago.

Since we were not exposing our SVN server externally and decided that sending our code files in plain text across our internal network did not represent a significant security risk, we opted to not use SSL as a way to optimize performance.

I’m not sure why I assumed that the actual credentials would be encrypted even though I knew the content would not be.

Perhaps it was because we were using windows authentication security scheme in SVN. Maybe it was because I actually opened up the svn.simple file in the Subversion app data cache on my local machine and saw that my TortoiseSVN credentials were saved in an encrypted form on disk when using the ‘save credentials’ checkbox.

Whatever the reason, it was a very bad assumption.

Here is a screen shot from WireShark, my favorite packet sniffer. The blurred out part under authentication was my windows password in clear text. Oops…

packetsniffercredentials

Luckily, it was an easy matter to correct.

On the server-side, I simply had to check a box on the property tab of Visual SVN to turn SSL back on. On the client side, I had to have everyone run an svn switch command with the –relocate option to change their working directories to use the new url.

So what was the lesson learned?

Next time I make a mistake like this, I will use WireShark to gather all of the passwords of my fellow developers before I switch to the more secure option. Dumb…dumb…dumb…

Related posts:

The 10 Second Visual Studio Makeover

I blame it on being forced to sit through one too many episodes of my wife’s favorite TV show, What Not To Wear, but I finally became inspired to retire my old, tired-looking default Visual Studio color scheme in favor of one of the hipper ones with a black background.

It turned out to be much easier than I thought since several bloggers already went to the trouble of exporting and publishing their favorite Visual Studio settings files, which you can import by simply selecting the ‘Import and Export Settings’ menu option under the Tools menu.

My favorites are the ones that try to mimic the Vibrant Ink theme from TextMate, the popular Rails IDE for the Mac. Rob Connery posted a nice version, but I finally settled on the one published by John Lam here.

Here’s a screen shot of me perusing CodeCampServer, the most excellent sample app for the upcoming ASP.NET MVC in Action book from Manning and that’s being written by Jeffrey Palermo, Ben Scheirman, and Jimmy Bogard.

vs-theme-screenshot

Mostly I’m happy I made the switch because I think the new color schema is easier on my eye, but I also can’t help but notice that I feel slightly more positive towards my otherwise homely and rather bloated IDE.

I guess the moral of the story is that you should never underestimate the power of lipstick when confronted with a pig.

Related posts:

Triple Shot Links # 17

Enjoying life after VSS. Next stop, Crucible… and then on to a possible replacement for CruiseControl (TeamCity or Bamboo).

  1. Saving the World via… TDD? - Steve Harman posts the best TDD code sample ever. It not only demonstrates the context/specification style specs but also clearly proves that TDD is our only hope of preventing the machines that look suspiciously like the current California Governor from taking over the world.
  2. A Rant about RAID, with a Bad Metaphor about Eggs, and No Happy Ending – Dylan Beattie shares his misadventures in using SATA RAID to try to protect his dev machine from catastrophe and in the process comes up with the best analogy I’ve seen in a while:
    “SATA RAID is like carefully dividing your eggs into two really good baskets, then tying them together with six feet of wet spaghetti and hanging them off a ceiling fan.”
  3. Visual Studio 2010 == Visual Studio 2008 + ReSharper - James Kovac catches an MS marketing faux-pas that proves that even the Microsoft Devs don’t like using Visual Studio without ReSharper installed.

Related posts:

Tips on Upgrading from VSS to Subversion

We’ve almost completed our first week on Subversion and all is well. Here are a few pieces of advice to those of you about to embark on a VSS to SVN migration of your own.

  1. Spend Time Getting Buy-In from all Developers BEFORE the Migration – Force feeding a new tool to your co-workers is a recipe for disaster. Developers who aren’t given any input or choice in the matter may be compliant at first but will likely turn passive-aggressive on you at the first sign of trouble. We did some lunch-and-learns and focused specifically on current source control related problems that would be solved by migrating to a new tool well before we did the actual migration. This made life much easier during the inevitable bumps that came up during the first few days after the migration.
  2. Be Aware of Tool Limitations When Migrating History – Unfortunately there don’t seem to be very many good options out there when it comes to migrating VSS history. After some failed attempts at using VSS2SVN and SVNImporter, I settled on using Eric Lane’s version of VSSMigrate. It accurately converted all the files in a 5GB VSS database, preserved history from the perspective of a single file, and stripped the VSS bindings from the project and solution files. The utility is also written in C# and the source code is provided so you can make tweaks as needed (I changed it to put the associated version label in the comment of the revision). Unfortunately, it doesn’t convert labels and more importantly it doesn’t preserve history from a holistic perspective since it loops through and commits the version history of one file at a time. If you really only care about doing diffs and not about reconstructing your apps as of a certain point in time, then I would recommend using this tool. Otherwise, keep looking.
  3. Do Several Practice Migrations – I set up a Virtual Machine that mirrored our source control server and not only went through the migration several times on a copy of the full VSS database, but also documented each step to make life easier during the actual migration, which took place over the weekend when I was less…focused.
  4. Don’t Forget About Dependencies – We had quite a few Nant, CruiseControl, and VisualBuild scripts that needed to be modified, which added quite a bit of time and effort to the migration process. A VM definitely came in handy when testing these changes as well.
  5. Run VSSAnalyze Before Migration – Corrupted VSS chains are common and will likely cause havoc with a migration tool unless you try to fix them prior to the migration. Even after running Analyze, the VSS equivalent of duct tape, there were still 2 files with corrupted version history that I had to remove from the VSS database prior to the migration and manually add to SVN after the migration.
  6. Use BeyondCompare to Verify Migration – Make sure that you do a full comparison of working directories from the new SVN repository and old VSS repository. Before performing the comparison, you’ll want to configure exclusions for the svn and vss specific files as well as the project and solution files if they have been stripped of bindings either by the migration tool or manually.
  7. Open Up and Compile All Solutions After Migration – I discovered a resource file that somehow got dropped during the migration because one of the solutions would no longer compile.
  8. Use SharpSVN to Extend and Script For SVN – I was surprised at how easy it was to create a pre-commit hook for SVN that would analyze commits and prevent the ones that didn’t contain a valid issue for our issue tracker (JIRA). This was partially because I used SharpSVN, an open source API, and was thus able to interact with the repository without having to parse command line return values from SvnLook.
  9. Practice Backups and Restores Before Migration – Resist the temptation to put this off until after the migration and make sure you fully test any scripts that you use, especially if you don’t use the recommended Python scripts that can be found on the official SVN site . I couldn’t convince the Powers-That-Be to let me install a Python interpreter on our server, so I went surfing for PowerShell scripts and the first one I tried for incremental backups only actually saved the latest revision instead of the latest range of revisions. I didn’t discover until doing some testing on a practice restore that I did.
  10. Plan the Migration over a Weekend – Most of the processes are very long running. The one that migrated our VSS history took almost 10 hours for a 5 GB database and we ran into some problems with our build scripts that took much of the day Sunday to debug.

Happy Migration!

Related posts:

Don’t Be a Cotton-Headed-Ninny-Muggins When Copying Files

I just submitted a feature request to Microsoft.

I thought that the perhaps the Windows Explorer file copy dialog could be a bit more truthful and instead of displaying something like this whenever a user is trying to copy something over 100 MB in size through Windows Explorer…

windowscopydialog

…it should instead show something like this…

windowscopydialog_2

Just to be safe,  I sent the above mockup directly to Bill Gates. I know he doesn’t run things in Redmond anymore but I figured he probably still eats a half dozen alpha-geeks raw for breakfast every morning and could surely make this happen.

In the meantime, I highly recommend that you find some other utility to hold you over whenever you have to perform a large copy job.

I used RoboCopy this weekend when I was forced to do an enormous one over a slow and unreliable VPN and was pleasantly surprised by how fast and robust it was.

Not only did it magically pick up where it left off every time I reconnected after a network failure, but it was even smart enough to only copy over missing files when I reran it this morning after discovering a few files were missing when I did a BeyondCompare sanity check (I didn’t know about the /R switch). I was prepared for several more hours of copying but I was greeted with this after only about 30 seconds.

robocopy


Not too shabby.

Moreover, there are a ton of other switches that allow fine grained control over how file attributes and ACL’s are copied over.

Despite it being an unassuming command line utility that ships with the Windows Server 2003 Resource Kit Tools, RoboCopy would clearly make Windows Explorer its bitch if they ever had it out in a File Copy Death Match.

Of course this is but one of a million good file copy options. The ToolMeister himself wrote about his favorites here and his HanselFollowers provided dozens of other good options in the comment section.

Whatever you decide to use for your future large copy jobs, just don’t be a cotton-headed-ninny-muggins and rely on Windows Explorer.

Related posts:

Triple Shot Links # 16

I’m just relaxing after a long weekend of migrating our source control from VSS to SVN and upgrading our build server. It turned out to be a fairly sizable project due to all of our automated build scripts, so I’m glad it’s done.

So long VSS. Don’t let the door hit you on the ass on the way out!

  1. Windows 7 Download Frustration – Ken Sipe provides a timely rant about MSDN download sites only working on an IE browser. I downloaded several things from MSDN this last week as I prepped a brand-spanking new build\source control server and managed to string together an impressive string of obscenities every up every time I had to switch browsers just to get the download to work. Special Message to Microsoft: Ignoring the realities of cross-browser compatibility on your corporate sites is inane and does not help promote your browser in any way!  On the contrary, it simply undermines my confidence in your ability to write decent, reliable software. Fix it before IE starts dragging otherwise decent software down with it as it continues to sink into the pit of browser failure.
  2. Dvorak Keyboard: Is it Really Faster? - Jaredpar discusses the pros and cons of switching from the traditional QWERTY to the Dvorak keyboard. For several years I’ve heard urban legends about the QWERTY originally being designed to slow typists down because of the limitations of the mechanical type writer and read about programmers who claim to be faster and more accurate typists after making the switch. I even considered making ‘switching to Dvorak’ one of my New Year’s resolutions for 2009. However, after reading this post I am now inclined to postpone this move indefinitely. I’m just not sure I am willing to spend three frustrating months of lower productivity while I fumble around on the keyboard as my fingers relearn the keys. Even more importantly, I really don’t want to deal with the hassles involved in interacting with other people’s computers afterwards (i.e. pairing).
  3. Limiting Code Comments Increases Productivity -  This is another post that I almost didn’t read because the topic has been done to death, however Jeffrey Palermo presents the argument beautifully and even includes before and after code samples to illustrate the point. I’m glad Jeff emphasized that nobody is suggesting that you will improve readability simply by ripping out existing comments. On the other hand, carefully naming and proper method composition always trumps comments. I can’t tell you how many stale comments have actually led me down an erroneous path because they no longer matched what the code actually did.

Related posts:

My 2009 Top 10 Technology Hit List

Here is a list of what I would most like to learn in the coming year.

  1. targetStructureMap – This is the one new technology that I will likely be able to implement at work in the first quarter, so I made it first on my list. I’ve been using the Dependency Injection pattern on an almost daily basis over the last six months as a way to make our codebase more testable, but I still haven’t taken the time to learn and start incorporating an IoC Container. Up until recently I had planned on using Windsor since I managed to make it through a few tutorials on it last year, but Jeremy Miller has given StructureMap so much attention lately in terms of a enhancements and documentation that I decided to try it instead.
  2. JQuery & QUnit– I only recently joined the rest of the world when it comes to using ajax and modern javascript frameworks while I was working on my recent Rails side project (I do mostly middle-tier and back-end development). I used Prototype simply because it was the default for Rails, but now I’m ready to try the much hyped JQuery framework along with QUnit, the unit testing framework that goes with it. Since I tend to learn much better when I have a concrete task, I’m going to start by re-implementing all of the Prototype functionality in my Rails app in JQuery.
  3. MVC Framework – I doubt I’ll have the opportunity to use this at work anytime soon since switching an existing project from WebForms to the MVC Framework would be a major rewrite. However now that I have a pretty good grounding in an MVC framework (RoR), I’m curious to see how the new Microsoft version compares.
  4. IronRuby – I’m also excited to see what the IronRuby experience is like compared with RoR. The RoR stack has been criticized in the past for poor performance and limited API and IDE support, so I’m anxious to see whether running Ruby on the DLR will be the answer to these problems or whether it will just seem like a cheap knock-off of the original.
  5. Git and\or MercurialI finally graduated to Subversion this last year, so now it is time to challenge myself with a distributed source control system. There’s no way we would go through another upgrade at work anytime soon, but it will be fun to experiment with these tools on personal projects.
  6. Django – I don’t have plans of doing any real development in Python or Django, but a friend of mine swears that this is way better than Rails, so I’m curious enough to at least go through some tutorials and sample projects so that I can decide for myself.
  7. Erlang – I’m going to finally try a functional language this year. I mean it this time. Really…
  8. Lambda ExpressionsI can fumble my way through samples, but I want to ratchet up my understanding a few levels so that I can naturally incorporate this C# 3.0 goodness into my daily development.
  9. PowerShell (again)I dug into this technology pretty deep about a year and a half ago when I first started this blog and even gave a couple presentations to user groups on the topic. Unfortunately, I fell victim to the ‘use it or loose it’ phenomenon and struggled mightily to do even the simplest of tasks during a recent automation project. Nevertheless, I was reminded about how cool this product was and got inspired to relearn it and start trying to use it on a regular basis this time around.
  10. Ubuntu – Finally, it’s been far too long since I’ve played with a flavor of Linux. With VM’s I really have no excuse anymore.

I guess I’d better quit writing and get started…

Related posts:

Using YSlow and HammerHead to Enhance Web App Performance

I recently installed YSlow, a Firefox add-on integrated with the popular Firebug web development tool that does performance analysis based on the rules for high performance web sites developed by Yahoo.

I tried it on DosPecesCreations.com, the e-commerce site I recently built for my wife using Ruby on Rails, and was surprised to learn that the site received a failing grade according to the YSlow Report Card.

yslow_grade_before

It took me just over an hour of clicking on the explanations for failed failed categories and researching how to make some of the configuration changes in Apache to bring that grade up to a high B.

Bringing it up to an A would require me to use a Content Delivery Network like Akamai Technologies, which deploys content across multiple, geographically dispersed servers and dynamically chooses the fastest option in a given scenario based on proximity and available connections. However, since the customer base for the site is not international and we don’t have thousands of dollars a month to spend at the moment, I’ll just have to content myself with being a B student.

So what was the payoff for making these changes?

I wanted to have a somewhat objective way to measure the performance improvements, so I also downloaded HammerHead, another firebug add-on that provides average load times for pages with and without the cache being used.

Here are my baseline metrics.

yslow_2

Here are the results after I made the changes.

yslow_after_2

As you can see, I more than doubled the speed of the site with little effort and almost no coding changes. Here’s a quick summary of what I did:

  1. Reduced the size of the HTTP response
    • Enabled Gzip Compression -  This is done in Apache with an output filter, which I enabled by adding one line to the .htaccess in the root directory of the site.
    • Minified Javascript Files – This involved removing all the comments as well as unneeded white space characters (space, newline, and tab) from javascript files. Luckily there are tools such as JSMin that will do this for you. I ran the Ruby version of JSMin as a Rake task and was able to reduce my Prototype Javascript Library files by about 25%.
    • Removed Unused Javascript Reference – This sounds obvious, but by using the default option with the javascript_include_tag Rails helper tag I was referencing 6 Prototype files even though I was only using 2 of them. By removing the unused references, I was able to trim 65k from my pages.
  2. Reduced # of trips
    • Merged javascript files – The Rake task I used above also merged the remaining prototype files into one file so the client would have to make one less round trip to retrieve the files.
    • Enabled Caching – I configured Apache to use Far Future Expire tags for my static content (images, js, & css) and Cache-Control tags for my dynamic content (2 hour expiration). I followed the recommendation of disabling ETags as well even though this only appears to only interfere with caching on web farms and I’m currently on a single server.
  3. Maximized parallel download speed – I did this by moving all my scripts from the html header to the bottom of the page. Apparently javascript files can block parallel downloads so simply moving these from the header to the bottom of the page will increase the overall load time.

I used this resource while making all of the Apache configuration changes. If you’re using IIS, then you might want to try this post.

As someone who spends most of his time doing middle tier and database development, I was surprised to learn how much of a web application’s performance is affected by these front end concerns.

Luckily, all of these front-end recommendations were much easier to fix than almost any performance tuning efforts applied to the back end.

No related posts.

Triple Shot Links # 15

Trying to recover from an injury that I got while playing WhirlyBall at a company team-building event. Don’t they know that bad things happen when hyper-focused programmers try to do things that require multi-tasking.

  1. Give and Take in the Software Industry - This is the Secret Geek’s version of The Joel Test and The programmer’s bill of rights. I almost didn’t read it because the jfk_asking_the_users_for_feedbacktopic is a little old and tired, but Leon Bambrick reinvigorated it with his own humorous writing style as well as helpful step-ladder approach to each topic that serves as a good reminder that you can always progress further down the road to progress. I particularly like the following excerpt on having companies provide separate dev, QA, and Prod environments for their developers:
    “You can’t afford testers and you just want me to fix it in production, eh? That’s awesome. That’s great. Next time the dentist is drilling out a cavity in your mouth, I’m going to tell him “This is an urgent operation. Let’s not waste time on X-rays. Just start drilling, you’re bound to hit something that’s rotten. And let’s save a few dollars and cut out the anaesthetic altogether.”

    2009 Predictions, 2008 Predictions Revisited - Ted Neward judges the accuracy of his predictions from last year and provides us with a new set of forecasts for the coming year. Ted’s ability to combine insightful critical analysis with just the right amount of cynicism and humor make this a great read. My favorite is #1 of the 2009 predictions:

    “The ‘Cloud’ will become the next ‘ESB’ or ‘SOA’, in that it will be something that everybody will talk about, but few will understand and even fewer will do anything with.”
  2. Hoops & Yoyo’s Decaf Coffee Crisis - It’s about time that someone took a stand against the abomination known as decaf coffee. Here’s a hilarious Hallmark e-card that you can send to your favorite coffee addict.

Related posts:

Next Page »