Thursday, February 24, 2011

Chapter 7

7.2.2:

Without -u (diff factorial-number factorial > factorial-nfix-ticket2604.patch)

6,7c6,7
< if n > 0:
< result = n * factorial_recursive(number-1) --- > if number > 0:
> result = number * factorial_recursive(number-1)

With -u (diff -u factorial-number factorial > factorial-nfix-ticket2604.patch)

--- factorial-number 2011-02-03 05:53:13.000000000 -0500
+++ factorial 2011-02-17 14:29:58.590786002 -0500
@@ -3,8 +3,8 @@
# define a factorial function in recursive flavor
def factorial_recursive(number):
result = 1
- if n > 0:
- result = n * factorial_recursive(number-1)
+ if number > 0:
+ result = number * factorial_recursive(number-1)
print "factorizing: ", number, " result: ", result
return result

Without -u, the output is only the changed lines. Diff run with the -u tag shows names of the two files that were compared, the time and date of the two files' creations, as well as the the code of the entire function that was changed. I am not sure what the numbers mean directly above the code in each example.


7.8:

Created a 'bar' file with these contents:
Contents of the "bar" file: blah blah blah

Command:
diff -u /dev/null bar > foo

Results (in 'foo' file):
--- /dev/null 2011-02-24 11:26:51.181903002 -0500
+++ bar 2011-02-24 12:04:15.292286001 -0500
@@ -0,0 +1 @@
+Contents of the "bar" file: blah blah blah

I'm not entirely sure if I understood the instructions correctly, but from what I can tell I did the exercise correctly.


7.9:

I tried running the first command (curl -O http://ftp.gnu.org/gnu/coreutils/coreutils-8.4.tar.gz) but I didn't have the 'curl' program installed. After running 'sudo apt-get curl', I ran the command again. The rest of the steps were as easy as copying and pasting the commands into terminal, with the exception of editing the 'echo.c' file and the 2nd to last step which reads: "$ ./configure$ make." The 'make' step should be on a new line.

The last step made me laugh; either it is written wrong or it was an intentional joke. The command list being reversed is the same backwards and forwards, so even if the echo command is now reversing the order, you can't tell. I instead ran 'src/echo is this reversed' and this gave the output 'reversed this is' proving that it is reversing the order of words.

Tuesday, February 22, 2011

The Patch

After reading chapter 7, our group was less perplexed about how to submit the fix to the bug ticket we submitted. The .patch file creation was outlined very nicely in the text. We created our patch file by using the same command, only changing the names of the involved files.

Our completed Patch Report is now on the A-Team's wiki page.

This was an interesting learning experience. The fix for the bug was so small and trivial, yet the process for submitting this fix was fairly complicated. The turnaround for our small patch was very fast; I can imagine large submissions taking much longer due to reviews needed and testing required.

As a side note, I now have my Motorola Atrix a.k.a. "The World's Most Powerful Smartphone." I've already rooted the device and enabled sideloading, but it seems as though the bootloader is signed; this means that as of right now users cannot load custom ROMs to really customize things. This is the first smartphone I've owned since the PDA phone I had about 7 years ago. I'm enjoying the capabilities of the phone and the MotoBlur interface will have to suffice for now.

Thursday, February 17, 2011

Submitted the bug/Alumni Symposium

We submitted the bug and it is now a ticket that can be found via this link:
http://bugs.sugarlabs.org/ticket/2604
Someone outside of our group changed the status of our ticket as follows:

Changed 5 days ago by RafaelOrtiz ¶

* priority changed from Immediate to High
* milestone changed from Unspecified by Release Team to not applicable

The ticket is not on the main bug tracker page but is in the list of tickets. I've thought about submitting a comment to the ticket, but I will wait until our group meets today.

The Alumni Symposium was a great event. The main thing I took away from the experience is that I need to pursue computer science interests outside of class. I have had the urge to play with making Android apps for a little while but I haven't gotten around to it. Perhaps when my new Motorola Atrix arrives next week I'll be more motivated. I'll have to root the device though because AT&T doesn't allow sideloading apps.

Thursday, February 10, 2011

Found a bug!

Our group spent some time on Tuesday trying to get the Browse activity to work. The problem with Browse is that a Hulahop dependency will not install. We gave up on that for the time being and discussed bugs. We were not feeling very encouraged until Stephanie pointed out a problem with an example math program that comes with the Pippy activity. The bug is a simple naming mistake which is easily fixed. After investigation, we found that the bug was undiscovered up to that point, and so our group will have the opportunity to submit a new bug to the bug tracker and provide a fix.

Tuesday, February 8, 2011

Chapter 6

I saw this bug in the Sugarlabs bug tracker that is 2 years old:
http://bugs.sugarlabs.org/ticket/405

The problem described here is that there is not sufficient visual indication that the Keep button is pressed which causes the user to try pressing it multiple times. A documented suggestion for fixing the bug is the addition of a brief hourglass. This bug has changed in status from 'bug' to 'enhancement' and was supposed to be fixed in the 0.86 release. It still hasn't been fixed; this could be the case because developers don't see the enhancement as necessary.

I signed up on the bug tracker so I am now able to comment on the bugs. Whenever someone provides a comment, it is not instantly visible on the bug tracker; instead, the comment is forwarded to someone for review and acceptance. I reproduced a bug, confirmed that the bug shows itself and commented on it on the bug tracker. It did get approved to show and I did get a response.
This is the bug: http://bugs.sugarlabs.org/ticket/1997
There is a patch that someone wrote for it, but the Read maintainer hasn't added it to the repository. The patch needs reviewing; perhaps this is something my team can help with?

As for the other bugs, I haven't been able to find any more yet that I feel I can triage. I tried to reproduce this bug as well but was unable to: http://bugs.sugarlabs.org/ticket/2569
I downloaded the xvkbd virtual keyboard and used it in sugar, but it didn't remain open when I clicked on the 'x.'

Thursday, February 3, 2011

Freeciv

I had a rough time with the Freeciv assignment; it ended up breaking my dual boot Ubuntu installation. Here is the story:

I began to follow the instructions in the INSTALL file as directed by Chapter 5. I had already checked out the source with svn, and was installing dependencies. I got to the "Prerequisites for the Gtk+ 2.0 client." I checked for 'pkg-config' in the Synaptic Package Manager and noticed it was already installed. Moving on to the Glib library, I found that I didn't have it installed. I downloaded Glib from the ftp link and installed it. Then I checked for Atk, found I didn't have it installed, and downloaded it from an ftp link as well. When I tried to install Atk, it complained that it asked something for the version of Glib and that it returned version 2.6.6, but it when it actually checked the files, it found version 2.26. After this message, it said I should try ldconfig. I tried running that, it complained about permissions, so then I ran sudo ldconfig. It seemed to work, but then I noticed that anything I tried to open in the GUI would not open. I clicked to restart Ubuntu, but nothing happened. So, I powered off the computer and turned it back on. Ubuntu would not boot; it got stuck on the loading screen.

I had to reinstall Ubuntu. Consequentially, I had to reinstall updates and rebuild the Sugar project. I decided I wouldn't take any more chances with my dual boot setup of Ubuntu, and booted up Ubuntu in my Windows virtual box. I decided to skip the dependencies steps. I initially tried ./configure, but that didn't work. I noticed there was no configure file. After doing some reading in the Install file, I found that I had to run ./autogen.sh. Then I ran make, and then sudo make install. The program was installed with no problems, and it runs smoothly.

I think the moral of the story here is to not always follow instructions.

Tuesday, February 1, 2011

Building

Our group has officially switched projects from RapidSMS to Sugarlabs. I've had quite a bit of trouble building and installing, and still haven't gotten anything to actually run.

Carly sent the group this link which was very helpful:
http://wiki.sugarlabs.org/go/Development_Team/Jhbuild

First, I tried building on the Ubuntu version 10 that I already had installed on my computer. I was confident through the beginning steps. I liked that they had a script for checking required dependencies before the build process. I ran "depscheck" and copied and pasted the names of the missing dependencies into the Synaptic Package Manager to mark them for install before hitting 'apply' to install them. Then I ran the check again to make sure I didn't miss anything. Then, I started the build phase. I received error after error. Upon receiving an error, the build process would stop and show a prompt that looks like this:

*** Error during phase build of python-xklavier: ########## Error running make *** [5/31]

[1] Rerun phase build
[2] Ignore error and continue to install
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
[7] Go to phase "configure"
[8] Go to phase "clean"
[9] Go to phase "distclean"
choice:

I tried hitting option 1 to retry the errors, but the result was the same. Above the prompts for the errors it would say that it wanted later versions of dependencies, but the Synaptic Package Manager didn't have those versions. After hitting option 2 multiple times for different modules, I finally reached the end.
It showed a lengthy list of modules that weren't built that looked like this:

*** the following modules were not built *** [31/31]
telepathy-gabble sugar-presence-service sugar-toolkit sugar meta-glucose read terminal log pippy imageviewer turtleart jukebox meta-fructose meta-sugar

Digger deeper into the documentation, I saw that they only support Ubuntu 9.10. I also saw a single command to download all the dependencies; I was mad I didn't see this earlier since I had gone through the trouble of copying and pasting each individual dependency into the package manager earlier. I wanted to keep my later version of Ubuntu installed, so I decided to install Virtual Box in my Windows Vista environment and install Ubuntu 9.10. I tried the dependency command, but it didn't work; I still ended up using the copy/paste method. I went through the build process on this environment and experienced fewer errors, and did not get a list of modules that weren't installed at the end. Hopeful, I tried to run sugar, but it would not run.

There is still more to figure out, but I'm glad I've gotten some of the growing pains out of the way. Two of my group members have had success actually running sugar, so I will talk to them today in class to see if they did anything differently. Perhaps I will have to get rid of my Ubuntu 10 after all.