CSc 337 - Web Programming > lectures/index.php > Source


<!DOCTYPE html>
<html>
<head>
<title>CSc 337 - Spring 2012</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../style.css"></link>
</head>

<body>

<img src="../uadcs.gif" alt="CS Department Header" />

<h3><a href="/cs337/">CSc 337 - Web Programming</a> &gt; Lectures</h3>

<span class="heading">Lecture Videos</span>

Lecture videos can be found one of two places:
<ol>
    <li><a href="http://itunes.arizona.edu/private/private.jsp">iTunes U</a>:
        log in as a student, then find Computer Science and CSc 337.</li>
    <li>Connect to <tt>lectura.cs.arizona.edu</tt> with your <b>CS username and
        password</b>, then navigate to
        <tt>/cs/coursevideos/spring12/cs337/videos</tt> to find the actual
        video files.</li>
</ol>

<?php

$topics 
= array(
    
'Introduction to Web Programming' => array(
        
'1/11/2012' => array(
            
'date'          => '1/11/2012',
            
'title'         => 'Course Overview',
            
'description'   => 'Syllabus review. How web software compares to traditional software.',
            
'links'         => array(
                array(
                    
'title' => 'The Other Road Ahead',
                    
'url' => 'http://www.paulgraham.com/road.html'
                
),
                array(
                    
'title' => 'It\'s Not Software',
                    
'url' => 'http://sites.google.com/site/steveyegge2/its-not-software'
                
)
            ),
        ),
        
'1/13/2012' => array(
            
'date'          => '1/13/2012',
            
'title'         => 'Introduction to HTTP',
            
'description'   => 'Explanation of the Hypertext Transfer Protocol.
                Difference between GET and POST.
                Interactive examples.'
,
            
'links'         => array(
                array(
                    
'title' => 'Hypertext Transfer Protocol',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol'
                
),
                array(
                    
'title' => 'Methods GET and POST - what\'s the difference?',
                    
'url'   => 'http://www.cs.tut.fi/~jkorpela/forms/methods.html'
                
),
            ),
            
'further'       => array(
                array(
                    
'title' => 'List of HTTP status codes',
                    
'url'   => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes'
                
),
                array(
                    
'title' => 'List of HTTP header fields',
                    
'url'   => 'http://en.wikipedia.org/wiki/List_of_HTTP_headers'
                
),
                array(
                    
'title' => 'HTTP Cats',
                    
'url'   => 'http://httpcats.herokuapp.com/'
                
)
            )
        ),
        
'1/18/2012' => array(
            
'date'          => '1/18/2012',
            
'title'         => 'Life of a Request',
            
'description'   => 'More details about HTTP.
                Basic web request handling.
                Setting up and using your class server account.'
,
            
'links'         => array(
                array(
                    
'title' => 'Basic access authentication',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Basic_access_authentication'
                
),
                array(
                    
'title' => 'In-class diagram: TCP',
                    
'url'   => 'uploads/tcp.png'
                
),
                array(
                    
'title' => 'In-class diagram: Request (Internet)',
                    
'url'   => 'uploads/request1.png'
                
),
                array(
                    
'title' => 'In-class diagram: Request (Server)',
                    
'url'   => 'uploads/request2.png'
                
),
                array(
                    
'title' => 'Account Creation',
                    
'url'   => 'http://qxlp.net/cs337/accounts/'
                
)
            )
        )
    ),
    
'HTML and CSS' => array(
        
'1/20/2012' => array(
            
'date'          => '1/20/2012',
            
'title'         => 'Intro to HTML',
            
'description'   => 'Introduction to HTML pages. What tags look
                like, what a simple document looks like, what HTML is and is
                not for.'
,
            
'links'         => array(
                array(
                    
'title' => 'Sitepoint HTML Reference',
                    
'url'   => 'http://reference.sitepoint.com/html'
                
),
                array(
                    
'title' => 'In-class example pages',
                    
'url'   => 'http://qxlp.net/cs337/examples/html/'
                
),
                array(
                    
'title' => 'HTML5 Validator',
                    
'url'   => 'http://html5.validator.nu/'
                
)
            )
        ),
        
'1/23/2012' => array(
            
'date'          => '1/23/2012',
            
'title'         => 'Intro to CSS',
            
'description'   => 'Intro to Cascading Style Sheets. What CSS is
                used for (as opposed to HTML), basic CSS syntax, selectors, a
                few properties.'
,
            
'links'         => array(
                array(
                    
'title' => 'Sitepoint CSS Reference',
                    
'url'   => 'http://reference.sitepoint.com/css'
                
),
                array(
                    
'title' => 'In-class example pages',
                    
'url'   => 'http://qxlp.net/cs337/examples/css/'
                
),
                array(
                    
'title' => 'W3C CSS Validation Service',
                    
'url'   => 'http://jigsaw.w3.org/css-validator/'
                
)
            )
        ),
        
'1/25/2012' => array(
            
'date'          => '1/25/2012',
            
'title'         => 'CSS Layouts',
            
'description'   => 'Float layouts, absolute/relative/fixed
                positioning, other various CSS features.'
        
),
        
'1/27/2012' => array(
            
'date'          => '1/27/2012',
            
'title'         => 'Forms',
            
'description'   => 'First steps towards interacting with your
                users. Basic form elements, validation via HTML5, general
                principles when using forms.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class example pages',
                    
'url'   => 'http://qxlp.net/cs337/examples/html'
                
),
                array(
                    
'title' => 'Form element reference',
                    
'notes' => 'sitepoint',
                    
'url'   => 'http://reference.sitepoint.com/html/elements-form'
                
),
                array(
                    
'title' => 'New form features: HTML5',
                    
'url'   => 'http://www.html5rocks.com/en/tutorials/forms/html5forms/'
                
),
                array(
                    
'title' => 'CSS for forms',
                    
'notes' => 'scroll to "FORM(s) and Function"',
                    
'url'   => 'http://www.alistapart.com/articles/practicalcss/'
                
)
            )
        )
    ),
    
'JavaScript' => array(
        
'1/30/2012' => array(
            
'date'          => '1/30/2012',
            
'title'         => 'Introduction to JavaScript',
            
'description'   => 'A quick overview of JavaScript as a language.
                Strings, objects, arrays, functions, dynamic typing, etc.'
,
            
'links'         => array(
                array(
                    
'title' => 'A re-introduction to JavaScript',
                    
'url'   => 'https://developer.mozilla.org/en/A_re-introduction_to_JavaScript#Custom_objects'
                
),
                array(
                    
'title' => 'MDN JavaScript Reference',
                    
'url'   => 'https://developer.mozilla.org/en/JavaScript'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'JavaScript: The World\'s Most Misunderstood Programming Language',
                    
'url'   => 'http://javascript.crockford.com/javascript.html'
                
),
                array(
                    
'title' => 'JavaScript: The Good Parts',
                    
'url'   => 'http://my.safaribooksonline.com/9780596517748/good_parts'
                
),
                array(
                    
'title' => 'JSLint',
                    
'notes' => 'code quality tool',
                    
'url'   => 'http://www.jslint.com'
                
)
            )
        ),
        
'2/1/2012' => array(
            
'date'          => '2/1/2012',
            
'title'         => 'Introduction to the DOM',
            
'description'   => 'The <tt>document</tt> object and some of the interfaces it provides.',
            
'links'         => array(
                array(
                    
'title' => 'Gecko DOM Reference',
                    
'url'   => 'https://developer.mozilla.org/en/Gecko_DOM_Reference/Introduction'
                
),
                array(
                    
'title' => 'DOM element (properties and methods)',
                    
'url'   => 'https://developer.mozilla.org/en/DOM/element'
                
),
                array(
                    
'title' => 'Event Attribute List',
                    
'url'   => 'http://reference.sitepoint.com/html/event-attributes'
                
)
            )
        ),
        
'2/3/2012' => array(
            
'date'          => '2/3/2012',
            
'title'         => 'More DOM',
            
'description'   => 'The <tt>window</tt> object and more DOM things.
                <tt>innerHTML</tt>, <tt>textContent</tt>, etc. Debugging JS.'
,
            
'links'         => array(
                array(
                    
'title' => 'window (MDN Reference)',
                    
'url'   => 'https://developer.mozilla.org/en/DOM/window'
                
),
                array(
                    
'title' => 'createElement (MDN)',
                    
'url'   => 'https://developer.mozilla.org/en/DOM/document.createElement',
                ),
                array(
                    
'title' => 'innerHTML (MDN)',
                    
'url'   => 'https://developer.mozilla.org/en/DOM/element.innerHTML'
                
),
                array(
                    
'title' => 'Firebug',
                    
'url'   => 'http://getfirebug.com/'
                
),
            ),
            
'further'       => array(
                array(
                    
'title' => 'Become a JavaScript Console Power-User',
                    
'url'   => 'http://www.youtube.com/watch?v=4mf_yNLlgic'
                
),
            )
        )
    ),
    
'PHP' => array(
        
'2/6/2012' => array(
            
'date'          => '2/6/2012',
            
'title'         => 'Introduction to PHP',
            
'description'   => 'How a server-side language like PHP fits into
                the web application stack. Code examples.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class examples',
                    
'url'   => 'http://qxlp.net/cs337/examples/php/'
                
)
            )
        ),
        
'2/8/2012' => array(
            
'date'          => '2/8/2012',
            
'title'         => 'PHP: Language fundamentals',
            
'description'   => 'Crash course in PHP. Types, variables, arrays,
                control structures.'
,
            
'links'         => array(
                array(
                    
'title' => 'PHP Language Reference',
                    
'url'   => 'http://www.php.net/manual/en/langref.php',
                    
'notes' => 'See "Basic Syntax", "Types", "Variables [Basics], Operators, Control Structures [especially <tt>foreach</tt>]"'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'url'   => 'http://qxlp.net/cs337/examples/php/'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'Problem, Boole?',
                    
'notes' => 'Loose comparison with <tt>==</tt>',
                    
'url'   => 'http://imgur.com/7unV7'
                
)
            )
        ),
        
'2/10/2012' => array(
            
'date'          => '2/10/2012',
            
'title'         => 'PHP: Interacting with data',
            
'description'   => 'URL\'s. GET and POST data in PHP.',
            
'links'         => array(
                array(
                    
'title' => 'URL Syntax',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Uniform_resource_locator#Syntax'
                
),
                array(
                    
'title' => 'PHP Superglobals',
                    
'notes' => 'See <tt>$_GET</tt> and <tt>$_POST</tt>',
                    
'url'   => 'http://php.net/manual/en/language.variables.superglobals.php'
                
),
                array(
                    
'title' => 'In-class URL diagram',
                    
'url'   => 'uploads/request3.tif'
                
),
                array(
                    
'title' => 'In-class POST diagram',
                    
'url'   => 'uploads/request4.tif'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'url'   => '/cs337/examples/php/'
                
)
            )
        ),
        
'2/13/2012' => array(
            
'date'          => '2/13/2012',
            
'title'         => 'PHP: Session handling',
            
'description'   => 'Sessions. How they work conceptually, how to
                start and use them in PHP.'
,
            
'links'         => array(
                array(
                    
'title'     => '<tt>session_start</tt>',
                    
'notes'     => 'PHP Documentation',
                    
'url'       => 'http://www.php.net/manual/en/function.session-start.php'
                
),
                array(
                    
'title'     => '<tt>$_SESSION</tt>',
                    
'notes'     => 'PHP Documentation',
                    
'url'       => 'http://www.php.net/manual/en/reserved.variables.session.php'
                
)
            )
        )
    ),
    
'MySQL' => array(
        
'2/15/2012' => array(
            
'date'          => '2/15/2012',
            
'title'         => 'Intro to Databases',
            
'description'   => 'What relational databases are, basics on how to design them.',
            
'links'         => array(
                array(
                    
'title' => 'Example database from class',
                    
'url'   => 'uploads/database_example.html'
                
)
            )
        ),
        
'2/17/2012' => array(
            
'date'          => '2/17/2012',
            
'title'         => 'More database design, intro to SQL.',
            
'description'   => 'Syntax for <tt>CREATE TABLE</tt>, <tt>INSERT</tt>, <tt>SELECT</tt>',
            
'links'         => array(
                array(
                    
'title' => '<tt>CREATE TABLE</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/create-table.html'
                
),
                array(
                    
'title' => '<tt>DROP TABLE</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/drop-table.html'
                
),
                array(
                    
'title' => '<tt>SHOW TABLES</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/show-tables.html'
                
),
                array(
                    
'title' => '<tt>DESCRIBE</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/describe.html'
                
),
                array(
                    
'title' => '<tt>SELECT</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/select.html'
                
),
                array(
                    
'title' => '<tt>INSERT</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/insert.html'
                
),
                array(
                    
'title' => 'Terminal transcript from class',
                    
'notes' => 'From a terminal, run <tt>wget -q -O - http://qxlp.net/cs337/lectures/uploads/sql.log</tt>',
                    
'url'   => 'uploads/sql.log'
                
)
            )
        )
    ),
    
'PHP + MySQL = Web Applications' => array(
        
'2/20/2012' => array(
            
'date'          => '2/20/2012',
            
'title'         => 'Introduction to PDO',
            
'description'   => 'PDO for interfacing with MySQL from PHP. How to put
                together a web application. Example app: blog.'
,
            
'links'         => array(
                array(
                    
'title' => 'PDO: Constructor',
                    
'url'   => 'http://www.php.net/manual/en/pdo.construct.php',
                    
'notes' => 'PHP Reference'
                
),
                array(
                    
'title' => 'PDO: <tt>prepare</tt>',
                    
'url'   => 'http://www.php.net/manual/en/pdo.prepare.php',
                    
'notes' => 'PHP Reference'
                
),
                array(
                    
'title' => 'PDO: <tt>execute</tt>',
                    
'url'   => 'http://www.php.net/manual/en/pdostatement.execute.php',
                    
'notes' => 'PHP Reference'
                
),
                array(
                    
'title' => 'PDO: <tt>fetch</tt>',
                    
'url'   => 'http://www.php.net/manual/en/pdostatement.fetch.php',
                    
'notes' => 'PHP Reference'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'url'   => '/cs337/examples/mysql/',
                    
'notes' => '<tt>blog*</tt>'
                
)
            )
        ),
        
'2/22/2012' => array(
            
'date'          => '2/22/2012',
            
'title'         => 'More SQL',
            
'description'   => '<tt>UPDATE</tt>, <tt>DELETE FROM</tt>,
                <tt>COUNT()</tt>, and <tt>GROUP BY</tt> in MySQL. Example app:
                bookmarking site.'
,
            
'links'         => array(
                array(
                    
'title' => '<tt>UPDATE</tt> syntax',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/update.html',
                    
'notes' => 'MySQL Reference'
                
),
                array(
                    
'title' => '<tt>DELETE</tt> syntax',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/delete.html',
                    
'notes' => 'MySQL Reference'
                
),
                array(
                    
'title' => 'Counting rows (<tt>COUNT</tt> and <tt>GROUP BY</tt>)',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/counting-rows.html',
                    
'notes' => 'MySQL Reference'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'url'   => '/cs337/examples/mysql/',
                    
'notes' => '<tt>bk*</tt>'
                
)
            )
        ),
        
'2/24/2012' => array(
            
'date'          => '2/24/2012',
            
'title'         => 'Uploading Files',
            
'description'   => 'How to allow users to upload files to your site
                (think <tt>enctype="multipart/form-data"</tt>)
                and how to handle uploaded files with PHP (remember the
                <tt>$_FILES</tt> array). Basic precautions to
                take when working with arbitrary files from users.'
,
            
'links'         => array(
                array(
                    
'title' => 'Handling file uploads',
                    
'notes' => 'PHP Reference',
                    
'url'   => 'http://php.net/manual/en/features.file-upload.php'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>editor*</tt>',
                    
'url'   => '/cs337/examples/mysql/'
                
)
            )
        )
    ),
    
'AJAX' => array(
        
'2/27/2012' => array(
            
'date'          => '2/27/2012',
            
'title'         => 'Introduction to AJAX',
            
'description'   => 'How to communicate to the server using
                JavaScript and the <tt>XMLHttpRequest</tt> object.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class request diagram',
                    
'url'   => 'uploads/ajax_sequence.png'
                
),
                array(
                    
'title' => 'Using <tt>XMLHTTPRequest</tt>',
                    
'notes' => 'MDN Reference',
                    
'url'   => 'https://developer.mozilla.org/en/DOM/XMLHttpRequest/Using_XMLHttpRequest'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>intro*</tt>, updated to show code that was demonstrated in Firebug\'s console',
                    
'url'   => '/cs337/examples/ajax/'
                
)
            )
        ),
        
'2/29/2012' => array(
            
'date'          => '2/29/2012',
            
'title'         => 'Adding AJAX into a web application',
            
'description'   => 'Using <tt>XMLHttpRequest</tt> to get
                information from PHP. Encoding with JSON.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>editor*</tt>',
                    
'url'   => '/cs337/examples/ajax/'
                
),
                array(
                    
'title' => '<tt>json_encode</tt>',
                    
'notes' => 'PHP Reference',
                    
'url'   => 'http://php.net/manual/en/function.json-encode.php'
                
),
                array(
                    
'title' => 'Evaluating JSON',
                    
'url'   => 'http://www.json.org/js.html'
                
)
            )
        ),
        
'3/2/2012' => array(
            
'date'          => '3/2/2012',
            
'title'         => 'Designing web applications',
            
'description'   => 'Thoughts on splitting up server/client
                functionality. Using <tt>window.history</tt> to create
                more seamless user experience.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>blog*</tt>',
                    
'url'   => '/cs337/examples/ajax/'
                
),
                array(
                    
'title' => 'Manipulating the browser history',
                    
'notes' => 'MDN Reference',
                    
'url'   => 'https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history'
                
)
            )
        )
    ),
    
'JavaScript Libraries' => array(
        
'3/5/2012' => array(
            
'date'          => '3/5/2012',
            
'title'         => 'Introduction to JavaScript libraries',
            
'description'   => 'What common JS libraries are used for.
                Introductory jQuery and History.js.'
,
            
'links'         => array(
                array(
                    
'title' => 'jQuery',
                    
'url'   => 'http://jquery.com/'
                
),
                array(
                    
'title' => 'jQuery Documentation',
                    
'notes' => 'See Selectors, Attributes, CSS, Ajax',
                    
'url'   => 'http://docs.jquery.com/Main_Page'
                
),
                array(
                    
'title' => 'History.js',
                    
'url'   => 'https://github.com/balupton/History.js/'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>blog*</tt>, <tt>dom.html</tt>',
                    
'url'   => '/cs337/examples/libraries/'
                
)
            )
        ),
        
'3/7/2012' => array(
            
'date'          => '3/7/2012',
            
'title'         => 'AJAX, more JavaScript libraries',
            
'description'   => 'Review of AJAX. How to build an AJAX
                application piece-by-piece. An assortment of JavaScript
                libraries and plugins.'
,
            
'links'         => array(
                array(
                    
'title' => 'AJAX sequence diagram',
                    
'url'   => 'uploads/ajax_examples.tif'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'url'   => '/cs337/examples/ajax/',
                    
'notes' => '<tt>ac*</tt>'
                
),
                array(
                    
'title' => 'Date.js',
                    
'url'   => 'http://www.datejs.com/'
                
),
                array(
                    
'title' => 'MathJax',
                    
'url'   => 'http://www.mathjax.org/'
                
),
                array(
                    
'title' => 'jQuery UI',
                    
'url'   => 'http://jqueryui.com/'
                
),
                array(
                    
'title' => 'Fancybox',
                    
'url'   => 'http://fancyapps.com/fancybox/',
                    
'notes' => 'Requires jQuery'
                
),
                array(
                    
'title' => 'd3',
                    
'url'   => 'http://mbostock.github.com/d3/'
                
)
            )
        )
    ),
    
'Security' => array(
        
'3/19/2012' => array(
            
'date'          => '3/19/2012',
            
'title'         => 'Introduction to Web Security, Password Storage',
            
'description'   => 'Web security and why it is important. General
                concerns and approaches. How to store passwords using salting
                and hashing.'
,
            
'links'         => array(
                array(
                    
'title' => 'Security diagram',
                    
'notes' => 'lecture',
                    
'url'   => 'uploads/security.tif'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>hash.php</tt>',
                    
'url'   => '/cs337/examples/security/'
                
),
                array(
                    
'title' => '<tt>hash</tt> function',
                    
'notes' => 'PHP Documentation, use <tt>sha256</tt>',
                    
'url'   => 'http://php.net/manual/en/function.hash.php'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'Cryptographic hash function',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Cryptographic_hash_function'
                
)
            )
        ),
        
'3/21/2012' => array(
            
'date'          => '3/21/2012',
            
'title'         => 'SQL Security',
            
'description'   => 'Demonstration of SQL injections. How to prevent
                them and how to mitigate attack danger through smart user
                permissions.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class "workbook"',
                    
'notes' => 'Notes added',
                    
'url'   => '/cs337/examples/security/sql_injection'
                
),
                array(
                    
'title' => '<tt>GRANT</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.0/en/grant.html',
                ),
                array(
                    
'title' => '<tt>UNION</tt> syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/union.html'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'SQL Injection Attacks and Defense',
                    
'notes' => 'Justin Clarke, Amazon',
                    
'url'   => 'http://www.amazon.com/Injection-Attacks-Defense-Justin-Clarke/dp/1597494240'
                
)
            )
        ),
        
'3/23/2012' => array(
            
'date'          => '3/23/2012',
            
'title'         => 'File upload security',
            
'description'   => 'Review of how to handle file uploads. Upload
                concerns, whitelisting over blacklisting as a concept (and
                using regular expressions to handle it), MIME types and MIME
                type inference by some browsers.'
,
            
'links'         => array(
                array(
                    
'title' => 'Secure Coding Guidelines',
                    
'notes' => 'File Uploads',
                    
'url'   => 'https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines#Uploads',
                ),
                array(
                    
'title' => '<tt>preg_match</tt>',
                    
'notes' => 'PHP Reference',
                    
'url'   => 'http://php.net/manual/en/function.preg-match.php',
                ),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>upload_*</tt>, functionality disabled',
                    
'url'   => '/cs337/examples/security/'
                
)
            )
        ),
        
'3/26/2012' => array(
            
'date'          => '3/26/2012',
            
'title'         => 'Cross-Site Coding',
            
'description'   => 'How to make AJAX requests across domains using
                the <tt>Access-Control-Allow-Origin</tt> and
                <tt>Access-Control-Allow-Credentials</tt> headers with the
                <tt>XMLHttpRequest.withCredentials</tt> flag. How cross-domain
                requests can be forged and how those forgeries can be detected
                using canaries.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class diagram showing CORS',
                    
'url'   => 'uploads/csrf_diagram.tif'
                
),
                array(
                    
'title' => 'In-class code for CORS',
                    
'url'   => '/cs337/examples/security/',
                    
'notes' => '<tt>cors_*</tt>, not fully functional, just code snippets'
                
),
                array(
                    
'title' => 'In-class code for how to prevent CSRF',
                    
'url'   => '/cs337/examples/security/',
                    
'notes' => '<tt>csrf_*</tt>: chat not fully functional, just code snippets'
                
),
                array(
                    
'title' => 'HTTP access control',
                    
'notes' => 'MDN Reference -- how to do legitimate cross-domain requests in your application',
                    
'url'   => 'https://developer.mozilla.org/En/HTTP_access_control'
                
),
                array(
                    
'title' => 'Cross-Site Request Forgeries',
                    
'notes' => 'Mitre CWE',
                    
'url'   => 'http://cwe.mitre.org/data/definitions/352.html'
                
),
                array(
                    
'title' => 'Cross-site request forgery',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Cross-site_request_forgery'
                
),
                array(
                    
'title' => 'Secure Coding Guidelines',
                    
'notes' => 'Preventing CSRF',
                    
'url'   => 'https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines#Preventing_CSRF'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'Advanced Web Attack Techniques using GMail',
                    
'notes' => 'How Gmail leaked contacts (a sort of CSRF)',
                    
'url'   => 'http://jeremiahgrossman.blogspot.com/2006/01/advanced-web-attack-techniques-using.html',
                ),
                array(
                    
'title' => 'How to upload arbitrary file contents cross-domain',
                    
'url'   => 'http://blog.kotowicz.net/2012/04/how-to-upload-arbitrary-file-contents.html'
                
)
            )
        ),
        
'3/28/2012' => array(
            
'date'          => '3/28/2012',
            
'title'         => 'Cross-Site Scripting (XSS)',
            
'description'   => 'What cross-site scripting is, how to protect against it. Examples
                of both non-persistent and persistent vulnerabilities.'
,
            
'links'         => array(
                array(
                    
'title' => 'Cross-Site Scripting',
                    
'notes' => 'OWASP',
                    
'url'   => 'https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)'
                
),
                array(
                    
'title' => 'XSS Prevention Cheat Sheet',
                    
'notes' => 'OWASP',
                    
'url'   => 'https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet'
                
),
                array(
                    
'title' => 'In-class CSRF diagram',
                    
'url'   => 'uploads/csrf_diagram1.tif'
                
),
                array(
                    
'title' => 'In-class XSS diagram',
                    
'url'   => 'uploads/csrf_diagram2.tif'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>xss*</tt>',
                    
'url'   => '/cs337/examples/security/'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'XSS Cheat Sheet',
                    
'url'   => 'http://ha.ckers.org/xss.html'
                
),
                array(
                    
'title' => '/r/xss',
                    
'notes' => 'reddit',
                    
'url'   => 'http://reddit.com/r/xss'
                
)
            )
        ),
        
'3/30/2012' => array(
            
'date'          => '3/30/2012',
            
'title'         => 'Case studies, clickjacking',
            
'description'   => 'Other ways to prevent or mitigate
                XSS attacks (hosting on other domains, browser XSS
                auditing). Case studies of high-profile web security failures
                and subsequent attacks. Brief demonstration of clicjacking.'
,
            
'links'         => array(
                array(
                    
'title' => 'Clickjacking',
                    
'notes' => 'OWASP',
                    
'url'   => 'https://www.owasp.org/index.php/Clickjacking'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>clickjacking*</tt>',
                    
'url'   => '/cs337/examples/security/'
                
),
                array(
                    
'title' => 'MySpace Worm Explanation',
                    
'url'   => 'http://namb.la/popular/tech.html'
                
),
                array(
                    
'title' => 'Osama Facebook Worm',
                    
'url'   => 'http://pastebin.com/uk0NZ758'
                
),
                array(
                    
'title' => 'Hacking Google for Fun and Profit',
                    
'url'   => 'http://blog.andrewcantino.com/blog/2011/12/14/hacking-google-for-fun-and-profit/'
                
)
            )
        ),
        
'4/2/2012' => array(
            
'date'          => '4/2/2012',
            
'title'         => 'Public-key cryptography and SSL',
            
'description'   => 'How SSL/TLS is used to secure communication
                channels between your computer and a website. Basic principles
                of public key cryptography.'
,
            
'links'         => array(
                array(
                    
'title' => 'SSL/TLS',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Secure_Socket_Layer'
                
),
                array(
                    
'title' => 'Public key certificate',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Public_key_certificate'
                
),
                array(
                    
'title' => 'HTTP Secure',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/HTTP_Secure'
                
),
                array(
                    
'title' => 'OSI Model',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/OSI_model',
                ),
                array(
                    
'title' => 'Public-key cryptography',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Public-key_cryptography'
                
),
                array(
                    
'title' => 'How to generate a self-signed certificate',
                    
'url'   => 'http://www.akadia.com/services/ssh_test_certificate.html'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'Everything you need to know about cryptography in 1 hour',
                    
'url'   => 'http://www.reddit.com/r/programming/comments/fqmhb/pdf_everything_you_need_to_know_about/'
                
)
            )
        )
    ),
    
'Other Topics' => array(
        
'4/4/2012' => array(
            
'date'          => '4/4/2012',
            
'title'         => 'DNS, Hosting a Web Site',
            
'description'   => 'How hostnames are resolved to IP addresses. How
                to set up a web site (registrar, hosting). Comparison of
                hosting types.'
,
            
'links'         => array(
                array(
                    
'title' => 'Domain Name System',
                    
'notes' => 'Wikipedia',
                    
'url'   => 'http://en.wikipedia.org/wiki/Domain_Name_System'
                
),
                array(
                    
'title' => 'Comparison of Hosting Types',
                    
'url'   => 'uploads/hosting'
                
)
            )
        ),
        
'4/6/2012' => array(
            
'date'          => '4/6/2012',
            
'title'         => 'Other Servers',
            
'description'   => 'Apache: a few features and some of its
                limitations. Thinking about handling HTTP requests more
                abstractly and discussion of other web servers that encourage
                that approach.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class example server code',
                    
'url'   => '/cs337/examples/servers'
                
),
            ),
            
'further'       => array(
                array(
                    
'title' => 'Node.js',
                    
'notes' => 'Server framework for JavaScript',
                    
'url'   => 'http://nodejs.org'
                
),
                array(
                    
'title' => 'Tornado Web Server',
                    
'notes' => 'Server framework for Python',
                    
'url'   => 'http://www.tornadoweb.org/',
                ),
                array(
                    
'title' => 'nginx',
                    
'notes' => 'Other useful HTTP server, fast/light',
                    
'url'   => 'http://nginx.org/'
                
)
            )
        ),
        
'4/9/2012' => array(
            
'date'          => '4/9/2012',
            
'title'         => 'Long-polling and WebSockets',
            
'description'   => 'Avoiding redundant polling, first with 
                long-polling and then with AJAX.'
,
            
'links'         => array(
                array(
                    
'title' => 'WebSockets',
                    
'notes' => 'MDN',
                    
'url'   => 'https://developer.mozilla.org/en/WebSockets'
                
),
                array(
                    
'title' => 'Long-polling examples (Comet)',
                    
'url'   => '/cs337/examples/longpolling'
                
),
                array(
                    
'title' => 'WebSockets examples',
                    
'url'   => '/cs337/examples/websockets'
                
)
            )
        ),
        
'4/11/2012' => array(
            
'date'          => '4/11/2012',
            
'title'         => 'Drag-and-drop, File API',
            
'description'   => 'Drag and drop in web applications. Dropping
                files and reading them in the browser.'
,
            
'links'         => array(
                array(
                    
'title' => 'Drag and Drop',
                    
'notes' => 'MDN',
                    
'url'   => 'https://developer.mozilla.org/En/DragDrop/Drag_and_Drop'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>drag*</tt>',
                    
'url'   => '/cs337/examples/js/',
                ),
            )
        ),
        
'4/13/2012' => array(
            
'date'          => '4/13/2012',
            
'title'         => 'Local storage, session storage, client-side SQL',
            
'description'   => 'Storing data long-term in the browser. Why it\'s useful, how to do it.',
            
'links'         => array(
                array(
                    
'title' => 'DOM Storage',
                    
'notes' => 'MDN',
                    
'url'   => 'https://developer.mozilla.org/en/DOM/Storage'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>todo*, client_storage</tt>',
                    
'url'   => '/cs337/examples/js/'
                
)
            )
        ),
        
'4/16/2012' => array(
            
'date'          => '4/16/2012',
            
'title'         => 'Templating and template engines',
            
'description'   => 'How to separate display logic from application
                logic using templating systems. Brief overview of Smarty,
                briefer overview of Underscore.js templates.'
,
            
'links'         => array(
                array(
                    
'title' => 'In-class examples',
                    
'notes' => 'see <tt>chat.php</tt>, <tt>alone.js</tt>, and
                        the <tt>templates</tt> folder'
,
                    
'url'   => '/cs337/examples/templates/'
                
),
                array(
                    
'title' => 'Smarty Crash Course',
                    
'url'   => 'http://www.smarty.net/crash_course'
                
),
                array(
                    
'title' => 'Underscore.js',
                    
'notes' => '<tt>template</tt> method',
                    
'url'   => 'http://documentcloud.github.com/underscore/#template'
                
)
            )
        ),
        
'4/18/2012' => array(
            
'date'          => '4/18/2012',
            
'title'         => 'JavaScript as a language',
            
'description'   => 'What goes on under the hood in JavaScript.
                Function-level scoping, <tt>call</tt> and <tt>apply</tt>,
                closures, objects, and prototypical inheritance.'
,
            
'links'         => array(
                array(
                    
'title' => 'JavaScript Scoping and Hoisting',
                    
'url'   => 'http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting'
                
),
                array(
                    
'title' => 'Understanding JavaScript OOP',
                    
'url'   => 'http://killdream.github.com/blog/2011/10/understanding-javascript-oop/index.html'
                
),
            ),
            
'further'       => array(
                array(
                    
'title' => 'JavaScript: The Good Parts',
                    
'url'   => 'http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742'
                
),
                array(
                    
'title' => 'Understanding <tt>delete</tt>',
                    
'url'   => 'http://perfectionkills.com/understanding-delete/'
                
)
            )
        ),
        
'4/20/2012' => array(
            
'date'          => '4/20/2012',
            
'title'         => 'Caching',
            
'description'   => 'HTTP caching, CDNs, <tt>memcached</tt>.',
            
'links'         => array(
                array(
                    
'title' => 'Caching tutorial',
                    
'url'   => 'http://www.mnot.net/cache_docs/'
                
),
                array(
                    
'title' => 'Memcached',
                    
'notes' => 'PHP',
                    
'url'   => 'http://php.net/manual/en/book.memcached.php'
                
),
            ),
            
'further'       => array(
                array(
                    
'title' => 'Nginx: Caching Proxy',
                    
'url'   => 'http://www.rfxn.com/nginx-caching-proxy/'
                
),
                array(
                    
'title' => 'REDbot',
                    
'notes' => 'HTTP debugging',
                    
'url'   => 'http://redbot.org/'
                
),
            )
        ),
        
'4/23/2012' => array(
            
'date'          => '4/23/2012',
            
'title'         => 'Mobile browsers, etc.',
            
'description'   => 'Degradable AJAX. How to detect mobile browsers,
                how to style pages differently based on browser size and/or
                device size.'
,
            
'links'         => array(
                array(
                    
'title' => 'The Hows and Whys of Degradable AJAX',
                    
'url'   => 'http://particletree.com/features/the-hows-and-whys-of-degradable-ajax/'
                
),
                array(
                    
'title' => 'CSS Media Queries',
                    
'url'   => 'MDN Reference',
                    
'url'   => 'https://developer.mozilla.org/en/CSS/Media_queries'
                
),
                array(
                    
'title' => 'Responsive Web Design',
                    
'url'   => 'https://developer.mozilla.org/en/CSS/Media_queries'
                
),
                array(
                    
'title' => 'In-class examples',
                    
'notes' => '<tt>query.html</tt>',
                    
'url'   => '/cs337/examples/css/'
                
),
            ),
            
'further'       => array(
                array(
                    
'title' => 'History of the browser user-agent string',
                    
'url'   => 'http://webaim.org/blog/user-agent-string-history/'
                
),
                array(
                    
'title' => '1140 CSS Grid',
                    
'url'   => 'http://cssgrid.net/'
                
)
            )
        ),
        
'4/25/2012' => array(
            
'date'          => '4/25/2012',
            
'title'         => 'Other database options, speeding up MySQL',
            
'description'   => 'Brief mention of other database solutions for
                specific purposes such as Cassandra, Solr/Lucene. Detail on
                how to write more efficient queries and how to use indexes
                in MySQL to speed queries up.'
,
            
'links'         => array(
                array(
                    
'title' => 'Apache Cassandra',
                    
'url'   => 'http://cassandra.apache.org/'
                
),
                array(
                    
'title' => 'Apache Solr',
                    
'url'   => 'http://lucene.apache.org/solr/'
                
),
                array(
                    
'title' => 'MyISAM vs InnoDB',
                    
'notes' => 'StackOverflow',
                    
'url'   => 'http://stackoverflow.com/questions/20148/myisam-versus-innodb'
                
),
                array(
                    
'title' => 'MySQL Server Logs',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.1/en/server-logs.html'
                
),
                array(
                    
'title' => 'How MySQL Uses Indexes',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html'
                
),
                array(
                    
'title' => '<tt>EXPLAIN</tt> Syntax',
                    
'notes' => 'MySQL Reference',
                    
'url'   => 'http://dev.mysql.com/doc/refman/5.5/en/explain.html'
                
)
            ),
            
'further'       => array(
                array(
                    
'title' => 'MySQL Performance Blog',
                    
'url'   => 'http://www.mysqlperformanceblog.com/'
                
)
            )
        ),
        
'4/27/2012' => array(
            
'date'          => '4/27/2012',
            
'title'         => 'HTML5 Grab Bag',
            
'description'   => '<tt>contentEditable</tt>, <tt>geolocation</tt>,
                <tt>video</tt>/<tt>audio</tt>, semantic markup, microdata'
,
            
'links'         => array(
                array(
                    
'title' => 'HTML5 demo: geolocation',
                    
'url'   => 'http://html5demos.com/geo'
                
),
                array(
                    
'title' => 'Microdata: getting started',
                    
'url'   => 'http://www.schema.org/docs/gs.html'
                
),
                array(
                    
'title' => 'Semantic markup',
                    
'url'   => 'http://blogs.msdn.com/b/jennifer/archive/2011/08/01/html5-part-1-semantic-markup-and-page-layout.aspx'
                
),
                array(
                    
'title' => 'CSS Transitions',
                    
'notes' => 'MDN',
                    
'url'   => 'https://developer.mozilla.org/en/CSS/CSS_transitions'
                
)
            ),
        )
    )
);


// END END END END END END END //

// Print out data.
foreach ($topics as $topic => $lectures)
{
    echo 
'<hr/><span class="heading">'$topic'</span>';
    echo 
'<table>';

    
// Print out each lecture
    
foreach ($lectures as $date => $lecture)
    {
        echo 
'<tr>';
        echo 
'
            <td class="heading">' 
$lecture['date'] . '</td>
            <td>
                <b>' 
$lecture['title'] . '</b>
                <p>' 
$lecture['description'] . '</p>';
        if (!empty(
$lecture['links']))
        {
            echo 
'
                <b>Resources:</b>
                <ul>
            '
;
            foreach (
$lecture['links'] as $link)
            {
                echo 
'
                    <li><a href="' 
$link['url'] . '">' $link['title'] . '</a>' .
                        (isset(
$link['notes']) ? ' (' $link['notes'] . ')' '') .
                        
'</li>
                '
;
            }
            echo 
'
                </ul>
            '
;
        }
        if (!empty(
$lecture['further']))
        {
            echo 
'
                <b>Further Reading:</b>
                <ul>
            '
;
            foreach (
$lecture['further'] as $link)
            {
                echo 
'
                    <li><a href="' 
$link['url'] . '">' $link['title'] . '</a>' .
                        (isset(
$link['notes']) ? ' (' $link['notes'] . ')' '') .
                        
'</li>
                '
;
            }
            echo 
'
                </ul>
            '
;
        }
        echo 
'
            </td>
        '
;
        echo 
'</tr>';
    }

    echo 
'</table>';
}

?>


<?php include("../source.php"); ?>

</body>
</html>