\documentclass[twoside]{article}
\title{Notes}
\author{CSC222 Geographic Information Systems}
\date{04 November 2014}
\begin{document}
\maketitle

\begin{enumerate}
  \item equivalence of programs: same inputs $\rightarrow$ same outputs
  \item equivalence of computers: if a program can be run on computer A,
    an equivalent program can be run on computer B
  \item if all computers are equivalent, why bother designing new computers?
  \begin{enumerate}
    \item faster
    \item more compact
    \item use less power
    \item more reliable
    \item easier to use
    \end{enumerate}
  \item if all programming languages are equivalent, why bother inventing new languages?
  \begin{enumerate}
    \item allow programmers to express themselves more concisely
    \item allow programmers to express themselves more clearly
    \item give programmers better ways to divide task into parts, to collaborate,
      to organize parts, to detect/correct errors, to describe their designs to
      other programmers, to modify and build upon previous work (reuse code)
    \item make it easier for people to write programs more quickly and with fewer errors
    \end{enumerate}
  \item largest computer programs are among the most complex objects that human beings
    have ever designed and built
  \item data types
  \begin{enumerate}
    \item integer
    \item floating point
    \item character/string
    \item boolean
    \end{enumerate}
  \item operators
  \begin{enumerate}
    \item arithmetic---$+ \;\; - \;\; \times \;\; /$
    \item relational---$< \;\; \leq \;\; = \;\; \neq \;\; \geq \;\; >$
    \item logical---\textbf{AND}, \textbf{OR}, \textbf{NOT}, \textbf{XOR}
    \end{enumerate}
  \item shapefiles
  \begin{enumerate}
    \item vector data 
    \item attribute values
    \item no topological information
    \item not a single file---several files
    \begin{enumerate}
      \item *.shp---vector data
      \item *.shx---association of geometric data with attributes
      \item *.dbf---database table 
      \item *.prj---information about projection
      \end{enumerate}
    \end{enumerate}
  \item object-oriented programming
  \begin{enumerate}
    \item class---a blueprint for the construction of objects
    \item object---a bundle of related data and methods for 
      retrieving, updating, and combining data
    \item inheritance---a derived class (subclass) has all methods and attributes
      of a parent class (superclass)
    \item polymorphism---behavior of object depends upon the class
      to which it belongs
    \begin{enumerate}
      \item suppose that we have an Employee class with
        SalariedEmployee and HourlyEmployee subclasses
      \item all kinds of employees have a method for computing pay
      \item pay is computed differently for hourly and salaried 
        employees
      \item given a collection of employees, system automatically
        uses correct formula to compute pay of each
      \end{enumerate}
    \item references---one object can point to another 
    \end{enumerate}
  \item database---peristent data
  \item relational database
  \begin{enumerate}
    \item data stored in tables
    \begin{enumerate}
      \item each row contains a record---information about a single thing
      \item each column contains values of a single attribute
      \item each record includes a unique identifier---a primary key
      \end{enumerate}
    \item database may contain several or many tables
    \item tables can be linked---a record in one table can contain
      the key of a record in another table
    \end{enumerate}
  \item design of databases
  \begin{enumerate}
    \item common sense, formal methods and notations, plus experience
    \item identify relationships among ``entities''
    \begin{enumerate}
      \item one-to-one
      \item one-to-many
      \item many-to-many
      \end{enumerate}
    \item normalization
    \begin{enumerate}
      \item eliminate redundancy
      \item reduce opportunities for introducing inconsistencies
      \item trade-off with performance
      \end{enumerate}
    \end{enumerate}
  \item SQL---Structured Query Language
  \begin{enumerate}
    \item pronounce the letters (``S'', ``Q'', ``L'') or say ``sequel''
    \item common to many vendors, many database management systems
    \item many dialects
    \item a declarative language---describe properties of result, not
      how to produce result
    \item commands include: SELECT, INSERT, DELETE, UPDATE
    \item SELECT \emph{attributes} FROM \emph{table} WHERE \emph{attributes have specified values}
    \end{enumerate}
  \item XML--eXtensible Markup Language
  \begin{enumerate}
    \item tags enclosed in angle brackets \\ 
      \verb+<  >+
    \item values between start tag and end tag \\ 
      \verb+<name> Isaac Asimov </name>+
    \item attributes in tags \\
      \verb+<a href="http://www.slowgerman.com"/>German lessons</a>+
    \item document with the structure of a tree---nested tags
    \item schemas describe permitted order and nesting of tags and attributes allowed within tags
    \item used to exchange data
    \item used to store data
    \item used to describe the configuration of programs
    \end{enumerate}
  \item JSON---JavaScript Object Notation
  \begin{enumerate}
    \item ``dictionary''
    \item key--value pairs
    \item value can be another dictionary (another list of key--value pairs)
    \end{enumerate}
  \item big data
  \begin{enumerate}
    \item volume, variety, velocity
    \item NoSQL databases
    \item map-reduce---distribute parts of database among many machines, query in parallel,
      collect partial results to process and format 
    \end{enumerate}
  \end{enumerate}

\end{document}
