Wednesday, February 23, 2011

Experience using diff

Using the diff tutorial in TOS Chapter 7 turned out to be really useful.  At first, we were stuck on how to go about formally submitting our bug fix for the string trimming problem.  It turns out that Sugar uses these exact same practices that TOS teaches to create a patch.


7.2:
Some things I've noticed about diff:

1.  It provides a very detailed report on the difference between the two provided (creation date, line differences, what's being added and removed, etc.).
2.  The -u command displays all lines that remain unchanged after using diff.  Not using -u only displays the lines that are different between the two files.

7.8:
This was a fairly simple exercise.  Here's the steps I took to complete it:
1.  Created a file called foo.txt and a file bar.txt.
2.  I left the file 'foo' blank, and wrote "This is a test." in the file bar.txt
3.  I used this command: diff -u bar.txt foo.txt > foo.patch

The contents of the file bar.txt are placed into foo.txt.

7.9:
Following 7.9 gave me a good idea how to go about applying what I've done for our own project in Sugar.    I changed the lines of code that it asked (to create a reverse ordering of the output), and created a patch for it.

To do this, i followed these instructions:
1.  Created a copy of the file using this:  cp echo.c echo.c.reverse
2.  Opened Gedit  and modified the code of echo.c as it has instructed.
3.  Created a patch for the file using this:  diff -u src/echo.c.reverse src/echo.c > echo-reverse.output.patch

To test the changes, I used "./configure" to build the project, and "make" to created all of the out files that can be run.  After running echo, it prints "reversed this is".


Some notes about our team:

We've come to a decision about our ideas for the rest of the semester, and we're all in agreement on creating a nutrition activity.  Our goal for the weekend is for each of us to create a hello world activity, and make sure that we're able to do this successfully.  If we're able to complete this by the weekend, I think that will be fair judgement on how difficult it would be for us to complete activity by the end of the semester.

No comments:

Post a Comment