<?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>17 of 26 &#187; Development Projects</title>
	<atom:link href="http://17of26.com/category/development-projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://17of26.com</link>
	<description>the world of programming and technology</description>
	<lastBuildDate>Fri, 11 Dec 2009 01:29:05 +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>eHow Earnings Tracker Version 1.1.0 Available</title>
		<link>http://17of26.com/2009/11/ehow-earnings-tracker-version-1-1-0-available/</link>
		<comments>http://17of26.com/2009/11/ehow-earnings-tracker-version-1-1-0-available/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 20:11:16 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[eHow]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=407</guid>
		<description><![CDATA[Version 1.1.0 of the eHow Earnings Tracker is available on the downloads page.  Changes are as follows:
* Changed error message &#8220;This is not an eHow Earnings page!&#8221; to &#8220;The eHow Earnings Tracker must be run from your Article Library (the &#8216;Articles&#8217; tab under &#8216;My Profile&#8217;)&#8221;
* Added &#8220;Update Earnings using Yesterday&#8217;s Date&#8221; menu option.  This is [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.1.0 of the eHow Earnings Tracker is available on the <a href="../downloads/">downloads</a> page.  Changes are as follows:</p>
<p>* Changed error message &#8220;This is not an eHow Earnings page!&#8221; to &#8220;The eHow Earnings Tracker must be run from your Article Library (the &#8216;Articles&#8217; tab under &#8216;My Profile&#8217;)&#8221;<br />
* Added &#8220;Update Earnings using Yesterday&#8217;s Date&#8221; menu option.  This is useful if you didn&#8217;t get a chance to run the Tracker yesterday but you know that the earnings haven&#8217;t yet updated today.<br />
* Added &#8220;Average of X per day&#8221; for both earnings and views.  Note that this average is over the selected date range.</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/11/ehow-earnings-tracker-version-1-1-0-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eHow Earnings Tracker Version 1.0.2 Available</title>
		<link>http://17of26.com/2009/10/ehow-earnings-tracker-version-1-0-2-available/</link>
		<comments>http://17of26.com/2009/10/ehow-earnings-tracker-version-1-0-2-available/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 03:10:19 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[eHow]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=400</guid>
		<description><![CDATA[Version 1.0.2 of the eHow Earnings Tracker is available on the downloads page.  There&#8217;s only one change in this version:
* &#8220;Change from previous day&#8221; values now take deleted articles into account so there are no longer negative changes.
]]></description>
			<content:encoded><![CDATA[<p>Version 1.0.2 of the eHow Earnings Tracker is available on the <a href="http://17of26.com/downloads/">downloads</a> page.  There&#8217;s only one change in this version:</p>
<p>* &#8220;Change from previous day&#8221; values now take deleted articles into account so there are no longer negative changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/10/ehow-earnings-tracker-version-1-0-2-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development Project : Hello, Internet!</title>
		<link>http://17of26.com/2009/09/development-project-hello-internet/</link>
		<comments>http://17of26.com/2009/09/development-project-hello-internet/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 03:35:14 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[Hello, Internet!]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=354</guid>
		<description><![CDATA[One task that every home computer user needs to do from time to time is to troubleshoot their internet connection.  Even for computer savvy users this task can be a bit of a chore.  A web page isn&#8217;t loading &#8211; is the problem with the website?  Is it my computer? Is it my router?  Is [...]]]></description>
			<content:encoded><![CDATA[<p>One task that every home computer user needs to do from time to time is to troubleshoot their internet connection.  Even for computer savvy users this task can be a bit of a chore.  A web page isn&#8217;t loading &#8211; is the problem with the website?  Is it my computer? Is it my router?  Is it my cable/dsl modem?  Is it my ISP?  Is it none of the above?  For inexperienced users, trying to resolve the problem can be overwhelming.</p>
<p>Finding the source of a network connection problem often requires one of more of the following:</p>
<ul>
<li>Run ipconfig from the command line</li>
<li>Run tracert from the command line</li>
<li>Checking various properties in Control Panel</li>
<li>Restarting the network card</li>
<li>Rebooting the computer</li>
<li>Contacting the ISP</li>
</ul>
<p>Not only does a user need to know about how run several different tools, they also have to know how to interpret the results.  My goal is to write a single application that will be able to walk the user through (and perform when possible) all of the troubleshooting steps needed to diagnose a broken network connection.</p>
<p>The requirements for the application are as follows:</p>
<ul>
<li>Provide a streamlined interface and detailed information for advanced users</li>
<li>Walk novice users through the troubleshooting steps &#8211; explain the results and suggest steps to take to resolve the problem</li>
<li>Educate users that are interested in learning more by explaining various network terms and describing what test results mean and explain why resolutions are suggested</li>
</ul>
<p>I would really like this application to be something that is useful for everyone.  Too many tools are targeted solely at users who already know what they&#8217;re doing.</p>
<p>The idea here is that advanced users (like me)  will be able to do network troubleshooting by running one tool instead of several.  Novice users will be able to do their own troubleshooting and not have to bother computer savvy friends or relatives every time their network connection goes south <img src='http://17of26.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>If you have any comments, questions, or would like to participate in beta testing when it&#8217;s ready then head over to the <a href="http://17of26.com/forum/viewforum.php?f=13">forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/09/development-project-hello-internet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and Running the eHow Earnings Tracker</title>
		<link>http://17of26.com/2009/08/installing-and-running-the-ehow-earnings-tracker/</link>
		<comments>http://17of26.com/2009/08/installing-and-running-the-ehow-earnings-tracker/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 00:47:51 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[eHow]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=326</guid>
		<description><![CDATA[To install the eHow Earnings Tracker, click on this link.  That will take you to the following page:

Because the add-on hasn&#8217;t yet gone through the approval process to make it public, you need to check the box next to &#8220;Let me install this experimental add-on&#8221;.  That will enable the &#8220;Add to Firefox&#8221; button:

Click on &#8220;Add [...]]]></description>
			<content:encoded><![CDATA[<p>To install the eHow Earnings Tracker, click on <a href="https://addons.mozilla.org/en-US/firefox/addon/12941">this link</a>.  That will take you to the following page:</p>
<p><img class="aligncenter size-large wp-image-327" title="install1" src="http://17of26.com/wp-content/uploads/2009/08/install1-1024x786.png" alt="install1" width="1024" height="786" /></p>
<p>Because the add-on hasn&#8217;t yet gone through the approval process to make it public, you need to check the box next to &#8220;Let me install this experimental add-on&#8221;.  That will enable the &#8220;Add to Firefox&#8221; button:</p>
<p><img class="aligncenter size-full wp-image-328" title="let me install" src="http://17of26.com/wp-content/uploads/2009/08/let-me-install.png" alt="let me install" width="310" height="93" /></p>
<p>Click on &#8220;Add to Firefox&#8221; and you will be taken to the &#8220;please donate&#8221; page:</p>
<p><img class="aligncenter size-large wp-image-329" title="roadblock" src="http://17of26.com/wp-content/uploads/2009/08/roadblock-1024x659.png" alt="roadblock" width="1024" height="659" /></p>
<p>Once again, click on the checkbox and then &#8220;Add to Firefox&#8221;.  That will take you to the end user license agreement:</p>
<p><img class="aligncenter size-full wp-image-330" title="license agreement" src="http://17of26.com/wp-content/uploads/2009/08/license-agreement.png" alt="license agreement" width="743" height="641" /></p>
<p>Click on &#8220;Accept and Install&#8221; and you will get the Software Installation dialog:</p>
<p><img class="aligncenter size-full wp-image-331" title="install dialog" src="http://17of26.com/wp-content/uploads/2009/08/install-dialog.png" alt="install dialog" width="557" height="377" /></p>
<p>Click on &#8220;Install Now&#8221; and the tracker will be installed.  After installation, you will be prompted to restart Firefox:</p>
<p><img class="aligncenter size-full wp-image-332" title="restart" src="http://17of26.com/wp-content/uploads/2009/08/restart.png" alt="restart" width="520" height="380" /></p>
<p>Click on &#8220;Restart Firefox&#8221;.  After Firefox restarts, you should see a dialog box telling you that the tracker was installed:</p>
<p><img class="aligncenter size-full wp-image-333" title="add on has been installed" src="http://17of26.com/wp-content/uploads/2009/08/add-on-has-been-installed.png" alt="add on has been installed" width="520" height="380" /></p>
<p>The eHow Earnings Tracker has now been installed, so close the dialog box show above and log onto your eHow account.  Go to &#8220;My Profile&#8221; and then click on the &#8220;Articles&#8221; tab:</p>
<p><img class="aligncenter size-full wp-image-334" title="ehow page" src="http://17of26.com/wp-content/uploads/2009/08/ehow-page.png" alt="ehow page" width="892" height="727" /></p>
<p>Now you can run the tracker by going to Tools &#8211; eHow Earnings Tracker &#8211; Update Earnings or by right-clicking somewhere on the page:</p>
<p><img class="aligncenter size-full wp-image-335" title="tracker menu" src="http://17of26.com/wp-content/uploads/2009/08/tracker-menu.png" alt="tracker menu" width="887" height="456" /></p>
<p>You should see the screen flash a few times as the tracker navigates through your article library.  When the tracker is finished, it will open a new window with your earnings data in it:</p>
<p><img class="aligncenter size-full wp-image-336" title="tracker run" src="http://17of26.com/wp-content/uploads/2009/08/tracker-run.png" alt="tracker run" width="956" height="858" /></p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/08/installing-and-running-the-ehow-earnings-tracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eHow Earnings Tracker Version 1.0.1 Available</title>
		<link>http://17of26.com/2009/08/ehow-earnings-tracker-version-1-0-1-available/</link>
		<comments>http://17of26.com/2009/08/ehow-earnings-tracker-version-1-0-1-available/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 02:32:16 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[eHow]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=322</guid>
		<description><![CDATA[Version 1.0.1 of the eHow Earnings Tracker is available on the downloads page.  This version has all of the major functionality that I had planned.
Changes since 0.4.0:
*==&#62; Version 1.0.1 (August 5, 2009)
* Fixed bug with Tracker not working if the Windows user name had an apostrophe in it
*==&#62; Version 1.0.0 (August 3, 2009)
* Added ability [...]]]></description>
			<content:encoded><![CDATA[<p>Version 1.0.1 of the eHow Earnings Tracker is available on the <a href="http://17of26.com/downloads/">downloads</a> page.  This version has all of the major functionality that I had planned.</p>
<p>Changes since 0.4.0:</p>
<p>*==&gt; Version 1.0.1 (August 5, 2009)</p>
<p>* Fixed bug with Tracker not working if the Windows user name had an apostrophe in it</p>
<p>*==&gt; Version 1.0.0 (August 3, 2009)</p>
<p>* Added ability to toggle table display between earnings and views</p>
<p>*==&gt; Version 0.6.0 (August 2, 2009)</p>
<p>* Added column sorting<br />
* View table still gone, will be coming back soon!</p>
<p>*==&gt; Version 0.5.0 (July 30, 2009)</p>
<p>* Added ability to select a date range<br />
* Views table is gone, will return next version</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/08/ehow-earnings-tracker-version-1-0-1-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming with XML in Firefox Add-ons</title>
		<link>http://17of26.com/2009/07/programming-with-xml-in-firefox-add-ons/</link>
		<comments>http://17of26.com/2009/07/programming-with-xml-in-firefox-add-ons/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 01:40:18 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[Firefox Addon]]></category>
		<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=302</guid>
		<description><![CDATA[The eHow Earnings Tracker stores its data in XML format, so one of the things that I needed to learn how to do was program with XML in Firefox Add-ons.  Mozilla has a whole section of code snippets dedicated to XML but I will walk through exactly what I did in the development of the [...]]]></description>
			<content:encoded><![CDATA[<p>The eHow Earnings Tracker stores its data in XML format, so one of the things that I needed to learn how to do was program with XML in Firefox Add-ons.  Mozilla has a whole section of <a href="https://developer.mozilla.org/en/Code_snippets/XML">code snippets dedicated to XML</a> but I will walk through exactly what I did in the development of the tracker and point out some gotchas that I figured out along the way.</p>
<p>The first step in this process was to figure out how to create an XML DOM tree in memory.  This turned out to be pretty straightforward to do thanks to Mozilla&#8217;s <a href="https://developer.mozilla.org/en/How_to_create_a_DOM_tree">How to create a DOM tree</a> documentation.  I wound up with the following code to create my basic XML DOM hierarchy:</p>
<pre class="syntax-highlight:javascript">var createEarningsDOM = function()
{
    m_trackerDOM = document.implementation.createDocument(null, null, null);

    var trackerNode = m_trackerDOM.createElement(m_xmlNodeTracker);
    trackerNode.setAttribute(m_xmlAttrVersion, m_xmlVersion);

    m_articleListElem = m_trackerDOM.createElement(m_xmlNodeArticleList);
    trackerNode.appendChild(m_articleListElem);

    m_statsElem = m_trackerDOM.createElement(m_xmlNodeStats);
    trackerNode.appendChild(m_statsElem);

    m_trackerDOM.appendChild(trackerNode);
};</pre>
<p>You should notice a couple of things about the source code above.  First, I create variables to hold my node and attribute names.  This ensures consistency when I refer to particular nodes and attributes throughout my code.  It also means that if I decide to change the string for a node or attribute name, I only need to do it in one spot.  The second thing is that I create variables to hold references to DOM nodes so that I can easily manipulate them later in the code.</p>
<p>Now that I was able to create an XML DOM tree in memory, it was time to figure out how to write it out to a file.  Mozilla has some decent documentation on <a href="https://developer.mozilla.org/en/Parsing_and_serializing_XML">parsing and serializing XML</a>.  I combined the information there with <a href="http://17of26.com/2009/07/file-io-with-firefox-addons/">what I learned about file I/O</a> and wrote the following code to serialize my XML DOM to a file:</p>
<pre class="syntax-highlight:javascript">var s = new XMLSerializer();
XML.prettyIndent = 4;
var xmlString = XML(s.serializeToString(m_trackerDOM)).toXMLString();

if(!FileIO.write(m_earningsFile, xmlString))
{
    throw Error(&quot;Failed to save file &quot; + m_earningsFile.path);
}</pre>
<p>The &#8220;pretty&#8221; serialization for XML strings is really cool because it formats the XML so that it&#8217;s very readable.  It makes life a lot easier when you need to look at the contents the XML file.</p>
<p>Now that I was able to write out XML to a file, I needed a way to read it back in again later.  I used the <a href="https://developer.mozilla.org/en/DOMParser">DOMParser</a>.  The one thing to watch out for with the DOMParser is that when the parsing fails, it doesn&#8217;t throw an exception.  Instead, it returns an XML document that contains the parsing error.</p>
<p>This is the code I came up with for loading the XML DOM from a file:</p>
<pre class="syntax-highlight:javascript">var fileContents = FileIO.read(currentFile);

if(fileContents)
{
    logMessage(&quot;\tParsing file&quot;);
    var parser = new DOMParser();
    m_trackerDOM = parser.parseFromString(fileContents, &quot;text/xml&quot;);

    logMessage(&quot;\tLooking for &quot; + m_xmlNodeArticleList);
    m_articleListElem = m_trackerDOM.getElementsByTagName(m_xmlNodeArticleList)[0];

    if(!m_articleListElem)
    {
        // XML parsing failed, grab error
        var s = new XMLSerializer();
        XML.prettyIndent = 4;
        logMessage(XML(s.serializeToString(m_trackerDOM)).toXMLString());                    
        throw Error(&quot;Failed to parse XML data file&quot;);
    }
}</pre>
<p>In this piece of code, I read in the file contents and parse it, attempting to find the DOM element that I&#8217;m looking for.  If I don&#8217;t find the element then something has gone wrong &#8211; either the parsing failed, or the XML is not what I&#8217;m expecting it to be.  In either case, I log the results of the parseFromString() function to my log file so that I know what went wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/07/programming-with-xml-in-firefox-add-ons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File I/O with Firefox Add-ons</title>
		<link>http://17of26.com/2009/07/file-io-with-firefox-addons/</link>
		<comments>http://17of26.com/2009/07/file-io-with-firefox-addons/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 03:46:37 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[Firefox Addon]]></category>
		<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=292</guid>
		<description><![CDATA[One of the major pieces of the eHow Earnings Tracker involves writing data to an XML file and reading it back later.  Figuring out how to do file I/O in a Firefox add-on was not straightforward due to Mozilla&#8217;s wide array of Chrome APIs and spotty documentation.
Unfortunately, file I/O is not one of Mozilla&#8217;s new [...]]]></description>
			<content:encoded><![CDATA[<p>One of the major pieces of the eHow Earnings Tracker involves writing data to an XML file and reading it back later.  Figuring out how to do file I/O in a Firefox add-on was not straightforward due to Mozilla&#8217;s wide array of Chrome APIs and spotty documentation.</p>
<p>Unfortunately, file I/O is not one of Mozilla&#8217;s new <a href="https://developer.mozilla.org/en/FUEL">FUEL APIs</a>.  FUEL is a Javascript Library available to Firefox add-ons that is far easier to use than the older <a href="https://developer.mozilla.org/en/XPCOM">XPCOM API</a>.  It was introduced in Firefox 3.0 and Mozilla has been slowly adding functionality to it.</p>
<p>Starting with Mozilla&#8217;s <a href="https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO">file I/O code snippets</a> was a quite confusing &#8211; the documentation meanders all over the place showing bits and pieces of code without explaining anything in much depth.  On top of that, they suggest that you use the <a href="http://kb.mozillazine.org/Io.js">io.js</a> wrappers at the beginning of the page but then none of the examples shown use it.</p>
<p>Basically what it comes down to is that file I/O is done by using the XPCOM interfaces <a href="https://developer.mozilla.org/en/nsIFile">nsIFile</a> and <a href="https://developer.mozilla.org/en/nsILocalFile">nsILocalFile</a>.  The io.js wrappers are utility functions used to encapsulate the tedious syntax needed to use them.  I don&#8217;t fully understand the purpose of everything in io.js but I will show you what I did figure out and ultimately use in the tracker implementation.</p>
<p>The first thing that I needed to do was get a hold of the current Firefox profile directory since that&#8217;s where I wanted to store my data.  I chose the current profile directory because I wanted to be able to support multiple Firefox profiles using the tracker without overwriting each other&#8217;s data.</p>
<p>I wound up with the following function to do it:</p>
<pre class="syntax-highlight:javascript">var getProfileDir = function()
{
    var dir = DirIO.get(&#039;ProfD&#039;);
    if(!dir || !dir.exists())
    {
        throw Error(&quot;Failed to open profile directory&quot;);
    }

    return dir;
};
</pre>
<p>What this code does is create an nsIFile object that represents the profile directory.  &#8216;ProfD&#8217; is a special string that refers to the profile directory.  You can see a list of the supported strings in the <a href="https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO">file I/O code snippets</a>.  If you want to open a specific directory path, use DirIO.open() instead of get().</p>
<p>Once you have an nsIFile object, you can do a bunch of things with it.  The following code snippet will try to open a file in the profile directory and create it if it doesn&#8217;t already exist:</p>
<pre class="syntax-highlight:javascript">var openEarningsBackupFile = function(username)
{
    var currentFile = getProfileDir();
    currentFile.append(username + &quot;.xml&quot;);

    if(!currentFile.exists())
    {
        if(!FileIO.create(currentFile))
        {
            throw Error(&quot;Failed to create earnings backup file&quot;);
        }
    }
    return currentFile;
}</pre>
<p>The append function of the nsIFile object lets you navigate a file hierarchy one level at a time.  You could go down multiple levels like so:</p>
<pre class="syntax-highlight:javascript">currentFile.append(&quot;path1&quot;);
currentFile.append(&quot;path2&quot;);
currentFile.append(&quot;file.xml&quot;);</pre>
<p>This would navigate to [currentFile.path]\path1\path2\file.xml.  The create() function will create any path segments that don&#8217;t already exist.</p>
<p>Keep in mind that the append function modifies the calling object so if you want to open up two different files in a particular directory then the easiest way to do it is to create an nsIFile object that points to the directory and then <a href="https://developer.mozilla.org/en/nsIFile/clone">clone</a> it:</p>
<pre class="syntax-highlight:javascript">var file1 = getProfileDir();
var file2 = file1.clone();
file1.append(&quot;file1.xml&quot;);
file2.append(&quot;file2.xml&quot;);</pre>
<p>Once you have an nsIFile object pointed to an existing file you can read from and write to it.  The following copy function shows how to do reads and writes with nsIFile objects using the io.js wrappers:</p>
<pre class="syntax-highlight:javascript">// srcFile and destFile should be nsIFile objects
var copyFile = function(srcFile, destFile)
{
    var srcText = FileIO.read(srcFile);

    if(!srcText)
    {
        throw Error(&quot;Failed to read &quot; + srcFile.path);
    }

    if(!FileIO.write(destFile, srcText))
    {
       throw Error(&quot;Failed to copy &quot; + srcFile.path + &quot; to &quot; + destFile.path);
    }
 };</pre>
<p>Another not-so-obvious thing to figure out was how to get the path where the add-on is installed.  After quite a bit of searching, I came up with this bit of code:</p>
<pre class="syntax-highlight:javascript">var getExtensionDir = function()
{
    var dir = Components.classes[&quot;@mozilla.org/extensions/manager;1&quot;].getService(Components.interfaces.nsIExtensionManager).getInstallLocation(m_extensionId).getItemLocation(m_extensionId);

    if(!dir)
    {
        throw Error(&quot;Failed to get extension installation directory&quot;);
    }

    return dir;
};</pre>
<p>File I/O in Firefox add-ons is pretty easy to do once you see how all of the pieces fit together.</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/07/file-io-with-firefox-addons/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>eHow Earnings Tracker Version 0.4.0 Available</title>
		<link>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-4-0-available/</link>
		<comments>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-4-0-available/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 13:47:28 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[eHow]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=286</guid>
		<description><![CDATA[Yet another version of the eHow Earnings Tracker  has been uploaded to to the Firefox Addons site.  Head over to the downloads page to get it.
Changes since 0.3.0: 
*==> Version 0.4.0 (July 13, 2009)
* Added &#8220;Totals&#8221; and &#8220;Change from previous day&#8221; rows for earnings and views
*==> Version 0.3.1 (July 13, 2009)
   [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another version of the eHow Earnings Tracker  has been uploaded to to the Firefox Addons site.  Head over to the <a href="http://17of26.com/downloads/">downloads</a> page to get it.</p>
<p>Changes since 0.3.0: </p>
<p>*==> Version 0.4.0 (July 13, 2009)</p>
<p>* Added &#8220;Totals&#8221; and &#8220;Change from previous day&#8221; rows for earnings and views</p>
<p>*==> Version 0.3.1 (July 13, 2009)</p>
<p>    * Fixed problem with URL parsing when users had dashes(-) in their name.</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-4-0-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eHow Earnings Tracker Version 0.3.0 Available</title>
		<link>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-3-0-available/</link>
		<comments>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-3-0-available/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 13:31:12 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[eHow]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=280</guid>
		<description><![CDATA[Another version of the eHow Earnings Tracker  has been uploaded to to the Firefox Addons site.  Head over to the downloads page to get it.
Changes since Version 0.2.0:
*==&#62; Version 0.3.0 (July 13, 2009)
* Added &#8220;Copy Earnings Data to Desktop&#8221; menu option
* Added Views to HTML report
*==&#62; Version 0.2.3 (July 12, 2009)
* Additional logging
* [...]]]></description>
			<content:encoded><![CDATA[<p>Another version of the eHow Earnings Tracker  has been uploaded to to the Firefox Addons site.  Head over to the <a href="http://17of26.com/downloads/">downloads</a> page to get it.</p>
<p>Changes since Version 0.2.0:</p>
<p>*==&gt; Version 0.3.0 (July 13, 2009)</p>
<p>* Added &#8220;Copy Earnings Data to Desktop&#8221; menu option<br />
* Added Views to HTML report</p>
<p>*==&gt; Version 0.2.3 (July 12, 2009)</p>
<p>* Additional logging<br />
* Fixed issue with invalid XML characters getting stored as part of titles<br />
* Added &#8220;Delete Earnings Data&#8221; menu option</p>
<p>*==&gt; Version 0.2.2 (July 12, 2009)</p>
<p>* Fixed bug related to addition/removal of articles from the article library</p>
<p>*==&gt; Version 0.2.1 (July 12, 2009)</p>
<p>* Added more error logging<br />
* A backup earnings.xml file is now created on a successful update</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-3-0-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eHow Earnings Tracker Version 0.2.0 Available</title>
		<link>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-2-0-available/</link>
		<comments>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-2-0-available/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 05:09:35 +0000</pubDate>
		<dc:creator>Q</dc:creator>
				<category><![CDATA[eHow Earnings Tracker]]></category>
		<category><![CDATA[eHow]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://17of26.com/?p=276</guid>
		<description><![CDATA[I just uploaded the latest version of the eHow Earnings Tracker to the Firefox Addons site.  Head over to the downloads page to get it.
Changes since 0.1.1:
*==&#62; Version 0.2.0 (July 12, 2009)
* eHow earnings report now opens in its own tab
* Added styling to $0.00 value fields so that they are italics with gray [...]]]></description>
			<content:encoded><![CDATA[<p>I just uploaded the latest version of the eHow Earnings Tracker to the Firefox Addons site.  Head over to the <a href="http://17of26.com/downloads/">downloads</a> page to get it.</p>
<p>Changes since 0.1.1:</p>
<p>*==&gt; Version 0.2.0 (July 12, 2009)</p>
<p>* eHow earnings report now opens in its own tab<br />
* Added styling to $0.00 value fields so that they are italics with gray font<br />
* Added eHow graphics &amp; color scheme<br />
* Added &#8220;View Last Update&#8221; which views the last HTML stats page rather than regenerating it from eHow article earnings pages<br />
* Added error logging and menu item to copy log file to desktop</p>
<p>*==&gt; Version 0.1.2 (July 9, 2009)</p>
<p>* Added CSS styling to HTML report</p>
<p>Once development work settles down I&#8217;ll write some more posts about the tracker and how to write Firefox Addons.</p>
]]></content:encoded>
			<wfw:commentRss>http://17of26.com/2009/07/ehow-earnings-tracker-version-0-2-0-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
