CS 330 Lecture 8 – Regex Lookaround
Agenda what ?s regex bingo lookaround quoting HTML attributes humanizing identifiers TODO Right now: You and a partner make a 4×4 grid of randomly generated strings. Include upper- and lowercase letters, numbers, whitespace, and punctuation. Keep the strings short. There’s no free space. Before Friday: Familiarize yourself with grammars and ANTLR. Read Grammar: The Language […]
Installing a Newer Ruby with RVM
My department’s Linux machines don’t have a very new Ruby installed (1.8.7, which was released in 2008 and which has since been retired by the Ruby community). This old version is missing a number of useful features, like lookaround assertions in regular expressions! Instead of upgrading the system-wide Ruby, they recommend that each individual install […]
CS 330 Lecture 7 – Regex: Replacement with Blocks
Agenda what ?s program this gsub examples src2html eval’ing embedded math regex bingo TODO Right now: You and a partner make a 4×4 grid of randomly generated strings. Include upper- and lowercase letters, numbers, whitespace, and punctuation. Keep the strings short. There’s no free space. Before Wednesday: Familiarize yourself with grammars and ANTLR. Read Grammar: The […]
CS 330 Lecture 6 – Regex: Capturing and Substituting
Agenda what ?s what is a regex? capturing substituting TODO For an extra credit quarter sheet, do these two things: Get at least 1000 points at Regex Golf. Don’t look up the answers anywhere. Start a post on Piazza sharing your solutions. Create your own level by clicking on the Help button in the navigation bar. Share […]
CS 330 Lecture 5 – Regex
Agenda what ?s regex anatomy regex operations assert match (=~) find match (capturing groups) find all matches (scan, grep) replace matches (sub, gsub) TODO Walk through RegexOne. On a 1/4 sheet, draft some regular expressions (and just the expressions) that match the following: Lines ending with a hyphenated word. Words with an internal uppercase letter. […]
CS 330 Lecture 4 – Ruby
Agenda what ?s program this examples calculate an aspect ratio list rhymes Advent of Code #1 merging two files TODO If your Ruby expertise is minimal, check out tryruby.org. No 1/4 sheet. Note Today we switch to another language for writing scripts: Ruby. We won’t hit in full detail, just enough to be able to move […]
CS 330 Lecture 3 – Shell Scripting Cont’d
Agenda what ?s mass programming bookmark a directory safe rm top10 big files upload file to www share directory re-extension TODO Read Eric Raymond’s Basics of the Unix Philosophy. On a 1/4 sheet, write down 2-3 questions, observations, or your own laws for developing software. Note Today we’re going to continue writing shell scripts together. […]
CS 330 Lecture 2 – Shell Scripting
Agenda what ?s mass programming zip a directory to directory.zip run a C source file safe rm top10 big files bookmark a directory upload file to www share directory re-extension TODO Read Shell Programming with Bash. On a 1/4 sheet, write some shell command lines to accomplish the following tasks. Be sure to consult man […]
CS 330 Lecture 1 – Hello, Shell
Agenda what ?s about.. me you this class questions shell exercises TODO Before next class: Read the syllabus. Set up a Bitbucket account and make your homework repository, described below. Cut a piece of paper in half vertically. Cut the two strips in half again, horizontally. On one of these 1/4 sheets of paper, write down […]