Dan McKinney's fall2012 Opus
My Name is Dan McKinney. I am in my last semester of my computer science degree. This will be my second degree from corning.
Today we cloned our own personal repository on lab46. A repository is great for creating programs because it gives you version control. Version control allows you to save a version of your file every time you make a change, and allows you to go back and see previous versions.
As an aid, feel free to use the following questions to help you generate content for your entries:
Today we cloned a copy of the “bignum” repository. The bignum repository has a bunch of files and utilities that we can use to help us with our own bignum project.
As an aid, feel free to use the following questions to help you generate content for your entries:
Today in discrete Matt showed us his “gimmeh” script that he wrote. It was very nifty, it allows us to enter some of our contact info, and also certian things about the class(s) that i am taking with Matt. The first thing is to tell him if the keywords that where assigned to you where discribed good enough to give a dipslay.
As an aid, feel free to use the following questions to help you generate content for your entries:
Today in class, Matt showed us a little bit about sets. We learned the notation that you use. We also learned about subsets. Matt had us start to write a program asking the user for some input and then putting then into a set and show the output in set form.
As an aid, feel free to use the following questions to help you generate content for your entries:
dynamic memory allocation (malloc/free)
dynamic memory allocation is the task of allocating a free chunk of memory specific to the size you predetermine in bytes, by using the malloc function. The chunk of memory is not always in the same location hence being “dynamic” instead of static. By using the “free” function, that will release the block of memory back to the system.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
passing by address (function parameter passing)
Passing by address is just one of the ways that you pass a variable into a function. This is done not by passing the variable itself, but by passing the variable address. The only uses for this type of variable passing that I have encountered are arrays.
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:
#include <stdio.h> void tripnum(int *x) { *x = (*x) * (*x) * (*x); } int main ( ) { int num = 10; tripnum(&num); printf(" Value of num is %d\n”, num); // Value of num is 1000 return (0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~/src$ gcc -otripnum tripnum.c lab46:~/src$ ./tripnum Value of num is 1000
left projection
Left Projection, in programming logic always returns the left-side value in a Truth table. So for values P and Q in a truth table, the left projection always reflects the value of P.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Left Complementation
Left Complement is similar to negation p. it is a logic operation that basically negates the p. For example if p was a 1 it would not matter what q was the result would be a 0. Likewise if p was a 0 regardless of q the result would be a 1.
Reference 1: http://en.wikipedia.org/wiki/Negation
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:
#include<stdio.h> #include<stdlib.h> char lproj(char, char); char p; char q; int main() { printf("P | Q | X | \n"); printf("----------- \n"); p = 0; q = 0; printf("%d | %d | %d\n",p,q,lproj(p,q)); p = 0; q = 1; printf("%d | %d | %d\n",p,q,lproj(p,q)); p = 1; q = 0; printf("%d | %d | %d\n",p,q,lproj(p,q)); p = 1; q = 1; printf("%d | %d | %d\n",p,q,lproj(p,q)); printf("enter either 1 or 0 for P\n"); printf(":"); scanf("%d", &p); printf("enter either 1 or 0 for Q\n"); printf(":"); scanf("%d", &q); printf("%d | %d | %d\n",p,q,lproj(p,q)); return(0); } char lproj(char p, char q) { char x; if(p==1) { x=0; } if(p==0) { x=1; } return(x); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~/src/discrete$ ./ttable P | Q | X | ----------- 0 | 0 | 1 0 | 1 | 1 1 | 0 | 0 1 | 1 | 0 enter either 1 or 0 for P :0 enter either 1 or 0 for Q :1 0 | 1 | 1
If you take the brackets off of an if statement will it still compile and run?
based on some wikipedia articles, there are many ways to write if statement and if else statements.
Based of what i know about c programming, and what i have read on wikipedia, i think that the program will still run with brackets on the if statement. I also think when you try to compile the program it will yell at you and give some warnings.
State your rationale.
I am going to write a program with some sort of if statement in it and try to compile and run the program with the brackets on and then with them off.
The data that i have collected from doing this experiment confirms that the program will compile and run with the brackets taken off of the if statement and also with the brackets on the if statement.
Based on the data collected:
My conclusion is that functions can be written different ways. At first i did not think that an if statement would run without brackets, but then after some research on wikipedia, i thought a program will probably run, i just didnt think it would compile cleanly. After preforming the experiment i found that not only will the program run with or with out brackets but the compiler runs fine and does not give any warnings or errors.
Today in data structures, we talked about stacks. Stacks are pretty much like a linked list ecxept you can not insert or delete “nodes” from where ever you want. When you add an object it gets put at the top of the stack. And when you delete an object it takes it off of the top of the stack.
As an aid, feel free to use the following questions to help you generate content for your entries:
Today in discrete stuctures we went back to talking about functions. We talked about the function signature. The function signature is basically the type, return value,function name, and parameter list. The main point of the lecture was that when you declare your parameters as somthing, what ever you pass into them need to be the same type.
As an aid, feel free to use the following questions to help you generate content for your entries:
Today in discrete we talked some more about recusion. We worked more on our inclass recursion program. Recursion is a good concept to learn because it can make your program be more efficient.
Today in Data we talked about a binary tree. To navigate from left to right in a binary tree you “traverse”. You can not loop in a tree, if you do it is no longer a tree but a graph. Trees are like linked list but automatically sort.
stack pop operation
Stack is a data structure that is used to keep things in order. A stack allows adding and removing items in order. When something is added to the stack it goes to the top of the stack, and the first item added to the stack is the last item to be removed.Pop is the operation used to remove an item from a stack.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
stack underflow condition
When a command in a program tries to pop an element from an empty stack causing it to error out.
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:
Stack A=NULL
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ ./stack 1. to pop : 1 error stack underflow! lab46:~$
subset
A subset is a set which every element in the set is contained in a larger or equal size set. In other words a set with in a set.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
union
Union is the combination of the elements of two sets, without any duplicates.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Demonstration of the indicated keyword.
A={1,3,5,7,9,} B={1,2,4,6,8} A U B={1,2,3,4,5,6,7,8,9}
Can you load windows 7 onto a macbook pro?
*http://www.digitaltrends.com/computing/how-to-install-windows-7-on-an-imac/
*http://www.zdnet.com/news/windows-7-works-great-on-the-macbook-pro/337007
Based on what i have read, i think that it is very possible and easy to install windows7 onto a macbook.
All of the articles are saying to upgrade your version of bootcamp and then just follow the on screen instructions in book camp to install windows.
I am going to test this experiment by using my macbook pro, and attempting to load my copy of windows7 onto it. I still want the ability to use mac as well, so i am going to attempt to duel boot this bitch.
I preformed the experiment.
It took around an hour to complete.
I partitioned the HDD in half and used one half for windows7 and one half for mac osx.
Boot camp then asked me to put the mac os cd in to load the drivers into windows(so that i can use the hardware).
It seems to be working fine, i can choose to boot into windows or mac, when i start up the computer.
Based on the data collected:
You can most definitely load windows7 onto a macbook. It is a great idea if you like the features and security that mac provides, but also need access to the business side of computing(Microsoft office, and other common programs)
If you do not care about mac and only want to use windows i would not suggest putting windows on a macbook for a couple reasons:
1. macbooks are a lot more expensive for the hardware that you get.
2. windows7 is not as stable when loaded on a macbook with boot camp.
Today in Discrete we got all of our implemented sort programs check off. Most of the class did not have it completed, but we needed to move on. We also filled out the instructor evaluation papers for Matt.
Today in Data we took a pop knowlege quiz. We also talked more about libraries, and also learned about archives.
Today in discrete, we were introduced to some of our end of course experience. Matt went over the content of the questians and then talked a little bit about the GD librairy. We also talked about what the rest of the semester was going to consist of, as far as new material and projects.
Today in Data we were introduced to our end of course experience. We talked about libraries, and binary trees as well. The rest of the classes will be working on the remaining binary tree project and EOCE.
Recursion
Recursion is one technique for representing data that's size is not always known by the programmer. The implementation of recursion would be a function calling it's self in the function, there fore creating an infinite number of computations.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Identification of chosen keyword.
Definition (in your own words) of the chosen keyword.
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$
combination
A combination is a set containing a certain number of objects that have been selected from another set. In combinations, the order of the elements does not matter.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
regular expression
Regular expressions are commands that match a pattern or characters in a string of characters or words. Some of the regular expression commands are the ^ that matches the beginning of a line, the $ matches the end of line, the \< matches the beginning of the line, \> matches the end of the word, . matches any single character, * 0 is 0 or more of the previous character or whatever you put in front of the *, [] matches any of the characters enclosed, [^ ] does not match any of the characters enclosed. Then there is also extended regular characters or egrep. Those are () which is like \( \), | which means or and + which matches 1 or more of the previous character. Usually you have to use a combinations of these to get what you want.
Demonstration of regular expression.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
#include <stdio.h> #include <regex.h> int main(void) { regex_t reg; const char *regex="[abc]"; const char *str="sadf"; regmatch_t matches[16]; regcomp(®, regex, REG_EXTENDED); if(regexec(®, str, 16, matches, 0) == 0) { printf("regex /%s/ matched string '%s' at bytes %d-%d\n", regex, str, matches[0].rm_so, matches[0].rm_eo); } else printf("regex /%s/ does not match string '%s'\n", regex, str); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ nano test.c lab46:~$ gcc -otest test.c lab46:~$ ./test regex /[abc]/ matched string 'sadf' at bytes 1-2 lab46:~$
is a cpu water cooling system significantly better then a typical fan and heat sink system?
http://www.tomshardware.com/forum/317915-28-water-cooling-cooling http://www.overclock.net/t/1260241/high-end-air-cooling-vs-closed-loop-water-cooling/130 http://en.wikipedia.org/wiki/Computer_cooling http://www.bit-tech.net/blog/2011/07/13/is-there-still-a-need-for-water-cooling/
based on what i have read, and learned in school, i think that a water cooling system will deffinitly cool the cpu and the over all system by a noticable amount. I am not sure how ever that it will make much of a difference when not putting a large load on the system (i.e. overclocking or gaming).
Since i over clock my cpu to the max and game often i have done plenty of researce and have decided to purchase a corseair h100 water cooler. I will run a controll test before i install the water cooler and get a temp reading on the cpu. I will then install the water cooler, and run the same test and take another reading.
While the cpu was over clocked over 4 GHz and wile playing a graphic intensive game(starcraft 2 ), the cpu was running very hot some times over 65 C. while under the same senorio with the water cooling the cpu ran around 45 c.
Based on the data collected:
My feelings are, that if you plan to over clock your cpu and or you do alot of gaming, i would make the investment and buy a water cooler. On the other hand, if you dont do either of those two things then your computer should be perfectly find with the stock cooling.