CS 330 Lecture 6 – Regular Expressions
Agenda what ?s homework 2 deadline extracting matches capturing transforming matches Program This Code chapterer.rb ocracy.rb blogify.rb report_generator.rb report_with_equations.txt Haiku
CS 330 Lecture 5 – Regular Expressions
Agenda what ?s Perry on “what’s best?” what are regices used for? common regex algorithms in Ruby asserting a pattern extracting matches transforming matches languages’ differing tacks on regex extracting a table of contents TODO Start Regexercise, homework 2. Optional: http://stackoverflow.com/questions/1732348 and http://www.codinghorror.com/blog/2009/11/parsing-html-the-cthulhu-way.html. See the dissonance between the question and answers, a hallmark of humanity. See Worse […]
CS 330 Homework 2 – due before February 12
See the PDF.
CS 330 Lecture 4 – Regular Expressions
Agenda what ?s the gauntlet state machines/DFAs DFAs are regular expressions bingo TODO Walk through http://regexone.com. Write expressions to match: Lines ending with a hyphenated word. Words with an internal uppercase letter. Lines lacking a semi-colon at their close. Don’t match lines that have a semi-colon followed by whitespace. Instances of the identifier i. Don’t match […]
CS 330 Lecture 3 – Shell and Regex
Agenda what ?s what does this do? what sets shell apart? writing Java globbing and patterns TODO Read Gabriel’s Worse is Better (http://dreamsongs.com/RiseOfWorseIsBetter.html). Read section 13.4.2. 1/4 sheet. What Does This Do? Code … Haiku
CS 330 Lecture 2 – Shell Scripting
Agenda what ?s who you are toolsmiths? duality redirection, expansion, and substitution some scripts find biggest files recycle instead remove mass email TODO Read chapter 13 through 13.2.1. If you are thirsty for more: http://www.johndcook.com/blog/2010/06/30/where-the-unix-philosophy-breaks-down http://www.faqs.org/docs/artu/ch01s06.html Optional challenge: write a one-liner to change permissions of all files and their descendants to be others-readable (without qualification) […]
CS 330 Lecture 1 – Hi and Shell
Agenda meta define this course outline shell Define This TODO Watch and play along with the video above on using Bitbucket for homework. Read the syllabus. Read Fred Brooks’ The Computer Scientist as Toolsmith II (http://www.cs.unc.edu/~brooks/Toolsmith-CACM.pdf). Change your shell as you wish. Bring a 1/4 of paper to Friday’s lecture with two questions and two […]
CS 330 – Programming Languages
Meta Syllabus Enrollment: 54 Lectures Homework Exams
CS 330 Lecture 39 – Mixins and Wrap-up
Agenda what ?s multiple inheritance in Ruby? implementing Orderable wrap-up Code vec3.rb Haiku
CS 330 Lecture 38 – Monkey patching, Meta-programming, Blocks, and Mixins
Agenda what ?s monkey patching why monkey patch? a custom malloc reflection and meta-programming why meta-program? a testing framework adding blocks to TestTest mixins making things Orderable (IRL, use Comparable) ?s Are there non-English languages? http://en.wikipedia.org/wiki/Non-English-based_programming_languages http://www.codinghorror.com/blog/2009/03/the-ugly-american-programmer.html What’s the point of symbols? http://www.troubleshooters.com/codecorn/ruby/symbols.htm http://glu.ttono.us/articles/2005/08/19/understanding-ruby-symbols http://www.robertsosinski.com/2009/01/11/the-difference-between-ruby-symbols-and-strings Is there something like tryruby.org for Haskell? http://tryhaskell.org Is there something […]