======Part 3======
=====Entries=====
====Entry 9: April 10, 2012====
In my UNIX class i learned how to better search through files and use the head(1) and sed(1) utility to take text out of the file i did not want.
sed 's/pattern/replacement/g' = pattern searching for and then replace pattern searching for with this replacement and g means globally.head -25 file.txt = -n for number of lines you want to print of the file you choose which could then be piped to sed a stream editor to remove unwanted text. a basic line may look like this
head -25 file.txt | sed -e 's/[a-z]*5/:/g'
print first 25 lines of file.txt and then search for text that start with a to z and end in 5 and once found replace that with colon globally in the file.
====Entry 10: April 13, 2012====
C++ class
A program can be split up into multiple files making it easier to edit and understand, especially in the case of large programs but also allows the individual parts to be compiled independently.
*when compiling a large program with multiple header file remember to add this line in the header file so you do not include the same header file twice in your program.
#ifndef _HEADERFILENAME_H
#define _HEADERFILENAME_H
#endif
====Entry 11: April 14, 2012====
g++ -o prog file1.o file2.o file3.o
compile c++ code into one executable named prog with the object files: file1 file2 file3.
then you can now run ./prog on the command line because it is now an executable file.
To produce only .o files from source files without doing any linking invoke -c option
===Entry 12: April 19,2012===
some html i did in unix class that diplayes an image of myself and some general info
RM Lab46 Homepage
Unix Homepage by Robert Matsch
Who am I :
My name is Robert matsch, I am currently a student at corning community college. Upon completion of my Computer Information Science degreein in may 2012 i am attending RIT for the fall of 2012. I am majoring in software engineering and planning to live in california once i graduate to work with my uncle and be part owner in a private consulting company.I enjoy listening to music, being active, riding my motorcycle and best of all spending time with friends and family.
Top 6 movies:
- Step Brothers
- Hangover 1 and 2
- Finding Nemo
- Bad Boys II
- Talladega Nights
- k-pax
who is I ?
RM Lab46 Homepage
Unix Homepage by Robert Matsch
Who am I :
My name is Robert matsch, I am currently a student at corning community college. Upon completion of my Computer Information Science degreein in may 2012 i am attending RIT for the fall of 2012. I am majoring in software engineering and planning to live in california once i graduate to work with my uncle and be part owner in a private consulting company.I enjoy listening to music, being active, riding my motorcycle and best of all spending time with friends and family.
Top 6 movies:
- Step Brothers
- Hangover 1 and 2
- Finding Nemo
- Bad Boys II
- Talladega Nights
- k-pax
who is I ?
====Entry 12: April Day, 2012====
This is a sample format for a dated entry. Please substitute the actual date for "Month Day, Year", and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
* What action or concept of significance, as related to the course, did you experience on this date?
* Why was this significant?
* What concepts are you dealing with that may not make perfect sense?
* What challenges are you facing with respect to the course?
Remember that 4 is just the minimum number of entries. Feel free to have more.
{{page>cprogpart3&nofooter}}
{{page>unixpart3&nofooter}}
=====Experiments=====
====Experiment 7====
===Question===
what will happen if you remove #ndef #define #endif from header files and re compile
===Resources===
Class notes
===Hypothesis===
I think the program will compile with out any problems.
===Experiment===
take a c++ program with multiple header files and remove the #ndef statements and see what happens.
===Data===
it compiled with out the statements.
===Analysis,Conclusion===
Based on the data collected:
* Was your hypothesis correct? yes my hypothesis was correct and i was able to compile.
* Was your hypothesis not applicable?yes
upon further investigation in small problems probably wont matter so much but with many header files and larger programs this could be a big plus to have.
====Experiment 8====
===Question===
can kids touch there parents private parts (C++ inheritance)
===Resources===
Mathew hass
===Hypothesis===
no kids to parent relationships cannot touch there parents private parts because then it would not be a private class if the kid had a friend and then third parties could touch the parents private parts which is not good for security.
===Experiment===
develop a program and set certain variables to private class and then try to access these variables via a kid of the parent.
===Analysis===
Based on the data collected:
* Was your hypothesis correct?yes
* Was your hypothesis not applicable?yes
* Is there more going on than you originally thought? yes(shortcomings in hypothesis)
* What shortcomings might there be in your experiment? taking into account friends
===Conclusions===
C++ is great for code management and for security purposes as data access..
====Retest 3====
===State Experiment===
josh Davis experiment "IF or not if"
http://lab46.corning-cc.edu/opus/spring2012/jdavis34/start#experiment_if_or_not_if
===Resources===
Evaluate their resources and commentary. Answer the following questions:
* Do you feel the given resources are adequate in providing sufficient background information?
* Are there additional resources you've found that you can add to the resources list?
* Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment?
* If you find a deviation in opinion, state why you think this might exist.
===Hypothesis===
What is the use of \n and to what effect does it have if in a simple program designed to print “hello world” if: 1. it exists.
2. it does not
I feel their hypothesis is adequate in capturing the essence of what they're trying to discover.
and there is no adjustments i would make.
===Experiment===
Follow the steps given to recreate the original experiment. Answer the following questions:
* Are the instructions correct in successfully achieving the results?
there is not to many directions to establish how to do it if i did not have any knowledge of C
I feel there room for improvement in the experiment instructions/description such as a small snip of code.
* Would you make any alterations to the structure of the experiment to yield better results?
no it is a simple experiment so there structure would do.
===Data===
#include
int main()
{
printf("hello, world\n");
printf("hello,\n world");
return(0);
}
lab46:~$ gcc -o hello hello.c
lab46:~$ ./hello
hello, world
hello,
world
===Analysis===
Answer the following:
* Does the data seem in-line with the published data from the original author?
Yes the data seems in-line with the author
* Can you explain any deviations?
There is no deviations.
* Is the stated hypothesis adequate?
Yes the stated hypothesis is adequate.
===Conclusions===
Answer the following:
* What conclusions can you make based on performing the experiment?
\n will make a new line
* Do you feel the experiment was adequate in obtaining a further understanding of a concept? yes
* Does the original author appear to have gotten some value out of performing the experiment?yes
Good job experiment was done well.