This is an old revision of the document!
HPC0 has definitely had the most eventful first week of any class i have been apart of at CCC. Starting out the semester with missing computers was interesting to say the least. This worked out alright in the end as it gave us time to rearrange the room into four separate pod stations to house the new computers. The new computers are great, especially the “upgraded” 4GB of flash.
We have slowly been working out the kinks in the new POD set up. We were able to give each pod a host name based up its MAC address! This required Brian and I to copy all of the MACs down and submit them to Matt to add to the router. We also fixed an issue, thanks to Andrew, with Vim not using backspace! More bug searching/fixing to come!
I have been brain storming ideas for a cool HPC0 project. Matt came up with a few really cool ones today such as a CLI based library system for checking out books from the lairs collection, installing Linux on multiple machines that are all different architectures (Some of them are powerpc, ARM, and MIPS). This one was appealing to me as i really did enjoy using the powerpc mac mini in the old lair and would like to restore its functionality. We also discussed making a weather display for the new lair. This would allow us to see graphical data in real time to veiw what the weather is doing in our local area. This may be a really cool project as the winter season approaches and inevitable snow days occur.
Today we finally rolled out an AWESOME new version of the pod BSD image. Matt, Brian, and i got every pod set up to copy the new image to the pods 4GB of internal flash storage. We were extremely leery of how the network would handle this mass roll out. We were astounded to see everything going smooth! Each machine was using about 12MB of network bandwidth. This is roughly saturating 100mbps speeds! Seeing how each switch has a 1GB up-link and each pod station has about 6 machines we were achieving some very impressive speeds for the low end hardware we have in place. This new image now allowed us to take advantage of the two extra gigabytes of flash storage we unexpectedly received in each pod station! Each station now has a free space of 1.7GB. This is much better than the 70MB we had with the previous version of the pod image. We are still experiencing some hanging issues up on boot but we are close to solving the issue!
Data structures is a hard class to take with out computers…
This week was very uneventful due to the above statement. Matt reviewed some topics from our past prerequisite classes to help us get up to pace with what will be needed in our first project. This had me inspired and i started working!
#include <stdio.h> int main() { int choice = 0; printf ("1) Build List\n"); printf ("2) Display List\n"); printf ("3) Instert Into List\n"); printf ("4) Append Into List\n"); printf ("5) Obtain From List\n"); printf ("6) Clear List\n"); printf ("7) Quit\n"); return 0; }
Underwhelming! :D
#include <stdio.h> int main(){ int test [20]; int choice = 0; do{ printf ("1) Build List\n"); printf ("2) Display List\n"); printf ("3) Instert Into List\n"); printf ("4) Append Into List\n"); printf ("5) Obtain From List\n"); printf ("6) Clear List\n"); printf ("7) Quit\n"); printf ("Enter option: "); scanf ("%d", &choice); if (choice > 7){ printf ("Non-existent Option\n"); } if (choice == 1){ printf ("enter numbers: "); int number = 0; int index = 0; int stop = -1; do{ if (index == 19){ test[index] = stop; printf ("number limit reached\n"); break; } else { scanf ("%d", &number ); test[index] = number; index++; } } while (number != -1); } else if (choice == 2){ int i; for (i = 0; i <= 19; i++){ int at = test[i]; if (at == -1){ printf ("# -1 @ array index %d\n", i); break; } else { printf ("# %d @ array index %d\n", at,i); } } } else if (choice == 3){ int nv, ai, in; printf ("enter new value: "); scanf ("%d", &nv); printf ("enter array index: "); scanf ("%d", &ai); printf ("nv %d ai %d\n", nv,ai); for (in =0; i <19 } } while (choice != 7); return 0; }
dsi0 is coming along and should be done tonight! W00t W00t.
Here is my finished dsi0 source code!
// Author: Dan Shadeck // Date: 09/09/2014 // Class: CSCS2320 // Project: dsi0 #include <stdio.h> int main(){ int test [20]; int choice = 0; int masterindex = 0; do{ printf ("1) Build List\n"); printf ("2) Display List\n"); printf ("3) Instert Into List\n"); printf ("4) Append Into List\n"); printf ("5) Obtain From List\n"); printf ("6) Clear List\n"); printf ("7) Quit\n"); printf ("Enter option: "); scanf ("%d", &choice); if (choice > 7){ // If user selects a number not on the menu report the error printf ("Non-existent Option\n"); } if (choice == 1){ // Taking user input into our above array (test) printf ("enter numbers: "); int number = 0; int index = 0; int stop = -1; do{ if (index == 19){ test[index] = stop; printf ("number limit reached\n"); masterindex = 19; break; } else { scanf ("%d", &number ); test[index] = number; if (number == -1) { masterindex = index; } index++; } } while (number != -1); } else if (choice == 2){ // Loop for dispalying array numbers and index int i; for (i = 0; i <= 19; i++){ int at = test[i]; if (at == -1){ printf ("# -1 @ array index %d\n", i); break; } else { printf ("# %d @ array index %d\n", at,i); } } } else if (choice == 3){ // Insert int nv, ai, in; printf ("enter new value: "); scanf ("%d", &nv); printf ("enter array index: "); scanf ("%d", &ai); for (in = masterindex; in >= ai; in--) { int nnv = test[in]; int nai = in + 1; if (nai == 19) { test[19] = -1; } else { test[nai] = nnv; } } masterindex++; if (masterindex > 19 ){ masterindex = 19; } test[ai] = nv; } else if (choice == 4){ // Append int nv, ai, in; printf ("enter new value: "); scanf ("%d", &nv); printf ("enter array index: "); scanf ("%d", &ai); ai++; for (in = masterindex; in >= ai; in--) { int nnv = test[in]; int nai = in + 1; if (nai == 19) { test[19] = -1; } else { test[nai] = nnv; } } masterindex++; if (masterindex > 19 ){ masterindex = 19; } test[ai] = nv; } else if (choice == 5){ // Choosing an array index and removing all numbers in the array after selected index int nv, ai, in; printf ("enter array index: "); scanf ("%d", &ai); printf ("# %d @ array index %d\n", test[ai],ai); for (in = ai + 1; in <= masterindex; in++){ int nnv = test[in]; int nai = in -1; test[nai] = nnv; } masterindex--; if (masterindex < 0) { masterindex = 0; test[0] = -1; } } else if (choice == 6){ // Clear the array by testing -1 at array index 0 & updating our master index test[0] = -1; masterindex = 0; printf ("cleared\n"); } } while (choice != 7); // Quit! return 0; }
sln0 is coming along smoothly!
I was sad to miss the first day of data communications as this class is definitely the one that interests me the most. We looked at what the best way to network the new classroom would be and decided that having a switch in the campus network closet would the best idea. We set up out switch with the proper IP address, subnet mask, and gateway to get it ready to deploy!
I am excited to see Matt is bringing back the sleep data project. I feel that this a valuable learning tool to understand basic hardware hacking. We went over the project page and should get a start tomorrow!
Here is some code we have created in class to help sift through the sleep data!
great progress.
#include <stdio.h> #include <stdlib.h> int main() { FILE *fptr; unsigned char byte; unsigned char chksum = 0; unsigned char chksumchk = 0; unsigned short int msglen = 0; unsigned short int imsglen = 0; unsigned char time_sec = 0; unsigned short int sub_sec = 0; unsigned char seq_num = 0; unsigned char dtype = 0; unsigned char *dblock; char pktflag = -1; int i = 0; fptr = fopen ("sleep.data", "r"); while ((byte = fgetc(fptr)) != EOF) { if (pktflag == -1) // not currently processing a data packet { if (byte == 0x41) { pktflag = 0; } } else if (pktflag == 0) // check for 2nd byte of packet { if (byte == 0x34) { pktflag = 1; } else pktflag = -1; } else if (pktflag == 1) // store checksum byte { pktflag = 2; chksum = byte; } else if (pktflag == 2) // store msglen bytes { pktflag = 3; msglen = byte; byte = fgetc(fptr); msglen = msglen | (unsigned short int)byte << 8; } else if (pktflag == 3) // store inverse msglen bytes { imsglen = byte; byte = fgetc(fptr); imsglen = imsglen | (unsigned short int)byte << 8; if ((msglen & imsglen) == 0) pktflag = 4; else pktflag = -1; } else if (pktflag == 4) { time_sec = byte; pktflag = 5; } else if (pktflag == 5) { pktflag = 6; sub_sec = byte; byte = fgetc(fptr); sub_sec = sub_sec | (unsigned short int)byte << 8; } else if (pktflag == 6) { seq_num = byte; pktflag = 7; } else if (pktflag == 7) { dtype = byte; pktflag = 8; chksumchk = dtype; dblock = (unsigned char *) malloc (sizeof(char) * (msglen - 1)); for(i=0; i<(msglen-1); i++) { (*(dblock+i)) = fgetc(fptr); chksumchk = chksumchk + (*dblock+i); } if (chksum == chksumchk) // we have a valid packet { fprintf(stdout, "chksum: %.2x msglen: %.4x time_sec: %.2x dtype: %.2x dblock: ", chksum, msglen, time_sec, dtype); for(i=0; i<(msglen-1); i++) fprintf(stdout, "%.2x ", (*dblock+i)); fprintf(stdout, "\n"); } } // fprintf(stdout, "We read: %.2hhX\n", byte); } fclose(fptr); return(0); }