Thursday, February 18, 2010

Enabling Firefox Tabs to load Homepage

For the past week I've been quietly working on enabling Firefox tabs to load a home page. By working on this task its shown me how important it is to be able to skim through huge amounts of code in order to find that small portion that affects or does what you are looking to change. So I'll get right into it!

The task was to achieve two things:

1) Enable a homepage to load whenever a new tab is created
2) Enable the user to optionally set the tab to open this homepage on creation or to
remain with the standard blank page

Surprisingly enough the second objective came along pretty easy! So if you've ever changed your homepage in firefox you would be familiar with the this:


If you look carefully you can see that my home page is set to "http://www.xbox.com", so whenever I open a browser window it will automatically open up to that website. Now in order to proceed further I will need to know where the homepage string is stored and for this I took up a torch and ventured into the "den of dragons":



This tool is real nifty in the fact that I can use it to search for different components of the Firefox browser. Since we are trying to customize a homepage load up for a tab I figured I'd search up browser.startup, lo and behold I got the following:


Notice anything familiar in those results? Check out the highlighted function and look at the value...it should look familiar now. This variable "browser.startup.homepage" holds a string variable for the home page's URL! Now I know I'm getting somewhere. Now I know where the homepage is actually stored. With this information I searched the Mozilla repository for it and I got the following results:


Weaving through all of these results was both tedious and time consuming but I eventually came across a file that contained the use of browser.startup.homepage. Looking at lines 199 - 203 you can see how an integer value is used to determine the action of the browser's startup, if you look again at the earlier screenshots showing the browser variable search from the "dragon's den" you'd notice that browser.startup.page has a value of '1' which then asks it to call "browser.startup.page" function which uses that string value in the browser.startup.homepage variable. Whew! I've done some testing and by changing the integer variable I can manipulate the actual action taken when the browser starts up.


Even though I now know how to manipulate a browsers homepage it still leaves out the tab function which is what I really want to manipulate. This is where my progress had temporarily come to a halt....until I happened across a colleagues blog in my OSD600 class. Scott Downe has also been working on the Firefox tab tweak and has made progress in the area in which I'm having trouble with. For now I will take a break from actual testing and contact Scott to better understand how Firefox tabs are called in the code and also share what I've come to understand thus far. (There's that Open Source collaboration coming into play :P )

Hopefully in the near future I will be able to post a success story but for now I gotta get back to work on my Release 0.1 which I should be releasing a status post for later today!

Thursday, February 11, 2010

Initial Project Plan

For my semester assignment I’ve chosen to contribute to the Processing for the Web project which is an ongoing work that is porting the Processing language to be the open web.

Background of Processing.js

Although the project is based around the processing.js language it is important to know the origins of this language port. Processing is an open source programming language that was developed for the purpose of teaching the basics of computer programming from a visual perspective. The Processing language was started by Ben Fry and Casey Reas in 2001, both of which were a part of the MIT Media Lab’s Aesthetics and Computation Group. A few years later in the summer of 2008 John Resig, the creator of the jQuery, ported the Processing language (which was based in Java) to Javascript for use in web pages.

Importance of Processing.js

Currently if one wants to implement animations in their browser they would have to install a plug-in, whether it is Macromedia Flash, Java and Microsoft Silverlight. But what if there was a way to run these animations without having to take that extra time to install a plug-in to do so? Wouldn’t that be convenient and make life easier? Well there is! With processing.js all of the implementation for animation can be done from the javascript running on your browser, ultimately eliminating the need for a plug-in to do the implementation for you. Not only is processing.js eliminating the need for additional plug-ins but it also is eliminating the issue of browser compatibility as the language is running on all of the major browsers such as Firefox, Safari and Internet Explorer (although with Internet Explorer they would have to use ExplorerCanvas).

What Will I Be Doing?

Why did I choose this project? I believe mainly for the fact that my job will consist of actually trying to break something as opposed to fixing it. For the project I will be creating a test suite that will test processing.js functions that are currently being ported through the parser to ensure that they work properly after the port process. For this I will have to develop lots and lots of simple tests to put each of the functions through. In doing so I will try to keep with the following timeline for my releases to the best of my ability:

0.1 Release – February 19th, 2010

0.2 Release – March 19th, 2010

0.3 Release – April 9th, 2010

For progress on my project you can follow on my wiki project page, I’ll keep my blog updated with breakthroughs and pitfalls, and maybe...just maybe…some ranting. Since my task encompasses creating tests for the functions used in processing.js I’m pretty sure my releases 0.2 and 0.3 will more than likely change. For the time being I will go with the following outline:


Release 0.1

Focus on completing tests for functions that are of high priority for the project in terms of close to completion by other members. For this I will have to communicate with others working on the actual porting of the code to find out which functions need immediate attention.


Release 0.2

To Be Specified**

I’m looking at completing less important functions after the important functions have tests created for them. An additional functionality will be added to the test suite to work with unit tests (unsure if this has been done yet, will update this release goal if it has)

Release 0.3

Test suite will be able to perform tests for all functions in the processing.js library. As I may be changing the goals of Release 0.2 there will be an added functionality which will be incorporated into the test suite.


Required Learning

For this project I will need to have a basic understanding of the following:

Javascript – it plays an important role in the project as it is the language in which the processing language will be ported into so I will need to know the basics of Javascript in order to write my tests and to debugging.

Processing - I will need to learn processing since it is the language that processing.js was ported from. To have an a basic understanding of this language will prove valuable for my work in the same light as Javascript as I would need to know which functions translate into what on the Javascript side.

Processing Developer Environment – familiarizing myself with how to use this development environment will allow me to actually use the functions to do some testing and debugging.

To acquire knowledge on these topics I will resort to the following:


Processing Resources

http://processingjs.org/reference

http://ejohn.org/

http://processing.org


Javascript Resources

“Learning Javascript” by Shelley Powers

http://javascript.internet.com/


Collaboration and Contact

As my task requires me to write many tests I would appreciate any input regarding to scenarios in which a function may crash, it’s not possible for one person to look at an issue from every angle so having others contribute ideas and scenarios will help cover areas that may escape me. In terms of contributing I’m keen on doing cross platform testing and debugging javascript since I will be using the language quite a bit this semester.


Barriers and Obstacles

For this project I’ve got a personal barrier that has stuck with me for a while. First off I’m easily intimidated by work that seems complex or beyond what I feel I’m capable of. When I’m faced with this not only do I get frustrated but I try to fix it on my own without asking for advice or assistance which results in time being wasted achieving a small task that could have been done in seconds should I have asked for assistance. To help with this barrier I will try to utilize IRC more and collaborate with others instead of struggling on my own wasting invaluable time.

Thursday, February 4, 2010

The Dark Tunnel..........

So it's been a while since I last posted, been wandering in a real dark "tunnel" trying to build the environment for Firefox. I first took a look at the MDC wiki on building FireFox for a Windows platform. From first sight it was, to put it mildly, tedious. In order to get my platform ready to build this environment I had to go and download a few a things:

- Microsoft SDK for Windows 7
- VisualStudio 2005/2008 (I chose 2008)
- The current mozilla-build file

Downloading three files might not seem to be much but when two of three files are more than two gigabytes then you can understand my frustration. Three hours later everything was prepped and installed, building the environment would be a cinch, or so I thought. After following the MDC wiki I ended up in a shell that was created to simulate a linux environment (start-msvc9.bat). In order to build Firefox on my system I needed to retrieve a clone from the mercurial that would produce a localized copy of the mozilla-central repository on my system. After issuing the command: "make -f client.mk build" the system beginning running tests to ensure that I had the necessary components installed and configured.

Enter my first headache, for a strange reason the test failed to identify the C compiler on my machine, after an hour of trying to figure it out I decided to google up error to find out if others had experienced the same problem as I had. After doing a bit of research I found out that the problem could be resolved by editing the PATH environment variable in the system properties.

After solving this I figured it would be smooth sailing but that was not the case. Enter headache #2, this little error that I picked up when attempting to build on my fourth try:

Adding configure options from /c/mozilla-central/mozconfig:
--enable-application=browser
--disable-optimize
--enable-debug
--enable-tests
configure: error: System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.
make[1]: *** [configure] Error 1
make: *** [/c/mozilla-central/ff-dbg/Makefile] Error 2

After carefully reading this error message I knew that my system lacked the atlbase.h header file which is necessary in order for the building to be completed. I followed the link which directed me to another link that ultimately landed me on this page. Seeing as my system is a 64 bit OS the only version of the header file that would work was the PSDK-amd64.exe. After installing the missing files I attempted to build again and my result was as follows:


Then I navigated into my obj-dir folder nicknamed ff-dbg and searched for the mozilla or firefox executable:



Issuing the command to start it with the profile manager and the build FireFox Browser (which looks identical to the one I normally use):

Thursday, January 28, 2010

You would never have thought.......

By now I'm sure you're tired of hearing "Na'vi", "world tree" or just a reference to "blue people", yes I'm talking about Avatar. I bet you're wondering why I'm even posting about such a thing here just bear with me for at least one more sentences and I promise it will be worth your time. Suprisingly the Na'vi and Open Source have a lot more in common than we'd like to think, this is because the film Avatar was rendered by 35,000 cores running Ubuntu....yes it's not a typo or my early morning-half awake typing.

Weta Digita
l the studio responsible for the graphics rendering used a setup comprised of:

- a 2 Petabyte disk array
-10gbps networking
-35,000 cores (4,000+ HP blades)

and even with this setup for some of the sequences it took 48 hours to render the graphics for the sequence.

If you're interested check out the article/blog post by Dustin Kirkland. I think I'll stop there as it's really early in the morning for my tastes. Oh but class is in just a few hours....heh.

Tuesday, January 26, 2010

Add-On Weekly: TwitterBar

So I've recently upgraded to the latest version of Firefox (which is 3.6, if you haven't done so I would highly recommend you do!) which is filled with lots of nifty little add-ons and newly introduced "Personas" which gives your browser an edgier look. Now I've recently got into using Twitter which in the past I've considered a personal blasphemy and I found it to be tedious that whenever I wanted to post a new "tweet" I would have to go to the website log in and go through all that jive. Enter Christopher Finke the developer of TwitterBar an add-on that makes posting to your twitterboard as easy as pie.

TwitterBar enables you to post links and short lines of text from your browsers address bar directly to your twitter board as long as you end it with "--post". For example, if I entered:

"Mass Effect 2 is out today go out and get it! --post", it would post that line onto my twitterbar in mere seconds.

If you're a casual twitter poster like myself its a wonderful add-on to have, if you're a heavy poster its also great but it has a few limitations at the moment for example image uploading and reading/posting to other peoples blogs. But these will be worked on sometime in the future.

Thursday, January 21, 2010

Making way to the festival

So it's week two and things are now really getting interesting in OSD600. Last week we were introduced to the two different types of developer environments described by Eric Raymond in "The Cathedral and the Bazaar". This week we were introduced to different tools and services that can help us on our journey to the "Bazaar". Tools such as IRC, mailing lists, public calls and Bugzilla are among the few explained and demonstrated. Personally I've never been one to get involved in mailing lists, use a blog or even utilize Twitter. However after toying around with a few of them my opinion has changed completely and the adamant anti-Twitter facade I once flaunted has pretty much vanished. As individual pieces I was unaware of how purposeful these tools could be, but after viewing a few resources this week its all coming together now. Something that stood out to me in particular was a quote that came from the "Learning to Be at the Festival" lecture by David Humphrey, he says "The Festival only exists if we decide to recreate it". The Open Source community is a strong embodiment of this festival and its community continues to recreate it. In essence the attendees of the festival are just as important as the festival; one cannot exist without the other. Should the community cease recreating and carrying on this festival it would only be a matter of time before the festival ceases to exist.

In due time I hope to improve my effective use of these tools as I would like to expose more people from my country to Open Source seeing that there is still a vast majority that are unaware of the impact that its having on all aspects of technology today.

Tuesday, January 19, 2010

OSD600 Beginnings....

First off I would like to welcome you to my blog, my name is Gustone Lewis a 4/5th semester student in the CTY program at Seneca College. After our first week of lectures in this course (OSD600) I was left a bit intimidated and unsure of whether I'm up for the challenge that this course will present me with. However I'm also excited to actually get a sample of the world of an Open Source Development and the environment that they work in.
We were presented with a few resources to better familiarize ourselves with Open Source, its history and a bit of information on the Mozilla Project. Of all the resources two in particular perked my interest:
The film "Revolution OS" fascinated me to see how the Open Source community got started and yet it coexists alongside another entity, the Free Software Foundation (started by Richard Stallman), in which they both believe that software should be "free" in a sense of freedom and not cost. Yet they differ in that the FSF believes that all software should be free and non-free software should not exist, the Open Source community believes that non-free software and free software should co-exist. From Eric Raymond's article "The Cathedral and the Bazaar" it was interesting to learn that the Open Source environment is similar to a Bazaar, seeming chaotic from a surface viewpoint yet it produces incredible results. It can because there is in fact some level of order just not as strict and hierarchic as the Cathedral model which is used mostly by proprietary developers (e.g Microsoft).

Overall I'm looking forward to this course and have confirmed my resolve to enjoy working in this course and with my fellow peers.