<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>No Free Time</title>
	
	<link>http://andrewmyhre.wordpress.com</link>
	<description>Because my therapist says I need to let things out</description>
	<lastBuildDate>Wed, 15 Jul 2009 15:03:58 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/b012d8af26af279e8b78dea60a545c86?s=96&amp;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>No Free Time</title>
		<link>http://andrewmyhre.wordpress.com</link>
	</image>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/NoFreeTime" type="application/rss+xml" /><item>
		<title>I’m Back and a Non-Programming Related Reference</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/OEkxwrpnLno/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/07/16/im-back-and-a-non-programming-related-reference/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 15:03:58 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=268</guid>
		<description><![CDATA[Well I&#8217;m finally back from an extended stay in my home country, New Zealand. The particulars that brought about my prolonged visit to NZ are boring and long-winded so I won&#8217;t go into them here. While I&#8217;m grateful to my employers for allowing me to work remotely while I was over there, I&#8217;m also thoroughly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=268&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well I&#8217;m finally back from an extended stay in my home country, New Zealand. The particulars that brought about my prolonged visit to NZ are boring and long-winded so I won&#8217;t go into them here. While I&#8217;m grateful to my employers for allowing me to work remotely while I was over there, I&#8217;m also thoroughly grateful to be back <em>home</em>, in London. Yes, my time back in NZ has brought the realisation into stark relief that London is, presently at least, home. It&#8217;s a nice feeling.</p>
<p>Moving swiftly to the point of this post, that being what I want to share.</p>
<p>It&#8217;s a testament to the connected world we live in that keeping up to date with the latest findings and speculations of scientific research no longer requires subscriptions to obscure publications and painstaking focus, analysis and consideration. Nowadays you can just have that stuff piped straight into your computer apparatus and consequently into your brain, in a much more passive and relaxing way. How, you may ask? YouTube!</p>
<p>I was introduced to Daniel Dennett a few weeks ago, and I&#8217;ve added him to my list of Great Human Beings. If you don&#8217;t know who he is, here&#8217;s a nice taster for his work: <a href="http://www.youtube.com/watch?v=KzGjEkp772s" target="_blank">Ants, Terrorism, and the Awesome Power of Memes</a>. It&#8217;s a quick TED lecture, so it&#8217;s a sample of his ideas which is suitable for untraumatic digestion, whatever your persuasion. If you watch that video and find yourself hungry for more, there are <em>schools</em> of in-depth, full-length lectures available on the YouTube also, so you know how to plunge further into this sumptuous mind-steak. <a href="http://www.youtube.com/watch?v=khp4VWJC1FI" target="_blank">This lecture</a> for instance is a fuller expansion on the TED talk linked above. <a href="http://video.google.com/videosearch?q=daniel+dennett&amp;emb=0&amp;aq=f#" target="_blank">Let me google that for you</a>.</p>
<p>I&#8217;d be interested in hearing from anyone at all in London who finds the above interesting and would enjoy meeting up to, er, talk utter nonsense about it? Leave a comment or hit me on twitter. If there are, say, half a dozen such doomed souls I&#8217;ll organise something.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/268/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=268&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/OEkxwrpnLno" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/07/16/im-back-and-a-non-programming-related-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/07/16/im-back-and-a-non-programming-related-reference/</feedburner:origLink></item>
		<item>
		<title>Google Chrome OS</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/vKWx0ookeg0/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/07/09/google-chrome-os/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 05:39:24 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=265</guid>
		<description><![CDATA[http://www.wired.com/gadgetlab/2009/07/five-things-googles-chrome-os-will-do-for-your-netbook/
But will I be able to play games on it?
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=265&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.wired.com/gadgetlab/2009/07/five-things-googles-chrome-os-will-do-for-your-netbook/" target="_blank">http://www.wired.com/gadgetlab/2009/07/five-things-googles-chrome-os-will-do-for-your-netbook/</a></p>
<p>But will I be able to play games on it?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=265&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/vKWx0ookeg0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/07/09/google-chrome-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/07/09/google-chrome-os/</feedburner:origLink></item>
		<item>
		<title>Integrating Google Analytics with your Silverlight Streaming application</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/7rcGky_V-4A/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/06/18/integrating-google-analytics-with-your-silverlight-streaming-application/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 03:34:55 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[silverlight]]></category>
		<category><![CDATA[silverlight streaming]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=262</guid>
		<description><![CDATA[No dice. Can&#8217;t be done. Here&#8217;s why.
To track an action you need to invoke the trackPage() function defined in ga.js. The function must be invoked from the same domain registered in your Google Analytics account, in my case that&#8217;s &#8220;andrewmyhre.com&#8221;. So in order to track events from my Silverlight app I need to call up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=262&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>No dice. Can&#8217;t be done. Here&#8217;s why.</p>
<p>To track an action you need to invoke the trackPage() function defined in ga.js. The function must be invoked from the same domain registered in your Google Analytics account, in my case that&#8217;s &#8220;andrewmyhre.com&#8221;. So in order to track events from my Silverlight app I need to call up to the parent frame and invoke a function to track the event. Unfortunately, because my Silverlight application is running on an entirely different domain (something like &#8220;silverlight.services.live.com&#8221;) the browser throws a &#8220;Permission denied&#8221; error when I try to invoke parent.trackPage().</p>
<p>There is no way around this. That behaviour is by design, in order to prevent cross-site scripting attacks.</p>
<p>So I&#8217;ve moved the Silverlight and media files to my hosting account where I can load everything under my own domain. That&#8217;s cool because I have 1gb of space there and the total media payload is around 500mb. It&#8217;s also a real shame, it was cool to be using a new beta service like Silverlight Streaming, but unfortunately event tracking is a deal breaker for me.</p>
<p>Maybe there are some coders out there who know how to get around this, or maybe the Silverlight Streaming team have a workaround&#8230; I can&#8217;t really see it happening though. Shame.</p>
<p>On the bright side though, the videos seem to be streaming much more quickly now! <img src='http://s.wordpress.com/wp-includes/images/smilies/face-uncertain.png' alt=':/' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/262/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=262&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/7rcGky_V-4A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/06/18/integrating-google-analytics-with-your-silverlight-streaming-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/06/18/integrating-google-analytics-with-your-silverlight-streaming-application/</feedburner:origLink></item>
		<item>
		<title>Design Your Experience</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/cd-FIKMZtK0/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/06/16/design-your-experience/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 02:36:37 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[silverlight 2]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=255</guid>
		<description><![CDATA[
So I deployed a personal website last week which I was quite happy with at the time but over the last few days I&#8217;ve thought of some features I wanted to add. I wanted visitors to be able to do a couple of things when they view my website:

pause and skip the music (not everyone [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=255&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-01.png"><img class="alignnone size-thumbnail wp-image-256" title="Gratuitous money shot" src="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-01.png?w=150&#038;h=90" alt="Gratuitous money shot" width="150" height="90" /></a></p>
<p>So I deployed a personal website last week which I was quite happy with at the time but over the last few days I&#8217;ve thought of some features I wanted to add. I wanted visitors to be able to do a couple of things when they view my website:</p>
<ul>
<li>pause and skip the music (not everyone likes minimal-tech-dub)</li>
<li>choose which videos are in rotation</li>
<li>i also want the UI not to get in the way when not in use</li>
</ul>
<p><a href="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-02.png"><img class="alignnone size-thumbnail wp-image-257" title="Everybody needs options" src="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-02.png?w=83&#038;h=150" alt="Everybody needs options" width="83" height="150" /></a></p>
<p>So I added an options panel. It presents you with a pause/play button and a skip button to control the music. Most people, including myself, hate it when websites play music and you can&#8217;t stop it so here&#8217;s the option. I used the WebDings font for the button icons which I copied from my windows folder into my solution and embedded it.</p>
<p>Further below in the options panel you have a list of checkboxes which determine what kinds of videos are circulating in the pool that can be selected to play. Uncheck the &#8216;cows&#8217; tag to any videos everything featuring cows, for instance. I use System.Linq methods to regenerate the pool on each click, like so:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">if (c.IsChecked.HasValue &amp;&amp; c.IsChecked.Value)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">tagSet = tagSet.Union(new string[] { tb.Text }).ToArray();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">else</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">tagSet = (from t in tagSet where !t.Equals(tb.Text) select t).ToArray();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">}</div>
<pre>string[] tagSet = new string[10];
if (c.IsChecked.HasValue &amp;&amp; c.IsChecked.Value)
{
    tagSet = tagSet.Union(new string[] { tag }).ToArray();
}
else
{
    tagSet = (from t in tagSet where !t.Equals(tag) select t).ToArray();
}</pre>
<p>In the above snippet, tagSet is my collection of active tags, it&#8217;s just a string array as I&#8217;ve indicated with the declaration on the first line. The first logic branch is adding the selected tag to the array using a Union() and the second logic branch removes it by performing a select where not equal. I wonder if this is awfully inefficient.</p>
<p>Finally at the very bottom of the options panel there are some blurry lines which now and then shrink and expand. These are gauges which indicate the current buffering and download progress of the videos. If you look closely you can see four distinct lines. The 1st and 3rd lines indicate buffering progress while the 2nd and 4th lines indicate download progress.</p>
<p><a href="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-03.png"><img class="alignnone size-thumbnail wp-image-258" title="Now you know what these do" src="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-03.png?w=150&#038;h=25" alt="Now you know what these do" width="150" height="25" /></a></p>
<p>What&#8217;s actually happening behind the scenes is that while one video is playing another one is silently buffering. Once the background video source is ready to play and the timing is right a cross-fade transition will occur. As soon as the transition is completed the video source that was previously in the foreground begins buffering the next video in the pool, and so on the so forth. I can see what&#8217;s happening by switching into my diagnostics view:</p>
<p><img class="alignnone size-thumbnail wp-image-259" title="Diagnostics view shows both video sources" src="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-04.png?w=150&#038;h=74" alt="Diagnostics view shows both video sources" width="150" height="74" /></p>
<p>I&#8217;m reasonably happy with the way that the options panel slides out smoothly to meet the mouse cursor as you move it towards the left-hand side of the screen, and retracts discretely in the same way. I&#8217;ve wanted to experiment with this method of revealing/hiding UI for a while and I like this as a prototype. I&#8217;m not a designer though so I&#8217;m pretty sure the whole thing could be much slicker.</p>
<p>One more thing I&#8217;ve added is a little &#8216;loading&#8217; note with initial buffering gauges. There are two separate white bars which indicate the loading process &#8211; these are for source A and source B which I load both of initially before video starts. Sometimes however (actually, quite frequently) Silverlight is loading a cached video, so it doesn&#8217;t need to buffer in which case Silverlight reports a buffering progress of 0.0. This isn&#8217;t the desired behaviour in my case, because it means I have to set up some hacks to detect this case and show a full buffering gauge instead. From my point of view this is a bug.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/255/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=255&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/cd-FIKMZtK0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/06/16/design-your-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-01.png?w=150" medium="image">
			<media:title type="html">Gratuitous money shot</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-02.png?w=83" medium="image">
			<media:title type="html">Everybody needs options</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-03.png?w=150" medium="image">
			<media:title type="html">Now you know what these do</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/06/20090616-newfeatures-04.png?w=150" medium="image">
			<media:title type="html">Diagnostics view shows both video sources</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/06/16/design-your-experience/</feedburner:origLink></item>
		<item>
		<title>Silverlight Streaming and Google Analytics</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/CBJ9GV21kyA/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/06/12/silverlight-streaming-and-google-analytics/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 09:25:36 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=251</guid>
		<description><![CDATA[I can&#8217;t seem to find a way to implement page/event tracking from Silverlight using Google Analytics when hosted using Silverlight Streaming. The usual solution to do this with with a regular Silverlight app is to reference the Google Analytics ga.js script and call HtmlPage.Window.Invoke() from Silverlight. But a difficulty arises because that javascript is executed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=251&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I can&#8217;t seem to find a way to implement page/event tracking from Silverlight using Google Analytics when hosted using Silverlight Streaming. The usual solution to do this with with a regular Silverlight app is to reference the Google Analytics ga.js script and call HtmlPage.Window.Invoke() from Silverlight. But a difficulty arises because that javascript is executed in the context of the Silverlight application, which (in my case at least) is inside an iframe, and therefore can&#8217;t use the ga.js script.</p>
<p>One of the features available with creating a Silverlight Streaming application is to include javascript files with your Silverlight app so that you can use them from Silverlight, but ga.js isn&#8217;t my script so I can&#8217;t do that. Unless I downloaded the obfuscated version using Firebug or something&#8230; but&#8230; ugh!</p>
<p>I&#8217;m sure there will be some combination of HtmlPage.Window.Parent.Parent.Whatever I can use to do what I want to do, but I&#8217;m already into my second glass of wine for the evening and my brains starting to go on holiday. Any UK devs just waking up want to tackle this problem?</p>
<p>I guess you could simulate the issue yourself by adding a new .html page to your standard Silverlight hosting website containing an iframe with loads the Silverlight test page. In fact that&#8217;s how I&#8217;ll start tackling it tomorrow.</p>
<p>For now, I&#8217;m going to call it a night.</p>
<p>I see I&#8217;m getting a little bit of new traffic/twitter follows which I guess I can attribute to my new website&#8230; not because I think it&#8217;s brilliant but because there aren&#8217;t many actual cases of websites making use of Silverlight Streaming, so the Silverlight enthusiasts on Twitter seem to be retweeting. Maybe I&#8217;m wrong but if I&#8217;m right, thanks everyone, and please provide feedback about what I&#8217;ve made. I&#8217;ll be really pleased to hear from you.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/251/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=251&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/CBJ9GV21kyA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/06/12/silverlight-streaming-and-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/06/12/silverlight-streaming-and-google-analytics/</feedburner:origLink></item>
		<item>
		<title>Providing custom ‘no-Silverlight’ UI using Silverlight Streaming</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/Wuju1xuAfwQ/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/06/12/providing-custom-no-silverlight-ui-using-silverlight-streaming/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 22:55:54 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=248</guid>
		<description><![CDATA[When building and hosting your own Silverlight application it&#8217;s pretty simple to provide whatever custom UI you want when a user doesn&#8217;t have a required version of Silverlight installed. Refer to Tim Heuer&#8217;s article on the subject: http://timheuer.com/blog/archive/2008/03/25/creating-a-great-silverlight-deployment-experience.aspx.
When using Silverlight Streaming, however, it&#8217;s not that simple. The two methods provided for embedding your Silverlight application [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=248&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When building and hosting your own Silverlight application it&#8217;s pretty simple to provide whatever custom UI you want when a user doesn&#8217;t have a required version of Silverlight installed. Refer to Tim Heuer&#8217;s article on the subject: <a href="http://timheuer.com/blog/archive/2008/03/25/creating-a-great-silverlight-deployment-experience.aspx">http://timheuer.com/blog/archive/2008/03/25/creating-a-great-silverlight-deployment-experience.aspx</a>.</p>
<p>When using Silverlight Streaming, however, it&#8217;s not that simple. The two methods provided for embedding your Silverlight application don&#8217;t provide a neat space to put your own HTML so you can&#8217;t easily &#8216;own&#8217; the experience.  In my case I used the iFrame solution because I couldn&#8217;t get the other method to work straight away.</p>
<p>What I did to get around this was to download the latest Silverlight.js from here: <a href="http://code.msdn.microsoft.com/silverlightjs">http://code.msdn.microsoft.com/silverlightjs</a>, and the latest JQuery from here: <a href="http://docs.jquery.com/Downloading_jQuery#Current_Release">http://docs.jquery.com/Downloading_jQuery#Current_Release</a>.</p>
<p>Reference both scripts from your web page and then add the following script:</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$(document).ready(function() {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">if (Silverlight.isInstalled(&#8217;2.0.30226.2&#8242;) == true) {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">showSilverlight();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">else {</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">showCopy();</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">});</div>
<pre>$(document).ready(function() {
    if (Silverlight.isInstalled('2.0.30226.2') == true) {
        showSilverlight(); // function to display the iframe &amp; hide the default copy
    }
    else {
        showCopy(); // function to hide the iframe &amp; show the default copy
    }
});</pre>
<p>And that&#8217;s it!</p>
<p>Note: there&#8217;s a comment on the silverlight.js download page that the script links to an older version of the silverlight player. It seems to be correct but even when I updated my script file I still got the &#8216;older version of Silverlight&#8217; message when using Chrome. Also I don&#8217;t know yet whether the experience works on a Mac &#8211; if anyone can let me know I&#8217;d really appreciate it!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=248&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/Wuju1xuAfwQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/06/12/providing-custom-no-silverlight-ui-using-silverlight-streaming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/06/12/providing-custom-no-silverlight-ui-using-silverlight-streaming/</feedburner:origLink></item>
		<item>
		<title>Giving Silverlight Streaming a go</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/2cy0z9INeq8/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/06/10/giving-silverlight-streaming-a-go/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 03:06:52 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[silverlight]]></category>
		<category><![CDATA[hosting]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=243</guid>
		<description><![CDATA[I&#8217;ve been in New Zealand since April undergoing the arduous process of changing my visa to a UK work permit. That&#8217;s another story but what&#8217;s important is that I wanted to capture some of the scenery on video while I was here, and I figured a cool way to present it would be in a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=243&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been in New Zealand since April undergoing the arduous process of changing my visa to a UK work permit. That&#8217;s another story but what&#8217;s important is that I wanted to capture some of the scenery on video while I was here, and I figured a cool way to present it would be in a Silverlight application on a website. I didn&#8217;t have a personal website yet, so I decided to create <a href="http://www.andrewmyhre.com" target="_blank">http://www.andrewmyhre.com</a>.</p>
<p>A couple of weeks and 3 roadtrips later, I&#8217;ve got some footage and a Silverlight application. I cut the video up using VirtualDub and encoded it into .wmv using Expression Encoder, which I&#8217;m very impressed with. The video and music are a combined total of around 300mb, and while my current hosts offer a minimum 1gb storage space on their hosting server I wanted to try something new. At first I figured Azure would be good to have a go at, but while I was googling Silverlight hosting I came across this: <a href="http://www.microsoft.com/silverlight/resources/streaming.aspx" target="_blank">Silverlight Streaming</a>.</p>
<p>Silverlight Streaming is currently in free public beta, and the basic deal is this: register yourself an application account, upload your silverlight application (XAP will do) in a .zip file and any media assets it needs and you&#8217;re given a script you can plonk into a web page to present the Silverlight app. They provide up to 10gb storage and they won&#8217;t charge you for bandwidth use &#8211; sweet!</p>
<p>It took me a couple of attempts to work the thing out, because the documentation seems little vague. I&#8217;ll enumerate some of the idiosyncracies I&#8217;ve come across.</p>
<p>The way the service works, which took me a little while to work out, is that it hosts your Silverlight XAP file and any media assets it needs. It doesn&#8217;t host the website your Silverlight is contained in. It&#8217;s up to you to create your website on another web host and reference the Silverlight app. Furthermore you can&#8217;t reference the XAP as you would regularly using an &lt;object&gt; tag or the Silverlight .Net control, because all of the files in your Silverlight Streaming account are only accessible from the Silverlight Streaming servers. You&#8217;ll just get access denied errors if you try. So the Silverlight Streaming website provides a couple of ways to embed your Silverlight using JavaScript or an iframe, which from my point of view is fine. The HTML for both methods is provided on the page for your application (browse to Manage Applications and select the appropriate application on the next page).</p>
<p>Deploying your application is straight forward when you know how. Create a standard Silverlight project and build it. Now browse to the /ClientBin folder and zip the .xap file. This is the file you upload as the &#8216;application package&#8217; file. You can optionally include a manifest.xml file which specifies some metadata about your .xap &#8211; stuff like Silverlight version, desired width/height and some other guff. Pretty clear why it needs to be specified but including it in your zip file is optional as you can create one manually in the Silverlight Streaming application manager.</p>
<p>When I built my Silverlight website I added the video files to a /Video folder within the host website, and I wanted the same structure in the hosted Silverlight Streaming application. Well it&#8217;s not that simple, because Silverlight Streaming doesn&#8217;t provide you with a nice RESTful file system API. It&#8217;s more like you are given a bucket for your application, and whatever you include in your Zip file gets placed in that bucket in the structure provided.</p>
<p>So I was able to create my structure by including all of the video files within the Zip in a /Video subfolder BUT the Zip file was ~300Mb, so what happens when I want to update the XAP file? I have to update the Zip file and re-upload the whole thing, which on my connection is a 2+ hour operation. This is because every time you upload an application package your whole application bucket is cleared and replaced with the contents of your Zip. So this is not the ideal method for uploading media. Fortunately, there is another method, detailed below, which works for videos. Unfortunately, other types of media, like mp3, wma, jpg etc MUST be uploaded in this way.</p>
<p>An alternative to including the media in the Zip file is to use the Manage Videos function in your Streaming account. Here you can upload individual video files one-by-one into their own seperate little buckets. It&#8217;s a matter of clicking Upload Video, Browse for the file on your hard-drive, click the Upload button. You&#8217;ll get a nice little progress bar to tell you how the upload is progressing. Once you&#8217;ve uploaded your videos, each one is given a unique URL which will be something like http://silverlight.services.live.com/[accountnumber]/[videoname]/video.wmv. This makes it pretty easy to reference the videos from within your silverlight application.</p>
<p>In my case, I have around 100 videos all numbered sequentially. In my silverlight application there&#8217;s a For loop which generates the array of filenames to access, so the above pattern works nicely.</p>
<p>I have a couple of little issues with the management interface so far. The nice thing about the application package upload process is that it takes the contents of a Zip file and extracts them to a bucket with the file structure intact. Nice! But why can&#8217;t I do this with videos? Or on the other hand, why do I have to upload the entire Zip again when I just update one file? Why can&#8217;t I have the option to UPDATE my files, i.e: overwrite anything existing and leave anything else on the server untouched? I either have to spend all day uploading each video one-by-one, or wait all day for a gigantic Zip file to upload. Guys, please, do something about this.</p>
<p>The other issue is regarding non-WMV file formats. While I&#8217;m free to upload video files to the service, what about other formats like mp3 and wma? My application is video clips with a seperate audio soundtrack, which I want to keep separate. The audio files are in WMA format there&#8217;s about 200Mb of them. But the only way to upload anything other than WMV is to include it in the application package Zip file! WHY?? To get around this issue I used Microsoft Expression Encoder to encode them as WMV with a blank video track &#8211; which added about 50% to the total file size. I then uploaded them individually just like all the other videos. I&#8217;m not at all happy with the situation but there&#8217;s currently nothing I can do about it, I just have to spend hours and hours uploading these things.</p>
<p>So it&#8217;s a mixed bag. YAY for free media hosting, that&#8217;s awesome. All they need to do is allow for uploading a single Zip with all your videos in it seperately from the application package, OR allow foran application package UPDATE option which preserves files on the server where they&#8217;re not included in the zip. Also if they added the same upload progress bar we get for videos to the application package upload, that&#8217;d be tops. My website should be online in a few days, once I&#8217;ve finished uploading everything. *sigh*</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/243/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=243&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/2cy0z9INeq8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/06/10/giving-silverlight-streaming-a-go/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/06/10/giving-silverlight-streaming-a-go/</feedburner:origLink></item>
		<item>
		<title>The Windows Hosts File Just Saved My Skin</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/1KEY3M2o1jo/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/05/04/the-windows-hosts-file-just-saved-my-skin/#comments</comments>
		<pubDate>Mon, 04 May 2009 07:05:19 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/2009/05/04/the-windows-hosts-file-just-saved-my-skin/</guid>
		<description><![CDATA[I had an issue today where a virtual machine couldn&#8217;t connect to our team foundation server. I had connected the client machine to the VPN, could ping by IP but not by hostname. I suspect it was to do with the fact that my VM is not part of the AD. I didn&#8217;t want to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=241&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I had an issue today where a virtual machine couldn&#8217;t connect to our team foundation server. I had connected the client machine to the VPN, could ping by IP but not by hostname. I suspect it was to do with the fact that my VM is not part of the AD. I didn&#8217;t want to connect it to the AD because keeping a VM off the domain saves headaches. So after a few moments trying to think of a workaround I remembered the Windows Hosts file. I added an entry to map the IP for the TFS server to the domain name it should have and &#8211; voila &#8211; my visual studio solution was able to connect as normal. I&#8217;ve never ever used that file to do anything useful before, so this was a first. <img src='http://s.wordpress.com/wp-includes/images/smilies/face-smile.png' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/241/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=241&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/1KEY3M2o1jo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/05/04/the-windows-hosts-file-just-saved-my-skin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/05/04/the-windows-hosts-file-just-saved-my-skin/</feedburner:origLink></item>
		<item>
		<title>Alt.Net Beers #7 was a good time</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/5dx9JrIWIXs/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/04/01/altnet-beers-7-was-a-good-time/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 09:12:58 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[alt.net]]></category>
		<category><![CDATA[community]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=228</guid>
		<description><![CDATA[Thanks to everyone who attended Alt.Net Beers #7 and made it such a fun, interesting night. I hope everyone learned a whole heap about DDD &#8211; I know I did.






       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=228&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Thanks to everyone who attended Alt.Net Beers #7 and made it such a fun, interesting night. I hope everyone learned a whole heap about DDD &#8211; I know I did.</p>
<p><a href="http://twitpic.com/2o903"><img class="alignnone size-medium wp-image-235" title="31032009273" src="http://andrewmyhre.files.wordpress.com/2009/04/31032009273.jpg?w=158&#038;h=210" alt="31032009273" width="158" height="210" /></a></p>
<p><a href="http://twitpic.com/2o91q"><img class="alignnone size-medium wp-image-234" title="31032009272" src="http://andrewmyhre.files.wordpress.com/2009/04/31032009272.jpg?w=300&#038;h=225" alt="31032009272" width="300" height="225" /></a></p>
<p><a href="http://twitpic.com/2oan6"><img class="alignnone size-medium wp-image-233" title="31032009271" src="http://andrewmyhre.files.wordpress.com/2009/04/31032009271.jpg?w=300&#038;h=225" alt="31032009271" width="300" height="225" /></a></p>
<p><a href="http://twitpic.com/2oan7"><img class="alignnone size-medium wp-image-232" title="31032009270" src="http://andrewmyhre.files.wordpress.com/2009/04/31032009270.jpg?w=300&#038;h=225" alt="31032009270" width="300" height="225" /></a></p>
<p><a href="http://twitpic.com/2oan5"><img class="alignnone size-medium wp-image-231" title="31032009269" src="http://andrewmyhre.files.wordpress.com/2009/04/31032009269.jpg?w=300&#038;h=225" alt="31032009269" width="300" height="225" /></a></p>
<p><a href="http://twitpic.com/2nd2t"><img class="alignnone size-medium wp-image-229" title="31032009267" src="http://andrewmyhre.files.wordpress.com/2009/04/31032009267.jpg?w=300&#038;h=225" alt="31032009267" width="300" height="225" /></a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=228&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/5dx9JrIWIXs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/04/01/altnet-beers-7-was-a-good-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/04/31032009273.jpg?w=225" medium="image">
			<media:title type="html">31032009273</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/04/31032009272.jpg?w=300" medium="image">
			<media:title type="html">31032009272</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/04/31032009271.jpg?w=300" medium="image">
			<media:title type="html">31032009271</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/04/31032009270.jpg?w=300" medium="image">
			<media:title type="html">31032009270</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/04/31032009269.jpg?w=300" medium="image">
			<media:title type="html">31032009269</media:title>
		</media:content>

		<media:content url="http://andrewmyhre.files.wordpress.com/2009/04/31032009267.jpg?w=300" medium="image">
			<media:title type="html">31032009267</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/04/01/altnet-beers-7-was-a-good-time/</feedburner:origLink></item>
		<item>
		<title>Create a list in a SharePoint site programmatically</title>
		<link>http://feedproxy.google.com/~r/NoFreeTime/~3/oWwZmCoIt2E/</link>
		<comments>http://andrewmyhre.wordpress.com/2009/03/21/create-a-list-in-a-sharepoint-site-programmatically/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 12:07:53 +0000</pubDate>
		<dc:creator>andrewmyhre</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[moss 2007]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[moss]]></category>
		<category><![CDATA[sharepoint 2007]]></category>

		<guid isPermaLink="false">http://andrewmyhre.wordpress.com/?p=225</guid>
		<description><![CDATA[Creating a list programmatically might be handy when you need to do this in a web part or, if you&#8217;re in the situation I was in today, you need to create a list where the template is not available on the Create page.
In my case I had a Collaboration site but I needed to create [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=225&subd=andrewmyhre&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Creating a list programmatically might be handy when you need to do this in a web part or, if you&#8217;re in the situation I was in today, you need to create a list where the template is not available on the Create page.</p>
<p>In my case I had a Collaboration site but I needed to create a Discussion Board &#8211; impossible using the SharePoint UI. How to get around this?</p>
<p>The first solution that occurred to me, and what I assumed I HAD to do, was to create a custom site definition. I had no idea how to go about doing this so this was a daunting prospect. But it occurred to me that, ultimately, I&#8217;ll only need to do this one time, maybe twice, and my users will <em>never</em> do this. So why go to all that trouble when the purpose of a site definition is to create a repeatable story for your end users? All I needed was a one shot hack.</p>
<p>So I remembered the SharePoint object model, and wrote an app. This app takes three arguments &#8211; Site URL, List Name, List Template ID. I used it to create a new discussion board in my site, it&#8217;s repeatable enough for my purposes, and it took me 5 minutes to write.</p>
<p>The code is provided below, but I want to hit home the point of this post &#8211; SharePoint is not as difficult as you think. There is <em>always</em> a simple way to do what you want to do. The difficulty is remembering to think outside the UI. I used to think that where SharePoint build was concerned I&#8217;d have to get used to telling customers &#8216;No&#8217; but, as it turns out, that&#8217;s not that case at all.</p>
<h2>CreateList.exe Source</h2>
<div style="font-family:Courier New;font-size:10pt;color:black;background:white;">
<p style="margin:0;"><span style="color:#2b91af;"> 1</span> <span style="color:blue;">using</span> System;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 2</span> <span style="color:blue;">using</span> System.Collections.Generic;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 3</span> <span style="color:blue;">using</span> System.Linq;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 4</span> <span style="color:blue;">using</span> System.Text;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 5</span> <span style="color:blue;">using</span> Microsoft.SharePoint;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 6</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 7</span> <span style="color:blue;">namespace</span> CreateList</p>
<p style="margin:0;"><span style="color:#2b91af;"> 8</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 9</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Program</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 10</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 11</span> <span style="color:blue;">static</span> <span style="color:blue;">void</span> Main(<span style="color:blue;">string</span>[] args)</p>
<p style="margin:0;"><span style="color:#2b91af;"> 12</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 13</span> <span style="color:blue;">if</span> (args.Length == 0)</p>
<p style="margin:0;"><span style="color:#2b91af;"> 14</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 15</span> PrintListTemplates();</p>
<p style="margin:0;"><span style="color:#2b91af;"> 16</span> <span style="color:blue;">return</span>;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 17</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 18</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 19</span> <span style="color:blue;">bool</span> validArgs = <span style="color:blue;">true</span>;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 20</span> <span style="color:blue;">if</span> (!<span style="color:#2b91af;">Uri</span>.IsWellFormedUriString(args[0], <span style="color:#2b91af;">UriKind</span>.Absolute))</p>
<p style="margin:0;"><span style="color:#2b91af;"> 21</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 22</span> <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#8220;Arg 0 must be an absolute Sharepoint site URL e.g: http://mysite.com&#8221;</span>);</p>
<p style="margin:0;"><span style="color:#2b91af;"> 23</span> validArgs = <span style="color:blue;">false</span>;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 24</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 25</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 26</span> <span style="color:blue;">int</span> templateId=0;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 27</span> <span style="color:blue;">if</span> (!<span style="color:blue;">int</span>.TryParse(args[2], <span style="color:blue;">out</span> templateId))</p>
<p style="margin:0;"><span style="color:#2b91af;"> 28</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 29</span> <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#8220;Arg 2 must be a valid list template id from the following list:&#8221;</span>);</p>
<p style="margin:0;"><span style="color:#2b91af;"> 30</span> validArgs = <span style="color:blue;">false</span>;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 31</span> PrintListTemplates();</p>
<p style="margin:0;"><span style="color:#2b91af;"> 32</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 33</span> <span style="color:blue;">if</span> (!validArgs)</p>
<p style="margin:0;"><span style="color:#2b91af;"> 34</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 35</span> <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#8220;Invoke with no arguments to get a list of available SharePoint List templates&#8221;</span>);</p>
<p style="margin:0;"><span style="color:#2b91af;"> 36</span> <span style="color:blue;">return</span>;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 37</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 38</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 39</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 40</span> <span style="color:#2b91af;">Uri</span> siteUrl = <span style="color:blue;">new</span> <span style="color:#2b91af;">Uri</span>(args[0]);</p>
<p style="margin:0;"><span style="color:#2b91af;"> 41</span> <span style="color:blue;">string</span> listName = args[1];</p>
<p style="margin:0;"><span style="color:#2b91af;"> 42</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 43</span> AddListToSite(siteUrl, listName, templateId);</p>
<p style="margin:0;"><span style="color:#2b91af;"> 44</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 45</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 46</span> <span style="color:blue;">private</span> <span style="color:blue;">static</span> <span style="color:blue;">void</span> AddListToSite(<span style="color:#2b91af;">Uri</span> siteUrl, <span style="color:blue;">string</span> listName, <span style="color:blue;">int</span> SPListTemplateTypeId)</p>
<p style="margin:0;"><span style="color:#2b91af;"> 47</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 48</span> <span style="color:blue;">using</span> (<span style="color:#2b91af;">SPSite</span> site = <span style="color:blue;">new</span> <span style="color:#2b91af;">SPSite</span>(<span style="color:blue;">string</span>.Format(<span style="color:#a31515;">&#8220;{0}&#8221;</span>, siteUrl)))</p>
<p style="margin:0;"><span style="color:#2b91af;"> 49</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 50</span> <span style="color:#2b91af;">SPWeb</span> web = site.OpenWeb();</p>
<p style="margin:0;"><span style="color:#2b91af;"> 51</span> <span style="color:#2b91af;">Guid</span> listGuid = web.Lists.Add(listName, <span style="color:#a31515;">&#8220;&#8221;</span>, (<span style="color:#2b91af;">SPListTemplateType</span>)SPListTemplateTypeId);</p>
<p style="margin:0;"><span style="color:#2b91af;"> 52</span> <span style="color:#2b91af;">SPList</span> list = web.Lists.GetList(listGuid, <span style="color:blue;">true</span>);</p>
<p style="margin:0;"><span style="color:#2b91af;"> 53</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 54</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 55</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 56</span> <span style="color:blue;">private</span> <span style="color:blue;">static</span> <span style="color:blue;">void</span> PrintListTemplates()</p>
<p style="margin:0;"><span style="color:#2b91af;"> 57</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 58</span> <span style="color:blue;">string</span>[] typeNames = System.<span style="color:#2b91af;">Enum</span>.GetNames(<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">SPListTemplateType</span>));</p>
<p style="margin:0;"><span style="color:#2b91af;"> 59</span> <span style="color:#2b91af;">Array</span> typeValues = System.<span style="color:#2b91af;">Enum</span>.GetValues(<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">SPListTemplateType</span>));</p>
<p style="margin:0;"><span style="color:#2b91af;"> 60</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 61</span> <span style="color:blue;">int</span> j = 0;</p>
<p style="margin:0;"><span style="color:#2b91af;"> 62</span></p>
<p style="margin:0;"><span style="color:#2b91af;"> 63</span> <span style="color:blue;">foreach</span> (<span style="color:blue;">int</span> i <span style="color:blue;">in</span> typeValues)</p>
<p style="margin:0;"><span style="color:#2b91af;"> 64</span> {</p>
<p style="margin:0;"><span style="color:#2b91af;"> 65</span> <span style="color:#2b91af;">Console</span>.WriteLine(typeNames[j++].ToString() + <span style="color:#a31515;">&#8221; &#8220;</span> + i.ToString());</p>
<p style="margin:0;"><span style="color:#2b91af;"> 66</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 67</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 68</span> }</p>
<p style="margin:0;"><span style="color:#2b91af;"> 69</span> }</p>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewmyhre.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewmyhre.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewmyhre.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewmyhre.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewmyhre.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewmyhre.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewmyhre.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewmyhre.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewmyhre.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewmyhre.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewmyhre.wordpress.com&blog=2776051&post=225&subd=andrewmyhre&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/NoFreeTime/~4/oWwZmCoIt2E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrewmyhre.wordpress.com/2009/03/21/create-a-list-in-a-sharepoint-site-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/88fb9df2ebabdb5026a0544004b41738?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">andrewmyhre</media:title>
		</media:content>
	<feedburner:origLink>http://andrewmyhre.wordpress.com/2009/03/21/create-a-list-in-a-sharepoint-site-programmatically/</feedburner:origLink></item>
	</channel>
</rss>
