<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Maurice&#039;s Musings &#187; Technology</title>
	<atom:link href="http://www.calvert.ch/maurice/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.calvert.ch/maurice</link>
	<description>On People, Life and Technology</description>
	<lastBuildDate>Sat, 04 Feb 2012 22:37:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Embedded GoogleMaps doesn&#8217;t work with IE9</title>
		<link>http://www.calvert.ch/maurice/2012/01/13/embedded-googlemaps-doesnt-work-with-ie9/</link>
		<comments>http://www.calvert.ch/maurice/2012/01/13/embedded-googlemaps-doesnt-work-with-ie9/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 21:42:06 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ie9]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=557</guid>
		<description><![CDATA[I&#8217;ve wasted hours trying to figure out why my embedded geocoding application doesn&#8217;t work with IE9. This is not the first bad experience I&#8217;ve had with IE9, which frankly is one of the worst browser implementations I&#8217;ve ever seen. If you&#8217;ve arrived here, you&#8217;re probably looking for a solution. Here&#8217;s what worked for me: &#60;meta <a href='http://www.calvert.ch/maurice/2012/01/13/embedded-googlemaps-doesnt-work-with-ie9/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve wasted hours trying to figure out why my <a href="http://www.calvert.ch/geodesix/">embedded geocoding application</a> doesn&#8217;t work with IE9.</p>
<p>This is not the first bad experience I&#8217;ve had with IE9, which frankly is one of the worst browser implementations I&#8217;ve ever seen.</p>
<p>If you&#8217;ve arrived here, you&#8217;re probably looking for a solution. Here&#8217;s what worked for me:</p>
<pre>
&lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" &gt;
</pre>
<p>That we have to resort to this kind of shit beggars belief.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2012/01/13/embedded-googlemaps-doesnt-work-with-ie9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Excel to HTML with formatting</title>
		<link>http://www.calvert.ch/maurice/2012/01/13/convert-excel-to-html-with-formatting/</link>
		<comments>http://www.calvert.ch/maurice/2012/01/13/convert-excel-to-html-with-formatting/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 12:37:55 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=553</guid>
		<description><![CDATA[This spreadsheet contains the VBA code to write an Excel range as a clean, formatted HTML page, with optional auto-refresh. Features: Correctly renders all Excel formatting (except conditional formats). Creates clean, formatted HTML that validates to HTML 4.01 strict. Optimised stylesheet to ensure minimal page weight. Supports merged cells with ROWSPAN and COLSPAN. Updates the webpage <a href='http://www.calvert.ch/maurice/2012/01/13/convert-excel-to-html-with-formatting/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.calvert.ch/download/HTMLWriter.xlsm">This spreadsheet</a> contains the VBA code to write an Excel range as a clean, formatted HTML page, with optional auto-refresh.</p>
<p>Features:</p>
<ul>
<li>Correctly renders <strong>all</strong> Excel formatting (except conditional formats).</li>
<li>Creates clean, formatted HTML that validates to HTML 4.01 strict.</li>
<li>Optimised stylesheet to ensure minimal page weight.</li>
<li>Supports merged cells with ROWSPAN and COLSPAN.</li>
<li>Updates the webpage automatically when cells&#8217; values are changed.</li>
<li>The webpage automatically refreshes itself at a user-supplied interval.</li>
</ul>
<p>The result is almost pixel-perfect, compare <a href="http://www.calvert.ch/download/HTMLWriter.png" target="_blank">this Excel screenshot</a> with <a href="http://www.calvert.ch/download/HTMLWriter.html" target="_blank">the HTML page it generated</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2012/01/13/convert-excel-to-html-with-formatting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Excel: Copying cell values/formulas/formats without using the clipboard</title>
		<link>http://www.calvert.ch/maurice/2011/12/23/excel-copying-cell-valuesformulas-without-using-the-clipboard/</link>
		<comments>http://www.calvert.ch/maurice/2011/12/23/excel-copying-cell-valuesformulas-without-using-the-clipboard/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 14:28:58 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[excel]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=548</guid>
		<description><![CDATA[I though this would be trivial; turns out it&#8217;s not. When you copy a formula from the clipboard, relative references are adjusted, so Range(x).Formula=Range(y).Formula doesn&#8217;t produce the expected results. The correct way is Range(x).Formula=Range(y).FormulaR1C1. Easy once you&#8217;ve been there. Copying border formats with Range(x).Borders=Range(y).Borders crashes Excel. You have to copy each individual border, left, right, <a href='http://www.calvert.ch/maurice/2011/12/23/excel-copying-cell-valuesformulas-without-using-the-clipboard/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I though this would be trivial; turns out it&#8217;s not.</p>
<ul>
<li>When you copy a formula from the clipboard, relative references are adjusted, so <code>Range(x).Formula=Range(y).Formula</code> doesn&#8217;t produce the expected results. The correct way is <code>Range(x).Formula=Range(y).FormulaR1C1</code>. Easy once you&#8217;ve been there.</li>
<li>Copying border formats with <code>Range(x).Borders=Range(y).Borders</code> crashes Excel. You have to copy each individual border, left, right, top, etc.</li>
<li>Similarly for fonts, you have to copy the font attributes one by one.</li>
<li>Good practice: check that the areas have compatible sizes and don&#8217;t overlap.</li>
</ul>
<p>Nothing inordinately difficult, but time-consuming to get right. Here&#8217;s the code:</p>
<div><span style="font-size: 11px;"></span></div>
<p><span style="font-size: 11px;"></p>
<pre>Option Explicit

' Copy cells without using the clipboard.
'
' Source is a range from which to copy values/formulas/formats.
' Dest is the destination range. Must be either
'     a single cell, the top-left of the target range. The source size (rows x columns) is copied.
'   or
'     a range exactly the same size as source. We throw an error if the shapes don't match.
'
' If 'what' is omitted, copies the values.
' what=CopyFormulas copies the formulas instead of the values.
' what=CopyFormats copies the formats.
' what=CopyFormulas+CopyFormats copies both.
'
' Examples:
'   CopyCells Range("b2:c6"), Range("h10")                                   ' Copies 8 cells (6x2) from B2 to H10
'   CopyCells Range(cells(2,2),cells(6,3)), Range("h10")                     ' Idem
'   CopyCells Range(cells(2,2),cells(6,3)), Range(cells(10,10),cells(14,12)) ' Fails, source is 6x2, dest is 6x3
'   CopyCells Range("b2:c6"), Range("b3")                                    ' Fails, source and dest intersect

Public Const CopyFormulas = 1
Public Const CopyFormats = 2
Public Sub CopyCells(source As Range, dest As Range, Optional what As Long)

    ' Turn off screen updating, wastes (a lot of) time
    Dim updating As Boolean
    updating = Application.ScreenUpdating
    Application.ScreenUpdating = False

    If IsMissing(what) Then
        what = 0
    End If

    Dim r As Long
    Dim c As Long

    ' If destination is not a singe (r,c) top-left cell, ensure that the ranges are the same shape and size
    If dest.Rows.Count &gt; 1 Or dest.Columns.Count &gt; 1 Then

        If dest.Rows.Count &lt;&gt; source.Rows.Count Or _
           dest.Columns.Count &lt;&gt; source.Columns.Count Then

            Err.Raise 1000, "CopyCells", "Destination area " &amp; dest.Rows.Count &amp; "x" &amp; dest.Columns.Count &amp; _
                " is not the same shape as the source area " &amp; source.Rows.Count &amp; "x" &amp; source.Columns.Count

        End If
    End If

    If Not (Intersect(source, dest) Is Nothing) Then
            Err.Raise 1000, "CopyCells", "Source area " &amp; Replace(source.Address, "$", "") &amp; " " &amp; source.Rows.Count &amp; "x" &amp; source.Columns.Count &amp; _
                " intersects destination area " &amp; Replace(dest.Address, "$", "") &amp; " " &amp; dest.Rows.Count &amp; "x" &amp; dest.Columns.Count
    End If

    For r = 1 To source.Rows.Count

        For c = 1 To source.Columns.Count

            If what And CopyFormulas Then
                dest.Cells(r, c).Formula = source.Cells(r, c).FormulaR1C1
            Else
                dest.Cells(r, c).Value = source.Cells(r, c).Value
            End If

            If what And CopyFormats Then

                Dim b As Long
                For b = xlEdgeLeft To xlInsideHorizontal
                    With source.Cells(r, c).Borders(b)
                        dest.Cells(r, c).Borders(b).Weight = .Weight ' You must do this *before* linestyle
                        dest.Cells(r, c).Borders(b).LineStyle = .LineStyle
                        dest.Cells(r, c).Borders(b).ColorIndex = .ColorIndex
                        dest.Cells(r, c).Borders(b).TintAndShade = .TintAndShade
                    End With
                Next
                dest.Cells(r, c).ColumnWidth = source.Cells(r, c).ColumnWidth
                dest.Cells(r, c).Interior.Color = source.Cells(r, c).Interior.Color
                dest.Cells(r, c).Interior.Pattern = source.Cells(r, c).Interior.Pattern
                dest.Cells(r, c).HorizontalAlignment = source.Cells(r, c).HorizontalAlignment
                dest.Cells(r, c).IndentLevel = source.Cells(r, c).IndentLevel
                dest.Cells(r, c).NumberFormat = source.Cells(r, c).NumberFormat
                dest.Cells(r, c).Orientation = source.Cells(r, c).Orientation
                dest.Cells(r, c).RowHeight = source.Cells(r, c).RowHeight
                dest.Cells(r, c).UseStandardHeight = source.Cells(r, c).UseStandardHeight
                dest.Cells(r, c).UseStandardWidth = source.Cells(r, c).UseStandardWidth
                dest.Cells(r, c).VerticalAlignment = source.Cells(r, c).VerticalAlignment
                dest.Cells(r, c).WrapText = source.Cells(r, c).WrapText

                With source.Cells(r, c).Font
                    dest.Cells(r, c).Font.Background = .Background
                    dest.Cells(r, c).Font.Bold = .Bold
                    dest.Cells(r, c).Font.Color = .Color
                    dest.Cells(r, c).Font.ColorIndex = .ColorIndex
                    dest.Cells(r, c).Font.FontStyle = .FontStyle
                    dest.Cells(r, c).Font.Italic = .Italic
                    dest.Cells(r, c).Font.Shadow = .Shadow
                    dest.Cells(r, c).Font.Size = .Size
                    dest.Cells(r, c).Font.Strikethrough = .Strikethrough
                    dest.Cells(r, c).Font.Subscript = .Subscript
                    dest.Cells(r, c).Font.Superscript = .Superscript
                    dest.Cells(r, c).Font.Underline = .Underline
                End With
                On Error GoTo 0
            End If

        Next
    Next

    Application.ScreenUpdating = updating

End Sub

Sub test()
    CopyCells Range("b2:c6"), Range("h10"), CopyFormulas + CopyFormats
End Sub</pre>
<p> </p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2011/12/23/excel-copying-cell-valuesformulas-without-using-the-clipboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Bubble Diagrams with Excel, Visio, Graphviz and Graphvizio</title>
		<link>http://www.calvert.ch/maurice/2011/05/10/creating-bubble-diagrams-with-excel-visio-graphviz-and-graphvizio/</link>
		<comments>http://www.calvert.ch/maurice/2011/05/10/creating-bubble-diagrams-with-excel-visio-graphviz-and-graphvizio/#comments</comments>
		<pubDate>Tue, 10 May 2011 19:52:33 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[Graphviz]]></category>
		<category><![CDATA[Graphvizio]]></category>
		<category><![CDATA[visio]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=408</guid>
		<description><![CDATA[Pavel in St. Petersburg asked me if it would be possible to produce bubble diagrams like this in Excel: Excel has had bubble diagrams sine 2003 but they are just an X-Y plot with variable-sized nodes. What Pavel was after is an automatic layout, with lines joining the nodes, along these lines: Not perfect, but <a href='http://www.calvert.ch/maurice/2011/05/10/creating-bubble-diagrams-with-excel-visio-graphviz-and-graphvizio/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Pavel in <a href="http://en.wikipedia.org/wiki/St._Petersburg">St. Petersburg</a> asked me if it would be possible to produce bubble diagrams like this in Excel:</p>
<p><a href="http://www.calvert.ch/maurice/files/2011/05/2009124163835.jpg"><img class="alignnone size-medium wp-image-409" title="UK Public Spending" src="http://www.calvert.ch/maurice/files/2011/05/2009124163835-300x196.jpg" alt="UK Public Spending" width="300" height="196" /></a></p>
<p>Excel has had bubble diagrams sine 2003 but they are just an X-Y plot with variable-sized nodes. What Pavel was after is an automatic layout, with lines joining the nodes, along these lines:</p>
<p><a href="http://www.calvert.ch/maurice/files/2011/05/Bubble1.jpg"><img class="alignnone size-medium wp-image-410" title="Bubble diagram with Graphviz" src="http://www.calvert.ch/maurice/files/2011/05/Bubble1-268x300.jpg" alt="Bubble diagram with Graphviz" width="268" height="300" /></a></p>
<p>Not perfect, but you get the idea, and it&#8217;s produced <strong>automatically</strong>. To do this, you&#8217;ll need Excel, Visio, <a href="http://www.calvert.ch/graphvizio">Graphvizio</a> and <a href="http://www.calvert.ch/download/bubbles.zip">this zip file</a> which contains the sample XLS, GV, VSD and JPG files.</p>
<ul>
<li>Open the XLS. Column A is the node&#8217;s title, B is the title and the amount separated by a newline. Columns C, D and E specify the node&#8217;s parent, colour and amount. Column F computes the diameter of the node, in inches, from the amount:</li>
</ul>
<p><a href="http://www.calvert.ch/maurice/files/2011/05/bubbless1.jpg"><img class="alignnone size-full wp-image-412" title="bubbless1" src="http://www.calvert.ch/maurice/files/2011/05/bubbless1.jpg" alt="" width="708" height="189" /></a></p>
<p>Column G just creates Graphviz DOT statements from the values. G1 and G2 are the prelude. Copying column G into a text file called bubble1.gv, we get:</p>
<pre class="qoate-code">
graph  RootGraph {
node [fontname=Arial, fontsize=12, style=filled];

"Total\n620" [width="3.1", height="3.1", color="gray", fillcolor="gray", shape=circle];

"Children, schools, family\n63"--"Total\n620" [color="pink"]; "Children, schools, family\n63" [width="0.315", height="0.315", color="pink", fillcolor="pink", shape=circle];

"Schools\n42"--"Children, schools, family\n63" [color="pink"]; "Schools\n42" [width="0.21", height="0.21", color="pink", fillcolor="pink", shape=circle];

...snip...

}
</pre>
<ul>
<li>Fire up Visio. Graph&gt;Diagram-&gt;Import Graphviz</li>
<li>To get the circular layout, Graph-&gt;Settings-&gt;Diagram-&gt;Concentric</li>
<li>Graph-&gt;Layout</li>
<li>A little tweaking of the font sizes and line thickness and you&#8217;re on your way</li>
</ul>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2011/05/10/creating-bubble-diagrams-with-excel-visio-graphviz-and-graphvizio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The longest GoogleMaps directions</title>
		<link>http://www.calvert.ch/maurice/2011/03/19/the-longest-googlemaps-directions/</link>
		<comments>http://www.calvert.ch/maurice/2011/03/19/the-longest-googlemaps-directions/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 22:28:51 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[map]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=348</guid>
		<description><![CDATA[You have to hand it to Google&#8217;s engineers, even the best GPS will have a hard job beating this: driving directions from Nordkapp in Norway to Pan Saung in Myanmar (Burma). 14&#8217;281 kilometres will take just over a week of continuous driving: How did I do this in Excel? GeodesiX]]></description>
			<content:encoded><![CDATA[<p>You have to hand it to Google&#8217;s engineers, even the best GPS will have a hard job beating this: driving directions from Nordkapp in Norway to Pan Saung in Myanmar (Burma). 14&#8217;281 kilometres will take just over a week of continuous driving:</p>
<p><a href="http://www.calvert.ch/maurice/wp-content/uploads/2011/03/NordkappPanSaung.bmp"><img class="alignnone size-full wp-image-349" src="http://www.calvert.ch/maurice/wp-content/uploads/2011/03/NordkappPanSaung.bmp" alt="" width="703" height="489" /></a></p>
<p>How did I do this in Excel? <a href="http://www.calvert.ch/geodesix">GeodesiX</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2011/03/19/the-longest-googlemaps-directions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: How to create real Excel RTD servers</title>
		<link>http://www.calvert.ch/maurice/2011/01/08/tutorial-how-to-create-real-excel-rtd-servers/</link>
		<comments>http://www.calvert.ch/maurice/2011/01/08/tutorial-how-to-create-real-excel-rtd-servers/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 16:33:44 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[addin]]></category>
		<category><![CDATA[excel]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=345</guid>
		<description><![CDATA[For those who envisage building an Excel RTD server, I have written a tutorial and open-sourced the code on SourceForge. The following topics are covered: How RTD servers work Architecture Excel, Multithreading and callbacks Providing easy-to-read function names Talking to the GoogleMaps APIs Avoiding Application Domain misery Embedding a GoogleMap page in an Excel Task <a href='http://www.calvert.ch/maurice/2011/01/08/tutorial-how-to-create-real-excel-rtd-servers/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>For those who envisage building an Excel RTD server, I have written <a href="http://www.calvert.ch/geodesix/help/source-code/">a tutorial</a> and open-sourced <a href="https://sourceforge.net/projects/geodesix/">the code on SourceForge</a>.</p>
<p>The following topics are covered:</p>
<ul>
<li>How RTD servers work</li>
<li>Architecture</li>
<li>Excel, Multithreading and callbacks</li>
<li>Providing easy-to-read function names</li>
<li>Talking to the GoogleMaps APIs</li>
<li>Avoiding Application Domain misery</li>
<li>Embedding a GoogleMap page in an Excel Task Pane</li>
<li>Creating the Setup project</li>
<li>Changing the Excel RTD Throttle Interval</li>
<li>Utility functions</li>
<li>Building help from the source with Sandcastle</li>
</ul>
<p>I hope that you will find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2011/01/08/tutorial-how-to-create-real-excel-rtd-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GeodesiX &#8211; Geocoder, Great Circle Distance and Google Maps in Excel</title>
		<link>http://www.calvert.ch/maurice/2010/10/20/geodesix-geocoder-great-circle-distance-and-google-maps-in-excel/</link>
		<comments>http://www.calvert.ch/maurice/2010/10/20/geodesix-geocoder-great-circle-distance-and-google-maps-in-excel/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 15:26:13 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[addin]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[gcd]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[map]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=271</guid>
		<description><![CDATA[Addin for Microsoft Excel which allows you to perform forward and reverse geocoding, both by address and latitude / longitude, calculate Great Circle Distances using Vincenty&#8217;s algorithm, calculate travel distances and durations and verify the results with a Google Maps Task Pane, all inside your comfortable Excel interface. This is useful for creating GoogleMap applications <a href='http://www.calvert.ch/maurice/2010/10/20/geodesix-geocoder-great-circle-distance-and-google-maps-in-excel/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Addin for Microsoft Excel which allows you to perform forward and reverse geocoding, both by address and latitude / longitude, calculate Great Circle Distances using Vincenty&#8217;s algorithm, calculate travel distances and durations and verify the results with a Google Maps Task Pane, all inside your comfortable Excel interface.</p>
<p>This is useful for creating GoogleMap applications to find places from a list, <a href="http://www.calvert.ch/geodesix/offices.htm">like this</a>.</p>
<p>Implements three Excel formulas:</p>
<p><strong>=Geocode(request, location)</strong></p>
<p style="padding-left: 30px"><strong></strong>Request is the field to return:</p>
<ul>
<li><strong>status</strong> The status of the geocode request (Fetching, OK, N matches, etc.)</li>
<li><strong>latitude</strong> The latitude of &#8216;location&#8217;</li>
<li><strong>longitude</strong> The longitude of &#8216;location&#8217;</li>
<li>and so on: formatted_address, country political,administrative_area_level_1 political, administrative_area_level_2 political, administrative_area_level_3 political, locality political, sublocality political, route, street_number, postal_code, types, location_type, partial_match, point_of_interest, establishment, viewpointne, viewpointsw, airport establishment transit_station, bus_station transit_station, establishment, natural_feature, neighborhood political, postal_town, premise, street_address, subpremise</li>
</ul>
<p style="padding-left: 30px">Location is the name or address of a place or point of interest</p>
<p><strong>=GreatCircleDistance(latitude1, longitude1, latitude2, longitude2)</strong></p>
<p style="padding-left: 30px"><strong></strong>Calculates the Great Circle Distance using <a href="http://en.wikipedia.org/wiki/Vincenty's_formulae">Vincenty&#8217;s Formula</a>, with fallback to the <a href="http://en.wikipedia.org/wiki/Haversine_formula">Haversine formula</a> when Vincenty&#8217;s method doesn&#8217;t converge.</p>
<p><strong>=Travel(request, origin, destination, mode)</strong></p>
<p style="padding-left: 30px"><strong></strong>Calculates the distance or duration to get from origin to destination, according to Google Directions.</p>
<p style="padding-left: 30px">Request is the field to return:</p>
<ul>
<li><strong>distance</strong> The distance in metres from origin to destination</li>
<li><strong>duration</strong> The estimated duration from origin to destination</li>
</ul>
<p style="padding-left: 30px">Origin and destination are the names or addresses of the start and finish.</p>
<p style="padding-left: 30px">Mode is the mode of transport to use: Driving, Bicycling or Walking</p>
<p>Free download <a href="http://www.calvert.ch/geodesix/">here</a></p>
<p>Enjoy!</p>
<p>Screenshot, click to enlarge:<br />
<a href="http://www.calvert.ch/maurice/files/2010/10/screenshot.jpg"><img class="alignleft size-medium wp-image-280" src="http://www.calvert.ch/maurice/wp-content/uploads/2010/10/screenshot-300x209.jpg" alt="" width="300" height="209" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2010/10/20/geodesix-geocoder-great-circle-distance-and-google-maps-in-excel/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GraphVizio &#8211; A Graphviz addin for Visio</title>
		<link>http://www.calvert.ch/maurice/2010/05/11/graphvizio-a-graphviz-addin-for-visio/</link>
		<comments>http://www.calvert.ch/maurice/2010/05/11/graphvizio-a-graphviz-addin-for-visio/#comments</comments>
		<pubDate>Tue, 11 May 2010 09:15:23 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[addin]]></category>
		<category><![CDATA[graphic]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[visio]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=248</guid>
		<description><![CDATA[In the process of analysing a client&#8217;s existing database, I used Visio&#8217;s reverse-engineering tool. It works well, but the resulting diagram was an incomprehensible bowl of spaghetti. Visio does have a &#8220;Layout shapes&#8221; command, which appears to work by moving shapes with repulsive forces and the result is, not surprisingly, repulsive. What I wanted was <a href='http://www.calvert.ch/maurice/2010/05/11/graphvizio-a-graphviz-addin-for-visio/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>In the process of analysing a client&#8217;s existing database, I used Visio&#8217;s reverse-engineering tool. It works well, but the resulting diagram was an incomprehensible bowl of spaghetti. Visio does have a &#8220;Layout shapes&#8221; command, which appears to work by moving shapes with repulsive forces and the result is, not surprisingly, repulsive.</p>
<p>What I wanted was a tool which would unravel the spaghetti, so that I could get a grasp of the relationships, edit and revise them and layout again in an iterative process.<br />
Searching for a solution, I found three layout programs, none of which have a Visio interface:</p>
<ol>
<li><a href="http://research.microsoft.com/en-us/projects/msagl/">Microsoft Automatic Graph Layout (MSAGL), formerly known as GLEE</a> The first version, GLEE, is free whereas MSAGL costs between 99 USD and 279 USD depending on where you buy it.</li>
<li><a href="http://www.tomsawyer.com/products/index.php">Tom Sawyer Layout</a> is also a graph layout library, the price isn&#8217;t disclosed on their website.</li>
<li><a href="http://www.graphviz.org/">Graphviz</a> from AT&amp;T research labs, reputed to have the most sophisticated layout algorithms, is free.</li>
</ol>
<p>Given that the best quality was to be found in the free library, I made the obvious choice.<br />
It took me over a year and some 11&#8217;000 lines of VB to get Visio and Graphviz to co-exist; marrying a Unix-style command-line program with a WYSIWYG interface, both with quirks to numerous to mention, was far more challenging than I initially thought.<br />
The result, unimaginatively called GraphVizio, is available <a href="http://www.calvert.ch/graphvizio/">here</a>, I hope you&#8217;ll find it useful.</p>
<p><strong>25 May 2011 Version 1.1.5 released. Improvements:</strong></p>
<p>Full support for 64-bit Windows and Visio</p>
<p>No longer makes a Visio document &#8216;dirty&#8217; when opening</p>
<p>Full support for UTF8. This DOT file:</p>
<pre>graph  RootGraph {
  node [width="7.08661417322834", height="0.787401574803148", color="#000000", fillcolor="#FFFFFF", fontname=Calibri, fontsize=24, style=filled, shape=box];
  edge [color="#000000", fillcolor="#FFFFFF"];

  "English: Hello, my name is Maurice\n(and blame Google if the translations are bad)" [pos="283.704566929134,620.932913385827", label="English: Hello, my name is Maurice\n(and blame Google if the translations are bad)"];
  "Russian: Здравствуйте, меня зовут Морис" [pos="283.704566929134,526.932913385827", label="Russian: Здравствуйте, меня зовут Морис"];
  "مرحبا، اسمي موريس : Arabic" [pos="283.704566929134,432.932913385827", label="مرحبا، اسمي موريس : Arabic"];
  "Chinese: 你好，我叫莫里斯" [pos="283.704566929134,338.932913385827", label="Chinese: 你好，我叫莫里斯"];
  "שלום, שמי הוא מוריס : Hebrew" [pos="283.704566929134,244.932913385827", label="שלום, שמי הוא מוריס : Hebrew"];
  "Japanese: こんにちは、私の名前はモーリスです" [pos="283.704566929134,150.932913385826", label="Japanese: こんにちは、私の名前はモーリスです"];
  "Thai: สวัสดีชื่อของฉันคือ Maurice" [pos="283.704566929134,56.9329133858268", label="Thai: สวัสดีชื่อของฉันคือ Maurice"];

  "English: Hello, my name is Maurice\n(and blame Google if the translations are bad)"--"Russian: Здравствуйте, меня зовут Морис";
  "Russian: Здравствуйте, меня зовут Морис"--"مرحبا، اسمي موريس : Arabic";
  "مرحبا، اسمي موريس : Arabic"--"Chinese: 你好，我叫莫里斯";
  "Chinese: 你好，我叫莫里斯"--"שלום, שמי הוא מוריס : Hebrew";
  "שלום, שמי הוא מוריס : Hebrew"--"Japanese: こんにちは、私の名前はモーリスです";
  "Japanese: こんにちは、私の名前はモーリスです"--"Thai: สวัสดีชื่อของฉันคือ Maurice";
}</pre>
<p>produces this Visio diagram:</p>
<div id="attachment_462" class="wp-caption alignnone" style="width: 627px"><a href="http://www.calvert.ch/maurice/files/2010/05/GraphvizioUTF82.jpg"><img class="size-full wp-image-462" title="Graphvizio UTF8" src="http://www.calvert.ch/maurice/files/2010/05/GraphvizioUTF82.jpg" alt="" width="617" height="843" /></a>
<p class="wp-caption-text">Graphvizio UTF8</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2010/05/11/graphvizio-a-graphviz-addin-for-visio/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Displaying images using the RES: protocol from a IE BHO</title>
		<link>http://www.calvert.ch/maurice/2009/08/27/displaying-images-using-the-res-protocol-from-a-ie-bho/</link>
		<comments>http://www.calvert.ch/maurice/2009/08/27/displaying-images-using-the-res-protocol-from-a-ie-bho/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 15:12:11 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[addin]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=156</guid>
		<description><![CDATA[Problem: You&#8217;re using Visual Studio to write a Browser Helper Object for Internet Explorer and you want to add some images to the web page being displayed. Here is an example, taken from my Affine addin. The two images I insert are shown by the arrow: Finding out how to do this is trickier than <a href='http://www.calvert.ch/maurice/2009/08/27/displaying-images-using-the-res-protocol-from-a-ie-bho/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Problem: You&#8217;re using Visual Studio to write a Browser Helper Object for Internet<br />
Explorer and you want to add some images to the web page being displayed.</p>
<p>Here is an example, taken from my <a href="http://www.calvert.ch/affine">Affine addin</a>. The two images I insert are shown by the arrow:</p>
<p><img class="alignleft size-full wp-image-161" style="border:1px solid" src="http://www.calvert.ch/maurice/files/2009/08/ss11.jpg" alt="Affine in action" width="496" height="201" /></p>
<p>Finding out how to do this is trickier than expected, so here&#8217;s the recipe:</p>
<ol>
<li>Import the images into the project and create a .RC file which identifies them:<br />
<blockquote><p>affinehide.bmp bitmap &#034;affinehide.bmp&#034;<br />
affinefade.bmp bitmap &#034;affinefade.bmp&#034;</p></blockquote>
<p>I called this file images.rc in the images directory in my project.</li>
<li>You&#8217;ll need RC.EXE, the resource compiler, which is in the Windows SDK. The<br />
2008 version for .NET 3.5 is <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=53F9CBB4-B4AF-4CF2-BFE5-260CFB90F7C3&amp;displaylang=en">here</a></li>
<li>In your setup project&#8217;s, set the prebuild event to<br />
<blockquote><p>&#034;D:Affinerc.exe&#034; /r &#034;d:affineimagesimages.rc&#034;</p></blockquote>
<p>I copied RC.exe into my project directory because I sometimes work on a 64-bit box, where Program Files becomes Program Files (X86). Adjust the paths to suit your installation.</li>
<li>Open your project&#8217;s .VBPROJ file and insert the three red lines shown:<br />
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#034;utf-8&#034;?&gt;<br />
&lt;Project DefaultTargets=&#034;Build&#034;<br />
xmlns=&#034;http://schemas.microsoft.com/developer/msbuild/2003&#034;<br />
ToolsVersion=&#034;3.5&#034;&gt;<span style="color:red;font-weight:bold"><br />
&lt;PropertyGroup&gt;<br />
&lt;Win32Resource&gt;imagesimages.res&lt;/Win32Resource&gt;<br />
&lt;/PropertyGroup&gt;</span><br />
&lt;PropertyGroup&gt;<br />
&lt;Configuration Condition=&#034; &#039;$(Configuration)&#039; == &#039;&#039; &#034;&gt;Debug&lt;/Configuration&gt;
</p></blockquote>
<p>Thanks to <a href="http://blogs.infosupport.com/blogs/wouterv/">Wouter van Vugt</a> for this!</li>
<li>The HTML to insert the images is straightforward:<br />
<blockquote><p>&lt;img src=&#034;res://affine.dll/#2/affinehide.bmp&#034;</p></blockquote>
<p>where #2 means that the embedded object is an image<br />
Assuming this string is stored in the variable &#034;buttonhtml&#034; then the code to insert the button on the page is</p>
<blockquote><p>a.insertAdjacentHTML(&amp;#34afterEnd&amp;#34, buttonhtml)</p></blockquote>
</li>
<li>Now for the events. You need an event handler for the DHTML event itself:<br />
<blockquote><p>
Imports mshtml<br />
Public Delegate Sub DHTMLEvent(ByVal e As IHTMLEventObj)<br />
 _<br />
Public Class DHTMLEventHandler<br />
    Public Handler As DHTMLEvent<br />
    Private Document As mshtml.IHTMLDocument<br />
    Public Sub New(ByVal doc As mshtml.IHTMLDocument)<br />
        Me.Document = doc<br />
    End Sub<br />
     _<br />
    Public Sub [Call]()<br />
        Handler(CType(Document.parentWindow.event, mshtml.IHTMLEventObj))<br />
    End Sub<br />
End Class</p></blockquote>
<p>Thanks to <a href="http://www.west-wind.com/Weblog/posts/393.aspx">Rick Strahl</a></li>
<li>A handler which the above will call, to actually deal with the event:<br />
<blockquote><p>
Imports mshtml<br />
Module BrowserEventHandler_<br />
    Public Sub BrowserEventHandler(ByVal e As mshtml.IHTMLEventObj)<br />
        Try<br />
            If e.type = &#034;click&#034;&#8221; AndAlso e.srcElement.tagName = &#034;IMG&#034; Then<br />
&#8230;</p></blockquote>
<li>and finally tghe code to add in in your DocumentComplete event:<br />
<blockquote><p>
Dim Handler As DHTMLEventHandler = New DHTMLEventHandler(doc)<br />
Handler.Handler = AddressOf BrowserEventHandler<br />
doc.onclick = Handler</p></blockquote>
</li>
</ol>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2009/08/27/displaying-images-using-the-res-protocol-from-a-ie-bho/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MS SQL Server ISNUMERIC bug &#8211; the joys of separators</title>
		<link>http://www.calvert.ch/maurice/2009/07/01/ms-sql-server-isnumeric-bug-the-joys-of-separators/</link>
		<comments>http://www.calvert.ch/maurice/2009/07/01/ms-sql-server-isnumeric-bug-the-joys-of-separators/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 09:56:43 +0000</pubDate>
		<dc:creator>maurice</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.calvert.ch/maurice/?p=149</guid>
		<description><![CDATA[From an early age I have practised defensive programming. On a recent project, I was loading data entered on an intranet site to an SQL Server table. Wary, I used SQL&#8217;s ISNUMERIC function to validate the numbers users had entered. It worked fine for a few weeks, until somone entered a comma as a decimal <a href='http://www.calvert.ch/maurice/2009/07/01/ms-sql-server-isnumeric-bug-the-joys-of-separators/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>From an early age I have practised defensive programming. On a recent project, I was loading data entered on an intranet site to an SQL Server table. Wary, I used SQL&#8217;s ISNUMERIC function to validate the numbers users had entered. It worked fine for a few weeks, until somone entered a comma as a decimal separator. It turns out that ISNUMERIC accepts this, whereas casting doesn&#8217;t. Here&#8217;s the proof:</p>
<p><img class="aligncenter size-full wp-image-150" src="http://www.calvert.ch/maurice/files/2009/07/isnumeric.jpg" alt="isnumeric" width="418" height="441" /></p>
<p>Doubtless, MS will try and wriggle out by saying that it depends on how your international settings are made. My contention is that if ISNUMERIC says it is then you should be able to CAST it to a number.</p>
<p>Period. </p>
<p>(sorry for the weak pun)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calvert.ch/maurice/2009/07/01/ms-sql-server-isnumeric-bug-the-joys-of-separators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

