<?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>dougt&#039;s blog &#187; mozilla</title>
	<atom:link href="http://dougt.org/wordpress/tag/mozilla/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougt.org/wordpress</link>
	<description>best. tagline. ever.</description>
	<lastBuildDate>Mon, 26 Jul 2010 03:18:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Geolocation &#8211; Setting your position manually</title>
		<link>http://dougt.org/wordpress/2010/06/geolocation-setting-your-position-manually/</link>
		<comments>http://dougt.org/wordpress/2010/06/geolocation-setting-your-position-manually/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 16:19:53 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[geolocation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=576</guid>
		<description><![CDATA[I thought that this was written down somwhere, but I couldn&#8217;t easily find it&#8230;. so If you know how to muck with about:config, there is an easy way to set your location manually.  First figure out your longitude and latitude.  There area bunch of tools on the web that gets you this.  Once you have [...]]]></description>
			<content:encoded><![CDATA[<p>I thought that this was written down somwhere, but I couldn&#8217;t easily find it&#8230;. so</p>
<p>If you know how to muck with about:config, there is an easy way to set your location manually.  First figure out your longitude and latitude.  There area bunch of tools on the web that gets you this.  Once you have this, you can do the following:</p>
<p>1) Open up about:config</p>
<p>2) search for geo.wifi.uri</p>
<p>3) change the value to:</p>
<p>http://snaptome.appspot.com/loc/json?latitude=<strong>your_lat</strong>&amp;longitude=<strong>your_lon</strong>&amp;accuracy=10</p>
<p>Thats it.  I hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2010/06/geolocation-setting-your-position-manually/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Fennec 1.0 gource</title>
		<link>http://dougt.org/wordpress/2010/02/fennec-1-0-gource/</link>
		<comments>http://dougt.org/wordpress/2010/02/fennec-1-0-gource/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 17:17:28 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[fennec]]></category>
		<category><![CDATA[gource]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=531</guid>
		<description><![CDATA[Fennec 1.0 has been released for the N900 devices.  It is fun to look back to see how far everything has come.  One interesting way to view the development progress is a visualization tool called gource.  Gource produced this graph for the frontend changes that make up Fennec 1.0 (best viewed in HD). There are [...]]]></description>
			<content:encoded><![CDATA[<p>Fennec 1.0 has been released for the N900 devices.  It is fun to look back to see how far everything has come.  One interesting way to view the development progress is a visualization tool called <a href="http://code.google.com/p/gource/">gource</a>.  Gource produced this graph for the <a href="http://hg.mozilla.org/mobile-browser/">frontend changes</a> that make up Fennec 1.0 (best viewed in HD).</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="385" height="314" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Kik5XwhGmAs&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="385" height="314" src="http://www.youtube.com/v/Kik5XwhGmAs&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>There are lots of nobs and switches to gource.  The command to produce this video is:</p>
<blockquote><p>gource -s 0.001 &#8211;output-framerate 25 &#8211;highlight-all-users &#8211;stop-at-end &#8211;disable-progress &#8211;auto-skip-seconds 0.1 &#8211;file-idle-time 10 &#8211;max-files 1500 &#8211;multi-sampling -1280&#215;720 &#8211;stop-at-end   &#8211;output-ppm-stream &#8211; | ffmpeg -y -b 30000K -r 60 -f image2pipe -vcodec ppm -i &#8211; -vcodec libx264 -vpre hq -crf 28 -threads 0 fennec.mp4</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2010/02/fennec-1-0-gource/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Labyrinth Game in the browser</title>
		<link>http://dougt.org/wordpress/2009/12/labyrinth-game-in-the-browser/</link>
		<comments>http://dougt.org/wordpress/2009/12/labyrinth-game-in-the-browser/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 21:18:05 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[MozOrientation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=516</guid>
		<description><![CDATA[A few months ago, I mentioned the game Labyrinth and how I wanted this to work in the browser. Syd Lawrence took up the cause and put together a cool implementation. Play it here. You must be running Firefox 3.6 RC or better. This uses the new orientation events added to Firefox 3.6. Syd also [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, I mentioned the <a href="http://dougt.org/wordpress/2009/08/orientation/">game Labyrinth</a> and how I wanted this to work in the browser.  <a href="http://twitter.com/sydlawrence">Syd Lawrence</a> took up the cause and put together a cool implementation.</p>
<p>Play it <a href="http://playground.marmaladeontoast.co.uk/labyrinth">here</a>.  You must be running Firefox 3.6 RC or better.</p>
<p>This uses the new <a href="http://hacks.mozilla.org/2009/10/orientation-for-firefox/"> orientation events added to Firefox 3.6</a>.</p>
<p>Syd also put together a demo of what orientation looks like for those that do not have Firefox 3.6:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="340" height="285" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/M5GMWaGiV1g&amp;hl=en_US&amp;fs=1&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="340" height="285" src="http://www.youtube.com/v/M5GMWaGiV1g&amp;hl=en_US&amp;fs=1&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>This web feature is going to be standardized in the <a href="http://www.w3.org/">W3C</a> in one of two working groups.   The general idea is to separate out acceleration (values in <a href="http://en.wikipedia.org/wiki/Standard_gravity">g</a>) and orientation (values in degrees for azimuth, roll, pitch).  More on that next year when we figure out where the work will be done!</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/12/labyrinth-game-in-the-browser/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fast Flash in Fennec</title>
		<link>http://dougt.org/wordpress/2009/11/fast-flash-fennec/</link>
		<comments>http://dougt.org/wordpress/2009/11/fast-flash-fennec/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 20:14:47 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[fennec]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[npapi]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=506</guid>
		<description><![CDATA[For the last few days, we have been making Flash fast in Fennec. Our situation in Fennec is that we have a hidden browser element that contains the flash object/embed element. When a paint needs to happen, we draw whatever the plugin wants to draw into a canvas or sent of canvas elements. These canvas [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few days, we have been making Flash fast in Fennec.</p>
<p>Our situation in Fennec is that we have a hidden browser element that contains the flash object/embed element.  When a paint needs to happen, we draw whatever the plugin wants to draw into a canvas or sent of canvas elements.  These canvas elements are what the user sees on the screen &#8212; they are part of Fennec&#8217;s tile manager.  Now these draws to the tile manager consistent of a 16bpp to 24bpp conversion (I am told that the flash is optimized for 16bpp), then a copy to a gfxXLibSurface, then a final blit to the screen.  This final bit also contains a 24bpp-&gt;16bpp conversion because the screen is 16bpp.  To make matters much worse, many plugins intersect multiple canvases in the tile manager which causes this drawing path to happen multiple times per video frame.  The end result is that we were getting no more than 4-5 fps.</p>
<p>We took some incremental steps to improvement performance, but we were no where close to double digit fps.</p>
<p>At this point, we decided to just draw directly to the screen avoiding the tile manager completely.  This allowed us to render without any conversions and only one copy &#8212; the plugin could write directly to X11 shared memory.</p>
<p>In making this decision, we would lose a bunch of information that Gecko provides such as where the plugin should be position relative to other elements, and how it should be clipped.  The solution we came up with was to let Fennec tell each of the object and embed elements where they should be drawn.  The frame painting code would honor the position and clip that the front end set.  In this way, we could have plugins do the right thing during pans and when content is below the Fennec sidebars/urlbar.</p>
<p>You can check out how Fennec positions elements here:</p>
<p><a href="http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#2937">http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#2937</a></p>
<p>The end result in this work is that we get over 25fps when <a href="http://en.wikipedia.org/wiki/Sorenson_codec">Sorenson</a> encoded videos.  Over the next weeks and months, I hope to see more video content honoring Fennec&#8217;s user agent and provide optimized content.  (YouTube and other sites do not recognized Fennec&#8217;s UA, yet).</p>
<p>This fast path is only implemented on Maemo, but it can be implemented on any platform assuming the plugin has support to draw directly into a memory buffer.</p>
<p>You also can check out the details in bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=528551">528551</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/11/fast-flash-fennec/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Geolocation support in add-ons</title>
		<link>http://dougt.org/wordpress/2009/11/geolocation-support-in-add-ons/</link>
		<comments>http://dougt.org/wordpress/2009/11/geolocation-support-in-add-ons/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:03:19 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[geolocation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=500</guid>
		<description><![CDATA[Today, I checked-in a set of changes that will allow mozilla addons the ability to acquire the location information. It is pretty simple to do: geolocation = Cc["@mozilla.org/geolocation;1"] .getService(Ci.nsIDOMGeoGeolocation); geolocation.watchPosition(successCallback); In this trivial example, the object &#124;geolocation&#124; is fully compatible with the W3C&#8217;s geolocation object that exists under the navigator object in web content. &#124;successCallback&#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I checked-in a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=493615">set of changes</a> that will allow mozilla addons the ability to acquire the location information.  It is pretty simple to do:<br />
<code><br />
geolocation = Cc["@mozilla.org/geolocation;1"]<br />
                       .getService(Ci.nsIDOMGeoGeolocation);<br />
geolocation.watchPosition(successCallback);<br />
</code></p>
<p>In this trivial example, the object |geolocation| is fully compatible with the<a href="http://www.w3.org/TR/geolocation-API/"> W3C&#8217;s geolocation</a> object that exists under the navigator object in web content.  |successCallback| will be called when Firefox acquires your position.</p>
<p>The prompting of the user is left up to your application.  All addons hosted on addons.mozilla.org must <a href="https://wiki.mozilla.org/Update:Editors/ReviewingGuide#Reviewing_Geolocation_stuff">follow the guidelines</a> and prompt the user.</p>
<p>If you have questions about what is permissible, please contact <a href="mailto:dougt@dougt.org">me</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/11/geolocation-support-in-add-ons/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>how i made the 192 pushlog ugly</title>
		<link>http://dougt.org/wordpress/2009/09/how-i-made-the-192-pushlog-ugly/</link>
		<comments>http://dougt.org/wordpress/2009/09/how-i-made-the-192-pushlog-ugly/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 02:52:49 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[hg]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=494</guid>
		<description><![CDATA[in other words, how i screwed up a hg push. I wanted to push changes from mozilla-central to mozilla-1.9.2. The standard way is to: ============================================================= how to apply a m-c committed patch to a release branch ============================================================= hg qimport http://hg.mozilla.org/mozilla-central/raw-rev/ hg qpush hg qref -e # add approval information hg qfin . hg push What [...]]]></description>
			<content:encoded><![CDATA[<p>in other words, how i screwed up a hg push.  I wanted to push changes from mozilla-central to mozilla-1.9.2.  The standard way is to:</p>
<blockquote><p>
=============================================================<br />
how to apply a m-c committed patch to a release branch<br />
=============================================================<br />
    hg qimport http://hg.mozilla.org/mozilla-central/raw-rev/<changesetid><br />
    hg qpush<br />
    hg qref -e # add approval information<br />
    hg qfin .<br />
    hg push
</p></blockquote>
<p>What I did was basically the same thing, with a few shortcuts (insert your favorite story about how cutting corners can cause harm).</p>
<p>Basically I started out with a bug report.  It has the information about what it fixed, who reviewed it, who approved it, etc.  The first thing to do is verify that it all checks out and is a reasonable thing to do.  In the bug, there usually a comment with the hg changeset information.  Here was my first shortcut; I copied the url to the html version of the changeset from the bug, and run the qimport command.  `hg qimport` has no problem with importing that patch (which should probably generate an error, but anywayz).  What this did was imported a big html file &#8212; not what I wanted at all.</p>
<p>I then jumped over the `hg qref -e` command.  This would have allowed me to see the changeset&#8217;s original comment.  I would have been able to see that the qimport terribly failed.  Also, this is a good idea to do so that you can add the appropriate a=foopy approval flag(s).</p>
<p>The last shortcut I took was I didn&#8217;t do a sanity check by running `hg out -p` which would have shown me what I was pushing.  This is always a good idea to see what you are pushing.  Sure reliance on the tools is fine and dandy, but actually seeing what hg thinks it is going to push doesn&#8217;t hurt and only takes a few seconds.</p>
<p>3 shortcuts resulted in a skidmark on the 191 push log:</p>
<p><a href="http://hg.mozilla.org/releases/mozilla-1.9.2/rev/739c7a69d412">http://hg.mozilla.org/releases/mozilla-1.9.2/rev/739c7a69d412</a><br />
<a href="http://hg.mozilla.org/releases/mozilla-1.9.2/rev/1898753917d5">http://hg.mozilla.org/releases/mozilla-1.9.2/rev/1898753917d5</a></p>
<p>Sure there are worse things (e.g. patch bomb, pushing without testing, breaking trees), but I thought I would write this up both for clarification of how I messed up as well as a warning. <img src='http://dougt.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/09/how-i-made-the-192-pushlog-ugly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Orientation Update&#8230;</title>
		<link>http://dougt.org/wordpress/2009/08/orientation-update/</link>
		<comments>http://dougt.org/wordpress/2009/08/orientation-update/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 16:27:42 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[MozOrientation]]></category>
		<category><![CDATA[orientation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=469</guid>
		<description><![CDATA[A few days ago, I blogged about orientation support in Firefox.  I am happy to report that linux patches landed over the weekend.  (We also have Window Mobile and Thinkpads running Windows patches in the review process.) If you a linux laptop and have a few minutes, please download one of the Firefox Trunk nightly [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I blogged about <a href="http://dougt.org/wordpress/2009/08/orientation/">orientation support in Firefox</a>.  I am happy to report that <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=512345">linux patches landed</a> over the weekend.  (We also have <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513183">Window Mobile</a> and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513233">Thinkpads running Windows</a> patches in the review process.)</p>
<p>If you a linux laptop and have a few minutes, please download one of the <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mobile-trunk/">Firefox Trunk nightly builds</a> and try out orientation!</p>
<p><strong>What to try?</strong></p>
<p><a href="http://people.mozilla.org/~dougt/ori.html">http://people.mozilla.org/~dougt/ori.html</a></p>
<p>Let it run for a little bit, then shake your laptop (<em>not responsible for any damage <img src='http://dougt.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </em>).  After you have a couple dozen responses, send me the results including what distro and laptop you are using.</p>
<p><strong>Demos!</strong></p>
<p>While you are testing things out, check out the demo Michael Ventnor (m.ventnor at gmail.com) put together:</p>
<p><a href="http://dougt.org/random/orientationdemo/index.xhtml"><img class="alignnone" title="Orientation Demo" src="http://dougt.org/random/orientationdemo/demo-preview.png" alt="" width="507" height="453" /></a><br />
<a href="http://dougt.org/random/orientationdemo/index.xhtml">http://dougt.org/random/orientationdemo/index.xhtml</a></p>
<p><a href="http://twitter.com/dolske">Justin Dolske</a> has a few demos too:</p>
<ul>
<li><a href="https://people.mozilla.com/~dolske/tmp/seismo.html">Seismometer</a></li>
<li><a href="https://people.mozilla.com/~dolske/tmp/awesome.html">No idea, but it&#8217;s awesome</a></li>
</ul>
<p><span><a href="http://twitter.com/jruderman">Jesse Ruderman</a> also cleaned up the &#8220;ball&#8221; demo that I created making the animation <a href="http://www.squarefree.com/smoother-orientation-demo.html">smoother</a>.<br />
</span></p>
<p><strong>Help Wanted</strong></p>
<p>There are still other platforms that I would like to support.  I specifically would like to see Windows support using their Sensor API.  If you are interested in helping, file a bug, cc me, and take a look at the other implementations.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/08/orientation-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Orientation in Firefox and beyond</title>
		<link>http://dougt.org/wordpress/2009/08/orientation/</link>
		<comments>http://dougt.org/wordpress/2009/08/orientation/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 03:24:02 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[accelerometer]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[htc]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[MozOrientation]]></category>
		<category><![CDATA[orientation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=452</guid>
		<description><![CDATA[One of the coolest apps I saw when the iPhone came out was the wooden balance game Labyrinth.  You basically tilt your phone to move a ball around the screen, avoiding holes, and trying to get the ball to a goal.  It made use of a feature of many modern devices &#8212; accelerometers. Obviously clear [...]]]></description>
			<content:encoded><![CDATA[<p>One of the coolest apps I saw when the iPhone came out was the wooden balance game <a href="http://en.wikipedia.org/wiki/Labyrinth_%28game%29">Labyrinth</a>.  You basically tilt your phone to move a ball around the screen, avoiding holes, and trying to get the ball to a goal.  It made use of a feature of many modern devices &#8212; accelerometers.</p>
<p>Obviously clear that there should be a webapp for doing just that.  What was missing was a javascript API.</p>
<p>In recent Mozilla trunk builds, I have added support for an orientation event.  This new event will allow you to build applications and listen for changes in orientation.  (note, the first platform to support such an event is any MacBook Pro.  Others will follow).</p>
<p><strong>Simple Call:</strong></p>
<p>To use this new event, you will add an event listener as you normally would:</p>
<p>window.addEventListener(&#8220;MozOrientation&#8221;, orientationChange, true);</p>
<p>Your callback will be called, when there is a change in acceleration, passing the current orientation:</p>
<p>function orientationChange(o) {</p>
<p>}</p>
<p><strong>Simple Result:</strong></p>
<p>The passed object has 3 attributes &#8211; &#8220;x&#8221;, &#8220;y&#8221; and &#8220;z&#8221;.  Each value is between -1 and 1 where zero is the &#8220;balance point&#8221;.  For example, suppose you device is a MacBook Pro and it is sitting on a desk that is perfectly level, you would expect to see:</p>
<p>x = 0<br />
y = 0<br />
z = 1</p>
<p>x is the axis in the direction from the left side of the keyboard to the right side of the keyboard (basically the axis that is along the home row keys) is level.  If I lift up the left side of the keyboard, x will increase.  if I lift up the right side, x will decrease.</p>
<p>y is the axis in the direction from the front of the laptop (where the mouse is) to the back of the laptop.  If I lift up the front of the laptop (the side closest to me), y will decrease.  If I left the back towards the front, y will increase.</p>
<p>Got that?  Yeah, physics is pretty hard. <img src='http://dougt.org/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>x and y can easily be visualized.  If you have a recent trunk build for the Mac, try loading this demo page:</p>
<p><a href="http://people.mozilla.org/~dougt/ball.html">http://people.mozilla.org/~dougt/ball.html</a></p>
<p>z basically will tell you that the laptop is sitting right side up.  if z was -1, you would know that the laptop (probably closed) and is sitting on its screen.  Of course the value will change as you rotate the laptop / device in this direction.</p>
<p>Right now, there is only support for the Macbook Pro.  It is pretty easy to add support for different OSs.  We have code for Samsung Windows Mobile devices, and for the HTC Windows Mobile devices.  We still need support for linux and for Windows.  If you are interested in adding support file a bug and start looking at <a href="http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIAccelerometer.idl">http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIAccelerometer.idl</a></p>
<p>The API isn&#8217;t fixed and may change.  I do invite you to comment.  Keep in mind that we want a really simple and straight forward API to expose orientation events to web developers.  If your response has either &#8220;RDF&#8221; or &#8220;DCCI&#8221; in it, please reread the last sentence.  <img src='http://dougt.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Thanks again and hope you enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/08/orientation/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Geolocation Address</title>
		<link>http://dougt.org/wordpress/2009/07/geolocation-address/</link>
		<comments>http://dougt.org/wordpress/2009/07/geolocation-address/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 17:25:45 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[device api]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[geolocation]]></category>

		<guid isPermaLink="false">http://dougt.org/wordpress/?p=440</guid>
		<description><![CDATA[Last week, I pushed a change that will enable tomorrow&#8217;s trunk Firefox builds (Minefield) to access user-readable position information. For example, instead only being able to work with: 37.3882005, -122.0834553 You can see the physical address as: 650 Castro St, Mountain View, California, 94041, US This should help aide the many people that already know [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I pushed a change that will enable tomorrow&#8217;s trunk Firefox builds (Minefield) to access user-readable position information.</p>
<p>For example, instead only being able to work with:</p>
<p>37.3882005, -122.0834553</p>
<p>You can see the physical address as:</p>
<p>650 Castro St, Mountain View, California, 94041, US</p>
<p>This should help aide the many people that already know their physical address in familiar terms.</p>
<p>To access address elements, you simply do what you have been doing.  The only modification is to test to see if there is an address associated with the position, and if so, access it:</p>
<pre>
navigator.geolocation.watchPosition(successCallback)
function successCallback(position)
{
    if (position.address)
        alert(position.address.postalCode);
}
</pre>
<p>Other fields on the address object are:</p>
<pre>
address.streetNumber
address.street
address.premises
address.city
address.region
address.county
address.countryCode
address.postalCode
</pre>
<p>Please let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/07/geolocation-address/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Geolocation in Firefox 3.5 and Fennec</title>
		<link>http://dougt.org/wordpress/2009/04/geolocation-in-firefox-3-5-and-fennec/</link>
		<comments>http://dougt.org/wordpress/2009/04/geolocation-in-firefox-3-5-and-fennec/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:25:41 +0000</pubDate>
		<dc:creator>dougt</dc:creator>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[fennec]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[geolocation]]></category>

		<guid isPermaLink="false">http://dougt.wordpress.com/2009/04/30/geolocation-in-firefox-35-and-fennec/</guid>
		<description><![CDATA[I&#8217;m excited to introduce a new feature in Firefox 3.5 Beta 4 that I&#8217;ve been working on called geolocation. Geolocation is an opt-in tool that lets users share their location information with web sites through Firefox and will enable a new range of services on the web. Geolocation can make web sites smarter and you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m excited to introduce a new feature in Firefox 3.5 Beta 4 that I&#8217;ve been working on called geolocation. Geolocation is an opt-in tool that lets users share their location information with web sites through Firefox and will enable a new range of services on the web.  Geolocation can make web sites smarter and you more productive.  Websites that use geolocation will ask where you are in order to bring you more relevant information, or to save you time while searching. Let’s say you’re looking for a pizza restaurant in your area. A website will be able to ask you to share your location so that simply searching for “pizza” will bring you the answers you need…no further information or extra typing required.</p>
<p>This idea isn’t new.  We have been researching meshing geolocation data and the web for a few years.  Last year, Mozilla Labs released an experimental addon, Geode, which implemented the draft <a href="http://dev.w3.org/geo/api/spec-source.html">W3C Geolocation Specification</a>.  We added support for the spec to Firefox 3.5 and &#8220;Fennec&#8221; (our mobile browser which is in development) as well as a user interface that put the user in control of which websites could use location.  However, we left it to add-ons to implement the code that would actually figure out your location, using any technique (GPS, WiFi or cell tower triangulation, manual address entry) of their choosing.  So, with Firefox 3.1, 3.5 or Fennec, plus a third-party add-on, users would be able to use location-enabled websites.</p>
<p>However, we were still left with a chicken-or-egg problem: unless lots and lots of users installed an add-on, websites wouldn&#8217;t have a significant audience for which to develop location-enabled services; and without lots of useful web content using the feature, users had no reason to install an add-on.</p>
<p>We decided to investigate bundling a technology that would provide an end-to-end solution, so that the feature would work out of the box for users, and would give websites a large enough potential user base to kick start the development of innovative apps and services.  We had learned a lot from the discussions about the various add-ons that had been built, and in other forums over the last few years. Earlier this year, I hosted a talk on <a href="http://air.mozilla.com/wp-content/uploads/2009/03/location-2009-03-04.ogg">Location in Mozilla</a> during which we reviewed many of the critical privacy issues.  We boiled these down to some key principles:<br />
* protecting user privacy.</p>
<p>User privacy is super important to us and we believe that we have the best privacy policies regarding your data.  The use of the WiFi data, IP addresses, associated protocol bits, should never be used to spy on users, track individuals, or shared without your permission.</p>
<p>* enabling web developers to use the API in an unencumbered way that would work in all browsers that implement the spec</p>
<p>Web developers can use a standard way of accessing geolocation data and not have to worry about the underlying geolocation provider.  We don&#8217;t share with third-party location provider(s) any information about websites the user&#8217;s visiting; this protects both the user&#8217;s privacy, and the website&#8217;s right to write to a web standard without fear of any third party gaining insight into how the site is being used.</p>
<p>* preserving user choice</p>
<p>This feature is completely opt-in!  If you don&#8217;t do anything, geolocation is never used.  When a web page wants ask you for your location, you get an dialog similar to the one below.  If you do nothing, the feature stays off by default.  Only if you press &#8220;Tell them&#8221;, will you send out your location information.  Furthermore, users are free to use a different geolocation provider by installing addons.</p>
<p><a href="http://dougt.org/wordpress/wp-content/uploads/200907141613.jpg" onclick="window.open('http://dougt.org/wordpress/wp-content/uploads/200907141613.jpg','popup','width=920,height=100,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"><img src="http://dougt.org/wordpress/wp-content/uploads/200907141613-tm.jpg" height="100" width="920" border="1" hspace="4" vspace="4" alt="200907141613" /></a></p>
<p>* applicability to both Firefox and Fennec</p>
<p>To avoid fragmentation on the web, the geolocation feature should be consistent between the desktop and mobile.  The truth really is that the line is getting blurred between mobile and desktop.  Calling the geolocation feature &#8220;mobile only&#8221; discounts many use cases that are pretty important.</p>
<p>Given these principles and a strong desire to create an &#8220;out of the box&#8221; experience in Firefox and Fennec, and to kick start the location aware web, we are happy to announce that Firefox 3.5 and Fennec will be using Google Location Service.  We found that we agreed on the many privacy concerns around location.  Do check out Mozilla&#8217;s <a href="http://en-us.www.mozilla.com/en-US/legal/privacy/firefox-en.html">privacy policy</a> and Google&#8217;s <a href="http://www.google.com/privacy-lsf.html">privacy policy</a>.  I am pretty excited about these policies I think they are going to be the industry standard when it comes to network based geolocation providers.</p>
<p>Just to provide a bit of technical detail on what exactly is going on, below I will walk through a simple geolocation request.</p>
<p>1) A user goes to a page that has some Javascript that asks for a Geolocation.</p>
<p>2) When the user loads that page, we put up a dialog.</p>
<p>3) If they don&#8217;t click anything, or click no, we do not do any geolocation stuff and simply return an error to the requestor.</p>
<p>4) If they click yes, we drop into this <a href="http://mxr.mozilla.org/mozilla-central/source/dom/src/geolocation/NetworkGeolocationProvider.js#162">bit of code</a> which packages up the WiFi Access Point data into JSON and sends it to Google Location Services over HTTPS.  The URL is configurable by preferences (&#8220;geo.wifi.uri&#8221;).  The data sent includes a version number, access token, and an array of public WiFi access points data.  The access token basically acts like a two week cookie, and if you clear cookies in the browser, this value is deleted and a new one is used.</p>
<p>6) Lastly, the Google Location service returns a location.  It&#8217;s another json object that is an actual location.</p>
<p>That&#8217;s it. For more information, check out the <a href="http://en-us.www.mozilla.com/en-US/firefox/geolocation">Frequently Asked Questions</a>. Get ready for Firefox 3.5 and start thinking about how you can location aware your web apps!  Here is the <a href="http://www.w3.org/TR/geolocation-API/">spec</a>.</p>
<p>Got questions, feel free to ask.  I am looking for feedback.  Comments welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougt.org/wordpress/2009/04/geolocation-in-firefox-3-5-and-fennec/feed/</wfw:commentRss>
		<slash:comments>73</slash:comments>
		</item>
	</channel>
</rss>
