Tuesday, November 27, 2018

Week 14: CST 205

This week, we learned about debugging techniques. There are multiple ways to do this such as glass-box, black-box, testing edge conditions, and incremental testing. In glass-box testing, every path through a program is tested as opposed to black-box testing where a range of inputs are tested. In edge conditions, the largest+1 and smallest-1 values are tested. In incremental testing, the code is tested as it is written so errors are found and dealt with as soon as they appear. When debugging with JES or other IDEs,  the debugger can be used to watch variables behavior. The error messages given and printing outputs will help as well.

In software engineering, there are two ways to engineer: top-down (eg waterfall) or bottom up. In top-down design, a list of requirements are made which describe how it should work and what tasks it needs to do. Then the hierarchical design is used to describe the functions that are needed and those are broken down into the helper functions it requires. In bottom-up design, the smallest functions are made before the larger functions.

In debugging, there are 3 types of common errors. Syntax errors are when there is a problem with the structure of the program like a missing colon. Syntax errors are indicated by "SyntaxError:".In order to avoid these, make sure not to use reserved Python keywords, have a colon after headers and loops, use straight quotes, closed multiline strings, closed operators, correct assignments in conditionals, correct indentation, and non-ASCII characters in the code. Runtime errors are made when the program is running which will describe where the error is and that was executing when it happened like an infinite recursion error. A semantic error is where there is a problem with a program that runs without producing errors but doesn't give the correct result.

Tuesday, November 20, 2018

Week 13: CST 205

This week, we started the sound modules.  The sounds we worked with were .wav files, which are not compressed. Sounds travel in compression waves that are created by changes in pressure. It is measured in rarefaction cycles and decibels (dB). The amplitude of the wave is the distance from 0 to the height in the y axis, a large amplitude will have a loud sound. When a full wave occurs, it is the frequency which is related to the pitch. When the frequency increases, the pitch increases.

We learned how to manipulate sound with Python. We increased the volume by getting the sample value of a sound at a specific sample then setting that sample to a larger value. This was done for all for the samples in the sound resulting in an increased volume. We then learned how to increase or decrease the volume in a given range for a sound by varying the lengths involved and varying the value.  We then learned how to combine sounds by making an empty sound and then copying the sounds into it with a for loop in the range of the entire sound clip.

In lab 8, we learned the basics of sound. We learned how to decrease the volume in a sound clip by divinding the value by half. We also learned how to change the volume of a sound by a factor by multiplying that value by a predefined factor variable. Next, we found the maximum number of samples by using the abs() function and setting the largest number it can find to max_value iteratively. Next, we set the samples to its max value using maxSample(sound).

In lab 10, we practiced strings and made a hangman game. In the warmup, we used the requestString(str) to ask for a name in a popup dialogue box. Later, a hangman class was made. This created allowed the computer to ask the user for letter guesses. If it was correct, it would evaluate the letter and add the letter to the word.

Tuesday, November 13, 2018

Week12 CST 205

This week, we made Team Improvement Plans. In my plan, I plan to do the following:

Complete assignments before the Tuesday deadline

Finish attempting group labs before group lab meeting
Either use pycharm to get more helpful errors or learn more about JES errors
Find when office hours are and go to the prof/TA for help before the group lab

Code review is reviewing others' code and having your code reviewed. In code review, code can be discussed in terms of tradeoffs and preference. Questions should be asked and not demands. Good questions are clarifying and not judgemental. Ownership of and namecalling of code should not be done. When you have your code reviewed, don't take things personally and know that the reviewer has your best intentions in mind. You should also respond to every comment. When reviewing code, you should tell which ideas you feel strongly about. You should also find ways to simplify the code and give alternatives.

In the "How to Get a Job at Google" article by Thomas L. Friedman, he mentioned that general cognitive ability or learning ability is very important at Google. Another important aspect to a candidate is leadership: knowing when to lead or to let someone else lead. Humility and ownership are also important in problem-solving because it tells when someone should help solve a problem or to let others fix it.

Wednesday, November 7, 2018

Week11: CST 205

In Lab 4, we learned how to modify pictures pixel by pixel. We started by making a vertical mirror of a picture. We then mirrored a picture horizontally from top-to-bottom and bottom-to-top. After, we made a quadruple mirror. I wanted to use the functions I already created but it wouldn't work out. Then we copied a picture from one file, making another file. After learning how to save to a file, I could have saved it to another file instead of just displaying the result. Next, we rotated a picture by making a blank picture and copying the pixels into it. Finally, we shrunk a picture by sampling every other pixel and copying it to a blank canvas.

             In Lab 5, we learned how to add blank space to images by adding pixels to the image. Then, we rewrote that function to become more reusable using a header. I rewrote my function to put pictures perfectly centered at the target x and y axis. In the end, we had a mini project where we inserted 8 pictures into one picture file and modified them with the functions we created earlier. For my project, I made it 5 x 7 or 1500 x 2100 pixels because it was too large when I examined it in explorer. The photo would update in my computer every time because it was saving it 8 times every time I ran the function. I could open the photo and it would update in real time. I wanted to import the other lab files but I wasn't able to make it work with "from Lab4 import *", I opted for copying the functions directly.


In Lab 6, we removed the red-eye from a picture. Our group exchanged all red with green in attempt to neutralize the red color. It worked but when I tried it on my own, I applied it to the entire picture. I could have applied the green fix to the eyes only and it would have been better. We created a sepia tint using the red and blue value multipliers after converting the picture to black and white. We also made an artify function which made color values in various ranges a single color for R/G/B. Finally, we created a picture using the Chroma-Key technique. It identified the already specified green values in the backdrop and applied the new background. 

cst 499 week 8

This week, we finished writing the paper in order to do the best job possible even if it was a little bit late. Now that everything is done,...