Planet Mozilla Interns

August 30, 2010

Brian Louie

Introducing the new MDN website

(This is the same article that can be found on the Hacks blog and is an updated version of the draft that was posted here last week. Thanks to Jay Patel for co-writing this with me.)

This week, Mozilla unveiled the newly redesigned Mozilla Developer Network, the latest incarnation of MDC. The website has evolved over the years and we recently decided to change the name from Mozilla Developer Center to the Mozilla Developer Network (MDN) to better reflect the developer segments that make up our community and provide a better platform for engaging developers in the Mozilla mission and our plans for pushing the open Web forward. In this blog post, we’ll walk you through some of the new features and content, in addition to some of the things you can expect in the months to come.

Our Mission
Upon first glance, the most obvious change is that the website has undergone a radical overhaul: from top to bottom, the entire MDN looks different. Even the tagline underneath the title is new: the Mozilla Developer Network is “a comprehensive, usable, and accurate resource for everyone developing for the Open Web.”

The idea behind the tagline is perhaps the biggest change we’ve made to the MDN: we wanted to create a place where all web developers – not just people who develop using Mozilla technologies – can find the resources they need to make the Internet at-large a better place. This fundamental premise drove many of the design decisions incorporated into the new MDN.

The New Home Page
One of our main goals for this redesign was to streamline and simplify the process of finding information. Because the MDN home page is the first page most people will see when they visit the MDN, we wanted to make sure a diverse set of users could access as much information as possible without cluttering the page.

Throughout the page, there are several opportunities for the user to sign up for an MDN account; if you already have an MDC/Deki account there’s no need to sign up again. If you’re new to MDN, you can easily register to join our community. Members will be able to log in to both the Developer Forums and the Docs Wiki.

The page also features a promo box with revolving panes highlighting important open Web technologies and tools. The goal of the promo box is to direct developers to the pages about technologies that are most likely to be pertinent to their work, which helps reduce the number of steps it takes to reach a desired article. There are a lot of things happening at Mozilla that developers will care about, so this is where we hope to provide every visitor a chance to learn more about those topics.

Moreover, the main content of the page will be available through a tabbed interface that will allow users to click through to whichever section in which they are interested. We currently have Docs and News but have plans to add Tools and Events as well. There are plans for the sidebar as well, but for now we have provided a live Twitter feed so that users can get a feel for what various Mozilla communities are talking about and sharing. We will eventually add trending topics based on activity from around the MDN, streams for conversations in the forums, and the latest web technology demos and experiments.

Site Architecture
The new MDN header contains a search bar and click-through access to various sections through the primary navigation. The MDN’s content has been separated into four main categories, each of which has its own navigation item: Web, Mobile, Add-ons, and Applications. This segmentation of the navigation allows us to organize content into non-overlapping buckets, which should more precisely direct developers to the content they need. Then we have the universal Docs – which takes users to a landing page leading to various articles and content from the Docs Wiki – and Community – which takes users to the Developer Forums for now – navigation items. Since those two areas are applicable to all developer segments, we kept them separate in the navigation layout.

Each content page has a similar format: we feature a few popular articles for each category, some Mozilla-supplied tools, related news and updates, and a feed with relevant tweets. At the bottom of each page, there will eventually be popular forum topics and community comments. (Only the Add-ons page has this content right now). If you don’t find what you’re looking for on the landing page for any given category, there are links in each section of the page that take you to more options and pages. Despite the design overhaul, all of the information from the previous MDC remains intact, so there’s no need to worry about losing important articles. It’s all there and works exactly the same way as before.

Also, any information that can be accessed via the Docs landing page can also be accessed from other pages on the MDN, but we wanted to provide an alternative way of presenting the information: we highlight some important web development topics, in addition to important topics from the other categories. There are also fun features like Doc of the Day and Most Active Docs, in case you’re interested in what everyone else is looking at.

Growing the Community
The final navigation item in the header is for Community and perhaps the most important addition to the new MDN: Developer Forums. In the previous version of the MDN, although there was plenty of documentation to be found, we didn’t provide developers much of an opportunity to talk, discuss, and ask questions. We felt that, in our goal to make the MDN a central hub for web developers, forums comprised an important feature to incorporate into the new version.

Right now, there are five broad topics for discussion: Open Web, Mozilla Platform, MDN Community, Mozilla Add-ons, and Mozilla Labs. These domains should be able to cover much of the wide gamut of available discussion topics, but if not, we can always add new ones. Because the forums are new, they are still in the experimental stage; if you have any feedback for us, just use the feedback link at the bottom of the page. Feel free to start new threads and ask questions about anything, especially if it’s about documentation or the open web in general.

We’d love for you to try out the new forums! Again, if you have an account for MDC/Deki, you can use that to log in; if not, you can use the link in the upper-right corner to become an MDN member.

Submitting Feedback
At the bottom of every page, there’s a link to submit feedback on the new MDN pages. Whether there’s something wrong or there’s something you’d like to see (or whether you’d just like to say hello!), just hit that link and let us know what’s on your mind. We’ll do what we can to integrate your ideas to make the Mozilla Developer Network a better place for all developers.

Next Steps
Though we have made quite a few changes to the Mozilla Developer Network, they certainly are not the last. As the MDN continues to expand, we have decided to create a next-generation Docs platform that the Mozilla web development team will be building on Django, similar to the one being implemented for the new SUMO site. Planning is already underway, and we hope to migrate documentation over sometime in 2011.

Once we’ve converted all the content over, we plan to improve the way you find information via the search bar. So far, we have been devising ways to improve the tagging system and make sure that localized versions of articles are released as soon as possible. In addition, with the help of article rating and commenting systems, we can help make sure that the most relevant and accurate results are mentioned at the top of each search query. And finally, we are building a system that allows community experts in particular fields to regulate editing and writing of articles in their domains.

We’re also looking to expand the Community tab. Though we expect the forums to remain the centerpiece of that section of the site, we hope to also bring you news, updates, and other community-sourced content.

We hope that this has helped you get acquainted with the new Mozilla Developer Network. As always, we are amenable to your feedback and ideas, as we are as eager as you are to make the MDN an even better place for web developers to write, read, and discuss important Web topics. We look forward to hearing from you, and we hope you like the new MDN.

Thanks!
- Jay & Brian (+ the MDN team)


August 30, 2010 08:01 PM

August 25, 2010

Brian Louie

Welcome to the new Mozilla Developer Network!

(This is the first draft of a blog post that will soon be published on the Hacks blog; it will be edited accordingly throughout the day, but you can get a sneak peek of it now. This was written with the guidance of Jay Patel.)

Today, Mozilla is excited to unveil the newly redesigned Mozilla Developer Network. You can take a look at it yourself at the same address as always (http://developer.mozilla.org), but in this blog post, we’ll walk you through some of the new features and content, in addition to some of the things you can expect in the months to come. Feel free to open up the page yourself to follow along as we give a tour through the new pages.

Our Mission

At first glance, the most obvious change is that the website has undergone a radical overhaul: from top to bottom, the entire MDN looks different. Even the tagline underneath the title is new: the Mozilla Developer Network is “a comprehensive, usable, and accurate resource for everyone developing for the Open Web.”

The idea behind the tagline is perhaps the biggest change we’ve made to the MDN: we wanted to create a place where all open Web developers – not just people who develop using Mozilla technologies – can find the resources they need to make the Internet at-large a better place. This fundamental premise drove many of the design decisions incorporated into the new MDN.

The New Home Page

One of our main goals for this redesign was to streamline and simplify the process of finding information. Because the MDN home page is the first page most people will see when they visit the MDN, we wanted to make sure users could access as much information from it as possible without cluttering the page.

Throughout the page, there are several opportunities for the user to sign up for an MDN account; if you already had an account on the previous MDN, there’s no need to sign up for another, but if you’re just joining us as we expand the site, you can easily join the community, hassle-free.

The page also features a promo box with three revolving panes highlighting important open Web technologies and tools. The goal of the promo box is to direct developers to the pages about the technologies that are most likely to be pertinent to their work, which helps reduce the number of steps it takes to reach a desired article.

Moreover, we have provided a live Twitter feed so that users can get the most updated information and documentation, and below, we provided quick links to important documentation articles. Switching panes in the bottom box also gives the user access to community news and updates.

The New Content Pages

At the top of every page (including the home page) there is a header that contains a search bar and click-through access to various tabs. The MDN’s content has been separated into four main categories, each of which has its own tab: Web, Mobile, Add-ons, and Applications. This tabbed structure allows us to organize content into non-overlapping buckets, which should more precisely direct developers to the content they need.

Each content page has a similar format: we feature a few popular articles for each category, some Mozilla-supplied tools, related news and updates, and a feed with relevant tweets. At the bottom of each page, there are also popular forum topics and community comments (which we’ll discuss in a bit). If you don’t find what you’re looking for on the landing page for any given category, there are links in each section of the page that take you to more options and pages. Despite the design overhaul, all of the information from the previous MDN remains intact, so there’s no need to worry about losing important articles.

There’s also a Docs tab in the header. Any information that can be accessed via the Docs landing page can also be accessed from some other page on the Network, but we wanted to provide an alternate way of presenting the information: we highlight some important web development topics, in addition to important topics from the other categories. There are also fun features like Doc of the Day and Most Active Docs, in case you’re interested in what everyone else is looking at.

Growing the Community

The final tab in the header is the Community tab. This tab introduces the MDN’s newest feature, community forums. In the previous version of the MDN, although there was plenty of documentation to be found, we didn’t provide developers much of an opportunity to talk, discuss, and ask questions. We felt that, in our goal to make the MDN a central hub for open Web developers, this was an important feature to incorporate into the new version.

Right now, there are five broad topics for discussion: Open Web, Mozilla Platform, MDN Community, Mozilla Add-ons, and Mozilla Platform. These domains should be able to cover much of the wide gamut of available discussion topics, but if not, we can always add new ones. Because the forums are new, they are still in the experimental stage; if you have any feedback for us, just use the feedback link at the bottom of the page.

We’d love for you to try out the new forums! For now, if you have an account on the Deki platform from the old MDN, you can use that account; if not, you can use the link in the upper-right corner to make a new one.

Submitting Feedback

At the bottom of every page, there’s a link to submit feedback on the new MDN pages. Whether there’s something wrong or there’s something you’d like to see (or whether you’d just like to say hello!), just hit that link and let us know what’s on your mind. We’ll do what we can to integrate your ideas to make the Mozilla Developer Network a better place for all developers.

Next Steps

Though we have made quite a few changes to the Mozilla Developer Network, they certainly are not the last. Most prominently, the new staging pages still link to articles on the MindTouch Deki platform. Though this platform has served us well over the past few years, we’ve decided that, as the Network continues to expand, it was time to look elsewhere. Thus we are transitioning all of our documentation from the Deki platform to a new Django platform, similar to the one being implemented by the new SUMO site. You can expect this to happen early next year. (this might not actually be correct…)

Once we’ve converted all the content over, we plan to improve the way you find information via the search bar. So far, we have been devising ways to improve the tagging system and make sure that localized versions of articles are released as soon as possible. In addition, with the help of article rating and commenting systems, we can help make sure that the most relevant and accurate results are mentioned at the top of each search query. And finally, we are building a system that allows community experts in particular fields to regulate editing and writing of articles in their domains.

We’re also looking to expand the Community tab. Though we expect the forums to remain the highlight of that section of the site, we hope to also bring you news, updates, and other community-sourced content.

We hope that this has helped you get acquainted with the new Mozilla Developer Network. As always, we are amenable to your feedback and ideas, as we are as eager as you are to make the MDN an even better place for web developers to write, read, and discuss important Web topics. We look forward to hearing from you!


August 25, 2010 06:18 PM

August 24, 2010

Brian Louie

Some cool releases this week

Today, we released the next beta for Firefox 4 – the fourth one, for what it’s worth. This might be the biggest beta release yet. Most notably, it features Firefox Panorama (previously referred to as Tab Candy) and Firefox Sync, which allows you to sync your desktop browser with things like your phone and other computers in your house or office or wherever else. CNET posted a good, unbiased summary of the update earlier today. If you’re interested at all in the future of tab and task management, definitely check out the latest beta.

Also of note: the refreshed Mozilla Developer Network, as I’ve been discussing in many of my posts below, releases tonight, meaning that when you go to developer.mozilla.org tomorrow morning, you should be able to see the hard work Jay, the web development team, and I have been putting into the MDN over the past few weeks (or months). Expect a long post detailing that in the near future!


August 24, 2010 10:00 PM

August 23, 2010

Michael Kurze

Diaspora — Can the Social Graph be Our Web of Trust?

On Friday we had Max, Ilya and Raphael from Diaspora over at Mozilla. They talked about their effort in creating a distributed social network. Where I think they are on the right track, and where they should think even bigger.

Why we need Diaspora

Personally, I see three major challenges that everyone passionate about the open internet needs to make up their mind about:

In the context of the Diaspora talk, I’ll focus on the third issue.

We need Diaspora because people need to be in control over with whom they share personal information. Every time Facebook sneaks in a new default that breaks privacy, we grudgingly change the settings again — and stay, not wanting to lose our friends. Or we just don’t know about it and leave it as it is. Combined with the social monopoly that Facebook has established, this makes privacy and security optional features, subject to change like any other.

How Diaspora can help already

The main distinguishing factor of Diaspora compared to Facebook et al. is in that it decouples your social graph from the network provider, bringing back real competition to the social space. Like with E-Mail, there can be lots of network providers, loosely connected over push-interfaces. Whenever a pod (the equivalent to an e-mail-provider in Diaspora) should violate your trust, you can just switch to another one, or set up your own pod.

What could be done better

On the downside, this means that you have to trust your pod as well as all your friend’s pods. No big deal? Well, where the same server software is used on a distributed network, it is very prone to exploit of vulnerabilities due to patch delay and misconfiguration (correctly setting up TLS is still a big challenge, not only for regular people).

Secure HTTP is great when a large, anonymous group of people needs to trust a central service. It allows us to do online banking and purchases, free from eavesdropping and man-in-the-middle attacks. However, it is not peer-to-peer: When you fetch your mail over a secure IMAP connection, you might be sure that your password is protected, but you do not know who actually sent you that e-mail (think about it: that is the reason why phishing works). When you get it from Google Mail, you might be using TLS, but Google is still able to read your every conversation.

How PGP can solve this

I propose that Diaspora pods should be dumb post boxes that are not able to actually look into status updates, private messages, friend lists and so on. How? The technology for that has been available for quite some time and is called PGP.

Basically, PGP allows you to send and receive messages that cannot be decrypted by the servers that route them. So, if you were to encrypt your message inside your browser, you would establish secure end-to-end communication. No need to trust the shady pods that some of your friends decided to use, not knowing any better. But encryption in a web client? That sounds awfully slow! Well, Firefox Sync does it already with your entire browsing history (the pass phrase to your key is never sent to the server), and I would imagine that JavaScript interpreters have become fast enough to emulate the cryptographic capabilities of a PC from 1991.

I do have ideas on how to approach search and incremental profile updates with this, and on the new security considerations that apply here (Can you always trust your browser? Could a pod not make you use an insecure web client that transmits your passphrase?). However, that is rather technical, possibly material for a follow up post.

The social network is a key signing party

The problem with PGP has always been that people have been unable to exchange public keys in a manner that is both trustworthy and extensive. Because a web of trust can often not be established, people refrain from using encrypted e-mail. Turns out that social networks come with a mechanism that is just made for this: Friending. In the secure social network, accepting a friend request would be equivalent to exchanging keys. Usually you are referred to friends from people you already know, so there already is a basic level of trust.

This means that online social networks can be transformed from a jeopardy to our security to a vehicle of the same. This idea is of course also not entirely new. What might be new is the idea of building the social web entirely on top of PGP rather than just integrating that as an optional feature.

Any Comments?

I have not gotten around to add Commenting or Pingback to this blog, but I would love to incorporate any (links to) comments in a follow up post, please write to michael at this domain.

Update:

If I understand correctly, the diaspora guys are already planning to use GPG for cryptography somewhere. This is a pretty good start. If they really already plan on generating keys for everyone, then they would only need to pull the actual encryption into the web client.

(*) Like any intern at Mozilla I had the opportunity to to talk to John Lilly, and I got the impression that Mozilla takes this development very seriously.

August 23, 2010 01:30 AM

August 22, 2010

Jaclyn Fu

Once a Mozillian, Always a Mozillian

The most awesomest internship ever.

I wish I could quit school to work here forever. I was spoiled by Bay Area weather, yummy snacks, super people, and rewarding work. Thanks Mozilla for such a great learning experience, and thank you Mozilla community for being great supporters. Hope to work with everyone again soon!

Back to UC Berkeley for my last year of academic slavery where I’ll be finishing up my History degree (taking loads of marketing classes nevertheless). I’ll probably still be posting Mozilla thoughts here, or maybe I’ll start a new blog – stay tuned!

Below is the slide deck for my intern presentation which highlights several accomplishments and things I learned. Enjoy!


August 22, 2010 08:59 PM

August 17, 2010

John Wayne Hill

Firefox Home Tab Concept

This summer I’ve been working at Mozilla with the Firefox UX team. My main project of the summer was to research what the hometab of the future could and should be. I was to give Firefox a useful path to traverse and provide some ideas about the design and experience of the hometab in Firefox.

In starting this project I came up with some predispositions (pre-project thoughts) on hometab, and how people use the internet. I then completed three major types of research: competitor analysis, academic research, and user research. This research led me to the following insights:

Insights

From these insights I sketched and iterated on many concepts. I then built a prototype concept. I used this prototype for about two weeks and had my colleagues on the UX team use it as well. I asked for feedback on desires, problems, and future thoughts. With this data I created new mockups showing what I think the hometab of the future should be. These mockups show 10 features of hometab:

Features

Hometab is laid out in a way to allow gradual engagement, quick access to important information, and personal connections.

Hometab with universal search and stream view

on Hover of Stream Items, an overlay appears

upon clicking a stream item, a large overlay appears with details and features

web apps that allow for badged notifications

ability to selectively restore tabs from previous sessions

showing contacts right in the browser

clicking a contact brings up an overlay with information and a conversation stream

content that you've shared across the web all in one place for easy findability

hovering over a shared content area brings up an overlay with more information

easy to get to bookmarks with location aware frequency

hovering over a bookmark takes away the favicon overlay and shows a preview of the site

quick searchable history with an option to see your full browsing history

easy to acess searchable downloads which the browser can open when possible

easy acess to Firefox tabs on other computers

Please keep in mind that this project was to map out a general direction for the Firefox UX team and to provide ideas and thoughts on the design and experience of Firefox hometab. In no way is my concept slated for inclusion in Firefox.

In the coming weeks I hope to expand upon this concept with more details about my process and the design shown above. Stay tuned!

Please let me know your thoughts and critique, as I strongly believe in getting good critiques.

August 17, 2010 03:27 PM

August 12, 2010

John Wayne Hill

Sharing in Firefox

Most of us like to share things with people that we know. This is one reason that flickr, facebook, and twitter became so popular. Sharing is huge. It’s likely that if you’ve used the internet, you have shared something with someone. Many of us share different things through many different networks. This can be quite a pain. There are many add-ons that tackle this very issue. However, the browser can make sharing easier by integrating sharing into the browser. If we know what social networks you use, by what passwords you’ve saved in Firefox, it should be pretty easy to enable sharing in Firefox.

In looking at this problem I’ve come up with the following design:

A user should be able to simply right-click an image, video, or link and then click Share. From here a nice overlay should appear with a preview of the thing to be sent, a URL auto filled into a text area, an area to add more information (comment, text, etc), a way to choose what service to use, and a way to share the item with only particular people.

I’ve created some mock-ups to show how this feature might work. Furthermore, I researched what social services I think Firefox should support when first implementing this feature.

A page with an image the user wants to share

user right clicks image

user selects "share image"

an overlay appears with a preview of the image and the url autofilled

a user can add their own text if desired

users can select a service with which to share

character counts could appear if Twitter is selected

users can choose to share privately with certain individuals

selecting particular people with which to share using Gmail

inline autocomplete for Twitter sharing

With sharing enabled directly by the browser people can more easily share images, videos, and links with a variety of social networks or with particular people. Furthermore, by integrating sharing directly into the browser users are never taken out of their flow or interrupted by moving between different websites and services.

Want to help make Firefox better? Why not contribute and help add this feature. Bug #: 586780

August 12, 2010 08:33 PM

Brian Louie

Firefox 4.0 beta 3 live

Hey, everyone!

Earlier today, the third beta for Firefox 4.0 went live. Most prominent of the changes include support for multitouch gestures on Windows 7 machines and revisions to the JS engine so that pages render faster. If you haven’t gotten it already, find it here.

I’ll be publishing another post soon detailing my work from the past couple of weeks. Stick around!


August 12, 2010 02:23 AM

August 10, 2010

Michael Kurze

Sites for Mozilla Input

As a side project during my internship at Mozilla, I worked with Aakash from Mozilla QA to bring a new feature to the Mozilla Input website.

Oftentimes when users have trouble with a Firefox beta, there is not actually a bug in the beta, but a problem with a specific website (such as broken user agent detection). Even when a problem is related to Firefox, it can be very helpful for QA to see what sites trouble our users the most, and what issues the users face there.

Enter clustering…

To group sentiment by topic, my fellow metrics intern Andres and I made use of Dave Dash’s clustering algorithm, which uses techniques from the search engine world to group related input. That helps to get a quick impression on what’s going on when a site is causing trouble for many users. We also get a lot of positive feedback on sites where the user experience has improved for beta users compared to the release version.

…and Django of course!

It was very cool to do something with Django again. The webdev team is very knowledgeable in this area so I learned a lot working with Fred and Dave. There are some limitations (you still cannot prefetch related objects along the inverse edge of a one-to-many relationship, like with any sensible ORM), but other than that Django has become a pretty solid toolkit. Also I finally got started with Git, which is as of now my version control system of choice.

Hopefully my main project will allow me time to improve Input and the dashboard in the future, there’s a lot of cool stuff planned with it.

August 10, 2010 06:46 PM

August 04, 2010

Jaclyn Fu

Firefox 1.1 Quiz Challenge Winners!

Congratulations to our two Firefox 1.1 for the Nokia N900 Quiz Challenge winners, Matt Boes and Heni Purwanti! In 3 weeks, over 6,700 quizzes were submitted from all over the world! Thank you to everyone who participated and supported Mozilla’s mission to browse without borders.

Here’s a recap of the quiz questions:

Quiz 1
1) Typing is hard on a mobile phone. What Firefox 1.1 feature takes you to your favorite parts of the web with minimal typing? Correct Answer: Awesome Bar

2) Firefox 1.1 now has improved zooming to make your browsing experience even more convenient. What new way can you zoom in and out on the Nokia N900? Correct Answer: Using the Volume Rocker

3) Don’t start from scratch. Sync your Firefox passwords, history, tabs, and bookmarks from your PC to your mobile phone. What current Firefox 1.1 feature on the N900 allows you to just get up and go? Correct Answer: Firefox Sync

Quiz 2
1) How is Firefox for mobile built like Firefox 3.6 for the desktop? Check all that apply. Correct Answer: All (Add-ons, Awesome Bar, Sync, HTML5)

2) On our @MozMobile Twitter account, what Firefox 1.1 feature was spotlighted on April 14th 3:08pm US/PST? (hint: you can save as PDF and add search engine here). Correct Answer: Site menu

3) What are the goals of bringing Firefox to mobile phones? Correct Answer: All

Quiz 3
1) (True or False) Firefox is the world’s only mobile Web browser to support add-ons. Correct answer: True

2) The improved Site Menu in Firefox 1.1 for the Nokia N900 lets you better manage your relationship with the site you’re on. What action can’t you do using the Site Menu options? Correct answer: Pizza

3) Firefox tries everywhere it can to minimize the amount you have to type on mobile phones. Besides the Awesome Bar, what other feature focuses on typing less? Correct answer: Form auto-complete

If you did not have the chance to sign up for the about:mobile newsletter to receive exclusive updates on mobile products and future challenges, you can do so by clicking here:

To our two winners of the quiz challenge: Let us know what you think of Firefox 1.1 on your new Nokia N900!


August 04, 2010 04:46 PM

July 30, 2010

Frank Yan

Making tab closing as easy as click, click, click

The best user interface anticipates actions that you want to perform and never gets in your way. When planning out the new tabbed browsing features for Firefox 4, this principle guided our focus. One of the things we think Google Chrome really nailed is its tab closing behavior: when you close a tab with the mouse, the remaining tabs shift or resize so that the next tab’s close tab button moves right under your cursor. This way, you can click the same spot to close the next tab.

Back in December, Basil Safwat wrote a fantastic piece, full of screenshots, that details these behaviors.

We now do the same in Firefox 4, so it will be super easy to close a whole row of tabs without moving your cursor a pixel:

[ YouTube HD HTML5 (if available) ]       [ YouTube HD Flash ]

We are also taking it a step further and including support for the tab overflow mode that Firefox has had for a while. No matter how your tabs scroll and move and resize, you can always count on the close button being in the right location when you need to close them:

[ YouTube HD HTML5 (if available) ]       [ YouTube HD Flash ]

Finally, let’s talk about a design decision made in Firefox’s earlier days: we placed the tab close buttons on the right side of each tab for all platforms, including OS X. To some people, this seems to break with the design of Apple’s platform, since Safari and OS X windows have close buttons on the left side instead. (It’s also worth noting that several of Apple’s applications have the close button on the right too — iChat, Pages and Automator all do this in various parts of their UI.)

Now imagine if we put the close buttons on the left. With that configuration, when closing the rightmost tab, we would have to shift the remaining tabs to the right to move the next close button to the same place, leaving an awkward gap on the left side of the tab bar. Placing the close button on the right (for left-to-right locales) is the more intuitive choice.

Another important aspect we have found is that favicons on tabs are the primary way people identify and navigate tabs, so we give them prominent placement.

This optimized close/resize behavior is just one of the many improvements to tabbed browsing in Firefox 4. Be sure to check out this and other new tabbed browsing features in the upcoming Firefox 4 betas!


July 30, 2010 07:04 AM

July 29, 2010

Brian Krausz

GazeHawk Launches!

At least now I have a publicly know excuse for being busy!

http://techcrunch.com/2010/07/29/y-combinator-backed-gazehawk-heatmaps-with-web-cams/

Keep an eye on our blog at http://gazehawk.com/blog/ for some interesting technology/startup posts.

Time to go deal with my ever-growing inbox ;-) .

July 29, 2010 10:06 PM

Brian Louie

Redesigning the MDN (part 2)

[This is a continuation of the post "Redesigning the MDN (part 1)."]

In my previous post I mentioned our fundamental goal is provide web developers with a central hub for documentation and discussion. I’ve talked a bit about how we plan to achieve the former, but what of the latter?

For this reason, we added yet another tab to the MDN’s header, called “Community.” In the newest iteration of the MDN, this tab will primarily serve to host a UserVoice-based forum where web developers can congregate and discuss anything open-web related. As we get that finalized, I’ll update this blog with a list of initial topics so that you can start to think about things to talk about.

Again, when the new MDN goes live sometime in mid-August, expect a more in-depth tour of the Community tab. Also, note that the Community tab will eventually encompass more than forums. Eventually there will also be community-provided news articles and other community engagement efforts via Mozilla. Those should be coming in later iterations of the MDN.

Thanks for reading! As usual, if you have any questions, comment or shoot me an email.


July 29, 2010 09:44 PM

July 28, 2010

Jaclyn Fu

Building Firefox 2.0 Position & Product

Back to basics: What does the mobile Web user want in a browser?

I left our mobile product delivery meeting with some thoughts: 1) The competitive landscape is rapidly changing what were many “nice to have” features into mandatory industry standards and 2) positioning a product is much easier if we understood exactly what the user wanted.

This prompted me to conduct a quick market research survey. I included a research question in Quiz #3 of the Firefox 1.1 for the Nokia N900 Quiz Challenge that asked participants which feature was most important in a mobile Web browser. Here are the results out of a 1800 person sample:

1) Speed
2) Battery life/memory usage
3) Readability/zooming
4) Tabs
5) Sync
6) Social media integration
7) Add-ons

It’s interesting to note that in this small sample, many people also wrote “full PC-like capabilities” in the open answer text field. Fennec is built from the same engine as Firefox for desktop and also has the same powerful capabilities as the desktop version. It’s even more interesting to see Tabs rank so high because Firefox is the only mobile Web browser that does tabs right (from experience). Most mobile Web browsers require you to navigate through a maze before you can reach your tabs, but Fennec conveniently stores them to the side of your browser, accessible with a quick swipe across the screen. Firefox Sync and Add-Ons satisfy the 5th and 7th most important features, respectively. Social media integration, or sharing, is the next step in Fennec development. You can view the Fennec planning page here.

Most of the sample audience uses Opera Mini, Opera Mobile, IE Mobile, and Android Browser. If you have had experience with these browsers, how do you think Firefox compares with them?

Firefox 2.0 is going to be a full, rich, mobile Web browser. We have all the bells and whistles – but how do we stand with the basics? Electrolysis and layers are going to improve performance, and there are current developments to maximize efficient battery life. The biggest challenge now is to improve readability so that zooming and text formatting is seamless. By the time the final product rolls out, I’m positive Firefox 2.0 will be polished, fast, and ready for daily use.

The user feedback data was really insightful for gaining a better sense of user needs and expectations. I’ve been trying to apply the concepts I learned from my 8am marketing class from last semester, but of course real-life problems are much more difficult to solve than classroom case studies. Let’s open this up for some discussion – what kind of experience do you have with brand positioning and do you have any tips for an aspiring marketer? How do you feel about Fennec’s current positioning?

Want to experience the nightlies yourself? You can download a nightly build of Fennec 2.0a1pre here.


July 28, 2010 07:54 PM

Brian Louie

Redesigning the MDN (part 1)

(Redesigning the MDN is a complex project that’s going to take more than one post. In this post, I discuss the reasoning behind some of the more superficial changes I’ve made to the Network.)

Another one of my big projects here at Mozilla has been working on redesigning and re-branding the Mozilla Developer Network (MDN). If you’ve been keeping up with my blog, you’ve already seen some of the work that Jay and I have done with regard to graphically redesigning the network. As I’ll discuss in a bit, we’ve made some important changes since then.

First, it’s important to understand the impetus for change. The Mozilla Developer Center (the current name for the MDN), as it stands, can be found here, if you’re not already familiar with it. Although it certainly looks better than it has in years past, it could still use some fixes here and there. Or all over the place. You can find the slide deck with some pictures of our first draft of the redesign here.

Underneath the superficial overhaul, however, lies a deeper paradigm shift. Although content is pretty well spread out to cover various domains of the open web, the focus currently concentrates on developing on the Mozilla platform specifically. While certainly we want to reward and help those who develop with the tools that we provide them, we feel that perhaps this mindset is a little close-minded. Mozilla’s goal is to advance the open web in every way possible, Mozilla-inspired or not. Consequently a solely inward focus on only Mozilla’s tools is unintuitive and does not allow us to optimize the progress of the open web.

Ultimately, the goal of the Mozilla Developer Network is to provide a central hub for discussion and documentation for open web developers, regardless of platform. The redesign of the MDN cannot lose sight of this goal.

With this goal in mind, we took the original .psd files from our web designers and started making tweaks. As previously mentioned, there are four main documentation headers: Web, Mobile, Add-ons, and Applications. In the currently released design, all of those headers are given equal weight, which runs against our fundamental goal.

Unfortunately, there wasn’t much of a way to change these headlines without breaking the entire header, so we instead decided to revamp the site’s home page to place a greater emphasis on open web technologies at-large. When the new site is live, you’ll be able to see for yourself. There have been several other changes as well; I’ll tour through them on this blog when the new Network goes live.

One thing I’d like to emphasize: though our presentation of information has changed to fit our goal, none of the documentation has changed. You will still find all the information found on the current MDC, from Gecko to info about Mozilla-specific APIs. These articles will continued to be updated as well. Only the presentation of the information has changed.

Expect the site to go live mid-August. Tomorrow, I’ll write about some of the awesome new features that we can expect to see in the next iteration of the MDN and how we plan to facilitate communication between developers.


July 28, 2010 06:19 PM

July 27, 2010

Brian Louie

Firefox 4 beta 2

A quick aside from my summary posts: download the Firefox 4 beta 2 to check out application tabs and a sweet new Mac OS X interface. The alpha for Tab Candy is also available as an early build of Firefox, if you’re interested in trying that out as well.

For a more detailed rundown of the new beta, check out the Hacks blog for a sweet demo from our very own Paul Rouget!

Happy developing!


July 27, 2010 08:12 PM

A global picture of the open web

Hey there! Sorry for the long delay since my previous post; it’s been a busy past few weeks. Since coming back from the summit, my internship has been full of twists and turns, leaving me little time to write.

I’ve been assigned to work on a whole lot of different things. To give equal exposure to all of them, I’ll write several posts to update you on my work these past few weeks.

One of my big projects thus far has been designing an industry-wide web developer survey. Some of you might have seen one of my previous blog entries about the results of the survey we distributed this past March. The findings, while interesting, don’t paint a complete picture of the state of the open web and the developer tools you all like to use. Thus far the surveys we’ve released – the one previously mentioned and one that was released last November – have been distributed via Mozilla channels and have only really inquired about Mozilla platform technologies. We hope to change that.

We hope to get a wider snapshot of the web development community, not just for us, but for you. A panorama, if you will.

The survey will be released in a few weeks – sometime before the end of August – so check back frequently for the opportunity to take the survey and help us paint the picture of the open web. Thus far I’ve iterated through several drafts of the survey and talked to several market research consultants to determine how to best distribute and design the survey. It will be ready soon!

On a more interesting note, I’ve also been reaching out to infographic designers. Although the data obtained from the survey will certainly help us, we want it to help you, too. We want to present our data and conclusions in an aesthetically awesome way. Right now, I’m talking over our goals and the possibilities of an end design with several artists. They all have some pretty good stuff going on; they’ve won awards and made some pretty interesting designs. Stay tuned!

Because we expect such a large audience to be taking the survey, there has been a lot of pressure to get every word and every question right. I never realized just how much goes into designing a questionnaire: figuring out the average time spent to read and answer each question, the best way to structure a question, the most efficient reconciliation of details and the big picture, etc. Given the impact we expect this survey to have on our engagement efforts, the survey must determine with exact precision the information that we’re looking for. Such a statistical conquest, I have discovered, isn’t as easy as it looks.

More blog posts about the other things I’m working on will be coming soon! Thanks for reading.


July 27, 2010 05:54 PM

July 24, 2010

Frank Yan

Hello, Mozilla; Goodbye, Paper Cuts!

Hello, Planet Mozilla! I’m Frank Yan, and I’m working as a Firefox engineering intern. This means that I get to spend my summer making Firefox more awesome! As one of my side projects, I’ve been hacking on “paper cut” issues, which are small bugs that get in your way and little features that you wish your browser had.

The first paper cut that I tackled finds its origins in 2006. That year, tabbed browsing was becoming all the rage, and Mozilla shipped Firefox 2 as its first release to handle tab overflow. Since most mouse wheels only supported vertical scrolling, we enabled the horizontal tab bar to be scrolled by vertical scroll events too. After laptops started rolling out with multi-touch trackpads, users could scroll in both axes simultaneously using two fingers. An unexpected side effect was that, when scrolling with the trackpad even slightly diagonally, the tab bar would sometimes try to scroll both left and right, resulting in sporadic bounces. The effect wasn’t exactly spectacular, so I added logic to scroll the bar only when scroll events are consistently along a particular axis. This will provide a smoother scrolling experience in Firefox 4.

Stay tuned for more patched-up papercuts!


July 24, 2010 09:41 PM

July 21, 2010

Brian Krausz

The Worst Paragraph Ever Written

Context: There’s an organization that sponsors Shabbat dinners. It’s really awesome: they basically pay you to feed your friends. That being said, they need a copywriter. Here’s a paragraph in the email they sent confirming my sponsored dinner:

As of Monday, July 19th, the new NEXT Shabbat program will begin providing new NEXT Shabbat’s with up to $14 per guest (maximum of 16 guests) for the first three meals a host registers after that date. After those three meals, hosts will receive up to $10 dollars per guest. As a returning NEXT Shabbat host, your meal-payment will be based on the number of meals you’ve held already. However, since you have a meal scheduled to take place between July 19th and August 19th, you will still receive $18 per-guest for that meal. Following that meal, if you’ve already held at least three meals, any meal registered after July 19th will only be eligible for a payment of $10 per guest. By joining with us as we make these changes to the program you will give many more people the opportunity to host and will enable thousands to participate in home-based Shabbat meals for the first time. If you’ve held less than three meals, any meal registered after July 19th will be eligible for a payment of up to $14 through your third meal. You can also see how many meals you have already hosted.

As always apologies for the lack of updates: I promise there’s a short (but major) update coming very soon, followed by more frequent posting (there’s a reason I’ve been so quiet lately).

July 21, 2010 11:31 AM

July 17, 2010

Jaclyn Fu

NEW Creative Collective Design Challenge! “Home is Where the Phone is”

Design an iPhone skin for Firefox Home!

Find out more on the Creative Collective challenge page.

Calling on all designers and Firefox mobile enthusiasts! Create cool designs to make into iPhone skins and help spread the news about Firefox Home. This is your opportunity to be featured on Mozilla’s website, blogs and possibly even official Mozilla merchandise!

We’re looking for designs that convey the message of how Firefox Home gives you instant access to your favorite parts of the web. Now you can carry your home with you on your phone. Themes we are focusing on:

-Get up and go. Easily pick up where you left off with Firefox.

-Home sweet home. Access your favorite parts of the Web anytime and anywhere.

-Don’t start from scratch. Enjoy the convenience of leveraging your Firefox browsing history.

-Comforts of your web. Your private data is protected and always with you.

We encourage you to be as creative as you can be. Be abstract and don’t take the themes too literally. A Mozilla team will pick the Top 5, and it’s up to the community to vote for the winner.

Download the design template and start designing! Make sure you follow all the design guidelines to ensure your design is considered.

The challenge ends on August 15th. Can’t wait to see what you come up with!


July 17, 2010 05:55 PM

July 14, 2010

John Wayne Hill

Mozilla Summit 2010

I recently got back from the Mozilla 2010 Summit in Whistler, BC.

I can sum up my entire experience in just one word.

Awesome!

But, that doesn’t really do the summit justice, not even close really. The summit was held over three days. Three full days of talking to people who change the world. Three days of meeting with like minded people who are just as enthusiastic about Mozilla as I am, even more perhaps. These people changed me a bit. I saw a spark in them that is very hard to describe. They, much like me, really believed that they could change the world (via the internet) for a better place. They really cared, not just giving lip service, about the people who use the software they help create. They put people first. Awesome!

This “army of awesome” as it was so called lent me a lot of energy. I was fueled by their passion. It was fantastic.

I gave a talk on the Perception of Performance in Firefox. I think there was about 500-600 people in attendance. It rocked my world. Many people came up to me after and told me that they really liked the work I was doing. Validation! I walked away from that talk exhausted but feeling incredibly worthy and capable of changing the world.

Firefox UX Beer Hall Design Session

Firefox UX Beer Hall Design Session

Much like any conference or summit, so many things happened in the after hours events. The Firefox UX team held a Beer Hall design session where we solicited ideas, complaints, and solutions from anyone who wished to join us. The ‘end-of-summit’ party, held on top of a mountain, was the best I’ve ever attended. It was full of fun, dancing, and some great discussions. We also had fun monsters hanging out with us! We even had a cool dancing conga line!

Me Dancing with the Monsters

Me dancing with the monsters

In summary I would like to thank everyone who made this possible. The summit was truly invigorating and exhilarating. In short, it was effing awesome!

July 14, 2010 06:42 PM

July 11, 2010

Brian Louie

Mozilla Summit 2010: day 3

The final day was a little shorter than the first two, but it was arguably the most memorable of the trip.

We woke up to a few lightning talks, which are five-minute demonstrations of various things that Mozillians have been working on. The lightning talks also featured the work of fellow intern John Wayne Hill, who has been working in user experience. Check out his blog at planet.mozinterns.net for more info.

Afterward, we went to our penultimate round of breakout sessions. Today I decided to stray from the usual engagement stuff to check out a session on web gaming. We were treated to demos of non-Flash-based games, including one that a fellow Mozillian had coded up on the plane on the way to Vancouver. It was, in short, a good time.

We then had one final round of lightning talks – featuring another fellow intern, Kyle Huey – followed by two more sets of breakout sessions. One of the most interesting breakout sessions featured my mentor, Jay Patel. As I mentioned in a blog post a week or two ago, one of our big projects has been working on the expansion and the redesign of the Mozilla Developer Network (previously called the Mozilla Developer Center). We’ve finished designing the new static pages, which should be going live by the end of the month. Most important in the redesign of these static pages is the categorization of documentation pages into four parts: web, mobile, add-ons, other.

If you want to see what the MDN looks like right now, check out the site. As you can tell, it could use quite the graphical overhaul.

We also hope to clean up the documentation and improve the way people navigate the site. As indicated by the heated discussion at the session, the most difficult obstacle will be localization: it’s hard to coordinate translation of documentation and to keep all of those different translations updated. We plan to keep the site constantly updated with the most updated version of an article in at least one language and to offer incentives for localizers to contribute. Furthermore, we plan to pinpoint contributors’ areas of expertise to streamline the technical review process so that articles are updated in a timely fashion.

If you want more details about the redesign of the MDN, check out the site for a copy of the PowerPoint deck that Jay and I made and also the priorities and requirements documents. If you have anything you’d like to contribute or suggest, please feel free to comment on this article or to contact me at blouie@mozilla.com. Any feedback is much appreciated!

Equally important is finding ways to get people to contribute to original documentation. Eric Shephard and Janet Swisher gave a great presentation about the implementation of so called “doc sprints,” which will bring together developers and experts in a particular field to draft documentation about a particular topic. If you have ideas to do so, definitely email Eric or Janet at sheppy@mozilla and jswisher@mozilla respectively.

After quite the busy day and an inspiring closing address by Jay Sullivan, we were corralled into gondolas that took us up to the peak of one of the highest mountains in Whistler. There was a great dinner and dance party up there; it was the perfect way to wrap up this opportunity to learn so much awesome stuff and meet so many awesome people. As they said at the closing address, there was “too much awesome.”

I can’t find a better way to describe it. I hope you’ve enjoyed reading my chronicles of the summit. If you have anything to say, don’t hesitate to talk to me!


July 11, 2010 04:05 AM

July 10, 2010

Brian Louie

Mozilla Summit 2010: day 2

Day two was equally as eventful, interesting, and informative as day one.

After starting the day with a breakfast highlighted by muffins and yogurt with berries and honey, we were treated to a couple of keynote addresses from Mitchell Baker and Mike Shaver, two of the most prominent Mozillians. They were inspiring; I’ve never felt safer and prouder of Mozilla’s future.

Soon after, breakout sessions continued. The first breakout session I attended was pretty unique: it compared Mozilla to other nonprofit movements, from the Boy Scouts to Alcoholics Anonymous. Though clearly Mozilla is different from these movements – the difference is especially apparent when analyzing certain of these organizations – but nonetheless there are certain core values that make each of these decentralized organizations successful, from having a unified mission to delineating a specific list of principles. Because precedence has been established, it’s easy to follow these examples and cultivate an effective call to action.

A few hours (and a delicious lunch with ravioli and peach upside-down cake) later, Mozilla threw a “science fair” in which Mozillians from various departments showed off demos of their hard work. The exhibits were diverse; there were some WebGL demos, some mobile demos with Nokia N900s, and there were Bugzilla-related demos. My favorite was Paul Rouget’s usage of HTML5 in Firefox 4 to do crazy things in his web page, like play videos on rotating cubes and scroll along 3D photo walls, all using just HTML, CSS, and a bit of JavaScript. The hall was clogged around Paul’s table; be sure to take a look at it online after the summit is over!

The next breakout session I attended discussed the the telling of the Mozilla mission. The session featured consultants from Engine Company 1, a market research firm. With the help of some data they’ve been collecting over the past couple years, the consultants offered some interesting and rather surprising insights, from the “people” Mozilla and its competitors convey to the branding association between parent company and browser to even the way people look at the Mozilla mascot. The main takeaway is that although Mozilla has awesome products (try out the Firefox 4 beta if you haven’t!), its brand image is not as well defined as its offerings. I accepted this as a personal challenge with regard to the developer community. I’ll update my blog as I continue to make progress over the next couple of months.

Afterward, we were treated to the summit’s World Expo, in which Mozilla branches from countries all around the world set up tables and talked about their countries. I’ll be honest: I really only went to the tables that had free snacks, including some rather interesting salted licorice. But the people were equally interesting! I met programmers from Sweden, marketers from Japan, and community developers from Chile. In short, Mozilla is EVERYWHERE.

The highlight of the event was definitely the dinner. In honor of the international theme of the event, Mozilla set up three dining rooms, each geographically themed. One room was for Asian, one was for Europe, and one was for the Americas. There was so much food that I got full after eating in just one room! But the food was delicious. Despite being full, I couldn’t help but stuff myself a little bit more.

The expo more or less marked the rest of the day, minus some barhopping and such. Stick around for updates on day three!


July 10, 2010 01:20 AM

July 09, 2010

Jaclyn Fu

Mozilla Summit 2010

“Be More Like The Web”, Fairmont Chateau – Whistler, BC, July 6-10

I think I may have lost all my brain cells in my 4 days at Summit from all the mind-blowing that happened. If you’re thinking about interning at Mozilla, I advise you to choose an even-numbered year (or intern twice!) so you don’t miss out on Summit. I always loved Mozilla, our mission, my work, and the people; but my experience this week gave me an invigorated passion and a motivation to truly make the Web a better place.

I was able to match IRC handles to faces, participate in stimulating discussions on challenges we’re facing, and create new memories that still give me shits and giggles whenever I think about them (blouie, get it?) The keynotes, breakout sessions, and lightning talks raised questions about the future of OUR Web and reinforced that Mozilla is a mover in how users will interact with their browser and the Web. Issues of privacy, communicating the Mozilla mission, the future of Mobile, and building community, contended that Mozilla Firefox will always be on the users’ side. Great products for great people by great people. On this note: Firefox 4 is going to be game-changing. I’m still recovering from the demo of Tab Candy.

To all the new friends I made: Thank you for the cool conversations and let’s keep in touch.

For pictures and Twitter feed of the Summit, click here.


July 09, 2010 09:56 PM

July 08, 2010

Wilson Lee

Cross-Domain Requests and Prototype

Ever since 3.5, cross-domain HTTP requests have been supported in Firefox. Getting this to work may seem easier and saner than piggy-backing Flash ("simply request a URL of different origin in your XMLHttpRequest!"), but unless you use jQuery, you'll realize that for some reason, cross-domain requests mysteriously fail in your JavaScript framework despite the fact that the server is correctly responding with an appropriate Access-Control-Allow-Origin header.

read more

July 08, 2010 06:47 PM

Brian Louie

Mozilla Summit 2010: day 1

Sorry for the long absence! It’s been a busy past few days, especially since I had a flight at 6am yesterday morning to Vancouver. Mozilla is throwing its summit in Whistler this year, and it started yesterday and ends tomorrow. On Tuesday we were treated to a luxurious reception dinner replete with seafood and Canadian beer, along with free shirts and the like. And then after that…well, that’s probably not appropriate for a blog post. (Hooray for not being underage in Canada!)

Yesterday began with a series of keynotes and demos from the likes of Mitchell Baker and Jay Sullivan. The demos of Firefox 4 were, in the tersest of forms, extraordinary and mind-blowing. They boasted TabCandy and application tabs, along with rapidly quickened JavaScript rendering (especially in relation to Chrome) and the capabilities of WebGL for 3D graphic rendering. Perhaps the most impressive demo was the five-minute, ad hoc creation of a text translation API that took a grand total of fifteen lines of code.

The rest of the day certainly didn’t disappoint. The day was divided into three breakout sessions; for each session slot, we had to pick from a whole list of diverse choices. The decisions were difficult. My first breakout session discussed the cultural implications of messaging and how messaging can be incorporated into the Mozilla message. Many of you are probably familiar with the Mozilla manifesto and thus recognize the ideological differences that separate us from our competitors in the open web. We discussed the advantages of desktop-based messaging clients and the importance of aligning our interests with those of the user. In response to this need, we talked about prototypes of UI’s and new add-ons for Thunderbird and Raindrop (a web-based email client ala Gmail that is flexible and dynamic).

About an hour later, I headed to my second breakout session, which talked about product marketing for Firefox: how to “keep Firefox sexy.” In light of growing browser competition and the recent release of beta 1 for Firefox 4, market position is key, especially as product differentiation has become scarce. As the speakers noted in the presentation, it’s not about beating the competition; it’s about positioning them. Thus devising taglines and branding for Firefox 4 has been a long and arduous process.

The final breakout session discussed the unification of the Mozilla web universe. Mozilla has so many resources online that are largely disconnected to each other. As a result, branding Mozilla is difficult and accessing its resources in a simple, convenient way is even more so. To address this problem, several Mozillians talked for about an hour and a half or so devising brain maps and diagrams to configure potential layouts of Mozilla’s web universe. Be on the lookout soon for layout changes! The call to action at the session was powerful and will surely be a priority for Mozilla’s engagement team in the near future.

Afterward we went to dinner at Bavaria, a ridiculously awesome (and expensive!) fondue restaurant. Thanks again to Mozilla for paying for all of it!

Stay tuned for updates on day 2!


July 08, 2010 12:25 AM

July 07, 2010

Jaclyn Fu

Want to win a Nokia N900? Take the Quiz Challenge!

Firefox 1.1 is available for download in the Ovi Store. Take the weekly Quiz Challenge for your chance to win a Nokia N900.

The challenge is now closed. Thank you for participating!

Click to take the quiz!

The Challenge
Pass a quiz with a perfect score for a chance to win a Nokia N900. There will be a total of 3 weekly quizzes every Wednesday, with the last one ending Tuesday, July 27th 11:59pm PST. The more quizzes you pass the more chances you have to win! Each completed quiz with a score of 100% will enter into a pool where 2 winners are selected.

We welcome all Firefox mobile enthusiasts of any experience level.

Getting Started
Firefox 1.1 for the Nokia N900 is the newest version of our awesome mobile browser. Don’t know much about it? Here’s a list of useful resources to get you started:

More information
1st Quiz: 7/7 – 7/13
2nd Quiz: 7/14 – 7/20
Last Quiz: 7/21 – 7/27
Announcement of winners: 8/4 – Congrats to our winners! http://bit.ly/99Wyh0

After the deadline of each quiz passes, you will no longer be able to take that quiz. However, you can still continue in the challenge and participate in other quizzes if you miss any.

Stay Connected

Challenge Rules
Please see complete Challenge Rules for more information.

Questions?
Contact firefoxmobile@mozilla.com or jaclynf on IRC (#mobile, #marketing) for more information.

Good luck!


July 07, 2010 07:00 AM

July 06, 2010

Michael Kurze

En Route To Whistler

The two first weeks as an intern at Mozilla were like a blast. Now we are heading for the worldwide Summit 2010 in Whistler, Mountain View.

Independence day with fireworks in SF is just over, and we are already heading back to the city, this time for the airport. In the past two weeks there was not much time for blogging: Mozilla interns BBQ, awesome work at the Metrics team, and Germany advancing past the round of eight in the soccer world cup.

Before I board the plane, I want to share a picture of the custom keyboard I am using at Mozilla:

Mission accomplished!

Update:

Thanks to Pascal at Mozilla who gave me a keyboard with German layout.

July 06, 2010 01:48 PM

Stirring Kettle

To work on my intern project at Mozilla, I have learned my way around with Pentaho Data Integration (aka Kettle).

What is this data integration anyways?

At any organization as large as Mozilla, enormous amounts of data are generated, that are potentially useful when making development decisions: We count downloads, up-to-date checks for the malware blocklist and installed addons, and there are webserver logs for the various Mozilla Web sites, the responses for Test Pilot case studies, and so on.

Such data pieces are generated in large quantities every day. So before the data can be analyzed by the metrics team, it needs to be grouped by common criteria (e.g. by date, language, region or hour of the day). This way, the data sets are summarized and the amount of becomes digestable for statistical tools such as R, Microsoft Excel or OpenOffice Calc.

A data collection that is accessible for analysis in this way is often called a data warehouse, as it persists data and makes it accessible in consumable quantities. Data integration is the task of transforming data from various sources into the data warehouse representation.

How does Kettle help here?

Kettle is a powerful node based tool to model and implement data integration tasks. It simple to visually express data transformations without getting lost in a soup of nested function calls and intermingled SQL-statements. Nodes in the graph represent transformation steps, while the edges indicate the flow of records. Each step handles one record at a time, allowing for parallel handling of large data sets.

There are lots of predefined steps available to import and export data to and from text/CSV files or database tables, to perform basic calculation, to group and to sort. There are steps for details-lookup, for merging and for splitting of record sets. When manually programmed, such operations require a lot of hand coding and are easy to get wrong. With Kettle, it is just a matter of connecting the right nodes and setting the appropriate configuration.

Whenever the predefined steps are insufficient, it is possible to write custom steps in JavaScript — or Java if performance is a concern.

No downsides?

Of course, there is always room or improvement, with Pentaho Data Integration especially in the area of usability. On Mac OS X, the visual editor does not use the appropriate shortcuts (it requires you to press ctrl-c instead of cmd-c for copy to clipboard). Also, the node editing is a bit fiddly: The editor for the various transformation steps should be a contextual inspector that automatically shows the editing options for the currently selected steps. Instead, I manually have to open it for each step (that means: all the time).

In the end, Kettle is very useful nonetheless: It allows for headless execution of the created transformations, so that the data integration process can be automated. And it has very good support for regular expressions, allowing for the parsing of fairly complicated source formats.

If you have to deal with the conversion of file and/or database formats on a regular basis, you might want to give Kettle a try. There is a free community edition of PDI available at the Pentaho website.

July 06, 2010 11:45 AM

July 01, 2010

John Wayne Hill

Firefox Home Tab Concepts

As you may know, I’ve been doing a lot of researching and thinking about post Firefox 4 Home Tab during my internship here at Mozilla. I’ve taken the research I’ve conducted, my colleagues thinking, experience and ideas, along with my own experience and ideas and put together some wireframes. These sketches represent some very basic directions that we could take with the Home Tab.

It’s important to note that these concepts represent some very basic and rough ideas of what the home tab could look like in the future. These are in no way absolute directions, but rather provide some jumping off points for future work.

That being said, let’s frame these concepts a bit better.

I’ve been thinking about the word “Home” and it’s meaning for a while. So, what does it mean and how am I using it?

Home: a place to store my stuff. I define home here as a place to store my stuff. This is a very basic definition and certainly does not cover all uses of the word but I’ve found it adequate for my research.

I’ve also done some research looking at current ‘start’ pages on the web, as well as some academic research. Currently most of these ‘start’ pages allow you to collect things, put your things in ‘boxes’, they allow for customization, and usually have some sort of quick access links. But, … they still don’t understand me!

What we really need is a better way to organize and collect my online data, all of it. We need a way to help me find stuff I’ve put online, stuff my friends have put online, and general online trends. We need a way of representing the relationships between these things. We need to better understand people’s locations and how that effects browsing habits. Furthermore, we need a way for me to discover new things, not just random things (which is entertaining at times), but things that matter to me.

I’ve also identified some keywords that I think are important in going forward with my research: Personal, Fast, Digestible, Easy, Stable, Findable, Discoverable, and Delightful.

With this basic framing in place we can now begin to explore this design space via some concepts.
(Please note that I did not wireframe all my ideas, concepts, and sketches but rather only a subset of these)

Sessions & Discover

The Sessions & Discover concept illustrates many ideas. First, you have a basic session restore feature that allows you to save and restore browsing session with ease. The sites feature is basically a location aware list of your favorite bookmarks. The Links feature is a listing of all the links, photos, videos, etc that you have shared across the web; this makes finding these links much easier as they are likely pretty important to you. Next up we have the Discover feature. This feature is a way for Firefox to show you things that you are interested in that you might not have discovered yet. For instance, if you were big into photography, like me, Firefox might ‘know’ this by your browsing history, bookmarks, etc. Firefox could then easily find other websites and applications that you are likely to be interesting to you. On the very right is the Contacts feature. This feature collects all of your contacts from across the web and lets you know who is online in a open, non-platform binding manner.

Many of these features are included in other concepts below.

Drawers

The Drawers concept includes features such as Sites, Links, and Contacts. Furthermore it features a Downloads section which lists all of your downloads for greatly findability. History is located on the left side of the browser and slides out, as a drawer, to list your browsing history. Additionally a Discover drawer is located on the right which also slides out and shows things that you could discover.

WordPress

The WordPress concept takes many of the above features and puts them in a very familiar WordPress like layout. This would allow for a more detail per individual feature while still being navigatable. Furthermore, this concept features a Personal Search which allows you to search across all of your personal items, history, links, etc.

Post in the Middle

The Post in the Middle concept shows many of the same features as the concepts above. Additionally, this concept features a quick post area that allows for quickly posting to a blog; as well as a simple ToDo list.

Spokes

The Spokes concept is a way to show the relationships of your data to you. You could click on the Sites icon to see your bookmarks, or click on Contacts to see a listing of friends; from there you could dive deeper to take a look at what links you have shared with a particular friend, or what links they have shared with you.

Left Nav

The Left Nav is a concept that shows greater details for each feature while still providing easy, very common, navigation.

Grid

The Grid concept is a way to show lots of information in an overview like state. Individual items could be drilled down into to see more detail and information. Furthermore, this concept has a Web Clips feature which would allow you to ‘clip’ a certain part of a website and have it shown and updated on your home page (shopping for prices, game scores, etc). The Events feature shows you events in your local area that you might be interested and could also pull information in from various calendars.

As a Site

The As a Site concept shows what Firefox Home Tab could look like as a website. This could allow you to use a friends computer, but log into Firefox and have access to all of your data.

Timeline

The Timeline concept shows your history, discovery items, and trending topics in a timeline view. This view shows history along a timeline as well as showing ‘future history’, Discovery towards the front. This allows for a great mental model of things that you might be interested in going to, but have not yet visited. Individual favicons would be displayed along the top of the line if a topic/website is trending across the web or below the line if a topic/website is more personal to just you. Each favicon could be clicked to see more information. Additionally, a slider along the bottom of the page allows for different zoom levels to get a broad or vary narrow view of your personal timeline.

Hitchhiker’s Guide

The Hitchhiker’s Guide concept is directly inspired from the book interface of the movie. This provides a delightful way of exploring your personal information gathered from across the web.

Feedback, Critique, and Future Directions

I presented these ideas and concepts to the Firefox UX team, of which I’m a proud proud member! My colleagues gave me great feedback, critique, and suggestions. Some feedback that I recieved was that there wasn’t always a clear visual hierarchy to these designs, there was a desire to see other firefox content within these concepts, that clips and contacts are great, worry about how to show different web applications (not app tabs), a worry about Links vs Sites, thoughts on how to scale these ideas to other devices, thoughts on sharing things via the browser, comments on how to make Firefox Home Tab more personal, as well as how to show that things are private and secure, and much much more.

Future directions include iterating on these and other ideas, ideating on my colleagues great feedback and critique, and getting more public feedback. Furthermore, I wish to explore more design inspiration for future interfaces. I also wish to further think about how concepts might scale to other devices, and how to make the home tab much more personal.

July 01, 2010 06:10 PM

June 30, 2010

Brian Louie

MDN roadmap talk today

If you’re interested in learning about the changes we’re making to the Mozilla Developer Network and our efforts to engage and communicate with developers, check out the talk I’m giving with Jay Patel at 1:30pm PST. The viewing information is as follows:

It’ll be a good time. See you then!

EDIT: You can find a copy of the slide deck here.


June 30, 2010 08:17 PM

June 29, 2010

Brian Louie

Results from Mozilla’s Developer Survey #2

(This entry was written in collaboration with Jay Patel. Note that this is the same entry as the one found on Mozilla Hacks.)

To follow up on the developer survey from last November, we did a second survey this past March after the releases of Firefox 3.6 and Firebug 1.5 to gauge developer reactions to the latest features in the browser and a much improved version of everyone’s favorite developer tool.

In this post we’ll share the results of our latest survey and provide some data and insights from all the great feedback we have received. We hope this will help us better understand developers’ needs and continue to build out the Mozilla Developer Network to better engage with them.

Recap of the November 2009 Survey

As a refresher, here is a summary of the initial November 2009 survey. The main takeaways were as follows:

Results from the March 2010 Survey

Our second developer survey received 2,267 responses over two months from late March to early June.

For this survey there were several common questions from the previous one – about browser preferences – so that we could measure satisfaction over time and follow trends in browser adoption following the release of Firefox 3.6.
We also responded to the overwhelmingly enthusiastic praise of Firebug by asking for feedback on the most recent release. By obtaining more specific feedback on the latest version of Firebug, we hope to address any remaining issues to make it an even more effective and attractive tool for developers.

Developer Browser Preferences

We did not see much change in browser preferences from November 2009 to March 2010. Even considering a new iteration of Firefox and increasing competition from other browsers, the data still reflect general browser market share trends: the latest versions of Firefox and Chrome gained at the expense of older versions of IE.

The following data show the primary browsers developers use to test their websites:

Which browser(s) do you test your web sites against to make sure they are compatible?

November 2009


Tested Against
Percent
Firefox 3.5 82.03%
IE 8 74.63%
IE 7 68.23%
Chrome 60.23%

March 2010

Tested Against Percent
Firefox 3.6 80.17%
IE 8 70.23%
Chrome 62.37%
IE 7 56.18%

The numbers are unlikely to shift drastically because regardless of developers’ personal preferences, the top browsers listed above are the ones most commonly used by regular users, as demonstrated by browser market share data. Thus it makes sense that developers test against these browsers most often.

Firefox isn’t just the most popular browser for developing, according to the data below; it’s also popular for personal usage. It should be noted, however, that this survey was distributed primarily though Mozilla-related channels, so there might be some bias in the results; we address this problem later in the report.

Note also that the vast majority of developers were quick on the uptake switching from 3.5 to 3.6.

Have you tried Firefox 3.6?

Upgrading to Firefox 3.6

Although the vast majority of developers switched from 3.5 to 3.6, there were still some who did not. In fact, roughly 10% of the March survey respondents still used 3.5. The primary reasons for the continued usage on 3.5, however, had little to do with personal preference. Roughly half of those who still used 3.5 did not even know that 3.6 was released, while the other half responded that they didn’t have time to update.

One interesting note from the results was that a lot of developers still using Firefox 3.5 were on Linux distros that did not yet have the Firefox 3.6 package available at the time they took the survey. Given that 23% of respondents develop on the Linux platform, that could explain why so many had not made the jump.

What operating system do you mainly use for your development environment?

Unfortunately the data lacked specific details on why developers did not know about 3.6 or why they did not find time to update to the next version. With that said, regardless of the reasons, it is clear we should focus on facilitating the update process for future iterations of Firefox. We will start by promoting early betas and announcing new Firefox releases on the MDN website.

Feedback on Firebug 1.5

We all know that Firebug is important to developers, so we wanted to focus on getting Firebug-related feedback for this survey. Comments about Firebug echoed those from the November survey: the consensus is that “Firebug is the single most important tool in web development.” Indeed Firebug is considered such a critical tool in the developer’s arsenal that several of you asked us to package Firebug as a built-in component of Firefox instead of just as an Add-on; some users call the duo the “triple F”: Firefox and Firebug.

While the 1.5 release was a huge improvement from previous versions, developers weren’t shy about sharing their frustrations and feature requests. Many noted occasional stability issues, such as when Firebug is finding elements in document trees or taking certain Ajax requests. Additionally, we received several suggestions for improving the user interface, such as incorporating more Firefox-native design elements, increasing the size of the “Deactivate Firebug” button, and removing elements like the “Quick Info” and “CSS Overview” boxes.

One data point that stood out was that about 22% of developers had not tried Firebug 1.5 at time they took the survey. Considering that it was released in January and the survey was open from March to June, we would have expected that the adoption of such an important tool to be higher than what the data suggests. This presents an opportunity to better communicate new releases and raise awareness among developers to make sure they are up-to-date on the latest development happening with Firebug.

Have you tried Firebug 1.5?

For those of you who are interested in learning more about documentation, features, and related news, visit the Firebug website. Along with regular blog posts from the team, the site will host community forums for discussions with community and Firebug team members and offer ways to get involved if you want to contribute to the project. Firebug 1.6 development is well underway and we’ll continue to see it evolve to meet web developers’ needs.

Next Steps

Thus far your feedback via our first two surveys has been invaluable as we strive to build a better open Web through the Mozilla Developer Network. We now have a decent snapshot of the type of development you do, the technologies and tools you use, and the browsers you prefer for both work and personal use. The insights we have gained will help us refine the MDN roadmap and guide the programs we develop over of the next year to better engage with developers and build out the MDN website to meet your needs.

Our next step is to move beyond these initial data to get a larger snapshot of the developer community. We will start by designing an informal survey to get a grasp of what developers here at Mozilla and within our immediate community have to say about the tools and resources they find the most valuable for their work. We plan to follow that up with more research on the web developer community as a whole by distributing an industry-wide survey.

The goal for Q3 is to design a survey that can be distributed to a more diverse and unbiased global developer community. We plan to launch the new survey later this year and will look to you to help us reach the right mix of developers. Ultimately our goal is to have the clearest possible picture of the global web developer community and how it views the current “state of the Web”.


June 29, 2010 08:44 PM

June 28, 2010

Brian Louie

Hello, world!

Since this is my first post as an intern for a tech company, I figure I should title it in classic programmer’s style.

My name’s Brian, and I’m a Developer Engagement Intern at Mozilla this summer. I will soon be a junior at Stanford. Generally, I’m pretty bad about updating blogs, but I’ll do what I can to keep the world updated on what I’m doing to keep web developers on Firefox. Looking forward to a great summer!


June 28, 2010 07:55 PM

June 24, 2010

Michael Kurze

72 Hours at Mozilla

On Monday, my internship at Mozilla started, and I can tell you how great it is. Since everything is open source anyway, I am actually encouraged to blog and talk about my work there.

Mozilla has more than a hundred people at its headquarters in Mountain View, while even more contributors work from all around the world. There are more than thirty other interns here, involved in various projects from mobile development, to metrics (such as myself), to developer engagement. I am going to write more about the data integration project I am working on, but first I want to give a quick impression of what an internship at Mozilla entails.

There are various benefits that help you to relax when you need to, and to focus on your work otherwise. For example free snacks and drinks (even beer) are provided for everyone, there are some big screen TV sets (yes, I watched the German team advance in the World Cup today, wooot), as well as pool and ping pong tables.

Also, there are lots of small conference rooms, so whenever you need some quiet for work and/or a phone call, you can find a spot, or just hang out at Ten Forward which is like a bar, a living room and a cinema in one. Funny thing: All conference rooms are either inspired by the Star Trek series, or pick up on classic internet memes. Other than Ten Forward, there are for example Holodeck (where new interns are trained), All your Base and the Bikeshed.

Every Monday after the all-hands meeting there is free food for everyone, and every Wednesday evening there is Intern Movie Night (we watched Primer tonight: great, but mind-boggling). Yesterday, I was at lunch with the Metrics Team: There is some great seafood to be had in mountain view.

In July, there will be the Mozilla Summit in Whistler, Canada. I will make sure to write about that, too.

June 24, 2010 08:42 AM

June 18, 2010

Michael Kurze

Going to Mozilla

Starting on Monday, June 21 I am going to intern at the Mozilla Corporation (MoCo) in Mountain View, California. Yay!

For quite some time I have been following the mozine and later PMO. So I am absolutely thrilled to have this opportunity, and this also means that this blog will get a new topic added. Not only will I get to know many more interns with whom I am going to live in Mountain View, and not only will I participate in the Mozilla project together with all the great people at the MoCo HQ. But also I will be attending the Mozilla Summit, the biennial meeting of people from all over the world that made great projects such as the Firefox web browser and AMO possible.

My internship position will be at the metrics department led by Ken Kovash and quite probably I will be allowed to go into the details of my project there, either at this blog or at a Mozilla blog.

Leaving for CA

If you plan to go abroad to the U.S. for an internship, I suggest you apply for the internship position(s) of your choice at least two months before the actual start of the internship. I was a bit late to the party and that led to a rather tight schedule: As a Germany based student at RWTH Aachen University, I had to invest some time in getting the visa. But fortunately there is a very helpful visa sponsoring partner, so everything went smoothly after all.

I do not know about other areas, but as a student in computer science you can expect compensation for an internship in the U.S. which is not necessarily the case in Germany. I applied at two organizations, and in both cases their offers covered living expenses and the flight to California. So I really do recommend that next spring you visit the web site of any company or organization you always wanted to get to know, and apply for an internship there. Make sure that the professional and academic experience on your resume matches the position you apply for, and prepare for two to three phone interviews.

June 18, 2010 05:07 PM

June 16, 2010

John Wayne Hill

Perceived Speed Performace

Firefox is fast, no doubt about it. But for many people it feels pretty slow when starting up. Chrome, while only marginally faster than Firefox at starting, feels much faster. By analyzing videos of these start-up processes we can start to understand what makes Firefox feel slow.

First, last start with some definitions of browser start-up events.

Videos

My colleague Alex Faaborg shot the following videos with an SLR at 60fps. Furthermore he created a very small application that would show time flying by in milliseconds. He then loaded up each browser, with different configurations, three times each.

Firefox Fresh (no plugins): http://www.youtube.com/watch?v=HtC7XVdq8Ko
Firefox vs Chrome (Fresh): http://www.youtube.com/watch?v=S3oLFHkeCco
Firefox vs Chrome (Full): http://www.youtube.com/watch?v=t7uAFp4gRq4

General Observations

Spinner Count: Upon starting Firefox, the spinner graphic is shown (and disappears) a total of three times, meanwhile in Chrome the graphic is only shown twice.

Window Drawing: In Firefox, the window is drawn (animated to size), then the browser chrome is drawn, then the website is drawn. In Chrome, the window and browser chrome is drawn all at once and then the web- site is drawn. This helps Chrome to feel faster because there is less visually going on at different times. Firefox feels very sequential in it’s loading, while Chrome seems to do everything at once. This allows Chrome to feel fast because once the window is animated the size, everything is pretty much ready to go. This is especially true if google.com is set as your homepage on Chrome.

Webpage Drawing: In Chrome the webpage loading icon is fairly small and is never ‘fully’ seen. While in Firefox the loading icon is large, grey, and can always be seen in it’s entirety. This is visually ‘bloated’ and makes Firefox seems slower. Furthermore, because Chrome’s loading icon animation goes ‘around’ faster, Firefox’s loading icon takes more time (seemingly) to get ‘around’.

Page Title: In Firefox, a page’s title is shown on the tab right away, while in Chrome the title is not shown un- til the website has completed loading. This is a simple trick that allows Chrome to feel faster in that once the title is shown, the page is ready. While in Firefox, a page’s title makes it seem like a page has loaded but
in fact the page isn’t ready to be interacted with quite yet and the user has to ‘wait longer’.

Graphs

The following graphs show the average time, in milliseconds, each event takes to ‘complete’.

Firefox Fresh Full

Explanation of Deltas

In the Firefox vs Chrome Fresh Installs graph, Firefox was loaded up with the default minefield page. This page is significantly heavier (both in text and images) than the Chrome Fresh Installs default page (google.com).

It should also be noted that Chrome draws the window and browser chrome at the same time.

In the Firefox vs Chrome Full graph, Firefox was loaded with at least four tabs while Chrome was only loaded with one tab (google.com). This has a significant affect on the Window Drawing time and the Close Window time (diaglog box that informs of closing multiple tabs opens and needs to be closed first).

Recommend Actions

With just a few changes in the Firefox start-up process, we could greatly enhance the feeling of Firefox’s speed. The changes listed below are recommendations to help better the overall Firefox experience.

June 16, 2010 09:25 PM

Jaclyn Fu

Lock and Loaded

Firefox Home for the iPhone and Firefox 1.1 for the Nokia N900 are about to go live soon! So what have I been doing to help support these launches?

To find out more information, tune in to the bi-weekly Community Marketing Calls or the IRC #mobile channel.


June 16, 2010 05:41 PM

June 03, 2010

Brian Krausz

How to Dispose of a Hard Drive

In 5 easy steps:

  1. Find hammer
  2. Give up on finding hammer…grab pliers
  3. Attack drive with pliers, destorying circuitry but leaving platters untouched
  4. Cut finger, swear and bleed profusely on drive
  5. Repeat steps 3 & 4 until you realize that nobody cares enough about your data to read it directly from platters. Toss drive in trash, go grab a band-aid

Tada!

June 03, 2010 01:50 AM

May 29, 2010

Jaclyn Fu

Off to the Races

The first three days were fun, but getting started on my projects for the summer is even better! I had my 1 on 1 meeting with Caitlin and we sat down to identify objectives and which of my ideas met those objectives.  It’s so exciting to have your ideas recognized and to be put into place, especially as an intern – there’s no coffee fetching here (only if it’s for yourself)! At Mozilla, interns have just as much responsibility and accountability as regular employees. Love it. I have full control over my projects and creative input in everything I want to do.

My first task was to write creative briefs on the ideas I’m proposing to help drive downloads for Firefox Home and Firefox 1.1 on the Nokia N900. Firefox Home is an iPhone application that will sync your desktop and mobile phone with all of your Firefox history, tabs and bookmarks so that you can just get up and go with all your stuff. Pretty handy for people like me who hate typing out lengthy URLS and who always forget passwords. If you have a N900, download Firefox 1.1 and check out how features like the Awesome Bar, Add-Ons, and Firefox Sync can make your mobile browsing experience even better.

Writing the creative briefs reminded me of writing case briefs for marketing class. It’s definitely a lot harder to write a proposal completely off of your own idea than analyzing a previous case. But with them almost complete, I have already started talking to different Mozillians and got the ball rolling on putting things together. Can’t wait to see them at materialization!


May 29, 2010 05:31 PM

May 27, 2010

Brian Krausz

Diaspora’s Upfront Costs

This post on Hacker News got me thinking about the costs Dispora’s going to have receiving all of their money and fulfilling their promises, so I did a little digging. The numbers below are estimates, but they should be fairly close to actual costs for these services (assuming no huge burst in donations over the next 6 days):

$ 5510 = $190k * 2.9% Amazon fees[1]
  1800 = 6k donations * $0.30 Amazon fees
  9500 = $190k * 5% for Kickstarter
  4150 = 5000 cds with jewel cases * $0.83 (random googling, I assume the "note from our team" will be on the jewel case insert)
  1380 = 400 sheets of stickers * $3.45 (zazzle, 20 sheet of stickers, 2 stickers per person)
 10200 = 3000 shirts * $3.40 (customink, Gildan 50/50 1 color on white front only)
  9000 = 3000 postage & packaging for shirts + stickers * $3
  2000 = 2000 postage & packaging for just stickers * $1
  1200 = "Turnkey hosting" for 600 people[2]
  2800 = 4 new computers*$700
======
$47540

[1] I’m not sure if Kickstarter gets a bulk discount here, or if it’s Dispora’s account history, so a volume discount may apply. I also assume all transactions are billed at the $10+ rate (2.9%) rather than the < $10 rate (5%) for simplicity.
[2] Turnkey hosting and phone support are hard to estimate...it may be more if they need to pay for phone support, but I think this is a reasonable number. I'm also including project hosting costs. I know they say plenty of hosting companies have offered their services, but you can't guarantee that will be there.

Keep in mind that this misses three big points:

  1. Declined credit cards & canceled/fraudulent donations – I have no clue what the expected amount of these is
  2. People who requested a gift for donating who never give their contact info
  3. The huge overhead for packing/sending all of these items, though I imagine a day of pizza and soda for volunteers can get all of them packed (the con I used to help run had similar “mailing parties” that were fairly effective)

With that in mind you’re looking at about 25% of the funding going toward transaction fees and fulfilling the rewards. This leaves around $142,000 left for them, which is still plenty of money. Though I don’t want to think about what an accountant would say about this money and how much he would charge to make it legitimate.

Don’t get me wrong: I think Diaspora is a great idea and I’d love to see it succeed, but I wonder if the founders considered the logistical overhead to this whole thing. Granted, this would have been smaller had they only raised $10k, but it’s still a big task to undertake. I hope they’re ready for it and they don’t let us down.

May 27, 2010 03:08 AM

Boston WordPress Meetup Example Code

As promised here’s the example code from the meetup I gave last Monday. It’s fairly small, so I only describe what it does briefly in the top comment. Feel free to use it how you wish (though if you make a lot of money off of it you owe me a t-shirt):

Example 1: Erroring out on install
register_activation_hook(__FILE__, 'bostonwp_install_error');

if('error_scrape' == $_GET['action'] && basename($_SERVER['PHP_SELF']) == 'plugins.php') {
    echo '<pre>' . get_option('bostonwp_activate_error') . '</pre>';
    delete_option('bostonwp_activate_error');
    deactivate_plugins($_GET['plugin']);
    die();
}

function bostonwp_install_error($error = false) {
    if(!$error) {
        $error = 'Generic Error Occurred';
    }
    add_option('bostonwp_activate_error', $error);
    //trigger a fatal error
    trigger_error('', E_USER_ERROR);
}

Example 2: Updating your DB structure
// http://codex.wordpress.org/Creating_Tables_with_Plugins

define('BOSTONWP_DB_VERSION', '1.0');

register_activation_hook(__FILE__, 'bostonwp_install');

$wpdb->bostonwp = $wpdb->prefix . 'bostonwp';

function bostonwp_install() {
    global $wpdb;

    $installed_ver = get_option( 'bostonwp_db_version' );

    $sql = 'CREATE TABLE ' . $wpdb->bostonwp . ' (
        id mediumint(9) NOT NULL AUTO_INCREMENT,
        time bigint(11) DEFAULT 0 NOT NULL,
        name tinytext NOT NULL,
        text text NOT NULL,
        url VARCHAR(55) NOT NULL,
        UNIQUE KEY id (id)
        );';

    if($wpdb->get_var('show tables like "' . $wpdb->bostonwp . '"') != $wpdb->bostonwp) {
        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
        dbDelta($sql);

        $welcome_name = 'Mr. Wordpress';
        $welcome_text = 'Congratulations, you just completed the installation!';

        $insert = 'INSERT INTO ' . $wpdb->bostonwp .
            ' (time, name, text) ' .
            'VALUES (' . time() . ',"' . $wpdb->escape($welcome_name) . '","' . $wpdb->escape($welcome_text) . '")"';

        $results = $wpdb->query( $insert );

        add_option("bostonwp_db_version", BOSTONWP_DB_VERSION);
    }
    elseif( $installed_ver != BOSTONWP_DB_VERSION ) {
        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
        dbDelta($sql);

        update_option( "bostonwp_db_version", BOSTONWP_DB_VERSION );
    }
}

Example 3: Adding admin menus
// http://codex.wordpress.org/Adding_Administration_Menus

add_action('admin_menu', 'bostonwp_menu');
function bostonwp_menu() {
    add_posts_page('My Page', 'My Page', 'manage_categories', 'bostonwp_page', 'bostonwp_dostuff');
}

function bostonwp_dostuff() {
?>
    <div class="wrap">
        <?php if(function_exists('screen_icon')) screen_icon(); ?>
        <h2>My Boston WP Page</h2>
    </div>
<?php
}

Example 4: Adding meta boxes to posts
// http://www.deluxeblogtips.com/2010/04/how-to-create-meta-box-wordpress-post.html

add_action('add_meta_boxes_post', 'bostonwp_box');
add_action('save_post', 'bostonwp_save');
add_action('delete_post', 'bostonwp_delete');

function bostonwp_box($post) {
    // http://codex.wordpress.org/Function_Reference/add_meta_box
    add_meta_box('bostonwp', __('Boston WP'), 'bostonwp_meta_box', 'post', 'side');
}

function bostonwp_meta_box() {
    global $post;
    $val = get_post_meta($post->ID, 'bostonwp', true);

    // Use nonce for verification
    echo '<input type="hidden" name="bostonwp_nonce" id="bostonwp_nonce" value="' . wp_create_nonce( plugin_basename(__FILE__) ) . '" />';

    // The actual fields for data entry
    echo '<input type="checkbox" name="bostonwp" value="1" ' . ($val ? ' checked="checked" ' : '') . ' />';
    echo '<label for="bostonwp">' . __('There Is Cake!') . '</label> ';
}

function bostonwp_save($id) {
    // verify nonce
    if ($_POST['action'] != 'inline-save' && !wp_verify_nonce($_POST['bostonwp_nonce'], plugin_basename(__FILE__))) {
        return $id;
    }

    // check autosave
    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return $id;
    }

    update_post_meta($id, 'bostonwp', $_POST['bostonwp']);
}

function bostonwp_delete($id) {
    delete_post_meta($id, 'bostonwp');
}

Example 5: Adding columns to post list
add_filter('manage_posts_columns', 'bostonwp_posts_column');
add_action('manage_posts_custom_column', 'bostonwp_manage_column', 10, 2);

function bostonwp_posts_column($cols) {
    $cols['bostonwp'] = __('Boston WP');
    return $cols;
}

function bostonwp_manage_column($name, $id) {
    if($name != 'bostonwp') {
        return;
    }
    $cake = get_post_meta($id, 'bostonwp', true);
    if($cake) {
        echo 'There is cake!';
        $cake = 1;
    }
    else {
        echo 'The cake is a lie!';
        $cake = 0;
    }
    echo '<div id="inline_' . $id . '_bostonwp" class="hidden">' . $cake . '</div>';
}

Example 6: Expanding Quick Edit
add_action('quick_edit_custom_box', 'bostonwp_posts_custom_box', 10, 2);
add_action('admin_head-edit.php', 'bostonwp_add_script');

function bostonwp_posts_custom_box($col, $type) {
    if($col != 'bostonwp' || $type != 'post') {
        return;
    }
?>
<fieldset class="inline-edit-col-right"><div class="inline-edit-col">
    <div class="inline-edit-group">
        <label class="alignleft">
            <input type="checkbox" value="1" name="bostonwp" id="bostonwp_check">
            <span class="checkbox-title">This Post Has Cake</span>
        </label>
    </div>
</fieldset>
<?php
}

function bostonwp_add_script() {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('a.editinline').live('click', function() {
        var id = inlineEditPost.getId(this);
        var val = parseInt(jQuery('#inline_' + id + '_bostonwp').text());
        jQuery('#bostonwp_check').attr('checked', !!val);
    });
});
</script>
<?php
}

May 27, 2010 02:01 AM

May 26, 2010

John Wayne Hill

Firefox Home Tab

Firefox 4 Home Tab Icon

As you may know, I’m currently working as User Experience Intern at Mozilla. I’ve been tasked with designing the next generation Firefox Home Tab. I wanted to share what work I’ve done so far and give a general update on what I plan on doing in the near future. I will be routinely updating the progress and my work on this project as the summer goes forward. So check back often to keep updated on what I’m doing.

I think it’s important to know right off the what we (the UX team) are imagining for the new home tab. We do not imagine the new home tab to be a content aggregation service, but rather we hope to fully understand and push the boundaries of what we (as a browser) can do that websites might not be able to do well. I’ve come up with some approaches that I’ve been looking at to use while designing, which I’ve listed below.

Possible Design Tools

Current Existing Approaches

I started out with this project by completing a competitor analysis of current ‘home’ pages on the web. This would allow me to get a good grasp of what is currently ‘out there’ in the world, to get a base understanding of what people actually use, to find out what is popular currently, to understand some trends, and to find what existing approaches currently ‘do right’. In order to be effective, I decided to focus on the following web sites:

Yahoo

My Yahoo

iGoogle

Windows Live

MSN

My MSN

Netvibes

Chi.mp

Flavors.me

UnHub

 

In doing this research I looked at trends among these sites and general observations. I aggregated
this research into the following observations.

You can find my full research (notes) on Google Docs

Summary and Next Steps

To summarize, we are not looking to build the next iGoogle, Netvibes, or My Yahoo clone, but rather
looking at what we (Mozilla) can do with our special role as an information broker and not a
web site. I’ve outlined some possible design tools and approaches to use in this project, and looked
at existing solutions in the world today.

As I move forward in this (very fluid) design process, I’ll be blogging about individual steps I’m
taking as well as my reflection on those steps and my process in general. I hope to continue
writing about my experience here at Mozilla and the awesome things on which I get to work.

I look forward to your feedback, comments, and ideas while continuing my work on this project.

May 26, 2010 06:45 PM

May 25, 2010

Jaclyn Fu

270

Sitting on a padded rolling filing cabinet in a conference room named “Peanut Butter and Jelly”, I witnessed the creative whirlwind that would be the makings of a product launch. Amidst all the ideas being thrown around, teleconference technical difficulties and big dogs, I was truly inspired. The marketing meetings I attended really showed me how much of an impact such a small group of people can make on millions of people. It was in this Peanut Butter and Jelly conference room that Firefox Mobile was going to be marketed and rolled out. What does it take to market Firefox Mobile? A whole bunch of Google Docs, emails, coffee and amazing people. Everyone has so much responsibility and input, I can’t wait to get started and produce results!

I was reminded of Mozilla’s vision and how everything centered around improving the web experience through open-source transparency. It still surprises me that only a company of 270 employees can make such a great difference in the way we browse the web – and soon, how we browse on a mobile phone. Probably had a lot of interns..


May 25, 2010 09:40 PM

May 24, 2010

Jaclyn Fu

Day 1

Hey everyone! This blog will be about my summer at Mozilla as a Firefox Mobile Marketing Intern. I will be posting on my thoughts about mobile browsing, Firefox on different phones and what it’s like to be a product marketing intern here at Mozilla.

To kick it off, my first day went something like this:

* Dogs
* Orientation (which was an overload of information on how good the life of an intern is)
* Meeting my mentor – Yay Caitlin!
* Getting lost finding the bathroom
* Getting lost finding my desk
* Chinese food!
* More stickers added to my laptop (I found that the average stickers/laptop here is around 2)

I’m so excited to get my hands on an Android phone so I can start testing mobile browsers (basically to confirm that Firefox Mobile is the best)! I’ll also be working to drive downloads for Firefox 1.1 on Nokia N900s and to engage with the early adopter community.

Only 43 more days until Mozilla Summit in Whistler!


May 24, 2010 08:56 PM

May 20, 2010

John Wayne Hill

Firefox User Experience

Firefox IconWoo hoo!

This summer (actually I already started) I will be working with Mozilla on the Firefox User Experience team. I couldn’t be more excited or happy. Firefox is a great product that has around 370 million users worldwide. This is a huge audience for which to design and will come with many challenges. I look forward to tackling these challenges head on with all that I have learned about design. I also hope to learn more than ever about designing in the real world, working with real people, on  stuff that will actually be in the world and used by millions. It’s scary as hell and I love it!

Reflection Thus Far

In thinking about the past (almost) two weeks, I can already seen how things have changed for me a bit. I’ve started to understand how UX teams might work in real world companies, specifically companies that are developer centric. Furthermore, I’ve started to understand the unique challenges that come with designing open source software. There are so many people involved, so many opinions, and so very many valid use and edge cases. It’s superbly interesting and a little overwhelming. I’m starting to look through my toolset and understand what tools I have that can best be used within a community such as Firefox. My colleagues (wow, that’s awesome to say) have blogged about some of these things as well. I work with really smart and amazing people. I’m very grateful for their help and support thus far.

You might want to have a look at what Alex Faaborg, Jennifer Borris, Aza Raskin, and Alex Limi are saying. It’s awesome!

The first week here I was a sponge, running around trying to soak up as much information as possible. It also happened to be an intensive work week where we had all of our remote people in the office. It was a really great week where I learned quite a bit about how things work at Mozilla and the direction that Firefox was taking. I also got to participate in many quick design meetings where we discussed and ideated on designs. Furthermore, I was able to give my opinion on some Bike Sheding issues and I really felt welcomed.

This week (my second) I’ve started my first project and helped the team on some other stuff. Limi and I filled a bazillion bugs for the Firefox Papercuts issues (see his presentation on the topic). So now I have a great grasp on filling bugs within bugzilla. My new project involves doing a good amount of research on what the next generation “home tab” might look like for the web. I really like this project thus far as it really allows me to stretch my imagination and think about the future of the web and how it can be better designed for people.

Mozilla Foundation Logo

So far, I’m having a great time. The Bay Area is fantastic. Mozilla is really great, and I love the people on the UX team. Plus I’m working for an organization that has a dino head for a logo. How cool is that!

Life is good.

May 20, 2010 09:55 PM

May 11, 2010

Adrian Kalla

The Proprietary Trap

Once again I was reminded, that proprietary file formats are not only evil, but are real trouble for the user at the end. Here is the story:

After finishing secondary school seven years ago, I started a movie project using all the pictures and video material we have gathered in school. As the software I have chosen "Pinnacle Studio 8", because my uncle was using it at that time too. I should have listened to him, when he was telling me, that "this is the worst software I have ever seen", because he was right. It took me nearly two years and an upgrade to "Studio 9" to be able to finish the project - the software was simply so buggy, that it was impossible to encode a one hour movie without bugs (e.g. missing transition effects, reversed transition effects) or crashes.

But finally - about five years ago my free time project was ready, burned to DVDs, and I was happy that I don't have to use Pinnacle's software anymore

2005 I wasn't thinking about HD videos (and my PC would be even too slow to allow me to watch them, not even considering encoding HD videos). But now I'd like to have that movie in HD.

I still have all the project files, so it would be really nice to just: choose a good video editing software, open the project and export it to 1080p. Unfortunately, that's not possible, because Pinnacle stores the project in a proprietary format. So the only choice I have, is to rely on "Pinnacle Studio 14", which can export my movie project to HD.

In theory, "Studio 14" can open projects saved by "Studio 9" or newer, but I remember my experience upgrading "Studio 8" to "Studio 9" - it took me several days to remove all the glitches it created in the project... I don't have so much time for it now - I just want to have it working and be ready with it in one single day.

To come to a conclusion: my hopes are, that:

At least I've learned my lesson: never, absolutely never store anything in a proprietary format - even if you think you won't need to use it in the future - you never really know. And you never know what (and if any) software will support that format in the future. Stay on the safe side - stay open.

May 11, 2010 02:08 AM

May 04, 2010

Brian Krausz

On To Bigger Things

Alternative title: OMGWTF I just quit my job!
Alternative alternative title: A better way to resign from a company

That’s right. I just gave notice that I’m leaving a great job with awesome coworkers and interesting problems. I’m trading all of that for the privilege of moving across the country, not taking a salary, and working 80 hours a week. If I’m lucky, I’ll get to continue doing this for a long time, rather than finding another job that pays actual money.

Shorter explanation: I’m moving to Silicon Valley to start a business.

Not too much to say right now about the startup. I got a funding offer I couldn’t turn down for an idea I really believe in. Expect more posts in the future, since they valley always does inspire more blogging in me. For now I don’t want to say too much about the idea itself, since we’re still fleshing a lot of things out, but I promise there will be some awesome posts about it in the future.

However, there is something to say about my current employer, TripAdvisor. Shortly put, they’ve been amazing. I got to work on awesome features (like mobile flight search, which just launched today…tripadvisor.com from a mobile phone). And not just work on them but have a major say in their direction. My coworkers were a lot of fun, and my boss was flexible and understanding.

I knew before I graduated that I would eventually leave my first employer to start a business (though I didn’t think it would be so soon). TripAdvisor made that an incredibly hard thing to do, which I commend them for. Hopefully I’ll be hiring soon, but until I open a Boston office, definitely apply for a position with them. If you’d like a contact within the company (not necessary, the engineering HR manager is a solid guy and will get your resume to the right place), just ask.

I’ll be out in Mountain View in early June. See you on TechCrunch :) .

May 04, 2010 01:20 AM

April 27, 2010

Wei Zhou

Tencent QQ UX design – Chinese user experience products is picking up…are we ready for the combat?

This article is about an reflection on a user experience design of a popular Chinese chatting software – QQ. I think UX experts can learn from about International digital products business development and culture barrier issues by studying their case. QQ has proven to be the best chatting software among all existing ones(it has the richest user experience and the most users) – it’s business models deserve to be studied by western cultures.  Chinese has a unique way of thinking user experience design in terms of life-enhancing patterns – we’ve seen this country is moving from imitation to innovation. For me this process is thrilling – Western investors and entrepreneurs, is it too late to enter China?

- Wei Zhou

I’ve recently seen an article from Tencent QQ official site: http://cdc.tencent.com/?p=2464

Video:

Background: Tecent QQ is the dominating instant messaging software in China. I personally believe it will be the dominating reasons for Facebook and Twitter to fail in China. This software has existed for over 20 years and it’s influence is encompassing. Chinese’ three generations are using it and it togethers with Baidu(A chinese Google), Taobao(a Chinese eBay) and Xiaonei/Kaixin(Chinese facebook) to form Chinese digital UX patterns. Recently Tencent officially announced their new prototype. It’s claim for practicing “natural interface design” reflects some Zen thoughts. It’s fresh and original interface is worth to see.

Development process(translated from their official site):

This prototype is Tencent QQ’s first NUI(Natural User Interface)product. In addition to the basic instant messaging feature, it also includes dynamic profile pictures, dynamic backgrounds, Multi-tab windows, 3D Interaction, Vector Interact and Desktop friends short-cut…

The original interface lights up the users: It triggers a lot more emotions. The interface is life-enhancing. It delivers an imaginary space beyond time and space dimensions. The expressions of interface is bold and colorful…It supports better mouse interaction and touchscreen interaction integration.

There’s two trends involved in the design process: Personified and materialized processes. Keywords are: Life force, time and space. This means the product design concerns day-to-day life stories. The interaction model should have a “breathing” effect.Design changes in different time settings, etc.,

Brain storming process:

Wireframes and prototyping:

Interesting pane emotion selector:

Visual Languages:

Profile Manager:

Friends management:

Dynamic backgrounds:

Pie panel enhances touchscreen interaction:

I will add QQ’s business models tomorrow. They did a great job on integrating online Ads into this product smoothly and seamlessly.


April 27, 2010 09:27 PM

April 22, 2010

Ehren Metcalfe

RTL level function removal

Over the past few days I’ve been focusing on getting the call graph portion of my dead code analysis in check. It turns out that function local const (or static) initializations are not accessible during later gcc passes. Luckily, walking the front end tree representation, which is accessible via Treehydra‘s process_cp_pre_genericize, does the trick. This takes care of all remaining false positives of which I am aware.

The downside is that going through all these extra tree codes is sloooow. After a bunch of false starts the damn thing is still running on one of the CDOT‘s development machines (probably an 8+ hour compile).

For a little while though, I’ve been thinking of ways to automatically remove identified dead code without actually patching the source. By applying Taras’ assembler name patch to dehydra I can now identify precisely which code to remove. The question now is how to remove it.

My first thought was a hack using objcopy. I could first output a list of the mangled names of dead functions and then, after running a build with -ffunction-sections, run a script like this:

#!/bin/sh
while read asmname
do
  find objdir -name "*.o" | xargs objcopy --remove-section=".text.$asmname"
done < asmlist.txt

(and then relinking). This works, but only for non-member functions.

The other option was some sort of gcc hack to remove as much code as possible when obcopy can’t do the job. I first tried removing every statement in every basic block of the function (see gsi_remove). This seems to only work with a non-branching cfg however (even when I leave a valid return statement). I then tried cgraph_remove_node with an IPA pass plugin which blows up if a function’s referenced anywhere else.

Today I arrived at a solution that, although requiring a direct patch of GCC, seems to be ideal. Surprisingly, it’s possible to hook in right before assembly generation, and it’s easy too:

diff --git a/gcc/final.c b/gcc/final.c
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -4090,16 +4090,34 @@
 {
   if (symbol_queue)
     {
       free (symbol_queue);
       symbol_queue = NULL;
       symbol_queue_size = 0;
     }
 }
+
+static bool
+is_dead(const char* name)
+{
+  char asmname[100];
+  FILE* fp = fopen("/home/ehren/asmlist.txt", "r");
+  if (!fp)
+    return false;
+
+  while (fscanf(fp, "%s", asmname) != EOF) {
+    if (strcmp(asmname, name) == 0) {
+      fclose(fp);
+      return true;
+    }
+  }
+  fclose(fp);
+  return false;
+}

 /* Turn the RTL into assembly.  */
 static unsigned int
 rest_of_handle_final (void)
 {
   rtx x;
   const char *fnname;

@@ -4109,17 +4127,19 @@
   x = DECL_RTL (current_function_decl);
   gcc_assert (MEM_P (x));
   x = XEXP (x, 0);
   gcc_assert (GET_CODE (x) == SYMBOL_REF);
   fnname = XSTR (x, 0);

   assemble_start_function (current_function_decl, fnname);
   final_start_function (get_insns (), asm_out_file, optimize);
-  final (get_insns (), asm_out_file, optimize);
+  if (!is_dead(fnname)) {
+    final (get_insns (), asm_out_file, optimize);
+  }
   final_end_function ();

 #ifdef TARGET_UNWIND_INFO
   /* ??? The IA-64 ".handlerdata" directive must be issued before
      the ".endp" directive that closes the procedure descriptor.  */
   output_function_exception_table (fnname);
 #endif

With this, functions are removed completely (except from the symbol table) and the bodies of virtuals are replaced with a couple words worth of NOPs. Yes, opening up the file with a hardcoded path for every function is ugly but later on I could always read it into a global somewhere else (and do a binary search).

The only downside here is I won’t get any link time errors if a few false positives slip through, as opposed to with objcopy. In my experiments, calling a function that doesn’t exist results in an immediate segmentation fault (makes sense), but storing the return of a NOP-body virtual just leaves you with an uninitialized value.

Hopefully, I’ll soon have some good results on the analysis front to actually test this on Mozilla.


April 22, 2010 04:38 AM

April 08, 2010

Ehren Metcalfe

Dead code progress

So far things are on track with my attempts to developed an unused function finding tool. Now that the function pointer/jump table problem has been solved other more subtle issues have come to light.

The first was a problem with callgraph‘s handling of inheritance chains. As I mentioned previously, it was necessary to add each method to the node table (see schema reference) both when the method’s body is processed (as is already the case) but also when the method’s type is processed. At some point I should really develop some tests here but this affects the recognition of pure virtual functions in a number of complicated cases.

However, I also ran into another issue where certain methods were not finding themselves into the inheritance chains in which they belong. This seems to be only when a virtual function overrides a base class function that has not been defined in the ‘next up’ base class (A defines virtual foo, B derives from A, C derives from B and redefines virtual foo). This could be a Treehydra issue or a maybe a problem with the GCC binfo data structure (or maybe I’m just misunderstanding things).

Either way, my solution has been to process all base classes and subclasses of a method both when the type is processed and also when the method body is processed. This appears to be a working solution (although it certainly does not improve callgraph compilation times).

Once this was handled I started to get some pretty good results but I noticed scriptable methods were getting into the mix. After a few hours of fruitless hacking it turned out I just forgot to properly define NS_SCRIPTABLE (since I’m not running a –with-static-checking build). After rebuilding again, I believe I finally attained a 0% false positive rate.

This time I hit another problem though. A bunch of genuinely dead methods turned up by my most recent (defective) analysis were not showing up. In fact, very few methods were showing up at all. Investigating, it turns out I’ve been quite overzealous in marking a method as scriptable. My previous technique was to check if __attribute__((user("NS_script")) was present in the declaration attributes of a function and also to check if it is present in the type attributes of the class and any base class. This excludes a bunch of juicy dead stuff like nsCharsetMenu::SetCharsetCheckmark (gimple isn count 75 ftw) which is a member of a non-scriptable class that derives from two scriptable interfaces (which do not declare SetCharsetCheckmark).

Naturally, the solution when marking methods scriptable because of their base classes is only to mark the method scriptable when the base class declares the method and is scriptable. Come to think of it, I probably don’t even need to do this because of the way I group together base and derived methods.

Anyway, my current status is waiting for a build with these changes to finish. We will see if there are more issues.


April 08, 2010 02:04 AM

April 06, 2010

Ehren Metcalfe

Function declaration escape analysis v2

I don’t want to get too excited until I’ve run this through 4000000 loc but I believe I’ve solved the problem of being unable to process global initializations of const/static global variables. Earlier, I posted a message to the GCC mailing list describing my troubles with varpool. I did receive a helpful response in that there is nothing inherent about const/static declarations that would prevent one from getting at the lhs of their initialization.

Today I experimented with walking as many trees in as many places as I could find without much luck. I then tried compiling this sample code with -Wunused:

int foo() {
  return 0;
}

typedef struct {
  int (*p) ();
} Table;

static Table t[] = {
  { foo }
};

As expected, GCC warns about the unused static variable.

Taking a look at toplevel.c It didn’t take too long to find a solution (and this works for const, static, and const static):

Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c  (revision 157978)
+++ gcc/toplev.c  (working copy)
@@ -844,12 +844,26 @@
   return output_something;
 }

+static tree
+find_funcs_callback(tree *tp, int *walk_subtrees, void *data)
+{
+  tree t = *tp;
+
+  if (TREE_CODE(t) == FUNCTION_DECL)
+    fprintf(stderr, "address held: %s\n", IDENTIFIER_POINTER(DECL_NAME(t)));
+
+  return NULL_TREE;
+}
+
 /* A subroutine of check_global_declarations.  Issue appropriate warnings
    for the global declaration DECL.  */

 void
 check_global_declaration_1 (tree decl)
 {
+  if (DECL_INITIAL(decl))
+    walk_tree(&DECL_INITIAL(decl), find_funcs_callback, NULL, NULL);
+
   /* Warn about any function declared static but not defined.  We don't
      warn about variables, because many programs have static variables
      that exist only to get some text into the object file.  */

I’ve got to fix up the output to match callgraph‘s serialization but this could be it.


April 06, 2010 07:46 AM

April 05, 2010

Ehren Metcalfe

Problems with const static initializations

Unfortunately I spoke too soon about developing an airtight dead code finder. The technique of processing file scope variables I mentioned in my previous post has a serious drawback: it doesn’t work for const static data. This is a show stopper when it comes to peeking into most jump tables.

I’ve been able to print type information for all globals using the dehydra hooks placed into c-common.c however it seems like const initializations are not even handled at this level. I have my suspicions that there’s no way to recover the FUNCTION_DECL node in this case, likely because gcc has no use for the info at this level.

Although I may be able to make do by simply manually filtering as many callback functions as I can this approach is not quite ideal. I’ll have to think more about this but I’m now thinking that the lto streamer might be of use. There’s also the chance that there’s another way of using the cgraph to get at this data.

The other possibility is ditching gcc entirely and using elsa to dump the data. I’ll report back when I know more.


April 05, 2010 05:02 AM

April 04, 2010

Ehren Metcalfe

Function declaration escape analysis

It’s been quite a while since I’ve blogged. Frankly I’ve got behind with my work. However, I believe I have hit a huge breakthrough finding dead code. I don’t want to get too ahead of myself but if things work as I think, I can now identify every unused function/member function in mozilla-central with a near 0 false positive rate.

I’ve mentioned many times that assignments to function pointers are a huge pain when it comes to recognizing call graph edges. I’ve been able to handle function local address taking for some time now but the problem of functions referenced in global variables (usually jump tables) has proved elusive. In fact, it’s currently not possibly to process global variables at all with Treehydra. This leads to thousands of false positives in the analysis and a bunch of special case handling.

It suddenly dawned on me that GCC might have already done the work for me. ipa-type-escape.c, which “determines which types in the program contain only instances that are completely encapsulated by the compilation unit” seems to fit the bill, but I ended up with less than stellar results trying to print out any escaping function declarations. In fact, I don’t think it really is useful for my purposes.

However, the technique of processing global variables using the varpool is exactly what I needed. In fact, I can very easily write a GCC plugin to print off all the globally escaping declarations in a compilation unit. Unfortunately, getting a plugin to build that uses more than the standard set of routines is a bit of a challenge (more stuff needs to be linked in) so I just hacked it into dehydra_plugin.c. It works though!

Here’s the code:

static tree find_funcs_callback(tree *tp, int *walk_subtrees, void *data) {
  tree t = *tp;

  if (TREE_CODE(t) == FUNCTION_DECL) {
    // dump function (I use dehydra specific code)
  }

  return NULL_TREE;
}

static void find_funcs(tree decl) {
  walk_tree(&decl, find_funcs_callback, NULL, NULL);
}

// This needs to go in the execute function of an IPA pass.
// I just stuck it into dehydra's gcc_plugin_post_parse
struct varpool_node *vnode;
FOR_EACH_STATIC_VARIABLE(vnode)
  find_funcs(DECL_INITIAL(vnode->decl));

Now all I have to do is mark every function printed by this routine as escaping. I’ve been able to match callgraph‘s serialization almost completely so this will be a breeze.

I’ve also found that the current way callgraph treats inheritance chains (using a table of ‘implementor’ – ‘interface’ pairs) is not particularly useful for finding dead code. In fact, a whole bunch of functions in the implementors table are being left out of the node table. I’ve been able to rectify this by treating method overriding just like any call edge. In particular, I have the base class ‘call’ the derived class which will fit right into my existing algorithm (becuase of dynamic dispatch, once the base method is called all bets are off on whether or not some derived method is called). In order to get any results previously, I’ve just been identifying base method-derived method pairs by textually matching the prototypes. Looking at my current results, I’ve found a disproportionate number of static methods which suggests that this technique is too conservative. Here’s the old script btw. With these callgraph chages the next one will be much simpler (with no method name parsing!)

I’ve had some success already with dead code in content and particularly in layout, even with this rudimentary script. I also certainly have more to file. With this new approach, though, I think I’ll be able able to find and file all of it by release 1.0.


April 04, 2010 03:13 PM

Josh Matthews

Knowledge++

Nine days ago, I made an off-hand remark in #content that I might be able to get the geolocation service working in Fennectrolysis by the end of the day if my plans worked out. I also remember referring to the process as “not a big deal.” Since that moment, I have put in a significant amount of work (at least several hours every day), and learned:

Having said all that, yesterday I got the Fennec geolocation permission prompt to appear when triggered by a content page, and the proper callback was called when I allowed or canceled the request, so I’m confident that I can have a patch up for review by the end of the holiday weekend. Of course, given my track record, that means it might be up by the end of the week.

April 04, 2010 04:39 AM

March 24, 2010

Benoit Girard

Syllabus for Learning Mozilla

Being a new member of the community can be very confusing at times. Coming from a close source background I had a lot of difficultly grasping how the Mozilla community operates. I remember my first week at Mozilla when I had someone jokingly grunt at me for not being on IRC. “That archaic chat client I hadn’t used since grade school?” I though. Little did I know how this old chat protocol would become nearly as valuable as my compiler.

My concern is the current mozilla wiki does a great job of being a key reference for nearly every topic but acts as just that, a reference. I have discussed offline a few times the idea of creating resources aimed specify at new members. Dria’s recent blog (1) posts (2) asking for screencasts and resources aimed at learning mozilla caught my attention.

My goal is not to duplicate the existing resources but to create a comprensive guide that gives an appropriate overview of all the different systems, interactions and processes we have in place and explain how they fit together and use them.

I would like to get feedback on the bare essentials that should be covered. I would like to receive input on this before I commit to a Syllabus. Here is the current Syllabus I had in mind.

Communicating at Mozilla

Discuss how we use e-mail, IRC, bugzilla, blogs and RSS. What medium should be used to discuss what.

Developing at Mozilla

Checking out the source, building, finding a bug in bugzilla ([good first bug] tag maybe?), finding a mentor for your bug, applying & creating patches, running tests, tinderbox, tryserver, getting your patch reviewed and landed. For this one I was considering walking a user through reverting to prevision revision before a small bug, recreating the patch, testing it and showing the steps taken to land the patch.


March 24, 2010 04:55 AM

March 16, 2010

Josh Matthews

I’ve seen the future, brother: it is dynamic additions to the status bar that don’t block the main process.

You’re looking at a mind-bogglingly alpha Jetpack prototype running out of process. Yesterday was a black triangle moment for me, as I finally saw the culmination of 2.5 months of work to make the words “Gmail it” appear in the status bar.

In this implementation, when a Jetpack tries to do something that doesn’t really make sense in its own process (say, adding an element to the status bar), it proxies this operation to the chrome process and continues on its way. Theoretically this allows the main chrome to focus on important things like being responsive or not freezing, so the main work of running Jetpack scripts can be delegated to another process.

There’s lots and lots more work from here (for example, clicking “Gmail it” does nothing for various reasons I need to explore), but this inauspicious screenshot demonstrates that the out of process future is alive and kicking!

March 16, 2010 09:04 PM

March 11, 2010

Adrian Kalla

Browser ballot fail: asks to set IE as the default browser

Wasn't the whole ballot thing about preserving the users choice? Then wtf is this:

ballot fail screenshot

Procedure to reproduce:

  1. choose to install your prefered browser, but not IE (actually, my prefered browser, SeaMonkey, is not in the list, even when it is the 6th most popular desktop browser in Europe... That's a big fail too.)
  2. close the ballot screen by clicking on "Choose later (Später auswählen)", because you couldn't find a "Close" button
  3. install the downloaded browser and set it as default
  4. restart your system
  5. see the ballot screen asking you to set IE as the default browser

Is it just me, or does this look like a violation of what Microsoft has signed in Brussels?

March 11, 2010 07:50 PM

March 09, 2010

Benoit Girard

Optimizing CGContextDrawImage

I wanted to share my finding on optimizing CoreGraphic’ CGContextDrawImage, a performance critical part of my upcoming patch for the Core Animation drawing model.

After implementing the read back from openGL, I was expecting the bottleneck of my code to be the glReadPixels() call since we are copying from VRAM to RAM every frame, however I noticed using Shark profiling tool that I was actually spending more time in CGContextDrawImage.

After investigating further I noticed using Shark that CGContextDrawImage was invoking argb32_sample_RGBA32 where cairo’s calls where not hitting this sampling routine. After a few hours of tweaking I managed to get around the first cause of this sampling by using the monitor’s color profile instead of ‘kCGColorSpaceGenericRGB’.

The second problem less obvious. I had previously looked at the transformation matrix to make sure that no scaling was happening. The transformation matrix was translating by (tx, ty) and was scaling the Y axis by -1. I had incorrectly assumed that scaling Y by -1 would be handled as a special case ‘flip’ case instead of using scaling, however resetting the scaling to 1 resulted in a drastic performance increase. Since my rendering was now reversed I applied the transformation on my OpenGL context where scaling is very efficient.

After the tweaking the bottleneck was now glReadPixels as I had originally hypothesized. I did not grab accurate measurements of the performance difference but I would say the rendering is now at least twice as fast as it was when I was hitting the sampling routine. Once we do away with the glReadPixels step this patch will be even faster!


March 09, 2010 05:49 AM

March 05, 2010

Wei Zhou

It’s really not all about money

When I studied Graphic Design in Yale University, my professor told me a universal truth: “When you choose a career path the primary thing is figure out if you would enjoy the details.” I realized at a young age that I don’t enjoy choosing typefaces among a thousand of options, so I quit graphic design. Among these years, I’ve watched so many types of jobs: I would never be an investment banker because I don’t enjoy correction typos or copying pasting numbers in the pitch book. I would never be an programmer because debugging kills my skin cell. And I would never be a teacher because I don’t enjoy talking to dumb kids. Now I work as a senior consultant in user experience industry, I realize sometimes don’t like using visios to create wireframes or photoshop creating visual design comps. This baffles me for a while: how could I ever fulfill and satisfy myself? I think this article(by josh Kaufman) answers this question well: you need to know yourself well enough.

Here’s a deceptively simple question: why do people work? On the face of it, the answer seems relatively straightforward:

The 3 Core Levels of Material Need

Level 1: Resources
Working for immediate needs like food & shelter; living paycheck to paycheck.

Level 2: Security
Working to ensure safety; saving and investing for future needs.

Level 3: Freedom
Working to ensure self-sufficiency and independent choice of action.

These three levels of work are similar to the first few levels of Maslow’s Hierarchy of Needs or ERG Theory: work is a way we can meet our basic existential needs effectively and reliably.

That’s a perfectly reasonable explanation, but here’s where things get interesting: what happens when people have enough resources to do whatever they want? What does “Level 4” look like?

Level 4: Primary Motivation

Consider individuals like Warren Buffett, Steve Jobs, Dick Cheney, and Angeline Jolie. Each of these individuals has enough money to ensure that they never need to work again – they could quit tomorrow and live off of their savings in perpetuity. For some reason, however, they don’t – they keep working. Why?

After considering this question, I think that people who have reached the “Freedom” stage of work make a choice (either explicitly or implicitly) about what they’re ultimately working for. The choice ultimately revolves around what that person values most: power, status, pleasure, creation, or quality.

#1: The Autocrat

The Autocrat’s primary motivation is power and control. Common behaviors include continually seeking influence or control over the lives and actions of other people. Examples: businesspeople turned politicians like Henry Paulson (US Secretary of the Treasury), Dick Cheney (US Vice-President), and Michael Bloomburg (mayor of New York City).

#2: The Narcissist

The Narcissist’s primary motivation is attention, status, and fame. Common behaviors include continually seeking the attention and esteem of other people, and acting in ways that will ensure they receive more and more attention. Examples: actors / celebrities like Lindsay Lohann, Brittany Spears, and Madonna.

#3: The Hedonist

The Hedonist’s primary motivation is pleasure and enjoyment of material goods. Common behaviors include the continual acquisition of luxurious homes, fine food, and exotic travel. Examples: Larry Elison (CEO of Oracle), Mohammed bin Rashid Al Maktoum (Sheikh of Dubai), and Paul Allen (co-founder of Microsoft).

#4: The Architect

The Architect’s primary motivation is creating something new or reshaping the world. Common behaviors include the establishment of a vision of what the world “should” look like, then continually pursuing projects that they believe will bring the world closer to that ideal. Examples: Steve Jobs (CEO of Apple), Richard Dawkins (biologist and lecturer), Muhammad Yunus (father of micro-lending), and politicians like Ron Paul, Denis Kucinich, and Al Gore.

#5: The Craftsman

The Craftsman’s primary motivation is quality and enjoyment of the work. Common behaviors include the continual exercise and improvement of a set of specific skills or abilities and use of those skills as a means of self-expression. Examples: Warren Buffett (investor and CEO of Berkshire Hathaway), J.K. Rowling (author), and Stephen Spielberg (filmmaker).

Why is Primary Motivation Important?

Here’s my first hypothesis: once you identify your primary motivation, you’ll find it much easier to achieve your goals. These primary motivations appear to be relatively universal, and are based on very deep-seated psychological needs. Tapping into these sources of motivation directly allows people to accomplish their actual objectives more quickly, whatever they might be. Said another way, it’s easier to get what you really want if you identify what you really want.

My second hypothesis is that not all of these primary motivations lead to a lasting sense of personal satisfaction and fulfillment. If you’re an Autocrat, there will always be people you do not control. If you’re a Narcissist, there will always be people who look down on or ignore you. If you’re a Hedonist, the hedonic treadmill ensures that every pleasure eventually fades. If you’re an Architect, the world seems to have a tendency to stubbornly refuse to conform to your ideals.

When I look at the universe of “successful” people in the world, it appears that the Craftsman has the best shot at lasting personal satisfaction and fulfillment. You ultimately can’t control the world or other people, but you can control your dedication to perfecting your craft and expressing yourself through your work.

If we have a choice in determining our primary motivation, it seems that the Craftsman’s ethos has the most to offer: it may eventually lead to power, status, pleasure, and world-changing achievement, but it frees us from the perception that our self-worth depends on any of these things. That’s a remarkable combination.

Thoughts? Leave them in the comments.


March 05, 2010 08:41 PM

March 03, 2010

Margaret Leibovic

Sharing Content on the Web

Since January, I’ve been working as an undergraduate researcher with the Haystack Group in CSAIL. I’ve been working on FeedMe, a plug-in for Google Reader that provides mechanisms to support sharing content with other web users via email. FeedMe facilitates directed sharing by supporting the social processes behind web content sharing. FeedMe uses content previously shared with recipients to determine their preferences, and it uses these preferences to recommend potential recipients for a given feed entry. It also allows users to see how many items have recently been shared with a given recipient, in order to avoid overwhelming individuals with shared content, and it provides a single-click process for recipients to thank sharers, encouraging future shares.

Although the current FeedMe system facilitates sharing within the Google Reader interface, one of its main limitations is that FeedMe recommendations aren’t available outside of this interface. Many information foragers use Google Reader, but most of them also find interesting content from at least one other information aggregator, such as Twitter, Hacker News, or Reddit. Additionally, users sometimes stumble upon novel content outside of any information aggregator, and this is content that their friends are often least likely to see.

To address the main limitation of the current FeedMe system, I’ve been working on designing an interface that will enable FeedMe recommendations for all websites. Designing this interface poses some challenges, especially figuring out a way to make these recommendations noticeable without detracting from the user’s browsing experience. After a series of paper prototypes and mock-ups, I decided to implement an expandable (and hideable) bar along the edge of the user’s browser content. However, I still haven’t decided whether this bar should be at the top or bottom of the content. I’ve included some mock-ups below, and I’m open to feedback.

This week I’m going to begin implementing the basic structure and functionality of this bar using Jetpack, and I’ll try to make updates here whenever I make progress worth sharing!

Top Bar (Collapsed)Top Bar (Expanded)

Top Bar (Collapsed and Expanded Views)

Bottom Bar (Collapsed)Bottom Bar (Expanded)

Bottom Bar (Collapsed and Expanded Views)

March 03, 2010 10:11 PM

March 02, 2010

Josh Matthews

Getting involved with Mozilla

I realize that while I’ve been contributing to Mozilla since last July, I’m still quite new to a lot of the process and knowledge that more experienced developers take for granted. Therefore, I’m going to document the steps I’ve taken to increase my understanding and involvement in hopes that it generates some discussion on the best way to help new people get their bearings.

One of the most inviting aspects of the project right off the bat was that I had a point of contact. Benjamin Smedberg announced in a blog post that the Electrolysis project could always use more help, inviting interested people to get in touch with him. This was an immense help, as he pointed me towards a really good introductory bug that forced me to explore and learn about IPDL, IDL, XPCOM, Javascript, the build system, and more. This was perfect for me; I’m always looking to expand the horizons of what I know, and my work hooking up e10s with the typeaheadfind component allowed me to do just that.

I find that one of the largest hurdles for getting involved in any project for me is lack of knowledge. You’ve got a source checkout, and you’ve got a problem to solve, but no idea where to start. If you’re courageous, you can start dipping into random files and window shopping until you find something that looks promising. However, this approach is inefficient. As I said, I really like to expand the breadth of my understanding as quickly as possible, so here are my patented steps to getting a better handle on the source tree:

  1. Subscribe to an RSS feed of commits
  2. Hang out in IRC channels
  3. Watch interesting Bugzilla users

The trick here is to have lots of information available for consumption, and to sample a wide variety of it. I read commit logs every morning, pick out entries that catch my attention and skim the commit. If I’m still interested, I’ll visit the original bug and read through its history. Through these actions, I am now in possession of:

IRC channels are a great way to act sponge-like. Many diverse conversations on all sorts of interesting code-related topics occur in #developers, while more focused channels like #content and #static allow me to pick up new concepts and insights into the work that I’m currently doing. Furthermore, they’re points of contact for people who are usually happy to help out when I’ve got a question.

Finally, Bugzilla is a goldmine of fascinating activity and information. When I started working on electrolysis, I realized that all of work I was interested in was clusted in the Core:IPC, so I set up an email watch on the QA contact for that component. Eventually, however, I wanted to diversify, so I began to follow specific users. Watching the activity of the polyglots of the project, those who dip in and out of every component is a great way to quickly become exposed to the wealth of work being done. There’s a downside to this: the more users you watch, the more intimidating your bugmail becomes. Today, I ended up receiving 270 emails over the course of one hour because roc decided to unassign himself from a crapload of bugs at the same time as a bunch of dependencies were added to some Jaegermonkey tracking bugs. However, I’ve become adept at quickly deciding whether a conversation thread is interesting to me or not, and these deluges are infrequent.

When it comes to learning about specific pieces of code that confuse me, I have another system. If it’s some fundamental concept that I need to grok (nsCOMPtr, ns*String, etc.), I turn to the faithful Google search: “mozilla X”, X being the unknown item, and 99% of the time the first result will be the relevant MDC page. If I’m more interested in quickly locating pieces of code, I pull out DXR and make use of its wonderful search limiters such as member: or derived:. If what I’m looking for is a piece of C or JS code, or simply isn’t indexed in DXR (m-c only), I haul out mxr and search there. If I do a few searches and can’t find what I’m looking for, it’s usually off to the friendly folk in #developers.

There’s one specific moment I remember from when I was starting out – my very first review. I’d submitted my first attempt at the typeaheadfind work, and to my horror, and email arrived with the subject “review denied.” I felt crushed. Reading through the review, I saw that many good points were made, but it was hard at first to shake the feeling that my code was simply not good enough. I’ve gotten better at accepting review- since then, but I feel that a simple change to the email subject (“review complete“) would go a long way to improving that user experience.

So that’s it, really. Through the application of these methods, I’ve gained enough knowledge to submit a bunch of patches, log some bugs, and start answering other people’s questions. It’s really just been a process of perseverance, asking the right questions, and making use of the correct tools.

Got a story? Please share! I’d love to hear how other people’s experiences differ.

March 02, 2010 10:09 AM

Faster mercurial patch queue merging with emacs

As a follow-up to my previous post about merging mq reject in emacs, I thought I’d share some improvements to the process that I’ve made since then.

(defun switch-hg-reject ()
  (interactive)
  (let ((other-file
     (if (string= (substring (buffer-file-name) -4 nil) ".rej")
         (substring (buffer-file-name) 0 -4)
       (concat (buffer-file-name) ".rej"))))
    (if (file-exists-p other-file)
    (save-selected-window
      (switch-to-buffer-other-window (find-file-noselect other-file)))
      (message "No alternate reject file found"))))

(defun kill-hg-reject ()
  (interactive)
  (let ((reject-file (concat (buffer-file-name) ".rej")))
    (kill-buffer
     (find-buffer-visiting reject-file))))

(global-set-key (kbd "C-c r") ’switch-hg-reject)
(global-set-key (kbd "C-x r") ‘kill-hg-reject)

It turns out that swapping back and forth between the reject and the original in a single window felt was quite inefficient. With these changes, the reject opens up in another window (think emacs terminology here) on C-c r, and I can kill it later with C-x r. This also works better with other modules like uniquify – the code from the previous post would fail when trying to access rejects associated with buffers name “Makefile.in|ipc”. No longer must you suffer the indignity of process! Merging can, and should, be fun! BEHOLD MY WORKS AND DESPAIR.

March 02, 2010 01:41 AM

February 26, 2010

Benoit Girard

Bugzilla Patch Collision

Edit: I was told that a similar feature was already planned for DXR. I think DXR as the potential to be a very good development tool!

I have been discussing this idea a bit over the work week and though I should perhaps get a better opinion. I haven’t worked on very many patches yet so I might be going from a small sample size but it seams like it should be possible to know if anyone is modifying the same code you are. I would be interested to know how common this problem is to everyone else so please let me know!

What I suggest is to have a separate web app from Bugzilla that would keep a copy of all current patches. You could submit your patch to that server and the web app would present you with a report of all patch that touch the same source files and even highlight patches that directly conflict with your patch. A visual diff of all the patches on a given source file would be a great bonus (color coded like EtherPad). It could also show you information about the review state of that patch (if its been super-reviewed and is likely to land soon). An added benefit is you could query the server if an existing Bugzilla patch can no longer be applied on Trunk (bitrot).

I’m curious to know if people that have been using Bugzilla longer think it would actually be worth while to create this tool or if it would just become an annoying optional step when submitting patch?


February 26, 2010 05:10 AM

February 25, 2010

Ehren Metcalfe

Dead code update (and problems finding uninitialized class members)

Well, I’ve fallen way behind with this blog again. Unfortunately, what I’ve done so far hasn’t worked out exactly as expected either. Anyway, here’s an update.

Finding Dead Code
I’ve refined the script I posted previously to take into account the fact that indirect calls to virtual functions register in g++ as calls to the base method (among a few other things). It can be viewed here. Running this new analysis, I’ve learned that finding dead methods is even more difficult than finding dead functions. Why? A tonne of stuff is exported as part of the Mozilla public api. A function or even an entire class may seem dead but it’s likely used via javascript/xpcom inside the mozilla tree (or maybe in an extension).

As far as I know, anything that derives from a class defined in an idl file probably can’t be marked dead and I suspect detecting this case will be most difficult. One thing I could take into account, however, are methods marked as NS_SCRIPTABLE ie __attribute__((user("NS_script"))). It would be easy to add this info to the node table in callgraph. Also, in regard to plain functions, I think it would be prudent to register function local address taking (of functions).

On the bright side I think I’ve found a handful of unused functions (view sample output of the script showing these here). I may be able to gleam more info once I’m able to actually query my paths table though. Unfortunately, the latest incarnation of the script is only about 85% finished:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
28977 ehren     20   0 17804  12m 2132 R 100.1  0.4   2331:07 python

That’s CPU time!

Uninitialized class members
I’ve also put a bit of work into a more immediate analysis. Bug 525063 proposes an error for any class with uninitialized data members. It seemed like an interesting project perhaps as an introduction to ESP analysis (especially since the only state transitions are assignments and passing by reference). In fact, dmandelin’s already done work on an analysis for uninitialized variables in general which I originally attempted to adapt. This was not the easiest task however, although I have just recently learned why I was not successful (I think it relates to a malfunctioning of create_decl_set which I have yet to diagnose).

Giving up on ESP for the moment, I tried my hand doing things the simple way. That is, if there’s any code at all in the constructor that initializes a variable, then I consider that variable initialized.

To accomplish this, I first wrote a rather ugly and unreadable version of the script. I then polished it up a bit. My days of using JS arrays for maps and sets is hopefully over and, in fact, I think I’d be able to take another run at an ESP analysis now. Unfortunately though, running my simple script has uncovered more fundamental problems.

The bug comments mention classes with an overridden operator new (containing a memset(0) to initialize the data members) as one special case but this is nowhere near the largest problem. Consider this mdc page on xpcom:

You can provide an initialization function for your class. This will be called immediately after your class is allocated and the constructor is called. The init function takes 0 arguments, returns an nsresult, and must be public. You can call it anything you like, just reference it from NS_GENERIC_FACTORY_CONSTRUCTOR_INIT (discussed below).

Now we have the situation of variable initialization split across multiple functions. In fact, it’s even more complicated! Here’s an example:

mCSSAware (part of nsHTMLEditor) is one ‘uninitialized’ member turned up by the script. Rather than being directly initialized in Init() (or in the constructor), the initialization takes place in UpdateForFlags which is called from Init() here. Luckily in this case the initializations are all within the same translation unit although I suspect this is not always the case.

So, what would be the solution? If it’s worth doing, some kind of interprocedural analysis will have to be performed. I was thinking of collecting all the ‘uninitialized’ fields during compilation of both the constructor and any other functions identified as an inititializer. Initializers must include any member function called by an initializer (note that pass by reference is just simple initialization). If the set of uninitialized fields in a particular constructor intersected with the sets of fields from the other initializers is non-empty, you’ve found a genuine uninitialized field.

I was thinking that if every initialization takes place in the same translation unit it might be possible to do this within the current static-checking framework ie by compiling only once. I’d basically just have to identify the set of data members not initialized for every member function while building a mini call graph to eventually determine which of those member functions is really an initializer. It would then be a simple matter to take the intersection of the relevant sets of uninitialized fields.

However, I suspect there’s probably more than a few cases where member function definitions are spread across translation units (Actually that might be a neat dehydra analysis if this behaviour’s unwanted). To deal with this case I’d have to store the sets of ‘uninitialized’ data members until the entire build is complete while also determining the set of initializing functions. I’d then have to determine which data members are really initialized during a post-compilation analysis.

It might also be possible to produce the errors while the build process is still under way if I was able to query an sqlite database from within a treehydra script. I’m under the impression that the only way to use sqlite from js is by using xpcshell though so I don’t know if this suggestion would work. You’d still have to run a callgraph build prior to compilation anyway which takes quite some time.

There’s also the issue of the accuracy of any analysis when the call graph will likely have to be pretty dumb ie unfeasible code in a particular function that contains a call will end up registering as an edge. I suppose it would also be necessary to relate a functions parameter’s (and any global data) to whether or not a particular call within a function is feasible or not (and so on). The ESP paper does discuss a framework for interprocedural analysis but that’s way out of my scope. It would probably still be a worthwhile analysis if this kind of stuff is not taken into account, however it kind of defeats the purpose of performing an ESP analysis to find which members are uninitialized.

Anyway, I’ll report back (hopefully without such a long delay) when I’ve determined the next course of action.


February 25, 2010 02:16 PM

February 23, 2010

Benoit Girard

Improving Incremental Builds Using ObjDir Method

One annoyance I’ve ran into while working with incremental builds is that the Makefile are generated in the obj-dir. Rebuilding requires you to go from your source directory to your corresponding obj-dir and invoking ‘make’.

Just place the following command in a script in your path:

cd $(pwd | sed 's/mozilla-central/mozilla-central\/obj-ff-dbg/g') && make; cd -

make -C $(pwd | sed 's/mozilla-central/mozilla-central\/obj-ff-dbg/g')

This script will call the corresponding obj-dir Makefile from the source folder. As readers mentioned the second version removes the ‘cd’ nastiness, thanks!

This is great if your working with both 32 and 64-bits obj-dirs since you can create a make32.sh and make64.sh script to trigger the corresponding incremental build from the same source folder and manage two builds!


February 23, 2010 01:03 AM

February 18, 2010

Benoit Girard

Sharing Your Session

Motivation

I’ve been working a lot with remote people over IRC here at Mozilla. Pastebin can be your friend to share stackdumps but sometimes you need to show an interactive session. This is great if you want someone more experience to help you debug the problem in GDB for example. GNU Screen is a great terminal multiplexer but the drawback is that it requires some configuration.

How to:

Here is a simpler way to quickly share your session over a chat session. You can redirect ‘script’ to a listening port using the following command:

touch transcript; tail -f transcript & script -q -t 0 | tee transcript | nc -l 5678; rm transcript;

That’s a long and complicated command but that is the best way I have found to redirect script to both the screen and ‘nc’. Let me know if you know a better way!
To have someone watch your interactive session ask them to execute the following commands:

nc <HOSTNAME/IP> 5678

Extensions

If this is useful others I could extend this to allow the person watching to interact with the session as well, however for now I can just claim that it’s a security issue!

I’d also like to extend this to work with NATs by deploying an online web app where you can request that you would like to share a session with someone and it will give you addresses to connect to and act as a connector so that two users located in different intranets can use this as well.


February 18, 2010 08:39 PM

Interning At Mozilla

I’ve been at Mozilla for nearly two months now. In this blog I plan to share about the projects I worked on, the problems and the solutions I found along the way and other tips that may be useful.


February 18, 2010 06:57 PM

February 17, 2010

Josh Matthews

Applied knowledge

I think I’m starting to feel more at home in the Mozilla codebase. It’s an exciting feeling when you can actually start answering other people’s questions instead of always being on the asking end.

February 17, 2010 01:41 PM

February 12, 2010

Wilson Lee

JavaScript Quiz and Explanations of its Answers

Update: Comments are now enabled.

In the field of linguistics, rules can be either descriptive or prescriptive. Simply put, descriptive rules tell you what can be done and prescriptive rules tell you what you shouldn't do. Many articles about JavaScript give you prescriptions: they tell you what you shouldn't do in JavaScript because it's bad practice. After learning to stay away from certain styles and patterns, though, sometimes a simple typo or brain fart can avalanche into a disaster in your code and still leave you puzzled even after attempting, descriptively, to explain what exactly happened.

kangax's JavaScript quiz, geared towards web developers, helps exactly that: finding descriptions that clarify perplexing situations. It does not test your knowledge of any DOM behavior and is focused on the ECMAScript language itself. Since this quiz targets web developers, SpiderMonkey gurus can likely even point to where a given quirk (the term is being used very loosely here) is manifested in the implementation. As always, please point out any possible error in the answer explanations about to follow. Those who are interested but still haven't taken it: halt! Go and take it. I'll wait. After that, read on.

read more

February 12, 2010 03:27 PM

February 08, 2010

Ehren Metcalfe

A static analysis for fallthrough switch cases in C++

For my 0.5 release in DPS911 I’d like to discuss some work on a Treehydra script for detecting fallthrough cases in a switch statement. I’ve actually been working on this off and on for some time, but it’s only been within the last few hours that I’ve arrived at something airtight.

Actually, I began work on such a script quite a while ago, after completing similar work on finding unreachable blocks in the control flow graph. Most of the serious bugs turned up by this analysis were all caused by forgetting the break statement (see bug 536438 and bug 536646) so a warning/error for this seemed natural. Also, I assumed this would be easy: just find all the basic blocks corresponding to the case labels of the switch and, if the successor of a block corresponds to the next case, you’ve got a fallthrough.

To make this more clear, here’s a simple switch statement that falls through:

int foo(int x) {
  switch(x) {
    case 0:
      x++;
    case 1:
      x--;
  }
}

And here’s a -fdump-tree-all printing of the cfg:

;; Function int foo(int) (_Z3fooi)

int foo(int) (x)
{
  # BLOCK 2
  # PRED: ENTRY (fallthru)
  switch (x)
    {
      case 0: goto <L0>;
      case 1: goto <L1>;
      default : goto <L2>;
    }
  # SUCC: 3 4 5

  # BLOCK 3
  # PRED: 2
<L0>:;
  x = x + 1;
  # SUCC: 4 (fallthru)

  # BLOCK 4
  # PRED: 2 3 (fallthru)
<L1>:;
  x = x + -1;
  # SUCC: 5 (fallthru)

  # BLOCK 5
  # PRED: 2 4 (fallthru)
<L2>:;
  return;
  # SUCC: EXIT
}

Notice something funny? There’s now a default case label! GCC will always insert this dummy default by the time you’ve reached the cfg and, even worse, there’s no way to distinguish a switch statement with a real default from one without, once you’ve reached this level. Unfortunately, I spent a great deal of time trying to do just that, at various times thinking I finally had the solution only to discover a new test case that would totally blow apart the analysis. I think I’ve tried maybe a dozen different approaches only to give up in disgust at various points. See here for one totally invalid early attempt.

So what’s the solution? I needed information from two separate passes of the compiler: The cfg, but also the initial c++ ast representation to find out if the default was really a default. To this end, I knew walk_tree would be needed. I was even able to find a bug in Treehydra during some initial experiments. However, as before, once I thought I had the solution, a more complex test case would ruin everything.

Anyway, here’s the finalish script which also employs a fallthrough() function/annotation to suppress the warnings. Once I’ve had a bit of time to sleep on it, I’m going to refactor a bit and then post to the bug. I also need to consider how to integrate this into a –with-static-checking build. There are a number of issues I had to take into account that I haven’t mentioned, as well, such as when the order of the cases is mixed up (eg case 1 before case 0) and also when labels and gotos come into the mix. (Properly dealing with switches embedded within switches … was the last hurdle.)

For a demonstration, here’s a nasty bit of code together with a sample run of the script.

So, for my 0.6 release, I’ll have to get back to dead code, hopefully being able to exploit callgraph to the fullest. Perhaps I can find another analysis to start work on as well.


February 08, 2010 07:15 AM

February 07, 2010

Brian Krausz

Building a C++ XPCOM Component in Windows

I’ve been teaching myself to write Firefox extensions for the last few weeks, and became interested in XPCOM components. Unfortunately, I couldn’t find a good (and recent) summary of them, and had to spend 3 or 4 days cobbling together various tutorials, so I figured it’s time to write one.

What is XPCOM?

XPCOM is a language-agnostic communication platform used in Mozilla products (and some other random pieces of software) to allow code (specifically extensions) to be written in a wide variety of languages.

Why would I want to use XPCOM?

There are two ways to “use” XPCOM. First, you can call functions through XPCOM. For example, the Firefox bookmarks service uses an XPCOM interface. So in order to interact with this service from Javascript you would do something like:

var bmarks = Components.classes["@mozilla.org/browser/bookmarks-service;1"].getService();
bmarks.QueryInterface(Components.interfaces.nsIBookmarksService);
bmarks.addBookmarkImmediately("http://www.mozilla.org","Mozilla",0,null);

There are plenty of tutorials on doing this as it is the more common use for XPCOM, so I won’t go into any detail on it here.

The second way is to write an XPCOM service. That is what this tutorial covers. Sometimes you need extra functionality, speed, or just want to tie into some library that requires a different language. Most commonly this is C++, but there is also JavaXPCOM and PyXPCOM (and probably a few others). I’ll be talking about C++, since it’s what I needed for my project.

Warnings

  1. Before you trudge through this: you most likely are in the wrong place. Firefox extensions are usually all Javascript. If you can use JS to do what you want, stop now. There is no need to go through the complexity of an XPCOM component when you can just use JS. Go read a tutorial about writing extensions and get to work.
  2. There is something called ctypes coming to FF 3.7 that may make doing this a lot easier. I haven’t touched this at all, but it may be worth considering if you can wait for the functionality and only need to tie into a particular DLL for some functionality. Long story short, XPCOM may become the more difficult way to call C++ functions from FF extensions.

My Setup

Sample Code

If you don’t want to go through the tutorial and just want everything to work, then download this sample code. Just follow step #1 of the tutorial, then make sure your Gecko SDK directory is set right in the build step, and you can breeze on by most of this article.

The Tutorial

This is mostly paraphrased from Alex Sirota’s great tutorial, but it hasn’t been updated since 2005 and is a bit outdated. This new one should work out of the box for FF 3.6.

This tutorial will create a component called MyComponent with one function: Add, which will take 2 numbers and, surprisingly, return the sum.

  1. Download the Gecko SDK for your version of Firefox. I used 1.9.2 for FF 3.6.
  2. Create an idl file – IMyComponent.idl, with the following (replacing ***IUID*** with your interface UUID):
    #include "nsISupports.idl"
    
    [scriptable, uuid(***IUID***)]
    interface IMyComponent : nsISupports
    {
      long Add(in long a, in long b);
    };
    

    This file is a language-agnostic interface definition which you can read more about here.

  3. Generate the interface header and typelib files out of the interface definition file. Assuming you extracted the Gecko SDK to C:\xulrunner-sdk\, run the following commands (from the directory you saved IMyComponent.idl to):
    C:\xulrunner-sdk\sdk\bin\xpidl.exe -m header -I C:\xulrunner-sdk\idl .\IMyComponent.idl
    C:\xulrunner-sdk\sdk\bin\xpidl.exe -m typelib -I C:\xulrunner-sdk\idl .\IMyComponent.idl
    

    These will create IMyComponent.h and IMyComponent.xpt, respectively.

  4. IMyComponent.h has two snippits of code that you can use for the next two files. Everything between /* Header file */ and /* Implementation file */ can be used for MyComponent.h:
    1. Start by inserting double inclusion protection code and the right include:
      #ifndef _MY_COMPONENT_H_
      #define _MY_COMPONENT_H_
      
      #include "IMyComponent.h"
    2. Add the following lines, which define your component name, contract ID, and CUID (where ***CUID*** is the C++-style component UUID, of the form { 0×12345678, 0×9abc, 0xdef0, { 0×12, 0×34, 0×56, 0×78, 0×9a, 0xbc, 0xde, 0xf0 } }):
      #define MY_COMPONENT_CONTRACTID "@example.com/XPCOMSample/MyComponent;1"
      #define MY_COMPONENT_CLASSNAME "A Simple XPCOM Sample"
      #define MY_COMPONENT_CID ***CUID***
    3. Copy in the snippet from IMyComponent.h, replacing all the instances of _MYCLASS_ with the name of your component (MyComponent).
    4. Finish off the double inclusion protection code with #endif //_MY_COMPONENT_H_
  5. Everything between /* Implementation file */ and /* End of implementation class template. */ can be used for MyComponent.cpp:
    1. Start by inserting the right include:
      #include "MyComponent.h"
    2. Copy in the snippet from IMyComponent.h, replacing all the instances of _MYCLASS_ with the name of your component (MyComponent).
    3. Add some implementation to the Add method. I replaced return NS_ERROR_NOT_IMPLEMENTED; with
      	*_retval = a + b;
      return NS_OK;
  6. Create your module definitions files:
    #include "nsIGenericFactory.h"
    #include "MyComponent.h"
    
    NS_GENERIC_FACTORY_CONSTRUCTOR(MyComponent)
    
    static nsModuleComponentInfo components[] =
    {
        {
           MY_COMPONENT_CLASSNAME,
           MY_COMPONENT_CID,
           MY_COMPONENT_CONTRACTID,
           MyComponentConstructor,
        }
    };
    
    NS_IMPL_NSGETMODULE("MyComponentsModule", components) 

You now have all of the files needed to build an XPCOM component:

IMyComponent.h
IMyComponent.idl
IMyComponent.xpt
MyComponent.cpp
MyComponent.h
MyComponentModule.cpp

Now comes the hard part: getting the damn thing to build.

Building the code

Ok, it’s actually not hard since I’ve done most of the legwork for you. Assuming you’re using Visual C++ 2008 here are the settings you need (again assuming C:\xulrunner-sdk is where your Gecko SDK is). In Project->Properties:

Configuration Properties
  General
    Configuration Type: .dll
  C/C++
    General
      Additional Include Directories: C:\xulrunner-sdk\include
    Preprocessor
      Preprocessor Definitions: XP_WIN;XP_WIN32;XPCOM_GLUE_USE_NSPR
  Linker
    General
      Additional Library Directories: C:\xulrunner-sdk\lib
    Input
      Additional Dependencies: nspr4.lib xpcom.lib xpcomglue_s.lib

If you put the idl file into your project, be sure to mark it “Excluded from Build” in its properties…we don’t want VS touching it.

Cross your fingers, pray to whatever deity you believe in, and hit the build button. If it didn’t work let me know why in the comments and I’ll try to build a troubleshooting section.

Installing/Testing the Code

  1. Copy two files to C:\Program Files\Mozilla Firefox\components:
    • The DLL the build generated
    • IMyComponent.xpt
  2. Normally, if this was installed as part of an extension, it would automatically search this directory and find these files. But now we have to force a refresh. Delete xpti.dat. and compreg.dat from your profile directory (FF will regenerate them on next restart)
  3. Close Firefox and open it with this test file (MyComponentTest.html in the sample code):
    <html>
    <script type="text/javascript">
    function MyComponentTestGo() {
    	try {
    		// normally Firefox extensions implicitly have XPCOM privileges, but since this is a file we have to request it.
    		netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    		const cid = "@example.com/XPCOMSample/MyComponent;1";
    		obj = Components.classes[cid].createInstance();
    		// bind the instance we just created to our interface
    		obj = obj.QueryInterface(Components.interfaces.IMyComponent);
    	} catch (err) {
    		alert(err);
    		return;
    	}
    	var res = obj.Add(3, 4);
    	alert('Performing 3+4. Returned ' + res + '.');
    }
    </script>
    <body>
    <button onclick="MyComponentTestGo();">Go</button>
    </body>
    </html>
  4. One last time: cross your fingers, pray to whatever deity you believe in, and hit the Go button. If it didn’t work let me know why in the comments and I’ll try to build a troubleshooting section.

Hopefully this clears up what looked like a lot of confusion to me. I will keep this updated to the best of my abilities and hopefully it will continue to be useful for a long time.

February 07, 2010 08:47 PM

February 04, 2010

Ehren Metcalfe

Computing connected components with SQLite (and other attempts finding dead code)

In the last couple of weeks I’ve put a bit of effort into identifying unused functions in mozilla-central. Unfortunately, I have not been keeping up with this blog, which is a major requirement in DPS911.

As I previously reported, I’ve been using a Treehydra generated call graph (callgraph) which records caller-callee relationships in a giant sqlite3 database. As mentioned, my first attempt was to ignore the directedness of each edge in this graph, and then compute the connected components. I believe this is equivalent to computing the weakly connected components in a directed graph.

I have based my code almost entirely off work done David MacIver who has an interesting post here where you can read more about his algorithm. It works by initially placing each verticex into its own component and then iteratively merging distinct components where there is an edge between two vertices in the respective components. Unfortunately, his Ruby written for Mysql is not directly usable for my purposes since SQLite, which I’m working with, does not support the update join syntax. Here’s a bit of MacIver’s code for example:

    update items
    join (
      select component1 source, min(component2) target
      from components_to_merge
      group by source
    ) new_components
    on new_components.source = component_id
    set items.component_id = least(items.component_id, target)

To create the equivalent code, I used a temporary table and a bit of kludge:

    INSERT INTO components_to_merge
    SELECT component2, component1 FROM components_to_merge;

    DROP TABLE IF EXISTS new_components;
    CREATE TABLE new_components
    AS
    SELECT component1 source, min(component2) target
    FROM components_to_merge
    GROUP BY source;

    UPDATE node
    SET componentID = min((SELECT min(componentID, target)
                           FROM new_components
                           WHERE source = componentID),
                          componentID)
    WHERE componentID in
        (SELECT source FROM new_components);

That update statement is horribly inefficient but ultimately the job gets done. All told, it takes about an hour on one of the CDOT’s development machines. As MacIver noted in his original blog post, you’re basically done once the first merge has completed. The complete script, written in python, can be viewed here.

Note that a few domain specific refinements had to take place here. For example, any indirect calls to virtual functions will be registered as a call to the function in the base class. Callgraph already deals with this using an implementors table but I had to add an extra column for the return type of the function in order to accurately construct the name of both member functions. I then merge their components:

# set interface component to implementor component
cursor.execute('SELECT implementor, interface, method, type \
                FROM implementors')
list = cursor.fetchall()
for row in list:
    # format: type interface::method
    basename = "%s %s::%s" %(row[3], row[1], row[2])
    # format: type implementor::method
    derivedname = "%s %s::%s" %(row[3], row[0], row[2])
    cursor.execute("UPDATE node \
                    SET componentID = (SELECT componentID \
                                       FROM node \
                                       WHERE name = '%s') \
                    WHERE name = '%s'" %(basename, derivedname))

Also, whenever a function is called outside of the compilation unit in which it’s defined, the call will point to the location of the forward declaration of the function (eg the .h file). To get around this, I simply merge all components that contain nodes with the same name:

SELECT n.name, min(nn.componentID)
FROM node n, node nn
WHERE n.name = nn.name AND
n.componentID != nn.componentID
GROUP by n.componentID

Of course, some nuance is required to interpret the data produced by this script. As I mentioned previously, the analysis is complicated by the fact that many functions “never called” are in fact called indirectly via a function pointer. This means that most connected components of size one aren’t particularly interesting. In fact, since I’m merging declarations and forward declarations, most components of size two also aren’t particularly interesting (at least those with elements containing the same name). This script takes the above into account and can be used to produce these results:

A list of connected components (that aren’t the largest component) with size greater than 3
and
A list of components of size 2 (that aren’t the largest component) that have members with distinct names.

The vast majority of these are false positives mostly for the reasons mentioned above, but In the last week I finally bit the bullet and filed a bug, along with a patch, to remove a bit of the dead code identified. Unfortunately, these functions are all in the cairo library, which means that applying such a patch would make tracking upstream changes unnecessarily difficult.

A number of issues have been identified here though. Previously, in connection with an analysis to find non-static functions called only within a particular compilation unit, Taras filed this bug to add -fdata-sections
-ffunction-sections -Wl,-gc-sections
to the build config in order to strip out dead symbols. Interestingly enough, running a few of my own tests with this configuration, I was not able to strip out all of these dead cairo functions. Even more bizarrely, the symbols of a number of dead static (!) functions seemed to work themselves into libxul?!

As an aside, the nm utilty would have been quite useful when working on the alwayszero project. (To get similar results I was previously running debug builds and then grepping the output of objdump).

A path based algorithm
There are issues with the above analysis though. For example, a function could be unused yet call functions that are used. This script begins at a particular node and iterates backwards, transitively adding all callers. If the callers to be added are exhausted within a reasonable number of iterations, we’ve found a dead path. Note that to narrow down this analysis, I’ve disregarded everything already identified by the component based analysis ie I do not start with any node not in the largest connected component.

One thing I should note is that this script requires explicit transaction management to run (using cursor.execute("BEGIN TRANSACTION") and connection.commit()). For anyone faced with mysterious insert/update anomalies in sqlite, this may be the answer.

Anyway, getting useful data out of this is a little bit more complicated. For example, to see info about every function in all paths that contain only functions, the following query can be used:

SELECT * FROM node n
JOIN path p ON (n.id = p.id)
WHERE pathID NOT IN
(SELECT pathID FROM node n
 JOIN path p ON (p.id = n.id)
 WHERE isMethod = 0)
ORDER BY pathID;

Has this analysis yielded any more candidates for removal though? Unfortunately, I have not taken indirect calls to overridden member functions into account eg Base* b = new Derived(); b->foo();, so an analysis for dead methods is currently out. There is an easy fix, however, it will require another 18 hr run of the script (building a path backward from a start set of 100000+ nodes = a boatload of time). Analyzing just functions though, ie using the query above, I have found some interesting possibilities. For example, there’s quite a bit of dead stuff in nameprep.c, but I suspect this is an even bigger nightmare to patch than cairo.

I will report back soon, however, when I have more concrete results.


February 04, 2010 05:39 AM

January 28, 2010

Aaron Train

Dabbling in Cocoa/iPhone SDK

As I gear towards graduation at Seneca College, I am actively engaged in an a professional Apple Development course. Why am I enrolled? Merely an interest for learning different languages; discovering their quirks, oddities and normalities. As well, I am using this astute scenario to experience the procedures and protocol in developing software on a mobile device. Nonetheless, the course should be fun and a unique learning opportunity.

As part of my first lab, we were to get a feel for the different interface builder UI objects within a single view in order to create a manipulating student profile. See below.

January 28, 2010 01:17 AM

Josh Matthews

Dealing with mercurial patch queue rejects in emacs

Since Mozilla has embraced mercurial, and especially patch queues, with open arms, I get to deal with rebasing patches frequently. There are two ways this can happen – either you set up an external merge tool like meld to handle each conflict, or the rejected changes are dumped in a filename.ext.rej in the same directory as the file being patched. Since I do all of my work in emacs, I’ve finally got around to writing an elisp function to allow me to switch to a reject file from the original quickly and painlessly:

(defun switch-hg-reject ()
  (interactive)
  (let ((other-file
     (if (string= (substring (buffer-file-name) -4 nil) ".rej")
         (substring (buffer-file-name) 0 -4)
       (concat (buffer-file-name) ".rej"))))    
    (if (file-exists-p other-file)
      (switch-to-buffer (find-file-noselect other-file))
      (message (format "No alternate reject file found" other-file)))))

(global-set-key (kbd "C-c r") ’switch-hg-reject)

A simple C-c r is all it takes to switch from nsFrameLoader.cpp to nsFrameLoader.cpp.rej in the current buffer, and another C-c r will take me back to the original. Now that’s convenience!

January 28, 2010 12:13 AM

January 27, 2010

Josh Matthews

Make ye a hydra

I’m interested in playing around with Dehydra to see whether I can create a pre-review checker, hopefully to lessen the amount of nits that inevitably crop up in any patch submitted on Bugzilla. However, as always, the immediate hurdle is acquiring and building the software involved. Making dehydra from scratch involves building gcc 4.3.x, SpiderMonkey 1.7+, and dehydra itself. The instructions in the dehydra README gave me good, error-less instructions for gcc, and installing SpiderMonkey was nothing more than ./configure ; make ; sudo make install. Building dehydra was a bit hairier; here’s my final sequence of steps:

export CXX=/home/t_mattjo/src/gcc-dehydra/installed/bin/g++
./configure --js-libs=/usr/local/lib --js-name=js_static --js-headers=/usr/local/include/js/
make

Of course, I also had to go into the Makefile and add -lstdc++ because I kept receiving this error while trying to use the generated gcc_dehydra.so (thanks bradh!): /home/t_mattjo/src/gcc-dehydra/installed/bin/../libexec/gcc/i686-pc-linux-gnu/4.3.4/cc1plus:
symbol lookup error: ./gcc_dehydra.so: undefined symbol: _Znwj

So after all that, make check almost passes everything. I’m running into the same six errors that Roger Dicke got a few days ago, so I might try digging into that. However! I can hopefully start playing with static analysis soon, and that’s a very exciting prospect.

Update: the treehydra problem is a known regression in Spidermonkey trunk.

January 27, 2010 10:32 AM