Git Product home page Git Product logo

forum's People

Contributors

damithc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

forum's Issues

Addressbook-level2 - Source code do not match byte code

Hello everyone,

I was trying to debug after adding some dummy values into the address book. I used the step into function to show me how the program runs. However, when it reaches the line where it shows the person I've added, it does not go into the Address/Email/Phone/Name/Person etc class to show me how each line of code is executed.

What does it mean "Source code does not match byte code"?

screen shot 2017-09-09 at 2 01 35 pm

Accept GitHub invitations if you haven't done so already

Trial peer evaluations for Phase A

We are conducting a trial peer evaluation for phase A using the TEAMMATES system, to get you guys familiarized with the peer evaluation system and the evaluation criteria. You should receive instructions from TEAMMATES shortly, in your NUSNET email. Let us know if you still have not received that email by 7pm today (Monday Sep 4th).

Be sure to read our instructions about peer evaluations before you submit the peer evaluation in concern.

How to set up IntelliJ with JDK?

Hi! The instructions linked to in the readme of addressbook 2 go as follows:
Set up the correct JDK version [from blank screen of IntelliJ]:
Click Configure > Project Defaults > Project Structure
Click New... and find the directory of the JDK

I downloaded the latest version of JDK (not that I'm entirely certain what it is), and am not sure what the directory I'm looking for is. Some help would be appreciated! (I'm on Mac, if that makes a difference). Thanks!

Problem running original code

When i tried to open the project, it requested me to choose a GRADLE so i selected the recommended option. Before i tried changing any of the programming, i ran the program under JUnit and it passed all tests. However, i cannot run it and an IOException is thrown at my stage.setScene(...) or stage.show() line in the GUI code.
Am i missing any packages that should be installed?

📣 Weekly project milestones, notes about AB-L4

Weekly project milestones

Note that there are weekly project milestones in weeks 7-13 that you need to achieve. Missing multiple project milestones will count against the project management component of your final project grade.

AddressBook-Level 4

  • nus-cs2103-AY1718S1/addressbook-level4 is now officially ready for forking. If you forked earlier, please sync your fork with the latest changes.
  • If you encounter any problems when using addressbook-level4, please post in this forum. Reporting technical issues via forums like this is part of the intended learning experience of the module.
  • If you have suggestions or bug reports, you are encouraged to post at the parent repo se-edu/addressbook-level4. PRs are welcome too.

Progress Tracker

Hihi

Anyone knows how the progress tracker thing works? Can I open my own issue or must I wait till the bot assigns me one? It doesn't assign all the stars too tho like for week 2 there's only progress for 1-star tasks.

Thanks

Failing unit tests for addressbook level2

Hey guys, anyone facing the issue of failing the unittests for addressbook level 2?

  • It is about the storage file test
  • I think both of the xml files exist.

'java.nio.file.NoSuchFileException: test/data/StorageFileTest/ValidData.xml

at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at java.nio.file.Files.newBufferedReader(Files.java:2784)
at java.nio.file.Files.readAllLines(Files.java:3202)
at seedu.addressbook.util.TestUtil.assertTextFilesEqual(TestUtil.java:139)
at seedu.addressbook.storage.StorageFileTest.assertStorageFilesEqual(StorageFileTest.java:99)
at seedu.addressbook.storage.StorageFileTest.save_validAddressBook(StorageFileTest.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

LoadException when trying to follow FXML tutorial

Hi! I've followed the FXML tutorial on the module site up to the point where I've created PersonOverview.fxml, RootLayout.fxml and have just started on MainApp.java. The tutorial provides a lot of code to copy, but it crashes when I run it. Can anyone advise me if they can tell what I'm doing wrong? The problem bits of code seem to be:

// Load root layout from fxml file.
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(MainApp.class.getResource("view/RootLayout.fxml"));
            rootLayout = loader.load();

and:

// Load person overview.
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(MainApp.class.getResource("view/PersonOverview.fxml"));
            AnchorPane personOverview = loader.load();

and give me the following error:

javafx.fxml.LoadException: 
/Users/josephbrough/Desktop/snart/cs2103/AddressApp/out/production/AddressApp/seedu/address/view/RootLayout.fxml:12

	at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
	at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:103)
	at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:922)
	at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:971)
	at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:220)
	at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:744)
	at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
	at seedu.address.MainApp.initRootLayout(MainApp.java:34)
	at seedu.address.MainApp.start(MainApp.java:21)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Caused by: java.lang.ClassNotFoundException: seedu.address.view.RootLayout
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:920)
	... 15 more
javafx.fxml.LoadException: 
/Users/josephbrough/Desktop/snart/cs2103/AddressApp/out/production/AddressApp/seedu/address/view/PersonOverview.fxml:15

	at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
	at javafx.fxml.FXMLLoader.access$700(FXMLLoader.java:103)
	at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:922)
	at javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:971)
	at javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:220)
	at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:744)
	at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2707)
	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2527)
	at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
	at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
	at seedu.address.MainApp.showPersonOverview(MainApp.java:53)
	at seedu.address.MainApp.start(MainApp.java:23)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Caused by: java.lang.ClassNotFoundException: seedu.address.view.PersonOverview
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:920)
	... 15 more

Java exceptions - When should we use it, and when not to?

From what I read, exceptions should only handle 'unexpected' events, whereas IndexOutOfBounds should've been expected and checked.

From this, seems that many exception handlers in the 2K-LOC code should've been checked with if-else statements instead, ie. IndexOutOfBounds exception in Command.getTargetPerson.

Or is my understanding of exceptions wrong?

📣 If your 2KLoC compulsory LO did not meet our requirements

If you failed to submit the 2KLoC compulsory LO W5.4 Can work with a 2KLoC code base or if your submission did not meet the requirements (based on tutor feedback during the tutorial or PR review), you will lose all 5 participation marks allocated for phase A.

However, there is a way to get the 5 marks back: Do an enhancement (can be the same enhancement you did for level 2, or a similar one) to addressbook-level3 and create a new PR against our repo. Ensure that the new PR rectify all the problems noted in the original PR, such as broken/missing JUnit tests. Level 3 does not have I/O tests; that requirement can be omitted.

Note that the PR title should be same as the original PR (i.e. same LO ID as before and using the Phase A team ID). The deadline is your week 6 tutorial (i.e. next week).

📣 Some info about lecture 4

  • Week 4 is our class photo week as per CS2103 tradition; we'll be taking a few photos during the lecture this week which will be posted in Facebook later (example from last year). If you don't like your photo being taken/posted, you may want to watch the webcast instead.

  • You may want to have a look at the questions to be discussed during the lecture.

  • As before, you can stay back after the lecture for one more hour to work on this/last week LOs. I'll stay back as well for you to ask questions.
  • As before, you guys can come and work on CS2103/T stuff in COM1 02-13 on Saturday 0900-1200. I'll be there during that period for you to ask questions. This may be especially suitable for your team to work together on W5.4 Can work with a 2KLoC code base (it has a teamwork component)

📣 This is a good time to learn JavaFX

As mentioned in Lecture 5:

  • AddressBook Level 4 (which we'll start using in week 7) uses JavaFX technology for the GUI. JavaFX has a significant learning curve. All of you are well advised to get at least a basic understanding of JavaFX during this week because there will be no time for it later. In addition, at least one member of the team should aim to get a good grasp of JavaFX. We have provided you with a detailed tutorial in W6.2 Can use JavaFX to build a simple GUI ⭐️⭐️⭐️

  • On a related note, AddressBook Level 3 (which will be used only in week 6) is almost the same as Level 2 except that it uses a small bit of JavaFX to add a very simple GUI.

JUnit Test Issues

Hi has anyone failed some test methods StorageFileTest and/or know how to go about solving them? I have passed all other test methods and classes except for 3 of the methods in StorageFileTest. I can't quite understand what those test methods do exactly so I can't really source out the problems.

image

  1. Regarding theNoSuchFileException: I see that the path to ValidData.xml file correct. I even changed the file separator in the methods from "/" to "\" but it still doesn't work.

  2. Regarding the Assertion Error, I don't understand why there is a difference in hashcode. Even though I created a new CommandTest file, I followed closely to the other commandtest files and it passed its JUnitsTest.

Will greatly appreciate any help on this matter!

W4.1b Can use Git branching ⭐️

Hello everyone,

I was trying to do the step 9 of the merging of branch. However, I got a different thing from the one showed to us.

screen shot 2017-09-06 at 2 26 37 am

What is the orange coloured line representing?

📣Additional requirements to get an A+

The good news: CS2103/T gives a relatively higher percentage of A+. If you are expecting an A- or an A, you might already be in the range for an A+.

The bad news: We do not give A+ based on marks alone, as was mentioned in lecture 1. Marks can get you up to an A only.

Additional things you need to do to get an A+:

  • Extra requirements are given in the [Module website: Admin: Appendix C: What are the extra requirements to get an A+?]
  • In particular, you are encouraged to be active on the slack channel and our forum and give your inputs to ongoing discussions so that other students can benefit from your relatively higher expertise that makes you deserve an A+.
  • Whenever you can, go out of your way to review PRs created by other class members, even if they are not in your team. For example, these few days you can review PRs created for W5.4 Can work with a 2KLoC code base by class mates.

Passes manual testing, but automated testing returns "NoSuchElementException: No Line Found"

Here's the relevant PR: https://github.com/nus-cs2103-AY1718S1/addressbook-level2/pull/400

I made an enhancement that prompts the user for name, phone, email, address & tags one by one as shown below. This passes manual testing, however it returns “NoSuchElementException: No line found” if I use file redirection with input.txt instead.
screen shot 2017-09-12 at 1 07 56 pm
the compile error
screen shot 2017-09-12 at 1 17 17 pm

Here's what input.txt looks like:
screen shot 2017-09-12 at 1 29 39 pm

Seems like it's something to do with Scanner.nextLine() not detecting a next line, but nextLine() is the only way to read in strings with spaces in them. Any idea what is causing this?

Creating FXML

Hi, for w6.2, we need to create some FXML files for the javaFX project. The instruction given is to right click on package and click new and click on FXML. I can't seem to find the FXML option when i do that. Anyone facing the same issue? Thanks!!

Resolving HashMap<String, String> collisions in in LO-Collections

How strict is the requirement for the LO to be completed in procedural form through a HashMap<String, String> replacement of String[]? I realize that if I have two people, of the exact same name, phone number and email, collisions can happen and they should be treated as two separate Persons. Is it ok if the LO was completed using a wrapper class with an internal HashMap implementation?

📣 Phase A peer evaluations [Compulsory ❗️]

The Phase A Peer Evaluation session is now open. You should have received an email from TEAMMATES regarding the session already. If not, email teammates [at] comp.nus.edu.sg to request for a re-send (remember to state your NUSNET email and full name in the email).

Note that submitting peer evaluations is compulsory. If you fail to submit peer evaluations, it will affect your participation marks. Similarly, your peer evaluations can affect participation marks of the peers you evaluate; therefore, do peer evaluations sincerely and fairly.

📣 Regarding automated checks on your PRs

When you submit your PR this week (week 5), out GitHub setup will automatically run your JUnit tests, I/O tests, and do some further automated checks on your code. The result is shown like the screenshots below, at the end of the PR thread (it takes a few minutes for the test results to appear; they are run every time you push new commits to the PR branch):
[check passed]
image

[check failed]
image

In cased it shows a check failure, you can click on the Details link to see the log file of the checks, from which you can get some clues as to why the check failed. Here's an example where a specific JUnit test failed.
image

Getting these checks to pass is not compulsory for this week. They are there to help you detect problems. As for grading, it is fine as long as you can show that tests pass on your computer, even if these online checks failed.

[W4.3d] Split Address

Hello,
I have created the classes as indicated on the diagram, to store the address info in separate objects instead of one long String, but then I had to make a decision regarding the format of the input. The default format, as far as I know, goes like this: a/123, Clementi Ave 3, #12-34, 231534.
We can say where the address starts and ends, but street name can comprise of numbers, block number is a number and the postal code, depending on country, may have different formats. If we let user put in this field whatever he/she chooses, how can we say what should go where?
Following all above, I have made an extra assumption that the address has 3 times ", " that separate the input, no matter if certain part of it is applicable or not, but this changes the required input and resulted in test failure on my pull request. Could you please state what I am supposed to do about the ambiguities?
Thanks in advance for help.

Aren't interfaces only supposed to have abstract methods?

If you look at the interface ReadOnlyPerson.java (under src/seedu/addressbook/data/person) it implements several concrete methods, which should make it count as an abstract class instead:
screen shot 2017-09-15 at 6 03 02 pm

Person is a class that implements the ReadOnlyPerson interface, and it also seems to inherit the concrete methods implemented in the interface as it makes those function calls without reimplementing the functions themselves. What then, differentiates an interface from an abstract class?

📣 Ways to use (and not to use) slack

  • As mentioned in a previous lecture, you can be a bit informal in the slack channel (it's just chat), as long as you stay within the bounds of civility. 🤡 🤣

  • Note that you can create private channels in our slack to chat with your team members. Your messages will only be visible to the members of the group. Not even the admins will be able to see those messages.
    image

  • You can also send direct messages to team members.
    image

  • Sending direct messages to the tutors/instructors is highly discouraged. Adding the tutor to your team's slack group is not allowed either.

    Reason: Your tutor is usually another student like you and I must protect them from unfair demands for their attention.)

    • If you have a question, please ask in the #cs2017aug-students channel or in this forum instead. That way, more people can benefit from the discussion.
    • If it is strictly not relevant to any other classmates, you can email the tutor instead so that he/she can answer at his/her convenience.
  • Most importantly, slack messages are auto-deleted after a while. Therefore, if you receive a message from a team member you might want to keep a record of, it is better to take a screenshot.

  • From now on I will discuss some sample exam questions in the slack channel from time to time, to help you practice for the exam, MCQ questions in particular. You are highly encouraged to install the slack mobile/desktop app and keep the notifications enabled if you don't want to miss those.

    Reason: Periodic 'spaced' interaction with concepts is known to enhance long-term retention of concepts in memory (as opposed to intensive cramming just before exams, which only helps short-term retention).

What is HashSet & Streams

Hello everyone,

I have read about what Streams means but I still do not really get it. It is stated in tutorialspoint that streams represents a sequence of objects from a source. What does this means? What is pipelining?
I also do not understand how they are used. Even though there are examples in the website. But I am still unsure how they are used and why.

What does HashSet exactly do?
I do not understand what is this line doing.

screen shot 2017-08-29 at 5 24 39 pm

"Could not find or load main class..." - Addressbook-level2

Hello everyone,

There seems to be a problem with my Intellij. After forking and cloning it. I imported the project to Intellij and tried to run it. However, there is this error "Error: Could not find or load main class seedu.addressbook.Main". I did not make any changes to the program. I just tried running it.

screen shot 2017-09-07 at 3 04 58 pm

Which project language level should I use?

Hello everybody,

I would like to know on which project language level should I use? I tried the different levels, but all of them give me errors.

screen shot 2017-08-24 at 12 20 50 am

I received this error while trying to run the address book.main().

screen shot 2017-08-24 at 12 22 42 am

Addressbook-level2

Hello everyone,

I have one question to ask. Is there supposed to be 100 errors after building the program that has been forked and cloned?

I tried running it. However, they told me "Error: Could not find or load main class seedu.addressbook.Main". I know I should not run it since there are so many errors after building it.

About the new system for progress tracking

We are trying out a new system to help you track your progress through the numerous Learning Outcomes of the module. While it will take some more time to iron out the kinks in it, it is now stable enough for you to start using it.

How it works: Every week, a bot will create an issues for each of you for LOs in our nus-cs2103-AY1718S1/progress issue tracker and assign the issues to you. You can tick the LOs in those issues as you achieve them (i.e. self-reporting). Example below:

  • W3.2d Can decide when to apply a given refactoring

Keeping track of your progress through LOs this way is optional but you are highly encouraged to do so because it will help us monitor your progress and identify,

  1. those who are falling behind and possibly in need of more help
  2. those who are doing extra and may be eligible for CS2103R and A+

We have now created issues for weeks 2-3. We'll be creating week 4 issues shortly.

Post in #15 if you cannot access the nus-cs2103-AY1718S1/progress or you do not have any issues assigned to you in that issue tracker

Some advice for this week's tutorial

Guys, in this week's tutorial we would like to ensure that,

  1. All students are able to create branch-based PRs without accidentally mixing commits between PRs (a common mistake)
  2. At least some members of the team are able to resolve merge conflicts and merge PRs

Reason: These two skills are going to be essential for you in future weeks because most of your work will require creating PRs.

Therefore, I strongly encourage you to do the W4.1 Can create PRs on GitHub before coming to the tutorial. If not, you'll have to do it during the tutorial and then there will be less time for you to do the other activities we have planned for this week's tutorial (i.e. T4)

📣 Get started on this week's compulsory LO

Some notes about upcoming compulsory LO W5.4 Can work with a 2KLoC code base:

  • LO instructions have been refined. In particular, there is a part that you need to do as a team.
  • This LO needs some time to finish; start it early.
  • Compared to the 1KLoC LO in week 3 (which we accepted as long as the code was working), acceptance criteria for this LO is stricter. e.g. code, tests, and docs need to be updated and the work needs to be submitted as a clean PR.
  • As you do this LO with your team members, observe their conduct, helpfulness, technical expertise, etc. You'll need to submit peer evaluations for your team members in week 6.

[W4.4c] exercise [addressbook-level2: LO-Exceptions]

Hello,
In the exercise it is written:
The current code does not handle the situation where the user deletes the storage file while the AddressBook program is running. Use exceptions to handle that situation.

I could not find a case when this causes problems. The file is read at the very beginning of the execution and if it does not exists at that point, a new one is created. Then after every update the whole data that is held in the memory is saved to the file, no matter if it exists or not. Even if we delete the file before performing the "exit" command, it still saves the data right before closing. Why and where we would consider introducing exception caused by the deletion?
Thank you for help.

Checkstyle, error while loading the rule file

When I try to follow the DeveloperGuide:

1.3. Configuring Checkstyle-IDEA
...
7. Use the checkstyle configuration file found at config/checkstyle/checkstyle.xml

Even though I have followed all the previous instructions, I get an error message:

Loading the rule file caused an error.

org.infernus.idea.checkstyle.exception.CheckStylePluginException: <html><b>The Checkstyle rules file could not be parsed.</b><br>SuppressionCommentFilter is not allowed as a child in Checker<br>The file has been blacklisted for 60s.</html>
	at org.infernus.idea.checkstyle.checker.CheckerFactory.blacklistAndShowMessage(CheckerFactory.java:197)
	at org.infernus.idea.checkstyle.checker.CheckerFactory.blacklistAndShowMessage(CheckerFactory.java:213)
	at org.infernus.idea.checkstyle.checker.CheckerFactory.createChecker(CheckerFactory.java:145)
	at org.infernus.idea.checkstyle.checker.CheckerFactory.getOrCreateCachedChecker(CheckerFactory.java:75)
	at org.infernus.idea.checkstyle.checker.CheckerFactory.checker(CheckerFactory.java:57)
	at org.infernus.idea.checkstyle.checker.CheckerFactory.verify(CheckerFactory.java:44)
	at org.infernus.idea.checkstyle.ui.LocationDialogue.attemptLoadOfFile(LocationDialogue.java:205)
	at org.infernus.idea.checkstyle.ui.LocationDialogue.access$800(LocationDialogue.java:35)
	at org.infernus.idea.checkstyle.ui.LocationDialogue$NextAction.actionPerformed(LocationDialogue.java:247)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6541)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6306)
	at java.awt.Container.processEvent(Container.java:2237)
	at java.awt.Component.dispatchEventImpl(Component.java:4897)
	at java.awt.Container.dispatchEventImpl(Container.java:2295)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
	at java.awt.Container.dispatchEventImpl(Container.java:2281)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.awt.EventQueue$4.run(EventQueue.java:735)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:821)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:645)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.awt.Dialog.show(Dialog.java:1084)
	at java.awt.Component.show(Component.java:1679)
	at java.awt.Component.setVisible(Component.java:1631)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at org.infernus.idea.checkstyle.ui.LocationDialogue.setVisible(LocationDialogue.java:158)
	at org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel$AddLocationAction.actionPerformed(CheckStyleConfigPanel.java:265)
	at org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel$ToolbarAction.run(CheckStyleConfigPanel.java:353)
	at org.infernus.idea.checkstyle.ui.CheckStyleConfigPanel$ToolbarAction.run(CheckStyleConfigPanel.java:348)
	at com.intellij.ui.ToolbarDecorator$2.doAdd(ToolbarDecorator.java:440)
	at com.intellij.ui.CommonActionsPanel$Buttons.performAction(CommonActionsPanel.java:72)
	at com.intellij.ui.CommonActionsPanel$MyActionButton.actionPerformed(CommonActionsPanel.java:263)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:216)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:233)
	at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:192)
	at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:155)
	at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:329)
	at java.awt.Component.processEvent(Component.java:6306)
	at java.awt.Container.processEvent(Container.java:2237)
	at java.awt.Component.dispatchEventImpl(Component.java:4897)
	at java.awt.Container.dispatchEventImpl(Container.java:2295)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
	at java.awt.Container.dispatchEventImpl(Container.java:2281)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.awt.EventQueue$4.run(EventQueue.java:735)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:821)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:645)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.awt.Dialog.show(Dialog.java:1084)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:736)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:458)
	at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1686)
	at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1635)
	at com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:86)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:151)
	at com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:83)
	at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:97)
	at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:63)
	at com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.java:52)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:216)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:233)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:310)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:911)
	at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:136)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:300)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:117)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:86)
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:109)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:118)
	at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:117)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533)
	at java.awt.Component.processMouseEvent(Component.java:6541)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6306)
	at java.awt.Container.processEvent(Container.java:2237)
	at java.awt.Component.dispatchEventImpl(Component.java:4897)
	at java.awt.Container.dispatchEventImpl(Container.java:2295)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
	at java.awt.Container.dispatchEventImpl(Container.java:2281)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4719)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.awt.EventQueue$4.run(EventQueue.java:735)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:821)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:645)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:365)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

W2.3d Automated Testing of CLI Apps

screen shot 2017-08-20 at 4 39 29 pm

screen shot 2017-08-20 at 4 51 56 pm

screen shot 2017-08-20 at 4 34 11 pm

screen shot 2017-08-20 at 4 38 20 pm

screen shot 2017-08-20 at 4 39 29 pm

In part W2.3d, we are asked to build the project on IntelliJ and then run the program AddressBook and redirect the output to output.txt. I assumed the target directory was from the out/production folder. However, despite building the project successfully I am getting a Could not find or load main class error. I'm a bit confused because there is an AddressBook.class in the production folder. Has anyone encountered a similar issue?

📣 Phase B started; now what?

  • More on how to go about doing the project will be explained in the lecture this week.
  • While we are on the topic of this week's lecture, I've added some questions for you to look at before coming to the lecture.
    image

📣 More ways you can use pull requests to your advantage

Now that you know how to create pull requests, here are some ways you can put them to good use:

1. If you are not sure how to do a certain coding task given under a Learning Outcome, you can read some of the PRs created for the same LO by other classmates. While there is no guarantee that those PRs will be the correct way to do the task, at least they might give you some ideas to try out. Feel free to ask questions from the PR author by posting comments in their PRs. Also feel free to give comments to the PR author e.g. if you notice a coding standard violation the author missed.
Note: If you end up in your PR an idea adopted from another PR, you are required to acknowledge the original PR in your PR description.

2. If you are facing difficulties in a coding task (e.g. the code is not working as expected), feel free to create a PR (against your own fork) and post a link to it in this forum to request help from classmates. That way, classmates can look at the exact code you have written when they try to help you.

[W4.3d] Object Diagrams for Class Diagram

Hello,
Doesn't the object diagram in the hint imply that the home address of Bruce and Alfred is same? Shouldn't we instead make two instances of anonymous Address object and connect Bruce to one of them and Alfred to another? I am aware that it might just happen that the address is identical, but while having two different objects with the same values is possible it is not the other way around, thus we, as I think, assume that the address is same. Am I right? The exercise is attached below.
Thank you for help.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.