Thursday, November 12, 2009

Running Thunderbird

After building Thunderbird is finished it was very disappointing that there were no fireworks or even a "congratulations your build was successful" message, all what you get is this screen in the picture below :(.


















After running Thunderbird I tested it for the "mailto" bug, and as you can see it is still present.

Wednesday, November 11, 2009

Easy to follow steps for building Thunderbird on Ubuntu

1. Install cvs:

sudo apt-get install cvs


2. Installing build tools:

sudo apt-get build-dep thunderbird
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev


3. To get autoconf version 2.13:

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz
tar -xvzf autoconf-2.13.tar.gz
cd autoconf-2.13/
./configure --program-suffix=2.13
make
sudo make install


4. Get the source:

hg clone http://hg.mozilla.org/comm-central/
cd comm-central
python client.py checkout


5. To get missing packages such as mesa or header files such as iwlib.h:

sudo apt-get install mesa-common-dev libiw-dev


6. Create an empty file in comm-central directory and rename it to ".mozconfig"

7. Add the following lines in the ".mozconfig" file:

ac_add_options --enable-application=mail
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb-release
mk_add_options MOZ_MAKE_FLAGS="-j4"


8. Start the build:

make -f client.mk


It worked for me !!!, I tried to make it as easy as possible without any descriptions for my colleagues who don’t want to get into details of the build :), but if you want to ask about anything just post a comment and I hope that I can help you. Also I would like to thank Eng. Mina Metias for his post about building Thunderbird.

Note: It takes time to download the source code.

Sunday, November 8, 2009

Fixing the Thunderbird bug

The first step in fixing the bug is finding it in the source code, in my approach I used MXR (Cross-Reference), and you have to cleverly choose the very specific keywords used for searching, because the source code isn’t small. I used "mailto" as my searching keyword, the code related to the bug was in the mozTXTToHTMLConv.cpp file between lines 194 to 204.

if (aInString[pos] == '@')
{
// only pre-pend a mailto url if the string contains a .domain in it..
//i.e. we want to linkify johndoe@foo.com but not "let's meet @8pm"
nsDependentString inString(aInString, aInLength);
if (inString.FindChar('.', pos) != kNotFound) // if we have a '.' after the @ sign....
{
aOutString.AssignLiteral("mailto:");
aOutString += aInString;
}
}

This part of the code just checks if there is an '.' after the '@' sign and ignores a lot of other invalid cases of an email address.

Invalid Addresses
a@.
a@..
a@..f
a@....f
@.
@.com
@a.com
@a
@a.
@a..
@a...com
a@a.a..a

So we must add more conditions to the if-statement in line 199, the first one is to check if we have a '.' right after the '@', the second condition is to check if we have more than one consecutive '.' after the '@' sign, the third condition is to check if the address ends with '.', finally we must check if the address starts with the '@' sign.
So this is my modified code:

if (aInString[pos] == '@')
{
nsDependentString inString(aInString, aInLength);
if ( (inString.FindChar('.', pos) != kNotFound) &&
(inString.CharAt(pos+1) != '.') &&
(inString.Find("..", pos) == kNotFound) &&
(inString.CharAt(inString.length()-1) != '.')&&
(pos!=0))
{
aOutString.AssignLiteral("mailto:");
aOutString += aInString;
}
}


Unfortunately I didn’t test or patch it :( for a well known reason :D, so can some one test it for me ??

Monday, October 26, 2009

Processing.js First project

In the first Processing.js Project, I worked with Eng. Sarah Nagaty and Eng. Omar Roushdy, we worked on creating an interface to show the contributions of each user in a nice way, but we failed to get the values of the contributions in an array to be used in our Processing.js code, so we tried to get the names only, we got them in an XML file using a query, but unfortunately we couldn’t use it also, so we just entered the users in a static way in an array and used it, hopefully soon we will find out how to do it and we will make an new release ;).

The project we did just list objects of circles in an ordered way and assigns a name to each one, when the users enters the mouse inside the box of the circle the name of the user assigned to it will appear on the tip of the mouse. The colors of the circles are random degrees of blue.

Finally, I used the “Get Source” button of the web IDE provided by Processingjs.org to get a file that works without support of any other files, and I changed the code inside of it to our code, and it works :), but for the text to appear you have to use Firefox, in chrome the text didn’t appear :(, and of course on IE it worked perfectly (kidding :D).

In this post I discussed the work of our group altogether, not my individual work.

Windows 7

I posted this picture on the wiki in the community humor page, but I think no one checks this page, you have to try Eng. Omar Roushdy Ubiquity command to go to this page it is really easy.



Microsoft tried to torpedo the success of the Japan Linux Symposium by launching their Windows 7 product that same day. They even had setup a big promotion booth across the street from the conference center.

During a break, Linus went over there to make some fun of Microsoft. When he arrived there, Linus was sold immediately on the product as you can see in the picture. At least that's what the sales guy thought. He obviously had no idea who he was dealing with. But in the end Linus surprisingly did not buy a copy.

Both of them look very funny in this picture :D

Yet Another Review

Today I wrote a review on the reviewers of my review on the Cathedral and the Bazaar review :D, and then one of my reviewers will review my review on the reviewers of my review on the Cathedral and the Bazaar review, and more to come ..., as a very wise man said "till infinity and beyond" my friend Captain Buzz Lightyear, I hope I can see him in Toy Story 3 soon isA, for people who are interested the release date is 16 June 2010.




Back to the Cathedral and the Bazaar review, I think that after a while it will be something worth the wait, I wish Dr. Fatma best of luck in joining all the points together, and I have to say that I really admire your work and effort. :)

Monday, October 19, 2009

g-osc-user-cont (Ubiquity command)

function open_usercontributionspage(arguments) {

if(arguments.object.text!="")
Utils.focusUrlInBrowser("http://se.bigbuddysociety.net/wiki/index.php?title=Special:Contributions/"
+ arguments.object.text);
else
Utils.focusUrlInBrowser("http://se.bigbuddysociety.net/wiki/index.php?title=Main_Page");
}

CmdUtils.CreateCommand({

names: ["g-osc-user-cont"],
author: { name: "Mostafa ELkhouly", email: "mostafa-khouly@hotmail.com"},
description: "Go to the G-OSC User contributions page.",
arguments: [{role: "object", nountype: noun_arb_text,label: "Username"}],
execute: open_usercontributionspage,
icon: "http://se.bigbuddysociety.net/wiki/images/c/c4/GOSC-Logo-135.png",
preview: function (pblock){
pblock.innerHTML = "Go to the G-OSC User contributions page\t"
+'<http://se.bigbuddysociety.net/wiki/images/c/c4/GOSC-Logo-135.png/>';}
})


This is the code of my first Ubiquity command, it is called "g-osc-user-cont", it is a very simple command it takes a username as an argument, and opens the contribution page of this username (if it is a valid username), but if the command is used without an argument it just opens the g-osc home page in a new tab. The command also uses the g-osc logo as an icon and it also appears in the preview window along with some text.

Now I am going to talk about the implementation of the command, I think that the action of "names", "author", "description" and "icon" are quite obvious, so I am going to start with the "preview" which contains a function that adds some text and g-osc logo to the preview page of the command. The second part is the "execute" which calls the "open_usercontributionspage" with the arguments if any, this function checks the argument and extracts the text from it, if the text is empty it just goes to the g-osc home page, in any other case it uses the text of the argument to open the contributions page for the given text (even if it isn't a valid username), and that's it.

One more thing I would like to thank Abdallah Elgindy for his blog post about using Utils.focusUrlInBrowser() instead of Utils.openUrlInBrowser().

My first post

Hello,
First of all I am going to start by introducing myself. My name is Mostafa Elkhouly, I'm a computer science graduate from the GUC and currently I'm doing my pre-masters courses. This is my first post on a blog on my first blog, and I don't even like blogs :D. I'm just going to say what comes to my mind about this course (Open Source Development course), I am going to start by talking about the reviews I hate them !!!, and till now I don't know why are we doing them, and the best thing about the reviews is that my review was removed from the topics :D what an "egoboo". Btw after sharing my feelings towards this course on the blog I feel much better, maybe this blog will help me survive this course :). One more thing, the best thing in course up till now is the cookies : D.

Soon I will post a feedback about my g-osc-user-cont (ubiquity command), and about the last lab, I didn’t have my laptop so I worked with Eng. Omar Roushdy, he is a very nice person, I hope we stay friends forever.