Wednesday, November 28, 2007

First XPCOM chrome



Well, I just finished the xul overlay for the firstxpcom extension we created in the previous lab. It wasn't actually that difficult; however, for those of you who regularly download a nightly; like I do. You need to make a few modifications to the lab. Here are some quick fixes I needed to make to get everything working properly.

1. When using Ted's extension creator, make sure you have the right max version. The lab says, "Maximum Version=3.0a3pre" this for me is not correct; I build version 3.0b2pre.

2. If you followed the labs instructions, the chrome extension doesn't seem to appear in the addons list (after extracting the needed files into the ../extensions/firstxpcomchrome@senecacac.on.ca), try renaming the .zip into a ".xpi"; which will allow you to drag and drop the extension into your browser for installation.

Those are basically all the needed steps I took to get the extensions working. Here are some screenshots of the results.

Tuesday, November 27, 2007

First XPCOM Extension


Well, I finally did it. Here are the screenshots to my new firstxpcom extension which doesn't do much. However, I would like to start editing it so that one day it can actually do something; even something small.

The lab was quite interesting, although I'm curious to know whether or not binary extensions be installed on other peoples machines without building. I know some are probably not able to without some work, but can this one?

Oh! and here's the zip with the extension.

Sunday, November 25, 2007

Metrics 0.2 Released

Well, my o.2 was finally released. It was a very painful process getting some of the Django framework to work properly with my database layout. I don't know why they haven't fixed a lot of the issues with database relationships; you would think that those bugs would be the first ones they'd jump on. However, I guess there are other issues to resolve?

For those who don't know what my 0.2 is about, the release basically was to create the database infrastructure for the metrics data that I would be receiving from the metrics extension (firefox browser). The database structure was created using the Django framework; which as I already posted makes Web and database work easier. The framework basically helped me create all the MySql tables, an administrator page w/ logins, search functionality, and methods to help with the CRUD.

My 0.3 release will now be creating a python script that uses the database models I created in my 0.2 to parse all the data from client into the database. Hopefully, this will be a semi easy task. I don't think parsing will be a problem or even getting the data; however, I'm not 100% sure if I can just use a python scripts to do all these tasks ( I'm a completely new to python). Although, some people of the Django community told me it would be possible and I will try to take their advice and get the ball rolling.

For anyone who wants more information on the project or try it out for themselves, just install all the necessary apps for Django Installation and do the setups for your platform then head on over to my wiki on zenit and get the source code; please use the nightly. Then unzip it into any directory, load up a shell, and use "python manage.py runserver" in the root directory of my project ("you_directory/metrics/").

Django - the "D" is silent

"Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design".

I am quite new to different frameworks and this is probably the first Open Source framework I've actually used for anything. I've heard that there are other frameworks that offer similar things - like Ruby on Rails; however, I've never actually used any of them, so Please keep in mind that my opinion may be a bit biased.

Django tries to keep everything automated and adheres to something called the Dry Principle. It makes life so much easier when creating database designs that I'm pretty impressed. From what I've experienced, it can create full database structures, administrative logins/web pages given object specifications (similar to normal OO Programming Syntax); on top of that you can design urls with minimal code.

Here is an example of an object model (taken from the Django tutorials) used to create the database:
from django.db import models

class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Admin:
pass
As you can see from the example, that is how you would create a table called "Poll" with two fields - question and pub_date. Now you can login to the administrator page (already automated) and add as many new polls as you like; simple right? You could even use python shell or a script, and create it like you would a class object. Like this:
p = Poll(question="What's up?", pub_date=datetime.datetime.now())
If you ever wanted to create a simple website or blog, you should check Django out. Try a few tutorials and see what it has to offer for yourself; if you have any trouble login their irc #django IRC channel on irc.freenode.net. There's a lot of nice people there who are more than willing to help out.

Tuesday, November 13, 2007

Metrics Project Contributions

As I have explained in class, my project requires some contributions. Currently, I require some people to test the patch I created on different platforms (linux, mac) and install the extension to test the server script.

Testing the patch only requires someone who uses or has one of the platforms listed above to build firefox with the metrics extension. All details on how to do this is on this blog (click here). I only require one of each, so that would be two people. Please leave a comment below if you're interested; or email me at my student email located on the school wiki (here).

Testing the server requires someone to build the extension with firefox and change some preference settings so that the extension will automatically start and send data to my server (click here). Once the extension has started (you can check by typing about:metrics in the address bar), you should see some xml style data, you just need to use it for about 5 mins. After around 5mins, the data in about:metrics should be reset and that means the data was sent; this is where you can disable the extesnion in the preferences.

Thanks to those who are willing to contribute. Please leave any comments or questions for the above.

Wednesday, November 7, 2007

My Experience at FSOSS 2007

FSOSS 2007 was a great learning experience! Before I attended the event, I dreaded the idea of coming to school on my week off; however, the knowledge I gained was irreplaceable. Although I'm still a student, I create a lot of little applications in many different languages for class, and I have always loved the design aspects. I mean, why do we develop applications? I think that many people get so involved is the code or the next best feature they thought of that they forget who the application is for. The average user doesn't care about what happens behind the scenes; they care about how easy and suited the application is for them; which is why I enjoyed the presentations that Jay Goldman/David Crow and Mike Beltzner gave.

Mike Beltzner presentated "Product and User Experience Design in Open Communities", and Jay Goldman and David Crow presented "Usability Anonymous: A 12 Step Program for Better User Experiences", both of which I thought was quite interesting. They kept the audience a bit more lively and made the experience fun. Both presentations were about the user, and tips in creating better software for them; I think they both mentioned the same book, "Design Patterns" by Jenifer Tidwell. However, each presentation took a slightly different focus. Mike Beltzner discussed much of building a community and letting the users get involved, while Jay Golman and David Crow talked more about understanding the user in design decisions. Although I liked the slides that Mike Beltzner gave (very colorful), I thought I gained a little more from Usabiltiy Anonymous. Sorry Mike!

I was even registered for the Drupal workshop which I didn't attend since I wanted to go see the presentation on Facebook, but it wasn't what I thought it would be about. The presentation was great and they presented a lot of interesting concepts provided in Thrift, an open source cross-language development framework, but my brain must have been on off because it got a little too technical for me. On another note, facebook does provide cool little programming challenges every once in awhile and those can be fun to solve.

In the end, I think I liked my time at FSOSS. The food was okay, the presentations were fun, but the little things that were gained were more than worth the loss of two days of my break. Thanks again to all those who participated in making the event go as good as it did!