CS 314 - Spring, 2008
Back to Frames version.
Dilbert
(jump to FOTW)
- April 29:
There were two questions during recitation about the Prolog Project.
- What should be the result of s([a], X)?
- For part 1, the result should be obvious. For part 2, the result
should be X = [[startopen, a, closeend]].
- What should be the result of smash(a, X)?
- The result of smash is always a list of elements (whose nesting
lists have been removed). Thus, the result is X = [a].
If you want to pick up your second midterm exam, come see me during
office hours. Good luck on the final exam!
- April 23:
Regarding the Prolog Project, here's a breakdown of the updates for
each question.
- Unchanged; remains 80% of total score.
- Now considered extra credit and worth 5%.
- Will be worth 20% of total score. The input string will be
generalized to include any number of nested lists (ie, lists of lists
of lists …). The smash function must be a deep recursive
function. The result should be a unique match (ie, typing a semicolon
to ask for alternatives should return none). Here is an example
query:
| ?- smash([a, [b], [[c]], [[[d, e], f]]], X).
X = [a,b,c,d,e,f] ? ;
no
You should also include a README file which will be worth 5% extra
credit.
- April 22:
Professor Paull's illness last week has led to several changes to
finish off this course. In essence, my updates last week were
obsolete one day after I posted them. Here are this week's updates.
- Project 2 has been graded and scores will appear soon on
Gradebook. The scores reflect a lateness penalty of 20% for each day
late. I used 16 test cases. If you want to know more details about
your score, come talk to me during office hours. Some common errors
were messing up the symbol table or assuming the grammar does not
include spaces. Virtually every modern language uses spaces to
separate tokens. Suppose I have an input string (z = a +
b). Now suppose I made a typo and forgot the operator (z
= a b). If there are no spaces, then (z=ab) will
be accepted by the grammar but not what I intended.
- The Final Exam will be held during the last regular class meeting
on Thursday, May 1, 6:40-8:00. It will be cumulative of all material
in the course and will include material from the remaining lectures
given by Professor Ryder and Professor Kremer.
- The Prolog Project is due on May 5, 23:59:59 (before midnight)
with no extensions. You may submit up to one day late for 20%
penalty.
- April 15:
I've been very busy the past few weeks, but let me catch up on some
updates.
- The second midterm exam has been graded; you can find your score
on Gradebook. Exams may be returned on Thursday or next Tuesday at
the latest.
- I will be grading Project 2 this weekend.
- The Prolog project is due on May 1 with no extensions. The
Handin system will be updated with the appropriate due dates. You can
submit up to 4 days late with 20% penalty per day. That also means I
have to wait until May 6 to start grading.
- The Final Exam is on May 8!
- March 26:
So the second midterm exam is scheduled for April 3. Recitations will
continue next week.
- March 25:
Assuming the second midterm exam is on April 1, recitations that day
will be canceled. I will not have extra office hours that day like
the first midterm (no one came!).
For the Scheme project, remember to document your project with a
README file. That is the easiest 20% of your score. Even if you
don't finish the project, you should still describe what you've done
and the problems you encountered. Over the next few weeks, I am and
will be very busy so my responses to email may be slow.
- March 12:
There were a handful of typos on the Homework 4 set of questions which
could have been misleading. I've typed up sample solutions, and
hopefully the typos will be clear when you compare with the solutions.
Keep in mind that there are multiple correct solutions; this is just
one way.
- March 4:
According to my trusty Scheme reference manual, there are three main
types of equality comparison (eq?, eqv?, and
equal?), another for numbers, and several variants on
those main types. My eq? example in class was bad.
Here's a better example. Try the following:
> eq? 'a 'a
> eq? '(a) '(a)
For practice, try writing these functions:
> (flatten '(a (b) ((c))))
==> (a b c)
> (my-append '(a (b)) '((c)))
==> (a (b) (c))
> (my-reverse '(a b c))
==> (c b a)
- February 28:
On the midterm exam, I graded questions {1, 6, 7}. The exams will
probably be returned next Tuesday. If you want to discuss any of the
three questions above, come talk to me. For questions {2, 3, 4, 5},
go see the other TA, Tuan Phan.
- February 20:
Let me make a slight correction on the extra office hours I mentioned
below. I probably should end them by 6:00, so I'll say 4:00-6:00.
- February 19:
Next Tuesday, February 26, will be the midterm exam. Recitations will
be canceled. For next week only, I'll have extra office hours on
Tuesday, 4:30-6:30.
I typed up a primer on
using gdb to debug C programs.
- February 14:
Happy Valentine's Day!
Unfortunately for someone though, a vehicle knocked down some power
lines. To repair them, PSE&G must shut down the power to
practically all of Busch campus. The power is expected to be off
during 5:00-6:00pm. Hence, my office hours will be effectively
canceled. Hope you find something useful to do for an hour.
- February 13:
I thought I should clarify about rewriting grammar rules using simple
productions. The EBNF syntax does not add any more flexibility or
power over the BNF, but it adds syntactic sugar, allowing rules to be
written more compactly or elegantly. What I tried to show in class
was one way of rewriting rules, and two students showed two more ways.
As for strictly using simple productions, I'll point out one student's
suggestion as the better example for question 1b.
E --> F | E + F | E - F
F --> O | F A O
A --> % | $
O --> 7 | x | ( E )
- February 12:
I wrote two versions of the
fibonacci program in C. They are basic examples of recursive and
non-recursive (loops) code. Compile it with gcc as mentioned below.
Run it by supplying the nth fibonacci number you want as an
argument on the command line. Examine the code and enjoy. Can you
tell what is characteristic for each version?
- February 5:
For homework #1, question 4, I coded the assembly style programs add and mult in C. You can compile
them with the command: gcc -o <output>
<filename>. Then run it by supplying a and b
as two arguments on the command line. For example:
prompt% gcc -o add add.c
prompt% ./add 3 -4
- January 30:
Our class time will remain at 5:15-6:10. I can't shift it earlier or
later because some students have constraints either way. However, I
will try to prepare 45 minutes worth of material. So we might be
finished by 6:00, and then you'd have an option to grab a bite before
lecture. Let me know if you have another suggestion.
I figured out that the emacs shortcut for indent-region is M-C-\.
- January 29:
Hello world!
(jump back to News)
Unix: sort
Emacs: M-x goto-line
Unix: history
Emacs: M-x spell
Unix: diff
Emacs: C-q
Unix: ln
Using the -s option will create
symbolic links.
Emacs: C-x C-o and M-\
Unix: head, tail, more and less
Emacs: C-x ( and C-x
)
Unix: grep
Emacs: M-a and M-e
Unix: du and df
Emacs: M-j
Unix: foreach (t/csh), for (bash)
Emacs: C-t, M-c, M-u, M-l
Unix: ls options
The man pages will show you
more options than a swiss army knife. Many of them act as filters.
For instance, you can sort files in reverse time-stamp order to find
your most recently modified files. One option you may find extremely
useful is -F.
Emacs: C-x 4
Unix: subdirectories
You would be well advised to group your files within subdirectories.
An obvious suggestion is to keep files pertaining to each project in
their own directories. Perhaps within those project directories, you
could have further subdirectories for test files. Keeping your files
organized should be a natural extension of the idea in keeping your
desk or important papers organized. Do you remember what
'.' and '..' refer to?
Emacs: M-C-f, M-C-b, M-C-n, M-C-p
Unix: man or woman
Emacs: M-x apropos
Each week, I will try to have a "Feature Of The Week". These first
features come first because they are the ones that you use to find out
about the other ones: Each provides documentation of a Unix or Emacs
feature. This week, type man
man as a shell command to see the Unix manual page on the
man program. Then, in Emacs, type
M-x (that's meta-x, or ESC
x if you prefer) describe-function apropos to see how the
apropos command works. If you want to
know about a command by its keystroke form (such as C-f) because you don't know its long name (such
as forward-character), you can say
M-x describe-key C-f.
- with credit & thanks to Dr. Brian Harvey
If you have time conflicts, email me; we can try making an
appt.
| Office: | CoRE 334
|
|---|
| Hours: | Th, 4:30-6:30
|
|---|
Updated: 4/29/2008
jhom@cs.rutgers.edu
Best viewed with