Friday, March 22, 2013

Calculating Distance with Google API and C#

Recently I had to use C# to calculate driving mileage between two locations.  Here's a great resource I found but they calculate in metric.

http://briancray.com/posts/calculate-driving-distance-google-maps-api

To convert the distance into miles, make the following modification at the end:


                miles = Math.Round((Double.Parse(distanceNode[0].ChildNodes[0].InnerText) / 1609.344d) * 100) / 100;

That's it! Very useful!

Tuesday, March 12, 2013

Canonical Tags

http://mikael.com/2013/01/seo-canonical-urls-in-sitecore/

If you need to set up canonical tags in sitecore, here's a real quick code snippet that lets you do it.  What are canonical tags?

Read this below:


In summar, canonical tags are used so that crawlers will know that your shortcut isn't copied content, it's just a shortcut.  That's it!