Programming With Text
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.
- #1.1
Introduction
09 Sep 2016contributions:
- title: “Accelerate to Mouse in Python via pyglet” author: name: “cenkt” url: “https://github.com/cenkt/pyglet/blob/Accelerate-to-Mouse/myprojects/2-n-body%20atraction.py”
- #1.2
My Workflow
09 Sep 2016In this video, I demonstrate the tools that I use in my coding environment for this course. There are many alternatives to this particular setup, but in case you are at a loss for what to use, here’s a reasonable option. The tools I am showing you (node.js, atom, p5.js) are free.
- #1.3
Text Input
09 Sep 2016In this video, I demonstrate how you can get text input from a user with DOM elements (“input” and “textarea” in combination with the p5.dom.js library.
- #1.4
Loading a Text File
11 Sep 2016In this video, I show you how to get text input from a user by loading a text file using the p5.js function loadStrings(). I discuss how a user can upload their own text file with createFileInput() or a “drag and drop” zone.
- #1.5
JavaScript String Object
12 Sep 2016In this video, I discuss the JavaScript String object, and how to use it to modify and manipulate text in JavaScript. The functions / properties covered are indexOf(), substring(), and length. I look at the p5.js specific split(), splitTokens(), and join().
- #1.6
Homework Assignments Week 1
12 Sep 2016In this short video I discuss a creative assignment around the topics covered in Week 1 of “Programming from A to Z”.
- #2.1
Introduction to Regular Expressions
15 Sep 2016In this video I introduce Regular Expressions. What are they and how are they used?
- #2.1
Homework Assignments Week 2
20 Sep 2016In this short video I discuss a creative assignment around the topic of Regular Expressions in Week 2 of “Programming from A to Z”.
- #2.2
Meta-characters
16 Sep 2016In this video I discuss meta-characters: what are they and what role do they play in regular expressions?
- #2.3
Character Classes
16 Sep 2016In this video, I explain character classes which are a way of matching a selection of characters in a regular expression.
- #2.4
Capturing Groups
17 Sep 2016In this video I discuss capturing parentheses and how they are used to create numbered groups that referenced in a find/replace operation.
- #2.5
Back References
18 Sep 2016In this short tutorial, I explain the concept of “back references” and explore how they are used to match the characters previously matched by capturing parentheses (groups) in a regular expression (regex).
- #2.6
test() and match()
18 Sep 2016In this video, I discuss how to use regular expressions with theJavaScript programming language.
- #2.7
exec()
18 Sep 2016In this video, I discuss another JavaScript function for regular expressions:
exec()
. - #2.8
split()
19 Sep 2016This video covers
split()
– a JavaScript String function, which is used to split a given piece of text into “tokens” based on a “delimiter” as defined by a regular expression. - #2.9
replace()
19 Sep 2016In this video, I cover the JavaScript function
replace()
. The function allows you to search for a string (by matching a regular expression) and replace that string. - #3.1
The RiTa.js Library
22 Sep 2016In this video, I cover the basics of using the RiTa.js library in JavaScript. I look at analyzing text with the RiString and generating words from the built-in RiTa lexicon.
- #3.2
The nlp-compromise Library
23 Sep 2016In this video, I cover a JavaScript “natural language processing” library called “nlp-compromise.” I show how you can change the tense of verbs, pluralize nouns, and perform other types of language-based operations.
- #3.3
Homework Assignments Week 3
28 Sep 2016In this short video I discuss a creative assignment around the topic of Data and APIs for week 3 of “Programming from A to Z”.
- #5.1
Intro to Week 5: Text Analysis and Word Counting
07 Oct 2016Week 5 of Programming from A to Z focuses on about text-analysis and word counting. In this introduction, I discuss different how word counting and text analysis can be used in a creative coding context. I give an overview of the topics I will cover in this series of videos.
- #5.2
Associative Arrays in JavaScript
07 Oct 2016In this video, I discuss the concept of “associative arrays” in JavaScript. I look at how JavaScript objects are collections of name-value (or key-value) pairs. This works in much the same as dictionaries in Python or HashMaps in Java. This concecpt will come extremely handy in the coding challenges around word counting.
- #5.3
Homework Assignment Week 5
13 Oct 2016In this video I discuss assignments and exercises around the topic of Text-Analysis and Word Counting for week 5 of “Programming from A to Z”.
- #6.1
Intro to Session 6: Markov Chains
22 Oct 2016This video introduces Session 6: Markov Chains (http://shiffman.net/a2z/markov). It is part of the ITP course “Programming from A to Z”. A Markov Chain is a broad concept, in this series I will demonstrate it as a means to generate text algorithmically, using n-grams and probability.
- #6.2
Homework Assignment Session 6
26 Oct 2016In this last video of Session 6, I discuss exercises you can try related to n-grams and Markov Chains (http://shiffman.net/a2z/markov).
- #7.1
Intro to Session 7: Context-Free Grammar
27 Oct 2016This video introduces Session 7: Context-Free Grammar from the ITP course “Programming from A to Z”. A Context-Free Grammar is a set of recursive “replacement” rules to generate text. In this session, I discuss two JavaScript libraries: Tracery and RiTa.js for working with context-free grammars. Finally, I code from scratch basic context-free grammar system.
- #7.2
Context-Free Grammar with Tracery
28 Oct 2016In this video, I demonstrate how to use Kate Compton’s Tracery library to generate a story from a set of grammar rules.. This video is part of Session 7 of the “Programming from A to Z” ITP class.
- #7.3
Context-Free Grammar with RiTa.js
29 Oct 2016In this video, I use Daniel C. Howe’s RiTa.js library to generate text with a context-free grammar (https://github.com/dhowe/RiTaJS). This video is part of Session 7 of the “Programming from A to Z” ITP class.
- #7.4
Homework Assignment Session 7
01 Nov 2016In this last video of Session 7, I discuss exercises you can try related to Context-Free Grammars.
- #8.1
Intro to Session 8: Building an API in Node
04 Nov 2016In this session, I cover the basic steps for building a RESTful API with Node.js. I show you how to install the Node.js framework express how to use routes and parameters to deal with the HTTP GET requests. I also cover what it means for an API to be a REST (Representational State Transfer) API.
- #8.2
HTTP Server with Express
05 Nov 2016In this first video of “Building an API in Node” from the ITP course “Programming from A to Z”, I show you how to create a simple HTTP Server with the Node.js framework Express. http://shiffman.net/a2z/node-api/
- #8.3
RESTful Routes
06 Nov 2016In this second video of “Building an API in Node” from the ITP course “Programming from A to Z”, I explain what a REST (Representational state transfer) API is as well as how to use “routes” in Express to process requests made to your API. http://shiffman.net/a2z/node-api/
- #8.4
RESTful Routes with Parameters
10 Nov 2016In “Building an API in Node” video for the ITP course “Programming from A to Z”, I expand on the previous video and customize the routes used in the GET requests using parameters. Data is returned to the client in JSON format.
- #8.5
Saving Data to JSON File with Node.js
18 Nov 2016In this video, I discuss how to work with a very simple database with in the API example using local JSON files and the node.js “fs”(file-system) package.
- #8.6
API Front End Client
19 Nov 2016In this video, I look at how to talk to your API from a web page by building a simple front end client with HTML and the p5.js library.
- #8.7
Build Your Own API - Conclusion with HTTP POST
13 Dec 2016This is it! The conclusion to the “Build Your Own API” with node.js tutorial from my “Programming from A to Z” ITP class.
- #9.1
What is Firebase? (Database as a Service) - Programming with Text
08 Dec 2016In this video, I introduce the concept of “Database as a Service” (DBaaS). I discuss how you can store data in a web application written with client-side JavaScript only. This is the first video in a tutorial series about Firebase. This video is part of the “Programming from A to Z” ITP course.
- #9.2
9.2: Firebase: Saving Data - Programming with Text
09 Dec 2016In this video, I demonstrate how to save data to the cloud using the database service Firebase. This video is part of the “Programming from A to Z” ITP class.
- #9.3
9.3: Firebase: Retrieving Data - Programming with Text
10 Dec 2016In this video, I demonstrate how to retrieve data from Firebase (Google database as a service product). The example is a high score list but the data can be anything of course. This video is part of the “Programming from A to Z” ITP class.
- #10.1
Introduction to Chatbots
12 Oct 2017This video is an introduction to a new topic in my Programming with Text playlist: Chatbots!
- #10.2
Chatbots with RiveScript
12 Oct 2017In this video I cover RiveScript: a simple scripting language for chatbots with a friendly, easy to learn syntax.
- #10.3
Text-to-Speech with p5.Speech
19 Oct 2017In this video, I use the p5.Speech library for text-to-speech (TTS). The p5.Speech library is an initiative from the NYU Ability Project.
- #10.4
Speech Recognition with p5.Speech
20 Oct 2017In this video, I use the p5.Speech library for speech-to-text, i.e. speech recognition. The p5.Speech library is an initiative from the NYU Ability Project.
- #11.1
Introduction to Chrome Extensions
13 Nov 2017This video introduces a new topic in the Programming with Text playlist: Chrome Extensions!
- #11.2
Bookmarklets
13 Nov 2017In this video, I cover Bookmarklets, a simple way to modify run JavaScript code to modify browser content via a bookmark button.
- #11.3
Content Scripts
14 Nov 2017In this video, I cover “content scripts” for chrome extensions. The content script is a JavaScript file that runs in the context of a web page (and can be used to modify that page.)
- #11.4
Background Scripts
15 Nov 2017In this video, I discuss “background scripts” for chrome extensions.
- #11.5
Pop-ups
21 Nov 2017In this video, I cover “pop-ups” with chrome extensions.
- #11.6
Pop-ups Messaging
22 Nov 2017In this video, I show you how to communicate between an extension “pop-up” and a content script with chrome’s messaging API.
- #11.7
New Tab Override
27 Nov 2017In this video, I demonstrate chrome extension “overrides” – specifically the “tab override” which replaces the default page when you open a new tab in your browser.
- #11.8
Cross-browser Extensions
28 Nov 2017The chrome extension API is also available as part of a more general “browser extension” API.