<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
  <title>redfive standing by</title>
  <link rel="alternate" type="text/html" href="http://www.jgaunt.com/" />
  <modified>2009-04-17T07:51:36Z</modified>
  <tagline></tagline>
  <id>tag:www.jgaunt.com,2010://1</id>
  <generator url="http://www.movabletype.org/" version="3.31">Movable Type</generator>
  <copyright>Copyright (c) 2009, redfive</copyright>
  <entry>
    <title>postgres crontab queries</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2009_04_12.html#000102" />
    <modified>2009-04-17T07:51:36Z</modified>
    <issued>2009-04-16T23:39:04-08:00</issued>
    <id>tag:www.jgaunt.com,2009://1.102</id>
    <created>2009-04-17T07:39:04Z</created>
    <summary type="text/plain">At Songbird we have a server set up to receive crash reports from our users. It&apos;s the same system Mozilla uses, written largely by Google employees and it&apos;s called socorro. It&apos;s great having that data and there is a web...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Technology</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>At Songbird we have a server set up to receive crash reports from our users. It's the same system Mozilla uses, written largely by Google employees and it's called socorro. It's great having that data and there is a web app that you can run that will display the data, the stack frames, charts and other goodies. You can do some simple searches and see the top crashers over a certain period of time.</p>

<p>There is a lot of data there though, and to make really good use of it you need some automation. So I'm working on setting up some automatic queries to run each night via a crontab that will pull topcrash data and deposit the results in a file somewhere in such a manner that I can create a csv file and create a nifty chart for it.</p>

<p>The first step has been figuring out how to run a postgres query command in a crontab. It's taken some time but I've finally figured it out. I should make a little tutorial section somewhere like I did for extensions but I'm so busy I doubt I'll get to that. So here's a list and some links (I assume an already setup postgres socorro database with an additional user: crashreports_user)</p>

<p>- allow the crashreports_user to log in with a password. I didn't actually create the user, but I believe it was created something like this: http://www.ubuntugeek.com/howto-setup-database-server-with-postgresql-and-pgadmin3.html</p>

<p>- set up the permissions on the postgres server to allow a user to connect that *doesn't* exist as a system account (can't log into the machine): http://solyaris.wordpress.com/2008/08/09/setup-postgres-in-ubuntu/ (I also looked at the comments in the pg_hba.conf and pg_ident.conf files)</p>

<p>- the kicker was to set up my account on the machine with the password for the crashreports_user in a .pgpass file, like so: http://www.postgresql.org/docs/8.1/interactive/libpq-pgpass.html</p>

<p>After those steps I was able to run a psql command from the command line as the crashreporst_user and not get prompted for the password. Next step is to work on the proper sql query statement to return exactly the data I need.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Progress made on BZ webservice</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2009_01_25.html#000100" />
    <modified>2009-02-04T08:29:51Z</modified>
    <issued>2009-01-27T11:52:22-08:00</issued>
    <id>tag:www.jgaunt.com,2009://1.100</id>
    <created>2009-01-27T19:52:22Z</created>
    <summary type="text/plain">I&apos;ve been making some slow progress on the bugzilla webservice. Last week I actually found a couple of hours at work and time on the train and was able to get a functioning XMLHttpRequest based service running. I was actually...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Technology</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I've  been making some slow progress on the bugzilla webservice. Last week I actually found a couple of hours <a href="http://getsongbird.com/">at work</a> and time on <a href="http://www.caltrain.com/">the train</a> and was able to get a functioning XMLHttpRequest based service running. I was actually building the requests by hand initially but remembered that <a href="http://prototypejs.org/">Prototype</a> has <a href="http://www.prototypejs.org/api/ajax">an Ajax class</a> and switched the code over. It is making the code much sleeker and easier to read and maintain so far.</p>

<p>Part of the difficulty was my desire to understand the python SimpleXMLRPCService and to actually implement both XMLRPC over HTTP POST and a JSON implementation using HTTP GET. I have a server that is capable of handling both type of requests but like the JSON approach better so will probably trim down the server to reject anything but that.</p>

<p>The next hurdle is to start defining the actual interfaces I need. I have a basic idea of the functionality I want, and some wireframes scratched out on a legal pad, but I want to set down and really think through the API and the requirements. Mainly as an exercise in project mgmt.</p>

<p>After that it will be figure out the python connection to the db and how to run queries. That will include creating the webservice's object model and data storage mechanism (another db?).</p>

<p>ps - I put things in categories but they are so limited, I think I'll try adding tags and see if I like that better.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Python web service fun</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2009_01_04.html#000098" />
    <modified>2009-01-09T07:16:20Z</modified>
    <issued>2009-01-08T14:13:19-08:00</issued>
    <id>tag:www.jgaunt.com,2009://1.98</id>
    <created>2009-01-08T22:13:19Z</created>
    <summary type="text/plain">For a long time I&apos;ve wanted to put together a web service to host on my site. I always had modest goals in mind; start with a service to spit out movie lines, favorite lyrics, or quotes. I never got...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Web</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>For a long time I've wanted to put together a web service to host on my site. I always had modest goals in mind; start with a service to spit out movie lines, favorite lyrics, or quotes. I never got around to implementing them though, even when I was working on WSDL support at Netscape or flat-out investigating web services for opportunities there. I even put together some tools to auto-generate all the files and configuration you need for a Java based web service. (man what a pain!). </p>

<p>Today I finally got an XML-RPC service running for the first time, in Python. I've been playing around with it on the train to and from work, off and on, for a week or two. Today I finally had a chunk of solid time to dig and figure out my problem. (as it turns out, it was the lack of an actual procedure call -duh). While doing it I got to play around with the SimpleXMLRPCServer and BaseHTTPServer (because I thought I had to do something really tricky, which I didn't). In the end I got my little helloworld web service written and functioning. I'll post the code and maybe even host it on jgaunt.com for fun.</p>

<p>Part of what may have kicked me into gear to get this finally written was the end goal. This time around it's not just a silly web service. I have in mind a pretty complicated integration with bugzilla to allow me to do more tracking of the Songbird eng team. We have an agile shop going and as lead I need to keep a close eye on the bugs and having a tool that is written with that in mind should really help (versus the standard bugzilla query-based interface).</p>

<p>In other Songbird news I'm having a really good discussion with a couple of Mozilla engineers (:bs and :rstrong) over in bmo bug 472606 about appname and distributionId and the effect of changing how those pieces fit in to the application puzzle. I have an idea of what I think would work for Songbird, but I don't think Mozilla has the same requirements for customization (or end goals), so I may have to adjust my vision of what an ideal solution will be, hopefully we can hash our way into a solution that works for both parties and is backward compatible with what they need (we don't have anything to be backward compatible with!).</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Gathering thoughts and writing</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2008_09_14.html#000097" />
    <modified>2008-09-15T08:25:23Z</modified>
    <issued>2008-09-15T00:23:33-08:00</issued>
    <id>tag:www.jgaunt.com,2008://1.97</id>
    <created>2008-09-15T08:23:33Z</created>
    <summary type="text/plain">I&apos;m working on writing more posts and making them of some interest and hopefully some insight. To that end I&apos;m using the draft section of my blog software to actually draft my ideas and work on them over time. An...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>In my spare time</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I'm working on writing more posts and making them of some interest and hopefully some insight. To that end I'm using the draft section of my blog software to actually draft my ideas and work on them over time. An additional goal is to improve my writing skills which have gone seriously downhill since college. Instead of just firing up some jumbled series of thoughts I want to put some actual thought into each post, like a little mini essay.</p>

<p>Right now I have a draft about the information organization system I'm using at work and have another draft, in a text file, about some of the issues faced by companies that build their software on the XULRunner platform. It's not a bitch session but thoughts about the kinds of hurdles we face and how we can get over them. In the future I expect there will be more writings on Songbird, Mozilla and being in the open source software business as well as the digital media business. I'm also very interested in the productivity things going on lately and have <a href="www.43folders.com">43folders</a> on my feed, so I'm sure there will be more about that. (interestingly merlin has re-focused his site a bit and I really dig the new direction he's heading).</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Netflix gets a little cooler</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2008_02_03.html#000084" />
    <modified>2008-02-05T08:10:16Z</modified>
    <issued>2008-02-04T23:32:10-08:00</issued>
    <id>tag:www.jgaunt.com,2008://1.84</id>
    <created>2008-02-05T07:32:10Z</created>
    <summary type="text/plain">I know it&apos;s been out for a little while now, but I just tried the streaming service on Netflix tonight. It was pretty great. I have to hold out a little because my dsl at home is terrible and I...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>In my spare time</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I know it's been out for a little while now, but I just tried the streaming service on <a href="http://www.netflix.com">Netflix</a> tonight. It was pretty great. I have to hold out a little because my dsl at home is terrible and I was on their lowest of three levels for connectivity. So my picture wasn't that great and after 30 minutes or so I had to wait another 5 for the rest of the show to download, but still it was not bad.</p>

<p>I caught the first episode of <a href="http://www.nbc.com/Heroes/">Heroes</a> in case you're wondering. I came late to the party and started watching shortly into the second season during the "Save the cheerleader, save the world" plot line. Which, by the way, was genius. That tagline was enough to finally get me to tune in. Now I'm starting back at the beginning to see what I missed while I wait for the writers strike to end and new episodes to start up again.</p>

<p>And while on the subject, the studios need to pull their heads out of their collective butts and give the writers their additional % for dvd sales and their internet residuals. Lamers.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Doesn&apos;t take a rocket surgeon</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2007_12_30.html#000083" />
    <modified>2008-01-03T06:21:26Z</modified>
    <issued>2008-01-02T22:16:18-08:00</issued>
    <id>tag:www.jgaunt.com,2008://1.83</id>
    <created>2008-01-03T06:16:18Z</created>
    <summary type="text/plain">One of the things I got for Xmas was a 365 day calendar of Mensa logic puzzles. I realized today I was a couple behind already and sat down to see if I could catch up. I flipped to today...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>In my spare time</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>One of the things I got for Xmas was a 365 day calendar of Mensa logic puzzles. I realized today I was a couple behind already and sat down to see if I could catch up. I flipped to today and got the answer fairly quickly. The puzzle for the 1st is going to take a little more time but basically because of iteration.</p>

<p>Anyway, the point of this post is that the answer for each day is on the back...... OF THAT DAY!!! What kind of lamer thought that one up? Put the answer on the question? Put the answer on the back of the NEXT day, or even... 2 days away. Just to prevent accidental spoilers. Fortunately I glanced at the back of the day I solved. But phew that was close. For a bunch of geniuses they really didn't do that one too well. Oh well, they say Einstein couldn't tie his shoes, who am I to judge?</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Firefox, GMail and GTD</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2007_05_13.html#000082" />
    <modified>2007-05-17T05:32:36Z</modified>
    <issued>2007-05-16T21:15:28-08:00</issued>
    <id>tag:www.jgaunt.com,2007://1.82</id>
    <created>2007-05-17T05:15:28Z</created>
    <summary type="text/plain">I&apos;ve been trying to implement the Getting Things Done process in my life, on and off, for some time now. As in more than a year. I forget exactly how long, but if I looked back through my blog entries...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Web</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I've been trying to implement the Getting Things Done process in my life, on and off, for some time now. As in more than a year. I forget exactly how long, but if I looked back through my blog entries I'd find out spouting about how I thought it would slice my bread for me or something. I've had trouble getting it working in my life largely because it's a lifestyle shift. Putting everything into a system isn't so tough, but actually USING the system is where it gets tricky.</p>

<p>There is a lot of talk going on these days, all over the web about GTD and how people are making it work for themselves and what tools they use. I recently read an article that talked about some tricks in Gmail that were useful in implementing the lists. Instead of dismissing the idea ( it's email not a listing tool! ) I read through the article and then opened my Gmail tab and tried it. Neat. It worked.</p>

<p>Ah, but I have a work Gmail account and a home Gmail account and Gmail is very funny about letting you log into two accounts at the same time ( as in you can't do it - or maybe that was Gcal that didn't like it, anyway ). And while I'm going to use it for work related stuff I don't really want to HAVE to log in to my work Gmail to get my home stuff. Drats. This means I'd have to be constantly logging in and out of Gmail to send myself emails to remember to do stuff. What a pain in the.... side ( Stand up straight ).</p>

<p>Ah, but that's where the magic of Firefox comes in. A little known feature that wasn't completely removed, just hidden from common everyday use, was the profile manager. Yes, it still exists and you can use it! You have to set an environment variable first: MOZ_NO_REMOTE=1 under computer->properties->advanced->environment or something like that. Then open the shortcut to the app and add a '-p'  (no quotes) after the quoted string pointing to the firefox.exe. Launch it and you should see the profile manager pop up. Create two profiles and then open firefox using each one. You are now able to log into Gmail and Gcal twice!</p>

<p>Okay, so maybe not Earth-shattering, but pretty cool non-the-less.</p>

<p>I'm going to go through the steps to get this working and then write it all up here, so look for a link in the next few days. I'll have docs on Windows and Linux at least, don't know if I can get my hands on a Mac to try it out.</p>

<p>Now it's time for pizza and Heroes on DVR!!</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>SecurityCheckedComponent</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2007_03_25.html#000081" />
    <modified>2007-03-27T22:35:16Z</modified>
    <issued>2007-03-27T14:31:24-08:00</issued>
    <id>tag:www.jgaunt.com,2007://1.81</id>
    <created>2007-03-27T22:31:24Z</created>
    <summary type="text/plain">I&apos;ve been playing with nsISecurityCheckedComponent quite a bit lately and have been wrestling with getting it to work on a js implemented component. I was even trying to use aggregation to have an &apos;inner&apos; class do the implementation (need to...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Mozilla</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I've been playing with nsISecurityCheckedComponent quite a bit lately and have been wrestling with getting it to work on a js implemented component. I was even trying to use aggregation to have an 'inner' class  do the implementation (need to have nsISCC implemented on lots of classes).</p>

<p>I just discovered an issue that I hadn't expected. When implementing nsISCC and nsIClassInfo the call to getClassDescription is actually a check for a property and causes the canGetProperty() method to be called asking about classDescription. Good times. I hadn't even thought to add those pieces to the list of approved properties and methods. Now I know.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>u2b goodness</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2007_01_07.html#000080" />
    <modified>2007-01-12T03:46:49Z</modified>
    <issued>2007-01-11T19:45:05-08:00</issued>
    <id>tag:www.jgaunt.com,2007://1.80</id>
    <created>2007-01-12T03:45:05Z</created>
    <summary type="text/plain">Most of the stuff on YouTube is lame, but every now and then I find or get sent something BRILLIANT!!! Like this video mashup of Star Wars and Monty Python...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>In my spare time</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>Most of the stuff on YouTube is lame, but every now and then I find or get sent something BRILLIANT!!! Like this video mashup of <a href="http://www.youtube.com/watch?v=2CLwxObfaNE">Star Wars and Monty Python</a><br />
</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Tuesday Night Music Club</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2007_01_07.html#000079" />
    <modified>2007-01-10T06:28:30Z</modified>
    <issued>2007-01-09T21:46:28-08:00</issued>
    <id>tag:www.jgaunt.com,2007://1.79</id>
    <created>2007-01-10T05:46:28Z</created>
    <summary type="text/plain">Hey, that&apos;s neat. I was going to write a short blurb about how I had come home and wanted some mellow music but not super mellow and had seen Sheryl Crow in my collection and missed the copy of her...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>In my spare time</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>Hey, that's neat. I was going to write a short blurb about how I had come home and wanted some mellow music but not super mellow and had seen Sheryl Crow in my collection and missed the copy of her first album I lost. I then hopped on Yahoo Music and found it and realized how much I really like this album. </p>

<p>Then I went to write the post and realized it was actually Tuesday!!! Co-incidence? I don't think so. So I think I'm going to write a blog post on Tuesdays and call it my Tuesday Night Music Club. Maybe I'll even link to some music. ( I hope <a href="http://www.sherylcrow.com/">Sheryl Crow</a> doesn't mind ).</p>

<p>On a side-note, I watched the show <a href="http://www.nbc.com/Heroes/">Heroes</a> last night (re-run) for the first time and found it intriguing enough to add to my dvr. Felt like something Fox would have aired, just with the kind-of glamoury feel to it and the young cast. But then Lost feels a lot like that too (although I haven't watched that one since the first season). And kudos to NBC for providing <a href="http://www.nbc.com/Video/rewind/full_episodes/heroes.shtml">EVERY Heroes episode online</a>. Too bad my home internet connection blows chunks.</p>

<p>I think I'm going to try and follow a pattern for music links. I'll have to always have some Van Halen, or Aerosmith, and then something from a musical or movie soundtrack. After those two I think I'll try for something a little off beat, not that much of my music is very off-beat, and then just something else relevant.</p>

<p>So here's the selection for the first post.</p>

<p><a href="http://www.jgaunt.com/uploads/sheryl_crow_soak_up_the_sun.mp3">Soak up the Sun </a>from Sheryl Crow's C'mon C'mon album. Sadly I don't have Tuesday Night Music Club in my collection and I'm not about to post music I don't own.<br />
<a href="http://www.jgaunt.com/uploads/van_halen_could_this_be_magic.mp3">Could this be love</a>, a lesser known track from Van Halen's Women and Children First album. ( Sail away with someones daughter... ) This one's for you Dave.<br />
<a href="http://www.jgaunt.com/uploads/west_side_story_omc_cool.mp3">Cool</a>, from West Side Story, maybe the greatest musical EVER ( it _is_ based on Shakespeare afterall)<br />
And finally from Presidents of the United States of America, <a href="http://www.jgaunt.com/uploads/presidents_of_the_united_states_of_america_naked_and_famous.mp3">Nake and Famous</a>. Some of my favorite lyrics come from their debut album. "Those lucky suckers, they don't have to work, make 3D billboards and big 30 ft. Smurfs."</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>XPCOM Proxy</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2007_01_07.html#000078" />
    <modified>2007-01-09T18:56:37Z</modified>
    <issued>2007-01-08T18:50:39-08:00</issued>
    <id>tag:www.jgaunt.com,2007://1.78</id>
    <created>2007-01-09T02:50:39Z</created>
    <summary type="text/plain">I&apos;m digging around in the source for the XPCOM proxy implementation. Trying to determine how things work and how we should go about implementing some cross thread notification stuff for songbird. In particular we want to move from our current...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Mozilla</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I'm digging around in the <a href="http://lxr.mozilla.org/mozilla1.8/source/xpcom/proxy/src/">source</a> for the <a href="http://www.mozilla.org/projects/xpcom/Proxies.html">XPCOM proxy</a> implementation. Trying to determine how things work and how we should go about implementing some cross thread notification stuff for songbird. In particular we want to move from our <a href="http://publicsvn.songbirdnest.com/trac/browser/trunk/components/dataremote">current dataremote system</a> which uses prefs to pass only strings, integers and booleans around to a <a href="http://wiki.songbirdnest.com/index.php/Controller_%26_State_Service_Architecture">system</a> that can pass nsISupports pointers and objects around. We're planning on using this system for publishing the progress of background jobs and want to be able to reflect that in the UI, so we're looking into ways to proxy notification calls from background threads to the UI thread, or just to any old thread you might be on.</p>

<p>More in the extended text...</p>]]>
      <![CDATA[<p>The hope was that the proxification step would only happen if the notification was coming on a different thread. But that doesn't appear to be the case. Instead it all depends on whether the calling code is on a different thread then the one passed to the ProxyManager. As you can see in the implementation for <a href="http://lxr.mozilla.org/mozilla1.8/source/xpcom/proxy/src/nsProxyObjectManager.cpp#205"> nsProxyObjectManager::GetProxyForObject</a>. If the requested event queue is on a different thread from the code of the caller then a proxy is created (or found and returned); if the thread is the same then the object is just handed back. Now I knew that the original object would get called ( as opposed to the proxy ) in some cases but I was hoping it would be if the actual call occured on a different thread than then the requested, not if the proxy was obtained on the same thread.</p>

<p>We were planning on creating a base class that would handle the proxy step for listener management. When a listener would call addListener(this) to a job the it would get added to a listener list. If the requested queue is different than the thread that the notification would happen on then a proxy would be stored, otherwise it would just be the object. But that doesn't really work ( and now that I think of it doesn't even make much sense!!! ).</p>

<p>So I guess there are 2 options open to us:<br />
1) When storing the listeners ALWAYS create a proxy since we never know if the threads will be different</p>

<p>or</p>

<p>2) When notifying the listeners, get a proxy object before making each call. This could be handled through an enumeration interface that just creates a container of proxied objects and hands it back.</p>

<p>And when I look at those two options, option one is WAY better. Consider that any one object might make multiple calls to update its status; To have to call getProxyForObject each time for the entire list of listeners ( could be one could be one hundred and one ) would whistle beef.</p>

<p>Well, that's our little headache and I think option 1 is the way to go. Let's look at the proxy stuff a little more before we go...</p>

<p>The proxy code actually creates a little linked list for each object that you request a proxy for. The root object of that list is linked to the nsISupports interface, each additional proxy in the chain represents a different interface on the object. When you do a QI on a proxied object it walks through the chain until it finds the internal proxy container that links to the specific object and interface requested. Took me a bit of poking around to figure that out but neat!</p>

<p>Then I thought 'Okay, I see how the QI works, but it just hands back a handle to the nsProxyEventObject object, how do the methods get called on the right thing', and that's when I found the CallMethod() override and the nsProxyObject class. The nsProxyEventObject overrides the CallMethod call so that it pushes the call to the wrapped nsProxyObject. It is in that object where the method gets posted to the right event queue. It also appears that it is because of the magic of XPTCall that this works. I read the docs <a href="http://lxr.mozilla.org/mozilla1.8/source/xpcom/reflect/xptcall/porting.html">over here</a> <a href="http://www.mozilla.org/scriptable/xptcall-faq.html"> and here</a> by jband to get a little explanation but it sounds like some crazy business. I'll save an in depth study for XPTCall when I have a week of spare time on my hands. </p>

<p>But in short there is some low level code that builds call frames that allow any xpcom object to masquarade as any other (I think). The XPTCall code was desigend to allow just that case and the ability to call across threads. XPConnect uses it alot and the proxy stuff uses it too.</p>]]>
    </content>
  </entry>
  <entry>
    <title>Upcoming mozilla docs</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2006_12_31.html#000077" />
    <modified>2007-01-05T04:32:50Z</modified>
    <issued>2007-01-04T20:20:31-08:00</issued>
    <id>tag:www.jgaunt.com,2007://1.77</id>
    <created>2007-01-05T04:20:31Z</created>
    <summary type="text/plain">I&apos;ve been doing a bunch of architecture work at Songbird for the past month or two. A large part of that has been digging around in mozilla source and asking questions in #developers to find out if certain things are...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Mozilla</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I've been doing a bunch of architecture work at Songbird for the past month or two. A large part of that has been digging around in <a href="http://lxr.mozilla.org">mozilla source</a> and asking questions in #developers to find out if certain things are possible and how to do them. I've been focusing on browser related stuff and in particular I've been looking at adding tabbed browsing to Songbird and adding an API for website to use that will give access to songbird controls (Yeah, I know security issue!!! ).</p>

<p>We're going to be posting all the docs we wrote on <a href="http://www.songbirdnest.com">our website</a> very soon so I won't get into the details of our plans here. But I will be writing some posts that detail some of the interesting things I've learned and discovered. I just feel that part of being in the mozilla community is contributing to the documentation as I go. If I get enough stuff on any particular section that it makes sense to move it over to one of the mozilla wikis I'll, of course, do that.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Comment test</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2006_12_31.html#000076" />
    <modified>2007-01-02T22:21:06Z</modified>
    <issued>2007-01-02T14:19:46-08:00</issued>
    <id>tag:www.jgaunt.com,2007://1.76</id>
    <created>2007-01-02T22:19:46Z</created>
    <summary type="text/plain">Just a test post with the comments turned on to see how much comment spam I&apos;m getting these days. I forget if I&apos;ve done anything specific to fight the spam....</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>Site Announcements</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>Just a test post with the comments turned on  to see how much comment spam I'm getting these days. I forget if I've done anything specific to fight the spam.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Happy people</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2006_12_24.html#000075" />
    <modified>2006-12-28T20:30:33Z</modified>
    <issued>2006-12-28T11:54:01-08:00</issued>
    <id>tag:www.jgaunt.com,2006://1.75</id>
    <created>2006-12-28T19:54:01Z</created>
    <summary type="text/plain">I was reading a blog post talking about happy people and how some a-lister blog guy said he was going to hang out with happy versus unhappy people. The article went on to talk a bunch about happiness and mental...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>In my spare time</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>I was reading a blog post talking about happy people and how some a-lister blog guy said he was going to hang out with happy versus unhappy people. The article went on to talk a bunch about happiness and mental health and stuff. Down towards the bottom of the article was a quote I thought was fabulous and had to post right away:</p>

<blockquote>Remember the flight attendant's advice... you must put on your own oxygen mask first.</blockquote>

<p>I really like the blog it came from and I highly recommend reading it. You can read the whole article over here: <a href="http://headrush.typepad.com/creating_passionate_users/2006/04/angrynegative_p.html"><br />
creating_passionate_users blog</a></p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Happy Holidays</title>
    <link rel="alternate" type="text/html" href="http://www.jgaunt.com/archives/week_2006_12_24.html#000074" />
    <modified>2006-12-28T05:17:50Z</modified>
    <issued>2006-12-27T21:14:17-08:00</issued>
    <id>tag:www.jgaunt.com,2006://1.74</id>
    <created>2006-12-28T05:14:17Z</created>
    <summary type="text/plain">Spending some time cleaning up the den and happened to be restarting my computer a couple of times to install some updates. It seemed like a good time to drop a little post on the blog and wish folks a...</summary>
    <author>
      <name>redfive</name>
      
      <email>redfive@jgaunt.com</email>
    </author>
    <dc:subject>In my spare time</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.jgaunt.com/">
      <![CDATA[<p>Spending some time cleaning up the den and happened to be restarting my computer a couple of times to install some updates. It seemed like a good time to drop a little post on the blog and wish folks a happy holiday for whatever holiday they are celebrating. And if, by chance, you aren't celebrating a holiday right now, Happy December and Merry Winter!</p>

<p>And who knows, maybe the New Year will see a trickle of activity in this space. I've been wanting to start making some Mozilla/Firefox/Songbird posts here or perhaps on my work blog so maybe I'll split them up a little and have some fun with it.</p>]]>
      
    </content>
  </entry>

</feed>