<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0cDSXc9eCp7ImA9WhRaE0U.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559</id><updated>2012-02-16T08:31:18.960Z</updated><title>My Doc's Got No Nodes</title><subtitle type="html">Looking for a punchline since 2002</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://nonodes.spunow.co.uk/" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/MyDocsGotNoNodes" /><feedburner:info uri="mydocsgotnonodes" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CUIBQ3w7cSp7ImA9WhRbEkw.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-7173364533094263682</id><published>2012-01-28T22:06:00.001Z</published><updated>2012-02-02T20:12:32.209Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-02T20:12:32.209Z</app:edited><title>Multi-Channel LPCM on a DVD-ROM</title><content type="html">&lt;em&gt;(Or how to store 4.0 / 5.1 at 96khz 24-bit on a DVD-R, in a way that plays back properly over HDMI from a Sony BDP-S370)&lt;/em&gt;&lt;br /&gt;
Yes, another exciting audio howto :-) but if I don’t record it, I won’t be remember (or be willing to rediscover) how.&lt;br /&gt;
If starting from one-track-per-file, use foobar2000 to create a single wav file and a cue sheet. The key here is to multi-select the files, and do a convert to wav with the destination type set to “Generate multi-track files”. This will produce the cue sheet.&lt;br /&gt;
Next find the duration of the combined wav file, and use &lt;a href="http://ffmpeg.org/" target="_blank"&gt;ffmpeg&lt;/a&gt; from the command prompt to create a still video file:&lt;br /&gt;
&lt;blockquote&gt;
ffmpeg.exe -loop 1 –i &lt;em&gt;somepicture.png&lt;/em&gt; -c:v libx264 -s hd720 -t &lt;em&gt;hh:mm:ss.mmm&lt;/em&gt; video.mkv &lt;/blockquote&gt;
Then use &lt;a href="http://multiavchd.deanbg.com/" target="_blank"&gt;multiavchd&lt;/a&gt;, add video.mkv and click on the entry under “compilation”. Add the audio, then edit the chapters and fill in the values from the cue sheet. On the Author tab I also changed TV system to PAL.&lt;br /&gt;
Hit Start, and choose AVCHD (Strict) under the Optical Media section. &lt;br /&gt;
From the command prompt multiavchd folder, Use &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=10333" target="_blank"&gt;oscdimg&lt;/a&gt; to create a UDF disc image of the AVCHD folder&lt;br /&gt;
&lt;blockquote&gt;
oscdimg -u2 AVCHD myaudiodisc.iso&lt;/blockquote&gt;
Burn myaudiodisc.iso to DVD-R. If I let the disc play automatically on loading, the receiver claimed it was being sent 88.2Khz sound. I had to select “AVCHD disc” from the blu-ray player menus to get 96khz.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-7173364533094263682?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xYEgDSUcLF0QB368puok4T9KNuM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xYEgDSUcLF0QB368puok4T9KNuM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xYEgDSUcLF0QB368puok4T9KNuM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xYEgDSUcLF0QB368puok4T9KNuM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/nvO8t29-mxY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/7173364533094263682/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2012/01/multi-channel-lpcm-on-dvd-rom.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7173364533094263682?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7173364533094263682?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/nvO8t29-mxY/multi-channel-lpcm-on-dvd-rom.html" title="Multi-Channel LPCM on a DVD-ROM" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2012/01/multi-channel-lpcm-on-dvd-rom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIFRnsycCp7ImA9WhRXFEs.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-8443736792473939352</id><published>2011-12-21T10:15:00.001Z</published><updated>2011-12-21T10:15:17.598Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-21T10:15:17.598Z</app:edited><title>Compiling Rmpi and doMPI for Windows HPC’s MSMPI</title><content type="html">&lt;h4&gt;For 32-bit only:&lt;/h4&gt;  &lt;p&gt;To get the Rmpi and doMPI packages working on Windows HPC, using Micrsoft’s MSMPI libraries:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Install the “foreach” package into R. &lt;/li&gt;    &lt;li&gt;Install RTools for your version of R from &lt;a href="http://www.murdoch-sutherland.com/Rtools/"&gt;Duncan Murdoch's page&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Install the Windows HPC 2008 SDK from &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=10505"&gt;Microsoft Download Center&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Download and extract the package source for the development version (0.6) from &lt;a href="http://www.stats.uwo.ca/faculty/yu/Rmpi/download.htm"&gt;The Rmpi download page&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Download and extract the package source for doMPI from &lt;a href="http://cran.r-project.org/web/packages/doMPI/index.html"&gt;the CRAN package page&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Modify the Rmpi\src\Makevars.win to read &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;PKG_CFLAGS&amp;#160;&amp;#160; = -I&amp;quot;C:\Program Files\Microsoft HPC Pack 2008 SDK\Include&amp;quot; -DMPI2 -DWin32 &amp;quot;-D__int64=long long&amp;quot;        &lt;br /&gt;PKG_LIBS&amp;#160;&amp;#160;&amp;#160;&amp;#160; = -L&amp;quot;C:\Program Files\Microsoft HPC Pack 2008 SDK\Lib\i386&amp;quot; -L&amp;quot;C:\Program Files\Microsoft HPC Pack 2008 SDK\Lib\amd64&amp;quot; -lmsmpi&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Open an administrative command prompt (so that your R installation can be updated) and do the following: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;cd &amp;lt;&lt;/font&gt;&lt;em&gt;folder above the extracted packages&amp;gt;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;set path=c:\Rtools\bin;c:\Rtools\MinGW\bin;c:\Rtools\MinGW64\bin;%PATH%&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Consolas"&gt;&amp;quot;c:\Program Files\R\R-2.14.0\bin\R.exe&amp;quot; --vanilla CMD INSTALL --build Rmpi&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Consolas"&gt;&amp;quot;c:\Program Files\R\R-2.14.0\bin\R.exe&amp;quot; --vanilla CMD INSTALL –build doMPI&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Copy the zip files created, Rmpi_0.6-0.zip and doMPI_0.1-5.zip, to your cluster head node and pass the file paths to R’s install.packages function together with “foreach”. &lt;/li&gt;    &lt;li&gt;library(doMPI) should then state that it has loaded Rmpi. &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;For 64-bit:&lt;/h4&gt;  &lt;p&gt;That all worked for i386 (32-bit), but I got an access violation when trying to load the Rmpi package for x64. So instead, I built the Rmpi sources using the Visual C++ 2010 compiler &lt;em&gt;(some fixing required)&lt;/em&gt;, and dropped the new dlls over the top of the ones installed in the R library folder.&lt;/p&gt;  &lt;h3&gt;Using parallel foreach on Windows HPC&lt;/h3&gt;  &lt;p&gt;MSMPI (Microsoft’s implementation of MPI) doesn’t support spawning (at least not in the 2008 R2 version), so you need to use the non-spawning method:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;library(doMPI)&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Consolas"&gt;cl &amp;lt;- startMPIcluster()&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Consolas"&gt;registerDoMPI(cl)&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Consolas"&gt;… use of foreach and %dopar% …&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Consolas"&gt;closeCluster(cl)&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Consolas"&gt;mpi.quit()&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Finally, you queue the job using mpiexec on R (or a batch file that calls R).&lt;/p&gt;  &lt;p&gt;To run one worker per core:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Set the job resource type to core, and set the minimum and maximum number of cores for the task to the number of cores on your worker nodes. &lt;/p&gt;    &lt;p&gt;Use the command mpiexec –n * &lt;em&gt;myRrunner.bat&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To run one worker per node:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Set the job resource type to node, and set the minimum and maximum number of nodes for the task to the number of nodes in your cluster.&lt;/p&gt;    &lt;p&gt;Use the command mpiexec –cores 1 &lt;em&gt;myRrunner.bat&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-8443736792473939352?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/64lSA1Dj3ZZdKoP1GukhH_bEjOQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/64lSA1Dj3ZZdKoP1GukhH_bEjOQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/64lSA1Dj3ZZdKoP1GukhH_bEjOQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/64lSA1Dj3ZZdKoP1GukhH_bEjOQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/7HuyqRik8AU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/8443736792473939352/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2011/12/compiling-rmpi-and-dompi-for-windows.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/8443736792473939352?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/8443736792473939352?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/7HuyqRik8AU/compiling-rmpi-and-dompi-for-windows.html" title="Compiling Rmpi and doMPI for Windows HPC’s MSMPI" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2011/12/compiling-rmpi-and-dompi-for-windows.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYHRHo7cCp7ImA9WhRQGEQ.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-7796469757395668910</id><published>2011-12-14T21:28:00.001Z</published><updated>2011-12-14T21:28:55.408Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-14T21:28:55.408Z</app:edited><title>Playing 24-bit wav files from DVD-R on the Sony BDP-S370</title><content type="html">&lt;p&gt;In an &lt;a href="http://nonodes.spunow.co.uk/2011/11/sony-bdp-s370-and-hdcd.html"&gt;earlier post&lt;/a&gt;, I mentioned that the Sony BDP-S370 can play back 24-bit 44.1Khz LPCM audio if it’s stored as a wav file on a USB memory stick.&lt;/p&gt;  &lt;p&gt;Just to add to that, the BDP-S370 can play back PCM (wav files) in 16-bit and 24-bit, 44.1Khz, 48Khz and 96Khz (if not more).&lt;/p&gt;  &lt;p&gt;Although it won’t play back wav files via UPnP / DLNA, another option is to burn a DVD-R containing the audio files. This has worked for wav files, and I expect it’ll work for MP3 too.&lt;/p&gt;  &lt;p&gt;As usual the S370 is picky about the format it will support, it didn’t like the data disc I burned using the standard Windows 7 DVD-ROM stuff from explorer.&lt;/p&gt;  &lt;p&gt;Instead, I used oscdimg.exe with the –u option to generate a UDF image as an ISO file, which I then burned with the Windows 7 right-click burn option. oscdimg is documented &lt;a href="http://technet.microsoft.com/en-us/library/cc749036(WS.10).aspx"&gt;here&lt;/a&gt;, and is available as a free download as part of the &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=9085" target="_blank"&gt;Windows Automated Installation Kit (Windows AIK)&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-7796469757395668910?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OcsX5yMpt9Gg3XxFcRo8FnPcCm4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OcsX5yMpt9Gg3XxFcRo8FnPcCm4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OcsX5yMpt9Gg3XxFcRo8FnPcCm4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OcsX5yMpt9Gg3XxFcRo8FnPcCm4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/S8ndCZ0Ubb4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/7796469757395668910/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2011/12/playing-24-bit-wav-files-from-dvd-r-on.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7796469757395668910?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7796469757395668910?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/S8ndCZ0Ubb4/playing-24-bit-wav-files-from-dvd-r-on.html" title="Playing 24-bit wav files from DVD-R on the Sony BDP-S370" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2011/12/playing-24-bit-wav-files-from-dvd-r-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4ARX4zfCp7ImA9WhRQF08.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-1927146703308178337</id><published>2011-12-12T21:22:00.001Z</published><updated>2011-12-12T21:22:24.084Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-12T21:22:24.084Z</app:edited><title>“bootmgr is missing” installing Windows HPC 2008 R2 Compute Nodes</title><content type="html">&lt;p&gt;Creating a node template from a Windows Server 2008 R2 HPC edition disc, and then PXE booting the cluster nodes seems to leave the cluster node unbootable.&lt;/p&gt;  &lt;p&gt;It seems that the default diskpart.txt creates a single partition that the Server 2008 WIM doesn’t initialize correctly.&lt;/p&gt;  &lt;p&gt;If instead, you use one of the now unbootable cluster nodes and perform a GUI install into that single partition, you can create a WIM from that node to use with a new compute node template.&lt;/p&gt;  &lt;p&gt;Trying to use the GUI install from an unpartitioned disk won’t work, because it overrides your partition choice and creates extra boot / system partitions. If you instead choose to install into the single partition that the diskpart stage created during the failed node install, you’ll get a Windows install that you can use to create your “Golden Image” from, following the instructions on technet: &lt;a href="http://blogs.technet.com/b/windowshpc/archive/2009/04/05/how-to-capture-a-master-compute-node-image-using-node-templates.aspx"&gt;How to Capture a “Master” Compute Node Image Using Node Templates&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-1927146703308178337?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aPYR6Qu-xfSJZL3isBEsOl-dBgs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aPYR6Qu-xfSJZL3isBEsOl-dBgs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aPYR6Qu-xfSJZL3isBEsOl-dBgs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aPYR6Qu-xfSJZL3isBEsOl-dBgs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/fCTaPlynkfk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/1927146703308178337/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2011/12/bootmgr-is-missing-installing-windows.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/1927146703308178337?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/1927146703308178337?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/fCTaPlynkfk/bootmgr-is-missing-installing-windows.html" title="“bootmgr is missing” installing Windows HPC 2008 R2 Compute Nodes" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2011/12/bootmgr-is-missing-installing-windows.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MGRH86eyp7ImA9WhRQEU8.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-7301224105610334953</id><published>2011-12-05T22:50:00.001Z</published><updated>2011-12-05T22:50:25.113Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-05T22:50:25.113Z</app:edited><title>Extending Wi-fi network range to wireless and wired devices</title><content type="html">&lt;p&gt;I recently wanted to extend the (woeful) range of the Sky router to get better Wi-fi signal for devices upstairs. I didn’t want to have to run a cable from the router to a new access point, but I thought it would be a bonus to be able to connect wired devices on the new ‘satellite’ network.&lt;/p&gt;  &lt;p&gt;It turns out that this is possible with a cheap box from Edimax, the EW-7228APN. It can act as a wireless access point with better coverage (with the same security settings as the main router, but a different SSID) and also connect wired devices and send the traffic wirelessly to the main router.&lt;/p&gt; &lt;iframe style="width: 120px; height: 240px" marginheight="0" src="http://rcm-uk.amazon.co.uk/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=spunow-21&amp;amp;o=2&amp;amp;p=8&amp;amp;l=as4&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;ref=ss_til&amp;amp;asins=B004JV42A0" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;Setup isn’t obvious though because the documentation isn’t great, so here’s the steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;From a command prompt, type “ipconfig” and note the ip address and gateway (for a default Sky Broadband setup the ip address will be 192.168.0.something, gateway 192.168.0.1)&lt;/li&gt;    &lt;li&gt;Visit the sky router config page in your browser (at 192.168.0.1) and note the wireless security settings.&lt;/li&gt;    &lt;li&gt;Connect the access point to the network port of a PC with the supplied cable.&lt;/li&gt;    &lt;li&gt;Change the TCP/IPv4 settings of the PC to use the static address 192.168.2.2 subnet mask 255.255.255.0 and leave the gateway blank&lt;/li&gt;    &lt;li&gt;Use your web browser to visit 192.168.2.1 to configure the access point, the user name is “admin” and the default password is “1234”.&lt;/li&gt;    &lt;li&gt;In the System Utility section, set the IP address to be on your subnet, e.g. &lt;strong&gt;192.168.0&lt;/strong&gt;.&lt;em&gt;50&lt;/em&gt; (you might want to change the sky router settings to not give out the &lt;em&gt;.50&lt;/em&gt; IP address in its DHCP), and the gateway address to be the address from your ipconfig. Apply but don’t reboot yet.&lt;/li&gt;    &lt;li&gt;In the Basic Settings section, choose Repeater, and click Site Survey. Choose your sky router. You may need to choose Repeater again when it returns to the Basic Settings page. Make up a new SSID for the access point. Apply but don’t reboot again.&lt;/li&gt;    &lt;li&gt;Go to the Security page and set the security settings to be the same as your Sky router. My router is set to WEP for the benefit of some old-school Nintendo DS Lites, so I set WEP and set the key length and hex codes.&lt;/li&gt;    &lt;li&gt;At this point I could apply and reboot. I then needed to change the PC’s TCP/IPv4 settings to be 192.168.0.1 (not the original address) to log back in to the access point at 192.168.0.50 and check everything was still set OK.&lt;/li&gt;    &lt;li&gt;Finally, I disconnected the cable and connected wirelessly using the new access point’s SSID and the sky router’s password/key. To do this with Windows 7 I had to create a new connection manually, otherwise I was asked for credentials (no idea what that’s about).&lt;/li&gt;    &lt;li&gt;I then set the PC back to dynamically acquire a TCP/IPv4 address, and connected via the wire to check that the PC got a DHCP address on the home network.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Result – the wireless devices have their Wi-fi signal bounced from the access point to the Sky router, but with better coverage, and any wired devices connected to the access point have their traffic sent wirelessly to the router too.&lt;/p&gt;  &lt;p&gt;Phew.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-7301224105610334953?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ur3twzqhsd858x6nF3CRSCL1MlQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ur3twzqhsd858x6nF3CRSCL1MlQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ur3twzqhsd858x6nF3CRSCL1MlQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ur3twzqhsd858x6nF3CRSCL1MlQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/X3bs7aigDvM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/7301224105610334953/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2011/12/extending-wi-fi-network-range-to.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7301224105610334953?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7301224105610334953?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/X3bs7aigDvM/extending-wi-fi-network-range-to.html" title="Extending Wi-fi network range to wireless and wired devices" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2011/12/extending-wi-fi-network-range-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQHR3k9eip7ImA9WhRSE0w.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-5753333583480758925</id><published>2011-11-14T23:45:00.001Z</published><updated>2011-11-14T23:45:36.762Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-14T23:45:36.762Z</app:edited><title>Sony BDP-S370 and HDCD</title><content type="html">&lt;h5&gt;(Or playing back 44.1Khz 24 bit lpcm on the S370)&lt;/h5&gt;  &lt;p&gt;I wasted quite a bit of time trying to work out what kind of container to put HDCD-decoded audio into to get it to play on the BDP-S370.&lt;/p&gt;  &lt;p&gt;The short story is this:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The audio&lt;strong&gt; should be on a local USB drive&lt;/strong&gt; (not DLNA). I haven’t looked into DVD-R yet.&lt;/li&gt;    &lt;li&gt;The S370 will play &lt;strong&gt;44.1Khz 20-bit from a 24-bit wav&lt;/strong&gt; file (like HDCD decodes), but the &lt;a href="http://forum.doom9.org/showthread.php?t=129136"&gt;decoder&lt;/a&gt; I used had made a wav that the Sony player didn’t like (nor did Windows Media player). Doing a conversion in &lt;a href="http://www.foobar2000.org/"&gt;foobar2000&lt;/a&gt; to a wav with the same bit depth and no resampling made a new 24-bit wav that played fine. I checked the actual bit depth with &lt;a href="http://www.videohelp.com/tools/eac3to"&gt;eac3to&lt;/a&gt; and found it to be 17-20 bits as expected.&lt;/li&gt;    &lt;li&gt;DVD/DAT style audio at &lt;strong&gt;48Khz&lt;/strong&gt; will also play fine, as will Hi-Res audio at&lt;strong&gt; 96Khz/24-bit&lt;/strong&gt;. To get 96Khz through my amp (the STR-DH520) I had to set the “Audio Out” setting to “Amp” (not “TV + AMP”), the same was true for playing back SACDs in 5.1.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I might look into higher than 96Khz, or storing the audio on optical discs next. If I’m bored enough :-)&lt;/p&gt;  &lt;p&gt;Equipment / Test disc used:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.amazon.co.uk/gp/product/B0038M1UTW/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=spunow-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=19450&amp;amp;creativeASIN=B0038M1UTW"&gt;Sony BDPS370 Blu-ray Player&lt;/a&gt;&lt;img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=spunow-21&amp;amp;l=as2&amp;amp;o=2&amp;amp;a=B0038M1UTW" width="1" height="1" /&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.amazon.co.uk/gp/product/B005ABQ3AA/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=spunow-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=19450&amp;amp;creativeASIN=B005ABQ3AA"&gt;SONY STRDH520 AV Receiver&lt;/a&gt;&lt;img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=spunow-21&amp;amp;l=as2&amp;amp;o=2&amp;amp;a=B005ABQ3AA" width="1" height="1" /&gt;&lt;/li&gt;    &lt;li&gt;HDCD: &lt;a href="http://www.amazon.co.uk/gp/product/B00000I8US/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=spunow-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=19450&amp;amp;creativeASIN=B00000I8US"&gt;David Usher - Little Songs&lt;/a&gt;&lt;img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=spunow-21&amp;amp;l=as2&amp;amp;o=2&amp;amp;a=B00000I8US" width="1" height="1" /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Incidental Mention:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;SACD: &lt;a href="http://www.amazon.co.uk/gp/product/B00008CLOA/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=spunow-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=19450&amp;amp;creativeASIN=B00008CLOA"&gt;Pink Floyd - Dark Side of the Moon - 30th Anniversary Edition&lt;/a&gt;&lt;img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=spunow-21&amp;amp;l=as2&amp;amp;o=2&amp;amp;a=B00008CLOA" width="1" height="1" /&gt;&lt;/li&gt;    &lt;li&gt;SACD:&lt;a href="http://www.amazon.co.uk/gp/product/B00066N8JS/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=spunow-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=19450&amp;amp;creativeASIN=B00066N8JS"&gt;Nine Inch Nails - The Downward Spiral [Deluxe Edition] [HYBRID SACD]&lt;/a&gt;&lt;img style="border-bottom-style: none !important; margin: 0px; border-left-style: none !important; border-top-style: none !important; border-right-style: none !important" border="0" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=spunow-21&amp;amp;l=as2&amp;amp;o=2&amp;amp;a=B00066N8JS" width="1" height="1" /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-5753333583480758925?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nhRQXdieVPiLvpZiCvjNEJtTuG8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nhRQXdieVPiLvpZiCvjNEJtTuG8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nhRQXdieVPiLvpZiCvjNEJtTuG8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nhRQXdieVPiLvpZiCvjNEJtTuG8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/7FqlGVP0_eY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/5753333583480758925/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2011/11/sony-bdp-s370-and-hdcd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/5753333583480758925?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/5753333583480758925?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/7FqlGVP0_eY/sony-bdp-s370-and-hdcd.html" title="Sony BDP-S370 and HDCD" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2011/11/sony-bdp-s370-and-hdcd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YFQ38-fip7ImA9WhdaFks.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-2097213345282486251</id><published>2011-10-26T21:31:00.001+01:00</published><updated>2011-10-26T21:31:52.156+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-26T21:31:52.156+01:00</app:edited><title>.net 4 Tasks Not Starting</title><content type="html">&lt;p&gt;This is another post about a problem that I could have solved much quicker if I’d found the right blog posts. It’s common enough that .net 4.5 will include a new Task.Run method that saves you from this mistake.&lt;/p&gt;  &lt;p&gt;The symptom was that a task that was supposed to run in the background while the UI thread did some other work wasn’t starting – it was scheduled but didn’t run.&lt;/p&gt;  &lt;p&gt;The reason was that the supposed background task was started from some code that was (further back in the call stack) inside a task that had been scheduled on the UI thread, using a common pattern of specifying the scheduler.&lt;/p&gt;  &lt;p&gt;If you’re already inside a task, creating or starting a new task without specifying a scheduler picks up the scheduler of the parent task, not the default scheduler.&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ButtonClicked()&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; onUiThread = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;TaskScheduler&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.FromCurrentSynchronizationContext();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; task = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Task&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(() =&amp;gt; DoSomethingInTheBackground());&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;task.ContinueWith(t =&amp;gt; DoSomethingUIRelated(), onUiThread);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;task.Start();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.5pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; DoSomethingUIRelated()&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; offUiTask = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Task&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Factory.StartNew(() =&amp;gt; SomethingElseForTheBackground()); &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.5pt" color="#808080"&gt;///&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;///&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt; Do some UI-thread stuff&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="color: "&gt;&lt;font color="#808080"&gt;///&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.5pt" color="#008000"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;offUiTask.Wait();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 9.5pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.5pt"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt; background: white; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background1" class="MsoNormal"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="line-height: normal; margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 12pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;So, on the UI thread, a task is created which calls DoSomethingInBackground. When that is finished, DoSomethingUIRelated is called – on the UI thread by specifying the scheduler onUiThread.&lt;/p&gt;  &lt;p&gt;But when the task to call SomethingElseForTheBackground is created, it inherits the UI thread scheduler, and because the UI thread starts a Wait for it, it never gets a chance to run.&lt;/p&gt;  &lt;p&gt;The solution is to specify TaskScheduler.Default for offUiTask, or to use the new Task.Run method when .net 4.5 comes along.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-2097213345282486251?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QDhiNHR9-dCPwvPnIUcH7EUnvgo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QDhiNHR9-dCPwvPnIUcH7EUnvgo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QDhiNHR9-dCPwvPnIUcH7EUnvgo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QDhiNHR9-dCPwvPnIUcH7EUnvgo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/IYMN99uvsYI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/2097213345282486251/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2011/10/net-4-tasks-not-starting.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/2097213345282486251?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/2097213345282486251?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/IYMN99uvsYI/net-4-tasks-not-starting.html" title=".net 4 Tasks Not Starting" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2011/10/net-4-tasks-not-starting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04ARH08fyp7ImA9Wx9aEEU.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-4134986114477116627</id><published>2011-03-02T17:12:00.001Z</published><updated>2011-03-02T17:12:25.377Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-02T17:12:25.377Z</app:edited><title>Infinite Loop in DLR caching with DynamicObject</title><content type="html">&lt;p&gt;This is another one of those posts to give the answer to a problem that I couldn’t find with Google.&lt;/p&gt;  &lt;p&gt;I was implementing a method call by:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;a BindGetMember on a dynamic meta object, returning an expression which returned a new dynamic meta object &lt;em&gt;provider&lt;/em&gt; for the method.&lt;/li&gt;    &lt;li&gt;a BindInvoke on the dynamic meta object for the method.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Because the dynamic meta object provider for the method didn’t pass itself (i.e. &lt;strong&gt;this&lt;/strong&gt;) into the value parameter for the dynamic meta object representing the method, the binding restrictions created didn’t match the expected type and so they weren’t cached by the CLR.&lt;/p&gt;  &lt;p&gt;Instead, it just looped round and round (in System.Dynamic.UpdateDelegates.UpdateAndExecute2) trying to cache the new rule. The fix was to make sure that the DynamicMetaObject has a Value of the original IDynamicMetaObjectProvider instance.&lt;/p&gt;  &lt;p&gt;Hope that helps someone else.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-4134986114477116627?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jvRSd14YwFcJ-uIrNXFw1Si8oyk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jvRSd14YwFcJ-uIrNXFw1Si8oyk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jvRSd14YwFcJ-uIrNXFw1Si8oyk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jvRSd14YwFcJ-uIrNXFw1Si8oyk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/4ycLLvgBpLI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/4134986114477116627/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2011/03/infinite-loop-in-dlr-caching-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4134986114477116627?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4134986114477116627?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/4ycLLvgBpLI/infinite-loop-in-dlr-caching-with.html" title="Infinite Loop in DLR caching with DynamicObject" /><author><name>Mark</name><uri>http://www.blogger.com/profile/15269729944068013352</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2011/03/infinite-loop-in-dlr-caching-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcNQ3c8cCp7ImA9Wx5bFkw.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-4844054908615268566</id><published>2010-11-01T11:48:00.001Z</published><updated>2010-11-01T11:48:12.978Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-01T11:48:12.978Z</app:edited><title>.net 4 Client Profile on Mono 2.8</title><content type="html">&lt;p&gt;If you’re running a .net 4 app built for the .net Client Profile, then you might get the following error when trying to run it on mono:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;WARNING: The runtime version supported by this application is unavailable.     &lt;br /&gt;Using default runtime: v2.0.50727&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To work-around this problem, you can either remove the line&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;supportedRuntime version=&amp;quot;v4.0&amp;quot; sku=&amp;quot;.NETFramework,Version=v4.0,Profile=Client&amp;quot;/&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;font face="Verdana"&gt;From the app.config file (or &lt;em&gt;yourprogram&lt;/em&gt;.exe.config), or add the switch &lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;pre&gt;&lt;font face="Verdana"&gt;--runtime=v4.0.30319&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;font face="Verdana"&gt;To the mono command-line.&lt;/font&gt;&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-4844054908615268566?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cGsxWDvFIqSoIyOXi9HG7OnFGPY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cGsxWDvFIqSoIyOXi9HG7OnFGPY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cGsxWDvFIqSoIyOXi9HG7OnFGPY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cGsxWDvFIqSoIyOXi9HG7OnFGPY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/d9BAd57vmdQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/4844054908615268566/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2010/11/net-4-client-profile-on-mono-28.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4844054908615268566?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4844054908615268566?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/d9BAd57vmdQ/net-4-client-profile-on-mono-28.html" title=".net 4 Client Profile on Mono 2.8" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2010/11/net-4-client-profile-on-mono-28.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4DQHsyeSp7ImA9Wx5QGU4.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-4266398716499374917</id><published>2010-09-08T10:09:00.001+01:00</published><updated>2010-09-08T10:09:31.591+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-08T10:09:31.591+01:00</app:edited><title>Troubleshooting Ubuntu Preseed installations</title><content type="html">&lt;p&gt;I hit a problem with doing a preseeded Ubuntu installation, where the partitioning wouldn’t continue without a confirmation.&lt;/p&gt;  &lt;p&gt;I found lots of discussions about how to work round the problem with the &amp;quot;write the changes to disks and configure lvm&amp;quot; message, but I could have fixed the problems with a lot less trial and error had I known this earlier:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Edit the “append” line of the pxelinux.cfg/default file to include DEBCONF_DEBUG=5&lt;/li&gt;    &lt;li&gt;Press Alt-F4 at the point where the automated install hangs to find out what parameter was missing to cause the user prompt.&lt;/li&gt; &lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-4266398716499374917?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/G97DYEj4pPgE-Mfq8EpeUAzrOMk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G97DYEj4pPgE-Mfq8EpeUAzrOMk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/G97DYEj4pPgE-Mfq8EpeUAzrOMk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G97DYEj4pPgE-Mfq8EpeUAzrOMk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/i-08lU6Wjuw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/4266398716499374917/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2010/09/troubleshooting-ubuntu-preseed.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4266398716499374917?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4266398716499374917?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/i-08lU6Wjuw/troubleshooting-ubuntu-preseed.html" title="Troubleshooting Ubuntu Preseed installations" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2010/09/troubleshooting-ubuntu-preseed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQNQ3s8fCp7ImA9WxFaEkQ.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-3620684522892838576</id><published>2010-07-16T16:33:00.001+01:00</published><updated>2010-07-16T16:33:12.574+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-16T16:33:12.574+01:00</app:edited><title>Connecting Android Phone to 2 Google Accounts (2nd Update)</title><content type="html">&lt;p&gt;&lt;a href="http://nonodes.spunow.co.uk/2009/10/connecting-android-phone-to-2-google.html"&gt;Previous article here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Well now that T-mobile have pushed out the OTA update for the G2 Touch (HTC Hero), I’ve got Android 2.1 and can connect the phone to 2 Google accounts without a problem.&lt;/p&gt;  &lt;p&gt;The only minor problem was that the widget for the Gmail inboxes looked identical and didn’t display unread counts.&lt;/p&gt;  &lt;p&gt;These two problems were fixed with this great widget by Alexander Blom, there’s a barcode to jump to the marketplace entry &lt;a href="http://alexanderblom.se/gmail-unread-count/"&gt;on his web page.&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-3620684522892838576?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GA1r7mZEsbKxc8EtDDX_P31XMiw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GA1r7mZEsbKxc8EtDDX_P31XMiw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GA1r7mZEsbKxc8EtDDX_P31XMiw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GA1r7mZEsbKxc8EtDDX_P31XMiw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/yL7fIgQhd_U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/3620684522892838576/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2010/07/connecting-android-phone-to-2-google.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3620684522892838576?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3620684522892838576?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/yL7fIgQhd_U/connecting-android-phone-to-2-google.html" title="Connecting Android Phone to 2 Google Accounts (2nd Update)" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2010/07/connecting-android-phone-to-2-google.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAHSHw_cCp7ImA9WxFVEEo.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-7017555453640541883</id><published>2010-06-09T09:55:00.001+01:00</published><updated>2010-06-09T09:55:39.248+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-09T09:55:39.248+01:00</app:edited><title>SideBySide Event 33 for msvsmon ia64</title><content type="html">&lt;p&gt;If you’re seeing an error in the event log that looks like this:&lt;/p&gt;  &lt;p&gt;Activation context generation failed for &amp;quot;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\ia64\msvsmon.exe&amp;quot;. Dependent Assembly Microsoft.Windows.Common-Controls,language=&amp;quot;&amp;amp;#x2a;&amp;quot;,processorArchitecture=&amp;quot;ia64&amp;quot;,publicKeyToken=&amp;quot;6595b64144ccf1df&amp;quot;,type=&amp;quot;win32&amp;quot;,version=&amp;quot;6.0.0.0&amp;quot; could not be found. Please use sxstrace.exe for detailed diagnosis&lt;/p&gt;  &lt;p&gt;And it’s occurring at about 00:30 every day, it seems to be caused by the scheduled task ProgramDataUpdater. It looks like it’s choking on the ia64 binary, and if you don’t need the Itanium version you could resolve it by renaming or deleting the exe, similar to this KB article:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://support.microsoft.com/kb/2021839" href="http://support.microsoft.com/kb/2021839"&gt;http://support.microsoft.com/kb/2021839&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-7017555453640541883?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1K70oXZltOOB06Qr4plWv8x9vw0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1K70oXZltOOB06Qr4plWv8x9vw0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1K70oXZltOOB06Qr4plWv8x9vw0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1K70oXZltOOB06Qr4plWv8x9vw0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/aANJnqr3924" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/7017555453640541883/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2010/06/sidebyside-event-33-for-msvsmon-ia64.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7017555453640541883?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7017555453640541883?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/aANJnqr3924/sidebyside-event-33-for-msvsmon-ia64.html" title="SideBySide Event 33 for msvsmon ia64" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2010/06/sidebyside-event-33-for-msvsmon-ia64.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAGQX8-eSp7ImA9WxBaFEs.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-4027622531360684257</id><published>2010-03-24T20:48:00.001Z</published><updated>2010-03-24T20:48:40.151Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-24T20:48:40.151Z</app:edited><title>.net 4 C# Parallel Array Bounds Checking</title><content type="html">&lt;pre&gt;&lt;font face="Verdana"&gt;In previous versions of .net (x64 .net 2), as a result of experimenting with the profiler and forming beliefs (whether true or false :-) that:&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;&lt;font face="Verdana"&gt;property accesses are expensive&lt;/font&gt; &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;bounds checks are &lt;a href="http://codebetter.com/blogs/gregyoung/archive/2006/07/08/147230.aspx"&gt;not eliminated for static member arrays&lt;/a&gt; (this one was correct, as Greg Young proves). &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;font face="Verdana"&gt;parallel array accesses do not have the bounds checks optimized away&lt;/font&gt; &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;font face="Verdana"&gt;So, for consistency, I always wrote loops like this, with a local reference to the array and a variable in the loop scope holding the end limit.&lt;/font&gt; &lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&lt;span style="color: #cc7832; font-weight: bold"&gt;int&lt;/span&gt; z = &lt;span style="color: #6897bb; font-weight: bold"&gt;0&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; localArray1 = memberArray1;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; localArray2 = memberArray2;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&lt;span style="color: #cc7832; font-weight: bold"&gt;for&lt;/span&gt; (&lt;span style="color: #cc7832; font-weight: bold"&gt;int&lt;/span&gt; x = &lt;span style="color: #6897bb; font-weight: bold"&gt;0&lt;/span&gt;, length = localArray1.Length; x &amp;lt; length; x++)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; z += localArray1[x] + localArray2[x];&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Verdana"&gt;Recently, I re-examined this practice with Visual Studio 2010 RC and the disassembly window. &lt;/font&gt;I wanted to find out what the best pattern would be consistency and allowing the JIT to hoist the bounds checks, eliminating them from the per-iteration part of the loop.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;.net 2&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;x86 and x64 JITs were both unable to remove the bounds checks.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Rewriting the for loop to read&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;for&lt;/span&gt; (&lt;span style="color: #cc7832; font-weight: bold"&gt;int&lt;/span&gt; x = &lt;span style="color: #6897bb; font-weight: bold"&gt;0&lt;/span&gt;; x &amp;lt; localArray1.Length; x++)&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Allowed the x86 JIT to eliminate one of the bounds checks. The x64 JIT still had both.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;.net 4&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The x86 JIT still had both bounds checks. The x64 JIT eliminated one.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Rewriting the for loop to read&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;for&lt;/span&gt; (&lt;span style="color: #cc7832; font-weight: bold"&gt;int&lt;/span&gt; x = &lt;span style="color: #6897bb; font-weight: bold"&gt;0&lt;/span&gt;; x &amp;lt; localArray1.Length; x++)&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The x86 now had only one bounds check. The x64 eliminated both.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Conclusions&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Don’t use a local variable to hold your array stopping condition. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Experiment with both ‘Any CPU’ and ‘x86’ if possible. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/vancem/archive/2006/02/20/535807.aspx"&gt;Check out the disassembly&lt;/a&gt; (step-by-step explanation by Vance Morrison). &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-4027622531360684257?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UxkuWAiRtw5CWDwAO2GBMtC1_FE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UxkuWAiRtw5CWDwAO2GBMtC1_FE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UxkuWAiRtw5CWDwAO2GBMtC1_FE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UxkuWAiRtw5CWDwAO2GBMtC1_FE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/cm8vtnZTgGg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/4027622531360684257/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2010/03/net-4-c-parallel-array-bounds-checking.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4027622531360684257?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4027622531360684257?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/cm8vtnZTgGg/net-4-c-parallel-array-bounds-checking.html" title=".net 4 C# Parallel Array Bounds Checking" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2010/03/net-4-c-parallel-array-bounds-checking.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8CRH08fyp7ImA9WxBUFEs.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-6707943666168221651</id><published>2010-03-01T17:01:00.001Z</published><updated>2010-03-01T17:01:05.377Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-01T17:01:05.377Z</app:edited><title>Copying a Folder to and from Windows with rsync</title><content type="html">&lt;p&gt;Suppose you’ve got a NAS, or *nix box which has an rsync daemon running on it. &lt;/p&gt;  &lt;p&gt;You’ve also got the convenient &lt;a href="http://www.itefix.no/cwrsync/"&gt;cwrsync&lt;/a&gt; bundle installed on your Windows box.&lt;/p&gt;  &lt;p&gt;Now you want to be able to copy all the files in a folder on the windows box, say:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;C:\foo\my spaced path\things&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;to and from the rsync module on your server.&lt;/p&gt;  &lt;h4&gt;To copy from the server to Windows&lt;/h4&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;&amp;quot;c:\Program Files (x86)\cwRsync\bin\rsync.exe&amp;quot; -v -r -c rsync://@server/module /cygdrive/c/foo/&amp;quot;my spaced path&amp;quot;/things&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This assumes the default installation path for cwrsync, you should drop the “ (x86)” if you’re not running on a 64-bit version of Windows.&lt;/p&gt;  &lt;p&gt;The parameters include &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;-v for verbose &lt;/li&gt;    &lt;li&gt;-c to always test file checksums rather than timestamps. If you’re happy that the timestamps are reliable, replace it with a –t to use (and copy) the timestamps. &lt;/li&gt;    &lt;li&gt;-r for recursive. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The path on the Windows box has been munged to cygwin’s standards to look like a *nix path.&amp;#160; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The slashes all go forwards &lt;/li&gt;    &lt;li&gt;The /cygdrive/c is the equivalent of “C:” &lt;/li&gt;    &lt;li&gt;Any directory names that have spaces need a quote around their name, not around the path as a whole. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The path to the server specifies the rsync protocol, and the server name and module (like a share name in Windows/Samba/CIFS). I’ve not shown any user or password specification.&lt;/p&gt;  &lt;h4&gt;To copy from Windows to the server&lt;/h4&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;&amp;quot;c:\Program Files (x86)\cwRsync\bin\rsync.exe&amp;quot; -v -c -r --no-perms --chmod=ugo=rwX /cygdrive/c/foo/&amp;quot;my spaced path&amp;quot;/things/ rsync://@server/module&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Note the trailing slash after the Windows folder name. Without that, you’ll get a subfolder called “things” created under the module on your server.&lt;/p&gt;  &lt;p&gt;I added the no-perms and chmod parameters because otherwise the ACLs that rsync placed on the copied files gave no rights to anyone.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-6707943666168221651?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Xz3s5guCuLmfoimL3mHnqYeLwe4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Xz3s5guCuLmfoimL3mHnqYeLwe4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Xz3s5guCuLmfoimL3mHnqYeLwe4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Xz3s5guCuLmfoimL3mHnqYeLwe4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/k2nG0KEZBXQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/6707943666168221651/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2010/03/copying-folder-to-and-from-windows-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/6707943666168221651?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/6707943666168221651?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/k2nG0KEZBXQ/copying-folder-to-and-from-windows-with.html" title="Copying a Folder to and from Windows with rsync" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2010/03/copying-folder-to-and-from-windows-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIEQH0_eCp7ImA9WxBQE04.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-4575773117280156982</id><published>2010-01-12T21:08:00.001Z</published><updated>2010-01-12T21:08:21.340Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-12T21:08:21.340Z</app:edited><title>MP3s Are Killing Home Taping</title><content type="html">&lt;p&gt;Just try giving a friend a C90 and asking them to copy a couple of albums for you. &lt;/p&gt;  &lt;p&gt;&lt;iframe style="width: 120px; height: 240px" marginheight="0" src="http://rcm-uk.amazon.co.uk/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=spunow-21&amp;amp;o=2&amp;amp;p=8&amp;amp;l=as1&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;md=0M5A6TN3AXP2JHJBWT02&amp;amp;asins=B00009P6DJ" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;iframe style="width: 120px; height: 240px" marginheight="0" src="http://rcm-uk.amazon.co.uk/e/cm?lt1=_blank&amp;amp;bc1=000000&amp;amp;IS2=1&amp;amp;bg1=FFFFFF&amp;amp;fc1=000000&amp;amp;lc1=0000FF&amp;amp;t=spunow-21&amp;amp;o=2&amp;amp;p=8&amp;amp;l=as1&amp;amp;m=amazon&amp;amp;f=ifr&amp;amp;md=0M5A6TN3AXP2JHJBWT02&amp;amp;asins=B001OENL3O" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-4575773117280156982?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mMDkG4OnId8_Pzi3Jt9saPBfLbY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mMDkG4OnId8_Pzi3Jt9saPBfLbY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mMDkG4OnId8_Pzi3Jt9saPBfLbY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mMDkG4OnId8_Pzi3Jt9saPBfLbY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/0vFhQLmeP2U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/4575773117280156982/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2010/01/mp3s-are-killing-home-taping.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4575773117280156982?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/4575773117280156982?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/0vFhQLmeP2U/mp3s-are-killing-home-taping.html" title="MP3s Are Killing Home Taping" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2010/01/mp3s-are-killing-home-taping.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEGR30_eSp7ImA9WxNaF0o.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-3037496782072681287</id><published>2009-12-02T17:07:00.001Z</published><updated>2009-12-02T17:07:06.341Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-02T17:07:06.341Z</app:edited><title>Silverlight 3 RIA Services Without Entities (POCO) – Part 1</title><content type="html">&lt;p&gt;(I’m including Part 1 in the title because there’s a possibility I’ll be adding to this topic.)&lt;/p&gt;  &lt;p&gt;If you look for information about using Plain Old CLR Objects with RIA services (or using RIA services without Linq to Entities) you’ll see a few articles telling you how easy it is to use your own business objects from a DomainService - If you simply stick the [Key] attribute above a property that uniquely identifies your object, all will be well.&lt;/p&gt;  &lt;p&gt;Except it’s not necessarily true. It all depends on how ‘smart’ your objects are, and how you expect it to work. If you have the (accurate) mental model of the objects being serialized and deserialized between client and server then you’re probably going to be OK. &lt;/p&gt;  &lt;p&gt;On the other hand, if you’re working with less dumb objects that do more than just hold database fields, and you think of the RIA services as more like remoting then, like me, you’re going to be disappointed.&lt;/p&gt;  &lt;p&gt;To be honest, my first clue should have been that everything has to be get/set and the classes need parameterless constructors. My ‘business objects’ had some internal state that they used to map themselves back to the database, so I marked that with [Exclude] attributes.&lt;/p&gt;  &lt;p&gt;I tried sending these objects to the client via a query method, and then accepting them back to the server as parameters on an [Invoke] method. All the internal state had gone. But that was because they weren’t the same objects I returned from the query, they were newly constructed objects with the same values in their public properties.&lt;/p&gt;  &lt;p&gt;The lesson was that there’s no reference tracking going on between client and server. If you send the client an object, it will be cloned on the client side. If that object is modified and passed back, the server gets a new object with all the values – not the original object with new values applied. &lt;/p&gt;  &lt;p&gt;This probably seems obvious to many people, particularly those who have used similar frameworks (like the view model stuff in ASP.NET MVC) but it’s not something I saw explicitly called out in any of the explanations of using Silverlight RIA services with POCO.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-3037496782072681287?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MxOjf7iDQIPVaPhsygLh11vYq_8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MxOjf7iDQIPVaPhsygLh11vYq_8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MxOjf7iDQIPVaPhsygLh11vYq_8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MxOjf7iDQIPVaPhsygLh11vYq_8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/m65iOBnR5KE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/3037496782072681287/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2009/12/silverlight-3-ria-services-without.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3037496782072681287?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3037496782072681287?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/m65iOBnR5KE/silverlight-3-ria-services-without.html" title="Silverlight 3 RIA Services Without Entities (POCO) – Part 1" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2009/12/silverlight-3-ria-services-without.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UGSXYycCp7ImA9WxNWFkw.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-3179510709960810087</id><published>2009-10-15T15:00:00.001+01:00</published><updated>2009-10-15T15:00:28.898+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T15:00:28.898+01:00</app:edited><title>Connecting Android Phone to 2 Google Accounts (update)</title><content type="html">&lt;p&gt;&lt;a title="http://nonodes.spunow.co.uk/2009/08/connecting-android-phone-to-2-google.html" href="http://nonodes.spunow.co.uk/2009/08/connecting-android-phone-to-2-google.html"&gt;Original article here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Recently, Google &lt;a href="http://googlemobile.blogspot.com/2009/09/google-sync-now-with-push-gmail-support.html"&gt;announced&lt;/a&gt; that they now support email over ActiveSync. So in theory you could set the phone to get email, calendar and contacts via ActiveSync and not use IMAP for email.&lt;/p&gt;  &lt;p&gt;I tried setting this up, but found the email part of ActiveSync to be unreliable (at least with my “Google apps for your domain” account) – it complained about keys and lost the email from the phone’s inbox.&lt;/p&gt;  &lt;p&gt;To be fair, they’re targeting the ActiveSync support at the iPhone and Windows Mobile, not Android.&lt;/p&gt;  &lt;p&gt;Perhaps reliability will improve when the system has been running a bit longer, it would be nice not to have to use IMAP and ActiveSync to access the second Google account.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-3179510709960810087?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SlCDSnRjKrM8lmKQotHkM5BJJlE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SlCDSnRjKrM8lmKQotHkM5BJJlE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SlCDSnRjKrM8lmKQotHkM5BJJlE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SlCDSnRjKrM8lmKQotHkM5BJJlE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/B5n7h0lVi3M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/3179510709960810087/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2009/10/connecting-android-phone-to-2-google.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3179510709960810087?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3179510709960810087?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/B5n7h0lVi3M/connecting-android-phone-to-2-google.html" title="Connecting Android Phone to 2 Google Accounts (update)" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2009/10/connecting-android-phone-to-2-google.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEHRXk_fyp7ImA9WxNSEko.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-6616231501348269136</id><published>2009-08-26T09:17:00.001+01:00</published><updated>2009-08-26T09:17:14.747+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-26T09:17:14.747+01:00</app:edited><title>Connecting an Android Phone to 2 Google Accounts</title><content type="html">&lt;p&gt;If you’ve got an Android phone, and you want to get your contacts, email and calendar from two Google accounts (e.g. work and home) it’s possible but a bit clunky.&lt;/p&gt;  &lt;p&gt;Set up the phone with the Google account you want to use most, this will be the account that the phone’s built-in Google apps will use. Note that if you change your mind about which account this should be you’ll need to reset you phone and so lose all your settings. &lt;/p&gt;  &lt;p&gt;For the other account, add an Exchange/ActiveSync account for the server m.google.com (as if you were using Windows Mobile, as shown &lt;a href="http://www.google.com/support/mobile/bin/answer.py?hl=en&amp;amp;answer=138636" target="_blank"&gt;here&lt;/a&gt;) and set it to sync calendar and contacts (not email because Google sync currently support it). To pick up email, add an imap account as shown &lt;a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;amp;answer=114408" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Now your contacts and calendar entries that came from the main Google account will show up as from “Google” and the items from the second account will show up as “Exchange”. &lt;/p&gt;  &lt;p&gt;Not perfect, but it works OK. Now I just need to figure out how to stop it from listing all the ActiveSync’d contacts in “lastname, firstname” format.&lt;/p&gt;  &lt;p&gt;Also note that either of these Google accounts can be &lt;a href="http://www.google.com/apps" target="_blank"&gt;Google Apps For Your Domain&lt;/a&gt; (gafyd) accounts if imap and sync are enabled by your domain administrator.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-6616231501348269136?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2exvHYVg_IBqePkz5XaYGkhQx3g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2exvHYVg_IBqePkz5XaYGkhQx3g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2exvHYVg_IBqePkz5XaYGkhQx3g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2exvHYVg_IBqePkz5XaYGkhQx3g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/YW8FrO0Awcw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/6616231501348269136/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2009/08/connecting-android-phone-to-2-google.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/6616231501348269136?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/6616231501348269136?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/YW8FrO0Awcw/connecting-android-phone-to-2-google.html" title="Connecting an Android Phone to 2 Google Accounts" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2009/08/connecting-android-phone-to-2-google.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUDRXoyeSp7ImA9WxJXEE4.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-5505558386255106073</id><published>2009-06-03T12:57:00.001+01:00</published><updated>2009-06-03T12:57:54.491+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-03T12:57:54.491+01:00</app:edited><title>Building a Network Cable Without a Crimp Tool</title><content type="html">&lt;p&gt;Searching the net to find out if it’s possible to make a cable without an RJ45 crimp tool yielded lots of people saying it’s not practical.&lt;/p&gt;  &lt;p&gt;If you’ve only got a couple of ends to fit and don’t mind wasting a connector (or two) it’s not that bad.&lt;/p&gt;  &lt;p&gt;Just splay the inner cores of the cable in the correct order and cut straight across the ends. Then feed the cores into the plug (making sure they go down to the ends of the correct holes). While keeping the wires pushed firmly into the plug, push down each metal piece in turn with a small flat-blade screwdriver.&lt;/p&gt;  &lt;p&gt;Finally, give the cable a half-hearted tug to make sure they’re all fairly firmly stuck.&lt;/p&gt;  &lt;p&gt;Obviously a crimp tool would give a much more reliable result, but at a push…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-5505558386255106073?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mPCiffH4XoygTWbaDnMjYWL53Co/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mPCiffH4XoygTWbaDnMjYWL53Co/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mPCiffH4XoygTWbaDnMjYWL53Co/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mPCiffH4XoygTWbaDnMjYWL53Co/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/skJAqoTE9YY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/5505558386255106073/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2009/06/building-network-cable-without-crimp.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/5505558386255106073?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/5505558386255106073?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/skJAqoTE9YY/building-network-cable-without-crimp.html" title="Building a Network Cable Without a Crimp Tool" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2009/06/building-network-cable-without-crimp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYGRns4eip7ImA9WxJRF08.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-3016601927772911109</id><published>2009-05-19T10:58:00.001+01:00</published><updated>2009-05-19T10:58:47.532+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-19T10:58:47.532+01:00</app:edited><title>Getting the Original Location of an Assembly’s Shadow Copy</title><content type="html">&lt;p&gt;If a test framework has loaded a shadow copy of your test assembly, and you need the path it was built to, you can use the following:&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; codebase = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Uri&lt;/span&gt;(&lt;span style="color: #ffc66d; font-weight: bold"&gt;Assembly&lt;/span&gt;.GetExecutingAssembly().CodeBase);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; assembly = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;FileInfo&lt;/span&gt;(codebase.LocalPath);&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-3016601927772911109?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yGk5N3knJRxX_6__1cqF8HPzJPI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yGk5N3knJRxX_6__1cqF8HPzJPI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yGk5N3knJRxX_6__1cqF8HPzJPI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yGk5N3knJRxX_6__1cqF8HPzJPI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/jr-pICut0FM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/3016601927772911109/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2009/05/getting-original-location-of-assemblys.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3016601927772911109?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/3016601927772911109?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/jr-pICut0FM/getting-original-location-of-assemblys.html" title="Getting the Original Location of an Assembly’s Shadow Copy" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2009/05/getting-original-location-of-assemblys.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIFQHo8eCp7ImA9WxJSEEw.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-5788595522371378137</id><published>2009-04-29T14:08:00.001+01:00</published><updated>2009-04-29T14:08:31.470+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-29T14:08:31.470+01:00</app:edited><title>Assembly.Load C++ CLI assembly gives Unverifiable code failed policy check</title><content type="html">&lt;p&gt;This is one of those problems that I couldn’t find the answer with google.&lt;/p&gt;  &lt;p&gt;Trying to load a C++ mixed mode assembly (like a CLR class library) from a byte array instead of a file throws a FileLoadException.&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: gray; font-weight: bold"&gt;// ClassLib.dll is a mixed-mode assembly (from a C++ CLR Class Library project&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Assembly&lt;/span&gt;.Load(&lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;ClassLib&amp;quot;&lt;/span&gt;); &lt;span style="color: gray; font-weight: bold"&gt;// Works&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;using&lt;/span&gt; (&lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; stream = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;FileStream&lt;/span&gt;(&lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;ClassLib.dll&amp;quot;&lt;/span&gt;, &lt;span style="color: #6897bb; font-weight: bold"&gt;FileMode&lt;/span&gt;.Open, &lt;span style="color: #6897bb; font-weight: bold"&gt;FileAccess&lt;/span&gt;.Read))&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; bytes = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;byte&lt;/span&gt;[stream.Length];&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; stream.Read(bytes, &lt;span style="color: #6897bb; font-weight: bold"&gt;0&lt;/span&gt;, bytes.Length);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Assembly&lt;/span&gt;.Load(bytes); &lt;span style="color: gray; font-weight: bold"&gt;// System.IO.FileLoadException &amp;quot;Unverifiable code failed policy check. (Exception from HRESULT: 0x80&lt;/span&gt;&lt;span style="color: gray; font-weight: bold"&gt;131402)&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-5788595522371378137?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AMdvWXqN2P9Ihj8pnCpxzzxwTXE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AMdvWXqN2P9Ihj8pnCpxzzxwTXE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AMdvWXqN2P9Ihj8pnCpxzzxwTXE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AMdvWXqN2P9Ihj8pnCpxzzxwTXE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/BmdKeei0xqk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/5788595522371378137/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2009/04/assemblyload-c-cli-assembly-gives.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/5788595522371378137?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/5788595522371378137?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/BmdKeei0xqk/assemblyload-c-cli-assembly-gives.html" title="Assembly.Load C++ CLI assembly gives Unverifiable code failed policy check" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>5</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2009/04/assemblyload-c-cli-assembly-gives.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UAQXo6fSp7ImA9WxJTGU0.&quot;"><id>tag:blogger.com,1999:blog-3970716704046490559.post-7375687844880933745</id><published>2009-04-28T10:00:00.001+01:00</published><updated>2009-04-28T10:00:40.415+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-28T10:00:40.415+01:00</app:edited><title>Mock and Stub for Linq To Sql</title><content type="html">&lt;p&gt;All the information I could find on testing Linq to Sql (DLinq) followed one of the following approaches:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Using reflection to &lt;a href="http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-extensible-linq-to-sql-datacontext.aspx"&gt;hack the internals&lt;/a&gt; of System.Data.Linq &lt;/li&gt;    &lt;li&gt;Duplicating the database (e.g. to Sql Compact Edition) &lt;/li&gt;    &lt;li&gt;Using the real database with rollback attributes on the test &lt;/li&gt;    &lt;li&gt;Writing the linq code against a ‘repository’ rather than the designer-generated classes. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Here’s a way to mock the tables so that the linq to sql code can be tested against in-memory tables. &lt;/p&gt;  &lt;p&gt;For the example code below, I’m using a dbml-generated DataContext which contains a reference to the Regions table of the Northwind database.&lt;/p&gt;  &lt;p&gt;The wizard-generated code looks like this:&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [System.Data.Linq.Mapping.&lt;span style="color: #ffc66d; font-weight: bold"&gt;DatabaseAttribute&lt;/span&gt;(Name=&lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;Northwind&amp;quot;&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;partial&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;class&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;MyDataDataContext&lt;/span&gt; : System.Data.Linq.&lt;span style="color: #ffc66d; font-weight: bold"&gt;DataContext&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; …&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; System.Data.Linq.&lt;span style="color: #ffc66d; font-weight: bold"&gt;Table&lt;/span&gt;&amp;lt;&lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt;&amp;gt; Regions&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;this&lt;/span&gt;.GetTable&amp;lt;&lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;And the method I want to test looks like this:&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; DataAccess()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; context = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;MyDataDataContext&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; max = context.Regions.Max(r =&amp;gt; r.RegionID);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.Regions.InsertOnSubmit(&lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt; { RegionID = max + &lt;span style="color: #6897bb; font-weight: bold"&gt;1&lt;/span&gt;, RegionDescription = &lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;New region&amp;quot;&lt;/span&gt; });&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.SubmitChanges();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;So first, create an interface to replace the use of MyDataDataContext. Here is an IMockableDataContext which describes the methods you might need from System.Data.Linq.DataContext:&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;interface&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IMockableDataContext&lt;/span&gt; : &lt;span style="color: #6897bb; font-weight: bold"&gt;IDisposable&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; SubmitChanges();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Add IMyDataContext which describes the table properties, they are copied from the designer-generated MyDataContext, but the return types are changed to use IMockableTable instead of System.Data.Linq.Table:&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;interface&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IMyDataContext&lt;/span&gt; : &lt;span style="color: #6897bb; font-weight: bold"&gt;IMockableDataContext&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #6897bb; font-weight: bold"&gt;IMockableTable&lt;/span&gt;&amp;lt;&lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt;&amp;gt; Regions { &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;IMockableTable is based on ITable and IQueryable&amp;lt;TEntity&amp;gt;, the same as System.Data.Linq.Table – so any code using the Regions property should work fine if the types are defined using ‘var’:&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;interface&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IMockableTable&lt;/span&gt;&amp;lt;TEntity&amp;gt; : &lt;span style="color: #6897bb; font-weight: bold"&gt;ITable&lt;/span&gt;, &lt;span style="color: #6897bb; font-weight: bold"&gt;IQueryable&lt;/span&gt;&amp;lt;TEntity&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;IMockableTable is implemented by a wrapper class MockableTable. It can be constructed from either an object which implements ITable and IQueryable&amp;lt;TEntity&amp;gt; (like an instance of System.Data.Linq.Table) or from two separate objects (like a mocked ITable and an in-memory collection). All its members call into the object(s) supplied in the constructor.&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;class&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;MockableTable&lt;/span&gt;&amp;lt;TEntity&amp;gt; : &lt;span style="color: #6897bb; font-weight: bold"&gt;IMockableTable&lt;/span&gt;&amp;lt;TEntity&amp;gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;private&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;readonly&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;ITable&lt;/span&gt; table;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;private&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;readonly&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IQueryable&lt;/span&gt;&amp;lt;TEntity&amp;gt; queryable;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; MockableTable(&lt;span style="color: #6897bb; font-weight: bold"&gt;ITable&lt;/span&gt; table, &lt;span style="color: #6897bb; font-weight: bold"&gt;IQueryable&lt;/span&gt;&amp;lt;TEntity&amp;gt; queryable)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;this&lt;/span&gt;.table = table;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;this&lt;/span&gt;.queryable = queryable;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; MockableTable(&lt;span style="color: #6897bb; font-weight: bold"&gt;ITable&lt;/span&gt; table)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : &lt;span style="color: #cc7832; font-weight: bold"&gt;this&lt;/span&gt;(table, (&lt;span style="color: #6897bb; font-weight: bold"&gt;IQueryable&lt;/span&gt;&amp;lt;TEntity&amp;gt;)table)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerator&lt;/span&gt;&amp;lt;TEntity&amp;gt; GetEnumerator()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; queryable.GetEnumerator();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerator&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerable&lt;/span&gt;.GetEnumerator()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; ((&lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerable&lt;/span&gt;)queryable).GetEnumerator();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Expression&lt;/span&gt; Expression&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt; { &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; queryable.Expression; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Type&lt;/span&gt; ElementType&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt; { &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; queryable.ElementType; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IQueryProvider&lt;/span&gt; Provider&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt; { &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; queryable.Provider; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; InsertOnSubmit(&lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; entity)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.InsertOnSubmit(entity);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; InsertAllOnSubmit(&lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerable&lt;/span&gt; entities)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.InsertAllOnSubmit(entities);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; Attach(&lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; entity)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.Attach(entity);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; Attach(&lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; entity, &lt;span style="color: #cc7832; font-weight: bold"&gt;bool&lt;/span&gt; asModified)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.Attach(entity, asModified);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; Attach(&lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; entity, &lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; original)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.Attach(entity, original);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; AttachAll(&lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerable&lt;/span&gt; entities)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.AttachAll(entities);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; AttachAll(&lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerable&lt;/span&gt; entities, &lt;span style="color: #cc7832; font-weight: bold"&gt;bool&lt;/span&gt; asModified)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.AttachAll(entities, asModified);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; DeleteOnSubmit(&lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; entity)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.DeleteOnSubmit(entity);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; DeleteAllOnSubmit(&lt;span style="color: #6897bb; font-weight: bold"&gt;IEnumerable&lt;/span&gt; entities)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; table.DeleteAllOnSubmit(entities);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; GetOriginalEntityState(&lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; entity)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; table.GetOriginalEntityState(entity);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;ModifiedMemberInfo&lt;/span&gt;[] GetModifiedMembers(&lt;span style="color: #cc7832; font-weight: bold"&gt;object&lt;/span&gt; entity)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; table.GetModifiedMembers(entity);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;DataContext&lt;/span&gt; Context&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt; { &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; table.Context; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;bool&lt;/span&gt; IsReadOnly &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt; { &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; table.IsReadOnly; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;So that MyDataContext can be treated as an IMyDataContext, we can take advantage of the partial declaration of MyDataContext and add an extra partial declaration which includes the explicit implementation of IMyDataContext to create a MockableTable wrapper for the Regions table.&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;partial&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;class&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;MyDataDataContext&lt;/span&gt; : &lt;span style="color: #6897bb; font-weight: bold"&gt;IMyDataContext&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #6897bb; font-weight: bold"&gt;IMockableTable&lt;/span&gt;&amp;lt;&lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt;&amp;gt; &lt;span style="color: #6897bb; font-weight: bold"&gt;IMyDataContext&lt;/span&gt;.Regions&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;get&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;return&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;MockableTable&lt;/span&gt;&amp;lt;&lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt;&amp;gt;(Regions);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The last stage in fitting the interfaces to the code is to modify the method to be tested:&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; DataAccess()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; context = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;MyDataDataContext&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AddNewRegion(context);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; AddNewRegion(&lt;span style="color: #6897bb; font-weight: bold"&gt;IMyDataContext&lt;/span&gt; context)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; max = context.Regions.Max(r =&amp;gt; r.RegionID);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.Regions.InsertOnSubmit(&lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt; { RegionID = max + &lt;span style="color: #6897bb; font-weight: bold"&gt;1&lt;/span&gt;, RegionDescription = &lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;New region&amp;quot;&lt;/span&gt;});&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; context.SubmitChanges();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;And now a test can be written (here I’m using NUnit and Moq):&lt;/p&gt;  &lt;div style="font-family: consolas; background: black; color: white; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #ffc66d; font-weight: bold"&gt;Test&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #cc7832; font-weight: bold"&gt;void&lt;/span&gt; TestAddNewRegion()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; mockRegionTable = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color: #6897bb; font-weight: bold"&gt;ITable&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; mockRegionData = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt;[] { &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt; { RegionID = &lt;span style="color: #6897bb; font-weight: bold"&gt;5&lt;/span&gt;, RegionDescription = &lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;Here&amp;quot;&lt;/span&gt; }, &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt; { RegionID = &lt;span style="color: #6897bb; font-weight: bold"&gt;9&lt;/span&gt;, RegionDescription = &lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;There&amp;quot;&lt;/span&gt; } };&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; mockRegions = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;MockableTable&lt;/span&gt;&amp;lt;&lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt;&amp;gt;(mockRegionTable.Object, mockRegionData.AsQueryable());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; mockContext = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color: #6897bb; font-weight: bold"&gt;IMyDataContext&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mockContext.SetupGet(c =&amp;gt; c.Regions).Returns(mockRegions);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #cc7832; font-weight: bold"&gt;var&lt;/span&gt; data = &lt;span style="color: #cc7832; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #ffc66d; font-weight: bold"&gt;DataClass&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; data.AddNewRegion(mockContext.Object);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mockRegionTable.Verify(x =&amp;gt; x.InsertOnSubmit(&lt;span style="color: #ffc66d; font-weight: bold"&gt;It&lt;/span&gt;.Is&amp;lt;&lt;span style="color: #ffc66d; font-weight: bold"&gt;Region&lt;/span&gt;&amp;gt;(r =&amp;gt; r.RegionID == &lt;span style="color: #6897bb; font-weight: bold"&gt;10&lt;/span&gt; &amp;amp;&amp;amp; r.RegionDescription == &lt;span style="color: #a5c25c; font-weight: bold"&gt;&amp;quot;New region&amp;quot;&lt;/span&gt;)));&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; mockContext.Verify(c =&amp;gt; c.SubmitChanges());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;It’s a fair bit of code, but most of it is a one-off:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;IMockableDataContext and (I)MockableTable are reusable. &lt;/li&gt;    &lt;li&gt;Adding tables to MyDataContext requires updating IMyDataContext and the partial declaration of MyDataContext. &lt;/li&gt;    &lt;li&gt;Future mockable data contexts need a new IFooDataContext and partial declaraion of FooDataContext &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Any comments, criticisms or suggestions for improvements are welcome!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3970716704046490559-7375687844880933745?l=nonodes.spunow.co.uk' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Dj6MdJLSpOg2SEtZWXwDkO7vtCU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dj6MdJLSpOg2SEtZWXwDkO7vtCU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Dj6MdJLSpOg2SEtZWXwDkO7vtCU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dj6MdJLSpOg2SEtZWXwDkO7vtCU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/MyDocsGotNoNodes/~4/rssgKNkO4ck" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://nonodes.spunow.co.uk/feeds/7375687844880933745/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://nonodes.spunow.co.uk/2009/04/mock-and-stub-for-linq-to-sql.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7375687844880933745?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3970716704046490559/posts/default/7375687844880933745?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MyDocsGotNoNodes/~3/rssgKNkO4ck/mock-and-stub-for-linq-to-sql.html" title="Mock and Stub for Linq To Sql" /><author><name>Mark</name><uri>http://www.blogger.com/profile/17014571818245647209</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>5</thr:total><feedburner:origLink>http://nonodes.spunow.co.uk/2009/04/mock-and-stub-for-linq-to-sql.html</feedburner:origLink></entry></feed>

