Posts

Code

Here's my entire code for the website I built. Resources:    Javascript the definitive guide :  https://www.amazon.com/JavaScript-Definitive-Guide-Activate-Guides/dp/0596805527 W3SCHOOL:  https://www.w3schools.com/ Stack Overflow:  https://stackoverflow.com/ YouTube:  https://www.youtube.com/ This code is before 10/3/2019 7:44PM <!doctype html> <html> <head> <link href="main.css" rel="stylesheet" type="text/css"/> <title>D a v i d  Y a s u d a </title> </head> <body id="e2"> <style> #e2 { overflow:visible;   font-family: "Lato", sans-serif; } .sidenav {   height: 100%;   width: 0;   position: fixed;   z-index: 1;   top: 0;   left: 0;   background-color: #111;   overflow-x: hidden;   transition: 0.5s;   padding-top: 60px; } .sidenav a {   padding: 8px 8px 8px 32px; ...

Acknowledgement

Image
I'll like to thank my family for giving me the opportunity to buy a domain and server host. I'll also thank a fellow senior computer scientist major for helping me organize my code and to help improve the website.

Data structures and algorithms

Image
Stacks Stack.push:  The stack.push places the data on the top and the rest are queued. Stack.pop: The pop method removes the top data instead of the bottom. stack.peek: Displays the top data stack.length: Displays the # of data inside an array or object. Ex 1.) var letters = [];          [] === arrays where the data is going to be stored var word = "101" var rword = ""; // put letters of word into stack for (var i = 0; i < word.length; i++) {          This will push the letters in the string    letters.push(word[i]); } // pop off the stack in reverse order for (var i = 0; i < word.length; i++) {          This will pop the letters in the pushed output    rword += letters.pop();  } if (rword === word) {    console.log(word + " is a palindrome.");    This will determine if the word is a         ...

Vector Art

Image
Vector art is created using illustration software. Vector art is mathematical equations to create art cleanly, precisely and optimally. The computer remembers mathematical formulas for the lines and shapes you put and redraws them at any scale. Sorta like normal 3D graphics works. A vector is drawn as an arrow. The pointer indicates the direction and the magnitude of the length. // Example of Vector coding { var x = 100; var y = 100; var xspeed = 1; var yspeed = 3.3; var draw = function () {     background(255, 255, 255);     // Move the ball according to its speed.     x = x + xspeed;     y = y + yspeed;       // Check for bouncing.     if ((x > width) || (x < 0)) {         xspeed = xspeed * -1;     }     if ((y > height) || (y < 0)) {         yspeed = yspeed * -1;     }       noStroke(); ...

Animation button

Image
It's good practice to make a diagram about a set of code. From beginning to end. The ins and outs. It creates a visual aspect into coding. // animation code <style> #custom-button{ display:inline-block; color:white; background-color:#29425c; padding:10px; font-size:30px; border: 2px solid #29425c; border-radius:5px; margin:top:10px; cursor:pointer; box-shadow:2px 2px 5px black; transition: box-shadow ease-in-out 0.4s } #custom-button:hover{ box-shadow:0px 0px 0px black; }  </style> // HTML <section> <div class="colors">  <h8> Animation <br><br><br>  <a id="custom-button">   <h9>Hello World</h9>  </a> <h1 class="GG"> I created a simple 2D animation using <br> JavaScript and Cascating Style Sheet. <br> Hover over the button! </h1> </h8></div> ...

Calculator

Image
// custom function function calculateTip(){ // store data of inputs var billAmount = document.getElementById("billAmount").value; var serviceQuality = document.getElementById("seviceQuality").value; var numPeople = document.getElementById("totalPeople").value; // Quick Validation if(billAmount === "" || serviceQuality == 0){ alert("Please enter some values") return; } if(numPeople === "" || numPeople <= 1){ numPeople = 1; document.getElementById("each").style.display="none"; } else { document.getElementById("each").style.display="block"; } var total = (billAmount * serviceQuality) / numPeople; total = Math.round(total * 100) / 100; total = total.toFixed(2); document.getElementById("totalTip").style.display="block" document.getElementById("tip").innerHTML = total; } // script.js // hide the tip amount...