Table of Contents

CS3342 Course Log B Term 2015-2016 Academic Year

1 [W1] Tuesday 5 Jan 2016: First meeting of this class

1.1 Cover announcements page/introduce course

  • demo'd org-mode, specifically using org->logging work -> clock in -> clock out -> create clock table
  • www.csd.uwo.ca/~webber/CS3342/index.html

1.2 Cover course outline

1.3 First reading

  • for Thursday, read pages 3 - 11 (Chapter 1, up to and including Section 1.3.6)
  • your group will be asked to hand in a paragraph on what you all think is the main problem with using English as a programming language in the near future based on the assigned reading. 10 minutes of class time Thursday will be set aside for your group to create its answer.
  • looking ahead, from this reading, next week will be dedicated to Chapter 2 (pages 17 - 50).
  • regarding language examples: we are going to look at many programming languages this semester. some languages will just appear for one example and others will come up frequently. the only time you won't have access to your notes is the final exam (and the practice quizzes that prepare for the final). for the final exam, we will prepare reference cards for the languages that are used as examples and these will be the ones we work with in class and on the programming assignments. the main role of the textbook is to cover the concepts of the course. however, its discussion of C++, Miranda, Lisp, Scheme, and Prolog will connect closely to the languages we will be working with.

1.4 Concept mapping and the Overview paragraph of Chapter 1

  • note: the last two sentences of overview are about Sections 1.4 and 1.5, which we are skipping.

1.5 Ruby Tic Tac Toe program example handout

on line 151, what does it look like the built-in method find is doing? how does that line work?

2 [W1] Thursday 7 Jan 2016:

2.1 review announcements page

  • ruby documentation
  • today's example
  • stuff from last class

2.2 prepare group answer re Tuesdays reading (10 minutes)

NOTE: Do not put your student id on the pages handed in by your group. Just your names (first and last). Clearly printed.

recall:

  • for Thursday, read pages 3 - 11 (Chapter 1, up to and including Section 1.3.6)
  • your group will be asked to hand in a paragraph on what you all think is the main problem with using English as a programming language in the near future based on the assigned reading. 10 minutes of class time Thursday will be set aside for your group to create its answer.
  • discussion?

2.3 return Tuesday's group ruby question

recall: on line 151, what does it look like the built-in method find is doing? how does that line work?

people seemed to do a reasonable job on getting started on this. reading code written by other people is a useful skill – we will get a bit of practice on doing this this semester.

2.4 readings/concepts for next week

  • as mentioned Tuesday, by next Thursday you should have read all of Chapter 2.

    • Sections 2.1 and 2.2 give us different ways to think about abstraction in programming languages.
    • Section 2.3 gives us a way to organize all the details of a new language. it is useful to think about how these ideas are reflected in different aspects of Java. as we get deeper into Ruby and later languages, it is useful to think about how these ideas are being reflected in these languages also.
    • Section 2.4 introduces a number of terms used to describe types of programming languages. We will be using these terms throughout the rest of the semester.
    • by Tuesday, you should be somewhere in Section 2.3,the further in, the better (as it makes you that much closer to being done by Thursday).
    • question to bring to Tuesday's class: So far, we have been introduced in the textbook to many `new' words and phrases. For example, perhaps, `syntax' or `semantic intent'. Are there any that you think need further discussion at this point? If so, list your top choices (at most three) and for each, indicate a sentence (and its page number) for a usage of that word or phrase that looks like a good place to start sorting the matter out. If you can come up with a specific question about the word or phrase, that would be ok instead (or in addition to the sentence). Drop off a page at the start of class and I will pick a few randomly on Tuesday, then read through them (* mistake: should read `through the rest after' *) after class and see if there are any clusters that need to be looked at on Thursday.

3 [W2] Tuesday 12 Jan 2016: Last day to add this course

Table 1: Clock summary at [2016-01-12 Tue 15:42]
Headline Time  
Total time 1:41  
[W2] Tuesday 12 Jan 2016: Last day to… 1:41  
  Planning out the semester   0:15
  Reminder   0:22
  Comment on Groups left over from…   0:03
  Test Driven Development/Behavioral…   0:39
  start discussing `Stupid Ruby Tricks'…   0:22

3.1 Planning out the semester

  • 38 hours of class this semester (12 weeks of 3 and 2 the last week). Last week we did 3 hours. so 7.89% of the semester is done. at the end of today's class, we will be 13.15% done.
  • another way to look at things is how are we going to navigate the textbook. so far we have been moving at a chapter a week. so I don't expect us to cover more than 12 chapters (worth of material – although we might look at a few sections from more chapters).
    • Chapters 1 thru 4 are important to set up the rest of the semester. So far, the only parts of these that look skippable are 1.4, 1.5, and 4.4.1
    • Chapters 12 and 13 are my favourite topics
    • to get to 12, we are going to need parts of 5 thru 11
    • if we have time, some of the material on polymorphic typing and generics is worth while (generic programming was added to Java in 2004 – was in C++ earlier (templates)). lambda was a new feature in Java with version 8 (circa 2014) connecting to functional programming (introduced into C++ roughly the same time). the assert statement went into Java 1.4 (circa 2002) (always been in C and C++). logic programming and its near relative constraint programming are available in most major programming languages as add-on libraries.
  • projects

    • clearly the first project will use Ruby.
    • for logic programming, we will have a gprolog project
    • a functional programming project could be based in either Haskell or Scheme – probably spend a week of class on each and then vote on which to go deeper into
    • a domain specific project could be based on either Emacs Lisp or JavaScript – probably spend a week of class on each and then vote on which to go deeper into
    • note: there is roughly 3 weeks of coverage in class for each of the four project styles.
    • NOTE: THE ABOVE COMMENTS ARE PROVISIONAL. BUT THE TIME RESOURCE LIMITS THAT DRIVE THEM ARE REAL.

3.2 Reminder

  • First programming assignment due in two weeks.
  • Overview the Announcements Page
    • First assignment material available
    • Note: comment on reading last Tuesday's tic tac toe program posted.

3.3 Comment on Groups left over from Thursday

  • if a group of people are puzzling it out, the puzzling goes faster, as not everyone figures each step out at the same speed. a communicating group figures each step out at the speed of the fastest person on that step. even better, perhaps some parallelism happens as one person tries to figure out what sort of think @gamestate holds while someone else if trying to figure out where move gets used. and, a communicating group can produce more reliable answers as when one person figures something out, the other people can ask questions to check and make sure they agree that that step was done right.
  • this sort of group interaction doesn't happen automatically, but it is something to strive for.

3.4 Test Driven Development/Behavioral Driven Development

  • introduction to rspec (tar of files on Announcements)
  • walk thru demo handout (link to bigger example on Announcements)
  • group task (15 minutes - yes, really) I want to write a program that can efficiently sort an array of integers. This program should return a 2 entry array. The first entry is the sorted version of the array. The second entry is the number of comparison operations that were necessary to do the sort. The ultimate goal is for the number of comparison operations to to be less that twice the size of the array times the log base 2 of the size of the array.

    What sequence of executable behavioral specifications would you use to guide the development of this program? Give rspec-like detail. After 15 minutes we will stop and the group hands in what they came up with so far.

3.5 Problems with Concepts and Phrases in the Readings So Far?

3.6 start discussing `Stupid Ruby Tricks' examples

GOT TO LINE 138 IN TRICKS 01

  • overview: now 2 files of tricks
  • these are on the course web page
  • if printed out, would be 11 pages for first file, 7 pages for second.
  • irb is tagging each prompt with a unique number for these examples
  • you can jot down the numbers of things you want to look at again later
  • this is not a bunch of stuff to memorize. this is a series of probes done to see how ruby works. what you want to think about is what is ruby that it works this way?
  • Whorfian hypothesis: the users of a natural language tend to think ideas that are easiest to express in that language
  • Zipf's Law: the most commonly used words in a natural language are the shortest
  • consider Chapter 2's `principle of frequency'
  • learning Ruby isn't about figuring out how to do in Ruby what you do in Java. Rather, it is about figuring out how an `ideal' Ruby speaker would program it.
  • What would Yukihiro Matsumoto (matz) do?

3.7 material on natural language question from Thursday moved to a file, see Announcements

4 [W2] Thursday 14 Jan 2016:

Table 2: Clock summary at [2016-01-14 Thu 13:39]
Headline Time  
Total time 0:42  
[W2] Thursday 14 Jan 2016: 0:42  
  reminders   0:25
  more on Ruby Tricks   0:17

4.1 check out Tuesday the 12th's clock report

4.2 reminders

4.2.1 what is new on announcements page

  • hopefully everyone has found the textbook link by now (repeated on Tuesday posting)
  • general comments on natural language question
  • note: tar file for org file also contains the different notes: Note160105Line151Question and Note160107NaturalQuestion

4.2.2 re the concept questions.

  • they worked out well, unfortunately I am a bit backlogged at the moment, but hope to post answers to them before the weekend.
  • regarding implicit/explicit questions, I hope discussion of the issue near the end of `Writing That Paragraph 01' helps.
  • same assignment for next tuesday.
    • next week covers Chapter 3. I plan on holding the first practice quiz next thursday, open book/web 1 question, 15 minutes. On textbook from Chapters 1, 2, and up to and including 3.1.
    • question to bring to Tuesday's class: So far, we have been introduced in the textbook to many `new' words and phrases. For example, perhaps, `syntax' or `semantic intent'. Are there any that you think need further discussion at this point? If so, list your top choices (at most three) and for each, indicate a sentence (and its page number) for a usage of that word or phrase that looks like a good place to start sorting the matter out. If you can come up with a specific question about the word or phrase, that would be ok instead (or in addition to the sentence). Drop off a page at the start of class. Include your uwo email and name on paper handed in, in case I need to reach you.

4.3 more on Ruby Tricks

  • note: last class ended with us on line 138 of tricks 01 139 shows us self, which someone was asking about.
  • irb is tagging each prompt with a unique number for these examples
  • you can jot down the numbers of things you want to look at again later
  • this is not a bunch of stuff to memorize. this is a series of probes done to see how ruby works. what you want to think about is what is ruby that it works this way?
  • Whorfian hypothesis: the users of a natural language tend to think ideas that are easiest to express in that language
  • Zipf's Law: the most commonly used words in a natural language are the shortest
  • consider Chapter 2's `principle of frequency'
  • learning Ruby isn't about figuring out how to do in Ruby what you do in Java. Rather, it is about figuring out how an `ideal' Ruby speaker would program it.
  • What would Yukihiro Matsumoto (matz) do?

5 [W3] Tuesday 19 Jan 2016:

5.1 reminders (5 minutes):

Today we take a 10 minute break at 1:20 class ends at 2:20

  • This week you are reading Chapter 3 hopefully you finished up through 3.1 by today
  • Hand in your questions on material up to and including Section 3.1
  • I plan on holding the first practice quiz thursday. 1 question, 15 minutes. open book/web On textbook from Chapters 1, 2, and up to and including 3.1.
  • this week is the last week of Ruby. next week we will start on prolog and read Chapter 4. the week after that, we will skip to Chapter 13 on logic programming, which will support our prolog understanding.
  • Chapter 4 actually has interesting questions at the end of the chapter. 3 thru 5, 8, 15 thru 20. the other questions, like most so far are just checking to see if you remember what you read.

5.2 more on Ruby Tricks (15 minutes):

  • note: last class ended with us on line 211 of tricks 01
  • learning Ruby isn't about figuring out how to do in Ruby what you do in Java. Rather, it is about figuring out how an `ideal' Ruby speaker would program it.
  • What would Yukihiro Matsumoto (matz) do?

5.3 Group Programming Task 1 (15 minutes)

5.4 look at paragraph writing material (15 minutes)

  • read question, what is the question asking for
  • create topic sentence, your one sentence response/claim
  • what supports your one sentence response/claim
  • pick a few of the most important supports and build the body of the paragraph around developing each of the supports
  • don't include anything not relevant to the claim
  • conclude with something that follows from the supports and repeats the idea of the initial topic sentence. (note: at this point, the reader knows more about your thinking on the topic than they did at the start of the paragraph.)

5.5 10 minute break (10 minutes)

5.6 Group Programming Task 2 (10 minutes)

5.7 took some more time

  • extra time on each Group task to cover an answer
  • extra time on task 2
  • ended at line 48 of Ruby Tricks 02

6 [W3] Thursday 21 Jan 2016:

6.1 reminders 5 minutes

  • this week's reading was Chapter 3.
  • Tuesday's concept questions were posted with replies Tuesday.
  • First programming assignment due Tuesday (hand in in class or put in locker so that it is there when cleared when I get in Wednesday). Regarding lateness etc., see course outline.
    • read Ruby Project Writeup Format before doing practice and before writing up practice
    • read Announcement's page for discussion of project and announcements of updates.
    • keep eye on Task list for Addendum items
    • so far, there seems to be enough task items to keep people busy for 7 hours. email me if this is not true and more will be added.
  • next week's reading Chapter 4
    • on Tuesday, group will be asked to hand in exercise 4 from Chapter 4. 10 minutes class time will be allocated for sorting out the group answer.
  • bring in concept questions from readings so far Tuesday.

6.2 Ruby Tricks 02 25 minutes (start handing out quiz 11am)

  • last meeting, we were up to line 48
  • line 64 sort, uniq, reverse, reverse!
  • line 77 map, end.reverse
  • line 98 making your own iterator
  • line 120 implementing your own attraccess, classeval
  • line 156 instanceeval
  • line 187 Proc as block replacement
  • line 189 lambdas as Proc
  • line 211 nested class definitions

6.3 Practice Quiz 15 minutes (handout 11, start 11:05)

7 [W4] Tuesday 26 Jan 2016: First programming assignment due

7.1 NOTE: Today's class runs from 12:30 to 2:10

7.2 Collect concept questions.

none handed in

7.3 Comments (takes 4 minutes to read)

7.3.1 detailed note on first practice quiz on announcement's page

  • Chapters 1 thru 3 introduce a lot of concepts
  • Standard questions on such material are of the form:
    • How does this concept connect to what you already know? (the practice question was like this) – note that restriction was discussed in Section 2.3.2
    • How is this concept different from this other concept?
    • How are these two concepts related?
  • Standard answer format is a paragraph where you take a position and then defend it. A position without a defense is a weak answer.
  • Chapters 1 thru 3 are part of the coverage of both the midterm and the final.
  • See book definition of restriction. Why does book say assembly language is the least restricted language? What does this mean for claims that lacking garbage collection or dynamic typing are restrictions? Ruby lacks static typing. C lacks dynamic typing. Which is more restricted vis a vis assembly language?
  • 5 10s, 10 9s, 7 8s, 13 7s, 5 6s. 40 in all.

7.3.2 also reminder about first programming assignment

7.4 Note on Pascal (takes 3 minutes to read)

  • Pascal is frequently referenced in the textbook, why don't we study it.
  • Because, the capabilities of Pascal are essentially those of C
  • The person (Nicholas Wirth) who invented Pascal was more concerned with code correctness and portability than the people (Kernighan and Ritchie) who invented C.
  • Both were very concerned with efficiency and worked within the compiler writing technology of their times (1970s).
  • To limit the pointer errors and buffer overflow problems that are familar in C, Pascal made three decisions:
    • a pointer can only point at a record (struct), it can't point inside (no pointer arithmetic)
    • two arrays of different sizes are of different types.
    • types must match (so you can't pass an array of size 10 to a procedure that expects an array of size 9).
  • pretty much everything important follows from these viewpoint differences. without variable length arrays, Pascal programmers relied more on linked structures. The Pascal motto was: Programs = Algorithms + Data Structures
  • C strings are null terminated, while Pascal strings had a one byte length field at front (not directly changable).
  • Pascal did not have macros
  • both C and Pascal had the problem of free'ing space and forgetting you still had a pointer at it. it takes garbage collection to fix that.
  • C was designed to make updating the Unix system easier
  • Early (pre Mac OS X) Mac OS implementations were done in Pascal

7.5 Were any of the concept questions related to Section 4.1 and 4.2

(pages 77 – 90)? none handed in

7.6 Groups to answer question 4 from Chapter 4 10 minutes

7.6.1 Sneech Syntax

  • sneech ::= '*' | ( '(' <sneech> ')' ) | [ <bander> ] '*' <sneech>
  • bander ::= { '+$+' | '#' } | ( '%' <bander> )
  • which of below are not legal? why?
    1. (*)
    2. (+$+*)
    3. *
    4. **
    5. %%%**
    6. #####**
    7. (+$+#
    8. +$+#*
    9. *+$+#
    10. %#*+$+**

7.7 Can we simplify Sneech syntax

7.7.1 Can square bracket notation be eliminated?

7.7.2 Can curly brace notation be eliminated?

7.7.3 Can | notation be eliminated?

7.7.4 Can parenthesis notation be eliminated?

7.7.5 Can empty be eliminated?

7.8 First Look at Prolog

7.8.1 Definite clause grammars

  • sneech
  • exprV1
  • exprV2

7.8.2 Declarative Language

7.8.3 Algorithm = Logic + Control

7.8.4 predicates, lists, constants, variables, matching

8 [W4] Thursday 28 Jan 2016:

8.1 Reminders

8.1.1 Test drive peer evaluation form

  • contact group members who are not here.
  • form on announcements page and my gaul home directory
  • do you have email for your other group members?
  • do you think other group members should tell you when they aren't going to be in class?
  • if you are in a group of 3, the odds are good at some point during the semester you will be in class alone at group times. if you know the answers, this isn't a problem, but if you don't, what would be a reasonable way to proceed so that the time wasn't wasted for you? feel free to include your opinion on this and anything else that might help the group work be more productive in the comments section of the group evaluation form.

8.1.2 Next week we are into Chapter 13: Logic Programming

  • it takes a different approach to Prolog
  • Chapters 4 & 13 are the most abstract material we cover. But prolog itself gives us a tool to explore this material.

8.1.3 Bring concept questions Tuesday

  • no more than three questions.
  • be specific, page numbers, quotes, etc.

8.2 Prolog Continued

8.2.1 readFileToList.pl

  • reading a file and putting contents into a list of character codes.
  • using a helper to handle if then else situation
  • printing a list of character codes

8.2.2 z and sneechV5b.pl

  • cascading readFileToList and phrase
  • every character matters.
  • parsing is easier if you have a scanner to package up the input for you.

8.2.3 intV1.pl

  • DCG good for scanners and parsers.

8.2.4 intV2.pl

  • DCG can tell you more than just if the input was in the language of the grammar
  • note left recursion/ right recursion problem and how we got around it by cascading phrase with intVectorToInt
  • =, ==, is

9 [W5] Tuesday 2 Feb 2016:

9.1 Note: Today's class had 10 minute break at 1:20

9.1.1 Do we want to continue alternating or `re-vote'?

9.2 Reminders

9.2.1 Apparently the light bulb was out Thursday, sigh.

9.2.2 Today last day for late project 1's

9.2.3 Second programming assignment due in two weeks (ignoring Reading week).

  • same format as Ruby assignment except
    • different tasks
    • it will be done in prolog (preferably GNU prolog, but any version that implements the ISO standard should be fine)
    • will be asked for uwo email address in addition to name

9.2.4 DSL quarter decision for Thursday.

  • Do we
    • cover a week of emacs lisp, a week of javascript, then decide on last week?
    • decide before covering which will be the project and cover it first?
    • decide before covering to just do one example (and pick example), which would also be the project language.

9.2.5 Test drive peer evaluation form

  • how did it work out? as of Monday afternoon, none emailed; by Tuesday noon, 5 mailed in.
  • contact group members who are not here.
  • form on announcements page and my gaul home directory
  • do you have email for your other group members?
  • do you think other group members should tell you when they aren't going to be in class?
  • if you are in a group of 3, the odds are good at some point during the semester you will be in class alone at group times. if you know the answers, this isn't a problem, but if you don't, what would be a reasonable way to proceed so that the time wasn't wasted for you? feel free to include your opinion on this and anything else that might help the group work be more productive in the comments section of the group evaluation form

9.2.6 This week we are into Chapter 13: Logic Programming

  • it takes a different approach to Prolog
  • Chapters 4 & 13 are the most abstract material we cover. But prolog itself gives us a tool to explore this material.

9.2.7 Today's concept questions

  • no more than three questions.
  • be specific, page numbers, quotes, etc.

9.3 Prolog Continued

9.3.1 intV2.pl

  • DCG can tell you more than just if the input was in the language of the grammar
  • note left recursion/ right recursion problem and how we got around it by cascading phrase with intVectorToInt
  • =, ==, is

9.3.2 group lambdaTaskV1 to be handed in [10 minutes]

9.3.3 group lambdaTaskV2 [group work 10, break class discuss, cycle]

9.3.4 Something to think about

  • how to handle substituting into a lambda expression whose dummy variable is the same as the variable we are substituting into.
  • can we implement the reduced parenthesis notation of exhibit 4.12
  • reproducing the work of exhibits 4.13, 4.14, 4.15, 4.16, 4.17, 4.18, 4.19, 4.20 and exercises 15 thru 20
  • can we do exhibit 21 (filling in the missing parts)

10 [W5] Thursday 4 Feb 2016:

10.1 reminders

10.1.1 peer evaluations

10.1.2 next week, reading week, busy week

  • in busy week, 2nd programming task due on Tuesday
  • in busy week, midterm handed out Thursday

10.1.3 next week, a second practice exam on Thursday

  • 15 minutes, at end of class
  • PEE/PEA approach to paragraph writing

10.2 more group work on Prolog tasks

  • ended up going over development of some prolog code in class using `database' of chapter page ranges and index of keywords/phrases on pages.

10.3 SEE ANNOUNCEMENTS PAGE FOR REMINDERS I FORGOT TO REMIND ABOUT

11 [W6] Tuesday 9 Feb 2016:

11.1 today we work straight thru and get out 2:10

See survey!

11.2 reminders

11.2.1 peer evaluations

  • between 1/3rd and 1/2 done.
  • email to be sent out telling everyone that it will be noted as a negative for the group (my 6%) if they are not able to complete the exercise of getting all their members to submit a peer evaluation before midnight this Friday 12 Feb 2016.
  • some worried about not having anything bad to say about group members. if you are happy with your group, I am happy. I purposely did not construct this to be curved. use the mark as you think appropriate. if there is a problem, it is your main opportunity to encourage its correction without having to form a new group.
  • some didn't like being responsible for their class mate's marks.
    • in every group project, your behavior impacts your class mate's marks.
    • in industry, your behavior impacts everyone else's earnings and potentially the success of the entire company.
    • by thinking about how you would judge others, you will better understand what is going on when you are judged (marks at school, hiring, firing, promotion activities at work).
    • be glad I didn't pull a glengary glen ross or even just take the GE way. it is up to you to manage your group and the mark gives you a possible tool to do it with if you believe that people will change their behavior to earn a reward. (which the university seems to believe)

11.2.2 this week, reading week, busy week

  • in busy week, 2nd programming task due on Tuesday
  • in busy week, midterm handed out Thursday

11.2.3 this week, a second practice exam on Thursday

  • 15 minutes, at end of class
  • PEE/PEA approach to paragraph writing

11.2.4 survey [forgot on Thursday, do it today]

  • handling of Tuesday break
  • handling of GNU Emacs Lisp/JavaScript coverage
  • someone on Peer Eval asked for an additional category on `communication skills'. please indicate if you support or don't support this idea. if enough support, will bring it to a vote. these categories are for you all to use to either keep your groups working well or improve them.

11.3 more group work on Prolog tasks

  • backtracking, trace, cut
  • functors, asserta, dynamic, retract.
  • 10 minutes, status check, repeat

11.4 discuss PEA approach to paragraph writing 1:50

  • POINT (recycle question)
  • EXAMPLE
  • ANALYSIS – don't think I will guess how the example supports the point.
  • Nothing in paragraph not relevant to POINT.
  • Don't forget about concluding.
  • Look at Section 13.4 in textbook (page 368 – 370)
    • does first paragraph in section fit pattern? how does this paragraph work?
    • does second paragraph in section fit pattern? how does this work?
    • how do the rest of the paragraphs in this section work?
  • PQRST for reading (has wikipedia entry)
    • preview
    • question
    • reading
    • summarize
    • test (can you now answer above questions you had before reading).

12 [W6] Thursday 11 Feb 2016:

12.1 Covered Announcements Page

12.2 Finished up discussion of prolog by looking at various meta capabilities

12.3 Did second practice quiz

13 15 Feb 2016 – 19 Feb 2016: Reading Week

14 [W7] Tuesday 23 Feb 2016: Second programming assignment due

14.1 Remember: class ends 2:10 on Tuesdays from now on.

14.2 Would anyone miss Scheme if we spent last quarter of semester entirely on Haskell with a Haskell task list?

14.3 Upcoming midterm. Due before noon next Tuesday. If you bring it to Tuesday's class, that is 10% off. Fill it out (make copy for self) and put it in the locker.

  • If, after you put it in the locker, you decide you want to change something, print it off, fill it out again, and put new date on it, and put in the locker (only most recent copy will be marked).
  • Figure 6 questions. One per Chapter covered before this week (1 thru 5 plus 13 – as posted to announcements page 4 Feb). Each comparable in effort to the practice quiz/exams.

14.4 Questions?

14.5 People can't follow instructions and fill out a simple form. What does this mean for Amazon?

14.6 First JavaScript example

14.7 Note: I code JavaScript for Chrome.

  • If my example doesn't work on your device, consider porting it to your device as a task countable toward the JavaScript 7 hours. Remember 15 minute rule. Let me know if you want to share your results.

14.8 Group work – extensions to example

15 [W7] Thursday 25 Feb 2016: Take home midterm distributed

15.1 Reminders

  • Take home midterm distributed around 11am and the instructions gone over. The equivalent PDF file will be posted on course web page afterwards. Any questions regarding the exam will have their answers posted to the course announcements page.
  • Monday 29 Feb 2016: no further questions on the takehome midterm after 3pm today – expect to have last posting the course announcements page caused by such questions made by 5pm today.
  • Tuesday 1 Mar 2016: Take home midterm due in locker by noon today (locker to the cleared before class starts). Late penalty for bringing it to class to hand in.

15.2 Comments on Second Practice Quiz

  • Many people forgot to give an example (PEA). Without an example your answer is just a bunch of words where is it unclear if you understand what you are saying or just repeating parts of the text. Midterm and Final marking will not give you the benefit of the doubt on this.
  • Similarly, references to PASCAL as examples that are essentially lifted from comments in the text again give the impression that you can't relate the material to stuff you actually know and so aren't worth top marks.
  • Taking apart the question. You were asked about what was the most important reason for having a formal description of a language.
    • The first thing you have to consider is that there are two types of formal descriptions: description of the syntax and description of the semantics. Which one are you going to address?
    • If syntax, then the question arises of what is important about formal syntax. And what are you going to use as an example of that importance? The main place we have seen formal syntax in use so far is the Definite Clause Grammar examples in Prolog. There we saw how you could go from a formal grammar to a program that recognizes the language of interest. This example would lead us toward claiming that formal syntax is useful to guide the implementation of a parser.
    • If semantics, then the question arises of what examples do we have of formal semantics. So far, we haven't really seen one. In the second paragraph of 3.4.1, we learn that it is useful as a specification for a language implementer. The closest we have probably come is the example of Prolog rules being used to define how lambda calculus reductions actually work. [The English discussion of lambda calculus in the text was essentially an informal semantic.] If you were going to write a Java or C program that would do lambda calculus reduction, the claim is that the Prolog rules would clarify some important details (as well as making it easier to test your program).
    • Some people claimed that formal descriptions aided learning. This is somewhat awkward. Before taking geometry, you probably knew about lines, points, and triangles. Did spending a year working with the axioms that are the formal description of geometry advance that understanding? Did looking at the prolog code for reduce aid your understanding of lambda calculus? Most people have no problems writing C, Java, or Ruby without ever seeing a formal description of their respective syntaxes.

15.3 Some more JavaScript, HTML, and DOM

15.3.1 realMembers.length and group size check

15.3.2 buried in REW.minScoreMessage – should this be refactored to make logic cleaner?

15.3.3 if refactored, how would you accomplish DRY?

15.3.4 warning text message p and /p

15.3.5 attempt to force subject line on mailto: failed

15.3.6 REW.blankNonMembers in REW.verificationMessage. Why there?

15.3.7 check console for error messages

15.3.8 textbook pages 42 and 44

  • old-style and new-style functional programming languages
  • JavaScript and Scheme.

15.4 Hand out and go over take home midterm.

16 [W8] Tuesday 1 Mar 2016: Take home midterm was due in locker by noon today

16.1 Reminder

  • as mentioned before, there is at least one excused late midterm coming in, so don't talk, post, email, etc. about it before 5pm Wednesday
  • Third programming assignment due in two weeks. JavaScript task and writeup to come out soon. Writeup will be similar to Prolog one.

16.2 JavaScript: functions, objects, prototypes

16.3 JavaScript: TicTacToe handout

16.4 JavaScript: Group Work

16.5 JavaScript: class keyword that doesn't create a class (ES6)

17 [W8] Thursday 3 Mar 2016:

17.1 reminders

  • reading list for the rest of the semester on announcements page
  • the JavaScript writeup format includes a note about a partial code listing being what the example section is about
  • the first half dozen JavaScript tasks are on the task list
  • I think the peereval web page is now stable. Feel free to test it out. Once I get back to you summaries from the last evaluation process, there will be another group task to get everyone to do an eval (doesn't count to do it before the task is announced).

17.2 JavaScript callback example and event-driven programming

17.3 Questions about Midterm?

  • 9 more class meetings.
  • don't forget about concept questions regarding readings.
  • should we have another practice quiz next Thursday?

18 [W9] Tuesday 8 Mar 2016:

18.1 reminders from Thursday

  • reading list for the rest of the semester on announcements page
  • the JavaScript writeup format includes a note about a partial code listing being what the example section is about
  • the first half dozen JavaScript tasks are on the task list
  • I think the peereval web page is now stable. Feel free to test it out. Once I get back to you summaries from the last evaluation process, there will be another group task to get everyone to do an eval (doesn't count to do it before the task is announced).

18.2 Things I forgot to mention last thursday

  • 8 more class meetings.
  • don't forget about concept questions regarding readings.
  • should we have another practice quiz this Thursday?
  • note: this is our last week on JavaScript, next week: HASKELL
  • note: JavaScript practice due next Tuesday

18.3 Fun and Exciting JavaScript Stuff

19 [W9] Thursday 10 Mar 2016:

19.1 Why have prototype based inheritance rather than class based?

19.2 Note: Selenium

  • could be used for browser scripting in general, not just testing.

19.3 Why Node.js

  • bypass security restrictions of client side html
  • event driven web server turns out to run better than most thread based web servers
  • Node.js is written in C++, uses Google's V8 JavaScript compiler and maintains a thread pool to handle i/o hidden from developer.
  • To developer, all i/o is asynchronus – you initiate a request and set a listener to handle the response event.

19.4 Node.js DEMO

  • Node.js web server delivers peereval.html
  • peereval.js embedded in peereval.html as the web server didn't seem to provide access to .js file
  • modified peereval.html so that it sends a POST request to the web server and listens for a response event
  • web server responds to the POST request
  • peereval.html recieves response and updates DOM (used warning message mechanism)

19.5 Stuff left to do in class this semester

  • Take a look at Haskell starting next week
  • Based on the notion that the midterm was typical of the final
    • Figure out what a Ruby reference card might look like that would look like that would help with final exam questions on Ruby
    • Figure out what a Prolog reference card might look like that would look like that would help with final exam questions on Ruby
    • Figure out what a JavaScript reference card might look like that would look like that would help with final exam questions on Ruby
    • Figure out what a Haskell reference card might look like that would look like that would help with final exam questions on Ruby
    • Figure out what a shared reference page on the textbook material would look like that would help with final exam questions
  • Not everything on the final will be paragraph questions. For example, on the midterm, we had the notion of drawing a parse tree based on a grammar and a target text. From the same Chapter, a lambda reduction is another such task. What other things like that are in the textbook material?

20 [W10] Tuesday 15 Mar 2016: Third programming assignment due

20.1 Things to keep in mind regarding creating a reference page for textbook

  • if the reference page is plain text and formatted using enscript -2r and using the front and back of one page of paper, then we are talking about 276 lines of notes (138 lines on each side of a page).
  • since final exam covers 12 chapters (chapters 1 thru 11 plus 13), the level of coverage we are talking about in a 276 line package becomes 23 lines per chapter.
  • we have six more classes left, 3 Thursdays and 3 Tuesdays.
  • one approach would be to generate a draft of four chapter's notes each Friday, have it posted and reviewed so that it could be refined in class down to 92 lines.
  • there are about 15 groups out there, so if each group generated roughly 3 or 4 lines of notes across each of 4 chapters, this would generate roughly 150 lines of notes to be edited down.
  • how to avoid duplicated effort? Each chapter is broken up into roughly a dozen subsections.
    • split responsibility for subsections up among groups with 2 or 3 degrees of redundancy (i.e., 2 or 3 groups covering the same subsection).
    • have each group do 3 lines per chapter chosen randomly. for example, if a chapter has 11 subsections, do one line per subsection chosen by typing into irb the Ruby expression Random.new.rand(1..11) three times (if a subsection comes up more than once, then do more than one line on that subsection).

20.2 Haskell

21 [W10] Thursday 17 Mar 2016:

22 [W11] Tuesday 22 Mar 2016:

22.1 Reminder

  • Fourth programming assignment due in two weeks.

23 [W11] Thursday 24 Mar 2016:

23.1 Reminders:

  • Sunday 27 Mar 2016: Easter Sunday according to Academic Calendar Sessional Dates List

24 [W12] Tuesday 29 Mar 2016:

25 [W12] Thursday 31 Mar 2016:

26 [W13] Tuesday 5 Apr 2016: Fourth programming assignment due;

26.1 Reminders:

  • Fourth programming assignment due;
  • Also, final peer group evaluations due.
  • Wednesday, 6 Apr 2016: Last day of classes for this term
  • Thursday, Friday: 7 Apr 2016, 8 Apr 2016: Study days
  • Saturday: 9 Apr 2016: Start of final exam period for this term
  • Saturday: 30 Apr 2016: End of final exam period for this term

Created: 2016-03-10 Thu 18:12

Validate