======Part 2======
=====Entries=====
====Entry 1: October 10, 2012 DATA====
What action or concept of significance, as related to the course, did you experience on this date?
>> Learned about stacks and the importance of using such concept. A stack is an area of memory that holds all local variables and parameters used by any function, and remembers the order in which functions are called so that function returns occur correctly.
Why was this significant?
>> The significance of this is that I now know about how to use stacks, somewhat, but I still have some troubles with implementation.
What concepts are you dealing with that may not make perfect sense?
>> The implementation, via code, of writing a working stack program.
What challenges are you facing with respect to the course?
>> How to use stacks whenever needed in a situation.
====Entry 2: October 11, 2012 DISCRETE====
* What action or concept of significance, as related to the course, did you experience on this date?
>> Learned about functions on this date. A function is art of source code within a larger computer program that performs a specific task and is relatively independent of the remaining code.
* Why was this significant?
>> This is significant because I now know how to implement the use of functions, making my code much cleaner looking.
* What concepts are you dealing with that may not make perfect sense?
>> The limitations that are held when using a function call.
* What challenges are you facing with respect to the course?
>> Passing by reference within a function.
====Entry 3: October 18, 2012 DATA====
What action or concept of significance, as related to the course, did you experience on this date?
>> On this day we learned about recursion. Recursion is a method where the solution to a problem depends on solutions to smaller instances of the same problem.
Why was this significant?
>> The significance of this is that it is another way of solving a problem and thinking about a program.
What concepts are you dealing with that may not make perfect sense?
>> The formatting a using a successful recursion sorting program.
What challenges are you facing with respect to the course?
>> Using recursion in certain situations over other ways of solving a problem.
#include
int itfact(int, int); // int factorial
int rfact(int, int); // recursion factorial
int main()
{
int (*fact)(int, int);
int product = 1;
int n = 4;
fact = &rfact;
// product = itfact(product, n); //INTEGER
// fprintf(stdout, "%d! = %d\n", n, product);
product = fact(product, n); //RECURSION
fprintf(stdout, "%d! = %d\n", n, product);
return (0);
}
int itfact(int p, int n) // Function Call
{
int i;
for (i = n; i > 1; i--)
p = p * i;
return (p);
}
int rfact(int p, int n) // Function Call
{
if (n > 1)
{
p = p * n;
p = rfact(p, (n - 1));
}
return (p);
}
====Entry 4: October 31, 2012 DATA====
What action or concept of significance, as related to the course, did you experience on this date?
>> Learned about binary trees on this day. a tree data structure in which each node has at most two child nodes, usually distinguished as "left" and "right".
Why was this significant?
>> Binary trees can be used to classify and organize information. Easy way to sort information.
What concepts are you dealing with that may not make perfect sense?
>> How to implement a program using the idea of a binary tree.
What challenges are you facing with respect to the course?
>> Writing a program using the idea of recursion.
=====Keywords=====
{{page>datapart2&nofooter}}
{{page>discretepart2&nofooter}}
=====Experiment 2=====
====Question====
Is it possible to set person options for your own terminal?
====Resources====
- http://www.computerhope.com/unix/ustty.htm
- Pgs 151-153, Chapter 7 - Using the Keyboard with Unix. Harley Hahn's Guide to Unix and Linux.
====Hypothesis====
What I hope will happen is that if there is such a way to edit person option within my terminal then I will be able to create personal changes to commands.
====Experiment====
I will be testing my hypothesis by running the **stty** command in order to change some options within my terminal. The structure of my experiment is a command and hope it works.
====Data====
stty [-a] [-g] [modes]
-a: Write to standard output all of the option set tings for the terminal.
-g: Report current settings in a form that can be used as an argument to another stty command. Emits termios-type output if the underlying driver sup ports it; otherwise, it emits termio-type output.
lab46:~$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixo
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
*** Now for the change *** LOOK AT ERASE FUNCTION
lab46:~$ stty erase \^h
lab46:~$ stty -a
speed 38400 baud; rows 45; columns 76; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ;
eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
-ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
====Analysis====
Was your hypothesis correct?
>> My hypothesis was correct.
Was your hypothesis not applicable?
>> My hypothesis was applicable.
Is there more going on than you originally thought? (shortcomings in hypothesis)
>> No shortcomings in hypothesis, or more going on than I originally thought. Ran, and completed as I thought it would happen.
What shortcomings might there be in your experiment?
>> Only changed one instance in my options. Didn't want to mess up a whole lot and regret it.
What shortcomings might there be in your data?
>> Not enough changes happen for sufficient data.
====Conclusions====
>> This command can be very useful if you do not like the standard settings being used. You can change them to whatever feels more comfortable to you.