======Part 3======
=====Entries=====
====November 3, 2011====
I added and committed queue data structure library project files after completing the project.\\
lab46:~/src/data$ svn add queue
A queue
A queue/createFixedQueue.c
A queue/deQueue.c
A queue/copyQueue.c
A queue/destroyFixedQueue.c
A queue/isEmpty.c
A queue/enQueue.c
A queue/listQueueSize.c
A queue/makeQueue.bat
A queue/queue.h
A queue/queueTest.c
A queue/makeQueue.old
A queue/makeQueue.sh
A (bin) queue/queueTest
lab46:~/src/data$ svn commit -m "Added and committed queue files -John T. Rine"
Sending data/Stack/libdll.a
Adding data/queue
Adding data/queue/copyQueue.c
Adding data/queue/createFixedQueue.c
Adding data/queue/deQueue.c
Adding data/queue/destroyFixedQueue.c
Adding data/queue/enQueue.c
Adding data/queue/isEmpty.c
Adding data/queue/listQueueSize.c
Adding data/queue/makeQueue.bat
Adding data/queue/makeQueue.old
Adding data/queue/makeQueue.sh
Adding data/queue/queue.h
Adding (bin) data/queue/queueTest
Adding data/queue/queueTest.c
Transmitting file data ..............
Committed revision 24.
lab46:~/src/data$
====November 4, 2011====
I cleaned up (finalized) my queue library and then committed it to the Subversion repository.\\
lab46:~/src/data/queue$ svn commit -m "Cleaned up queue library -John T. Rine"
Sending queue/deQueue.c
Sending queue/queueTest
Sending queue/queueTest.c
Transmitting file data ...
Committed revision 25.
lab46:~/src/data/queue$
====November 11, 2011====
I worked on data and system programming topics.
====November 13, 2011====
I worked on data and system programming topics.
====November 14, 2011====
Once again, I worked on data and system programming topics. In particular, I wrote selection and bubble sorting code for data topics. I then added and committed the code to the Subversion repository:\\
lab46:~/src/data$ svn add selection*
A selection.bat
A selection.c
lab46:~/src/data$ svn add bubble*
A bubble.bat
A bubble.c
lab46:~/src/data$ svn commit -m "Added and committed selection and bubble sort example code -John T. Rine"
Adding data/bubble.bat
Adding data/bubble.c
Adding data/selection.bat
Adding data/selection.c
Transmitting file data ....
Committed revision 26.
====November 15, 2011====
I worked on data and system programming topics. In particular, I wrote insertion sorting code for data topics. I then added and committed the code to the Subversion repository:
lab46:~/src/data$ svn add insertion*
A insertion.bat
A insertion.c
lab46:~/src/data$ svn commit -m "Added and committed insertion sort files -John T. Rine"
Adding data/insertion.bat
Adding data/insertion.c
Transmitting file data ..
Committed revision 27.
lab46:~/src/data$
Next, I updated the insertion.c file and then re-committed it.
lab46:~/src/data$ svn commit -m "Updated insertion sort file -John T. Rine" Sending data/insertion.c
Transmitting file data .
Committed revision 28.
lab46:~/src/data$
====November 25, 2011====
For one of my data topics, I wrote, compiled, and executed a file demonstrating the binary search algorithm.\\
lab46:~/src/data/binarySearch$ gcc binarySearch.c -o binarySearch
lab46:~/src/data/binarySearch$ ./binarySearch ABCDEFGHIJKLMNOPQRSTUVWXYZ U 0 25
Now performing a binary search for element U, between elements 0 and 25
left = 0, right = 25, middle = 0, element = -1, value = U
left = 13, right = 25, middle = 12, element = -1, value = U
left = 20, right = 25, middle = 19, element = -1, value = U
left = 20, right = 21, middle = 22, element = -1, value = U
The element containing the value is 20 (-1 indicates element not found)
lab46:~/src/data/binarySearch$ cd ..
lab46:~/src/data$ svn add binarySearch
A binarySearch
A binarySearch/binarySearch.c
A (bin) binarySearch/binarySearch.exe
A binarySearch/binarySearch.bat
A (bin) binarySearch/binarySearch
lab46:~/src/data$ svn commit -m "Added and committed binary search files -John T. Rine"
Adding data/binarySearch
Adding (bin) data/binarySearch/binarySearch
Adding data/binarySearch/binarySearch.bat
Adding data/binarySearch/binarySearch.c
Adding (bin) data/binarySearch/binarySearch.exe
Transmitting file data ....
Committed revision 29.
lab46:~/src/data$
I added and committed sorting source files to the Subversion repository.
lab46:~/src/data$ svn add sorting
A sorting
A sorting/bubble.bat
A sorting/bubble.c
A (bin) sorting/bubble.exe
A sorting/insertion.bat
A sorting/insertion.c
A (bin) sorting/insertion.exe
A sorting/selection.bat
A sorting/selection.c
A (bin) sorting/selection.exe
A sorting/quick.bat
A sorting/quick.c
lab46:~/src/data$ svn commit -m "Added and committed sorting source files -John T. Rine"
Adding data/sorting
Adding data/sorting/bubble.bat
Adding data/sorting/bubble.c
Adding (bin) data/sorting/bubble.exe
Adding data/sorting/insertion.bat
Adding data/sorting/insertion.c
Adding (bin) data/sorting/insertion.exe
Adding data/sorting/quick.bat
Adding data/sorting/quick.c
Adding data/sorting/selection.bat
Adding data/sorting/selection.c
Adding (bin) data/sorting/selection.exe
Transmitting file data ...........
lab46:~/src/data$ svn commit "Added and committed sorting source files -John T. Rine"
====November 27, 2011====
I researched and documented the following system programming topics: file system structure, directories, links, re-entrant code, and interval timers.
=====Data Topics=====
====Version Control====
Version control software manages changes to documents, programs, and other information stored as files on a computer. It is most commonly used among software development teams, where more than one person may modify the same files. Changes are usually identified by a designator known as the "revision number", "revision level", or simply "revision".
==References==
- http://en.wikipedia.org/wiki/Revision_control
- http://betterexplained.com/articles/a-visual-guide-to-version-control/
- http://svnbook.red-bean.com/
- http://www.jaredrichardson.net/articles/svn-cheat-sheet.html
- http://aymanh.com/subversion-a-quick-tutorial
====Selection Sort====
The selection sort is conceptually the most simple of all the sorting algorithms. It works by selecting the smallest (or largest, if you want to sort from big to small) element of the array and placing it at the head of the array. Then the process is repeated for the remainder of the array; the next largest element is selected and put into the next slot, and so on down the line.
Since a selection sort looks at progressively smaller part of an array each time through the loop, a selection sort is a little faster than bubble sort.
//selection.c
//John T. Rine
//November 14, 2011
#include
#include
int cntChars(char *);
int main(int argc, char **argv)
{
int x, y;
int n;
if(argc != 2)
{
printf("usage: selection string_to_sort\n");
exit(1);
}
n = cntChars(*(argv + 1));
//for (x = 0; x < n; x++) printf("%c", *(*(argv + 1) + x));
//printf("\n");
char *charPTR;
charPTR = malloc(sizeof(char) * (n + 1));
for (x = 0; x <= n; x++) *(charPTR + x) = *(*(argv + 1) + x);
printf("Before sorting: ");
printf("%s\n", charPTR);
for(x = 0; x < n; x++)
{
int min = x;
for(y = x; y < n; y++) if(*(charPTR + min) > *(charPTR + y)) min = y;
/*Swap*/
char temp = *(charPTR + x);
*(charPTR + x) = *(charPTR + min);
*(charPTR + min) = temp;
}
/*print after sorting*/
printf("After sorting: ");
for(x = 0; x < n; x++) printf("%c", *(charPTR + x));
printf("\n");
free(charPTR);
return 0;
}
int cntChars(char *inputString)
{
// returned value "count" does not include '\0'
int count = 0;
while(*(inputString + count) != '\0') ++count;
return(count);
}
\\
rem selection.bat
rem John T. Rine
rem November 14, 2011
gcc selection.c -o selection
pause
selection "badcfeghijklnmoprqsutvwxzy"
pause
\\
C:\Users\John\Desktop\New Folder>gcc selection.c -o selection
C:\Users\John\Desktop\New Folder>pause
Press any key to continue . . .
C:\Users\John\Desktop\New Folder>selection "badcfeghijklnmoprqsutvwxzy"
Before sorting: badcfeghijklnmoprqsutvwxzy
After sorting: abcdefghijklmnopqrstuvwxyz
C:\Users\John\Desktop\New Folder>pause
Press any key to continue . . .
==References==
- http://www.cprogramming.com/tutorial/computersciencetheory/sorting2.html
- http://en.wikipedia.org/wiki/Selection_sort
====Bubble Sort====
The simplest sorting algorithm of all is the bubble sort. The bubble sort works by comparing each pair of array elements and swapping their positions, if necessary, to order them by value. This process is repeated as many times as necessary, until the array is sorted. Since the worst case scenario is that the array is in reverse order, and that the first element in sorted array is the last element in the starting array, the most swaps that will be necessary are equal to the length of the array.
//bubble.c
//John T. Rine
//November 14, 2011
#include
#include
int cntChars(char *);
int main(int argc, char **argv)
{
int x, y, n;
char temp;
if(argc != 2)
{
printf("usage: bubble string_to_sort\n");
exit(1);
}
n = cntChars(*(argv + 1));
char *charPTR;
charPTR = malloc(sizeof(char) * (n + 1));
for (x = 0; x <= n; x++) *(charPTR + x) = *(*(argv + 1) + x);
printf("Before sorting: ");
printf("%s\n", charPTR);
for(x = 0; x < n; x++)
{
for(y = 0; y < n - 1; y++)
{
if(*(charPTR + y) > *(charPTR + y + 1))
{
/*sort*/
temp = *(charPTR + y + 1);
*(charPTR + y + 1) = *(charPTR + y);
*(charPTR + y) = temp;
}
}
}
/*print after sorting*/
printf("After sorting: ");
for(x = 0; x < n; x++) printf("%c", *(charPTR + x));
printf("\n");
free(charPTR);
return 0;
}
int cntChars(char *inputString)
{
// returned value "count" does not include '\0'
int count = 0;
while(*(inputString + count) != '\0') ++count;
return(count);
}
\\
rem bubble.bat
rem John T. Rine
rem November 14, 2011
gcc bubble.c -o bubble
pause
bubble "badcfeghijklnmoprqsutvwxzy"
pause
\\
C:\Users\John\Desktop\New Folder>gcc bubble.c -o bubble
C:\Users\John\Desktop\New Folder>pause
Press any key to continue . . .
C:\Users\John\Desktop\New Folder>bubble "badcfeghijklnmoprqsutvwxzy"
Before sorting: badcfeghijklnmoprqsutvwxzy
After sorting: abcdefghijklmnopqrstuvwxyz
C:\Users\John\Desktop\New Folder>pause
Press any key to continue . . .
==References==
- http://en.wikipedia.org/wiki/Bubble_sort
- http://www.cprogramming.com/tutorial/computersciencetheory/sorting1.html
====Insertion Sort====
An insertion sort is performed by repeatedly taking the next item to be sorted and inserting it into the array in its proper order with respect to items already inserted
//insertion.c
//John T. Rine
//November 15, 2011
#include
#include
int cntChars(char *);
int main(int argc, char **argv)
{
int x, y, n;
char temp;
if(argc != 2)
{
printf("usage: insertion string_to_sort\n");
exit(1);
}
n = cntChars(*(argv + 1));
char *charPTR;
charPTR = malloc(sizeof(char) * (n + 1));
for (x = 0; x <= n; x++) *(charPTR + x) = *(*(argv + 1) + x);
printf("Before sorting: ");
printf("%s\n", charPTR);
for (x = 1; x < n; x++)
{
y = x;
while (y > 0 && *(charPTR + y - 1) > *(charPTR + y))
{
temp = *(charPTR + y);
*(charPTR + y) = *(charPTR + y - 1);
*(charPTR + y - 1) = temp;
y--;
}
}
/*print after sorting*/
printf("After sorting: ");
for(x = 0; x < n; x++) printf("%c", *(charPTR + x));
printf("\n");
free(charPTR);
return 0;
}
int cntChars(char *inputString)
{
// returned value "count" does not include '\0'
int count = 0;
while(*(inputString + count) != '\0') ++count;
return(count);
}
\\
rem insertion.bat
rem John T. Rine
rem November 15, 2011
gcc insertion.c -o insertion
pause
insertion "badcfeghijklnmoprqsutvwxzy"
pause
\\
C:\Users\John\Desktop\New Folder>rem insertion.bat
C:\Users\John\Desktop\New Folder>rem John T. Rine
C:\Users\John\Desktop\New Folder>rem November 15, 2011
C:\Users\John\Desktop\New Folder>gcc insertion.c -o insertion
C:\Users\John\Desktop\New Folder>pause
Press any key to continue . . .
C:\Users\John\Desktop\New Folder>insertion "badcfeghijklnmoprqsutvwxzy"
Before sorting: badcfeghijklnmoprqsutvwxzy
After sorting: abcdefghijklmnopqrstuvwxyz
C:\Users\John\Desktop\New Folder>pause
Press any key to continue . . .
==References==
- http://www.algolist.net/Algorithms/Sorting/Insertion_sort
- http://www.cprogramming.com/tutorial/computersciencetheory/sorting2.html
- http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Sorting/insertionSort.htm
====Quick Sort====
The quick sort uses the "divide and conquer" strategy to sort a list. It doesn't require extra memory to perform the sort and is said to perform the sort "in place".
The quick sort algorithm is composed of the following steps:\\
- Select a pivot value to divide the list.
- Reorder the list so that all of the elements before the pivot value are less than its value and all of the values greater than the pivot come after it in the list.
- Sort both pieces of the list.
//quick.c
//John T. Rine
//November 25, 2011
#include
#include
int cntChars(char *);
void quickSort(char[], int, int) ;
int main(int argc, char **argv)
{
int x, n;
if(argc != 2)
{
printf("usage: quick string_to_sort\n");
exit(1);
}
n = cntChars(*(argv + 1));
char *charPTR;
charPTR = malloc(sizeof(char) * (n + 1));
for (x = 0; x <= n; x++) *(charPTR + x) = *(*(argv + 1) + x);
printf("Before sorting: ");
printf("%s\n", charPTR);
quickSort(charPTR, 0, n - 1);
printf("After sorting: ");
printf("%s\n", charPTR);
free(charPTR);
return 0;
}
int cntChars(char *inputString)
{
// returned value "count" does not include '\0'
int count = 0;
while(*(inputString + count) != '\0') ++count;
return(count);
}
void quickSort(char array[], int m, int n)
{
int i,j,k;
char temp, pivot;
if(m < n)
{
k = (m + n) / 2;
temp = *(array + m);
*(array + m) = *(array + n);
*(array + n) = temp;
pivot = *(array + m);
i = m + 1;
j = n;
while(i <= j)
{
while((i <= n) && (*(array + i) <= pivot)) i++;
while((j >= m) && (*(array + j) > pivot)) j--;
if(i < j)
{
temp = *(array + i);
*(array + i) = *(array + j);
*(array + j) = temp;
}
}
temp = *(array + m);
*(array + m) = *(array + j);
*(array + j) = temp;
quickSort(array, m, j - 1);
quickSort(array, j + 1, n);
}
}
I wrote the following Windows batch file to automate compilation and execution, with command line arguments, of the source file-quick.c.\\
rem quick.bat
rem John T. Rine
rem November 25, 2011
gcc quick.c -o quick
pause
quick eafbgchdikjlnmopqsrtvwuyxz
pause
These are the results of compiling and executing the source file, quick.c, using the character string "eafbgchdikjlnmopqsrtvwuyxz" as its only commandline argument.\\
C:\Users\John\Desktop\sorting>rem quick.bat
C:\Users\John\Desktop\sorting>rem John T. Rine
C:\Users\John\Desktop\sorting>rem November 25, 2011
C:\Users\John\Desktop\sorting>gcc quick.c -o quick
C:\Users\John\Desktop\sorting>pause
Press any key to continue . . .
C:\Users\John\Desktop\sorting>quick eafbgchdikjlnmopqsrtvwuyxz
Before sorting: eafbgchdikjlnmopqsrtvwuyxz
After sorting: abcdefghijklmnopqrstuvwxyz
C:\Users\John\Desktop\sorting>pause
Press any key to continue . . .
==References==
- http://www.cs.auckland.ac.nz/software/AlgAnim/qsort.html
- http://www.cs.auckland.ac.nz/~jmor159/PLDS210/niemann/s_man.htm
- http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Sorting/quickSort.htm
- http://www.cprogramming.com/tutorial/computersciencetheory/quicksort.html
- http://www.cs.purdue.edu/homes/ayg/CS251/slides/chap8b.pdf
====Merge Sort====
The merge sort is a divide and conquer algorithm just like the quick sort, however, unlike the quick sort, it requires extra memory to perform the sort.
==References==
- http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Sorting/mergeSort.htm
- http://www.cprogramming.com/tutorial/computersciencetheory/mergesort.html
- http://www.cprogramming.com/tutorial/computersciencetheory/merge.html
- http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/merge/mergen.htm
====Binary Search Algorithm====
The binary search algorithm is a way to locate an element having a certain value within a list of sorted elements. The binary search algorithm eliminates half of the elements searched with each comparison.
//binarySearch.c
//John T. Rine
//November 25, 2011
#include
#include
int main(int argc, char **argv)
{
int i, n;
int left, right, middle, element = -1;
char value;
char temp;
if(argc != 5)
{
printf("usage: binarySearch string_to_search element_to_search_for left_element right_element\n");
exit(1);
}
left = atoi(*(argv + 3));
right = atoi(*(argv + 4));
value = *(*(argv + 2) + 0);
printf("Now performing a binary search for element %c, between elements %d and %d\n", value, left, right);
while (left <= right)
{
printf("left = %d, right = %d, middle = %d, element = %d, value = %c\n", left,right,middle,element,value);
middle = (left + right) / 2;
if (*(*(argv + 1) + middle) == value)
{
element = middle;
break;
}
else if (*(*(argv + 1) + middle) > value) right = middle - 1;
else left = middle + 1;
}
printf("The element containing the value is %d (-1 indicates element not found)\n", element);
return 0;
}
\\
I wrote a batch file to automate compilation and execution with command line arguments of the binarySearch.c source file.\\
rem binarySearch.bat
rem John T. Rine
rem November 25, 2011
gcc binarySearch.c -o binarySearch
pause
binarySearch abcdefghhijklmnopqrstuvwxyz b 0 25
pause
Here is the execution of the binary search algorithm on Windows with the lower case alphabet as the string to be searched, 'b' as the value to be found, left index as 0, and the right index as 25.\\
C:\Users\John\Desktop\binarySearch>rem binarySearch.bat
C:\Users\John\Desktop\binarySearch>rem John T. Rine
C:\Users\John\Desktop\binarySearch>rem November 25, 2011
C:\Users\John\Desktop\binarySearch>gcc binarySearch.c -o binarySearch
C:\Users\John\Desktop\binarySearch>pause
Press any key to continue . . .
C:\Users\John\Desktop\binarySearch>binarySearch abcdefghhijklmnopqrstuvwxyz b 0
25
Now performing a binary search for element b, between elements 0 and 25
left = 0, right = 25, middle = 212, element = -1, value = b
left = 0, right = 11, middle = 12, element = -1, value = b
left = 0, right = 4, middle = 5, element = -1, value = b
left = 0, right = 1, middle = 2, element = -1, value = b
left = 1, right = 1, middle = 0, element = -1, value = b
The element containing the value is 1 (-1 indicates element not found)
C:\Users\John\Desktop\binarySearch>pause
Press any key to continue . . .
Here is the execution of the binary search algorithm on Linux with the upper case alphabet as the string to be searched, 'U' as the value to be found, left index as 0, and the right index as 25.\\
lab46:~/src/data/binarySearch$ gcc binarySearch.c -o binarySearch
lab46:~/src/data/binarySearch$ ./binarySearch ABCDEFGHIJKLMNOPQRSTUVWXYZ U 0 25
Now performing a binary search for element U, between elements 0 and 25
left = 0, right = 25, middle = 0, element = -1, value = U
left = 13, right = 25, middle = 12, element = -1, value = U
left = 20, right = 25, middle = 19, element = -1, value = U
left = 20, right = 21, middle = 22, element = -1, value = U
The element containing the value is 20 (-1 indicates element not found)
lab46:~/src/data/binarySearch$
==References==
- http://en.wikipedia.org/wiki/Binary_search_algorithm
- http://www.algolist.net/Algorithms/Binary_search
- http://video.franklin.edu/Franklin/Math/170/common/mod01/binarySearchAlg.html
- http://planetmath.org/encyclopedia/BinarySearch.html
====Big-O====
Big O or Big Omicron represents the upper bound of asymptotic complexity.
Big O notation describes the relative complexity of an algorithm by reducing the growth rate to the key factors when the key factor tends towards infinity, all other factors being ignored. This is why the phrase "asymptotic complexity" is used to describe its behavior.
Listed below are common examples of big O notation; included is an explaination of what each example means:\\
==O(1)==
Describes an algorithm whose number of operations, the complexity, is always the same regardless of the size of the input data set.
==O(n)==
The complexity, the number of operations, is directly proportional to the size of the data. This is called linear complexity.
==O(n^2)==
Describes an algorithm whose number of operations,the complexity, is directly proportional to the square of the size of the input data set. This is common with algorithms that consist of nested loops over the data set. Deeper nested loops result in big O (n to higher powers).
==O(2^n)==
O(2^n) describes an algorithm whose growth will double with each additional element in the input data set.
==References==
- http://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/
- http://www.cforcoding.com/2009/07/plain-english-explanation-of-big-o.html
- http://recursive-design.com/blog/2010/12/07/comp-sci-101-big-o-notation/
- http://www.youtube.com/watch?v=6Ol2JbwoJp0
- http://www.perlmonks.org/?node_id=227909
- http://www.perlmonks.org/?node_id=573138
- http://pages.cs.wisc.edu/~vernon/cs367/notes/3.COMPLEXITY.html#introduction
====Binary Trees====
Binary trees are so called because when drawn pictorial look like inverted trees. Binary trees are made up of nodes that contain data and pointers to other nodes just like linked-list implementations. Binary trees, however, have "left" and "right" pointers rather than "next" and "previous" pointers.
Also similar to linked lists, binary trees use null pointers to indicate an end of a tree; in a binary tree, however, it is the end of a branch or subtree. Since binary trees branch out, that is they spread out rather than being one node after another like a list, so binary trees are fast at searching for data.\\
==References==
- http://cslibrary.stanford.edu/110/BinaryTrees.html
- http://www.cprogramming.com/tutorial/lesson18.html
- http://msdn.microsoft.com/en-us/library/ms379572(v=vs.80).aspx
- http://www.cs.bu.edu/teaching/c/tree/binary/
- http://cis.stvincent.edu/html/tutorials/swd/bintrees/bintrees.html
=====hpc1 Topics=====
====Keyword 1====
Identification and definition of the chosen 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
int main()
{
return(0);
}
====Keyword 2====
Identification and definition of the chosen keyword.
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$
====Keyword 3====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual 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
int main()
{
return(0);
}
====Keyword 4====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual keyword.
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$
====Keyword 5====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual 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
int main()
{
return(0);
}
====Keyword 6====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual keyword.
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$
====Keyword 7====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual 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
int main()
{
return(0);
}
====Keyword 8====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual keyword.
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$
====Keyword 9====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual 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
int main()
{
return(0);
}
====Keyword 10====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual keyword.
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$
====Keyword 11====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual 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
int main()
{
return(0);
}
====Keyword 12====
Identification and definition of the chosen keyword. Substitute "keyword" with the actual keyword.
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$
=====sysprog Topics=====
====Group IDs====
In Unix/Linux operating systems, users can be categorized together into groups. File permissons in POSIX compliant and Unix/Linux operating systems are organized into three classes, user, group, and others. The use of groups as the name implies, allows groups of users access to files and other system resources.
A group identifier or GID, is a numeric value used to represent a specific group. The range of values for a GID varies among different operating systems; at minimum, a GID can be between 0 (0x0000) and 32,767 (0x7fff), with one restriction:
* The login group for the Superuser must have GID 0.
The GID is used to refer to groups in the /etc/passwd and /etc/group files or their equivalents. Shadow password files and Network Information Service also refer to GIDs. The GID is a necessary component of Unix file systems and processes.
==References==
- http://en.wikipedia.org/wiki/Group_identifier
- http://kb.iu.edu/data/adwf.html
====User IDs====
In Unix/Linux operating systems, users are identified within the kernel by an unsigned integer value called a user identifier or UID.
The range of UID values varies among different operating systems; at mimimum, a UID can be between 0 (0x0000) and 32767 (0x7fff), but with the following restrictions:\\
* The superuser must always have a UID of zero (0).
* The user “nobody” traditionally got the largest possible UID (as the opposite of the superuser): 32767. More recently, systems have assigned the user a UID in the system range (1–100, see below) or in the range 65530–65535.
* Convention reserves UIDs from 1 to 100 for system use; some manuals recommend reserving UIDs from 101 up to 499 (Red Hat Enterprise Linux) or even up to 999 (Debian) as well.
The UID references users in the /etc/passwd file. Shadow password files and Network Information Service also refer to UIDs. The UID has become a necessary component of Unix file systems and processes.
==References==
- http://en.wikipedia.org/wiki/User_identifier
- http://kb.iu.edu/data/adwf.html
====File System Structure====
A file system is used to organize and store data on non-volatile media such as disk drives. The file system includes security features used to control access to data. The file system also provides man-readable aliases called file names with which to access data on non-volatile memory devices. File system structure looks like an inverted tree. At the top of the tree is the root directory. In this directory are files and subdirectories, each directory containing other directories and, or files which make up the "branches" of the tree.
==References==
- http://en.wikipedia.org/wiki/File_system
- http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.baseadmn/doc/baseadmndita/filesys_struct.htm
====Directories====
Directories appear to the user of an operating system as a container of files and other directories, however, a directory is actually a file that has an entry for each item contained within the directory. Each entry in a directory contains only the name of the item, and a numerical reference to the location of the item. The reference is called an i-number, and is an index into a table called the i-list. The i-list is a complete list of all the storage space available to a particular file system.
==References==
- http://www.cs.princeton.edu/courses/archive/fall09/cos318/lectures/FileLayout.pdf
- http://www.webopedia.com/TERM/D/directory.html
- http://www.freebsd.org/doc/handbook/dirstructure.html
- http://snap.nlc.dcccd.edu/learn/idaho/fstour.html
====Links====
A link is a pointer to another file. A directory entry can be a hard link, in which the i-number points directly to another file. A hard link to a file cannot be distinguished from the file itself. When a hard link is created, the i-numbers of two different directory file entries point to the same inode. For this reason, hard links cannot span file systems. A symbolic link provides an indirect pointer to a file. A symbolic link is implemented as a directory file entry containing a pathname. Soft links are distinguishable from files, and can span across file systems. Note that some versions of UNIX do not support symbolic links.
The I-List.\\
Differences between hard and symbolic links:\\
* A hard link to a directory cannot be created.
* If the file a hard link points to is removed, the link can still be used to access the content of the file.
* A symbolic link can link to a directory.
* A symbolic link, is useless when the file it references has been removed.
==References==
- http://snap.nlc.dcccd.edu/learn/idaho/fstour.html
- http://en.wikipedia.org/wiki/Symbolic_link
- http://www.linuxclues.com/articles/17.htm
====Atomic Operations====
An atomic operation guarantees that one or more machine instructions are executed sequentially, without interruption. Without intervention, any sequence of two or more machine instructions isn't atomic since the operating system may suspend the execution of the current sequence of instructions in favor of some other task. To ensure that a sequence of operations will in fact be atomic some form of synchronization is required. Without that, the only guarantee you have is that a single machine instruction is always atomic; the CPU can not interrupt a single instruction in the middle.
==References==
- http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=469
- http://wiki.osdev.org/Atomic_operation
====Re-entrant Code====
Re-entrant code is written so that none of it can be modified, further, it does not keep track of anything. Programs calling re-entrant code keep track of their own variables, flags, etc., therefore, one copy of a re-entrant routine can be shared by any number of processes.
==References==
- http://en.wikipedia.org/wiki/Reentrancy_(computing)
- http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.genprogc%2Fdoc%2Fgenprogc%2Fwriting_reentrant_thread_safe_code.htm
- http://www.eetimes.com/discussion/beginner-s-corner/4023308/Introduction-to-Reentrancy
- http://www.theserverside.com/discussions/thread.tss?thread_id=3640
- http://www.pcmag.com/encyclopedia_term/0,2542,t=re-entrant+code&i=50231,00.asp
====Alarms, Interval Timers(Event Driven Programming)====
==References==
- http://academic.udayton.edu/SaverioPerugini/courses/cps445/lecture_notes/times.html
=====data Objective=====
====Objective====
State the course objective; define what that objective entails.
===Method===
State the method you will use for measuring successful academic/intellectual achievement of this objective.
===Measurement===
Follow your method and obtain a measurement. Document the results here.
===Analysis===
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
* How did you do?
* Room for improvement?
* Could the measurement process be enhanced to be more effective?
* Do you think this enhancement would be efficient to employ?
* Could the course objective be altered to be more applicable? How would you alter it?
=====hpc1 Objective=====
====Objective====
State the course objective; define what that objective entails.
===Method===
State the method you will use for measuring successful academic/intellectual achievement of this objective.
===Measurement===
Follow your method and obtain a measurement. Document the results here.
===Analysis===
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
* How did you do?
* Room for improvement?
* Could the measurement process be enhanced to be more effective?
* Do you think this enhancement would be efficient to employ?
* Could the course objective be altered to be more applicable? How would you alter it?
=====sysprog Objective=====
====Objective====
State the course objective; define what that objective entails.
===Method===
State the method you will use for measuring successful academic/intellectual achievement of this objective.
===Measurement===
Follow your method and obtain a measurement. Document the results here.
===Analysis===
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
* How did you do?
* Room for improvement?
* Could the measurement process be enhanced to be more effective?
* Do you think this enhancement would be efficient to employ?
* Could the course objective be altered to be more applicable? How would you alter it?
=====Experiments=====
====Experiment 1====
===Question===
What is the question you'd like to pose for experimentation? State it here.
===Resources===
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.
===Hypothesis===
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.
===Experiment===
How are you going to test your hypothesis? What is the structure of your experiment?
===Data===
Perform your experiment, and collect/document the results here.
===Analysis===
Based on the data collected:
* was your hypothesis correct?
* was your hypothesis not applicable?
* is there more going on than you originally thought? (shortcomings in hypothesis)
* what shortcomings might there be in your experiment?
* what shortcomings might there be in your data?
===Conclusions===
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.
====Experiment 2====
===Question===
What is the question you'd like to pose for experimentation? State it here.
===Resources===
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.
===Hypothesis===
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.
===Experiment===
How are you going to test your hypothesis? What is the structure of your experiment?
===Data===
Perform your experiment, and collect/document the results here.
===Analysis===
Based on the data collected:
* was your hypothesis correct?
* was your hypothesis not applicable?
* is there more going on than you originally thought? (shortcomings in hypothesis)
* what shortcomings might there be in your experiment?
* what shortcomings might there be in your data?
===Conclusions===
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.
====Retest====
If you're doing an experiment instead of a retest, delete this section.
If you've opted to test the experiment of someone else, delete the experiment section and steps above; perform the following steps:
===State Experiment===
Whose existing experiment are you going to retest? Prove the URL, note the author, and restate their question.
===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===
State their experiment's hypothesis. Answer the following questions:
* Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover?
* What improvements could you make to their hypothesis, if any?
===Experiment===
Follow the steps given to recreate the original experiment. Answer the following questions:
* Are the instructions correct in successfully achieving the results?
* Is there room for improvement in the experiment instructions/description? What suggestions would you make?
* Would you make any alterations to the structure of the experiment to yield better results? What, and why?
===Data===
Publish the data you have gained from your performing of the experiment here.
===Analysis===
Answer the following:
* Does the data seem in-line with the published data from the original author?
* Can you explain any deviations?
* How about any sources of error?
* Is the stated hypothesis adequate?
===Conclusions===
Answer the following:
* What conclusions can you make based on performing the experiment?
* Do you feel the experiment was adequate in obtaining a further understanding of a concept?
* Does the original author appear to have gotten some value out of performing the experiment?
* Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).