Michael Owens' fall 2012 Opus
3 Different Classes and more.
I dislike introductions, so enjoy this simple thing; I am who I am, enjoy lol.
Got told today that my wonderful idea from last semester's C/C++ is no longer a wonderful idea due to the fact that I know more about C…
Well, that was definetly fine, but now I have to come up with another good idea, first idea was to use our project big num, but I can't think of some way to put those numbers into the array for it yet. But that is a possible way to do it. I will have to keep thinking about this.
Displaying numbers as hex, why did I not think of this…
Ohh, that is why, I dislike displaying numbers outside of decimal numbers (aka base 10). Guess I am going to have to attempt to learn to read hexidecimal now gah…
Still not 100% sure how I am going to mess around with the hex to decimal bignum thingy… I am confused on how to get the hexidecimal into variables. But I have decided how to turn the hexidecimal into decimal.
Realized I forgot to do the function part of our work that we needed for discrete today. I guess that is what I get for not paying attention
address of
Address Of: is the hexadecimal location of a variable in memory or storage.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
The C Programming Language 2nd Edition By Briand W. Kernighan and Dennis M. Ritchie
pointer arithmetic (esp. in relation to arrays)
Pointer arithmetic is basically when you use math on pointers to accomplish a task. Generally this task is looped, where the math is incrementing or decrementing… and generally this is used for 'pointer arrays' (as opposed to 'bracket arrays').
When you want to make an array, and fill it with 20 zero's. You will create a pointer. You will then create a loop that will fill in a zero to the array, where the pointer is having a counter of some form (usually) being added to it. That part where the pointer is having stuff added to it, that's pointer arithmetic.
Pointer arithmetic is arguably faster, but it really does depend on surrounding code and the CPU and the compiler etc.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
<code c> /* * Sample code block */ #include <stdio.h> #include <stdlib.h>
int main() {
char array[20]; char i = 0; while(i > 20) { array[i] = i; i = i + 1; }
}
contradiction/falsehood
Contradiction/Falsehood: Setting every bit to 0; Outputting logically false to all possible logical inputs.
nonimplication/difference/but not
Nonimplicion/difference/but not means that the only true output is if p is true and q is false. Everything else is false. So if p is 0 and q is 1 the output should be 0.
Demonstration of the indicated keyword.
lab46:~$ P = 0 Q = 0 Output = 0 lab46:~$ P = 0 Q = 1 Output = 0 lab46:~$ P = 1 Q = 0 Output = 1 lab46:~$ P = 1 Q = 1 Output = 0 lab46:~$
Data Streams (STDIN, STDOUT, STDERR)
Data Streams:
The location information is sent to form your computer.
Paths: Absolute and Relative
Paths specify the unique location of a file or directory by showing the root and the hierarchy of directories in which the file resides. For example, in the Lab46 file system, the path to get to the games directory is from the Lab46 root, to the user directory, followed by the games directory. This path would be written as “lab46:/usr/games”.
Paths may be absolute or relative. An absolute path is a path that points to the same file location in a file system regardless of the current, or working, directory (where the user currently is). A relative path is a path that points to the file location but is dependent on the working directory.
Examples:
/a/b/c/d is an absolute path, as it specifies the full location for the directory/file “d”.
Using the above example, if the user is currently in the /c directory, he/she could use /d as a relative path to get to d. However, if the user is currently in the /a or /b directories, typing /d will not direct him/her to d.
Demonstration of the indicated keyword.
lab46:~$ /src/hello (absolute path) lab46:~$ cd /src lab46:~/src$ ./hello (relative path)
In unix's ViM, does :1m$ do the same thing as :0m$?
Basic knowledge with the unix system and ViM is very helpful in helping you understand how this will work.
I hypothesis that it will move the 1st line and do the same thing. Line 0 can be the same as line 1.
I am going to make a vim text file and just use the commands.
Create a file, put in a bunch of none repeating jibberish and run the first command, and then recreate the same jibberish, and run the second command, and then compare.
This is the vi file I used for my start point
There is going to be stuff we are doing. where we need a good chunk of space per line. So here I am typing a bunch of jibberish lines of text. and i don't know what we are doing yet so. I will keep typing until matt says we can stop. Okay I think a 7th line is way more than enough lines. http://www.google.com/ ohh my, ohh my gosh. hi.
Next we will run the :0m$ command
where we need a good chunk of space per line. So here I am typing a bunch of jibberish lines of text. and i don't know what we are doing yet so. I will keep typing until matt says we can stop. Okay I think a 7th line is way more than enough lines. http://www.google.com/ ohh my, ohh my gosh. hi. there is going to be stuff we are doing.
This is my results after running the command :om$ It appears it moved the first line to the last line of the file.
Next lets run the :1m$ command
where we need a good chunk of space per line. So here I am typing a bunch of jibberish lines of text. and i don't know what we are doing yet so. I will keep typing until matt says we can stop. Okay I think a 7th line is way more than enough lines. http://www.google.com/ ohh my, ohh my gosh. hi. there is going to be stuff we are doing.
The experiment has shown that the two commands act the same. Perform your experiment, and collect/document the results here.
Based on the data collected: My hypothesis is correct and the commands worked as expected.
I have concluded that ViM does not use programming based counting for its lines (starting at 0).
Definetly couldn't figure out this sort program due today. I even have issues sleeping because of it, I tell you.
I got rid of my unwanted global variable and feel very happy that it worked just like I had hoped. I still need to find an experiment though.
I am still stressing over the sort programs, even after talking with matt about it. I still don't get how to get them in their right positions…
Today we have a gaint storm coming through and i need to work out the kinks in my program, hope we dont lose power
queue enqueuing operation
Enqueuing is the operation of putting something at the end of a queue There for adding something to the queue
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Queue Dequeuing Operation
Removes and returns the object at the beginning of the Queue (Represents a first-in, first-out collection of objects). Often referred to as a head-tail linked list.
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> List deque(List list1) { //List is a stuct that contains the ending node's and starting node's address printf("%hhd", (list1 -> end)); (list1 -> end) = (list1 -> end) -> next //could also be previous instead of end, depends on the coder's choice //You could also use start instead of end in this situation, both logically would, just reads different return(list1); }
set difference
Set Difference is the resulting set from two different sets. The resulting set contains only values that were in the first set (aka set a) that are not in the second set (aka set b).
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
singleton set
A set containing only a single item in its set. (Editted by myself)
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
dot files
A dot file is a file that is not normally visible using a basic ls command. These files tend to be configuration files for other programs, but not always.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
pipes
In Unix, a pipe (or pipeline) is used to direct the flow of output from one command as input to another command. This can be used to connect two operations together on a single command line, instead of having to use multiple command line inputs to receive the same result.
In Unix systems, pipes are shown using a vertical bar symbol, |. This bar will take the output from the command on the left, and use it as the input for the command on the right.
An example of this would be:
who | grep $USER
This would execute the who command, and then use it as input to the grep command, which would parse who for all instances of your own username.
lab46:~$ who | grep $USER mowens3 + pts/22 2012-10-25 14:00 . 4935 (grrasp.offbyone.lan lab46:~$
What is the question you'd like to pose for experimentation? State it here.
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.
Finished the MOST AWESOMEST puzzlebox EVER!!!
Finally our set program was due, I still have no real idea how I was supose to do mine still.
Taking a more indepth look into how this binary tree program is going to be. Look like I will use a couple of different things. I am going to have to write stuff down on paper by the looks of it, nothing unusual though.
Couple of days left to do my keywords and my experiment.
This is going to be interesting. Also went over all of our end of course experiences, looks pretty fun. I am excited for this semester to be almost over. 1 more semester and hopefully I will be trnasfering to RIT!
Recursive tree transversal
A form of going through a Tree via recursion. Recusion is calling the function while still inside the function before finishing the original function.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Postfix (reverse polish)
A mathematical notation wherein every operator follows all of its operands. For instance “3 + 4” would be written as “3 4 +”. If there are multiple operators the operator is given immediately after its second operand; so the expression written “3 − 4 + 5” in conventional infix notation would be written “3 4 − 5 +”
A simple demonstration of this would be 5 5 + 10 - which would equal 0
The conventional infix notation is 5+5-10.
Matrix Multiplication
The multiplication of two or more matrices to produce a new matrix.
http://en.wikipedia.org/wiki/Matrix_multiplication#Powers_of_matrices
finite state machine.
It is conceived as an abstract machine that can be in one of a finite number of states. The machine is in only one state at a time; the state it is in at any given time is called the current state. It can change from one state to another when initiated by a triggering event or condition, this is called a transition.
Draw some circles and connect the dots, upload them to this.
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
bvi/hexedit
bvi: BVI is a binary visual editor, it allows you to visually see binary values and edit them.
Hexedit: Hexedit is a similar program that show's you the same values in hexidecimal instead of binary.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
head
head is a command used to display the first few lines of a text file or piped data
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
en.wikipedia.org/wiki/Head_(Unix)
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~/src/unix$ head wildcard.notes Their are a set of wild cards for your command line * means 0 or more of any character (a true wild card); so *.o would be any file that ends with .o ? - 1 of any character (a single wild card); so ??? would be any file with 3 letters (so ls ??? would show any 3 letter files) [] - 1 of any of the enclosed, so any of the letters entered in the brackets so [rstlne] means it must have one of them to show, so ls [rstlne]* would only show lab46:~/src/unix$
what is up with the “+” and the “-” from jobs
What Matt said in class and my minor playing around with it before starting the hypothesis
I believe the + sign desonates the last paused job that will be resumed first in a stack style. While the - sign desonates the 2nd last paused job that will become the + sign after resuming the previous + signed job.
I am going to run and pause several jobs, and then print out jobs, and take note of where the + and - sign are. Then resume a job, and close it. Rerun jobs, and take note of where the + and - sign are again. Contine that a couple of times taking note of where the + and the - signs god, and that should give us enough data to confirm what is what.
lab46:~$ jobs lab46:~$ cat ^C lab46:~$ cat ^Z [1]+ Stopped cat lab46:~$ vi [2]+ Stopped vi lab46:~$ nano Use "fg" to return to nano. [3]+ Stopped nano lab46:~$ emac -bash: emac: command not found lab46:~$ emacs [4]+ Stopped emacs lab46:~$ jobs [1] Stopped cat [2] Stopped vi [3]- Stopped nano [4]+ Stopped emacs lab46:~$ man jobs
after resuming and closing EMACS
lab46:~$ fg 4 emacs lab46:~$ jobs [1] Stopped cat [2]- Stopped vi [3]+ Stopped nano lab46:~$
we noticed how our - on nano became a + and the vi program got -, so next we will open and close Vi, which should move the - from vi to cat.
vi lab46:~$ jobs [1]- Stopped cat [3]+ Stopped nano lab46:~$
Did exactly as expected. now lets open up a couple more programs and see what happens.
lab46:~$ vi [4]+ Stopped vi lab46:~$ jobs [1] Stopped cat [3]- Stopped nano [4]+ Stopped vi lab46:~$ man What manual page do you want? lab46:~$ man printf [5]+ Stopped man printf lab46:~$ jobs [1] Stopped cat [3] Stopped nano [4]- Stopped vi [5]+ Stopped man printf lab46:~$
so now lets use basic fg, which is what this entire experiment is about.
lab46:~$ fg man printf lab46:~$ jobs [1] Stopped cat [3]- Stopped nano [4]+ Stopped vi lab46:~$
it opened our man page.
So all of this data has confirmed to me my hypothosis was correct.
Based on the data collected: My hypothesis was correct, even after running the progams several times to make sure.
Jobs and fg and bg work all together and they work on a stacak based idea. Last object in is the first object out. What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.