<?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>crowder's blog</title>
	<atom:link href="http://blog.mozilla.com/bcrowder/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.com/bcrowder</link>
	<description>what I'm doing, what I'm interested in, random junk</description>
	<lastBuildDate>Fri, 08 Jan 2010 22:44:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IMAP filters</title>
		<link>http://blog.mozilla.com/bcrowder/2010/01/08/imap-filters/</link>
		<comments>http://blog.mozilla.com/bcrowder/2010/01/08/imap-filters/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 22:44:17 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/?p=30</guid>
		<description><![CDATA[Due to some mayhem at my email host, I&#8217;d been trying gmail anew for a few days.  I&#8217;ve had an active account there for a very long time, but this was the first time I&#8217;d really used gmail in anger (as my bugzilla account).
It turns out gmail and extended headers, such as those bugzilla [...]]]></description>
			<content:encoded><![CDATA[<p>Due to some mayhem at my email host, I&#8217;d been trying gmail anew for a few days.  I&#8217;ve had an active account there for a very long time, but this was the first time I&#8217;d really used gmail in anger (as my bugzilla account).</p>
<p>It turns out gmail and extended headers, such as those bugzilla delivers, don&#8217;t quite work together well, and the massive flood of emails I get from bugzilla is too firehose-like to be managed without those headers, so I quickly retreated to the safer ground of a Thunderbird nightly.</p>
<p>BUT, I have also become addicted to being able to use Google Sync (ala ActiveSync) with my phone for contacts, email, and calendar (no tasks! *pout*).  So I need to be able to check bugmail from my phone, but having extensive filtering there isn&#8217;t really necessary.  Having it at my desktop is critical.  But I still don&#8217;t want my phone to think I&#8217;ve got email every time bugzilla spams me.  So I set up a gmail filter to kick bugzilla mail off to my bugzilla folder.</p>
<p>Thunderbird, though, in its default configuration, does not perform additional filtering on any folder other than &#8220;Inbox&#8221;.  I wanted priority highlighting to work in Thunderbird without having to &#8220;Run Filters on Folder&#8221; every time I switched.  Here&#8217;s the trick:</p>
<p>In about:config for Tbird (Tools -> Options -> General -> Config Editor), add the following key:</p>
<p>mail.server.default.applyIncomingFilters = &#8220;true&#8221;</p>
<p>(It&#8217;s important that the key be a string), and you&#8217;ll get filtration in all of your IMAP folders.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2010/01/08/imap-filters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>canvas + chrome + content</title>
		<link>http://blog.mozilla.com/bcrowder/2009/04/08/canvas-chrome-content/</link>
		<comments>http://blog.mozilla.com/bcrowder/2009/04/08/canvas-chrome-content/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 18:04:37 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/?p=28</guid>
		<description><![CDATA[I am writing an extension that attaches a div and a canvas to content pages, and in the process of trying to tune it for performance, I ran into bug 339587.  I submitted a patch for that bug, but I ran into another problem, which is that my patch causes the ImageData to be [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing an extension that attaches a div and a canvas to content pages, and in the process of trying to tune it for performance, I ran into <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=339587">bug 339587</a>.  I submitted a patch for that bug, but I ran into another problem, which is that my patch causes the ImageData to be wrapped (it becomes a SafeJSObjectWrapper), which means that subsequent putImageData calls are foiled; the object doesn&#8217;t look like an object anymore, and especially, the data member doesn&#8217;t look like an array, so eventually an exception is thrown.  putImageData could be made more robust, but the cost might not be worth it&#8230;  here&#8217;s the obvious workaround.  You needn&#8217;t actually call createImageData, ever (at least not currently &#8212; this might change??); instead, you can build a JS object that looks and works precisely like an ImageData object in your own code.  Since you&#8217;ll be setting the pixels yourself anyway, I suspect that creating your own image data is actually a tiny bit faster than using createImageData.  Here&#8217;s what I did:</p>
<p><code>let imgData = { width: width, height: height };<br />
imgData.data = new Array(width * height * 4); // make sure your array never needs to grow dynamically<br />
//.... initialization loop ....</code></p>
<p>This probably seems like an obvious workaround, but it might not be obvious to those who haven&#8217;t inspected the get/putImageData code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2009/04/08/canvas-chrome-content/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jswrap (C++ love for Spidermonkey)</title>
		<link>http://blog.mozilla.com/bcrowder/2008/09/17/jswrap-c-love-for-spidermonkey/</link>
		<comments>http://blog.mozilla.com/bcrowder/2008/09/17/jswrap-c-love-for-spidermonkey/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 19:50:08 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/?p=19</guid>
		<description><![CDATA[A couple of years ago I started and then abandoned a project that implemented what I thought then were a couple of cute ideas to do with using boost (the outstanding C++ libraries found at boost.org) to automatically generate wrappers for C++ objects to be used in Spidermonkey.  I&#8217;ve shared pieces of the code [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago I started and then abandoned a project that implemented what I thought then were a couple of cute ideas to do with using boost (the outstanding C++ libraries found at <a href="http://www.boost.org">boost.org</a>) to automatically generate wrappers for C++ objects to be used in Spidermonkey.  I&#8217;ve shared pieces of the code before, to people who needed a C++-style error-reporter for Spidermonkey, or whatever, but I&#8217;ve never bothered actually sharing the whole thing.  Well, that seems silly, so I&#8217;m <a href="http://people.mozilla.com/~bcrowder/wrapdemo.tar.gz">sharing it now</a>.</p>
<p>There is a lot left to be done here; as I said, I abandoned the project.  All I&#8217;ve done since then is a tweak here or there, and a couple of cleanups I made today.</p>
<p>As I said, though, it implements some cute ideas:</p>
<ul>
<li>You can get a simple JS program running in two or three lines of C++ code (snipped from demo.cpp):
<pre>
<code>
    jswrap::jswrap_ptr js = jswrap::jswrap_ptr(new jswrap());
    jsval rval;
    js->runfile("test.js", &#038;rval);
</code>
</pre>
</li>
<li>Wrapping member function calls is a matter of one line of code, and can happen right inside your JSFunctionSpec array (this example is taken from pgsqljs.cpp):
<pre><code>
    { "status", cmember0&lt;PGconn_wrap, int,
      &#038;PGconn_wrap::status&gt;().call,
      0, DEF_PROP_FLAGS, 0 },
    { "transaction_status", cmember0&lt;PGconn_wrap, int,
      &#038;PGconn_wrap::transaction_status&gt;().call,
      0, DEF_PROP_FLAGS, 0 },
    { "parameter_status", cmember1&lt;PGconn_wrap, const char *, const char *,
      &#038;PGconn_wrap::parameter_status&gt;().call,
      1, DEF_PROP_FLAGS, 0 },
</code></pre>
<p>Essentially, I am creating template-classes (I couldn&#8217;t figure out how to make this magic work with template-functions &#8212; help wanted!) for each member function.  The instantiated template class has one static function which knows how to marshall parameters and return values.  I also handles exceptions by propagating JS-exceptions as C++-exceptions, and vice versa.  This is a little hairy, but I think is an interesting approach.  It means no IDL and no external help (other than some rather egregious abuse of the C pre-processor, thanks largely to help from Boost.Preprocessor).  It also means you don&#8217;t have to maintain a separate call-through layer by hand.  Better still, this actually works for C++ member-functions of C++ objects, not only static member functions, so foo.bar() in C++ is still foo.bar() in JS.</li>
<li>It includes a sample embedding of the C PostgreSQL API, encapsulated in a C++ class.</li>
<li>It handles rooting for you (or at least, I think it does, I haven&#8217;t tested very carefully).</li>
<li>It provides an error-reporter and a stack-dumping facility, written in C++; both of which can be handy for debugging, or just as &#8220;recipes&#8221; for external projects.  Steal at will.</li>
<li>It&#8217;s amazingly terse, compared to the usual process for embedding spidermonkey.  I&#8217;d love to see it get even moreso, while retaining flexibility.</li>
</ul>
<p>It needs some cleanup and extension.  It could also benefit from some additional love in the template department.  I&#8217;d really like the member function spec lines to look like this, instead:</p>
<pre><code>    { "status", wrappedfunc&lt;&#038;PGconn_wrap::status&gt;, 0, DEF_PROP_FLAGS, 0 },
    { "transaction_status", wrappedfunc&lt;&#038;PGconn_wrap::transaction_status&gt;, 0, DEF_PROP_FLAGS, 0 },
    { "parameter_status", wrappedfunc&lt;&#038;PGconn_wrap::parameter_status&gt;(), 1, DEF_PROP_FLAGS, 0 },</code></pre>
<p>I&#8217;d really like to have a better story for properties (ie., data-members) of C++ objects.<br />
I&#8217;d really like to have an autoconf-based build environment that works with Mozilla-build (+boost?).<br />
I wrote a boost::asio wrapper.  It isn&#8217;t included here, but it would be neat to get it back on its feet and wrapped a little more cleanly than I had it before.<br />
It needs more testing and feedback (which is why I am releasing it.)</p>
<p><a href="http://people.mozilla.com/~bcrowder/wrapdemo.tar.gz">Here it is</a>.  I&#8217;m pretty sure you&#8217;ll need Boost 1.35 (at a minimum) to build it, and you&#8217;ll have to tweak the Jamfile and some other spots to suit your own directory structure (look for the string &#8220;crowder&#8221;) and file/library locations.  Feedback and patches are welcome and appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2008/09/17/jswrap-c-love-for-spidermonkey/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>extend this!</title>
		<link>http://blog.mozilla.com/bcrowder/2008/07/18/extend-this/</link>
		<comments>http://blog.mozilla.com/bcrowder/2008/07/18/extend-this/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 03:23:07 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/?p=18</guid>
		<description><![CDATA[I&#8217;ve been working on something fun for the last couple of days (in between patch-revs on other bugs I can&#8217;t talk about yet), and I thought I&#8217;d blog about it.  It&#8217;s cool (at least to me) and useful:
John Resig and others involved in the standardization process for the new ECMAScript language proposals have been [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433351">been working on</a> something fun for the last couple of days (in between patch-revs on other bugs I can&#8217;t talk about yet), and I thought I&#8217;d blog about it.  It&#8217;s cool (at least to me) and useful:</p>
<p>John Resig and others involved in the standardization process for the new ECMAScript language proposals have been going back and forth lately over the design of a new language library feature, to facilitate copying properties of one object to another.  Object.extend() &#8212; essentially you pass an object (the one you mean to extend), and a series of objects (from which you want properties copied), and you get a new object with all the goodness of the others:</p>
<p>From the spidermonkey JS shell:<br />
<code>js&gt; var a = { get x () { print("foo"); return 3 } }<br />
js&gt; var b = [ 1, 2, 3 ]<br />
js&gt; var c = { foo: "bar" }<br />
js&gt; var result = Object.extend({}, a, b, c)<br />
js&gt; result.toSource()<br />
({get x () {print("foo");return 3;}, 0:1, 1:2, 2:3, foo:"bar"})</code><br />
Notice the getter itself is copied, not the result of its evaluation.</p>
<p>I hope this feature makes it into the standard(s), I think it&#8217;s a very powerful, useful, and flexible one.  So much so that many of the existing AJAX libraries already have a 5-or-10 line version of it included, under <a href="https://mail.mozilla.org/pipermail/es3.x-discuss/2008-July/000361.html">any of a number of names</a>, and with a few variations in semantics.  In my opinion, a number of the other features being discussed in lieu of it (like Object.clone) can be implemented trivially in terms of it).  A good, consistent semantic for a feature this convenient seems like a great thing for the &#8220;library&#8221; side of JS, to me.  I&#8217;d love to land this for 1.9.1, it seems like it would, at least, be handy for extension authors.  I hope it survives the committees!</p>
<p>Also, thanks to John for writing a nice test-suite for the feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2008/07/18/extend-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>million</title>
		<link>http://blog.mozilla.com/bcrowder/2008/06/24/million/</link>
		<comments>http://blog.mozilla.com/bcrowder/2008/06/24/million/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 19:03:05 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/?p=17</guid>
		<description><![CDATA[This is a brilliant idea that rewards public school students with cell-phone air-time, credits for music purchases, etc., in exchange for educational performance, and is useful as an educational tool during classtime.
Here&#8217;s a video about the project.
Did I mention it&#8217;s self-sustaining, and funded by advertising?
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nytimes.com/2008/02/28/nyregion/28cellphones.html">This</a> is a brilliant idea that rewards public school students with cell-phone air-time, credits for music purchases, etc., in exchange for educational performance, <em>and</em> is useful as an educational tool during classtime.</p>
<p><a href="http://www.droga5.com/clients/Million/MILLION_FINAL_WEB.mov">Here</a>&#8217;s a video about the project.</p>
<p>Did I mention it&#8217;s self-sustaining, and funded by advertising?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2008/06/24/million/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.droga5.com/clients/Million/MILLION_FINAL_WEB.mov" length="42366557" type="video/quicktime" />
		</item>
		<item>
		<title>stone soup</title>
		<link>http://blog.mozilla.com/bcrowder/2008/04/26/stone-soup/</link>
		<comments>http://blog.mozilla.com/bcrowder/2008/04/26/stone-soup/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 04:14:38 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[Free Beer]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/2008/04/26/stone-soup/</guid>
		<description><![CDATA[Perhaps everyone has encountered this story before me, but tonight was my first time.  I found myself reading it to my sons and thinking a lot about how much it feels like what I do at work.  The version I read was by a childrens&#8217; author named Jon J. Muth.  If you [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps everyone has encountered this story before me, but tonight was my first time.  I found myself reading it to my sons and thinking a lot about how much it feels like what I do at work.  The <a href="http://www.amazon.com/Stone-Soup-Jon-J-Muth/dp/043933909X">version I read</a> was by a childrens&#8217; author named Jon J. Muth.  If you get a chance to read it, I highly recommend it.  There are a <a href="http://en.wikipedia.org/wiki/Stone_soup">couple</a> <a href="http://www.extremelinux.info/stonesoup/stonesoup.html">of</a> <a href="http://www.storybin.com/sponsor/sponsor116.shtml">online</a> <a href="http://www.storyresources.co.nz/shop/item.aspx?itemid=526">renditions</a> available, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2008/04/26/stone-soup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evolving from the JavaScript of today to the JavaScript of tomorrow (ES3 -&gt; ES4)</title>
		<link>http://blog.mozilla.com/bcrowder/2007/11/30/evolving-from-the-javascript-of-today-to-the-javascript-of-tomorrow-es3-es4/</link>
		<comments>http://blog.mozilla.com/bcrowder/2007/11/30/evolving-from-the-javascript-of-today-to-the-javascript-of-tomorrow-es3-es4/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 18:27:54 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/2007/11/30/evolving-from-the-javascript-of-today-to-the-javascript-of-tomorrow-es3-es4/</guid>
		<description><![CDATA[Lars Hansen of Adobe has written a really great tutorial for ES4 that describes the evolution of a library project written in JS using current technologies, as it incrementally incorporates features of the new language to simplify and improve the code for readability, integrity and performance.  
That sounds like a lot of weasel-words.  [...]]]></description>
			<content:encoded><![CDATA[<p>Lars Hansen of Adobe has written a really great tutorial for ES4 that describes the evolution of a library project written in JS using current technologies, as it incrementally incorporates features of the new language to simplify and improve the code for readability, integrity and performance.  </p>
<p>That sounds like a lot of weasel-words.  The tutorial demonstrates a library which otherwise has no <em>requirement</em> to be modified at all, but which gradually, simply, and piece-by-piece, as its author&#8217;s see fit, improves itself &#8212; and the environment to which it exposes its clients &#8212; over time, by incorporating some of the new, powerful features of ECMAScript4.</p>
<p>The tutorial is very approachable; even if you don&#8217;t consider yourself a language geek, you should <a href="http://www.ecmascript.org/es4/spec/evolutionary-programming-tutorial.pdf">check it out</a>.  If you&#8217;re curious as to what the designers behind ES4 are thinking about, and how they plan to shape the future of the web with the new version of the language, this paper provides some great clues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2007/11/30/evolving-from-the-javascript-of-today-to-the-javascript-of-tomorrow-es3-es4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Solar System Doesn&#8217;t Work as Well with IE</title>
		<link>http://blog.mozilla.com/bcrowder/2007/11/29/14/</link>
		<comments>http://blog.mozilla.com/bcrowder/2007/11/29/14/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 19:11:03 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/2007/11/29/14/</guid>
		<description><![CDATA[Seen in a Google Gadget, this morning:
Most installations of the Solar System don&#8217;t work as well with Internet Explorer.  If you are still using IE this would be a good time to switch to the Firefox browser.
Deeply philosophical.
]]></description>
			<content:encoded><![CDATA[<p>Seen in a Google Gadget, this morning:</p>
<blockquote><p>Most installations of the Solar System don&#8217;t work as well with Internet Explorer.  If you are still using IE this would be a good time to switch to the <a href="http://echo3.net/firefox/?solar">Firefox</a> browser.</p></blockquote>
<p>Deeply philosophical.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2007/11/29/14/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dtrace on Leopard</title>
		<link>http://blog.mozilla.com/bcrowder/2007/10/29/dtrace-on-leopard/</link>
		<comments>http://blog.mozilla.com/bcrowder/2007/10/29/dtrace-on-leopard/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 17:39:26 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/2007/10/29/dtrace-on-leopard/</guid>
		<description><![CDATA[So good.
Not quite ready for primetime yet, but close enough to be useful for Mozilla/Firefox developers.  Check it out.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.sun.com/ahl/entry/dtrace_firefox_leopard">So good</a>.</p>
<p>Not <em>quite</em> ready for primetime yet, but close enough to be useful for Mozilla/Firefox developers.  Check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2007/10/29/dtrace-on-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Black Hat</title>
		<link>http://blog.mozilla.com/bcrowder/2007/07/30/black-hat/</link>
		<comments>http://blog.mozilla.com/bcrowder/2007/07/30/black-hat/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 05:11:33 +0000</pubDate>
		<dc:creator>bcrowder</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/bcrowder/2007/07/30/black-hat/</guid>
		<description><![CDATA[This will be my first year at the Black Hat conference in Las Vegas.  I&#8217;m exited.  The fact that Jesse Ruderman is nervous, makes me nervous.   
]]></description>
			<content:encoded><![CDATA[<p>This will be my first year at the Black Hat conference in Las Vegas.  I&#8217;m exited.  The fact that Jesse Ruderman is nervous, makes me nervous.  <img src='http://blog.mozilla.com/bcrowder/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/bcrowder/2007/07/30/black-hat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
