Wednesday, February 23, 2011

TOS Chapter 7 Exercises

7.2.2.
I agree that the diff command using the -u parameter is much easier to read because it provides the entire file so you can get a sense of where in the file the changes were made. The diff command without the -u parameter just prints the changes, < the original line and > the new line.

7.8
I'm not sure if I understood this exercise fully. We're supposed to create a text file called bar.txt and put some information in it. Then diff this file with /dev/null because this represents an empty file and pipe the results to the patch, foo.patch. I opened the patch and the file contained the information from the bar.txt file so I'm assuming that this was right.

 diff -u bar.txt /dev/null > foo.patch

7.9
The patch for the echo.c file seemed to be fairly straight forward. I just followed the steps to create the patch and edit the file. My patch file ended up looking like the example.
Then I wanted to check the code to make sure it would run after the changes. The example said to enter ./configure$ make. I was confused here because that was a strange command. Then I realized it was a typo and that they are two separate commands, ./configure and THEN make.
I typed in src/echo is this reversed and "reversed this is" was the output.

It was pretty cool learning about the diff command and how to create patches.

Monday, February 21, 2011

TOS Chapter 7

This chapter of the TOS book was about fixing code and creating patches. I understood did not know going into this chapter what patches were but now that I've read a little, I understand the concept.

My group from CSCI 362 used the diff command in our project to compare the oracle for our test to our results to see if the test succeeded or failed.

A patch in this chapter is described as like what SVN stores for the difference between the different versions of the files. It does not hold copy after copy after copy of the file in the repository but only the changes from one version to the next.

Comparing two files seemed easy enough but I don't think comparing directories and all the files inside is easy to do.

Alumni Symposium

I attended the Alumni Symposium on Feb 15th and I thought it was great. I was cool seeing two students who had just graduated from CofC speaking at this event. I enjoyed listening to the speaker's view on what we should know for when we graduate and how their experience was when they graduated.

Some things that I learned were:
its better to be truthful about what you know and only list languages that you are confident in working with on your resume than to list pages and pages of languages and concepts that no one could really have a full understand of.
its better to find something that you're passionate about because your passion will be the driving force for your work ethic.
its good to get involved with computer science oriented groups and associations. "Who you know" can play a large part into whether or not you get the job.

Some things to be looking into:
-web applications
-mobile computing/apps

Tuesday, February 15, 2011

Bug Fix Progress

So far our group is doing great!
We chose our first bug and initially found where we believed the error was in the code on Feb 10th. When we commented out the 'attack menu' line, the scan button no longer attacked the enemy. This was only half of the issue though; the scan button is supposed to display a depletion level and the weakness of the enemy (ex: weakness is fire).

Before our next group meeting on Feb 13th, Jaime found the code for displaying the scan damage information. After adding this to the scan button if statement, our bug was fixed! Therefore, in our Sunday meeting, we were able to meet with Jon (the main developer for the Fortune Hunter game) over Skype.

We let him know that we fixed the bug and he told us to use GIT to commit the new code back to the Sugar Labs repository, then update the bug on the bug tracker to fixed.

We thought we should commit the new code up to our repository on the 462 playground server and then check the code out again to make sure it runs properly. We were having some trouble with this so we will need to do some additional research so that we can use SVN to commit code to the Cirdles repository and then GIT to commit the code to the Sugar Labs repository.

We still have plenty of time to do this but we wanted to keep the ball rolling and start looking into our next contribution so that we can stay ahead of the game in case any bumps might occur in the future.

Thursday, February 10, 2011

Selecting our first bug to tackle

This week's assignment was to select a bug from our project's bug tracker. My group has chosen the "scan damage" bug.

The issue here is that in the game, Fortune Hunter, the user is supposed to be able to click the Scan button to see the weakness level of the enemy and the number of hit points left for the enemy. Currently, the Scan button attacks the enemy and displays "You attack for 10 damage", which could probably be worded a little better in itself.

As far as our approach to fixing this bug, we have found a definition for the scan function as well as the player_input variable which is used to display the messages (the incorrect message in our case). We plan to look further into those two possible causes for the bug.

We think we would be able to easily test our fix-attempts for the bug because we have the source code and we are able to run the game. Brittany has also setup a repository for us on the cirdles' server so we can make sure we can revert to a previous version of the source code if our changes break the game.

Monday, February 7, 2011

TOS Ch6 Exercises

Chapter 6 of the Teaching Open Source book is called "Debugging_the_Code". The first couple sections of this chapter are about find the bug tracker for your open source project. The author defines certain words that you need to know and that should be used in the bug tracker so that the bugs are clearly define and there is enough information for developers to find the bug, reproduce the error, and determine the level of importance of the bug.

Exercise 6.4
This exercise is to find the oldest open bug for the project that I have chosen, Fortune Hunter. There are currently only two open bugs for this project and the oldest one is actually the one we chose to help fix for our assignment due on Thursday.
The name of this bug is "scan damage". The reason why it is a bug is because the "scan" button in the game should only display the weakness of the enemy, not proceed to attack the enemy, which is what it currently does. The priority is marked as "major" and there is no severity listed. However, the author said that normally most projects will pick one of the two instead of having both.
I think the bug hasn't been fixed yet because there aren't that many people to fix bugs. I was looking through the bug tracker, opening all the bugs/tasks/enhancements and 98% of them have been reported by the main developer, Jonathan Meschino. I see only two other people listed as owners of some of the tasks/enhancements. Therefore, this is why I think this bugs has not been fixed. I don't think that Jonathan can't fix the bug, just that he hasn't had time to even look at this bug.

Exercise 6.5
This exercise is to create an account to gain access to the bug tracker. Jonathan has been very enthusiastic about us helping/contributing so he responds to all of our emails. He is so helpful and even told us how to set up our accounts. Brittany has been emailing back and forth with Jonathan about setting up our accounts for the bug tracker. He said he was still working on it yesterday, so we're just waiting to hear from him.

Exercise 6.6
The next exercise is to reproduce the bug from the bug tracker. I have been able to reproduce it before so this time I'll try to explain the steps for reproducing it.

1) Open the terminal
2) cd into "csci462/fortunehunter/MAFH2"
2) Type the command "python MafhActivity.py"
3) Press the Enter key to select "Adventure Play" (since there is no pointer in the game).
4) Press the Enter key to select "New Game"
5) Type in a name and press the Enter key
6) Arrow up key twice
7) Arrow right
8) Arrow up
9) Arrow left
10) Arrow up twice (you have reached an enemy and the options menu appears)
11) Arrow up once so that the 'scan' option is highlighted and press the Enter key.
"You attack for 10 damage" appears instead of a weakness level.

I'm pretty sure the enemies appear in different rooms each game so this probably wouldn't be the process to reproduce the error again but the error occurs every time you reach an enemy. Its hard to tell where you are going in the game because the map part of the screen is below my actual screen so I can't see it. Its hard to tell if I really did arrow up and left to get through the door or not.

I tried to look through the python files to see where is bug is occurring. I think I have found where it states what it should display but I'm not sure when/where is producing the wrong output. I haven't figured out how to debug in Netbeans yet, which I think it what I'll need to do to figure out the error.

Exercise 6.7
This exercise is to triage five bugs. Currently, there are only 2 bugs in our project's bug tracker. I think the one my group has chosen to focus on, scan damage, is reported fairly well. It has a reporter, priority level, component, milestone, and version. The description of the bug is given and understandable but it probably could have listed what the button displays as well as what it does. It could probably also list an example of what it should have displayed if it were working properly. There are not any steps on how to reproduce the error or where in the code this button was created/functioning. I think the "MAFH" component is just a folder that has many more files within it.

This information goes the same for the second bug reported about this activity. The only difference is that the priority level is "critical" instead of "major". The description is that the player is unable to move through the doors after they enter dungeon 3. The doors might be locked but there is no messages stating that the user needs a key. I wouldn't know where to begin with this bug because I don't even know what dungeon 3 is. I'm not sure if its referring to a room or a level or something else. I also do not know how the keys are used in the game to unlock doors. This bug could use a lot more information to clarify the whats wrong and where the bug is occurring.

Wednesday, February 2, 2011

TOS: Freeciv Exercise

For this assignment, we were supposed to go through the Freeciv example in chapter 5 of the TOS textbook. The purpose of this exercise was to learn about building source code. We've all done this before, but it was nice to follow the steps and get a better understanding for the process.

Using svn to get the code was simple. Installing the first half of the dependency packages seemed simple. Then I reached the Glib dependency. The author was able to get the package easily but no matter how I tried to get Glib on my machine, it couldn't find it. So I did what the author suggested and Googled it. I just typed 'how to install glib on ubuntu'. I found a forum where someone else was trying to glib and another user posted that they needed to type 'sudo apt-get install build-essential libglib2.0-dev', and this worked! Easy enough.

For the next three dependencies the author combined them all into one line, 'yum install atk pango gtk+'. (Which reminds me, since I am in Ubuntu, I don't use the commands he used. I had to use apt-get to install packages and dpkg -s to look to see if I had packages installed already instead of rpm -q). So, when I entered 'sudo apt-get install atk pango gtk+' the terminal responded with 'couldn't find package atk'. I figured I would turn to Google for information on how to install atk on Ubuntu but it wasn't easy to find information about this package. I turned to the install file that I opened at the beginning of this exercise. It says to get the package from ftp://ftp.gtk.org/pub/gtk/v2.6/atk-1.9.0.tar.bz2. So I downloaded the tar file, extracted it, ran ./configure, make, and make install. Everything went smoothly until make install. For some reason at this part I received a "cannot create regular file" error, and a "permission denied" error. I entered dpkg -s atk and it said that atk was not installed. I opened the Ubuntu Software Center and searched for Atk and this stated that libatk1.0-0, the ATK accessibility toolkit was installed. I wasn't sure if I need libatk1.0-0 or libatk1.0-dev. And this appeared to be the case for pango and gtk+.

I decided to just keep going to see if I get an error saying that they aren't installed, then I would come back and try again. But I didn't. Following along with the example, I received a different error than the author. My C++ compiler was fine; I received an error about libcurl development files. The example didn't get this error, so I was on my own to try to get this one. In the Ubuntu Software Center, there were two entries for 'development files and documentation for libcurl', GnuTLS and OpenSSL. I decided to just install the first one to see if it would be sufficient and it was. However, I still received yet another error. But this error was also received by the author in the exercise.

I didn't like how I couldn't find gtk+, gtk+2, or gtk2! So again I had to just try to Google information about it. Thank goodness for all of these forums, they can be so helpful. I found a forum where these two users were going back and forth trying to get gtk2 to install. They eventually got to this command 'sudo apt-get install gnome-core-devel build-essential libgtk2.0-dev libgtk2.0-doc dev-help'. I didn't need to enter build-essential because I had already done this, and I didn't type dev-help because the user showed that s/he received an error that dev-help could not be found. And it appeared that the command worked! This seemed to be more work than what the author had to go through but I also didn't get the next error that he received about gtk2-devel. Although, I did feel like he did when I saw 'Now type 'make' to compile freeciv'!!

The next step was to enter make. The author wanted to use the Unix trick to send output and error messages to files. The funny thing is, we just learned about this Unix command today in Operating Systems. At first I was afraid to do this, I might mess something up. But I decided to try it. I waited and hit enter after a while. I didn't see anything. Oh no... maybe I just have to wait a while longer.. he did say go get a cup of coffee and engage in some serious business somewhere else. Ah, it's done now.

Following this example made the build process seem kind of easy. Don't get me wrong, I thoroughly enjoyed being able to successfully build and compile the code! But I don't think it would have went through so smoothly if I was just following the install file. In the install file, it listed where to get the tar files. Once you download those, you have to run ./configure, make, and make install. However, by following the author, I just had to run sudo apt-get install for the packages. Overall though, I felt like it was a very useful experience. I believe I learned a lot and can understand the process a little better now.