Blog
Final assignment posted
Wed Jun 20 16:01:03 EDT 2012
The final assignment has been posted.
Clarifications on homework
Tue Jun 19 11:33:02 EDT 2012
A couple of questions came up on the homework:
What do you mean by “Rewrite the hash table initialization to use an interval as we had orginally wanted to”?
Originally in the hash table constructor, we had wanted to iterate through the numbers from 0 to the SIZE of the table. Had Java made Integer implement Iterable<Integer>, we could have done that with:
for (Integer i : this.SIZE) { ... }
Alas, this won’t work because Integers don’t implement Iterable<Integer>. But the first part of the lab is all about implementing iterators on integers, so if you complete the first part, you should now be able to write:
for (Integer i : new HalfOpen(this.SIZE)) { ... }
That’s what was meant.
In quick lists you use both size and length interchangeably. Are they the same? Which should we use.
They are meant to be the same. It’s just a typo. Use size and replace all occurrences of length with size in the description of the assignment.
Class canceled today
Mon Jun 18 08:49:36 EDT 2012
Class is canceled today. See you Tuesday.
Solution to Exam 6
Thu Jun 14 10:00:06 EDT 2012
Here is a solution to today’s exam.
HashTable code from today
Tue Jun 12 11:40:58 EDT 2012
Here is the hash table implementation we wrote today in class.
New partners
Thu Jun 7 12:34:25 EDT 2012
Here are the changes made for the next round of partners. If you are not mentioned in this list, you should continue working with your old pair. Please report any problems ASAP.
pair15: psanshi ajacks |
pair16: deema sripley7 |
pair17: merylas schwarta |
The svn repository should be updated shortly.
Solution for Exam 5
Thu Jun 7 10:34:26 EDT 2012
Here is a solution for Exam 5.
Some code from class
Wed Jun 6 17:45:03 EDT 2012
Here is the code from yesterday and today.
Assignment 5 revised, new partners
Tue Jun 5 09:32:23 EDT 2012
As discussed in class, assignment 5 has been revised and finalized by adding the exercises from lab 7.
If you’d like a new partner for the remaining portion of class, send email to dvanhorn with the subject “CS2510 Partner”. The body should consist of two CCIS usernames. If you don’t submit a partner request by midnight tonight, we will assign you a partner randomly.
Solution for exam 4
Thu May 31 11:40:23 EDT 2012
Here’s a solution to today’s exam.
Code from yesterday and today
Wed May 30 12:33:19 EDT 2012
Here is the code from today and yesterday’s part 1 and part 2.
How to test exceptions
Tue May 29 00:19:38 EDT 2012
Here is a short example of how to test the exceptional behavior of a program.
import tester.*; |
|
// An example of how to test for exceptional behavior |
|
// Represents a function A -> B |
interface Function<A,B> { |
// Apply this function to given argument. |
B apply(A a); |
} |
|
// Represents inversion operation 1/x |
class Invert implements Function<Double,Double> { |
Invert() {} |
|
// Produce 1/x |
public Double apply(Double x) { |
if (x.equals(0.0)) { |
throw new RuntimeException("Divide by zero."); |
} else { |
return 1/x; |
} |
} |
} |
|
class Examples { |
void testInv(Tester t) { |
t.checkException(// The expected exception |
new RuntimeException("Divide by zero."), |
// The object that throws |
new Invert(), |
// The method (as a string!) that throws |
"apply", |
// The arguments to the method |
0.0); |
} |
} |
Homework deadline is still Tuesday at midnight
Mon May 28 22:21:58 EDT 2012
There was a typo on assignment 4 giving a due date of 5/27, which was not correct. The assignment is due Tuesday, 5/29 at midnight and the assignment has been corrected.
Solution to today’s exam
Thu May 24 11:35:08 EDT 2012
Here is a solution, in the form of running Java code, to today’s exam.
Today’s lab is cancelled
Thu May 24 10:25:07 EDT 2012
Today’s lab is cancelled. You should spend the this time working with your partner on the current homework assignment.
Code on safe casting, double dispatch, and instanceof
Wed May 23 14:07:06 EDT 2012
Here is the code from class today that shows the safe casting approach to structural equality, the double dispatch approach, and finally the perils of instanceof and casts, which should be avoided at all costs.
Code from today on exceptions and visitors
Tue May 22 11:42:54 EDT 2012
Here is the code from today’s class on exceptional behavior and the visitor pattern.
Solution for assignment 2
Tue May 22 00:17:29 EDT 2012
Assignment 2 should be graded by the end of this week, but in the meantime, solutions to 2.1, 2.2, and 2.3 are available.
Code from today
Mon May 21 15:17:33 EDT 2012
Here is the code from today’s lecture on sorting with comparison functions and using folds.
Bug in homework, change for Ian’s office hours
Mon May 21 09:41:58 EDT 2012
There is a bug in How to Design Classes that affects the current homework. In exercise 12.3 it says, “Design an extension for the classes in figures 47 and 48 that deals with equilateral right triangles.” After a moment’s thought, you’ll realize there is no such thing as an equilateral right triangle. Instead you should design an extension for a isoscoles right triangle.
Ian Johnson has shifted his office hours back by a half an hour. His office hours are now held Friday from 1:30-3:30pm as noted on the General page.
Grammatikos office hours, Assignment 3 finalized
Thu May 17 09:37:30 EDT 2012
James Grammatikos has finalized his office hours, which will be held between class and lab on Tuesday, i.e., 11:30am to 1:30pm.
Assignment 3 has been finalized by adding some book problems.
Today’s code
Tue May 15 12:50:39 EDT 2012
Here is today’s Java code from class. Also, remember to think about how to translate our accumulator design of reverse from ISL to Java:
;; Reverse the given list of integers |
;; LoI -> LoI |
(define (my-reverse lon) |
(reverse/acc lon empty)) |
|
;; LoI LoI -> LoI |
;; ACCUM: rev represents list of elements we've seen so far, in reverse order. |
(define (reverse/acc lon rev) |
(cond [(empty? lon) rev] |
[(cons? lon) |
(reverse/acc (rest lon) |
(cons (first lon) rev))])) |
No need to interleave
Tue May 15 09:41:02 EDT 2012
The interleave problem of the current assignment requires you to use concepts we haven’t covered in class. You should try to solve the problem and see what goes wrong, but the interleave part of the assignment will not be graded.
Two new 2510 tutors and CCIS tutors
Mon May 14 09:01:51 EDT 2012
We’ve added James Grammatikos and Jason Shrand to the course staff as tutors. James and Jason will be holding office hours throughout the week and are here to help you. Be sure to visit them. See the General page for details.
Monday 5:15-7:15pm Dan King, 102WVH
Wednesday: 1-3pm Stephanie Lund, 102WVH
Assignment 2 is up
Thu May 10 20:32:12 EDT 2012
Assignment 2 is finally up. It’s due date has been moved back to Tuesday at midnight so that we can show you how to use svn to submit your homework in lab on Tuesday.
Homework partners
Wed May 9 17:41:37 EDT 2012
Here are the initial partner assignments. If something isn’t right, email dvanhorn immediately.
pair01: acalo joejeno |
pair02: kevin08 kmiao |
pair03: sripley7 ajacks |
pair04: merylas bjliuy |
pair05: michng goodwin |
pair06: guom dsimond |
pair07: jcaron jwall |
pair08: deema psanshi |
pair09: schwarta gabriel |
pair10: jbrooks2 ascherj |
pair11: bmccabe4 jkosof |
pair12: cungtran gudosha |
pair13: yusuf.m nnamdi93 |
pair14: jinwow gudosha |
Tester library
Wed May 9 08:56:37 EDT 2012
We will use the Tester Library developed here at NEU by Prof. Proulx in order to test our Java programs.
To use the library, you’ll need to download the tester jar file.
Past exams
Wed May 9 00:59:17 EDT 2012
Here is a complete set of recent exams from Fundamentals II. Much of this material is not relevant for Thursday exam, since it will only cover what we have studied in class, lab, homeworks, and course readings so far. However, some of these problems may prove useful in preparing for Thursday’s exam. The remaining material will become more useful as the semester goes on.
Exam 1: Spring 2010 (A).
Exam 1: Spring 2010 (B).
Exam 1: Summer 2010.
Exam 1: Fall 2010.
Exam 1: Spring 2012 (A).
Exam 1: Spring 2012 (B).
Exam 2: Summer 2010.
Exam 2: Spring 2010 (A).
Exam 2: Spring 2010 (B).
Exam 2: Fall 2010.
Exam 2: Spring 2011.
Exam 2: Spring 2012 (A).
Exam 2: Spring 2012 (B).
Exam 2: Spring 2012 (H).
Exam 3: Fall 2009.
Exam 3: Spring 2010.
Exam 3: Fall 2010.
Exam 3: Spring 2011.
Exam 3: Spring 2012.
Ian Johnson
Tue May 8 09:39:07 EDT 2012
Ian Johnson has signed on as the head TA for our course. Ian is a PhD student in programming languages and does hairy research on automated reasoning about programs with Profs. Van Horn and Shivers.
Check out the General page for his office hours.
Don’t have a CCIS username?
Mon May 7 13:21:56 EDT 2012
If you do not have a CCIS account, you should see the Systems office on the third floor of WVH today! It takes two days to process the request so you may not have an account by the time tonight’s homework is due. If that’s the case, please submit the CCIS username you requested and indicate in your submission that the account is still pending.
Code from today’s lecture
Mon May 7 13:21:56 EDT 2012
Here is the code from today’s lecture.
Welcome to CS2510
Sun May 6 23:04:12 EDT 2012
We hope you’ll have fun.
Programming is like Cooking
Here’s a recent NYTimes article (There’s the Wrong Way and Jacques Pépin’s Way) about the chef Jacques Pépin, author of La Technique. There are many fruitful analogies between programming and cooking; one of which is that Pépin’s "technique" is very much like our design recipe. The goal of Fundamentals I and II is to instill the essential technique of great programmers, and to borrow Pépin’s words, "Once you learn the technique, then can be a creative programmer; a great programmer is first a tehnician." And there’s only one way to become a master of technique: "you have to repeat, repeat, repeat, repeat until it becomes part of yourself."