Planet CDOT

February 09, 2010


Andor Salga (asalga)

Double Compiling My Web IDE



I’ve started a primitive Web IDE based on the one found at the Processing.js site. I started this mainly as a demo, but found it useful to quickly test new functions, like adding WebGL functionality to the library. The problem I have now is getting the canvas to reload the first, not tenth time the user wants to reload the sketch source ‘into’ canvas. What ends up happening is a number of 3D contexts are created before the script decides to load the updated one. This effectively slows down rendering like crazy. I might have to take another look at the one implemented on the Processing.js site and see how they are using jQuery. I also have some concerns as to how all this will work with WebGL. But making it actually work would be sweet.

Filed under: Open Source, Processing.js, WebGL

by asalga at February 09, 2010 11:24 PM


Konstantin Novichikhin

DXR – Getting Started – Initial Project Plan


I covered a little about DXR in my earlier post.

So what is that exactly I’m going to do? I’m going to make DXR to recognize platform specific source code. For example, when a function is clicked, DXR should show whether it’s Mac, Windows, or Linux (or all three) specific code.

Release 0.1

First of all, I need to know how DXR builds its database. So far I only know that DXR is essentially a script that runs while Firefox is being built. And since DXR is available on Linux only, I will have to have Mac, Windows, and Linux Firefox builds on a Linux machine. Then I’m going to hack DXR to see how it’s doing what it’s doing with Linux Firefox build.

hacker - someone who makes furniture with an axe

So far I have the following:

  1. Make a Linux Firefox build on Linux
  2. Make a Mac Firefox build on Linux
  3. Make a Windows Firefox build on Linux using Wine
  4. Find out how DXR works with a Linux Firefox build
  5. (maybe) Create MXR for DXR

Release 0.2

“First, solve the problem. Then, write the code.”
—John Johnson

I’m going to find out how to get and merge information from multiple Firefox builds by DXR. I’m going to have to decide on how to approach data collection based on current DXR model.

For bullet points fans such as myself:

  1. Get Mac specific data from Mac build
  2. Get Windows specific data from Windows build
  3. Modify the way DXR gets data from Linux build to mark Linux specific data
  4. Merge all data from Linux, Mac, and Windows builds in DXR database

Release 0.3

“Design is not just what it looks like and feels like. Design is how it works.”
—Steve Jobs

I’m also going to have to answer several design questions:

What if only a single line is OS specific (i.e. a macro), what if a variable?

What if the same code is common to Mac and Linux, but not Windows?

What controls do I have to add to the user interface?

Toggles, such as “Show Mac Code”, “Show Win Code”, “Show Lin Code”, “Show All”?

Or simply labels and/or possibly icons?

It’s too early to answer these questions, however.

Bullet points:

  1. Populate data in the user interface
  2. Test and fix outstanding bugs

This is an initial plan of what I’m going to do. I’m sure some of it is not going to work the way I expect. And some, if not all, is going to change.

A “haiku”:
I’m totally lost
I have no idea where to start
Do not give up

by Konstantin.Novichikhin at February 09, 2010 09:01 PM


Christopher Cheung

screen cleared

After many trials and tribulations, I've gotten my part in the project to work on all the platforms.
Also Made a simple batch file to quickly compile with BCC32 straight from my VCC workspace directory. It's in my SVN workspace named 'bcc.bat' if any team member care to try it. It's very crude, but does the job for now.
It assumes you installed Borland in default installation directory. If not just change the 'set path=%path%;' and 'set tempo=' accordingly. Run straight from where you have all your VCC files. If successful it will produce the .exe in that same directory.

Comments

February 09, 2010 08:29 PM


Paul Whalen

Creating a Snort Package for use with Fedora 12 (default spec file)


First we need to create a packaging environment. I downloaded rpm-build, rpmdevtools, rpmlint using the ‘yum’ command. Then used the “rpmdev-setuptree” command to set up the packaging environment which created a new folder in my working directory called ‘rpmbuild’ which contained the folders ‘BUILD’ ,  ‘RPMS ‘ , ‘SOURCES’ ,  ‘SPECS’ and  ‘SRPMS’. Then using the command ‘yumdownloader –source snort’ I downloaded ’snort-2.8.5.1-1.fc12.src.rpm’,  the source package for Snort. I then ran the command ‘rpm -i snort-2.8.5.1-1.fc12.src.rpm’.

Moving to the rpmbuild directory I now find in the ‘SOURCES’ folder the files ’snort-2.8.5.1.tar.gz’, ‘ snortd’ and ‘ sysconfig.snort’. And in the  SPEC folder there is now a file ’snort.spec’.

Now to rebuild. I ran the command ‘rpmbuild –rebuild snort-2.8.5.1-1.fc12.src.rpm’ but received ‘Failed build dependencies’ errors with a list of packages. Installing the needed packages I ran the command again and this time was successful. The default spec file creates 10 different rpms and include snort compiled with different configuration options.

Next I will be creating my own Snort spec file and posting the results.

by paulfedora at February 09, 2010 02:17 PM


Crystal de Nobrega (cldenobrega)

Building Firefox


I disappeared last week. I was taking a 5 hour nap on Tuesday, when I should have been in class. Guess I shouldn’t do that again – I missed Dave’s class on compiling Firefox.

Wednesday I was back in school. I spent a few hours in TEL’s Open Lab, downloading all the the tools I would need to build Firefox later that night. I needed to have it built (or try to have it built) for Thursday’s class.

I used this task as an excuse to take over my mom’s new laptop >=]

The list of goodies I secured from the TEL lab and the order I installed them:

0 – Alcohol52% Free Edition – I use a virtual drive to install all of my .iso files. I love the name and it’s wonderful.

1 – Visual Studio 2005 Pro – decided to go with ‘05 because it was marked by Mozilla as ‘official‘. Seneca students can download it (2 .iso files) from ACS

2 – VS05 Team Suite Service Pack 1

3 – Microsoft Hotfix – cures a linking problem

4 – Windows 7 SDK – went with the .iso download so I could use Alcohol52% again. I didn’t know which one to choose, so I tried the first one: x86. It didn’t work right off the bat, so I downloaded AMD64. It worked perfectly. <3 Download takes 20 minutes per .iso in TEL's Open Lab.

5 – Mozillabuild <– that links right to the mozillabuild download

This is as far as I got before Thursday’s class. I started installing the files Wednesday night, fell asleep during the VS05 disk 1 install, and again during the Windows 7 SDK install. I finished installing Mozillabuild right before I left for class.

Monday, I finally got back to the Firefox build. I followed MDC’s ‘Simple Firefox build‘ page

run:
c:\mozilla-build\start-msvc8.bat

and a lovely window appears. Ensure your path doesn’t have any spaces in its name:
cd /c

get source code:
hg clone http://hg.mozilla.org/mozilla-central/

got an error:
requesting all changes
adding changesets
adding manifests
transaction abort!
rollback completed
abort: connection ended unexpectedly

Google: 5 seconds later I was at Konstantin’s blog. Apparently I needed to grab a LAN cable. But I was cozy in my room, on wi-fi. So I ran the command again:
hg clone http://hg.mozilla.org/mozilla-central/

and again:
hg clone http://hg.mozilla.org/mozilla-central/

and again:
hg clone http://hg.mozilla.org/mozilla-central/

I was about to search for the LAN cable when that 4th time succeeded. I am delighted.

continue:
cd mozilla-central

create the mozconfig file, I’m going with the debug build (1.5GB larger than the release build):
echo '. $topsrcdir/browser/config/mozconfig' > mozconfig
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-debug' >> mozconfig
echo 'ac_Add_options --enable-debug' >> mozconfig
echo 'ac_add_options --disable-optimize' >> mozconfig

build:
make -f client.mk

I don’t know how long the build took. I went off for 40 mins to go eat, came back, and realized the laptop had gone to sleep …. karma?

When the build did finish, this line didn’t work:
objdir-ff-release/dist/bin/firefox

I thought firefox.exe wasn’t created. Turns out my directory was named objdir-ff-debug, not objdir-ff-release. Before I realized that, I had gone to Google, thinking there was a problem with my build.

I found a blog post by Simon Jung. His post is excellent – and very detailed. He wrote a note on Minefield:

If there is a current Firefox session running, Minefield will open another window, it won’t actually run Minefield.

After I fixed my path:
objdir-ff-debug/dist/bin/firefox

A window popped up – and looked exactly like the Firefox/google search home-page-thingy. It even had the Firefox icon. How suspicious. Turns out I had minimized my Firefox window so it was still running when I ran Minefield. I remembered what Simon Jung had posted, closed the Firefox windows and tried again. This time:

Minefield
The page was huge, so I tried ‘Ctrl + -’ to shrink it …. and I broke it already.

by Crystal at February 09, 2010 09:14 AM


Daniel Hodgin

0.6 The plan to implement PImage into processing.js


Now that 0.5 is pushed up and under review I’ve turned to re-planning my 0.6 release to include PImage.

Originally blocked because of plans to implement asynchronous image loading I brought up the fact that PImage was about 75% completed and there was a large chunk of code that was being held back by it being blocked by the async idea.  So I’ve been tasked with the responsibility of bringing PImage back into the code along with all its methods.

The great thing about PImage code is it has methods for copy, blend, filter, mask, get, set, loadpixel, updatepixel.  All of which are methods for the language as well and some of which are already implemented in a basic or completed form.

Hopefully since I have already worked on PImage code a while back I should be able to relatively quickly (read 2-3 days of work) be able to get it in and start testing it.

The wrench in the works

Apparently PGraphics is something that is currently holding back 3D development past 0.6 so it’s been mentioned that PGraphics should be implemented first before PImage.  Although I am not sure why as in the java code a PGraphics object extends a PImage object so I’m not sure why a PImage wouldn’t come first singe a PGraphics inherits variables from PImage.

The goal is to find out this Thursday on the conference call.

More to come

by dhodgin at February 09, 2010 04:13 AM


James Boston

Use dangerous colours

Nearly every computer instructor in every web programming course I've taken has drummed the importance of web safe colours into his students. It's a requirement. Pages must be xhtml compliant. The css must validate. And the colours must be web safe.

If your web pages are served by a time machine, that's a good strategy. According to w3schools, web safe colours are outdated:

Some years ago, when computers supported max 256 different colors, a list of 216 "Web Safe Colors" was suggested as a Web standard, reserving 40 fixed system colors.

The 216 cross-browser color palette was created to ensure that all computers would display the colors correctly when running a 256 color palette.

This is not important now, since most computers can display millions of different colors.
— (http://www.w3schools.com/html/html_colors.asp)

By most computers, I think they mean all. Desktops, laptops, netbooks, mobile phones. They all have displays that show millions of colours. There is a bit of funny business around how various operating systems and web browsers implement ICC profiles to ensure that colours are rendered the same everywhere. But so-called web safe colours will not give you any advantage unless your readers use Mosaic. There's no longer a reason to use the eye-stabbing ugliness of web safe colours.

Webmonkey put web safe colours on it's list of 8 Things on the Web We’d Like to Throw Down a Black Hole. They woke web safe colour #99ff33 at dawn and shot it:

Known colloquially as “Acid Green,” this color was once near and dear to our hearts. It was part of the original Hotwired brand’s color scheme, showing up as an accent color in older designs of Wired News and Webmonkey, and even playing a primary role in the design of Wired’s old search engine, HotBot.

But you know what? The web-safe color palette is dead. We’ve moved on to more pleasant tones that don’t remind us of 1998 — or the morning after that party where we mistakenly downed about 16 Midori Sours.

It's time to move on.

by James at February 09, 2010 03:30 AM


Gamal Tawaf

String Vs Charecters

I had a code thet used " " to display a single space but it gave me a crazy answer like it showed <. I didn't know what to do so I asked freind
this is the code : http://pastebin.ca/1790805
this is why it showed < :
well i see one problem
you probably want to use ' ' not " "
" " is for a string and will add a null byte to the end...i dont know if that could be causing the problem or not
it should be ' ' not " "
" " is for strings, ' ' is for characters
so I know now what was my problem and my code is
working nicely now thanks tdot

by Gamal Tawaf (noreply@blogger.com) at February 09, 2010 01:44 AM


David Horn

IRC meeting

So far in the past few weeks, I have joined team Code Junkies for my OOP344 project. We had our first meeting last week, and learned about the rules and standards of irc chat. We were also told that if we wanted to post code on irc, we shouldn't paste it directly onto the chat but rather to copy the code onto paste bin and then paste the url. Also if the url is too long we were suppose to tiny url. That was pretty much what we learned in our first meeting. Here's the chat log to our meeting, if any of my group members missed it.

by David (noreply@blogger.com) at February 09, 2010 01:34 AM


Scott Downe

There and back again, and regular expressions are hardcore

So, I've been thinking about my solution to bug #226, and at one point, I changed my mind on my solution, of masking all strings, and later replacing them based on <STRING n>. I thought of a few possible bugs, mostly the odd chance someone enters <STRING 7> (for example) as a string, and that would be a problem, because the parser would put <STRING 7> into it's array, and mask it with the appropriate mask, then later replace the string, but if it happens to contain a string of a string that has yet to be replaced, the parser would then find that string, replace it. Hmm, hard to explain, but I decided the only solution would be to only replace <STRING n> later, when all the code is replaced, if the <STRING n> is NOT inside a string, and that was kinda what I wanted to avoid in the first place.

So, I figured I should re consider checking all parser regexs to not parse while in a string, like I have to do while replacing <STRING n> with the appropriate strings. The advantage of doing the later, is I don't have to worry about keeping an array of all strings, which might get quite large, but only has to be done once for each time the code is parsed, I believe, which isn't too bad, but not optimal.

I thought more about it (this was while taking my 2 hour bus ride home) and decided against it, so I was back to my original solution. My reasoning: KISS. The original method might not be the fastest, but it's simple, you do it once, and it's done. The other way, might be faster (marginal) and it's situational, but it's a debugging nightmare. Each time someone adds something to the parser, they must remember to check to make sure it's not in a string. I only need to check to make sure it's not in a string once, and no one else has to ever worry about my code, also making it more modular.

The other thing I've been working on: really tweaking the regex for checking for strings. It's not apparent, there were a lot of things I was not considering, and I've been changing and testing various solutions, and right now, this is how it looks.

/(["'])([^"'\\]|\\.)*(\1)/g

Before, I was being greeeedy, things like this test, would muck it all up.

text("Hello World!" + (4 + 5) + "Hello World",50,i+=15);

Now, it was being printed off fine in this case, but any processing that was between the two strings, would NOT get parsed, so I changed it to a non greedy string, and added a few more touches, like using ['"] instead of ('|"), which are pretty much the same, but to me, the first one is simpler, and using back reference on the string type, just because I think it's cleaner that way. Anyway, all for today.

by Scott (noreply@blogger.com) at February 09, 2010 12:40 AM

February 08, 2010


Jeffrey Lee

Building SeaMonkey


Building SeaMonkey was a task I kept putting off but really didn't take that long considering the previous courses I have taken has me install the prerequisites for this task.

The first thing i had to do was install Mercurial
http://mercurial.selenic.com/wiki/

And download the SeaMonkey code off comm-central
http://hg.mozilla.org/releases/comm-1.9.1/

I used the command to download and send the code to a the folder called src
hg clone http://hg.mozilla.org/releases/comm-1.9.1/file/c5c64590370a src
python client.py checkout

After downloading it i created the .mozconfig file.

ac_add_options --enable-application=suite
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-sm-release
mk_add_options MOZ_MAKE_FLAGS="-j4"


And tried to compile the source code. The problem i ran into was that i could not compile the code if the path to the code had spaces. What took me awhile to realize was the code downloaded from comm-central to my documents and setttings, and i couldn't rename that. I cut and paste the code else where which took 20 mintues, a lot files.

After figure that out i used the command
make -f client.mk

After and hour of compiling i was rewarded with no errors and a clean launch of SeaMonkey

by Jeff (noreply@blogger.com) at February 08, 2010 09:55 PM


Sergey Aleinikov

Multi-dimensional arrays.

Today in class we talked more in-depth about arrays, specifically on multi-diminsional arrays.
Our teacher gave us a more accurate explanation about how multi-diminsional arrays look like in the memory. Unlike we've been taught that m-d arrays are stored in a net-like memory block, m-d arrays are the same as regular arrays, except that instead of being a large array that would (for example) hold ten cells (variables), the array would be split into two or more arrays (holding 5 cells each or less). So in reality when have:
int array[4] [4];
and we try to access the second cell of the second array by:
array[1] [1];
what we are actually doing is:
array [0] [5];
or:
array[5]; if we had this as a single array.
In other words - the first number in [] brackets signifies how many cells to jump when array is specified.
This would also mean that - if we were to print the address of array[0][0] and then print the address of array[1][0] - the difference in address would not be 4 (considering it is an int), but 16, since it will jump 4 blocks of cells of four.

Comments

by seal13 at February 08, 2010 08:53 PM


Kai Xu

Some IRC Commands

syntax:

[] option
# any number.
message any text.
channel a name of a channel, starting with # or & (=local channel).
nick a nickname as used on IRC.


/admin [server] returns the name of the administrator of the given server.
/away message marks you as being away. Typing /away again removes the away status
/ban nick bans 'nick' from the current channel
/bye message displays 'message' and quits IRC
/broadcast message sends a message to all the channels you are on
/channel channel [passwd] join a channel [with password]
/cmdchar c changes the command-prefix (default /) to the given character
/cping nick shows response time for 'nick' in seconds
/ctcp nick command
/ctcp channel command
issues a CTCP (client to client protocol) command. CTCPs are used to get information from other clients, or to trigger certain actions on other clients. CTCPs /ctcp nick clientinfo for more info.
/ctcp nick sound sndname plays the sound 'sndname' at 'nick's computer. Shortcut: '/sound nick' and select a sound file.
/ctcp nick sound displays the list of available sounds on 'nick's computer
/ctcp nick xdcc list displays the list of available files on 'nick's computer
/ctcp nick xdcc version shows the xdcc version (currently 1.0)
/ctcp nick xdcc send # asks 'nick' to send file number # to your computer
/ctcp channel action Sends an action description. See also: /me. Example: '/me is drinking coffee' will be displayed as '* Yournick is drinking coffee' in the channel.
/ctcp nick finger shows the idle time and/or email address of a user
/ctcp nick source shows where to obtain Ircle.
/ctcp nick version shows the (Ircle) version.
/ctcp nick clientinfo shows all ctcp commands of a client.
/ctcp nick userinfo displays the userinfo field of a user.
/ctcp nick face exist shows if a user has a face file
/ctcp nick time shows the local time of a user.
/ctcp nick video stream opens a video window from the target to you.
/date display date and time
/dcc command nick issues a DCC command (explained below)
Valid commands for /dcc are:
/dcc chat nick requests CHAT connection for nick or answers such a request.
/dcc send nick send a file
/dcc tsend nick send a text file.
/dcc get receive a file (to be answered to a SEND request).
/dcc tget receive a text file
/dcc list list all DCC connections.
/dcc sendvideo nick sends a video snapshot to a selected nick
/dcc sendvideostream nick sends your video stream to a selected nick
/dcc sendface nick sends your face(s) to a selected nick
/debug shows all low level messages in ircle Console window. use at own risk. unpredictable things may happen. for testing only.
/exit message = /bye
/fserve nick starts a dcc chat/fserve with nick. You will be the host
/ignore pattern ignore messages from nick!user@host (may contain wildcards)
/ignore -pattern removes a pattern from the ignore list (also check your Friends list in your preferences)
/info gives info about server
/invite nick channel invites nick to channel
/ison nick shows if a user is on irc. not implemented on some servers.
/join joins channel last invited to
/join channel [passwd] = /channel
/kick channel nick :msg kicks nick from channel with message, clicking Kick in the userwindow does the same. Option click lets you set a kick message.
/leave channel leave a channel, same as closing a channel window
/links show server connections
/links mask shows all servers matching mask
/list list channels. Note: on some servers you'll get disconnected because of the large amount of data /list generates. You may use wildcards in the List window. Example: *mac*
/list -min # list only channels with minimum of # users
/list -max # list only channels with maximum of # users
/list -public list only public channels
/list -private list only private channels
/list -local list only local channels (channels available on this server only)
/list -global list only global channels (channels available on all servers of this network)
/list -topic list only channels with topic set
/list -mask- list only channels matching 'mask', for instance /list -*mac*
/lusers display statistics: the number of users on this irc network and the
number of channels.
/map displays a map of all server connections (not supported on all networks)
/massop gives operator status to everyone on a channel
/massdeop removes operator status from everyone but you on a channel
/massunban removes all bans from a channel
/me action sends an action description, can also be used in a DCC Chat window (private action). shortcut: Option Return Key.
/mode channel parm set channel mode:
/mode channel +p private channel
/mode channel +s secret channel
/mode channel +i invite-only channel
/mode channel +m moderated channel, noone can speak except users with mode +v
/mode channel +n no messages from outside channel
/mode channel +t topic may only be set by a channel operators
/mode channel +l # # channel may hold at most # users
/mode channel +v nick nick let nick speak on moderated channel (voice)
/mode channel +b shows ban list. Not implemented on some servers.
/mode channel +b nick!username@hostname ban nick!user@host, wildcards (*,?) allowed
/mode channel +k password key set channel password
/mode channel +o nick nick becomes channel operator
-x removes flag x, where x is one of the above
You can also you the switches in the Userlist window for this.
/mode nick parm set user mode:
/mode nick +i invisible user, recommended to prevent spam. You can also set this mode in the Connections Window
/mode nick +s receive server notices. Normally off. You can also set this mode in the Connections Window
/mode nick +w receive wallops (messages from IRC operators). You can also set this mode in the Connections Window
/mode nick +o become IRC operator. Normally this is done by the /oper command.
/mode nick +d deaf mode, for bots only.
/motd [server] show message-of-the-day [of another irc server]
/msg nick message sends nick a private message. Pressing TAB automatically sets the inputline to /MSG and the nickname that last sent you a message. Ircle remembers up 10 nicks for 15 minutes after the last activity.
/names channel list users on channel
/nick newnick change your nickname
/note unknown
/notice user|channel msg (almost) like /msg
/notify show notify list. You may also use the Notify Window to add/edit/delete nicks.
/notify nick adds nick to notification list (show each signon/off). You may also use the Notify Window to add/edit/delete nicks.
/notify -nick removes nick from notification list. You may also use the Notify Window to add/edit/delete nicks.
/omsg text send a message to all channel operators on a channel. On some servers ircle may send a /wallchops command instead, when available.
/onotice text send a notice to all channel operators on a channel
/op nick gives nick operator status
/deop nick removes operator status from nick
/part channel = /leave
/ping pings a user. to measure the delay use /cping
/quote raw irccommand sends a command to an irc server, exactly as typed.
/query nick open window for private messages to nick
/quit message = /bye
/server hostname [port] switch to a different server
/silence show ignored users list. /silence is a server side ignore. ignores are checked by the server, not the client.
/silence mask ignores users with selected mask
/signoff message = /bye
/sound channel soundname plays soundname to the channel
/sound nick soundname plays soundname to nick
/stats show statistical info:
/stats b shows server ban list
/stats c returns a list of servers which the server may connect to or allow connections from
/stats h returns a list of servers which are either forced to be treated as leaves or allowed to act as hubs
/stats i returns a list of hosts which the server allows a client to connect from
/stats k returns a list of banned username and hostname combinations for that
server
/stats l returns a list of the server connections, showing how long each connection has been established and the traffic over that connection in bytes and messages for each direction
/stats m returns a list of commands supported by the server and the usage count for each if the usage count is non zero
/stats o returns a list of hosts from which normal clients may become
operators
/stats p ?
/stats s ?
/stats t ?
/stats u returns a string showing how long the server has been up
/stats y show Y (Class) lines from the server configuration file
/summon user@host invites user@host to IRC (host must be running a server) obsolete??
/time = /date
/topic channel text set a channel topic (clicking in the title bar of a channel lets you achieve the same)
/trace [user] shows which servers are being used to connect to user
/type type a text file to the current channel
/unban opens the unban dialog, allowing to view and unban hosts with a simple click.
/unban nickmask removes 'mask (nick!username@hostname) from the channel ban list
/users (x)
/version show server version
/video opens your video window
/who channel list people on channel
/whois give information about nick that last joined the channel or sent private message
/whois nick give information about nick
/whowas nick give information about nick no longer online
IRC Operator commands:
/connect target port Force the remote server to try establishing a new server connection to the target server, on the specified port.
/die Used by IRC operators to force the server to exit and cease activity.
/hash reconfigure a server
/host
/kill nick comment The KILL message is used to cause a client-server connection to be closed by the server which has the actual connection. KILL is used by servers when they encounter a duplicate entry in the list of valid nicknames and is used to remove both entries. It is also available to operators.
/oper nick password Used by a normal user to gain operator privileges.
/rehash Used by IRC operators to force the server to re-read its configuration file.
/restart Used by IRC operators to force the server to restart.
/squit server comment Close a server connection.
/uping unknown
/wallops message message to all operators (deprecated)

by Kai (noreply@blogger.com) at February 08, 2010 08:33 PM

Something of first IRC meeting!

IRC is a new thing for me, but in our team first IRC meeting, Fardad talk a lot of IRC - culture. He also give us some rule for IRC meeting.

1. In IRC meetings, chats are much slower than talking.

2.
IRC is a very casual environment, so don't talk like : wassssssup!!!!!!! and don't used bad and impolite words! (Important!)

3. IRC don't support visual contact.

4. You can say some funny things when you meeting, but don't say to much.

5.
If you must say something to someone, use their nick like: nick: you want to say!

6. People with @ in front of their name are moderators

7. If you are to meet few of your team members for a meeting in a chat room, say in #seneca

8. Use pastebin.ca show your code to your friends, and you can use tinyurl.com make your URL short.

IRC is a very good software to communicate with your group, and it easy learn how to use it.




by Kai (noreply@blogger.com) at February 08, 2010 08:23 PM


Zhibin Huang

before release 0.1

I am working on text(val) of processing.js (ticket #213) this morning. The most challenge of that is it should be able to draw immediately right of the last string placed.

About how to do that, M. Lam mentions that it is possible if we draw the new text base on the length of the last string added. And I think it is good for a try.

Follow that clue, I look into the original source code of processing again.

How it work is, it calculate each char by char, and store the final offset plus the start position. When the text(val) is called, it calls text(val,x,y,z) with ending position of the last call instead.

I know how it work, but how to do it in JavaScript? Don't even need to think, I Google JavaScript font width. Then, a page call JavaScript/CSS Font Detector flash into my eyes.

How they do is, they create a span element, put the text into it and get the offsetWidth back.

Now, what I do is, I do the same thing as they do, but after I get the width back, I delete the element.

The result is good. However, there is an error. When the text is getting longer, the bigger offsetWidth than it should be is returned. Anyway, it is not perfect yet. I will come back to this after I finish the text(val,xl,yl,x2,y2).

the code is available on here.

by Benjamin Huang (noreply@blogger.com) at February 08, 2010 06:53 PM


Kai Xu

How to create a new project on Visual Studio 2008

1. Open your Visual Studio 2008 and from the File menu, select New > Project
You will see a "New Project" window !

2. Select Project Type as Visual C++ > Win32
3. Select template Win32 Console Application
4. Give a project name and a location
5. Uncheck the box "Create directory for solution", then select OK.


You will see "Win32 Application Wizard - New Project"
6. Click on Application Settings
7. Make Sure Application type of Console application was selected
8. Check the box beside Empty project

by Kai (noreply@blogger.com) at February 08, 2010 06:11 PM


Dan Ventura

OOP344 - fardad, i accept your putint() challenge!

this function was harder than i expected. In order to convert a number to a character, all you have to do is add 48 (this is because 0 on the ascii table is 48, 1 is 49, etc.). So as long as you are sending the putint function a 1 digit number, this will work. However, for the keys that are 4 digits long (i.e: RIGHT_KEY = 1077), it gets a little more complicated.

This took me a while to figure out and i must say, it's genius :). First what you have to do is: seperate the digits. This is where being good with numbers really helps.
(i'm not going to write code, instead I'll give you a mathematical view point)

if you divide a number by 10, the decimal moves one point to the left:
1077 / 10 = 107.7
In order to get the decimal point i used a float, however that caused problems because float are never exact. So, i made two temporary int variables and did this:

1. temp = 1077 <- this is the integer being sent to the function
temp / 10 = 107 <- integers truncate decimal points
temp * 10 = 1070
2. temp2 = 1077 - temp
= 7
Hooray, i got the first digit separated. Now, just do char = temp2 + 48; and your first digit is successfully converted. Repeat this process for x amount of times and your string contains a 4 digit number. BUT WAIT, how do i determine x? dividing by 10 again.
make a while loop where you divide temp by 10 while temp > 0 and do an i++ to get how many digits are in the number. you can now use i for a for loop.

There you have it, a putint function that converts an integer into a string without using extra libraries (there is no atoi() or sprintf()).

by Dan Ventura (noreply@blogger.com) at February 08, 2010 05:26 PM


shun yao zhang

Integer Array

a[5][4][3][2][1]
the pointer for this array ..in step is.
*(a[5][4][3][2]+1)
*(*(a[5][4][3]+2)+1)
*(*(*(a[5][4]+3)+2)+1)
*(*(*(*(a[5]+4)+3)+2)+1)
*(*(*(*(*(a+5)+4)+3)+2)+1)

by shun yao zhang (noreply@blogger.com) at February 08, 2010 04:39 PM


Andor Salga (asalga)

Release 0.5


This marks my 0.5 release for my open source class at Seneca College. I’m collaborating with a few of students from the class to port over Processing to Processing.js which is a JavaScript implementation of the language. Three of us are working with WebGL to kick-start the 3D functions. This blog details some of the things I’ve been up to for this release.

The Plan

blog post , plan details
While we had all done different pieces of 3D separately for a prior release, it was difficult to merge the code. This why we needed to take a step back and create a plan. This was difficult to write as it involved trying to assess all the 3D dependencies and delegate a decent amount of work. I think I succeeded in figuring out which code relies on other code, but I didn’t assign the right amount of work. I’m not sure why I was so off the mark, but I’m glad my professor Dave pointed out that it was likely not enough. It also became quite clear early on when I was very much ahead of schedule.

Git

Something I needed to re-learn for this release was Git. I wrote a blog post about how I came to terms with this tool. I’m now having a lot of fun using it, but it was challenging to get going. I essentially had to sit down for the day to learn the basics by watching video tutorials, reading and experimenting. After starting with a fresh outlook, I managed to turn something I despised to something with which I’m becoming obsessed. I guess that’s a good thing.

3D Helper Functions

uniformi: ticket
uniformf: ticket
uniformMatrix: ticket
vertexAttribPointer: ticket
I knew a few helper functions would be useful to me in box(), and also useful to others once the code is committed. So I wrapped WebGL functions and named them uniformf, uniformi, uniformMatrix and vertexAttribPointer. I already had the code in C3DL, so I copied it, reformatted it, removed C3DL specific code, and formatted it for Processing.js.

PMatrix3D

Ticket
My progress suffered a lot because I had to rewrite parts of this huge class. We already had a student write it, but we didn’t have a test, which meant I needed to write those. This was not in the least bit fun, but very necessary. I also had to make a few changes to the class. It was within the Processing scope, which had to be changed. I had trouble getting some functions to work, such as mult(), so I had to rewrite those. This class took a considerable amount of time to rewrite and test, but now that it’s going into the repository, it will be available for others to update, modify, fix, optimize, etc.

Box Outlines

Ticket
Sometime during all this coding, I needed to take a break. I thought it would be fun to figure out the vertices needed to render the outline of a cube. We already had the vertices for the solid cube exported from Blender, but drawing those with the lines mode does not render a proper outline. We needed to get a different set of vertices when drawing with lines. I knew opening Blender and playing around with it would probably take longer than doing it by hand. So I found my Rubik’s cube and imagined it at the origin of a 3D coordinate system. I then plotted out all the vertices manually. To make things easy I decided to work with 1’s. I imagined each corner’s respective x,y and z components were 1 unit away from the origin. Once I had an array of -1 and 1’s, I did a search and replace and replaced them all with 0.5’s to make a unit cube. I then fed them into WebGL’s drawArrays() using the lines drawing mode. Box outlines done! This was a fun exercise and also valuable to the next student who decides to pick up strokeWeight(), noFill() and stroke() since they’ll be looking at this code.

Box

ticket
This was probably the most fun and frustrating piece of code I had to write. We already had the code, but needed to tie it together with variables which the camera() function was setting. I started from scratch, dug through the Processing code and slowly pieced together a function which seems to now work. It was absolutely essential to get this properly working since it would allow other students to work with the rest of the 3D functions.

Size

ticket
This was a small change, I just had to update the code so the script was acquiring a context by passing in ‘experimental-webgl’.

IDE 3D DEMO


It’s been a while since I wrote a demo, so I wanted to write one for this release. I knew we would have camera, perspective and box code working, so I imagined I could have some controls on a page which allow the user to transform a box. I then realized there’s no better way to test and demonstrate box() than to just let the user write the Pjs code! But to do anything interesting, I had to implement rotateX(), rotateY(), rotateZ() and translate(). This took some time as I had to ‘trace’ through the Processing code and figure out what it was doing when those functions were called. I started with hardcoded lines in box() for the transformations and eventually all those lines were stripped out and replaced with calls to rotate and translate in the Pjs script. It took a while, but it wasn’t just necessary for this demo. I was testing to make sure everyone’s code in the future (0.6) would actually work.

Once I finished that, I started working on the actual demo. I had no idea how long it would take to get it to work ‘dynamically’, so I was hesitant, but I tried anyway. I analyzed the Web IDE on the Processing.js web site and wrote my own, very similar page. The page is still a bit buggy, but it mostly works. It also serves as a great way to let the user compare between Processing and Processing.js sketches.

While writing the Web IDE demo, I ran into an interesting bug. I had the page setup with the textarea, the 3D context was acquired, background filled, but no box. I opened the error console and found an obscure exception. I wondered why this was happening. I came up with all sorts of crazy ideas, but nothing made sense, so I ran a search. I was incredibly surprised to find THIS. Well, well, well. Very interesting. This a bug I filed, and I’m sure glad I filed it too. This bug led me to believe there was something funky with the size() call in Pjs and the HTML canvas width and height. I knew this because I get that exception when the dimensions in size() and the canvas dimensions differ. After a bit of thinking I decided to remove the canvas width and height from the inline CSS and replace it with regular attributes, and yes it worked. That was like time travel debugging.

Wiki Update

I also update my wiki page which includes tickets for all the things I’ve been working on.

Filed under: Open Source, Processing.js, WebGL

by asalga at February 08, 2010 03:30 PM


David Seifried

OOP344 Assign 1 so far

Well its been a while since I blogged and figured I may aswell drop a couple lines on my progress through assignment one thus far.

As it stands, I havnt heard much from my team other then Carolyn who I discussed the project with briefly before the weekend. I dont know where everyone else is on there functions, or what functions there even doing for that matter. I hope everythings going well...

As far as my part is concerned it went off without a hitch. I completed both the bio_getch(), and bio_move() simple functions. Didnt take much as the code was supplied by the teacher, but I made a point of understanding what was going on in each of the functions. As far as complex functions go, I finished bio_display() on my own in probably one of the least efficient ways. But its done! The only minor problem I was having was getting .length() to work with the string being passed to the function. I dont know why, but it wasnt working for me. So I decided to take the long way around the problem and pass it through a while loop with a counter to determine the length of the string each time its passed through the function. Hardly efficient. If anyone reads this and has encountered the same problem/has a solution please let me know!

As I said before I hope my group is doing there parts. As if I find out today no one has done there parts, im going to have to try and pick up the slack tonight. Seeing as our first release is due tomorrow, its something I could really do without. The only other person ive seen commit any code what-so-ever is Carolyn, who put up the files for the program, and finished her simple function (bio_clrscr()). Its nice to see someones done something!

I think im going to attempt to tackle another complex function just incase no ones done anything.

Thats all for now,

dAve

by dseifried (noreply@blogger.com) at February 08, 2010 02:52 PM


Ehren Metcalfe

A static analysis for fallthrough switch cases in C++


For my 0.5 release in DPS911 I’d like to discuss some work on a Treehydra script for detecting fallthrough cases in a switch statement. I’ve actually been working on this off and on for some time, but it’s only been within the last few hours that I’ve arrived at something airtight.

Actually, I began work on such a script quite a while ago, after completing similar work on finding unreachable blocks in the control flow graph. Most of the serious bugs turned up by this analysis were all caused by forgetting the break statement (see bug 536438 and bug 536646) so a warning/error for this seemed natural. Also, I assumed this would be easy: just find all the basic blocks corresponding to the case labels of the switch and, if the successor of a block corresponds to the next case, you’ve got a fallthrough.

To make this more clear, here’s a simple switch statement that falls through:

int foo(int x) {
  switch(x) {
    case 0:
      x++;
    case 1:
      x--;
  }
}

And here’s a -fdump-tree-all printing of the cfg:

;; Function int foo(int) (_Z3fooi)

int foo(int) (x)
{
  # BLOCK 2
  # PRED: ENTRY (fallthru)
  switch (x)
    {
      case 0: goto <L0>;
      case 1: goto <L1>;
      default : goto <L2>;
    }
  # SUCC: 3 4 5

  # BLOCK 3
  # PRED: 2
<L0>:;
  x = x + 1;
  # SUCC: 4 (fallthru)

  # BLOCK 4
  # PRED: 2 3 (fallthru)
<L1>:;
  x = x + -1;
  # SUCC: 5 (fallthru)

  # BLOCK 5
  # PRED: 2 4 (fallthru)
<L2>:;
  return;
  # SUCC: EXIT
}

Notice something funny? There’s now a default case label! GCC will always insert this dummy default by the time you’ve reached the cfg and, even worse, there’s no way to distinguish a switch statement with a real default from one without, once you’ve reached this level. Unfortunately, I spent a great deal of time trying to do just that, at various times thinking I finally had the solution only to discover a new test case that would totally blow apart the analysis. I think I’ve tried maybe a dozen different approaches only to give up in disgust at various points. See here for one totally invalid early attempt.

So what’s the solution? I needed information from two separate passes of the compiler: The cfg, but also the initial c++ ast representation to find out if the default was really a default. To this end, I knew walk_tree would be needed. I was even able to find a bug in Treehydra during some initial experiments. However, as before, once I thought I had the solution, a more complex test case would ruin everything.

Anyway, here’s the finalish script which also employs a fallthrough() function/annotation to suppress the warnings. Once I’ve had a bit of time to sleep on it, I’m going to refactor a bit and then post to the bug. I also need to consider how to integrate this into a –with-static-checking build. There are a number of issues I had to take into account that I haven’t mentioned, as well, such as when the order of the cases is mixed up (eg case 1 before case 0) and also when labels and gotos come into the mix. (Properly dealing with switches embedded within switches … was the last hurdle.)

For a demonstration, here’s a nasty bit of code together with a sample run of the script.

So, for my 0.6 release, I’ll have to get back to dead code, hopefully being able to exploit callgraph to the fullest. Perhaps I can find another analysis to start work on as well.

by ehren at February 08, 2010 07:15 AM


Boris Chao

A Different Approach On BackPorting GCC

Referring to my previous posts on my attempt to backport features from GCC 4.5 to GCC 4.4, I am figuring out another way to overcome some obstacles I encountered.

One of my ways is re-download the GCC 4.4 branch again and patch it. But this time I will copy over the GCC 4.5 Makefile.in and put it in the GCC 4.4 directory.

So to download the branch, I simply followed the steps I did from my previous post using SVN.

This adventure took about 12 mins to complete. After completing the download, I copied over the Makefile.in into the new downloaded directory.


I used the patches I have created from the last time I tried backported. The first run of the patch went smoothly till it tried to patch the Makefile.in. It notified me that the script detected the Makefile.in has already been patched with this patch before and asked me if I wanted to continue.

Because I have no idea what I am doing, I typed in the letter "y" and pressed enter to continue (the default option is [n]) to continue. But I'll keep trucking through till I figure it out, hopefully in my next post I've gone past this phase.

by Boris Chao (noreply@blogger.com) at February 08, 2010 06:37 AM


Matthew Lam

Processing.js - It's a long way to 0.6

“But my heart's right there", or so the song goes. Indeed, it looks like my work is laid out for me. So for this short update, I'll just list what I hope to get done for February 19th (in no particular order):
  • Port normal() (Ticket)
  • Complete porting smooth() and noSmooth() (Ticket)
  • Upgrade char(), float(), str() to accept a multitude of argument types (Ticket)
This will also be the first release where we'll be using automated tests! I wonder if I still have Minefield stashed away somewhere...

by Matthew Lam (noreply@blogger.com) at February 08, 2010 05:21 AM

February 07, 2010


Brian Parreno

Noob at using Xcode for mac

Hello everyone!!!!

Today I was on my mac trying to compile Fardad's program from Feb 1st class to get the keyboard codes in a mac environment. I was first trying to compile the program in terminal. After hours of effort, I can to the agreement that I needed a compiler to get it working. I went on to google and search for a mac base compiler. I found a link to apple's website and discovered a compiler program call 'Xcode'. It's a free download, but I needed to create an account to Apple's Development Program (this happens way to often). After I entered useless information, I was finally downloading the xcode (size:1GB). When the installation was complete, I opened Fardad's program in Xcode and was ready to compile it ......... but I didn't know how :(. I tried writing a "Hello world" program, but still could not get it to compile. So now I asking for help. Does anyone know how to compile in Xcode? Is there another way to compile code without using xcode? Any help will be welcome.

Cheers

Brian P


by Brian P (noreply@blogger.com) at February 07, 2010 08:23 PM


Scott Downe

Yesterday was not the most productive day, I sort of did little bits of work, on and off all day, amongst other things.

I did get something pushed into my repository by following these instructions throughout the day yesterday.

Only two things left to do.

6. Update the LightHouse ticket with your repo information as well as the url's of the tests.
7. Send annasob a pull request using the pull request button.

I've been going through other finished tickets, and looking at the tests they have completed. For example, this test here by Andor Salga is way better than mine, which is a good thing. It's a guide, something for me to shoot for. I've actually noticed a few others using a very similar testing process. Maybe there is a guide on the processing.js lighthouse, and these are the standard tests? This seems like the last step, and there is still a week until release 0.1 is due.

by Scott (noreply@blogger.com) at February 07, 2010 12:48 PM


Matthew Daniels

Thanks for the assist !You Team


It appears that I had just overlooked the header file that was telling the program what platform to run as, once I changed it off on Linux then things seem to compile correctly.

Thanks again

by cdnpadawan at February 07, 2010 01:02 AM


Zhibin Huang

initialize git & detail of release 0.1

Since I have been watching the source code of text for couple days, today, I was working on setting up git on my computer. I installed msysgit on my windows, and cloned the source code from MinyXO. MinyXO's code have implemented the PMatrix3D which I think I am going to need it in the future. As I followed the tutorial (I lost the page but you will see it before you initialize), everything went smoothly until I try to upload my copy from my laptop. It needs to setup a SSH public key to before I upload, and I don't know what is that. Once again, I took a look at the tutorial, and there is a page talking about that.

After the Git has been setup, I reviewed my ticket once again. I couldn't do the 3D stuff before I clearly understand how it works on canvas. Therefore I am focusing on text(val) and text(val,xl,yl,x2,y2).

According to the ticket description and the original processing, there are some point I need to notice.
for text(val):
  • text must be placed to the immediate right of the last string placed using text()
  • doesn't need to wrap

for text(val,xl,yl,x2,y2):
  • wrap the text
  • doesn't need to display the text out of the rectangle.

It seem to be very easy butt think it will take me a while to figure out how to implement :)

by Benjamin Huang (noreply@blogger.com) at February 07, 2010 12:42 AM


Scott Downe

processing.js bug #284 and #226

I've been doing some Processing.js debugging and testing, for tickets #226 and now #284 because of the close relation.

Originally, I did some tests for removing the comment regex, and these were the results source code. The problem is with the comments, the parser is having problems as it's not expecting a comment. I believe parsing out the comments is the easiest solution.

Here is my solution to both tickets. souce and a test.

What I am doing is first, creating an array that contains all the strings.
Then, masking all the strings, this will also grab any strings inside a comment

// Saves all strings into an array
// masks all strings into <STRING n>
// to be replaced with the array strings later
var strings = aCode.match(/("|').*("|')/g);
for ( var i = 0; /("|').*("|')/.test(aCode); i++)
{
aCode = aCode.replace(/("|').*("|')/, "<STRING " + i + ">");
}

Then, I parse away all comments.

// Remove end-of-line comments
aCode = aCode.replace(/\/\/.*\n/g, "\n");

Any strings inside a comment do not matter, and any // inside a string have already been converted to .
I then replace all the strings as the final step.

// replaces all masked strings from <STRING n> to the appropriate string
if (strings != null){
for( var i = 0; l = i < strings.length; i++ ){
var ex = new RegExp("\<STRING " + i + "\>");
aCode = aCode.replace(ex, strings[i]);
}
}

any strings that were removed because of being in a comment, are not replaced, and the program simply skips it.

I'm ready to upload it, and hope I have not missed anything as it's my first time! *fingers crossed*

by Scott (noreply@blogger.com) at February 07, 2010 12:13 AM

February 06, 2010


Boris Chao

Dehydra Package: Reviewing The Fedora Review Guidelines

In order for us to put my dehydra package on the next Fedora Release we need to make sure it passes the Fedora Review Guidelines.

So I went through my SPEC file to see what needs to be fixed or corrected so it can pass the Fedora Review Phase. So far I went through the checklist and I think everything is OK. I did the rpmlint test on all the RPM files, and they all passed with no errors only a couple warnings.

** if any of you have the time, can you please also check my package if it would pass the review board and just make a comment, thanks BoChao :)

[bchao@HongKong SPECS]$ rpmlint dehydra.spec
dehydra.spec:7: W: non-standard-group Applications/Programming
dehydra.spec:32: W: configure-without-libdir-spec
0 packages and 1 specfiles checked; 0 errors, 2 warnings.

Since its 4am in the morning, I don't think Chris Tyler would be awake so I jumped on IRC and joined the #fedora-devel channel on the freenode server.

**You can connect to the irc via web: Link

Here is a snippet of our conversation: IRC Chat


After that conversation, I went back to my spec file and added the comments he suggested.

And Now We have dehydra-0.9-3

Sadly this is not ready to be release to public till I get my other project up and running which is backporting GCC4.5 to 4.4

Here is my updated dehydra spec file

by Boris Chao (noreply@blogger.com) at February 06, 2010 07:36 AM


Daniel Hodgin

0.5 processing.js release contribution


Sat in on this weeks processing.js status call and got a few things sorted out on where to go with the rest of my stuff for release 0.5 and made some plans for 0.6 which was good.

After the status call Anna was nice enough to teach me how to really use Github and how to manage branches, commit new code, and checkout.  It was a HUGE help and as a result I’ve gotten my code fixes for 0.5 up on Github and ready for review.

A quick summary of my 0.5 work.

  1. Rewrote hex() to support all the required functionality.
  2. cleaned up helper functions relating to hex that were no longer needed and exposed to processing code
  3. Rewrote trim() and added recursive support for arrays of strings. or arrays of arrays of strings, etc, etc.
  4. reviewed Andor’s sort(), and binary() functions
  5. Wrote tests for hex(), and trim()
  6. and cleaned up some library code variables that were reserved words, and some duplicate function definitions

I’m preparing to add PImage for 0.6 and its going to be a MASSIVE undertaking. It may span 2 releases to get it all in with proper tests.

by dhodgin at February 06, 2010 05:21 AM


Sadiki Latty

Wireshark building 101

After days of failed builds my wireshark package is complete. Apparently, it was always supposed to be trial and error and that there isn't a real approach to follow. My source rpm Can be found at

Http://Scotland.proximity.on.ca/slatty/wireshark-1.2.5-1.fc12.src.rpm

It also passed the rpmlint test on both the spec file and the binary file without any warnings or errors.

Mock and Koji are next on my list...look out for blog tomorrow

by Sadiki Latty (noreply@blogger.com) at February 06, 2010 04:14 AM


Matthew Daniels

I’m stuck with Visual Studio


Hey everyone, I’m having a problem with getting our Project’s code to run on Visual Studio. I keep getting an error saying that the ncurses.h file cannot be found.

I just recently installed Visual Studio C++ Express onto my netbook (which is running the new Windows 7 in case that makes a difference).

Anyone else have this problem? Or am I just a noob who isn’t using the program correctly…

*/*/*/*/*/*/*/*/*/*/*/
Programmer Humor
*/*/*/*/*/*/*/*/*/*/*/
while (Resistance)
{
Resistance = Futile;
}

by cdnpadawan at February 06, 2010 03:29 AM


Scott Downe

setting up Git and GitHub

Last night I went onto the Processing.js Lighthouse page, to get the instructions on how to push my code. I'm quite new to this, and am following the instructions, and learning what I'm doing while I do it, usually after making a mistake, then I get it right, then I know what it is I was trying to do :). I think that's normal... I hope it's normal... it's normal for me, and works.

Anyway, I went to these instructions on setting up Git and GitHub, and created a new fork of jeresig's repository into my ownfork. I had some difficulty with some of the instructions setting up Git to connect to GitHub, and it was a silly mistake. It ended up being because I was so tired, as after going to bed, I woke up, and everything was so clear and easy. A good thing too, because I could of easily wasted hours on it. What was happening was, when I tried to connect, I would get an error, because my SSH key was not properly set. The key was right, the file location was wrong, as I didn't let the key go into the default location. The key is used to connect my Git command line, to GitHub, which holds my fork, I believe. Ah, so many new terms :). Anyway, I simply generated a new key with the "ssh-keygen -C “youremailinquotes@com” -t rsa" command, this time leaving all requested fields blank. So I believe the first time I tried, my key was right, it was just looking for it in the wrong place. Which is an easy mistake to over look if you over think things. Some say children are better at solving logic puzzles simply because they don't over think things, or they get more sleep :).

Finally, here I am in the morning, 5:00ish, going through my newly cloned source, trying to get that setup. I figured a good place to start would be checking out the READMEs. So I've bee folloing the README instructions in the test folder, and it's been going quite well. I first had to setup a Mozilla build again, like I did on in my last post, which I wanted to do again anyway, as I made some mistakes last time, and I will understand things better the second time though. It's always good to be able to work on one thing, and get two things done. Last time I built Firefox, I used a tarball, as apposed to cloning a new one. The tarball before worked, but it was confusing, this time, it's been smooth.

I am now making a JavaScript shell, to use to for the test code for Processing.js. It is running as I started this post, and it is now done. So I'm off to do the next step.

Two more things I want to improve on.

  • Start putting screen shots into my blog.

  • And post at least two blogs a day, as I didn't get a chance to yesterday.

  • Or one large, detailed post.



Update, with screen shots! I have a working js.exe, and adding the path to my Processing.js makefile. I know this, because I ran a test "make test" on the processing,js file, this was the result.

I am now doing "make test-parser", will come back with updates.

Ok, ran "make test-parser". I won't bother with the screen shot, as it looks a lot like the last one, cept it has 662 passed, 188 failed, and 850 total. I'm excited to run my code from a few days ago through the tests, but I still have a few more steps in the README.

Next step has to do with converting a processing file into JavaScript. It all made sense to me, cept it wants the processing file to be of type pde, not sure what that is, so I'll go check that out now. Here is an article on pde. There is a spot near the bottom of interest to us.
Processing Development Environment (PDE) (Source Code File) by ProcessingThe Processing Development Environment (PDE) consists of a simple text editor for writing code, It is an open source programming language and environment for people who want to program images, animation, and interactions. When programs are run, they open in a new window called the display window. Software written in PDE and also all Processing projects are called sketches. Each sketch is saved in its own folder. The main program file for each sketch has the same name as the folder and is found inside it. For example, if the sketch is named "Sketch123", the folder for the sketch will be called "Sketch123" and the main file will be called "Sketch123.pde". The PDE file extension stands as an acronym for the Processing Development Environment. This association is classified as Source Code.

I noticed some .pde files already in the processing.js test folder, going to play around with them.

I just ran the command "make test/parser/shiffman-test.js", with success. What happened was, it took the file shiffman-test.pde, which is a processing file, and converted it to javascript, using processing.js. It outputted the new code right in the command line, I was expecting a new file to be saved, but that's no big deal, as I just used "make test/parser/shiffman-test.js > shiffman-test.js". easy enough.

Next step is to go through the workflow link, add my code to the local processing.js file, test it, then submit it if everything is good.

It's quite a learning process getting this all setup for the first time, and I find this class to be one of the more challenging classes. Not that it's harder, just that I'm doing more learning, and challenges. I find the solution is usually quite small, it's just getting there. Ah, I should use the word "new challenges" instead of the usual jump-through-the-same-old-hoops challenges. I'm really enjoying editing and working with code, it's more professional, I'm actually starting my career now, as apposed to before, when I was just doing academic assignments. I don't know if any Seneca faculty are reading this that don't already agree with me, but this class, this OSD600 has been the best fit for me, I highly recommend it to any 4th semester students that can get over the hurdle of making a blog *gasp*, but I would not be able to do it if it wasn't for the steps before. It feels like a long process, but to think, just 5 semesters ago, not much more than a year, I knew nothing about programming! Ok, I'm rambling now.

by Scott (noreply@blogger.com) at February 06, 2010 01:40 AM

Update! working tests

At the end my last post, I mentioned how my program was failing tests due to testing old code with my bug fix, with new code, so my tests were off, anyway, I tested my bug fix for bug #226 with up to date code, and these are the results!

as you can see, the results are the same as the original test, which is great. I learned more by not getting it right the first time! Anyway, I have to double check the quality of my code, comment it, keep it in the appropriate style, and go for pushing it to my repository. I believe I need to put together some files for that, some examples, and show some tests. I am confident though. I am also getting down the system used to do this development, so my next few attempts will go much smoother!

by Scott (noreply@blogger.com) at February 06, 2010 01:39 AM


David Humphrey

Writing Automated Tests for Processing.js

I finished up some work today on the Processing.js automated test tools.  Previously I wrote a test harness to allow JavaScript based unit tests, as well as parser tests.  However, after watching some of my students struggle through bugs during the lead up to their 0.5 release, I decided we needed a way to also be able to write them in Processing.  Right now I see a lot of tests being drawn into sketches, and then manually comparing results.  It’s sub-optimal to say the least.

Having written the unit test functions already, I decided to simply load them into Processing via a library.  Processing.js, like Processing, has the capability to load “native” libraries.  In Processing.js, such libraries are JavaScript functions written like so:

(function() {
  Processing.lib.Foo = function() {
    this.something = function() {...};
    ...
  }
})();

Then, in your Processing.js sketch code, you initialize the library by calling its constructor (e.g., Foo();), and then any function (e.g., something();) will be available to your code.

Using this technique I added the same set of _check* functions already available to JavaScript unit tests, such that I’m now able to write small unit tests in Processing like this:

// Tests for Processing str() function - http://processingjs.org/reference/str%28%29
boolean b = false;
byte y = -28;
char c = 'R';
float f = -32.6;
int i = 1024;

_checkEqual('false', str(b));
_checkEqual('-28', str(y));
_checkEqual('R', str(c));
_checkEqual('-32.6', str(f));
_checkEqual('1024', str(i));

I’ve fully documented the setup and use of the new automated testing features. All Processing.js developers (especially my students), should read through this. Beginning with the 0.6 code, we’ll start using this by default for all regression and API testing.

by david.humphrey at February 06, 2010 01:27 AM


Scott Downe

Testing of bug number 226

After an evening and morning of setting up an environment, my curiosity peaked when I was doing the tests on processing.js, so I decided to go back to my friend bug #226, and run that through some tests. This is the result!

Ah, I consider this interesting, compared to the tests on my blog post from this morning. I have to admit, I was disappointed... but it's all part of the process. One of the obvious errors was strings was == null, and I was trying to access it's length property. This was an easy fix, as I just needed to put the for loop into an if checking to see if strings was != null, like so.

if (strings != null)
{
for( var i = 0; l = i < strings.length; i++ ){
var ex = new RegExp("\<STRING " + i + "\>");
aCode = aCode.replace(ex, strings[i]);
}
}

I then re ran the test, and there was progress. Here are the results.

As you can see this is considerable progress from last test, but still down from the original test. So I still have work to do. Now I think I should redirect the results from both tests into a file, and see which errors are new, and start working on them.

Update!!

So, I checked, and a lot of these errors I'm getting is simply because of an old build, so I'm adding all the string updates to the new Processing.js. I'll probably post the results into a new post, though, as too many updates in one post, might make it hard for people to follow my progress.

by Scott (noreply@blogger.com) at February 06, 2010 01:12 AM

February 05, 2010


Roger Dicke

0.5 release


Cool things this release:

Bug 529978 – xpcom analysis Makefile produces error about “.deps” has been tagged for check in!

This is the farthest I’ve gotten with a bug/patch, so even finding out how to do that was something new to me. (Add keyword “checkin-needed” to the bug to have it marked as requested to be checked in.) Apparently a patch such as this one does not require superreview (sr). I noticed this under “What needs super-review?” at http://www.mozilla.org/hacking/reviewers.html, and it was confirmed via IRC on channel #Seneca on the Mozilla IRC server.

Preparing for the next release:

I’ve put the word out (commented on  Bug 494970 – Document Mozilla External String Guide) that I am looking for a bit of guidance for how to better the Mozilla external string guide. 0.6 should be a product of any direction I get out of this.

This release:

The function pointer parameter bug ( Bug 530175 xpcom analysis type-printer.js error with function pointer parameter) has, I believe, been satisfactorily fixed. It has yet to be reviewed however, so anything I may have unwittingly done in the code which isn’t up to the Mozilla standard can still hold it back. That is not a stab, I am glad this is the fact, how else do we learn if not from our mistakes?

New static-analysis docs have been produced with this patch, however they have not officially been uploaded to the MDC. It would be a shame to be so close to finishing them, upload them, then find out a minor tweak has to be done and have to do it all over again!

Initially I had been concentrating on making the output of the functions parameters correct. This was the biggest visible issue at first where raw code was dumped instead of any “reasonable” output. The work I did here was in the typeName() function in xpcom/analysis/type-printer.js. Once I was winding up the work there I noticed some other things which I traced back to a function getShortName(). After a bit of experimentation I changed one function, and because of that I believe that this is where I might get my code denied. I say that only because the original function used (lastIndexOf) was used for some reason. The only reason I can think of for that is if a function name had a ‘(‘ in it. Now I am pretty sure that isn’t allowed, but the decision to use that function over indexOf tells me there must be a reason I am unaware of at this time.

See what this release has done:

As noted in the bug:

Before: https://developer.mozilla.org/User:EndersTruth/nsAString#Compare%28const%20PRUnichar*%2C%20PRInt32%20%28*%29

After: https://developer.mozilla.org/User:EndersTruth/nsAString_%28External%29_example#Compare

See, it even makes the URL nicer!

https://developer.mozilla.org/en/Mozilla_external_string_guide

by enderstruth at February 05, 2010 11:51 PM


Mickael Medel (aSydiK)

Mistakes and new functions


In my previous post, I was doing some tests.  Somehow, be it tiredness or plain out carelessness, I messed up one of my tests and forged ahead on a commit.  Luckily it was caught by Andor, and a bad release was avoided.  Then again, that’s what we have peer-reviews and super-reviews for.  However, I was able to find the problem and fix it… still the same old problem with the variables not updating once a resize is called.  It seems that I forgot to update an important variable.  I also took some time to test for the ortho function (since it was easy to change one line).  I added that update to the repo as well.

As can be seen above, the outputs are the same as what would be done in Processing.  I have also added in the necessary variable names that Andor was looking to use.  I’m still working on the current matrix stack and hopefully can get the testing finished either today or tomorrow.

I adapted PMatrix3D into all the camera functions already as Andor is working on it and should come out with the release at the same time as my functions.  I am a little concerned with how he implemented PMatrix3D though… it’s not an object, unlike PVector.

by aSydiK at February 05, 2010 09:40 PM


Matthew Lam

Processing.js – int() and Release 0.5

int(), the late passenger

A long time ago, in the forest across the river, where fiery leaves danced upon the crisp winds of pseudo-winter (or in other words: back in the 0.2 release) I finished porting boolean(), a function that converted primitive types to either true or false, over to Processing.js (Pjs). As it transpires, boolean() was just one a gaggle of conversion functions, many which continue to seek the company of a code monkey willing to give them a boost over the wall from Java-land into JavaScript-land.

Yesterday evening, at the behest of The Powers That Be, and against the questionable judgement of my lazy self, I tentatively picked up the rest of these converters. And as I told Anna, the recently promoted Fearless Leader, I'd try to get one of them done for 0.5, whose deadline is today. So, without further ado, I present to you int() for Pjs.

Who wants to write the thousand words?

Lo, see now int() in action in Pjs, and compare it to how the same code renders in Processing:



Your eyes do not deceive you: Pjs' int() fails a test. But don't break out the torches and pitchforks just yet! There's a good reason for this. int() may take a byte or an array of bytes as an argument. In Processing, a byte may have a value from -128 to 127, but more importantly: byte is a static type. Through overloading this allows Processing methods, written in Java, to behave differently to accommodate different variable types.

Things are not so simple in JavaScript. In Pjs a Processing byte and int gets converted into a JavaScript 'number'; effectively there is no distinction between a byte and an int in Pjs. Since there's no distinction, int() cannot be tailored to behave differently when it receives bytes. (floats and doubles are different since you can always check if there's a decimal point in there somewhere.) Therefore, the test fails.

A possible solution may be to add a second parameter to int(), a flag called 'isByte' or something. That might be something to bring up in next week's telephone conference.

int() links



A Quick Recap of 0.5
Just for the record, here are the links to the rest of the stuff I did for 0.5:



I'll be making a (hopefully) shorter post soonish outlining what I hope to accomplish for 0.6. But for now, it's time to switch gears and call it a morning.

by Matthew Lam (noreply@blogger.com) at February 05, 2010 11:14 AM


Catherine Leung

Updated Asteroids


As part of prepping for c3dl’s upcoming release I had modified a demo that Peter Callaghan had made into a game.  Its a 3D take on the old asteroids game that is written entirely with JavaScript using webGL (If you want to play it you will need a webGL enabled browser… )  Instead of seeing your ship from top down, you see the space as if you are sitting on ship.  you can rotate around and shoot asteroids that are flying towards you (hit A and D to rotate left or right).  To hit an asteroid click on it.

Here is a screenshot:

My initial game was ok but had a few bugs in it.  I have since cleaned it up and added scoring.  I even added an end game model.  One snag that I really am stuck on has to do with sound.  Firstly I found out how easy it was to add sound using html5 audio tags… I thought it would be alot harder but apparently not.  I added an <audio> tag to my page, and in the js just loaded it and played.  about 5 lines of code in all… however I have hit a few snags and I am not sure why.

Firstly, I couldn’t get the audio to load in Webkit… I thought at first that it was because the format (ogg) was unsupported so I put in a bit of code to load an mp3 instead but that didn’t work either.  I’m going to have to probably play around with a simpler demo first.  I’m trying to find out if it needs to be enabled right now (like webGL) but so far have not found anything about having to enable it.

The other problem I ran into which I really really don’t understand is that on minefield, when I ran my game locally, it had no problem loading the audio file.  It played and didn’t have any trouble.  But when I uploaded my files to make them available to the web the sound broke… this makes no sense to me as to why this would be the case.  So far I have checked these issues:

  • relative path is correct (actually no path…the file is in same folder as html)
  • the permissions are correct
  • the transfer seems fine
  • files are in the directory

I really don’t understand why it should not work from my site while it worked locally.  I have checked it out with firebug and it seems the audio object is created so I’m not quite sure where to check next.  In any case perhaps I’ll take a page from my old school days and sleep on my bug…

by Cathy at February 05, 2010 07:02 AM


Anthony Alves

Hello World

Welcome to my blog, this is my first entry. I've been learning some pretty fascinating things already in OSD600. I'm quite excited to have the opportunity to give back to the open source community that up until now I've only taken from.

I run a Mac with a Windows partition and both Operating Systems contain open source software such as Firefox, Open Office, and ClamWin. I plan on downloading a version of Linux as well as Virtual Box and trying out some of the software discussed in the course.

The movie Revolution OS was a great way to learn the history behind Linux and the GNU Project. It left me with a very positive feeling towards some of the people interviewed in the film. Richard Stillman's philosophy behind software development was admirable. It was great to see someone who sincerely held the benefit of the many before the need of oneself. It was also comforting to see that there is a way to make a living at the same time.

Cathedral and Bazaar by Eric Raymond is a paper that compares the conventional model of software development to that of a cathedral. While the open source is more of a bazaar. The positives I see in the cathedral model is that everything is more organized, work is delegated, which means even the dirty jobs get done. However in the bazaar communication is much more open, ideas flow freely, and everyone can talk to anyone. I also liked the point the paper made about open source products having any number of outlets for support making them strive to be the best. While closed source companies have a monopoly on their product and support and can afford to work at their own pace.

I guess that pretty much wraps up my first post. Thanks for reading, have a great day.

Bye for now,
Anthony

by Anthony Alves (noreply@blogger.com) at February 05, 2010 04:09 AM

Links for days...

Another week has gone by, and I've been exposed to a lot more general knowledge about open source development. The more I learn about it, the more I'm fascinated and want to become a part of it.

I found David Humphrey's talk "Learning to be at the festival" to be particularly motivating. His message is that the open source community is similar to a festival in that it is a tradition that goes on before and after anyone who participates in it. In order to become part of it you must not get bogged down by the fact that you don't entirely understand it. You simply have to decide that you would like to join and go for it, because it will happen with or without you.

After watching this I was motivated to immerse myself in the festival. I registered with the Mozilla Developer Center and Mozilla Wiki. I began browsing and quickly realized one can get lost forever just by clicking links to pages of pages of pages of information. Without anything in particular to look for I continued reading pages that interested me. I learned about different types of add-ons, I also picked up a few useful tips on setting up an extension development environment.

All of this information is a bit overwhelming if you don't have anything real to apply it to. Which is why I look forward to opening up some real source code in the upcoming weeks and reading it..

by Anthony Alves (noreply@blogger.com) at February 05, 2010 04:09 AM

Setting up Bespin Locally

After a long while fiddling with the latest versions of Apache, Python, and Mercurial I've managed to install a local version of Bespin on my machine.

That's as far as I've gotten for now.. When I run it in my browser it loads the Bespin homepage, it says that I'm in 'DEVELOPMENT MODE'. However I can't seem to find a way of getting to the editor without logging into a username, and connecting to their website.

Any tips or suggestions any of you out there may have would be greatly appreciated.

by Anthony Alves (noreply@blogger.com) at February 05, 2010 04:08 AM

Implementing themes for the Bespin

In have chosen to work on the Bespin project this semester, specifically on implementing customizable themes for the editor. I've chosen this feature because it will give me the opportunity to create a component of the UI of what I believe to be a truly unique web application. I have confidence that later versions of this application will be widely used across the web.

Background


Bespin is a Mozilla Labs project to create a web based code editor. It gives developers the power to access their code anywhere through a web browser. Use of the editor promotes collaborative efforts as well as open source development.

My Feature


I plan on adding a feature to Bespin allowing users to change the theme of the editor. The Bespin UI is built using SproutCore components. This open source platform is used for building cloud applications on the web. Cloud applications aim to achieve a rich user experience, in which there is immediate response to user actions such as hovering the mouse over certain areas of the UI without having to click. I understand that SproutCore works with CSS and the interface can be styled accordingly.

Interest has been expressed in modeling the theme editor to resemble that of TextMate's. However, since TextMate is not an open source project it's likely that I will only be mimicking it's appearance. Getting this to work inside a browser is another story. That being said I will be learning a lot of javascript.

Considerations will also have to be made for the fact that Bespin uses syntax highlighting. My plan is to build in functionality that automatically changes the colour of syntax highlighting if the background colour falls within a certain range of that HTML colour code.

0.1


For my 0.1 release I plan on getting a pop-up pane working. It will be triggered by the user clicking an icon. I will also try to add some of the basic aspects of UI customization to the pane so that the user can change the background or font colour.

0.2


Fine tuning to the interface of the pop-up pane will be done. It will offer the user more options to customize their theme. Such as font styles and sizes. Bespin already has built in code that allows the user to toggle font size. I will discuss with Kevin Dangoor whether the pop-up pane will replace the font size toggling or be offered as an alternative method of changing the font size.

0.3...


More fine tuning of the interface will be performed. Built in safety mechanisms will ensure that the colours of the theme don't overlap with colours of the font and syntax highlighting. I understand that one developer is currently in the process of working in this area. I will look into contacting them to see what they have to say on the matter.

After the functionality is taken care of I look forward to creating some preset colour schemes that the user will be able to select.

Overall


My biggest concern is being able to achieve all the goals I have set out for myself. I've never been part of such a large project before and I find the thought of it exciting. The past couple weeks have been very eye-opening for me. I'm realizing what a massive community of open source developers is out there and I look forward to jumping into it. I hope this experience offers me the opportunity to obtain a great amounts of knowledge in a relatively short period of time by learning from other people's code. So far I have been pleasantly surprised that the open source community has accepted our willingness to help with such open arms. Stay tuned for more updates on the project I'll be posting them as they come.

More information can be found here...

Project Wiki

Bugzilla Status

by Anthony Alves (noreply@blogger.com) at February 05, 2010 04:08 AM

Building Success

I've been reading a lot about open source over the past few weeks and it's good to finally have some results to reflect my efforts. My advice to anyone starting out in open source development is to seek out the proper documentation and follow the instructions as closely as possible. It's more than likely that you will still run into problems, and for the most part Google is your best friend. Although I did find the people on IRC to be most helpful when all else failed.

Building Firefox took a while. I followed the steps given for setting up a Mac OS X build environment, only to find myself stuck on the last and most important step... the make command. After scouring the internet for some time trying to figure out what was the problem with my gcc compiler I resorted to asking for help on IRC. I was surprised to have my problem fixed almost instantaneously. Apparently the trunk defaults to Mac OS 10.6 configurations so I needed to configure my .mozconfig file. After those adjustments were made I had my very own debgugging version of Mozilla Firefox running on my machine...


Bespin was a bit tricky at first as well. I started out building it locally on my computer. That took quite a while considering I had to download Mercurial as well as Python. After finishing my build I changed my mind and decided I wanted to build Bespin on a remote server so that my teammates and I can collaborate on a shared version. After a bit of tinkering I managed to get a remote version of the editor up and running...


Even though this was a bit of a struggle and I feel a sense of accomplishment in achieving these tasks so far. The back of my brain is still telling me I've only done the easy part. Fortunately the hard part also seems like it's the fun part. I look forward to cracking open some code and seeing how it ticks in the upcoming week.

by Anthony Alves (noreply@blogger.com) at February 05, 2010 04:07 AM


Alex Vlahopoulos

CALLING ALL DXR PACKAGERS!

ATTENTION DXR Project Packaging Team! As mentioned in my previous post Cleaning the DXR Repo, there are a lot of source rpms that are missing and required.

Here is the list of what I need!

cpp-4.3.0-9.src.rpm
dehydra-debuginfo-0.9-2.fc11.src.rpm
gcc-4.3.0-9.src.rpm
gcc-c++-4.3.0-9.src.rpm
gcc-debuginfo-4.3.0-9.src.rpm
gcc-gfortran-4.3.0-9.src.rpm
gcc-objc-4.3.0-9.src.rpm
gcc-objc++-4.3.0-9.src.rpm
libgcc-4.3.0-9.src.rpm
libgfortran-4.3.0-9.src.rpm
libgomp-4.3.0-9.src.rpm
libmudflap-4.3.0-9.src.rpm
libmudflap-devel-4.3.0-9.src.rpm
libobjc-4.3.0-9.src.rpm
libstdc++-4.3.0-9.src.rpm
libstdc++-devel-4.3.0-9.src.rpm


Please place the source packages into the dropofff directory under /DXR.

THANK YOU IN ADVANCE!

by apvlahopoulos (noreply@blogger.com) at February 05, 2010 03:54 AM

Cleaning the DXR Repo

Stage 1 (Throwing out the trash):

DXR Repository = Messier than a teenager's room. There were too many unnecessary old package versions in the DXR repository so I decided to just keep the newest ones. The platform directories are now a lot easier to look at and do not give me a headache. With an added bonus, it helped to save disk space :)

Stage 2 (Where oh where did all the source packages go?):

After the clean out, I soon realized that there were many source rpms missing. (I will be creating a separate post after this one, listing which source packages are needed).

Stage 3 (seLinux, let me in!):

I tried testing to see if yumdownloader would work, and as prior to my last post, it was quite the struggle.

Command: yumdownloader --source viewsource

Result: *PUKE* (just kidding)....

http://scotland.proximity.on.ca/DXR/source/repodata/repomd.xml: [Errno 14] HTTP Error 403: Forbidden

So, obviously a permission error. I tested out to see if it was a simple file permission (chmod) fix, but of course it wasn't (that would be way too easy right?) I soon learned that it could be seLinux. I messaged my buddy and viewsource packager Jonathan Deni for some assistance since I knew he had recently had some issues with seLinux as well....

So long story short, after comparing the security context between /repodata/repomd.xml and /DXR/index.html it was clear to see that they had different security TYPES.

One was home directory content, the other was httpd content and since seLinux policy prohibits home directory content from being served, voila!

restorecon -r /var/www/html = looked up types based on the location within the filesystem

Stage 4 (Making things pretty and easy):

Http://scotland.proximity.on.ca/DXR

Enough said.







by apvlahopoulos (noreply@blogger.com) at February 05, 2010 03:30 AM


Aleh Pliats

About me and learning C++ in Seneca college.

O my god I just created my first blog.
If it goes like this I will become a computer geek.

by oleg (noreply@blogger.com) at February 05, 2010 02:21 AM


Scott Downe

parsing indifferent to strings

I think I have implemented a solution to #226. The problem was seemingly complex, first thing I thought is I would have to keep track of all the parsing, so that it didn't parse a string, but then I thought if I could remove all strings, then replace them later, after the parsing is completed, and that's what I've done. It seems to be working! This is what I did.

At the beginning of the parsing, I run this block of code

var strings = aCode.match(/".*"/g);

for ( var i = 0; /".*"/.test(aCode); i++)
{
aCode = aCode.replace(/".*"/, "<STRING " + i + ">");
}


This, first, goes through all the code, and grabs all strings, and saves them in an array. Then, I loop through the code, applying in place of the "string". I do this until there is no more "string"'s left.

Then, at the end of the code, after all other parsing has been done, before I return aCode, I reapply all the strings like this

for( var i = 0; l = i < strings.length; i++ ){
var ex = new RegExp("\<STRING " + i + "\>");
aCode = aCode.replace(ex, strings[i]);
}

This goes through the array of strings, one at a time, until they have all been gone through, each time, applying that string to the proper with n being the index of that string in relation the the array of strings.

I believe this is pretty solid and can be demonstrated here. You should see three alert boxes, displaying messages that would normally be parsed out, then the usual black box of success. Also notice how I put a string inside the comment, to make sure it was able to handle that, as I parse the string before I parse a comment, as to avoid removing some string that happens to contain // in it. I also tested a multi line string, as I was curious, it handles it fine just so long as it's not written like this.

alert("first line
second line");

which to my knowledge, should not work anyway, plus, it's horrible code!

I think I'm done this bug, and I think the next step is to figure out how to submit my code...

by Scott (noreply@blogger.com) at February 05, 2010 01:14 AM


Gustone Lewis

The Dark Tunnel..........

So it's been a while since I last posted, been wandering in a real dark "tunnel" trying to build the environment for Firefox. I first took a look at the MDC wiki on building FireFox for a Windows platform. From first sight it was, to put it mildly, tedious. In order to get my platform ready to build this environment I had to go and download a few a things:

- Microsoft SDK for Windows 7
- VisualStudio 2005/2008 (I chose 2008)
- The current mozilla-build file

Downloading three files might not seem to be much but when two of three files are more than two gigabytes then you can understand my frustration. Three hours later everything was prepped and installed, building the environment would be a cinch, or so I thought. After following the MDC wiki I ended up in a shell that was created to simulate a linux environment (start-msvc9.bat). In order to build Firefox on my system I needed to retrieve a clone from the mercurial that would produce a localized copy of the mozilla-central repository on my system. After issuing the command: "make -f client.mk build" the system beginning running tests to ensure that I had the necessary components installed and configured.

Enter my first headache, for a strange reason the test failed to identify the C compiler on my machine, after an hour of trying to figure it out I decided to google up error to find out if others had experienced the same problem as I had. After doing a bit of research I found out that the problem could be resolved by editing the PATH environment variable in the system properties.

After solving this I figured it would be smooth sailing but that was not the case. Enter headache #2, this little error that I picked up when attempting to build on my fourth try:

Adding configure options from /c/mozilla-central/mozconfig:
--enable-application=browser
--disable-optimize
--enable-debug
--enable-tests
configure: error: System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.
make[1]: *** [configure] Error 1
make: *** [/c/mozilla-central/ff-dbg/Makefile] Error 2

After carefully reading this error message I knew that my system lacked the atlbase.h header file which is necessary in order for the building to be completed. I followed the link which directed me to another link that ultimately landed me on this page. Seeing as my system is a 64 bit OS the only version of the header file that would work was the PSDK-amd64.exe. After installing the missing files I attempted to build again and my result was as follows:


Then I navigated into my obj-dir folder nicknamed ff-dbg and searched for the mozilla or firefox executable:



Issuing the command to start it with the profile manager and the build FireFox Browser (which looks identical to the one I normally use):

by galewis (noreply@blogger.com) at February 05, 2010 01:08 AM

February 04, 2010


Zhibin Huang

build FireFox cont

On my last post, I was building FireFox. This post is about what happened on that day and the day after.

So, I was building FireFox that night, and then, I fell asleep:) then, on the next day, when I woke up, it was done already. It didn't bring me to any problem. I think that is because I followed the Build Documentation exactly.

after that, I tried to build it again and this time it brought me some problem. There are some problem on me .mozconf file. Obviously, I wrote something wrong this time. then I changed it back, and it worked prefect again.

at that time, I have two debug build. I asked myself why not build a release. Then, I did it as I said. And it was still work perfectly.

I want some problems. What if I build it without the mozilla-build? What if I build other software? I gotta try it someday.

by Benjamin Huang (noreply@blogger.com) at February 04, 2010 09:44 PM


Thanh Dao

WinCE builds disabled on release engineering

We have turned off the WinCE builds in our release automation. This will give us back some of our CPU time for others builds.
Disabling these jobs is just as switching off the lights of a room, and therefore, it can be easily reversed.

I announce this on dev.planning and here is the link to the bug.



Creative Commons License
This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

by Armen Zambrano (noreply@blogger.com) at February 04, 2010 08:16 PM


Mickael Medel (aSydiK)

Testing camera, frustum and perspective


Anna, our new project manager, was doing a follow-up on me yesterday.  She brought up a valid point of me not blogging enough (which everyone already knows as well, if you’ve been following anyway).  I was stuck on a problem the past few days and just let it go, as I was busy with other things.  But I realize that if I blogged about it, I could have gotten the answer while I left it alone.  I did find the problem when I threw it out on IRC and people read it and provided feedback.  I ended up filing a bug (267) for the problem to get looked at in the future.

Anyway, I did get my tests done and the results were working as intended… and by that I mean my matrices were lining up with what Processing has…

I’m still thoroughly testing PMatrix3DStack… as there’s not default tests with that, I’m just plugging in some random numbers.  The biggest concern is mult… if it’s being multiplied properly.  If I can finished PMatrix3DStack testing tonight, I should be able to write a test for ortho() as well.

by aSydiK at February 04, 2010 08:14 PM


Andor Salga (asalga)

Box Outline, Camera, PMatrix3D, Translate, Scale, etc…


I’m in the process of trying to tie together a bunch of functions and code and make them all work. I have vertices of box outlines, Mickael’s camera code, Anna’s box function, the PMatrix3D object and a matrices all over the place. So far I’m making progress. I had to dig through a bunch of processing code to see what exactly the Java version of the language is doing that was making my results so different. A few things I figured out was where they were transposing their matrices, I also found out they are indeed flipping the Y axis. My kludge was removed and replaced with a scale(1,-1,1), just the way they do it. I also had to modify the camera code so it looks more like their code. In addition, I found that their box outline vertices do indeed create a unit cube, so I scaled mine by 0.5.

After finding all these out, my outline code, box scaling code and camera code is starting to make some sense. Here’s a screenshot of me trying to make both Processing and Processing.js identical.

This demo is a mess. For some reason, in Pjs I have to specifically render the box in draw, otherwise it doesn’t render at all. I also have to do a literal translation in Pjs within the box function because adding a p.translate in the Pjs scope is somehow recursively calling another translate function. After it rendered, I counted the pixels and our version’s box is slightly larger, by 2 pixels. Since the box is so far away it might have a big different later, so I’ll have to look into that. But might look like old news compare to other stuff we have. But one main different is we’re now using the Edward’s refactored PMatrix3D object.

I’m happy that even though I have to do a literal translation in the box() code, it’s much clearer than multiplying Y by -1 all over the place. Once I can rip out this translation, we can start playing around with moving the box around. I’m also working on scaling the box if the user sends in arguments. In Processing, they just scale each vertex one by one. This is a bit wasteful, especially since we would have to call bufferData() each time box() was called. It would be more efficient to just apply a scale matrix. The problem is I have to call preApply() on the PMatrix3D instead of apply (Matrix A * Matrix B != Matrix B * Matrix A). I’m still unsure why I have to do this, and it’s been driving me crazy. But anyway, I’m pretty glad that the Pjs version is getting closer and closer to Processing. Here I’m translating and scaling (right now literally), but it shows up in the correct place!

I’ll be committing all this stuff to my experimental branch in Github by the end of the week.

Filed under: Open Source

by asalga at February 04, 2010 06:15 PM


Konstantin Novichikhin

“Simple Firefox build”


I’m going to attempt to build a firefox on my windows machine. I’m going to follow “simple firefox build“  doc in MDC.

First of all, I’m going to get Mozilla build tools for windows. I’m running windows 7 and VS2008, so I do not need to worry about .NET Framework. But I will most likely need some of the windows SDKs.

Mozilla build tools is going to install lots of stuff to “drive:\mozilla-build” (by default). Next thing I’m going to do is to set environment to use VS2008. In cmd under mozilla-build folder execute start-msvc9.bat.

C:\mozilla-build>start-msvc9.bat
"Mozilla tools directory: C:\mozilla-build\"
Windows SDK directory: C:\Program Files\Microsoft SDKs\Windows\v6.0A\
Windows SDK version: 6.0A
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Mozilla build environment: MSVC version 9.

I guess, it worked.

Next step is to get the source code. Mozilla uses HG to manage source code (you can get HG here). I’m going to get the code from the main tree:

hg clone http://hg.mozilla.org/mozilla-central/

I’m doing it over my college wireless. It’s probably not the best idea, because there is 1GB of source code data.

C:\Program Files (x86)\Mercurial>hg clone http://hg.mozilla.org/mozilla-central/
destination directory: mozilla-central
requesting all changes
adding changesets
adding manifests
transaction abort!
rollback completed
abort: connection ended unexpectedly

Thought so… So, first step should have been “look for a lan cable”.

Here is a “haiku”:

Found a LAN cable
Broadband connection is nice
Very Cold outside

Before I build I have to make sure that there is no spaces in the path to “make”. And I have to have a mozconfig file in the build directory.

mozconfig should containt the following lines:
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-release
mk_add_options MOZ_MAKE_FLAGS="-j4"

So now when I have the source code all I have to do is “make -f client.mk”. Spirits of my ancestors tell me that “make” is a unix program. Here is where MozillaBuild comes into play. Under “drive:\mozilla-build”, I’m going to execute “start-msvc9.bat” to get a build console. Inside the console I’m going to execute “make -f client.mk” to start compiling firefox.

And SDK version check fails:

checking for Windows SDK being recent enough... no
configure: error: You are targeting Windows version 0x06010000, but your SDK only supports up to version 0x06000000.

It basically requires windows 7 SDK, that can be downloaded here. 3 ISO files, 1500 mb each. I will reduce the world carbon dioxide emissions by not downloading those files. Instead, I’m going to add “ac_add_options –with-windows-version=600″ to mozconfig and see if it works.

I will see you after the brea… after it builds.

It failed with the following error:

cl : Command line error D8027 : cannot execute ‘c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\c2.dll’

I have another “haiku”:

Building Firefox
Installing Visual Studio SP1
Not good at all

I let VS2008 SP1 install first and re-started “make”. Now, I just need to wait for it to finish.

An hour later the build is finished. Time to test.

drive:\mozilla-build\mozilla-central\objdir-ff-release\dist\bin\firefox.exe

Welcome to Minefield

Minefield installed
It has not crashed on me
Broken Promises

Overall, it wasn’t too difficult to do “simple firefox build”. The main requirements are keyboard, monitor, and patience… and a lan cable.

by Konstantin.Novichikhin at February 04, 2010 05:43 PM


Derek Ambrose

Firefox Build

I began by typing into Google 'download firefox source code' and stumbled across this page. It was nice enough to give me a link to the source code and some guidance that winzip and winrar don't (at least at the time the article was written) have the ability to extract .*bz2 and .tar files properly, and to do it with 7-zip. I extracted it into a directory on my computer and proceeded to look for instructions on how to build Firefox on the web.

I opened up a few websites, but only really looked at one page in particular. The author seemed to explain things very well, and it was clear and easy to follow. He said he was new at building Firefox, as was I so that was a promising commonality, but the main difference is he did it on visual studio 2005 and I was running it on visual studio 2008, so I had to change a few things in the batch setup file, being the directory.

It was all good and well until we came to the .mozconfig file that we had to create. The first error was that it was saying I didn't have it set to create .mozconfig.mk automatically. After I fixed that, it was saying I didn't have MOZ_PROJECT_CO or something along those lines set to a variable, yet scanning through the files I found a MOZ_PROJECT_CO=browser line, so I do not know what it was talking about there. I went searching on the web and stumbled across this page from mozilla that had this set up for the .mozconfig file

echo '. $topsrcdir/browser/config/mozconfig' > mozconfig # let's build Firefox...
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-release' >> mozconfig # ...in this directory...
echo 'mk_add_options MOZ_MAKE_FLAGS="-j4"' >> mozconfig # ...quickly.


however that didn't work either, and had the same moz_project_co issue. I was two seconds away from asking in the firefox channel of irc and had typed out half of the message, but then on my way to pastebin to paste what was happening, I decided to try something. I made a combination of the two and ended up with this...

# Building Firefox Trunk with Debugging
. $topsrcdir/browser/config/mozconfig > mozconfig

# Put all obj files in one place, not in src tree
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-objdir >> mozconfig
ac_add_options --disable-static
ac_add_options --enable-shared

# Debug Build Setup Options
ac_add_options --disable-optimize
ac_add_options --enable-debug

# I'm using Canvas for my work
ac_add_options --enable-canvas


and voila! after a quick

make -f client.mk checkout


it began!! Success!! At least for the checkout... There were a few 'command not found's at the beginning of the build but that was something in the .mozconfig file and it seemed to have been minuscule. The line numbers of the issues were, 3, 8, and 12, and those are the lines that are blank, so of course no command is found on a blank line...

I then ran

make -f client.mk build


hoping that it would all work out, but unfortunately it did not. It said to build the installer, I would need makensis, and to build without the installer, to reconfigure using --disable-installer. It is late now, and I am tired, so I thought I would speed up the process and disable the installer. Lo and behold, it ran for a little bit longer but ... not long enough ... as a new error has been brought to the surface...an error unlike any other...and error, full of unorganized and very confusing lines.

/cygdrive/c/proj/mozilla/build/cygwin-wrapper /cygdrive/c/proj/moztools/bin/nsinstall -m 644 ../mozilla-config.h /cygdrive/c/proj/mozilla/config/nsStaticComponents.h ../dist/include
/cygdrive/c/proj/mozilla/build/cygwin-wrapper: line 75: /cygdrive/c/proj/moztools/bin/nsinstall: Permission denied
/cygdrive/c/proj/mozilla/build/cygwin-wrapper: line 75: /cygdrive/c/proj/moztools/bin/nsinstall: No error
make[4]: *** [export] Error 1
make[4]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir/config'
make[3]: *** [export_tier_base] Error 2
make[3]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
make[2]: *** [tier_base] Error 2
make[2]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/cygdrive/c/proj/mozilla/firefox-objdir'
make: *** [build] Error 2


...Yea. Sooo...I guess something is wrong with cygwin-wrapper. That, or permission is denied to nsinstall. or both...line 75 in cygwin-wrapper is simply

exec $prog $args

Prog being the first argument after exec is run, and args being what follows after that...
I guess the issue is that nsinstall's permission is denied. I looked at it in windows explorer, and it does have a little administrators icon on the icon. Time to look to irc and see what they say...
I asked irc and there is no response. It is troublesome because recently my internet is not really working at home and I am stuck at the library most of the time. The only time my internet works reliably is after midnight...other than that downloads will stop not far in and productivity is hindered. I asked some irc folks but I guess it's too late for a response? Either way, I will continue to pick away at it, at 2 in the morning, after 5 unsuccessful hours in the library...maybe if I download these mozilla build tools, things will get better.

I downloaded the build tools that are defined as a prerequisite on Mozilla's development wiki, but unfortunately, it encountered a new error...

make[1]: Leaving directory `/c/proj/mozilla'
make -C /c/proj/mozilla/firefox-objdir
make[1]: Entering directory `/c/proj/mozilla/firefox-objdir'
Makefile:45: /cygdrive/c/proj/mozilla/config/config.mk: No such file or directory
Makefile:69: /cygdrive/c/proj/mozilla/browser/build.mk: No such file or directory
Makefile:91: /cygdrive/c/proj/mozilla/config/rules.mk: No such file or directory
make[1]: *** No rule to make target `/cygdrive/c/proj/mozilla/config/rules.mk'. Stop.
make[1]: Leaving directory `/c/proj/mozilla/firefox-objdir'
make: *** [build] Error 2

No rule to make target mozilla/config/rules.mk ehh ... well, that's odd because there's a rules.mk in the mozilla/config directory, so why do you need a rule to make it?? Bah!
I tried to just build it with the command make -f client.mk as it says in mozilla's site... only adding -B at the end to make all targets...and I will hope for the best. Sleep would be nice, but I think it's a thing of the past since I have to work on some C++ which is due tomorrow and I have not been able to find the time to work on it. I haven't watched tv for so long :(. I have re-enabled the installer to be built by the way since I am taking another route and using the mozilla build tools. An installer is definitely an integral part of any application, and it should be there.
Whoa...it's been running for a good 10 minutes. I may have something here. Maybe all I ever needed was that -B...never mind. Same problem. I don't understand why it's saying it's not making rules.mk when, for one, it's already made, and two, I did set a rule to make all targets (also known as rules.mk)...

make -B -f client.mk build ???
please.
nope
make -B -k -f client.mk build?
nope


So I have decided to scrap everything and just go with what it says on the mozilla developers website. If this works, then ... good. It should, why wouldn't it...? I have just run the first step, being

hg clone http://hg.mozilla.org/mozilla-central/


but it is taking forever. It's been about a half an hour and I don't think it's even half through. I can thank my internet connection for that. I am going to bed. In the morning, I will continue with the

make -f client.mk


Anndddd I tried to run make -f client.mk but unfortunately, I do need the Windows 7 sdk. The biggest problem with that is finding a connection that'll be able to get it in less than 6 hours, since it's 2.5 gb. My connection won't do it, since the sun is up and it'll continuously drop, but I am at school now and have begun the download...only 10 hours left...then hopefully there will be some success.

by Derek (noreply@blogger.com) at February 04, 2010 02:36 PM


Ehren Metcalfe

Computing connected components with SQLite (and other attempts finding dead code)


In the last couple of weeks I’ve put a bit of effort into identifying unused functions in mozilla-central. Unfortunately, I have not been keeping up with this blog, which is a major requirement in DPS911.

As I previously reported, I’ve been using a Treehydra generated call graph (callgraph) which records caller-callee relationships in a giant sqlite3 database. As mentioned, my first attempt was to ignore the directedness of each edge in this graph, and then compute the connected components. I believe this is equivalent to computing the weakly connected components in a directed graph.

I have based my code almost entirely off work done David MacIver who has an interesting post here where you can read more about his algorithm. It works by initially placing each verticex into its own component and then iteratively merging distinct components where there is an edge between two vertices in the respective components. Unfortunately, his Ruby written for Mysql is not directly usable for my purposes since SQLite, which I’m working with, does not support the update join syntax. Here’s a bit of MacIver’s code for example:

    update items
    join (
      select component1 source, min(component2) target
      from components_to_merge
      group by source
    ) new_components
    on new_components.source = component_id
    set items.component_id = least(items.component_id, target)

To create the equivalent code, I used a temporary table and a bit of kludge:

    INSERT INTO components_to_merge
    SELECT component2, component1 FROM components_to_merge;

    DROP TABLE IF EXISTS new_components;
    CREATE TABLE new_components
    AS
    SELECT component1 source, min(component2) target
    FROM components_to_merge
    GROUP BY source;

    UPDATE node
    SET componentID = min((SELECT min(componentID, target)
                           FROM new_components
                           WHERE source = componentID),
                          componentID)
    WHERE componentID in
        (SELECT source FROM new_components);

That update statement is horribly inefficient but ultimately the job gets done. All told, it takes about an hour on one of the CDOT’s development machines. As MacIver noted in his original blog post, you’re basically done once the first merge has completed. The complete script, written in python, can be viewed here.

Note that a few domain specific refinements had to take place here. For example, any indirect calls to virtual functions will be registered as a call to the function in the base class. Callgraph already deals with this using an implementors table but I had to add an extra column for the return type of the function in order to accurately construct the name of both member functions. I then merge their components:

# set interface component to implementor component
cursor.execute('SELECT implementor, interface, method, type \
                FROM implementors')
list = cursor.fetchall()
for row in list:
    # format: type interface::method
    basename = "%s %s::%s" %(row[3], row[1], row[2])
    # format: type implementor::method
    derivedname = "%s %s::%s" %(row[3], row[0], row[2])
    cursor.execute("UPDATE node \
                    SET componentID = (SELECT componentID \
                                       FROM node \
                                       WHERE name = '%s') \
                    WHERE name = '%s'" %(basename, derivedname))

Also, whenever a function is called outside of the compilation unit in which it’s defined, the call will point to the location of the forward declaration of the function (eg the .h file). To get around this, I simply merge all components that contain nodes with the same name:

SELECT n.name, min(nn.componentID)
FROM node n, node nn
WHERE n.name = nn.name AND
n.componentID != nn.componentID
GROUP by n.componentID

Of course, some nuance is required to interpret the data produced by this script. As I mentioned previously, the analysis is complicated by the fact that many functions “never called” are in fact called indirectly via a function pointer. This means that most connected components of size one aren’t particularly interesting. In fact, since I’m merging declarations and forward declarations, most components of size two also aren’t particularly interesting (at least those with elements containing the same name). This script takes the above into account and can be used to produce these results:

A list of connected components (that aren’t the largest component) with size greater than 3
and
A list of components of size 2 (that aren’t the largest component) that have members with distinct names.

The vast majority of these are false positives mostly for the reasons mentioned above, but In the last week I finally bit the bullet and filed a bug, along with a patch, to remove a bit of the dead code identified. Unfortunately, these functions are all in the cairo library, which means that applying such a patch would make tracking upstream changes unnecessarily difficult.

A number of issues have been identified here though. Previously, in connection with an analysis to find non-static functions called only within a particular compilation unit, Taras filed this bug to add -fdata-sections
-ffunction-sections -Wl,-gc-sections
to the build config in order to strip out dead symbols. Interestingly enough, running a few of my own tests with this configuration, I was not able to strip out all of these dead cairo functions. Even more bizarrely, the symbols of a number of dead static (!) functions seemed to work themselves into libxul?!

As an aside, the nm utilty would have been quite useful when working on the alwayszero project. (To get similar results I was previously running debug builds and then grepping the output of objdump).

A path based algorithm
There are issues with the above analysis though. For example, a function could be unused yet call functions that are used. This script begins at a particular node and iterates backwards, transitively adding all callers. If the callers to be added are exhausted within a reasonable number of iterations, we’ve found a dead path. Note that to narrow down this analysis, I’ve disregarded everything already identified by the component based analysis ie I do not start with any node not in the largest connected component.

One thing I should note is that this script requires explicit transaction management to run (using cursor.execute("BEGIN TRANSACTION") and connection.commit()). For anyone faced with mysterious insert/update anomalies in sqlite, this may be the answer.

Anyway, getting useful data out of this is a little bit more complicated. For example, to see info about every function in all paths that contain only functions, the following query can be used:

SELECT * FROM node n
JOIN path p ON (n.id = p.id)
WHERE pathID NOT IN
(SELECT pathID FROM node n
 JOIN path p ON (p.id = n.id)
 WHERE isMethod = 0)
ORDER BY pathID;

Has this analysis yielded any more candidates for removal though? Unfortunately, I have not taken indirect calls to overridden member functions into account eg Base* b = new Derived(); b->foo();, so an analysis for dead methods is currently out. There is an easy fix, however, it will require another 18 hr run of the script (building a path backward from a start set of 100000+ nodes = a boatload of time). Analyzing just functions though, ie using the query above, I have found some interesting possibilities. For example, there’s quite a bit of dead stuff in nameprep.c, but I suspect this is an even bigger nightmare to patch than cairo.

I will report back soon, however, when I have more concrete results.

by ehren at February 04, 2010 05:39 AM


Jonathan Deni

Viewsource New Release!

Hello fellow community!

Well if you have been following my blogs you probably know that I was working on fixing some issues with Viewsource.

Well, the good news is I found out what the problem was!
The bad news is you might have to fix it yourself, haha. (I will explain in a bit)

Firstly, I had to change my viewsource.conf up a bit so that it looked like this:


Addhandler cgi-script .cgi .py .pyc .pyo
Options Indexes FollowSymLinks ExecCGI


That is to give the viewsource directory handlers for cgi and python and give it the Execute cgi option. I tested this out on a fedora 12 machine (india) and it worked, even with SeLinux. I thought it would probably work on the HongKong machine which I believe still has fedora 11 on it, sadly it did not.

I then had to turn on AVC denial messages because they were currently being suppressed due to saving space, I did this with the command: "semodule -DB"

I then issued the command: "
ausearch -m avc -ts recent" to view the recent messages so I didn't waste time searching for them. To be honest, looking at AVC denial messages is like looking at the matrix, NO idea what it meant until I talked to Chris Tyler who helped me out a little.
After frustrating myself, I eventually found out that the boolean "httpd_enable_cgi" had to be turned on (which it was in india), and since this is not my personal machine I left it alone. Which is what I was talking about before when I mentioned you might have to fix it for yourself, if you have errors simply use the command: "setsebool -P httpd_enable_cgi on" and you are set. I also placed a README in my package for this.

I put a DXRDROP directory in my home so that my good friend Alex Vlahopoulos, who is in charge of the repo, to come and pick it up when he is ready for it.

I suppose I should probably suppress the AVC messages again so I don't cause hongkong to eat up too much memory :
semodule -B.

Now, assuming there are no more issues with the package, (which we will find out soon when dehydra and jshydra are ready), I just have to clean up my spec file to comply with fedora regulations and I will be set!

Until next time, friends! :P




by Jonathan Deni (noreply@blogger.com) at February 04, 2010 04:52 AM


Scott Downe

Firefox build

Well, after a few problems, Firefox seems to be building fine now. It's been compiling for about twelve minutes, and before my problems all seemed to be early in the build, so I hope I'm out of the woods now.

The hardest part was simply downloading the files I needed to do this. I felt like there was no guide giving step by step instructions all in one place, but parts of guides. And, it seemed all of the parts vary for different machines and versions. It was up to me to learn it, understand it, and make the right choices.

Google was not much help in getting answers to my specific error messages, so what I would end up doing, when I hit a problem I didn't understand, I would go back a step or two, and try again, paying close attention to what is happening, and I may go back more than one step, or in some cases, right back to the beginning until I understand it. Each pass through I knew more and more, and by going back, I could see things with a knowledgeable eye, and stuff just sort of clicked.

Anyway, on to my specific errors and how I solved them. Once I got the commands working understood, I started using the make command, until I figured that out, and my first error was something to do with --enable-application=APP, which made no sense at the time. I was trying things like adding it to the end of the make command, and moving my .mozconfig file around. I read that it was important, and I thought I had it. But, it turned out I had a .mozconfig.mk and .mozconfig.out, which are not the same. I needed to create it myself, and then add the --enable-application-APP command there, so I tried that, still didn't work. I think found some advice on the web, with "ac_add_options --enable-application=browser" thinking I needed ac_add_options before my =APP, still didn't work. So, I tried "ac_add_options --enable-application=browser" without APP and browser instead. And voila, it seems to be going error free. In fact, it's still going, and I think it's going to finish problem free from this point on. If there are any more problems, I'll be back to edit this post, actually, I;ll be back if it works too.

So, it completed with what I think is no errors, although, It took me awhile to figure out how to install it. I found something under the name of Namoroka, which I believe to be it, so I installed it. It installed fine, or what I thought, but it would run, said it was missing Firefox.exe, so I aded that, just out of curiosity, then it wanted a .dll, and it kept going. So eventually I found all the files in one location in the firefox build files, so I just copied it all into the Namoroka folder. It now has no errors, but no program is actually started. Ah well, I think though, that's all I have time for and is a good amount for only an hour (7:38 - 8:48) little more than an hour. Anyway, I have to wake up tomorrow at 5:00 to make it to Java EE on time tomorrow.

by Scott (noreply@blogger.com) at February 04, 2010 01:57 AM


Harjinder Virdi

My First Firefox Build

4th week into the open source development course and were discussing about how to build Firefox on your machine, which sounds fascinating and crazy at first no?

Requirements
I decided to build Firefox3.6 on my windows 7 Laptop and I basically followed the instructions in “Build documentation” on Mozilla’s Developers web site. Prior to building Firefox, I checked to see if I had the met the prerequisites and had all the tools that Firefox was dependent on in order to have a successful build.  I was missing Windows SDK and Mozilla Build Tools, so I had to install both packages.

Tools Required
- Microsoft Visual C++ Tools
- Microsoft Windows SDK(s)
- Mozilla Build Tools

Get Source Code and Configure Build Options
Next step was to get the source code of Firefox, so I retrieved it using Mercurial. My build configuration option file “.mozconfig“ was set up with the following options:

ac_add_options —enable-application=browser
mk_add_options MOZ_CO_PROJECT=browser

Start Building…
I launched the command line prompt tool by running “C: and went to the source directory where I had the Firefox code downloaded….wait that did not work , the folder name “Mozilla Builds” is right? Ops I had a space and as Mozilla stated that you can’t have any spaces in the directory path, so I renamed the folder to “MozillaBuilds” and it worked…Then I ran “$ make –f client.mk build” and………..after a long coffee break and a bit of waiting…The build was completed, and it took roughly 50 minutes.

I went into obj-i686-pc-mingw32/dist/bin and ran “firefox.exe” and it worked! So I guess I successfully compiled Firefox on my laptop

It was my first ever Firefox build and it all went smooth:)

February 04, 2010 01:41 AM