This course focuses on programming strategies and techniques behind procedural analysis and generation of text-based data. We'll explore topics ranging from evaluating text according to its statistical properties to the automated production of text with probabilistic methods to text visualization. Students will learn server-side and client-side JavaScript programming and develop projects that can be shared and interacted with online. There will be weekly homework assignments as well as a final project.
- Daniel Shiffman, Mondays, 12:10pm-2:40pm
- All class dates
- Office Hours
- Notes
- Homework Assignment
- Git and Github
- Github Pages: By no means, is github pages required for hosting your projects. But it's free and fast and lives on github. So there are many reasons why you might like to consider it, at least during the homework / experimentation stage / of a project.
- p5.js
- Overview of p5.js
- p5.js transition from Processing
- p5.js DOM library
- Objects in JavaScript
- Basics of HTML and CSS with p5.js
- JavaScript
- Client-side vs. Server-side?
Week 2 -- Strings and DOM
- Notes
- Homework Assignment
- DOM manipulation in p5.js
- Strings in JS
- Text input (from user, from file)
Week 3 - Regular Expressions
- Notes
- Notes on callbacks in a loop
- Homework Assignment: Regular Expression Exercise
- Project 1 (due week 6): Use a text input source (user input, raw text file, API/data source) to generate an output presented back to the user in the browser. Possibilities include data visualization of text data, generative text maker, etc. We'll discuss details in class.
- Review OOP in JS
- Regular Expressions
- meta-characters
- position
- single character
- quantifiers
- character classes
- Regex in sublime text
- Regex in JS:
test()
,search()
,match()
,exec()
- Splitting with regex:
split()
- Replace with regex:
replace()
- randexp.js
- meta-characters
Week 4 - Data/API Workshop
- Notes and examples
- APIs
- Working with google sheets
- Parse
- Homework: Start working on a text analysis project, due Week 6 (October 19).
Week 5 - Text Analysis Workshop
- Notes and examples
- In class, we'll build a simple concordance together as well as demonstrate and discuss TF/IDF and Bayesian analysis.
- Simple Concordance
- TF/IDF
- Bayesian Analysis
Week 7 - Text Generation: Markov chains
- Using google sheets for text input
- Object "prototypes"
- ngrams and markov chains
- Homework Assignment
Week 8 - Text Generation: Grammars
- Using parse for saving data
- Closures
- Context free grammars
- Homework Assignment
Week 9 - Twitter Bots
- All notes
- All examples
- Server side programming with Node
- How to do data scraping
- How to make your own "API"
- How to make a Twitter bot
- Bot Homework Assignment
Week 10 - More Bots + Chrome Extensions
- Notes on chrome extensions
- More on bots -- Twitter streaming API, video tutorial
- More on bots -- Working with images/media, video tutorial
- Deploying
- Assignment: Final project proposals
Week 11 - Final Project Proposals part 1
- half of you talk about ideas this week
- Text Analysis in Node
- building your own API
Week 12 - Final Project Proposals part 2
- half of you talk about ideas this week
- Text Analysis in Node
- Persistance (files, database, parse.com)
- GET vs POST
- Node packages for text: NaturalNode, sentiment, and more
- Moved to references wiki
- JavaScript: The Definitive Guide
- Eloquent JavaScript, Marijn Haverbeke
- Beginning JavaScript, Paul Wilton and Jeremy McPeak
- CodeAcademy: JavaScript
- How to learn JavaScript properly
- JavaScript the right way
- Code School
- JavaScript garden
- A re-introduction to JS by Mozilla
- JavaScript 101 from JQuery
- Checking code: JSLint / JSHint
- Browser debugging: Chrome Developer Tools (tutorial) / Firebug (tutorial)
- Mobile debugging jsconsole.com
- Sharing code snippets (useful for asking questions): gist.github.com
- You are required to attend all class meetings and submit all weekly assignments and a final project.
- Grading (pass/fail) will be based on a combination of factors:
- Attendance, participation in class discussion, and engagement in other students' projects (25%)
- Quality of assignments (50%)
- Final Project (25%)