Tuesday, February 23, 2010

processing-js near release 0.1

For the last few days I tried to test my processing-js code however I couldn't push the code into my repos. The last steps in the instructions gave me an headache. I kept getting permission denied:

$git push origin master
permission denied .
fatal: the remote hung up unexpectedly.

I tried many times, still didn't work. May be I need to create very public key for each repos I have.

So I did tried to generate another key but I still got permission denied message. Well may be I need to dig deeper inside the documents.

Wednesday, February 17, 2010

Processing.js

In my Open Source Development 600 course, I was assigned to work on the bugs 41284 for on Processing.js (tickets 270 -275) which were implementation of simple string functions. I needed to review my javascript which I took in first year and learned the prof. programming style. Here were my code for the first release 0.1.

Convert all characters of a string into a upper case and return the string:

function stringToUpperCase(string str)
{
var strUpperCase = str.touppercase();
return strUpperCase;
}

Or convert all characters of a string to lower case and return the string:

function stringToLowerCase(string str)
{
var strLowerCase = str.tolowercase();
return strLowerCase;
}

To find part of string using substring:


function StringSubstring(string str, int beginIndex, int endIndex)
{
var stringSub;
if(endIndex >0)
stringSub = str.substring(int beginIndex, int endIndex);
else
stringSub = str.substring(int beginIndex)

return stringSub;
}


To find total characters in a string

function strLength(string str){
return str.length();
}


Find a substring within a string and return the first occurrence otherwise return -1

function stringIndexOf(string str, string subStr){
int p1 = str.indexIf(subStr);
if(p1==-1)
return -1;
else
return p1;
}


Get a character in a string at a specific index


function stringCharAt(string str, int strIndex){
if(strIndex > -1 && strIndex < c1 =" str.charAt(strIndex);" href="https://processing-js.lighthouseapp.com/projects/41284/project-workflow">repos and got a public key. Now I need to add my new js file to the branches and test them.

Monday, February 8, 2010

Building Firefox

This is my first experience of building Firefox on a local machine. I followed the This simple Firefox build. I downloaded MozillaBuild and installed it on my laptop. My laptop is 32 bit Windows 7. I got VS2008 and SDK v6.0A installed. Everything was checked. So I ran the command c:\mozilla-build\start-msvc8.bat and cloned the repository from the server. However I ran into a problem.




After a few tries, it still failed. So I googled it and found out that my Avira antivirus cause the problem. I disabled it and my firewall. Finally, it completed the clone about 2 hours on my wireless connection.



I notice that it copied to c:/mozilla-central/mozilla-central. This could be part of the repos already copied to my hard drive when the connection dropped. And it prevented me from copying to the same directory. This was my mozconfig.

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ojbdir-ff-release
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-debug
ac_add_options --enable-debug
ac_add_options --disable-optimize
ac_add_options --with-windows-version=502


For some reason the compiler did not like SDK 6.0A, because I did not update my VS2008 to sp1. So I try the quick fix and set --with-windows-version=502 to save some time. Then I ran make -f client.mk command.




Finally I got FireFox build on my laptop.
So What I learned so far about building Firefox?
- make sure all requisites installed before the clone (this could save a lot of time and headache latter).
- disable firewall and antivirus
- use wire connection instead of wireless connection.