User Tools

Site Tools


blog:spring2016:lwenzel:start

Logan Wenzel's spring2016 Opus

Welcome to the Jungle baby

Introduction

Hello, my name is Logan Wenzel and I am a freshman at CCC. I have enjoyed computers for as long as I can remeber. In my free time I work as an aid at AIM Independent Living. I also spend my time as a volenteer firefighter as well as skiing whenever I am able.

C/C++ Programming Journal

January 21, 2016

I am excited for this semester. I know almost nothing about C/C++ but that give a lot of room for improvement. I only have prior knowledge of java and python. With C being less visually helpfully this should be an interesting experience. I am also taking unix as well this semester.

January 29, 2016

This week for C/C++ programming we were tasked with using a mental math technique to multiply numbers ending in 5 by themselves with use of logic. The trick of it all is taking a the numbers before the 5 and increment them by one then multiply it by its initial amount. 25^2 = 2|5 … 2*(2+1)|5*5 … =625. I used % 10 to split each decimal place. Then individually manipulated each digit to create a 6 and 25 (if used with the example only). Then lastly print them out next to each other to represent the number to the user. This project can be used for numbers larger than 95 if they end in 5(105^2 for example). This only works up to 155. Then after the numbers are incorrect most likely due to the use of unsigned chars restrict the amount of data that can be stored inside a variable. unsigned char is one bytes worth of data.

February 3, 2016

This week we began to dabble into the world of loops in C. Our project this week tasks us programmers with creating a program that will state the weekday that January 1 falls on for any given year. This requires to break down the number so that you are left with on the last two digits. Ex. 2050>50. There after we then manipulate the number. After the manipulation we can then check the number to see if it meets the conditions for certain days of the week. OH NO! How are we going to check and see if an argument is correct and then run certain code relating to that argument. Well no need to fear if else loops are here to help. Along with our first implementation of if loops this week we also had to use different data types. Ones with floating points (decimal place) and ones without. We had to do this because the mental math technique required us to be able to drop the decimal place of our numbers.

February 11, 2016

This week we were presented the task of more mental math algorithms to implement into our code. We were asked to take any number 0 - 999 and be able to times it by 11. The trick is to split the numbers on the ends and then add the ones in the middle. With some examples we found that they had carries of number for examples the tens place could be larger than 10. The program would need to check for these things and also without the use of any loops. So bring on the if statements to check for the overflow. This sounds easy in theory but later when there are 4 different instances of how overflow could effect the results. No overflow/ just the first instance/ just the second instance/ or both instances. All of these produce different results. A problem that I eventually faced was multiple fprintf statements printing out. I fixed this by creating a variable i=0 after every output statement in my program I would increment i by 1. When I would get to the last line if i==0 I would allow it to print.

March 1, 2016

This week we had the task of evaluating whether or not numbers were prime on a large range of numbers. This is used to show how useful loops can be. Loops are used to complete a set of instructions until a condition is met. The way most loops change their conditions is by incrementing or decrementing a variable. For prime numbers in a range we needed two different loops one to increase the range of numbers. Also another loop to increment the numbers that divide a number in a range. While doing that I would check the modulus of the two numbers and if they were to equal 0 the number would not be prime. Along with the use of the loops this project showed algorithmic complexity. That is to mean the amount of instructions that must be completed to solve a problem in a program. This does not sound that difficult to make a program fast until something needs to be repeated millions of times or even more.

March 9, 2016

This week we had the task of making an improved version of multiply by 11 mental math. The kind of math was the same as the previous project but this time we are able to use the wonderful loops. We were not limited to if statements now we are able to use loops that can do if statements very very quickly. This project was a challenge because we had to split number up into solitary digits and add them into an array. I accomplished this by using a while loop to divide by 10 each time until the final result equaled zero. While doing this i had a digit incrementing each time this would show me how many digits were in the number. This was very nice for when i created my ints so that I would use reasonable sizes. Not a big deal with my tiny program but with a larger program such as a program that could find the product of 11 and a number with 8+ digits it is very useful for not over doing it in regards to memory.

March 10, 2016

This week we took the plunge into graphics libraries used in C. We used the gd lib to make a circle made out of squares. We used only the rectangle shape used in the library. We were forbidden from using the circle function of the gd lib. We also had to find points on a circle on our own. This makes use have to use the good old math.h library.

April 4, 2016

This week we were tasked with creating our own hex viewers. This requires us to be able to read a file and then be able to then change the data from what we were reading while also keeping it in a nice a sorted format. All this while taking info line by line showing it in hex then ascii and then on to the next line. This is pretty easy to do until you factor in the fact that once end of file is read those processes need to stop as well. For this is created booleans that would only be set when the end of file had been met.

April 11, 2016

This week we took a crack at more mental math tricks and implementing them. The math trick we used this week was all from nine last from ten. This project wasn't difficult because of the fact that we had a new math problem to solve. Rather we took a swing at using functions to solve the problem we had. We also needed our program to then be able to solve the mental math problem with very large numbers. We used unsigned long ints to be able to obtain large numbers and do manipulations to them. Another problem I had with this project was my arrays having the wrong information some of the time at the end. With looking over the logic I suspected that is must of been the array itself causing the issue. I for specifically suspected that it may of had something to do with calling an array with a value stored in an variable. I used calloc and my issue was cleared up instantly. I used calloc so that if pieces of the array had been working wrong they would be easier to find since if I allocated an array larger than what was needed I would then see that the errors would be similar because all values are initialized as zero. That seemed to clear up the issue and then with a few more refinements I was then ready to turn the project in!

April 16, 2016

This week we had the task of creating a program that will figure out our grades. This project we had to take input from a file created by the flattenstatus command and then use numbers from the files as delimiters to check for what section of the information is being shown. The sections were split off from each other by negative numbers. The three sections of the file shows journals participation and lastly the grades given on projects. We will later have to take these numbers and do simple math to figure out our own grades1); was used to create the first part of the 2d array. I then allocated each grade array separately, with more arrays the use of loops would prove useful. Once that was complete I was able to then do the simple math that was need to figure out my grade.

May 5, 2016

This week I have been chipping away at the eoce. This week I have completed the data conversion and length conversion programs. These were done in similar ways to one another. These projects could both be done by finding a constant for each number and then create a ratio based on the two units that youre converting in between. These were both done using one of the smallest values in the list of units. Bits were used in the data program and inches in the length program. These could be done in terms of other numbers such as the larger units but with the smaller units the there are no decimals that are very small and the project asked for a percision of four decimal places so if I was to do a mile in inches it would take five digits to see the first decimal. I have also began the group management project this project takes a big emphasis on arrays and shifting data within an array while keeping the contents intact. As of right now I am very close to being done.

May 6, 2016

This week is sadly the last week of cprog/unix. This week I have done the last of the chipping away at eoce for both subjects. For UNIX I have all of the projects complete except for one is almost done. For cprog I have been avoiding the c++ sections but I have started the section of the eoce that is used for c++ but converting the other projects into the c++ variation. I have completed the group management is used to shift data in an array so that a user can create a list with the numbers the desire. The last thing I changed to make it complete was displaying an error that occurs when the user tries to add more than 20 elements to the array. This is done because the projects asks for a static array that can be changed but if it was meant to be dynamic then it would be able to be any length with no wasted data because the array would need to be closed and reopened with the actual values each time.

UNIX/Linux Fundamentals Journal

January 21, 2016

Since this class has been titled the best class ever I go in with higher expectations than what I usually would into a class. I am like most and know nothing about unix. Any time I would hear someone talk about unix/linux I would look at them as an outsider. I am excited to join this unknown world

January 28, 2016

This week in the best class ever we had a project that made us explore archives. The great thing about archives is the ability to compress files and thus be able to save space while keeping like files together. With the use of the unxz command and variations of the tar command I was able to decompress files with those extensions. This was shown by taking files from an archive. The project also had shown commands that show different ways to display text. Cat displays as is, rev flips it horizontally and tac flips the file and displays it up side down. Lastly I discover the power of the > symbol and its ability to save a manipulated file into a new file name. With all of these commands I was able to change the ascii scrambled horse into a majestic beast. Once complete I was able to save its four parts into a master file and then archive it with the scrambled pieces with the use of the tar or zip command.

March 9, 2016

This week in class we were tasked with making unix personalized to our needs. This was a nice project because afterwards we not only reap the benefit of new skills that we can utilize but also the pure joy of having unix be a little easier to use. The easiest things to change were vimrc and bashrc. With using vim for all of my coding and for using bash any time I am on putty these were nice changes to make. On vim I added a color scheme and syntax checking.

April 4, 2016

Hello there best class ever journal long time no write. During spring break we were tasked with UDR2 oh how fun. This is our first project where we must take all of the things we have done in class and implement them into a program. Our script has to take a large file of data related to a sleeping head band and then manipulate the data to show different stats about it. Such as how long the user had slept or how many packets are in the file. This is done with the use of not only using OS manipulation but also using programs given to use by Matt. These program are C programs that manipulate binary/hex data hence their name binhaxx. These files allow for things such as searching a file of data for instances of a hex pattern with the use of the program search. We are able to use these programs by adding them to our PATH in a bin file we made in our home directories. This project requires alot of time learning what the numbers mean in hex. Like a start of a new packet is A4 in ascii or 41 34 in hex. So we can then search '41 34' in hex and then see how many and where the packets are.

April 4, 2016

This week we took a crack at a chmod game created by Matt. Every two hours we were able to have 12 different chmod symbol codes appear in different formats to then convert to their octal representation. This ramps up the difficulty by adding a fourth tier other than user, world, and other. Things like SetUID, SetGID, and a Sticky Bit. These are viewed in their symbol form as s, s, and t. They can also be seen as their upper case counter parts. If they are in their upper case form that means that they will be worth no value to the user group or other section. If they are lowercase treat them as if they were an x. rwsrwsrwt = 7777 | rwSrwSrwT = 7666

1)
our grade/ total grade) * 100 = overall). But before we do that we must store all of the values somehow this project could have been solved by doing three different arrays but why bother when you can have one two dimensional array. This is where I struggled the most on this project. I treated the array as a pointer to three other arrays. int grades = (int ) calloc(3, sizeof (int*
blog/spring2016/lwenzel/start.txt · Last modified: 2016/01/18 16:05 by 127.0.0.1