User Tools

Site Tools


user:bboynton:portfolio

This is an old revision of the document!


Portfolio

Week One

the First week of class was interesting. No computers and one small white board. My C is very rusted. I am planning on starting the projects as soon as I can instead of putting them off till the last couple of days before the dead line. I also need to play around with lab46 again since I forgot most of it. I kind of understand the nodes and how to add new ones to the list with the tmps and next. Hopefully I do not forget before we get to them.

Week Three

For the third week of class we looked at the debugger tool for the gcc compiler. This tool will be very valuable to us in are attempts to code programs for data structures. We went over some of the basic options the debugger offers like list that displays the program in blocks, the command display which we can use to check variable at certain spots, step which runs the next line of the program, break which is used to set break points for the program to stop at like a certain line, and next which lets use run past functions that we are not interested in like scanf or printf. The debugger we can use to find run time errors or find why we are getting a segment fault which is a common run time error that I get when trying to use pointers and arrays mainly from simple mistakes that I have a hard time finding since I assume that the problem is larger than a simple mistake. The debugger will make finding this easier especially when we get to larger programs and looking at it line by line in nano or vim will take too long to find the problem. We also looked at the at the next project. This is getting into the data structures that we will be using but the project involves only pseudo code and pictures to help use grasp and understand things like a link list that we will be using in the future in C. The first project was also due on the 9th. That project helped me remember the syntax as my code was full of syntax errors that keep me from running the program or logic errors that I got with my if statements as I only used one = instead of the == that I need to check if it was equal to a certain value so it ran every if statement every time. I still have to get use to coding in C again and need to figure out how to get pictures of my drawings for the project due for week 4 from my phone to my lab46 so they can be submitted with my pseudo code. I think I can email it to my lab46 but I do not know how to get it from there to my src folder. I also believe that I can clone a repo from bit bucket to my lab46.

Week Four

For the fourth week of class week looked at projects. Both the one due the week before and the one due the next week (sln1). For the project dsi0 we looked different ways that people did the project and other ways of doing this. I was glad that my approach while not being the most effective or easiest was also not the most insane way of approaching the project. I understand that I am not as bad as I thought but also that I still have room to improve my coding skills and hope to do so over the course of this course. Along with looking at the last project on tuesday we looked at the sln1 project. We started by grabbing a copy of the project that contained all the files we needed for the project like the test and libraries along with the Makefile. We spent a lot of the time looking at the Makefile and what it does. There are multiple ways to use the make command that compiles the code we wrote along with everything else which I am very glad we have because compiling multiple files together is still confusing to me and I am sure I would make a mistake and overwrite my source file. We can make clean which gets rid of all the already compiled code so we can do a fresh start to make sure there is no problems. We can also make save which will back up our source code. Make submit which will submit the project for us (replacing the submit line). The makefile will help me with the creation saving and submitting of the source code for this project which is kind of some of the most important things. We also talked about some basic stuff for adding in a node to a singly linked list. On wednesday we looked at more of the sln1 project. This time we looked more into the project itself. We looked at the src folder in the project folder which is where the bulk of our coding is going to be done. We looked at the test that we have in the project folder that compile with our code so we can check if the code does what it is suppose to do which I am really glad to have for troubleshooting purposes. We also looked at the function malloc and how we will be using it. I normally mess up when using this function as I have only used it with pointers and pointers are not my strong suit. I have been reading up on pointers and watching videos to help explain it better but I am still having trouble. Since the ideas in this projected are linked to sln0 which I felt good about while doing it I feel like this project is going to easier to grasp then some of the other projects from C/C++. I was able to complete sln0 well before the deadline but I might be pushing the deadline for sln1 due to putting off starting which I need to stop and hope to start week 5s project on that Thursday after my sln1 is turned in.

Week Five

For the fifth week of class we focused mainly on the projects due that week and the one due the next week. On the 22nd we updated are sln1 project which included changes to the makefile to get rid of some bugs and improve the code. Applying the update was easy and took no time at all. Also we talked about using make clean after an update to make sure that the code we wrote still works and we were not getting false positives on the test programs. We also went over stuff about copying a node and having the copy’s after pointer to the same node so:

(2)→(4)tmp→(9)→NULL

tmp2=cpnode(tmp)

(4)tmp2→(9)

From there we can change the after to point to something else like the 2 so we can copy and insert a node from a list then back into the list. We also talked about NULL and how we should make sure to set things to NULL because we can check if something is set to NULL. Because it can be checked we can use it for troubleshooting and debugging purposes.

We got the next project sll0 which we could only get after we completed the code for the sln1 since the code in sll0 depends on our code we wrote for mk.c cp.c and rm.c. We also have the option to use the code we wrote or the already compiled code that Matt wrote for it.

The project sll0 is a little confusing to me with how everything works. I understand that “my list” contains all the nodes but putting the nodes into my list is where I am confused. I know that first points to the first node and last points to the one that points to a NULL so we have a start and a end point for the list with just quick reference. I get warnings when I try to make a node at first but the code still works. By works I mean it passes the test so I hope it is not a false positive.

On thursday I found out that other of the students had the a similar problem as I did. While they had a zero at the beginning of their list mine would drop the value from the last list and replace it with a zero. I was able to stop this from happening by removing my rmnode function call from the call. Matt said to someone else that their was caused by a memory leak but I do not know if mine was the same thing. I do not know why the rmnode function would cause a problem since it sets thing to NULL and not zero which are not the same thing.

Thursday was a work in class day so we did not go over anything new. We did go over some cases that we should check for in our code which are:

case 1: a NULL list ex:mylist=NULL;

case 2: empty list ex:mylist[first→NULL/last→NULL]

case 3: list of one ex: mylist[first→(1)/last=NULL]

case 4: list of more than 1 ex: mylist[first→(1)→(2)→(3)→NULL←last]

I did not get very much done during the class. I ended up helping a classmate make improvements to his sln1 so his node-display2.c would work better even though he already submitted sln1 the night before. It was good practice for reading code that is not mine and understanding what is going on and troubleshooting it. He was having a problem with a zero appearing at the start of his list. After playing around for a bit got it to stop giving us the 0 but instead gave us two of the first node. It turned just to be his order for his inputs and his assigning of the input to a node’s info was weird. He was assigning an input into a node before he got the input from the user. simple stuff that took a while. I still need practice troubleshooting and I am not very good with the debugger.

cprog

user/bboynton/portfolio.1443498216.txt.gz · Last modified: 2015/09/29 03:43 by bboynton