Tuesday, November 24, 2009

Recently, I was asked to migrate code from one source control repository to another.  The customer had been using Visual Source Safe (VSS) for many years and had dozens (maybe hundreds) of projects checked in. Most of these projects had a long history of file versions.
VSS was a decent product when it was first released, but it falls far short of newer source control systems, such as Team Foundation Server (TFS), Subversion and CVS. This customer selected TFS as their new source control system, but they did not want to lose the history they had captured in VSS.

They asked me how to move the years of VSS history into TFS. Tools exist to do this, including  Microsoft’s VSS2TeamFoundation (available at  http://msdn.microsoft.com/en-us/library/ms181247(VS.80).aspx). However, migration tools have several disadvantages:

  1. Migrating years of source control can take a really long time, maybe weeks. You will probably want to do a test migration of your data, which will extend the time requirement even further.
  2. If you have been checking code into a source control system for any length of time, there are bound to be some mistakes: Projects that were started but never went anywhere; Code changes that were mistakenly checked in and had to be reverted; and duplicate source code erroneously checked into two distinct folders. If you migrate your all source code history, these mistakes will be migrated as well.

A simpler alternative to migrating every version of every project in every folder is to simply get the latest code from the old source control repository and check it into the new repository. Using Visual Studio, this requires only a few steps:

  1. Open the project in Visual Studio
  2. Get latest from the old source control system
  3. Remove bindings to the old source control system
  4. Connect to the new source control system
  5. Check the code into the new source control system

Repeat this for each solution. You will now have a current version of all relevant code checked you’re your new source control system.

Some users will tell you this is not enough. These users want to keep all the history of every bit of code - every version, every branch and every project. Using the above migration strategy, you can still do that. My recommendation is to keep the history in your old repository, mark that repository as read-only and leave it online. Users will still be able to use this old source control system to find their old code, but will use the new source control system for all version control going forward. This is far simpler and faster than trying to push years of changes into a new repository.

The lesson here is: Always consider the simplest alternative and determine whether it meets your needs, before considering more complex solutions.

Tuesday, November 24, 2009 6:49:04 AM (Eastern Standard Time, UTC-05:00)
 Tuesday, September 22, 2009

I count many software developers among my friends and colleagues. Many of them tell of writing code in high school or earlier; of hacking during junior high school; or of knowing their career path at an early age.

My programming career began much later in life. Because I grew up with no inkling what I wanted to become, I majored in biochemistry as an undergrad and I studied finance in graduate school. During my eight years of matriculation, I kept busy working as a laborer for a construction company, coaching a high school wrestling team, selling financial securities, interning for a commodity trading advisor and painting. After four years attending grad school at night and working two jobs, I took my MBA and went to work doing accounting and financial analysis for a printer manufacturer. I spent almost four years at this job and it rarely changed. I learned almost nothing after the first year and found myself mightily bored.

At the time, it seemed like misfortune, but I was laid off from this job when the economy turned south and my employer sold off a large subsidiary. Months of job searching during the recession of the early 1990s left me feeling discouraged about my prospects. So I took this as an opportunity to change careers. I had taken a couple programming classes before and I had done well and enjoyed them, so I enrolled at the local university to study Computer Engineering. Sometimes the curriculum was difficult. For example, every other student in my Calculus 4 class had taken the prerequisite class the semester before.  I had taken it nine years earlier.

After two semesters of straight A’s, I was prepared to pursue a degree in Computer Engineering until the phone rang between semesters. It was an old friend of the family calling. He owned a small company in Cincinnati, had heard I knew something about computers and was looking for someone to help him with his computers. I had never been to Cincinnati before, but the offer was good and he was willing to pay for my training so I accepted and moved. Six months later, my house in Michigan sold and my family joined me.

I was a novice at that time and I knew it. I worked my tail off to learn everything I could about networking and programming and computers in general. On most days, I was the first to arrive and the last to leave work. I would get up early and drive in on Saturday to work a few hours before my family woke up. I worked at that company for five years. For most of that time, I was the entire IT department. I managed a LanManager network that I converted to a Windows NT network; I ran a call center of data input operators;  I was the company’s primary computer help desk; I evaluated and bought personal computers and servers and printers; and I wrote all the company’s custom software.

Of these tasks, writing software appealed to me most. In programming, I had the ability to learn technical skills, to practice logical thinking, and to exercise my creativity. It gave me the opportunity to exercise all parts of my brain. I decided I wanted to focus most of my energy on programming.

At that time, my language of choice was FoxPro, which gave me a chance to build Windows user interfaces and to learn about relational databases. I learned about language constructs and programming algorithms and naming conventions and frameworks. I would stay up late into the night reading programming books and technical journals. I enjoyed learning about programming far more than I enjoyed accounting or finance.

When Visual FoxPro was released, I redoubled my efforts, trying to grasp the concepts of object oriented programming and deciding when to use inheritance.

After five years, I got the opportunity to join a local consulting company, where I could focus on software development and training. I would rotate between teaching classes and building business solutions. This was another great learning experience: Teaching made me a better programmer and programming made me a better teacher.

This consulting company was known for its FoxPro expertise but we did a fair amount of Visual Basic programming and I was able to learn my second language. When Microsoft released ASP and Visual InterDev, I learned that and began teaching a class in web development. I taught that class more than any other.  I learned about XML in 2000 and began applying it anywhere I could, like a hammer looking for a nail.

Unfortunately, the company I worked for made some poor business decisions and people began to leave – first the customers, then the consultants. I followed a friend to G.A. Sullivan (aka GAS), a medium-sized consulting company in Cincinnati. I was attracted to GAS because of all the talented developers they had on board already.  Where my old employer seemed to be drifting from day-to-day, the new group had plans. They managed projects with efficiency, they had in-house experts in numerous areas; and they were well-respected by their customers and by other development shops. Not only did I learn a great deal of technology (I was at GAS when I did my first .Net project) but I first began to do public technology presentations at that time. I spoke in front of customers and at the local VB user group (later reborn as CINUG).

To this day, I have not worked with a group as talented and tight as the folks at GA Sullivan. Most of us have moved on, but I remain close friends with a number of my former colleagues from those days.

After a couple years, GAS was purchased by Avanade, a large multi-national consulting company started as a joint venture between Accenture and Microsoft. With such enormous parents, Avanade was able to go after much larger customers. During my years there, I traveled a lot but I was able to work on a number of large enterprise applications, which helped me in understanding scalability, security and how to navigate the bureaucracy of a large corporate environment.

I had my first exposure to Rules Engines, Workflow Foundation, Unit Testing, and Continuous Integration on various projects for Avanade. I spent over a year focused almost exclusively on BizTalk Server, diving deep into Microsoft integration technologies.

I wrote very little code my last year at Avanade as I led a team designing an e-commerce integration project. Instead I got experience writing design specifications and developing project plans for a waterfall project.

In 2007, I left Avanade because I wanted to spend more time with my family. I took a job with Quick Solutions Inc. (QSI) because I was impressed with the smart developers I met there and I admired their passion working and speaking in the community. I got back into coding working on an ASP.Net portal project. I also had a chance to learn from some smart people about Agile development methodologies, Team Foundation Server and the database tools of Visual Studio. Being closer to home allowed me to spend time with the developer community.  For the first time in years, I began actively speaking at conferences and user groups and participating in user groups. In 2008, following a change in ownership, QSI decided to get rid of all their consultants outside of Columbus, OH. 

A year of being active in the local community made it easier to find a new job and I joined Sogeti, my current employer. While here, I’ve worked in a variety of industries and even did my first SharePoint project. I’ve kept active in the development community, in part as a way of expanding my own knowledge of technologies.

I’ve had a number of stops over the past 15 years and I’ve learned something new everywhere I’ve been. Looking back, losing my job as an accountant was a good thing for career and my life.  

Monday, September 21, 2009 11:06:01 PM (Eastern Standard Time, UTC-05:00)
 Thursday, April 17, 2008

Today, I was approached by someone with a request that sounded very simple.  She had a large Word document and she wanted to create an Excel spreadsheet in which each cell contained the name of a section in the Word document.  A hyperlink in each cell should open the Word document and navigate the user to the corresponding section.

Years ago, I did something similar using Office 97 or Office 2000, so I knew it was possible.

I opened the Word document and inserted a bookmark at the top of each section.  Inserting bookmarks in Word is pretty straightforward:

  1. Select the first line of the section
  2. From the menu/ribbon, select Insert Bookmark
  3. In the Bookmark dialog, type a name for that bookmark.

 

I became confused when I tried creating the hyperlinks in Excel.  Inserting a hyperlink in Excel hasn't changed much through the versions:

  1. Type some text in a cell
  2. Select that cell
  3. From the menu/ribbon, select Insert | Hyperlink
  4. Find and select the file to which you want to link.

This is where I became confused.  The "Insert Hyperlink" dialog contains a big button labeled "Bookmark".  Naturally I clicked this button to specify the bookmark within the Word document.  Unfortunately, clicking the button displayed an error.  According to Excel, Word documents don't support bookmarks, although my personal experience and the on-line help says that they do.

 

The secret is that you should not click the bookmark button in order to link to a bookmarked location in a Word document.  Rather, you should append the filename with the pound symbol ("#"), followed by the name of the bookmark to which you wish to link.  For example, I wanted to link to a bookmark named "Section1" in a document named "BigWordDoc.docx", so I entered "BigWordDoc.docx#Section1", as shown below.

Apparently, the "Bookmark" button is used for cells and defined names within an Excel document.

  

I'm not sure if Excel's "Insert Hyperlink" dialog has changed in the last few versions, but this strikes me as a flaw in the user interface.  The visual clues don't help me accomplish this task - they actually took me in a different direction.

Here is a working demo of an Excel spreadsheet with links to sections of a Word document: OfficeLinkDemo.zip (17.92 KB)

Thursday, April 17, 2008 3:56:20 PM (Eastern Standard Time, UTC-05:00)