======Part 1====== =====Entries===== ====Entry 1: discrete/data August 29, 2012==== Durring this class session we began talking about pointers and memory. Such as the different ways memory can be stored, data types. some of the various data types are integers, characters, float, double, boolean and string etc. Pointers on the other hand are very different. Pointers hold the adress of allocated memory. Basically a sign on a highway telling where a city is. This is very significant because this is how data is stored in memory on the computer. Each data type has its own purpose and is very important when planning a program. Same with pointer although very different and having a different purpose very important when planning a program. I am a little shakey on the concept of pointers but after the lecture on the 31st i felt a little more confident and it seemed to make more sense. This might change... The biggest chalenge i am having with the course is the fact that i feel as if i learned absolutly nothing in my c/c++ class last semester. I got a good grade but do not feel i learned up to my grade and that is frustrating to me. ====Entry 2: Discrete September 4, 2012==== On this day we started talking about logic. Logic is a very important thig when it comes to computers and software. Logic is the backbone of software or programs without logic there would be no computer programs. We also went over the logic table. We created the table and named six binary and one unary opperation. Binary: AND, NAND, OR, NOR, XNOR, XOR Unary: NOT After creating the logic table the class begain name where those opperations where on the logic table. This confused me a little bit i didnt seem to get where and how you knew what opperations were which on the table. I definitally need to sort this out. I will be asking for help. ====Entry 3: Unix September, I cant remember, 2012==== Today we began going over the vi editor. This was very usefully because i was constantly dealing with scrutiny and judgment when using the infamous nano editor. Not only was a able to feel more accepted when using it but I was also able to become more efficient when typing code using the many key commands implemented in vi. Just a few of the commands that where taught were i, w , b, ^ and $. These are just a few of the commands but using them efficiently can greatly improve productivity. i is simple it simply allows you to enter [insert] mode. w is very usefully and allows you to advance a work or a certain number of words by entering 5w or 9w or 10w. b is very much the same except for going back a word or a number of words. ^ sends the cursor to the beginning of the line. $ sends the cursor to the end of the line. As i said these are only a few of the things described in the class but i thought they were some of the most useful. I found it very useful at least. There was really nothing in this lecture that i had a hard time understanding it will just take practice and use to remember all of the commands. I am having no challenges with respect to the course. ====Entry 4: Data September sometime, 2012==== During this lecture we began the concept of linked list and "nodes". This concept is very useful and inherently confusing. A linked list allow you to allocate a computers memory until it basically runs out. This is very useful when you want to store data but do not know necessarily how much data or how many values you will need to store. Hence the name Linked List, it is a list of data that is linked so it may be navigated. A linked list is similar but at the same time VERY different from an array and array is finite and once defined its space allocated cannot be "re allocated" and the array cannot be re sized. I have been dealing with a lot of understanding issues regarding linked lists but i am getting help and i begin to understand more and more every time i get help and expose myself to them. The only challenges i feel like i am facing for this course is my understanding due to lack of prior knowledge but that is quickly becoming less of a problem because of the high amount of exposure i am having to the material!!!! =====Keywords===== {{page>datapart1&nofooter}} {{page>discretepart1&nofooter}} {{page>unixpart1&nofooter}} =====Experiment 1===== ====Question==== what would happen if i modified the guessing game script to try to guess itself would it ever get it right? ====Resources==== From my UNIX class lecture on Septemeber 26th and 28th. AND http://stackoverflow.com/questions/5061227/why-doesnt-my-variable-seem-to-increment-in-my-bash-while-loop ====Hypothesis==== Since i set it up to have one value static and one continuing to be random i think it will be possible ====Experiment==== I will write and test a bash script in a controlled environment! ====Data==== Nope 15864 is not equal to 25740 guess a value: 22205 Nope 22205 is not equal to 25740 guess a value: 4461 Nope 4461 is not equal to 25740 guess a value: 12557 Nope 12557 is not equal to 25740 guess a value: 28518 Nope 28518 is not equal to 25740 guess a value: 17998 Nope 17998 is not equal to 25740 YAY!!!!! IT WORKED! 25740 was equal to 25740 It took 21678 guesses. evan@evan-Extensa-4630Z:~$ This was the final result after letting the script run for about 1 minute. The code i used : #!/bin/bash #script 3 # # value=`bc <<< "$RANDOM"` num=5 count=0; while [ $num -ne $value ] ; do echo -n "guess a value: " echo "$num" echo "Nope $num is not equal to $value" count=$((count+1)) num=`bc <<< "$RANDOM"` done echo "YAY!!!!! IT WORKED! $num was equal to $value" echo "It took $count guesses." exit 0 ====Analysis==== Based on the data collected: * Yes the hypothesis was correct. One shortcoming of this would be knowing the exact time it took I feel that would have been nice to have. ====Conclusions==== I was pretty confident that the experiment would work but i was a little unsure of how long it would take. I implemented the counter to get an idea but it would have been nice ti have a run time timer of some sort. maybe a future revision...