This site is from a past semester! The current version will be here when the new semester starts.
CS2113/T 2020 Jan-Apr
  • Full Timeline
  • Week 1 [from Mon Jan 13]
  • Week 2 [from Wed Jan 15 noon]
  • Week 3 [from Wed Jan 22 noon]
  • Week 4 [from Wed Jan 29 noon]
  • Week 5 [from Wed Feb 5 noon]
  • Week 6 [from Wed Feb 12 noon]
  • Week 7 [from Wed Feb 19 noon]
  • Week 8 [from Wed Mar 4 noon]
  • Week 9 [from Wed Mar 11 noon]
  • Week 10 [from Wed Mar 18 noon]
  • Week 11 [from Wed Mar 25 noon]
  • Week 12 [from Wed Apr 1 noon]
  • Week 13 [from Wed Apr 8 noon]
  • Textbook
  • Admin Info
  • Report Bugs
  • Forum
  • Instructors
  • Announcements
  • File Submissions
  • Tutorial Schedule
  • repl.it link
  • Java Coding Standard
  • Forum Activities Dashboard
  • Participation Dashboard

  •  Individual Project (iP):
  • Individual Project Info
  • Duke Upstream Repo
  • iP Code Dashboard
  • iP Progress Dashboard

  •  Team Project (tP):
  • Team Project Info
  • Team List
  • tP Code Dashboard
  • tP Progress Dashboard
  • Forum Activities Dashboard

    [This page was last updated on Apr 11 2020]

    The text-ui-test passes locally on my computer

    but it fails when pulling request

    Wonder how I can fix it?

    I wonder if the heading and the tail count into the page limit? Those really occupy a lot of space

    The format seems problematic here.

    when running the text-ui-test, such error occurs. Such error never happens before, my JDK is set to be 11.

    When I logged into CATcher using github for the first time, it saids that

    How I can fix it?

    I generated the jar file for tp via

    project structure -> artifacts -> JAR -> from modules with dependencies ->

    however, when running the jar file, terminal shows that "jar has no manifest attribute"

    I wonder how I can fix it?

    As per subject. It is inconvenient to wait for github to check on submission

    Given than we can have JUnitest for those functions that return something, I wonder if we can test for functions such as "execute" which return "void"?

    Hi professor, since my computer was configured with JDK 12, so do intellij, the jar file generated cannot be run on JDK 11. I wonder how I can fix it?

    1. How to convert an existing ordinary java project into a gradle project in intellij. In Topic, it seems that it only mentions how to create brand new gradle and import existing gradle project.

    2. Do we need to convert it to gradle project for iP?

    As per issue subject. I wonder if we can just update the README.md on docs/README.md since I think the tutorial on the README.md in the original duke is quite good.

    I wonder if there is a abstract methods for superclass and polymorphism shown in subclasses, do we need to write documentation for the abstract method in superclass? Or we just need to write documentation for that method (specific implementation) in each subclass?

    I modified the code and the demo looks like this.

    However, when I ran test-ui-test, it told me that there was difference.

    I wonder why this is so and how I can make changes

    I tried to read the txt file using relative path, however it always said "file not exists"; if I changed it to absolute path, then it can be read. I wonder what is wrong with it?

    private static String filePath = ".." + File.separator + ".." + File.separator + "data" + File.separator + "duke.txt";

    I wonder what the three markers mean?

    I wonder for good coding style, it is better to put the function definition before main function/where it is called or after?

    For IP, when generating the ACTUAL.txt file, it seems that tick icon cannot be shown properly. I wonder how I can fix it? Any help would be appreciated!

    I tried to import contacts project mentioned in Lecture 3, but the IDE only recognize "src\main\java" as source directory so project only includes files under this directory after import. However the project still need files from "text-ui-test" or something. How can I fix this problem? Any help would be appreciated!

    When running the test case, it shows "assertEquals(Arrays.toString(new double[]{5.0, 0, 2.5, 3.0}), Arrays.toString(Main.getMultipleGradeCaps(new String[]{"A+", "Foo", "C", "B-"})));"

    It seems that it expects "0" instead of "0.0" for "Foo". However, as a double, the result will be 0.0. In this case, should we do any special manipulation on "0.0" case?

    It seems that it expects "0" instead of "0.0" for "Foo".

    Are you sure this is the cause of the test failure? As no one else reported a similar problem, my initial thought is that the test failure caused by something something else.

    I found the reason, due to the wrong function name...

    You can change the view to 'Project Files' instead of 'Project' to see non-java files.

    Thanks that help! However I wonder when you demo during lecture, it seems that it showed all files including non-java files with "Project", why this is so?

    Also I am not sure what is wrong here, but there seems to ACTUAL.txt

    Also I am not sure what is wrong here, but there seems to ACTUAL.txt

    ACTUAL.TXT is generated by the script and contains the actual output from the program, so it doesn't need to be present before the script runs. If ACTUAL.TXT is present, the script deletes it before compiling and running the program again (e.g. in the .bat script on line 7):

    del ACTUAL.TXT

    OK thx so much! Problem fixed!

    Thanks for the help @rdimaio

    Go ahead and close this issue if the problem is resolved @SibingWu

    Professor I am still wondering why when you demo during lecture, it seems that it showed all files including non-java files with "Project" instead of Project Files

    Professor I am still wondering why when you demo during lecture, it seems that it showed all files including non-java files with "Project" instead of Project Files

    I suspect that earlier (before the lecture), I must have set some setting in Intellij to make those files visible by default, although I can't remember exactly what though.

    OK, thank you so much for your help!

    replace line 18 in runtest.bat to

    java -Dfile.encoding=UTF-8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT

    Thank you so much for your help! Problem fixed!

    As that aspect is not specified in the coding standard, you are free to choose your own, but apply in consistently throughout the code base.

    Thank you so much! Confusion clarified.

    One thing you can try is to print the 'current working directory' from your code. That should tell you what directory is your path 'relative to'. It may not be the location of the java file.

    Thank you so much! Problem fixed!

    I think you may run the jar file in a improper directory. Maybe you can try this:

    1. cd to the directory of "duke" project

    2. then "java -jar xxxx.jar"

    I think it will be fixed

    Since that the path we used to find txt file is a relative path, so it is very important that which directory we are relative to (just guess

    Maybe you have added some new package and you forgot to put the path?

    if this is so, the idea will just report error for not finding the classes

    I think she is referring to your runtest.bat. It may compile and run as normal in the terminal but shows this response because the new classes have not been included in the batch script.

    I understand, and I have tried; if the batch script does not include the new package, it will report the error

    May I ask what kind of operation will produce “empty list” in your code, list or a message after you add a new task

    It will display "Empty List." when there is no tasks in the duke.txt file, so nothing will be loaded to the screen

    So 2 possible reasons, is it because your duke.txt is empty or when your program cannot find the file, it has a default constructor to build an empty task list?

    I think the second one is possible (since if it is the first reason, then it should display "Empty List." as expected). However I wonder how I can write the batch script to let it find the duke.txt?

    Here comes another problem:

    when running the project in intellij, it works perfectly fine.

    However when it comes to runtest.bat, error occurs:

    2 problems:

    1. how come there is no bug when running in intellij and there is an exception for runtest.bat

    2. there is no line 90 in Duke.java

    Search for all *.class files (that were generated by previous runs) and delete them.

    Make sense! I wonder where I can find those .class files?

    Make sense! I wonder where I can find those .class files?

    try out folder, bin folder (if any)

    I deleted all .class files under the two folders, but there is another problem: java.lang.ClassNotFoundException: Duke

    Such exception only occurs when runtest.bat

    I deleted all .class files under the two folders, but there is another problem: java.lang.ClassNotFoundException: Duke

    Such exception only occurs when runtest.bat

    Did you update the javac command in the runtest.bat to account for the packages you introduced?

    I did: javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke*.java ..\src\main\java\duke\commands*.java ..\src\main\java\duke\exceptions*.java ..\src\main\java\duke\parser*.java ..\src\main\java\duke\storage*.java ..\src\main\java\duke\tasklist*.java ..\src\main\java\duke\tasks*.java ..\src\main\java\duke\ui*.java ..\src\main\java\duke\utils*.java

    I did: javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke*.java ..\src\main\java\duke\commands*.java ..\src\main\java\duke\exceptions*.java ..\src\main\java\duke\parser*.java ..\src\main\java\duke\storage*.java ..\src\main\java\duke\tasklist*.java ..\src\main\java\duke\tasks*.java ..\src\main\java\duke\ui*.java ..\src\main\java\duke\utils*.java

    Does that command work when you run it manually, from the same directory as the runtest.bat?

    It can work:

    Actually runtest.bat successfully generates the *.class files under bin directory

    Actually runtest.bat successfully generates the *.class files under bin directory

    Then, check the java command in the runtest.bat. Is it updated to use the packaged Duke class?

    I wonder how I can know if it is updated?

    I wonder how I can know if it is updated?

    See the end of this textbook section.

    Thank you so much!!! Problem fixed!

    Not entirely sure what you mean.

    [root]/docs/README.md is supposed to be a user guide whereas [root]/README.md is meant for developers. So, best not to copy content from latter to the former.

    Is that what you wanted to know?

    Yes! Thank you prof!

    1. Do we need to convert it to gradle project for iP?

    No. We start using Gradle in the tP.

    Ok Thank you

    Testing is essentially ensuring that the actual behavior is same as the expected behavior. If the return value of a method is not able to tell you the actual behavior, you can try some other ways to verify it.

    For example, if the execute method is supposed to add an object to a list, you can check the last element in the list to confirm that the object has been added there as expected.

    If the actual behavior is hard to verify (e.g., the method simply prints something), that means the testability of the method is low -- you can try to redesign the method to improve the testability e.g, get the method to return the string instead of printing it directly.

    So it means that, when doing JUnitest for adding something to the list, the thing used for test is truely added into the list, and we need to remove it after test finishes?

    So it means that, when doing JUnitest for adding something to the list, the thing used for test is truely added into the list, and we need to remove it after test finishes?

    Yes, if that addition could affect the result of other tests.

    Thx Prof!

    gradlew checkstyleMain

    Thx!

    @damithc dear professor, I also created a PR to the https://github.com/nus-cs2113-AY1920S2/tp repo, could u please take a look? we tried many times, but the problem of IO redirection test still not resolved... I modifed the INPUT.txt, but the corresponding EXPECTED.txt generated on my local computer still cannot pass the test. I wonder if it can run properly on your end?

    gradlew shadowJar

    then where can find the generated jar file?

    build/libs

    Thank you, problem fixed!

    You are trying to access a session of CS2103. Our module code is CS2113.

    my bad... thx prof!

    Looks like another Java version is being used somewhere along the way.

    If possible, remove all other java versions from your computer.

    just curious why this never happens before?

    Well, something must have changed somewhere. Perhaps an automatic update?

    I fix it by changing the computer environment path from jdk11 back to jdk 12... seems that I need to remove all the .class files generated when my computer was still jdk 12

    Well, something must have changed somewhere. Perhaps an automatic update?

    no use if I just delete the .class files from out directory; I have to change back to jdk12...

    Keep in mind that using JDK 12 might appear to solve the problem in your computer but you should be using JDK 11 for all PE work and the jar file your team releases must be produced using JDK 11. If your jar file doesn't work on JDK 11, you are going to lose a lot of marks as your product will be completely unusable in the target execution environment.

    notice with thx!

    Can you elaborate?

    The overall format looks like this. I cannot see the content for "What BVA recommends"; it is blocked

    Looks fine to me. May be a caching issue. Try force-reloading the page?

    I restart the whole browser but the problem still exists; however, when I changed another browser, it is normal now

    ctrl+F5

    still problematic

    Which Browser is problematic?

    EDGE

    Yes, older Edge Browsers seem to have this problem. Upgrade to the new edge:

    OK, thx prof!

    Yes. The page limit takes into account that a significant amount of space is wasted by the template. Try to make the PPP concise; peer evaluators are not going to like it if you make them read a lot. Same applies for other 'tricks' such as using small fonts or narrow margins. It's not enough to meet the page limit in theory; you should also meet it in spirit -- i.e., make the content concise. If the content is concise, evaluators are unlikely to fault you for going over the page limit slightly.

    OK Got it! Thx Prof!

    Hi, I've encountered this issue too. It could be caused by an old jar file in your local build/lib directory, resulting in a false positive test pass. Try deleting the old jar and making a new jar via gradle shadowJar, after which your local test would be similar to the CI tool and you can fix accordingly.

    thx!

    @damithc Professor, I wonder if the instruction for source code here means that we need to make a pull request of our code to the main repo? or it simply means the "source code" shown after we release the jar file?

    @damithc Professor, I wonder if the instruction for source code here means that we need to make a pull request of our code to the main repo? or it simply means the "source code" shown after we release the jar file?

    No need to do anything extra @SibingWu Just make sure your team repo source code matches the jar file.

    Noted with thx!

    @damithc is it OK for the jar name to look like this in github? it is [xxx][xxx].jar in local, but when submitted, it becomes the following

    @damithc is it OK for the jar name to look like this in github? it is [xxx][xxx].jar in local, but when submitted, it becomes the following

    It's OK, as long as the file submitted to LumiNUS has the correct name.

    OK!

    Will we have in-person final exam for the course? I think many exchange students have already left NUS.

    Is it possible for the teaching team to share Tutorial 9 Exercise Answers with us? 😃

    Understood from the explanation that 100% path coverage gives the highest intensity, but why doesn't 100% statement coverage give highest intensity as well? Doesn't all statements being executed mean all paths are executed?

    Any help is appreciated!

    Does anyone know why Alfred and Bruce are using the same home address? I know it's logical to assume they have the same home address since Alfred is a guardian of Bruce, but this is not explicitly mentioned.

    The screenshot is as below:

    It seems that Week 9 Quiz Part 2 is worth 0 mark - is this a mistake?

    We've submitted UG v1.0 before during tutorial, but do we need to publish the UG v1.0 on GitHub like we did for iP?

    I noticed that there are some exercises in Week 8 Tutorial - just wondering whether the answers to these exercises will be posted?

    I'm not sure whether we are supposed to add JavaDoc comments in tP v1.0, but when we do not add the JavaDoc comments, the Java CI tests fail?

    Is the iP demo in next week's tutorial graded as part of our iP mark?

    The iP grading page is here but I didn't find anything related to the demo.

    After I merged the branch gradle to my master branch, I'm unable to run gradlew run as it gives zsh: command not found: gradlew error. But I'm able to run ./gradlew run.

    Is it okay to just run ./gradlew run? And why is it failing to execute gradlew run?

    Any help is appreciated!

    I noticed that we do not get direct feedback on whether or not the answers we submit for post-lecture quizzes on LumiNUS are correct. Will we get the model answers after the deadline?

    It seems that the links to the textbook chapters required for week 6 [e-learning](https://nus-cs2113-ay1920s2.github.io/website/schedule/week6/index.html

    ) are broken.

    I get a page not found error when clicking on any of the 3 links: e.g. https://nus-cs2113-ay1920s2.github.io/website/schedule/week6/se-book-adapted/chapters/requirements.html

    Does anyone have any idea about which functions we are supposed to write Javadoc comments for?

    Any help is appreciated 😄

    I'm looking to use a few lines of code in my iP similar to that I found on Stack Overflow. Does anyone know how do we indicate that we referenced from online sources? Can I just put the link in my code?

    Any help is appreciated!

    Understood that the tutors for each tutorial group are listed in the module website. But where could we get the email addresses of our tutors?

    Any help is appreciated!

    Understood from the previous issue here that we are to push our work to our GitHub repo starting from Week 3.

    However, are we going to get grade/feedback for our iP every week?

    I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃

    I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃

    That's correct. Thanks @Zhilin-Huang

    In that case, are we still supposed to push our commits to the public repo?

    Yes, but no need to push this week. You'll need to push your code from week 3.

    Thanks for the clarification!

    Noted! Also, for the exercises on repl.it every week, will we get frequent grade/feedback on this component? Or is it sufficient that we make sure we submit solutions that pass all the test cases?

    Thanks for the clarification!

    https://nus-cs2113-ay1920s2.github.io/website/admin/instructors.html

    Thank you!

    Not sure what's the problem with the second screenshot, but from your GitHub repo I see that your tags are attached to different commits instead of the first commit: https://github.com/kokjoon97/duke/releases

    This solves my problem! Thanks for your help 😃

    Noted! Thanks Prof 😃

    Based on how I understand the requirements, I think we are allowed to customize the output of our bot as we see fit

    Thanks Prof!

    I see! But it seems that A-Gradle is an increment under A-Jar for Week 6 iP tasks here?

    Thanks for the clarification 👍

    Thanks for the clarification!

    If you are very sure that you want to delete that commit, then it should be fine to do so.

    I think the iP progress dashboard is not updated in real time? So maybe it's because you released the JAR file after the last update

    I'm not sure whether we are supposed to add JavaDoc comments in tP v1.0, but when we do not add the JavaDoc comments, the Java CI tests fail?

    The code is expected to be well-documented, which includes using javadoc comments appropriately.

    Having said that, you can modify the checkstyle config file to allow methods without javadoc comments as the given coding standard does not specifically disallow methods/classes without javadoc comments. I'll look into removing that rule from the checkstyle config so that it will not be enforced against your PRs in https://github.com/nus-cs2113-AY1920S2/tp/pulls

    Thanks for the clarification!

    Thanks Prof!

    Which tP requirement in which week are you referring to?

    Anyhow, yes the tP UG must be published on GitHub. Your project template comes with a UG file that you need to update https://github.com/nus-cs2113-AY1920S2/tp/blob/master/docs/UserGuide.md

    Okay, we'll update and publish UG v1.0 on GitHub!

    I was asking about tP v1.0 requirements for Week 8 and 9 because I cannot seem to find a requirement corresponding to UG update.

    I was asking about tP v1.0 requirements for Week 8 and 9 because I cannot seem to find a requirement corresponding to UG update.

    Updating UG is not required at v1.0, but you are welcome to update the UG as you go.

    Noted! Thanks Prof

    It's a LumiNUS bug. Will contact NUS IT to see if they can help. Meanwhile, you can go ahead and attempt the quiz as marks calculation can be changed later.

    Noted with thanks

    It was mentioned during tutorial that it's because the question stated to assume that we are trying to minimize the number of total objects.

    Oh I see! Thanks

    To add on to this problem - I think our team have followed the forking workflow but this task it is not marked as done for us (or anyone else in the class?)

    It's not being checked yet.

    I see 😃 Thanks Prof!

    Good question @Zhilin-Huang

    Consider a case of a while-loop in the code. An execution path that does only one iteration through the loop executes all statements in the loop, achieving 100% statement coverage. But that does not mean all unique paths through the loop have been executed because a path that does only one iteration in the loop is different from another path that does two iterations in the loop.

    I see! So does this mean that in the case that we have a while-loop, we can never achieve 100% path coverage because executing 1, 2, 3... n iterations are considered different paths?

    I see! So does this mean that in the case that we have a while-loop, we can never achieve 100% path coverage because executing 1, 2, 3... n iterations are considered different paths?

    Yes, if the possible number of loops is not a fixed number of possibilities. In other cases it is not impossible but the number of paths can be too big for 100% path coverage to be feasible.

    Thanks for the clarification Prof!

    Thanks for the reminder @Zhilin-Huang . Posted as an announcement.

    Hmmm I cannot seem to find the announcement @damithc ? The latest announcement is the one about Week 10 Tutorial arrangement.

    Hmmm I cannot seem to find the announcement @damithc ? The latest announcement is the one about Week 10 Tutorial arrangement.

    Sorry, it turns out I posted it in the wrong module :-p

    Re-posted it in CS2113 just now.

    Just saw the announcement 😃 Thanks!

    Yes, we will have a final on-site exam. There will be an alternative assessment option given to exchange students who are no longer in Singapore.

    Noted with thanks!

    This is my current IntelliJ:

    All the loading suddently becomes unavailable. I have shifted to the original status when every code should be correct, but still cannot work.

    When I am implementing the UG, I want to write things in different lines so I use </p>. This works when I display in Github:

    This is the code for UG:

    This is the display when I see it on github or my IDE:

    However, when I see it on the website of my project, the will displayed:

    I am confused why this happens.

    I also wonder how to add return in markdown.

    I have updated the user guide on docs/readme

    However, when i am visiting the website: http://{your username}.github.io/duke/, it still appears the readme of origin duke.

    When want to solve the merge conflict, I have carried out some wrong steps. Currently, my branch-A-JavaDoc is in some strange location. May I ask how to slove this and how to continue to merge master and javadoc?

    If i pull the javadoc , then it becomes:

    When i want to do the merge for JavaDoc and master, i accidently check out the branch-java doc, and then pull the master. Such thing appear. May i ask if there is any way that can come back to the previous status so that i can first check out master, then pull master, then merge master to branch?

    Is it okay to delete a commit on github by:

    git reset --hard HEAD^

    git push origin +branchName --force

    Remember to give sufficient details e.g.,

    • Your development environment (IntelliJ version, Java version, OS, ...)

    • Relevant code, error message, stack trace

    • Relevant code snippet (an example given below), or link to the relevant code on your GitHub repo


    String value = "Some code here"

    When i am refactoring the code, there are some unknown errors displayed on Intellij.

    All newly created class suffer from this errors. I have searched and tried to change encoding. However, still cannot really see the errors.

    💡 You can use Markdown to format your text

    When I am running the text-ui-test after creating the Level-7, it cannot find the duke.txt. May I ask what to deal with? Do we need to add some lines in the runtest.bat?

    Hi, even in the terminal, my tick icon cannot display properly. I am not sure if that is because the encoding of the project has something wrong.

    I am not sure if this solution is okay. I add a folder called "data" which is in the same directory as the jar file, then the jar file works.

    Thank you for your reply. Then i just use the a regular character.

    I have tried creating a new file when there is no duke.txt However, it still does not work. I suppose that the jar cannot find the data folder?

    @JTWang2000 Something to consider: What would happen after your code catches the FIleNotFoundException ? Will it continue to run your while loop?

    I suppose that it will not run the while loop? It means there is no such file so it will create a duke.txt file. However, it cannot find the data folder so it cannot create?

    @Jeremy733 yeah i tried to make it File f = new File(duke.txt). OMG it works! But is that okay that we do not a data foler?

    A general tip: if you expects the data file to be in specific folder e.g., ./data/, your code must check if the folder exists and create it if it doesn't. If your code doesn't have that, your text ui tests could fail too.

    yep. I find that even if i add the data directory in the runtest.bat, still got similar error as the jar file which is cannot find data directory.

    Do you mean when you run the jar file, the initial task list is not loaded because can not find the file?

    Sorry for answering so late. Yes. I think because there is no data folder.

    can you check if is the chinese character?...

    Have tried. If it is the Chinese character, then the display will be:

    So it should be the English character

    You can copy paste some code from the problematic files into a tool like this one to see if there are some hidden characters in the code.

    Also check if your other Intellij java projects suffer from this problem. If they don't, you can try reimporting this project.

    Thank you for your reply.

    After pasting the code to the website:

    I suppose that there is no hidden characters?

    I tried the circus class we used to use during lecture. When i am creating class and package, it works fine. Then, I tried to reimport this project, still have the same problem.

    I tried to change the console to UTF -16 to try to see if the strange "characters" are chinese character:

    Also failed. Very confusing.

    I tried to rewrite the: package duke.command;

    a new error appears.

    I suppose that maybe my encoding of all the files are wrong?

    Then, i check the setting which displays:

    I tried the Remove BOM function. It works! Thank you so much.

    @Zhilin-Huang Sure. Thanks. This command works

    @damithc Thank you for your advice.

    My understanding for this problem is that: Previously, there is no data/duke.txt. When we first run duke, it will be created. Therefore, we may need to add code to create a data folder and a duke.txt. This may solve both jar problem and test-ui problem?

    Maybe you have added some new package and you forgot to put the path?

    uhhh. I solve it by myself

    @damithc Thank you for your reply. I tried and it worked.

    But then i followed this to try to solve conflict, then my master leaves at previous stage:

    @damithc Thanks. I have understood now and merged to master successfully.

    I have added a test when loading the duke.txt file and will create a data folder. Then, even if I do not add the path in runtest.bat, it still works. It is just that every time when a runtest, I need to delete the data folder to ensure the actual and expected txt matches.

    Thanks for those who have helped me.

    Thanks, I have fixed!

    @damithc @rdimaio Thank you for the reply. I will try to add line break by using two consecutive blank lines instead of one.

    I re-import and it worked!. Thanks.

    Hello,

    Should all v2.1 deliverables including the portfolio go into the final submission folder on LumiNUS?

    Also, it says on the website that for the product demo the submission is to a different folder, though I do not see any other folder on LumiNUS. Will this be created later on?

    Hello,

    It seems I am unable to view the results for the week 12 quiz in LumiNUS and also cannot see the questions I got correct or wrong even though its past the closing time of the quiz.

    Hello,

    Can I check if there is a recommended way of converting our md files into pdf format (since it seems the final submission for the portfolio page is in pdf)?

    It seems I am unable to save the md file as any other file format and I'm not sure if it is safe to rely on an online converter also. When I tried to print as pdf on the rendered md file on Github, it then has the problem of including the UI of the webpage as well.

    Hi,

    In order for the code to be RepoSense-compatible, does this mean that all the code contributions by me should be recorded in the code dashboard?

    Currently, it seems that the code that is attributed to me in the dashboard is indeed contributed by me however some of the other code portions which I have written as well are not reflected in the dashboard but are instead showing up in the dashboard for other members of my team. Do I have to create the config.json file to fix this? Its just one method that is missing though so I'm not sure if its considered a serious issue too

    Hi,

    It seems that in LumiNUS, I am only able to see Week 10 - Quiz Part II. Can I check if there is supposed to be a part I which I am not seeing in the quizzes section?

    Hello,

    I have already released the JAR file using Github releases, however the iP progress dashboard shows that I have not completed the Final Jar increment. Is this because I checked the box that says it is a pre-release when publishing the release?

    If that is the case, do I have to create a new release or can I simply edit the release and uncheck that option?

    I made a costly mistake by creating a branch from one of my branches instead of from the master branch. As a result, when I created the PRs and tried to merge, the results were disastrous.

    I have then tried to delete the changes manually and make a new commit to "undo" the change since I don't think it is possible to revert commits on GitHub. After this, I did the merging of the PRs correctly and also tagged the merge commits.

    Will the scripts only focus on the commits that are tagged and ignore the erratic commits that I have made to the fork?

    Can I check if it is a must to follow the output of Duke exactly as given in the iP tasks? Is it acceptable if we vary the format of the output but still achieve the same functions?

    For example, even after I have fixed writing of UTF-8 characters into txt files using

    -Dfile.encoding=UTF8, I am still having problems with the command prompt not displaying UTF-8 characters when I tried running the JAR file which I created. I have tried changing the code page to 65001 but it does not seem to work and most solutions I have found suggested editing the registry which seems pretty risky.

    I have unintentionally removed one of my tags on the commits in Github and I tried to undo that removal by re-pushing my latest commit (with all tags pushed). Now, for my latest commit (first picture below) it shows its own tag, whereas for my first commit (second picture below), it shows all the tags which I have ever included in a commit.

    Can I clarify if this is what I am supposed to see if I have tagged the commits correctly?

    When redirecting output from the console into a txt file, I find that I am unable to represent Unicode characters properly. This problem occurs since in the Duke chatbot, stylized ticks and crosses are used to indicate the status of completion for different tasks.

    Every time when I try to run the batch script, I get something like this:

    ***** ACTUAL.TXT

    Got it. I've added this task:

    [E][?] project meeting (at: Mon 2-4pm)

    Now you have 3 tasks in the list.

    ***** EXPECTED.TXT

    Got it. I've added this task:

    [E][Γ£ÿ] project meeting (at: Mon 2-4pm)

    Now you have 3 tasks in the list.


    Any stylized symbols get transformed into a "?" the moment I try to put them in a txt file. May I know if there is a workaround for this issue?

    Just found a solution, I basically added the "-Dfile.encoding=UTF8" into the java command in the batch script.

    java -Dfile.encoding=UTF8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT

    Referenced from this website: http://hints.macworld.com/article.php?story=20050208053951714

    I wonder if it is a feature of GitHub for commits to show their own tag and tags of commits that come after them, though I could imagine that might make it hard to track which tag is for which commit specifically

    Okay thank you for clarifying prof!

    Okay thank you for clarifying!

    I was just wondering if the scripts would detect the erratic commits and if there are any penalties for those commits

    Okay thank you for clarifying prof!

    Hmm I uploaded the JAR file before these new tasks were added to the dashboard though

    My final release was on the evening of 28th, not sure what time the update to the dashboard was done. I have also changed that release to be a final release for consistency because I realized I marked one of my earlier releases as a final release while this one was not.

    My final release was on the evening of 28th, not sure what time the update to the dashboard was done. I have also changed that release to be a final release for consistency because I realized I marked one of my earlier releases as a final release while this one was not.

    @kokjoon97 dashboard updated. Your jar should be visible now.

    Okay thank you prof!

    Hi, on behalf of the OP, this is the commit where our team last edited the code that had to do with scanning of user input:

    Link to commit

    It seems I have resolved the issue by changing the path to 'dir /b duke-0.0.1.jar' in the runtest.bat file where it was previously 'dir /b *.jar'. I don't think it was an issue with the Scanner like IntelliJ was warning about, it seemed no matter how I changed the code, it kept warning about the same line of code even though that line only contained a curly bracket.

    I have just merged a PR which passes all the CI tests.

    EDIT: Not very sure why shadowJar creates two different jar files in the build/libs directory, of which only one works (duke-0.0.1.jar)

    Ohhhh I see, that explains why one of the jar files had such weird behaviour. Thanks for clarifying prof!

    Okay I see it now! Thank you prof!

    Ah okay so I only have to add the @@author tag in the code? I thought it was a much more complex process. Thanks for clarifying prof!

    Okay thank you for clarifying prof!

    Its still not working for me for some reason though

    It works now! Thank you prof!

    Okay thank you prof!

    https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/uml.html#associations

    https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/oop.html#classes

    to indication the three priority levels -> to indicate the three priority levels

    https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/oop.html#implementing-multiplicity

    without having a direction association with it -> without having a direct association with it

    https://nus-cs2113-ay1920s2.github.io/website/schedule/week4/topics.html#paradigms-oop-inheritance-what

    woment -> women

    https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/designFundamentals.html#cohesion

    because the code realated to that change -> because the code related to that change

    https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/codeQuality.html#intermediate

    it has no value on matter how fast/efficient it it. -> it has no value on matter how fast/efficient it is.

    https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/gitAndGithub.html#git-and-github

    Git will now show ignored fiels as ‘unstaged modifications’ -> Git will now show ignored files as ‘unstaged modifications’

    Note that the URL of the Github project is different form the URL -> Note that the URL of the Github project is different from the URL you

    https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/gitAndGithub.html#git-and-github

    Creating Pull Requsts (PRs) is needed -> Creating Pull Requests (PRs) is needed

    on repl, the class name should be Main if you want to click run to test your code.

    you can run your own command in the repl console to specify your argument passing to the program.

    Maybe you can define a finalize method? https://javaconceptoftheday.com/garbage-collection-finalize-method-java/

    I think that is what you need. finalize() is called before the garbage collector tries to release the unreferenced object memory, and you can put the decrement of the static class variable in the finalize() method. But when the garbage collector works is totally up to jvm, even you reference an object to null, the JVM may start garbage collection only when it runs out of memory. so the finalize method may not be called throughout the entire programme running time.

    Correct me if I am wrong.

    https://nus-cs2113-ay1920s2.github.io/website/admin/instructors.html

    replace line 18 in runtest.bat to

    java -Dfile.encoding=UTF-8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT

    can you check if is the chinese character?...

    GBK is the encoding for Chinese characters... and 0xBF is part of the BOM header. I suspect that you edited the file using the windows notepad before.... you can copy the content of the file, paste into notepad, delete this file, create a new one, then paste it back and try if error is still there.

    actually the IntelliJ is providing a Remove BOM function, right click on the file and select Remove BOM

    No problem, glad I can help.

    Hi may I ask what GSON actually helps with? Not familiar with this particular library

    Probably saving the objects(tasks) into file as json string, and loading json string from the file back to objects.

    but acually ObjectOutputStream and ObjectInputStream can do the work well already, just the output file is in binary, and cannot be edited by text editor.

    change this

    "check1" and "check2" will remain in the buffer until a newline "\n" is at the end, which is "Please enter your gender\n", then these three strings will be printed to the stdout together.

    gradlew checkstyleMain

    gradlew shadowJar

    build/libs

    ctrl+F5

    replace the line

    ![Image of SwitchCase](https://github.com/AY1920S2-CS2113-T14-2/tp/blob/master/docs/images/switchCase.png)

    by

    ![Image of SwitchCase](images/switchCase.png)

    or

    ![Image of SwitchCase](https://raw.githubusercontent.com/AY1920S2-CS2113-T14-2/tp/master/docs/images/switchCase.png)

    it is because https://github.com/AY1920S2-CS2113-T14-2/tp/blob/master/docs/images/switchCase.png is not even a pure image resource.

    <img src="images/xxx.jpg" style="zoom:50%;" />

    Hello, how can I resize images in Markdown? Several images are taking a lot of space in my PPP section. I tried the <img src="" +="" width=""> tags but it didn't work.

    Any help would be appreciated!

    I am having issues with trying to build and run the JUnit tests. For example, using the default tests provided, the test classes encounter an error when trying to build the module, IntelliJ is unable to import the Assertions class:

    After adding the recommended library to the classpath:

    I can build the module, but trying to run all tests it gives this error:

    Is there any way to rectify this? Have tried deleting and reimporting the project but it makes no difference.

    https://nus-cs2113-ay1920s2.github.io/website/book/uml/classDiagrams/associations/navigability/

    In the exercise, it says, "In the implementation, the Unit object will hold a Unit object in one of its variables." Was wondering if the 2nd Unit was meant to be an Item instead?

    Hello, the Github page for my user guide says it has been published, but when I access the link, there is no page available. Anyone able to help with this?

    Hello, my program for Repl.it W3 Ex10 keeps failing the final test case, even though I am able to get the required output. It passes the other 2 test cases when submitting, may I know is there some sort of time limit for the program or any other issue?


    import java.util.Scanner;

    import java.util.Arrays;



    public class Main {



    // You can add more methods here

    public static String[] filterExpenses(String[] words){

    String[] results = new String[words.length];

    int currCount = 0; //keep track of the index of next free space in validItems

    for (String word : words){

    if (word.substring(0,1).equals("$")){

    results[currCount] = word;

    currCount++;

    }

    }

    //print the 2nd line of output

    System.out.println("Expenses in overseas currency:" + Arrays.toString(Arrays.copyOf(results, currCount)));

    return Arrays.copyOf(results, currCount);

    }



    public static void printTotal(String[] args){

    double total = 0;

    //add floats together

    for (String arg: args){

    //get rid of the preceding $ char and convert value to double

    double currItemValue = Double.parseDouble(arg.substring(1, arg.length()));

    total += 1.7 * currItemValue; //convert exchange rate

    }



    //convert final value to string, print $ + final value

    System.out.println("Total in local currency: $" + String.format("%.2f", total));

    }



    public static void main(String[] args) {

    String line;

    Scanner in = new Scanner(System.in);



    System.out.print("Your expenses while overseas?");

    // TODO: add your code here

    line = in.nextLine();

    String[] separated = line.split(" ");

    printTotal(filterExpenses(separated));

    }

    }

    Apologies for the delay!

    Hi Prof, have resolved the issue! I didn't realize the last test case differs from the other two in that it is preceded by a trailing whitespace. This is resolved by adding a .trim() before the split function in the 2nd last line of main.

    Thank you for your help!

    @damithc I feel it could become an issue if I create a duke.txt everytime I run the .jar file in a new directory without keeping track 😆 Is there anyway to redirect to the original duke.txt, maybe create a shortcut/symlink to data/duke.txt?

    createNewFile will try to create the file according to the path you have specified in the File object. If the directory your jar file is located in does not have a subfolder path "src/main/java/data", it will throw an error. So maybe you could try to see how you can rectify this error.

    Note: the jar file should be run in an empty directory

    I think she is referring to your runtest.bat. It may compile and run as normal in the terminal but shows this response because the new classes have not been included in the batch script.

    Relative path points to the path of the file relative to your current location/directory. So say if I'm in "./src/main" and I want to access "./src/main/java/duke/duke.txt", the relative path would be "java/duke/duke.txt".

    For the jar case, you could run it in an empty directory eg "test". So for this example, the jar file will try to locate the saved tasklist file in whatever relative path you specified ie "test/<relativepath>" </relativepath>

    Yup, it works now. Thanks Prof!

    Yes, it says build successful.

    After uninstalling and reinstalling IntelliJ, it seems I can run the tests now. Very weird:

    Thank you for the help Prof!

    I think it depends not so much on the access modifier but the level of encapsulation and whether the rest of the program outside the class has a reference to it. Taking an example from an SO post:

    Composition


    class Car {



    private final Engine engine;



    Car(EngineSpecs specs) {

    engine = new Engine(specs);

    }



    void move() {

    engine.work();

    }

    }

    Notice how the Car constructor creates an Engine object that exists only within the Car object. When the Car is destroyed, the Engine must be destroyed as well. (in your Email example, the Email and Subjects have a 'part-of' relationship meaning they co-depend on each other)

    Aggregation


    final class Car {



    private Engine engine;



    void setEngine(Engine engine) {

    this.engine = engine;

    }



    void move() {

    if (engine != null)

    engine.work();

    }

    }

    For this example, I can create a Car object at a certain time, then put in an Engine into that Car at a later time. The Engine object doesn't exist exclusively within the Car, and there is some way to reference it from outside. So when the Car is destroyed, the Engine can still exist and maybe be put into another Car. (like for your Team example, a Person can still live even if his Team is disbanded) In the example, there isn't a constructor but if there was, it probably wouldn't specify the Engine attribute at creation time.

    I could be wrong, please feel free to correct me!

    SO reference:

    https://stackoverflow.com/questions/11881552/implementation-difference-between-aggregation-and-composition-in-java

    I feel that it refers to the latter as well.

    https://www.youtube.com/watch?v=XQnytAeZrWE#t=16m15s In the diagram that he draws, he describes the function calls to the OS as the external couplings rather than between different functions. So a change in 1 function call wouldn't necessarily affect the other function call couplings, whereas if they changed the OS all the function call couplings would have to change as well.

    Noted, thank you for your help!

    The following error occurs when I enter more than 1 line in input.txt. Im not sure why this is happening and what I can do to solve it.

    I tried methods recommended by other forum posts such as deleting old jar files and running gradlew clean but nothing seems to work. Would really appreciate any help. Thanks!!!

    Hi everyone. I am facing a really weird issue and I honestly have no idea why it is happening.

    In the attached picture is a snippet of my code with a few checks to see how it prints. I would expect "Check 1" to be printed before I enter the user input but it only gets printed after scanning in userAge which is very weird. The same happens for userGender, where "Check 3" gets printed after the input.

    When I change all the println() statements to print() statements it ends up becoming weirder as they do not get printed until all the inputs have been entered. May I know why this is the case and why this happens? Because it does not make much sense to me personally.

    This issue seems simple enough but I have no idea why it's happening this way. Hopefully, someone would be able to help me out 😃

    Just to clarify, by all classes having to be in some package does that also include the Main class (Duke.java)?

    Im actually also having issues with saving the file. It only works if I use the absolute pathway but that will cause errors when using the jar file. Tried many variations but none of them is working 😦

    Hi may I ask what GSON actually helps with? Not familiar with this particular library

    Ohh, not exactly sure how to do that. Guess I'm gonna have to go look it up

    Thanks for the help 😃

    This was what I used previously. I actually redid a lot of my code so it looks different now.

    The brute force rewriting of the file was just a temporary measure as I was more focused on getting the reading and saving parts to work.

    The one above is an absolute path but that won't work when using a jar file, still trying to figure out the relative path. Though honestly not exactly sure how it would work in that case.

    Why does this happen though? I tried using an online java compiler and runner and it works fine, where I can put my input on the same line as the printed prompt

    Why is there a difference with the 2 results?

    It works fine when i replace the println() to print(). The error only occurs when I run it using Intellij/Gradle. Not sure why that is happening.

    Oh, noted prof 😃 I was just doing this initially to test the input all at once when I encountered this issue.

    Oh ok noted. Makes testing a little harder but I guess I can work around it. Thanks a bunch 😃

    I have a related question regarding Composition and Aggregation. Based on the above example, its shown that there is an obvious difference between the 2, where

    However, it was also mentioned in the textbook that the aggregation symbol can be omitted.

    Would it be possible for an aggregation symbol to be replaced with a composition symbol?

    For example, in the example above, where a "whole-part" relationship is not present. Is replacing the aggregation with a composition be wrong in this case?

    This also applies for the example in the textbook:

    where removing the club doesn't actually remove the person as well, and thus a whole-part relationship is not observed. Can the aggregation be replaced with a composition in this case?

    Oh noted, thanks for the reply. So am I correct to assume that if we were told to not use aggregation we should in fact be replacing all non-whole-part relationships with normal associations? Which means that only strong whole-part relationships should be labelled with composition while all container-contained relationships are labelled with an aggregation/association?

    I have a related question regarding coupling. If I have multiple classes utilising the same static class, is that considered high coupling? For example, multiple command classes utilising methods from a static class.

    Alternatively, what if those multiple classes are utilising methods from another class (an instantiated object)? For example, multiple command classes utilising methods from an object passed in as a parameter.

    Is there a difference if the class is static or not?

    Oh, I think I managed to figure out the issue already. I honestly have no idea what I did to fix it but I messed around with it a little and now it works. Thanks a bunch! 😃

    I added the file duke.txt in /data and had

    File file = new File("data/duke.txt");

    in my code.

    But when packaged as JAR,

    "Exception in thread "main" java.io.FileNotFoundException: data/duke.txt (No such file or directory)"

    How should I package data folder into JAR.

    I saw on the Admin Notes that we have a quiz this week but I coudn't find it

    Did you have this issue with CompareNames? You will need a main class to run it. You can try your code on your local machine and just copy and paste it to repl.it as the lecturer said in an earlier post.

    I got the JAR file running however it still does not save. Therefore if you shut down and rerun the JAR file, you will start with an empty file.

    @JTWang2000 This is also my temporary fix but I believe we should only be distributing JAR files when releasing it

    I have adopted the solution of creating a new file if it doesn't exist. As long as the user of the jar doesn't move around files into different folders I think it should work.

    @damithc Thank you for your advice, I'm refactoring the code to make it works better

    @JTWang2000 You need to check if data folder exists or not or to make life easier just cdo

    File f = new File(duke.txt)

    @JTWang2000 From what I understand as long as you can save the file locally it's fine

    Well it's always a good habit to have JavaDoc especially when you are working as a team

    With Java 11, "Error:Java FX Packager: Can't build artifact – fx:deploy is not available in this JDK"

    issue: IDEA-200721

    https://youtrack.jetbrains.com/issue/IDEA-200721?_ga=2.226103452.787797951.1581843904-766222336.1581314726

    Is it possible to build a jar file if I change the SDK to Java 8 ?

    I tried to implement the automated text ui texting and followed the Text UI Testing Tutorial in the repo.

    I have trouble in updating the java / javac commands to match my main class. The terminal output is:

      Error: Could not find or load main class Main
    
      Caused by: java.lang.ClassNotFoundException: Main
    

    My main class's address is

      /Users/xxx/Documents/cs2113T/ip/src/seedu/duke
    

    How should I edited these two lines:

      if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/Duke.java
    
      java -classpath ../bin Duke < input.txt > ACTUAL.TXT
    

    Thanks very much.

    The only working solution I found so far is build a shadowJar with shadow plug-in using Gradle. It works perfectly.

    However, other methods I tried like, a normal fat jar with dependencies does not work. Maybe it is because I am using external library?

    Do you mean when you run the jar file, the initial task list is not loaded because can not find the file?

    Are you building the project before running it again? Normally if you made edits and then pressed run it should automatically build it before running, but maybe this feature could have been disabled in the settings. Have you tried going to Build -> Clean build?

    Thanks for your suggestion, but there's no "clean Build" option under "Build" though

    Did you implement gradle? Gradle can help build and also can clean build.

    Hi may I ask what Jason actually helps with? Not familiar with this particular library

    An open source library published by google. It can parse an obj to Json String or from the other way back.

    An open source library published by google. It can parse String obj to Gson obj or from the other way back.

    Actually it is capable of parsing any Object to JSON (not GSON object). JSON is a format for storing data.

    Sorry my bad English, I mean Json String.

    May I ask what kind of operation will produce “empty list” in your code, list or a message after you add a new task

    So 2 possible reasons, is it because your duke.txt is empty or when your program cannot find the file, it has a default constructor to build an empty task list?

    Hi Prof,

    Our Java CI check keeps getting cancelled. What might the issue be?

    Our group retagged v2.1 because we had to make changes after we released.

    1. The video link mentioned on the website for W12.1b leads to an invalid session on Panopto.

    1. Should the line (under W12.2b) be changed to the following?

    Testing all pairs between p1 and p3 only while ensuring all p3 p2 values are tested at least once

    I think this would help you:

    https://nus-cs2113-ay1920s2.github.io/website/admin/appendixB-policies.html#policy-on-reuse

    Thanks Prof, Will try

    When I created a new PR, the CI doesn't run and it's stuck at the starting state.

    Hi Prof, It ended up failing again.

    Pushing a dummy commit didn't resolve the issue. But thanks a lot Prof, we weren't planning to push any more code.

    The mysterious thing is that the code seems to still pass CI on the PR created at the nus-cs2113-AY1920S2 branch.

    Thanks for the update. Our code passes Java CI now.

    Whereas for week 11:

    I think the error may be in the diagram drawn for Q2(b) in the bottom left corner.

    It says "one ActionX object containing one Task object has been created and added to the History"; I think it means that :ActionX should be added to :History (in which case History should point to :ActionX instead of :Task)

    (supported by the fact that History adds Repeatable objects, which is an interface implemented by Action, but not by Task)

    Also I am not sure what is wrong here, but there seems to ACTUAL.txt

    ACTUAL.TXT is generated by the script and contains the actual output from the program, so it doesn't need to be present before the script runs. If ACTUAL.TXT is present, the script deletes it before compiling and running the program again (e.g. in the .bat script on line 7):

    del ACTUAL.TXT

    Are you building the project before running it again? Normally if you made edits and then pressed run it should automatically build it before running, but maybe this feature could have been disabled in the settings. Have you tried going to Build -> Clean build?

    HI, I am also having this issue; I uploaded my final .jar file in a release called v0.2 on the 20th, but it shows up as gray on the iP progress dashboard.

    GitHub uses a version of Markdown called GitHub Flavored Markdown (GFM), which implements things in a slightly different way than standard Markdown. This section in particular talks about the <p> HTML tag.

    A couple suggestions:

    • There may be an issue with the cache for the GitHub Pages page; you can try Shift + F5 to load the page again, ignoring the cached content

    • If you 're linking your images using their relative path, you could try using their absolute paths instead (or viceversa)

    Hi everyone, I am having some issues passing the Java CI / build for my PR. Specifically, the check that fails is the 'Perform IO redirection test (*NIX)' part. You can view it here: [https://github.com/AY1920S2-CS2113-T14-4/tp/pull/28/checks?check_run_id=505277833].

    I have tried to run my IO tests locally and it is working fine. See here:

    However, on Java CI, it is showing this error. See here:

    How should I approach to rectify this issue? The link to the source code is here: https://github.com/AY1920S2-CS2113-T14-4/tp/tree/branch-Joseph

    Thank you.

    Hi, you might want to check your save function and see if it writes to the same file path as the one you use for your load function

    Well you may want to add the data/duke.txt into the runtest.bat. This is what I've got.

    Hi Prof Damith,

    I have tried to reorder the I/O tests. Is it supposed to look like this?

    Also, I've tried to replace "\n" and it hasn't been working. May I know if there are other OS-specific characters that I should look out for?

    Thank you.

    It seems that after I updated to the lastest gradle.yml, the CI test still fails.

    You can see it here: https://github.com/AY1920S2-CS2113-T14-4/tp/pulls

    Hi Prof, I managed to solve this issue by applying your solution in which to convert the EXPECTED.txt to a unix format. I figured that my IDE has set the default file format as dos that caused this issue to happen. I had since, configured the necessary settings and rectified this issue.

    Thank you for your help, prof.

    I understand that Java uses garbage collector and thus, there is no need for destructor methods. But without destructors, how can I know the total number of objects within a class during runtime? For eg, if I can only increment the number of objects in the constructor method but not decrement it under the destructor method, wouldn't the total count be inaccurate if an unreferenced object gets garbage collected without decrementing total object count explicitly?

    The method we should create to prevent the wrong submission is :


    double[] caps = getMultipleGradeCaps(grades);

    insead of repl's skeleton code method:


    double[] caps = getGradeCaps(grades);

    From what i understand, finalize method only cleans unreferenced objects when called, but my issue is that i want to have a static class member variable that has the total count of objects in runtime, and i want to decrement it whenever unreferenced object gets garbage collected, and increment it whenever a new object is created.

    Oh okay, thanks for explaining! Closing this issue now!

    With regards to this arrow, The instructions for ActionFactory is: creates ActionsX, ActionY objects and adds them to the History object.

    Since ActionFactory did not specify that History object is a member object within its class, the History object is transient within ActionFactory and the arrow should be a dotted arrow indicating ActionFactory depends on History as well as ActionX and ActionY.

    Hi, I've encountered this issue too. It could be caused by an old jar file in your local build/lib directory, resulting in a false positive test pass. Try deleting the old jar and making a new jar via gradle shadowJar, after which your local test would be similar to the CI tool and you can fix accordingly.

    During the iP we have been told not to delete our completed branches in our individual forks. For the tP are we allowed to delete the branches in our local forks once we are done with them?

    In both the main website and repl Ex2 (use Rectangle objects), the given code states:

    //TODO: add a line here to set the size of r to 8x10 (width x height)

    //Recommended: use the setSize(int height, int width) method of the Rectangle object
    

    However, the method should be setSize(int width, height) instead

    Under Week 2 > Project > iP > Point 4, it says

    'In this initial skeletal version of Duke, it starts by greeting the user, simply echos commands entered by the user, and exits when the user types bye. '

    Wording should be corrected/added to, and state something along the lines of 'You are to modify the current duke project to implement the following:' to reduce confusion as to what the task actually is. The phrasing seems to imply that duke already does the above stated functions

    Found on page https://nus-cs2113-ay1920s2.github.io/website/admin/ip-w2.html

    Potential clarification needed on above mentioned page, under Section 1, Admin - iP Grading > Project Management section:

    Deliver some deliverables in least in 4 out of weeks 2-7)

    If when you run the jar file alone, you're getting errors because there is no data folder, that probably means that you need to add code to your program that will create folder(s) if they do not already exist

    Okay noted, thank you.

    Hello, I'm not sure when this problem started, but now any edits that I make on IntelliJ are not reflected when I run the code. I have tried printing strings when I greet the user to ensure that this is not caused by any error in logic, but it did not work.

    Did anyone face the same problem?

    Hello,

    I tried to commit some changes in SourceTree after editing. However, it says "No changes in this file have been detected, or it is a binary file".

    I tried to google and they suggested changing the Size Limit in settings but it still didn't work.

    I'm not sure what is the issue

    I'm not sure if this counts. Because when I click on the file to be staged, no preview comes out

    Okay thank you Prof

    Are you building the project before running it again? Normally if you made edits and then pressed run it should automatically build it before running, but maybe this feature could have been disabled in the settings. Have you tried going to Build -> Clean build?

    Thanks for your suggestion, but there's no "clean Build" option under "Build" though

    Thank you for all the suggestions! I have somewhat solved the issue.

    Hi sir, my group's DG seems to be having some formatting issues in terms of the spaces for diagrams. We tried to resize our diagrams but the formatting still seems off.

    Will we be penalised for this?

    2020-04-11 (3) 2020-04-11 (2)

    Hi I've been adding the headers and the comments for my code for a while and so throughout my code in all my branches, majority of my code already has headers so I won't be to do my A-Javadoc in a separate branch and merging it into my master.

    How should I proceed? Please advise, thank you 😃

    Hi, I did my A-MoreOOP but I realised I missed out one part of it after I pushed the incomplete commit with the tag A-MoreOOP. Now after I finished my A-MoreOOP increment, I tried to push that commit with the same tag but it told me that I couldn't do so due to a conflict.

    I tried to change the old tag name, and tried to delete the tag on github but it looks like nothing changed, even though now I can push the tag on my completed commit. Unsure if I did this retagging correctly, hope it doesn't affect my grades 😦

    Ok! Have created a branch for it and did some minor javadoc comments in it. Thank you!!

    Ok thank you Sir!!!

    Ok thank you Sir.

    Hello,

    When I was trying to merge some changes to the JUnit tests, some of the tests failed but just for windows, and they work locally on my windows machine. I have tried multiple times to change things in the code that might affect the CI build for windows, but I still can't figure out why it only fails on windows machines.

    https://github.com/AY1920S2-CS2113-T14-2/tp/pull/51

    https://github.com/AY1920S2-CS2113-T14-2/tp/pull/33/checks?check_run_id=530870712

    I have also tried to run runtest.bat on my computer but it passed all tests so I am not able to figure out the error

    I created functions that sorts all of our data in our arraylist every time an action takes place and the error is still evident. I don't know what to do at this point now

    Since the build is successful on my windows computer, I am unable to test and find the error that is causing this. What do you recommend we do at this point in order to move forward with the project?

    I can see the image in my .md file but I cannot seem to see it in GitHub Pages. Is there any particular reason this happens?

    My build has been failing for Windows only as seen in the attached photo. I thought the error was in runtest.bat, but my friend could successfully run the test in runtest.bat in her Windows machine.

    Are there any potential reasons for this error?

    Thank you Prof and @j-lum for helping us figure this out. I replaced all the "\n" with System.lineSeparator() and also removed the fancy ﹊ characters and replaced them with the normal straight line: "__". I am still getting the same error. Everything else seem seems to be fine as before though.

    Thank you all, I was able to fix the issue eventually. The problem was @j-lum pointed out. It was basically characters that Windows didn't recognise.

    After I opened a PR for some JUnit tests, the build keeps failing on Github with an assertion error in one of the tests. However, when I run the test locally, the build is successful. I'm not sure how to debug the test in Intellij because the local build doesn't have any errors.

    We initially suspected that this was due to the list (checked in the assertion) being modified in some other tests, but even after I reinitialized the list to be private to the failed test, the problem still persists.

    Any suggestions as to how to resolve this issue?

    It was mentioned during tutorial that it's because the question stated to assume that we are trying to minimize the number of total objects.

    Noted, here is the link to the PR: https://github.com/AY1920S2-CS2113-T14-1/tp/pull/43

    Thanks prof. The issue has been resolved. The assertion error was caused by some other constants being modified. Strangely enough, the error did not show up in my Intellij but it did on my teammate's Intellij.

    Hi,

    According to the iP Progress Dashboard, the merged branch-Level-X has not been found in the fork although I have merged the latest master to all the existing branches as a merge commit that is reflected in the branches itself.

    Have i misunderstood the instructions? If so, please advise. Thank you

    It seems that i had misunderstood the instructions here.

    I had completed the merged branches-level-X (did the work in the branch and merge it to master) prior to this mistake and it seems that the script cannot detect them anymore when it could the last time. What are the steps i should take to allow the script to properly pick up the merged branches again?

    Prior to the merging the master to each of the branches, branches contain work done for the respective increments i.e. Branch-Level-6 contains the increment Level-6 which is subsequently merged to master in a merge commit as per Level-6 increments instructions in that particular week and left alone thereafter. This applies for Level-5, Level-6 and Level-7 increments as can be seen below:

    Level-9 increments and A-JavaDoc were merged to master through a PR requests as seen below:

    However, due to the recent incorrect merges as can be seen above where i incorrectly merge master into all branches, all of them now contain the same code as master which is the most recent increment A-Release.

    Ok thank you

    I have followed the instructions given under the Week 2 Project tab to set up the project. After making changes for increment Level-1, committing and pushing it, I realised that my fork of Duke is public and I am unable to make it private without duplicating it. Can I check if we are supposed to leave it as public or otherwise? Thank you.

    Perhaps I have misread the instructions given for adding increments. Are we supposed to just commit locally without pushing it?

    I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃

    In that case, are we still supposed to push our commits to the public repo?

    I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃

    That's correct. Thanks @Zhilin-Huang

    In that case, are we still supposed to push our commits to the public repo?

    Yes, but no need to push this week. You'll need to push your code from week 3.

    Thank you for the clarification!

    1. In this case, there is a composition association between Email class and Subject object. Subject object cannot exist after the Email object is deleted.

    class Email {

    private Subject subject;
    

    ...

    }

    1. In this case, there is an aggregation association between Team class and Person object. Person object can exist even after the Team object is deleted (Why is this so?).

    class Team {

    Person leader;
    
    ...
    
    void setLeader(Person p) {
    
        leader = p;
    
    }
    

    }

    Is the key difference how the part/containee object is declared in the whole/container class? Does declaring the object as a private variable result in composition association?

    In this case, there is a composition association between Email class and Subject object

    class Email {

    private Subject subject;
    

    ...

    }

    In this case, there is an aggregation association between Team class and Person object.

    class Team {

    Person leader;
    
    ...
    
    void setLeader(Person p) {
    
        leader = p;
    
    }
    

    }

    Follow up question: Are composition and aggregation associations between

    1. a class and a object

    2. two classes

    3. two objects

    ?

    I accidentally posted this issue by pressing Enter. Will take note!

    Hi,

    For our team's UG, it is split into 4 markdown documents UG link. May I know whether I can convert each page into pdf and combine them together ?

    For the team files, do everyone in the team have to submit the UG/DG/JAR file respectively?

    May I know whether this is a typo or it is intended? 🤔

    Hi,

    I failed my I/O redirection test in git when I tried to create a pull request. I have no idea how to resolve this problem? Can somebody give me some guidance?

    Alright thanks for the prompt reply 😄

    For the submission today, must everybody submit the Jar file, UG pdf and DG pdf to luminus? Or just one person of the team to submit?

    I uploaded a png file on my local repo, and now am having trouble merging that particular branch to my master branch. This is the error that appears, and I am not sure how to solve it.

    Library

    GSON

    Purpose

    License

    Apache 2.0

    I have found the problem. The file was untracked, and once I removed it, and commited the new changes, it works fine.

    Hi,

    Our team is having issues with the tp, when we try to run the runtest.bat in the terminal. The program works fine when we run it using Gradle in IntelliJ, however, we keep getting this error when we run the runtest.bat:

    BUILD SUCCESSFUL in 11s

    2 actionable tasks: 2 executed

    Exception in thread "main" java.util.NoSuchElementException: No line found

        at java.base/java.util.Scanner.nextLine(Scanner.java:1651)
    
        at seedu.duke.Duke.readCommand(Duke.java:68)
    
        at seedu.duke.Duke.runCommandLoopUntilExitCommand(Duke.java:53)
    
        at seedu.duke.Duke.run(Duke.java:30)
    
        at seedu.duke.Duke.main(Duke.java:24)
    

    Test failed!

    Currently we have the following code to read commands from user input:

    private static Scanner in = new Scanner(System.in);

    // some other code

    public String readCommand() {

        String input = "";
    
        while (input.isEmpty()) {
    
            input = in.nextLine();
    
            input.trim();
    
        }
    
        return input;
    
    }
    

    Please advise. Thanks in advance!

    When I was running an iP's Jar file for evaluation using the java -jar {file_name} command, I got a "java.lang.UnsupportedClassVersionError" which says that it has been compiled by a more recent version of the Java Runtime (class file version 56.0). (Picture below)

    According to this website: https://mkyong.com/java/java-lang-unsupportedclassversionerror/ , class file version 56 refers to JDK 12. So I'm guessing I can't run it because I'm using JDK 11.

    May I clarify how I should go about the peer evaluation? More specifically, is it ok for me to download the source files and compile it myself for testing and evaluation? Or do I evaluate the program as is (not able to run)?

    Ok, issue posted, thanks Prof!

    Dear Prof Damith,

    Is it possible to release the results of the online quiz on luminus so that we know which questions were answered incorrectly, so as to be able to correct any misconception.

    I could not run my code on repl.it as it kept giving me this error.

    "Error: Could not find or load main class Main

    exit status 1"

    I do not encounter this issue when I compile and run my code on cmd.exe.

    Unable to resolve this issue. Should I just submit my code?

    Thanks for your input. I manage to get past the problem. Now I'm having this error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0

    at Main.main(Main.java:3)
    

    exit status 1"

    I googled that it means that there is no additional argument as I compile and run the code on repl.it, which causes my code to get that error

    Our tp PR was closed by mistake and I have reopened it. But after reopening, it seems that the new update of our code cannot be tracked in tp code dashboard. Here is the link of our tp PR

    How can I fix this problem? Thanks in advance!

    tP code dashboard is not linked to the team PR. It is only based on the code in the master branch of your team repo, and is updated only once per 24 hours. Does that clarify the situation or is something still amiss?

    Yeah, and our code is updated now. Thank you, professor!

    I also meet this problem. And I find it is because there is something wrong with storage and runtest.bat. e.g, if your storage file path is data/example.csv, then when you run runtest.sh, it will create a folder under text-ui-test and will get text-ui-test/data/example.csv. But for runtest.bat, it will create a folder under build/libs and will get build/libs/data/example.csv. So I edit runtest.bat in this way:

    image

    And now when I run runtest.bat, the storage file will in the same folder as the runtest.sh's.

    Filename and class name should be the same. You can try doing a copy of it on your desktop and save the file as WordComparator.java and try running it. If it works, you can just paste the code and submit. Hope it helps!

    https://netjs.blogspot.com/2015/04/why-file-name-and-class-name-same-in-java.html

    In the Object Diagram, I think that :History should be linked to :ActionX instead of :Task. This will then align with the Class Diagram. Correct me I'm wrong. I'm still learning :-p

    Keeps throwing either the error of class Main cannot be found.

    or

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0

    at Main.main(Main.java:3).
    

    mm I see, where did I go wrong here?

    class WordComparator {

    public static void main(String[] args) {

      if (args.length > 0) {
    
      String x = args[0];
    
      String y = args[1];
    
      System.out.println("Words given: " + x + ", " + y);
    
      boolean isSame = y.equals(x);
    
      System.out.println("They are the same: "+ isSame);
    
    }
    

    }

    }

    May i ask if we can continue to update our iP for testing/exploration/fun?

    Thank you!

    Hi, I've encountered similar issue. I've found out that it could be the result of Hashmap or Arraylist. For different OS, if your array is not sorted, it could result in failing runtest for different OS.

    Github status for workflow actions is up now.

    Then may be you have accessed out of bound index in array i guess