Programming Methods (2IP15): Frequently Asked Questons

2012-2013 Quartile 3

19-Feb-2013Added Java question about ignored package-info.java
19-Feb-2013Added DrJava question about JUnit 4
06-Feb-2013Translated and updated

General

NetBeans

DrJava

Java

peach³


Answers


General

What to do if I missed a deadline?

When you think you will not be able to meet a deadline, then you can submit a timely and motivated request for a deadline extension with the 2IP15 coordinator.

In such a request, always include

  1. Your name and id.number
  2. Which assignment(s) it concerns
  3. Your motivation
  4. Date/time when you will be able to submit

If the deadline has already expired, then you need to submit your request as soon as possible. Explain in the motivation also why the request comes so late.

What to do if my submission was rejected?

A rejected submission does not count, and it needs to be corrected. Proceed as with a missed deadline (because you did not fulfil the requiremens within the deadline). Mention as motivation that you want to correct a rejected submission, and explain why you think it was rejected.

Do this immediatly after seeing the rejection and do not delay this.

What to do if I want to retry an assignment?

If you are not satisfied with the result of an assignment and you think you can do better, then you can request a retry.

Proceed as with a missed deadline. Mention as motivation that you want to improve the result for the assignment, and explain what the nature of this improvement will be.

Note that not all requests for retries will be honored. Furthermore, for graded assignments, there will be an automatic deduction, and the requirements will possibly be checked more strictly.

What to do if I do not understand something?

If you do not understand something, then you can consult

If that does not resolve your questions, then

for practical questions concerning tools or the Java language
consult one of the assistants with the lab sessions, or contact them by email;
for technical questions concerning the subject matter
consult your instructor (possibly by email);
for logistical questions concerning organization and procedures
consult the lecturer (at a lecure or by email).

What is an easy way to stay up to date with the course downloads?

As of 13 Feb 2013, the course website and included downloads (except for material with restricted access) are also available in a Subversion repository. This repository has public read access.

Suggested way of using it:

  1. Get yourself a Subversion client.
  2. Check out the entire repository, using the address above for Subversion clients.
    You need to do that only once.
  3. Do not edit files in this checked out copy.
    If you want to use a downloaded file, copy it from the checked out copy of the site to the location with your own work.
  4. To obtain the latest changes from the repository, update your checked out copy, using your Subversion client.
    You can also

How can I use a personal Subversion repository?

GEWIS, the study association of the Department of Mathematics & Computer Science at TU/e, offers a free service for students to obtain a personal Subversion repository. See Projexy.

Configuration management is not a topic in the course 2IP15. You can consult Common Configuration Management Tasks: How to Do Them with Subversion.


NetBeans

Which version of NetBeans should I use?

We use NetBeans 7.2. That is, NetBeans projects that we make available will have been made with NetBeans 7.2.

There can be problems when opening such a project with an older version of NetBeans. If you make a project with an older version of NetBeans, then we often can process it (but there is no guarantee). If you use a newer version, then possibly we cannot open it, and cannot provide assistance or evaluate it.

If everyone uses the save version of NetBeans, then it is easier for us to address issues.

How do I use the 2IP15 PrePostDoclet in NetBeans?

  1. Download PrePostDoclet.jar.
  2. Store it in an easily accessible place.
  3. For each project, configure its properties:

How do I use the 2IP15 Checkstyle configuration file in NetBeans?

  1. Add the SQE Update Center:
  2. Install and activate Checkstyle:
  3. Configure Checkstyle:
  4. Apply Checkstyle to test it:

How do I generate javadoc for a NetBeans project with the source files in a default package?

You need to repair a configuration file. This screencast explains how to do it. Here is a summary.

  1. When you try to generate javadoc for a NetBeans project that has its source files in the default package, you get an error message like this:
        /.../nbproject/build-impl.xml:1195: No source files and no packages have been specified.
        BUILD FAILED (total time: 0 seconds)
    
  2. Click the URL for build-impl.xml , and that file will open in the editor at a line with a <javadoc ...> tag.
  3. Within that tag, four lines, down you see:
        <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
    
  4. Delete *.java, (including the comma), yielding
        <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
    
  5. Save the file, and try again.

How do I enable runtime assertion checking in NetBeans?

For each project, configure its properties to enable runtime assertion checking:

NetBeans behaves strangely (e.g., incorrect error messages); what now?

NetBeans stores some information about projects in a cache. This cache is not cleared by restarting NetBeans or restarting the operating system.

If information in the cache is inconsistent or corrupted, then NetBeans can be very persistent in giving incorrect error messages (e.g. Duplicate class or Class not found).

You can manually clear the cache.

How can I disable the spellchecker in NetBeans?

You can try:

Go to Tools > Plugins > Installed tab > Select the Spellchecker plugin > Press Deactivate > Restart NetBeans

Alternatively, you can disable it for certain file types only:

Windows (and Linux?):
Tools > Options > Miscellaneous > Spellchecker > uncheck (e.g.) Javadoc comments > OK
Mac:
NetBeans > Preferences > Miscellaneous > Spellchecker > uncheck (e.g.) Javadoc comments > OK

DrJava

How do I use the 2IP15 PrePostDoclet in DrJava?

  1. Download PrePostDoclet.jar.
  2. Store it in an easily accessible place.
  3. Configure the preferences:

How can I use JUnit 4 with DrJava?

  1. Locate a copy of junit-4.10.jar on your machine.
    NetBeans probably installed a copy of it somewhere.
    If you cannot find it, then you can download it from here and store it in an easily accessible place.
  2. Open the Preferences of DrJava.
  3. Below Extra Classpath, click on Add, and select junit-4.10.jar.
  4. Click OK.
  5. Open the Xxx.java and XxxTest.java files for testing.
  6. Compile them.
  7. In the Interactions pane, type: run org.junit.runner.JUnitCore XxxTest
  8. The interactions pane will show the JUnit output and then reset (output is deleted).
  9. Click the Console tab to see the JUnit output.

Java

Which version of Java should I use?

We use Java 7. However, most of the language constructs that appear in this course are available in Java 5.

What is the story behind final parameters?

The modifier final on a parameter in the header of a method definition concerns only the implementation, not the specification. That is why you will not see final in extracted javadoc.

For the implementation, it means that the method body cannot change this parameter (the compiler will enforce that). This offers several advantages:

N.B. If the parameter concerns a reference (to an object), then the method body cannot make this parameter refer to another object. However, when the object is mutable, the method body can change the object's state!

Why is my package-info.java ignored by javadoc, and how can I fix this?

It is a known limitation that package-info.java in an otherwise empty package is not processed by javadoc. It is not unreasonable to have such package directories, especially at the top level.

Workaround: Include a dummy class to make javadoc notice the package documentation and process it:

package ...;

/**  
 * Exists only to enable package-info.java to be processed by javadoc.
 */
class Dummy {
}

By making it package-private, this dummy class itself will not show up in the javadoc output, unless you specify the private or package option in javadoc.


PEACH³

How do I use peach³?

Currently, there is no on-line user documentation for the new peach³ web interface. The peach³ FAQ for students explains how to accomplish some common tasks.

What if I cannot register for 2IP15?

You need to register for 2IP15 via Oase. This registration is copied by peach³ within an hour.

In case of further problems, contact the 2IP15 coordinator.

System failures can be reported to E.T.J.Scheffers@tue.nl.

Why do my JUnit test cases not work in peach³?

Two common reasons are:


©2013, Tom Verhoeff (TU/e)
Feedback about this page is welcome