<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Paul Kiddie's Blog</title>
	
	<link>http://www.paulkiddie.com</link>
	<description>Mainly coding...</description>
	<lastBuildDate>Sun, 12 Feb 2012 19:38:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PaulKiddiesBlog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="paulkiddiesblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">PaulKiddiesBlog</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>You get a HTTP 400 Bad Request when POSTing to a WCF service</title>
		<link>http://www.paulkiddie.com/2012/02/you-get-a-http-400-bad-request-when-posting-to-a-wcf-service/</link>
		<comments>http://www.paulkiddie.com/2012/02/you-get-a-http-400-bad-request-when-posting-to-a-wcf-service/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 23:29:09 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[wcf]]></category>
		<category><![CDATA[http 400]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=563</guid>
		<description><![CDATA[I was recently debugging an issue with a WCF service I had written, where it appeared that POSTing data to the service returned a HTTP 400 Bad Request error. There are several reasons you may experience such an error but mine was peculiar in that it wasn&#8217;t always repeatable and depended on what the client [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently debugging an issue with a WCF service I had written, where it appeared that POSTing data to the service returned a HTTP 400 Bad Request error. There are <a href="http://thepursuitofalife.com/diagnosing-http-400-bad-request-errors-with-wcf-rest-services/">several</a> <a href="http://blogs.msdn.com/b/asiatech/archive/2012/01/30/400-bad-request-when-posting-webservice-or-wcf-request-from-ie.aspx">reasons</a> you may experience such an error but mine was peculiar in that it wasn&#8217;t always repeatable and depended on what the client application sent to the service.</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2012/02/wcf-service-400-bad-request.png"><img src="http://www.paulkiddie.com/wp-content/uploads/2012/02/wcf-service-400-bad-request.png" alt="" title="wcf-service-400-bad-request" width="988" height="561" class="aligncenter size-full wp-image-580" /></a></p>
<p>On closer investigation, it turned out I was hitting the default <code>maxReceivedMessageSize</code> (<a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.maxreceivedmessagesize.aspx">set to 65536 bytes</a>) when POSTing the data on the <code>basicHttpBinding</code> binding I was using, as shown on the Fiddler trace above (highlighted in red) &#8212; but only just.</p>
<h2>How to get around it.</h2>
<p>The WCF service was defined by an endpoint using the <code>basicHttpBinding</code> binding, so it was a case of adding the following:</p>
<pre class="brush: xml; title: ; notranslate">&lt;system.serviceModel&gt;
    &lt;bindings&gt;
      &lt;basicHttpBinding&gt;
        &lt;binding name=&quot;&quot; maxReceivedMessageSize=&quot;262144&quot;&gt;&lt;/binding&gt;
      &lt;/basicHttpBinding&gt;
    &lt;/bindings&gt;
    ...
&lt;/system.serviceModel&gt;</pre>
<p>Here I am setting the default <code>basicHttpBinding</code> binding to accept messages up to 256KB in size. This immediately fixed the problem. This comes with a caveat though as setting this value too high on production code could increase your exposure to possible DoS attacks from large payloads.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F02%2Fyou-get-a-http-400-bad-request-when-posting-to-a-wcf-service%2F&amp;linkname=You%20get%20a%20HTTP%20400%20Bad%20Request%20when%20POSTing%20to%20a%20WCF%20service" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F02%2Fyou-get-a-http-400-bad-request-when-posting-to-a-wcf-service%2F&amp;linkname=You%20get%20a%20HTTP%20400%20Bad%20Request%20when%20POSTing%20to%20a%20WCF%20service" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F02%2Fyou-get-a-http-400-bad-request-when-posting-to-a-wcf-service%2F&amp;linkname=You%20get%20a%20HTTP%20400%20Bad%20Request%20when%20POSTing%20to%20a%20WCF%20service" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F02%2Fyou-get-a-http-400-bad-request-when-posting-to-a-wcf-service%2F&amp;linkname=You%20get%20a%20HTTP%20400%20Bad%20Request%20when%20POSTing%20to%20a%20WCF%20service" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F02%2Fyou-get-a-http-400-bad-request-when-posting-to-a-wcf-service%2F&amp;linkname=You%20get%20a%20HTTP%20400%20Bad%20Request%20when%20POSTing%20to%20a%20WCF%20service" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F02%2Fyou-get-a-http-400-bad-request-when-posting-to-a-wcf-service%2F&amp;linkname=You%20get%20a%20HTTP%20400%20Bad%20Request%20when%20POSTing%20to%20a%20WCF%20service" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F02%2Fyou-get-a-http-400-bad-request-when-posting-to-a-wcf-service%2F&amp;title=You%20get%20a%20HTTP%20400%20Bad%20Request%20when%20POSTing%20to%20a%20WCF%20service" id="wpa2a_6">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/oQBNUCZ17Ogszlyh3zSo_r5eF-s/0/da"><img src="http://feedads.g.doubleclick.net/~a/oQBNUCZ17Ogszlyh3zSo_r5eF-s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oQBNUCZ17Ogszlyh3zSo_r5eF-s/1/da"><img src="http://feedads.g.doubleclick.net/~a/oQBNUCZ17Ogszlyh3zSo_r5eF-s/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/ctjmD8nkg8U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2012/02/you-get-a-http-400-bad-request-when-posting-to-a-wcf-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweaking MSDeploy arguments to keep existing files in folder during deployment to IIS</title>
		<link>http://www.paulkiddie.com/2012/01/tweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis/</link>
		<comments>http://www.paulkiddie.com/2012/01/tweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 10:10:41 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[tfs]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[continuous integration]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=566</guid>
		<description><![CDATA[I recently got into MSDeploy in order to automate the deployment of web application packages to IIS. A great resource that got me most of the way was Web Deployment Painkillers: Microsoft Visual Studio 2010 &#038; MS Deploy, very useful in getting me started via TFS 2010/VS 2010. What this gave me was the following [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got into MSDeploy in order to automate the deployment of web application packages to IIS. A great resource that got me most of the way was <a href="http://www.microsoftpdc.com/2009/FT56">Web Deployment Painkillers: Microsoft Visual Studio 2010 &#038; MS Deploy</a>, very useful in getting me started via TFS 2010/VS 2010.</p>
<p>What this gave me was the following MSBuild arguments that I put in Process -> Advanced -> MSBuild Arguments, within a TFS build definition I had set up:</p>
<p><code>/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:Configuration="Staging" /p:CreatePackageOnPublish=True /p:MsDeployServiceUrl=https://<i>&lt;server name&gt;</i>:8172/msdeploy.axd /p:AllowUntrustedCertificate=True /p:username="<i>&lt;user name&gt;</i>" /p:password="<i>&lt;password&gt;</i>" /p:MSDeployPublishMethod=WMSVC /p:SkipExtraFilesOnServer=True</code></p>
<p>I was looking for a way to emulate the option you get when you import an application package in IIS (with the <a href="http://www.iis.net/download/webdeploy">web deploy</a> extension installed), which lets you chose whether you want to overwrite existing files in the destination, or not, as I wanted.</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2012/01/iis-7-append-files-to-destination.png"><img src="http://www.paulkiddie.com/wp-content/uploads/2012/01/iis-7-append-files-to-destination.png" alt="" title="iis-7-append-files-to-destination" width="677" height="510" class="aligncenter size-full wp-image-568" /></a></p>
<p>Unfortunately, the documentation for MSDeploy seems a little thin on the ground, but it seems argument I was lacking was <code><b>/p:SkipExtraFilesOnServer=True</b></code>. Adding this to the end of the above MSBuild arguments gave me the required behaviour, resulting in the following MSBuild arguments:</p>
<p><code>/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:Configuration="Staging" /p:CreatePackageOnPublish=True /p:MsDeployServiceUrl=https://<i>&lt;server name&gt;</i>:8172/msdeploy.axd /p:AllowUntrustedCertificate=True /p:username="<i>&lt;user name&gt;</i>" /p:password="<i>&lt;password&gt;</i>" /p:MSDeployPublishMethod=WMSVC /p:SkipExtraFilesOnServer=True</code></p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F01%2Ftweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis%2F&amp;linkname=Tweaking%20MSDeploy%20arguments%20to%20keep%20existing%20files%20in%20folder%20during%20deployment%20to%20IIS" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F01%2Ftweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis%2F&amp;linkname=Tweaking%20MSDeploy%20arguments%20to%20keep%20existing%20files%20in%20folder%20during%20deployment%20to%20IIS" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F01%2Ftweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis%2F&amp;linkname=Tweaking%20MSDeploy%20arguments%20to%20keep%20existing%20files%20in%20folder%20during%20deployment%20to%20IIS" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F01%2Ftweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis%2F&amp;linkname=Tweaking%20MSDeploy%20arguments%20to%20keep%20existing%20files%20in%20folder%20during%20deployment%20to%20IIS" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F01%2Ftweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis%2F&amp;linkname=Tweaking%20MSDeploy%20arguments%20to%20keep%20existing%20files%20in%20folder%20during%20deployment%20to%20IIS" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F01%2Ftweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis%2F&amp;linkname=Tweaking%20MSDeploy%20arguments%20to%20keep%20existing%20files%20in%20folder%20during%20deployment%20to%20IIS" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2012%2F01%2Ftweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis%2F&amp;title=Tweaking%20MSDeploy%20arguments%20to%20keep%20existing%20files%20in%20folder%20during%20deployment%20to%20IIS" id="wpa2a_12">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/txHNKVkV3cH6nhLhwYhK71rAIpY/0/da"><img src="http://feedads.g.doubleclick.net/~a/txHNKVkV3cH6nhLhwYhK71rAIpY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/txHNKVkV3cH6nhLhwYhK71rAIpY/1/da"><img src="http://feedads.g.doubleclick.net/~a/txHNKVkV3cH6nhLhwYhK71rAIpY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/SjgiCEmly9M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2012/01/tweaking-msdeploy-arguments-to-keep-existing-files-in-folder-during-deployment-to-iis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The importance of the position of Window.Resources element in WPF XAML markup</title>
		<link>http://www.paulkiddie.com/2011/10/the-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup/</link>
		<comments>http://www.paulkiddie.com/2011/10/the-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 22:46:47 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=535</guid>
		<description><![CDATA[Got burnt by a little gotcha today writing a sample Windows Presentation Foundation (WPF) application. I was manually hooking up a WPF DataGrid control to a Entity Framework data source that was defined in another project, through a combination of XAML and code-behind. I had declared the DataGrid control as follows in Window.xaml: in which [...]]]></description>
			<content:encoded><![CDATA[<p>Got burnt by a little gotcha today writing a sample Windows Presentation Foundation (WPF) application. I was manually hooking up a WPF <code>DataGrid</code> control to a Entity Framework data source that was defined in another project, through a combination of XAML and code-behind.</p>
<p>I had declared the DataGrid control as follows in <code>Window.xaml</code>:</p>
<pre class="brush: xml; title: ; notranslate">&lt;DataGrid AutoGenerateColumns=&quot;False&quot; EnableRowVirtualization=&quot;True&quot;
ItemsSource=&quot;{Binding Source={StaticResource AlbumsSource}}&quot; Name=&quot;AlbumsDataGrid&quot; Margin=&quot;5&quot;
RowDetailsVisibilityMode=&quot;VisibleWhenSelected&quot; Grid.Row=&quot;1&quot;&gt;
            &lt;DataGrid.Columns&gt;
                &lt;DataGridTextColumn x:Name=&quot;IdColumn&quot; Binding=&quot;{Binding Path=Id}&quot;
Header=&quot;Id&quot; Visibility=&quot;Hidden&quot; /&gt;
                &lt;DataGridTextColumn x:Name=&quot;NameColumn&quot; Binding=&quot;{Binding Path=Name}&quot;
Header=&quot;Album Name&quot; Width=&quot;*&quot; /&gt;
            &lt;/DataGrid.Columns&gt;
&lt;/DataGrid&gt;</pre>
<p>in which
<pre class="brush: xml; title: ; notranslate">... ItemsSource=&quot;{Binding Source={StaticResource AlbumsSource}}&quot;</pre>
<p> is responsible for binding the items to the data grid. I had set a collection of resources on <code>Window</code> that I was <strong>below</strong> the <code>DataGrid</code> as follows:</p>
<pre class="brush: xml; title: ; notranslate">&lt;Window.Resources&gt;
        &lt;CollectionViewSource x:Key=&quot;AlbumsSource&quot;&gt;&lt;/CollectionViewSource&gt;
&lt;/Window.Resources&gt;</pre>
<p>Then I set the data source of the <code>CollectionViewSource</code> I&#8217;d defined in <code>Window.Resource</code> in the code-behind as follows, in the <code>Window_Loaded</code> event handler:</p>
<pre class="brush: csharp; title: ; notranslate">private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //look up AlbumsSource in resource dictionary
            CollectionViewSource src = ((CollectionViewSource)Resources[&quot;AlbumsSource&quot;]);

            using (var ent = new MusicTrackerContainer()) {
                src.Source = ent.Albums;
            }
        }
</pre>
<p>Where <code>MusicTrackerContainer</code> is simply a Entity Framework model. This did not work as expected, instead throwing an <code>XmlParseException</code> stating &#8216;Provide value on &#8216;System.Windows.StaticResourceExtension&#8217; threw an exception.&#8217;.</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2011/10/xmlparseexception-for-static-resource.png"><img src="http://www.paulkiddie.com/wp-content/uploads/2011/10/xmlparseexception-for-static-resource.png" alt="" title="xmlparseexception for static resource" width="649" height="453" class="aligncenter size-full wp-image-536" /></a></p>
<p>To fix this, the <code>Window.Resources</code> element should be declared in the XAML <strong>before</strong> it is referenced in the <code>Binding</code>. I moved the <code>Window.Resource</code> element to be the first child of the <code>Window</code> element and it worked. XAML follows:</p>
<pre class="brush: xml; title: ; notranslate">&lt;Window x:Class=&quot;MusicTracker.MainWindow&quot;
        xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
        xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
        Title=&quot;MainWindow&quot; Height=&quot;350&quot; Width=&quot;525&quot; Loaded=&quot;Window_Loaded&quot;&gt;
    &lt;Window.Resources&gt;
        &lt;CollectionViewSource x:Key=&quot;AlbumsSource&quot;&gt;&lt;/CollectionViewSource&gt;
    &lt;/Window.Resources&gt;
    &lt;Grid&gt;
        &lt;Grid.RowDefinitions&gt;
            &lt;RowDefinition Height=&quot;*&quot; /&gt;
            &lt;RowDefinition Height=&quot;*&quot; /&gt;
        &lt;/Grid.RowDefinitions&gt;
        &lt;DataGrid AutoGenerateColumns=&quot;False&quot; EnableRowVirtualization=&quot;True&quot;
ItemsSource=&quot;{Binding Source={StaticResource AlbumsSource}}&quot; Name=&quot;AlbumsDataGrid&quot; Margin=&quot;5&quot;
RowDetailsVisibilityMode=&quot;VisibleWhenSelected&quot; Grid.Row=&quot;1&quot;&gt;
            &lt;DataGrid.Columns&gt;
                &lt;DataGridTextColumn x:Name=&quot;IdColumn&quot; Binding=&quot;{Binding Path=Id}&quot;
Header=&quot;Id&quot; Visibility=&quot;Hidden&quot; /&gt;
                &lt;DataGridTextColumn x:Name=&quot;NameColumn&quot; Binding=&quot;{Binding Path=Name}&quot;
Header=&quot;Album Name&quot; Width=&quot;*&quot; /&gt;
            &lt;/DataGrid.Columns&gt;
        &lt;/DataGrid&gt;
    &lt;/Grid&gt;
&lt;/Window&gt;</pre>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fthe-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup%2F&amp;linkname=The%20importance%20of%20the%20position%20of%20Window.Resources%20element%20in%20WPF%20XAML%20markup" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fthe-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup%2F&amp;linkname=The%20importance%20of%20the%20position%20of%20Window.Resources%20element%20in%20WPF%20XAML%20markup" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fthe-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup%2F&amp;linkname=The%20importance%20of%20the%20position%20of%20Window.Resources%20element%20in%20WPF%20XAML%20markup" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fthe-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup%2F&amp;linkname=The%20importance%20of%20the%20position%20of%20Window.Resources%20element%20in%20WPF%20XAML%20markup" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fthe-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup%2F&amp;linkname=The%20importance%20of%20the%20position%20of%20Window.Resources%20element%20in%20WPF%20XAML%20markup" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fthe-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup%2F&amp;linkname=The%20importance%20of%20the%20position%20of%20Window.Resources%20element%20in%20WPF%20XAML%20markup" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fthe-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup%2F&amp;title=The%20importance%20of%20the%20position%20of%20Window.Resources%20element%20in%20WPF%20XAML%20markup" id="wpa2a_18">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/CQzQRM9g06kNAS5mRA2D0VH5CcA/0/da"><img src="http://feedads.g.doubleclick.net/~a/CQzQRM9g06kNAS5mRA2D0VH5CcA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CQzQRM9g06kNAS5mRA2D0VH5CcA/1/da"><img src="http://feedads.g.doubleclick.net/~a/CQzQRM9g06kNAS5mRA2D0VH5CcA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/gwUWu1vm5kA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2011/10/the-importance-of-the-position-of-window-resources-element-in-wpf-xaml-markup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WCF Service user impersonation options in IIS7.0 +</title>
		<link>http://www.paulkiddie.com/2011/10/wcf-service-user-impersonation-options-in-iis7-0/</link>
		<comments>http://www.paulkiddie.com/2011/10/wcf-service-user-impersonation-options-in-iis7-0/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 18:38:43 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[wcf]]></category>
		<category><![CDATA[application pools]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[impersonation]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=506</guid>
		<description><![CDATA[I recently had a problem where I wanted my WCF services to run under the context of a user with additional permissions over the standard ApplicationPoolIdentity user used when hosting WCF services under IIS, including opening named pipe clients. I got a little burnt, and thought I&#8217;d share a couple of options I explored. ASP.net [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a problem where I wanted my WCF services to run under the context of a user with additional permissions over the standard <code>ApplicationPoolIdentity</code> user used when hosting WCF services under IIS, including opening named pipe clients. I got a little burnt, and thought I&#8217;d share a couple of options I explored.</p>
<h1>ASP.net impersonation</h1>
<p>Though WCF has been designed to be transport-independant, you can utilise ASP.net compatibility mode, which gives you the opportunity to get your services to impersonate as a given user through standard ASP.net means, by adding the following to your <code>web.config</code>:</p>
<pre class="brush: xml; title: ; notranslate">&lt;system.web&gt;
    &lt;identity impersonate=&quot;true&quot;/&gt;
&lt;/system.web&gt;</pre>
<p>This will cause your services to impersonate the current user. See <a href="http://msdn.microsoft.com/en-us/library/ff647404.aspx">http://msdn.microsoft.com/en-us/library/ff647404.aspx</a> under the section &#8216;To impersonate the original caller&#8217;, which does a great job of explaining this.</p>
<p>Then, if you want <strong>ALL</strong> your WCF service requests to run under the identity of a pre-defined user, the identity element further supports the username and password attributes, e.g.</p>
<pre class="brush: xml; title: ; notranslate">&lt;system.web&gt;
    &lt;identity impersonate=&quot;true&quot; username=&quot;user&quot; password=&quot;pass&quot; /&gt;
&lt;/system.web&gt;</pre>
<p>Where user is a local or domain user. The above will give you access to the resources that <em>user</em> is capable of accessing. </p>
<p>If you want to take advantage of this for your WCF services, you should configure your services as follows:</p>
<p>1. In your web.config, set the <code>aspNetCompatibilityEnabled</code> attribute to true on the <code>system.serviceModel</code> element:</p>
<pre class="brush: xml; title: ; notranslate">&lt;system.serviceModel&gt;
    ...
    &lt;serviceHostingEnvironment ... aspNetCompatibilityEnabled=&quot;true&quot;/&gt;
&lt;/system.serviceModel&gt;</pre>
<p>2. On your service implementation (the class that implements your service contract), set the <code>AspNetCompatibilityRequirementsMode</code> attribute at the class level.</p>
<pre class="brush: csharp; title: ; notranslate">[AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Required]
public class Service : IService {
    public bool DoSomeWorkThatRequiresElevatedPermissions(int id)
}</pre>
<p>The <code>AspNetCompatibilityRequirementsMode</code> attribute will ensure that the service instantiation fails if the <code>aspNetCompatibilityEnabled</code> attribute has not been added to the web.config. </p>
<p>This should be enough to get the service to run as the impersonated user you set in the web.config, and on the surface it seemed to give me the appropriate behaviour, with the WCF services able to access folders I had secured for access only by a given user &#8211; until I began using the <a href="http://msdn.microsoft.com/en-us/library/dd460717.aspx">Task Parallel Library (TPL)</a> from within the service operations to spin off some long running operations in seperate threads. TPL provides a nice clean API to spin off threads as <code>Task</code>&#8216;s, but it seemed the running of the service in the context of the impersonated user in the web.config did not extend to any threads spun off by the service.</p>
<h1>Run WCF service as&#8230;.</h1>
<p>In order to enable WCF services to run as a specific user, I thought of extracting the services that required elevated permissions and have them run as a windows service. Or instead, with the services being hosted under IIS, run the services under a separate application pool and set this application pool&#8217;s identity to the user with the permissions to access the required resources. This solved my problem &#8211; any threads spun out as part of the service ran under the context of the new application pool identity, meaning you can use all the loveliness of the TPL.</p>
<p>To take advantage of this, head to the Internet Information Services (IIS) Manager. I&#8217;m using Windows 7 64-bit, which comes with IIS 7 by default, but most of these instructions should apply to earlier versions also, though the location of the settings panels will be different.</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2011/10/iis-custom-app-pool.png"><img src="http://www.paulkiddie.com/wp-content/uploads/2011/10/iis-custom-app-pool-1024x749.png" alt="" title="iis custom app pool" width="775" height="566" class="aligncenter size-large wp-image-530" /></a></p>
<p>Select &#8216;Application Pools&#8217; over in the left hand bar of the IIS Manager and create an app pool relevant for your WCF services (.NET 4.0/Integrated pipeline should do). Here, I&#8217;m going to call mine ElevatedAppPool. </p>
<p>Once you&#8217;ve created it, select it and click &#8216;Advanced Settings&#8217; in the Actions pane on the right hand side of the IIS Manager. Under Process Model you should see an &#8216;Identity&#8217; element, which if you click &#8230; you can assign a custom account to it. This can be either a domain or local machine account.</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2011/10/iis-app-pool-set-identity.png"><img src="http://www.paulkiddie.com/wp-content/uploads/2011/10/iis-app-pool-set-identity-1024x756.png" alt="" title="iis app pool set identity" width="775" height="572" class="aligncenter size-large wp-image-524" /></a></p>
<p>Finally, go back to the application that your WCF services are located by expanding the Sites tab on the left hand side of the IIS Manager. Click &#8216;Advanced Settings&#8217; and select the application pool you just set up. You should now find your WCF services are running under this user with elevated permissions.</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2011/10/iis-web-app-set-app-pool.png"><img src="http://www.paulkiddie.com/wp-content/uploads/2011/10/iis-web-app-set-app-pool.png" alt="" title="iis web app set app pool" width="830" height="673" class="aligncenter size-full wp-image-525" /></a></p>
<p>You could of course, have given the <code>ApplicationPoolIdentity</code> the extra permissions (such as reading or writing to a particular folder outside wwwroot) but having a seperate identity/application pool makes the changes specific to this set of WCF services, and not for other application pools that may be using the <code>ApplicationPoolIdentity</code> user.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fwcf-service-user-impersonation-options-in-iis7-0%2F&amp;linkname=WCF%20Service%20user%20impersonation%20options%20in%20IIS7.0%20%2B" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fwcf-service-user-impersonation-options-in-iis7-0%2F&amp;linkname=WCF%20Service%20user%20impersonation%20options%20in%20IIS7.0%20%2B" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fwcf-service-user-impersonation-options-in-iis7-0%2F&amp;linkname=WCF%20Service%20user%20impersonation%20options%20in%20IIS7.0%20%2B" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fwcf-service-user-impersonation-options-in-iis7-0%2F&amp;linkname=WCF%20Service%20user%20impersonation%20options%20in%20IIS7.0%20%2B" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fwcf-service-user-impersonation-options-in-iis7-0%2F&amp;linkname=WCF%20Service%20user%20impersonation%20options%20in%20IIS7.0%20%2B" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fwcf-service-user-impersonation-options-in-iis7-0%2F&amp;linkname=WCF%20Service%20user%20impersonation%20options%20in%20IIS7.0%20%2B" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F10%2Fwcf-service-user-impersonation-options-in-iis7-0%2F&amp;title=WCF%20Service%20user%20impersonation%20options%20in%20IIS7.0%20%2B" id="wpa2a_24">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/woyuLw0Ks_aP_161IFMVuor67ks/0/da"><img src="http://feedads.g.doubleclick.net/~a/woyuLw0Ks_aP_161IFMVuor67ks/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/woyuLw0Ks_aP_161IFMVuor67ks/1/da"><img src="http://feedads.g.doubleclick.net/~a/woyuLw0Ks_aP_161IFMVuor67ks/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/EdzfDGX6ED8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2011/10/wcf-service-user-impersonation-options-in-iis7-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Matlab command window history in Windows</title>
		<link>http://www.paulkiddie.com/2011/09/getting-matlab-command-window-history-in-windows/</link>
		<comments>http://www.paulkiddie.com/2011/09/getting-matlab-command-window-history-in-windows/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 20:22:25 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[matlab]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=451</guid>
		<description><![CDATA[A few months ago whilst writing up my thesis and doing some number crunching with Matlab, my machine died spectacularly, leaving the hard drive but not much else intact. Making good use of the command window in Matlab I wanted to recover this history &#8211; so armed with the hard drive and not much else [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago whilst writing up my thesis and doing some number crunching with Matlab, my machine died spectacularly, leaving the hard drive but not much else intact.</p>
<p>Making good use of the command window in Matlab I wanted to recover this history &#8211; so armed with the hard drive and not much else I went looking for where the history of the command window is kept.</p>
<p>The file you&#8217;re looking for is <code>history.m</code>, which if you are using Vista/Windows 7 you&#8217;ll find in the following folder:</p>
<p>C:\Users\<em>user_name_here</em>\AppData\Roaming\MathWorks\MATLAB\R2008b\history.m</p>
<p>* of course you&#8217;ll need to replace R2008b with the version you are using also!</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F09%2Fgetting-matlab-command-window-history-in-windows%2F&amp;linkname=Getting%20Matlab%20command%20window%20history%20in%20Windows" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F09%2Fgetting-matlab-command-window-history-in-windows%2F&amp;linkname=Getting%20Matlab%20command%20window%20history%20in%20Windows" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F09%2Fgetting-matlab-command-window-history-in-windows%2F&amp;linkname=Getting%20Matlab%20command%20window%20history%20in%20Windows" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F09%2Fgetting-matlab-command-window-history-in-windows%2F&amp;linkname=Getting%20Matlab%20command%20window%20history%20in%20Windows" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F09%2Fgetting-matlab-command-window-history-in-windows%2F&amp;linkname=Getting%20Matlab%20command%20window%20history%20in%20Windows" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F09%2Fgetting-matlab-command-window-history-in-windows%2F&amp;linkname=Getting%20Matlab%20command%20window%20history%20in%20Windows" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F09%2Fgetting-matlab-command-window-history-in-windows%2F&amp;title=Getting%20Matlab%20command%20window%20history%20in%20Windows" id="wpa2a_30">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/CBqupuOGo2RKTXtPSQxJfqPdeJA/0/da"><img src="http://feedads.g.doubleclick.net/~a/CBqupuOGo2RKTXtPSQxJfqPdeJA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CBqupuOGo2RKTXtPSQxJfqPdeJA/1/da"><img src="http://feedads.g.doubleclick.net/~a/CBqupuOGo2RKTXtPSQxJfqPdeJA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/Nd7rUFfhRII" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2011/09/getting-matlab-command-window-history-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A fix for Error 720: A Connection to the remote computer could not be established when trying to connect to a Windows 7 VPN</title>
		<link>http://www.paulkiddie.com/2011/06/a-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn/</link>
		<comments>http://www.paulkiddie.com/2011/06/a-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 21:14:42 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[windows 7]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[vpn server]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=478</guid>
		<description><![CDATA[I was recently re-setting up my Windows 7 VPN server and forgot an essential step that led me to get &#8216;Error 720: A Connection to the remote computer could not be established&#8217; when trying to connect to it with Windows-based clients. Turns out you might need to assign an IP address range to the VPN [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently re-setting up my Windows 7 VPN server and forgot an essential step that led me to get &#8216;Error 720: A Connection to the remote computer could not be established&#8217; when trying to connect to it with Windows-based clients. Turns out you might need to assign an IP address range to the VPN server, by doing the following:<br />
1. Go into Network and Sharing Center &gt; Change Adapter Settings<br />
2. Right click on Incoming Connection<br />
3. Click on the Networking tab and double click on the &#8216;Internet Protocol Version 4 (TCP/IPv4)&#8217; checkbox</p>
<p style="text-align: center;"><a href="http://www.paulkiddie.com/wp-content/uploads/2011/06/ipv4.png"><img class="aligncenter size-full wp-image-481" title="ipv4" src="http://www.paulkiddie.com/wp-content/uploads/2011/06/ipv4.png" alt="ipv4" width="340" height="410" /></a></p>
<p>4. Click the &#8216;Specify IP addresses&#8217; and type an IP range that is in line with your current router setup (e.g. if your LAN is on a 192.168.11.x network, then you might want to set it as follows):</p>
<p style="text-align: center;"><a href="http://www.paulkiddie.com/wp-content/uploads/2011/06/specify-ip-addresses.png"><img class="aligncenter size-full wp-image-483" title="specify-ip-addresses" src="http://www.paulkiddie.com/wp-content/uploads/2011/06/specify-ip-addresses.png" alt="" width="370" height="285" /></a></p>
<p>You should now find, like me, that the VPN works once more! I&#8217;ll post up a tutorial on how I got it working and accessible to the public Internet soon.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F06%2Fa-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn%2F&amp;linkname=A%20fix%20for%20Error%20720%3A%20A%20Connection%20to%20the%20remote%20computer%20could%20not%20be%20established%20when%20trying%20to%20connect%20to%20a%20Windows%207%20VPN" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F06%2Fa-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn%2F&amp;linkname=A%20fix%20for%20Error%20720%3A%20A%20Connection%20to%20the%20remote%20computer%20could%20not%20be%20established%20when%20trying%20to%20connect%20to%20a%20Windows%207%20VPN" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F06%2Fa-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn%2F&amp;linkname=A%20fix%20for%20Error%20720%3A%20A%20Connection%20to%20the%20remote%20computer%20could%20not%20be%20established%20when%20trying%20to%20connect%20to%20a%20Windows%207%20VPN" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F06%2Fa-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn%2F&amp;linkname=A%20fix%20for%20Error%20720%3A%20A%20Connection%20to%20the%20remote%20computer%20could%20not%20be%20established%20when%20trying%20to%20connect%20to%20a%20Windows%207%20VPN" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F06%2Fa-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn%2F&amp;linkname=A%20fix%20for%20Error%20720%3A%20A%20Connection%20to%20the%20remote%20computer%20could%20not%20be%20established%20when%20trying%20to%20connect%20to%20a%20Windows%207%20VPN" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F06%2Fa-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn%2F&amp;linkname=A%20fix%20for%20Error%20720%3A%20A%20Connection%20to%20the%20remote%20computer%20could%20not%20be%20established%20when%20trying%20to%20connect%20to%20a%20Windows%207%20VPN" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2011%2F06%2Fa-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn%2F&amp;title=A%20fix%20for%20Error%20720%3A%20A%20Connection%20to%20the%20remote%20computer%20could%20not%20be%20established%20when%20trying%20to%20connect%20to%20a%20Windows%207%20VPN" id="wpa2a_36">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/0A4DR4780nVoGjaajW5PHKxu7Hc/0/da"><img src="http://feedads.g.doubleclick.net/~a/0A4DR4780nVoGjaajW5PHKxu7Hc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0A4DR4780nVoGjaajW5PHKxu7Hc/1/da"><img src="http://feedads.g.doubleclick.net/~a/0A4DR4780nVoGjaajW5PHKxu7Hc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/TUlfz6Or3qc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2011/06/a-fix-for-error-720-a-connection-to-the-remote-computer-could-not-be-established-when-trying-to-connect-to-a-windows-7-vpn/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Customising surface plots in Excel 2010</title>
		<link>http://www.paulkiddie.com/2010/10/customising-surface-plots-in-excel-2010/</link>
		<comments>http://www.paulkiddie.com/2010/10/customising-surface-plots-in-excel-2010/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 14:14:08 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[excel]]></category>
		<category><![CDATA[office 2010]]></category>
		<category><![CDATA[crosstab]]></category>
		<category><![CDATA[excel 2010]]></category>
		<category><![CDATA[surface plot]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=436</guid>
		<description><![CDATA[I&#8217;ve got a bunch of data in three columns (x,y,z) which I put into a cross tab and output as a surface and contour plot in Excel 2010. I wanted to customise the colours used, remove the shading and filter labels in order to paste the graph into a document. Just a quick heads up [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a bunch of data in three columns (x,y,z) which I put into a cross tab and output as a surface and contour plot in Excel 2010. I wanted to customise the colours used, remove the shading and filter labels in order to paste the graph into a document. Just a quick heads up for some articles that helped me achieve all these.</p>
<h2>Removing shading</h2>
<p>The following article also applies to Excel 2010. Unfortunately there still is no option to remove the shading from the user interface, so you have to resort to a bit of VB scripting.</p>
<p>Remove shading from a surface chart in Excel 2007 - <a href="http://social.answers.microsoft.com/Forums/en-US/excelchart/thread/2b147908-636b-4445-9262-46463406accb">http://social.answers.microsoft.com/Forums/en-US/excelchart/thread/2b147908-636b-4445-9262-46463406accb</a></p>
<h2>Colouring the plots</h2>
<p>Here, the essence is that to colour the plot yourself, you have to colour each legend item individually. Do this by selecting the legend (make sure it&#8217;s not the entire legend!), then right click and select &#8216;Format Band&#8217;. Original article: Formatting Surface Charts part in Surface and Contour Charts in Excel 2007 -<a href=" http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=447"> http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=447</a></p>
<h2>Removing filter labels</h2>
<p>The filter labels serve a very good purpose when you want to filter individual rows or columns but get in the way a little if you want to embed the graph into a document. If you want to remove the filter labels, the toggle button to do so is tucked away in PivotChart Tools, which pops up if you select the surface plot derived from Pivot Table data. Then click the Analyse tab and click &#8216;Field Buttons&#8217; to toggle between showing and hiding the filter labels.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F10%2Fcustomising-surface-plots-in-excel-2010%2F&amp;linkname=Customising%20surface%20plots%20in%20Excel%202010" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F10%2Fcustomising-surface-plots-in-excel-2010%2F&amp;linkname=Customising%20surface%20plots%20in%20Excel%202010" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F10%2Fcustomising-surface-plots-in-excel-2010%2F&amp;linkname=Customising%20surface%20plots%20in%20Excel%202010" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F10%2Fcustomising-surface-plots-in-excel-2010%2F&amp;linkname=Customising%20surface%20plots%20in%20Excel%202010" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F10%2Fcustomising-surface-plots-in-excel-2010%2F&amp;linkname=Customising%20surface%20plots%20in%20Excel%202010" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F10%2Fcustomising-surface-plots-in-excel-2010%2F&amp;linkname=Customising%20surface%20plots%20in%20Excel%202010" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F10%2Fcustomising-surface-plots-in-excel-2010%2F&amp;title=Customising%20surface%20plots%20in%20Excel%202010" id="wpa2a_42">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/eVPKo7pbil_lwgoRwxAJdc7cb40/0/da"><img src="http://feedads.g.doubleclick.net/~a/eVPKo7pbil_lwgoRwxAJdc7cb40/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/eVPKo7pbil_lwgoRwxAJdc7cb40/1/da"><img src="http://feedads.g.doubleclick.net/~a/eVPKo7pbil_lwgoRwxAJdc7cb40/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/5edkL4Ai23k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2010/10/customising-surface-plots-in-excel-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration methods in PHP to enable large uploads on a per-site basis</title>
		<link>http://www.paulkiddie.com/2010/06/configuration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis/</link>
		<comments>http://www.paulkiddie.com/2010/06/configuration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 10:22:05 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[registry]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=409</guid>
		<description><![CDATA[As dry as the subject of PHP configuration is, I thought a blog entry was necessary as I’ve just spent a fair bit of time digging around to find a way to configure PHP directives on a per-site basis. The mechanisms available vary based on the runtime environment and the method PHP runs. My problem [...]]]></description>
			<content:encoded><![CDATA[<p>As dry as the subject of PHP configuration is, I thought a blog entry was necessary as I’ve just spent a fair bit of time digging around to find a way to configure PHP directives on a per-site basis. The mechanisms available vary based on the runtime environment and the method PHP runs.</p>
<p>My problem was to set PHP directives on a per site basis in order to enable large file uploads on a single web application running on the web server. I also wanted to modify the temporary upload folder PHP uses for file uploads, and enable file upload progress monitoring through the APC extension (preferrably only on the file uploader web app). The directives corresponding to these are in a number of different <a href="http://www.php.net/manual/en/ini.list.php">“modes”</a>, so I was looking for a way that provided complete freedom over specifying the directives.</p>
<p>Depending on your PHP install and operating system there are several ways to customise your site’s PHP configuration. PHP itself can run in CGI mode, or as an Apache module. I’ll leave it to <a href="http://docs.joomla.org/Should_PHP_run_as_a_CGI_script_or_as_an_Apache_module%3F#What_is_the_difference_between_CGI_and_apache_Module_Mode.3F ">http://docs.joomla.org/Should_PHP_run_as_a_CGI_script_or_as_an_Apache_module%3F#What_is_the_difference_between_CGI_and_apache_Module_Mode.3F</a> as it does a great job at explaining security and performance differences between PHP running in CGI or Apache module mode.</p>
<h1>Determining your PHP runtime environment.</h1>
<p>To determine the best way for configuring PHP on a per-site basis you’ll need to determine your PHP runtime environment (i.e. your operating system and whether PHP runs as a CGI or an Apache module). So, create a script that outputs your PHP runtime environment information:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><a href="http://www.php.net/phpinfo"><span class="kw3">phpinfo</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">?&gt;</span></div>
</li>
</ol>
</div>
<p>You should then look at the “Server API” field, which will say something like “CGI/FastCGI” for PHP running as a CGI:</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2010/06/cgi.png"><img class="aligncenter size-full wp-image-417" title="cgi" src="http://www.paulkiddie.com/wp-content/uploads/2010/06/cgi.png" alt="" width="606" height="890" /></a></p>
<p>or “Apache Handler” for PHP running as an Apache module:</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2010/06/apache_handler.png"><img class="aligncenter size-full wp-image-418" title="apache_handler" src="http://www.paulkiddie.com/wp-content/uploads/2010/06/apache_handler.png" alt="" width="602" height="611" /></a></p>
<p>Now we&#8217;ve identified the mode of operation, I&#8217;ll explain some general methods for customising PHP directives on a per-site basis:</p>
<h1>General per-site configuration methods</h1>
<p>This should work on PHP running in any environment (Linux/Windows/Mac/etc) as either an Apache module or CGI.</p>
<h3>Use ini_set() (limited number of options available)</h3>
<p>You can customise a limited number of PHP directives on a per-script basis, by adding <code>ini_set()</code> to the top of your scripts. You can adjust <code>PHP_INI_USER</code> directives within scripts. See <a href="http://uk.php.net/ini_set">http://uk.php.net/ini_set</a> for more information on this.</p>
<h3>Allow user defined INI files (greater number of options available)</h3>
<p>Edit your <code>php.ini</code> to permit user defined .ini files, by looking for a field <code>user_ini.filename</code> (which might be currently commented out). Uncomment it and state the filename you want to use for the user defined .ini files (which by default is <code>.user.ini</code>).</p>
<p>Then, within your web application (e.g. <code>C:\phpwebs\helloworld</code>), create a new file called <code>.user.ini</code> and add in the directives to suit:</p>
<pre>upload_max_filesize = 1024M
post_max_size = 1500M</pre>
<p>You can adjust <code>PHP_INI_PERDIR</code> and <code>PHP_INI_USER</code> directives in user defined INI files, which may or may not be enough. In my case, it was not, as I wanted to also update <code>upload_tmp_dir</code>, a <code>PHP_INI_SYSTEM</code> directive.</p>
<h3>Define folder and directives in php.ini (most, if not all options available)</h3>
<p>In this approach, you edit <code>php.ini</code> wherever it is located (see output from <code>phpinfo()</code> above), and at the end add your site-specific configuration, by specifying the folder that the web application resides in. Lets say our web app is located in <code>C:\phpwebs\helloworld\</code>. To configure the PHP runtime on this web app, add</p>
<pre>[PATH=C:/phpwebs/helloworld/]
upload_max_filesize = 1024M
post_max_size = 1500M</pre>
<p>At the end of <code>php.ini</code>.</p>
<p>Note virtually any directive can be customised on a per-site basis using this method, and this was the approach I went for when hosting a PHP web app on IIS to in order to adjust <code>upload_tmp_dir</code> for the uploader app. What I didn’t seem to be able to do was to enable some extension based directives on a per site basis. The progress meter failed when <code>apc.rfc1867=on</code> was specified under the per-site declaration, so I made this part of the global php.ini.</p>
<h1>Per-site configuration options with PHP as a CGI in Windows IIS</h1>
<p>Any of the general per-site configuration options mentioned above should work. You can also edit the registry to manage a subset of PHP directives, illustrated at <a href="http://www.php.net/manual/en/configuration.changes.php">http://www.php.net/manual/en/configuration.changes.php</a>, in the section entitled ‘Changing PHP configuration via the Windows registry’. The process is as follows:</p>
<ul>
<li>Open up regedit</li>
<li>Navigate to HKLM\SOFTWARE\PHP\Per Directory Values</li>
<li>Create keys corresponding to the directory hierarchy of your web app and at the child node specify the customised directives via <code>New &gt; String Value</code>. Using our <code>C:\phpwebs\helloworld\</code> example see the screenshot below for how you modify PHP directives:</li>
</ul>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2010/06/registry.png"><img class="aligncenter size-full wp-image-419" title="registry" src="http://www.paulkiddie.com/wp-content/uploads/2010/06/registry.png" alt="" width="638" height="450" /></a></p>
<p>Note that you can customise only <code>PHP_INI_USER</code> directives in this manner.</p>
<h1>Per-site configuration options with PHP as an Apache module</h1>
<p>All-in-one *AMP stacks (such as XAMPP) mostly have PHP running as an Apache module. Any of the general per-site configuration options mentioned above should also work for PHP configured as an Apache module.</p>
<p>If your PHP install in running this way, you can also edit <code>httpd.conf</code> file to specify PHP directives for virtual hosts and additionally directories and subdirectories exposed by the virtual host.</p>
<p>To do this:</p>
<p>1.	Ensure <code>AllowOverride All</code> in <code>httpd.conf</code>. This should reside in the <code>conf</code> folder in the Apache folder.</p>
<p>2.	In XAMPP, virtual host declarations are containerised and are specified in &lt;<code>apache_dir&gt;/conf/extra/http-vhosts.conf</code>. In this file you would type the following:</p>
<pre>DocumentRoot "C:/phpwebs/helloworld"
ServerName www.helloworld.com
php_admin_value upload_tmp_dir "C:\tmp"
php_value post_max_size 1500M
php_value upload_max_filesize 1024M
php_admin_value apc.rfc1867 on</pre>
<p>With this method you have complete freedom over which PHP directives you want to set. Valid apache directive syntax can be found at <a href="http://www.php.net/manual/en/configuration.changes.php">http://www.php.net/manual/en/configuration.changes.php</a>.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fconfiguration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis%2F&amp;linkname=Configuration%20methods%20in%20PHP%20to%20enable%20large%20uploads%20on%20a%20per-site%20basis" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fconfiguration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis%2F&amp;linkname=Configuration%20methods%20in%20PHP%20to%20enable%20large%20uploads%20on%20a%20per-site%20basis" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fconfiguration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis%2F&amp;linkname=Configuration%20methods%20in%20PHP%20to%20enable%20large%20uploads%20on%20a%20per-site%20basis" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fconfiguration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis%2F&amp;linkname=Configuration%20methods%20in%20PHP%20to%20enable%20large%20uploads%20on%20a%20per-site%20basis" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fconfiguration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis%2F&amp;linkname=Configuration%20methods%20in%20PHP%20to%20enable%20large%20uploads%20on%20a%20per-site%20basis" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fconfiguration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis%2F&amp;linkname=Configuration%20methods%20in%20PHP%20to%20enable%20large%20uploads%20on%20a%20per-site%20basis" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fconfiguration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis%2F&amp;title=Configuration%20methods%20in%20PHP%20to%20enable%20large%20uploads%20on%20a%20per-site%20basis" id="wpa2a_48">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/OgQSv5LCSlykPe17KuxcUhNCoNE/0/da"><img src="http://feedads.g.doubleclick.net/~a/OgQSv5LCSlykPe17KuxcUhNCoNE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/OgQSv5LCSlykPe17KuxcUhNCoNE/1/da"><img src="http://feedads.g.doubleclick.net/~a/OgQSv5LCSlykPe17KuxcUhNCoNE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/JYIOgHEKwGM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2010/06/configuration-methods-in-php-to-enable-large-uploads-on-a-per-site-basis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What does Word 2010 offer for reference management?</title>
		<link>http://www.paulkiddie.com/2010/06/what-does-word-2010-offer-for-reference-management/</link>
		<comments>http://www.paulkiddie.com/2010/06/what-does-word-2010-offer-for-reference-management/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 13:26:00 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[bibword]]></category>
		<category><![CDATA[jabref]]></category>
		<category><![CDATA[word 2010]]></category>
		<category><![CDATA[reference manager]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=279</guid>
		<description><![CDATA[I&#8217;ve been having a bit of a play with Word 2010 since its release on MSDN to see if any improvements have been made in the area of reference management. Unfortunately it seems not a great deal has changed. So, instead, here&#8217;s a feature wish-list and how you can get by currently on some of the points [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having a bit of a play with Word 2010 since its release on MSDN to see if any improvements have been made in the area of reference management. Unfortunately it seems not a great deal has changed. So, instead, here&#8217;s a feature wish-list and how you can get by currently on some of the points by using Word (both Word 2007 and Word 2010) and some third party tools for all your referencing and citation needs:</p>
<ol>
<li>Support for citing as parenthesised and non-parenthesized references like in LaTeX. Unfortunately Word only supports the former, which is fine when citing references numerically, but it does not provide the flexibility which is important for Harvard author, date referencing. There is no automatic workaround that I am aware of to assist in this.</li>
<li>Search and import citations into the Source Manager via common Internet repositories such as ieeexplore, citeseer, Google Scholar etc, or provide a mechanism by which this functionality can be plugged in. I’m currently using <a href="http://jabref.sourceforge.net">JabRef</a> as my reference manager which provides a search of these libraries.</li>
<li>A larger selection of bibliographic styles provided out of the box. In the meantime, <a href="http://www.codeplex.com/bibword">BibWord</a>, available on Codeplex, has a number of alternative bibliographic styles, including variations of Harvard style referencing.</li>
<li>Make it easier to cite multiple authors within the text. Currently, <a href="http://bibword.codeplex.com/wikipage?title=Styles_FAQ&amp;referringTitle=Documentation#Q13">the process is a little clunky</a>.</li>
<li>Import other bibliographic formats natively. I use <a href="http://jabref.sourceforge.net/">JabRef</a> as a middleman to store citations as it is able to deal with citations in a number of formats (Endnote, .ris, .bib etc). I then export the JabRef library into a Word 2007 XML bibliography. See <a href="http://www.paulkiddie.com/2009/07/jabref-exports-to-word-2007-xml/">my article on how to export a bib using Jabref into XML format</a> in order to read it into Office 2007/2010.</li>
<li>Offer a search when inserting citations so if an author/author tag or some other information about the reference  is known, you can filter the list without having to scroll through a (potentially long) list of citations.</li>
<li>Sort the performance issues when rendering extremely large reference lists. To mitigate any performance issues you can export just the citations you need to Office XML format (see 5.) from within Jabref, rather than your entire library.</li>
</ol>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fwhat-does-word-2010-offer-for-reference-management%2F&amp;linkname=What%20does%20Word%202010%20offer%20for%20reference%20management%3F" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fwhat-does-word-2010-offer-for-reference-management%2F&amp;linkname=What%20does%20Word%202010%20offer%20for%20reference%20management%3F" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fwhat-does-word-2010-offer-for-reference-management%2F&amp;linkname=What%20does%20Word%202010%20offer%20for%20reference%20management%3F" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fwhat-does-word-2010-offer-for-reference-management%2F&amp;linkname=What%20does%20Word%202010%20offer%20for%20reference%20management%3F" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fwhat-does-word-2010-offer-for-reference-management%2F&amp;linkname=What%20does%20Word%202010%20offer%20for%20reference%20management%3F" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fwhat-does-word-2010-offer-for-reference-management%2F&amp;linkname=What%20does%20Word%202010%20offer%20for%20reference%20management%3F" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F06%2Fwhat-does-word-2010-offer-for-reference-management%2F&amp;title=What%20does%20Word%202010%20offer%20for%20reference%20management%3F" id="wpa2a_54">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/AWXxTdwAgOeRHPJBVK0LUJfXsfE/0/da"><img src="http://feedads.g.doubleclick.net/~a/AWXxTdwAgOeRHPJBVK0LUJfXsfE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/AWXxTdwAgOeRHPJBVK0LUJfXsfE/1/da"><img src="http://feedads.g.doubleclick.net/~a/AWXxTdwAgOeRHPJBVK0LUJfXsfE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/g7Oglzd9l4k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2010/06/what-does-word-2010-offer-for-reference-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Alternative PHP Cache (APC) extension in Zend Server CE</title>
		<link>http://www.paulkiddie.com/2010/05/enabling-alternative-php-cache-apc-extension-in-zend-server-ce/</link>
		<comments>http://www.paulkiddie.com/2010/05/enabling-alternative-php-cache-apc-extension-in-zend-server-ce/#comments</comments>
		<pubDate>Thu, 20 May 2010 12:58:35 +0000</pubDate>
		<dc:creator>Paul Kiddie</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[zend server ce]]></category>

		<guid isPermaLink="false">http://www.paulkiddie.com/?p=399</guid>
		<description><![CDATA[I spent a little bit of time yesterday trying to code up a file progress bar for a project requiring large uploads. It seems the best (and the only?) way to do this in PHP is to use an extension called the Alternative PHP Cache, which amongst other things enables file upload status support and [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a little bit of time yesterday trying to code up a file progress bar for a project requiring large uploads. It seems the best (and the only?) way to do this in PHP is to use an extension called the <a href="http://php.net/manual/en/book.apc.php">Alternative PHP Cache</a>, which amongst other things enables file upload status support and specfically enable a switch corresponding to RFC1867 support. I&#8217;m going to show you how I did this using the Zend Server CE PHP stack on a Windows Server 2003 x86 install.</p>
<p>I originally thought that APC was statically compiled into Zend as it pops up in the list of  extensions in the Zend dashboard:</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2010/05/zend-apc.png"><img class="aligncenter size-large wp-image-403" title="zend-apc" src="http://www.paulkiddie.com/wp-content/uploads/2010/05/zend-apc-1024x682.png" alt="" width="1024" height="682" /></a>But, on closer inspection of <code>phpinfo()</code>, there was no reference to any apc directives at all.</p>
<p>So here is how I did it:</p>
<h2>Enabling Alternative PHP Cache (APC) extension in Zend Server CE</h2>
<ol>
<li>Download non-thread safe VC9 APC DLL (I went for <code>php_apc-5.3-nts-svn20100226-vc9-x86.zip</code>) from <a href="http://downloads.php.net/pierre/">http://downloads.php.net/pierre/</a></li>
<li>Unzip it and put the extension dll <code>php_apc.dll</code> into <code>C:\Program Files\Zend\ZendServer\lib\phpext</code> (assuming you left the Zend Server install location as its default)</li>
<li>Add the following to your <code>php.ini</code> (in <code>C:\Program Files\Zend\ZendServer\etc</code>):
<pre>;Enable APC
extension=php_apc.dll
;Enable upload progress bar
apc.rfc1867=on</pre>
</li>
<li>Give Apache/PHP a restart</li>
</ol>
<p>Now check out <code>phpinfo()</code> on the Zend dashboard and you should see something like the following, with apc and the various directives being output in the configuration part of the output.</p>
<p><a href="http://www.paulkiddie.com/wp-content/uploads/2010/05/phpinfo-apc.png"><img class="aligncenter size-large wp-image-404" title="phpinfo-apc" src="http://www.paulkiddie.com/wp-content/uploads/2010/05/phpinfo-apc-1024x682.png" alt="" width="1024" height="682" /></a></p>
<p>Any of the APC file upload progress bar plugins (e.g. <a href="http://www.ibm.com/developerworks/library/os-php-v525/index.html">http://www.ibm.com/developerworks/library/os-php-v525/index.html</a>) should now work.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F05%2Fenabling-alternative-php-cache-apc-extension-in-zend-server-ce%2F&amp;linkname=Enabling%20Alternative%20PHP%20Cache%20%28APC%29%20extension%20in%20Zend%20Server%20CE" title="Digg" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F05%2Fenabling-alternative-php-cache-apc-extension-in-zend-server-ce%2F&amp;linkname=Enabling%20Alternative%20PHP%20Cache%20%28APC%29%20extension%20in%20Zend%20Server%20CE" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F05%2Fenabling-alternative-php-cache-apc-extension-in-zend-server-ce%2F&amp;linkname=Enabling%20Alternative%20PHP%20Cache%20%28APC%29%20extension%20in%20Zend%20Server%20CE" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F05%2Fenabling-alternative-php-cache-apc-extension-in-zend-server-ce%2F&amp;linkname=Enabling%20Alternative%20PHP%20Cache%20%28APC%29%20extension%20in%20Zend%20Server%20CE" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F05%2Fenabling-alternative-php-cache-apc-extension-in-zend-server-ce%2F&amp;linkname=Enabling%20Alternative%20PHP%20Cache%20%28APC%29%20extension%20in%20Zend%20Server%20CE" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_google_buzz" href="http://www.addtoany.com/add_to/google_buzz?linkurl=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F05%2Fenabling-alternative-php-cache-apc-extension-in-zend-server-ce%2F&amp;linkname=Enabling%20Alternative%20PHP%20Cache%20%28APC%29%20extension%20in%20Zend%20Server%20CE" title="Google Buzz" rel="nofollow" target="_blank"><img src="http://www.paulkiddie.com/wp-content/plugins/add-to-any/icons/google_buzz.png" width="16" height="16" alt="Google Buzz"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.paulkiddie.com%2F2010%2F05%2Fenabling-alternative-php-cache-apc-extension-in-zend-server-ce%2F&amp;title=Enabling%20Alternative%20PHP%20Cache%20%28APC%29%20extension%20in%20Zend%20Server%20CE" id="wpa2a_60">Bookmark</a></p>
<p><a href="http://feedads.g.doubleclick.net/~a/BfOqJFMsZDJiYnw-UJ-FSZPnyso/0/da"><img src="http://feedads.g.doubleclick.net/~a/BfOqJFMsZDJiYnw-UJ-FSZPnyso/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BfOqJFMsZDJiYnw-UJ-FSZPnyso/1/da"><img src="http://feedads.g.doubleclick.net/~a/BfOqJFMsZDJiYnw-UJ-FSZPnyso/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/PaulKiddiesBlog/~4/lDWsWhwGYsw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.paulkiddie.com/2010/05/enabling-alternative-php-cache-apc-extension-in-zend-server-ce/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.paulkiddie.com @ 2012-05-17 19:18:48 -->

