reading-notes

Reading Notes

View the Project on GitHub simon-panek/reading-notes

Code 201: Class 01 - Pre-class Reading Notes


Read: 01 - Learning Markdown

Mastering Markdown on GitHub

To quote a line of text use >.


To quote a block of text or code, use ``` "fences" before and after.

To create a task list use the following


- [ ] Item (Incomplete)
- [x] Item (Complete)

To create a chart: Letter|1|2| —|—|— A|A1|A2 B|B2|B3

Chart code


Letter|1|2|
---|---|---
A|A1|A2
B|B2|B3

GitHub supports emoji :+1:! Here is an emoji cheat sheet.


Read: 02 - The Coder’s Computer

Choosing a text editor

A text editor is a piece of software located on your local machine or operated in a broser that allows the user to write and manage text.

Four primary features that make for a good text editor

Emmet is a shorthand language that is built into some text editors that allow the user to code in HTML and CSS much more quickly.

Preinstalled Text Editors (Typically very bare bones.)

3rd Party Tex Editors (Most provide some or all of the desirable features.)

IDE = Integrated Development Environment *a suite of software including text editor, file manager, compiler, and debugger

The Command Line

Basic Navigation

About Files

Commands and their function:


Read: 03 - Git Intro

Version Control system that records changes and allows easy access to previous versions

Git a DVCS that saves system of snapshots of your project

Getting Git help in Terminal


git help *command*
git *command* --help
man git-*command*

Cloning a repository Git will automatically give the name “origin” to the server and the name “master” to your local branch $ git clone (url)

List of terminal commands

Remote repositories versions of a project stored online or on network. Teams can push info to and pull info from remote repositories


Read: 04 HTML & CSS Textbook Chapter 18

Process and Design

Visual Hierarchy most users do not read entire web pages. Using contrast can help focus a users attention.

Grouping and Similarity visually grouping items of related content through similar element styles

Navigation a good design allows users to better find and understand your content

Read: 04 HTML & CSS Textbook Chapter 1

Structure

HTML (Hypertext Markup Language) describes the structure of a webpage

HTML Elements *usually made up of two tags inside angle brackets <example></example>

Attributes provide more information and instruciton in a tag, consist of two parts: name and value seperated by “=”

List of Tags

View Source in browser allows you to see the code for the current page, this can be useful in figuring out how to achieve certain structures

Read: 04 HTML & CSS Textbook Chapter 17

HTML 5 Layout

HTML 5 introduced new tags that are more specific for the structure of the page

Common Structural Tags

Older browsers may need to be updated or have extra JavaScript added to function properly.

## Read: 04 HTML & CSS Textbook Chapter 8

Extra Markup

Doctypes tells the browser what kind of HTML it is using

Comments in HTML <!--Comment--> allows coder to place notes in the code ignored by the computer

ID Attribute *every html element can have an id attribute used to individually name it.

Class Attribute *allows multiple elements to be given the same label

Block Elements will always appear to start on a new line


- <h1>
- <p>
- <ul>
- <li>

Inline Elements always appear to continue on the same line as their neighboring elements


- <a>
- <b>
- <em>
- <img>

Span acts like an inline equivalent of the <div> tag.

IFrames short for inline frame, holds a seperate window within your window

Meta provides information about your page

Escape characters allow the coder to add characters to the page that would otherwise be operands in html


Read: 5 Chapter 10

CSS (Cascading Style Sheets) alows developer to set rules to specify how content and layout should appear

CSS Rule governs how content of specified elements should be displayed

External CSS Allows a single seperate file to contain all of the style information for a multipage website

Internal CSS *can use CSS in html page by placing them within a <style> element, usually inside a <head> element


<head>
    <title>Using Internal CSS</title>
    <style type="text/css">
        body {
                font-family: arial;
                background-color: rgb(185,179,175);}
    </style>
</head>

CSS Selectors

Selector | Meaning | Example — | — | — Universal Selector | applies to all elements in doc | *{} Type Selector | matches element names | h1, h2, h3 {} Class Selector | matches element whose class attribute has value specified after the . | .example {} ID Selector | matches element whose id attribute has value specified after the # | #example {} Child Selector | matches the element that is a direct child of another | li>a {} Descendant Selector | matches element that is a descendant of another specified element | ` p a {} Adjacent Sibling Selector | matches and element that is the next sibling of another | h1+p {} General Sibling Selector | matches element that is a sibling of another, does not have to be directly preceding element | h1~p {}`

Cascading Rules

Inheritance style properties that are inheritable can be given to all children of an element by default

Online tools that allow developer to test CSS appearance in multiple virtual browsers and or OS

CSS Bug Fixes and Tools

Read: 5 Chapter 11

Color the color: property allows you to specify text color in an element

CSS Comments developer notes that will not effect the code

Background Color background color is set to transparent by default, most browsers show white, but not always


body {
    background_color: rgb(200,200,200):}

Online Color Picking Tool Color Scheme Designer

Opacity allows developer to set the opacity of an element and its children, values from 0.0 to 1.0

HSL Colors defines a color in three terms: hue, saturation, and lightness


Read: JavaScript and jQuery Pages 43-69

HTML, CSS, and JavaScript the three languages of a website

JavaScript plain text language so it does not require any additional tools to start

Link to Do Along project pages 46-49

Objects and Methods

document.write('Good afternoon!');

JavaScript runs where it is found in the html, location maters.

Chrome Developer Tools Shortcuts

Script set of step by step instrucitons that a computer can follow, each should end with a ;

Variables

Data Types

Numeric Data Types String Data Types Boolean Data Types
Example = 0.75 Example = 'Hi, Ivy!' Example = true
For tasks involving counting or sums Enclosed in a pair of single or double quotes used for working with text True / False

Strings must always be surrounded by quotes either "string" or 'string' but not a combination. It must also be on one line.

6 Rules for naming variables

  1. must begin with a letter, dollar sign $, or underscore _
  2. no dashes -, or dots . are allowed in a name
  3. no keywords or reserved words are allowed
  4. names are case sensitive
  5. create a name that represents the information it stores
  6. use camelCase for names with more than one word

How do computers work? Video Notes

Computers take in information, stores info, processes it, and outputs calculation resutls.

Data and Binary

Circuits and Logic

Memory, CPU, Input, and Output

Hardware and Software


Read: JavaScipt and JQuery Text pg 1-24

JavaScript used in browsers to make websits more interactive

Script a seriese of instructions a computer can follow to achieve a goal

Vocabulary words that computers understand

Syntax how teh words are put together to create instructions that computers can follow

Computers solve problems proramattically, following a series of instrucitons, one step after another

Read: JavaScipt and JQuery Text pg 74-79

Expressions evelauate into a singlge value

Operators allow programmers to create a single value from one or more values

Arithmetic Operators JS contians the standard operators +, -, /, * which can be used with numbers as well as the following special operators

String Operator just one operator + used to join strings on either side

Mixing numbers and strings

Read: JavaScipt and JQuery Text pg 88-94

Functions allow programmer to group a series of statements together to perform a specific task

Declaring a Function give it a name and then write its statements needed to achieve its taks inside the curly braces


function sayHello() {
    document.write('Hello!');
}

Calling a Function can execute all of the statements between a functions curly braces with just one line of code in the location that programmer desires

Declaring functions that need information give a function information by providing parameters


function getArea(width,height) {
    return width * height;
}

Calling a Function that nees information specify the values it should use in the () following the name, these values are called arguments


wallWidth = 3;
wallHeight = 5;
getArea(wallWidth,wallHeight);

Getting a single value out of a function “returning a result”


function calculateArea(width, height) {
    var area = width * height;
    return area;
}
var wallOne = calculateArea(3,5);
var wallTwo = calculateArea(8,5);

Note: when the interpreter hits the return command it goes back to the statemnt that called it, subsiqent statements in the function would not be processed


Read: JavaScript and JQuery Text pg 150 - 151

Comparison operators can compare one value in the script to its expected value and result boolean

Read: JavaScript and JQuery Text pg 156 - 157

Logical Operators

Short Circuit Evaluation logical evaluations evaluate from left to right and will stop as soon as they are satisfied of the result

Read: JavaScript and JQuery Text pg 156 - 157

Loops check a condition, if it returns true a code block will run then will check again, if still true, code block will run again, until no longer true


for (var i = 0; i < 10; i++) {
    document.write(i);
}

The preceeding loop will write 0123456789 to the page.

Loop Counter

Read: JavaScript and JQuery Text pg 176

While Loop will continue as long as the condition in the () is true


var i = 1; //set counter to 1
var msg = ' '; // message

//store 5 times table in a variable
while (i < 10) {
    msg += i + ' x 5 = ' + (i * 5) + '<br />;
    i++;
}

document.getElementByID('answer').innerHTML = msg;

Loop returns the following:


1 x 5 = 5
2 x 5 = 10
3 x 5 = 15
4 x 5 = 20
5 x 5 = 25
6 x 5 = 30
7 x 5 = 35
8 x 5 = 40
9 x 5 = 45


Return to reading-notes Deployed Site

Return to reading-notes Mark Down