• 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!