Monday, December 7, 2009

My first Patch !!! :D

Well, long time no blogging,huh ?
The thing is I had no internet connection for the past 2 weeks due to some “heavy maintenance “ at my internet provider,which is supposed to be one of the best providers,namely vodafone :S :S

Today I am blogging about my first real contribution to the open source community :D …. despite the fact that I might have wrote the same title in a previous post title, this post is considers as my official release of the first open source contribution.
As part of the open source course I am enrolled in I had to work on fixing a sort of serious bug in the Thunderbird project. The bug that was assigned to us (Eng Mirna Ayman,Eng Muhammad Mostafa and myself) was about an enhancement. The enhancement was about opening draft messages from that appear in the search dialog in the respective editable mode (the current situation it opened in the viewable mode)

Our bug fixing process could was divided into three major releases:

release 0.1 : code exploration and to know where everything was,and what is the functionality of each class,and to identify the classes that we will work on in order to produce the desired solution.

Release 0.2: Some modification to the code and further code exploration is done. The code modification enabled us to have more confidence and getting acquainted to the TB environment.

Release 0.3: the Bug fix was finally produced and tested on many scenarios,a patch is also produced and submitted to the mozilla-TB community .


The results of our work are posted on the course community page :http://se.bigbuddysociety.net/wiki/index.php?title=Thunderbird_Draft_View



And the patch could be viewed on bugzilla website: https://bugzilla.mozilla.org/show_bug.cgi?id=489106

The patch is not yet accepted,however we received the review for it and we are currently working on releasing patch 0.2 ;) .


Sunday, November 8, 2009

Thunderbird build finally works !!!! :D:D

FINALLYYYYYYYYYYYYYYY!!!!!
well,for those who have been following me on mt blog,they know how much i suffered during my various trials to build the thunderbird mail client on my machine.
GOOD NEWS people...i finally managed to build it :D :D. Before stating how it was built,i would like to mention my mistake,so that it could be beneficial for anyone.
My main and major mistake,that i was kind of mix and matching online tutorials on how to build it,i didn't stick to one tutorial,and thus the procedures were contradicting ( the main problem that faced me was that the TB build was bothered by a previous TB build,and i couldn't clean the folder properly)
well,the building process goes as follows:

1. Get build prerequisites:
sudo apt-get build-dep thunderbird
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev
2.Get the source :
hg clone http://hg.mozilla.org/comm-central/
cd comm-central
python client.py checkout
3.Configuration: Create your own .mozconfig (simply create a new empty file and type the following in it) file in the comm-central directory,where u specify your build options as follows:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-tb-debug
ac_add_options --enable-application=mail
ac_add_options --enable-debug
ac_add_options --disable-optimize
4.Build:
make -f client.mk

5.RUN:
The thunderbird executable can be found in objdir-tb-release/mozilla/dist/bin/
on linux u open the terminal and start typing:

cd ~/comm-central/objdir-tb-debug/mozilla/dist/bin$
./thunderbird


ANd you got it :D:D !!!

Screen shot: Thunderbird build complete
Screen shot: Thunderbird running =)

Saturday, October 31, 2009

Thunderbird Bug fixed !! :)

hey,..
despite the failure and frustration that i faced, during my several attempts to build the thunderbird project,the idea of me getting a sight into the project's code never vanished completely. :)
Through the code search agent MXR (here) i managed to take a look into the code.The MXR is a code search enginr that understands the semantics of your query (more or less =) ) . Anyway, Thunderbird suffers from a serious bug,while typing in the mail editor,the " automated hyperlink detector" mis interperts some of the written text.
For example,writing " S@Y...where" would be interpreted as a valid mail address. This is a brief description for the problem, a more detailed one could be found here.
Using MXR the following code segment was found and was observed to be of special interest to solve the bug mentioned above:
 if (aInString[pos] == '@')
195 {
196 // only pre-pend a mailto url if the string contains a .domain in it..
197 //i.e. we want to linkify johndoe@foo.com but not "let's meet @8pm"
198 nsDependentString inString(aInString, aInLength);
199 if (inString.FindChar('.', pos) != kNotFound) // if we have a '.' after the @ sign....
200 {
201 aOutString.AssignLiteral("mailto:");
202 aOutString += aInString;
203 }
204 }

Clearly the code doesn't handle the special cases as the one mentioned above.
So,as part of my this week's assignment,as well as part of my duty towards the open source comunity ( :D ) modification to the current code segment had to be implemented.
The following modification was the result of some searching problem solving techniques:
Substituding line 199 in the previous code with :

if ((pos!=0)&& (inString.CharAt(pos+1)!='.') && (inString.CharAt(inString.length()-1)!='.') (inString.FindChar('.', pos) != kNotFound) && (inString.Find("..",0)==kNotFound))

As it is obvious,each condition handles different case.
1.pos!=0: An email address cannot start with the "@" symbol
2. inString.CharAt(pos+1)!='.' : An email address cannot have a dot right after the @ symbol
3.inString.CharAt(inString.length()-1)!='.': An email address cannot end with a dot.
4.inString.FindChar('.', pos) != kNotFound : An email must contain at least one dot(but not in the previous positions)
5. inString.Find("..",0)==kNotFound : An email address cannot contain two consecutive dots.

The previous modification was developed with the help of the c++ tutorial that could be found here . (as i am no c++ expert myself :) )

Unfortunately,i wasn't able to patch my modification,and get it reviewed,since i failed to build thunderbird for this reason.
Hopefully,the problem with building will be solved,and i will tell you all about it in my next post :)
Cheers,
Mina

Friday, October 30, 2009

Mozilla,Bugzilla,Chatzilla..... The Zilla life =)

Hey :),
This post is a little bit related to the previous post.As mentioned before, due to my enrollment in the Open Source Development course at my university,i'm being faced with new challenges every week. Today's challenge is pretty similar to the previous week's dilemma. Am having the hardest time trying to build a certain project on my machine locally. last week i was trying to build the BesPin(here) project,but only disappointment and failure were the result of enormous time and effort spent :S .
However and being totally honest, last week i was a little lost,and didn't quite understand what a "build" of a project meant.
fortunately this week's assignment is also related to "building" the source code of another project,so i didn't really miss the chance to learn what that means and how it could be done. The project is well known for most tech-related people, and also for regular computer users. Mozilla Thunderbird is the project that i tried to build this week .Although i have paid my dues in reading and searching and getting sufficent information before doing it, i didn't get the result is was hoping for :S . During the lab we were introduced to the whole MOZILLA world, where almost every single entity ends with "zilla" :D:D. We were introduced to Mozilla (the whole structure), Bugzilla(reporting Bugs Agent) ,Chatzilla (IRC client) and Thunderbird,on which i am supposed to work for next week's assignment.
The major problem that faced me while trying to build the project was while checking out....
I followed this tutorial while trying to build,and here is the error that occur

Traceback (most recent call last):
File "client.py", line 403, in
do_cvs_checkout(LDAPCSDK_DIRS, LDAPCSDK_CO_TAG, options.cvsroot, options.cvs, '')
File "client.py", line 257, in do_cvs_checkout
cwd=os.path.join(topsrcdir, checkoutdir, parent))
File "client.py", line 75, in check_call_noisy
check_call(cmd, *args, **kwargs)
File "/usr/lib/python2.6/subprocess.py", line 457, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python2.6/subprocess.py", line 444, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.6/subprocess.py", line 595, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1092, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

I wish anyone who sees this post,would be able to help :)

PS:Unable to build the project,doesn't mean that there is no access to the project code. You can still access it through the MXR for Thunderbird under the following link

Sunday, October 25, 2009

BesPin Setup??????

Looking at the title one may think i didn't formulate a question correctly,... however it IS well formulated indeed =),and the story behind it goes as follows :
In the previuos session of our Open Source development course
Link(click here),we were introduced to a new tool called Bespin.Bespin is an online editor that is mainly used as a build tool for bigger projects.Through the nature of BesPin and being an ONLINE editor,it provides it's users with the ability to interact,share and work on the same code,even though they might be continents far away. Which of course enhances the efficeny of thw work process,and speeds up the whole Software Engineering process. However,Bespin is not as "pink" as it seems to be ... the source code of BesPin is still under heavy development (which eliminates the possibility of working on it as my major project for the open source development course :S ). The source code is rapidly changing and there is no stable version available yet. Due to this major unstability in the source code of the BesPin projct,i faced some abnormal difficulties while trying to set the system up on my local machine :S:S . I followed all possible online tutorials,and even some combinations of those,none of them met success :S . I even wasted nearly half a day (literately 12 hours) trying to set the system up on the machine..but again with no success.
Anyway,enough for now about the current progress in the BesPin project....and who knows,maybe after today's class some positive changes to the progress might be posted on this very same blog :D!!!
Link

Monday, October 19, 2009

Ubiquity:Check your score and rank !!! :)

My first Ubiquity command :D .... and my first REAL open source experience.
Today i submitted my firt ubiquity command,in a nutshell the command allows the user to view his/her score and rank among the G-OSC community. The brialliance of ubiquity in being able to do things "on the air" or "on the fly" is emphasized in the usage of the command.There is no need for the user to open the wiki and navigate through it, he/she can simply check thier rank and status while surfing on any other page :)
I liked the idea of being able to come up with some new and innovative features,being enrolled in a community where all participants are involved within the same problems and thier solutions and finally being able to APPLY it on a real world example. :)

here is the link for the command,hope you will like it :)
link: http://se.bigbuddysociety.net/wiki/index.php?title=G-osc_ubiquity_commands#g-osc-check-scores


Screen shot of G-osc-check-scores

Sunday, October 18, 2009

My first open source experiment :)!!

Hey,..
i know it has been short since i last posted... (2 mins ago :D:D )
but i just had my first open source experience :D !!!
well i was expecting it would be a code-sharing sort of experience,but apparently this open-source world can be expanded to more than that :).
Sharing is not only restricted on code and programming sharing( as i had in mind first before actually being involved in it) it could be rather be expanded to include in general KNOWLEDGE sharing... which honestly amazes me,how people could be beneficial to each other :)!!!!
Enough talking,... here is the link if anyone is interested to have a look on the "problem" i posted the solution for,it is a rookie mistake actually not a problem :)

the link:http://getsatisfaction.com/mozilla/topics/control_space_doesnt_trigger_the_ubiquity_command_window_to_pop_up

hope it's useful to u all :)