<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>zpao.com | blog</title>
    <link>http://zpao.com</link>
    <webMaster>paul@zpao.com (Paul O’Shannessy)</webMaster>
    <pubDate>Fri, 24 Apr 2009 21:32:21 GMT</pubDate>
    <description>AWESOME</description>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/zpao" type="application/rss+xml" /><feedburner:emailServiceId>zpao</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Undo Close Window Has Landed!</title>
      <link>http://zpao.com/articles/19-undo_close_window_has_landed</link>
      <description>&lt;p&gt;I&amp;#8217;m happy to announce the landing of &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=394759"&gt;Undo Close Window&lt;/a&gt;. This adds a menu &amp;#38; keyboard shortcut for reopening your previously closed windows. By default we store 3 windows (though sometimes more due to special cases involving pop-up windows). I&amp;#8217;m not going to go into further implementation details (because really, I know you don&amp;#8217;t care), but if you&amp;#8217;re interested, you can take a look at the patches on the bug.&lt;/p&gt;


	&lt;h2&gt;A Little History&lt;/h2&gt;


	&lt;p&gt;Sometime before Firefox 2, there were APIs in place for handling recently closed windows. The only thing missing at that point was the front-end work to tie it together. But that never happened. Instead, since the code wasn&amp;#8217;t even being published for extensions to use, all that was happening is that we were eating memory for no good reason. So the &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=344642"&gt;code was taken out&lt;/a&gt; late in the 2.0 development cycle.&lt;/p&gt;


	&lt;p&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=360408"&gt;Bug 360408&lt;/a&gt; was added for Firefox 3, making it possible for extensions to be able to implement their own Undo Close Window if they wanted. The description of that bug was unclear though, since it didn&amp;#8217;t actually adding any APIs, it just made sure the data was kept around long enough to be saved by somebody else.&lt;/p&gt;


	&lt;p&gt;Along comes &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=394759"&gt;Bug 394759 &amp;#8211; Add undo close window feature&lt;/a&gt;, which sat untouched for almost a year. After I finished the &lt;a href="http://zpao.com/articles/10-passwordmgr_storage"&gt;primary project I worked on during my internship&lt;/a&gt;, I still had a week left, so I looked for bugs that I found interesting and allowed me to explore a new area of the code. I found this bug and wrote a &amp;#8220;working&amp;#8221; patch over a weekend. At that point I was really surprised that we didn&amp;#8217;t have this already. We&amp;#8217;ve had Undo Close Tab for a while, and this seemed like the sensible next step. In all honesty, somebody familiar with the code involved here could have written that patch in an hour or two. That&amp;#8217;s when I found out that I had essentially reimplemented the code that had been taken out and added the front-end to it.&lt;/p&gt;


	&lt;p&gt;I worked on it a bit more before I was done interning, then went back to school and time to work on this became increasingly rare. I dropped the ball a bit, and then suddenly we were at string freeze, and this wasn&amp;#8217;t done. Fast forward a few months; I graduated &amp;#38; started working for Mozilla full time. I found out we were still going to have another string freeze for beta 4, so I got my patch out of bitrot and continued working on it. It needed more work and testing by then due to Private Browsing and a few other changes that were made. Strings went in right before we froze them &amp;#38; the actual patch went in very last minute, and only because code freeze had slipped for other reasons.&lt;/p&gt;


	&lt;p&gt;A huge thanks to Simon for all the reviewing he did and help he gave me, &lt;a href="http://autonome.wordpress.com/"&gt;Dietrich&lt;/a&gt; for the heroic &amp;#8220;today is code freeze&amp;#8221; review and help, &lt;a href="http://en.design-noir.de/"&gt;Dão&lt;/a&gt; for fixing the problems that popped up as this had a rocky landing (there was no time to bake on trunk), and &lt;a href="http://beltzner.ca/mike/"&gt;Beltzner&lt;/a&gt; for approving this without the normal bake time.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=FZrxU2C7g78:TOdQBzmpUsQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=FZrxU2C7g78:TOdQBzmpUsQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=FZrxU2C7g78:TOdQBzmpUsQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/FZrxU2C7g78" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 24 Apr 2009 21:32:21 GMT</pubDate>
      <guid>http://zpao.com/articles/19-undo_close_window_has_landed</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>sessionstore</category>
    </item>
    <item>
      <title>Changing Tab Load Order</title>
      <link>http://zpao.com/articles/18-changing_tab_load_order</link>
      <description>&lt;p&gt;During the Firefox work week last month, somebody had the idea of loading visible tabs first. It&amp;#8217;s one of those things that just make sense. Since I had done some work in the SessionStore component before, I volunteered to head up this task.&lt;/p&gt;


	&lt;h2&gt;What does it do exactly?&lt;/h2&gt;


	&lt;p&gt;When you open Firefox using session restore (and through some other paths), you often load several tabs. I know I&amp;#8217;ve personally restored windows with 50+ open tabs. It takes a lot of time to load 50 tabs. One optimization that was done previously was to (roughly speaking) prioritize the selected tab, so that it would in theory load first. This change make it so that the tabs visible in your tab strip are also prioritized.&lt;/p&gt;


	&lt;h2&gt;How does it work?&lt;/h2&gt;


	&lt;p&gt;When we were doing this for just the selected tab, it was extremely simple &amp;#8211; we just reordered the array of tab data so that the selected one was first. Now we prioritize a set of tabs (keeping the selected tab first). &lt;em&gt;That&amp;#8217;s it.&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;To be clear&lt;/strong&gt;, this does not &lt;em&gt;actually&lt;/em&gt; improve performance. All it does is make the browser feel faster. But hey, isn&amp;#8217;t that just as almost as important.&lt;/p&gt;


	&lt;p&gt;Go ahead and try it out. It&amp;#8217;s been in Minefield (mozilla-central) for over a week and landed in Shiretoko (mozilla-1.9.1) yesterday.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=JISZFRL8Jmo:5cQ76FpAHc0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=JISZFRL8Jmo:5cQ76FpAHc0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=JISZFRL8Jmo:5cQ76FpAHc0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/JISZFRL8Jmo" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 01 Apr 2009 17:38:48 GMT</pubDate>
      <guid>http://zpao.com/articles/18-changing_tab_load_order</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
    </item>
    <item>
      <title>Is The Tree Green? For Your Desktop</title>
      <link>http://zpao.com/articles/17-is_the_tree_green_for_your_desktop</link>
      <description>&lt;p&gt;&lt;a href="http://projects.tynsoe.org/geektool/"&gt;GeekTool&lt;/a&gt; is awesome. &lt;a href="http://isthetreegreen.com"&gt;Is the Tree Green?&lt;/a&gt; is awesome. So together they are &lt;span class="caps"&gt;SUPER AWESOME&lt;/span&gt;!&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/zpao/3382045487/"&gt;&lt;img src="http://farm4.static.flickr.com/3588/3382045487_01114ff567.jpg" title="isthetreegreen.py + GeekTool by zpao, on Flickr" alt="isthetreegreen.py + GeekTool by zpao, on Flickr" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;h2&gt;Python?&lt;/h2&gt;


	&lt;p&gt;Historically, I&amp;#8217;m a Ruby guy, but I started learning Python for a Django project I&amp;#8217;m (barely) working on. So I picked up a book here at work &amp;#38; decided to flex my pythons a little bit. You can laugh, it&amp;#8217;s punny.&lt;/p&gt;


	&lt;p&gt;The first pass of this took me ~20 minutes, and I just tidied it up this morning so it would take command line options.&lt;/p&gt;


	&lt;h2&gt;How?&lt;/h2&gt;


	&lt;p&gt;If you&amp;#8217;re reading this and actually need to know whether or not the tree is green, then you should be able to figure it out. GeekTool is &lt;span class="caps"&gt;OS X&lt;/span&gt; only, but there are similar programs for Windows and Linux.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s easy enough to do what I did in the image above. The program can take 2 arguments &lt;code&gt;treename&lt;/code&gt; and &lt;code&gt;output&lt;/code&gt;. Run it with &lt;code&gt;-h&lt;/code&gt; for usage.&lt;/p&gt;


	&lt;h2&gt;Code?&lt;/h2&gt;


&lt;script src="http://gist.github.com/84210.js"&gt;&lt;/script&gt;

	&lt;p&gt;A big thanks to Justin Dolske for &lt;a href="http://isthetreegreen.com"&gt;Is the Tree Green?&lt;/a&gt;. He deserves more credit for this than I.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=xjEJOdPIdjs:L-HRrBxGZ9E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=xjEJOdPIdjs:L-HRrBxGZ9E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=xjEJOdPIdjs:L-HRrBxGZ9E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/xjEJOdPIdjs" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 24 Mar 2009 23:08:39 GMT</pubDate>
      <guid>http://zpao.com/articles/17-is_the_tree_green_for_your_desktop</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>python</category>
      <category>geektool</category>
    </item>
    <item>
      <title>Your Browser is Special</title>
      <link>http://zpao.com/articles/16-your_browser_is_special</link>
      <description>&lt;p&gt;Roughly 6% of the people visiting this site in the past month were using &lt;span class="caps"&gt;IE6&lt;/span&gt;. That&amp;#8217;s mostly insignificant, but I despise &lt;span class="caps"&gt;IE6&lt;/span&gt; and had to do my part to put an end to it. So, following in the footsteps of &lt;a href="http://therissingtonpodcast.co.uk/"&gt;The Rissington Podcast&lt;/a&gt; (and surely others), I&amp;#8217;m serving up an &lt;span class="caps"&gt;IE6&lt;/span&gt; stylesheet complete with Comic Sans. I also put together a super tiny script that puts a special message up top.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/zpao/3376947996/"&gt;&lt;img src="http://farm4.static.flickr.com/3559/3376947996_7b3fa08bc4.jpg" title="Your Browser is Special by zpao, on Flickr" alt="Your Browser is Special by zpao, on Flickr" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;d been wanting to do this for a while, but it&amp;#8217;s finally done. I&amp;#8217;m using conditional comments to differentiate browsers. I used JavaScript to display the message so I wouldn&amp;#8217;t be adding clutter to my source, even if nobody else would see it. View the source if you&amp;#8217;re interested.&lt;/p&gt;


	&lt;p&gt;And yes, I&amp;#8217;m biased about the browser I&amp;#8217;m suggesting, but I&amp;#8217;m allowed to be.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=IiH5Ayzohi0:1aLNw1dzyjE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=IiH5Ayzohi0:1aLNw1dzyjE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=IiH5Ayzohi0:1aLNw1dzyjE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/IiH5Ayzohi0" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 23 Mar 2009 00:03:52 GMT</pubDate>
      <guid>http://zpao.com/articles/16-your_browser_is_special</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>blarg</category>
      <category>ie6</category>
      <category>browsers</category>
    </item>
    <item>
      <title>Here I Am, Back Again</title>
      <link>http://zpao.com/articles/15-here_i_am_back_again</link>
      <description>&lt;p&gt;I&amp;#8217;m now into my third week here at Mozilla, working on Firefox. It&amp;#8217;s been a tiring 2 weeks so far, but I&amp;#8217;ve enjoyed every second.&lt;/p&gt;


	&lt;p&gt;For those of you who don&amp;#8217;t know, I was an intern on the Firefox team last summer. I primarily worked on the password manager and a performance analysis tool. I was offered a full-time position soon after the summer ended, and while I did some looking around, I realized that I wanted to be at Mozilla. I loved the company, the people, and the work I would do&amp;#8212;so overall it was right for me.&lt;/p&gt;


	&lt;p&gt;After an extended winter break, I flew out here with Amanda on February 17&lt;sup&gt;th&lt;/sup&gt;, a Tuesday. Amanda had been looking at apartment stuff like a fiend, and while I helped, she found a bunch of great places for us to see and did the real work with that. So we spent Wednesday &amp;#38; Thursday looking at ~20 apartments. CitiApartments may (apparently) be the spawn of Satan when it comes to housing in SF, but Hilary was an incredibly helpful agent, if perhaps a little unconventional. It turns out that the apartment we really wanted was the first one we saw on Wednesday morning. Friday was spent making sure our application went through, and jumping through hoops to get my money from my bank in Pennsylvania in order to get certified checks. It all worked out; we signed our lease on Saturday and moved in Monday/Tuesday. We&amp;#8217;re working on making the place a bit more homey, but it&amp;#8217;s coming along and hopefully we&amp;#8217;ll have a little housewarming when there are places for people to sit.&lt;/p&gt;


	&lt;h2&gt;Back to Work&lt;/h2&gt;


	&lt;p&gt;I joined the team as we&amp;#8217;re wrapping up Firefox &lt;del&gt;3.1&lt;/del&gt; 3.5, and since I&amp;#8217;m already relatively familiar with the code base, I got to start working on fixing blockers &amp;#38; participating in &lt;a href="https://wiki.mozilla.org/Firefox3.1/Sprints"&gt;sprints&lt;/a&gt;. My first week was also a Firefox &amp;#8220;work week,&amp;#8221; where the Firefox team physically gets together (we&amp;#8217;re spread out around the world), and gets stuff done face-to-face. We came up with a bunch of good ideas for what we want to be and how to make people excited about Firefox&amp;#8212;that&amp;#8217;s where our sprints came from.&lt;/p&gt;


	&lt;p&gt;I look forward to working with everybody here and meeting those of you who I haven&amp;#8217;t met yet. Remember, I&amp;#8217;m not an intern this time around :)&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/zpao?a=lf9bhZXw-3c:ttIM_xv7GJI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?i=lf9bhZXw-3c:ttIM_xv7GJI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/zpao?a=lf9bhZXw-3c:ttIM_xv7GJI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/zpao?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/lf9bhZXw-3c" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 10 Mar 2009 16:52:12 GMT</pubDate>
      <guid>http://zpao.com/articles/15-here_i_am_back_again</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>life</category>
      <category>apartment</category>
    </item>
    <item>
      <title>YELL AT THE TV!</title>
      <link>http://zpao.com/articles/14-yell_at_the_tv</link>
      <description>&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;FRESHLY LAUNCHED&lt;/span&gt;:&lt;/strong&gt; &lt;a href="http://yellatthetv.com"&gt;Yell At The TV!&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;I just launched a new app that lets you yell at your TV via twitter. It&amp;#8217;s nothing fancy, but it was a good little bit of fun.&lt;/p&gt;


	&lt;h2&gt;Is &lt;span class="caps"&gt;LOST&lt;/span&gt; on yet?&lt;/h2&gt;


	&lt;p&gt;While this was an idea I had been kicking around for a while, it was the work done by Rick Olsen on &lt;a href="http://islostonyet.com/"&gt;Is &lt;span class="caps"&gt;LOST&lt;/span&gt; on yet?&lt;/a&gt; that made me decide to do this.&lt;/p&gt;


	&lt;h2&gt;Feature Poor&lt;/h2&gt;


	&lt;p&gt;It&amp;#8217;s worse than feature poor right now. There&amp;#8217;s only the first page right now.&lt;/p&gt;


	&lt;p&gt;Hopefully I&amp;#8217;ll be adding features over the next week or so. The primary thing I want to add is some support for hashtags, allowing you to view tweets for a show, season, or episode. Something like #lost-s05e01. It shouldn&amp;#8217;t be &lt;em&gt;that&lt;/em&gt; much work, so hopefully I&amp;#8217;ll find some time to do that.&lt;/p&gt;


	&lt;h2&gt;Dreamhost Pains&lt;/h2&gt;


	&lt;p&gt;I originally made this in &lt;a href="http://sinatra.github.com"&gt;Sinatra&lt;/a&gt;, but that didn&amp;#8217;t work out so well on Dreamhost for a few reasons. I fucked around for a bit trying to get it to work, but gave up and instead rewrote it using Ruby on Rails. I really do like Dreamhost, but for projects like this, it&amp;#8217;d be nice to host it with ease, using the framework of my choice.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;So give it a try: &lt;a href="http://yellatthetv.com"&gt;http://yellatthetv.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/zpao?a=ybs77jUx"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?i=ybs77jUx" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/zpao?a=K1jt5yfE"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/PSgg9ywlndU" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 22 Jan 2009 01:20:08 GMT</pubDate>
      <guid>http://zpao.com/articles/14-yell_at_the_tv</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>ruby</category>
      <category>non-work</category>
      <category>twitter</category>
      <category>yellatthetv</category>
    </item>
    <item>
      <title>Hey Hey-ey, Goodbye</title>
      <link>http://zpao.com/articles/13-hey_hey-ey_goodbye</link>
      <description>&lt;p&gt;Today I took my last final exam as a Carnegie Mellon student. It&amp;#8217;s been four and a half years, but it feels like just yesterday I got here. Pending that one last grade, today I became a &lt;a href="http://ism.cmu.edu/"&gt;Master of Information Systems Management&lt;/a&gt;. That degree joins my Bachelor&amp;#8217;s degree I finished up in May. I could go on and on about the value of my education or spend time evaluating the programs I was in, but I won&amp;#8217;t. I have a lot to say, so I&amp;#8217;ll save it for another time. I mean this to be brief.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s often said that college changes you. &lt;strong&gt;It&amp;#8217;s true.&lt;/strong&gt; I really grew up here; or maybe matured. Either way, Carnegie Mellon has had a huge impact on my life. I figured out what I want to do with my life; I made good friends; I fell in love; &lt;em&gt;I learned&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;Now it&amp;#8217;s time to move on, into the scary unknown of the real world. Working the ol&amp;#8217; daily grind, paying the bills, and so on. I&amp;#8217;ll be far from my family and friends. I look forward to it though&amp;#8212;it&amp;#8217;s the next big adventure.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;(Cue sappy music: &amp;#8220;A Whole New World&amp;#8221;)&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;Oh yea, did I mention that I&amp;#8217;ll be working on &lt;a href="http://getfirefox.com"&gt;the best damn browser&lt;/a&gt; out there?&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/zpao?a=Dy7WuTuG"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?i=Dy7WuTuG" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/zpao?a=DTwrWTND"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/SfftYUv_h4Q" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 15 Dec 2008 23:22:06 GMT</pubDate>
      <guid>http://zpao.com/articles/13-hey_hey-ey_goodbye</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>non-work</category>
      <category>carnegie-mellon</category>
      <category>life</category>
    </item>
    <item>
      <title>Yahoo! HackU 2008</title>
      <link>http://zpao.com/articles/12-yahoo_hacku_2008</link>
      <description>&lt;p&gt;This past week Yahoo! was on campus for their annual &lt;a href="http://developer.yahoo.com/hacku/"&gt;HackU&lt;/a&gt; event. This is the third year they have been doing it and each year it has gotten progressively larger.&lt;/p&gt;


	&lt;h2&gt;The Past&lt;/h2&gt;


	&lt;p&gt;The first year (2006), I think there was a single entry. I made it in time for the presentation and was pretty sad I hadn&amp;#8217;t had a chance to make anything.&lt;/p&gt;


	&lt;p&gt;Last year, I made a determined effort and hacked together my own entry &amp;#8211; &lt;a href="http://playground.zpao.com/yweather"&gt;yWeather&lt;/a&gt; &amp;#8211; and contributed to &lt;a href="http://flolcatr.com"&gt;flolcatr&lt;/a&gt;. These were among the six or so entries from Carnegie Mellon. I didn&amp;#8217;t win anything, though I&amp;#8217;m still pretty proud of yWeather. There was a 24-hour hack session on the last night, but I&amp;#8217;m pretty sure there was nobody there after midnight.&lt;/p&gt;


	&lt;h2&gt;This year&lt;/h2&gt;


	&lt;p&gt;This year there were 28 hacks! I was simply astounded at the number and variation of the entries this year. There were technically impressive hacks, humorous hacks, hacks that could change the web, and even some creepy hacks. We had some big hacker names from Yahoo! show up &amp;#8211; &lt;a href="http://lerdorf.com/"&gt;Rasmus Lerdof&lt;/a&gt; (creator of &lt;span class="caps"&gt;PHP&lt;/span&gt;), &lt;a href="http://kentbrewster.com/"&gt;Kent Brewster&lt;/a&gt; (hacker extraordinaire), and my new pal &lt;a href="http://paulisageek.com/"&gt;Paul Tarjan&lt;/a&gt; (creator of Search Monkey). I think there were people who actually pulled off the 24-hour hackathon, staying up the whole night. I know Paul was there when I left around 6am.&lt;/p&gt;


	&lt;p&gt;Last year I took advantage of the time and spent the week working on my hack. This year I didn&amp;#8217;t start until after midnight. I contributed a little bit to a hack (&amp;#8220;lolmonkey&amp;#8221;) with &lt;a href="http://matttthompson.com/"&gt;Mattt Thompson&lt;/a&gt; which uses &lt;a href="http://developer.yahoo.com/searchmonkey/"&gt;Search Monkey&lt;/a&gt; and creates an infobar in Yahoo! search results lolifying an image on the linked page. While not the craziest hack, we had fun with it. I think at this point we are both officially done creating tools/hacks that have anything to do with lolcats.&lt;/p&gt;


	&lt;h2&gt;Busses &amp;#38; the Blueprint Framework&lt;/h2&gt;


	&lt;p&gt;The other hack that I worked on uses the &lt;a href="http://mobile.yahoo.com/developers/roadmap"&gt;Yahoo! Blueprint framework&lt;/a&gt; for creating mobile applications. While not the most technically advanced hack, I think it was one with the most immediate value. It was called &amp;#8220;CMU Busses&amp;#8221;, and simply tells you the next 5 busses leaving Carnegie Mellon in either direction. You can see a screenshot on the &lt;a href="http://playground.zpao.com/bp_busses"&gt;project page&lt;/a&gt;. This is something I&amp;#8217;ve been wanting to make for a long time, and something I would actually use (no offense to the other hacks). This was a true &amp;#8220;hack&amp;#8221; &amp;#8211; I&amp;#8217;m scraping the &lt;span class="caps"&gt;PAT&lt;/span&gt; website with Ruby. My Ruby code is outputting &lt;span class="caps"&gt;PHP&lt;/span&gt; code (the departure times are hardcoded instead of doing a DB lookup). Then the rest of the script is using the &lt;span class="caps"&gt;PHP&lt;/span&gt; Blueprint framework that Yahoo! provides (after spending a while working it out).&lt;/p&gt;


	&lt;p&gt;I had originally planned to make this an iPhone application, but having never done Objective-C, I figured now wasn&amp;#8217;t the time to start. I had also wanted this application to be able to detect the user&amp;#8217;s &lt;span class="caps"&gt;GPS&lt;/span&gt; coordinates and find the closes 5 bus stops before showing departure times, but that had some barriers as well. In a future iteration hopefully we&amp;#8217;ll see that. The Blueprint framework is supposedly also able to convert a Blueprint application to an iPhone application, but that has not been released to the public yet. When it is released, I think I may publish what I have now as a first iteration.&lt;/p&gt;


	&lt;h2&gt;Some Other Highlights&lt;/h2&gt;


	&lt;p&gt;I got to hang out with some great people throughout the week. I also got treated to a dinner for all of the former Yahoo! interns at Fuel &amp;#38; Fuddle. It was a good time, getting to talk some technology and design with smart people.&lt;/p&gt;


	&lt;p&gt;As a result of working on the lolmonkey hack, Mattt and I were invited to dinner by Alicia at &lt;a href="http://buglabs.net"&gt;Bug Labs&lt;/a&gt;. They have a really cool product called &lt;span class="caps"&gt;BUG&lt;/span&gt;, which as they say on their website, &amp;#8220;is a collection of easy-to-use electronic modules that snap together to build any gadget you can imagine&amp;#8221;. I got to play with one and it&amp;#8217;s really neat. I wish I had some spare cash to get one. They also have some of the coolest package design I&amp;#8217;ve seen in a while. So if you&amp;#8217;re interested in hacking hardware, take a look at them &amp;#8211; they&amp;#8217;re cool people with a cool product, hacking on open source hardware and software.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/zpao?a=9F5oDMpL"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?i=9F5oDMpL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/zpao?a=rLYXVpX8"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/l4LLqsTdp7o" height="1" width="1"/&gt;</description>
      <pubDate>Sun, 12 Oct 2008 18:50:09 GMT</pubDate>
      <guid>http://zpao.com/articles/12-yahoo_hacku_2008</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>yahoo</category>
      <category>hacking</category>
      <category>php</category>
      <category>blueprint</category>
    </item>
    <item>
      <title>Making the New Password Manager Storage Faster</title>
      <link>http://zpao.com/articles/11-passwordmgr_storage_faster</link>
      <description>&lt;p&gt;When I first wrote the new storage module for the Password Manager, I took a few &amp;#8220;shortcuts,&amp;#8221; trying to keep my code &lt;span class="caps"&gt;DRY&lt;/span&gt;. Partially this was because of the first patch by Mrinal Kant, but mostly it was because I like to reuse code. This bit us just a bit.&lt;/p&gt;


	&lt;p&gt;I mentioned in my &lt;a href="http://zpao.com/articles/10-passwordmgr_storage"&gt;first post about this change&lt;/a&gt; that we were initially considerably slower in the critical &lt;code&gt;countLogins&lt;/code&gt; method. While it got improved before being checked in, it was still marginally slower (milliseconds on an abnormally large dataset).&lt;/p&gt;


	&lt;p&gt;As I said before, this was most likely since we were doing a &lt;code&gt;SELECT *&lt;/code&gt; on the &lt;code&gt;moz_logins&lt;/code&gt; table, and looping over the results and counting. This allowed me to reuse more code. Loops are a kind of slow, and since this was so important, I decided to speed it up.&lt;/p&gt;


	&lt;p&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=451479"&gt;I filed a bug&lt;/a&gt; just over a week ago entitled &amp;#8220;storage-mozStorage should use &lt;span class="caps"&gt;COUNT&lt;/span&gt; in countLogins&amp;#8221; &amp;#8211; which pretty much explains what the solution to the above problem. I created a patch which essentially just switched the mosStorage module to use &lt;code&gt;SELECT COUNT(1)&lt;/code&gt;. I reran the performance tests I created and we&amp;#8217;re doing much better now. There&amp;#8217;s still a miniscule loss in speed from the legacy storage module, but at this point, we&amp;#8217;ve done all that we can, and where the difference was milliseconds, its closer to millisecond.&lt;/p&gt;


	&lt;p&gt;This was &lt;a href="http://hg.mozilla.org/mozilla-central/rev/ce557eb9ef4a"&gt;checked in&lt;/a&gt; today (thanks Justin!).&lt;/p&gt;


	&lt;p&gt;And that&amp;#8217;s it. I have another patch in the pipeline and hopefully I&amp;#8217;ll have time to get it finished, approved, and reviewed for the freeze (whenever that is now).&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/zpao?a=mLogA8jr"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?i=mLogA8jr" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/zpao?a=sYb3s79x"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/LTxUB3we7cc" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 29 Aug 2008 01:01:47 GMT</pubDate>
      <guid>http://zpao.com/articles/11-passwordmgr_storage_faster</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>javascript</category>
      <category>passwordmgr</category>
      <category>sqlite</category>
      <category>mozstorage</category>
    </item>
    <item>
      <title>Password Manager now uses mozStorage</title>
      <link>http://zpao.com/articles/10-passwordmgr_storage</link>
      <description>&lt;p&gt;The other day &lt;a href="http://hg.mozilla.org//mozilla-central/index.cgi/rev/c2f416981fa3"&gt;my patch landed&lt;/a&gt; switching the Password Manager to use &lt;a href="http://developer.mozilla.org/en/docs/Storage"&gt;mozStorage&lt;/a&gt; (our wrapper around SQLite).  &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=288040"&gt;The bug&lt;/a&gt; had been up on Bugzilla for a long time, over 3 years, when I came across it at the end of June. I had been doing some Password Manager related work already by that point, so I decided I would do it. This is the story of that bug: the process, the hardships, the code (at least a bit). Keep in mind I was also doing work on my &lt;a href="http://zpao.com/articles/8-dtrace_treemaps_part_1"&gt;DTrace Treemaps&lt;/a&gt; at the time, went to Summit, and encountered more edge cases than I wanted, so this took longer than expected.&lt;/p&gt;


	&lt;h2&gt;Quick Features &amp;#38; Change Summary&lt;/h2&gt;


	&lt;p&gt;Some of this is discussed further down, so bear with me. One of the primary differences in the switch to using mozStorage is that we now store data in a database. Previously we were storing data in a text file, using lines and periods to separate data fields. Open &lt;code&gt;signons3.txt&lt;/code&gt; in your &lt;a href="http://support.mozilla.com/en-US/kb/Profiles"&gt;profile directory&lt;/a&gt; and take a look at it (assuming you&amp;#8217;ve saved a password before). All information was kept in memory, and when a new password was saved, the whole file would need to be rewritten. The same thing happened if you ever removed a saved password. Using a database means that we don&amp;#8217;t have to keep any (potentially) sensitive information in memory. It also means faster reading and writing since we don&amp;#8217;t have to read the whole file every time. These speed boosts are apparent especially in the speed tests, attached to the bug and summarized below.&lt;/p&gt;


	&lt;p&gt;Since this is really just a drop in change that must implement an &lt;span class="caps"&gt;API&lt;/span&gt;, to the outside world nothing has changed. Although the inner workings are different, it&amp;#8217;s the same to anybody who happens to use it (extensions or other parts of Firefox).&lt;/p&gt;


	&lt;h2&gt;v0.1 &amp;#8211; The beginning&lt;/h2&gt;


	&lt;p&gt;I began work by really taking a look at the &lt;a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/passwordmgr/src/storage-Legacy.js"&gt;legacy storage module&lt;/a&gt; to make sure I knew what was supposed to be happening. Then I looked at the initial attempts by other developers. The first attempts were made before Password Manager got rewritten, so those weren&amp;#8217;t relevant. Mrinal Kant came in (over 2 years after the first patches) and wrote what I used as the basis for my code. I don&amp;#8217;t think I ran it as it was, but it looked functional, at least at the core.&lt;/p&gt;


	&lt;p&gt;I actually started by just copying the legacy storage file, removing all of the code from methods that would need to be changed, and started fresh. I copied in some code from Mrinal&amp;#8217;s work and used some of the conventions, but the bulk of it was rewritten. I opted to use the wrapper we have for Storage, which makes it easy to do parameter replacement. This also automatically binds the parameters to a type &amp;#8211; so when you give it a string, it will ensure it&amp;#8217;s treated as a string. It&amp;#8217;s very handy.&lt;/p&gt;


	&lt;p&gt;This first version &amp;#8220;worked&amp;#8221; (at least as far as I remember), though it definitely had problems. I brought it up at our &lt;a href="http://wiki.mozilla.org/Firefox3.1/StatusMeetings/"&gt;weekly status meeting&lt;/a&gt; and it became one of the &amp;#8220;nice to have&amp;#8221; features for 3.1. That gave it some attention it needed and I got some quick feedback from &lt;a href="http://shawnwilsher.com"&gt;Shawn&lt;/a&gt; and &lt;a href="http://blog.mozilla.com/dolske/"&gt;Justin&lt;/a&gt;.&lt;/p&gt;


	&lt;h2&gt;v0.2 &amp;#8211; Database details&lt;/h2&gt;


	&lt;p&gt;One of the primary changes here was some of the database stuff. Shawn had pointed out that I needed a way to version the database. All I had was a method to create the tables. In order to future-proof this, I needed to make sure the schema was stored somewhere and there was a procedure for migrating the database.&lt;/p&gt;


	&lt;p&gt;I took a look at &lt;a href="http://mxr.mozilla.org/mozilla-central/source/toolkit/components/contentprefs/src/nsContentPrefService.js"&gt;nsContentPrefService&lt;/a&gt; (which stores your preferences for specific sites, like remembering zoom settings) since that was another component using storage and written in JavaScript. I &amp;#8220;hijacked&amp;#8221; the code related to the database stuff, and modified it a bit to fit my needs.&lt;/p&gt;


	&lt;p&gt;The other major change here was to replace &lt;code&gt;var&lt;/code&gt; with &lt;code&gt;let&lt;/code&gt; &amp;#8211; &amp;#8220;&lt;code&gt;let is the new var&lt;/code&gt;&amp;#8221; as my shirt says. A number of other changes were also made &amp;#8211; cleaning up queries, hard-coding the table names, and making sure I was using statements correctly.&lt;/p&gt;


	&lt;h2&gt;v0.3, v0.4 &amp;#8211; Cleanup &amp;#38; Optimization&lt;/h2&gt;


	&lt;p&gt;These versions were pretty light &amp;#8211; mostly involving cleanup. &lt;code&gt;modifyLogin&lt;/code&gt; and the process involved got improved. I also reduced the number of queries we were making by hand and so all &lt;code&gt;SELECT&lt;/code&gt;s were done from just 2 places (one for each table).&lt;/p&gt;


	&lt;h2&gt;v0.5 &amp;#8211; Importing&lt;/h2&gt;


	&lt;p&gt;v0.5 focused on importing from the legacy module. The basics were in the original code Mrinal wrote, but all of the edge cases were difficult to handle. The one case that caused a lot of problems were the &amp;#8220;user has a master password, but presses cancel when we import&amp;#8221;. We needed to handle that gracefully, and Justin and I decided the best way was to introduce a &lt;code&gt;_deferredInit&lt;/code&gt; method, which did the bulk of the initialization work. At the beginning of each public method, we then check the initialization state and try to import again. It can get annoying, but everything about the master password is annoying.&lt;/p&gt;


	&lt;p&gt;This also resulted in a couple bugs being spun off to help us with importing: &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=449810"&gt;one bug&lt;/a&gt; was just a few lines added to the legacy module and the password manager UI to handle an additional error, and &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=449095"&gt;the other&lt;/a&gt; was just to ensure the legacy module didn&amp;#8217;t create an empty file if it was never used.&lt;/p&gt;


	&lt;h2&gt;v0.6 &amp;#8211; Tests&lt;/h2&gt;


	&lt;p&gt;I finally got to writing the tests, which involved a lot of copy &amp;#38; paste from the legacy tests, then making small modifications. It&amp;#8217;s not the most efficient way, but it works ok. Since the mozStorage module works slightly differently, the code duplication is a necessity for now. In theory they can be cleaned up, but that&amp;#8217;ll be a task for the next intern :)&lt;/p&gt;


	&lt;p&gt;At this point I thought I was pretty much done, and I was. There were still a few problems though, and also not quite enough test coverage.&lt;/p&gt;


	&lt;h2&gt;v0.7, v0.8 &amp;#8211; Cleanup, Tests, Corrupt Databases&lt;/h2&gt;


	&lt;p&gt;v0.7 involved a lot of cleanup and adding tests. v0.8 was an important milestone in that I finally added the handling of a corrupt database. Before this point, if we encountered a corrupt database, we would fail and then as with a failed import, just try again and again. This was bad, really bad. So a &amp;#8220;thank you&amp;#8221; to Shawn for catching that. Now we backup the corrupt database and just create a new one. It should be difficult to get a corrupt database, but just in case (and to cover the case when people think they know what they&amp;#8217;re doing, but don&amp;#8217;t).&lt;/p&gt;


	&lt;h2&gt;v0.9, v1.0 &amp;#8211; Performance&lt;/h2&gt;


	&lt;p&gt;In one of the recent status meetings, &lt;a href="http://shaver.off.net/diary/"&gt;Mike Shaver&lt;/a&gt; asked me about performance. At that point I hadn&amp;#8217;t really done much except throw it up on the try server. The try server gives decent ball park figures, but it&amp;#8217;s not perfect. So Justin worked on getting &lt;a href="http://wiki.mozilla.org/StandaloneTalos"&gt;Standalone Talos&lt;/a&gt; working while I wrote some &lt;span class="caps"&gt;XPC&lt;/span&gt; shell &amp;#8220;tests&amp;#8221;. I discovered that while we were generally faster &amp;#8211; faster init, faster add, faster remove &amp;#8211; we were considerably slower for &lt;code&gt;countLogin&lt;/code&gt;, which is a critical path, since it gets called on every page. Over 90% of the that time was actually spent initializing &lt;code&gt;nsLoginInfo&lt;/code&gt; objects (since I tried to reuse code). This got improved, though we are still a couple milliseconds slower. This could likely be improved a little bit since we are still doing a &lt;code&gt;SELECT&lt;/code&gt; and looping over the results. A little bit more work needs to be done that way, so making the query use &lt;code&gt;COUNT&lt;/code&gt; would cut that out. Maybe I&amp;#8217;ll write another patch to do that before Beta 1. For now though, we&amp;#8217;ll keep doing it how we&amp;#8217;re doing it.&lt;/p&gt;


	&lt;h2&gt;And that&amp;#8217;s all&amp;#8230; almost&lt;/h2&gt;


	&lt;p&gt;After this got checked in, the Windows boxes turned orange on Tinderbox. This was because of the tests (trying to delete files). Justin and I thought we had a quick fix, committed that. As I was packing to come home, I got pinged on &lt;span class="caps"&gt;IRC&lt;/span&gt; since the boxes were still orange and it was my fault. So the tests for my changeset got backed out and we switched back to the legacy module, but the code was still in there.&lt;/p&gt;


	&lt;p&gt;On Sunday, my module &lt;a href="http://hg.mozilla.org/mozilla-central/index.cgi/rev/063c145b2a09"&gt;was re-enabled&lt;/a&gt; (thanks Justin!). There was &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=451040"&gt;another hiccup&lt;/a&gt; related to packages-static, but that was fixed as well. If you have any problems &lt;a href="https://bugzilla.mozilla.org/enter_bug.cgi?component=Password%20Manager&amp;#38;product=Toolkit"&gt;please report them on Bugzilla&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/zpao?a=PGnFhJQs"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?i=PGnFhJQs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/zpao?a=bbLc3dDi"&gt;&lt;img src="http://feeds.feedburner.com/~f/zpao?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/zpao/~4/qaZabOeXXd8" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 19 Aug 2008 03:55:43 GMT</pubDate>
      <guid>http://zpao.com/articles/10-passwordmgr_storage</guid>
      <author>paul@zpao.com (Paul O’Shannessy)</author>
      <category>mozilla</category>
      <category>firefox</category>
      <category>javascript</category>
      <category>passwordmgr</category>
      <category>sqlite</category>
      <category>mozstorage</category>
    </item>
  </channel>
</rss>
