Planet CDOT

February 03, 2012


Aries Alwi

Testing Build Using Koji Part 1

In this post I will be using koji to test my build in Fedora distribution only. I will make another post (part 2) to test my build on other architectures.

If we don’t have koji yet in our system, let’s install it first:

  • yum install fedora-packager

Then, we have to setup our Fedora Account System (FAS2). If you don’t have any FAS2 account, create one here.

  • /usr/bin/fedora-packager-setup

 

In this example, I am queuing a build request for my combine package on the main koji server used for primary architecture builds (i386 and x86_64).

  • koji build f17 –scratch combine-0.3.3-1.fc16.src.rpm

koji_combine

 

We can find more information on how koji command used:

  • koji help

More information how to use koji can be found here.


by asalwi123 at February 03, 2012 08:24 PM

Using Mock to Test BuildRequires

Alright, so this time I have to use Mock to test the buildrequires of package that built earlier (moe).

First, we have to install mock if we don’t have it:

  • yum install mock

Note: We can’t run mock as root! We have to use our regular user. So let’s add ourself to the mock group:

  • usermod -aG mock your_username

The command to use mock to test our SRPM is:

  • mock -r distribution-release-arch your_SRPM

You can check your distribution-release-arch by looking config files in /etc/mock. Use the same format but without the .cfg extension.

In this example I will be running mock on my fedora 16 (64 bit) system to test my moe package:

  • mock -r fedora-16-x86_64 moe-1.3-1.fc16.src.rpm

This is the result I get:

mock_moe_error

As you can see there are some errors. So let’s find out those errors in the build.log file under /var/lib/mock/fedora-16-x86_64/result.

I am using vi to open the log file so I can easily search for the word error using vi built-in function (/your_pattern).

moe_build.log

The error specified:

  • fatal error: ncurses.h: No such file or directory

So I figured out by adding ‘ncurses-devel‘ package under my BuildRequires in the spec file (moe.spec) fixes the problem. I was able to figure this out by asking someone from IRC, but I’m not actually sure what packages should I put if I was missing other packages. Please leave a comment for this post if you have some explanations. Thanks :)

After adding the buildrequires, we have to rebuild our package:

  • rpmbuild -ba moe.spec

Run mock again:

  • mock -r fedora-16-x86_64 moe-1.3-1.fc16.src.rpm

mock_moe

This time the results doesn’t show any error messages. Yaayy :D

This whole mock testing process took me about an hour. I did another mock testing for another package and everything went smoothly; takes me only about 5 minutes.

 


by asalwi123 at February 03, 2012 07:28 PM


Jose Rainulf Pineda

Android Development Part 1: Activity

I was inspired by my professor of ECL500 class, Jordan Anastasiade, to make this blog post about Android Development. As you are aware, Android apps are developed in Java. As long as you know the basics of Java development, you shouldn't have problems developing apps for Android. There are, however, a couple of new conventions you need to learn and get familiar with before you can develop one. First of all, we will be developing apps in Eclipse. So I suggest that you download the latest version of Eclipse Classic (Indigo).

After that, you will need to download and install the Android SDK. Finally, you will need to install the Android ADT plugin in Eclipse. For more information, please follow this tutorial starting from Step 3. After you have set everything up, you will need to install a couple of packages from the Android SDK manager. Please install everything under "Tools" and "Android 4.0.3 (API 15)" - we will be developing apps using the latest version of Android. The following packages are essential throughout this tutorial and future ones:

  • SDK Platform
  • Documentation for Android SDK
  • ARM EABI v7a System Image - this image is needed for the Android emulator!

The first thing we will tackle on this post is Activity. In Android, an Activity is an application component that provides a screen in which users can interact. The following diagram shows the important state paths of an Activity. The square rectangles represent callback methods you can implement to perform operations when the Activity moves between states. The colored ovals are major states the Activity can be in.

activity_lifecycle

To create an activity, one must create a subclass of Activity class. As you can see in the diagram, an activity has a couple of callback methods that the operating system automatically calls on each cycle. These methods are pretty self-explanatory, but in order to work with them, you must override them in a class you create extending the Activity class.

Create a new project in Eclipse:

  1. Click "File" then under "New", click "Project..."
  2. Expand "Android", select "Android Project" then click "Next"
  3. Type a Project Name, then click "Next"
  4. Check "Android 4.0.3" for the build target then click "Next".
    Note: You may choose whatever you wish, it will still work for this tutorial. But please note that newer versions have newer methods and features
  5. Type a Package Name (eg. test.part1), then click "Finish"

Eclipse will create a bunch of files. The important ones are under "src" and "res" directories and the "AndroidManifest.xml" file. Open that one Java file in "src" directory under the package name you made up. There, you should see something similar to this:

package test.part1;

import android.app.Activity;
import android.os.Bundle;

public class TestActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

As you can see, it already override the onCreate() method for you. The first thing it does is call the onCreate() method of the parent. The next line set its content view or the layout of your activity. On this case, it is saying to use the "main" layout, which also Eclipse have created for you.

The main layout is located under the "res" directory, expand it. There, you should see some or all of the following directories:

  • drawable-hdpi
  • drawable-ldpi
  • layout
  • values

Everything under "res" sets the feel and looks of your app. Starting from the resolution of the phone, to the layout and to the values in a layout. Expand the "layout" directory and you should see "main.xml", open it. These layouts are defined in an XML format. But if you open it in Eclipse, it should show you the Graphical view of it.

eclipse_android_mainxml

Eclipse makes it easy for you because you can easily drag and drop buttons, widgets, images, etc. into the layout. Click the "main.xml" tab to see the XML version of it.

Before we can run this app, we need to create our emulator! In Eclipse, click the "Android Virtual Device Manager" icon:

click_emulator_eclipse

It should open the "Android Virtual Device Manager" window. On that window, Click "New" and make up a name. The target of course should be "Android 4.0.3 (API 15)". You may also set the size of the SD Card. After that, click "Create AVD".

Now, let's compile and run this app in the emulator! Do the following:

  1. In Eclipse, click "Run", then click "Run Configurations..."
  2. Double click the "Android Application" at the left-hand side and it should create a new run configuration for you
  3. Click "Browse" and choose the Test project
  4. Click the "Target" tab, then choose the AVD you created.
  5. Click "Apply", then click "Run"!
    NOTE: Please wait for a while to load. The app should be installed to it once it's finished!

Now that we've created and run our first app, is it possible to add more activities to it? The answer is yes! Let's go back to your Test project and create a new Activity class:

  1. Click "File", then under "New", click "Class"
  2. Make up whatever name for your second activity
  3. In "Superclass:", click "Browse..." and search for "android.activity" and select the first result
  4. Make sure that you have "android.app.Activity" as your Superclass, since that's the class we want to extend. Click "Finish"

The new class should roughly contain the following:

package test.part1;

import android.app.Activity;

public class SecondActivity extends Activity {

}

The next step is to create a new layout for this new activity. Do the following:

  1. Under res/layout, right click the directory "layout", then under "New", click "Other"
  2. Expand "Android", choose "Android XML Layout File", then click "Next"
  3. Make up a name, then click "Finish"

This should create a new XML file for layout and open the graphical interface. Try to play around with it, make sure you save it after. If you wish to add a string, you must define it in "strings.xml" file under "values" directory, open it. Go to the XML version of "strings.xml" because it is easier. You should roughly see the following:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="hello">Hello World, TestActivity!</string>
    <string name="app_name">Test</string>

</resources>

Just add another string element, with a unique name for it. If you want to refer to this string in your newly created layout, first of all, you must drag and drop a TextView from widget to the layout. After that, go to the XML version of the layout. You should see the "TextView" element. It should have an attribute called "android:text". Erase all everything in it and add the following: @string/whatever_name_of_your_string - this should refer to the string you created in "strings.xml"

Now that we've customized our newly created layout, we must tell our new activity to use it! We do that by doing the same way as our first activity, we override onCreate() and call the setContentView() method:

public class SecondActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.the_name_of_your_second_layout);
    }
}

We set the content view to our new layout. If the name of our new layout is "second.xml", we pass "R.layout.second" to setContentView() method.

So how do we run this new activity alongside with the existing one? We have two activities! Which activity runs first? This setting is defined under "AndroidManifest.xml" file. In order to use this new activity we created, we must define it first in the "AndroidManifest.xml" file:

  1. Open "AndroidManifest.xml" file
  2. Go to "Application" tab"
  3. Under "Application Nodes", right click and click "Add..."
  4. Double click "Activity", then browse for the new activity you created, choose it
  5. Save and close the "AndroidManifest.xml" file

Now let's open our very first Activity and add the following method inside it:

    public boolean onKeyDown(int keyCode, KeyEvent event) {
       if(keyCode == event.KEYCODE_DPAD_CENTER) {
          Intent newActivity = new Intent(this, SecondActivity.class);
          startActivity(newActivity);
       }
       
       return super.onKeyDown(keyCode, event);
    }

Let me explain what this do line by line. The first line checks for the key that is being pressed. If the center pad is pressed, if statement should be true and therefore run whatever's under it. The next line creates an Intent object. We need to create an Intent object to tell the Android OS that we intend to do something. On this case, we intend to start a new activity when the center key pad is pressed. We use the startActivity() method to run the intent that we have created. This should open the new activity that we have created!

All in all, this is a pretty straight forward tutorial with Android Activity. There are a couple of things I haven't touched such as saving instance state (how to keep the state of your current activity if you decided to open a new one) or creating fragments and use them alongside with Activities. But I leave it up to you if you want to learn more about those two.

February 03, 2012 03:11 PM


Diogo Golovanevsky Monteiro

Firefox Bug 714071

Working on Bug 714071 introduced me to another layer of Firefox.
So far all I’ve been doing was working with c++ code, specifically related to the MouseLock API.
Bug 714071 on the other hand was focused on the js layer.

A brief summary of the bug:

Fix a problem with the Statistics video control


When the showing statistics option of a video was on, and the fullscreen was toggled the video would stop displaying the statistics but the menu would not be updated.
The goal for the bug was to keep showing the statistics when toggling between fullscreen.

The code that displays the statistics on a video is the following:

                showStatistics : function(shouldShow) {
                    if (this.statsInterval) {
                        clearInterval(this.statsInterval);
                        this.statsInterval = null;
                    }

                    if (shouldShow) {
                        this.video.mozMediaStatisticsShowing = true;

                        this.statsOverlay.hidden = false;
                        this.statsInterval = setInterval(this.updateStats.bind(this), this.STATS_INTERVAL_MS);
                        this.updateStats();
                    } else {
                        delete this.video.mozMediaStatisticsShowing;
                        this.statsOverlay.hidden = true;
                    }
                },

Everytime the video was loaded on the page, or toggled in fullscreen, the init method would be called and an event listener would be attached to listen for the “Show Statistics” option click. However, the init method would initialize the video with a fresh config, so if the statistics were being displayed it would be hidden after switching between fullscreen mode.

Solution

The solution was to add a check on the setUpInitialState method to activate the statistics on the video if they were being displayed before toggling the fullscreen.

if (this.video.mozMediaStatisticsShowing) {
  this.showStatistics(true);
}

That apparently solved the problem and the statistics are preserved even when toggling fullscreen.

Working on this bug made me very curious. How could some javascript code interact with c++ at run time.
I knew about the XPCOM object model used in Firefox and lately I’ve started to read more about XUL and the Gecko engine . This was the perfect time to start digging more deep and learn more about the Firefox foundations.
Using the videocontrols as a starting point I went to mxr and started searching some code.
From my initial search I think I found where the controls were loaded in c++. Now I just need to figure it out how all that happens :)

videoscontrols.xml – define the video controls

nsCOMPtr mVideoControls;
nsVideoFrame::CreateAnonymousContent – where the menu gets attached to the video element

nsNodeInfoManager – apparently used to load the video controls as well the poster image
nsNodeInfoMangager::GetNodeInfo – looks like the loading happens here

Manage XPCOM objects?
PL_HasTableLookup
PLHasEntry
PL_HasTableAdd

NS_TrustedNewXULElement – where the XUL element gets created and casted to an nsIContent
NS_TrustedNewXULElement declaration
NS_TrustedNewXULElement definition

TODO:
Keep digging and find how the pieces fit together!


by diogogmt at February 03, 2012 07:10 AM

February 02, 2012


Diogo Golovanevsky Monteiro

DPS911 Update

After being introduced to Firefox development last semester in the DPS909 – Topics in Open Source Development and now being enrolled in the DPS911 – Open Source Project it’s time to get some bugs fixed
Besides continuing the work started last semester in the implemention of the MouseLock Spec on Firefox, I picked a few other bugs to work on.

My first Firefox patch originated from Bug 715141. The bug was to add a keyboard shorcut to resize the zoom level of an image to a 1:1 scale. When Firefox serves an image file and the image is bigger than the boundaries of the browser, the image gets resize to fully fit in the browser window. A magnifying glass with a +/- sign appears when the mouse hover overs an image if the image can be resized.
So the goal of the bug was to add support to manipulate the zoom level with only the keyboard.
In one of the comments of the bug, Jared suggested that the changes would probably happen on the ImageDocument.cpp file
At first I thought to look for the code that changed the browser zoom level, the Ctrl +/- shortcut. I found what I thought was the code for switching zoom levels in the HandleEvent method. However, it turned out to be the code that was resizing an mage to a 1:1 scale! The shortcut already existed, was Shift +/- I then spoke with Jared and he talked to gavin and in the end was decided that since noboby ever used, or even knew about the shortcut, it would be better to remove it due code maintance in the future, so Bug 715141 was closed and a new bug to remove the code was created, Bug 718133.
On Bug 718133, knowing where the code for the shortcut was located, all I had to do was remove it, and that was my first contribution to Firefox :)

My second contribution was Bug 713383. On Bug 376997, when the browser serves an image file instead of the image being displayed on the top left corner in a white background it began being displayed in the center of the page with a greyish background. However, if somedoy wanted to print an image, most likely they don’t want the greyish background or the image to be centered on the page. After some suggestions, was agreeded that the best solution would be to wrap all the new styles introduced in Bug 376997 on a

@media not print
rule and preserving the new styles for displaying an image but not applying them when the image is being printed.

Quick Summary:

Bug 633602 – Implement Pointer Lock (Mouse Lock) API
Bug 715141 – Using keyboard to switch zoom level when viewing images directly
Bug 718133 – Remove keyboard shortcuts for zooming to 1:1 scale when viewing standalone images
Bug 713383 – Directly viewed images should be printed with a transparent background on the body
Bug 714071 – The Show Statistics setting is not preserved when toggling the full screen mode
Bug 712225 – When element is in fullscreen mode, window.innerHeight is bigger than window.outerHeight
Bug 581866 – outerWidth / outerHeight features in window.openDialog do not include window manager decorations
Bug 581863 – gtk2/nsWindow::GetScreenBounds returns client window size instead of outer (frame) size


by diogogmt at February 02, 2012 11:03 PM


Chad Pilkey

First Post

I was just added to the team working on the Big Blue Button project this week. It’s exciting to finally be working on a “real world” project that is surprisingly large.

I’m looking forward to working with Justin, Anatoly and Fardad this semester.


by chadpilkey at February 02, 2012 09:14 PM


Justin Robinson

Cast your ballots, folks!

The polling module is coming along nicely, the voting results save properly to Redis now, the checkboxes are registering properly, all is right with the world. I think the next thing we need to take care of is the results window for the presenter, and then we’ll have something we can actually demonstrate to Blindside without having to go into Redis through the command line (don’t hold me to that, though) There’s still a lot to do, though.

 


by Justin at February 02, 2012 07:29 PM


Aries Alwi

RPM Writing

There are some packages we need to install before we can create an RPM package. We can install them using yum command.

  • yum groupinstall “Fedora Packager”
  • yum install rpmlint yum-utils

We need to have ‘~/rpmbuild/’ directory and ‘~/.rpmmacros’ file by running this command:

  • rpmdev-setuptree

Under the ‘~/rpmbuild’ directory, there are some directories automatically created: BUILD, BUILDROOT, RPMS, SOURCES, SPECS, SRPMS.

If later on we need to clears out these directories, run this command:

  • rpmdev-wipetree

First step to create an RPM package is move the package source code (tarball) in ‘~/rpmbuild/SOURCES’ directory. In this example I will be using moe package.

  • mv moe-1.3.tar.gz ~/rpmbuild/SOURCE

Change directory to ‘~/rpmbuild/SPECS‘, then create an empty skeleton spec file there.

  • cd ~/rpmbuild/SPECS
  • rpmdev-newspec moe

The file will automatically has .spec extension (e.g. moe.spec). Edit the the specfile (using vi) and add all the required fields.

  • vi moe.spec

After finish editing, try to build the package.

  • rpmbuild -ba moe.spec

This is the error message that I encountered:

error: line 10: Empty tag: BuildRequires:

I simply commented (by adding #) these two lines for now:

#BuildRequires

#Requires

Then, I tried to rebuild the package.

  • rpmbuild -ba moe.spec

Everything seemed to go fine until I saw these error messages in the end:

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /etc/moerc
   /usr/bin/moe
   /usr/share/info/dir
   /usr/share/info/moe.info.gz
   /usr/share/man/man1/moe.1.gz

We can resolve these errors by adding those specified files under ‘%files‘ tag in the spec file (moe.spec).

%files
   /etc/moerc
   /usr/bin/moe
   /usr/share/info/dir
   /usr/share/info/moe.info.gz
   /usr/share/man/man1/moe.1.gz

Try to rebuild the RPM package.

  • rpmbuild -ba moe.spec

There isn’t any error messages! Yaaayy :D

If the build is successful, you should see the binary RPM under ‘~/rpmbuild/RPMS/’ directory and the source RPM under ‘~/rpmbuild/SRPMS/’ directory.

moe_result


by asalwi123 at February 02, 2012 06:46 AM


Raymond Hung

Pointer Lock – Developing on Windows

There’s been a lack of posts I must admit, much of it due to the lack of any real significant breakthroughs. Much of the progress has been minor ones which didn’t feel like they merited a post in itself. So now that a week has essentially come, a round up post is in order. As the title of the post suggests, much of this post will detail my experience while working on Windows.

Work Done

There were three main things that were necessary to get the tests done (assuming that the tests from last semester were all pretty much perfect). The first was that the tests needed to be updated to use the proper syntax. This meant that lines that said var pointer = navigator.pointer got changed to var pointer = navigator.mozPointer. The second thing that needed to be done was to trim unnecessary tests. Several tests from last semester had tests that overlapped with each other, and in general, if it’s tested once and it works, don’t bother testing it again, it’s a waste of time. Lastly, one thing that was noticed by a few of the test developers from last semester were that there were leaks that were being caught by mochitest.

This last task was the most time consuming of them all and it ended up also being mostly a wasted effort. Much of the leaks actually occurred in the now defunct file_MouseEvents.html. As mentioned in my previous post, when I first found this, I was extremely exciting. It took ages to find this out. I had to cut files from the test harness one by one to find which file did it. Afterwards I had to lob of entire sections of the test to finally find the culprit, and then promptly learned that it was a Windows specific issue. Luckily, it turns out that we didn’t need to be that specific, which meant we could avoid the leak totally. By specific I mean that for Firefox, the route a mousedown event takes is for the most part is the same regardless of which button is pressed. So instead of sending a mousedown event for left, middle, and right mouse button, you can send a generic one and know that it will cover all three.

The next major work was to integrate into file_movementXY.html a test to check to make sure the mouse can theoretically move beyond the element in point lock. In other words, once in pointer lock, the mouse should be able to continue to move in any direction and not worry about hitting the “edge” of the browser which would, in normal circumstances, cause the mouse to stop reporting events to the browser. Original attempts were fairly straight forward. The test would move the mouse, store the mozMovementX and mozMovementY move it almost half the screen 3 times, and then check to make sure the values added up to be larger than the screen width or height (depending on if we’re comparing X or Y). On linux it flat out failed. Instead of getting a positive number, it seemed that we were getting the negative equivalent to what we were expecting. On Windows, it was worse. For the most part, running it would give the tests a pass (which was why I pushed to my repository for peer review), but if you were to move your mouse outside of the browser when the test started, the tests would fail and something similar to the linux error occurs… a negative number. It turns out, the test could be simplified and after a chat with Diogo the current method was developed. The idea was that by moving the mouse to the center and initializing pointer lock, we know that after each move we go back to the center of the screen. We would move a quarter of the screen each time, and when the moves are finished we can declare that it works. The reason is because if we try to use synthesizeMouse and send the mouse to a location beyond the browser, the test would hang and thus the test would fail.

More recently, work was being done on file_cursorPosEvents.html. This really highlighted a lack of understanding on my part regarding asynchronous calls and events. I’m too used to coding in C and C++ with synchronous calls and often times I make the incorrect assumption that certain things are synchronous when they’re not. In such cases, we’re looking at possible random fails. Another poor habit includes not using a bool when all I use a variable for is to track if something happened or not. With this test, I’ve also found that working running pointer lock tests on Windows is wonky at best…

The Rant

I’m sure we need to test these on Windows, however, so far it seems that whatever runs on Linux works on Windows. More interestingly is that, whatever doesn’t work Linux, still has a chance to work “as expected” on Windows. As I showed Diogo on Tuesday, while movementXY would fail on linux, and it would succeed with no problems on Windows. This has caused me and my colleagues a lot of headaches (namely because I push it up to my repo for review because it works for me… just not for them). However, to really highlight the “what the heck”-ness of developing on Windows, take a look below. The following screenshots were taken right after a pull and compile. No files were changed that could alter the behaviour.

The image above shows that for the most part, everything is A-OKAY! We have 1 todo left and this bunch of tests are good. It should be noted that there should actually be one fail. This failure is consistent with macs and linux computers when they run the same set of tests. So there seems to be a missing error… but that’s not all. Right now we’re in a specific test, however, if I were to go up one level …

As you can see, test_FullScreenHarness actually DOES have a fail. To clarify, the order in which this occurred, I actually started out in the folder view and then went into run test_FullScreenHarness to see what was actually failing. The important thing to note is by running test_FullScreenHarness, we actually LOST a test. It didn’t all of a sudden succeed, it just skipped it. Another reason for concern is that the number of tests total up to 76. The actual number of tests that are supposed to be there is 80. The number of tests for mozPointerLock is correct, which means in the tests are missing in test_FullScreenHarness.

Next up

We’re very close to finishing up the tests, the last one is to fix file_cursorPosEvents.html. The purpose is to make sure that once in pointer lock, mouseover, mouseenter, mouseout, mouseleave events are no longer triggered. After a lot of iterations of the file and consulting with Steven, we’re still somewhat stumped as to how to do this properly. At the moment, if you were to run this test, the set of tests will occur twice. This is because the mousemove that is directed to the child is redirected to the parent, which is why the tests happen twice. A solution was proposed to directly send to the child mouseover, mouseenter, mouseout, and mouseleave events to the child. In this case because those events are essentially eliminated, there’s nothing to signify to us that it’s “okay to check if the events occurred now.” The idea to circumvent that was to use setInterval or setTimeout… which probably won’t fly which means we’re still at the drawing board.


by Raymond at February 02, 2012 06:07 AM


Aries Alwi

Building from source code

Before we start building from source, we have to install the development tools and development libraries installed in our system. Let’s install them using yum command:

  • yum groupinstall “Development Tools” “Development Libraries”

We can choose various packages to be installed from GNU Software Collection. I chose combine and moe for this example. You can download the package simply by copying the link of the packages and download them using wget command.

  • wget http://gnu.mirror.iweb.com/gnu/moe/moe-1.3.tar.gz

After you downloaded the package, let’s unpack the tarball:

  • tar xvzf moe-1.3.tar.gz

Then there should be a directory of the package that we just unpacked. Let use cd command to change to that directory.

  • cd moe-1.3

 

Let’s read the build instructions in a file called INSTALL or README.

Typically, we have to run the script that configures the build for our particular system first.

  • ./configure

Then, run a script to build the software.

  • make

Last, install the program.

  • make install

The installed program usually located in ‘/usr/local/bin/’ directory. If the program installed properly, then you should be able to run it without any error messages.

 

This whole process of building from source code took me around twenty minutes. Good luck! :)


by asalwi123 at February 02, 2012 06:04 AM

February 01, 2012


Chris Choo

RPM Building Part 2

Okay, leaving my proxyknife rpm build in the back burner for now I am going to jump to my other source program and give it a shot at building an RPM for it.

Now the second program that I am using it M4, pretty much following the same steps from my previous post on proxykinfe I did the same configuration and steps to start my rpm build. Keeping my spec file for proxykinfe, I rebuilt the setuptree so I have a clean directory to work with. Now issuing these commands as before
  1. - cp m4-1.4.16.tar.gz ~/rpmbuild/SOURCE
  2. - cd ~/rpmbuild/SPECS
  3. - rpmdev-newspec m4
  4. - rpmbuild -ba m4.spec
After editing the spec file and running the rpmbuild command it started to build, and m4 took a long time compared to proxykinfe, none the less it finished and yet again I got errors again. :( Here are the errors that I got this time around.

error: Installed (but unpackaged) file(s) found:
   /usr/bin/m4
   /usr/share/info/dir
   /usr/share/info/m4.info-1.gz
   /usr/share/info/m4.info-2.gz
   /usr/share/info/m4.info.gz
   /usr/share/man/man1/m4.1.gz


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/bin/m4
   /usr/share/info/dir
   /usr/share/info/m4.info-1.gz
   /usr/share/info/m4.info-2.gz
   /usr/share/info/m4.info.gz
   /usr/share/man/man1/m4.1.gz

So after looking it over and doing some research, I found that the error was telling me that I didn't put any files into the RPM! Knowing that I added these lines to the %file section to test and the result...

Wrote: /home/chris/rpmbuild/SRPMS/m4-1.4.16-1.fc16.src.rpm
Wrote: /home/chris/rpmbuild/RPMS/x86_64/m4-1.4.16-1.fc16.x86_64.rpm
Wrote: /home/chris/rpmbuild/RPMS/x86_64/m4-debuginfo-1.4.16-1.fc16.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.GfdUJw
+ umask 022
+ cd /home/chris/rpmbuild/BUILD
+ cd m4-1.4.16
+ /bin/rm -rf /home/chris/rpmbuild/BUILDROOT/m4-1.4.16-1.fc16.x86_64
+ exit 0

Success!! Finally I got an RPM made, but copying all thoes files all the time when you make a RPM can be time consuming, after doing some more research I found easy to use macros to reduce similar lines

%files
%doc
%{_bindir}/*
%{_infodir}/*
%{_mandir}/man1/m4.1.gz

Some rpmlint testing to see if my spec files and rpm has any errors, so far none at the moment

 [chris@localhost SPECS]$ rpmlint -i m4.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.


 [chris@localhost SRPMS]$ rpmlint -i m4-1.4.16-1.fc16.src.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.


[chris@localhost x86_64]$ rpmlint m4-debuginfo-1.4.16-1.fc16.x86_64.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.


Finally I have created an RPM!! This will help me with my next project using Mock and Koji, I am still going to work on my proxykinfe build still but for now I will continue on with my m4 RPM for my Mock and Koji testing.

**I will update a link for my RPM, SRPM files when I figure out how to post it up on my blog, for now here is my spec file below.**

m4.spec


Name:           m4
Version:        1.4.16
Release:        1%{?dist}
Summary:        Traditional Unix macro processor


License:        GPLv3
URL:            http://www.gnu.org/software/m4/
Source0:        http://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.gz


#BuildRequires:
#Requires:


%description
M4 can be used as a front end to a compiler or a macro processor by itself.


%prep
%setup -q


%build
%configure
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%files
%doc
%{_bindir}/*
%{_infodir}/*
%{_mandir}/man1/m4.1.gz


%changelog
* Mon Jan 30 2012 Chris Choo
-SBR600 Class RPM Build lab, First build,  m4-1.4.16

by Chris Choo (noreply@blogger.com) at February 01, 2012 10:49 PM


Kavishankar Srivamathevan


Justin Robinson

Check one-two, check one-two

Anatoly and I were having a problem with CheckBoxes yesterday and today, where we couldn’t get the Polling Module to actually recognize which boxes were and weren’t checked when a user votes on a poll that allows multiple selections. We were tearing our hair out trying to figure out how to find which boxes were selected, since the boxes were all being created dynamically and for some reason could not be accessed by their IDs.

Well, it took a lot of searching to figure it out, but Anatoly finally found this forum post where a user named Zolotoj demonstrated his homemade CheckBoxGroup class (you may have to scroll down a bit). We saw that he was using the CheckBox addEventListener method to assign a function to the Check Box’s click event, which we had been discussing but weren’t sure how to do. In Zolotoj’s code, the line looks like this: chkBox.addEventListener(change, onClick)  and we changed ours to addEventListener(MouseEvent.CLICK, checkButtonClick).  We didn’t bother using the DataProvider class, instead our checkButtonClick() keeps track of which boxes are checked in an array, adding new elements and deleting duplicate ones as necessary.

So I think we’re in the home stretch! The method to send the vote information back to the server is already in place, we just need to actually link it up to everything else.


by Justin at February 01, 2012 06:39 PM

January 31, 2012


Diogo Golovanevsky Monteiro

Synthesizing mouse events in a mochitest

Writing mochitests for firefox is a tricky task sometimes since you need to recreate use cases of browser usage withouth human interaction.
I was faced with the task of writing some tests to check the mouselock API. One test specifically, needed to check if mouse events were being retartgeted from the child to the parent locked element, for example:

<div id="parent">
<div id="child">
</div>
</div>

If parent is locked and child receives a mouseevent, the event should be retargeted to the parent and not be dispatched to the child.

To write the test I had to use the EventUtils library
EventUtils has several different functions to deal with synthesizing mouse and key events, the one I was interested for dispatching mouse events was: synthesizeMouseAtCenter

Since the element is in fullscreen mode, and it doesn’t matter which specific position the mouse event occurs, synthesizeMouseAtCenter was perfect for the task.

Dispatching a mouse event with sythesizeMouseAtCenter involves the work of three functions:

1. synthesizeMouseAtCenter

The center of the element receiving the event is calculated by getting its the dimensions with getBoundingClientRect.

2. synthesizeMouse

Here the center of the element is calculated in a browser perspective.
Again getBoundClientRect is called, but this time the distance between the left and top border from the browser window is added to the center point of the element calculated in synthesizeMouseAtCenter

3. synthesizeMouseAtPoint

In the end synthesizeMouseAtPoint is called with the x,y coordinates of where the event should take place in the browser window, the type of event it should be dispatched and the window that will receive the event.

To dispatch the event the nsDOMWindowUtils::SendMouseEvent method gets called.


by diogogmt at January 31, 2012 07:24 PM


Catherine Leung

Setting up Thunderbird with Seneca’s new staff email system

I’m writing this blog because I think that there may be other fellow Senecan’s out there that might be in the same boat as me and I want to help them out.  Recently we changed over our email system to Microsoft Exchange Sever.  Now, while I had no great love for our old mail server, the new server meant that we had to update our email clients.   Helpdesk is supporting only outlook for mail clients and that just isn’t going to work for me.  They did however provide information on how to connect to the email server using IMAP.  This information is for the most part correct.  However, there are some things that don’t match up exactly with options available for Thunderbird.  So here is what you can do…

1) Thunderbird will auto detect your settings… this is probably the easiest way to do it and if I had let it do that I wouldn’t have been unable to sent email for a whole day :P .    Just go to the bottom of the account window, click on the account action button and choose add account and fill in the info in the dialog box and let Thunderbird do the rest.

2) If you want to manually set it up, the info supplied by ITS is correct however, there was a bit of confusion for me on the labelling.  For incoming server, choose SSL/TLS for outgoing choose STARTTLS

Anyhow hope this helps!


by Cathy at January 31, 2012 06:19 PM


Kezhong Liang

[Solved]Could not allocate requested partitions: requested size exceeds maximum allowed

We had a server which had 4 hard drivers made RAID10 using LSI hardware RAID card. The total size of hard driver was 4TB. I wanted to install Fedora 16 on it via graphical mode. I choose “Create Custom Layout” to assign partitions. After I assigned BIOS Boot, /boot, and swap partition, and I wanted to assigned the rest size to / partion, it prompted “Could not allocate requested partitions: requested size exceeds maximum allowed”.
I turned back, and pressed Ctrl+Alt+F2 to switch to text terminal,
# parted /dev/sda
(parted) mklabel gpt
(parted) quit
pressed Ctrl+Alt+F6 to switch to graphical terminal, choose “Create Custom Layout” to assign partitions again. Everything was ok.


Filed under: Uncategorized

by kezhong at January 31, 2012 05:24 PM


Ching Wei Tseng (Steven)

PointerLock [MouseLock] API Test – Part 2: Crashing the Test

This blog is a continuation of my previous blog on the PointerLock Tests and I initially didn’t even planned for a two part blog. This happened due to a failure of the test which caused it to crash.

The Crash

Overall, the crash was caused when a HTML element tag have CSS styling for the “display” attribute. In some of our test cases, we had CSS styles that looked like this:

<div id=”content” style=”display: none”>

The problem with having the “display” attribute set to none is that when trying to lock the mouse, the underlying code tries to get the element “rectangle”. This causes a problem when the “display” attribute is set to “none”, as there is no “rectangle” to be obtained. Thus the crash occurs. If the display is left in it’s default value, that is, the “display” attribute is set to “block” then the rectangle exists and the test does not break.

You may ask why I didn’t go through this crash issue before? Well, the crash seem to occur on isolated incidents on both Windows Build and Linux Build (where Raymond and I have our build on, respectively). For example, I had only two such occurrence that is is impossible for me to recreate to scenario to find a fix and the same happened to Raymond. However, when Dave pull the test from me and ran them, he gets the crash EVERYTIME!!! He was practically unable to run any of the test cases even once.

The Fix

Why is this crash odd? I do not have the answer and hopefully will get one soon from other developers (Dave is asking people involved with the API for feedback).

Until we get further feedback, we are working with a fix where when the element being locked have their “display” CSS attribute set to “none”, then the pointer will not lock. A test is also available to check for this, it is the file_pointerLockCSSDisplay.html file.

For a view on what was changed to incorporate this fix, look at the Diff on my Github account.

Outcome?

A crash like this brings up many questions. Questions like what other problems would the API run into. If someone didn’t put in the styling tag, we would not have known this problem at all. Another question, which is being discussed with people involved with the API specification, should we allow lock to occur when constraints like the “display: none” are present? Would it open up other problems with security? Who can answer these questions?

I wish I knew….

Note: Dave have this blog that explains the problem further


by Steven Tseng at January 31, 2012 03:29 AM

MouseLock API Test Update [0.1 Release]

Over the past week, I had been pushing myself to get the test for the MouseLock API up for review over the weekend or early next week. At the time of writing this blog, almost all the test are good to go. Like I just said, ALMOST!!

I was working with Raymond Hung to get these test completed. I mentioned in my previous blog about how I was struggling while trying to read other people’s code and make sure they work properly. Well, I am still fighting that war. It will be a war (with numerous battles, of course) that will not end until the day I retire. While reading other people’s code block, it does not just becomes a matter of getting the code to work. I involves a lot more work like making it readable so other people who will review my code will not have to go through what I went and also if they don’t understand, they’ll just throw my code back. It also involved ensuring that all the test follow a consistent format.

In this blog, I will talk about almost all the test we have worked with.

**Note: All the test being linked in this blog is on my GitHub account and as such, the files will be updated from time to time and some of them may even be taken down. It is also good to note that the MouseLock API Draft Specification had changed it’s name to PointerLock and I will be referring to PointerLock throughout this blog and any that may follow.

For those of you who have not been reading and have the time, you may follow up on what have been happening with this test suite through my blog section on the PointerLock API test.

For the impatient, well the test are to ensure that the PointerLock API does not crash for any possible edge cases we could think of. These test must work on Mochitest, Mozilla’s automated regression test framework.

Tests, the gritty details

First in the queue is the file_DOMtree.html. This test is used to check that the mouse can be locked only when the target element is in the current DOM tree. It also checks that if the target is “ripped” out of the current DOM tree while the element is in FullScreen and in locked mode, the mouse loses the lock.

Next up is the file_nestedFullScreen.html, where it test to ensure that when there is a nested HTML tag, lock is not allowed to the child element when the parent is in lock. Why would we do this? Well, ask yourself how many cross-hairs do you want to use when playing a first person shooter? The main reason for this is mainly be allowing lock on child element, it may open up security issues which we definitely don’t want.

Next (on the chopping block) is file_differentDOM.html, wherein we had to check that when there is an iframe element (my Nemesis while using Mochitest), any attempt to gain PointerLock from the content inside the iframe is denied as the requesting element belongs to another DOM which is different from the current active DOM (the parent of the iframe). I think if the child element within the iframe is allowed to lock the pointer, it may allow cross-site scripting which is BAD for the good guys and GOOD for the bad guys.

Now we have the file_fullscreen.html. This test validate checks for multiple scenario, such as:
  • pointer.isLocked, which is a validation checker, returns true if mouse is locked, false otherwise.
  • the pointer.lock() takes in three argument, namely, a DOM element, a success callback and a failure callback. [this method of operating is currently being debated and the folks are looking at using events instead of callback, which translates to (yup!) "more work"]
  • When the element is locked, it fires the appropriate callback immediately. This way depending on the result, the user can execute different actions accordingly. In my honest, I think callbacks are decent to work with, once you get the hang of it.
  • Finally, the pointer.unlock() method cancels the pointer lock and returns the pointer (known as a mouse now as it is no longer locked) to it original state and position.

Next up is file_doubleLockCallBack.html. This test is to check that when a pointer is locked, another instance of pointer.lock() still fires the success callback as the the element is still in FullScreen and pointer is still locked (DUH~!).

Now we have file_unlockOnUnload.html, where the pointer must lose it’s locked state when the window unloads. In a nut shell, a window is the first thing that gets loaded in a browser before the document gets loaded (this is properly explained here).

We then have file_extiMouseLockOnLoseFocus.html. As the name suggest, this test check to ensure that the pointer loses its lock state when the current window/document loses focus. A scenario of losing focus is when the user switches between tabs either through alt+tab or mouse clicks, then the window/document loses focus and pointer gets unlocked.

file_pointerLockLost.html is a test that is used to check that when the mouselocklost event fires, the bubble attributes are set to true, and the target attribute is the element that initiated the lock. (For details on what is an event bubbles, refer to this page).

The file_defaultUnlock.html file is used to check only when default keys are pressed with the element lose it’s locked state. For example, when a user press the letter “a”, the element should not lose it’s locked state. However, if they press the “ESC” key (which is set as the default), then the element loses its locked state.

In the file_userPref.html test, we check that there is a user preference available to allow users to enable the browser to lock the pointer/mouse. It would drive a lot of people mad if this option isn’t available, right?

Next up is file_constantXY.html (we a nearly done), where we test that when the mouse is unlocked, the movement between a point (X1, Y2) to another (X2, Y2) is different. However, when the pointer is locked, all the values should equal to zero.

Finally, file_targetOutOfFocus.html, is used to check that an element can be locked even when it is not in focus. For example, in a page with two div element, and div1 should be able to lock the pointer even though div2 maybe the element in focus. This is not similar to file_exitMouseLockOnLoseFocus.html, where focus is shifted entirely to another document.

Whew!!! That was a long test, as of now, I made a pull request to be merged with Dave Humphrey and he will post a patch on Bugzilla.

[Updated] More tests!!!

The file_cursorPosEvents.html is a test to check that the “mouseover”, “mouseout”, “mouseenter” and “mouseleave” events can be executed prior and after pointerlock.

The file_movementXY.html checks for multiple scenario:
  • They check that mozMovementX and mozMovementY are present in a mouse event object.
  • It also checks that value of mozMovementXY and it should be equal to the current screenXY minus the last screenXY.

What’s Left?

Well we currently have one test that is commented out as it is throwing a bunch of weird errors. It is the file_MouseEvents.html. A possible problem that we can think of is that we cannot pin point the exact location of the mouse before the lock to synthesize it properly.

What’s Next?

What’s next? I will be most likely be making small changes that may have formatting issues from Dave and other such little problem. I will also be waiting for a review on the next patch. Until then, I can return to my attention on the bug that I worked on partially (Bug 601535)

**Updated: There is a weird crash that caused the test to fail. Read my blog about it here.


by Steven Tseng at January 31, 2012 02:45 AM


Matthew Schranz

Bug 698381 – My Work So Far

When compared to bugs 698384 and 698385, this one is very similar. The problems I am finding myself having aren’t to do with how IDL defined optional arguments are handled but following the massive inheritance chain of nsIDOMNode. Compound that with the complexities of a code base like Mozilla and it can be pretty difficult at times really trying to figure out where or what you should be looking for.

Various helpful mxr searches have helped me find where cloneNode actually has been implemented (at least from what I can tell) however it seems to be more complicated than simply updating those methods to the new definition of cloneNode. Currently when compiling I get these errors:


/Users/matthewschranz/Sites/repos/mozilla-central/content/html/content/src/nsHTMLOptionElement.h:70:3: error:
      too many arguments to function call, expected 2, have 3
  NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::) 
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../dist/include/nsIDOMNode.h:225:135: note: instantiated from:
  ...* *_retval NS_OUTPARAM) { return _to CloneNode(deep, _argc, _retval); } \
                                                                 ^~~~~~~
/Users/matthewschranz/Sites/repos/mozilla-central/content/base/src/nsGenericElement.h:437:3: note:
      'CloneNode' declared here
  nsresult CloneNode(bool aDeep, nsIDOMNode **aResult)
  ^
In file included from /Users/matthewschranz/Sites/repos/mozilla-central/js/xpconnect/src/dombindings.cpp:1206:
In file included from ./dombindings_gen.cpp:3:
In file included from /Users/matthewschranz/Sites/repos/mozilla-central/content/html/content/src/nsHTMLSelectElement.h:61:

/Users/matthewschranz/Sites/repos/mozilla-central/content/html/content/src/nsHTMLFormElement.h:109:3: error:
      too many arguments to function call, expected 2, have 3
  NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::) 
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../dist/include/nsIDOMNode.h:225:135: note: instantiated from:
  ...* *_retval NS_OUTPARAM) { return _to CloneNode(deep, _argc, _retval); } \
                                                                 ^~~~~~~
/Users/matthewschranz/Sites/repos/mozilla-central/content/base/src/nsGenericElement.h:437:3: note:
      'CloneNode' declared here
  nsresult CloneNode(bool aDeep, nsIDOMNode **aResult)
  ^
In file included from /Users/matthewschranz/Sites/repos/mozilla-central/js/xpconnect/src/dombindings.cpp:1206:
In file included from ./dombindings_gen.cpp:3:


/Users/matthewschranz/Sites/repos/mozilla-central/content/html/content/src/nsHTMLSelectElement.h:262:3: error:
      too many arguments to function call, expected 2, have 3
  NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::) 
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../dist/include/nsIDOMNode.h:225:135: note: instantiated from:
  ...* *_retval NS_OUTPARAM) { return _to CloneNode(deep, _argc, _retval); }

The troubles I am having is attempting to figure out what those two forward declarations are calling.

Honestly this is the only thing that’s leaving me stuck at this point. For now I think I’ll go get myself level 1 Try server access so I can finish another ticket.


by Matthew Schranz at January 31, 2012 02:27 AM


Gang Li

RPM-Writing Lab 2

[root@fedora RPMS]# rpmlint x86_64
ocrad-debuginfo.x86_64: E: no-changelogname-tag
ocrad-debuginfo.x86_64: W: invalid-license free
ocrad-debuginfo.x86_64: E: debuginfo-without-sources
ocrad.x86_64: W: summary-not-capitalized C test
ocrad.x86_64: E: no-description-tag
ocrad.x86_64: E: no-changelogname-tag
ocrad.x86_64: W: invalid-license free
ocrad.x86_64: W: devel-file-in-non-devel-package /usr/include/ocradlib.h
ocrad.x86_64: E: info-files-without-install-info-postin /usr/share/info/ocrad.info.gz
ocrad.x86_64: E: info-files-without-install-info-postun /usr/share/info/ocrad.info.gz
ocrad.x86_64: E: info-dir-file /usr/share/info/dir
ocrad.x86_64: E: info-files-without-install-info-postin /usr/share/info/dir
ocrad.x86_64: E: info-files-without-install-info-postun /usr/share/info/dir
ocrad.x86_64: W: devel-file-in-non-devel-package /usr/libexec/libocrad.a
2 packages and 0 specfiles checked; 9 errors, 5 warnings

There is no %changelog tag in your spec file. To insert it, just insert a
‘%changelog’ in your spec file and rebuild it
%changelog
*Jan 26 renew

 /usr/bin/ocrad
   /usr/include/ocradlib.h
   /usr/libexec/libocrad.a
   /usr/share/info/dir
   /usr/share/info/ocrad.info.gz
   /usr/share/man/man1/ocrad.1.gz

 

[root@fedora SPECS]# rpmlint ocrad.spec
ocrad.spec: W: invalid-url Source0: ocrad-0.20.tar.gz
0 packages and 1 specfiles checked; 0 errors, 1 warnings.

[root@fedora rpmbuild]# rpmlint -i ocrad-0.20-10.fc16.src.rpm
(none): E: no installed packages by name ocrad-0.20-10.fc16.src.rpm
0 packages and 0 specfiles checked; 0 errors, 0 warnings.

[root@fedora rpmbuild]# rpmlint x86_64
(none): E: no installed packages by name x86_64
0 packages and 0 specfiles checked; 0 errors, 0 warnings


by ligangbory at January 31, 2012 02:02 AM

January 30, 2012


David Humphrey

How to crash like you mean it

I lost most of a day today trying to track down a bug in our Pointer Lock (nee Mouse Lock) implementation.  We’re literally within inches of being done this patch, and to be honest, I need to get it done so I can focus on other projects.  However, as is the case when programming, being close simply means you use smaller units to measure your distance, not that you reduce the number of steps.  I’m hopeful that we’ll have this thing back into review by mid-week.  But first a digression while we fix a newly discovered crash bug.

Raymond, Steven, Diogo and myself have been collaborating on the final implementation details and the tests.  Today I landed the bulk of the tests in my branch, which Raymond and Steven had written and/or fixed over the past few weeks.  I was keen to see how things stood, since Diogo and I had also rewritten some key parts of our code this week.  I ran the tests and 5 or 6 tests in, my browser crashed.  I hadn’t even had coffee yet (heya, Monday!).

Steven was online and quickly offered to fix the tests.  But I told him what I’m going to tell you right now: no web page (our tests are just HTML, CSS, and JavaScript–simple web pages) should ever be able to crash the browser.  Never.  Ever.  If you can crash the browser with JavaScript, it’s a browser bug, not (only) your bug.  I talk to lots of good web developers who all seem to think they’ve done something wrong when the browser crashes.  It’s never the web developer’s fault, because nothing in that page should be capable of causing the crash.  That isn’t to say that their code doesn’t do something odd, unique, or incorrect.  Doing something wrong is not the same as crashing.  Remember that.  If you can crash the browser, you should report the bug–it might even be worth something, if it’s an exploitable security issue (not all crashes are).

Unfortunately reporting this crash just meant swiveling around in my chair, so as to face the reflection in my second monitor.  The first thing you need when you crash is to know where you’re crashing, often called a ’stack trace,’ or just a ’stack’.  There are various ways to accomplish this, depending on the circumstances under which you crash.  Your standard Firefox browser keeps track of these via about:crashes (i.e, type that into your address bar).  Here you can see a list of crashes you’ve had (I have lots, maybe you have none).  If you click any of your crashes, you’ll be taken to Mozilla’s Crash Server, which will, among other things, allow you to see your crash stack.

This isn’t possible in my case.  I’m running a local debug build that I made, which isn’t hooked up to the crash server.  However, because I’ve made this build, and because it has debug symbols already (you want to make debug builds while you’re working on bugs for this very reason), I can simply attach my debugger to the browser before I crash, trigger the bug, and then look at the crash stack.

When you’re doing Mochitests, as we are, you can run your tests in a few different ways.  If you want to have time to attach your debugger to the running browser before the tests start, and then crash, you can do this:

python ./objdir-debug/_tests/testing/mochitest/runtests.py
  --test-path=dom/tests/mochitest/pointerlock

This runs the test runner, starting a simple web server and the browser, and points it at just the tests specified in the dom/tests/mochitest/pointerlock directory.  NOTE: before you do this, make sure your tests are copied into the object directory (i.e., make -C objdir-debug/dom/tests/mochitest).

Now you can attach your debugger (get your browser’s PID using ps or the like, then run gdb and type: attach <pid>).  Once connected to your running process, and all symbols loaded, you can tell the debugger to let your browser continue (in gdb, type ‘continue’).  Run your tests, and if all goes well, you’ll crash.

When I crashed this time, my debugger instantly came to life, and I was able to ask for a stack trace (e.g., a ‘backtrace’ in gdb, using the ‘bt’ command).  The full stack is here, but the top few frames (e.g., function calls) tell the story:

#0  ... in nsIFrame::GetStyleContext (this=0x0) at nsIFrame.h:716
#1  ... in nsIFrame::PresContext (this=0x0) at nsIFrame.h:546
#2  ... in nsIFrame::GetScreenRect (this=0x0) at /Users/dave/repos/mozilla-central/layout/generic/nsFrame.cpp:4197
#3  ... in nsEventStateManager::GetMouseCoords (this=0x10033ff20) at /Users/dave/repos/mozilla-central/content/events/src/nsEventStateManager.cpp:4136
#4  ... in nsEventStateManager::SetPointerLock (this=0x10033ff20, aWidget=0x127d2f240, aElement=0x119c70f80) at /Users/dave/repos/mozilla-central/content/events/src/nsEventStateManager.cpp:4111
#5  ... in nsDOMMozPointerLock::Lock (this=0x119adc190, aTarget=0x119c71000, aSuccessCallback=0x11b81a680, aFailureCallback=0x11b81a6a0) at /Users/dave/repos/mozilla-central/dom/base/nsDOMMozPointerLock.cpp:293

Here’s what this says. At some point nsDOMMozPointerLock::Lock() was called, which is what happens when the user calls navigator.mozPointer.lock() in JavaScript. This in turn called nsEventStateManager::SetPointerLock(), which stores a reference to the locked element on the nsEventStateManager. Part of that process involves figuring out where the mouse pointer is at the time of lock, since the spec says we need to keep track of this position so that we can return the mouse there when we unlock. The call to nsEventStateManager::GetMouseCoords() is where things go off the rails, as it tries to get dimensions for the element’s frame in the page–notice nsIFrame::GetScreenRect (this=0x0). The “this=0×0″ shows us we are calling a method on a null pointer; in other words, we have no frame for this element.

It’s definitely our code that’s causing the crash (our C++ code, that is). Now we have to figure out why. For the next little while we tried to isolate the specific test that was causing the issue. That turned out to be a losing battle, since we have so many tests, and since it seemed (initially) like it might be related to the interaction of multiple tests run in a particular order. Was it an OS X only bug? We didn’t seem to hit it very often on Linux. The fact that it didn’t crash every time was also frustrating.

Reducing it down to a particular test wasn’t going to work. We needed to understand why an element would not have a frame. I asked on irc, and instantly got the same answer from two people: display:none. Why does CSS hate me so? If you style an element display:none, it won’t have a frame, since it won’t be visible. Seems so obvious. But why were we hitting this in our tests? Surely no one would use display:none in…our…tests. Yet here were two cases of it:

<iframe id="iframe" style="display: none" ... >

...

<div id="content" style="display: none">
  <canvas id="canvas" width="150" height="150"></canvas>
</div>

Many, many tests in Firefox hide content that isn’t relevant to the test, and normally it wouldn’t matter. But in this case, it made a lot of difference. So first, we need to remove those display:none styles. But we also need to protect against an element not having a frame when lock is called, and losing its frame once locked (display:none style added after being locked). By doing these simple checks, we won’t crash in the future, no matter what the web developer does with the display style.

I wanted to write about this for my students who are doing work like this all semester, and will inevitably hit an issue like this in their own code. Crashes can be really useful when you have a strategy for using them to your advantage.

by david.humphrey at January 30, 2012 09:48 PM


Chris Choo

RPM Bulding Part 1


Alright folks, I am going to attempt to build a RPM package from one of my source packages. The first one I am going to attempt is proxyknife. So first we need to install these packages:

- yum groupinstall "Fedora Packager" 
- yum install rpmlint yum-utils 

Now after that we can create the rpm directories where we can work in by typing this command:

- rpmdev-setuptree 

After that is finished we can now start to work on our RPM, first we need to copy our source tarball to ~/rpmbuild/SOURCES 

- cp proxykinfe-1.7.tar.gz ~/rpmbuild/SOURCES

Now go into the SPECS directory so we can create the spec file to build the RPM:

- cd ~/rpmbuild/SPECS

In the SPECS directory we can now make the skeleton spec file for us to modify:

- rpmdev-newspec proxyknife

So with the skeleton spec file, I did some small configuration to the file to get it up and running then issued the command to build the RPM:

- rpmbuild -ba proxyknife.spec

In the beginning everything was going okay until the end where I got these bunch of errors: 


cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Customize-Request.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Index.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Sort-the-Result.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/index.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Command_002dline-Exclusive-Options.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Output.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Invoking.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Examples-of-startup-file.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Via-Proxy.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Startup-Options.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/General-Usage.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Introduction.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/GNU-Free-Documentation-License.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Copying-Source-Code.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Startup-File.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Contact.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Advanced.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Download-Proxylist.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Proxylist.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Copying-This-Manual.html': Permission denied
make[2]: *** [install-data-local] Error 1
make[2]: Leaving directory `/home/chris/rpmbuild/BUILD/proxyknife-1.7/doc'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/chris/rpmbuild/BUILD/proxyknife-1.7/doc'
make: *** [install-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.ef2HEI (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.ef2HEI (%install)


My overall thoughts on why this is happening is maybe because I needed to be root to install this source program last time? This could be the issue why it keeps failing.

After doing some editing to my spec file I still was getting that error. After looking at the errors logs it looks like it keeps erasing the documents during the end of the make part and it is getting permission denied, that is the reason why my RPM is not building. Maybe a little more research on the issue might help so I am going to leave it as it is for now until I get some solid answers to tackle my issue.

by Chris Choo (noreply@blogger.com) at January 30, 2012 05:41 PM

January 29, 2012


Gary Kwong (nth10sd)

January 28, 2012


Kezhong Liang

Install and configure Zabbix on Fedora 16

Install packages
# yum install zabbix zabbix-agent zabbix-docs zabbix-server zabbix-server-mysql zabbix-web zabbix-web-mysql
# yum install mysql-server httpd curl-devel net-snmp net-snmp-devel iksemel iksemel-devel

Enable mysqld, httpd, zabbix-agent and zabbix-server boot up automatically
# systemctl enable mysqld.service
# systemctl enable httpd.service
# chkconfig zabbix-agent on
# chkconfig zabbix-server on

Start mysqld and httpd service
# service mysqld start
# service httpd start

Set MySQL root password and import database
# mysqladmin -u root password [whateverpasswd]
# mysql -uroot -p
mysql> create database zabbix;
mysql> quit
# cd /usr/share/doc/zabbix-server-mysql-1.8.10/create/schema
# mysql -u root -p[whateverpasswd] zabbix < mysql.sql
# cd ../data
# mysql -u root -p[whateverpasswd] zabbix < data.sql
# mysql -u root -p[whateverpasswd] zabbix < images_mysql.sql

Change items in configuration files
# vi /etc/zabbix/zabbix_agent.conf
# vi /etc/zabbix/zabbix_agentd.conf
    change from “LogFileSize=0″ to “LogFileSize=1024″
    change from “# DebugLevel=3″ to “DebugLevel=4″
# vi /etc/zabbix/zabbix_server.conf
    change from “LogFileSize=0″ to “LogFileSize=1024″
    change from “# DebugLevel=3″ to “DebugLevel=4″
    change from “# DBPassword=” to “DBPassword=[whateverdbpasswd]“

Create zabbix user and grant its privileges
# mysql -uroot -p
mysql> create user ‘zabbix’@'localhost’ identified by ‘[whateverdbpasswd]‘;
mysql> grant all privileges on zabbix.* to ‘zabbix’@'localhost’ with grant option;
NOTE: The websites I read did not mention this step. If you ignore it, you will see the following errors in the log file.
3548:20120127:115321.384 Database is down. Reconnecting in 10 seconds.
3548:20120127:115331.384 [Z3001] connection to database ‘zabbix’ failed: [1045] Access denied for user ‘zabbix’@'localhost’ (using password: YES)

The errors will occur on Fedora 14:
1830:20120111:202637.548 In DBconnect() flag:1
1830:20120111:202637.549 [Z3001] connection to database ‘zabbix’ failed: [1044] Access denied for user ”@’localhost’ to database ‘zabbix’
1830:20120111:202637.549 Cannot connect to the database. Exiting…

Start zabbix-agent and zabbix-server services
# service zabbix-agent start
# service zabbix-server start

Configure PHP
# vi /etc/php.ini
    change from “;date.timezone =” to “date.timezone = “America/Toronto”"
    change from “memory_limit = 128M” to “memory_limit = 256M”
    change from “post_max_size = 8M” to “post_max_size = 32M”
    change from “upload_max_filesize = 2M” to “upload_max_filesize = 16M”
    change from “max_execution_time = 30″ to “max_execution_time = 600″
    change from “max_input_time = 60″ to “max_input_time = 600″

Restart httpd service
# service httpd restart

Installation from browser
Open Firefox browser and input “http://[serverIP]/zabbix”.
If you can connect to the server, close the firewall
# iptables -F

Click “Next”


Click “I agree” and click “Next”

Click “Next”


Input password, click “Test connection” and click “Next”


Click “Next”


Click “Next”


Click “Next”


Click “Finish” and you can see the login page

Input “Admin”, and its default password “zabbix”, and then you can enter.

Change default Admin password
# mysql -uroot -p
mysql> use zabbix;
mysql> update users set passwd=md5(‘[wahteverpasswd]‘) where alias=”Admin”;
mysql> quit

After everything is ok, you can adjust DebugLevel back
# vi /etc/zabbix/zabbix_agentd.conf
    change from “DebugLevel=4″ to “DebugLevel=3″

# vi /etc/zabbix/zabbix_server.conf
    change from “DebugLevel=4″ to “DebugLevel=3″

# service zabbix-server restart
# service zabbix-agent restart

Disable SELinux, when you use zabbix
When I used Fedora 14 as server before, I found it occurred the below measages
fclose() expects parameter 1 to be resource, boolean given [api/classes/class.cscript.php:626]
Error Description: Permission denied

After I set SELinux, the problem was solved
# setsebool -P httpd_can_network_connect 1
But on Fedora 16, it didn’t work, so I did “setenforce=0″ temporarily.

Reference
http://www.zabbix.com/


Filed under: Uncategorized

by kezhong at January 28, 2012 07:21 PM


Scott Downe

OSD 700 project release 0.4

For school, I am doing project releases in courses OSD600 and OSD700.

In OSD600 I completed three iterations, 0.1-0.3. Now in OSD700, I need to do 0.4-1.0.

This post will outline what I did for 0.4.

I’ve started by taking Firefox bug 677122 which was labeled as “not quite as easy”. I am always up for a challenge. For the tl;dr check my diff.

I will talk about what I did right, what I did wrong, and what I learned.

Three main things I did in this release are:

Created a working Firefox build on Windows. Which was not quite as easy because of bug 718541. I ended up narrowing what was needed to get a working build, and adding my findings to the ticket. Now being able to reproduce this problem, in hopes that it can be used to track down the exact cause. The ticket is now fixed.

Got a working developer environment working on Windows with Visual Studio 2010. This took more time than I wanted, as I am so used to web development where things like firebug work right out of the box. In other courses and projects, the code base is small enough that I don’t need any real developer tools, except my mind.

The real work was done in bug 677122. I had three attempts on this, and will describe each one, and why the first two failed and last succeeded.

First attempt was to wire the go to anchor code to process media fragment code. This failed because process media fragment should not be called out of context. It was originally a protected function, so that there should of been a red flag that this was going to fail. I moved it to public, then in the anchor code I would get a reference to the media element, and call ProcessMediaFragment, which would crash when trying to grab the mLoadingSrc. I suspect this is due to the way the media element lives in the media document. I loaded up firebug and actually looked at it, and it did not even have a src attribute attached to it. Probably why it failed, as it was not completely what I wanted. I did manage to parse the fragment code so I knew the difference between a fragment and an anchor, which would be crucial in the third attempt.

Second attempt was to try to get around the loading src, by doing this at a different time, or by calling a different function. Both attempts failed for similar reasons. I don’t think the timing was even the problem, but the reference to the element itself. A media document’s video element is not complete, and should not be used as such. It is a different beast. I tried things like, LoadWithChannel and resetToURI which both failed because they would access an element that was not what they expected it to be. Again, it doesn’t have a src attribute like most media elements. I also tried to do the work in the InternalLoad function, before the anchor code. This failed for the same reasons, but did get me choking off the GoToAnchor code, which helped me find the next part.

Third attempt was actually putting together two elements from the failed attempts. I moved the check for anchor or fragment to the InternalLoad, where I choked off the anchor code. It was as simple as that. Check for fragment and choke of the anchor. Once done, let the rest of the code to continue on its way. I have created a patch for this and submitted it for feedback in the ticket.

The biggest lesson I learned was a soft lesson. I should of probably asked for help between Monday’s post and Wednesday’s post. In retrospect, reading those posts now, I can see the naivety in my attempts. I was so positive about some of my solutions, and I can see it in my words. This will get better when I get more comfortable in the community, as I have been here before.

Some smaller lessons were more technical things about Firefox code. Like how to get a reference, cast it, string management, etc. These are things specific to Firefox code, and not really C++.

Warning, some of the links to Firefox source code will bitrot as the code changes and the lines where things live changes. Not sure of a better way to link to the source code.

Thanks for reading :)


by scottdowne at January 28, 2012 06:50 PM


Chris Tyler (ctyler)

Seriously, CBC?


Going to the CBC this morning, I found this:

I have three problems with this:

  1. The CBC is our public broadcaster, funded in large part by tax money. It should support wide access.
  2. I'm not running IE, I'm running Firefox. The ad is lying to me. If they're able to detect I'm not running the latest version of IE, they should also detect that I'm not running IE at all. My browser is not old, either -- I'm running the latest release of Firefox, which contains several features not yet supported by IE.
  3. IE does not run on my platform (Linux). The ad is a waste of time for me and a waste of money for the advertiser. The pages to which the ad links are all specific to Windows, with no consideration for those running Mac OS/X, Linux, or any other platform.

The ad text seems to imply endorsement. Does the CBC actually endorse the position that the only acceptable end-user computing platform is Windows on an x86 computer? Is increasing the monopoly of a foreign corporation a suitable goal for a taxpayer-funded public broadcaster? I trust not.

by Chris Tyler (nospam@example.com) at January 28, 2012 05:51 PM

January 27, 2012


Justin Robinson

Total eclipse of the heart

Great. My Eclipse is broken now after I tried to put in an MXML highlighter. This could prove problematic.

UPDATE: I thought I fixed it by uninstalling the highlighter. Nope. The FDT plugin for Eclipse keeps shutting down the entire application, claiming that I’m missing Flex 3.6 SDK and the Flex 4.5 SDK, even though installing 4.5 was one of the steps for getting the Dev env working in the first place. Even uninstalling Eclipse doesn’t work, because then I try to reinstall it and it still has the same plugins somehow.

UPDATE: Either it’s impossible to uninstall Eclipse, or sudo apt-get purge eclipse doesn’t do what I think it does.

UPDATE: Alright, the version of Eclipse I was using is completely gone, and I downloaded a different one more tailored to Java development. Why I wasn’t using it in the first place, I don’t remember. Anyway, now I have to pull what I committed to the repo back out, since apparently some of my local copies are corrupted, and put everything back where it’s supposed to go. And figure out why Eclipse now wants to open Actionscript in a gedit window rather than, y’know, ECLIPSE.

Oh, it’s Monday alright.

UPDATE: Fixed the Editor problem. From the top menu, go into Window -> Preferences, then choose General -> Editors -> File Associations. Add *.as to the File Types pane, highlight it, and add Java Editor as an associated editor. Easy peasy. Now to fix the missing files.

UPDATE: And now I have to reinstall parts of BigBlueButton, because hey why not? I think the moral of this story is clear: don’t download the FDT plugin for Eclipse! Jeez, what a headache. It’s nearly noon and all I’ve been able to work on is repairing the damage from that plugin.

UPDATE: Okay, this stopped being funny two and a half hours ago. After being forced to reinstall parts of BigBlueButton, I try to run commands like bbb-conf and get the message “# BigBlueButton does not appear to be installed … exiting” What in the sam hill is going on?

UPDATE: Finally, everything compiles again and BigBlueButton has remembered that it does, in fact, exist. I had to re-do the step from the DE instructions that would make the red5 folder writeable (sudo chmod -R o+w /usr/share/red5/webapps)


by Justin at January 27, 2012 09:10 PM

Hip to be Square

Do you like Huey Lewis and the News? The voting window works now, it appears in the client window for all users but not the presenter, just like it’s supposed to. My next task is to figure out how to get the radio buttons to look like ordinary radio buttons; at the moment, they are (somehow) rectangles with rounded corners.

The weird thing is, I can’t find anywhere in the code that tells the radio buttons to come out as square instead of round, and all the examples I’ve found of AS radio buttons show them as round by default. This may be the only application in the world that uses square radio buttons. Weird.


by Justin at January 27, 2012 08:36 PM

The main() Event

Alright, so we figured out last night just before quittin’ time how to deal with what I’ve been calling our Las Vegas problem (that being, whatever happens in nc.call STAYS in nc.call). We just need to make sure the entire chain of events that needs to happen once the client-side getPoll() starts occurs within nc.call until it gets to a point where it sends data back to the server. Once it’s in Java’s hands, we don’t have to care if Actionscript develops amnesia or not.

(Unrelated to Big Blue Button, I keep seeing the Money Mart pig out of the corner of my eye and thinking it’s someone approaching my cubicle. Weird.)

UPDATE: Alright, I’ve made a pretty big breakthrough here. Moving the pig to a different part of the divider prevents – okay, seriously, I’ve just been experimenting with Event handling in Actionscript to get the voting window to appear. I’m not sure how we’re going to test this efficiently, though, considering we’ll need to log in as a presenter, make a poll, and log in again to the same room as a user without the presenter logging out; that would destroy the poll. Maybe Anatoly knows how we could make the voting window appear to the presenter as well as everyone else, and then we can just switch that feature off when we’re done testing. I’ll have to talk to him about that when he gets in.

But yeah, moving the pig was a good idea too.

UPDATE: Well, that was an easy solution. I log in as a presenter through Firefox, and as a student through Chrome with a different name. Bam, lecture room.


by Justin at January 27, 2012 02:06 PM


Lukas Blakk (lsblakk)

Growing the company, structuring volunteerism: My response to David Eave's community lifecyle audit

Last Wednesday David Eaves presented the results of the multi-tiered contributor lifecycle audit (watch the video).  A few points really grabbed my attention and as someone with a background in arts & education non-profits I feel the need to share my experiences alongside my reactions to this talk.

David pointed out that as we are growing, we can hire people to solve problems, so what exactly do we need volunteers for? Survey results showed that contributors often don't feel their contributions had much impact on the project and that as our paid staff pool grows in size, there is less clarity about what exactly a volunteer's importance is to the critical path of Mozilla's mission.  I wish we had this data prior to the 1+ year push to releasing Firefox 4.  My hand-waving hypothesis would be that as we were cramming to get a product out the door we forgot to be leaders of volunteers and instead unconsciously pushed them aside so that things could get done on a schedule.  It was a stressful time, but now that we've moved on to regular, rapid releases perhaps we paid staff can all take a step back and really assess how we incorporate the work of volunteers into our individual areas.

For many Augusts I have worked at a women's music festival in the woods of Michigan and at that festival there is a kitchen that has pumped out 3 vegetarian meals a day for 5 days to 4000-8000 attendees depending on the year.  This festival relies on a core group of 'workers' who are in fact volunteers but let's pretend that group of 500-600 people is like the paid staff of Mozilla.  The main kitchen work crew gets about 30 workers to run the kitchen.  You might think to yourself "but 30 people cannot produce enough food for 4000-8000 women" and you'd be very right.  The way it works is that all attendees of the festival are asked to do two 4 hour workshifts during the week they attend the festival.  The majority of workshifts center around the main kitchen and creating the meals which range from burrito night to pasta putanesca to nutloaf (a vegetarian version of meatloaf). All these meals involve preparation of pounds upon pounds of vegetables as well as cooking of pasta, beans, sauce.  Did I mention this was all in the woods, over a massive firepit?  Yup, so 30 women are in charge of making that entire process work and they do so by wrangling hundreds of volunteers per day into shifts around each meal and constantly leading and dividing up the work so it can be done by many hands yet results in one huge meal - 3 times a day!

So let's go back to people who are volunteering not feeling clear about how Mozilla works and whether their time and effort has impact.  How can we make sure that the smallest task makes that person feel like they've contributed?  Some areas of Mozilla do this very well to name a few; AMO, SUMO, QA, and Personas. These teams manage tons of volunteers and have tasks with measurable outcomes (tests run, filing bugs, approving an add-on, answering a question in the knowledge base, shrinking the queue of pending Persona submissions) and sometimes they can use scoreboards or themed days to get volunteers mildly competitive for the respect of their peers and accomplish larger goals in a short burst. I'd encourage people interested in having volunteers participate in their team's work think about how to make sure their volunteers have tools to measure their impact from the get-go.  In Release Engineering I would measure the number of bugs that we have yet to fix, many of them labelled "simple" or "old".  If I had volunteers doing RelEng work I could keep track of their progress and post reports (as blog posts) of who fixed what when and how as the number of bugs shrank.

Another interesting result from the survey: older folks (34-55!) aren't on-ramping as much as younger ones. At first I wondered how much of this was about access to the muscle memory of being a student.  I think it's fair to assume that many students/youth can have a lot more time to contribute to projects like Mozilla as certain adult responsibilities may not be required of them yet. Over the past week though, I have started to visualize another take on this. In the arts & social justice organizations I have been involved with there have been plenty of adult volunteers but those organizations have a different need for volunteers. The music festival I mentioned would not happen if it wasn't for volunteers.  The fact that the volunteers want the community of the festival to exist for them every year becomes the carrot drawing women of all ages to come to the woods of Michigan and build a music festival every year.  People quit jobs, take unpaid leave, and make plenty of other sacrifices of their time to participate in creating this community. The thanks for this 2-4 weeks of donated work is an amazing live/work experience camping with 5000 women on private land, having workshops, parties, and dances all in a very natural, safe, and ad-free environment and watching incredible performances all day and night for 5 days. 

In a different example, let's look at a the Toronto International Film Festival.  Volunteers have to make it through the rigorous screening and application process in order to 'get' to volunteer for the festival. They are rewarded with behind-the-scenes access to the festival, sometimes a quick run in with a movie star, and free tickets to festival screenings.  The festival shows entirely world-premiere films so this is a huge deal for a volunteer.  Several films will see theatrical releases after the festival but seeing the premiere, often with the star in attendance and with a director Q&A post-screening really sweetens the experience. The volunteers also get thanked before every screening with a cute trailer from the sponsor for the volunteer program and there's always a fantastic party post-festival as the final thank you. 

At Mozilla we do thank our volunteers with tshirts and sometimes bringing them to summits, MozCamps, or other parties. For older volunteers though, I wonder if that's enough.  What does it take to get someone in the 34-55 range to donate their time?  I'm really interested in this one since I fall in that demographic as well.  For me, I need the time donated to do at least one of the following things:
  • be social, meeting new people in the community I chose to volunteer in is a big part of why I'd do it in the first place
  • provide a networking opportunity (similar to above, but might apply to folks on the job market a bit more accurately)
  • get me free access to an event I wouldn't attend if it wasn't
  • be something my friends are also doing so we are visiting with each other while doing something interesting
  • be for a very good cause so I feel good just helping that cause regardless of the tasks I perform
Let's look at that last one.  The good cause is certainly in the eye of the beholder but I can honestly say that sometimes I have no idea why I would want to encourage a friend who volunteers for hospice care, homeless shelters, AIDS awareness, or other non-profits where the staff is small and the operating budget miniscule to come and contribute to Mozilla.  In the circles I travel in outside of my job Mozilla seems right up there with Google, Apple, and of course Microsoft.  Sure, a lot of people don't know we're a non-profit. I tell people that all the time and while it's of interest to them, it doesn't generate an "Oh! Can I volunteer there then?" kind of response.  We compare ourselves sometimes to the Red Cross or Boy Scouts - large organizations with volunteer bases - but I think we should start to re-think ourselves more like the film festival or the music festival.  We pay competitive salaries to our employees, we throw amazing events, and we don't have to write grant applications every year to the government (like in Canada) or to private funds (like in the US) to ensure we can keep operating on a shoestring budget.  So even though Mozilla is a GREAT cause, I don't think that's the bait for the on-ramping of volunteers - especially non-students and people in the 34-55 age range.


What's going to encourage 34-55 year olds to engage with Mozilla?  In my opinion it's going to happen with targeted events where they can do something in a few hours that leaves them feeling connected and fulfilled and even better if it makes something in their life easier.  A while back, in Toronto, we did a day of service and set up an info table at the local library so people could come and ask anything about Firefox and even though by some ironic twist the library's internet died we still had an amazing day just conversing with people and answering questions about Firefox, the web, security, and even general computing questions.  According to David "having good experiences in the project helps one to want to find others and pull them in" and "age and gender have no impact on the willingness to on-ramp, but the longer you volunteer with Mozilla, the less you on-ramp".  My approach with trying to on-ramp then, in light of this, would be to look at getting a lot out of that short interaction. Help someone help themselves on their computer. Teach them a few keyboard shortcuts or how to install an add-on that helps them do what they already do faster and with more confidence.  Then encourage them to come back and teach someone else what they learned.  This can spread like a pyramid scheme and it's no longer about getting a single volunteer to stick around for a long time, it's just about having a good experience and carrying that forward. Potential volunteers can be motivated by the mission and/or by practical considerations it's important to remember both have tremendous value to the Mozilla project.  I think it's important to encourage 34-55 year olds by believing it's OK for a contributor to do a one-off in a few hours as long as they walk away happy.

In conclusion of this very long post, I want to circle back to measuring. If we are going to make community a core part of what we do then we need to measure it we currently do not have an institution-wide measurement of contributions, volunteer performance cannot be evaluated, there is no structure for including volunteer engagement during strategic or operational planning.  Until we require Directors to create annual and quarterly goals that include measurable goals around volunteer growth, retention, participation, and effectiveness we will only see people (like myself) trying to do this "off the corner of their desks" which means it's not a part of your paid work and thus less likely to be sustainable and effective. The Toronto International Film Festival is a great example of what we could do here.  They have paid staff who organize the volunteers each year. They have a clear path for volunteers to follow to be accepted - training sessions are mandatory.  Each year returning volunteers are given roles depending on performance from previous years.  The record kept of each volunteer's performance allows paid staff to request certain volunteers for specific tasks based on that information and a volunteer's history with the organization.  Teams of volunteers will sometimes have "Captains" who are also volunteers but with more experience and they are thus given more responsibility.  Each area of Mozilla that can accommodate volunteers should keep an eye out for their current or potential "Captains". David also suggested that, while we avoid it, we should really look head on at guidelines for when to rely on volunteers and when to not - this seems to fly in the face of open source "free for all" mentality but if we compare ourselves to other non-profits like TIFF there is proof that having some structure for volunteers allows staff and teams to develop stronger relationships and the work gets done smoothly, which was really the point all along.

Don't forget to throw them fabulous parties, share with the world the importance and impact of their contributions, and remember you can never thank a volunteer too much.




by Lukas Blakk (noreply@blogger.com) at January 27, 2012 02:00 AM


Jayaditya Mulwani

Installing from Source

Hi Guys,
So the source code that I picked was Units. Which pretty much
calculates the value and changes it to a unit that the user has specified.
For example if I wanted to calculate 100km/h to m/h this is the tool to use.

Anyways long story short: Here are the steps that I went through
in order to install the package to my machine.
1. Go to the Website gnu.org/software as per Chris's Instructions
2. I copied the link of the source code and ran wget <link> command on
Terminal.
3. After downloading the package, I ran the
command time tar -xvf <filename.tar.gz>.Here are the results
[jmulwani@fedora ~]$ time tar -xvf units-1.88.tar.gz
units-1.88/
units-1.88/Makefile.in
units-1.88/COPYING
units-1.88/units.dat
units-1.88/strfunc.c
units-1.88/units.info
units-1.88/parse.y
units-1.88/Makefile.dos
units-1.88/parse.tab.c
units-1.88/configure
units-1.88/units.h
units-1.88/units.texinfo
units-1.88/texi2man
units-1.88/NEWS
units-1.88/INSTALL
units-1.88/getopt.h
units-1.88/units.dvi
units-1.88/ChangeLog
units-1.88/install-sh
units-1.88/units.man
units-1.88/README.OS2
units-1.88/configure.ac
units-1.88/getopt1.c
units-1.88/units.c
units-1.88/makeobjs.cmd
units-1.88/getopt.c
units-1.88/README
units-1.88/mkinstalldirs
units-1.88/Makefile.OS2
units-1.88/units.doc
real    0m0.026s
user    0m0.018s
sys     0m0.013s
4. After I ran this command I had successfully unpacked the tarball.
NOTE: The highlighted Directory in green after unpacking.
If you do not get the above results, you may be typing the wrong filename or
maybe in the wrong directory
[jmulwani@fedora ~]$ ls
dead.letter  Documents  Music     Public    Templates   units-1.88.tar.gz
Desktop      Downloads  Pictures  rpmbuild  units-1.88  Videos
5. I then changed directory to the units-1.88 using the cd command.
6. Finally in order to install the program I first read the read me. But if you don't
want to read the documentation,simply issue the command ./configure
or time ./configure if you want to know how long this took.
Here are the results
[jmulwani@fedora units-1.88]$ time ./configure checking
for gcc...
gcc checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none
needed checking for an ANSI C-conforming const... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for sin... no
checking for tparm in -lncurses... yes
checking how to run the C preprocessor...
gcc -E checking for grep that handles long lines and -e...
/bin/grep checking for egrep... /bin/grep -E checking
for ANSI C header files... yes checking for sys/types.h... yes
checking for sys/stat.h... yes checking for stdlib.h...
yes checking for string.h... yes checking for memory.h... yes
checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h...
yes checking for unistd.h... yes checking for readline in -lreadline... yes
checking readline/readline.h usability... yes checking readline/readline.h presence... yes
checking for readline/readline.h... yes checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes checking for strchr... yes
checking for strspn... yes checking for strtok... yes configure:
creating ./config.status config.status: creating Makefile
real    0m1.622s
user    0m0.602s
sys    0m0.428s
7. I then issued the command time make to compile the program. Here are the results

[jmulwani@fedora units-1.88]$ time make gcc
-DUNITSFILE=\"/usr/local/share/units.dat\"
-DREADLINE -DPACKAGE_NAME=\"GNU\ units\" -DPACKAGE_TARNAME=\"units\" 
-DPACKAGE_VERSION=\"1.88\" -DPACKAGE_STRING=\"GNU\ units\ 1.88\"
-DPACKAGE_BUGREPORT=\"adrian@cam.cornell.edu\" 
-DPACKAGE_URL=\"http://www.gnu.org/software/units/\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -g -O2 -I. -c units.cgcc
-DUNITSFILE=\"/usr/local/share/units.dat\"  -DREADLINE
-DPACKAGE_NAME=\"GNU\ units\" -DPACKAGE_TARNAME=\"units\" 
-DPACKAGE_VERSION=\"1.88\" -DPACKAGE_STRING=\"GNU\ units\ 1.88\"
-DPACKAGE_BUGREPORT=\"adrian@cam.cornell.edu\" 
-DPACKAGE_URL=\"http://www.gnu.org/software/units/\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 
-DHAVE_UNISTD_H=1 -g -O2 -I. -c parse.tab.c gcc
-DUNITSFILE=\"/usr/local/share/units.dat\"  -DREADLINE -DPACKAGE_NAME=\"GNU\ units\"
-DPACKAGE_TARNAME=\"units\" 
-DPACKAGE_VERSION=\"1.88\" -DPACKAGE_STRING=\"GNU\ units\ 1.88\"
-DPACKAGE_BUGREPORT=\"adrian@cam.cornell.edu\" 
-DPACKAGE_URL=\"http://www.gnu.org/software/units/\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -g -O2 -I. -c getopt.cgcc
-DUNITSFILE=\"/usr/local/share/units.dat\"  -DREADLINE -DPACKAGE_NAME=\"GNU\ units\"
-DPACKAGE_TARNAME=\"units\" -DPACKAGE_VERSION=\"1.88\"
-DPACKAGE_STRING=\"GNU\ units\ 1.88\" -DPACKAGE_BUGREPORT=\"adrian@cam.cornell.edu\"
-DPACKAGE_URL=\"http://www.gnu.org/software/units/\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -g -O2 -I. -c getopt1.c gcc  -o units
units.o parse.tab.o getopt.o getopt1.o  -lm -lreadline
-lncurses sed s!@DATAFILE@!/usr/local/share/units.dat! ./units.man > units.1
real    0m1.362s
user    0m0.755s
sys    0m0.057s

8. (Optional) I then ran the command time make check to ensure that the program
compiled properly. Here are the results:
[jmulwani@fedora units-1.88]$ time make check
Checking units Units seems to work
real    0m0.014s
user    0m0.005s
sys    0m0.005s
9. Step number 8 is not required but it ensures that the software is working properly.
Usually takes longer depending on size of package.
10. Finally I ran the command time make install in order to install the
software to my machine. Here are the results:
[jmulwani@fedora units-1.88]$ time make install
./mkinstalldirs /usr/local/share/man/man1 /usr/bin/install -c -m 644 units.1
/usr/local/share/man/man1/`echo units|sed 's,x,x,'`.1 /usr/bin/install:
cannot remove `/usr/local/share/man/man1/units.1': Permission denied make: ***
[install-man] Error 1
real    0m0.105s
user    0m0.003s
sys    0m0.002s 
11. NOTE: This command did not work because I was a regular user so I was
denied access. I just ran the command su - to become root and ran the above command again.
Here are the results: 
[root@fedora units-1.88]# time make install
./mkinstalldirs /usr/local/share/man/man1 /usr/bin/install -c -m 644 units.1
/usr/local/share/man/man1/`echo units|sed 's,x,x,'`.1
./mkinstalldirs /usr/local/bin /usr/local/share /usr/bin/install -c
units /usr/local/bin/`echo units|sed 's,x,x,'`
/usr/bin/install -c -m 644 ./units.dat /usr/local/share/units.dat
real    0m0.499s
user    0m0.131s
sys    0m0.027s

12. FINISHED. Let me show you the program I installed:
[jmulwani@fedora ~]$ units
2526 units, 72 prefixes, 56 nonlinear units
You have: 100km
You want: miles     
* 62.137119     
/ 0.01609344
You have: 100 CAD
You want: USD     
* 94.44     
/ 0.010588734
A VERY USEFUL TOOL IF YOU ARE AN INVESTOR

;)

My next step is to figure out how to repackage the software by making my custom spec file. UNTIL THEN

Cheers

by jmulwani at January 27, 2012 01:27 AM

January 26, 2012


Mohammed Buttu

DPS911 Release 1

Introduction

This is my first release for David Humphrey’s DPS911 open source class. I am currently working on three projects: Popcorn Maker, Popcorn Maker FCP (the Mac version of the web-based Popcorn Maker), and TestSwarm for Popcorn. Below is a description of the bugs I am working on for each project. Although the patches submitted for Popcorn Maker are small, it took time to find the right area in the code to actually make the fix.

Here is a table quickly summarizing the work done for the first release. The blog posts for bug 67 and 157 explain the problem and the solution; this blog post talks about how I went about solving them, and what issues I ran into. This post also talks about the progress of the work being done for Popcorn Maker FCP and TestSwarm for iOS.

Summary of First Release for DPS911
Popcorn Maker
Bug Blog Post Tweet
Bug 67 Popcorn Maker – Bug 67 Tweet
Bug 157 Popcorn Maker – Bug 157 Tweet
Popcorn Maker FCP
Bug Blog Post Tweet
Custom DMGs for release builds Still working on it
TestSwarm for iOS
Play videos automatically Still working on it

Popcorn Maker

Bug 67

Bug 67 is on Lighthouse; the issue is that users are able to change a media source to nothing, which leaves the application in a broken state. The fix to this problem is explained in my blog post titled “Popcorn Maker – Bug 67.” That, however, was not my first solution before posting the patch up for review. My first solution involved editing two files, butter/src/core/media.js, and js/menu.js.

butter/src/core/media.js

  Object.defineProperty( this, "url", {
	get: function() {
	  return url;
	},
	set: function( val ) {
	  if ( val && val.length > 0 && !/^\s*$/.test( val ) && val !== url ) {
		url = val;
		em.dispatch( "mediacontentchanged", that );
	  }
	}
  });

js/menu.js

  buttonManager.add( "change-url", $( ".change-url-btn" ), {
	click: function() {
	  var newUrl = $('#url').val();
	  popupManager.hidePopups();
	  if ( !newUrl || newUrl.length === 0 || /^\s*$/.test( newUrl ) ) {
		popupManager.showPopup( "load-failed" );
		return;
	  }
	  if ( newUrl !== butter.currentMedia.url ) {
		butter.currentMedia.url = newUrl;
		$(".media-title-div").html( newUrl );
		pm.toggleLoadingScreen( true );
		function changeComplete( media ) {
		  pm.toggleLoadingScreen( false );
		  butter.unlisten( "mediacontentchangecomplete", changeComplete );
		}
		butter.listen( "mediacontentchangecomplete", changeComplete );
	  } //if
	} //click
  }); //change-url-btn

This code is also up on pastebin.

There is the same check going on here in two different places:

if ( !newUrl || newUrl.length === 0 || /^\s*$/.test( newUrl )

This is checking to make sure that the new URL is defined, is not empty, and is not a string full of spaces. Based on the title of the ticket, which reads, “Don’t let a user commit a blank field for timeline media change,” it sounds like changing the URL source to nothing should be handled in the core of Butter. That’s why there is a check in the butter/src/core/media.js: if it is not allowed to be blank, then having this check will protect any function that sets the currentMedia.url property of an instance of Butter to an empty string. If it’s handled there, then why do the same check again in js/menu.js? The reason for the check on the UI side is to give an appropriate error message, and to stop from making a call that we know will not work. It’s similar to a client application calling a web service: the web service has its own checks that it does server side. Often, however, these checks are also done on the client side to avoid making round trips and putting a greater load on the server if it’s known ahead of time that what’s being entered is invalid. For example, submitting a blank field when asked to enter your credit card number will not be accepted on the server side. So to save the server some work, and for quicker feedback to the user, a check is made client side and the user is presented with an appropriate error message saying that the credit card field is blank. The same type of logic applies to this first solution: why make Butter do work trying to change the media’s source when it’s known what’s being sent as the new media source is invalid?

After completing this, I decided to talk to Bobby–secretrobotron–on IRC to get his thoughts on having the checks in both places, and perhaps turning this check into a utility method in js/utils.js. He told me that the URL may need to be blank for the base player to work. This is exactly what David Seifried told me when I discussed the patch with him. Bobby also said that Butter should throw the error, and Popcorn Maker should react to it. I then started looking for a way to dispatch this specific error so that when Popcorn Maker reacts to it, it will know that the exact reason changing the media failed was because what was entered was either nothing, an empty string, or a string full of spaces. But then I remembered that I read an error dispatched in the code, previewerfail, when working on bug 157. That’s when I added in the listener for “previewerfail” in js/menu.js, which lead to the patch that is currently in review.

Bug 157

The fix for bug 157 is explained here. Although this fix is even smaller than bug 67, it actually took longer. I ended up spending many hours looking at the wrong areas of the code (which was not a waste of time, it helped me understand the code base better, and made finding the area to fix bug 67 easier). At first I was looking for all areas that could possibly manipulate some sort of id property for a track. After some digging, I finally found a line of code in js/timeline.js that may have been causing the issue:

  layerDiv.id = "layer-" + track.id;

So then I put a breakpoint there, examined the call stack, stepped through the code, and started digging around. After some time, I eventually wound up in butter/external/trackLiner/trackLiner.js. I found a clear function, and noticed that it never said track.id to 0. So I added that in, but when I tested the code it still didn’t work. I found it a bit odd; maybe a track is being passed around to different functions, and one of those is somehow manipulating the id in the wrong way. So I added more breakpoints and spent quite a bit of time pursuing this idea. Once I realized that wasn’t working, I thought maybe something was being done to the JSON blob that represents the project when it’s either imported or exported. I had watch expressions set up for a few variables that I thought could be the issue as I was stepping through the code.

I eventually noticed that this issue doesn’t actually occur when first loading Popcorn Maker. If Popcorn Maker is loaded for the first time in the browser, and a previous project is opened, everything works just fine. This issue only happens if a project is saved first, and the loaded again. So there was a variable somewhere that was sticking around and not being reset back to 0. I finally found butter/src/core/track.js. The id of the track is set by incrementing a static variable, Track.guid. I used grep to find other areas in Popcorn Maker where this was used. It wasn’t used any other place other than when first initialized to 0, and when being using to set the id of the track. I finally found the problem. While looking through the code I knew that Butter had a clearProject function in butter/src/butter-main.js. I set Track.guid to 0 in that function, and everything worked as expected.

Popcorn Maker FCP

For Popcorn Maker FCP, I have been working on creating a custom DMG file that people will be able to download. I want to create a drag-and-drop installation, which is common with Mac programs. The DMG will have two icons: one for Popcorn Maker FCP, and one for the Applications folder on the Mac. Once the DMG is opened, the user can drag Popcorn Maker FCP’s icon into the icon representing the Applications folder, which is a symbolic link to /Applications. I also need this to work with the updating mechanism in place for Popcorn Maker FCP, which uses the popular Sparkle framework.

It turns out creating DMGs with custom images is not straightforward. There are commercial applications out there that allow the developers to use a native Mac application that makes creating these DMGs manually really easy. But that method is too slow; I want to add in a build script for the release builds so that these DMGs are creating automatically. Therefore, I needed a way to create a custom DMG using the command line. I found some information on StackOverflow, which gave me a start. Now I know hdiutil is responsible for creating DMGs, but it seems as though there are many quirks. I then started looking for a tool that wraps hdiutil and simplifies the interface. After searching around, I stumbled on the create-dmg project. I set this up and started playing with the settings, following the example posted here. But I couldn’t get it to work. No matter what image I told it to use as a custom background, it always created a plain DMG. So I started to search again, and found another project, ChocTop (which also supports the Sparkle framework!). I have spent quite a bit of time actually trying to get the tool to work without throwing an error. I have been installing the ruby gems it needs, but I keep getting this error when I try to use the install_choctop command:

/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rubigen-1.5.7/lib/rubigen/options.rb:31:in `default_options': undefined method `write_inheritable_attribute' for RubiGen::Base:Class (NoMethodError)
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rubigen-1.5.7/lib/rubigen/base.rb:84:in `'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rubigen-1.5.7/lib/rubigen/base.rb:79:in `'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rubigen-1.5.7/lib/rubigen/base.rb:42:in `'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/rubigen-1.5.7/lib/rubigen.rb:10:in `'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
	from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/choctop-0.14.1/bin/install_choctop:4:in `'
	from /usr/local/Cellar/ruby/1.9.3-p0/bin/install_choctop:19:in `load'
	from /usr/local/Cellar/ruby/1.9.3-p0/bin/install_choctop:19:in `'

I hope to get this working as it would make releasing the application much easier, and the resulting custom DMG will look much more professional.

TestSwarm for Popcorn

David Seifried is working on TestSwarm for Popcorn. I am going to work on getting this to work on iOS: we need a way to let the videos needed for Popcorn’s test cases to play automatically, without someone having to sit there and hit the play button. I haven’t been able to do too much on actually figuring that issue out, we are still working on me actually being able to see the web page on the iOS simulator. I keep getting this error:

TestSwarm iOSError

Conclusion

I have learned really interesting things while working on my first release. It’s nice to work on different projects so that I can keep up to date with more than one technology. Working on multiple projects has also come in really useful when I am unable to work on a particular bug. For example, when I was not able to work on TestSwarm for iOS, I went back to trying to get ChocTop to work for Popcorn Maker FCP.

What I Learned for Future Releases

  • I learned that I need to blog about my process and the problems I run into when working on the bugs assigned to me. It helps others know my current progress, and someone who reads it may end up helping me solve the issue. Having these blog posts will also help make my release blog post more organized and concise; it will avoid having to talk about the process of fixing the bugs in a release post. Additionally, it’s better to blog about the process while I am actually in the middle of it, because that’s when it is fresh in my mind; some of it forgotten when I blog about it after the fact.
  • I need to use IRC more. I did make use of IRC, but I may have been able to solve my bugs faster if I asked questions earlier on. There are others who have worked with the code and already understand it; they can help me focus in on the area I need to be looking at.
  • Get more involved with Twitter. I tweet about my blog post once I publish it, but I can tweet about my progress as I am working on the bugs. Sometimes progress is small and isn’t enough for a blog post, that’s when tweeting will come in useful.

by mbuttu at January 26, 2012 10:29 PM


Justin Robinson

Viva Las Vegas!

NetConnection.call is a very strange place. I have a global PollObject called pollGlobal, declared and instantiated far outside of nc.call. Nc.call’s success method calls another method named extractPoll, and extractPoll assigns values to pollGlobal. Still with me? Good.

Now, the weird thing is that in the very next line after nc.call, the changes I’ve made to pollGlobal disappear. Gone. Vanished. Woosh! What happens in nc.call, STAYS in nc.call. But there’s no reason for it! Here, have a diagram.

public var pollGlobal:PollObject;

public function getPoll(){
““`pollGlobal = new PollObject();
““`nc.call(){
“““““extractPoll(){
“““““““` pollGlobal.title = “TITLE”;
“““““} –> end of extractPoll
“““““printf(pollGlobal.title); —–> “TITLE”
““` } –> end of nc.call
““`prinf(pollGlobal.title); –> “null”
} –> end of getPoll

That isn’t how the code actually looks, but that’s the flow the logic takes. What is going on?!

(Incidentally, there’s a chance I could be going to Vegas for my brother’s bachelor party this summer)


by Justin at January 26, 2012 07:40 PM


Christopher DeCairos

OSD700 Release post 1

Before I get started here's some formalities for the course:

My work on this release can be found here:

bug 686137 - Setting audio.mozFrameBufferLength has no effect on MozAudioAvailable.frameBuffer.length

https://github.com/cadecairos/mozilla-central/tree/bugs/686137

And now, the story:

As I described in my previous post, I've been hacking on Firefox media code for my OSD700 class.  This post is going to detail more about the bug I was working on and how things went with it.

Bug 686137 was an audio API related issue where the MozAudioAvailable event on an audio element would report an incorrect frameBufferLength value. This happened after it had been manually changed through the mozFrameBufferLength attribute on the <audio> element. The first thing I did was create a test case using code that David Humphrey included in his bug report. Using this test I narrowed down the list of possible bugs that caused this regression and eventually discovered the bug that created it. From there I zeroed in on the content/media folder within mozilla-central, where all the media code lives. Using the Mozilla Cross-Reference website, I searched for a couple of keywords: mozFrameBufferLength and MozAudioAvailable.

This search led me to more files than I'd have liked to have seen. I spent the majority of my time last week reading through these files trying to familiarize myself with what was going on in them, but this ultimately got me no closer to a fix. I spoke with Jon Buckley, who told me that in his experience, using GDB was the best way to trace the execution of the bug down. I hadn't used GDB since OOP344 with Fardad, where I and two other team members created a simple text editor in C/C++ called Bite. After a simple search, I found a wiki detailing techniques for debugging Firefox with GDB.

The obvious thing for me to do here was find all the places in the code where the frameBufferLength was being handled in some manner. My plan was to set break points at parts where I thought it was being set and do some checking of the data from within GDB. For your information, the test case I was using used a default buffer length of 2048 Bytes, which was set in JavaScript to 4096 Bytes. When debugging against this test case, I found it very curious that at all the break points I had set, the frame buffer length was always 2048. There was no trace of the 4096 value in the test case.

What this told me is that I needed to follow the path that the value 4096 was taking. Using MXR I located the setter method for the mozFrameBufferLength attribute and using GDB, set a break point within the function. Stepping through the code, it looked as if everything was being set properly.  At this point in my investigation, I found myself completely stumped.  I spent many hours stepping through the code trying to find the difference in the initial setting of the buffer length on the

Then I noticed it. The key to the puzzle was a class called nsBuiltinDecoder. This class inherited from a base class named nsMediaDecoder. Each one contains a RequestFrameBufferLength() method that accepts a 32 bit integer for the new buffer size and handle it in slightly different ways. Why is this important? Well, When the nsBuiltinDecoder::RequestFrameBufferLength(). On the other hand, when setting the buffer length from the element, it passes the argument into nsMediaDecoder::RequestFrameBufferLength! I opened the header file for nsMediaDecoder and found the function definition, and lo and behold, there was no "virtual" keyword! By this point I'd spent over 6 hours that day tracing this thing down, and I was quite fatigued. I made the addition and using a tool called "smartmake" suggested to me by a Mozillian in #introduction on Moznet, began an incremental build. I was 100% sure it would work. I opened up Nightly and navigated to my test page and.... nothing changed. What. The. Fudge.

It was a huge let down. But I wasn't let down for long. After posting about where I was, a developer named Yuri posted a comment, indicating that the virtual keyword was the problem. After discussions with him and Dave Humphrey on IRC, it became clear that I should perform a top-level build. I'm not gonna lie, I was pretty excited. After my top-level build completed, the test case finally passed! Vindication at last.

Now that I had a fix I needed to create a patch for it. Matthew Schranz posted a guide on developing for Firefox using GIT (which is what I was doing) and he had included a command that would create a properly formatted patch. Using that, I created this attachment on the bug. I then set out to write a test for it so that it would never break unknowingly again.  Using existing tests as a base, and after reading several guides on writing tests for Firefox, I produced this attachment to the bug.

From there, my navigation through the review process was a little rocky. I found that upon setting an attachment for review, I should set a person responsible for it (something I did not do). Luckily it got picked up by Matthew Gregan AKA kinetik who r+ the first patch. He also gave me some pointers for the future. In my patch I didn't follow the regular commit message conventions, something I won't do again. The second patch needed some work done before it could be approved. They were just minor issues relating to comments I'd forgotten to remove and unneeded listeners I'd used. I also took his advice and added a second assertion for a case I had not considered. After wrestling with git for an hour trying to get the patch right I posted a new attachment with the fixes, and a commit message that met the expectation I mentioned above.

This new attachment got a positive review from Kinetik. The next day, after discussion about the bug I was advised to set the bug to have the checkin-needed flag. I also uploaded a new attachment with a conforming commit message, obsoleting the first attachment I posted. Later that evening the patches were merged into mozilla-inbound. I learned that this is a sort of staging area, where new patches have the tests run on multiple platforms to make sure that they don't break the entire program. While driving to work the next morning I got an email notification that my patches were now merged into mozilla-central.

Hacking on this bug taught me a lot. I got a great introduction to some of the media code and its inner workings. I got a nice refresh on using GDB. I now have a deeper understanding of building Firefox from the source (when in doubt, do a top-level build). I learned more about the firefox review process (what NOT to do). And I personally learned that even the simplest of fixes can take a ridiculous amount of time to track down. Especially when you're not familiar with the code like I was. Coming out of this thing I feel I'm in a better position to take on more bugs.

My plan for the next two weeks is to get on a couple other bugs I've been looking at ( bug 715323 and bug 711742 ). I'm also going to find more bugs to work on related to the media code.

by cadecairos at January 26, 2012 05:54 PM


Matthew Schranz

OSD700 Release 1 – Updating the DOM

First release! Already? Hate to sound not enthused but other courses are bringing down my mood right now :P Not this one though!

During these first two and a half weeks I have been able to get three tickets done with two of them landed and the third’s patch review+ and just needed to be run on the try server to finalize if it’s acceptable or not.

Said three bugs are:
Bug 698384
Bug 698385
Bug 718274

You may notice that there is not actual patch for 698385. That is because the changes to that one and 698384 affect the same area of code so in order to properly fix one the other has to be done at the same time. Hence why the patch for both is located in 698384.

The first two were simply updates to the DOM specifications. Both document.createTreeWalker and document.createNodeIterator now had optional arguments according to the DOM Spec and obviously Mozilla wants to adhere to this spec as much as possible. The actual coding changes for these were pretty simple in the end once I knew what to do but getting there was another story. I can’t make the claim that I am an experienced C++ developer so coming in I had no idea how to deal with optional arguments. In the end I figured it out which can be read here.

Bug 698381 is still a work in progress. The types of changes are the same but with this one the update is to a class that has a VERY long and big inheritance chain. It literally is the basis for almost anything web related so finding all the various implementations of that method proved difficult at first but thanks to the help of some DXR searches I should have it finished shortly.

With 718274 I have to admit I thought the fixes needed might actually be more difficult when I first read over it. Not to say it wasn’t interesting but the changes were pretty quick. To sum it up, there was a desire to add a method to nsContentUtils called DispatchUntrustedEvent. The name pretty much tells you what it’s intent is, to send untrusted events. What is an untrusted event? That’s another story entirely.

However at the same time they wanted to introduce another private method called DispatchEvent that both DispatchUntrustedEvent and DispatchTrustedEvent would call as they both would be written the same way other than what they would set a boolean variable aTrusted too. I won’t bother showing the .h files additions but here is the transformation in the .cpp:

From…

static
nsresult GetEventAndTarget(nsIDocument* aDoc, nsISupports* aTarget,
                           const nsAString& aEventName,
                           bool aCanBubble, bool aCancelable,
                           nsIDOMEvent** aEvent,
                           nsIDOMEventTarget** aTargetOut)
{
  nsCOMPtr domDoc = do_QueryInterface(aDoc);
  nsCOMPtr target(do_QueryInterface(aTarget));
  NS_ENSURE_TRUE(domDoc && target, NS_ERROR_INVALID_ARG);

  nsCOMPtr event;
  nsresult rv =
    domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr privateEvent(do_QueryInterface(event));
  NS_ENSURE_TRUE(privateEvent, NS_ERROR_FAILURE);

  rv = event->InitEvent(aEventName, aCanBubble, aCancelable);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = privateEvent->SetTrusted(true);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = privateEvent->SetTarget(target);
  NS_ENSURE_SUCCESS(rv, rv);

  event.forget(aEvent);
  target.forget(aTargetOut);
  return NS_OK;
}

// static
nsresult
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
                                     const nsAString& aEventName,
                                     bool aCanBubble, bool aCancelable,
                                     bool *aDefaultAction)
{
  nsCOMPtr event;
  nsCOMPtr target;
  nsresult rv = GetEventAndTarget(aDoc, aTarget, aEventName, aCanBubble,
                                  aCancelable, getter_AddRefs(event),
                                  getter_AddRefs(target));
  NS_ENSURE_SUCCESS(rv, rv);

  bool dummy;
  return target->DispatchEvent(event, aDefaultAction ? aDefaultAction : &dummy);
}

To…

static
nsresult GetEventAndTarget(nsIDocument* aDoc, nsISupports* aTarget,
                           const nsAString& aEventName,
                           bool aCanBubble, bool aCancelable,
                           bool aTrusted, nsIDOMEvent** aEvent,
                           nsIDOMEventTarget** aTargetOut)
{
  nsCOMPtr domDoc = do_QueryInterface(aDoc);
  nsCOMPtr target(do_QueryInterface(aTarget));
  NS_ENSURE_TRUE(domDoc && target, NS_ERROR_INVALID_ARG);

  nsCOMPtr event;
  nsresult rv =
    domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr privateEvent(do_QueryInterface(event));
  NS_ENSURE_TRUE(privateEvent, NS_ERROR_FAILURE);

  rv = event->InitEvent(aEventName, aCanBubble, aCancelable);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = privateEvent->SetTrusted(aTrusted);
  NS_ENSURE_SUCCESS(rv, rv);

  rv = privateEvent->SetTarget(target);
  NS_ENSURE_SUCCESS(rv, rv);

  event.forget(aEvent);
  target.forget(aTargetOut);
  return NS_OK;
}

// static
nsresult
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
                                     const nsAString& aEventName,
                                     bool aCanBubble, bool aCancelable,
                                     bool *aDefaultAction)
{
  return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
                       true, aDefaultAction);
}

// static
nsresult
nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
                                       const nsAString& aEventName,
                                       bool aCanBubble, bool aCancelable,
                                       bool *aDefaultAction)
{
  return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
                       false, aDefaultAction);
}

// static
nsresult
nsContentUtils::DispatchEvent(nsIDocument* aDoc, nsISupports* aTarget,
                              const nsAString& aEventName,
                              bool aCanBubble, bool aCancelable,
                              bool aTrusted, bool *aDefaultAction)
{
  nsCOMPtr event;
  nsCOMPtr target;
  nsresult rv = GetEventAndTarget(aDoc, aTarget, aEventName, aCanBubble,
                                  aCancelable, aTrusted, getter_AddRefs(event),
                                  getter_AddRefs(target));
  NS_ENSURE_SUCCESS(rv, rv);

  bool dummy;
  return target->DispatchEvent(event, aDefaultAction ? aDefaultAction : &dummy);
}

Hoping to finish 698381 soon. Once I’m done with that I hope to find something a little bit more in-depth to help me learn more as a developer!


by Matthew Schranz at January 26, 2012 03:55 PM


David Seifried

OSD700 – First release!

For the last two weeks I have been working on various Firefox bugs for my first release in OSD700.  My bugs have been centered around various parts of the media implementation, ranging from issues with the controls to problems with how preload states are handled.  As it stands, I’ve  managed to get a patch up for 3 of my tickets which is pretty cool if I do say so myself. The tickets that I’ve worked on so far are 702161, 708814, and 680321.  I’m going to touch briefly on each ticket and the changes that I made.

The first ticket I started on for the course was 702161 and was focused around removing anonymous functions that were set up for event listeners but were never removed because we had no reference to them.  Fixing these was a matter of storing a reference to each of these functions and removing them at the proper time.  You can read up on my earlier work for this ticket in my other blog posts. My first patch for this ticket was rejected because I attached each function to the video object instead of attaching an object to the video and attaching the event listeners to it. I forget my reasoning for not doing this in the first place, but thats beside point. I learned a lot about Firefox’s review process with this bug and how it differs from the review process in other open source projects I work on ( Popcorn.js and Popcorn Maker ).  In Popcorn projects we typically wait until both a fix and tests have been written before review is requested.  The review process in Firefox is a bit different.  It seems to the norm to submit patches more frequently in order to get early feedback on what you’ve been working on.  I like this because it allows you to find any glaring mistakes you are making early and ensures that you are on the right track for later patches.  It also allows reviewers to handle your code in smaller doses.  I remember one ticket that I submitted in Popcorn that touched ever file of every plugin ( ~100 files ).  I remember dumping that ticket on Chris De Cairos for review and seeing the look on his face.  I can just imagine how much more manageable my patch would have been if we did something similar to Firefox.  All in all this ticket taught me a lot about Firefox’s review process, how patches should look, and was a good way to get my foot in the door of Firefox development.

 

My second ticket was 708814 and had to do with fixing an issue where mousing over a full-screened video would not hide the controls.  It was cool that this ticket was centered around code that I just finished working with in 7021661, so I felt pretty confident about getting started.  The first thing I did was to make sure that I could reproduce the bug.  Chris Pearce posted a test case and some guidelines about how to reproduce the bug.  I fired up the test and followed his instructions and what do you know there was the bug.  The problem was that when using a hotkey to trigger a video to go full-screen that the controls would not disappear.  This was because prior to my patch, a timeOut for removing the controls was initially fired on mouse move when the video was fullscreen.  My fix consisted of checking to see if the mouse was over the video element when it was fullscreen.  If it was, we would start the timeOut then.  The interesting part about this ticket was that my fix spawned another ticket for me to work on.  The bug that I found ( that already existed in bugzilla )was 708553.

Bug 708553 is about the video element not properly handling hover states when in full-screen mode.  This relates to 708814 because my fix essentially says that if the video is full-screen and if the mouse is hovered over the video, then start the timeOut.  I picked up this bug because from what I can tell, it is blocking my fix for 708814, so I figured why not speed up the process and fix it myself.

My final bug for this release is 680321.  This bug is centered around the preload attribute on video elements and how it handles being changed in the resource selection algorithm.  The initial issue with this ticket was that the resource selection algorithm would ignore preload states that buffered less agressively if changed programatically.  This means that if we start video A with preload auto and set a timeOut for one second later to switch preload to auto and change the videos source, that the new preload state is now ignored.  This means that video B will begin loading assuming preload auto when it should use preload none.  This ticket was interesting because it was my first ticket involving C++.  Now I’m not gonna lie my C++ skills are pretty lacking, and I had to do a bit of refreshing to ever begin to understand what was going on in this code.  The file that I was working in, nsHTMLMediaElement.cpp, was also pretty huge ( ~4k lines ).  I spent pretty much the entirety of a whole night just reading this file and trying to understand how all of the pieces fit together. After finding an area of the code that I thought the bug was in, I began hacking.  After a few incremental builds and I found that I was pretty lost without a debugger.  I remember Chris and Jon talking about a good C++ debugger for the command line so I went to irc to ask for some help. I was given a quick rundown about GDB and how to use it, tho I found a way to screw it up so I opted out and chose to wait until David Humphrey explained it in class.  I was going to have to go with the ole trial and error approach if I wanted to make progress before Thursdays class.  The odd thing that I noticed was the no matter how many changes I made to the file I was not seeing and changes actually happen to the browser ( I even commented out huge blocks of seemingly important code, and nothing happened ) so I figured my build process was screwed up somewhere. My guess was that I was attempting to build too far into the tree and my changes were not actually being seen further up the tree where they needed to.  I said screw it and waited the few minutes and did a fresh new build and I finally saw my changes!  I was lucky in the fact that I was pretty close to a solution on my first try.  It took a few more small tweaks to make the change elegant and following the rest of the codes style and I was ready to submit for some feedback.  The fix involved removing a chunk of code that prevented the functionality that we now wanted and added in another conditional check for our preload state.

My experience so far hacking on Firefox has been awesome. I’ve had a chance to talk with some cool dev’s on irc, make changes to Firefox that will help Popcorn.js, and learn a ton along the way.  As it stands two of my tickets still need tests to be written for them before they get officially reviewed, but I’m optimistic about finishing them and can hopefully get that done by mid next week.  I managed to get 3 tickets somewhat finished so far and hope that I can continue this pace until the end of the semester.  I know the tickets are only going to get harder the deeper I go into Firefox but that also means the satisfaction I get out of finishing them will be even greater. I have no idea what other crazy bugs I will get to work on this semester but I can’t wait.


by dseifried at January 26, 2012 03:42 PM


Justin Robinson

Copycat!

I had a bit of a brainwave in regards to yesterday’s problem of passing the Java Poll to an ActionScript PollObject. Neither class has a copy constructor, maybe that little technicality is the problem. I’m compiling now with a copy-con in the Poll class, if that doesn’t work I’ll add one to the AS class and recompile with both together, and if THAT doesn’t work I’ll try it with just the AS copy-con. Hopefully there’s a result for me in here somewhere.

UPDATE: Well, fist of all, ActionScript doesn’t seem to use copy constructors. I’m still thinking in terms of C++, I guess. Anyway, the Java copy-con was sound, but never got called even though the NetConnection.call successfully calls up a PollObject (which is, unfortunately, empty). Earlier, I changed the server-side getPoll() method being addressed in the NC.call() to return all the properties of a Poll as an ArrayList, which the client-side AS could translate to an ArrayCollection and use to populate a PollObject, but it didn’t work. Maybe I have to return to that.

UPDATE: SUCCESS! The information is passed cleanly from Java to AS! Here’s how it happens:
1) The client calls for server-side getPoll()
2) getPoll() returns a Java ArrayList with all the properties of a Poll (5 Strings and 2 ArrayLists) to client
3) Client creates an ordinary Array, not an ArrayCollection like I originally thought, of the data coming back.

The Array holds everything! Ta-da!


by Justin at January 26, 2012 03:41 PM


Nikita Kuznetsov

so far...

Busy semester. Web dev, as always, carrying on with the real estate CMS. Now implementing the major functionality and designing a nice-looking website (done). Introducing JQuery snippets into usual environment... We'll see what that results in shortly :)

by Nikita Kuznetsov (noreply@blogger.com) at January 26, 2012 06:38 AM


Maria Bustos-Roman

Building my first RPM package

This is my attempt at building an RPM package for ed.

At first I followed the simple instructions from lab:

Move the tarball to ~/rpmbuild/SOURCES/:

mv ed-1.6.tar.gz ~/rpmbuild/SOURCES/

Create an empty skeleton spec file:

rpmdev-newspec ed-1.6

Then I edited the spec file using vi:

vi ed-1.6.spec

After filling in all the required sections of the spec file I attempted to build the package by running:

rpmbuild -ba ed-1.6.spec

I got the following errors:

error: Installed (but unpackaged) file(s) found:
   /usr/share/info/dir
   /usr/share/info/ed.info.gz

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/share/info/dir
   /usr/share/info/ed.info.gz

I proceeded to browse on google for a solution and it didn’t take long before I came across a solution.

To fix this error I needed to specify the list of files that would be installed.

I added this to the %files section of the spec file:

%files
%doc README
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/man1/*
/usr/share/info/

And finally! I got it to work.

Run te rmplint command to check the spec file RPM and SRPM for Errors or warnings:

[root@mbustosroman SPECS]# rpmlint ed-1.6.spec
ed-1.6.spec:21: W: configure-without-libdir-spec
ed-1.6.spec:23: W: macro-in-comment %configure
ed-1.6.spec:7: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 7)
0 packages and 1 specfiles checked; 0 errors, 3 warnings.

[root@mbustosroman SRPMS]# rpmlint ed-1.6-1.src.rpm
ed.src: I: enchant-dictionary-not-found en_US
ed.src: W: summary-not-capitalized C text-editor
ed.src: E: no-changelogname-tag
ed.src: W: invalid-license GNU
ed.src: E: invalid-spec-name
ed.src:21: W: configure-without-libdir-spec
ed.src:23: W: macro-in-comment %configure
ed.src:7: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 7)
1 packages and 0 specfiles checked; 2 errors, 5 warnings.

[root@mbustosroman x86_64]# rpmlint ed-debuginfo-1.6-1.x86_64.rpm
ed-debuginfo.x86_64: I: enchant-dictionary-not-found en_US
ed-debuginfo.x86_64: E: no-changelogname-tag
ed-debuginfo.x86_64: W: invalid-license GNU
ed-debuginfo.x86_64: E: debuginfo-without-sources
1 packages and 0 specfiles checked; 2 errors, 1 warnings.

Even though I got the the rpm to build there are still some errors I have to fix. I found it extremely useful the rpmlint command tells you exactly what the error is, it is very straight forward. I think I’ve got a pretty good idea on how to fix the errors and will post one I am done. It is somehow 2am now! Will update this tomorrow.


by mariabustoss at January 26, 2012 06:35 AM


Raymond Hung

Mouse Lock Tests Status

It’s funny, if you were ask me 5 years ago, if I would associate legacy with something good or something bad, I would’ve definitely said good. Legacy… it SOUNDS good, prior to entering the world of programming much of my exposure to the word legacy were in the form of “so-and-so hero left a legacy” again, a good thing. So I was rudely introduced to the fact that often times in the programming world legacy can be equated to outdated and not-maintained.

For all the great teaching and experience I get while studying at Seneca, most of the time, code is created from scratch. Due to this, our projects are almost always small scale assignments, even group projects are relatively small (until professional options anyway). The amount of exposure students get with regards to large code bases, or dealing with existing-but-buggy code is almost nil. Even for projects where the professor suggests sources for code we can use, much of the code is either in copy-and-paste condition or better code can be obtained through a web search where we can THEN copy and paste. Rarely do we have a chance to touch code where there’s not necessarily a “better” alternative and where we just have to buckle down and decode the program in front of us. So reworking some of these mouse lock tests became just that, of course much of it was my fault to begin with…

I’ve done group work in programming classes and I’m tutoring at Seneca’s Learning Centre, so I’ve seen my fair share of coding differences. However, when I started to look over the tests again, wow. There’s a lot to be learned from reading other people’s code, and learn I did. Unfortunately the flip side was that there were a few tests that either tried to do the impossible or tried to do something but was unsuccessful. The problem was the amount of time it took to decode some of the tests that were written in order to determine if the tests needed to be changed, updated, or even removed. Luckily Steven was there to help me and took a little over half of the tests that were peer reviewed to look over.

In the end, I dealt with file_MouseEvents, file_defaultUnlock, test_mousePos, file_movementXY, file_targetOutOfFocus, test_MozPointerLock, file_limitlessScroll, and file_userPref.

There’s no point talking about what changes happened to each individual file since most of the files were actually fairly simple fixes, they just needed minor updates to make sure that the tests worked with the new patch. However, because some of the original authors of the code are no longer working on this project, it’s important for us to understand what it does so when review comes (and we’ve been told to expect the worst), we can get it fixed ASAP.

Looking back the past week at what I said, I underestimated both the amount of free time I would have, as well as how long it would take to fix these tests. The one test that gave me the most trouble was honestly my own, haha. file_MouseEvents.

The main issue was that it was hanging for some, but not for others. As well, some people were having random success and failures. It took me three days and two full rewrites to figure out all the things I did wrong.

During some of the edits I had made, I left some old pieces of code which in turn, caused the test to sometimes stall there until mochitests finally closed it for being open too long. That was problem one taken care off. As for the random success and failures, it took a while for to figure out, but in the end it wasn’t anything I could really do about it. When the test is run, the mouse cursor MUST be in the browser, otherwise, it won’t be able to do the proper synthesis, at least not on Windows. When I launch the test with the cursor hovering anywhere over the browser, the test will work as expected. Take it away and run it? A bunch of failed tests. That’s not really something I can control and fix, when running mochitests, ideally you’re not doing anything that can affect the browser doing its thing anyway.

Finally I noticed a processleak. It was because of this that I had to do the two full rewrites, but every time I got the same thing.

As you see above, that’s a lot of leaking. I always thought it was my code, that something I coded caused this. After a bit of sleuthing, I found that by calling synthesizeMouse and passing in an event of type “mousedown” and with a button of “1″ (middle mouse button), mochitest would leak like this. I found another test_bug549170.html, I ran it, and got the similar results. It leaked like mine. This leak seems to only affect Windows machines because Steven, using linux, did not have the same leak issues. And really, I never heard anyone who was peer reviewing this test mentioning the leak (many of them used a linux box to do the builds and testing).

In any case, the majority of the tests ARE done. Steven mentioned two tests that need to be taken care of. The first is one that will be merged with movementXY, and it deals with testing to make sure that the mouse can move more than 1 screen’s length and height once in mouse lock (it’s easy enough to test it out in real life though, just look at the demo pages haha). The next is do something similar to what I’ve done in file_MouseEvents. In file_MouseEvents, I have one outer div that holds a child div. Once mouse lock is set on the outer div, the child div should not get many of the mouse events. The case that is being sought is to have multiple children inside the outer/parent div. It should be fairly straightforward to rig up. =)

I really need to get into the habit of blogging more often, or else I get these REALLY long pages of text.


by Raymond at January 26, 2012 06:34 AM


Nam Nguyen

Build from Source Code

I regularly install software by downloading a file and then running the installer, In this post I'll share my experience building two software packages to install on my Fedora system through the build process. When building packages, there are some that are easier and some harder packages to build as I found out.

First, I downloaded a group of development tools and development libraries using yum.
yum groupinstall "Development Tools" "Development Libraries"

From there I went to the GNU software collection where I selected many packages to try and build. Some packages were harder to build as I experienced when configuring the source code. The reason for this was that some of those packages required other packages which I did not have and so caused an error!. One of those errors when configuring was from not having "GTK+" which is the Gimp Tool Kit.

Two software packages that was fairly easy to build that I installed are:
barcode ftp://ftp.gnu.org/gnu/barcode/barcode-0.98.tar.gz
gnuchess http://ftp.gnu.org/pub/gnu/chess/gnuchess-6.0.1.tar.gz

The command to download from command line using "wget"
wget ftp://ftp.gnu.org/gnu/barcode/barcode-0.98.tar.gz
wget http://ftp.gnu.org/pub/gnu/chess/gnuchess-6.0.1.tar.gz

After downloading these two tarball files, I unzipped them using "tar" with the options "xvzf" for extract,verbose,gzip and file.
tar xvzf barcode-0.98.tar.gz
tar xvzf gnuchess-6.0.1.tar.gz

This is what the tarball files looks like in red and the blue folder is whats created after using tar. 

Then change to the new directory with the cd command. Within the new directory there is a script called configure that will configure the build. I ran the script by entering ./configure

After the script ran with no errors I used the time command with the make script to build the software. The result of time make for both packages

barcode
real    0m2.316s
user    0m1.353s
sys    0m0.299s

gnuchess
real    0m2.806s
user    0m0.387s
sys    0m0.374s

After make ran successful, I entered make install to install the software. Finally to test that these builds are successful, I entered gnuchess and barcode from the command line to have these packages.







by namnguyen (noreply@blogger.com) at January 26, 2012 05:11 AM


Maria Bustos-Roman

Installing gzip – A data compression program

This blog-post will be a guideline of my experience installing gzip. The original link for this software is http://www.gnu.org/software/gzip/ . This is a very popular compression program, its installation is also easy and does not take too long to install.

Download and Extract

To Download the program go to the following link:

Download http://ftp.gnu.org/gnu/gzip/ and click on one of the latest modified tar balls.

Extract the file with the following command:

tar xzvf gzip-1.4.tar.gz

Move into the newly created directory ed-1.6:

cd gzip-1.4/

Now you need to find a script that runs the build of the program, more often then not it will be this:

./configure

When successful, run:
make

followed by :
make install

To check the time it took the command to execute we type:

time make

real    0m2.213s
user    0m0.316s
sys    0m0.955s

If done correctly the software should have now been succesfully installed and ready to run.

Here is a quick example that might be useful…

Use the command gzip followed by the file(s) name to compress. Notice the decrease in size of the file after compression.

To decompress just use gunzip instead. Go to the gzip man page for more information on additional options.


by mariabustoss at January 26, 2012 12:59 AM

January 25, 2012


Maria Bustos-Roman

Install Ed – A line oriented text editor

This blog-post will be a guideline with my experience in installing ed. The original link for this software is http://www.gnu.org/software/ed/ . The installation didn’t take very long and is fairly easy.

Download and Extract

To download the program go to the following link:

Download http://ftpmirror.gnu.org/ed/ and click on one of the latest modified tar balls.

Extract the file with the following command:

tar xzvf ed-1.6.tar.gz

Move into the newly created directory ed-1.6:

cd ed-1.6/

Now you need to find a script that runs the build of the program, more often then not it will be this:

./configure

When successful, run:
make

followed by :
make install

To check the time it took to execute we use:

time make

real    0m4.223s
user    0m3.422s
sys    0m0.523s

If done correctly the software should have now been succesfully installed and ready to run. Go to the ed man page for more information on how to use!


by mariabustoss at January 25, 2012 11:25 PM


Andor Salga (asalga)

No Comply Game Prototype with Processing

Last week I met with Dave Humphrey and Jon Buckley to discuss creating a game for the HTML5 games week which will take place at Mozilla’s Toronto office in mid-February. The main purpose of this is to drive the development and showcase the Gladius game engine.

At the end of the meeting we decided it would make the most sense to upgrade the No Comply demo by adding interaction—making a small game. Since we only have a few weeks, we decided to keep it simple. Keeping that in mind I created a game specification.

Play Analysis

After putting together the spec, I started on a prototype. I began the prototype by playing and analyzing the game mechanics of Mortal Kombat I. The game is simple enough to emulate given the time frame. I took some notes and concluded characters always appear to be in discrete states. If characters are in a particular state, they may or may not be able to transition into another state. Initially a player is idle. From there, they can transition into a jumping. Once jumping they cannot block, but are allowed to punch an kick. Having understood the basic rules, I drew a diagram to visually represent some states.

The diagram led me to believe I could use the state pattern to keep the game extensible. We can get a basic game working and the design should lend itself to later (painless) modification.

Prototyping the Prototype

Having worked with Processing for some time I knew it would be an ideal tool to construct a prototype of the game. Processing enables developers to get graphical interactive software up and running quickly and easily. The structure is elegant and the language inherits Java’s simple object-oriented syntax.

I began creating a Processing sketch by adding the necessary classes for player states such as moving, jumping and punching. I hooked in keyboard input to allow changing states and rendered text to indicate the current state. I was able to fix most of the bugs by playing around with different key combinations and just looking at the text output.

I eventually added graphical content, but intentionally kept it crappy. I resisted the urge to create attractive assets since they would be replaced with the No Comply sprites anyway. Neglecting the aesthetics was a challenge—if you cringe at the graphics, I succeeded.

Okay, still want to play it?

Next Steps

I omitted collision detection and some simple game logic from the prototype, but I believe it demonstrates we can create a structure good enough for a fighting game for Gladius. Today I’ll be switching gears and starting to hack on Gladius to get COLLADA importing working which we’ll discuss in a Paladin meeting early next week.


Filed under: Game Development, Gladius, Open Source, Processing

by Andor Salga at January 25, 2012 09:10 PM


Justin Robinson

Responder? I hardly KNO- Oh, I used that joke already?

Here’s the new problem. The server-side Java needs to send a Poll object to the client-side Actionscript. The trouble is, we just cannot get our Poll to play nicely with either plain ol’ Actionscript Objects or with our own PollObject Actionscript class. Here’s how we’re trying to do it; I’m almost certain we’re using Responder wrong, but I can’t be entirely sure:

public function  getPoll(pollKey:String):void{
var poll:PollObject;
try
{
nc.call(
"poll.getPoll",
new Responder(
function(result:Object):void {
if(result != null)
{
poll = result as PollObject;
extractPoll(poll);
}
},
function(status:Object):void {
for (var x:Object in status) {
LogUtil.error(x + " : " + status[x]);
}
}
),
pollKey
);
LogUtil.debug(LOGNAME + "nc.call survived");
} catch (e:Error) {
LogUtil.debug(LOGNAME + "nc.call blew up. KABOOM");
}
extractPoll(poll);
}


by Justin at January 25, 2012 09:09 PM


Mohammed Buttu

Popcorn Maker – Bug 67

My second Popcorn Maker bug that is now up for review is bug 67. The issue is that users are able to change their video source to nothing, and doing so breaks the application. Below is a screenshot showing what happens when the media’s source is changed to nothing.

Popcorn Maker  No Video Source

The event handler that is responsible for changing the URL is in js/menu.js.

js/menu.js

      buttonManager.add( "change-url", $( ".change-url-btn" ), {
        click: function() {
          $(".media-title-div").html( $('#url').val() );
          popupManager.hidePopups();
          var newUrl = $('#url').val();
          if ( newUrl !== butter.currentMedia.url ) {
            butter.currentMedia.url = ( $('#url').val() );
            pm.toggleLoadingScreen( true );
            function changeComplete( media ) {
              pm.toggleLoadingScreen( false );
              butter.unlisten( "mediacontentchangecomplete", changeComplete );
            }
            butter.listen( "mediacontentchangecomplete", changeComplete );
          } //if
        } //click
      }); //change-url-btn

It turns out that butter broadcasts a “previewerfail” message when changing the media’s source fails. So, to fix this bug, all that needs to be added in is an event handler that will listen for the “previewerfail” message and revert the media’s source back to what it was originally.

      buttonManager.add( "change-url", $( ".change-url-btn" ), {
        click: function() {
          var newUrl = $('#url').val(),
          oldUrl = butter.currentMedia.url;
          popupManager.hidePopups();
          if ( newUrl !== butter.currentMedia.url ) {
            butter.currentMedia.url = newUrl;
            $(".media-title-div").html( newUrl );
            pm.toggleLoadingScreen( true );
            function changeComplete( media ) {
              pm.toggleLoadingScreen( false );
              butter.unlisten( "mediacontentchangecomplete", changeComplete );
            }
            function changeError( media ) {
              butter.currentMedia.url = oldUrl;
              $(".media-title-div").html( oldUrl );
              butter.unlisten( "previewerfail", changeError );
            }
            butter.listen( "mediacontentchangecomplete", changeComplete );
            butter.listen( "previewerfail", changeError );
          } //if
        } //click
      }); //change-url-btn

The diff for this commit is here.

While testing this out, I found another bug. If users enters in “badURL” as the media’s source, they are presented with an alert that tells them the loading failed, and allows them to enter in another URL. This is a good thing, but it only happens the first time. So if you once again chose “badURL” as the media’s source, Popcorn Maker would accept it, and would be left in a broken state. This patch also fixes this issue. Now the users will always be presented with an error message and a chance to correct it if the new media’s source fails for whatever reason.


by mbuttu at January 25, 2012 08:58 PM


Scott Downe

Update on Firefox bug 677122

Last night I thought I made a lot of progress on Firefox bug 677122. Turns out, I just made some progress. I am building another option as I type this, so things may still be better than I think, but we’ll see.

What I have accomplished is getting a reference to the video element, inside the video document, at the time the user clicks enter while selecting the address bar that has some media fragment data. Test video link.

I also accomplished exposing the ProcessMediaFragmentURI function to this scope. This was my initial goal, and what I hoped could be the finish line. That function should be doing all I need and This is a huge step, but there is one small problem. That function crashes if the video has already been loaded.

I am still wrapping my head around why this happens. What I do know:

The existing code only calls ProcessMediaFragmentURI inside the MetaDataLoaded. So currently, this function is only ever called during a load.

So, from inside ProcessMediaFragmentURI, GetCurrentSpec is being called. It hits line 2880 and checks if something called mLoadingSrc is true. If the video is already loaded, this enters an object, and starts the process of a termination of the browser.

I have options. I can either investigate this termination, possible bug, and make the ProcessMediaFragment function work on loaded and playing videos. Or, I can figuring out how to properly call LoadWithChannel, which will call ProcessMediaFragment inside a loading context. The later is what I am currently building, as it seem like the path of least resistance. But, I suspect it may not be the best solution in the end.


by scottdowne at January 25, 2012 06:16 PM


Justin Robinson

Execute order 2036

I try to join the BigBlueButton demo meeting, and the loading hangs again at 100% (or 90% if I use Chrome instead of Firefox) This time, though, the log gives me this message:

[ERROR] Error loading PollingModuleError #2036

So what is Flex Error 2036? I’m sure I’ll find out.

After lunch.

UPDATE: Apparently, the root cause of Error 2036 is that some Flash object can’t be found. So it’s time to go through the Polling AS and find what’s gone missing…

UPDATE: Turns out the cause of the problem was convenience breeding complacence. I have an alias set up that pretty much automates a recompile of BigBlueButton, and the step for compiling Polling Module is in the middle. Unfortunately, running the whole script at once doesn’t wait around to show you when there are errors in the compile, like I was getting. Sigh. Anyway, parts of the client code had reverted to an older state, and I needed to update them again. Problem solved!


by Justin at January 25, 2012 05:19 PM


Kun Liu

SBR600 RPM writing lab 2

I just worked with “wget” command. Now everything looks fine, spec file give me now error or warning , same as SRMP file. However, I still get an error from RPM file, which is “empty-debuginfo-package”. I hope I can figure it out tomorrow.


by kliu39 at January 25, 2012 04:07 AM

SBR600 RPM writing 1.2

Forget to including some command output for “less” command:

less.spec file:

Name:           less
Version:        443
Release:        1
Summary:        A program similar to “more”

License:        GNU
URL:            http://www.greenwoodsoftware.com/less
Source0:        httP://ftp.gnu.org/gnu/less/less-443.tar.gz

#BuildRequires:
#Requires:

%description
allow backward movement in the file

%prep
%setup -q

%build
%configure
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

%files
%doc README
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/man1/*

%changelog
*Tue Jan 24 2012 Kun Liu<kliu39@learn.senecac.on.ca> 443-1
-SPEC file updated


by kliu39 at January 25, 2012 02:57 AM

SBR600 RPM writing lab -1

Today I tried this lab with my first command, which is “less” command. At the beginning, it was very frustrated, because it failed some many times, and I had to keep searching online to find the solutions.

Finally I got it almost done done, except only one error–”rpm build errors installed but unpackaged”. It took me almost another hour to tuning the less.spec. Then I run the “rpmbuild” without any error.

But that was only part of the job. When I run “rpmlint” command to test the spec file, binary file and SRPM, I still got some errors and warning. Fortunately, the system gave me very clear message, list the errors and warning, even point out the incorrect line related to the program. So the troubleshooting is not so difficult. It even point out my typo. 8-)

Now I will try with second command “wget”. Hope I will be back soon.

Useful link for this lab.

http://wiki.mandriva.com/en/Policies/RpmSpecProposal

 


by kliu39 at January 25, 2012 02:48 AM

January 24, 2012


Chi Hsun Lai

Journey to building RPM’s

So as I am writing this blog I have just spent my last 2 hours figuring out how to build an rpm from source. Last post I have made was about building from source and installing, but I will be talking about how I attempted build from source

First of all you will need the pre-requisites

yum install groupinstall “Fedora Packager”
yum install rpmlint yum-utils

Once we have those installed we can move on into creating our RPM.

Now I issued these commands to create the directories for rpmbuild.

rpmdev-setuptree

I previously had my wget tarball located in my Downloads folder (default by Firefox). Now we need to copy wget-1.13.tar.gz over to ~/rpmbuild/SOURCES I issued this command:

cp wget-1.13.tar.gz ~/rpmbuild/SOURCES/wget-1.13.tar.gz

After that it was time to configure the SPECS file located in ~/rpmbuild/SPECS

To create a empty skeleton spec file, I ran the command

rpmdev-newspec wget-1.13.tar.gz

Now I used vi to edit ~/rpmbuild/SPECS/wget-1.13.spec with this command:

vi ~/rpmbuild/SPECS/wget-1.13.spec

Now is where I have been stuck for the past 2 hours,

I have configured the SPECS file, everything loads and loads, and seems fine, few seconds later I get to some permission denied errors.

DAY 2 UPDATE

I have been writing this post in draft mode, today is the 24th of January, it is 5:50pm right now, I have spent the last hour working on my spec file for wget-1.13. I was determined to get this working today, after surfing and surfing the internet, and playing around with the spec file and doing some trail and error! I FINALLY got this to work!

I ran the rpmbuild -ba wget-1.13.spec command and just crossed my fingers, when it was done it was time to examine. This is where I came to join when I saw the following two lines:

Wrote: /home/chlai2/rpmbuild/SRPMS/wget-1.13-1.src.rpm
Wrote: /home/chlai2/rpmbuild/RPMS/x86_64/wget-debuginfo-1.13-1.x86_64.rpm

I literally jumped in joy! After hours and hours of testing and researching it finally worked! Here is how the last bit of script went which means it gave me no errors.

Processing files: wget-debuginfo-1.13-1.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/chlai2/rpmbuild/BUILDROOT/wget-1.13-1.x86_64
Wrote: /home/chlai2/rpmbuild/SRPMS/wget-1.13-1.src.rpm
Wrote: /home/chlai2/rpmbuild/RPMS/x86_64/wget-debuginfo-1.13-1.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.DOOT2g
+ umask 022
+ cd /home/chlai2/rpmbuild/BUILD
+ cd wget-1.13
+ rm -rf /home/chlai2/rpmbuild/BUILDROOT/wget-1.13-1.x86_64
+ exit 0

Here is my spec file for those interested:


Name: wget
Version: 1.13
Release: 1
Summary: Repacking from tar to rpm for wget
License: GNU
URL: http://www.gnu.org/software/wget/
Source0: ~/rpmbuild/SOURCES/wget-1.13.tar.gz

%description
Wget enables downloading from command line

%prep
%setup -q

%build
./configure
make
%install
make DESTDIR=%{buildroot}

%clean
rm -rf $RPM_BUILD_ROOT

Now it is time to use rpm lint and see if my packages are good to go

cd ~/rpmbuild/SPECS
rpmlint wget-1.13.spec

The results were:

[chlai2@localhost SPECS]$ rpmlint wget-1.13.spec
wget-1.13.spec:18: W: configure-without-libdir-spec
wget-1.13.spec: W: invalid-url Source0: ~/rpmbuild/SOURCES/wget-1.13.tar.gz
0 packages and 1 specfiles checked; 0 errors, 2 warnings.

Yes there are warnings, but no errors is what I am concerned about right now.

Next up, rpmlint the actual rpm, and srpm.

cd ~/rpmbuild/RPMS/x86_64/
rpmlint wget-debuginfo-1.13-1.x86_64.rpm

Results:

wget-debuginfo.x86_64: E: no-changelogname-tag
wget-debuginfo.x86_64: W: invalid-license GNU
wget-debuginfo.x86_64: E: empty-debuginfo-package
1 packages and 0 specfiles checked; 2 errors, 1 warnings.

Analysing the above errors and warning, it said I did not have a change-log, but that is okay, I didn’t include one in my spec file! the GNU licence is invalid because I only entered GNU. The main purpose of this lab was to actually build the RPM from configuring the spec, and building from source. Which I have done.

Next up, the SRPM file.

cd ~/rpmbuild/SRPMS/
[chlai2@localhost SRPMS]$ rpmlint wget-1.13-1.src.rpm

wget.src: W: name-repeated-in-summary C wget
wget.src: E: no-changelogname-tag
wget.src: W: invalid-license GNU

Everything looks the same as the above. Looks fine with the warning and changelog error which will be fixed at a later time.

Here are the srpm and the rpm file for those that wish to download it. EDIT: Just realized you cannot upload rpm’s on to wordpress.

Please email chlai2@learn.senecac.on.ca for them if you wish to use them! Thanks for reading, stayed tuned for post, it will be about Mock and Koji

That’s it for now, thank you for reading my long long blog post!


by teddychilai at January 24, 2012 11:15 PM


Chris Choo

Building from Source


In this blog post I am going to go though a simple example of how to build software from source. It may see like a difficult task but in reality it is very simple to do, as long as you read the documents supplied you should be fine.

For my demonstration purposes I used software from the GNU Project, there lots of different software at their website but I decided to choose these two


  • Proxyknife - This program is basically to find out open proxy ports behind users firewalls. There are many other options and functions that you can invoke while running this software that could be of use to you if you need a program like this.
  • Units - What this software does is it is a simple unit converter, I found this program to be very interesting just in the fact that it is a simple converter (KM to M, etc...) as well is is able to do simple unit calculations. Very useful tool to have if you need to do a quick conversion.


Here are the steps that I used to install this software, I followed the same procedure for both of my source software.

1) Grab the tar file from the site proxyknife-1.7.tar.gz or units-1.88.tar.gz

2) Extract the tar using "tar -xvf  proxyknife-1.7.tar.gz" or "tar -xvf units-1.88".

3) Go into the directory of the extracted folder ( It is a good idea to read the supplied documents to see if there are any other extra dev tools need).

4) Now in that same directory we are going to configure the build for are specific machine by using the command "./configure" , this will run through and usually make the "make" file to setup.

5) Then after the configure is complete type the command "make" to build the software. For my testing purposes I used the time command to see how long it took to finish the make.

[ ProxyKnife ]
$ time make
real    0m1.641s
user    0m1.260s
sys    0m0.300s

[ Units ]
$ time make
real    0m0.857s
user    0m0.790s
sys    0m0.070s

These two programs built relatively quick.

6) After the make is done type the command "make install" which will install the program.

Overall this process only took around 10mins, I did play around with the units program for a bit and it did do proper conversion, but the proxyknife need a bit more manual reading before I mess around with. The only problems that I ran into was that I was not able to install certain parts of the program unless I was root, it usually gave me a permission denied. Switching to superuser root let me install the two software's without any issues. Though it is always good idea to use your user to do things, some things do require root access just like these software.





by Chris Choo (noreply@blogger.com) at January 24, 2012 10:53 PM


Justin Robinson

Sleeping on the job

Alright, so I recompiled the client and the apps, restarted Red5, and now when I sign in to the Demo meeting it will start to load, and then stop at “Loading 10 modules.” No error messages, nothing in the logs, it just….. stops. Weird.

UPDATE: Ah, the Big Blue Ghost is at it again. Somehow, a line of code from the clipboard was pasted into another part of the file it came from without me knowing it. Deleted it, recompiled every little thing, and now let’s try and run this again.

UPDATE: Ta-daaah! It worked. Now to throw in a foreach loop and a call to the system time, to get rid of the nulls currently being stored in votes and time as soon as the Poll is created.

UPDATE: Don’t you just hate it when a coding blog says “I’ve solved the problem!” and doesn’t go into quite enough detail on how? Especially when it’s your own blog? Yeah, I’ve hit the same problem again today. I have to somehow remember how I tracked down the offending line of code yesterday.

UPDATE: Nevermind, slightly different problem.


by Justin at January 24, 2012 06:56 PM

This looks like a job for…. BLOGGING!

Alright ladies and germs, new problem! We’ve got some work done on the Polling module for BigBlueButton, it can save the polls we create to Redis, list and retrieve available polls for whatever room you’re in, and deletes them when it should. Now I’m trying to update calls to the various savePoll methods throughout the client-side code, but at least one of them must still be eluding me. The way it was done initially, the poll objects only tracked the title, question, answers, and multiplicity (whether the answers could be treated as radio buttons or a checklist); now they also have to track the votes for each answer, the room ID, and the timestamp. Unfortunately, after updating all the savePoll calls I could find, I still get this error message from the server terminal when I save a poll:

[INFO] [NioProcessor-3] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder – Action poll.savePoll
[ERROR] [NioProcessor-3] org.red5.server.service.ServiceInvoker – Method savePoll with parameters [[Crosby, Olvetchkin], Won the gold?, Hockey, false] not found in org.bigbluebutton.conference.service.poll.PollService@b7141a

(In this case, my sample poll had the title “Hockey”, the question “Won the gold?”, the answers “Crosby” and “Olvetchkin”, and a value of false for multiplicity)

UPDATE: I think I found it, there was another savePoll call hiding in the PollManager that I’d overlooked, and it was trying to call the old version with 4 arguments.

UPDATE: Okay, that didn’t work, but I’m starting to think that the NetConnection call where the Polling Actionscript uses a Polling Java method is trying to find the Java method in the Actionscript file. Maybe I just have to give the NetConnection.call() a better path to the savePoll method I want it to use…

UPDATE: No, that can’t be it. What am I thinking? The logic never even gets to the call(), because the log messages that precede it in the savePoll method never execute. Now, where is this savePoll that I’m in currently called from?

UPDATE: This still doesn’t make sense. PollingEventMap.mxml tells the handleSavePollEvent to handle the act of a poll being saved, sensibly enough. It passes a SavePollEvent to the handleSavePollEvent in PollingManager.as, and then that calls savePoll in PollingService.as, using all the arguments. So why is it still telling me it can’t find a savePoll in PollingService with only four arguments? Nobody is ASKING for a savePoll in PollingService with only four arguments!

UPDATE: I’m a blockhead, I’ve been running the command to recompile the APPS, when it’s the CLIENT that I’ve made changes to. Way to go, Justin! Let’s see if it works after a CLIENT recompile.


by Justin at January 24, 2012 04:18 PM


Kun Liu

SBR600 Build-from-Source Lab

My choices are “less” and “wget” commands, and here are the links for these two commands:

http://www.gnu.org/software/less/

http://www.gnu.org/software/wget/

After downloaded and unzip the tarballs, they both need “configure” first, before we make the package.

time make for “less”

real    0m6.446s
user    0m5.641s
sys    0m0.755s

time make “wget”

real    0m3.135s
user    0m0.425s
sys    0m0.955s

These two commands are easy to build. However, I tested “less” command with the executable file, and I did not find the executable file for “wget” after build.

 


by kliu39 at January 24, 2012 03:14 PM


Kavishankar Srivamathevan

Building from Source Code

Here I am doing a basic installation from a Source Code. I will be using software from GNU's official site. On the site there is bunch useful applications and tools that is available for us to use or try it out. To demonstrate my building process I will be downloading two small softwares, which is downloaded on that Web site.

They are:
  1. GNU Chess - GNU Chess is a full game of chess.
  2. Units - It is a units converter.

GNU Chess is a full game of chess that we play on command line, so yes it is a text based chess, not graphical chess game. But for the graphical interface we can install another package called XBoard and run the XBoard with gnuchess, which it is now Graphical Chess Game.
To run: $ xboard -fcp 'gnuchess --xboard'

Below is the steps to build and install the software:
  • First, Download the source code from here.
  • Then extract or unpack the source code tarball, like this tar xvzf gnuchess-6.0.1.tar.gz
  • Go in to the extracted directory
  • It is recommended that we read the instructions file, which are usually named INSTALL or README.
  • While in that directory, run the configure script, which sets up the build for the system. For example, we can specify where your home directory is, by specifying it in the prefix.
  • To run the configure script, type this in the command line $ ./configure
  • Next we build the software, type: $ time make
  • Finally, type: $ make install, this will install the game to your system.
  • To run the simply type: $ gnuchess
  • Also, if you have the XBoard installed you can use the graphical interface for the game, to do that type: $ xboard -fcp 'gnuchess --xboard'
The purpose of typing time before make is that it is provide us the time that it took to execute the make for the software.
Here is my execution of the make for GNU Chess:

      real     0m31.251s
      user    0m16.175s
      sys      0m9.795s



The other package I downloaded is units, which is unit converter, meaning for example, using this small tool we can find out how many metres in a kilometres. For the units package I did the same exact procedure for building and installing the software, which is extracting the tarball; run the configure script; compile it using the make and then installing it. After we finish installing we can just run it by typing units command.
The execution time of the make for units package is:

      real     0m2.354s
      user    0m1.261s
      sys      0m0.524s



After finishing up just for fun, I tried the graphical interface for the chess game, believe me it is worth installing the XBoard package to play GNU Chess, playing it on the terminal felt weird. Anyhow, if you really want a free chess game on your computer, then download the GNU chess and I recommend running it with XBoard interface. Also, it can be installed easily, just type: yum install xboard.

Below is a screenshot of running the GNU Chess using the XBoard interface:



Overall it took less than 20 minutes to build and install these two packages. I had no problems going through the basic installation process, but except for a permission denied error. When I was doing the make install on both of these packages it gave me an error stating that permission is denied for some specifics tasks. But after change into the superuser (root) ran the make install, it installed successfully without giving me any errors. Therefore, you need to have root access to install these packages.

by Kavi Sri (noreply@blogger.com) at January 24, 2012 05:43 AM


Chi Hsun Lai

SBR600 – Build from source

Hello everyone, this post will be about building from source. This is one incredibly important knowledge to know for anyone switching over from Windows. When installing a program in Windows you simply click the executable file and it will do its job. For a Linux user to install a package may be something very new to them. I am here to document what I’ve done to “build” the following packages from source. First I decided to choose the following package to be demonstrated as part of my Week 2 Lab in SBR600.

I will be installing wget to my Fedora 16, wget is:

GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.

http://www.gnu.org/software/wget/

I have downloaded the wget-1.13.tar.gz file to my Fedora 16.
I changed my directory to where the downloaded file is,

cd /home/chilai/Downloads

to extract the tarball file, I issued this command:

tar xvzf wget-1.13.tar.gz

once that was complete I would now then need to change directories containing the filed we just unpacked, or “unzipped” in windows.
Now I will need to run the configure script to make this package work for my particular system.

./configure

Once that is completed successfully I will now need to build the software using the command make. My instructor Chris has asked us to time how long it took us to execute the command. So I used the time command before make

time make

Here is the result it gave me after it ran the script:

real 0m15.134s
user 0m10.114s
sys 0m2.154s

We are complete! We have just successfully installed the gnu package wget

Now, on to my second demonstration of installing a GNU package.

I decided to install a console text editor – Moe

http://www.gnu.org/software/moe/

I downloaded the tarball: http://mirror.csclub.uwaterloo.ca/gnu/moe/moe-1.4.tar.gz

Same procedure as the package above,

Extract,

tar xvzf moe-1.4.tar.gz

change directory

cd moe-1.4/

run the configure script to configure the package for your computer

./configure

finally, make to install the package. once again I used

http://teddychilai.wordpress.com/wp-admin/post.php?post=9&action=edit&message=6&postpost=v2

time make

By doing that I can see how long it takes for the package to be built and installed. The results were

real 0m12.682s
user 0m9.307s
sys 0m1.353s

Thats it for now, stay tuned for my next blog,

Creating a RPM


by teddychilai at January 24, 2012 04:00 AM

January 23, 2012


Scott Downe

Firefox bug 677122 so far

I have been working on Firefox bug 677122 and have come to a sort of cross roads.

The problem in the bug is that a media fragment of a video document will not update changes unless you do a refresh of the page.

The media fragment parsing happens once the video’s meta data is loaded, which makes sense. So it is obvious why the fragment doesn’t get re parsed without a refresh. Something I did notice though, in the anchor code a string with the media fragment data does get passed in, but I have not found it using this data for anything. Seems like a waste, and to me it would make sense to just do all media fragment parsing then. One point, instead of two. I cannot simply refresh the video when it is already loaded, nor can I set the video’s playback position if it did not get loaded.

My options are to hook into the anchor code, parse for “t=10,100″, if we are a video doc, and video is loaded, call media fragment parser, if the video is not loaded, setup an event of some sort. One path to all “#” at end of URL, two ways to parse it (media fragment or anchor), loaded or not. Or, keep things the way they are, and just do half of what I said above; only update the fragment in the anchor parse if the video is already loaded.


by scottdowne at January 23, 2012 07:33 PM


Andor Salga (asalga)

Learning to Wield and Forge Gladius

Wielding

For the next few weeks I’ll be working on the open source project Gladius. More specifically, I’ll be working on CubicVR.js, a rendering engine which is one part of the Gladius 3D game engine. Gladius in turn is part of Paladin, Mozilla’s initiative to bring awesome gaming technologies to the Web.

Since Gladius is a game engine, it is essentially a conglomeration of many game-related technologies:

Drawing Stuff

CubicVR.js is a JavaScript port of Charles Cliffe’s CubicVR game engine which is responsible for rendering using WebGL.

Saving Stuff

GameSaver is a project which uses Node.js and BrowserID to save JSON game state on a server. Check out a prototype which uses GameSaver at MyFavoriteBeer.org.

Physics Stuff

For collision detection and response, Gladius uses AMMO.js: a JavaScript port of the C++ Bullet physics engine.

Controlling Stuff

My supervisor, David Humphrey and colleagues in my lab have been working on two important aspects of game input: the Gamepad API and the Mouse Lock API. Check them out, they’re very interesting.

Other Stuff

This list is not exhaustive. As the project matures it is expected other libraries and technologies will be incorporated.

Forging

The release date for Gladius 0.1 is mid February, so I’ll be contributing where I can to help out with the release. Last week I started by making a minor tweak to CubicVR.js. Not much, but it’s a start. I also noticed there wasn’t a way for developers to simply check for AABB-AABB intersection. So I filed the issue and began working on that as well. This week I’ll be working with Bobby Richter to fix COLLADA related bugs which is super exciting. (:

Do you want to get involved? You can find a number of ways to get in contact with developers and start contributing right here.


Filed under: Game Development, Gladius, Open Source

by Andor Salga at January 23, 2012 06:32 PM