I hereby claim:
- I am sbaldwin24 on github.
- I am sbaldwin24 (https://keybase.io/sbaldwin24) on keybase.
- I have a public key ASDGrEO-83MV9d-_IaY17OOzDCQcybE5qgttAR4rXrdNBwo
To claim this, I am signing this object:
{ | |
"AF": "Afghanistan", | |
"AL": "Albania", | |
"DZ": "Algeria", | |
"AS": "American Samoa", | |
"AD": "Andorra", | |
"AO": "Angola", | |
"AI": "Anguilla", | |
"AQ": "Antarctica", | |
"AG": "Antigua and Barbuda", |
I hereby claim:
To claim this, I am signing this object:
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../topeka-elements/category-images.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icons/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<polymer-element name="my-element"> |
<link rel="import" href="../ace-element/ace-element.html"> | |
<link rel="import" href="../speech-mic/speech-mic.html"> | |
<link rel="import" href="../topeka-elements/category-icons.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |
""" | |
Boolean Operators | |
------------------------ True and True is True | |
True and False is False | |
False and True is False | |
False and False is False | |
True or True is True | |
True or False is True | |
False or True is True |
A model contains the state (i.e. the JSON data or what Backbone calls attributes) for an application, as well as a basic set of functionality (i.e. methods like .set() or .get() and events like change) for managing and listening to changes in the state/data.
Additionally, the model orchestrates the storing of this state/data in memory in the browser, as well as persisting the state/data to the database on the server (i.e. syncing).
An ordered grouping of models is a collection.
In Backbone, collections are wrapped with a basic set of functionality for working with groups of models. The classic illustration of a model would be the data for a to-do item (i.e. the to-do and its state of completion), and a list of to-dos would be considered a collection of to-do models.
When used inside of a function, the var statement defines the function's private variables. Statements tend to be executed in order from top to bottom. The sequence of execution can alttered by Conditional, Looping, and Distruptive Statements.
if and switch
while, for, and do
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>User Profile Page</title> | |
<meta charset="utf-8"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery-1.8.0.min.js "></script> | |
<script> | |
window.onload = initPage; | |
function initPage() { |
This imperative version, while somewhat contrived, is emblematic of an imperative | |
programming style. That is, the implementation describes a “99 Bottles of Beer” pro‐ | |
gram and exactly a “99 Bottles of Beer” program. Because imperative code operates at | |
such a precise level of detail, they are often one-shot implementations or at best, difficult | |
to reuse. Further, imperative languages are often restricted to a level of detail that is good | |
for their compilers rather than for their programmers (Sokolowski 1991). | |
By comparison, a more functional approach to this same problem might look as follows: | |
function lyricSegment(n) { | |
return _.chain([]) | |
.push(n + " bottles of beer on the wall") |
Imperative programming | |
An imperative programming style is categorized by its exquisite (and often infuriating) | |
attention to the details of algorithm implementation. Further, imperative programs are | |
often built around the direct manipulation and inspection of program state. For exam‐ | |
ple, imagine that you’d like to write a program to build a lyric sheet for the song “99 | |
Bottles of Beer.” The most direct way to describe the requirements of this program are | |
as such: | |
• Start at 99 | |
• Sing the following for each number down to 1: | |
— X bottles of beer on the wall |