Saturday, December 15, 2007

Metrics Server-Collection 0.3 Release

Well, that was quite a project. I went in knowing nothing so, there was a lot of research effort needed to get even the littlest things done. My project basically required me to learn Python, the Django Framework, http request/response, MySQL, and database design. Although I knew some SQL and database design, the project really required me to think and re-learn a lot of the material I never really thought was that important.

Django is an awesome framework to get things done quickly, so I strongly recommend it to anyone who wants to do average database work and page implementation. Python is an odd language, it is nothing like the other languages I've learned; I mean how was I suppose to know what a "tuple" was; its basically a list for those who want to know. Hm... what else? Http was definitely the hardest for me to grasp; even though the concept is so simple. There's just not enough of this being taught in my courses and I feel that a lot of the hardships other students are going through comes from the same problems; not enough concepts being taught vs code.

Anyways, for anyone interested in getting some cool user data and putting it into a database, check out my project wiki and keep me posted on what you think. As far as project contribs go, I did that canvas3d test, got some useful favicons for a colleague, help brainstorm on solutions for the OpenID http probs, and sent some C# code to the distCC project (although I got no confirmation back on that). It's getting real late, so goodnite.

Sunday, December 9, 2007

Favicons for Firefox

Well, I just finished contributing to the Favicon Project. Favicons for Firefox are basically icons you can use to represent sites; very similar to the ones you see next to the URL in the address bar. I think the idea is kind of neat since it allows users to customize their browser even more. I gave the project owner some nice icons, some of which I think will be useful - like Wikipedia, MySpace, YouTube, and other famous site icons. Hopefully, they all work properly and can be of some use. Anyone interested in the project or want to contribute some more can check it out at the projects wiki; My Favicons Extension.

Canvas 3d


Well, I just got around to testing the canvas3d extension on my home computer. There were some complications since I had like 5000000 different installations of Firefox on my PC that I lost track of the one I installed it on. However, in the end I got it displaying and I'm glad. There was one thing I did find a bit odd, in class when Cathy was testing the installation her teacup was upside down; but, on my computer the teacup is right side up. I wonder if there are conflicts with the way canvas3d is displaying 3d content on the monitor. I know that sometimes this happens when my driver set-up goes wrong for my games. Anyways, here's an image of what the teacup looks like.
If anyone else wants to test it out and haven't found a chance to, download the canvas3d extension and try one of the html page tests.

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.