<?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>Less Talk, More Do</title>
	<atom:link href="http://www.chrisfinke.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisfinke.com</link>
	<description>Christopher Finke is a software engineer. He is available for birthday parties and bar mitzvahs.</description>
	<lastBuildDate>Sun, 28 Feb 2010 00:09:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Making Add-on/User Communication Less Annoying</title>
		<link>http://www.chrisfinke.com/2010/02/27/making-add-onuser-communication-less-annoying/</link>
		<comments>http://www.chrisfinke.com/2010/02/27/making-add-onuser-communication-less-annoying/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 00:09:57 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Browser Add-ons]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TwitterBar]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1602</guid>
		<description><![CDATA[When a new user downloads TwitterBar, there are a number of things I want them to know or questions I want to ask them.  So what is the best method to communicate with an add-on user?
The solution I've been using for a while is to pop up a dialog like this:

There are several problems [...]]]></description>
			<content:encoded><![CDATA[<p>When a new user downloads <a href="https://addons.mozilla.org/en-US/firefox/addon/4664">TwitterBar</a>, there are a number of things I want them to know or questions I want to ask them.  So what is the best method to communicate with an add-on user?</p>
<p>The solution I've been using for a while is to pop up a dialog like this:</p>
<p><img src="http://www.chrisfinke.com/files/2010/02/twitterbar-demand.png" alt="" title="" width="520" height="223" class="alignnone size-full wp-image-1603" /></p>
<p>There are several problems with this approach, all of which I decided to ignore when I implemented it:</p>
<ul>
<li>It steals the user's focus.</li>
<li>It's annoying.</li>
<li>The user might click cancel without reading it just to get rid of it.</li>
<li>It's annoying.</li>
<li>The user might immediately (but accidentally) click elsewhere, hiding the dialog behind another window, never to be seen again.</li>
<li>It's annoying.</li>
<li>It's extra code and work to pop up a special dialog like this.</li>
<li>It's annoying.</li>
</ul>
<p>Back when there was only one dialog, I decided that these were acceptable faults.  However, since then, I've come up with a few more questions I want to ask users, so now instead of one annoying dialog, there are three or four annoying dialogs - a new one appearing each time you restart Firefox.</p>
<p>Predictably (or so it should have been), users don't like to be assaulted with new dialogs each time they start their browser.  Most likely, they're starting their browser for some purpose other than using my add-on, so my add-on shouldn't steal their attention.  As one user so elegantly put it,</p>
<blockquote><p>"I really love the TwitterBar, but after the most recent TwitterBar update, I noticed I kept getting these <b>annoying as hell</b> pop-ups from TwitterBar about TwitterBar. After the third one (while I was in the middle of doing something and became distracted with this pop-up dialog box TwitterBar tip of the day), I uninstalled it. <b> If you want to keep your clients, don't constantly tap them on the shoulder.</b>"</p></blockquote>
<p>I had already been working on redesigning these add-on/user interactions when I got that email, so the user's message reinforced what I had suspected: I was alienating my userbase.</p>
<p>Here's the new scheme I've settled on for now:</p>
<p><img src="http://www.chrisfinke.com/files/2010/02/twitterbar-request.png" alt="" title="" width="710" height="192" class="alignnone size-full wp-image-1604" /></p>
<p>It's a notification bar, much like the one that appears when Firefox blocks a popup.  It has these positive qualities:</p>
<ul>
<li>It doesn't steal focus or interrupt the user.</li>
<li>It's not in-your-face, so it's less likely (I assume) to be dismissed without thought.</li>
<li>It can't be lost behind another window.</li>
<li>The amount of code to implement it is less, and it's more in tune with the browser interface.</li>
<li>It's not <em>as</em> annoying.</li>
</ul>
<p>I'd love your feedback on this change.  Is it enough? Should I stop bothering users altogether and just let them discover their way around the add-on? I'm open to all ideas.</p>
<p>(If you'd like to try a version of TwitterBar with this new notification method, you can <a href="http://code.google.com/p/firefox-twitterbar/downloads/detail?name=twitterbar-2.9.1b3.xpi&#038;can=2&#038;q=#makechanges">download it here</a>. Although, if you've already seen the old dialog-style version of these notifications, you won't see the new-style ones anyway.)</p>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1602" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/02/27/making-add-onuser-communication-less-annoying/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>TwitterBar 2.9 Available: Post to Multiple Twitter Accounts</title>
		<link>http://www.chrisfinke.com/2010/02/24/twitterbar-2-9-available-post-to-multiple-twitter-accounts/</link>
		<comments>http://www.chrisfinke.com/2010/02/24/twitterbar-2-9-available-post-to-multiple-twitter-accounts/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 19:36:12 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Browser Add-ons]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[TwitterBar]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1592</guid>
		<description><![CDATA[Version 2.9 of TwitterBar for Firefox was made available on Mozilla Add-ons today, and it has a very cool new feature: you can now use TwitterBar with more than one Twitter account.
To post to a specific account, just type your message like this:
I am posting to my other account. --@other_account --post

If you haven't yet authorized [...]]]></description>
			<content:encoded><![CDATA[<p>Version 2.9 of <a href="https://addons.mozilla.org/en-US/firefox/addon/4664">TwitterBar for Firefox</a> was made available on Mozilla Add-ons today, and it has a very cool new feature: you can now use TwitterBar with more than one Twitter account.</p>
<p>To post to a specific account, just type your message like this:</p>
<blockquote><p>I am posting to my other account. --@other_account --post</p></blockquote>
<p><img src="http://www.chrisfinke.com/files/2010/02/post-to-account.png" alt="" title="" width="354" height="51" class="alignnone size-full wp-image-1596" /></p>
<p>If you haven't yet authorized TwitterBar for @other_account, you'll be walked through the authorization process.  </p>
<p>If you've authorized more than one account, and you don't specify which account you want to post to, you'll be given a list of choices:</p>
<p><img src="http://www.chrisfinke.com/files/2010/02/account-choices.png" alt="" title="" width="439" height="213" class="alignnone size-full wp-image-1598" /></p>
<p>You can manage your accounts from the TwitterBar options (just type "--options").</p>
<p><img src="http://www.chrisfinke.com/files/2010/02/twitterbar-accounts.png" alt="" title="" width="436" height="114" class="alignnone size-full wp-image-1595" /></p>
<p>Finally, to authorize a new account without posting to it, just type "--account" in the URL bar.</p>
<p>To install this new version of TwitterBar, <b><a href="https://addons.mozilla.org/en-US/firefox/addon/4664">download it from Mozilla Add-ons.</a></b></p>
<p>The next obvious step is the ability to post to multiple accounts simultaneously, and the next version of TwitterBar will offer than feature.  If you'd like to beta-test that update, <a href="mailto:cfinke@gmail.com">e-mail me and let me know.</a></p>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1592" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/02/24/twitterbar-2-9-available-post-to-multiple-twitter-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading form data and files with JavaScript (Mozilla)</title>
		<link>http://www.chrisfinke.com/2010/01/30/uploading-form-data-and-files-with-javascript-mozilla/</link>
		<comments>http://www.chrisfinke.com/2010/01/30/uploading-form-data-and-files-with-javascript-mozilla/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 21:23:34 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Browser Add-ons]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1573</guid>
		<description><![CDATA[One problem I stumble across occasionally in writing Firefox extensions is properly uploading form data that includes a file - that is, assembling the POST request in JavaScript while still maintaining the sanctity of any file or string data.  You can't just do this:

var request = "--boundary\r\n some text\r\n--boundary" + fileBytes + "\r\n--boundary--";

I had [...]]]></description>
			<content:encoded><![CDATA[<p>One problem I stumble across occasionally in writing Firefox extensions is properly uploading form data that includes a file - that is, assembling the POST request in JavaScript while still maintaining the sanctity of any file or string data.  You can't just do this:</p>
<pre>
var request = "--boundary\r\n some text\r\n--boundary" + fileBytes + "\r\n--boundary--";
</pre>
<p>I had to spend a bit of time getting this just right in order to allow <a href="http://www.scribefire.com/">ScribeFire</a> to upload media to <a href="http://posterous.com/">Posterous</a>, so I'm posting below the final solution at which I arrived; it was cobbled together from a dozen different examples I found around the Web (none of them solving the full problem), then lovingly massaged into the elegant function you see before you.  With this function, you can pass in an array of fields and files, and the request will be crafted and returned to you, ready for upload.</p>
<p>Instructions for use are in the comment block at the top of the function.</p>
<pre>
function createPostRequest(args) {
  /**
   * Generates a POST request body for uploading.
   *
   * args is an associative array of the form fields.
   *
   * Example:
   * var args = { "field1": "abc", "field2" : "def", "fileField" :
   *              { "file": theFile, "headers" : [ "X-Fake-Header: foo" ] } };
   *
   * theFile is an nsILocalFile; the headers param for the file field is optional.
   *
   * This function returns an array like this:
   * { "requestBody" : uploadStream, "boundary" : BOUNDARY }
   *
   * To upload:
   *
   * var postRequest = createPostRequest(args);
   * var req = new XMLHttpRequest();
   * req.open("POST", ...);
   * req.setRequestHeader("Content-Type","multipart/form-data; boundary="+postRequest.boundary);
   * req.setRequestHeader("Content-Length", (postRequest.requestBody.available()));
   * req.send(postRequest.requestBody);
   */

  function stringToStream(str) {
    function encodeToUtf8(oStr) {
      var utfStr = oStr;
      var uConv = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
                    .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
      uConv.charset = "UTF-8";
      utfStr = uConv.ConvertFromUnicode(oStr);

      return utfStr;
    }

    str = encodeToUtf8(str);

    var stream = Components.classes["@mozilla.org/io/string-input-stream;1"]
                   .createInstance(Components.interfaces.nsIStringInputStream);
    stream.setData(str, str.length);

    return stream;
  }

  function fileToStream(file) {
    var fpLocal  = Components.classes['@mozilla.org/file/local;1']
                     .createInstance(Components.interfaces.nsILocalFile);
    fpLocal.initWithFile(file);

    var finStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
                      .createInstance(Components.interfaces.nsIFileInputStream);
    finStream.init(fpLocal, 1, 0, false);

    var bufStream = Components.classes["@mozilla.org/network/buffered-input-stream;1"]
                      .createInstance(Components.interfaces.nsIBufferedInputStream);
    bufStream.init(finStream, 9000000);

    return bufStream;
  }

  var mimeSvc = Components.classes["@mozilla.org/mime;1"]
                  .getService(Components.interfaces.nsIMIMEService);
  const BOUNDARY = "---------------------------32191240128944"; 

  var streams = [];

  for (var i in args) {
    var buffer = "--" + BOUNDARY + "\r\n";
    buffer += "Content-Disposition: form-data; name=\"" + i + "\"";
    streams.push(stringToStream(buffer));

    if (typeof args[i] == "object") {
      buffer = "; filename=\"" + args[i].file.leafName + "\"";

      if ("headers" in args[i]) {
        if (args[i].headers.length > 0) {
          for (var q = 0; q < args[i].headers.length; q++){
            buffer += "\r\n" + args[i].headers[q];
          }
        }
      }

      var theMimeType = mimeSvc.getTypeFromFile(args[i].file);

      buffer += "\r\nContent-Type: " + theMimeType;
      buffer += "\r\n\r\n";

      streams.push(stringToStream(buffer));

      streams.push(fileToStream(args[i].file));
    }
    else {
      buffer = "\r\n\r\n";
      buffer += args[i];
      buffer += "\r\n";
      streams.push(stringToStream(buffer));
    }
  }

  var buffer = "--" + BOUNDARY + "--\r\n";
  streams.push(stringToStream(buffer));

  var uploadStream = Components.classes["@mozilla.org/io/multiplex-input-stream;1"]
                       .createInstance(Components.interfaces.nsIMultiplexInputStream);

  for (var i = 0; i < streams.length; i++) {
    uploadStream.appendStream(streams[i]);
  }

  return { "requestBody" : uploadStream, "boundary": BOUNDARY };
}
</pre>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1573" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/01/30/uploading-form-data-and-files-with-javascript-mozilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2010 Calendar - December</title>
		<link>http://www.chrisfinke.com/2010/01/13/2010-calendar-december/</link>
		<comments>http://www.chrisfinke.com/2010/01/13/2010-calendar-december/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 13:00:17 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1500</guid>
		<description><![CDATA[
"December: Jesus is the reason for the season."
 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cfinke/4235663842/" title="12 - December by cfinke, on Flickr"><img src="http://farm5.static.flickr.com/4020/4235663842_c93600c902.jpg" width="500" height="375" alt="12 - December" style="border: 0;" /></a></p>
<p>"December: Jesus is the reason for the season."</p>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1500" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/01/13/2010-calendar-december/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2010 Calendar - November</title>
		<link>http://www.chrisfinke.com/2010/01/12/2010-calendar-november/</link>
		<comments>http://www.chrisfinke.com/2010/01/12/2010-calendar-november/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 13:00:32 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1499</guid>
		<description><![CDATA[
"November: It's probably cold out. Stay in and do a puzzle."
 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cfinke/4235656880/" title="11 - November by cfinke, on Flickr"><img src="http://farm3.static.flickr.com/2801/4235656880_34111e3574.jpg" alt="11 - November" style="border: 0pt none ;" height="375" width="500" /></a></p>
<p>"November: It's probably cold out. Stay in and do a puzzle."</p>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1499" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/01/12/2010-calendar-november/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2010 Calendar - October</title>
		<link>http://www.chrisfinke.com/2010/01/11/2010-calendar-october/</link>
		<comments>http://www.chrisfinke.com/2010/01/11/2010-calendar-october/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 13:00:45 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1498</guid>
		<description><![CDATA[
"October: Better harvest the crops before they freeze."
 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cfinke/4234875665/" title="10 - October by cfinke, on Flickr"><img src="http://farm3.static.flickr.com/2786/4234875665_a4946b4861.jpg" width="500" height="375" alt="10 - October" style="border: 0;" /></a></p>
<p>"October: Better harvest the crops before they freeze."</p>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1498" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/01/11/2010-calendar-october/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2010 Calendar - September</title>
		<link>http://www.chrisfinke.com/2010/01/10/2010-calendar-september/</link>
		<comments>http://www.chrisfinke.com/2010/01/10/2010-calendar-september/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 13:00:00 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1497</guid>
		<description><![CDATA[
"September: Bonfires, ghost stories, and s'mores."
 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cfinke/4235644108/" title="09 - September by cfinke, on Flickr"><img src="http://farm5.static.flickr.com/4037/4235644108_50334564db.jpg" width="500" height="375" alt="09 - September" style="border: 0;" /></a></p>
<p>"September: Bonfires, ghost stories, and s'mores."</p>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1497" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/01/10/2010-calendar-september/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2010 Calendar - August</title>
		<link>http://www.chrisfinke.com/2010/01/09/2010-calendar-august/</link>
		<comments>http://www.chrisfinke.com/2010/01/09/2010-calendar-august/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 13:00:09 +0000</pubDate>
		<dc:creator>Christopher Finke</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.chrisfinke.com/?p=1496</guid>
		<description><![CDATA[
"August: Everyone loves to take a dip in the pool."
 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cfinke/4234862375/" title="08 - August by cfinke, on Flickr"><img src="http://farm3.static.flickr.com/2622/4234862375_d80fcda114.jpg" width="500" height="375" alt="08 - August" style="border: 0;" /></a></p>
<p>"August: Everyone loves to take a dip in the pool."</p>
 <img src="http://www.chrisfinke.com/wp-content/plugins/feed-statistics.php?view=1&post_id=1496" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.chrisfinke.com/2010/01/09/2010-calendar-august/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
