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

<channel>
	<title>b-rad blog</title>
	<atom:link href="http://www.bradcurtis.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bradcurtis.com</link>
	<description>adventures in technology</description>
	<lastBuildDate>Sun, 13 Feb 2011 06:49:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Hosts files and the Google Android emulator</title>
		<link>http://www.bradcurtis.com/2011/02/13/hosts-file-google-android-emulator/</link>
		<comments>http://www.bradcurtis.com/2011/02/13/hosts-file-google-android-emulator/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 06:49:37 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.bradcurtis.com/?p=52</guid>
		<description><![CDATA[Using the Google Android emulator is a good way to test how a website behaves on Android devices. Connecting to your local computer http://10.0.2.2 is the URL to connect to a website hosted on your local computer. localhost or 127.0.0.1 will not work! This is all defined in the documentation on Android emulator networking. Using&#8230;]]></description>
			<content:encoded><![CDATA[<p>Using the Google Android emulator is a good way to test how a website behaves on Android devices.</p>
<h3>Connecting to your local computer</h3>
<p>http://10.0.2.2 is the URL to connect to a website hosted on your local computer. <em>localhost</em> or 127.0.0.1 will not work! This is all defined in the documentation on <a href="http://developer.android.com/guide/developing/tools/emulator.html#emulatornetworking">Android emulator networking</a>.</p>
<h3>Using a hosts file</h3>
<p>The Android emulator will not make use of your local hosts file. This is unfortunate when your website relies on host headers to work correctly (eg. SharePoint). What you need to do is edit the hosts file on the Android emulator image itself.</p>
<ol>
<li>start your Android Virtual Device (AVD):
<pre>emulator -avd myAvdNameHere -partition-size 128</pre>
<p>Located in C:\Program Files (x86)\Android\android-sdk-windows\tools\ on Windows 64bit</p>
<p><strong>Note</strong><br />
The partition-size parameter is needed to expand the image size to prevent an error in step 5. If you try and perform these steps after starting the emulator from the UI you will receive the following error:<br />
<em>failed to copy &#8216;c:\temp\hosts&#8217; to &#8216;/system/etc/hosts&#8217;: Out of memory</em></li>
<li>remount the device image as writable:
<pre>adb remount</pre>
<p>Located in C:\Program Files (x86)\Android\android-sdk-windows\platform-tools\ on Windows 64bit</li>
<li>save a copy of the existing hosts file to a temporary location on your host computer:
<pre>adb pull /system/etc/hosts c:\temp</pre>
</li>
<li>edit the hosts file adding an entry pointing to your host computer:
<pre>127.0.0.1     localhost
10.0.2.2      mytesthost</pre>
</li>
<li>save the edited hosts file to your Android emulator:
<pre>adb push c:\temp\hosts /system/etc</pre>
</li>
</ol>
<p>You can now browse to your entered hostname in the Android browser.<br />
<a href="http://www.bradcurtis.com/wp-content/uploads/2011/02/android-emulator.png"><img class="aligncenter size-medium wp-image-54" title="Android emulator" src="http://www.bradcurtis.com/wp-content/uploads/2011/02/android-emulator-300x180.png" alt="Android emulator" width="300" height="180" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradcurtis.com/2011/02/13/hosts-file-google-android-emulator/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010 jQuery compatibility errors &#8211; cmssitemanager.js</title>
		<link>http://www.bradcurtis.com/2011/01/26/cmssitemanager-sharepoint-2010-jquery-compatibility-errors/</link>
		<comments>http://www.bradcurtis.com/2011/01/26/cmssitemanager-sharepoint-2010-jquery-compatibility-errors/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 04:17:00 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://www.bradcurtis.com/?p=47</guid>
		<description><![CDATA[Recently I used a site collection scoped feature to add jQuery support to a SharePoint 2010 site collection. As documented on countless blogs, I used custom action XML similar to the following: &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&#62; &#60;CustomAction ScriptSrc="JqueryCustomAction/jquery-1.4.2.min.js" Location="ScriptLink" Sequence="100"&#62; &#60;/CustomAction&#62; &#60;/Elements&#62; Everything seemed to work as intended. Only later did I notice strange&#8230;]]></description>
			<content:encoded><![CDATA[<p>Recently I used a site collection scoped feature to add jQuery support to a SharePoint 2010 site collection. As documented on countless blogs, I used custom action XML similar to the following:</p>
<pre class="brush: xml">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;CustomAction
    ScriptSrc="JqueryCustomAction/jquery-1.4.2.min.js"
    Location="ScriptLink"
    Sequence="100"&gt;
  &lt;/CustomAction&gt;
&lt;/Elements&gt;
</pre>
</p>
<p>
Everything seemed to work as intended. Only later did I notice strange JavaScript errors in the SharePoint interface. The most common errors were in a file called cmssitemanager.js when using the Asset Picker dialog as part of a publishing site:<br />
<a href="http://www.bradcurtis.com/wp-content/uploads/2011/01/error.png"><img src="http://www.bradcurtis.com/wp-content/uploads/2011/01/error-300x259.png" alt="SharePoint 2010 JavaScript error" title="SharePoint 2010 JavaScript error" width="300" height="259" class="aligncenter size-medium wp-image-48" /></a>
</p>
<p>
It turns out that SharePoint 2010 has JavaScript that registers a global function named &#8220;$&#8221;. This conflicts with the same global function which is registered by jQuery and is used as shorthand for the various jQuery functions.
</p>
<p>
My very quick solution was to reference a second JavaScript file in my custom action. This JavaScript file disables the &#8220;$&#8221; shorthand function for jQuery. This fixes all the compatibility issues with the only downside being that you now have to replace &#8220;$&#8221; with &#8220;jQuery&#8221; when referring to jQuery globally.</p>
<p>Updated script references:</p>
<pre class="brush: xml">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  &lt;CustomAction
    ScriptSrc="JqueryCustomAction/jquery-1.4.2.min.js"
    Location="ScriptLink"
    Sequence="100"&gt;
  &lt;/CustomAction&gt;
  &lt;CustomAction
    ScriptSrc="JqueryCustomAction/jquery-noconflict.js"
    Location="ScriptLink"
    Sequence="105"&gt;
  &lt;/CustomAction&gt;
&lt;/Elements&gt;
</pre>
<p>No conflict JavaScript:</p>
<pre class="brush: js">
// this puts jquery into no conflict mode which will remedy conflicts caused by jQuery when used
// with certan publishing features
jQuery.noConflict();
</pre>
<p>
Below is a minimal Visual Studio 2010 solution that contains a site collection scoped jQuery feature.</p>
<p><a href='http://www.bradcurtis.com/wp-content/uploads/2011/01/SharePoint2010jQuery.zip'>Visual Studio 2010 Solution &#8211; SharePoint 2010 &#038; jQuery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradcurtis.com/2011/01/26/cmssitemanager-sharepoint-2010-jquery-compatibility-errors/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>My iPad Experience</title>
		<link>http://www.bradcurtis.com/2010/05/06/my-ipad-experience/</link>
		<comments>http://www.bradcurtis.com/2010/05/06/my-ipad-experience/#comments</comments>
		<pubDate>Thu, 06 May 2010 11:44:33 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[tablet]]></category>

		<guid isPermaLink="false">http://www.bradcurtis.com/?p=15</guid>
		<description><![CDATA[I was lucky enough to get an iPad recently. I can truthfully say that it is my best ever gadget purchase. The iPad has not been designed as a general purpose computer and that is its biggest strength. It excels at web browsing, audio/video playback, as a book reader and at gaming. Below I&#8217;ll cover&#8230;]]></description>
			<content:encoded><![CDATA[<p>I was lucky enough to get an iPad recently. I can truthfully say that it is my best ever gadget purchase. The iPad has not been designed as a general purpose computer and that is its biggest strength. It excels at web browsing, audio/video playback, as a book reader and at gaming. Below I&#8217;ll cover some of the apps I&#8217;ve been using to help me perform these tasks.</p>
<h2>Safari</h2>
<p>Safari is still the best mobile web browser I have used. The iPad version is basically the same as that of the iPhone. There are some tweaks to make better use of the screen real estate. This is most noticeable in the &#8220;tab&#8221; view for viewing multiple pages simultaneously. Although Flash is a noticeable absence from the iPad, I have not found it to be much of a problem. All of the video sites I frequent (<a href="http://www.youtube.com/">YouTube</a>, <a href="http://www.vimeo.com/">Vimeo</a>, <a href="http://www.funnyordie.com">Funny or Die</a>) support either HTML 5 or iPad compatible video. This results in a far better experience than even Flash video on the desktop. A simple pinch zoom brings an embedded video to full screen. It&#8217;s great.</p>
<p>It isn&#8217;t all good though. I am often left waiting for sections of a page to render even if it has already been recently rendered. This occurs when you are panning around a large website. This may be related to the small amount of memory given to the iPad (256MB). I also find the iPad redownloading a lot of content that you might expect to be cached. This often occurs when you navigate back and may also be due to the small amount of memory.</p>
<h2><a href="http://itunes.apple.com/au/app/air-video-watch-your-videos/id306550020?mt=8">Air Video &#8211; $3.99</a></h2>
<p><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/AirVideo.jpg"><img class="aligncenter size-medium wp-image-44" title="Air Video" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/AirVideo-300x225.jpg" alt="Air Video" width="300" height="225" /></a>My media setup is made up of a <a href="http://www.thecus.com/products_over.php?cid=11&amp;pid=32">Thecus NAS</a> with <a href="http://www.twonkyvision.de/">TwonkyMedia</a> server serving to my PS3. This works great for all of the many media formats that can be natively played by the PS3. For other files I use the fantastic <a href="http://ps3mediaserver.blogspot.com/">PS3 Media Server</a> which serves the same files on my NAS but adds a seamless transcoding function.</p>
<p>I wanted this same experience on my iPad so that it could act as another &#8220;screen&#8221; for local content. I first investigated DLNA/UPNP clients which would allow me to browse my Twonky server. There are a few of these but the main limiting factor is the iPad and its inability to play content in anything other than its preferred format. After some brief investigations into PS3 Media Server support for iPad, I eventually turned to another iPad app and matching software called <a href="http://www.inmethod.com/air-video/index.html">Air Video</a>. This works in a similar way to PS3 Media Server by providing a seamless transcoding experience especially for the iPhone and iPad. It isn&#8217;t free and it isn&#8217;t UPNP compatible but it has successfully transcoded every video I have thrown at it thus far.</p>
<h2><a href="http://itunes.apple.com/au/app/kindle/id302584613?mt=8">Kindle &#8211; Free</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/Kindle.jpg"><img class="aligncenter size-medium wp-image-45" title="Kindle" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/Kindle-225x300.jpg" alt="Kindle" width="225" height="300" /></a>I was already a Kindle owner, so for me the Amazon Kindle application for iPad was a must. This app seamlessly turns your iPad into another Kindle compatible device. All of your books will automatically appear on your iPad just as they did on your Kindle. The iPad is a solid book reader. For large format books or for books with detailed illustrations the iPad is far better than my Kindle (international, non DX). For reading basic novels I prefer the smaller and lighter Kindle. One thing I did notice was that I seemed to get less drowsy when reading from the iPad versus the Kindle. This can be good in some situations but is obviously not preferable before bedtime. Another issue which became apparent was that the iPad provided unlimited sources of distraction from the books I was attempting to read.</p>
<h2><a href="http://itunes.apple.com/au/app/wyse-pocketcloud-remote-desktop/id326512817?mt=8">Wyse PocketCloud Remote Desktop &amp; RDP Client &#8211; $17.99</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/WYSE.jpg"><img class="aligncenter size-medium wp-image-36" title="WYSE" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/WYSE-300x225.jpg" alt="WYSE" width="300" height="225" /></a>I use this reasonably priced piece of software to remotely control my Windows 7 machines via RDP. This software is simple to use and quite fast over my wireless-G network. The good thing about this application when compared with others is that it allows for direct interaction. By this I mean that to click a button you simply touch it. Other RDP/VNC tools first make you move the mouse cursor to a position before you can click it. One example of this iTeleport.</p>
<h2><a href="http://itunes.apple.com/au/app/iteleport-for-ipad/id364905685?mt=8">iTeleport: Jaadu VNC for iPhone / iPad &#8211; $29.99</a></h2>
<p><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/iteleport.jpg"><img class="aligncenter size-medium wp-image-42" title="iteleport" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/iteleport-300x225.jpg" alt="iteleport" width="300" height="225" /></a>This is a rather pricey app that can be used for accessing your computers via VNC. The creators of this app also provide a number of additional OSX/Windows tools for helping you configure your firewall settings, port forwarding/UPNP. These may be useful for beginners but I found they just got in the way. As expected VNC was not as fast as RDP on a Windows machine. Also, the non-direct way of interacting with the host system (via the movement of a virtual mouse pointer) was quite annoying.</p>
<h2><a href="http://itunes.apple.com/au/app/inet-pro-network-scanner/id305242949?mt=8">iNet Pro &#8211; $5.99</a></h2>
<p>iNet provides a number of useful networking tools. This application is actually an iPhone application. I can put up with the iPad&#8217;s awful 2x scaling of iPhone apps because i use the wake on LAN function of this app to turn on my computers from my couch.</p>
<h2><a href="http://itunes.apple.com/au/app/f1-2010-timing-app-championship/id338673815?mt=8">F1 2010 Timing App &#8211; $39.99</a></h2>
<p><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/f1timing.jpg"><img class="aligncenter size-medium wp-image-34" title="f1timing" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/f1timing-225x300.jpg" alt="f1timing" width="225" height="300" /></a>Although ridiculously priced, this app should be good. There a number of other sports apps in the AppStore that are designed to augment your TV viewing experience. As my sport of choice is F1 I coughed up the money for this app which should provide live timing and track position during practice sessions, qualifying and grand prixs. My first use should be at next week&#8217;s Spanish grand prix.</p>
<h2><a href="http://itunes.apple.com/au/app/dungeon-hunter-hd/id364354155?mt=8">Dungeon Hunter HD &#8211; $8.99</a></h2>
<p><a href="http://itunes.apple.com/au/app/dungeon-hunter-hd/id364354155?mt=8"></a><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/dungeonhunter.jpg"><img class="aligncenter size-medium wp-image-39" title="Dungeon Hunter HD" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/dungeonhunter-300x225.jpg" alt="Dungeon Hunter HD" width="300" height="225" /></a>This game will appeal to anyone who likes Diablo or Torchlight. This game has all of the right ingredients and is fun to play but it is let down by its horrible leveling/balancing. It gets easier as you progress through the game to the point that you don&#8217;t really feel the need for new gear or attributes. I hope someone can fix this as the iPad is awesome for this style of game.</p>
<h2><a href="http://itunes.apple.com/au/app/real-racing-hd/id363998989?mt=8">Real Racing HD &#8211; $12.99</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/realracinghd.jpg"><img class="aligncenter size-medium wp-image-37" title="Real Racing HD" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/realracinghd-300x225.jpg" alt="Real Racing HD" width="300" height="225" /></a>This is my favorite racer on the iPhone and it&#8217;s even better on the iPad. Although it pretends to be a simulation style racer, the car dynamics are far from realistic. This is probably for the best given the limited control inputs available. Heaps of tracks and great graphics make this game worthy of its premium pricing.</p>
<h2><a href="http://itunes.apple.com/au/app/minigore-hd/id364238135?mt=8">Minigore HD &#8211; $5.99</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/minigorehd.jpg"><img class="aligncenter size-medium wp-image-40" title="Minigore HD" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/minigorehd-300x225.jpg" alt="Minigore HD" width="300" height="225" /></a>This is a fun arcade shooter with a great visual style and even better comical sound effects. I recommend it.</p>
<h2><a href="http://itunes.apple.com/au/app/fieldrunners-for-ipad/id364204209?mt=8">Fieldrunners HD &#8211; $9.99</a></h2>
<p><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/mzl.rmhqglhq.480x480-75.jpg"><img class="aligncenter size-medium wp-image-33" title="Fieldrunners HD" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/mzl.rmhqglhq.480x480-75-300x225.jpg" alt="Fieldrunners HD" width="300" height="225" /></a></p>
<p>Tower defense games are brilliant on iPad. Field runners is one of the best. It has great graphics and is highly addictive.</p>
<h2><a href="http://itunes.apple.com/au/app/zombieville-usa-hd/id366741832?mt=8">Zombieville USA HD &#8211; $2.49</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/zombievillehd.jpg"><img class="aligncenter size-medium wp-image-38" title="Zombieville HD" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/zombievillehd-300x225.jpg" alt="Zombieville HD" width="300" height="225" /></a>This game is amazingly simple. You move either left or right and tap as fast as you can to shoot the never-ending herd of zombies that are trying to eat your brains. Great artwork and well priced.</p>
<h2><a href="http://itunes.apple.com/au/app/geometry-wars-touch-for-ipad/id364175436?mt=8">Geometry Wars &#8211; $12.99</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/geometrywars.jpg"><img class="aligncenter size-medium wp-image-41" title="Geometry Wars" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/geometrywars-300x225.jpg" alt="Geometry Wars" width="300" height="225" /></a>This game is pretty much the same as it is on every other platform. It still provides some pretty intense arcade style fun. The virtual analogue controllers mean you won&#8217;t be as accurate as you would be on other platforms. Still this is worh the money especially if you are yet to try this great game.</p>
<h2><a href="http://itunes.apple.com/au/app/flight-control-hd/id363727129?mt=8">Flight Control HD &#8211; $5.99</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/flightcontrolhd.jpg"><img class="aligncenter size-medium wp-image-35" title="Flight Control HD" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/flightcontrolhd-300x225.jpg" alt="Flight Control HD" width="300" height="225" /></a>This is the iPad version of the best selling iPhone game. In this game you direct planes and helicopters into runways and helipads in an attempt to avert inevitable fiery disasters. In this version they have added some splitscreen multiplayer modes and 3D?!? This game spawned a host of other &#8220;path drawing&#8221; games and is probably still the best.</p>
<h2><a href="http://itunes.apple.com/au/app/angry-birds-hd/id364234221?mt=8">Angry Birds HD &#8211; $5.99</a></h2>
<p style="text-align: left;"><a href="http://www.bradcurtis.com/wp-content/uploads/2010/05/angrybirdshd.jpg"><img class="aligncenter size-medium wp-image-43" title="Angry Birds HD" src="http://www.bradcurtis.com/wp-content/uploads/2010/05/angrybirdshd-300x225.jpg" alt="Angry Birds HD" width="300" height="225" /></a>This is another very popular game which has come from the iPhone. In it you shoot angry birds at mean pigs in all kinds of breakable environments. I don&#8217;t think the iPad has added anything to the enjoyment of this game but it was pretty fun to start with so that&#8217;s ok.</p>
<p>So, are there any other apps I should be using? I have omitted the Apple provided apps like iBooks and iWork as these are not yet available to Australians. In fact the iPad AppStore app itself is unavailable. For the moment i am forced to get all my apps through iTunes and then sync via USB. It&#8217;s a good thing the iPad is an incredible device because iTunes is rubbish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradcurtis.com/2010/05/06/my-ipad-experience/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Series &#8211; notes from launch</title>
		<link>http://www.bradcurtis.com/2010/02/16/windows-phone-series-7-notes-from-launch/</link>
		<comments>http://www.bradcurtis.com/2010/02/16/windows-phone-series-7-notes-from-launch/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 21:49:22 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.bradcurtis.com/?p=12</guid>
		<description><![CDATA[Microsoft announced Windows Phone 7 today. It looks pretty amazing. The only negative point is that it won&#8217;t be out until the fourth quarter of 2010. Below are my notes from the launch: Approach WP7 changed approach, focused on end users, business and otherwise visual design is called &#8220;metro&#8221; graphical intense, high motion ui home&#8230;]]></description>
			<content:encoded><![CDATA[<p>Microsoft announced Windows Phone 7 today. It looks pretty amazing. The only negative point is that it won&#8217;t be out until the fourth quarter of 2010.</p>
<p><a href="http://www.bradcurtis.com/wp-content/uploads/2010/02/wp7.jpg"><img class="alignnone size-full wp-image-13" title="wp7" src="http://www.bradcurtis.com/wp-content/uploads/2010/02/wp7.jpg" alt="Windows Phone 7 - Prototype Hardware" width="510" height="283" /></a></p>
<p>Below are my notes from the launch:</p>
<h2>Approach</h2>
<ul>
<li>WP7 changed approach, focused on end users, business and otherwise</li>
<li>visual design is called &#8220;metro&#8221; graphical intense, high motion ui</li>
<li>home screen is called the &#8220;start bar&#8221;</li>
<li>focuses on tasks rather than apps &#8211; tasks form a hub</li>
<li>Syncing to social networks seems to be a hands-off experience, sign in and it does the rest</li>
<li>Microsoft want to maintain stricter control of the look &amp; feel of the device while still allowing for third-party innovation</li>
</ul>
<h2>Hardware</h2>
<ul>
<li>three hardware buttons (back, start, search)</li>
<li>require capacitive touch (minimum 4 point touch)</li>
<li>WVGA screen</li>
<li>FM (or digital?) radio</li>
</ul>
<h2>Search</h2>
<ul>
<li>context sensitive &#8211; different results based on where you are in the phone (contacts, email etc.)</li>
<li>automatically uses GPS</li>
<li>search can be of three types, attempts to choose the most appropriate one automatically (local, news, web)</li>
</ul>
<h2>Web Browser</h2>
<ul>
<li>based on PC code for maximum compatibility</li>
<li>pinch zoom</li>
<li>tap to zoom (zoom to column on page)</li>
<li>sub pixel positioning for text)</li>
<li>recognizes phone numbers and addresses and makes them linkable</li>
<li>supports tabs</li>
</ul>
<h2>People Hub</h2>
<ul>
<li>Aggregates all your contacts from social networks (no twitter yet by the looks, I imagine this will change)</li>
<li>Shows people you have communicated with recently</li>
<li>&#8220;What&#8217;s new&#8221; feed: feed from all your social networks</li>
</ul>
<h2>Office Hub</h2>
<ul>
<li>Access to Microsoft Office apps like OneNote, Excel, Word etc.</li>
</ul>
<h2>Games hub</h2>
<ul>
<li>Syncs with Xbox live</li>
<li>Focus on social gamer experience</li>
<li>earn gamer score, achievements</li>
</ul>
<h2>Me tile</h2>
<ul>
<li>Simultaneously update your social networking status to multiple sites</li>
</ul>
<h2>Email</h2>
<ul>
<li>Supports all common providers including gmail, yahoo as well as Exchange (of course)</li>
<li>Never see a loading bar, works against a local cache (very fast experience)</li>
</ul>
<h2>Text</h2>
<ul>
<li>Supports SMS, MMS</li>
<li>Supports portrait/landscape typing modes</li>
</ul>
<h2>Calendar</h2>
<ul>
<li>Automatically merges your personal and work calendars</li>
</ul>
<h2>Pictures</h2>
<ul>
<li>gallery lets you browse all pictures</li>
<li>&#8220;mosaic&#8221; shows recent or favourite pictures</li>
<li>&#8220;What&#8217;s new&#8221; feed shows latest pictures from your social networking sites (Facebook, Windows Live etc)</li>
<li>Album view combines folders from photos synced from Zune software on your PC with albums from Facebook, Windows Live</li>
<li>Social networking comments are displayed when you view a picture</li>
</ul>
<h2>Music and Video</h2>
<ul>
<li>Full Zune HD experience</li>
<li>Supports Zune pass/subscription</li>
</ul>
<h2>Other</h2>
<ul>
<li>toolbar is always available at the bottom to access &#8220;enhanced&#8221; commands</li>
<li>UI is not completely done (especially some of the buttons you see)</li>
<li>one press to correct words you&#8217;ve messed up in keyboard mode</li>
</ul>
<p>More information:</p>
<p><a href="http://channel9.msdn.com/posts/LauraFoy/First-Look-Windows-Phone-7-Series-Hands-on-Demo/" target="_blank">http://channel9.msdn.com/posts/LauraFoy/First-Look-Windows-Phone-7-Series-Hands-on-Demo/</a></p>
<p><a href="http://www.windowsphone7series.com" target="_blank">http://www.windowsphone7series.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradcurtis.com/2010/02/16/windows-phone-series-7-notes-from-launch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows 7 tablets versus the Apple iPad</title>
		<link>http://www.bradcurtis.com/2010/02/07/windows-7-tablets-versus-the-apple-ipad/</link>
		<comments>http://www.bradcurtis.com/2010/02/07/windows-7-tablets-versus-the-apple-ipad/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 07:20:09 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[tablet]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.bradcurtis.com/?p=10</guid>
		<description><![CDATA[There&#8217;s plenty of things not to like about the iPad. However the user experience isn&#8217;t one of them. I think the Windows 7 crew have a fair way to go in this respect. See the videos and make up your own mind. HP Slate &#8211; Windows 7 Archos 9 &#8211; Windows 7 Apple iPad &#8211;&#8230;]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s plenty of things <a href="http://www.crunchgear.com/2010/01/27/apple-has-a-solution-for-the-ipads-missing-sd-card-slot-and-usb-port-adapters/">not</a> <a href="http://gizmodo.com/5458382/8-things-that-suck-about-the-ipad">to</a> <a href="http://www.popsci.com.au/gadgets/article/2010-01/ipad%E2%80%99s-closed-system-sometimes-i-hate-being-right">like</a> about the iPad. However the user experience isn&#8217;t one of them. I think the Windows 7 crew have a fair way to go in this respect.</p>
<p>See the videos and make up your own mind.</p>
<h2>HP Slate &#8211; Windows 7</h2>
<p><object type="application/x-shockwave-flash" style="width:560px; height:340px;" data="http://www.youtube.com/v/En7cdBhlrGU&#038;start=165"><param name="movie" value="http://www.youtube.com/v/En7cdBhlrGU&#038;start=165" /></object></p>
<h2>Archos 9 &#8211; Windows 7</h2>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6493470&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6493470&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object></p>
<h2>Apple iPad &#8211; iPhone OS</h2>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/c4IBN5OAdZc&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;start=20"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/c4IBN5OAdZc&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;start=20" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradcurtis.com/2010/02/07/windows-7-tablets-versus-the-apple-ipad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Document and report generation using XAML, WPF data binding and XPS</title>
		<link>http://www.bradcurtis.com/2010/02/06/document-and-report-generation-using-xaml-wpf-databinding-and-xps/</link>
		<comments>http://www.bradcurtis.com/2010/02/06/document-and-report-generation-using-xaml-wpf-databinding-and-xps/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:18:55 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[wpf]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[xps]]></category>

		<guid isPermaLink="false">http://www.bradcurtis.com/?p=3</guid>
		<description><![CDATA[Generating printable documents or reports containing dynamic data is a common requirement of most business systems. In this post I will show you how to create XPS documents dynamically using WPF templates loaded from the file system and populated with data binding. This technique is especially powerful when the output document needs to be either&#8230;]]></description>
			<content:encoded><![CDATA[<p>Generating printable documents or reports containing dynamic data is a common requirement of most business systems. In this post I will show you how to create XPS documents dynamically using WPF templates loaded from the file system and populated with data binding. This technique is especially powerful when the output document needs to be either highly dynamic or has lots of design elements. The example document we will create looks something like this:</p>
<p><a href="http://www.bradcurtis.com/wp-content/uploads/2010/02/docscreenshot3.png"><img class="size-full wp-image-9 alignnone" title="Document Template" src="http://www.bradcurtis.com/wp-content/uploads/2010/02/docscreenshot3.png" alt="" width="476" height="468" /></a></p>
<h2>The document template</h2>
<p>For a fixed format document the &lt;FixedDocument/&gt; is a logical starting point. The template needed to make our document is as follows:</p>
<pre class="brush: xml">&lt;FixedDocument
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xml:lang="en-au"&gt;
   &lt;FixedDocument.Resources&gt;
      &lt;BooleanToVisibilityConverter x:Key="visConverter"/&gt;
   &lt;/FixedDocument.Resources&gt;
   &lt;PageContent&gt;
      &lt;FixedPage Width="793.76" Height="1122.56"&gt;
         &lt;!-- Page 1 Begins Here --&gt;
         &lt;StackPanel Margin="50"&gt;
            &lt;Border BorderThickness="5" BorderBrush="Gray" CornerRadius="10"
               Padding="20" Width="690"&gt;
               &lt;StackPanel Orientation="Horizontal" Margin="0 0 0 0"&gt;
                  &lt;Image Source="truck.jpg" HorizontalAlignment="Left"/&gt;
                  &lt;TextBlock Margin="30 0 0 0" FontSize="50"
                     Text="{Binding Path=Heading}" VerticalAlignment="Center"/&gt;
               &lt;/StackPanel&gt;
            &lt;/Border&gt;
            &lt;TextBlock Margin="0 30 0 0"
               Text="{Binding Path=CurrentDate, StringFormat='{}{0:d MMMM yyyy}'}"/&gt;
            &lt;TextBlock Margin="0 30 0 0"
               Text="{Binding Path=Name, StringFormat='Dear {0},'}" /&gt;
            &lt;ItemsControl Margin="30 20 0 0" ItemsSource="{Binding Path=DotPoints}"
               HorizontalAlignment="Left"&gt;
               &lt;ItemsControl.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                     &lt;StackPanel Margin="0,8,0,0" Orientation="Horizontal" &gt;
                        &lt;TextBlock Text="• " /&gt;
                        &lt;TextBlock Text="{Binding}" TextWrapping="Wrap" Width="400"/&gt;
                     &lt;/StackPanel&gt;
                  &lt;/DataTemplate&gt;
               &lt;/ItemsControl.ItemTemplate&gt;
            &lt;/ItemsControl&gt;
            &lt;TextBlock Margin="0 30 0 0"
               Text="Congratulations, you are entitled to a 50% discount!"
               Visibility="{Binding Path=GiveDiscount,
                                        Converter={StaticResource visConverter}}"/&gt;
         &lt;/StackPanel&gt;
      &lt;/FixedPage&gt;
   &lt;/PageContent&gt;
   &lt;PageContent&gt;
      &lt;FixedPage Width="793.76" Height="1122.56"&gt;
         &lt;!-- Page 2 Begins Here --&gt;
         &lt;TextBlock Margin="50" Text="Nothing to see here."/&gt;
      &lt;/FixedPage&gt;
   &lt;/PageContent&gt;
&lt;/FixedDocument&gt;</pre>
<p>This includes the namespace imports that should be familiar to any WPF developer. One thing of interest in this template is the hard coded width and height of the &lt;FixedPage/&gt;. These values have specified an A4 page in portrait orientation. These have been based on the DPI of WPF (96) and the dimensions of an A4 page.</p>
<p>The XAML template includes standard WPF binding expressions which will be used to populate the document with dynamic data. It also makes use of the BooleanToVisibilityConverter to make easy show/hide functionality through data binding.</p>
<h2>Loading the template from the file system</h2>
<p>System.Windows.Markup.XamlReader provides an easy way of parsing XAML markup into objects:</p>
<pre class="brush: csharp">public static object LoadTemplate(string templatePath)
{
   object template;

   // get the needed template paths
   string absolutePath = Path.GetFullPath(templatePath);
   string directoryPath = Path.GetDirectoryName(absolutePath);

   using (FileStream inputStream = File.OpenRead(absolutePath))
   {
      var pc = new ParserContext
      {
         // It is critical to have the trailing backslash here
         // will not work without it!
         BaseUri = new Uri(directoryPath + "\\")
      };

      template = XamlReader.Load(inputStream, pc);
   }

   return template;
}</pre>
<p>It&#8217;s critical here to setup the ParserContext so that resources can be referenced from the XAML. In our example we reference an image, but you can also reference things like fonts and other XAML files.</p>
<h2>Injecting data into the document with data binding</h2>
<p>For our example we will use basic object data binding. However this technique would work equally well with other WPF binding sources such as XML. The object we will bind to has properties which correspond to the binding expressions in the template:</p>
<pre class="brush: csharp">public class Data
{
   public string Heading { get; set; }
   public DateTime CurrentDate { get; set; }
   public string Name { get; set; }
   public string[] DotPoints { get; set; }
   public bool GiveDiscount { get; set; }
}</pre>
<pre class="brush: csharp">public static void InjectData(FixedDocument document, object dataSource)
{
   document.DataContext = dataSource;

   // we need to give the binding infrastructure a push as we
   // are operating outside of the intended use of WPF
   var dispatcher = Dispatcher.CurrentDispatcher;
   dispatcher.Invoke(
      DispatcherPriority.SystemIdle,
      new DispatcherOperationCallback(delegate { return null; }),
      null);
}</pre>
<p>In this code we set the DataContext for the FixedDocument to be the object containing the data. The strange thing is the dispatcher code. In a normal WPF application the dispatcher is used to marshal calls from worker threads to the UI thread. It seems that data binding outside of the UI context is not triggered unless the dispatcher is woken from its sleepy state. To do this we give it an arbitrary task.</p>
<h2>Save our document to XPS</h2>
<p>The ugliest code is left for last.  Below is what is required to convert a FixedDocument to an XPS format file ready to be viewed and printed by the user:</p>
<pre class="brush: csharp">public static void ConvertToXps(FixedDocument fixedDoc, Stream outputStream)
{
   var package = Package.Open(outputStream, FileMode.Create);
   var xpsDoc = new XpsDocument(package, CompressionOption.Normal);
   XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);

   // xps documents are built using fixed document sequences
   var fixedDocSeq = new FixedDocumentSequence();
   var docRef = new DocumentReference();
   docRef.BeginInit();
   docRef.SetDocument(fixedDoc);
   docRef.EndInit();
   ((IAddChild)fixedDocSeq).AddChild(docRef);

   // write out our fixed document to xps
   xpsWriter.Write(fixedDocSeq.DocumentPaginator);

   xpsDoc.Close();
   package.Close();
}</pre>
<p>When working with XPS files you will find that you always have to work within a Package. The other interesting part of this code is the cast to IAddChild which is needed to add the DocumentReference as content within the FixedDocumentSequence.</p>
<h2>Exception: the calling thread must be STA</h2>
<p>WPF controls can only be used in STA threads. This isn&#8217;t usually something you have to consider when you are using WPF in a GUI application. However, if you are attempting to use this XPS code deep within some class library then the apartment state of the calling thread cannot be guaranteed. Instead of putting this requirement onto the consumer of your class you can use code like the following:</p>
<pre class="brush: csharp">if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
{
   var t = new Thread(() =&gt;
      {
         // do work here when calling thread is not STA
      });
   t.SetApartmentState(ApartmentState.STA);
   t.IsBackground = false;
   t.Start();
   t.Join();
}
else
{
   // do work here when calling thread is STA
   // this removes the overhead of creating
   // a new thread when it is not necessary
}</pre>
<h2>Final comments</h2>
<p>This XPS generation technique is extremely flexible. Some key strengths:</p>
<ul>
<li>Allows for the full power of WPF, enabling attractive documents</li>
<li>You can use user controls as well as third party components such as charting libraries</li>
<li>Your own custom ValueConverters in combination with <a title="DataTrigger" href="http://msdn.microsoft.com/en-us/library/system.windows.datatrigger.aspx" target="_self">data triggers</a> can be used for almost any dynamic requirement (this is probably worth another post)</li>
<li>Conversion to PDF is possible with third party libraries</li>
</ul>
<p><strong>Visual Studio 2008 Solution</strong> &#8211; <a href="http://www.bradcurtis.com/wp-content/uploads/2010/02/XpsDocumentGenerator.zip">XpsDocumentGenerator.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bradcurtis.com/2010/02/06/document-and-report-generation-using-xaml-wpf-databinding-and-xps/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
