This is an old revision of the document!
On the first day of HPC, all we did was organize the tables we had in the room into a more “lair” like feel. We moved the tables into their own pods. That's basically all we did.
On the second day of HPC, we still didn't have the computers due to an error when ordering them. So, all we did was set up the monitors on all the pods.
On the third day of HPC, the computers finally came! We set everything up. The goal for that day was to have a fully functional lair. I believe we were able to successfully set every pod up except for one (which was set up the next day).
That's essentially all we have done so far.
We didn't really do much in HPC. I believe Dan and Brian set some stuff up (I can't remember what they did). Currently we are just looking for any possible bugs that is in the current pod system. For example, there was a problem with VIM where you could not backspace. Andrew Hoover found the solution to this problem, where setting backspace=2 solved it.
vim ~/.vimrc
Add in the line “set backspace=2”.
I believe for next class we will be working on cable management. We will try our best to organize the cables, as in their current state, it looks very messy and unorganized.
In HPC, we worked on organizing the cables for the pods. That's essentially all we did, although, we didn't really finish. I'm hoping to finish it up soon though.
I haven't really picked out what exactly I will be doing for HPC yet. I'm trying to think of something but nothing comes to mind. I have been looking into Android development, so I could do something with that. Who knows, I will continue to find something.
In the meantime, I will state what I have been doing in my free time in relation to computers. I recently purchased a solid state drive for my desktop. Originally I purchased a 120GB Samsung 850 Evo for $70, but I realized that it definitely wouldn't be enough space. So, I returned it and instead of going Samsung, I went with the Crucial MX200. 250GB for $90. I spent almost 2 hours researching different SSDs, and it came down between two of them. The Crutial MX200 and the Crucial BX100. I found that the main difference between the two drives is that the BX100 is mainly for consumers who have never really purchased an SSD before, it's more standard, or basic. The MX200 has more advanced features, such as a longer endurance, encryption, and much more. I researched some bench marking tests and both the drives seems to be very equal to one another in almost every aspect. In the end, I went with the MX200 because the price different was only $5, so it didn't really matter to be honest.
My original plan was to purchase a 500GB SSD to replace my current internal 1TB hard drive. I was then going to transport my 1 TB hard drive to my home server, which is currently very low on space. I decided against this because it would be a lot more efficient if I simply purchased a smaller capacity SSD (250GB) and then another hard drive for my home server (maybe 2 or 3GB; we'll see) later down the road.
Another project I thought about doing for HPC is playing around with virutalization. I have a home server and currently, the only thing it does is runs an Apache web server. I want to look into more cool things I can do with it. One of those things would be virtualization through command line. Sure, you could go the GUI way, but learning it through command line would probably be more effective. I could look into ways of creating virtual machines with ease and using them with ease. Stuff like that.
I have also been looking into Python. I see a lot of people writing Python scripts for their UNIX/Linux machines and I thought it would be nice if I could learn that, maybe do some neat stuff with that. We'll see.
We talked about what data structures is all about. Essentially, it is about writing code which is efficient and doesn't eat up resources. In previous programming courses, we are taught how to program, but not how to program effectively and efficiently.
We learned about something called a LinkedList. It is basically an array except each element is in a random location in memory (instead of being lined up, like in an array). Matt showed us an example of this using a struct called node. Node contained two variables, a signed short int called value and a struct node pointer called next. Basically, each instance of struct node is an element in a LinkedList. Each element of this struct node will then point to the next instance in the LinkedList.
Our first project for this course is to create a program which will simulate a LinkedList except using an array (for now). The purpose of this project is so that we can get a refresher of C and so that we can start leading into data structures.
Today I finished the first project for dsi0. Here is the code:
#include <stdio.h> int main() { // initialization of variables int loopMenu = 1; int numbers[21]; numbers[0] = -1; // loop through all indexes in array and set it to zero int j; for(j = 1; j <= 20; j++) { numbers[j] = 0; } int currentIndex = 0; // will loop the main menu until the user requests to exit do { printf("\nMenu Options\n"); printf("1 = build list\n"); printf("2 = display list\n"); printf("3 = insert into list\n"); printf("4 = append into list\n"); printf("5 = obtain from list\n"); printf("6 = clear list\n"); printf("7 = quit\n"); int option = 0; printf("\nEnter an option: "); // scans in option number scanf("%d", &option); // checks which option it is if(option == 1) { printf("\n"); // checks if the max amount of numbers has been built into array if(currentIndex == 20) { printf("You have reached the limit of 20 numbers.\n"); } else { int loopAppend = 1; // will loop until -1 is input or the limit is reached do { int input = 0; printf("Input a number to add to the list: "); scanf("%d", &input); // checks if they have reached the limit if(currentIndex == 20 && input != -1) { printf("You have reached the limit of 20 numbers.\n"); loopAppend = 0; numbers[20] = -1; } else { numbers[currentIndex] = input; printf("numbers[%d] = %d\n", currentIndex, input); if(input == -1) { loopAppend = 0; } else { currentIndex++; } } } while(loopAppend == 1); } } else if(option == 2) { // checks if the list has any numbers if(numbers[0] == -1) { printf("Your list has no numbers.\n"); } else { printf("List Contents:\n"); int i; // loops through all indexes; prints them for(i = 0; i < 21; i++) { int number = numbers[i]; if(number == -1) { break; } else { printf("numbers[%d] = %d\n", i, number); } } } } else if(option == 3) { int index = 0; printf("Enter index: "); scanf("%d", &index); if(index < 0 || index > currentIndex) { printf("The index must be between 0 and %d.\n", currentIndex); } else { int input = 0; printf("Enter the number you wish to insert: "); scanf("%d", &input); int i; // shifts the array for(i = currentIndex; i >= index; i--) { int numAt = numbers[i]; int newIndex = i + 1; if(newIndex == 20) { numbers[20] = -1; } else { numbers[newIndex] = numAt; } } currentIndex++; if(currentIndex > 20) { currentIndex = 20; } // sets the input in for the destination index numbers[index] = input; } } else if(option == 4) { int index = 0; printf("Insert index: "); scanf("%d", &index); if(index < -1 || index > (currentIndex - 1)) { printf("The index must be between -1 and %d.", currentIndex - 1); } else { index++; int input = 0; printf("Enter the number you wish to append: "); scanf("%d", &input); int i; // shifts the array elements over for(i = currentIndex; i >= index; i--) { int numAt = numbers[i]; int newIndex = i + 1; if(newIndex == 20) { numbers[20] = -1; } else { numbers[newIndex] = numAt; } } currentIndex++; if(currentIndex > 20) { currentIndex = 20; } // sets the input number in for the dest index numbers[index] = input; } } else if(option == 5) { int index = 0; printf("Insert index: "); scanf("%d", &index); // checks if the index is present in the list if(index < 0 || index >= currentIndex) { printf("The index must be between 0 and %d.", currentIndex - 1); } else { // prints what the number is in that index printf("numbers[%d] = %d\n", index, numbers[index]); int i; // removes the number at that index and shifts everything over for(i = index + 1; i <= currentIndex; i++) { int numAt = numbers[i]; int newIndex = i - 1; numbers[newIndex] = numAt; } currentIndex--; if(currentIndex < 0) { currentIndex = 0; numbers[0] = -1; } } } else if(option == 6) { // sets the first (zero-th) index to -1 numbers[0] = -1; currentIndex = 0; printf("The list has been cleared.\n"); } else if(option == 7) { // exits... loopMenu = 0; printf("Exitting...\n"); } else { printf("Incorrect menu option.\n"); } } while(loopMenu == 1); return 0; }
The project wasn't insanely difficult, but it did require some thinking, especially for the insert into and append features of the program. Everything else wasn't very hard but it did require some thinking to make it so that everything worked together.
In data structures, we have a new project. Unfortunately though, I'm not allowed to post anything in regards to it (any work I did for the project) because it shouldn't be a “temptation” to others who are currently not finished with the project.
Basically, it involved drawing pictures are writing pseudo-code. We had to draw pictures of nodes and pointers in a singly linked list. We had to follow the directions of how the list would be modified and show that on paper and in pseudo-code.
That is all we have really been doing in data structures so far.
We got a new project in data structures. This time, we aren't drawing a bunch of pictures! Instead, we applied those pictures to code. We began writing a node library for a singly-linked list.
The functions that we began to write was cp.c, mk.c, and rm.c
cp.c is for copying an existing node. mk.c is for creating a brand new node. rm.c is for removing a node and de-allocating it.
Creating a new node requires creating a new pointer of the Node structure. Allocate the memory, and assign the variable(s). Quite simple. For copying a Node, we had to create a new Node pointer (using the mknode function located in mk.c). With this new node pointer, we would copy the variables from the node input into the new node. For removing the node, we had to use the free function to mark that memory for de-allocation. Next, we set this currently existing node pointer to NULL, which breaks off any and all ties to the node.
After completion of the node library, we had to complete certain application which took advantage of the node library. These programs were the following:
This application will convert a currently existing array of chars to use the node system we just created. Using the nod e library, we will create a singly-linked list. This involved first off, creating a starting node, to indicate where the list would begin. From there, we had to create other nodes which would link off of the starting node, to the next node, to the next, etc… The elements of the list had to be the elements of the currently existing array.
This application would display the contents of a singly-linked list. The only argument is the starting node of the list. From there, it would continue to access the “after” node pointer until this node pointer is equal to NULL. This indicates the end of the list, there is nothing past this point.
This application does the same thing as the above application except the display portion is in it's own function.
That is essentially all the project was. Along with that, we got a “make” system, to help make the project more simple to work with. For example, to compile all currently existing code, we would simply go to the root of the project and type the command “make”. If we wanted to clean out all currently exiting compiled code, we would type the command “make clean” in the root of the project. This system also enables Matt Haas to push updates to the project, in case if something comes up where a file needs changing. It's a very handy tool and will definitely come in use later down the road whilst working on other projects.
In data structures, I completed another project. This project was sll0. This project involved a new struct known as List. This List struct contained two different Node pointers, one called first, and one called last. These pointers did exactly what you think they would do. The Node pointer first points to the first Node in the list and the pointer last points at the last Node in the list. This struct made creating a list very easy, and made managing the variables a lot more simple.
The sll0 project involved us creating some new functions.
This file contains one function. This function effectively displayed a list, from the start to the end. It involves getting the first Node in the list and looping through until the after Node pointer is NULL. With iteration, display the contents of that Node.
This file contains one function. This function would insert a Node into the list before the Node specified. So the arguments would be a List, a currently existing Node in the specified List, and the Node you wish to insert.
Before insert: start → NODE(A) → NULL
After insert: start → NODE(B) → NODE(A) → NULL
This file contains one function. This function will simply allocate memory for a new List.
This file contains two different functions.
This function will get the position of a Node from a List. The function takes in two arguments, a List and a Node. If the number returned is a negative number, then that means there was an error of some sort (the List may have been NULL, the Node may have been NULL, or the Node may have not been in the specified List).
This function returns a Node at a specific position. Personally, I think that this function should be renamed to “getnode” because setpos was a little confusing for myself to understand exactly what this function was doing. It will just return the Node at the specified location. If the Node returned is NULL, then that means there was an error (the list may have been NULL, the position provided was invalid, or the position was out of bounds).
All of these functions are meant to work together to make the applications that Matt wrote work properly.
I don't exactly remember what I did in data structures (more projects) so here's an essay I wrote for vegetarian experience.
The article which I chose was found on DailyMail.co.uk and is about when dozens of PETA supporters decided to protest against meat-eating on World Vegan Day. The way they protested is that they went to central London, stripped down and pouring fake blood on their bodies, and then laid there in the streets. They also has some signs there saying stuff about a vegan lifestyle. Many pictures of this event are seen in the article. To me, the people associated with this protest seem to be very into a vegan lifestyle and seem to care a lot about it, which is a good thing for them. It shows that they are willing to protest for something that they believe will better this planet and better other people’s lives. It is also a peaceful protest, which makes it even better. Nobody was hurt in doing this and it sent a message to anyone who would happen to see the protest take place. It was also in a very good and public location. This shows that they have the bravery to do something like this, stripping almost nude in public to convey a message is not something that is very easy to do. As for if I agree with this demonstration or not, I can’t really say. Myself personally, I would not do something like this. The reason I wouldn’t do something like this is because I think that people everywhere already know of vegetarianism, and that if they had the interest in becoming a vegetarian, they would research the benefits of it on the internet, similar to how I am taking this class on vegetarianism to learn more about it. Instead of lying in the streets nude covered in fake blood, they should do something else which is more informational, rather than “hysterical” in other people’s eyes. Something like handing out flyers or creating posters which show the many benefits of vegetarianism. To me, that would send a more clear message.
And here's another essay. This is an essay on Fuzzy Logic that I had to write for Discrete Structures.
Fuzzy Logic is a concept of logic where instead of having 0 be false and 1 be true, there is an in-between. Anyone who has programmed before knows that there are variables called “boolean” variables, which can only be true or false, where true usually represents a one and false represents a zero. With Fuzzy Logic, you can choose any real number between zero and one. For example, the weatherman says that it will be very sunny outside today. However, I look outside and there are some clouds in the sky. I could say that the weatherman’s statement was 75% true, or 25% false. Fuzzy Logic allows us to work more with boolean logic, rather than just two values, we have an infinite amount of values to work with. These values are called degrees of truth.
One example of Fuzzy Logic which is used very often is a shower controller. The temperature of the water coming from a shower will not be strictly cold or strictly hot. There are many in between states of temperature. So, the water could be slightly cold, or it could be slightly warm. It shows how there aren’t just two separate states of the temperature of water, there are many different states.
Another example of Fuzzy Logic being used is in a washing machine. Everytime you turn on the wash, the settings aren’t the same. The washing machine considers many different factors to decide how fast it spins and what temperature it should wash at. These factors could be how much clothes was put into the washing machine, or how dirty the water is with each cycle. The washing machine will operate at the most efficient and eco-friendly way as possible.
One of the most famous examples of Fuzzy Logic being used is the Sendai Subway located in Japan. This subway system uses Fuzzy Logic to determine how fast it should go. It takes into consideration different factors, such as the weight of the passengers, where the subway is at that time, stuff like that. The subway system uses this information to determine the optimal travel speed for smooth and eco-friendly travel for all travelers. This subway was also the first notable use of Fuzzy Logic in a real life scenario.
So essentially, with Fuzzy Logic, we can input certain factors and data into a computer. The computer will then analyze this information according to a set of predefined rules. For example, we could have a rule for how dirty water is, or a rule for what temperature is considered very hot or very cold. The information is checked against all of these rules, and depending on which rules the information checks out on, the operation of the machine the computer is controlling will be modified to some extend. For example, back to the washing machine. There could be some information inputted that the water is very dirty. There could also be a rule that if the water is very dirty, then have the washer do 50 more cycles, or up the amount of detergent being used.
One more example of Fuzzy Logic being applied in the real world is for heating ventilation and air conditioning units. These systems will use thermostats controlled with Fuzzy Logic to control the flow of hot or cold air. This will make the whole system much more efficient, which will result in energy being saved.
I did some work on the new project in data structures. So far, I have only gotten one of the functions done, but I plan on finishing it up tomorrow at some point. Hopefully I will actually complete all of it in a timely fashion.
I don't really have anything else to write about, so here's an essay I wrote on transcendental numbers.
Start
A transcendental number is a number which is real or complex. It is not algebraic. The best known transcendental numbers are pi and Euler's number (e). Even though we only know of a few transcendental numbers, they aren't that rare. Almost all real and complex numbers are transcendental. All transcendental are irrational.
I suppose the best way to prove that a transcendental number is by using a proof by contradiction. I watched a Numberphile video on transcendental numbers and the man in the video explains that an algebraic number will always have a formula. This formula can be used to find the said number. However, transcendental numbers do not have an algebraic formula. The examples shown above are e and Pi. Both these numbers are transcendental numbers because there is no algebraic formula to represent the numbers. In the video, it was explained that to see if a number is algebraic, you try to get it down to zero by adding, subtracting, multiplying, or putting it to a power. All additions must be whole numbers. So, for example, you can't add 1.5, or subtract 6.75. I suppose that to prove that a number is transcendental you would have to do something like that and show that it can't be done.
Current numbers which are shown to be transcendental are e and Pi, two very famous constants. It was proven that e is a transcendental number, and it was also proven that e to any power is a transcendental number. I'm not sure as to what the exact process is to finding out if a number is transcendental, whether is simply fails the game I listed above or if there are other conditions. I did find some interesting theorems on transcendental, however, I did not really understand them because I don't know a whole lot on the subject in the first place.
As for numbers which we aren't sure if they are transcendental, I tried searching for some but I couldn't find any. I think the main issue with transcendental is finding that number in the first place. After the number is found, then you try to see if it is transcendental or not.
End
I had to write this essay for discrete structures. The idea of these kind of numbers is very interesting. What I want to know is the exact methods of proving these kind of numbers. I couldn't really find a definite answer when looking online, so I can only assume that it is pretty complicated.
Many people embark on the journey of following a whole-food, plant-based diet with the sole intention of improving their heath and enhancing their quality of life. And while improved physical wellbeing is a worthy goal in-and-of itself and its benefits are indisputable, it is by no means the only benefit of eating “plant-strong.” We cannot reduce eating to nothing more than what we put in our bodies any more than we can reduce foods to nothing more than their chemical properties (a whole apple, for instance, is not simply an aggregate of fiber, calories, and vitamins). Whether intentional or not, following a whole-food, plant-based diet is about much more than simply what we do – or do not – eat, and it therefore impacts much more than simply our physical health.
Following a whole-food, plant-based diet is about having the courage to step outside of the mainstream, animal-eating culture, a culture that seeks to keep us intellectually anesthetized and comfortably numb. (For more information on the mentality of the animal-eating culture, which I refer to as carnism, see carnism.com). It is about reclaiming our health and redefining the very meaning and nature of eating and food. It is about being open to ideas that challenge the myths of the dominant culture in which we have all been indoctrinated – to critically examine longstanding “truths” that have been drummed into us by our parents, teachers, doctors, and society. It is about questioning the authorities we have learned to place our trust in and thus questioning our own relationship with authority and truth. It is about resisting the pressure to conform to a seductive yet destructive status quo and having the strength to hold onto our convictions in the face of deep-seated resistance to our lifestyle. (How often have you thrown up your hands in perplexed exasperation when, for instance, your dangerously overweight loved one, who’s undergone triple bypass surgery, calls you crazy for suggesting they reduce their meat consumption? How often have you felt alienated at meals where otherwise conscientious, rational people cannot seem to remember or figure out how to prepare a plant-based meal so that you don’t have to starve?) Following a whole-food, plant-based diet is about saying yes to health, life, and truth – and therefore saying no to the beliefs and behaviors of the dominant, animal-eating culture.
The above were some interesting essays I read on vegetarianism during my vegetarianism online course. The course kind of sucked but it was informative to say the least. I hope you enjoyed reading my latest Opus entry.