User Tools

Site Tools


opus:fall2013:ahughe12:journal

Data Structures Journal

MONTH Day, YEAR

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?

Septiembre de quatro, dos mil y diezitres

  • eye duhn mayd dat dur prugrahm dat dit dat ting. et prented duh vahroos of duh drate-uh-tripes of duh dooble, cher, lohng, ETCETERA.
  • The program itself was eloquent in it's simplicity, as it assessed the amount of memory each data type would consume on the system from it's use.
  • I move on now to the assignment of structs and their use as I am sure the great wide world of data will….

E

X

P

A

N
  D

September 6th, 2013

The Second Week of School:

  • This week we worked on a singley Linked list, with insert and append.
  • This Builds the List:
                            if(list == NULL)
                        {
                                list = tmp = (Node *)malloc(sizeof(Node));
                                tmp->next = NULL;
                                //list->next = NULL == tmp->next = NULL 
                                // because both list and tmp point to the same thing
                                list->value = input;
                        }
                        else
                        {
                                tmp-> next=(Node*)malloc(sizeof(Node));
                                tmp-> next-> next = NULL;
                                tmp-> next-> value = input;
                                tmp = tmp -> next;
                        }
  • This code adds the option to insert:
      printf("Which node would you like to insert before?\n");

                int seeker; tmp = list; Node*tmp2 = NULL;

                scanf("%d",&input);

        tmp = list;

        for(seeker = 0; seeker < (input-1); seeker++)
        {
        tmp = tmp-> next;
        }

        printf("Enter a value to insert:\n");

        if(input == 0)
        {
                scanf("%d", &input);
                tmp2=(Node*)malloc(sizeof(Node));
                tmp2 -> value = input;
                tmp2 -> next = NULL;
                tmp2 -> next = tmp;
                list = tmp2;
        }
        else
        {
                scanf("%d", &input);
                tmp2 = (Node*)malloc(sizeof(Node));
                tmp2 -> value = input;
                tmp2 -> next = tmp -> next;
                tmp-> next =tmp2;
       }
        tmp = list;
        input = 0;

September 13th, 2013

  • This week we added append to the single link list, and started the double link list.
  • From the link list above, append only changed the value of seeker to be true to input, instead of (input -1)
  • Then, we started the Doubly Link List, but it was not finished until week 4.

September 20th,2013

  • The doubly link list is built, and a program to make a menu with functions of the singly link list as well as the double link list was assigned.
  • The doubly link List looks like this:
    List * build()
{
        Node * tmp=NULL;
        List * myList = (List*)malloc(sizeof(List));
        myList->start=myList->end=NULL;
        int input = 0;

        printf("enter a value (-1 to quit): \n");
        scanf("%d",&input);
        while(input != -1)
        {
                if(myList->start == NULL){
                        myList->start = myList->end = (Node*)malloc(sizeof(Node));
                        myList->start->value = input;
                        myList->end->prev=myList->start->next = NULL;
                }
                else
                {
                        myList->end->next=(Node*)malloc(sizeof(Node));
                        myList->end->next->value=input;
                        myList->end->next->next=NULL;
                        myList->end = myList->end->next;
                }
        printf("Enter another value(-1 to quit): \n");
        scanf("%d",&input);
        }

        return (myList);
}
  • We also added append to the double link List:
     List * insert(List * myList, Node * place, Node * newNode)
{
        if(place == myList -> start)
        {
                newNode->next=place;
                place-> prev=newNode;
                newNode->prev = NULL;
                myList->start=newNode;
        }
        else
        {
                newNode->next=place;
                place->prev->next=newNode;
                newNode->prev=place->prev;
                place->prev=newNode;
        }

return(myList);
}

September 27th, 2013

  • I am having scoping issues with the functions needed in the menu programs for both the doubly linked list and the sinlge linked list.
  • The scopes of the functions are asking for values within the function, when those values that the functions are calling should be initialized and declared within main, and not within the function itself
  • A am begining to understand what is going wrong, but it is going to process to ingrain and debug everything conceptually.

October 3st, 2013

   
   * the scoping issues are resolved with a lot of frustration and broken computer equipment (via HULK SMASH)
   * NOW ON TO OTHER FUNCTIONS SUCH AS 'SORT' AND THE LIKE
   * sort is a pain in the a$$

October 9rd, 2013

  • KNOWLEDGE ASSESSMENT?! REALLY ?! WHAT THE FRIG YO?
  • in all honesty, this is difficult, but I know a few weeks ago I wouldn't of been able to understand anything at all that is going on in the code.

October 10st, 2013

  • after tackling it a second time, I know there are some problems, but i am catching on to the order of where things should go and traipsing through the logic step by step. I think Even with the discrepancies I may or may not have there are some things I caught over the other students, so that makes me happy. Also, the looping recursive pointers in connecting two separately built list functions is a pain in the butt.

October 11fr,2013

  • Part two of the knowledge assessment, coding.
  • With the given functions from part one, I feel confident I can build the lists with conditional if statements, although some are thwarting my efforts on a syntax level. The amount I understand after these few weeks in comparison to other courses I have taken thus far at this school is pretty amazing. The trouble I am having is timing and congruence of understanding, which I think will only come with time and practice.

October 18we, 2013

  • This week we went over the knowledge assessment and I felt better about my pitfalls, as they were stupid mistakes and just oversight of some key code/components.
  • We also got introduced to pop, peek, and stacks as well, which i will have to wait to implement, as I am still on my menulist.
  • Now, Back to this friggin linked list menu, and the demon sort.
  • Logically, it took me awhile to understand how I needed/wanted to go about doing it. but Now that I have a sense of how it could work, I am having a better time with it.
  • Then it was a success! Now I move onto clear and the other parts of the list

October 25qp,2013

  • I have had similar problems with scope and logic in the clear, but with some help from matt, I found that it was a pointer issue with myList→ start being NULL where the loop was supposed to end, with that resolved with a contingency if statement around the loop, the full linked list menu is finished.
  • Now I move onto the Stack

November 1st

  • Couldn't really get anything done this week due to a certain online class piling on past requirements and assignments to be due from lack of an instructor and any instruction.

November 8nm, 2013

  • This week I started jumping into the makefiles that Matt put up, so we could learn to look for what is significant in each makefile. It's pretty dense, but considering I have already built most of the programs and functions he has put into header files and libraries, I know what is important and being manipulated, but I am not sure how to implement it onto my own stack program, So i started writing notes on where all the functions I think I will be using are, and how I might want to use them.

The End of the Semester Struggle

  • Towards the end things got very hectic, but Imust say it was a wonderful learning experience. The EoCE, although hairpulling, gave me a means to understand another method of coding by being able to build off tools and knowledge that i had previously learned through work and instruction. Issues of syntax and scope were like diving head first into a shovel, but I really think i got a nice enough grasp of them to be able to start being able to learning other things that can use coding as a tool to test and produce something viable and consumable. I had many an issue with scope due to not ever being exposed to an OOP. That non understanding was led by a not knowing of syntax that kept me from being able to even understand the scope problems to begin with. but i trudged it out and badgered you with questions (I started to getting around to know what questions to ask because i understood what the program was intended to do from instruction and presentation previously) after I got some understanding of syntax i could start piecing together how the scope worked and then create the functions to the corresponding classes. I was only able to create a build program, but i did that build program the right way. I got it to work (with much help from you) and had a working piece of code that I could apply to how to build the other functions and make them work within their corresponding scopes. I then planned on placing that build program into a scoped function in the class itself, and then use that function within the constructors of the other classes of stack and queue but then I alas, was met with another OOPsyntax/scope misunderstanding of a protected class that kept me from producing more. All in all, now that it's over, I'm glad I did it, I learned a lot, it was most definitely an experience.

Data Communications Journal

MONTH Day, YEAR

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?

August 29, The Year of Stuff, 2013

The first week of school:

  • The goal of this week was to go over to course expectations and requirements as well as set up the raspberry pi's for future projects.
  • Today, with the joyous help from the ever so handsome Shawn Meas, the pi's were loaded with the debian images onto their microSD cards.
  • once these are set up , the real fun starts. Hoorah.

September 6, Marklar, 2013

The second week of school:

  • Pi's are set up
  • The goal of this week was to set up the GPIO pins and construct an LED to be lit up from the command line.
  • It was successful and now the next goal is to do the same thing through a C-Program that will allow us to have more possibilities.

September 13, Ottorino Resphigi, 2013

The third week of school:

  • Pi's now have a IO chord extension.
  • The goal was to set up the C-Program to light the LED, however I wanted to check the connection for the chord to make sure the pin coordination was correct, and there were complications from the command line that didn't allow me to send electricity to the pins to light the LED. Matt found out that there was an odd write access problem in the directory the command was held.
  • Next week the C-Program will be built and things will commence into making a Telegraph communication system Via lit LED's.

September 20, Rachmaninov, 2013

  • This week Matt helped with an algorithm to build a binary counter to allow for the GPIO pins to fire according to the binary number to be displayed.
  • It's pretty cool, and very bright.:
  while(value <= 15)
 {
      printf("Value is at %d\n", value);
      place = 8;
      pin = 3;
      queue = value;
      while(place > 0)
      {
         GPIO_SET = queue/place << pins[pin];
        printf("place is %d, bit is %d\n",place,(queue/place));

         if((queue/place) == 1)
         {
         queue = queue - place;
         }

         place = place/2;
         pin=pin-1;

      }
   usleep(1000000);
   GPIO_CLR = 1 << pins[3];
   GPIO_CLR = 1 << pins[2];
   GPIO_CLR = 1 << pins[1];
   GPIO_CLR = 1 << pins[0];
   usleep(50000);
   value++;
}

September 27, Nicoolo Paganini,2013

  • Still waiting for some people to catch up with binary counter, data structures is kickin me in the A$$
  • Haven't done anything for data comm this week.

HPC Experience I Journal

MONTH Day, YEAR

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?

August 29th, The year of the Snark, 2013

- just got the list of stuff to be done this semester today. My goal for HPC Experience is to get as comfortable with linux to take a red hat cert and finish some systems programming stuff.

September 4th, 2013

  • today i downloaded virtual box in hopes to be able to run RHEL on it to start going over some certification KNOWLEDGE(the “k” is not silent)
  • with RHEL i will do some activities that will delve deep into the great wide world of capitalistic enterprise linux, that drudge through the depths of profit and escape the philosophy of free information flow! (but it will get me a job, so f*** it. )
  • then i presumed to create the virtual machine, it was fun, then i called it a day to leave the rest of my work for THE FUTE-REYYYYY

September 11th, 2013

  • Today, Thomas Hakes got me through a means to run a Red Hat Linux Environment through Amazon Web Services.
  • I ran the environment and now have a means to start my RHCSA/RHCE exam study material.

September 27th, 2013

  • haven't done Jack shiz, need to get on it. gtg to work now.

The rest of the semester

I have lacked on the updates to this opus, but that is not for a complete lack of work.

I did a multitude of things such as getting my AWS Red Hat instance to be able to run through lab46, writing an attendance script, and learning to use some programs within lab46 that made my life much easier to be able to code, such as finally switchingn out of nano into vi as my main text editor (i am now interested in emacs), and using tmux to allow myself to have multiple panes open within the same screen.

The attendance script

this was necessary as I felt like i didn't do anything that would constitute as a project otherwise, but it is a great exaple of the guts of writing a script that i needed to learn, such as defining variables and running loops within the BASH syntax. It's not as complete as i would like, but it's a start.

Code format ="bash"

YEAR=`date +%Y`
MONTH=`date +%m | sed 's/^0//'`
CURMONTH=`date +%m | sed 's/^0//'`
CLASSLOGIN - '09:00'
CLASSEND - '10:15'
INTIME =`last|cut 50-55`
OUTIME=`last|cut 58-63`

#december of the of the current year is actually the first month of the next year, november is coded as the 12th month and all previous months are offbyon    e

#data structs 9-10:15 wed thurs fri
#cprog 12:25-1:50 wed fri
#clab 3-4:50 thurs
#unix 3-5:20 wed fri

#To do:
#classlogin as var and classend as vars
#place login time in var (intime)
#place logout time in var (outtime)
#if the intime is less than classend (on before class is over)              }\
                                                                              # Do something that recognizes a successful login
#if the outtime is after(greater than) class begins (off after class starts)}/


#for MONTH in `last -f /var/log/wtmp.${YEAR}${MONTH}`; do
for((i=0;i<5; i++)); do
        if [ $i -eq 0 ]; then
                last -i| grep $1 | grep '10.80'> userlogin
                MONTH=`echo $MONTH | sed 's/^0//'`
                MONTH=$(($MONTH+1))
        else
                if [ $MONTH -lt 10 ]; then
                        MONTH="0$MONTH"
                fi
                last -i -f /var/log/wtmp.${YEAR}${MONTH} | grep $1 | grep '10.80' > userlogin
        fi
        MONTH=`echo $MONTH | sed 's/^0//'`
        MONTH=$(($MONTH-1))
        cat userlogin | grep Wed
                # grep login time, cross reference with class times for each day.
        cat userlogin | grep Thu
        cat userlogin | grep Fri
done

code

The AWS instance

This instance was kind of usefull, I had been able to get some things done in a RED Hat Certification book such as creating a new user, but the book was frustrating as it jumped around and wasn't consise and to the point as to what it was going to teach you.

I had initially thought that i needed to do a recursive ssh in order to access the instance from the Wedb services, but it turned out that i just needed to copy the permission access file that held my private key within it. I also figured out what a pem file was:

  • “.pem Defined in RFC's 1421 through 1424, this is a container format that may include just the public certificate (such as with Apache installs, and CA certificate files /etc/ssl/certs), or may include an entire certificate chain including public key, private key, and root certificates. The name is from Privacy Enhanced Email, a failed method for secure email but the container format it used lives on.”

from the definition i think there is a more direct means of accessing the instance without using this file, but seeing how i already had the file built, i figured I should just try and use it.

I ended up using an scp command to lab46 to send the file to my user ssh. The problem i then ran into was that the permissions needed to be set to read only to send the file, and then set back to be able to use the file to open the instance from lab46.

with that resolved i could now access my instance from any outside computer by first ssh into lab46 and then running the instance through the .pem file.

nano to vi

so, I was very reluctanct in previous semesters to use another text editor besides nano, because i just didn't see the benefits. but then i took data structs. data structs kicked my ass and i needed a viable means to be able to quickly manipulate my code without losing my train of thought as to what i was doing.

at first there were a barrage of questions on basic commands, but then they all ended up being very fluid at the end and i honestly don't know how i ever dealt without it before.

tmux

I had seen other people in courses using multiple paned programs, and i just always thought that it was cool, and i started using multiple terminals and getting a slew of .swp files because of that, then i started using tmux.

I love tmux. it is the shit, without having a equally 4 paned window i would have just become painfully frustrated with coding the EoCE in data structs. I had both class headers open in 2 panes, the src folder in another, and the current function i was building in a seperate pane so i could see where all my scope was at once.

it's just another one of those things that i didn't see the beauty of until i had a need for it, and when i did, oh was it beautiful. the intuitive control system was much like vi's command and insert modes. it uses CTRL_B to enter command mode and then the appropriate character to use the command. mainly i used it for multiple panes, which are the '“' and '%' but as i delved deeper in single cases i was copying between panes using the number of lines. it all sounds like really simple stuff, and it is, but there is a reason its there, and i am glad it was.

both the use of vi and tmux makes me wonder about a bit bulkier program that may save even more time in moving and manipulating code between files/panes.(emacs? i'm open to suggestion)

opus/fall2013/ahughe12/journal.txt · Last modified: 2013/12/14 08:11 by ahughe12