<?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>To Hell in a Handbasket &#187; Programming</title>
	<atom:link href="http://ericsilva.org/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://ericsilva.org</link>
	<description>General Views, Opinions, and Observations in the World Around Me by Eric Silva</description>
	<lastBuildDate>Mon, 05 Sep 2011 13:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Code Review Does Not Have to Suck</title>
		<link>http://ericsilva.org/2011/02/24/code-review-does-not-have-to-suck/</link>
		<comments>http://ericsilva.org/2011/02/24/code-review-does-not-have-to-suck/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 17:49:12 +0000</pubDate>
		<dc:creator>Eric Silva</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CodeCollaborator]]></category>
		<category><![CDATA[Crucible]]></category>
		<category><![CDATA[Kiln]]></category>
		<category><![CDATA[Peer Code Review]]></category>
		<category><![CDATA[SmartBear]]></category>

		<guid isPermaLink="false">http://ericsilva.org/?p=453</guid>
		<description><![CDATA[I have been using this saying for the last 6 years, &#8220;Code Review Does Not Have to Suck&#8221;.  I just saw today that SmartBear, who makes the wonderful CodeCollaborator peer code review tool, which I also use, released a quick 3-minute video explaining this. Peer code review is a critical milestone step in any good [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using this saying for the last 6 years, &#8220;Code Review Does Not Have to Suck&#8221;.  I just saw today that SmartBear, who makes the wonderful <a href="http://smartbear.com/products/development-tools/code-review/features/">CodeCollaborator</a> peer code review tool, which I also use, released <a href="http://smartbear.com/support/screencasts/codecollaborator/not-suck-ad">a quick 3-minute video</a> explaining this.</p>
<p>Peer code review is a critical milestone step in any good development process; especially with distributed teams.  <a href="http://smartbear.com/products/development-tools/code-review/features/">CodeCollaborator</a>, <a href="http://www.atlassian.com/software/crucible/">Crucible</a>, and <a href="http://www.fogcreek.com/kiln/">Kiln</a> are all great tools for facilitating peer code review without having to go through all the headache of gathering files, scheduling meetings, pissing off your co-workers, etc.</p>
<p>Check out the <a href="http://smartbear.com/support/screencasts/codecollaborator/not-suck-ad">video</a>.  It&#8217;s worth the 3-minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericsilva.org/2011/02/24/code-review-does-not-have-to-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Design a Good API and Why It Matters</title>
		<link>http://ericsilva.org/2011/02/04/how-to-design-a-good-api-and-why-it-matters/</link>
		<comments>http://ericsilva.org/2011/02/04/how-to-design-a-good-api-and-why-it-matters/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 16:48:07 +0000</pubDate>
		<dc:creator>Eric Silva</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[LinkedIn]]></category>

		<guid isPermaLink="false">http://ericsilva.org/2011/02/04/how-to-design-a-good-api-and-why-it-matters/</guid>
		<description><![CDATA[I am starting to design a new API for an application that will need to integrate with other applications. Before doing so, I always make it a point to re-watch and re-read this presentation given by Joshua Bloch from Google.&#160; Joshua does a fantastic job going over the DOs and DON’Ts of good API design. [...]]]></description>
			<content:encoded><![CDATA[<p>I am starting to design a new API for an application that will need to integrate with other applications.</p>
<p>Before doing so, I always make it a point to re-watch and re-read this presentation given by <a href="http://en.wikipedia.org/wiki/Joshua_Bloch">Joshua Bloch</a> from Google.&#160; Joshua does a fantastic job going over the DOs and DON’Ts of good API design.</p>
<p>&#160;</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:472f067b-2ac2-4e4c-8c60-90c39537f3de" class="wlWriterEditableSmartContent">
<div><object width="448" height="252"><param name="movie" value="http://www.youtube.com/v/aAb7hSCtvGw?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/aAb7hSCtvGw?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"></embed></object></div>
<div style="width:448px;clear:both;font-size:.8em">Joshua Bloch Presentation on API Design</div>
</div>
<p>&#160;</p>
<p>You can also download the slides <a href="http://lcsd05.cs.tamu.edu/slides/keynote.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ericsilva.org/2011/02/04/how-to-design-a-good-api-and-why-it-matters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Bulk File Move Script</title>
		<link>http://ericsilva.org/2009/10/13/windows-bulk-file-move-script/</link>
		<comments>http://ericsilva.org/2009/10/13/windows-bulk-file-move-script/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 16:37:41 +0000</pubDate>
		<dc:creator>Eric Silva</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[wsh]]></category>

		<guid isPermaLink="false">http://ericsilva.org/?p=316</guid>
		<description><![CDATA[We have some applications that leave files sitting in a folder location out on some file server.  Eventually the disk space gets used up, or Windows starts choking because there are too many files in a directory, etc.  To delete the &#8216;old&#8217; files, a support technician will try to connect to the file share, sort [...]]]></description>
			<content:encoded><![CDATA[<p>We have some applications that leave files sitting in a folder location out on some file server.  Eventually the disk space gets used up, or Windows starts choking because there are too many files in a directory, etc.  To delete the &#8216;old&#8217; files, a support technician will try to connect to the file share, sort the files by date, and delete the files within a date range, e.g., older than a year.</p>
<p><span style="background-color: #ffffff;">What can happen, especially on a Window server, is that the operating system will attempt to load all the file information into memory, so that you can see it, and then tell it to sort all those files by date, which in turn, increases the time and memory needed by the OS to accomplish this.  If the file size/quantity is too great, the problem that caused you to want to clean up the disk space will reappear and choke Windows once more.</span></p>
<p><span style="background-color: #ffffff;">After going through this more than twice, I decided to write a JavaScript and execute it using the <a href="http://en.wikipedia.org/wiki/Windows_Script_Host" target="_blank">Windows Scripting Host (WSH)</a>.  The script performs very well and was able to iterate through a directory of 700,000+ files in a matter of an hour.  This was including the log statements from being enabled.  Disabling the &#8216;Echo&#8217; statements may increase performance.</span></p>
<p><span style="background-color: #ffffff;">Here is the script:</span></p>
<pre class="brush: jscript; gutter: true; title: ; toolbar: true; notranslate">
var fso = new ActiveXObject('Scripting.FileSystemObject');
var argArray = new Array(WScript.Arguments.Named(&quot;src&quot;), WScript.Arguments.Named(&quot;s&quot;), &quot;.&quot;);
var inSrcDirName = coalesceArray(argArray);

argArray = new Array(WScript.Arguments.Named(&quot;dest&quot;), WScript.Arguments.Named(&quot;d&quot;));
var archiveDir = coalesceArray(argArray);

argArray = new Array(WScript.Arguments.Named(&quot;year&quot;), WScript.Arguments.Named(&quot;y&quot;));
var beforeYear = coalesceArray(argArray);

if (archiveDir != null) {
	if (!fso.FolderExists(archiveDir)) {
		fso.CreateFolder(archiveDir);
	} else {
		fso.CreateFolder(archiveDir + &quot;1&quot;);
	}
}

var gfldr = fso.GetFolder(inSrcDirName);

ArchiveFiles(gfldr);

function ArchiveFiles(fldr) {
	var i, bias;

	WScript.Echo(&quot;Loading all files...&quot;);
	for (files = new Enumerator(fldr.files); !files.atEnd(); files.moveNext()) {
		f = files.item();
		dt = new Date(f.DateCreated);
		bias = dt.getTimezoneOffset();

		dt.setMinutes(dt.getMinutes() - bias);

		fileYear = dt.getFullYear();
		//WScript.Echo(f.Name + &quot;:&quot; + fileYear);
		if (beforeYear &gt; fileYear) {
			WScript.Echo(&quot;Moving \&quot;&quot; + f.Name + &quot;\&quot; with year &quot; + fileYear + &quot; to &quot; + archiveDir);
			f.Move(archiveDir+&quot;\\&quot; + f.Name)
		} else {
			WScript.Echo(&quot;Skipping \&quot;&quot; + f.Name + &quot;\&quot; with year &quot; + fileYear);
		}
	}
	WScript.Echo(&quot;Done loading files.&quot;);

}

function coalesceArray(arr) {
	var i;
	for (i = 0; i &lt; arr.length; i++) {
		if (arr[i] != null) {
			return arr[i];
		}
	}
	return null;
}
</pre>
<p><span style="background-color: #ffffff;">Executing the script is performed by passing a source directory, destination directory (to move the files to), and a year to mark the year that all files must be equal to or younger than to not be moved as parameters.</span></p>
<p><span style="background-color: #ffffff;">Example:</span></p>
<pre class="brush: plain; gutter: false; light: true; title: ; toolbar: false; notranslate">cscript movefiles.js /s:c:\myapp\data /d:c:\backup\archive_2006 /y:2007</pre>
<p><span style="background-color: #ffffff;">This will move all files from the c:\myapp\data folder that were created before January 1, 2007 to the c:\backup\archive_2006 folder.  The script can be easily modified to use the &#8216;modified&#8217; or &#8216;accessed&#8217; date instead.</span></p>
<p><span style="background-color: #ffffff;">Hope this helps someone else as much as it helped me.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://ericsilva.org/2009/10/13/windows-bulk-file-move-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

