Dev Tip: Customising Visual Studio to use a different merge tool

One tip I picked up after many years of using Visual Studio and TFS is that the default diffing tool in Visual Studio is… lacking. But the great thing is that you can customise Visual Studio to use a different diff and merge tool.
My tool of choice is KDiff 3 (Package also available on Chocolatey.org) as it is free and open source. Meaning I am able to just install it via Chocolatey on all my machines without a second thought.

Here is a great example of why you may want to change your default diff tool. Below is a web.config file that was reformatted by a tool and simply put an additional space before the closing tag. Visual Studio flags every single line as having changed, but I can’t find the actual lines that were changed by me.
image

However in KDiff3 I can toggle to show whitespace changes, allowing me to focus just on the actual code that changed

Whitespace on
image

Whitespace off
image

 

Step 1: Install your diff tool of choice

Below are some I have previously used

 

Step 2: Open the Visual Studio Options

From Visual Studio select Tools –> Options. Then navigate to Source Control –> Visual Studio Team Foundation.
Then click Configure User Tools.
image

Step 3: Enter the command line parameters

In the configure use tools screen. Click Add.

  • For the extension enter .*
  • Command select the diff tool .exe
  • Enter the arguments from the table below based on if you are defining the compare or merge

image
image

The table below is duplicated from a 2006 blog post. I’d hate for the content to ever disappear off the web. All credits go to the James Manning’s original post.

Compare arguments

Product Command Arguments
TFS default diffmerge.exe %1 %2 %6 %7 %5 /ignorespace
WinDiff windiff.exe

%1 %2

DiffDoc (for Word files)

DiffDoc.exe /M%1 /S%2
WinMerge winmerge.exe /ub /dl %6 /dr %7 %1 %2
Beyond Compare bc2.exe %1 %2 /title1=%6 /title2=%7
KDiff3 kdiff3.exe %1 –fname %6 %2 –fname %7
Araxis compare.exe /wait /2 /title1:%6 /title2:%7 %1 %2
Compare It! Wincmp3.exe %1 /=%6 %2 /=%7
SourceGear DiffMerge DiffMerge.exe /title1=%6 /title2=%7 %1 %2
Beyond Compare 3 BComp.exe %1 %2 /title1=%6 /title2=%7
TortoiseMerge TortoiseMerge.exe /base:%1 /mine:%2 /basename:%6 /minename:%7
Visual SlickEdit win\vsdiff.exe %1 %2

 

Merge arguments

Product Command Arguments
TFS default diffmerge.exe /merge %1 %2 %3 %4 %6 %7
KDiff3 kdiff3.exe %3 –fname %8 %2 –fname %7 %1 –fname %6 -o %4
Visual SourceSafe ssexp.exe /merge %1 %2 %3 %4 %6 %7
Araxis compare.exe /wait /swap /a3 /3 /title1:%6 /title2:%7 /title3:%8 %1 %2 %3 %4
Beyond Compare (2-way merge) bc2.exe %1 %2 /savetarget=%4 /title1=%6 /title2=%7
WinMerge (2-way merge) winmerge.exe /ub /dl %6 /dr %7 %1 %2 %4
Guiffy guiffy.exe -s -h1%6 -h2%7 -hm%9 %1 %2 %3 %4
Ellie Computing guimerge.exe –mode=merge3 %3 %1 %2 –to=%4 –title0=%8 –title1=%6 –title2=%7 –to-title=%9
SourceGear DiffMerge DiffMerge.exe /title1=%6 /title2=%8 /title3=%7 /result=%4 %1 %3 %2
Beyond Compare 3 BComp.exe %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9
TortoiseMerge TortoiseMerge.exe /base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9
Visual SlickEdit win\vsmerge.exe %3 %1 %2 %4

Translating emails easily in Outlook

I have been working with SSW’s Beijing office for over 12 months now. One common occurrence is that I am CC’d on emails to our Chinese customers, but unfortunately I can’t read Chinese. It is very useful for me to quickly read these emails so I have an idea of what correspondence is going on.

The easiest way I have found to keep myself in the loop and check in on threads periodically is by adding a button to the Outlook ribbon bar to quickly translate the current document for me. Here is an example of how to set it up and translate an email.

Step 1: Customise the ribbon
image

Step 2: Select the Home tab and create a new group. Call it Translation, then add “Translate Document”. Press OK to save it
image

Step 3: You will now see the translate button in the ribbon, press it to set up what language it should translate from and to.
image

It will then warn you that your email will be sent over the internet to the translation service
image

 

That is it. Now in your ribbon bar you will see your button ready to use.
image

Clicking it will open up a browser with your document translated
image

Getting married with Azure

After being with my partner for nearly 8 years, we finally tied the knot and got married. In the nerdiest way possible, I managed to organise the reception to be held in the “Azure Court” (without my wife realising). I was able to spend the day with the 2 loves of my life: my new wife, and Azure Winking smile

I mentioned to her that I was going to post about this and she recommended I link to the first time I mentioned her on my blog, when I was trying to figure out how to integrate Chinese & technology together:
Unicode not displaying correctly in Chinese apps and Creating a translation app to speak with her parents.

I have been an Azure MVP for 3 years now (with hopefully many more years in the future), however I’m hoping my new wife will outlast even my love for technology. Here is to many many happy years and the rest of our life together.

wedding with flowersdancing

Posted in Azure. 1 Comment »

Microsoft Virtual Academy – Windows 10 fundamentals & Azure

microsoft_ITHero_banners_02

Microsoft has a hidden resource for skilling up your technical skills, the “Microsoft Virtual Academy”. If you are looking to learn more about a specific Microsoft technology then it is a good way to learn from the experts. Some of the courses also help prepare you for Microsoft certification exams.

Today I am highlighting a few courses focused around

Windows 10 Technical Preview Fundamentals for IT Pros

Watch as the lead Windows 10 Enterprise Product Managers roll back the covers on the Windows 10 Technical Preview. Learn about new UI enhancements, find out how management and deployment is evolving, and hear how new security enhancements in Windows 10 can help your organization respond to the modern security threat landscape.

Windows 10 Technical Preview Fundamentals for IT Pros

Open Source Database on Microsoft Azure

Watch the experts, as they explore data storage in Azure and look at ways to design your data disk architecture for virtual machines (VMs). Plus, compare the performances of different VMs, and look at database reliability and availability.

Open Source Database on Microsoft Azure

Microsoft Virtual Academy – Azure IaaS series

microsoft_ITHero_banners_02

Microsoft has a hidden resource for skilling up your technical skills, the “Microsoft Virtual Academy”. If you are looking to learn more about a specific Microsoft technology then it is a good way to learn from the experts. Some of the courses also help prepare you for Microsoft certification exams.

Today I am highlighting a course series on Azure IaaS (Infrastructure As A Service).

 

Part 1 – IaaS Fundamentals

In this session, hear from Mark Russinovich and explore Azure IaaS virtual machines, inside and out. Learn to optimize your Windows Server workloads on Azure, and dig into IaaS architecture and management best practices.

IaaS Fundamentals

Part 2 – Dive Deep into Networking Storage and Disaster Recovery Scenarios

In this second in a series of Azure IaaS trainings for IT Pros, explore networking and hybrid connectivity to extend your datacenter, see why storage is the fundamental building block for all Azure services, and find out how new tools and capabilities simplify migration and disaster recovery. Get the details on network, storage, and automation, as you continue the deep dive into the supporting technologies that light up Azure IaaS.

Dive Deep into Networking Storage and Disaster Recovery Scenarios

Part 3 – Embrace Open Source Technologies to Accelerate and Scale Solutions

In this third in the series of Azure IaaS trainings for IT Pros, focus on open source technologies on Azure. Walk with engineers through how to best deploy and manage a Linux environment with tools you know and use today.
Learn how to use your existing Chef and Puppet configurations and how to scale new ones to massively scale and deploy your solution. Wrap the day with a look at the new capabilities of containerization with Docker.

Embrace Open Source Technologies to Accelerate and Scale Solutions

Build 2015 day 1 keynote

Highlights:

Note, the stream started at 1:36am my time. You can see the timestamp in most of the screencaps, so you can translate it into how far into the steam each topic/announcement is.

1:36

Satya comes on stage

When Windows first started, it was written by 2 guys and was for PCs.
But now there are so many more devices out there.
It is Microsoft’s mission to help empower every person, and that starts by empowering every developer.

clip_image001

Read the rest of this entry »

Community report: Beijing Xamarin hack day

With the success of the Sydney Xamarin hack day a few months back, we decided to repeat the event in as many locations as possible. With me working in Beijing, China for a few months it was the perfect opportunity to run the event in another country!
http://xamarinhackday.com/beijing

Challenges

Running an event in another country comes with a number of localization issues. Such as different social media sites used, and language translations of any marketing materials that are sent out. We are lucky that China is embracing English as a critical part of their education, and people working in the Tech Industry are more used to speaking in English than other fields.

image

Newsletter

The mailout we sent out to our Chinese contacts took us 2 weeks to lock down. Initially I thought “this is an English event, being presented in English, for a crowd that is assumed to have a very basic level of English”. Under this assumption I created the initial version of the newsletter in English only. After reviewing it we decided we should probably send it out in Chinese, and I got my PA to translate it. We then decided to merge it all into a single English/Chinese flyer, which then took some time to get the formatting correct. All up it was 2 weeks of iterating on just how to communicate the event. The final result can be found here http://xamarinhackday.com/newsletter/aug2014/beijing-hack-day_en-ch.html

Social media

The traditional forms of social media we use in the western world (Twitter, FaceBook, Instagram, YouTube, Tumblr, etc.) are all blocked via the “Great Firewall of China”. This means you need to adapt and use the local alternatives of these services.

We used Weibo (Twitter clone) to promote the event on the SSW account http://www.weibo.com/2647550041/BlhOYjUab as well as on the official Microsoft MSDN account  http://www.weibo.com/1678298567/BlASwk0fs

We also uploaded the promotional video of the event to YouKu (YouTube clone) so that Chinese participants could view the video http://v.youku.com/v_show/id_XNzQ4MjY0MDMy.html

Android development kits blocked by firewall

Another fun issue I knew we would have, is the Xamarin installer instantly fails when you try to run it. As it tries to download Android resources off the Google CDNs, which are all blocked by the Chinese firewall. I had to get all the resources downloaded and put onto a USB key that I could share with the attendees on the day. I had one of my staff create a word document out of the instructions on how to install it offline with these caches, I should blog the instructions in the future.

On the day

The event went extremely smoothly on the day. The event was hosted at the Microsoft office, and they had organised everything perfectly, from the prearranged desks, right through to catering for lunch.

Presenting to a Non-Native speaker crowd

From working with Chinese .Net developers here in Beijing, my assumptions about their base level of English proved correct. I was able to give my presentation on using Xamarin basics, right through to advanced MVVM & PCL with Xamarin.Forms. It was meant to be a 3 hour talk, however it took me 4.5 hours as I spoke at 1/2 my normal speed, and was constantly making sure I clarified myself with simpler English, or in another way to help make sure I got the concepts across.

DSC06663

I also tried modifying my presentation style on the day. I knew that if I just did my typical “talk lots to the crowd” that I would lose a lot of them. I tried speaking and writing short notes on what I am saying, to help get the message across. I also tried to “let the code do the talking” and did my demos from 1st principles. By doing it all from the basics it helped ensure they understood what I was doing, as any attempt at trying to explain the background of a pre-canned sample may be futile due to language barrier.

You can read about my attempt at using GitHub to share the source code & MarkDown to prettify my notepad notes https://davidburela.wordpress.com/2014/09/18/experimenting-with-ways-to-share-presentation-materials/

DSC06675_2

Overall the day went well, with enthusiastic developers learning how to develop with Xamarin, and subsequently start running up their own cross platform apps. I saw many sample apps running identically on Windows Phone & Android via Xamarin.Forms.

Follow

Get every new post delivered to your Inbox.