Thursday, December 4, 2014

The Grand* Finale

Pull Requests Associated with this Milestone:

Filer Issue #303 PR
Appmaker Issue #2338 PR

With the hope of not sounding overly dramatic, past week and a half has been quite overwhelming in just about every direction in my life. Pertaining to my plan for the 0.4 milestone though, my original plan for fully realizing a live iframe instance of the remixed app template was deemed both too onerous and unnecessary for its function due to factors such as the ever-changing Webmaker tools pages and assets that would make for a very volatile environment to try and parse or retrieve data objects reliably for a long period of time. My 0.3 implementation is apparently more than sufficient in its current state, and all that was requested of me (as briefly described in my earlier post) was to fix up the URL reference to an HTTP route that they will add functionality to in the near future, and merge my solution shortly thereafter.

This turn of events has left me scrambling for a suitable alternative in a very constrained and stressful period of time. I quickly perused through a handful of Mozilla project code bases I'm familiar with for anything of remote reasonableness to my sought after goals for this semester's end. I quickly recalled leaving behind a very small Appmaker bug I was assigned a month or so ago by Scott Downe involving a couple value setting additions in JSON objects in lieu of my 0.3 milestone. Most of the effort for implementing this involved asking Scott where the JSON blobs were located in the codebase so that I can simply inject the properties and call it a day. This was a start, but something more sizable and challenging needed to complement it for a respectable release.

It was at this point that I turned to an early project I contributed a little code to at the start of my work with CDOT this past summer - Filer. An issue Mozillian coding tour-de-force @Modeswitch put up dealing with rebuffing an old performance test of his for this module in order to be run both in node and in the browser, as well as cater to a provider-agnostic configuration seemed to fit the bill. This required a complete reintroduction into my knowledge of Browserify, as well as a bit of a refresher crash course into some filer methods and invocations. I needed help with this one, and thankfully, I managed to get some time and guidance from former CDOT team members Gideon Thomas and Kieran Sedgwick on my options and concerns of how to get started and solve this bug. As per the link on the top of this blog post, a pull request is already up, and I'm still not 100% sure of my solution, but after requesting review from all the major Filer contributors, so far the only corrections I've had to make were minor. I am waiting for good news either way - be it more input on how to complete this if anything was left out, or an "r+" and a merge into the master branch.

I wish I could have done something even more substantial to conclude my time in this course. It's been inspiring, and it's also been a wonderful opportunity for me to keep my open-source skills sharp from my summer position. The open source philosophy and its realization has now left me spoiled; I often seem to feel that the work I do has genuine impact, and as a person who's no stranger to needing assistance to overcome logical hurdles in the realm of programming principles, it is available and many times happy to try and turn my shortcomings into strengths. I will inevitably get back to this type of work in one of its many shapes. I'm hoping to acquire a post-graduate position at CDOT to further enrich my experience with this work, and my upcoming group implementation project is heavily influenced by open source workflows and intends on emulating those in order to achieve greater and more efficient productivity in its development lifecycle.

It has been nothing short of a pleasure to be a part of David Humphrey's world, whether as a student or a research assistant. I owe this man much gratitude for extending and bequeathing his passion unto me. I do not take that lightly. I very much hope to still remain a part of it for years to come.

Monday, November 24, 2014

Appmaker Template Picker Progress Update

The second last week of this semester has already begun, and between 20 other errands to accomplish in this always merry and relaxed time frame, I have managed to get a hold of Pomax and discuss with him clarifications on how to go about moving forward and accomplishing my iterative solution for Appmaker Issue #2348. His only qualm with my initial pull request was that the current URL for arriving at the custom Appmaker template gallery list page looks very unreadable and hash-like in its address. What we have agreed to in the meantime was that Pomax will initiate a separate Webmaker issue in the meantime to accommodate this request by creating functionality for the URL address "" and that will be the de-facto address that I will use when creating my next pull request. Since the expert on implementing these sort of HTTP Option handlers and custom route logic is away, I will obviously still be using the presently functional old URL to test my logic up until the final commit.

If all of the stars will align, and my google-fu research will prove immediately effective in helping me accomplish my initial task for this last milestone of getting an iframe preview to fetch the resource on a user's mouseclick event, I might even able to hop on this newly created issue and contribute to its completion.

In all likelihood, my last update for this semester will be the pull request announcement. Stay tuned, as the cliffhanger is quickly nearing its conclusion.

Friday, November 14, 2014

0.3 Milestone Completed for the Price of Potentially Digging My Own Grave

Link to the PR:

As stated earlier, landing on this issue was a bit of a fluke. Well, since most of the bugs are kind of flukey in nature, this might more of a fluke of a fluke. As mentioned previously, Mozillian Scott Downe was away this week to assist me in a bug of his that I initially wanted to work on, so within my time constraints I needed to quickly switch over to something reasonable, which ended up being this issue.

If you take a peek at the conversation about this, this is a realization of my iterative approach to providing this problem an elegant solution. Currently, I added a menu item to the top right initialization context bar that opens a new window to the user that directs them to the app template gallery to remix an app, on a click event.

Implementing logic for this was fairly simple and streamlined, since I had the original 'New App' menu item logic to follow and parrot the data flow to a great extent. The Appmaker convention herein seems to prescribe to an approach that involves an event listener attached to a JQuery connected ID field in the html, whose logic is embedded in the same file. The parent init function exposes the scope of an object in a file both called 'application', that exports a whole bunch of functionality - most importantly of which was the functionality of the menu item that I was trying to emulate:

// application.js, line 36:
    newApp: function(){
      var app = document.querySelector("ceci-app");
      var parent = app.parentNode;
      // TODO
      // we have to decouple appidChanged and initFirebase
      app.setAttribute("appid", "ceci-app-"+uuid());
      history.pushState({}, "", location.origin);

I didn't need all this fancy functionality yet either; so far, the intent was just to give the user a link to the template gallery. So a simple on an href should (and did) do the trick:

  templateApp: function(){
    // Open the link in a new tab so as to not interrupt the current instance's workflow

The module.export already takes this entire function list wholesale as part of the application scope, so simply adding this function to the list was enough to be able to invoke it on my event listener back in the html file.

The first and last part was essentially to just add the element to the dom, which for the most part was just duplicating the code used for the initial menu item. Funny enough though, the most convoluted part of this was adding the text label to my new menu item. Appmaker uses what I believe to be some sort of angular.js localization directive - l10n - which I didn't know worked in a key-value pair fashion. This is where parroting code unfortunately stopped being helpful ;)

The directive is appended to your element like so: {{'your label here' | l10}}

If your 'label' pair isn't listed in the msg.json file in the language locale directory, it doesn't simply slap the string onto the element, it actually doesn't do anything with it, and therefore your label doesn't show up at all. Documentation and examples on the web were hard to come by for me, so some last minute pointing in the right direction from David Humphrey (current professor, former project lead) cleared this issue up in a hurry.

The title for this post alludes to the hope that I don't bury myself under the weight of my own ambition for this bugfix for the final course's milestone. The stage is officially set for my last hurrah and the opportunity to call it my Appmaker's "Magnum Opus" addition.

Monday, November 10, 2014

Unintentional, yet Necessary Bug-Hopping Ensues

Shortly after FSOSS and the end of reading week, I initially requested to work on an Appmaker issue created by senior Mozillian Scott Downe, AKA 'TheCount' (Link to #2338). My mistake from the get-go was not to immediately use the comment thread to clarify my lack of context for how to find the code necessary to fix the bug, instead leaving it for a while as life happened for both parties involved with the intent of asking Sir Downe at a more convenient time for me later on down the road. As fortune often shines it everloving light on me, the gentleman is now off on some sort of vacation/time away from his work for a week as my deadline for this milestone looms and is at the end of this week. Instinct dictated me to immediately find a suitable alternative, and I believe that I have found a manageable little number that might even serve as an incremental growth to a rather impressive final 0.4 effort (no promises yet, though) - Issue #2348

As usual, updates to soon follow after the initial PR at the end of this week.

Friday, October 24, 2014



Comparing and analyzing two symposium talks from industry leaders of open source technology in the world of IT.

“How Companies Use NoSQL Open-Source Technologies like Couchbase” – Don Pinto, Product Marketing Manager (Couchbase)

Don Pinto (M.Sc., Computer Science – University of Toronto) has previously worked as the director of product management at GridCentric Inc. (now owned by Google), with additional experience as a SQL Server/Azure program manager at Microsoft.

The Problem – “There is lots and lots of data. More users than ever before and the interactive complexity of apps.”

“Consumers & Employees Demand Highly Responsive Apps.”

Old relational stores had a lack of flexibility/rigid and an inability to scale out data easily. Those 2 factors along with performance costs comprised of some of the most popular client complaints when using such tools.

This calls for a new backend technology – NoSQL.
So what could be a candidate to be the right tool?

·        The JSON Data Model Fits today’s developer needs better
o   Aggregates & denormalizes data into single document (Document data model).
o   Handles structured & unstructured data equally well (Docs are distributed evenly across servers)
o   Inferred schema requires no migration
o   JSON rapidly being adopted
o   Access both JSON and binary data as key-value pairs

·        RDBMS needs a bigger, more expensive server to scale up architecture.
·        Auto-sharding vs. Manual sharding (data partitioning).
·        Open-source obviously implies lower costs for maintenance, and usage.

·        Availability – Relational systems use clustering as an afterthought.
o   RDBMS must take database down for “maintenance windows”
o   They struggle to support XDCR (Cross data center replication) across many DCs (data centers).

·        Couchbase offers a full range of Data Management solutions
o   High Availability Cache (Zero downtime administration and upgrades)
§  Always-on functionality for a potentially global user base
§  Couchbase Lite – Mobile application that includes a sync gateway for mobile work to update server.
o   Consistet High Performance
§  Built-in object level cache
§  Fine grained locking
§  Hash partitioning to uniformly distribute data across the cluster
o   Elastic Scalability –
§  Shared-nothing architecture with a single node type
§  True XDCR
§  Push button scale-out

Some use cases for NoSQL:
·        Heavily accessed web landing pages
·        Application objects
·        Popular search query results
·        Session values or cookies (key-value pair store), eg. Shopping carts, flights selected, etc.
·        User profile with a unique ID, user settings/preferences, user application state
·        Content metadata stores (articles, text)

Some known users of Couchbase:
·        Orbitz – 11 clusters with a total of 100 nodes
o   3 TB of data with over 430 million objects
·        McGaw-Hill Education Labs – Content and metadata stores
o   “Building a self-adapting, interactive learning portal”
o   Scale to millions of learners
o   Self-adapt via usage data
·        AOL – Ad-targeting using a Couchbase server
o   40 milliseconds to respond with the decision.
o   User profiles, real time campaign stats
o   Affiliate, event, profile, and campaign data

Mike Hoye, Engineer Community Manager at Mozilla: “Social Engineering – Building Communities With, And On, Purpose”

·       "Process reifies and reinforces values"
·        If you don’t measure it, don’t pretend you care about it
·        The ROI on timely gratitude is ridiculous.
·        Karma is a wheel (courtesy, saying thank you for the things you are given)

“The way you conduct and execute your process is a direct reflection of your values.”

Access, Engagement, Retention - “If you let a patch sit for a week from a first contributor, it is very unlikely you will see them contribute again.”

·        What is in front of a user, if they want to commit a one-line change to your project?
·        The importance of comprehensive documentation
·        The “miraculous” benefits of an easy-to-set-up build environment

·         * “Throw the little fish back in the water for the new entrants to the game.”
·         *  Label good first bugs for beginner contributors and give a concise, yet thorough explanation of how to go about fixing them

·         * “A single toxic contributor can harm an entire community. If people feel unequally welcome in the     community, many will inevitably shy away from it. Don’t be a jerk and don’t let others become           jerks.”
        * Gratitude. Saying thank you. “This bug and your fix matters.” Telling them what to do next.

Why does open source matter? Am I the first person to have this problem?

-        Mythology: Is what is in the absence of real numbers and real data about what works and what doesn’t. Stories are powerful and get into and stay in people’s heads.

-        Open source is meritocratic (we need to stop talking about ourselves like we’re “magic”)

-        Diminishing returns: After 3 sets of eyes looking at a piece of code to figure out a bug, the rest are wasting their time…

-        Strong FSOSS and FSOSS-like communities grow organically

What are the most basic, fundamental things we need to embark upon an open source project?

1)      Source Control
2)      Issue Tracking
3)      Automatic Testing

Do you care?
“There is no regression test for somebody’s mood.”

“Your community is an API to your software.”
What is the state of our community? What problems does our community have?
Are we actively fostering community engagement?

“Have a code of conduct. Have a code of conduct. Have a code of conduct.”

               Choosing this particular pair of talks yielded a very comprehensive picture on the open-source process, since one focused on the community build and project goal philosophies – the preliminary prerequisites - and the other presented the benefits of a completed and deployed product that was a result of many of the same ideals and principles being implemented. There was a clear testament to not only an implied agreement of the two speakers’ points and values, but a symbiosis as well. The focuses and comparisons were of a completely different nature and centered on relatively unrelated processes due to the subject matter, but were ultimately two sides of the same coin.

The open-source paradigm and its implications have not changed for me so much as they had flourished over time. Admiring the philosophies behind open source came naturally, but I was initially confused and doubtful about the financial feasibility of companies and institutions that fully embrace free software and open source processes and values with their intellectual property. The state of this maturing industry after nearly a quarter-century of existence is clear evidence of its resounding and continued success, mainly by awareness of giants like Microsoft or Google investing in more open source venture startups and releasing more open source code and products, as well as witnessing and contributing to companies like RedHat and Mozilla - which are almost entirely based off of open source ideologies in every one of its aspects - rise over the years to become fortune 500 companies.

Thursday, October 16, 2014

0.2 Milestone Completed - My 1st Appmaker Pull Request is in!

First and foremost, the link to the PR - Fixed tray hover tooltip position offset #2317

As expected, this bug ended up being nothing short of an absolute blessing because the time it took to fix it was an iota of the amount of time it took to successfully set up my Appmaker development environment on my Windows 8 machine in order to be able to properly see and test my work.

In the beginning, besides the odd npm install error log emitting after attempting to download the required dependencies partially failed raising an eyebrow, it was relatively smooth sailing until needing to install and run MongoDB. The Appmaker documentation doesn't really let on much as far as the nitty gritty to my particular use case, save for showing the general link to the official website tutorial for installation and use steps. Those proved to be little more than useless in the end. I GUI-installed MongoDB just fine, but as soon as I opened up a command prompt to try and run it as per the instructions on the Appmaker README it would fail and often close the window altogether. When I managed to isolate the error it purported, it looked something like this:

 ERROR: dbpath (\data\db\) does not exist.
 Create this directory or give existing directory in --dbpath.

But much like Tweety Bird constantly reaffirming that it did, it did in fact see a pootie tat... I too clearly made a \data\db folder and later even set and assigned that location to the dbpath explicitly in the config file. After trying to make the most of my google-fu skills to find a step-by-step how-to on Windows related MongoDB installation and execution, I finally found the most relevant and comprehensive one titled Running MongoDB on Windows. If you follow this with a fine-tooth comb, you will be able to both start mongo on both the command prompt, and have it perpetually keep running as a local service via the service manager.

NOTE: For the love of all that is good and righteous in this world, the Service Controller (sc.exe) command you will try to run to create a local service out of MongoDB can ONLY be executed by the administrator account -- not your own custom user account, even if it has the "administrator" label/type. If you want to be extremely thorough, follow the steps mentioned in this answer article to the same problem for a different sc command.


Finally, the bug itself proved to be initially daunting, but with inspiration from a casual comment given to me in-class on Wednesday from a fellow student, once I managed to get the node app/server to run, the procedure I followed ended up being close to my original strategy with a few additions:

1) Open my Appmaker localhost browser instance.

2) Find the "tray hover tooltip" element as described in the bug. It wasn't called that, so after thinking about it, I actually just used my own vision to infer where its location on the DOM was by looking at the image posted on the issue site in Github and compared it with my Appmaker site. I know, it's horribly crass, but hey, it seems to have worked out this time...

3) I used the Chrome Developer Tools to try and inspect the element by hovering over it. This was where my biggest issue was - the tray hover tooltip only appears when you hover over the tray's inquiry icon. Because life was never meant to be this easy. After a bit of thought, I figure I might be able to pinpoint it in the source code by finding where the logic for its parent element was - a div with an ID named "showInfo".

4) In Atom, I initiated a global search for that particular string. I ended up finding it in a place I would never have guessed from past experience with css properties - an .html file. What? Fine, I'll indulge in new flavors. So I started parsing the rest of the file and ended up landing on this interesting looking property nugget: = pos + 54 - (height/2) - offset + "px";

I'll be honest. I don't have any background context on the specifics of this statement. It looks more like Javascript than CSS so my assumption is that it's some sort of new library or framework for CSS injection that I'm not yet aware of, or something much more comprehensive and cool altogether. What I did see is the name of the property itself, which by the looks of it seemed like just about exactly what I was looking for. So I did what any Curious Carl would do at this point...

5) Start playing around with values, and see what changes. Turned out to be pretty much as easy as that. I changed the pixel value after the "pos" variable by 14 pixels and voila!

The original positioning:

My fix's positioning:

And for now, that's all she wrote ladies and gentlemen. Stay tuned for next week update on FSOSS!

Wednesday, October 15, 2014

0.2 Milestone Progress Report

A few weeks into the workload at hand, and after finding a bug and initially attempting to setup the development environment a few times, a problem that seems to be repeating itself in recent times is the inherent constraint of other work from full-time courses as well as a cursed history of personal less-than-stellar time management skills when dealing with more than one substantial subject or task at a time. Unfortunately, with this particular upcoming Friday being riddled with more than just this deadline, I will be scrambling to procure a pull request for this in the next day or two. 

At the very least, I'm in slight familiar ground with CSS and armed with a broad but tested strategy of element/CSS property inspection using web browser development tools to pinpoint where the snippet of code I'm looking for is located.

This epic cliffhanger will conclude with a blog post at the end of the week.

Saturday, October 4, 2014

Initial Bug Scavenging

Last week I've managed to scour the Appmaker repository for issues that might be my pace to start off with. I ended up finding Issue #2251 which in accordance with the recommendations of professor David Humphrey and seasoned mozillian Scott Downe, this seems to be the perfect scope for the deadline and for dipping my feet in the Appmaker environment for the first time. The size and priority of the bug itself are at a state where it is extremely unlikely to block anyone from continuing their current work on the codebase which also provides me with more time to acquaint myself with the logical hurdles and conventions that naturally baggage themselves with a new project I'm about to dive into. Perhaps if done early, I might be able to find another one before the 0.2 deadline.

Friday, September 26, 2014

The 0.1 Milestone: Implementing the 'du' linux command in Filer's Shell

For the first major task this semester, I had major logical challenges in implementing this task on my own. The weeks that I've been away from Javascript work and programming work in general have heavily hindered me from making a lot of sometimes obvious logical assumptions and conclusions in code flow and structure that I should have been able to undertake with relative ease. Many thanks to fellow classmate and prior co-worker Gideon Thomas for his reference solution which my own has inevitably become extremely akin to. Time constraints due to other obligations have also played a large part in my half-baked attempt at delivering this task in a signatory fashion. An immediate future goal of mine would be to play catch-up yet again and invest more effort in being able to comprehend complex code structures such as Filer if I am to continue contributing in a productive and meaningful way going forward. 

While I am still familiar with the unit test infrastructure and conventions, and am able to easily understand the high-level purposes and functions necessary to complete the function itself, my original design was completely bereft of very basic and standard node.js conventions including proper error and function argument handling cases. I also had trouble remembering how to properly access method properties (syntactically) for what I can only describe as absolutely no reason whatsoever.

Overall, without external sound logic there would have been no way for me to meet the deadline and I'm quite disappointed at my general performance for this milestone, but am now doubly inspired to bring myself back up to speed and uphold whatever little reputation that I already previously built back into these projects.

Monday, September 15, 2014

Transcript of Open-Source Case Study Presentation

Here is a slightly summarized transcript of my presentation earlier today centered around my open-source case study -


A hackable text editor for the 21st Century”
Created and maintained by GitHub and its communities


Core is built with web technologies, making Atom extremely customizable
Primarily made for and used by web developers, but supports a variety of languages
Is currently found to be slow in some cases, including text search in the editor and string manipulation


GitHub made and GitHub-based
Currently over 100 contributors in the main repository and over 45,000 downloadable packages
Atom’s twitter page presently has over 35,000 followers
A few ways to contribute to are:
Creating a new package and adding it to the already vast library of modifications to the editor
Directly contribute to the source code by heading to the main repository’s webpage on GitHub.
Conventions and practices used by this community to add or modify code is well documented on the webpages 


An end user has the right to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, with the following stipulations:
The MIT copyright notice needs to be shown on all of or substantial parts of the codebase
The owner of the codebase is not liable for any hardware or software malfunction that occurs either directly or indirectly as a result of using this product

Sunday, September 14, 2014

Setting Up Development Environment on Windows

As a vehement and outspoken anti-Apple preacher for all things hardware and software related, I have been time and time again mocked or warned about the disadvantages of the development environment limitations of a windows-based machine. The main complaints and tribulations that I needed to address (for myself included) were - 

* Find a way to circumvent having to deal with windows command prompt/line syntax in favor of more familiar and comfortable unix console syntax
* Find a good package manager that can compete with the likes of brew or apt-get

The first conundrum was rather easily solved with the installation and activation of Git (with the process being virtually identical to any other platform) and using the the git shell instead of the windows command prompt. The git shell accepts all unix-like commands so you can feel right at home "cd"-ing and "ls"-ing around your file system. I have yet to try more complex bash scripts or commands, but for my current necessities this works like a charm.

Coincidentally, GitHub also helped me procure the next solution with the desire to install and use their code editor, Atom (which I will be presenting about tomorrow). The suggested method of download and installation for Windows 8 is to use a package manager called Chocolatey. This is now turning out to be a marvel of a package manager that also helped me install Node.js, Grunt, and Bower - all paramount to the Mozilla projects that I will be focusing on this semester.

Stay tuned for next week's updates.

Monday, September 8, 2014

Apache vs. Apple Licenses

While I do come from a bit of experience with open-source contributing, the licenses that mine or other peoples' code are wrapped in was never a real big concern of mine. I sort of cruised along with the vague understanding that open source is meant to be free and reusable by all in order to achieve a global sense of community and progress. It's quite eye-opening to read and discuss the various flavors and takes that some of these licenses adopt in our day and age. For my case study, I took on the comparison between the Apple EULA and the Apache license. Below are a few snippets from each:

Apple's Logic Studio Software:

1. General.
The Apple software and any third party software (including any content), documentation and any fonts accompanying this License whether on disk, in read only memory, on any other media or in any other form (collectively the "Apple Software") are licensed, not sold, to you by Apple Inc. ("Apple") for use only under the terms of this License, and Apple reserves all rights not expressly granted to you. You own the media on which the Apple Software is recorded but Apple and/or Apple's licensor(s) retain ownership of the Apple Software itself. The terms of this License will govern any software upgrades provided by Apple that replace and/or supplement the original Apple Software product, unless such upgrade is accompanied by a separate license in which case the terms of that license will govern.

Title and intellectual property rights in and to any content displayed by or accessed through the Apple Software belongs to the respective content owner. Such content may be protected by copyright or other intellectual property laws and treaties, and may be subject to terms of use of the third party providing such content. This License does not grant you any rights to use such content nor does it guarantee that such content will continue to be available to you.

2. Permitted License Uses and Restrictions.
A. Subject to the terms and conditions of this License, you are granted a limited non-exclusive license to install and use one copy of the Apple Software on one Apple-branded desktop computer and one Apple-branded laptop computer so long as both computers are owned and used by you. You may not make the Apple Software available over a network where it could be used by multiple computers at the same time. You may make one copy of the Apple Software in machine-readable form for backup purposes only; provided that the backup copy must include all copyright or other proprietary notices contained on the original.

B. With respect to the Logic Node Installer, the Logic Node application may be installed and used concurrently on as many Apple-branded client computers owned, leased, or otherwise controlled by you as reasonably necessary. These computers must be networked and running Mac OS X.

C. Except as otherwise indicated, you may use the Apple and third party audio file content (including, but not limited to, the Apple Loops, built-in sound files, samples and impulse responses) (collectively the “Audio Content”), contained in or otherwise included with the Apple Software, on a royalty-free basis, to create your own original soundtracks for your film, video and audio projects. You may broadcast and/or distribute your own soundtracks that were created using the Audio Content, however, individual Apple loops, audio files, sound settings, samples and impulse responses may not be commercially or otherwise distributed on a standalone basis, nor may they be repackaged in whole or in part as audio samples, sound files, sound effects or music beds.

D. Certain components of the Apple Software, and third party open source programs included with the Apple Software, have been or may be made available by Apple on its Open Source web site ( (collectively the "Open-Sourced Components"). You may modify or replace only these Open-Sourced Components; provided that: (i) the resultant modified Apple Software is used, in place of the unmodified Apple Software, on a single Apple-branded computer; and (ii) you otherwise comply with the terms of this License and any applicable licensing terms governing use of the Open-Sourced Components. Apple is not obligated to provide any maintenance, technical or other support for the resultant modified Apple Software.

E. You may not, and you agree not to, or to enable others to, copy (except as and only to the extent permitted in this License), decompile, reverse engineer, disassemble, attempt to derive the source code of, decrypt, modify, or create derivative works of the Apple Software or any part thereof (except as and only to the extent any foregoing restriction is prohibited by applicable law).

3. Transfer. You may not rent, lease, lend, sell, redistribute or sublicense the Apple Software. You may, however, make a one-time permanent transfer of all of your license rights to the Apple Software to another party, provided that: (a) the transfer must include all of the Apple Software, including all its component parts, original media, printed materials and this License; (b) you do not retain any copies of the Apple Software, full or partial, including copies stored on a computer or other storage device; and (c) the party receiving the Apple Software reads and agrees to accept the terms and conditions of this License. You may not rent, lease, lend, redistribute, sublicense or transfer any Apple Software that has been modified or replaced under Section 2C above. All components of the Apple Software are provided as part of a bundle and may not be separated from the bundle and distributed as standalone applications.

Apache's General License (version 2.0):

"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
  1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
  2. You must cause any modified files to carry prominent notices stating that You changed the files; and
  3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
  4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.

    You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
3 Key Differences - 
* While Apple's license does refer to some open source components being reusable and redistributed, the vast majority of the rhetoric in the license agreement goes into great detail about the "temporary privilege" of this being a 1 sole obtainable license that cannot be modified, or sublicensed by anyone except Apple who are the true "owners" of this particular piece of intellectual property. Apple makes every effort to constrain you from doing anything except the intended end-use of a product such as this, as blatantly written in this clause: 
"You may not, and you agree not to, or to enable others to, copy (except as and only to the extent permitted in this License), decompile, reverse engineer, disassemble, attempt to derive the source code of, decrypt, modify, or create derivative works of the Apple Software or any part thereof (except as and only to the extent any foregoing restriction is prohibited by applicable law)."
* Apache is in clear contrast mostly open-source in its philosophies, especially with clauses explaining classic conventions such as being able to redistribute the work in any modified or unmodified form onto any medium so long as the original authors are given credit where it is and that this continues to be published under the same license respectively.
* Interesting additions to the Apache license even as far as open source goes, extending to such things as "trademarks" that protect the name of the released product from liberal reuse, or the clauses referring to how you can sell this and warranty or maintenance plans along with it so long as you follow certain conditions.