MY NAME's spring2016 Opus
OPTIONAL SUBTITLE
My name is Jessica, and I am addicted to computer science, web design, and photography. #proudtobeanerd
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:
Worked on new project…SHOW AND TELL. I changed some aspects of my project because I was having issues with the other. If I have extra time at the end of the semester, I'll ask for help to do what I originally wanted to do. As for now, I am still doing a general version of what I originally - ORIGINALLY wanted to do. Instead of having multiple food choices, I changed it so that the user only has one choice and that is to build their own personal pizza. After the user selects what they want on their pizza, it will go to another page displaying a picture of what their pizza will look like when it is done being made. I will have to resize some of the topping images I saved and place them on top of the first image I have, but I'm working on it.
Worked on new project…SHOW AND TELL. Still working on getting this to where I want it for the showing and telling part. I tried to do more research on how to get the onclick event I want for the drop down list and to get it working, but didn't quite figure it out. Will most likely end up asking for help on Monday because I'm pretty sure I'm stuck now.
Worked on new project…SHOW AND TELL. Still working on getting this to where I want it for the showing and telling part. I originally had an html file accessing a php file, but I decided to change it so that it is just going to be the html file with php code written within it. I decided I wanted the drop down list with food choices to be an onclick event type of thing where the user clicks on one choice and an image shows up according to their choice. The page will also load a list of choices to go onto the food they want. So say they want pizza. There will be a list with things such as cheese, pepperoni, mushrooms, onions, olives, etc. (Hopefully there will be anyway. This was my goal kinda from the start..to be able to see the food you're building to be ordered.)
Worked on new project…SHOW AND TELL. Still working on getting this to where I want it for the showing and telling part. I saved more images I'd like to use, but I'm trying to get at least one food choice to order. Something is better than nothing with a ton of images just sitting in my folder. My program works, but I decided to change some aspects of it. I changed some of the choices and may do so again, due to image availability.
Worked on new project…SHOW AND TELL. Still working on getting this to where I want it for the showing and telling part. I did save the images I want to use to my php folder, so I can access them.
Spring Break!
1. Created a file called monte.php so we can do our own pi (3.14….) approximation with this code.
1. Got to add text to a shape! 2. Got to add text with a cool font to a shape!
1. Worked on Monte Carlo project!!
1. Talking about PIE (not the food – Polymorphism, Inheritance, Encapsulation)
Polymorphism: late binding virtual functions function overriding Inheritance: IS A Encapsulation: HAS A
PIE is actually in the order EIP.
2. Talking about OOP (Object-oriented programming)
3. Four different types of programming:
function - LISP (nesting parentheses) procedural - solving the problem right there, step by step (how humans think) logical - Prolog, Haskell OOP - moving things to align them but from a 30,000ft view
1. Let's celebrate Pi Day with a corresponding PHP file that generates the number pi! 2. First project! Create the monte carlo pi thingy. Dots inside and outside of the circle, randomized. Submit: submit php mcv0 monte.php URL
1. Taking an image, putting it on a web page, and then manipulating the image.
1. Using mySQL to access a database!
1.1: I'm mind blown by this honestly. I understand it for the most part, but it's mesmerizing.
1. Drawing shapes using php and html!
1. Creating an html document, then using a form with PHP!
1. Reading from an XML file using PHP! :)
2. Reading the info from XML file into a table using PHP!
3. Adding colors to a table (fluctuating between two different colors)!
1. Reading from a file using PHP! :)
1. Functions! Math ex: y = f(x) y = sqrt(25)
Function definition function name(parameters) { $sum = # + # + # + #; $avg = $sum / 4; } Function call $val = average(#, #, #, #);
2. Moving a file into a different folder. (oops) mv nameoffile public_html/php cd public_html/php
1. Key-Based Arrays! $atarigames = array(
2601 => "Combat", 2602 => "Circus Atari", 2605 => "Star Raiders", 2611 => "Adventure", 2655 => "Asteroids"
);
foreach($atarigames as $game) {
echo "<p>game is: $game<br />";
}
2. String key to float value! $produce = array(
"pear" => 2.19, "apple" => 1.90, "kiwi" => 1.02, "onion" => 3.11, "pepper" => 4.44
);
foreach($produce as $item ⇒ $price) {
echo "$item costs: \$$price<br />";
}
1. For loops and While loops are condition-based and top-driven loops.
Top-driven loops can loop 0 or more times.
2. Do-while loops are condition-based and bottom-driven loops.
Bottom-driven loops can loop 1 or more times.
3. ARRAYS!
scalar variable - single composite variable - container Ex. $nums[0] $nums[2] = 26;
4. FOREACH loops (are list-based)!
Ex. foreach($nums as $i) For each number in $nums, pull one out, and do this stuff: statement; statement; There is another side to the foreach loop. (O.o)
1. Loop – repeat/repetition – iteration
Numeric for() loop List-based for() loop While() loop Do while() loop Top and bottom driven loops...condition-based. Syntax for a for() loop: for(start condition; loop condition; progression) { statement; } for($i = 0; $i < 10; $i++) { statement; }
interpreted execution = live…line by line compiled execution = if there are syntax errors, it will not run
BORDER COLORS!
style=\"border: 2px solid black dashed green dotted #ff00ff
1. IF statements. You must have at the least/most 1 IF, but you can have 0 or more ELSEIF's.
if(condition) {
statement;
} elseif {
statement;
} else {
statement;
}
Relational Operators!
2. Must use echo when using HTML code in PHP.
Ex.
echo "<div style=\"color: rgb($size, $size, $size);\">"; echo "<p>Some text to see what happens."; echo "</div>";
3. PHP is mind-boggling. I love it.