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

<channel>
	<title>blog.richardramdat.com &#187; Development</title>
	<atom:link href="http://blog.richardramdat.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.richardramdat.com</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 01:49:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Code 10145 LEFT_SUBFIELD only supports Object</title>
		<link>http://blog.richardramdat.com/2012/01/code-10145-left_subfield-only-supports-object/</link>
		<comments>http://blog.richardramdat.com/2012/01/code-10145-left_subfield-only-supports-object/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 01:49:08 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=341</guid>
		<description><![CDATA[Got this error trying to update a field in a mongodb collection. Turns out I was previously using the same field to store object Ids. Now that I&#8217;m trying to repurpose the field to store a different datatype, mongo throws an error. Solution was to remove the old field completely from all documents within the [...]]]></description>
			<content:encoded><![CDATA[<p>Got this error trying to update a field in a mongodb collection. Turns out I was previously using the same field to store object Ids. Now that I&#8217;m trying to repurpose the field to store a different datatype, mongo throws an error. Solution was to remove the old field completely from all documents within the collection using the unset command. With no documents having this field, mongo was able to append the new field with the new data type.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2012/01/code-10145-left_subfield-only-supports-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find the current version of installed packages using NPM</title>
		<link>http://blog.richardramdat.com/2011/05/find-the-current-version-of-installed-packages-using-npm/</link>
		<comments>http://blog.richardramdat.com/2011/05/find-the-current-version-of-installed-packages-using-npm/#comments</comments>
		<pubDate>Sun, 15 May 2011 06:25:29 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[npm]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=282</guid>
		<description><![CDATA[Things change quickly in the world of node development, you&#8217;re usually working with a lot of different modules within your projects. Fortunately there&#8217;s a great package manager that most node developers used called NPM. It makes installing and updating dependencies in your environment fairly simple. At anytime you can see a list of installed packages [...]]]></description>
			<content:encoded><![CDATA[<p>Things change quickly in the world of node development, you&#8217;re usually working with a lot of different modules within your projects. Fortunately there&#8217;s a great package manager that most node developers used called <a href="http://npmjs.org/">NPM</a>. It makes installing and updating dependencies in your environment fairly simple. At anytime you can see a list of installed packages and their version number using:</p>
<p><code>npm ls installed</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2011/05/find-the-current-version-of-installed-packages-using-npm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MongooseJS Validation</title>
		<link>http://blog.richardramdat.com/2011/05/mongoosejs-validation/</link>
		<comments>http://blog.richardramdat.com/2011/05/mongoosejs-validation/#comments</comments>
		<pubDate>Sun, 15 May 2011 06:12:33 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[mongoose]]></category>
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=276</guid>
		<description><![CDATA[The docs on MongooseJS can be really unclear at times, here are some pointers on validation that may help (note this is valid as of MongooseJS 1.3.3)
Making a field unique:

var User = new Schema({
email: { index: {unique: true} }
});

Note: If your collection exists in Mongo, you need to drop the collection before schema changes kick [...]]]></description>
			<content:encoded><![CDATA[<p>The docs on MongooseJS can be really unclear at times, here are some pointers on validation that may help (note this is valid as of MongooseJS 1.3.3)</p>
<p>Making a field unique:</p>
<p><code><br />
var User = new Schema({<br />
email: { index: {unique: true} }<br />
});<br />
</code><br />
<strong>Note:</strong> If your collection exists in Mongo, you need to drop the collection before schema changes kick in. Otherwise, you&#8217;ll see duplicated fields and wonder why it doesn&#8217;t work. If all is working, when you call User.save(), Mongoose will throw an error such as &#8211; &#8216;E11000 duplicate key error index: &#8230;&#8217; if the field is duplicated.</p>
<p>Validating a schema field:</p>
<p>When defining a field you can do some basic validation through Mongoose, such as indicating a max or min for numbers, specifying the field is required, or matching to a regular expression. For more advanced validation you can provide a call to function which is evaluated after any defaults for a field is applied. In almost all instances, validating through a function seems to be the most robust approach, even for checking a required field, regex, or max/min values. Assuming you already defined a validation function for your schema field, you can associate it two ways,</p>
<p><code><br />
var User = new Schema({<br />
email: { index: { unique: true }, validate: [ isValidEmail, 'Please provide a valid email' }<br />
});<br />
</code></p>
<p>or</p>
<p><code><br />
User.path('email').validate( isValidEmail(value), 'Please provide a valid email' );<br />
</code></p>
<p>Validating a virtual schema field:</p>
<p>If you are using virtuals within a schema, it would be nice to validate them from the model. There are a couple approaches that won&#8217;t work. Chaining a .validate function onto a virtual schema field definition, throws a compiler error when launching node. Likewise, attempting to attach a .validate function using Schema.path() will also fail as virtuals are not accessible using path(). The best solution is to use middleware from within the model to validate the virtual attribute.</p>
<p><code><br />
User.pre('save', function (next) {<br />
if (this.virtualfield) {<br />
next ( new Error('This field is required.') );<br />
} else {<br />
next ();<br />
}<br />
});<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2011/05/mongoosejs-validation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extract WSP from SharePoint MOSS Solution Store</title>
		<link>http://blog.richardramdat.com/2010/10/extract-wsp-from-sharepoint-moss-solution-store/</link>
		<comments>http://blog.richardramdat.com/2010/10/extract-wsp-from-sharepoint-moss-solution-store/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 20:42:44 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=214</guid>
		<description><![CDATA[Need to deploy a WSP to a new SharePoint 2007 server but don&#8217;t have an archive of it? The following utility allows you to extract a specific or all WSPs packages installed on a SharePoint farm and save them to disk where you can redeploy it to another server. Very useful -
http://code.msdn.microsoft.com/SPSolutionExtractor
Be wary though &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Need to deploy a WSP to a new SharePoint 2007 server but don&#8217;t have an archive of it? The following utility allows you to extract a specific or all WSPs packages installed on a SharePoint farm and save them to disk where you can redeploy it to another server. Very useful -</p>
<p><a href="http://code.msdn.microsoft.com/SPSolutionExtractor">http://code.msdn.microsoft.com/SPSolutionExtractor</a></p>
<p>Be wary though &#8211; the author of this tool doesn&#8217;t seem familar with command line tools.  Not only is the executable&#8217;s name far too wordy, certain menus and prompts seem to lack polish, however it does get the job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2010/10/extract-wsp-from-sharepoint-moss-solution-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global Assembly Cache (GAC) Compare</title>
		<link>http://blog.richardramdat.com/2010/06/global-assembly-cache-gac-compare/</link>
		<comments>http://blog.richardramdat.com/2010/06/global-assembly-cache-gac-compare/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 15:16:41 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=209</guid>
		<description><![CDATA[If you&#8217;re doing SharePoint development then you&#8217;ve no doubt heard of the GAC, or Global Assembly Cache (c:\windows\assembly) where compiled assemblies are deployed. In a SharePoint farm with several front-ends, you may occasionally find a server with a missing DLL or the wrong version of the assembly.
The following tool makes quick work of trying to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re doing SharePoint development then you&#8217;ve no doubt heard of the GAC, or Global Assembly Cache (c:\windows\assembly) where compiled assemblies are deployed. In a SharePoint farm with several front-ends, you may occasionally find a server with a missing DLL or the wrong version of the assembly.</p>
<p>The following tool makes quick work of trying to find differences in the GAC for remote servers and evens offers up a nifty HTML report. Very nicely done.</p>
<p><a href="http://gaccompare.codeplex.com/">http://gaccompare.codeplex.com/</a></p>
<p>A couple things &#8211; you need to have Admin rights on the remote computers, the tool does take a while to do the compare (so be patient) and to get the HTML report and other cool features, right-click in the results pane after it has loaded.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2010/06/global-assembly-cache-gac-compare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>W3wp.exe Associate Process ID with Application Pool</title>
		<link>http://blog.richardramdat.com/2010/06/w3wp-exe-associate-process-id-with-application-pool/</link>
		<comments>http://blog.richardramdat.com/2010/06/w3wp-exe-associate-process-id-with-application-pool/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 22:12:57 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=206</guid>
		<description><![CDATA[If you noticed your website is running slow, probably one of the first things you do is log into your web server, open Task Manager and check what&#8217;s going on. Usually you will see a process called w3wp.exe (or several instances of it) running and using high cpu utilization.
W3wp.exe is the worker process that Internet [...]]]></description>
			<content:encoded><![CDATA[<p>If you noticed your website is running slow, probably one of the first things you do is log into your web server, open Task Manager and check what&#8217;s going on. Usually you will see a process called w3wp.exe (or several instances of it) running and using high cpu utilization.</p>
<p>W3wp.exe is the worker process that Internet Information Services (IIS) uses for the application pools on your site. Each application pool, is assigned a separate worker process. That way an exception or crash in one of your application pools doesn&#8217;t affect other sites running in a different app pool.</p>
<p>To identify which w3wp process belongs to which application pool, here is what you will need to do. <strong>NOTE: this is specific for IIS 7.</strong></p>
<p>In Task Manager, switch to the Processes tab. From the top menu, click on View and then Select Columns&#8230;, ensure that PID (Process Identifier) is checked.</p>
<p>Now open a command window (Start -&gt; Run -&gt; cmd.exe) and change directory to the following path,</p>
<p><strong>cd c:\windows\system32\inetsrv</strong></p>
<p>*notice that inetsrv may be<strong> inetsrv32</strong> or<strong> inetsrv64</strong> depending on your specific version of Windows Server.</p>
<p>Once in this directory, type the following:</p>
<p><strong>appcmd list wp</strong></p>
<p>The output will appear with the Process ID (PID from Task Manager) and the associated application pool belonging to it.</p>
<p>Another helpful command is: <strong>appcmd list requests</strong></p>
<p>This will list all current requests and other useful information, such as time in milliseconds to help you identify long running requests.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2010/06/w3wp-exe-associate-process-id-with-application-pool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS 7 Worker Processes &#8211; Category does not exist</title>
		<link>http://blog.richardramdat.com/2010/06/iis-7-worker-processes-category-does-not-exist/</link>
		<comments>http://blog.richardramdat.com/2010/06/iis-7-worker-processes-category-does-not-exist/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 21:57:47 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=204</guid>
		<description><![CDATA[In my last post, I mentioned the Internet Information Services (IIS) Manager feature called Worker Processes, and explained how you can use it to glean information into high cpu utilization for the w3wp.exe process(es) running on your server. If you followed the steps and got the following error: &#8220;There was an error while performing this [...]]]></description>
			<content:encoded><![CDATA[<p>In my<a href="/2010/06/iis-7-worker-processes/"> last post</a>, I mentioned the Internet Information Services (IIS) Manager feature called <strong>Worker Processes</strong>, and explained how you can use it to glean information into high cpu utilization for the w3wp.exe process(es) running on your server. If you followed the steps and got the following error: &#8220;There was an error while performing this operation. Details: Category does not exist.&#8221; Here is what you can do to resolve the issue.</p>
<p>The issue stems from the performance counters on the server being disabled. To verify &#8211; run the following at the command line,</p>
<p>lodctr /q:PerfProc</p>
<p>If you see the following,</p>
<p>[PerfProc] Performance Counters (Disabled)</p>
<p>The performance counters are not running. To activate them, run the following command,</p>
<p>lodctr /e:PerfProc</p>
<p>Once done, close any instances of the IIS Manager that you had open. Reopen IIS Manager, and you should now see the Worker Processes feature.</p>
<p>Thanks to the following for information about this issue:</p>
<p><a href="http://bit.ly/b9yhrV">http://bit.ly/b9yhrV</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2010/06/iis-7-worker-processes-category-does-not-exist/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SharePoint Error Delete Site WebDeleted.aspx File Not Found</title>
		<link>http://blog.richardramdat.com/2010/01/sharepoint-error-delete-site-webdeleted-aspx-file-not-found/</link>
		<comments>http://blog.richardramdat.com/2010/01/sharepoint-error-delete-site-webdeleted-aspx-file-not-found/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 21:21:00 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=196</guid>
		<description><![CDATA[We had several  users reporting an error when deleting a SharePoint team site. The error appears as a &#8220;File Not Found.&#8221; on the WebDeleted.aspx layout page along with a stack trace. It appears that the problem stems from our custom master page. For our implementation we use a custom HttpModule that redirects incoming requests for [...]]]></description>
			<content:encoded><![CDATA[<p>We had several  users reporting an error when deleting a SharePoint team site. The error appears as a &#8220;File Not Found.&#8221; on the WebDeleted.aspx layout page along with a stack trace. It appears that the problem stems from our custom master page. For our implementation we use a custom HttpModule that redirects incoming requests for a master page to virtualized custom master pages that we maintain.</p>
<p>The WebDeleted.aspx page references the simple.master page which we redirect to our customized application master page. Apparently this results in the page trying to load in elements that are out of context for it. The solution was to stop redirecting simple.master and instead route it back to the SharePoint out of the box simple.master.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2010/01/sharepoint-error-delete-site-webdeleted-aspx-file-not-found/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SharePoint CAML Query Date</title>
		<link>http://blog.richardramdat.com/2010/01/sharepoint-caml-query-date/</link>
		<comments>http://blog.richardramdat.com/2010/01/sharepoint-caml-query-date/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 20:13:32 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=193</guid>
		<description><![CDATA[For the past two SharePoint implementations that I&#8217;ve worked with, it was a common business requirement to query from a list to retrieve items that should be displayed on a &#8220;scheduled&#8221; basis. Think along the lines of an alert or announcement. Typically what I end doing is create a custom list and add the following [...]]]></description>
			<content:encoded><![CDATA[<p>For the past two SharePoint implementations that I&#8217;ve worked with, it was a common business requirement to query from a list to retrieve items that should be displayed on a &#8220;scheduled&#8221; basis. Think along the lines of an alert or announcement. Typically what I end doing is create a custom list and add the following three fields, &#8220;StartTime&#8221;, &#8220;EndTime&#8221; and &#8220;Active&#8221;. Start and End Time are the fields for scheduling the list item. I make them a Date+Time field and also allow them to be optionally be null, this way someone can create an open ended item that starts at a specific time but has no specified End Time. The Active field is a simple yes/no that is a convenient kill-switch or safety check.</p>
<p>So with the three columns, the following CAML query can be used to query items that should be currently displayed:</p>
<textarea cols="40" rows="10" name="code" class="Xml">        <Where>
          <And>
            <And>
              <Or>
                <Leq>
                  <FieldRef Name='StartTime' />
                  <Value Type='DateTime' IncludeTimeValue='True'>
                    <Today />
                  </Value>
                </Leq>
                <IsNull>
                  <FieldRef Name='StartTime' />
                </IsNull>
              </Or>
              <Or>
                <Gt>
                  <FieldRef Name='EndTime' />
                  <Value Type='DateTime' IncludeTimeValue='True'>
                    <Today />
                  </Value>
                </Gt>
                <IsNull>
                  <FieldRef Name='EndTime' />
                </IsNull>
              </Or>
            </And>
            <Eq>
              <FieldRef Name='Active' />
              <Value Type='Boolean'>1</Value>
            </Eq>
          </And>
        </Where>
        <OrderBy>
          <FieldRef Name='Modified' Ascending='False' />
        </OrderBy></textarea>
	<!-- Wordpress Code Snippet -->
	<script type="text/javascript" src="http://blog.richardramdat.com/wp-content/plugins/wordpress-code-snippet/js/shCore.js"></script><script type="text/javascript" src="http://blog.richardramdat.com/wp-content/plugins/wordpress-code-snippet/js/shBrushXml.js"></script>
	<link type="text/css" rel="stylesheet" href="http://blog.richardramdat.com/wp-content/plugins/wordpress-code-snippet/css/SyntaxHighlighter.css"/>
	
	<script language="javascript">
	dp.SyntaxHighlighter.ClipboardSwf = 'http://blog.richardramdat.com/wp-content/plugins/wordpress-code-snippet/js/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	</script>
	<!-- End Wordpress Code Snippet -->
	]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2010/01/sharepoint-caml-query-date/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Determine if SPListItem belongs to a document library</title>
		<link>http://blog.richardramdat.com/2010/01/determine-if-splistitem-belongs-to-a-document-library/</link>
		<comments>http://blog.richardramdat.com/2010/01/determine-if-splistitem-belongs-to-a-document-library/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 05:07:48 +0000</pubDate>
		<dc:creator>richard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.richardramdat.com/?p=187</guid>
		<description><![CDATA[So you have an instance of a SPListItem and want to know whether this item belongs to a Document Library or if it came from a list (such as an Event Calender, Survey, or Custom List). A quick way to distinguish a document library item is to access the ParentList property of the SPListItem class and examine [...]]]></description>
			<content:encoded><![CDATA[<p>So you have an instance of a SPListItem and want to know whether this item belongs to a Document Library or if it came from a list (such as an Event Calender, Survey, or Custom List). A quick way to distinguish a document library item is to access the ParentList property of the SPListItem class and examine the BaseType. In code,</p>
<p>SPListItem item = GetItemFromSomeWhere();</p>
<p>if (item.ParentList.BaseType == SPBaseType.DocumentLibrary)</p>
<p>{</p>
<p>// This item is from a document library &#8211; it probably contains a file.</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.richardramdat.com/2010/01/determine-if-splistitem-belongs-to-a-document-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

