2005-Dec-15: With apologies I must postpone today's review session. We will hold it instead on Saturday, 2005-Dec-17, from 2 to 4 pm in SMudd 206.
2005-Dec-14: After considering the handful of requests and desires expressed by some of you, I have schedule the CS 11 review session on Thursday, December 15th, from 2:00 pm to 4:00 pm. Assume that it will be in our usual classroom space, but if we will need to use a different classroom, I will post it here.
2005-Dec-9: With apologies, I am cancelling class today due to the snow. As always, feel free to ask questions via email.
2005-Dec-9: Many of you, on lab-5, used either a length if-then-else chain or a complex loop to determine which histogram entry to increment. There's a simpler way to do it. Specifically, your computeDistribution() method could look like this:
public static int[] computeDistribution (double[] x) { int[] histogram = new int[10]; for (int i = 0; i < x.length; x++) { int index = (int)(x[i] * 10); histogram[index]++; } return histogram; }
The key observation here is that for each random value, the decile to which it belongs can be taken from the first digit after the decimal point. By multiplying by ten, you shift that digit one position to the left so that it preceeds the decimal point, and by casting the multiplied value as an integer, you eliminate all digits that follow the decimal point. Thus, you are left with the correct index into the histogram.
2005-Dec-8: Check out the answers to mid-term exam #2. If you have questions about my solutions or commentary, or about my grading on your exam, be sure to ask!
2005-Dec-6: As many of you have noticed, romulus is taking a beating tonight. There are simply too many people doing too much work from CS 11, CS 12, and CS 21. So, first, the deadline for project-3a will be pushed back by one day to Wednesday, 2005-Dec-07 at 11:59 pm. Second, note that there is another machine, remus that is essentially identical to romulus. Trying logging into remus if you are finding romulus to be slow and unresponsive.
2005-Dec-6: When submitting project-3a, note that the cs11-submit command can accept the names of multiple files to be submitted. That is, your submit command should look like this:
cs11-submit project-3a Verifier.java observations.txt
2005-Dec-2: If you were diligent enough already to have obtained a copy of Sudoku.class for project-3, then I apologize that you must do it again. This new version fixes an error that swapped columns and rows when printing the grids. To get the new version, just repeat the copy command that you used to get it in the first place:
cp ~sfkaplan/public/cs11/Sudoku.class .
2005-Nov-28: I have omitted an important detail regarding FileWriter objects! Specifically, when your code has completed writing into the file to which the FileWriter refers, then it must call the close() method within that FileWriter object. If your program ends without having called the close() method, than some or all of the data that you attempted to write to the file will not actually appear in the file at all. So, if fw is a pointer to a FileWriter object, you would use the following line to complete writing to its file:
fw.close()
2005-Nov-15: Because I have received so many critical questions about project 2, there is now a new deadline for project 2; specifically, Wednesday, 2005-Nov-30 at 11:59 pm. Do not wait to get started! It's a tricker project then it first seems!
2005-Nov-11: Two useful observations regarding Project-2:
In order to use the rewindFile() and readValue() methods from within your code, you must specify that those methods reside in the LifeApplet class. That is, when you call them, you must prefix them with LifeApplet., like this:
int x = LifeApplet.readValue();
In your evolve method, you must, for each cell, traverse its neighborhood within the grid to find out how many neighboring cells are alive. In contemplating how you might perform this task, you will quickly discover the problem of handling the neighborhoods of cells on the fringes of the grid. Avoid handling this problem by writing many special cases into your code. Instead, you should seek a single, general solution -- one that traverses the neighborhood of any cell, simply skipping any neighbor that does not really exist (because it is off the grid).
If you have no idea what I'm suggesting here, then come and talk with me. I do not want you to write dozens of lines of code to handle this problem. It should be manageable in about 5 lines of carefully constructed code.
2005-Nov-3: Project-2 has been posted. Don't delay -- get started! Also, check out Sample mid-term #2. Use it as preparation for the mid-term #2 that will be Friday, November 11.
2005-Oct-10: Many of you have tried to submit lab-4 and found that it did not work. I have fixed the problem (which was, frankly, my lack of preparation for submissions on this lab), and it should now work. Let me know if you continue to have problems.
2005-Sep-29: There will be no lab tomorrow. Instead, we will meet in our usual classroom for an optional review session. Please bring questions or else our review won't be very helpful to you. You should look at this sample week-5 mid-term to get a sense of the types of questions that you may see. Note that questions 4 and 5 on this sample mid-term are not ones that I expect you to be able to answer -- they use a concept that we have not yet covered, so ignore them for now.
2005-Sep-9: Please note the addition of the reading assignments page. Note the assignment for Monday, 2005-Sep-12!
2005-Sep-2: Note that the classroom has changed! Even though the Registrar's listings do not yet reflect it, we will be meeting in Seeley Mudd 207 (not 206) for lectures.
2005-Aug-20: Check here daily throughout the course for any timely updates and information. Begin by checking the course information page to learn more about this course. In particular, pay close attention to the unusual grading policy.