CIT 594 Previous Announcements
Spring 2012, David Matuszek

Date Announcements
March 31, 2012 I've posted my
March 21, 2012 I have posted my, which you may find helpful when working on your Parser.

CIS 550 is being offered in the fall. It was inadvertently omitted from the earlier posted schedule of courses. I strongly recommend this course for everyone.

Other good courses for MCIT students: CIS 552 Advanced Programming, CIS 554 Programming Paradigms (disclaimer: I teach this course), CIS 573 Software Engineering (Chris), others according to individual interest.

February 25, 2012 By the way, has everyone noticed that there is a link to exam questions on this page? It's been there all semester. smiley face
February 25, 2012

For those who are interested, I've just posted a new version of the Tokenizer test, This version fixes the errors noted on Piazza--and, of course, I did some minor code cleanup.

My TAs, Sarah and Chris, have been doing a great job of keeping up with the grading. Were it not for the errors in my tests, you would have your grades by now. The remaining delay is my fault.

Also, please note that if, because of an error in my tests, you changed your Tokenizer's next() method to return an ERROR Token when it should throw a NoSuchElementException, you should probably change it back. (Eclipse's Local History command can do that for you.)

February 23, 2012 I've posted an updated version of my Recognizers slides. The only change is to make some of the names more consistent with the supplied code for the Recognizer assignment.
February 20, 2012
  • When I asked that you turn in a program that takes no more than a minute to run, I was talking about your program; we are not going to run JRat on your program.
  • The following original (or "close to" original) step sort program works fine. The problem was that at some point the ">=" turned into ">".
    def stepsort(array):
        step = len(array) // 2
        # Note: Integer division is / in Python 2, // in Python 3
        while step > 0:
            i = 0
            while i < len(array) - step:
                if array[i] > array[i + step]:
                    array[i], array[i + step] = array[i + step], array[i] # swap
                    if i >= step:
                        i -= step + 1
                i += 1
            step = step // 2
    You may use any correct version in your assignment (test it!).
February 8, 2012

The enum TokenType declares eight values (INT, ..., ERROR). Since these are public, unless you write a Javadoc comment for each and every one of them, you'll get a warning message.

You really should specify how each of these is defined, but I do that in the Javadoc for my Tokenizer class, where I think it's more useful. If you do that, it's okay to ignore the warning in the TokenType class.

Also, I've added to the specification that toString in the Token class should return a string of the form type:text.

February 8, 2012

I've been checking my own code, and will be asking for slightly fewer warning messages. In Code style, you may continue to Ignore:

  • Unqualified access to instance field
    • Says you should put this. in front of every use of an instance variable. That's probably a good idea--it makes it obvious what your "global" variables are--but it's not a convention I've ever followed.
  • Non-externalized strings
    • The idea of "externalization" is to put all your strings into a file, so that if you ever need to translate your program into another language (like Chinese, not Python), all you have to do is translate the contents of this file, not edit the program.
February 6, 2012

Sam Moelius is giving a talk on "Java Generics", Thursday, February 9, at 1:30 inWu & Chen. You should attend if you can, because:

  • You might learn something useful about Java generics, and
  • He is applying for a lecturer position--possibly for MCIT.
February 1, 2012 The findAllSolutions method should find all solutions that don't revisit any locations, otherwise there could be an infinite number of solutions (which would be impossible to program). For example, in  2  1  1  0  the only valid solution is R-R. Otherwise, R-L-R-R, R-L-R-L-R-R, R-L-R-L-R-L-R-R, ..., anything of the form R-(L-R)*-R would be a solution.

Similarly, the solve method should produce a solution (if one exists) in which no array location is entered more than once.
January 26, 2012

Errors in current assignment (you knew there had to be some!):

In the definitions of leftmostDescendant() and rightmostDescendant(), I said that they each returned a leaf. That isn't necessarily so! They return the furthest node that can be reached by going only left or going only right. The leftmost descendant may have a right child, and the rightmost descendant may have a left child. Sorry for the confused definition.

January 23, 2012

Assignment 1 FAQ (Frequently Asked Questions):

Can I use toString() to display results?
No. The description of void add(T value) says, "Displays the new contents of the data structure, with the top or first element as the first line in the display." That isn't what toString() does.
What should the Iterate buttons do?
They should create a new Iterator for the given collection (Stack, Queue, or Deque). If you already have an Iterator for that collection, it should be discarded.
For Deque, how to I keep track of whether I'm iterating forward or backward?
Save the direction in some variable in your program.
How should I use the Data text field?
This field is used for both input and output. Some buttons, like Size, should display a number in the Data text field. To add a value to a collection, type it into the Data field and press Push (or Enqueue, or Add To Front/Rear). The user should not edit the JTextArea displays; in fact, feel free to setEditable(false) to these three text areas.
January 18, 2012

I'm not blacking out my site today, but I will mention techdirt, which is a site I read regularly.

As Will Rogers said, "We have the best Congress money can buy."

January 8, 2012 Note that we will be using Blackboard rather than Sakai for this course. Sakai was a pilot project, and isn't available to us again this semester. frowny face
January 6, 2012

The language for this course is Java 7; Read A Look at Java 7's New Features. You can get Java 7 from:

Other software we will be using: Eclipse (I'm using Eclipse Java EE IDE for Web Developers, but Eclipse Classic 3.7 should do), JRat (documentation is here), CountTokens.jar, and SwingExamples.jar.