<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5159270228810038336</id><updated>2011-12-17T16:37:10.495Z</updated><category term='silverlight bingmaps visualization'/><title type='text'>martimedia</title><subtitle type='html'>Rich internet enabled applications.
Martimedia is a small Silverlight consultancy based in Suffolk,England.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-3927879878446226285</id><published>2011-02-23T16:26:00.001Z</published><updated>2011-02-24T13:00:59.946Z</updated><title type='text'>British visitor attractions 2010</title><content type='html'>&lt;p&gt;Using &lt;a href="http://martimedia.blogspot.com/2010/09/google-fusion-tables.html"&gt;Google fusion tables&lt;/a&gt; and data from the AVLA via the &lt;a href="http://www.guardian.co.uk/news/datablog/2011/feb/23/british-tourist-attractions-visitor-figures?CMP=twt_fd#data"&gt;Guardian&lt;/a&gt; I’ve created the following map of the top visitor attractions across the UK for 2010.&lt;/p&gt; &lt;iframe height="600" src="http://www.google.com/fusiontables/embedviz?viz=MAP&amp;amp;q=select+col0%2C+col6%2C+col7%2C+col2%2C+col3%2C+col4%2C+col5+from+494484+&amp;amp;h=false&amp;amp;lat=51.57706953722567&amp;amp;lng=0.68115234375&amp;amp;z=7&amp;amp;t=1&amp;amp;l=col7" width="800" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;Note: Sites with more than 1 million visitors a year are displayed with a larger sized pin. To see it without the frame check out the &lt;a href="http://www.google.com/fusiontables/embedviz?viz=MAP&amp;amp;q=select+col0%2C+col6%2C+col7%2C+col2%2C+col3%2C+col4%2C+col5+from+494484+&amp;amp;h=false&amp;amp;lat=51.57706953722567&amp;amp;lng=0.68115234375&amp;amp;z=7&amp;amp;t=1&amp;amp;l=col7"&gt;full screen version here&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-3927879878446226285?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/3927879878446226285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=3927879878446226285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/3927879878446226285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/3927879878446226285'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2011/02/british-visitor-attractions-2010.html' title='British visitor attractions 2010'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-780406689396890204</id><published>2010-12-14T17:58:00.002Z</published><updated>2011-02-08T13:26:59.951Z</updated><title type='text'>River of News, consuming a JSONP data feed</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;i&gt; UPDATE:&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;With the release of JQUERY 1.5 this post is now out of date, also Dave is updating his JSONP feed to make consuming of the feed easier. Once this is completed I'll update the blog with a new post on, but for now see post on &lt;a href="http://groups.google.com/group/river-of-news/browse_thread/thread/baa9e515fd61967f"&gt;River of News news group&lt;/a&gt; .&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span  &gt;Recently Dave Winer, a pioneer of RSS, published a &lt;a href="http://scripting.com/stories/2010/12/06/innovationRiverOfNewsInJso.html"&gt;river of news&lt;/a&gt; feed via JSONP. This article shows how to consume such a feed and the pitfalls of JSONP. For starters check out the demo at &lt;/span&gt;&lt;a href="http://martimedia.com/news.htm"&gt;&lt;span   &gt;http://martimedia.com/news.htm&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;a href="http://martimedia.com/news.htm"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="river-of-news" border="0" alt="river-of-news" src="http://lh6.ggpht.com/_huphup02COI/TQe0XiPUBsI/AAAAAAAAAHo/T8tNj6T4XE0/river-of-news%5B4%5D.png?imgmax=800" width="804" height="387" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span &gt;&lt;span &gt;To create the page I made use of the following JavaScript libraries&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span &gt;&lt;span &gt;&lt;a href="http://jquery.com/" target="_blank"&gt;jQuery&lt;/a&gt; – Makes writing clean / cross browser JavaScript a breeze &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span &gt;&lt;span &gt;&lt;a href="http://api.jquery.com/jQuery.template/" target="_blank"&gt;jQuery.templates&lt;/a&gt; –Separates the presentation (HTML) from code(js) &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;span &gt;&lt;span &gt;&lt;a href="http://jquery-jsonp.googlecode.com/" target="_blank"&gt;jQuery.jsonp&lt;/a&gt; – Provides jsonp error handling&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Step 1 – Download the news feed&lt;/h2&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;In the past I’ve just used the jQuery $.get command to download the feed, but luckly, Dave was having teething problems causing timeouts and formatting errors. But $.get wasn’t returning any feedback on these errors. After a bit of goggling I found the following article on &lt;a href="http://stackoverflow.com/questions/1002367/jquery-ajax-jsonp-ignores-a-timeout-and-doesnt-fire-the-error-event" target="_blank"&gt;StackOverflow&lt;/a&gt; which indicates that JSONP requests don’t make use of XHR hence lack of error handling. To overcome this problem &lt;a href="http://jquery-jsonp.googlecode.com/" target="_blank"&gt;jQuery.jsonp&lt;/a&gt; is recommended. This is similar to $.get but supports error handling for &lt;strong&gt;timeouts&lt;/strong&gt; and &lt;strong&gt;invalid JSONP&lt;/strong&gt;.&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 96.63%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; height: 267px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; $.jsonp({&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;               dataType: 'jsonp',&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;               timeout: 10000,&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;               url: 'http://jsonp.scripting.com/daveRiver.json?callback=?',&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;               success: function (data,status) {&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;                     ProcessData(data);&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;               },&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;               error: function(XHR, textStatus, errorThrown){&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;                       if ( textStatus == "timeout")&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;                           $("#newsFeed").text("Sorry, your request to scripting.com has timed out, please try again later");&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;                       else if ( textStatus == "error")&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;                           $("#newsFeed").text("Sorry, response from scripting.com is corrupted, please try again later");&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;                   }&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;       });&lt;/pre&gt;
 &lt;/div&gt;
&lt;/div&gt;

&lt;blockquote&gt; &lt;/blockquote&gt;

&lt;h2&gt;Step 2 – Process the news feed&lt;/h2&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;Typically we would now write a load of jQuery to create HTML response, but in the new world of jQuery.templates we’re going to separate presentation from the code. This makes the code a lot cleaner and easier for others to reuse. In our example we’re not going to do any processing of the data, but just bind the data to the jQuery template with the following code:&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
 &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; $("#newsFeed").html("");&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; $("#newsTmpl").tmpl(data.updatedFeeds).appendTo("#newsFeed");&lt;/pre&gt;
 &lt;/div&gt;
&lt;/div&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;

&lt;h2&gt;Step 3 – Generate HTML via a template&lt;/h2&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;If you’re not familiar with templates then check out &lt;a href="http://encosia.com/2010/11/10/composition-with-jquery-templates-why-and-how/" target="_blank"&gt;encosia blog&lt;/a&gt; . For Dave’s feed we have an array of feeds, which contain one or more stories. To keep us on our toes, Dave returns an object if the feed contains 1 item or an array for 2 or more items.&lt;/p&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;

&lt;div&gt;
 &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="newsTmpl"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="text/x-jquery-tmpl"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   {{each(f,feed) updatedFeed}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;       &amp;lt;h2&amp;gt;${feed.feedTitle}&amp;lt;/h2&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;       {{&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; feed.item.length &amp;gt; 1 }}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;       {{each(i,item) feed.item}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;                   &amp;lt;div &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'item'&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;                   &amp;lt;span &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'date'&lt;/span&gt;&amp;gt;${format_date(item.pubDate)}&amp;lt;/span&amp;gt; ${item.title} &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;                   &amp;lt;a href=&lt;span style="color: #006080"&gt;'${item.link}'&lt;/span&gt;&amp;gt;${get_hostname_from_url(item.link)}&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;                   &amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;           &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;           {{/each}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;       {{&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                   &amp;lt;div &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'item'&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;                   &amp;lt;span &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'date'&lt;/span&gt;&amp;gt;${format_date(feed.item.pubDate)}&amp;lt;/span&amp;gt; ${feed.item.title} &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;                   &amp;lt;a href=&lt;span style="color: #006080"&gt;'${feed.item.link}'&lt;/span&gt;&amp;gt;${get_hostname_from_url(feed.item.link)}&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;                   &amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;       {{/&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;   {{/each}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;   &lt;/pre&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
 &lt;/div&gt;
&lt;/div&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;

&lt;h2&gt;Step 4 – Some formatting&lt;/h2&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt; &lt;/p&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;To make it look pretty I made use of the &lt;a href="http://www.colorzilla.com/gradient-editor/" target="_blank"&gt;colorzilla gradient editor&lt;/a&gt; , and a couple of helper functions to format the date and hostname.&lt;/p&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;

&lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;

&lt;p&gt;Putting it all together in less than 100 lines of CSS/HTML/JS we have …..&lt;/p&gt;



&lt;div&gt;
 &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: #800000"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: #ff0000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;River of News&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;meta&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Description"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;content&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Example of consuming a JSONP data feed (http://scripting.com) via jQuery and jQuery Templates."&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;link&lt;/span&gt; &lt;span style="color: #ff0000"&gt;rel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="stylesheet"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="text/css"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://yui.yahooapis.com/3.2.0/build/cssfonts/fonts-min.css"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;style&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="text/css"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;     body { /* generated via http://www.colorzilla.com/gradient-editor/ */&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     background: #87e0fd; /* old browsers */&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;     background: -moz-linear-gradient(left, #87e0fd 0%, #53cbf1 40%, #05abe0 100%); /* firefox */&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     background: -webkit-gradient(linear, left top, right top, color-stop(0%,#87e0fd), color-stop(40%,#53cbf1), color-stop(100%,#05abe0)); /* webkit */&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87e0fd', endColorstr='#05abe0',GradientType=1 ); /* ie */&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     }&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;     #page { width:800px; padding:20px 60px 20px 60px; margin:60px; min-height:600px; background:white; }&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;     .date { font-size:80%; color:#888; vertical-align:top; }&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     #footer { padding-top:20px; }&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;head&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;body&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="page"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;River of News&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Powered by Dave Winer &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://scripting.com/stories/2010/12/06/innovationRiverOfNewsInJso.html"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;river of news&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; feed&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;hr&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;                 &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;='newsFeed'&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Loading news from scripting.com, please wait.....&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;        &lt;span style="color: #008000"&gt;&amp;lt;!-- news feed via template inserted here --&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;  &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="newsTmpl"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="text/x-jquery-tmpl"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     {{each(f,feed) updatedFeed}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;         &amp;lt;h2&amp;gt;${feed.feedTitle}&amp;lt;/h2&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         {{&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; feed.item.length &amp;gt; 1 }}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         {{each(i,item) feed.item}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;                     &amp;lt;div &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'item'&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;                     &amp;lt;span &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'date'&lt;/span&gt;&amp;gt;${format_date(item.pubDate)}&amp;lt;/span&amp;gt; ${item.title} &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;                     &amp;lt;a href=&lt;span style="color: #006080"&gt;'${item.link}'&lt;/span&gt;&amp;gt;${get_hostname_from_url(item.link)}&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;                     &amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;             &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;             {{/each}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;         {{&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;                     &amp;lt;div &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'item'&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                     &amp;lt;span &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;=&lt;span style="color: #006080"&gt;'date'&lt;/span&gt;&amp;gt;${format_date(feed.item.pubDate)}&amp;lt;/span&amp;gt; ${feed.item.title} &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;                     &amp;lt;a href=&lt;span style="color: #006080"&gt;'${feed.item.link}'&lt;/span&gt;&amp;gt;${get_hostname_from_url(feed.item.link)}&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;                     &amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;         {{/&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     {{/each}}&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;     &lt;/pre&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;     &amp;lt;hr /&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &amp;lt;p id=footer&amp;gt;Check &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; my &amp;lt;a href=&lt;span style="color: #006080"&gt;"http://martimedia.blogspot.com/"&lt;/span&gt;&amp;gt;martimedia blog&amp;lt;/a&amp;gt;, &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     or my company website at &amp;lt;a href=http:&lt;span style="color: #008000"&gt;//martimedia.com/&amp;gt;martimedia.com&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &amp;lt;/body&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; &amp;lt;script type=&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt; src=&lt;span style="color: #006080"&gt;"http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;/script&amp;gt; &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;script type=&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt; src=&lt;span style="color: #006080"&gt;"http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &amp;lt;script type=&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt; src=&lt;span style="color: #006080"&gt;"http://jquery-jsonp.googlecode.com/files/jquery.jsonp-1.0.4.min.js"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &amp;lt;script type=&lt;span style="color: #006080"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     $(&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; () { &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         $.jsonp({&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;                 dataType: &lt;span style="color: #006080"&gt;'jsonp'&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;                 timeout: 10000,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;                 url: &lt;span style="color: #006080"&gt;'http://jsonp.scripting.com/daveRiver.json?callback=?'&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;                 success: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; (data,status) {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;                         $(&lt;span style="color: #006080"&gt;"#newsFeed"&lt;/span&gt;).html(&lt;span style="color: #006080"&gt;""&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;                         $(&lt;span style="color: #006080"&gt;"#newsTmpl"&lt;/span&gt;).tmpl(data.updatedFeeds).appendTo(&lt;span style="color: #006080"&gt;"#newsFeed"&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;                 },&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;                 error: &lt;span style="color: #0000ff"&gt;function&lt;/span&gt;(XHR, textStatus, errorThrown){&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ( textStatus == &lt;span style="color: #006080"&gt;"timeout"&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;                             $(&lt;span style="color: #006080"&gt;"#newsFeed"&lt;/span&gt;).text(&lt;span style="color: #006080"&gt;"Sorry, your request to scripting.com has timed out, please try again later"&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ( textStatus == &lt;span style="color: #006080"&gt;"error"&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;                             $(&lt;span style="color: #006080"&gt;"#newsFeed"&lt;/span&gt;).text(&lt;span style="color: #006080"&gt;"Sorry, response from scripting.com is corrupted, please try again later"&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;                             $(&lt;span style="color: #006080"&gt;"#newsFeed"&lt;/span&gt;).text(&lt;span style="color: #006080"&gt;"Error, status: "&lt;/span&gt; + textStatus + &lt;span style="color: #006080"&gt;", please try again later"&lt;/span&gt; );&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;                     },&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;         });&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;     });&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;     &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; format_date(date) {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; newDate = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Date( Date.parse(date));&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; newDate.toLocaleTimeString();&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;  &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; get_hostname_from_url(url) {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;         url = url.match(/:\/\/(.[^/]+)/)[1];&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;         url = url.replace(&lt;span style="color: #006080"&gt;"www."&lt;/span&gt;,&lt;span style="color: #006080"&gt;""&lt;/span&gt;).replace(&lt;span style="color: #006080"&gt;"feedproxy."&lt;/span&gt;,&lt;span style="color: #006080"&gt;""&lt;/span&gt;).replace(&lt;span style="color: #006080"&gt;"feeds."&lt;/span&gt;,&lt;span style="color: #006080"&gt;""&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; url;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;     &lt;/pre&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;script&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;   &lt;/pre&gt;

   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;html&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
 &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Feel free to use the code to create your own river of news, I just ask you to post your examples in the comments section below.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-780406689396890204?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/780406689396890204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=780406689396890204' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/780406689396890204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/780406689396890204'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2010/12/river-of-news-consuming-jsonp-data-feed.html' title='River of News, consuming a JSONP data feed'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_huphup02COI/TQe0XiPUBsI/AAAAAAAAAHo/T8tNj6T4XE0/s72-c/river-of-news%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-7682828779286955633</id><published>2010-09-07T19:10:00.001+01:00</published><updated>2010-09-07T19:23:58.386+01:00</updated><title type='text'>Google fusion tables</title><content type='html'>&lt;p&gt;In the past I’ve created a few data visualisations using Silverlight, but though for smaller datasets a HTML solution would be preferable. Now with the help of &lt;a href="http://tables.googlelabs.com/" target="_blank"&gt;Google fusion tables&lt;/a&gt; I can create simple datasets with custom info windows without the need to write any code.&lt;/p&gt; &lt;iframe style="width: 763px; height: 474px" height="300" src="http://tables.googlelabs.com/embedviz?viz=MAP&amp;amp;q=select+col0%2Ccol1%2Ccol2%2Ccol3%2Ccol4%2Ccol5%2Ccol6%2Ccol7+from+247676+&amp;amp;h=false&amp;amp;lat=51.85613885029435&amp;amp;lng=-1.1865234375&amp;amp;z=7&amp;amp;t=1&amp;amp;l=col3" width="500" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;In the example above we’ve created a Google Map showing expenditure of Primary Care Trusts(PCT) across the England, when you click on a PCT it will display a custom tooltip.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_huphup02COI/TIaACC9e17I/AAAAAAAAAHU/uAqR75M9N8A/s1600-h/info_window%5B2%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="info_window" border="0" alt="info_window" src="http://lh4.ggpht.com/_huphup02COI/TIaACvDLfbI/AAAAAAAAAHY/UHolVz61dfk/info_window_thumb.jpg?imgmax=800" width="235" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To create this visualisation without any code I carried out the following 6 steps:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1 – Grab the data&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;For this example we’ve taken data shared by the &lt;a href="http://www.guardian.co.uk/news/datablog/2010/sep/07/nhs-consultancy-spending-lansley" target="_blank"&gt;Guardian Data Blog&lt;/a&gt; as a Google Spreadsheet, this is downloaded as an excel spreadsheet, which I removed rows such as the spreadsheet title and “regional total” rows. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2 – Add geo hinting&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;To help Google geo-code the data I took the PCT name e.g. “Barnsley PCT” and region “Yorkshire and the Humber” to create a location column e.g. “Barnsley,Yorkshire and the Humber,England”&lt;/p&gt;  &lt;p&gt;Without the hinting Google will assume the location is in the USA.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 3 – Upload to Google&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now with the geocoding hints in place we can upload the data, label the columns (important for step 5) and tell Google which column to use for location.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 4 – Geocode data&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;To geocode the data simply select the “visualize” menu bar and select “map” this will geo-code the locations to lat/long points.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 5 – Configure info window and styles&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now we have a map with lots of small dots for each PCT, choose “Configure styles” to change your pin style, and “Configure info window” to personalise the info window. For my demo I chose the custom template based on a mixture of HTML and meta data for field place holders.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_huphup02COI/TIaADVYK4UI/AAAAAAAAAHc/U1aXUirlHm8/s1600-h/configure_info%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="configure_info" border="0" alt="configure_info" src="http://lh4.ggpht.com/_huphup02COI/TIaAEEBVwUI/AAAAAAAAAHg/_-Q-JfkTbUU/configure_info_thumb%5B2%5D.jpg?imgmax=800" width="668" height="443" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 6 – Share and embed&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Finally click on the “Share” button and select Visibility options Unlisted or public to share the data. Once the data is public we can use “Get Embeddable link” to get the HTML to embed in your website / blog&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;iframe&lt;/span&gt; &lt;span style="color: #ff0000"&gt;width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;500px&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;300px&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;scrolling&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;no&amp;quot;&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://tables.googlelabs.com/embedviz?viz=MAP&amp;amp;q=select+col0%2Ccol1%2Ccol2%2Ccol3%2Ccol4%2Ccol5%2Ccol6%2Ccol7+from+247676+&amp;amp;h=false&amp;amp;lat=51.78483389373529&amp;amp;lng=-1.197509765625&amp;amp;z=8&amp;amp;t=1&amp;amp;l=col3&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;iframe&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Note: We can also export the data to KML, which could then be used in your preferred mapping solution, be it Bing Maps for Silverlight, Google Earth etc..&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-7682828779286955633?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/7682828779286955633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=7682828779286955633' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/7682828779286955633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/7682828779286955633'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2010/09/google-fusion-tables.html' title='Google fusion tables'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_huphup02COI/TIaACvDLfbI/AAAAAAAAAHY/UHolVz61dfk/s72-c/info_window_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-7474476913382271471</id><published>2010-07-08T19:32:00.000+01:00</published><updated>2010-07-08T19:38:47.820+01:00</updated><title type='text'>Part 3 of 3 - Creating a Custom Silverlight Pivot View application</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This series of articles cover the process from concept to release of how RoomSeeker.eu integrated visual search &lt;b&gt;using Pivot Viewer for Silverlight&lt;/b&gt;:&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/how-roomseekereu-integrated-visual.html"&gt;Part 1 – What is Pivot?&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-pivot-collection.html"&gt;Part 2 – Creating a Pivot Collection&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Part 3 – Creating a custom Silverlight Pivot View application (this article)&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Part 3 of 3&amp;#160; Pivot View Silverlight App, Deployment and Summary&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Create Silverlight Pivot App&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium &amp;#39;Times New Roman&amp;#39;; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="text-align: left; line-height: 16px; font-family: verdana, arial, sans-serif; font-size: 13px" class="Apple-style-span"&gt;The screen shot below shows how we’ve integrated a Pivot collection based on the&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;b&gt;Silverlight Pivot Viewer Control&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;into our site in the form of a visual search page, you can try it out&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;a style="color: rgb(225,119,30)" href="http://roomseeker.eu/content/pivot.htm"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium &amp;#39;Times New Roman&amp;#39;; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="text-align: left; line-height: 16px; font-family: verdana, arial, sans-serif; font-size: 13px" class="Apple-style-span"&gt;&lt;a style="color: rgb(225,119,30)" title="Screen shot of Roomseeker pivot view app - click to go to live site" href="http://roomseeker.eu/content/pivot.htm"&gt;&lt;img style="border-bottom: rgb(0,0,0) 0px solid; border-left: rgb(0,0,0) 0px solid; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; display: block; float: none; margin-left: auto; border-top: rgb(0,0,0) 0px solid; margin-right: auto; border-right: rgb(0,0,0) 0px solid; padding-top: 4px" title="clip_image002" border="0" alt="clip_image002" src="http://lh6.ggpht.com/_huphup02COI/TDYITmSRbSI/AAAAAAAAAGo/gW84nPCf8n4/clip_image002%5B7%5D.gif?imgmax=800" width="528" height="397" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;/span&gt;    &lt;p align="center"&gt;&lt;b&gt;RoomSeeker.eu Visual Search page&lt;/b&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The app is a simple host for the Pivot Silverlight Control, with the addition of some buttons in the top right to select the collection ( East, South East, South West England etc.) and a back button in the left hand side to enable the user to see a previous query.&lt;/p&gt;  &lt;p&gt;When the user zooms in we’ve added two custom buttons in the top right hand corner&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Hotel Rates &amp;amp; Availability – Navigate the user to hotel info web page &lt;/li&gt;    &lt;li&gt;Hotels nearby – Navigate user to hotels for the given tow (Histon in this case) &lt;/li&gt; &lt;/ul&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font face="Arial"&gt;&lt;span style="mso-no-proof: yes"&gt;&lt;a href="http://lh4.ggpht.com/_huphup02COI/TDYWqu2XDPI/AAAAAAAAAHE/xEL6YPeOs40/s1600-h/clip_image002%5B3%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image002" border="0" alt="clip_image002" src="http://lh6.ggpht.com/_huphup02COI/TDYWrJLbn8I/AAAAAAAAAHI/Su5vCW0aUT4/clip_image002_thumb%5B1%5D.gif?imgmax=800" width="298" height="291" v:shapes="Picture_x0020_7" /&gt;&lt;/a&gt;&lt;/span&gt; &lt;/font&gt;    &lt;p&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt; &lt;span style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: medium &amp;#39;Times New Roman&amp;#39;; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" class="Apple-style-span"&gt;&lt;span style="text-align: left; line-height: 16px; font-family: verdana, arial, sans-serif; font-size: 13px" class="Apple-style-span"&gt;     &lt;p align="left"&gt;Even though the app is quite basic and probably needs a few more iterations, it’s already provided useful for queries such as:&lt;/p&gt;      &lt;ul&gt;       &lt;li&gt;         &lt;div style="line-height: 1.3em; margin: 0px 0px 0.75em" align="left"&gt;“Show me all the AA rated hotels that take pets and cost less than £150 in the South East of England”&lt;/div&gt;       &lt;/li&gt;        &lt;li&gt;         &lt;div style="line-height: 1.3em; margin: 0px 0px 0.75em" align="left"&gt;“Show me all beach hotels group by town in Suffolk”&lt;/div&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/span&gt;&lt;/span&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;Future improvements:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;Deep linking&lt;/em&gt; – Currently I cannot share links via social networks e.g. &lt;i&gt;click here for a list of golfing hotels in Suffolk&lt;/i&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;Browser navigation&lt;/em&gt; button integration – Make use of browsers back and forward buttons to flip between filters. &lt;/li&gt;    &lt;li&gt;&lt;em&gt;Dynamic pivot collections&lt;/em&gt; to overcome regional search limitations e.g. “Show me all hotels in England with golf courses” &lt;/li&gt;    &lt;li&gt;Silverlight hotel information pages, rather than navigating to a separate web page &lt;/li&gt;    &lt;li&gt;Analytics &lt;/li&gt;    &lt;li&gt;Improved search panel &lt;/li&gt;    &lt;li&gt;Custom loading page – % loading plus some help &lt;/li&gt;    &lt;li&gt;Help for first time user, online video help (would be good if Microsoft had an intro to Pivot video we could embed in the app) &lt;/li&gt;    &lt;li&gt;Use of MEF for custom search / branding options &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;i&gt;Issues: &lt;/i&gt;Even though the app doesn’t do a lot the Pivot control and it’s dependences (including System.Xml.Serialization) result in a 800K xap file (2.5MB unzipped!). I’m sure this could be reduced by removing the decency on the Silverlight 4 Toolkit (April 2010).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Deployment&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Creating the deep zoom images is very CPU/IO intensive so these tasks were performed on a local PC. The files were then zipped up and uploaded to the server and unzipped. The pivot metadata is relatively small, so could be created either locally or on the server. On IIS I made the following changes&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Add text/xml mime types for .cxml , .dzc , .dzi &lt;/li&gt;    &lt;li&gt;Add compression for .cxml , dzc , .dzi &lt;/li&gt;    &lt;li&gt;Add never expires HTTP headers for deepzoom folders &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Note: If you client and collections are on different domains you will need to add a clientaccesspolicy.xml file to the root directory of hosting the collection.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Creating a prototype solution was quick and simple, by refactoring the NetFlix demo code from &lt;a href="http://blog.smarx.com/posts/pivot-odata-and-windows-azure-visual-netflix-browsing"&gt;blog.smartx.com&lt;/a&gt; , using basic hotel photos with some simple search criteria.&lt;/p&gt;  &lt;p&gt;But with most things it’s the final 20% that takes the time. Creating the composite images to include the hotels location on a map, getting the balance right on image quality vs download size, to what information to display on screen, and colours all took longer than expected. &lt;/p&gt;  &lt;p&gt;Then the design of the search panel also took some time, deciding what data to display and how to group the data. This still isn’t perfect and will probably be refined over the coming weeks.&lt;/p&gt;  &lt;p&gt;Finally the images are currently hosted on the west coast of America, this isn’t ideal as most of my customers are in the UK, so will probably need to look into use of a CDN / UK hosting to improve download speeds, possibly hosting on multiple sub domains to increase concurrent downloads and optimisation of the DeepZoom collections to share common low res images (e.g. generic green , yellow , blue images for images less than 16 pixels would reduce the file count significantly).&lt;/p&gt;  &lt;p&gt;The Silverlight app is very basic, providing a host for the Pivot Silverlight control and directing the user to a RoomSeeker web page. In the future would be good to extend the app to support dynamic collections based on room availability.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This is part 3 of 3:&lt;/p&gt; &lt;i&gt;   &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/how-roomseekereu-integrated-visual.html"&gt;Part 1 – What is Pivot?&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-pivot-collection.html"&gt;Part 2 – Creating a Pivot Collection&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;i&gt;Part 3 – Creating a custom Silverlight Pivot View application (this article)&lt;/i&gt;&lt;/p&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-7474476913382271471?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/7474476913382271471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=7474476913382271471' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/7474476913382271471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/7474476913382271471'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2010/07/creating-custom-silverlight-pivot-view.html' title='Part 3 of 3 - Creating a Custom Silverlight Pivot View application'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_huphup02COI/TDYITmSRbSI/AAAAAAAAAGo/gW84nPCf8n4/s72-c/clip_image002%5B7%5D.gif?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-6709119668792558835</id><published>2010-07-07T15:30:00.000+01:00</published><updated>2010-07-08T19:38:13.988+01:00</updated><title type='text'>Part 2 of 3 - Creating a Pivot Collection</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This series of articles cover the process from concept to release of how RoomSeeker.eu integrated visual search &lt;b&gt;using Pivot Viewer for Silverlight&lt;/b&gt;:&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This is part 1 of a 3 part series:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/how-roomseekereu-integrated-visual.html"&gt;Part 1 – What is Pivot&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;Part 2 – Creating a Pivot Collection (this article)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-custom-silverlight-pivot-view.html"&gt;Part 3 – Creating a custom Silverlight Pivot View application&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Creating a Pivot View Collection&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;For a deep dive on general collection design check out the article on &lt;a href="http://www.silverlight.net/learn/pivotviewer/collection-design/"&gt;silverlght.net&lt;/a&gt;, in this post we look at the steps required to create a pivot collection.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create composite images for input to deep zoom &lt;/li&gt;    &lt;li&gt;Create deep zoom data &lt;/li&gt;    &lt;li&gt;Create Pivot meta data &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 1 - Create composite images&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To keep things simple, pivot view only displays static images, so any text overlays, borders etc need to be burnt into an image.&lt;/p&gt;  &lt;p&gt;Key things to consider are aspect ratio, size, borders, and image quality along with the information you want to overlay. For RoomSeeker.eu we decide on the following info:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Hotel Name, Town, County (State), Star rating, Star accreditor &lt;/li&gt;    &lt;li&gt;Hotel Photo &lt;/li&gt;    &lt;li&gt;Room Price from &lt;/li&gt;    &lt;li&gt;Location &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;A sample composite image taken from the site is shown below containing the text overlays and location information on a map.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_huphup02COI/TDYNpmrMVAI/AAAAAAAAAG0/SBxeJedwHs0/s1600-h/clip_image002%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image002" border="0" alt="clip_image002" src="http://lh4.ggpht.com/_huphup02COI/TDYNqtc79AI/AAAAAAAAAG4/Tco4D80e2nc/clip_image002_thumb%5B1%5D.gif?imgmax=800" width="284" height="277" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So knowing what we want, how do we go about creating these 7000 images? Options include:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Manual via Paint &lt;/li&gt;    &lt;li&gt;3&lt;sup&gt;rd&lt;/sup&gt; party tool such as Photoshop which allows for a data merge functionality &lt;/li&gt;    &lt;li&gt;Create a custom app &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Option 1 is clearly a non-starter, but depending on your in house skills options 2 and 3 are the way to go.&lt;/p&gt;  &lt;p&gt;For us a custom app seemed the most flexible, as it could pull data direct from the database and integrate future changes via our content management system. So the only question now is what sort of app, options considered were:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create images via .NET bitmap APIs &lt;/li&gt;    &lt;li&gt;Create images via embedded IE web control &lt;/li&gt;    &lt;li&gt;Create images via XAML using WPF app &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;For simple image templates option 1 would be the simplest solution, but we wanted to have the image driven via a content template which pushed us into the direction of either being HTML based or XAML based. In the end we went for XAML as we could then create the templates in Expression Blend and incorporate smart controls such as our hotel map.&lt;/p&gt;  &lt;p&gt;So we ended up with a WPF app that pulled the data from the database and then created a custom Bitmap for each hotel based on a XAML template and inject the hotel data. Once we had our custom XAML this was then loaded into a canvas object using the code below:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; Canvas oCanvas = (Canvas) XamlReader.Parse(&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;                 InjectData(xamlTemplate,hotel));&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;  iWidth  =  (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)oCanvas.Width;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;  iHeight  =  (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)oCanvas.Height;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; oCanvas.Arrange(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt;  Rect(0,  0,  iWidth,  iHeight));&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; RenderTargetBitmap  oRenderTargetBitmap  =  &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;  RenderTargetBitmap(iWidth,  iHeight,  96,  96, PixelFormats.Default);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;      &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; oRenderTargetBitmap.Render(oCanvas);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; // Save image &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; JpegBitmapEncoder &lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p align="center"&gt;&lt;i&gt;Xaml to Bitmap code&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;So the end result is a direct with 7,000 custom images which can now be used to create the deep zoom collections.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 2 - Create deep zoom data&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Creating the deep zoom data is the easiest part of this project thanks to the &lt;b&gt;DeepZoom.dll&lt;/b&gt; library. A deep zoom collection consists of image tiles and collection meta data.&lt;/p&gt;

&lt;p&gt;Using the .NET4 parallel extension the following code will kick off 4 threads to create the deep zoom imagery via the DeepZoom API ImageCreator&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; Parallel.ForEach(titles, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ParallelOptions { MaxDegreeOfParallelism = 4 }, (title) =&amp;gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;      {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;       &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ImageCreator{ MaxLevel = 9 }.Create( imagePath, &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;@&amp;quot;{0}\{1}.xml&amp;quot;&lt;/span&gt;, outputDirectory, title.Id));  &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;      });&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; Once the images have been produced we then create the meta data, via the CollectionCreator API:&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; CollectionCreator().Create(titles.Select(t =&amp;gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;@&amp;quot;{0}\{1}.xml&amp;quot;&lt;/span&gt;, outputDirectory, t.Id)).ToList(), &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;@&amp;quot;{0}\collection.dzc&amp;quot;&lt;/span&gt;, outputDirectory));&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Thanks to &lt;a href="http://blog.smarx.com/posts/pivot-odata-and-windows-azure-visual-netflix-browsing"&gt;blog.smartx.com&lt;/a&gt; for this code, used as part of his NetFlix browsing article.&lt;/p&gt;

&lt;p&gt;And that’s pretty much it, though using the DeepZoom.dll I couldn’t figure out how to set a minimium zoom level as the tool wanted to create 9 zoom levels, of which levels 0 to 4 are very small and &amp;lt;1k in size, ( need a MinLevel = 3 option)?&lt;/p&gt;

&lt;p&gt;Note: Word of warning my 7,000 files (400MB) now went up to 100,000 files (575MB size / 842MB size on disk) and 78,000 folders.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Step 3 of 3 - Create Pivot metadata&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;In the previous steps we created the deep zoom data, now we need to create Pivot metadata to inform the viewer:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How we allow the user to &lt;b&gt;filter&lt;/b&gt; or &lt;b&gt;search&lt;/b&gt; the information via the filter panel e.g. Number of rooms, Location, price. &lt;/li&gt;

  &lt;li&gt;How we &lt;b&gt;group the results &lt;/b&gt;via the sort drop down, e.g. by city, user ratings. &lt;/li&gt;

  &lt;li&gt;What information is displayed in the &lt;b&gt;information panel&lt;/b&gt; for a given image e.g. hotel description, contact details etc. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;Collection Name&lt;/b&gt; provides the ability to give the collection a name and (in Silverlight) a custom logo. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_huphup02COI/TDYNrK8fUAI/AAAAAAAAAG8/kElf0bUxku0/s1600-h/clip_image006%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image006" border="0" alt="clip_image006" src="http://lh5.ggpht.com/_huphup02COI/TDYNrpa40aI/AAAAAAAAAHA/ndeqYSfYwS0/clip_image006_thumb%5B1%5D.gif?imgmax=800" width="392" height="134" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a deep dive on the Pivot meta data see the &lt;a href="http://www.silverlight.net/learn/pivotviewer/collection-xml-schema/"&gt;Collection XML Schema&lt;/a&gt; article on Silverlight.net.&lt;/p&gt;

&lt;p&gt;Filter panel For us this is still a work in progress, we’ve got the basics such as price, ratings, location, but are still iterating with attention to group of data e.g. hotel features / room features.&lt;/p&gt;

&lt;p&gt;Sort Dropdown Care should be taken to not overload the user with irrelevant sort groups, e.g. is group by hotel name really useful? At present we’ve got most of the filter panel appearing in the sort dropdown, but may remove some after testing / user feedback.&lt;/p&gt;

&lt;p&gt;Item panel I need to investigate this further, but currently my item panel will only display a button to link to an external URL via the Pivot app, but for the Silverlight control we have to option to multiple buttons and custom event handlers, e.g. to display a Silverlight dialog box. Note: For this release of the Silverlight control you cannot change the size / color of the buttons.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Info Panel &lt;/i&gt;Displays data related to the hotel, including extended information pulled from a &lt;b&gt;secondary.cxml&lt;/b&gt; data file that holds the hotel descriptions which can be quite large.&lt;/p&gt;

&lt;p&gt;The key part of the design here is to decide what information is important to your users. You may want to group things to help the user find the correct info, for example our database has a list of hotel features, but for this panel we broke down the features into groups for hotel and room features to keep the options brief as the panels are quite narrow so text needs to be concise.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;Issues:&lt;/i&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;To reduce the size of downloads I split the collection into 7 collections of ~1000 hotels each. This has the negative effect of searches in the filter panel being restricted to items in the current collection, e.g. if the user is viewing hotels in the South East of England they won’t see any search results for the South West unless they switch collections. &lt;/li&gt;

  &lt;li&gt;Do you want your collection to be consumed by both your Silverlight control, other Silverlight apps, WFP Pivot App? If so then you may want to ensure core functionality does not rely on logic built into your custom Silverlight Pivot Viewer app. &lt;/li&gt;

  &lt;li&gt;The secondary file can be quite large, would be good if that was split into multiple files, not sure if this is possible or not? &lt;/li&gt;

  &lt;li&gt;In the future I may also support dynamic collections e.g. based on search / availability. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;This is part 2 of a 3 part series:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/how-roomseekereu-integrated-visual.html"&gt;Part 1 – What is Pivot&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Part 2 – Creating a Pivot Collection (this article)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-custom-silverlight-pivot-view.html"&gt;Part 3 – Creating a custom Silverlight Pivot View application&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-6709119668792558835?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/6709119668792558835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=6709119668792558835' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/6709119668792558835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/6709119668792558835'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2010/07/creating-pivot-collection.html' title='Part 2 of 3 - Creating a Pivot Collection'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_huphup02COI/TDYNqtc79AI/AAAAAAAAAG4/Tco4D80e2nc/s72-c/clip_image002_thumb%5B1%5D.gif?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-2472807565238884798</id><published>2010-07-06T18:18:00.000+01:00</published><updated>2010-07-08T19:37:39.226+01:00</updated><title type='text'>Part 1 of 3 - How RoomSeeker.eu integrated visual search using Pivot Viewer for Silverlight</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p align="left"&gt;In this series of 3 posts we will cover the process of adding visual search to RoomSeeker.eu integrated visual search &lt;b&gt;using Pivot Viewer for Silverlight&lt;/b&gt;:&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Part 1 – What is Pivot (this article)&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-pivot-collection.html"&gt;Part 2 – Creating a Pivot Collection&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-custom-silverlight-pivot-view.html"&gt;Part 3 – Creating a custom Silverlight Pivot View application&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://roomseeker.eu/"&gt;RoomSeeker.eu&lt;/a&gt; provides details on late room availability for hotel rooms across Europe. The site is built on MVC 2.0 using ASP.NET 4.0 and supported by Microsoft BizSpark Programme. Currently the site integrates mapping and text search for users to find hotels.&lt;/p&gt;  &lt;p&gt;As it stands the site is similar to a lot of other hotel sites, so we were looking for something to help us stand out from the crowd, so decided to integrate a Pivot collection based on the &lt;b&gt;Silverlight Pivot Viewer Control&lt;/b&gt; into our site in the form of a visual search page, as shown below or you can try it out &lt;a href="http://roomseeker.eu/content/pivot.htm"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://roomseeker.eu/content/pivot.htm"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image002" border="0" alt="clip_image002" src="http://lh6.ggpht.com/_huphup02COI/TDYITmSRbSI/AAAAAAAAAGo/gW84nPCf8n4/clip_image002%5B7%5D.gif?imgmax=800" width="528" height="397" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;b&gt;RoomSeeker.eu Visual Search page&lt;/b&gt;&lt;/p&gt;  &lt;p align="left"&gt;Even though the app is quite basic and probably needs a few more iterations, it’s already provided useful for queries such as:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="left"&gt;“Show me all the AA rated hotels that take pets and cost less than £150 in the South East of England”&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;“Show me all beach hotels group by town in Suffolk”&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p align="left"&gt;&lt;b&gt;Part&amp;#160; 1 of 3 Introduction to Pivot&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Quoting Microsoft &lt;i&gt;“Pivot makes it easier to interact with massive amounts of data in ways that are powerful, informative, and fun.”&lt;/i&gt; The data in this case is a mixture of images and metadata associated with the image. This metadata could include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;How we allow the user to &lt;b&gt;filter&lt;/b&gt; or &lt;b&gt;search&lt;/b&gt; the information via the filter panel e.g. Number of rooms, Location, price. &lt;/li&gt;    &lt;li&gt;How we &lt;b&gt;group the results &lt;/b&gt;via the sort drop down, e.g. by city, user ratings. &lt;/li&gt;    &lt;li&gt;What information is displayed in the &lt;b&gt;information panel&lt;/b&gt; for a given image e.g. hotel description, contact details etc. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Collection Name&lt;/b&gt; provides the ability to give the collection a name and (in Silverlight) a custom logo. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_huphup02COI/TDYIUG05MII/AAAAAAAAAGs/DtYsLjXWbOo/s1600-h/clip_image002%5B4%5D%5B3%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image002[4]" border="0" alt="clip_image002[4]" src="http://lh3.ggpht.com/_huphup02COI/TDYIUopWyJI/AAAAAAAAAGw/z3OS3EtjnQk/clip_image002%5B4%5D_thumb%5B1%5D.gif?imgmax=800" width="544" height="185" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once we’ve created a collection we can then view the collection via a Pivot Viewer, currently Microsoft offers two viewers:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;WPF Client&lt;/b&gt; (via &lt;a href="http://getpivot.com/download/"&gt;getpivot.com&lt;/a&gt; ) This only works on Windows 7 or Vista, requires .NET 3.5 SP1 and IE8, but once installed you can browse many public pivot collections including our e.g. for rooms in the east of England past the following into the navigation bar &lt;a href="http://roomseeker.eu/content/pivot/v2/e/collection.cxml"&gt;http://roomseeker.eu/content/pivot/v2/e/collection.cxml&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Pivot Viewer for Silverlight&lt;/b&gt; &lt;b&gt;Control&lt;/b&gt; – Developers can use this control to embed Pivot collections into their Silverlight applications / websites on both Windows and Mac devices.&lt;/p&gt;  &lt;p&gt;Note: As a Pivot Collection is just a few XML files mapping to deep zoom collection I wouldn’t be surprised to see clients for other devices (we already have the excellent Seadragon, a deep zoom client, on the iPhone) and perhaps a &lt;strong&gt;HTML 5 client&lt;/strong&gt; making use of the hardware acceleration of IE9?&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This is part 1 of a 3 part series:&lt;/p&gt;  &lt;p&gt;&lt;i&gt;Part 1 – What is Pivot (this article)&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-pivot-collection.html"&gt;Part 2 – Creating a Pivot Collection&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://martimedia.blogspot.com/2010/07/creating-custom-silverlight-pivot-view.html"&gt;Part 3 – Creating a custom Silverlight Pivot View application&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-2472807565238884798?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/2472807565238884798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=2472807565238884798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/2472807565238884798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/2472807565238884798'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2010/07/how-roomseekereu-integrated-visual.html' title='Part 1 of 3 - How RoomSeeker.eu integrated visual search using Pivot Viewer for Silverlight'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_huphup02COI/TDYITmSRbSI/AAAAAAAAAGo/gW84nPCf8n4/s72-c/clip_image002%5B7%5D.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-6262054680497601463</id><published>2010-02-19T18:51:00.001Z</published><updated>2010-02-19T18:51:07.619Z</updated><title type='text'>Windows Phone 7 Series Countdown to Mix 10</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.martimedia.com/public/beta/silverlight.aspx?xap=mmMix10"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="mixcountdown" border="0" alt="mixcountdown" align="right" src="http://lh3.ggpht.com/_huphup02COI/S37dmsZ-KrI/AAAAAAAAAGc/8IWkyDgWnQE/mixcountdown%5B6%5D.jpg?imgmax=800" width="215" height="384" /&gt;&lt;/a&gt;With the launch of Windows Phone 7 Series this week I’ve created a simple Silverlight project to simulate the phones clock screen and added a countdown timer for Mix 10.&lt;/p&gt;  &lt;p&gt;The key items in the project were:&lt;/p&gt;  &lt;p&gt;1. Assume WVGA model ( 480 x 800 pixels)&lt;/p&gt;  &lt;p&gt;2. Add a view box to enable scaling of the window&lt;/p&gt;  &lt;p&gt;3. Add a KerningTextBlock control to get text closer to Windows phone, thanks to &lt;a href="http://blogs.msdn.com/danteg/archive/2009/02/27/a-silverlight-textblock-with-tracking-surely-you-jest.aspx"&gt;Danteq&lt;/a&gt; for this code, by enabling a text kerning in Silverlight 3, though I had to change&amp;#160; from Padding to Margin to support negative trackingproperty.&lt;/p&gt;  &lt;p&gt;4. Use of the windows font &lt;strong&gt;Segoe UI&lt;/strong&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;To see demo &lt;a href="http://www.martimedia.com/public/beta/silverlight.aspx?xap=mmMix10"&gt;click here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The code can be downloaded at: &lt;a href="http://www.martimedia.com/public/beta/ClientBin/mmMobile7.zip"&gt;http://www.martimedia.com/public/beta/ClientBin/mmMobile7.zip&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-6262054680497601463?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/6262054680497601463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=6262054680497601463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/6262054680497601463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/6262054680497601463'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2010/02/windows-phone-7-series-countdown-to-mix.html' title='Windows Phone 7 Series Countdown to Mix 10'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_huphup02COI/S37dmsZ-KrI/AAAAAAAAAGc/8IWkyDgWnQE/s72-c/mixcountdown%5B6%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-2737929461813974252</id><published>2009-11-10T18:00:00.003Z</published><updated>2009-11-10T18:14:21.254Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight bingmaps visualization'/><title type='text'>New pricing plan for Silverlight Bing Maps</title><content type='html'>&lt;p&gt;Great news today, as Microsoft has announced new &lt;a href="http://www.bing.com/community/blogs/maps/archive/2009/11/09/bing-maps-terms-of-use-changes-benefit-educators-not-for-profits-and-developers.aspx"&gt;Terms of Service&lt;/a&gt; for Bing Maps and released version 1.0 of the Silverlight control for Bing Maps.&lt;/p&gt;&lt;p&gt;Due to the power of Silverlight to serve up large amounts of tiles to the end user the old commercial model would made it commercial suicide for a small developer (see &lt;a href="http://martimedia.blogspot.com/2009/05/is-virtual-earth-for-silverlight.html"&gt;previous post&lt;/a&gt;) to use Bing Maps, as a user session could consume a huge number of tiles resulting in CPM rates in the region $100/CPM.&lt;/p&gt;&lt;p&gt;Well now it’s all change with a session based pricing model, with free access for education/non-profit and free 120K sessions a year for developers.&lt;/p&gt;&lt;p&gt;To see how much you save check out my &lt;a href="http://www.martimedia.com/public/tileCalc.htm"&gt;TileCalc demo&lt;/a&gt; (based on CTP Silverlight Control and old pricing model).&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.martimedia.com/public/tileCalc.htm"&gt;&lt;img style="border: 0px none ; display: inline;" title="image" alt="image" src="http://lh3.ggpht.com/_huphup02COI/ShF-1bCEFzI/AAAAAAAAAFg/tyGxzM_qhr8/image%5B12%5D.png?imgmax=800" width="524" border="0" height="399" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-2737929461813974252?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/2737929461813974252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=2737929461813974252' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/2737929461813974252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/2737929461813974252'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2009/11/new-pricing-plan-for-silverlight-bing.html' title='New pricing plan for Silverlight Bing Maps'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_huphup02COI/ShF-1bCEFzI/AAAAAAAAAFg/tyGxzM_qhr8/s72-c/image%5B12%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-3308896416633455950</id><published>2009-05-18T16:29:00.002+01:00</published><updated>2009-11-10T17:41:51.792Z</updated><title type='text'>Is Virtual Earth for Silverlight commercial suicide?</title><content type='html'>&lt;p&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;Update: Today (10 Nov 2009) Microsoft anounced a &lt;/span&gt;&lt;a style="font-weight: bold; color: rgb(153, 0, 0);" href="http://www.bing.com/community/blogs/maps/archive/2009/11/09/bing-maps-terms-of-use-changes-benefit-educators-not-for-profits-and-developers.aspx?WT.mc_id%20=Twitter_newTOU"&gt;change to the Bing Maps Terms of Service &lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;which means it's now charged per session rather than tile count, also developers get 125,000 sessions per year for FREE.&lt;/span&gt;
&lt;/p&gt;Before I start I must state that the Virtual Earth CTP control for Silverlight is a CTP and terms have yet to be announced for commercial use of the control….  &lt;p&gt;Recently I’ve created a couple of visualisations using Virtual Earth CTP control for Silverlight ( see previous entry &lt;a href="http://home.btconnect.com/martibiz/mps.htm" target="_blank"&gt;&lt;span style="color:#800080;"&gt;British Politician’s Expenses&lt;/span&gt;&lt;/a&gt; ). I’ve been impressed at how easy it is to create web apps with the control. Like most CTPs the commercial model has not been announced for Virtual Earth, but looking at the existing commercial licence fees for Virtual Earth I got a bit alarmed after reading &lt;a href="http://www.cadmaps.com/gisblog/?p=41" target="_blank"&gt;GIS in XML blog&lt;/a&gt; entry.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;span style="font-size:78%;"&gt;Standard version license is $8000 for 1,000,000/year transactions = 8,000,000/year tile renders. Note: no routing in standard&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;span style="font-size:78%;"&gt;Advanced version license is $15,000 for 1,500,000/year transactions = 12,000,000/year tiles. Includes routing capability"&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;span style="font-size:78%;"&gt;"An overage rate (generally $0.01 per transaction) is listed for exceeding the preset number of transactions for use during the term."&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The situation is slightly better for Bizspark users costing $2000  for 8,000,000 tiles, though not sure what rate it goes to once 8million rate is exceeded ( $0.01 per 8 tiles seems very high).&lt;/p&gt;  &lt;p&gt;To get an understanding of the types of apps I could create using Virtual Earth I needed to know how many tiles a typical user would request on a visit to my site, so I created a simple application which you can try out &lt;a href="http://www.martimedia.com/public/tileCalc.htm"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.martimedia.com/public/tileCalc.htm"&gt;&lt;img style="border: 0px none ; display: inline;" title="image" alt="image" src="http://lh4.ggpht.com/_huphup02COI/ShF-y9oDbjI/AAAAAAAAAFY/mSm9EgFfjjk/image%5B11%5D.png?imgmax=800" width="780" border="0" height="365" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The results are quite alarming, from just going on a simple tour of the world (browser size:  1200x800) London-&amp;gt;New York-&amp;gt;Sydney-&amp;gt;Ipswich I rack up 241 tiles, as a BizSpark customer that would cost me $0.06 or $60.25 per CPM, but even more alarming the overage rate would cost me $0.30 for a single user. If I were to makes use of the mouse wheel to zoom in/out and pan around a few tows I hit 1300 tiles in less than a minute! Clearly running this control on an add funded site is commercial suicide where CPM rates are $0.60 to $1.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.martimedia.com/public/tileCalc.htm"&gt;&lt;img style="border: 0px none ; display: inline;" title="image" alt="image" src="http://lh3.ggpht.com/_huphup02COI/ShF-1bCEFzI/AAAAAAAAAFg/tyGxzM_qhr8/image%5B12%5D.png?imgmax=800" width="524" border="0" height="399" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I know their has been talk of a revised VE commercial licence, as without one this control will remain a niche product. One suggestion I would make would be for the VE team to host &lt;strong&gt;Open Street Map data&lt;/strong&gt; on their servers and offer it free to BizSpak customers, this would be a great way to kick of creativity using MS technology?&lt;/p&gt;  &lt;p&gt;As for the app, it makes use of a &lt;strong&gt;custom tile server&lt;/strong&gt; ,shown below, to keep track of the number of tiles consumed. The requests are tracked via a dictionary to ensure we only count unique requests. Once we have a request an event is fired back to the main page and the stats updated to the user. &lt;/p&gt;  &lt;p&gt;  
&lt;span style=";font-family:&amp;quot;;font-size:8;color:blue;"   &gt;public&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;FeedEventArgs&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs &lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;{ &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; Msg { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; } &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;long&lt;/span&gt; count { &lt;span style="color:blue;"&gt;get&lt;/span&gt;; &lt;span style="color:blue;"&gt;set&lt;/span&gt;; } &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;} &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt;   &lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;CounterMapTileSource&lt;/span&gt; : Microsoft.VirtualEarth.MapControl.&lt;span style="color: rgb(43, 145, 175);"&gt;TileSource&lt;/span&gt; &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;{ &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;, &lt;span style="color:blue;"&gt;long&lt;/span&gt;&amp;gt; d = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;, &lt;span style="color:blue;"&gt;long&lt;/span&gt;&amp;gt;(); &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;long&lt;/span&gt; tileCount = 0; &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt;   &lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; CounterMapTileSource() : &lt;span style="color:blue;"&gt;base&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"http://tile.openstreetmap.org/{2}/{0}/{1}.png"&lt;/span&gt;) { } &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt;   &lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;override&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Uri&lt;/span&gt; GetUri(&lt;span style="color:blue;"&gt;int&lt;/span&gt; x, &lt;span style="color:blue;"&gt;int&lt;/span&gt; y, &lt;span style="color:blue;"&gt;int&lt;/span&gt; zoomLevel) &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;{ &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; uri = &lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Format(&lt;span style="color:blue;"&gt;this&lt;/span&gt;.UriFormat, x, y, zoomLevel); &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; info = &lt;span style="color: rgb(43, 145, 175);"&gt;String&lt;/span&gt;.Format(&lt;span style="color: rgb(163, 21, 21);"&gt;"{0:000#} Zoom x,y: {1:0#} {2} , {3} "&lt;/span&gt;, tileCount , x,y,zoomLevel); &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (d.ContainsKey(uri) == &lt;span style="color:blue;"&gt;false&lt;/span&gt;) &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;{ &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;d.Add(uri, tileCount); &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;/span&gt;    &lt;/p&gt;&lt;p&gt; &lt;/p&gt;   &lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;span style=""&gt;      &lt;/span&gt;tileCount++; &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;OnFeedRetrieved(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;FeedEventArgs&lt;/span&gt; { count = tileCount,&lt;span style=""&gt;  &lt;/span&gt;Msg = info }); &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;} &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;/span&gt;    &lt;/p&gt;&lt;p&gt; &lt;/p&gt;   &lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;null&lt;/span&gt;; &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;} &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;/span&gt;    &lt;/p&gt;&lt;p&gt; &lt;/p&gt;   &lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; Reset() { tileCount = 0; d.Clear(); } &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;/span&gt;    &lt;/p&gt;&lt;p&gt; &lt;/p&gt;   &lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;event&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;FeedEventArgs&lt;/span&gt;&amp;gt; FeedRetrieved; &lt;/span&gt;    &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style="color:blue;"&gt;protected&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; OnFeedRetrieved(&lt;span style="color: rgb(43, 145, 175);"&gt;FeedEventArgs&lt;/span&gt; args) &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;             &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;{ &lt;span style="color:blue;"&gt;if&lt;/span&gt; (FeedRetrieved != &lt;span style="color:blue;"&gt;null&lt;/span&gt;)FeedRetrieved(&lt;span style="color:blue;"&gt;this&lt;/span&gt;, args); } &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt;" class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:8;"  &gt;&lt;span style=""&gt;    &lt;/span&gt;} &lt;/span&gt;    &lt;/p&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Finally a couple of caveats:&lt;/p&gt;  &lt;p&gt;If you switch map views then make sure to hit the reset button to clear the custom tile source tile cache, otherwise it may underestimate your usage.&lt;/p&gt;  &lt;p&gt;Animation is turned off, as the tile requests for the custom tile map are a lot higher than those for Virtual Earth ( looking at my browser cache and watching Fiddler network traffic.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-3308896416633455950?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/3308896416633455950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=3308896416633455950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/3308896416633455950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/3308896416633455950'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2009/05/is-virtual-earth-for-silverlight.html' title='Is Virtual Earth for Silverlight commercial suicide?'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_huphup02COI/ShF-y9oDbjI/AAAAAAAAAFY/mSm9EgFfjjk/s72-c/image%5B11%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-8332363144945968989</id><published>2009-04-23T15:18:00.001+01:00</published><updated>2009-04-23T15:43:41.849+01:00</updated><title type='text'>British MP’s Expenses Data Visualisation via Virtual Earth CTP</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Following on from my previous blog on &lt;a href="http://martimedia.blogspot.com/2009/02/silverlight-usa-states-visualisation.html" target="_blank"&gt;US Politicians&lt;/a&gt; data visualisation using a listbox, this time I’ve moved across the pond to my homeland and created one for &lt;a href="http://home.btconnect.com/martibiz/mps.htm" target="_blank"&gt;British Politician’s Expenses&lt;/a&gt; (a bit of a hot topic in the UK at present) based on the CTP of the Virtual Earth for Silverlight control.&lt;/p&gt;  &lt;p&gt;The application enables you to quickly view Members of Parliament (MP) expenses for 2007/08 based on:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Location / Political Party (colour of the pin) &lt;/li&gt;    &lt;li&gt;Travel expenses (opacity of the pin) &lt;/li&gt;    &lt;li&gt;Second home allowance (size of the pin) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Note: An MP represents ~100k people, so map gives a good indication of population density across Britain.&lt;/p&gt;  &lt;p&gt;Using the Search tool you can filter the results&amp;#160; based on MP’s name/constituency Travel expenses and second home allowance. Any changes to the map are reflected in the pages URL making it easy to share custom reports via the share button on Twitter, Digg, Facebook and Email.&lt;/p&gt;  &lt;p&gt;E.g. the link blow shows MPs in the South East of England:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://home.btconnect.com/martibiz/mps.htm#?s=&amp;amp;t=0&amp;amp;h=0&amp;amp;y=51.5417&amp;amp;x=-0.1491&amp;amp;z=12"&gt;http://home.btconnect.com/martibiz/mps.htm#?s=&amp;amp;t=0&amp;amp;h=0&amp;amp;y=51.5417&amp;amp;x=-0.1491&amp;amp;z=12&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://home.btconnect.com/martibiz/mps.htm#?s=&amp;amp;t=0&amp;amp;h=0&amp;amp;y=51.5417&amp;amp;x=-0.1491&amp;amp;z=12" target="_blank"&gt;&lt;img style="display: block; float: none; margin-left: auto; margin-right: auto" src="http://home.btconnect.com/martibiz/ClientBin/mps-screen1.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="center"&gt;&lt;strong&gt;Sample screen shot&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Tech notes:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The visualisation makes use of &lt;a href="http://www.viawindowslive.com/Articles/VirtualEarth/VirtualEarthSilverlightMapControl.aspx"&gt;&lt;/a&gt;Client Technical Preview (CTP). The data is sourced from the &lt;a href="http://www.guardian.co.uk/news/datablog/2009/mar/31/mps-expenses-jacquismith"&gt;Guardian MP expense claims&lt;/font&gt;&lt;/a&gt; with MP geo data coming from &lt;span style="font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: &amp;#39;Times New Roman&amp;#39;; mso-bidi-theme-font: minor-bidi; mso-fareast-language: en-us; mso-ansi-language: en-gb; mso-bidi-language: ar-sa"&gt;&lt;a href="http://www.theyworkforyou.com/"&gt;&lt;font color="#800080"&gt;TheyWorkForYou&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;, though some data cleansing was required to link the two sets of data. The data is pulled in as&amp;#160; JSON, to keep things as fast as possible I embedded the JSON in the XAP assembly and loaded it using the following code:&lt;/p&gt;  &lt;div&gt;   &lt;div&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; LoadMPdetails()
   {
       Stream file = Assembly.GetExecutingAssembly().GetManifestResourceStream(&lt;span style="color: #006080"&gt;&amp;quot;mmMPs.Assets.mpDetails.js&amp;quot;&lt;/span&gt;); 
       TextReader tr = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StreamReader(file);

       JsonArray jsonArray = (JsonArray)JsonArray.Load(tr);

       mps = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;MP&amp;gt;();

       &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (JsonObject jsonItem &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; jsonArray)
       {
           MP item = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MP();
           item.name = jsonItem[&lt;span style="color: #006080"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;];
           item.constituency =  jsonItem[&lt;span style="color: #006080"&gt;&amp;quot;constituency&amp;quot;&lt;/span&gt;];
           item.party =  jsonItem[&lt;span style="color: #006080"&gt;&amp;quot;party&amp;quot;&lt;/span&gt;];
           mps.Add(item);
       }
   }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Even though this is a Silverlight 2.0 application we support deep linking (added to Silverlight 3.0 beta) so you can create custom views and share the links with your friends. Each time the viewport is changed or a search preformed the pages URL is updated and added to the browsers page history using &lt;span style="mso-spacerun: yes"&gt;&amp;#160;&lt;/span&gt;JQuery and jquery.history and some C# code provided by &lt;a href="http://blog.nerdplusart.com/archives/deep-linking-browser-history-navigation-in-silverlight"&gt;&lt;font color="#0000ff" size="3" face="Calibri"&gt;nerdplusart.com&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code below shows the logic to display the push pin with the tooltips:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; AddPin2(Loc con)
        {
            &lt;span style="color: #008000"&gt;// pushpin image&lt;/span&gt;
            Image image = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Image();

            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (con.mp == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
                image.Source = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BitmapImage(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #006080"&gt;&amp;quot;/assets/pinMagenta.png&amp;quot;&lt;/span&gt;, UriKind.Relative));
            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;        
            &lt;span style="color: #0000ff"&gt;switch&lt;/span&gt; (con.mp.party)
            {
                &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;Liberal Democrat&amp;quot;&lt;/span&gt;:
                    image.Source = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BitmapImage(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #006080"&gt;&amp;quot;/assets/pinYellow.png&amp;quot;&lt;/span&gt;, UriKind.Relative));
                    &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;

                &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;Conservative&amp;quot;&lt;/span&gt;:
                    image.Source = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BitmapImage(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #006080"&gt;&amp;quot;/assets/pinBlue.png&amp;quot;&lt;/span&gt;, UriKind.Relative));
                    &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
  
                &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;Labour&amp;quot;&lt;/span&gt;:
                    image.Source = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BitmapImage(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #006080"&gt;&amp;quot;/assets/pinRed.png&amp;quot;&lt;/span&gt;, UriKind.Relative));
                    &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;

                &lt;span style="color: #0000ff"&gt;default&lt;/span&gt;:
                    image.Source = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BitmapImage(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #006080"&gt;&amp;quot;/assets/pinMagenta.png&amp;quot;&lt;/span&gt;, UriKind.Relative));
                    &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
            }

            &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; size = 35;
            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (con.expense.Cost_Of_Staying_Away_From_Main_Home &amp;gt; 5000)
                size = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) Math.Min(( (con.expense.Cost_Of_Staying_Away_From_Main_Home - 5000) / 5000) * 10 + 35,80);
            image.Width = size; image.Height = size;

            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (con.expense.Cost_Of_Staying_Away_From_Main_Home &amp;lt; 500)
                image.Opacity = 0.6;
            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
                image.Opacity = 0.6 + (con.expense.Cost_Of_Staying_Away_From_Main_Home / 23000);
            

            image.MouseEnter += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.Windows.Input.MouseEventHandler(i_MouseEnter);
            image.MouseLeave += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.Windows.Input.MouseEventHandler(i_MouseLeave);
            image.MouseLeftButtonDown +=&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.Windows.Input.MouseButtonEventHandler(image_MouseLeftButtonDown); &lt;span style="color: #008000"&gt;// += new System.Windows.Input.MouseButtonEventHandler(image_MouseLeftButtonUp);&lt;/span&gt;


            &lt;span style="color: #008000"&gt;// Add Tooltip&lt;/span&gt;
            var tooltipObject = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StackPanel();

            var title = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextBlock();
            title.FontWeight = FontWeights.Bold;
            title.Text = con.name;
            tooltipObject.Children.Add(title);
            
            var description = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TextBlock();
            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (con.mp != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
                description.Text = con.mp.party + &lt;span style="color: #006080"&gt;&amp;quot; - &amp;quot;&lt;/span&gt; + con.mp.name + &lt;span style="color: #006080"&gt;&amp;quot;\n\n&amp;quot;&lt;/span&gt; +getExpenseReport(con.expense); &lt;span style="color: #008000"&gt;// .Total_Allowances_Claimed_Inc_Travel ; // &amp;quot;Info goes here.....&amp;quot;; // &amp;quot;This is an arbitrary description of the \&amp;quot;Huge Square\&amp;quot; to be displayed within the Tooltip.&amp;quot;;&lt;/span&gt;
            tooltipObject.Children.Add(description);

            image.Tag = con.name;

            ToolTipService.SetToolTip(image, tooltipObject);
            
            &lt;span style="color: #008000"&gt;//Add the pushpin to the Map &lt;/span&gt;
            myMap.Children.Add(image);

            &lt;span style="color: #008000"&gt;//Position the pushpin using the attached properties &lt;/span&gt;
            MapLayer.SetMapPosition(image, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Location(con.centre_lat, con.centre_lon));
            MapLayer.SetMapPositionMethod(image, PositionMethod.BottomLeft);

        }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Things I would have liked to do if I had the time:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Better control of the map pins when zooming out, would like some form of clustering and pins to be a bit smaller, 600+ large pins is too much for a place the size of Britain.&lt;/p&gt;

&lt;p&gt;Restrict zoom level and panning just to the UK, as things get a bit confusing for the user seeing a small island with los of dots.&lt;/p&gt;

&lt;p&gt;Host via Silverlight Streaming, but couldn’t figure out how I could get the deep linking working from an IFRAME hosted on a different domain.&lt;/p&gt;

&lt;p&gt;Make the tooltip timeouts longer, but this isn’t a trivial task, though you can find a &lt;a href="http://tooltipservice.codeplex.com/" target="_blank"&gt;ToolTipService&lt;/a&gt; on codeplex that supports such a feature.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-8332363144945968989?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/8332363144945968989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=8332363144945968989' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/8332363144945968989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/8332363144945968989'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2009/04/british-mps-expenses-data-visualisation.html' title='British MP’s Expenses Data Visualisation via Virtual Earth CTP'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-3113605704288726948</id><published>2009-02-27T15:22:00.001Z</published><updated>2009-02-27T15:29:19.208Z</updated><title type='text'>Open Street Map to XAML</title><content type='html'>&lt;p&gt;After playing around with maps in my previous post, &lt;a href="http://martimedia.blogspot.com/2009/02/silverlight-usa-states-visualisation.html"&gt;Silverlight USA States Visualisation&lt;/a&gt;, I decided to check out the maps at &lt;a href="http://openstreetmap.com/"&gt;OpenStreetMap&lt;/a&gt; and see if I could embed them into a simple Silverlight app, for which you can see a live demo &lt;a href="http://www.martimedia.com/public/mmOpenMap.htm" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.martimedia.com/public/mmOpenMap.htm" target="_blank"&gt;&lt;img title="app" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="347" alt="app" src="http://lh5.ggpht.com/_huphup02COI/SagFP-zVBZI/AAAAAAAAADE/fAB-_2AQt5k/app%5B4%5D.png?imgmax=800" width="401" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1 – Grab the data&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This is very easy, just zoom into the location you want and then hit the Export tab, select format PDF and download your PDF image and save the file to disk e.g &lt;strong&gt;map.pdf&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_huphup02COI/SagFReIi-EI/AAAAAAAAADw/AJjjqkKoHdg/s1600-h/streetmap%5B3%5D.png"&gt;&lt;img title="streetmap" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="349" alt="streetmap" src="http://lh6.ggpht.com/_huphup02COI/SagFSGPxw5I/AAAAAAAAAD4/zvGLkd3s84U/streetmap_thumb%5B1%5D.png?imgmax=800" width="430" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once downloaded check all is ok (I had to download twice for some reason as first download was corrupted).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2 – Import to Expression Design&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;To do this create rename the file to &lt;strong&gt;map.ai &lt;/strong&gt; and import the data (File/Import) into Expression Design. At this stage you may want to delete some of the features, e.g. cost lines, borders etc.&lt;/p&gt;  &lt;p&gt;For more info on this step check of post by &lt;a href="http://timheuer.com/blog/archive/2007/08/30/convert-vector-svg-to-xaml-for-silverlight.aspx" target="_blank"&gt;Tim Heuer&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 3 – Export to Silverlight XAML&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Select the File/Export and select Silverlight option this will then give you a &lt;strong&gt;map.xaml&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;In my XAML I noticed 4 &amp;lt;image&amp;gt; of the format shown below, which I striped out of the XAML.&lt;/p&gt; &lt;font color="#0000ff" size="1"&gt;&lt;font color="#0000ff" size="1"&gt;     &lt;p&gt;&amp;lt;&lt;/p&gt;   &lt;/font&gt;&lt;font color="#a31515" size="1"&gt;&lt;font color="#a31515" size="1"&gt;Image&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="1"&gt;&lt;font color="#ff0000" size="1"&gt; Source&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;&lt;font color="#0000ff" size="1"&gt;=&amp;quot;Ipswich - Open Street Map_files/image3.png&amp;quot;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;&lt;font color="#0000ff" size="1"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;  &lt;p&gt;&lt;font color="#0000ff" size="1"&gt;&lt;font color="#0000ff" size="1"&gt;&lt;/font&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/font&gt;&lt;strong&gt;Step 4 – Embed in your Silverlight project&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I pasted the contents into&amp;#160; and paste contents of map.xaml into your canvas..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_huphup02COI/SagFSsT9NAI/AAAAAAAAAD8/b8cBLzielvY/s1600-h/code1%5B5%5D.png"&gt;&lt;img title="code1" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="246" alt="code1" src="http://lh5.ggpht.com/_huphup02COI/SagFTC4UBbI/AAAAAAAAAEI/kYWY4fZaXPE/code1_thumb%5B3%5D.png?imgmax=800" width="587" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the app I just add a scale factor based on the mouse wheel ( using Pete Blois MouseWheelHelper class), which works ok but doesn’t update the horizontal / vertical bar sizes/ranges.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_huphup02COI/SagFTcK3w1I/AAAAAAAAAEM/pw1HDB2q540/s1600-h/code2%5B3%5D.png"&gt;&lt;img title="code2" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="345" alt="code2" src="http://lh4.ggpht.com/_huphup02COI/SagFT4m8TTI/AAAAAAAAAEU/wC6FV94brjw/code2_thumb%5B1%5D.png?imgmax=800" width="410" border="0" /&gt;&lt;/a&gt; See online version&lt;strong&gt; &lt;/strong&gt;&lt;a href="http://www.martimedia.com/public/mmOpenMap.htm" target="_blank"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;A note on file Sizes&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The PDF I used for a medium sized English town (Ipswich) resulted in a 700K PDF file. Once converted to XAML this grew to 5.9MB (and still 1.7MB zipped). Trying to edit such a large file in VS2008 proved very slow which each edit of the file taking 10 seconds, hope VS2010 is faster.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Deep earth&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;For most Silverlight mapping tasks you would probably be better off using something like &lt;a href="http://deepearth.codeplex.com/" target="_blank"&gt;DeepEarth&lt;/a&gt; which makes use of DeepZoom, and a custom map source provider to enable Open Street Map data to be displayed within a Silverlight app, though not sure of the terms and conditions of using OpenStreetMap tile server, but you can see a live demo at &lt;a href="http://deepzoom.soulclients.com/osm/"&gt;http://deepzoom.soulclients.com/osm/&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-3113605704288726948?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/3113605704288726948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=3113605704288726948' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/3113605704288726948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/3113605704288726948'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2009/02/open-street-map-to-xaml.html' title='Open Street Map to XAML'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_huphup02COI/SagFP-zVBZI/AAAAAAAAADE/fAB-_2AQt5k/s72-c/app%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-2252561051150248494</id><published>2009-02-23T16:34:00.000Z</published><updated>2009-02-23T17:03:59.010Z</updated><title type='text'>Silverlight USA States Visualisation</title><content type='html'>&lt;div style="font-family: arial;"&gt;&lt;p&gt;&lt;a href="http://timheuer.com/blog/archive/2009/02/17/write-silverlight-code-and-win-a-pass-to-mix.aspx"&gt;Tim Heuer&lt;/a&gt; challenged his readers to create a Silverlight visualisation application; this is &lt;a href="http://www.martimedia.com/public/usa.htm"&gt;my entry&lt;/a&gt;…….&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.martimedia.com/public/usa.htm"&gt;&lt;img style="cursor: pointer; width: 320px; height: 250px;" src="http://3.bp.blogspot.com/_huphup02COI/SaLWOSfZmwI/AAAAAAAAACQ/A9TF2AAvgn4/s320/blog1-4.png" alt="" id="BLOGGER_PHOTO_ID_5306038851965917954" border="0" /&gt;&lt;/a&gt;

&lt;p&gt;It displays visualisation of the following name value pairs (stored as embedded text files) from Wikipedia of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Average salary per state
&lt;/li&gt;&lt;li&gt;US elections 2008 votes per state - &lt;a href="http://en.wikipedia.org/wiki/List_of_U.S._states_by_population"&gt;Wikipeida&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;Population per state - &lt;a href="http://en.wikipedia.org/wiki/List_of_U.S._states_by_population"&gt;Wikipeidia&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Other sources of info are on &lt;a href="http://en.wikipedia.org/wiki/U.S._state"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;

&lt;b&gt;Step 1 - Simple Listbox&lt;/b&gt;
&lt;p&gt;Each set of name value pairs are stored in their own embedded text file, which are then are then loaded into a observable type and bound to a list box. A slider bar then allows the user to filter the results. The data binding worked well but looked so 2003, so it was time to jazz it up. &lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_huphup02COI/SaLQ4cxg3uI/AAAAAAAAABw/Hk0VqGuWGSs/s1600-h/blog1-1.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 309px;" src="http://2.bp.blogspot.com/_huphup02COI/SaLQ4cxg3uI/AAAAAAAAABw/Hk0VqGuWGSs/s320/blog1-1.png" alt="" id="BLOGGER_PHOTO_ID_5306032979210985186" border="0" /&gt;&lt;/a&gt;

&lt;b&gt;




Step 2 - Basic Item Template&lt;/b&gt;

&lt;p&gt;I then put a nice border around items, could have added some simple graphics, bound the data to colour and opacity attributes, that would have made it a bit better but still it’s so 2005.&lt;/p&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_huphup02COI/SaLQ8sD6TXI/AAAAAAAAAB4/KYwNr3of28s/s1600-h/blog1-2.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 266px;" src="http://1.bp.blogspot.com/_huphup02COI/SaLQ8sD6TXI/AAAAAAAAAB4/KYwNr3of28s/s320/blog1-2.png" alt="" id="BLOGGER_PHOTO_ID_5306033052034157938" border="0" /&gt;&lt;/a&gt;




&lt;b&gt;Step 3 - Advanced Item Template with paths&lt;/b&gt;

&lt;p&gt;Then I remembering seeing a &lt;a href="http://richapps.wordpress.com/2009/02/12/advanced-styling-wpf/"&gt;blog&lt;/a&gt; of a WPF app that
created a USA map from a list box, so I ported the app to Silverlight, this required me to:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;Resolve issues of Silverlight not supporting binding of certain types
&lt;/li&gt;&lt;li&gt;Replacing XML data source with my custom observable type
&lt;/li&gt;&lt;li&gt;Tweaking animation effects
&lt;/li&gt;&lt;li&gt;Tweaking labels so they weren’t clipped by the state
&lt;/li&gt;&lt;/ul&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_huphup02COI/SaLUGg8UytI/AAAAAAAAACI/My5CWZ3RlfI/s1600-h/blog1-3.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 228px;" src="http://3.bp.blogspot.com/_huphup02COI/SaLUGg8UytI/AAAAAAAAACI/My5CWZ3RlfI/s320/blog1-3.png" alt="" id="Img1" border="0" /&gt;&lt;/a&gt;

&lt;p&gt;The results are a great example of the strength of data binding to a custom list box to totally transform an app from a dull winforms style list box to an advanced visualisation. Using these features in WPF/Silverlight makes it very easy to separate the visualisation from data, and the ZAP file is only 36Kb, smalled than a PNG of the screenshot!&lt;/p&gt;

&lt;p&gt;Due to time contains there are still a few rough edges, the animation could be a bit slicker, button designs could be improved any fixing the z-order of the selected state.&lt;/p&gt;

&lt;p&gt;Future enhancements could include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;More complex data type, e.g. third axis to include time
&lt;/li&gt;&lt;li&gt;Load your own data via local text file
&lt;/li&gt;&lt;li&gt;Embeddable widget
&lt;/li&gt;&lt;li&gt;Extra maps
&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-2252561051150248494?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/2252561051150248494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=2252561051150248494' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/2252561051150248494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/2252561051150248494'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2009/02/silverlight-usa-states-visualisation.html' title='Silverlight USA States Visualisation'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_huphup02COI/SaLWOSfZmwI/AAAAAAAAACQ/A9TF2AAvgn4/s72-c/blog1-4.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5159270228810038336.post-8641092622981019278</id><published>2008-04-14T12:29:00.000+01:00</published><updated>2008-04-14T12:33:39.048+01:00</updated><title type='text'>Welcome</title><content type='html'>&lt;span style="font-family:arial;"&gt;This is one of many blog sites I've created, perhaps I might come back some time and update it? For more info on me check out &lt;/span&gt;&lt;a href="http://friendfeed.com/martimedia"&gt;&lt;span style="font-family:arial;"&gt;friendfeed.com/martimedia&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; for an overall summary of my online life.

&lt;strong&gt;&lt;em&gt;Martin &lt;/em&gt;&lt;/strong&gt;

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5159270228810038336-8641092622981019278?l=martimedia.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://martimedia.blogspot.com/feeds/8641092622981019278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5159270228810038336&amp;postID=8641092622981019278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/8641092622981019278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5159270228810038336/posts/default/8641092622981019278'/><link rel='alternate' type='text/html' href='http://martimedia.blogspot.com/2008/04/welcome.html' title='Welcome'/><author><name>Martin Duffy</name><uri>http://www.blogger.com/profile/08813741544980259004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_huphup02COI/SeD7pg6VUvI/AAAAAAAAAEo/Wp_oZkflm0c/S220/marti-bw-01.png'/></author><thr:total>0</thr:total></entry></feed>
