Go to CS2103/T main site
  • Dashboards home
  • Participation dashboard
  • Forum dashboard
  • iP progress
  • iP comments
  • iP Code
  • tP progress
  • tP comments
  • tP Code
  • Forum activities dashboard

    [This page was last updated on Nov 10 2020] [ indicates those watching the forum (kudos 👍)]

    The image below says that I have added 30 lines in the PPP but the status is still 'no'. Do you mind explaining why?

    Screenshot 2020-11-04 at 9 28 21 AM

    May I know when the deadline is for PPP?

    Are we allowed to edit directly on the github account of the team repo or do we have to create PRs?

    Hi, wat does it mean by "dummy bug reports" given in the instruction.

    >Label fx:id="roomNumber" textFill="black" alignment="CENTER" contentDisplay="CENTER" styleClass="cell_big_label"/>

    This is my code on java fxml, but the text is still white.

    May I know when the deadline is for the Smoke-test CATcher is? The website says before the deadline but I can't seem to find the deadline.

    Screenshot 2020-10-06 at 1 54 51 AM

    In the file above, I am not sure how to change the value of "patients". Been stuck at it for a few hours.

    Screenshot 2020-10-01 at 6 32 58 PM

    Are we allowed to extend deadlines and if all our PRs manage to be within the extended deadline is it considered late?

    I am unable to push my branches as my teammates made changes to the master branch which I have not pulled yet. Should I pull them and then push my branches?

    Is this week recess week for CS2103/T or next week?

    I am getting this error when I try to launch the app.

    Sep 18, 2020 3:47:26 PM seedu.address.MainApp init

    INFO: ===[ Initializing AddressBook ]=

    Sep 18, 2020 3:47:26 PM seedu.address.MainApp initConfig

    INFO: Using config file : config.json

    Sep 18, 2020 3:47:26 PM seedu.address.commons.util.JsonUtil readJsonFile

    INFO: Json file config.json not found

    Sep 18, 2020 3:47:26 PM seedu.address.MainApp initPrefs

    INFO: Using prefs file : preferences.json

    Sep 18, 2020 3:47:26 PM seedu.address.commons.util.JsonUtil readJsonFile

    INFO: Json file preferences.json not found

    Sep 18, 2020 3:47:26 PM seedu.address.commons.core.LogsCenter init

    INFO: currentLogLevel: INFO

    Sep 18, 2020 3:47:26 PM seedu.address.commons.util.JsonUtil readJsonFile

    INFO: Json file data/addressbook.json not found

    Sep 18, 2020 3:47:26 PM seedu.address.MainApp initModelManager

    INFO: Data file not found. Will be starting with a sample AddressBook

    Sep 18, 2020 3:47:26 PM seedu.address.MainApp start

    INFO: Starting AddressBook V0.6.0ea

    Sep 18, 2020 3:47:26 PM seedu.address.ui.UiManager start

    INFO: Starting UI...

    Exception in Application start method

    Sep 18, 2020 3:47:26 PM seedu.address.MainApp stop

    INFO: ============================ [ Stopping Address Book ] =============================

    Exception in thread "main" java.lang.RuntimeException: Exception in Application start method

    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)
    
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
    
    at java.base/java.lang.Thread.run(Thread.java:834)
    

    Caused by: java.lang.NullPointerException: Input stream must not be null

    at javafx.graphics/javafx.scene.image.Image.validateInputStream(Image.java:1117)
    
    at javafx.graphics/javafx.scene.image.Image.>init>(Image.java:701)
    
    at seedu.address.ui.UiManager.getImage(UiManager.java:55)
    
    at seedu.address.ui.UiManager.start(UiManager.java:41)
    
    at seedu.address.MainApp.start(MainApp.java:171)
    
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)
    
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)
    
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
    
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
    
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    

    I realised i didnt tag my JAR File as A-Release and I used another name. But I realised that the ip-dashboard doesn't care about it. Do i need to change my name of JAR File tag?

    My import statements are moving after I commit my changes. Is there a way to stop this?

    I am unable to push a branch-A-codequality after i merged master to it.

    I was coding and suddenly all the files which contains JavaFx statements turned red, indicating that JavaFX cannot be identified. However, when I run my launcher class I still can get a GUI. I don't really understand this behaviour.

    Screenshot 2020-09-07 at 9 14 48 PM

    After I have many inputs on my app, the output from the previous and current Duke comments is being cut short.

    Are we supposed to merge after completing each level or do we complete all levels and then merge them? Sorry I'm confused.

    I have the following dummy code below, but when I want to run it it gives me No test were found. Do you mind helping


    import org.junit.jupiter.api.Test;

    import static org.junit.jupiter.api.Assertions.assertEquals;

    public class test {

    @Test

    public void test(){

    assertEquals(2,2);

    }

    }

    💡 You can use Markdown to format your text

    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"

    💡 You can use Markdown to format your text

    Even if I type in a simple System.out.println(123) and the EXPECTED.TXT contains 123, I am getting a Failed message being printed

    My runtest.sh file is this:


    #!/usr/bin/env bash



    # create bin directory if it doesn't exist

    if [ ! -d "../bin" ]

    then

    mkdir ../bin

    fi



    # delete output from previous run

    if [ -e "./ACTUAL.TXT" ]

    then

    rm ACTUAL.TXT

    fi



    # compile the code into the bin folder, terminates if error occurred

    if

    ! (

    find ../src/main/java -name "*.java" >sources.txt

    javac -cp ../src -Xlint:none -d ../bin @sources.txt

    )

    then

    echo "********** BUILD FAILURE **********"

    exit 1

    fi



    # run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT

    java -classpath ../bin Duke < input.txt > ACTUAL.TXT



    # compare the output to the expected output

    diff ACTUAL.TXT EXPECTED.TXT

    if [ $? -eq 0 ]

    then

    echo "Test result: PASSED"

    exit 0

    else

    echo "Test result: FAILED"

    exit 1

    fi

    This is my error message:

    Noorul-Azlina:text-ui-test hidayadullaubayathulla$ /bin/bash /Users/hidayadullaubayathulla/ip/text-ui-test/runtest.sh

    0a1

    123

    Test result: FAILED

    My main method just contains: System.out.println(123)

    EXPECTED.TXT


    public static void main(String[] args) {

    try {

    System.out.println("123");

    }catch (Exception e){



    }



    }

    this is my main method, and I thought the ACTUAL.TXT would get filled by itself according to the textbook:

    Run the program as given below, which will redirect the text in input.txt as the input to AddressBook and similarly, will redirect the output of AddressBook to a text file output.txt. Note that this does not require any code changes to AddressBook.

    My ACTUAL.TXT file remains empty, thats why I dont know but when I run Duke.main, I get the output I want... Im confused

    So we are supposed to mark the main as the module?

    Okay thanks!

    Yeap that works! thanks!

    Screenshot 2020-09-07 at 9 16 58 PM Screenshot 2020-09-08 at 1 33 17 AM

    This is the error im getting. I tried pulling too but it didnt work.

    Right, cause my iP dashboard is all green as of now. So I don't have to make changes right?

    Alright thanks!

    Screenshot 2020-09-18 at 3 52 16 PM

    Oh okay, so the quiz bonus deadline is also pushed to 28 September?

    Yes prof, i made that mistake. Thank you!

    No I tried changing that yesterday, but it doesn't work.

    I also tried to search for the word patients but I can't find the code to which is responsible for that header. The @JsonProperty("patients") thing is used for reading not writing.

    Screenshot 2020-10-06 at 10 59 44 AM Screenshot 2020-10-06 at 10 59 15 AM

    I changed it, but it is still patients.

    I managed to change it thank you!

    Okay thank you.

    Okay thank you.

    Okay thanks Prof!

    Library

    PlantUML GitHub Action

    Dependency: Git Auto Commit Action

    Purpose

    Automatically generate and commit PlantUML pngs when .puml files are updated, so as to eliminate the manual labor of exporting each .puml file as an image whenever they are changed. Also, this allows people reviewing the PR to see the visual result of the UML changes on GitHub itself, which is convenient sometimes.

    I've uploaded a sample .yml file as a .txt file here for those that want to use this as well, if approved

    Edit: After some tinkering, I've updated the .yml file to fix some issues, you can get it here

    License

    PlantUML GitHub Action has no license indicated, but it runs the PlantUML tool which is under the GPL License

    Git Auto Commit Action: MIT License

    I would like to ask if the walking skeleton approach conflicts with the instructions for our breadth-first iterative approach?

    From the images below, the breadth-first approach says that "Adding all data classes first" is a bad thing, but it seems that a walking skeleton would be basically doing that, albeit just creating dummy data classes, unless my understanding of a walking skeleton is wrong.

    The walking skeleton also doesn't really make the product a "slightly better working version" as there will technically be no functionality change, so would creating the walking skeleton not be considered a proper, independent task to be assigned and committed to the master branch? Is it just a separate branch/dummy code that team members should refer to when implementing their feature?

    Hi, you probably need to install dos2unix on your laptop. (Not a mac user but I think you can use homebrew to install it)

    The random numbers indicate the places where differences in the ACTUAL and EXPECTED files are found, which in this case is probably the line endings and indentations.

    Assuming your runtest.bat resides in the text-ui-test folder, it would mean that the working directory when you run it is inside the text-ui-test folder. Thus, to access the src folder you need to move one level up, which would mean just changing the filepath to "..\src\main\java\data\list.txt" (just prepend a dot)

    I'm guessing that it's most likely because of the multiple creation of the Scanner object in your code, since you are creating a new Scanner every time you call the readCommand function.

    The better practice is to just create one Scanner object and use it for the entirety of the program to read inputs.

    Maybe you can also try adding a check for sc.hasNextLine() before you do sc.nextLine(), to get rid of the error temporarily and from there check if your program is reading the file properly and where it fails to find a nextLine

    Hmmmm that's weird, maybe the input file has some kind of issue? Could you try to recreate a smaller input.txt file in intellij by typing out like 3 commands and test it on that?

    From the website, the example path given is [project_root]/data/duke.txt, so in your case the mkdir should be run in the ip folder

    I think the method described in the link below is pretty simple and elegant

    https://stackoverflow.com/questions/4024544/how-to-parse-dates-in-multiple-formats-using-simpledateformat

    @iamgenechua can you try the solution detailed at the end of this issue thread?

    https://github.com/nus-cs2103-AY2021S1/forum/issues/49

    @tohyuting Are you using Windows? Because I can't find it on my screen.

    You can see it in the top right side of your photo, almost directly below the close [X] button

    Hi if you're using the checkstyle and suppress xmls from ab3, you can change your checkstyle version (in build.gradle as well) to 8.1 and it'll get rid of the 'FileContentsHolder' error. As for the config_loc, you can just ignore it and click next as it doesn't seem to affect the operation of checkstyle

    Yup works now, thank you! Would the older version affect our iP?

    Nope, I don't think it will, unless the checkstyle.xml file in ab3 is outdated

    You can try removing all mentions of the shadow plugin from from your build.gradle file

    I got this error when I tried running 2 instances of the program at the same time. Maybe you could check if a process is already running? The red stop button in the top toolbar of intellij should be lit up and if so, and you can just press it to stop your instances.

    If the above doesn't work, you can also try running grade clean

    For this week's tasks it is not needed. It's simpler to remove it first then add it back later on when needed.

    I think you can refer to issue #125

    #125

    Maybe you can take a look at the stack trace? The java.lang.XXXException tab usually doesn't give any information, you can try clicking on the Launcher.main() lines to see if there are more details on why these exceptions were thrown.

    Usually its due to some kind of uninitialized fields or a naming issue which leads to FXML and your java code not meshing together (or maybe you forgot to set the controller, etc.)

    There has been a similar discussion in issue #100, please refer to the reply by Prof

    Have you tried addressing the error shown by renaming your duke/Todo.java to duke/ToDo.java?

    You can just remove the new ImageView from the handleUserInput() function. The two getDialog functions are expecting an Image and not an ImageView.

    Are you using gradle run to run the app? If not, could you try that and see if the error still appears?

    Could you try changing it to ./seedu/duke/todo.txt instead and see if it works?

    I think you are reading too much into the word 'skeleton' 😃

    Walking skeleton is basically the minimal system that can do something useful (i.e., just enough bones/muscles to be able to walk!) -- skeleton doesn't mean add all classes in dummy form.

    In other words, it's exactly the breadth-first approach.

    Sorry, I'm still a little confused about what exactly the skeleton means 😅

    So for example if we were to create a walking skeleton for v1.2, would it be adding all the fields, methods and classes required for the features we are adding for v1.2 into the repo, but leaving the implementation out (returning some default value or doing some default action)? Or would it be something else?

    So for example if we were to create a walking skeleton for v1.2, would it be adding all the fields, methods and classes required for the features we are adding for v1.2 into the repo, but leaving the implementation out (returning some default value or doing some default action)? Or would it be something else?

    That's going too low level. 'Components' here means higher level things, not low level things such as fields and methods. For example, if you expect the network communication to be handled by a separate component and there isn't any yet, you can add an empty Network class as a place holder for that component. By the time you are done with v1.2, it could evolve in to a component consisting of a bunch of other internal classes and many methods/fields., but that's later. So, the skeleton referred to here is an architecture-level skeleton.

    Given you are starting off with an existing code base, the skeleton may already be there. Perhaps you only need to do a bit of refactoring (rename a few things), or in rare cases, add a place holder for a new component that you need but not present in the current one.

    Ah ok I think I get it now thank you for the detailed clarification Prof!

    I'm guessing you need to find and change @JsonProperty("patients") in your code. You can use Ctrl-Shift-F to find all instances of the word "patients" in your code.

    I also tried to search for the word patients but I can't find the code to which is responsible for that header. The @JsonProperty("patients") thing is used for reading not writing.

    Hmmmm from the jackson github I don't think its only used for reading. Was the @JsonProperty("patients") you changed in JsonSerializableAddressBook? Could you try adding a @JsonProperty(&gt;new name here>) before the private final List&gt;> patients in the same file?

    Did you try starting afresh (moving your current json to another folder and regenerating by adding some data back using the app)? Does it still give you patients?

    Another thing you might wanna try would be changing the variable name itself to rooms?

    Maybe try re-running the CI? There's a small chance that its just some weird temporary bug

    hi @CodyChew I cloned your code and figured out the issue. Try moving/temporarily deleting your data folder at your project root and re-run gradle test, I think you should be able to debug from there 😃

    Remember that the data folder is gitignored

    WOAH, thanks so much @qwoprocks I didn't notice it! How did you manage to figure it out?

    No problem 😄. I just did a clone of your repo and immediately ran the tests, which failed due to the lack of the data folder. Then I did a quick trace through the errors to see that the file validation portion of your Reference class was failing.

    You can refer to the java documentation here and see that the java.awt.HeadlessException is being caused by your Desktop.getDesktop().

    This is because the CI workflows run in a headless environment, and the awt Desktop is not supported there. I would probably skip the tests in the CI by wrapping the whole thing in an if (Desktop.isDesktopSupported()), since as far as I can see there's no practical workaround that allows you to open files in this headless environment, besides using Runtime exec and tailoring to each OS maybe?

    Not sure if anyone else knows of an easy way to circumvent this limitation?

    Thanks for the reply.

    I have followed your suggestion, everything passes but macOS CI.

    This is really strange. Could this be because of the OpenGL renderer used in macOS CI?

    Why is the CI desktopSupported anyways? =(

    Unable to create basic Accelerated OpenGL renderer.

    Core Image is now using the software OpenGL renderer. This will be slow.

    seedu.address.logic.commands.OpenCommandIntegrationTest > execute_openValidTag_success() FAILED

    java.lang.AssertionError at OpenCommandIntegrationTest.java:38
    
        Caused by: seedu.address.logic.commands.exceptions.CommandException at OpenCommandIntegrationTest.java:38
    
            Caused by: java.io.IOException at OpenCommandIntegrationTest.java:38
    

    seedu.address.logic.commands.OpenCommandTest > execute_tagNameInModel_success() FAILED

    java.lang.AssertionError at OpenCommandTest.java:69
    
        Caused by: seedu.address.logic.commands.exceptions.CommandException at OpenCommandTest.java:69
    
            Caused by: java.io.IOException at OpenCommandTest.java:69
    

    I believe that the MacOS fails because you can't run .bat files in Mac, which is why the IOException is thrown 😦

    You can view the results of the checks here

    As shown on that page, the issue that's causing your CI to fail is the following error:

    ERROR:../config/checkstyle/suppressions.xml:9: no newline at EOF.

    I'm not 100% sure, but it looks like you're on Windows and tried to run the jar file from your WSL CLI. WSL operates in a virtual environment of sorts and does not offer proper GUI support, thus it will be unable to run this GUI application. You need to run the same command in powershell / cmd

    Hi, I faced the same problem and if I recall correctly I solved it by downloading and using the 32-bit version of graphviz. The result of running dot -v on my computer gives this:

    dot - graphviz version 2.44.1 (20200629.0800)

    As the error suggests, this is caused by different java versions being used for compiling and running. You can refer to these issues for more info: #25, #181, #247, #266

    @GeNiaaz could you try changing public static final String VALID_TEAMMATE_GIT_USERNAME_A = "Sparrow32"; in TeammateTestUtil.java to public static final String VALID_TEAMMATE_GIT_USERNAME_A = "Sparrow"; and see if this passes the checks?

    If it does pass, I suspect that your validation regex for git usernames is incorrect.

    Hi prof,

    Yesterday, when I pasted link of RepoSense in PPP, it worked. But just now when I test it, it failed to link me to RepoSense, does it matter? Will it affect grading?

    Thanks!

    Hi guys,

    Anyone knows the instruction for that assertion task? I add one assert into code but it does not become green. So I feel confused.

    Thanks for any help given!

    Hi,

    Our group fails to pass CI due to codecov error. Does anyone know how to solve this problem?

    Hi prof, if our group is using trello to manage the project, is it ok? But we see that there is one task regarding GitHub issues although it is not compulsory initially.

    Hi,

    I am implementing login function to my iP. I want to use JSON to store user information. So is there any good JSON package in Java? Any help will be appreciated.

    Hi, I run duke.jar in powershell but got this error. The structure of the project is compliant with instructions. Anyone knows the reason? Thank you for any help given.

    In command line, if you want to delete tags on remote, you can try push origin :/refs/tags/tagname.

    Also, you may try an unsafe way push origin localTageName:tagName. This has the possibility of deleteing the whole branch. But I used this since the first method fails. I haven't found the reason why the first method does not work. Any help will be appreciated.

    I tried chcp 65001 to display the tick and x symbol but I got ? in powershell. Then I tried chcp 1200 to switch to UTF-16 but it reported Invalid Code Page. I don't know how to fix this bug.

    Any help will be appreciated.

    Thanks!

    No but I gave up so just use IDEA to run the code. It works well.

    Thank you for both of your suggestions! The problem has been solved.

    You probabaly need to download the checkstyle and suppressions file from AB3 and paste it into your own project.

    Thanks.

    Thanks prof

    I spent four hours solving this problem and found that it failed because not all tasks have been run. I deleted all of tests before so no report was created.

    But I feel confused is it necessary to write tests for main code at the same time when I write main class? Or I can write tests after main part is almost done. If so, JavaCI cannot pass because original tests cannot work as long as of original classes is changed. Is it not friendly to a project which is based on modifying other projects.

    ok thanks!

    Hi,

    I mean why in tp dashboard, it does not show asserts found in my code base.

    I have already put assert in my code and merge into master branch.

    @damithc Hi prof. RepoSense failed to detect my commits after 13 Oct.

    image image

    In tp progress, it detects those commits but RepoSense failed to do so. How can I solve these issues?

    Yes, I am using a new device. So if I configure again in local device, will it be detected?

    Attached is author name of current device.

    image

    Or I need to write an assertion after configuring and push again?

    It should be SimonXIA0316.

    So commits written by SimonXIA0316 in the future can be detected right?

    Okie, thanks prof!

    BTW, when can I see the update info on RepoSense report?

    Okay thanks prof!

    Hi prof, @damithc I wrote the assertions on 21 Oct, but the tab of assertions is still red although it can be detected in RepoSense.

    image

    Also for overdue task, if I do it now, will it be green again?

    Prof, you mean which question? The assertion tab?

    Okay thanks for reply!

    Thanks prof!

    I'm not sure whether this is a discussion worth having, but I have this small query:

    I have integrated JavaFX into my project and now have a fully functional (albeit ugly-looking) GUI. I'm assuming this is the main platform users will be interacting on/with.

    Does that mean the part of the code that deals with printing output onto the terminal (i.e. how we've been interacting with the user prior) is now rendered obsolete? Should I remove it to prevent unncessary bloat in my code?

    The only purpose I see in keeping it right now is the fact that if I remove it, it'd be hard to do semi-automated testing using the provided .bat/.sh file, but I think unit testing using JUnit seems far more efficient as a form of automated testing.

    Could anyone shed some light on this? Any comments would be appreciated!

    I had a lot of trouble with getting my .bat file to work as well, and this is what worked for me:

    If you're like me and have a very long and convoluted file path (with lots of whitespaces) to your source files, you can try using the following method:

    SET MY_PATH=&gt;your_really_long_path_here>

    Hereafter you can refer to your path by simply calling %MY_PATH% wherever you need it.

    Here's an example of what I'm talking about:

    Let me know if this helps 😃

    Regarding this line:

    SET MY_PATH="my_file_location"

    Did you encase your location path in double quotes (")? If you did, try removing the double quotes.

    i.e. Suppose my path is something like C:\Users\blah\CS2103\ip. Then that line would be:

    SET MY_PATH=C:\Users\blah\CS2103\ip

    The former (I just tried) gave me a similar error in your post while the latter worked just fine.

    First issue regarding the cmd window closing:

    Try putting a PAUSE command at the end of the script, so something like:

    Second issue regarding the .bat not working properly:

    I'm not sure where your respective directories are but here's what you should be inputting for each command javac and java:


    javac -cp <your_source_code_directory> Xlint:none -d <destination_directory> <file(s)_to_compile>

    -cp <your_source_code_directory>: (classpath) your .java files should be in this specified directory.

    -d <destination_directory>: (destination directory) where your .java files will end up in after compilation (as .class files).


    java -classpath <your_source_code_directory> <file_to_run> < input.txt > ACTUAL.TXT

    classpath <your_source_code_directory>: note this should match the directory where your .class files ended up after compilation.

    As a reference here is what my .bat file looks like atm:

    Hope this helps!

    Edit: fixed typo

    You can try the following:


    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java

    But iirc if you compile your top-level class first (in terms of dependencies) every other relevant class should be compiled as well. Hence why calling javac on just Duke.java works for me

    It may be something to do with javac PATH not having been set properly.

    See: https://www.edureka.co/community/4800/unable-resolve-error-recognized-internal-external-command

    It should be in the parent directory of src, so in your case that would be in ip.

    To clarify: .. means navigate to parent directory. So if your current directory is something like C:\Users\blah\text-ui-test, a script inside calling for the path ..\src implies C:\Users\blah\src. (blah is the parent directory here)

    Upon closer inspection of your .bat file, go to line 10 and change -d ..\src\bin to -d ..\bin.

    Can you elaborate (and maybe provide an example) of case 2? Not sure I fully understand it.

    Nevertheless, to emphasize the notion of encapsulation, what I personally did was create a separate exception class that handles logic specific to an empty todo (or any other task for that matter) description (aptly named DukeInvalidTaskDescriptionException). This class extends from DukeException.

    By doing so I ensure that neither Task nor any exceptions related to the class (or its subclasses) know about each other (because imo they shouldn't). All of the logic with respect to exception handling would then be handled by the overarching driver class (Duke by default). This includes throwing the relevant exceptions in try-catch blocks, etc.

    I faced a similar issue previously.

    I solved it by placing my scanner object as a field within the Ui class so that way I only have one scanner object per Ui object (as @qwoprocks has kindly suggested). Thereafter your readCommand body can just look something like this:


    public String readCommand() {

    return scanner.nextLine();

    }

    If by testing you mean continuing to use .bat or .sh files to script testing, the way I did it was pretty rudimentary:

    I created a feature to support the "delete all" user input command. This command (as its name suggests) deletes all existing tasks (if any) in the list of tasks.

    All I did afterwards was make sure this command was the first line of my input.txt. This allowed the task list to "reset" every time the script is run.

    A cool side effect to adding this command is that users of my Duke chatbot will be able to use it in normal circumstances as well (because I think the default implementation of delete 2, etc. can be quite clunky especially for substantially big lists).

    I'm sure there are more clever ways to go about doing this though.

    Changing your -cp directory in line 18 to -cp ../src/main/java (where your sources root is) should fix the issue I believe

    In the build.gradle file (should be in your root folder), I think you will need to make the following change:

    Change the class name according to your main class name (and package).

    Hope this helps!

    This is a similar issue to #101 I believe

    Assuming you have been doing the project on Intellij, then like (me and many others) yours should fall under Scenario 2!

    As per the instructions in A-Gradle, merge the branch that "added gradle support" into your current master branch and follow the instructions in Scenario 2 from there.

    Thanks prof!

    I think this is a similar issue to the one in #125

    Okay, sorry, I realised I had to either change the main class in the build gradle file.

    @yanbingtao You could try the solution posed in #101. Hope this helps!

    Updated my GUI a little bit so it looks like this now:

    Thanks @tankangliang for the resources to integrating CSS into JavaFX!

    It's covered under week 5's topics.

    Do you have a Duke constructor that takes in 0 parameters? (i.e. new Duke())

    If not, try implementing one.

    I had a similar issue and I managed to solve it by implementing one.

    #160

    This seems similar to #176, you might wanna try the solutions posted there

    Try the solutions posted in #125, I think the problems there are similar

    Go to the [root]/build.gradle file, you should see this:

    Hope this helps!

    This seems to be a common issue across the board (see #375 ). My team is also experiencing the same problem, I suspect the issue is on the GitHub/Codecov server side

    Which block are you referring to?

    Under .github/workflow/gradle.yml, I commented out the following block:


    - uses: codecov/codecov-action@v1

    if: runner.os == 'Linux'

    with:

    file: $/build/reports/jacoco/coverage/coverage.xml

    fail_ci_if_error: true

    and my team's repo CI starting passing again.

    This is an issue regarding Desktop.getDesktop().open().

    Desktop.getDesktop().open() passes all JUnit testing and can open files in linux . However, when this method is called under JavaFX (I've only tested on KDE Ubuntu and KDE Manjaro), the JavaFX application freezes.😢

    This seems to be long term concurrency issue with JavaFX, and the solution I found on StackOverflow does not seem to work well.

    https://stackoverflow.com/questions/23176624/javafx-freeze-on-desktop-openfile-desktop-browseuri

    Should this be considered a bug or a limitation of JavaFX?

    Platform: Windows

    As my group is doing a file management app, we need to open files that are stored under some directory.

    We implemented that using java.awt.Desktop.

    However, after we wrote tests to assert success and failure of opening some dummy files, the tests pass locally but fails Java-CI on GitHub.

    Has anyone encountered this issue before? Is there anyway to resolve this issue?

    https://github.com/AY2021S1-CS2103T-F12-1/tp/pull/91


    seedu.address.logic.commands.OpenCommandTest > execute_tagNameInModelFileNotFound_throwCommandException() FAILED

    org.opentest4j.AssertionFailedError at OpenCommandTest.java:76

    Caused by: java.awt.HeadlessException at OpenCommandTest.java:77



    seedu.address.logic.commands.OpenCommandTest > execute_tagNameInModel_success() FAILED

    java.awt.HeadlessException at OpenCommandTest.java:65



    seedu.address.logic.commands.OpenCommandIntegrationTest > execute_openValidTag_success() FAILED

    java.awt.HeadlessException at OpenCommandIntegrationTest.java:32



    seedu.address.logic.commands.OpenCommandIntegrationTest > execute_openInvalidTag_throwCommandException() FAILED

    org.opentest4j.AssertionFailedError at OpenCommandIntegrationTest.java:47

    Caused by: java.awt.HeadlessException at OpenCommandIntegrationTest.java:47



    214 tests completed, 4 failed, 3 skipped

    My group is doing something completely unrelated to AddressBook3 in terms of functionality, so we need to modify a lot of classes.

    We plan to remove all the irrelevant classes before putting in our own code.

    Is this approach efficient? Or should we modify existing code before removing the irrelevant code?

    My program works fine in windows. However, I encountered a strange bug when testing it in Manjaro Linux.

    This bug only happens when I set the stage as not resizable.

    stage.setResizable(false);

    My window doesn't seem to appear. It is only a vertical line.

    It also appears to be running in the taskbar.

    This bug is mentioned in some other issue reports:

    https://github.com/defold/editor2-issues/issues/2602

    https://github.com/javafxports/openjdk-jfx/issues/222

    Has anyone encountered the same bug before?

    I think the issue is platform dependent, so should I try to rectify the bug or should I leave it as it is?

    Intellij is very smart and recommends me to simplify my code here because "it is always true".

    However, I feel that my way is clearer to the average reader (myself).

    My question is that while I think we are able to reason in our head that some of the code is true, should we still value readability and write verbose code?

    Should we use obvious assertions?

    Where do we draw the line?

    It was my fault for failing to read the requirement of iP this week, which states:

    Discuss with your team members to ensure that each member picks a different extension.

    I want to ask if my teammate and I are allowed to implement the same extension.

    I can't think of any other way except checking time string against multiple regex, and my regex is pretty bad.

    For example here's one:

    Pattern p = Pattern.compile("(?&gt;year>\\d{4})[\\s\\-.](?&gt;month>\\d{1,2})[\\s\\-.](?&gt;day>\\d{1,2})"
    
            + "[\\s\\-.T](?&gt;hour>\\d{1,2})[\\s\\-.:]?(?&gt;minute>\\d{2})");
    
    Matcher m = pattern.matcher(timeString);
    
    m.matches();
    

    Matcher.group(groupName) can then be used to access the individual capture groups.

    If the pattern cannot be matched then I just store the raw string as time.

    It will be great if anyone can share a elegant approach for parsing date and time.

    Thanks in advance!

    One of the questions in the quiz is phrased as follows:

    When wrapping a long statement (an example given below), one should indent lines using two tabs instead of the usual one tab.

    totalSum = a + b + c

          + d + e;
    

    In the context of this question, does "tab" mean four spaces or an unexpanded tab?

    Thank you! @damithc

    This is gold!

    I think the method described in the link below is pretty simple and elegant

    https://stackoverflow.com/questions/4024544/how-to-parse-dates-in-multiple-formats-using-simpledateformat

    I had the same issue. Searched around and found it could be some non-printable control characters that are causing the problem.

    Maybe you can try my_string.replaceAll("\\p{Cntrl}", " "); on both expected string and actual string to see if it helps.

    I got mine to work after fixing a few extra newline characters in my Ui class.

    I have learnt in CS2030 that classes are better if they are immutable, so I kept all my classes immutable.

    For example, the list object can be immutable if we create a new list using the old list every time.

    Is immutability no longer strictly desirable in higher level programming modules?

    Just a caution: don't rely on a lot of additional configurations to get the correct app behavior. Keep in mind that the end users will simply be running the jar file without any additional set up. The only requirement is that they have Java 11 runtime.

    So the correct way of doing things is to stop using those Unicode characters?

    Thank you prof!

    Yes there seems to be some UI problem as well if I set resizable to false. Some UI elements are cut off.

    This is a clean fork of AB3 with only the above modification.


    @Override

    public void start(Stage primaryStage) {

    logger.info("Starting AddressBook " + MainApp.VERSION);

    primaryStage.setResizable(false);

    ui.start(primaryStage);

    }

    I guess that would work.

    I wanted to limit the user's ability to resize since the inner elements are not resizable. And it works in windows but just not KDE linux.

    Thank you for your reply.

    We want to make a file manager, where the user can tag files and open files using tags.

    Since this is no longer related to person. we thought that we should delete everything related to person as well as the unused Command and Parser, before working on our implementations of Tag class, commands and parsers. We will need to delete all the relevant tests as well.

    Is this the right way? Or should we modify AB3 gradually?

    Thank you for your kind attention!

    Thank you for your detailed advice! =)

    Thanks for the reply.

    I have followed your suggestion, everything passes but macOS CI.

    This is really strange. Could this be because of the OpenGL renderer used in macOS CI?

    Why is the CI desktopSupported anyways? =(


    Unable to create basic Accelerated OpenGL renderer.

    Core Image is now using the software OpenGL renderer. This will be slow.



    seedu.address.logic.commands.OpenCommandIntegrationTest > execute_openValidTag_success() FAILED

    java.lang.AssertionError at OpenCommandIntegrationTest.java:38

    Caused by: seedu.address.logic.commands.exceptions.CommandException at OpenCommandIntegrationTest.java:38

    Caused by: java.io.IOException at OpenCommandIntegrationTest.java:38



    seedu.address.logic.commands.OpenCommandTest > execute_tagNameInModel_success() FAILED

    java.lang.AssertionError at OpenCommandTest.java:69

    Caused by: seedu.address.logic.commands.exceptions.CommandException at OpenCommandTest.java:69

    Caused by: java.io.IOException at OpenCommandTest.java:69

    Wow I didn't realise that! Thank you very much!

    This is very strange because all these issues with freezing, concurrency and threads only happens under linux.

    Running the code below under JavaFX will cause the freeze in Linux. It is not dependent on what file is being opened.


    try {

    Desktop.getDesktop().open(new File("/"));

    } catch (IOException e) {



    }

    I think you can find that option under .github/workflow/gradle.yml.

    uses: codecov/codecov-action@v1

    Hello, have you checked if Desktop is supported?

    Maybe this can help but I am not sure.

    if(!Desktop.isDesktopSupported()){

    System.out.println("Desktop is not supported");

    return;

    }

    Desktop desktop = Desktop.getDesktop();

    if(file.exists()) {

    desktop.open(file);

    }

    Yes the platform is desktop supported.

    I think the main issue is because JavaFX's thread is blocked by Desktop.getDesktop().open().

    A walk-around that my team used was to run Desktop.getDesktop().open() on a separate thread.


    new Thread(() -&gt; {

    try {

    Desktop.getDesktop().open(file);

    } catch (IOException e)

    e.printStackTrace();

    }

    }).start();

    Hi @luo-git ! My team faced a similar issue and I think this will help you.

    try {

    if (SystemUtils.IS_OS_LINUX) {
    
        // Workaround for Linux because "Desktop.getDesktop().browse()" doesn't work on some Linux implementations
    
        if (Runtime.getRuntime().exec(new String[] { "which", "xdg-open" }).getInputStream().read() != -1) {
    
            Runtime.getRuntime().exec(new String[] { "xdg-open", urlString });
    
        } else {
    
            showAlert("Browse URL", "xdg-open not supported!", true);
    
        }
    
    } else {
    
        if (Desktop.isDesktopSupported())
    
        {
    
            Desktop.getDesktop().browse(new URI(urlString));
    
        } else {
    
            showAlert("Browse URL", "Desktop command not supported!", true);
    
        }
    
    }
    

    } catch (IOException | URISyntaxException e) {

    showAlert("Browse URL", "Failed to open URL " + urlString , true);
    

    }

    This is a workaround I found on the internet.

    Thank you for the suggestion Kevin! Have you tested this solution on MacOS?

    it states on the module website that each individual should come up with 1 page of the UG and 3 pages of DG, can i clarify if we are supposed to indicated author of each section of the UG/DG?

    Used to be able to view all checkstyle errors in my console and have a link to go to the line with the error but now I have to view the html file on my web browser (see below), is this an issue with the settings?

    Screenshot 2020-10-21 at 4 32 28 PM

    I am currently writing test cases for a new object similar to tasks, it is quite cumbersome to write so many classes for the sole purpose of testing e.g. TaskBuilder, TypicalTask. If I were to write test cases that are effective but not as well written as those in AB will I be penalised?

    An example of such code is as follows:

    Screenshot 2020-10-21 at 4 04 17 PM

    If my team is implementing a find feature in an application similar to iP, would an input of

    find date:01-01-202 (note that the year is 202 not 2020) which returns results even if the date is not in a "correct" format considered a bug?

    Screenshot 2020-10-17 at 6 09 25 PM

    If we state how the find function is intended to work in the UG/DG then it will no longer be considered a bug.

    Screenshot 2020-10-15 at 12 38 04 PM

    I have 2 questions to ask:

    1. For each activity does the actor(person carrying out activity) need to be stated?

    2. Do we need to include the activity of customer making payment?

    i.e. Is the diagram below preferred over the answer given in the tutorial?

    Does anyone know what may cause the gradle build to run indefinitely? Running gradle clean test shows that all test cases passes and the application is able to run, CI on git also passes but build runs indefinitely.

    My teammate has tried deleting .idea and importing the project from build.gradle and the problem perisists.

    Attached is the output before reimporting the project

    This is the build that runs indefinitely

    The circled part seems wrong

    If a class is private do we need to add the '-' sign beside its name?

    For example, is the example above correct as well?

    • Changed name to title

    • Application runs

    • Checkstyle fails

    • Checkstyle version in both tool settings and build.gradle is 8.29

    Screenshot 2020-10-01 at 9 33 14 PM

    Help is appreciated

    Screenshot 2020-09-27 at 5 14 05 PM

    Hi does anyone know how to complete this last task? I have:

    • a PR to my team's repo with milestone v1.1 tagged to it

    • PR contains issue that is also tagged with milestone v1.1 and assigned to me

    Thank you

    OS: MacOS

    I was trying to follow this tutorial but I am unsure how to execute step 1.

    Screenshot 2020-09-24 at 6 03 37 PM

    As seen in the screenshot, after jumping to the source code the safe delete option is not available under refactor

    Ok, thanks prof, I just figured it out

    Thank you @ktaekwon000

    Screenshot 2020-10-01 at 10 12 06 PM

    Found the mistake, there were changes made to the checkstyle file thank you prof!

    I would also like to clarify if rating=POOR should be written as rating=Rating.POOR

    Ok thanks prof, I was confused as I thought this did not follow the standard notation

    Thank you for the suggestion professor but the rest of the team does not have this issue, we suspect it has something to do with one of the .gitignore files but reimporting the project after cloning it from git does not solve this issue

    Thank you Prof.

    Ok noted, thank you prof.

    Thanks prof

    Ok, thanks prof

    File size: Recommended to keep below 200Mb. You can use a low resolution as long as the video is in usable quality.

    Hi Prof @damithc, can I confirm that the demo video file size limit is 200Mb and not 200MB?

    Library

    Jekyll Spaceship

    Purpose

    For beautiful documentation. 😂

    License

    Licensed under the MIT License.

    Library

    git-hooks-gradle-plugin

    Purpose

    For sharing git hooks without having to add .git/hooks to the working tree, or for each developer to manually set up the hooks locally. Unfortunately, the previous library (#201) which we had intended to use is incompatible with Windows.

    License

    Licensed under the MIT License.

    Library

    IDEA inspection plugin

    Purpose

    For running IDEA inspections during Gradle build.

    License

    Licensed under the Apache License 2.0.

    Library

    Gradle plugin for PIT Mutation Testing

    Purpose

    For performing mutation testing.

    License

    Licensed under the Apache License 2.0.

    Library

    Gradle Git Hook

    Purpose

    For sharing git hooks without having to add .git/hooks to the working tree, or for each developer to manually set up the hooks locally.

    License

    Licensed under the Apache License 2.0.

    You can redirect stderr to stdout by appending 2>&1 to the back of the command:


    Duke < input.txt > ACTUAL.TXT 2>&1

    This should work for both bash and cmd.

    What does your build.gradle look like?

    Could you try using a version of Shadow that's listed here instead of 5.1.0?

    Edit: Never mind, 5.1.0 does seem to be available in the Gradle plugin repo. It might help to show your build.gradle file, as well as the output when running with --stacktrace.

    I'm able to clone @yuming7144's repo, checkout the branch with Gradle and get it working on my end. After getting her to try some things out on her end, I'm fairly certain it's a network issue (as opposed to some error in config or setting up). Anyone have any other suggestions?

    Added a dark theme! Unfortunately, it doesn't seem like setting the colour of the title bar is possible without implementing a custom one. 😦

    Does rebuilding the project solve the issue?

    @damithc Hi Prof, do you want permission request threads to remain open? Or should they be closed once approval is given/rejected? Thank you!

    This is due to the IntelliJ console picking out ERROR: as a keyword and thus showing the supposed error in another window.

    Just click on the topmost window to get back to your program.

    Alternatively, run your application from a terminal that doesn't have this keyword flagging feature.

    I noticed from your Ui.png that you're running Windows. This seems like a Unix permission issue; more specifically, gradlew is not set to be executable (x).

    Try running the following command, then commit and push:


    git update-index --chmod=+x gradlew

    Try specifying the following in your build.gradle:


    sourceCompatibility = JavaVersion.VERSION_11

    targetCompatibility = JavaVersion.VERSION_11

    I think you might have made a spelling error with sourceCompatibility.

    Approved. Keep us posted if the plugin works out. We might want to adopt it for AB3. The plantUML support is especially interesting.

    GitHub Pages runs in safe mode and only allows the following whitelisted dependencies. As such, I'm planning on adding a CI job to build the site without having to adhere to the safe mode restrictions, and then pushing the generated static files to a separate branch which will then be deployed.

    I'm not sure whether I have to seek permission if I use pre-configured GitHub Actions, but this seems to do exactly what I want. If permission is required, I can open a new issue for it.

    As for AB3 adoption, I think it wouldn't be too big a concern as long as the teaching team adds the necessary GitHub workflows to support whatever was described above in the base repo, since this proposed GitHub Pages deployment process is rather involved.

    @damithc Hi Prof, just a quick update. We didn't end up using that GitHub Action as it only works with personal access tokens, and not the GITHUB_TOKEN secret that is automatically generated for every repository. It felt wrong to have to use personal access tokens for a team repo.

    Also, it turns out that the github-pages gem handles a lot of things in the background, such as setting the name of the repo as the base URL. If anyone else is planning on doing this, do keep in mind that there will be a lot of troubleshooting involved. This was the GitHub workflow that we came up with: https://github.com/AY2021S1-CS2103T-W16-3/tp/blob/master/.github/workflows/build-jekyll.yml.

    If we were to adopt it, it will be for future semesters, not this one. Let's see how it goes for your team. We can decide at the end of the semester.

    As for whether it was worth all the trouble, we'll get back to you at the end of the semester. 😄

    What sort of path syntax is this?

    This is a refspec; a mapping of references between a remote and a local repository.

    does anyone know what does the fetch = +refs/heads/*:refs/remotes/origin/* mean? can't really seem to find much on google... I assume it means something like fetch all head refs + and all refs in remote/origin.

    Fetch all references under refs/heads from the remote repository and map them to refs/remotes/origin in the local repository. The + allows for the references to be updated even if it isn't a fast-forward (such as when the commit history is rewritten).

    More information can be found here.

    I've taken a few examples out of your failing CI:


    ERROR:../src/main/java/seedu/address/logic/commands/RemarkCommand.java:98: no newline at EOF.

    This means that your RemarkCommand.java file does not have a newline at the end of file. To resolve this, simply add an empty line at the bottom of the file.


    ERROR:../src/main/java/seedu/address/model/person/Person.java:54: trailing whitespace.

    This means that at line 54 of your Person.java file, you have extra whitespace. To resolve this, delete off the additional whitespace at the end of the line. You can see the additional whitespace if you select it.

    Hello, you're in luck! This is something that my group wanted to do as well, so I came up with the following solution.

    Feel free to reference our implementation, but do give credit so as not to run afoul of plagiarism rules.

    @howtoosee Thanks for alerting me to this! I didn't realise that the styling was being applied to all ordered lists. D:

    Fix is here.

    Hi, change line 23 in UiManager.java to


    private static final String ICON_APPLICATION = "/images/salon_icon.png";

    I suspect that different OSes have different load orders. Due to the icon being set both via MainWindow.fxml and programmatically in UiManager.java, you end up with different icons on different OSes.

    When doing the PE, say a bug is discovered in a program. If the bug affects other areas of operation of the program and causes them to behave unexpectedly, are the "derived" errors considered bugs too and cause us to be marked down? Or are we only graded based on the "root" bugs in our program.

    For example, if the time is not validated, and leads to many other functions behaving unexpectedly, are we marked down for all the subsequent errors? Or simply for the initial bug of time not being validated.

    For the recording of our demo, are we allowed to record using Zoom's screen record function? That way we can get everyone to contribute.

    Are we allowed to make any changes to the README during these few days?

    I am not sure what is causing this issue, since the tests pass on my machine. I have added lines to clear details in static classes to maybe clear the memory, but nothing is working and I do not know what else I can try.

    The fail message is as shown:

    Here is a snippet of the failing testcases:

    The PR is linked below:

    PR

    My test is suddenly failing at Codecov, and I have no idea why. Does anyone have a fix for this? I have rerun several times.

    Why is there a line from view -> controller -> user after displayStudentData executes? Shouldn;t it go straight from View back to the user?

    My team and I have had issues with PlantUml, and want to use draw.io to create our diagrams. Would that be okay? To replace our diagrams with draw.io

    Make it easier to solve your checkstyle errors by scanning for them right in IntelliJ so you never have to deal with failed commits from checkstyle ever again.

    1. Navigate to Settings > Checkstyle

    1. Press the + sign and browse for a checkstyle file.

    2. From there open tP > config > checkstyle > checkstyle.xml

    3. Name the checkstyle anything you wish eg. checkstyle_is_a_2_MC_mod

    4. For scan scope, select Only Java sources (including tests)

    5. Click apply and ok

    6. Close the settings menu and click the checkstyle tab at the bottom:

    1. Simply select the correct Rules, and press the folder icon on the left to run checkstyle on all your java files.

    2. Simply double click each error to navigate to the error! 👍

    Regarding v1.3, it is due in Week 11 right? And the JAR file for the mock practical exam is due in Week 10?

    I was refactoring Address to ProjectDescription, and inadvertently changed a lot of files unintentionally. Among those changed were some 'seedu.address...' changed to 'seedu.ProjectDescription'.

    In the process of refactoring, I encountered many of these issues and subsequently fixed them.

    However, I face one last issue now. The 'validFile.fxml' and 'validFileWithFxRoot.fxml' have an import statement as seen below:

    '>?import seedu.projectDescription.ui.TestFxmlObject?>

    >TestFxmlObject xmlns:fx="http://javafx.com/fxml/1" fx:id="validFileRoot">Hello World!>/TestFxmlObject>'

    I tried looking line by line for any other accidental change, even going over to Github and combing over every change line by line, However, I cannot seem to solve this error.

    Since the issue arises when building, I realised this file is created from elsewhere in the code, and once I find that file I can change it and solve this issue

    I would like to implore any kind soul who has gotten this far in my issue to please point me in the right direction. I have spent plenty of time on this issue and would like to resolve it as soon as possible.

    Here is a video of my issue: https://photos.app.goo.gl/pytLCU3jtkWuBErr9

    @LeeEnHao Hi EnHao, I am facing an issue regarding my fxml files too. They are created when the project is built, can I ask where exactly it is constructed? I'm not sure about this and have been trying to solve this issue for ages.

    I solved it! 👍

    The issue was that I did not know where the file was being generated by when the program builds. The fxml files are in fact copied from test\resources. SO once I changed those files, the files generated in Build worked too (since they are simply copied over on build)

    Yea, prof mentioned that the script only detects code in the tP fork's master branch

    Alright, thanks prof

    I believe its before your tutorial Week 10 if I'm not wrong, since it's supposed to facilitate the mock Practical Exam

    Alright, thanks prof!

    Right, I missed that. Thanks

    I should think that the A class could have another dedicated method like getItemStringVal().

    Though on balance, it may be impractical to implement that especially if there are many such method calls for a lot of attributes. So maybe this is the ideal way to do it since it would eliminate the need for potentially double the methods in the A class.

    I'd guess that the right call here is to simply be consistent with either path chosen while considering the architecture of the over all program.

    Ahhh i see, time to refactor my own code then

    Does it just not show up in the IntelliJ view window? Because that happens sometimes. You should test out by checking it out on Github itself to view it there.

    Can you click on "Details" for the MacOS job to view the error message, and let us know exactly what the issue was?

    Sure!

    Thanks!

    Thanks

    Ah alright, thanks for the clarification

    Hi Prof and TAs,

    I am very sorry to disturb you. I have just received an email saying that CATcher was not done. However, I have already created two issues according to project requriements.

    I wonder could u please help me with this, thank u so much!

    Hi, I have met the problem after I deleted all address usages in tp by following tutorial 2. 8 of the test cases have failed but I am a bit confused because it seems that they are not relevant to "address" tests. I have attached the screenshot below and I wonder has anyone met the same issue?

    Hi! When I was adding Increments as parallel branches: A-JavaDoc, A-CodingStandard, Level-9, I made a mistake. A-JavaDoc and A-Coding Standard branches are all created from the master branch, however, Level-9 branch was created from A-Coding standard branch instead. I only realized this after I have merged all three branches to the master branch, as shown below. I wonder will I get penalized because of this or do I need to reset these branches and commits? Thank you very much for your help!

    Hi! When I was doing the ip, it was mentioned on the website that we shall commit and tag according to the order specified.

    However, I am wondering that if after I have finished level 6, I realized that I wanted to make some small improvements on the previous levels that I have finished, can I make other commits about previous levels again after Level-6? If so, do I also need to change the tag of previous levels? And will we get penalized because of this? Thank you very much in advance!

    I also encountered this problem when I ran runtest.bat on windows. As mentioned on the CS2103 website, "The likely cause that the line endings are different (not visible to the naked eye) because the two files were created in two different operating systems." Thus, I ran the runtest file using git bash again and it finally solved the problem. (in git bash, we should run runtest.sh instead, and remember to update the directory path)

    Hii! I think maybe you can try the method mentioned in issue #5, which is adding set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 in runtest.sh, just like this. Hope it helps! : )

    Hii! I think maybe you can try the method mentioned in issue #5, which is adding set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 in runtest.sh, just like this. Hope it helps! : )

    if i'm not wrong JAVA_TOOL_OPTIONS is only available on Windows .-.

    Ohh, sorry, my mistake

    Thanks @richardcom @wakululuu for helping @howtoosee

    Thanks Prof! : )

    Thanks a lot Prof! : )

    Hi Prof, thank you so much for your reply! I will be more careful next time : )

    Hi, I think maybe you can try delete the corrupted cache and restart Intellij again. I also met some strange issues after I imported gradle. But I solved them by first close the project, delete the .idea folder, then re-import and project and rebuild the project. Hope it helps.

    Source

    Hi, sorry but what do you mean by corrupted cache?

    I think you can try to delete the .idea folder and re-import the project, then rebuild the project. Hope it helps! : )

    Hi, sorry but what do you mean by corrupted cache?

    I think you can try to delete the .idea folder and re-import the project, then rebuild the project. Hope it helps! : )

    Hi, thanks for the advice. But when I delete the .idea file and restart the intellij project, it still tells me that zip END header not found. And another issue that arises by deleting .idea and restarting the project is that intellij now cannot run the java files(i.e, the java files are not recognized as runnable). so I am very confused about it..

    Ohh, I think that after you re-import the project, you need to reconfigure the compiler to Java 11 again, maybe can try out the solutions mentioned here

    Hi, I have met the same issue yesterday when I used IntelliJ to build the new Jar file. However, I later tried to use shadowJar in Gradle to produce the new jar file and it finally worked. Hope it helps!

    Hi, I have met the same issue yesterday when I used IntelliJ to build the new Jar file. However, I later tried to use shadowJar in Gradle to produce the new jar file and it finally worked. Hope it helps!

    Thanks! I have generated the jar file by using gradle!

    No problem! : )

    I can successfully run the project after deletion, but it seems that only these 8 tests have failed.

    Use the debugger (one of the topics of this week) to investigate what exactly causes the failure? 😃

    Got it, thanks Prof! I will try to use the debugger to find out the problem : )

    Problem solved. Thanks to Prof @damithc 's advice. I used the debugger and traced the program carefully. I finally found that I accidently deleted one of the example emails in TypicalPersons.java.

    Problem solved. Thanks to Prof @damithc 's advice. I used the debugger and traced the program carefully. I finally found that I accidently deleted one of the example emails in TypicalPersons.java.

    Great to hear that @richardcom 💯

    Thanks Prof! 😃

    Did you create those issues using CATcher or created them manually via the GitHub user interface? You need to create them using CATcher.

    Ohh, thanks a lot Prof Damith! I first created the repo using CATcher app however then I created the issues on Github initially. I will immediately created them again using the applicaiton. I am very sorry for this and I wonder if my participation marks would be deducted and I am truly sorry that I have made mistakenly used Github to create them directly.

    We'll restore your participation points, as it was an honest mistake.

    Thank you so much Prof Damith! : ) I will be much careful next time! : )

    In case anyone is still struggling with Graphviz installation:

    1. Simply go to download link to install the zip file
    1. Extract the folder to your Program Files
    1. Open your command prompt, navigate to the location of the bin folder and type dot -c
    1. Type dot -v and you should see the version of Graphviz that you've installed.
    1. Follow Step 2 in the diagram below and everything should work fine.

    Thanks a lot! Just to add on, we need to run the command prompt as admin. Initially I did not run it as admin and it fails to run dot -c.

    Screenshot 2020-09-15 at 8 46 41 PM

    But I already uploaded my user guide... https://persdre.github.io/ip/

    I am doing A-CI. But after I uploading the gradle.yml file, the build failed in ./gradlew check part. However, I ran it correctly locally. So I feel confused. Could you give me some advice? Thanks!

    Screenshot 2020-09-09 at 4 08 01 PM

    The auto testing is so strict. As I pressed the enter key after entering all my expected output, I was stuck in testing for about half of the day. 😦

    The textbook says: class-level members are to be accessed using the class name rather than an instance of the class. But a question in the quiz asks whether a class-level member can be accessed by an instance of the class. From my experience, I actually once accessed a static variable from an object. So, I don't know this question's answer 😦

    already solved! thanks!

    You can click https://github.com/nus-cs2103-AY2021S1/forum/issues/27 for more information!

    already be solved!

    To add on,

    Screenshot 2020-08-26 at 12 18 39 AM

    Yeah, you didn't give enough information... I guess the reason you can't pull/push is that the branch you click doesn't exist? Or some sync problems...

    So I suggest you fetch your code from your Github ip repository first, then try the easiest pull/push operations.

    Screenshot 2020-09-02 at 11 33 31 PM Screenshot 2020-09-04 at 12 19 53 PM

    I think the constructor is a little from the other public methods, so I write it like this. 😃

    You can refer to this: https://github.com/nusCS2113-AY1920S1/forum/issues/8

    oh so sad😂. Have you solved it? But I think don't worry lah. I see your repository and all your branches and tags are there 😃

    Yeah, but I think a better way is to click "compare", then create a pr 😃

    Screenshot 2020-09-09 at 6 27 39 PM

    The file name is right 😦

    Looking at your repository, the file is still Todo.java. This may be caused by a case-insensitive filesystem like Windows / MacOS. You can try changing the file name to something different, staging it, then changing it to the correct filename Todo.java -> Foo.java -> ToDo.java. Alternatively, there are some steps outlined here that may help.

    https://www.hanselman.com/blog/GitIsCasesensitiveAndYourFilesystemMayNotBeWeirdFolderMergingOnWindows.aspx

    Thank you!

    I pull a request about this. Thank you for pointing it!

    https://github.com/se-edu/addressbook-level3/pull/50

    Thank you for your reply! Now it is still not reflected in the dashboard 😦 @damithc

    Thank you so much! @damithc

    Hello, I created a team pull request to merge my master branch to the master branch of our team repository on Tuesday. However, it seems that the pull request is not detected by the script, because the individual progress dashboard shows that v1.2 PRs is not present.

    I noticed that the dashboard was last updated on October 7, which is after I created and closed the pull request.

    I am wondering whether this is caused by the fact that I closed the pull request before the script was run.

    Can I ask what I should do?

    Hello, I have some issues regarding the displaying of check and cross in the individual project.

    When I wrote

    System.out.println("\u2713");

    or

    System.out.println("\u2718");

    The question mark will be displayed instead of the check and cross.

    This is quite strange because I did not have this issue previously and it appeared quite recently. Is it related to the configuration of the platform or is it related to something else?

    Can I ask if anyone knows how to handle this issue?

    Hello, I want to ask several questions regarding the project.

    Firstly, do we need to keep the name of the chatbot, the greeting message, the format of the command, indentation, and response information exactly the same as the ones shown in the example? For example, can I show a different greeting message when the program runs? If a difference between the individual project and the example is allowed, will this difference affect the grading of the project?

    Secondly, will the grading be based on the tags, or the commits in master branch, or both?

    Thirdly, does the order of commits matter? For example, if I push the commit for level 6 first, and then I push the commit for level 5, will this cause any issues in the grading process?

    Sorry but I seem to have quite a few questions to ask. I hope this will not disturb you.

    Thank you professor for your clarification.

    I may need to change the background a bit and replace the image.

    Hello professor, I am wondering if there is a bidirectional navigability pointing from one class to the same class, will the following class be a valid representation of this bidirectional navigability? Will this class declaration lead to single direction navigability or bidirectional navigability?

    class Animal {

        Animal anotherAnimal;

    }

    Thanks a lot for the tip. I think this will be quite helpful especially in terms of improving the code quality.

    Yeah I think one way to do it is to just clone the address book repository to the local computer, move the config directory to the individual project root directory, and change the version of the checkstyle in build gradle to 8.32.

    Yeah I do think it will generate the conflict when the marker is added manually. By the way, git also has a default merge tool that can help to resolve merge conflict. To resolve a merge conflict, type

    git mergetool

    on the branch with the merge conflict to use the tool.

    Maybe you can try to pull by allowing unrelated histories. Additionally, I remember that the name of the local branch needs to correspond to the name of the remote branch.

    Can I ask if it is necessary to commit the new jar file this week to the remote repository?

    Maybe you can change the path of the class in the runtest file a bit. It is necessary to include the package name in the class name in order to search for the class.

    Hello, I had a similar issue. Have you solved the problem?

    Thanks a lot. I think it is quite helpful especially in terms of arranging the order of tags in the remote repository.

    Thanks for the reply. Let me check.

    Uh so I need to create a pull request from a new branch where there is no previous pull request from that branch right.

    OK. Thank you.

    Hello, have you checked if Desktop is supported?

    Maybe this can help but I am not sure.

    if(!Desktop.isDesktopSupported()){

        System.out.println("Desktop is not supported");

        return;

    }

    Desktop desktop = Desktop.getDesktop();

    if(file.exists()) {

        desktop.open(file);

    }

    I believe there is a different dateline for CS2101 so I am checking here as well

    Hi all,

    I found these two links which I found to be immensely helpful when altering DarkTheme.css to suit a new theme. Hopefully, this will save you some time when coming up with a new design.

    https://www.schemecolor.com

    https://coolors.co/

    In general: try to keep to the 70-20-10% rule when using new colors so that everything blends nicely together. E.g. Use 70% of a primary color (for your base), 20% of a secondary color (for your features), and 10% of your last color for the accents (alerts/outlines/extras).

    I hope this will save you some time when porting over to a new design

    Regards,

    Gabriel

    Hi,

    I noticed that the TP dashboard is not tracking my and my team's progress.

    In particular, my team has completed the tasks :

    v1.1 set up

    DG adapted (partially, we have done use cases and NFRS)

    updated readme

    As for myself, I have done:

    Tutorial task

    v1.1 issues

    v1.1 PRs and

    Week 7 (I contributed to the master branch of the team repo)

    Dashboard link: https://nus-cs2103-ay2021s1.github.io/dashboards/contents/tp-progress.html

    My team is CS2103T-T09-4

    Team github: https://github.com/AY2021S1-CS2103T-T09-4/tp

    My admin number is A0184257X

    My github: https://github.com/GabrielSimbingyang/tp

    Regards,

    Gabriel

    Hi guys,

    I am having some issues unique to me (my group members don't have this issue). My text seems to get compressed if it's too long. So for example, in the photo below, only listings 1-19 are shown (even though there are actually around 25 listings). Also, if I have too many dialogs in my gui then everything gets compressed to be about 4 lines (picture 2).

    Hi,

    If you are trying to do level A-Gradle, I suggest reusing your code from A-JUnit to ensure everything is working correctly. I actually did gradle first instead of the JUnit level so I understand how frustrating it can be.

    If you had followed the non-gradle instructions from JUnit, then you can simply use that code to "test" that you have done A-Gradle first. Remember to create your build.gradle first (and intellij will automatically detect you are trying to install gradle). Below is a screenshot to show you how your setup should look like :

    On your left, make sure your test files are in the right directory (root>src>test>java). Note the build.gradle file in the directory.

    On the right, you can see the gradle toolbar. You can click the little elephant then type in "gradle test" and press enter

    At the bottom is the gradle terminal after a successful test

    Hi,

    I am running into some issue trying to run runtext.bat. For reference, I am using the same code as stated in https://se-education.org/guides/tutorials/textUiTesting.html .

    This is my error message using the original file:

    C:\Users\warlo\OneDrive\Desktop\IP> C:\Users\warlo\OneDrive\Desktop\IP\text-ui-test\runtest.bat

    Could Not Find C:\Users\warlo\OneDrive\Desktop\IP\ACTUAL.TXT

    error: file not found: ..\src\main\java\Duke.java

    Usage: javac >options> >source files>

    use --help for a list of possible options

    This is my directory:

    I have tried several variations of line 10 and 18 of runtext.bat such as using .\src\main instead of ..\src\main and using *.java instead of Duke.java on line 10

    Now, I am stuck at this error:

    C:\Users\warlo\OneDrive\Desktop\IP> C:\Users\warlo\OneDrive\Desktop\IP\text-ui-test\runtest.bat

    Could Not Find C:\Users\warlo\OneDrive\Desktop\IP\ACTUAL.TXT

    The system cannot find the file specified.

    FC: cannot open ACTUAL.TXT - No such file or folder

    Apparently my script isnt creating an ACTUAL.TXT file. I am not sure what is the issue. If anyone could help me that would be great (:

    Alternatively, is there another way I can test my code before the dateline?

    When I try to run Duke.java , intellij IDEA asks me to configure the run/debug configuration. May I know which is the right choice to use?

    Hi prof,

    This is what I see:

    Hi Prof and Cody,

    I am currently using JDK 11 and I am also using the latest version of intellij IDEA (ver 2019.3.3). I have also set the java file and as source root.

    Also, I have previously used intellij for a nodeJS project, perhaps that caused some of the issues.

    Currently, intellij is letting me know that I have no project compiler output. I am not sure how to solve this problem

    This is the alert I get when I click "run Duke.java"

    Hi Cody,

    It works now. Thank you. Could I just check if this is how it is suppose to look like?

    Hi Prof, thank you. Running the bat file outside of intelliJ has solved my issue.

    May I know if the ACTUAL.TXT is supposed to contain the original inputs (such as todo, deadline, etc)?

    This is my ACTUAL.TXT after experimenting with level 5 and the inputs are missing.

    Hi,

    Java should be the src folder and not main. You can see my post that I made to the forum to see if you're on the right track

    Gabriel

    Hi, could you give more details when you say intellij cant recognize your source file?

    Thank you my friend!

    Hi prof @damithc ,

    The dashboard has been updated to the 23rd of September (it was 22nd September when I posted this).

    I noticed some issues with the tracking

    1. According to the dashboard, my team has not created a milestone called v1.1. However, if we look at the dashboard for individual tasks (A0184257X), it says that I have authored and merged a PR in milestone v1.1 which indicates that milestone v1.1 exists.

    2. It also says that I had not done "v1.1 tasks" even though I had done it in the individual task "v1.1 PRs". I provided a link to an issue I had completed down below.

    3. Our UG had also been completed, link below.

    Link to my team's milestone : https://github.com/AY2021S1-CS2103T-T09-4/tp/milestones

    Link to an issue that I had completed in the team repo: https://github.com/AY2021S1-CS2103T-T09-4/tp/issues/14

    Dashboard link: https://nus-cs2103-ay2021s1.github.io/dashboards/contents/tp-progress.html

    User guide link: https://ay2021s1-cs2103t-t09-4.github.io/tp/UserGuide.html#adding-a-new-entry-add

    Regards,

    Gabriel Sim

    Hi Prof,

    Understood, we will change it accordingly. Thanks for the help!

    Regards,

    Gabriel

    Ok, thanks Prof @damithc

    Hi, my CI keeps failing on Ubuntu due to an error when running CodeCov. This error has been persistent despite re-running all jobs multiple times.

    The error comes from the codecov.sh file having a syntax error, but if im not wrong this file does not exist in our repository under the .github directory.

    Some background: I've only made commits to the UG...

    Does anyone know how to solve it?

    Hai does anyone know how I can remove the bullet points at the front of the TOC?

    I'm using the auto-generated table of contents placeholder in Markdown:


    * Table of Contents

    {\:toc}



    My CS2101 tutor isn't very happy about my group having the bullet points together with numbering in my table of contents...

    Hi, my storage throws an error: Error reading from jsonFile file data/financeAccount.json: com.fasterxml.jackson.databind.JsonMappingException: Can not find a deserializer for non-concrete Collection type [collection type; class javafx.collections.ObservableList, contains [simple type, class nustorage.model.record.FinanceRecord]]

    This occurs when trying to read from a json file (created by jackson itself).

    The line that threw the error is Optional&gt;JsonSerializableFinanceAccount> jsonFinanceAccount = JsonUtil.readJsonFile(filePath, JsonSerializableFinanceAccount.class);

    Did anyone face a similar issue? I'm not sure if its a problem with the storage class.

    FinanceRecords are stored in a class FinanceAccount, which uses ObservableList>FinanceRecords> to store the collection of records (similar to how AB3 stores Persons using the observable list).

    Why can enums be shown as instantiated objects in the object diagram? (bottom right corner green box) If i'm not wrong, no programming language allows for enumeration to be instantiated. (or are there?)

    Intellij supports code styles, and can be customers under Preferences > Editor > Code style > Java, or some other languages too.

    I was fiddling around after doing the quiz question on switch-case indentation, so according to the code style, we should set up intelij like this, with "Indent 'case' branches" unchecked:

    Using MacOS 10.15.6, JDK 11.0.8.

    I'm using unicode escape sequence for ✓ and ✗, ("\u2713" and "\u2717") respectively. Not sure why the output renders these characters as "?" both.

    (Lines starting with ">" are the output lines and that with ">" are expected lines)

    Anyone experiencing similar issues?

    Hi, I would like to clarify on the wording of one of the quiz 1 questions (q6), which stated the main way for objects to interact with each other is by reading each others' data.

    However upon checking the textbook, I discovered it says that objects interact by sending each others messages.

    I would like to clarify if they mean the same thing, or is there a difference since one is active and the other is passive?

    I think we can use both!

    For example, when the parent method calls the child method, pass the string to the child method as an argument. In this way, the child method can throw an exception to be caught by the parent method, which can then do the exception handling, e.g. print out the "todo bad" message. Then we don't need to terminate the programme but still manage to use exceptions.

    Hii! I think maybe you can try the method mentioned in issue #5, which is adding set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 in runtest.sh, just like this. Hope it helps! : )

    if i'm not wrong JAVA_TOOL_OPTIONS is only available on Windows .-.

    export LC_ALL=en_GB.UTF-8

    That works! Thanksss!

    If i'm not wrong, you can use sourcetree to move the tags from one commit to another. But you probably need to delete the tags before re-adding .-. Doing so might not be a real good idea for this mod though

    Thankyou! Set us on the right direction!

    I see. thankyou!

    OOO THANK u sirrrrr

    Hello, you're in luck! This is something that my group wanted to do as well, so I came up with the following solution.

    Feel free to reference our implementation, but do give credit so as not to run afoul of plagiarism rules.

    Hi Ian sorry, but this method seems to have removed some bullet points and numberings in the document body for me. Did it happen to yours too?

    I am currently experiencing the same problem after I made some commits where I increased the number of JUnit tests.

    My team rerun CI checks for old commits and now they are failing so i think it might be a github / codecov issue...

    I think this is a github/codecov issue. i have the same problem #375

    Is there a way to just disable it?

    For now, I just remove the whole block.

    I have try commenting out the whole block of code in .github/workflow/gradle.yml. but does not seem to work [Have other weird error].

    Commenting out this section only worked for me

    I opened up EXPECTED.TXT and edit manually, finally it worked! Thanks for the headsup.

    I had a lot of trouble with getting my .bat file to work as well, and this is what worked for me:

    If you're like me and have a very long and convoluted file path (with lots of whitespaces) to your source files, you can try using the following method:

    SET MY_PATH=&gt;your_really_long_path_here>

    Hereafter you can refer to your path by simply calling %MY_PATH% wherever you need it.

    Here's an example of what I'm talking about:

    Let me know if this helps 😃

    Wow Eris it worked well! Thanks!

    Do you have more than one java file? The above suggestion changing Duke.java to *.java works for me.

    Thanks!! Nesting all other classes in Duke works too, however, it is a rather bad practice.

    Hi Prof, just a quick question: Does changing the class file (from "Duke.java" to "MyChosenName.java") affects the scripting?

    Hi, can't view your image >>. Try restarting your IntelliJ client after changing your environment variables.

    It seems that for case 1, throwing exceptions in constructors isn't a bad practice. In a way, throwing an error as early as possible can be useful as culprit is in the callstack and provide and explanation of the reason (prefer compile-time error to runtime error).

    https://stackoverflow.com/questions/6086334/is-it-good-practice-to-make-the-constructor-throw-an-exception

    Open up a Linux terminal, navigate to your ip local directory. Navigate to your src/main/java.

    Enter the commands:

    //check if git remote found

    git remote -v

    //remove Command directory

    git rm -r Command

    git commit -m *Remove Command directory*

    git push origin master

    //check if removed

    ls -l

    I'm not sure if this is the right way but I fixed it by making sure that my code on github is the most updated version, then I used IntelliJ to "get from git version control" again. Then open up SouceTree and locate the new local repo I cloned. Go to remotes -> branches -> check out on all the branches and they will show up in the "branches" tab of your local repo, and I think it will show up when you click on push.

    If I'm not wrong, the UI do not display each character in equal spacing, so a '-' and '_' will take up more space than '|'.

    Actually spent too much time on this

    Oh my! Kang Liang, may I ask how do you add backgrounds?

    Do you have a Duke constructor that takes in 0 parameters? (i.e. new Duke())

    If not, try implementing one.

    I had a similar issue and I managed to solve it by implementing one.

    Thank you @erisjacey !

    My guess would be close project and open again? Also, try rebuilding your build.gradle

    Added background image and edited a simple dialog box.

    Hi Luoyi, personally I feel that asserting two conditions that will always be true has no significance. I quote the textbook [W5.6] Assertions are used to define assumptions about the program state so that the runtime can verify them. .

    Since there will be no change in the boolean values of your conditions in both compile time and runtime, then it does not fit the purpose of using Assert. I would suggest you to write in comments above the code for readers to take note of such condition.

    Hi, I believe there is a way to set your codestyle on Intellij. The import statements will follow according to the checkstyle guide line. No more package.* imports!

    Source: https://www.jetbrains.com/help/idea/configuring-code-style.html

    Hi Khoongwk, I'm not too sure but I've checked my Jar file and it looks like this.

    I compared your codebase and the file, it looks quite different from mine. Your ui and task package are together with your duke, whereas my ui and task packages are inside duke. You might want to try gradle clean shadowJar instead.

    Hi Matthias, I feel that it is fine for Parser to be an interface because it provides a "contract" that promises what a Parser can do. It specifies what methods a Parser object should have!

    As for Command... I am not too sure as it currently does have any class fields. Well I guess maybe for the extensibility of the Command class, where you may add properties to it? Let's say you define a constructor that takes in some primitives or objects as class fields in your addressbook.

    Hope I'm making sense!

    Source:

    I think there is a typo in the textbook's week 7 topic, the design approaches section. "Approaches" is misspelled into "appraches"

    @damithc

    When I try to implement CI/CD using GitHub Action, I got the following problem when building Gradle:

    This is my gradle.yml file


    # This workflow will build a Java project with Gradle

    # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle



    name: Java CI with Gradle



    on:

    push:

    branches: [ master ]

    pull_request:

    branches: [ master ]



    jobs:

    build:



    runs-on: ubuntu-latest



    steps:

    - uses: actions/checkout@v2

    - name: Set up JDK 1.8

    uses: actions/setup-java@v1

    with:

    java-version: 1.8

    - name: Grant execute permission for gradlew

    run: chmod +x gradlew

    - name: Validate Gradle Wrapper

    uses: gradle/wrapper-validation-action@v1

    - name: Build with Gradle

    run: ./gradlew build

    - name: Perform JUnit test

    run: gradle test

    Does anyone have any ideas on how to fix this issue?

    When I tried to build the GUI, I got the following error in processResources


    Failed to clean up stale outputs

    Couldn't delete [path to my directory]\build\resources]\main\images\DaDuke.png

    Any ideas on how to fix this?

    When I try to build the gradle project, I got this error:

    Plugin [id: 'com.github.johnrengelman.shadow', version: '5.1.0'] was not found in any of the following sources:

    Anyone knows how to fix it?

    Hi, where did you find that trouble shooting slides?

    Both ways work, I think

    The problem lies in the line : String.format("%d.%s\n", i + 1, tasks.get(i).toString()); in your convertTaskListToString method.

    Since your clearly state out that the end line is \n instead of System.lineSeparator(), the correct listMessage string should be:


    String listMessage = "Here are the tasks in your list:\n" +

    "1.[T][" + CROSS_ICON + "] t1\n" +

    "2.[D][" + TICK_ICON + "] t2 (by: Aug 24 2020, 10:00)\n" +

    "3.[D][" + CROSS_ICON + "] t3 (by: Aug 27 2020, 11:00)\n" +

    "4.[E][" + TICK_ICON + "] t4 (at: Aug 24 2020, 11:00)\n" +

    "5.[E][" + CROSS_ICON + "] t5 (at: Aug 27 2020, 12:00)";

    Only use System.lineSeparator() to represent line breaks that use System.out.println() or strings that clearly refer to System.lineSeparator() themselves.

    Is there any thing that I have to note when implementing this shutdown hook? 'cause when I try to use it, I cannot pressing ctrl + c to terminate the program any more

    Somehow I run this code in the terminal, then import the build.gradle again and it works


    ./gradlew assembleDebug

    Maybe add this to your build.gradle might help

    tasks.withType(JavaCompile) {

    options.encoding = 'UTF-8'

    }

    Source

    This doesn't work for me

    Got it! Thanks, mate

    #95

    When I change to Java 11, the above error disappears, but I got this instead:

    Edit: after digging some old issues, I have found the answer in #118

    @keanecjy You go to File -&gt; Settings -&gt; Editor -&gt; Code Style -&gt; Java, select Tabs and Indents tab, then set continuation indent to 4

    I suppose this is what you are facing, where the checkstyle gives warning about the parenthesis on the start of a new line. If so, you can use these comments to temporarily turn off those checkstyle. Hope this helps


    //CHECKSTYLE:OFF: SeparatorWrap

    ((Deadline) newTask).setTime(newTime);

    //CHECKSTYLE:ON: SeparatorWrap

    To automatically strip trailing white space in intellij, you can go to settings -&gt; editor -&gt; general, then scroll to other and change strip trailing white space on save to all

    Library

    TestFX

    Purpose

    For headless GUI testing

    License

    TestFX license

    EUPL

    This is with regards to setting up a headless environment using Monocle together with Javafx 8. I have included monocle and testfx in dependencies as well we created a task headless to set systemProperties of test to the appropriate settings in build.gradle. I have made task test to depend on headless. However, on running gradlew clean test or headless test, the GUI test will fail. Somehow, the robot needed for headless is not being imported. Whats the workaround in build.gradle.

    Library

    FontAwesome

    Purpose

    Font Awesome

    License

    License FontAwesomeFX is licensed under the Apache 2.0 license. If this license is not suitable, please contact me to discuss an alternative license.}

    Library

    https://github.com/marketplace/actions/auto-update

    Purpose

    To remove the need to manually update the pull request if updates are pushed to destination. Does not resolve conflicts. Removes time spent waiting on checks if there are multiple pull requests affected by update.

    License

    chinthakagodawita/autoupdate is licensed under the

    MIT License

    Every time I run gradle build, the view directory which I placed the fxml files appears in build/resources/main instead of build/classes/java/main is there any way to change the gradle setting for this. It is causing the FXML.load() to load the fxml files in a directory that does not exist in build/classes/java/main

    This is my source tree.


    ip

    └───src

    └───main

    |___images

    | .png files

    |

    |───java

    | .java files and packages

    |_____test

    |

    └───resources

    |_______view

    MainWindow.fxml

    DialogBox.fxml



    This is the build/out tree:


    build

    └───classes

    | └───java

    | |____test

    | |

    | |───main

    | .class files and packages

    |

    |______resources

    |______view

    MainWindow.fxml

    DialogBox.fxml



    In the out tree the fxml file is out side of the project root which is have confirmed to be build/classes/java/main. This is causing the fxml.load to be unable to find /view/*.fxml files. How do I resolve this?

    CheckstyleMain task is returning some exceptions which I have never encountered before and I can't seem to find any relevant information on the web. It says:


    Execution failed for task ':checkstyleMain'.

    > Checkstyle rule violations were found. See the report at: file:///C:/projectroot/build/reports/checkstyle/main.html

    Checkstyle files with violations: 2

    Checkstyle violations by severity: [error:6]

    This appears after the errors thrown by the project files failing the test. Similarly, checkstyletest is throwing somewhat same error but in a different directory:


    Execution failed for task ':checkstyleTest'.

    > Checkstyle rule violations were found. See the report at: file:///C:/projectroot/build/reports/checkstyle/test.html

    Checkstyle files with violations: 1

    Checkstyle violations by severity: [error:1]

    Is there any way to resolve all these issues?

    Hi there, after running the shadowjar task, I attempted to runshadow, but that immediately triggered a warning:


    > Task :runShadow FAILED



    FAILURE: Build failed with an exception.



    * What went wrong:

    Execution failed for task ':runShadow'.

    > The value for task ':runShadow' property 'mainClass' is final and cannot be changed any further.



    * Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.



    * Get more help at https://help.gradle.org

    I did a gradle clean runshadow command but it returns this error over and over again. Using the IDLE gradle runshadow task runs some form of truncated program where it opens and immediately exits by a bye command. Not sure what is happening so I came to ask for help.

    There seems to be an issue with the runshadow command even though I have no problem running the normal jar file. There also seems to be a problem with installShadowDist when i tried to run it, it throws an error:

    Failure to delete directory: ip\build\install\ip-shadow

    Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.

    Is there something missing in my build.gradle?


    plugins {

    id 'java'

    id 'application'

    id 'checkstyle'

    id 'com.github.johnrengelman.shadow' version '5.1.0'

    }



    repositories {

    mavenCentral()

    }



    dependencies {

    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'

    testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'



    String javaFxVersion = '11'



    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux'

    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux'

    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux'

    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'

    }



    test {

    useJUnitPlatform()



    testLogging {

    events "passed", "skipped", "failed"



    showExceptions true

    exceptionFormat "full"

    showCauses true

    showStackTraces true

    showStandardStreams = false

    }

    }



    application {

    mainClassName = "duke.Duke"

    }

    sourceSets {



    main {

    java {

    srcDirs 'src\\main'

    }

    }



    test {

    java {

    srcDirs 'src\\test'

    }

    }

    }



    shadowJar {

    archiveBaseName = "duke"

    archiveClassifier = null

    }



    checkstyle {

    toolVersion = '8.23'

    }



    run{

    standardInput = System.in

    }



    I have a lot of problem switching accounts as I have to repeatedly delete the cache in windows credential manager. How do I disable this feature without uninstalling git?

    Sick!! Thanks for sharing man!

    You can try issuing a SIGQUIT instead

    On a side note the hooks will not execute in the event of an unexpected termination of JVM, so its still a safer choice to save on add.

    That's not helpful at all. The the idle or I don't know what is throwing a violation warning at the html file but the problem is not from the html file.

    Could be due to the Image(getClass.getAsResource.xxxxxx). Remove this and see if the code launches? The exception is caused by a null pointer exception. So the cause is deeper into the stack trace. This is the best I can deduce without the stack trace.

    What you said is most likely the cause The invocation target exception can be solved by resolving the null pointer. So maybe somewhere in your code you are accessing an absent resource?

    Issue resolved.

    Hi En Hao,

    I am facing the same issue as you - my resources directory is not being built in the src/main folder. May I ask how you managed to solve this?

    Hi, I think my issue was caused by the fx:controller to be set to just MainWindow when in fact I packaged MainWindow within another sub directory. You can try setting the fx:controller to >yourpackages.....>.MainWindow

    Resolved.

    Printing the UG and DG to pdf is pretty scuffed, since it likes to cut off text and/or tables at arbitrary places:

    image

    Will this be counted as a documentation defect during the PE and/or counted against us for grading? Thanks.

    So I re-opened an issue assigned to 1.3 (realised it wasn't fully fixed), without re-assigning it to the 1.4 milestone, and looks like the progress-checking-script caught the repo with the issue open, so now my team's 1.3 wrap up is currently marked as un-done.

    I already re-assigned the issue to 1.4, but hopefully there won't be a penalty for this?

    How does the script count teammembers' pull requests? Is it strictly through the github API? ie. if I manually clone the personal repo and cherry-pick + push commits to the main master, that teammate's PR will not be counted by the bot?

    to what extent is the order of imports enforced? (both for ip and tp). i noticed that there's a rule for it in the AB3 checkstyle xml, but is it strictly necessary to follow that?

    (by strictly necessary -> points docked for not following?)

    edit: while i'm here, whitespace -- extra whitespace for alignment is supposed to be OK according to the style guide, but checkstyle complains about it as well.

    Are we supposed to commit all the non-essential gradle files to the repository?

    eg:

    1. gradle/wrapper/*

    2. gradlew and gradlew.bat

    AFAIK for it to work you just need the checkstyle configs in config/checkstyle/*.xml, right? i don't suppose intellij is actually using the wrappers to run gradle...

    This particular increment asks us to extract out classes for Storage, Ui, etc. Are they required to be objectified into those particular categories with those particular names? eg. if our code is already abstracted/encapsulated in some other way that "demonstrates" OOP (whatever that means), is it necessary to change it?

    Thanks.

    In the other questions, it was stated that we are free to customise as much as possible, as long as we're not "subverting the learning goals".

    So: regarding the testing scripts, I don't suppose there are going to be any automatic CI bots to run the scripts on our repos, so are we free to move/rename/edit/delete them, for example? As long as there is a script to run tests on the program, it should be sufficient yes?

    okay, thank you!

    nothing stops you from committing a file that still contains conflicts; you are free to lie that it's resolved, but of course bad things will happen.

    try git config --global --unset credential.helper.

    alternatively you can set user.name and user.email for the specific repository instead of having to switch.

    doesn't the error writing aborted; java.io.NotSerialisableException: ToDo suggest that your class ToDo does not implement the Serialisable interface

    actually IMO the whole concept of immutability in java is kinda pointless because it does not have "const-correctness" like other languages. Just because your taskList is marked private final, it doesn't mean the list itself is immutable, only that the reference to the list is immutable.

    you can't reassign the list to another new list, but you are totally free to append/delete items to/from the list. in fact, having a getter allows other people to do list.getTasks().clear() or something else to modify the list.

    in general you should not treat what you learn in programming modules as dogmata (eg: cs2030 said immutable classes are good, so i should always use them) (eg: cs2103 said we should program in OOP style, so i should always program in OOP), but weigh their pros and cons as you deem fit. for example, if you know that your list is gonna have hundreds or thousands of items, then it doesn't make sense to die-die make your class immutable and force a copy every time you want to modify something.

    (nb: even though you're only copying pointers, a copy is still a copy)

    on the other hand, if your classes are small, and (imo) generally stored in lists or something like that, you might want to make them immutable, so you can hand out references with ease-of-mind that nobodoy will change things from under your feet. good examples here might include your various Task classes.

    anyway this problem is unique to java because of its lousy concept (or lack thereof) of "const-ness", as mentioned before. in a more sensible language you'd be able to create and pass around const references so the idea of having an "immutable class" wouldn't make sense.

    okay thank you!

    okay, guess i will have to add the wrapper files back to the repository... feels dirty to commit jar files >>

    okay, thanks prof!

    while i'm here, can we close the tutorial PRs? presumably the participation for those has already been counted right?

    ok, thanks prof!

    Anyone has experience with java CI tests failing on github. I am able to build and successfully run all tests with gradle in IntelliJ however after committing to a PR, the tests fail. Most come from java.lang.NoClassDefFoundError. Any tips for debugging for this?


    java.lang.UnsupportedClassVersionError: Duke has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

    at java.lang.ClassLoader.defineClass1(Native Method)

    at java.lang.ClassLoader.defineClass(Unknown Source)

    at java.security.SecureClassLoader.defineClass(Unknown Source)

    at java.net.URLClassLoader.defineClass(Unknown Source)

    at java.net.URLClassLoader.access$100(Unknown Source)

    at java.net.URLClassLoader$1.run(Unknown Source)

    at java.net.URLClassLoader$1.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

    Error: A JNI error has occurred, please check your installation and try again

    Exception in thread "main" Comparing files ACTUAL.TXT and EXPECTED.TXT



    Anyone encountered the above error while setting up the testing?

    I've got this error after "javac not recognised as internal or external command" error and after adding the project JDK home path under the system environment path.

    Currently I'm trying to tweak the settings in intelliJ project settings but I can't seem to solve it. My project SDK is also at java 11.

    Thanks @bchenghi! I think mine was the same problem but i didn't catch it!

    You can try the following:

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java*.java

    But iirc if you compile your top-level class first (in terms of dependencies) every other relevant class should be compiled as well. Hence why calling javac on just Duke.java works for me

    @erisjacey do you know why we do not need to compile all the classes? I'm still confused on this, thanks!

    This looks like a similar problem as "javac not recognized...", did you previously have this error? if not i think it has something to do with the environment path.

    You can check if you get the same error in your command prompt by typing the FC command. then you would have to edit your path system variables under environment variables.

    @GabrielSimbingyang I also had the same problem after setting up the project, you can

    right click the java file > mark directory as > sources root

    Hopefully this solves the issue

    create an "output" folder in your repo and set that folder as your output path. I've always done that for my projects and it seems to work for me, but not sure why i always have to configure it too

    yup it looks like that for mine too

    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 java.lang.UnsupportedClassVersionError: Duke has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

    I had the same problem earlier #25. You probably have the Java 8 path in your environment path variable. Deleting it solves the problem for me. I think moving it up for higher priority will also work

    I also have this problem for my .bat file but not too sure how to solve. Some sources tell me to download the JavaFX and include it in our project library following setting it up without gradle in the tutorial, however i think it'll mess up the gradle configuration.

    https://www.jetbrains.com/help/idea/javafx.html#add-javafx-lib

    Anyone one has faced this issue before? Or can we also move away from standard output and shift our testing to only JUnit tests for our classes. Or is the standard output still important for testing because now my Duke UI is only printing standard output for this .bat test. Appreciate any advice.

    Hi! can i check if your main class in Manifest.MF is updated with the correct class too? since the problem seems to be coming from that file.

    here's the link! Thank you

    yes, i ran on intelliJ and used the terminal as well.

    Yes, I'm on windows. But I'm able to run ./gradlew build on SoureTree bash terminal. My team mate was also able to build on his Mac. At first I was thinking if it has something to do with different Java versions when compiling and building but it seems like the correct version is being used as well

    i thought it might be that too @qwoprocks but i ran it several times today already 😦 would there be a way to see the report from the Java CI check? or maybe a 'proper' way to resolve merge conflicts from last build?

    Thanks so much @qwoprocks I didn't notice it! How did you manage to figure it out?

    Library

    prettytime

    GitHub repo

    Purpose

    Format dates in a more natural manner.

    License

    Apache License 2.0

    Hi, our group was getting codecov reports generated for PRs, and found the feature useful as it showed which lines were not targeted by tests.

    For my specific PR, codecov analyzed the code, commented on the PR with the change in coverage, and a link to the full report was generated. However, when this link is clicked, codecov throws an error, and no report is shown.

    Has anyone experienced this problem before?

    The following are links to the relevant PRs/reports.

    Working codecov:

    PR, report

    Broken codecov: PR, the codecov bot still analyzes the code and leaves relevant comments.

    report, error in screenshot above is shown.

    Library

    jfxtras-agenda

    jfxtras-icalendarfx

    jfxtras-icalendaragenda

    Purpose

    Display a calendar and export iCalendar files from our program.

    License

    BSD 3

    Hi, I noticed that the CS2103T website mentions a "Gradle tutorial at the Duke repo" for implementing Gradle into our project.

    However, the relevant material seems to be removed at commit https://github.com/nus-cs2103-AY2021S1/ip/commit/71d7ea84f3d61821643e505e532051fcc09ec2b1. Am I looking for the tutorial at the wrong place?

    @aidoxe-123: Hi, where did you find that trouble shooting slides?

    The screenshot is from the se-education webpage: https://se-education.org/guides/tutorials/textUiTesting.html

    Have you tried changing the version of javafx to 11.0.2 in the build.gradle file? According to the bug tracker for javafx the fix has been backported to version 11.0.2, but I am not able to test since I'm on Windows.

    This version upgrade doesn't require a newer version of JDK.

    Keep in mind you might have to restart your IDE for the changes in build.gradle to take effect.

    I think I ran into a similar problem when copy pasting the code for the 4th tutorial. Have you placed the copy pasted code into a package? If so, go through the fxml files and make sure that all class names mentioned in those files have the proper naming for them, with the package name included. (For example, in MainWindow.fxml check that fx:controller="MainWindow" is changed to fx:controller="duke.MainWindow" or whatever your package naming is.)

    I noticed this message on the relevant commit with those tags, could you help me check whether these tags are to a commit on the master branch?

    This seems to be a similar issue to https://github.com/nus-cs2103-AY2021S1/forum/issues/216. Try moving the tag to a commit on the master branch to see if it fixes the problem.

    I also experienced the same issue, but what I did to fix it was change my JavaFX version in my build.gradle to 11.0.1

    I guess my method might cause our build.gradle to deviate from the rest of the cohort? I'm not sure what downsides this will have, but I suspect its not very relevant because there's already people modifying their build.gradle to use external libraries and such.

    About Adithya's method, I personally havent tried it myself so I'm not 100% sure, but I suspect you'll have to edit the .fxml file to change the version string every time you edit something in it with the scene builder. I don't have experience with this though so it would be nice if someone who did that could test it for me.

    From how I cannot access https://weijie96.github.io/ip/, I suspect your Github Pages is not configured properly. Could you check that it's configured to serve /docs like the screenshot below?

    If you're having problems with Windows 10 Home, you can change your edition to Windows 10 Education which can run Windows Sandbox, and comes included with our NUS email.

    Here are the instructions to get Windows 10 Education:

    This issue might be relevant to your issue: https://github.com/nus-cs2103-AY2021S1/forum/issues/142

    tl;dr: Update the javafx version in your build.gradle file to 11.0.2

    I had the same problem and I got a response from the prof in the gitter chat. The PR from your fork needs to be from a branch other than master. The reasoning was that the forking workflow needs each PR to the upstream repo to be from a different fork, and having all PRs from the master branch prevents each member from making more than one PR.

    The error seems to be on codecov's end, according to codecov's statuspage. We've actually been having this problem for the past couple of days so I'm not sure how relevant codecov's issue is, but I'll close this issue while I see if codecov's fixes fix this issue.

    May I ask when we should the object deletion symbol in sequence diagrams, in particular for AB3?

    For delete command, only the parser gets deleted, but not the command itself.

    Whereas for undo command, the command gets deleted.

    In the original AB3, there is file docs_data\projects.yml, which lists out a list of URLs related to AB3 (some may not be relevant).

    I was wondering what this file is for, and how we can configure it for our own project?

    Hi Prof,

    I can see my Ui.png in the iP Showcase (CS2103-T16-2), and also my README.md can be accessed via https://weijie96.github.io/ip/README.html

    I have uploaded them before 15 Sep (date of Dashboard refresh).

    May I ask why the status is not updated?

    Thank you

    Hi Prof,

    On the "Setting up and getting started" page of AB3 developer guide (https://nus-cs2103-ay2021s1.github.io/tp/SettingUp.html), the href for "[se-edu/guides] IDEA: Configuring the JDK" is pointed towards https://se-education.org/guides/tutorials/checkstyle.html, instead of https://se-education.org/guides/tutorials/intellijCodeStyle.html

    Thank you

    Should we write javadoc for obvious methods? E.g. getters/setters, one/two-liners that just prints out a string

    Should we write javadoc for all non-private (includes package, protected, public) methods and classes, or just the public ones?

    Is this considered a violation of SLAP? Just concerned if indexing (or mathematical operations) and self-created methods can be put together in one method.


    void method() {

    String[] parts = doSomething();

    String firstPart = parts[0];

    String secondPart = parts[1];

    doAnotherThing(firstPart);

    doYetAnotherThing(secondPart);

    }

    Thank you Prof!

    Can I ask another one with if-else statements? Also, for the part with (x + 2) > 0, do we need to abstract it as well?


    void method(int x) {

    if ((x + 2) > 0) {

    doSomething();

    }

    else {

    doAnotherThing();

    }

    }

    I see, thank you Prof for the explanation!

    P.s. Pardon my brackets 😷

    Thank you for the detailed explanation, Prof Damith!

    Hi,

    Yes, it does look like this:

    My folder structure is


    master branch

    |-- docs/

    | |-- images/

    | | |-- Start.png

    | |-- README.md

    | |-- Ui.png

    Hi Prof,

    The URL works after I added an index.md file in the same folder. Would the autograder mark both tasks as done via this workaround?

    Thank you Prof, I would check again tomorrow

    Thank you Prof, it works now

    Thank you, Jeffry!

    Thank you, Prof!

    I tried using gradle to create a jar file using shadow and managed to create a jar file that launches and works fine on my computer. However, i cant load it on another comupter and get the following errors

    I looked through some of the forum helps but alot of them specify the build.gradle has to updated to duke.Launcher which I tried and got error. But i think it is due to me deleting the duke class as I no longer had any code inside it. the build.gradle that works its shown below

    Any help would be greatly appriciated

    Ive managed to combine the window pop up with my duke but the dialog box is unable to display the entire list because i think it is too large? I am quite unfamiliar with scene builder and have tried to make it larger via that as shown in the image below

    but it doesnt seem to affect it. Also i searched online on how to close the window pop up but come up with nothing. As of now the command "bye" just gives the see you soon dialogue but it doesnt exit the application so a small hint would be greatly appreciated!

    I am trying to do the A-gradle increment but after following the steps(Merge the branch, reimport using gradle.build) i managed to get the gradle thing working. However when i try to run my code, certain parts of it now fail. For example, [✓] or [✗] now gives [?] which i have previously never had issue with and the command find (example find book) now doesnt work despite the code still being the same. Please advice on the issue thank you!

    I am attempting Level 7. Save and I am trying to use serialization to save an array which stores my list that is printed out. However my method saveData(ArrayList list) gets the nullPointer error as shown in the image above. I am using intelliJ

    Below is my SaveData method (Note not sure why the insert code button isnt working)


    public void saveData(ArrayList<Task> listToSave) {



    FileOutputStream fos = null;



    try {



    fos = new FileOutputStream(dataFile);



    } catch (FileNotFoundException e) {





    e.printStackTrace();



    } finally {



    if (fos != null) {



    ObjectOutputStream oos = null;

    try {



    oos = new ObjectOutputStream(fos);



    if (oos != null) {



    oos.writeObject(listToSave);



    }

    assert oos != null;

    oos.close();



    } catch (IOException e) {

    e.printStackTrace();

    }

    }

    }





    }

    The image above shows the nullPointerException is coming from fos = new FileOutputStream(dataFile);

    i think i do in the initFile method @wakululuu

    @wakululuu added the system.out.println(datafile) and in the picture shows i intialise it at the begining

    @zhiayang ah yes my bad that was the problem thank you

    For some clarification i went to download my project from my own tag (Level-9) and tried running it normally and it works fine

    Update: looked through my code and realized that there was duplicated variables due to the merging of Level9 AddJAvadocs that cause the find command to not work so that issue is fixed. However still having trouble with the [✓] or [✗] now gives [?] issue. Im on windows and am trying to fix using #64

    Update2: fixed [✓] or [✗] now gives [?] issue but not sure if it was the legitimate way of to fix it

    i now just used the actual symbol instead of \u2713. Tried to add set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 to runtest.bat but no luck

    'public String getStatusIcon() {

        return (isDone ? "✓" : "✗"); //return tick or X symbols  "\u2713" : "\u2718"
    
    }'
    

    @tanweijie123 yeah that works thanks alot

    @qwoprocks oh my bad i sint see that issue thanks!

    @khoongwk i did try doing that it seems to be the correct and i checked with my friend who uses apple but it doesnt work on his

    @damithc yes. Sorry I forgot to update the issues. The answer specified by @khoongwk was correct I had the wrong version on the other computer and my friend downloaded the wrong file.

    Hi i've generated the new jar file with shadow via

    1. adding id "com.github.johnrengelman.shadow" version "6.0.0" to plugins under build.gradle

    2. refreshing gradle so it installs

    3. typing gradlew shadowJar in intellij terminal

    4. duke.jar appears under build/libs

    but when i double click the jar file or even running it from cmd it says

    Error: Could not find or load main class seedu.duke.Duke

    Caused by: java.lang.ClassNotFoundException: seedu.duke.Duke

    any solution?

    Duke runs fine from intellij

    How does one do this? I don't know if the way i did it was correct but the program seems to run fine

    I've tried

    1 - ticking "Use fx:root construct" in MainWindow.fxml

    2 - setting root in Main as shown below

    Hi!! I've figured out where i went wrong but i don't know how to fix it.

    It seems that the onAction is not able to import handleUserInput method from the MainWindow class

    THINGS I'VE TRIED

    1. import duke.MainWindow

    2. removing #

    Doesnt work D: anyone has any idea why

    Hi, i've implemented the various classes in A-OOP but after doing so runtest.bat file stopped working. It tells me that my Scanner.nextLine() has no input. But when i run my Duke.java file as per normal it works!

    me running duke.java

    me running runtest.bat

    this is how my Duke.java looks like

    and how my Ui looks like

    and how my input.txt looks like

    anyone has any idea?

    It works perfectly fine when i manually input but runtest.bat doesnt seem to take in strings from my input.txt

    Hi! I'm getting this error

    even after following some fixes that worked for others.

    This is how my runtest.bat looks like

    what am i doing wrong?

    Now i'm having this error and i have no idea why. I've installed JDK11.0.8 and am using that in both intellij and my JAVA_HOME + Path already

    Nvm it's fixed after i uninstalled the JDK14. Thanks!

    Personally I did both!

    Basically it's encased in a try catch block.

    The try block tries a static method I declared in the Duke.java file

    The catch block will catch my custom exception and inside my catch block is simply a

    sys.out.println(e.getmessage())

    This will allow the program to keep running while printing the error msg and having the method throw an exception

    Hi i think you need to make sure JDK 11 is installed and JAVA_HOME and PATH variable is set properly

    https://github.com/nus-cs2103-AY2021S1/forum/issues/8#issuecomment-674464491

    refer

    @qwoprocks tried it but it still gives the same error

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

    at java.base/java.util.Scanner.nextLine(Scanner.java:1651)
    
    at Ui.readCommand(Ui.java:12)
    
    at Duke.run(Duke.java:18)
    
    at Duke.main(Duke.java:32)
    

    @qwoprocks i've confirmed that the scanner is only reading the first line in my input.txt which is jsut "todo" then it does not recongise any of the next lines

    @qwoprocks @erisjacey

    I've done what both of u did and there's still the issue D:

    I'm guessing that runtest.bat is using an outdated version of the Duke.class file. This might occur after you implement packaging.

    First, try deleting all the files in ./bin/, then running the batch file again. There should be some error about not being able to find the Duke class, which you can then resolve by using java -classpath ..\bin duke.Duke &gt; input.txt > ACTUAL.TXT instead of java -classpath ..\bin Duke &gt; input.txt > ACTUAL.TXT

    Yeap you're right! This fixed it for me. Thanks!!!

    NVM it somehow fixed itself when i shifted the MainWindow.java file from duke and back to duke package

    Yes! omg sorry for dup thread

    In intellij, my JavaFX runs fine but after creating the JAR using gradle's shadowjar and trying to run the jar, I get this:

    The issue is with the load method of the FXMLLoader, but I can't seem to find out why this is happening only when I try to run the program in its JAR form. I tried opening jar file as an archive and noticed that the resources folder is not there:

    So I suspect that gradle is not building my jar with my resources folder inside it. Any advice is appreciated!

    After creating of the JAR file, I keep getting the following error when trying to run it:


    no main manifest attribute, in (my_directories)\iP\out\artifacts\iP_main_jar\iP.main.jar

    I already made sure to select Launcher as my main class in the artifacts settings and edited build.gradle such that my main class is Launcher:


    application {

    mainClassName = "Launcher"

    }

    Did anyone face the same issue?

    I used the File, FileWriter and Scanner classes to read and write the text file for level 7. For some reason, there were no issues when i compile and run the program in the console but when i used runtest.bat, an IOexception is triggered:


    java.io.IOException: The system cannot find the path specified

    The following is a snippet of my code:


    .....

    File savedList = new File("src/main/data/taskList.txt");

    if (!savedList.exists()) {

    // Create new file if it does not exist.

    savedList.createNewFile(); &gt;--- exception is triggered here.

    }

    .....

    Is this a problem with the working directory? Because runtest.bat uses the Duke.class file from the bin directory.

    That solves my problem, thanks a lot!

    Hi Ming Soon,

    My Launcher class is not in any package. This is how it looks like:

    Thanks Cody and Prof Damith for the comments. I have shifted the JavaFX classes into my duke package.

    I don't think the issue is with my MANIFEST.MF file, because that file is auto-generated by Intellij when I set the settings under project structure -&gt; artifacts. Although my project has more than one psvm main() method, I made sure to select the Launcher class when building the JAR file.

    Could my build.gradle be missing something / is configured wrongly?

    @damithc

    My bad, I was trying to build the JAR file using intellij's build artifacts function instead of Gradle. This resolves the issue.

    On a side note, I tried running the generated shadowjar and got an FXML exception:

    @kormingsoon I saw you had the same issue at #148 . May I know what you meant by "naming issue due to Package"?

    Hi Ming Soon, my mainClassName is also set to duke.Launcher and my dependencies in gradle are the same. Seems like the core issue is related to these 2 lines of code:


    FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("/view/MainWindow.fxml"));



    AnchorPane ap = fxmlLoader.load();

    There are no issues while running the project in Intellij and only when it is being run as a JAR file.

    I had the same issue. Check your java version on your other computer and update it if it is outdated. If that still doesn't work, check the windows PATH and environment variables to see if windows is pointing to the correct java executable (there might more than 1 version of java installed on that computer).

    Hi En Hao,

    I am facing the same issue as you - my resources directory is not being built in the src/main folder. May I ask how you managed to solve this?

    Solved. See #213

    Issue solved. The problem was that getResource() returns null, causing FXMLLoader's load method to fail. Turns out that my 'view' folder under 'resources' was capitalized to 'View', and that was causing the issue.

    But I think it's weird how my program works in Intellij despite this misspelling however, as though it corrects it automatically.

    Thanks Marcus and Ming Soon for the advice, it's much appreciated. 😄

    Thanks for the comment En Hao, I have solved my issue at #213 .

    Hi! I am not sure whether users are allowed to use a mouse to scroll a bar? If not, are there any ways such that can add such keyboard shortcuts?

    Here is the problem:

    Solved by setting MinHeight = "-Infinity" in DialogBox.fxml:

    &gt;fx:root alignment="TOP_RIGHT" maxHeight="-Infinity" minHeight="-Infinity"

    I am using the Win10 PC. After running the runtest.bat, the output .txt file (UTF-8) shows "?" instead of "✓" or "✘". I solved the problem by replacing \u2713 and \u2718 by ✓ and ✘. I think there should be other ways to solve it as well. Hope this will help. : )

    But I encountered another problem: the FC command seems does not recognize that symbol and consider the same symbol as different : (

    I did not find a command to force FC to compare two files with UTF-8 encoding

    problem solved!

    The problem I think it is because of your format of setting MY_PATH, just like others said.

    Instead of setting PATH, have you tried to use the .., which means go to the parent directory? i.e. javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java

    Hi, may I know is this a utf-8 encoding issue actually? Stuck over here as well and not sure what's the problem.

    Hi! Now I realize it is not about utf-8, and here is the reason:

    Try to copy the content in ACTUAL.txt into EXPECTED.txt EXACTLY, then you should pass the check.

    Oh I see, thanks a lot!

    no problem : )

    Which task did you run? Besides, here is the link for this exception: https://docs.oracle.com/javase/7/docs/api/java/lang/reflect/InvocationTargetException.html

    Are there any error messages? If not, try pull and push commands in Git GUI, and check the error messages.

    Hi, this is my GUI for iP. Basically I followed the tutorial and implement that frame to my Duke and did not modify too much on design. Here is a screenshot:

    Ok I see. Thank you prof!

    Hi managed to run gradle clean test via the gradle tab on the top right corner

    I passed all the test cases but i got some error too. Does anyone know how to resolve this?

    Screenshot 2020-09-01 at 1 12 34 PM

    As you can see, when i have more than 4 tasks, they just truncate my tasks for me. How do i show all tasks?

    Appreciate your help!

    Hi, I just finished the A-Jar level.

    I just added a 'clear' command to be able to clear all the existing tasks in the storage file so that I can execute runtest.sh without any side effects affecting the test.

    When i type in the 'clear' command when running Duke normally through the terminal, it works as expected.

    However, runtest.sh does not recognise this command.

    Appreciate your advice on how to solve this!

    After level 7, we will be able to persist data on our harddrive.

    Now, everytime we start up our program, we continue to have the tasks from before.

    These tasks are ever changing, and the 'list' command will show different tasks depending on what i have done.

    My expected output will behave as if it is the first time we run the program.

    How do i do my testing accurately then?

    The instructions above one me to push all branches to my fork.

    But i also have to push my tags too.

    I did a bit of googling.

    So do i do this?


    git push --all

    git push --tags

    in this order. So that i can push both my branches and tags.

    Hi! A screenshot of my working directory is here:

    Where am I recommended to mkdir a directory and create the duke.txt file in?

    We're encouraged to commit frequently, but should we git tag after every commit?

    Or is it better to git tag once we are ready to git push and increment our level?

    so i must cd twice to the previous directory to go to the main iP folder directory. Then mkdir there ah.

    Thanks. But I'm also considering this case:

    If I create a new file on my local machine, it works fine and dandy. But because of the above message. I'll also have to find a way to create a file with my code if there isn't any file right?

    What is the recommended approach for this?

    Hi I'm not using the jar file for testing. I'm using the original runtest.sh file.

    I added the duke package earlier and i wonder if that affected anything.

    Thank you so much. lifesaver!

    Prof @damithc, so should we have checkstyle version 8.23 or version 8.29?

    agreed.

    Hi,

    I opened my Catcher app a few minutes ago and it stated that my version (CATcher 3.3.2) is outdated. May I know if I am allowed to re-download Catcher again for tomorrow's PE dry run? Thank you.

    I intend to use draw.io to create my UML diagrams. I created an empty draw.io document and placed it in the docs/diagrams folder before committing it. However, when I ran the build on Github, I encountered an error stating that there is no newline at EOF. I do not understand how to correct this error, since I am not uploading a text file, but a diagram. May I know if anyone has encountered and solved this error?

    Thanks!

    Hello,

    May I ask where we can find the collaborative project notes document for doing the v1.2 demo?

    My team recently received v1.2 feedback for the tp and it was reported that none of us contributed code to the project. However, for v1.2, we sent pull requests containing code changes to another branch, which we have not merged with the master branch. I am wondering if this might be causing the results in the tp feedback. May I know whether our code contributions will be tracked if we merge the changes in the other branch with the master branch?

    Hi,

    My team is working on a flashcard application. Currently, we have planned the milestone tasks such that milestone v1.2 mainly involves simple CRUD operations, where flashcard is essentially the same entity as person but with extra fields removed. Because milestone v1.2 resembles much of the existing functionality in AB3, most of our work is removing unnecessary fields and renaming classes. May I ask if this is sufficient for v1.2 to be considered completed, or do we have to start implementing tasks in milestone v1.3 (which contains new functionality for my team)?

    Thanks!

    Hi,

    I am currently using Intellij Idea 2019.3.1 (community edition) on Windows Java 11. I am currently failing 5 test cases for the add command tutorial, which is affecting my Gradle build. The error messages are similar, but I do not understand why I am getting these errors because when I check the files that I changed in SourceTree, I can see that I did not change the code relevant to the error messages.

    I think the error messages are similar because they indicate that the memory locations of the two Addressbook/AddCommand objects are different. The other error messages are similar so I never show them here. However, I am still confused as to why these errors are happening. May I have some advice as to where I am going wrong?

    Thank you.

    I have resolved the issue by removing the problematic lines of code. However, I am still a bit confused about why this problem pops up.

    So previously I wrote this in the Person class:

    @Override
    
    public boolean equals(Object other) {
    
        if (other == this) {
    
            return true;
    
        }
    
    
    
        if (!(other instanceof Person)) {
    
            return false;
    
        }
    
    
    
        Person otherPerson = (Person) other;
    
        return otherPerson.getName().equals(getName())
    
                && otherPerson.getPhone().equals(getPhone())
    
                && otherPerson.getEmail().equals(getEmail())
    
                && otherPerson.getAddress().equals(getAddress())
    
                && otherPerson.getTags().equals(getTags())
    
                && otherPerson.getRemark().equals(getRemark());
    
    }
    
    
    
    @Override
    
    public int hashCode() {
    
        // use this method for custom fields hashing instead of implementing your own
    
        return Objects.hash(name, phone, email, address, tags, remark);
    
    }
    

    So the lines of code that I removed to make it work are && otherPerson.getRemark().equals(getRemark()), and I modified Objects.hash to exclude the remark field.

    Clearly, I added the remark field to the object hash, and I also used it as a criterion for determining whether two objects are equal. But why is it that doing this will cause two objects to not be equal? May I have some advice about this? Thanks!

    Oh, I understand what you mean, when I went back and added the remark to the hash and also the equals method, then I tweaked the test cases to have all the same default remark, the test cases passed.

    Thanks!

    Ok Prof, I understand. Thanks!

    Hi, thanks for the reply. May I know if the merge will allow the script to track individual members' contributions, since each of us sent our pull requests to the branch?

    Ok, I understand. Thanks!

    Ok thanks!

    Hi Prof, I found that the file is in XML format but I could edit it using Notepad. The gradle build works now. Thanks!

    Hi prof,

    Our team created some duplicated issues. May we know should we close them or simply delete them (we have enabled deletion in the setting)? Thanks!

    Hi prof,

    When our team was updating the developer guide, we found that certain commands we planned need to be modified or put into later iterations. However, we do have some of our members writing use cases for these features that are not going to be out in iteration 1.2. May I know is it okay to put these use cases in a [coming soon] section in the Developer Guide's requirement section? We try to acknowledge his effort and also plan for future iteration reference.

    Thank you!

    Hi all, I'm wondering whether we should be able to open the GUI from the .jar file created.

    Currently I need to use cmd line to start duke and cannot open the GUI at all (double-clicking or java -jar don't work).

    Is this natural, do I miss out something?

    Hi all, may I ask to comply with the coding quality, must the method be less than 30 lines?

    It appears to be a basic guideline in coding quality, but I do find some of peer's main logic for command handing >= 30 lines with a relatively decent/correct logic. Should I point the issue out? Or is it okay to have a slightly >30 lines method if the logic is sound?

    Thank you!

    Hi, may I know is this a utf-8 encoding issue actually? Stuck over here as well and not sure what's the problem.

    Oh I see, thanks a lot!

    @li-s It's under the description in peer review task in Week 4 project.

    @damithc I see, thanks prof!

    Hmm not sure if Star War theme is allowed, but here is my try:

    https://github.com/Criss-Wang/ip/blob/master/src/main/java/META-INF/MANIFEST.MF

    If your main class has changed, you might need to change the manifest so that the JAR can find the correct main method.

    Thanks for the help! I also modified the main class in build.gradle to make the application open upon double clicking.

    Currently it seems that your json file location path is not correct...

    Also, maybe its better if you can give the full log...

    Thanks prof!

    Hi Prof, I did my assertions a while back (I did it before week 10, and it was recorded) but I deleted and replaced it in week 11, so the assertion turned red again. Could you help me take a look please? Thank you!

    Hello all, currently my MergingPR tag shows red even though i have merged the pr a few days back. Does anyone know if its an error on my part? Thank you.

    Hi all,

    I am trying to run the runtest.bat file on terminal. However, I am running into various issues. The latest issue I have is shown in the picture.

    According to my directory, the file is listed.

    If it helps, here is my full directory,

    Here is my code for runtest.bat:

    I have tried various methods, including:

    • Placing the paths in double quotes

    • Replacing .. with %MY_PATH%

    • Replacing line 13 with

    dir /s /B ..\src\main\java*.java > sources.txt

    javac -cp ..\src -Xlint:none -d ../bin @sources.txt

    Would gladly appreciate any help! Thank you.

    Hi Prof, thanks for answering! If the picture above means it succeeded, then the solution worked, although I'm not sure since the the symbol didn't print right but there was no "build failure".

    I managed to create the runtest file, needed to download the necessary plugins for intellij (prompted). However, I am getting the above error. Is it a directory issue in input.txt?

    Is this what you meant?

    This is what I got using DOS prompt

    I tried by copying the original into runtest.bat, ran on the same dos prompt, but it leads to a full circle hahaha

    1. https://github.com/nus-cs2103-AY2021S1/forum/issues/3#issue-679049330 (Cannot find symbol)

    which using the solution leads to

    1. https://github.com/nus-cs2103-AY2021S1/forum/issues/4 (invalid flag due to white space)

    which leads to

    1. the original solution of this post hahah

    I managed to solve this issue by recoding the project and testing each level as I went along. Thanks Prof!

    Okay thanks prof! @damithc

    I realised I couldn't find the code on my reposense report. I will insert another assertion then. Thanks prof!

    Like the other users already mentioned, I do think throwing errors as early as possible would be better.

    That said, you could look into having a private constructor and having a factory method to create instances of the class which would have checks before creating the object and thus, avoiding the problems with memory usage etc.

    You could even look into other design patterns if you think this might not be proper encapsulation of Task's duties. There is a factory design pattern that seems useful and I've been reading up on.

    https://www.tutorialspoint.com/design_pattern/factory_pattern.htm

    I'm not sure if there's a proper solution to having two relative paths from different working directories point to the same one but you could create the directories to get the path you want if it isn't found. Then remember to remove the save files with your .bat files or your results will differ each time.

    Assuming a layout of [project root]\src\test\java

    The test folder should be the one selected as Module

    The java folder should be the one marked as Test Source Root

    You shouldn't touch main as it is part of your source code and not the test cases.

    When you normally run your program, IntelliJ runs it from the root directory and thus the src/main/data/taskList.txt exists.

    When you use runtest.bat, the working directory is currently in text-ui-test and it cannot find the path text-ui-test/src/main/data/taskList.txt.

    You can also refer to #57 #47

    Try using javac -cp ..\src\main\java\ -Xlint:none -d ..\bin ..\src\main\java\*.java with the -cp flag changed to ..\src\main\java\

    Actually spent too much time on this

    I faced this error too. If you took the FXML from the guide, make sure that the field fx:controller="MainWindow" is changed to include the package name like fx:controller="duke.MainWindow".

    Actually spent too much time on this

    Oh my! Kang Liang, may I ask how do you add backgrounds?

    I'm using CSS to customize the appearance. The background image -fx-background-image:url('/images/background.jpg'); is applied to the VBox component and stylesheet is applied using scene.getStylesheets().add("path/stylesheet.css");

    You can find out more about customizing CSS here https://docs.oracle.com/javafx/2/css_tutorial/jfxpub-css_tutorial.htm

    Another point I would like to add on is that when using lambdas in streams, local variables need to be final or effectively final. I wanted to introduce streams into my code as well and felt that some workarounds for this tend to make code less readable. For example, a common workaround is using a final array to store a single variable that tricks the compiler into thinking that the variable is not modified. This could, however, lead to unpredictable results as detailed in this blog post here https://www.baeldung.com/java-lambda-effectively-final-local-variables

    The restriction to effectively final variables prohibits access to dynamically-changing local variables, whose capture would likely introduce concurrency problems.

    So if you find yourself needing to introduce such "anti-patterns" into your code, you should probably not use streams for that portion.

    Looking at your repository, the file is still Todo.java. This may be caused by a case-insensitive filesystem like Windows / MacOS. You can try changing the file name to something different, staging it, then changing it to the correct filename Todo.java -> Foo.java -> ToDo.java. Alternatively, there are some steps outlined here that may help.

    https://www.hanselman.com/blog/GitIsCasesensitiveAndYourFilesystemMayNotBeWeirdFolderMergingOnWindows.aspx

    Try changing the mainClassName in your build.gradle to "Launcher"

    I think this has been answered in #149

    Can you check if this works for you?

    According to the textbook,

    A composition is an association that represents a strong whole-part relationship. When the whole is destroyed, parts are destroyed too i.e., the part should not exist without being attached to a whole.

    In AB3, the relationship between the Person class and its components is considered a composition as shown in the diagram below:

    However, as we have found by tracing the execution path that one time, calling the add command creates the parts (using the ParserUtil methods) before the Person itself. Additionally, when we call the edit command, a new Person is created using the same containees from the previous Person object, and those containees continue to exist despite the old Person record being deleted. Is this still considered a composition in that case?

    I couldn't find a rake symbol in the PlantUML docs, but I did come across this here, and adapted it so it looks somewhat bigger and also works (because J is not a valid hexadecimal value).

    Just include this in style.puml:


    sprite $rake {

    0000000000000000

    0000000FF0000000

    0000000FF0000000

    0000000FF0000000

    0000000FF0000000

    0000000FF0000000

    0000000FF0000000

    000FFFFFFFFFF000

    000FFEEFFFFFF000

    000FF00FF00FF000

    000FF00FF00FF000

    000FF00FF00FF000

    000FF00FF00FF000

    000FF00FF00FF000

    000FF00FF00FF000

    0000000000000000

    }

    And when you want to use it in your activity diagram, just include !include style.puml under @startuml and reference it with <$rake> (e.g :Do Something <$rake>; and it should look this)

    If we store data as strings in json we can check if the data fields are there by checking if the input is null and throwing an IllegalValueException if so.

    (e.g. below)

    But is it possible to do something similar with booleans? After all, I cannot perform a boolean == null in Java.

    Are merge nodes actually needed? From the text book it would seem that the following is acceptable even though there is no merge before action B1:

    In the quiz there was also a question where the alternate paths converged directly on the end node without having to merge too, so I was wondering if merge nodes are more of a "good-to-have" notation than a necessary one.

    One of my teammates raised a PR to our repo but Codecov threw this error message at us.

    It says the error came from master@e6533c6, which is the commit where we had merged another PR that had passed all the checks in gradle.yml

    Screenshot 2020-10-07 at 2 07 18 PM

    Unfortunately, the Codecov site I linked doesn't tell me how to resolve it, can anyone please help?

    I followed the tutorial for setting up JavaFX via Gradle, but I am unable to run the application as I get the following error:

    JavaFX runtime components are missing, and are required to run this application

    How do I resolve this?

    I've dug around some more and found this link over here

    https://github.com/javafxports/openjdk-jfx/issues/236#issuecomment-426583174

    The gist of it is that if the driver class extends Application, it strongly requires JavaFX platform to be available as a module rather than a JAR. They recommend us to just create a different class with a main method that does not inherit Application.

    It was discussed in here

    javafxports/openjdk-jfx#236 (comment)

    Simply put, just put the main method in a Launcher class to avoid headaches. #128

    Giving the link to the said PR might be useful here.

    PR with the report issue

    PR with the base commit

    Thanks!

    Hmmm... It seems that if it is a missing field Java will just assign a default value (false), so I suppose I probably should stick to using strings instead

    https://community.codecov.io/t/how-is-code-complexity-calculated/961

    It is branch coverage. Perhaps try having tests that reach all possible decision points in a method's execution (e.g. if-else clauses or catch clauses).

    Hi has anyone experienced this error before when trying to run a jar file? I am not sure what the issue is but my path seems correct when compared to my friend's. However when I tried to run the jar files of apps that work on other computers, the error below appeared on my computer. Thank you for your time to read nevertheless!


    private void saveTasksToList(BufferedWriter bw, TaskList tasks) throws IOException{

    for (int i = 0; i < tasks.size(); i++) {

    Task task = tasks.get(i);

    TaskType taskType = task.returnTaskType();

    String taskInfo = task.returnTaskInfo();

    String when = "";

    switch(taskType.returnTaskSymbol()) {

    case 'D' :

    Deadlines deadline = (Deadlines) tasks.get(i);

    when = " : " + deadline.returnTime().trim();

    break;

    case 'E' :

    Events event = (Events) tasks.get(i);

    when = " : " + event.returnTime().trim();

    break;

    default :

    break;

    }

    String toWrite = taskType.returnTaskSymbol() + " : " + task.returnDoneStatus() + " : " + taskInfo.trim() + when;

    bw.write(toWrite);

    bw.newLine();

    }

    }

    Hi everyone I just wanna ask about a question that I have encountered while doing the IP.

    So what im doing here is typecasting the returned task to Deadlines because only my Deadlines and Events class got a returnTime() method. However, one of my teammates told me that a better way would be to have a returnTime() in the superclass Task, and then throw an exception in the returnTime() method of the Todos class. He claims that this saves code duplication which can be seen from the two cases above (can be combined into one in his method) and also allows for extension should there be more timed Tasks as well as removing typecasting (bad-coding habit). However, I was thinking that having a returnTime() method in Task breaks the polymorphism/inheritance law of including a method in the super class where one/some of the child do not use that method.

    In this regard, which would be the better option?

    '''

    Hi I changed my environment variables to 11.0 jdk bin already but it still doesn't work. May I ask what's the issue?

    Ohh okay it works haha thanks!!! 😄

    @Elgoh Hi May I ask what's the solution? Im facing this problem too haha

    Hi prof just a question on the preferred tagging habit, if I have changed two tags simultaneously eg. A-OOP and A-Packaging, should we delete the old tags and retag them at the one updated commit or do we just leave the old tags where they are and write out the corresponding updates in the updated commit message?

    Noted with thanks prof! 😃

    My personal takeaway is (Do correct me if I'm wrong):

    • We should use assertions on private methods, to check if the else/default of a conditional statement is not reached (If it is not supposed to)

    • Generally, we should not use assertions for public methods and definitely not for plausible user input failures

    Found this online, hope it helps 😃

    Where to use Assertions

    Arguments to private methods. Private arguments are provided by developer’s code only and developer may want to check his/her assumptions about arguments.

    Conditional cases.

    Conditions at the beginning of any method.

    Where not to use Assertions

    Assertions should not be used to replace error messages

    Assertions should not be used to check arguments in the public methods as they may be provided by user. Error handling should be used to handle errors provided by user.

    Assertions should not be used on command line arguments.

    A little late but Poppins says better late than never 😉

    Thank you @siangernlow and @Nahoyhp for your inputs and @damithc for the code edit. I felt that @siangernlow 's solution was most suited with my implementation and decided to adjust towards it. Will leave this open if it is ok for more ideas and inputs for anyone else facing the same issue 😃

    I'm not 100% sure, but it looks like you're on Windows and tried to run the jar file from your WSL CLI. WSL operates in a virtual environment of sorts and does not offer proper GUI support, thus it will be unable to run this GUI application. You need to run the same command in powershell / cmd

    Hi qwoprocks thank you for your reply but theres this other issue that pops out when I tried that.

    @qwoprocks Thank you so much :DD Managed to finally work with post #25. Spent alot of time on this and it's finally resolved thank you lots!!!

    It might be that your tag for the levels does not point to commits in the main branch. Try checking if all the commits of the relevant tags can be found on your main branch.

    Within a constructor, you can call other constructors of the class directly by using their corresponding signature.

    So in your case, you can just use this in your no-argument constructor: this("./data", "./data/tasks.txt");

    For your current solution, I believe you will be creating 2 Duke objects when u call your no-argument constructor

    Try running the clean build on Gradle and then run your whole project again. It could be that the class files are not updated and hence the program does not reflect your changes to Main or Duke.

    Let me know if it works 👍

    If you are referring to displaying the check and cross on your GUI, you can refer to this: #159

    Actually, I think you can just retag the appropriate commit. For me, I think of tags as a pointer and if it points to a commit that does not exist on main branch, you just have to manually change the tag to point to the correct one. (the correct one shd exist on the main branch)

    This can be done by deleting the tag and creating a new tag. After that you can force push just the changed tag to update the remote github tag

    These are not testcase errors, but expected error log output.

    I think that these are the error logs that appears when error testing is done to ensure that the appropriate response is produced in certain scenarios.

    If you refer to the Json file location, you can see that the file is actually in the test folder and named NonExistentFile.json. The error message corresponds to this file name.

    If you click on the info icon at the ip dashboard, you can see what they are detecting to fulfill a particular requirement.

    For Jar-released, they detect if a new release is made during this week time period. So the tag does not matter for this requirement.

    Yep, don't have to make any changes. I did not use the A-Release tag too

    Hi, I took a look at your codebase and I think that for JsonSerializableFinanceAccount, the constructor should take in a ReadOnlyFinanceRecord instead of FinanceRecord.

    A FinanceRecord has an ObservableList, while the interface just has the method.

    I'm not really sure how Jackson reads the JSON object, but I think it is attempting to find an ObservableList due to the parameter type in that constructor.

    You can use the wrapper class Boolean, it allows null assignment. (Not really sure if this is a good practise tho)

    Not sure if this might help fix your issue, but you can try playing around with the VGrow properties (setting it to always for contents that should always increase in vertical height to max height, for example, your list of tasks)

    Alternatively, you can directly put a VBox into the ScrollPane (if its the only item in your ScrollPane)

    I realised alot of solutions for javaFX issues can be found on google, in a javaFX syntax. However, converting this into FXML style is really difficult, as it seems like there's literally almost no one using it and hence the lack of examples. Does anyone have like a FXML API or something? Any will be appreciated! Thanks!

    Is this the correct way of using a no-argument constructor as needed when extending Duke from JavaFX Application?

    Is anyone else experiencing sourcetree hanging often, especially on startup which it will take quite abit of time? I am running on a 4K laptop which might seem to be the issue but when I googled for help the fix doesnt work for me.

    The following error occur when I run runtest.bat

    These are how my files are arranged.

    What might be causing the FC error?

    To what extent customization is allowed? Can display messages be customized, e.g. instead of echoing "hello" with the input "hello" in level 1, I can change it to "Duke says: hello" to enhance the personality aspect, so long the functionality holds it will be accepted? Thanks!

    For the NoSuchElementException, it might be the case that sc.nextLine() is called without checking sc.hasNext(). Since the test input.txt file is empty, it will throw an error when the scanner cannot find the next line.

    I have editted this previously and resolved the issue! Thanks!

    It might help to post the code of your Duke class (or whichever class that is using the Scanner object).

    Only my duke class is using the Scanner object. I have emptied out my whole main method in Duke class but the FC error still exists.

    I think my cmd somehow does not support the fc command line, i've tested on cmd on this laptop vs other pcs and only mine does not recognize fc

    Only my duke class is using the Scanner object. I have emptied out my whole main method in Duke class but the FC error still exists.

    This first error message usually occurs when you create the scanner object inside the loop. Instead, it should be created once (as a static variable) and reused for each loop. If not, the first scanner object will swallow all the lines from the input.txt and the subsequent scanner objects errors out with the error in your screenshot. That's why I wanted to see the code to confirm if that's the case.

    The second error usually happens when you set the path variable inside the batch file, but instead of adding the JDK location to the existing path, you overwrite the path variable. In that case, Windows cannot locate the FC.exe anymore because Windows uses the path variable to locate exe files.

    [RESOLVED] %SystemRoot%\system32 was missing from PATH in environment variables thus windows cannot call fc.exe

    Thanks for the help!

    Within a constructor, you can call other constructors of the class directly by using their corresponding signature.

    So in your case, you can just use this in your no-argument constructor: this("./data", "./data/tasks.txt");

    For your current solution, I believe you will be creating 2 Duke objects when u call your no-argument constructor

    Thanks! I am using that currently.

    Try deleting the duke.jar file and build your jar file under Gradle tab -> shadow -> shadowJar.

    [

    ](url)

    I have some folder that I would like to delete in my remote repository. Currently in my local, I don't have all the directory that starts with the Capital letters, as I have refactor(by renaming) them to lower case. However, it seems that gitHub cannot detect that changes.

    Anybody have an idea of how to delete the directory?

    Thanks in advance

    Apparently, I forgot to push my local branch to remote branch and I only push my tag for branch level-7 and level-8. And I have merged both branch to the master too. I just want to know whether this is okay? If not, how can I solve this issue?

    Thank you

    Can you provide more context to your error?

    I think it might be something about your path

    you can do the following :

    1. Type environment in your windows search bar

    2. Then click on Environment Variables

    3. Then on the System Variables section, click on Path and click Edit. Then, add your Java path (something like this C:\Program Files\Java\jdk-11.0.6\bin)

    May I check that whether you run your runtest.bat when your directory is on the text-ui-test folder?

    I had similar issue previously, and the problem is because I am running the "cmd.exe /c runtest.bat" command on the parent directory instead of text-ui-test directory

    you might want to direct you terminal to text-ui-test folder (cd text-ui-test)

    @damithc Prof, I was asked to execute this command "git push --set-upstream origin branch-Level-7"

    Is this the correct command to do that?

    Okay Prof..Thank you 😃

    @MarcusTw Hi Marcus, thanks for the answer. Unfortunately, it doesn't work in my case because the Command folder/package is gone in my local repo. However, I tried running git rm -r Command and it show an error message of "fatal: pathspec 'Command' did not match any files". May I know what is wrong with this?

    @MarcusTw I am sorry, I was at the wrong directory previously. Now, the problem is resolved. Thank you!!

    I merged the add-gradle-support branch and set up the Gradle. However, when I tried to run the JUnit test with gradle, it keeps saying that it cannot find any class from my duke package. Any help would be appreciated. Thanks!

    Please help! Thank you 😊

    Originally posted by @florenciamartina in https://github.com/nus-cs2103-AY2021S1/forum/issues/6#issuecomment-674996725

    hi! I followed the steps above but still got this error message:

    Could Not Find MY_PATH\ip\src\text-ui-test\ACTUAL.TXT

    error: illegal argument for -d: java.nio.file.InvalidPathException: Illegal char >*> at index 18: MY_PATH\main\java*.java

    error: no source files

    please help 😦 thank you

    @theodoreleebrant no, they are all in the same folder ._.

    @JingYenLoh hi, thank you for replying! Just to clarify, is "text-ui-test" folder supposed to be inside or outside src? Because currently it is inside src folder.

    @erisjacey thanks 😄 I will try again!

    Hi, so somehow I managed to make it run.


    Error: Could not find or load main class Duke

    Caused by: java.lang.ClassNotFoundException: Duke

    Comparing files ACTUAL.TXT and EXPECTED.TXT

    ***** ACTUAL.TXT

    ***** EXPECTED.TXT

    ...bot's output

    so it runs but when I go to ACTUAL.TXT, it is empty.

    @HynRidge thank you!

    @erisjacey it works now! thank you for your help.

    I got this exact same problem 😦 Can you share your solution in case you solved this? Thank you 😊

    Hi @madanalogy Thank you for your reply!

    I found the problem and solved it. Turns out, somehow I accidentally deleted the main/java folder, so all of my codes are directly in duke folder. When I created new directory main/java, everything works fine.

    Hi all,

    I have this problem when I try to run CheckSttyle on our desktop and it shows no error.

    But when I upload to a branch which is submitted as a PR, the CI test always fail, and the reason is always some checkstyle, mainly trailing white space or no new line at EOF. [Example below]

    I have tried following the instruction from the 'A-CheckStyle' portion in IP.

    Anyone knows what can I do to get the same level of CheckStyle as the CI???

    Thanks.

    Hi all, for the level "A-Gradle", I have merged the branch "add-gradle-support" into my new branch "branch-A-Gradle'.

    I followed the instructions but at the end I am confused whether or not I did successfully.

    IntelliJ managed to run everything without error and generated Gradle-related files under External libraries. But I can't find the Gradle tool bar at the top.

    I have tried to delete the .idea file but don't help. Anyone have suggestions on what to do?

    And how can I check if my "gradle installing" is successful?

    @tohyuting Are you using Windows? Because I can't find it on my screen.

    @tohyuting Thanks. It works.

    Sorry for causing the trouble. Totally don't see it.

    Hi @thutahw, i think you have installed it successfully.

    I encountered the same problem before and apparently the Gradle button is now on the right, (as shown in picture below)

    Untitled

    Upz la. I goggled for 20 mins and can't find an answer. I try my luck on forum and got it.

    Really thanks man.

    I think another way to work around to wrap the class around Optional. So the time variable will return Optioanl.empty. With that you can do it with one if statement.

    Alternatively, you can implement a general toSaveFormat() in Task interface/abstract class, then Override it in either TimedTask (if you decide to have another layer) or in both Deadline and Event.

    Hope this help.

    Hi,

    Did anyone success in getting it on Window 10 Home?

    I try the links above and it is not working. Apparently, Sandbox is supposed to be features for Pro and Enterprise and some said that Microsoft has found the bugs that allow us to use on Home Edition.

    So I am just wondering if anyone success and can share their methods.

    Thanks

    @damithc Sorry Prof, I take the screenshot from the wrong PR. But the forum that you mentioned indeed solved my problem. Thanks Prof.

    For those who want to set up your intelliJ in one go, take a look at these following related issues:

    #276 - To automatically remove trailing white spaces.

    To remove the wildcard in imports, [For Window] Go to Setting > CodeStyle > Java.

    Then "set class count to use import with *" and "name count to use static import with *" as 999.

    Scroll down and re-order of Packages as the following:

    *PS: I learn the second method from the same website that teaches us how to set up Gradle and everything. But I can't find the website link now. Appreciate if someone can post the link. Thanks.

    Is there a way to just disable it?

    For now, I just remove the whole block.

    I have try commenting out the whole block of code in .github/workflow/gradle.yml. but does not seem to work [Have other weird error].

    The question is simple: would it be appropriate (in the context of this project) to have a "static" class?

    I define a "static" class in the following manner, since top level classes can't be static by definition:

    • Only the default constructor is used, i.e. not declared

    • All methods are static

    Take for example the Parser class (talked in A-MoreOOP last week). I do not see a reason to make the class not "static" for the following reasons:

    1. The default constructor will work fine (I do not need to pass anything, there are no instance variables)

    2. For every single method, there would not be a difference in behavior if I:

    a) Make the class non-"static" and instantiate it (e.g. Parser parser = new Parser(); followed by parser.parseCommand();)

    b) Make the class "static", and use the class (e.g. Parser.parseCommand();)

    And this introduces several advantages, without any apparent disadvantages that I can see directly:

    1. There is no need to pass by reference if you need it - it's available for every single class to use

    2. Save a little bit of space in coding since you do not need to instantiate it

    Again restating the question: would it be appropriate to have a "static" class? Looking for any input. Thanks!

    If I'm not mistaken, an exception would cause the program to terminate. Is there any way to throw an exception without exiting the program?

    For context, I have the following pseudocode:


    while (true) {

    wait for input

    receive input

    try {

    do something with input (e.g. todo, bye, etc.)

    } catch (Exception e) {

    print stack trace

    }

    }

    But this would exit the program given an illegal input.

    What is the inherent advantage of using inheritance instead of, let's say, enums for the type of tasks in Level 4? As I see it, using inheritance introduces certain inflexibilities (e.g. having a need to add new classes to create any further type of task) as compared to enums. Additionally, enums might have some advantages in pattern-matching (although Java being Java...)

    Actually now that I think again about it, they might have differing behaviours in the future...

    Do you have more than one java file? The above suggestion changing Duke.java to *.java works for me.

    Related stackoverflow: https://stackoverflow.com/questions/48871445/javac-java-windows-command-line-error-as-illegal-chacter

    Do you put your java files in separate directory @florenciamartina?

    Dis you branch it out from branch-A-JavaDoc instead of master? Just to resolve ambiguity.

    If that is the case, here is a solution: https://stackoverflow.com/questions/8428587/git-created-new-branch-from-a-wrong-branch

    Thanks for the insight!

    If not wrong, there is also a button to restart the CI! So you don't need to close and open the PR.

    (no idea how to reopen, but super closely related qn, help @MarcTzh @damithc )

    How do we then draw this if there are more than 3 branches?

    Hello I'm unsure why I'm encountering this error in my MainWindow.java (line 28)

    Basically, I want to print my intro message on JavaFX but I don't see where the bug is...

    Attached below is the error I encountered.

    When I run my launcher and type list, it works as per normal. however, when I test out other commands, my program responses are shortened with "...".

    Also in general, all the responses from my program have 2 white lines above... how do I remove this?

    Did anyone encounter this issue and how did you solve it?

    (first pic: everything is as intended)

    (second pic: issue I encountered)

    I'm unable to run my project using Gradle after implementing the JavaFX component of iP.

    I'm certain it has something to do with my build.gradle, so I included my file below, along with the error message.

    I'm currently at the end of part 4 in the JavaFX tutorial (which I followed to a T) but I encountered an error...

    Could anyone suggest how to fix this? Im thinking it has something to do with the weird implementation in DialogBox.java

    I believe "linked to" is missing in the mentioned exercise option (d)

    was reading https://nus-cs2103-ay2021s1.github.io/website/schedule/week4/topics.html when this caught my attention.

    Hello does anyone know how to solve this error?

    followed the JavaFX tutorial but encountered this error...

    There seems to be an extra bracket on this "bad" example, at the end of line 2.

    (sorry in advance if this is the wrong place to post a typo)

    edit: sorry i meant bracket

    You can just remove the new ImageView from the handleUserInput() function. The two getDialog functions are expecting an Image and not an ImageView.

    thanks! i also replaced userText and dukeText with userInput.getText() and getResponse(userInput.getText()) respectively. (for anyone else who might need this)

    @tankangliang it worked! thanks!

    @tankangliang thanks!

    Unable to run addressbook level 3 on Java 11

    Tried running addressbook using java -jar addressbook.jar

    Java 11 is installed

    Double checked the version of Java on the command prompt

    >br>

    >br>

    >br>

    Literally uninstalled all Java versions and installed >b>Java 11>/b> before starting this module

    >br>

    Tried running it on IntelliJ but encountered the exact same code trace

    More information

    OS: Windows 10 Home 64-bit May 2020 Update

    Java SDK version: Java SE Development kit 11.0.8 (64 bit)

    Java version: 11.0.8 2020-07-14 LTS

    Java SE Runtime Environment version: 18.9 (Build 11.0.8+10-LTS)

    IntelliJ version: IntelliJ ultimate 2020.2 (202.6397.94)

    >br>

    Things I have tried:

    • Tried to run using IntelliJ

    • Tried to run using command prompt

    • Tried removing 1/2 of the paths at a time and running addressbook.jar

    Things I might try later (Will update here later after I try)

    • Cloning the Java file and compiling it and running it

    • Compile the Jar file from source code and running it

    >br>

    It mentioned the bug was fixed in Intellij as mentioned:

    >br>

    But I am still encountering the bug, not sure what is causing it

    Has anyone encountered any similar issues when trying to open addressbook 3?

    There are only 2 java paths in my environmental variables

    Tried removing 1 at a time and running addressbook.jar

    The path on both the local user path and the system paths are the same

    Same error on both instances

    You can open the conflict in visual studio code, there will be buttons to allow you to accept one side or another or edit either one of them before resolving the conflict.

    Is the path for the module test marked correctly?

    You can refer to here if that is the case.

    You can significantly speed up Git on Windows by running three commands to set some config options:

    git config --global core.preloadindex true

    git config --global core.fscache true

    git config --global gc.auto 256

    This might help with sourcetree lagging

    You can take a look here too!

    Source: here

    It will look something like this when you draft a release.

    the A-jar goes into the Tag Version and the Duke v0.1 goes into the release title I think

    Intellij was using JDK 11

    There was a weird bug where there was 2 JDK but they were not showing up in the control panel correctly and not reflected in Intellij.

    Went to the Java folder and manually deleted the rest of the java files and the address book worked.

    Thank you for all the help @j-lum !

    Maybe add this to your build.gradle might help

    tasks.withType(JavaCompile) {

    options.encoding = 'UTF-8'
    

    }

    Source

    It might be because the constructor for Duke has an argument.

    Might need to make a constructor which has no arguments as input.

    https://github.com/google/gson This is pretty good as well

    Sorry for asking at the last minute but I do not know what went wrong with my merging PR.

    What I have done was:

    1. commit in a branch

    2. go to github and create pull request from that branch to master in my fork

    3. merge to my fork ip/master with commit

    My current state is:

    Here's the screenshot of my GitHub "branches" page:

    Screenshot 2020-09-18 at 9 38 12 PM

    Here's the screenshot of my GitHub "pull request" page:

    Screenshot 2020-09-18 at 9 42 16 PM

    Here's the screenshot of my tracking diagram in sourcetree:

    Screenshot 2020-09-18 at 9 44 11 PM

    I thought that it was not detected is due to dashboard not updating and did not think it as a big issue. However, I got to know that dashboard has updated today in the afternoon and I went crazy 😰

    😭Thank anyone who will help me with my issue

    Previously I have followed tutorial from https://se-education.org/guides/tutorials/jar.html to create a JAR file with Intellij IDEA, and everything worked. When this week I attempted to create a new JAR file, it says "MANIFEST.MF already exists in VFS".

    So I did the following things:

    1. delete the whole folder in src/main/java/META-INF

    2. delete the old jar file "ip.jar" in out/artifacts/ip-jar

    3. follow the tutorial again to try to create a new jar file again

    However, it showed "no main manifest attribute, in ip.jar". When I copy & paste the new MANIFEST.MF file into the folder out/artifacts/ip-jar, it showed the same error message as well as the "duke.Duke" is highlighted as red. (I guess it is due to the wrong directory but I try different forms and fail to correct it) (Duke.java is inside the duke package)

    The content of MANIFEST.MF is simply:

    "Manifest-Version: 1.0

    Main-Class: duke.Duke"

    My directory is like this.

    Screenshot 2020-09-15 at 1 50 39 PM

    I have seen the post https://github.com/nus-cs2103-AY2021S1/forum/issues/207 but I do not understand it clearly and I am still confused. Also because I am using IntelliJ instead of gradle to generate jar files.

    Please help 😦(

    Is this the correct tutorial of building jar files with gradle? https://se-education.org/guides/tutorials/gradle.html#creating-a-jar-file

    I do not think it provides enough details to follow...

    Hi, I have met the same issue yesterday when I used IntelliJ to build the new Jar file. However, I later tried to use shadowJar in Gradle to produce the new jar file and it finally worked. Hope it helps!

    Thanks! I have generated the jar file by using gradle!

    Thanks prof! That is way clearer!

    Another thing (not related to this issue) I want to bring up is that instructions installing checkstyle plugin using intelliJ may not be updated since the window is slightly different on my computer. For example, instead of "Browse Repository" which is stated in the instructions, it should be directly searching in the "marketplace".

    Hi, I think your jar file is somehow complied using java 13. Maybe double-check your intellij java settings and create the jar file again?

    Thanks prof! I feel better now!

    I guess I have a similar problem with codecov. After some googling, I changed fail_ci_if_error to false in the file workflows/gradle.yml and everything works. I don't know exactly how it works though😂 but I hope this will provide some insights to your team

    Change fail_if_ci_error to false and everything will work then

    I follow the tutorial and try to run my app, but this error occur:

    I trace the stack, it seems like it hasn't reached the launcher.main(), it seems like the setting problem. Is there anyone can solve this?

    I have set up the Gradle and it can run the program, but when I try to perform unit test, there are some problem. Here are the pictures of my build.gradle and one unit test class:

    From these pictures, it seems that my test class cannot recognize another package, also, it cannot recognize assertEqual as well, the error message is like this:

    Does anyone know what's the cause of this? Is it the dependency problem?

    Regarding the convention described in the code standard, there is nothing say about immutability.

    As we know, immutability can support method chain for testing, so when is a good practice to have an immutable class?

    Here is one concrete example of the testing:

    • Here is my taskList class which is mutable:

    I did not make my arraylist as private final. If I want to make it private final, I need to make my method markDone(),add,delete... etc return a TaskList object.

    Now my testing is like this:

    If I make the TaskList and Task immutable and declare a getter function for specific index of TaskList, it is easier for testing. We can just use:

    AssetEquals(sample.markAsDone().getStatus(), list.add(sampleInList).markDone(0).get(0).getStatus())

    after instantiating three objects to test the output.

    So the main point is, when should we have an immutable class?

    Since the IntelliJ's encoding is correct, maybe the problem of encoding of command prompt or windows system?

    Sorry for the confusion, what I mean is just about immutability. Nothing about static.

    Hi, if you mean to use the jar file for testing. Is it possible that you haven't rebuilt the jar file? So the source code still cannot recognize the clear command.

    actually IMO the whole concept of immutability in java is kinda pointless because it does not have "const-correctness" like other languages. Just because your taskList is marked private final, it doesn't mean the list itself is immutable, only that the reference to the list is immutable.

    you can't reassign the list to another new list, but you are totally free to append/delete items to/from the list. in fact, having a getter allows other people to do list.getTasks().clear() or something else to modify the list.

    Oh yeah. If it is really immutable, I should not have the getter method, since all class are passing by reference. But there is a possibility to always use the clone() method to clone the list and pass it out. Because my usage of the getter is just to see the content, it's kind of force the use of the getter method is only to see the content because modifier on this list after cloning is kind of useless (because it will not change the object itself). But I just feel like this is not a good practice considering the efficiency.

    Hi there Lingy12 I am not entirely sure since your screen shot cut off the import lines above, but you could try adding this import line. The error looks like its due to u importing the wrong line. Cheers!

    import static org.junit.jupiter.api.Assertions.assertEquals;

    Yes you are right. After merging the branch to support gradle, the import line just magically disappear. After I add it back, it works now.

    Solved,Turns our I put the images to a wrong directory.

    Thanks for the reply above.

    For those groups who are doing MORPH, what are some of the actions that will break the idea of a brown field project?

    What is the point of making these 2 super classes different? As personally, i feel that Parser should also be an abstract class as it does not make sense to be able to instantiate an Parser object.

    Currently trying to fix my my CI fails for all platform.

    Here are the fail errors in Ubuntu, MacOS, Windows respectively

    And here is my gradle.yml file:


    name: Java CI



    on: [push, pull_request]



    jobs:

    build:

    strategy:

    matrix:

    platform: [ubuntu-latest, macos-latest, windows-latest]

    runs-on: $



    steps:

    - name: Set up repository

    uses: actions/checkout@master



    - name: Set up repository

    uses: actions/checkout@master

    with:

    ref: master



    - name: Merge to master

    run: git checkout --progress --force $



    - name: Validate Gradle Wrapper

    uses: gradle/wrapper-validation-action@v1



    - name: Setup JDK 11

    uses: actions/setup-java@v1

    with:

    java-version: '11'

    java-package: jdk+fx



    - name: Build and check with Gradle

    run: ./gradlew check



    Hi, so I have push and completed all the levels and increments and push them to the Github, but some of them are not being marked as done. For example, both my merge level 8 and merge level 9 are being being marked as done despite it being completed. But later levels are being marked as completed, so I am not sure if its become I did it wrongly. Anyone can help? Thanks!

    So based on what I know, generally it is safer to us immutability. I understand that using mutable objects are easy to work with and use, the benefit of using immutable objects is the reduction of side effects. I'm sure you have seen first hand the possible side effects of using mutable objects. Immutable objects are more troublesome to use, but it allows you to add-on future areas without having to worry about the side effects it may cause your existing functions. But having said that, I'm currently not using immutable objects as well purely due to it being more troublesome to work with and due to time constraints hahah.

    Dear, prof

    Im so sorry that I just show this. But may i ask how do i fix this? Do i revert back to this commit and push again?

    I reverted back to the merge commit and re-tagged this level and pushed into the repo. I hope this will work!

    still doesnt work

    After consulting with prof, this is what I understand:

    1. We should not be starting on a clean slate and copying the relevant codes into the new slate.

    2. We should keep our new morphed idea as close to the AB3 as possible, it shouldn't be too different from the code provided.

    3. Do not make too much deletions of the current legacy code.

    For those who have broken any of these rules, you should start to get back on the brown field track asap.

    I'm facing a weird issue whenever I run my GUI application. Although it doesn't affect the functionality of my application, it's kinda irritating.

    Whenever I launch my application either using IntelliJ or from Windows cmd, I'll keep seeing these warnings appearing.. Currently, my javaFxVersion in build.gradle under dependencies is '11'. Does anyone have any idea on how to resolve this? Thanks in advance!

    Hi everyone, I'm facing a rather weird bug for my GUI and I think it's related to wrap text.

    When I first run my program, I'm able to view all the items in my list.

    However, once I reach the bottom of the application, the items will be 'cut off' as shown in the image below

    I've checked the Wrap Text option for my Label (that stores the replies from Duke) and I'm currently using the option 'USE_COMPUTED_SIZE' for all the height and width settings (min width, min height, pref width, pref height, ... etc)

    Please give me some advice, thank you in advance! 😃

    Just curious, may I know how do yall know that the version of the checkStyle is 8.32? I know it's mentioned in the GitHub's commit for the checkstyle.xml but I don't see '8.32' appearing in the checkstyle file itself. I wonder how Gradle checks for this number. 😕

    Go to the [root]/build.gradle file, you should see this:

    Hope this helps!

    Oh I think you misunderstood my question haha, I'm asking how does gradle check for the number 8.32, as it was only mentioned in the commit header but it wasn't mentioned in the xml file itself. Thanks for answering though!

    Sorry I realised this question was already answered and I was searching with the open issues filter on 😅

    I think this warning is caused when you use scene builder to edit the fxml. I was able to clear this warning by changing the xml namespace of the root elements in the FXML files to this xmlns="http://javafx.com/javafx/11.0.0".

    I also experienced the same issue, but what I did to fix it was change my JavaFX version in my build.gradle to 11.0.1

    Both methods works! Thank you @ktaekwon000 and @AdithyaNarayan!

    Just wondering though, is there a preferred way or are both ways acceptable?

    I think Gradle does not actually know the version, and completely relies on whatever number you put in the build.gradle file. Its just that the structure between checkstyle of version 8.32 and 8.23 is different so if you tell gradle that you are using 8.23 then they will give you an error because the structure seems wrong to them. I only knew the correct version from the commit header too.

    Ah I see.. Thank you @qlchan24!

    I guess my method might cause our build.gradle to deviate from the rest of the cohort? I'm not sure what downsides this will have, but I suspect its not very relevant because there's already people modifying their build.gradle to use external libraries and such.

    About Adithya's method, I personally havent tried it myself so I'm not 100% sure, but I suspect you'll have to edit the .fxml file to change the version string every time you edit something in it with the scene builder. I don't have experience with this though so it would be nice if someone who did that could test it for me.

    Thanks ktaekwon for sharing! I guess the best option right now would be to follow his method and change the JavaFX version in our build.gradle to 11.0.1. I'll be closing this issue.

    In case anyone is still struggling with Graphviz installation:

    1. Simply go to download link to install the zip file

    2. Extract the folder to your Program Files

    3. Open your command prompt, navigate to the location of the bin folder and type dot -c

    4. Type dot -v and you should see the version of Graphviz that you've installed.

    5. Follow Step 2 in the diagram below and everything should work fine.

    Expected : module-related

    Expected : Contacts Plus

    Actual : ContactsPlus

    Can we see assertions as a form of unit testing for functional code?

    Since it is mentioned in the textbook that "junit and assertion are similar in purpose but JUnit assertions are more powerful and customized for testing"

    Hi Prof, just to clarify further. This means both children and fiction are in the same arraylist of the same class, and hence they "know about each other"? (Ie Bidirectional navigability)

    I think in that case, for Q52 Week 5 Quiz, it is more suitable if the question is framed as "Java assertions are used in unit testing" rather than "Java assertions are used for unit testing." ?

    And assert can refer to either Assert.AreEqual in unit tests or assert in functional code so it wasn't stated clearly in the qn?

    Not sure if i'm missing anything out in my reasoning but please do lmk if anything seems wrong

    @damithc I think "appear" missing in here?

    Library

    Jackson Dataformats Text

    Purpose

    Use the csv submodule to write/read between JSON and CSV files.

    License

    Apache License 2.0 (link to GitHub)

    Is the throwing of checked exceptions in constructors considered poor practice in software design?

    For illustration, consider a checked exception called DukeException, a class called Task and the scenario of say, writing a command "todo" without any description.

    Case 1: The Task constructor throws a DukeException on being passed a null string as description.

    The benefit (per my understanding) is that it localizes exception logic to the Task class. However, this would imply that any user of the Task class must always wrap object creation in a try-catch block (not sure if this is problematic).

    Case 2: The user creating Task objects raises a DukeException for a null string before calling the Task constructor. A benefit is that it avoids problems with object initialization, creation or memory usage. However, this might lead to duplication of code (for example, if neither Todos, Events or Deadlines (which are all Tasks) are permitted to have empty descriptions).

    Could someone throw some light on my dilemma (or possible point out flaws in my reasoning?). Thanks in advance!

    Sorry Prof, my bad! I meant for the first sentence to read as follows (with the addition of the bolded text):

    Is the throwing of checked exceptions in constructors considered poor practice in software design?

    Should I edit the question inline with this, to keep the discussion here more streamlined?

    I think that rounds it off! Thanks @erisjacey @sudogene @tankangliang for the holistic suggestions.

    @damithc Is it fine to close the issue?

    Building off OP's question (note sure if this is tangential), in the case where we do indeed pick an arbitrary non-boundary value, does it help by picking the most likely option? In other words, if I know that a particular option is most liable to be selected by the user, and I use that option as my "arbitrary" value?

    If so, would this fall under scenario testing?

    Alternatively, would it be wise to include designs for potential features that the team doesn't plan to add for this semester, but would be useful for, say, v2.0? This is an approach that the AddressBook-3 Developer Guide uses.

    Ah, so there's a lot of considerations (type of test, type of bug, catchability) that I should keep in mind while writing tests in EPs. Thanks for highlighting Prof!

    Can you click on "Details" for the MacOS job to view the error message, and let us know exactly what the issue was?

    I noticed a (small) number of people having the issue as I had following the instructions from the Week 5. The issue being that when we followed the instructions in the for the merging of Pull Request (PR), the PR was instead made to the nus-cs2103-AY20221S1 fork instead of our own master branch.

    I will just do up a short guide to aid others alongside what is given in the iP instructions to aid those not as well versed with github (as I am).

    The assumption so far is that you are able to push the branch to your fork in github. I will continue the steps thereafter from the assumption.

    1. Go to your iP Repository

    2. Go to the branch that you want to create the PR from. (e.g click on branch-A-Lambdas)

    1. Click on the pull request once the branch page is loaded.

    1. What you see now is something like a configuration for the pull request.

    1. This is where the mistake happens for some people (notice that the merge is suggested to the base repository that is nus-cs2103-AY2021/ip).

    1. Click on the nus-cs2103-AY2021S1/ip and the pop up will appear for you to select the right ip to create the right PR.

    From here you can then proceed to create the pull request, the interface thereafter from here is rather intuitive, hence, I will only cover up to this point. Feel free to ask questions if you encounter further errors!

    Anyone encountered this error as well?

    Followed the steps in the github but can't seem to run JavaFX despite setting up all the stuff.

    Based on what I see, my MainWindow.fxml and DialogBox.fxml cant seem to be able to access my MainWindow.java and DialogBox.java


    String value = "Exception in Application start method

    Exception in thread "main" java.lang.RuntimeException: Exception in Application start method

    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)

    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)

    at java.base/java.lang.Thread.run(Thread.java:834)

    Caused by: java.lang.IllegalStateException: Location is not set.

    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2459)

    at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)

    at duke.Main.start(Main.java:23)

    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)

    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)

    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)

    at java.base/java.security.AccessController.doPrivileged(Native Method)

    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)

    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)

    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)

    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)

    ... 1 more

    "

    💡 You can use Markdown to format your text

    Resolved it, naming issue due to Package

    This is likely got to do with the path settings as Kang Liang, I spent a great deal of time solving it and resolved it just as how Kang Liang suggested.

    Suggestion for places to check:

    1. the .getResource( >file path> ) > mine is /view/DialogBox,fxml (or /view/MainWindow.fxml for Main.java)

    2. .getResourceAsStream("/image/>filename>.png")

    Thanks for the tip!!

    Repost, please pardon the naughty pichu 😄

    Hey bro!

    Can I check if you put the Launcher class in the package / folder? e.g if your package name is duke then you should have it as follows.

    In my case, the package of which my Launcher lies in is in the package duke.


    application {

    mainClassName = "duke.Launcher"

    }

    Hello! For this I realised the issue was in build.gradle under my main application. I resolved it by redirecting my mainClassName with the package name e.g duke.Launcher.

    I would suspect it might have to the with the package / directory issue given the similarity of the error. But note that I did not encounter the load() error as you did. But I would strongly suggest looking at how you reference the class names or file names.

    Also, if your JAR files are not being added inside (as per your suspicions):

    Maybe you can check your dependencies in build.gradle ? Does it contain the JavaFX dependencies as shown below. I also encountered this but realised I carelessly deleted the dependencies as I drowned in gradle.

    dependencies {

    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'
    
    testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'
    
    
    
    String javaFxVersion = '11'
    
    
    
    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'
    
    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'
    
    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux'
    
    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win'
    
    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac'
    
    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux'
    
    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win'
    
    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac'
    
    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux'
    
    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'
    
    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'
    
    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'
    

    }

    For increment A-Gradle, I created a new branch and merged the given "add-gradle-support" branch to it. After that, I clicked on the file->open, and opened the build.gradle file as a project. Then I closed the intellij and restarted it and imported the gradle script as suggested by intellij. However, I do not have the project tasks in the gradle toolbar and I also got an error that says "Cause: zip END header not found". Can anyone give me some suggestions on how to fix this? Thanks!

    Hi, sorry but what do you mean by corrupted cache?

    Hi, sorry but what do you mean by corrupted cache?

    I think you can try to delete the .idea folder and re-import the project, then rebuild the project. Hope it helps! : )

    Hi, thanks for the advice. But when I delete the .idea file and restart the intellij project, it still tells me that zip END header not found. And another issue that arises by deleting .idea and restarting the project is that intellij now cannot run the java files(i.e, the java files are not recognized as runnable). so I am very confused about it..

    Try clearing gradle's cache instead of intellij's cache.

    Hi Jeffry, how do I clear gradle's cache?

    how do I clear gradle's cache?

    Sounds like this is a general-enough question to have answers on the interwebs already. 😃

    Try Googling and see if something useful comes up. If it does, don't forget to share.

    so I tried to delete the gradle-6.2-bin and run the project in intellij again. But when I entered gradlew --version in the command line, the following error occurred.

    And again in intellij it tells me that it cannot import the gradle file and the error message says "Cause: zip END header not found". So I am not sure if clearing gradle cache works. I also tried to reinstall intellij but that couldn't work either.

    @Royxuzeng You can also try using a fresh clone of the ip repo, and go through the steps carefully to step up gradle for it, just to see if the same problem occurs there as well. That will help you determine if the problem is inside your current iP project setup or more systemic to your computer/OS setup.

    I tried to use a fresh clone of the ip repo but the same problem occurred so I think the ip does not have problems. When running gradlew --version in the command prompt in the project root folder, the error occurred that it cannot unzip the gradle-6.2-bin.zip so I think it might have something to do with it but I am really not sure how to fix this issue.

    Update: problem solved! It was because the internet was not very good so the gradle file was not properly downloaded and therefore it cannot be unzipped.

    @GilbertTan19 , hi can I ask how did you manage to solve that issue?

    Take for example a class that holds strings like that


    public static final String DASH = "-";

    public static final String SPACE = " ";

    Lets say we have another string which is something like


    public static final String EXAMPLE = "How-Are You?";

    Should we abstract it to become

    Version 1


    public static final String EXAMPLE = "How" + DASH + "Are" + SPACE + "You?"

    or remain the same?

    One of it will improve consistency but deprove readability, vice versa

    Hi, take for example, let's say I have a method with many parameters. what is the proper way of formatting it?

    Q1) Adapted from ab3

    Format 1


    /**

    * Constructs a {@code JsonAdaptedPerson} with the given person details.

    */

    @JsonCreator

    public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone") String phone,

    @JsonProperty("email") String email, @JsonProperty("address") String address,

    @JsonProperty("tagged") List<JsonAdaptedTag> tagged) {



    this.name = name;

    this.phone = phone;

    this.email = email;

    this.address = address;

    if (tagged != null) {

    this.tagged.addAll(tagged);

    }

    }

    Format 2


    /**

    * Constructs a {@code JsonAdaptedPerson} with the given person details.

    */

    @JsonCreator

    public JsonAdaptedPerson(@JsonProperty("name") String name,

    @JsonProperty("phone") String phone,

    @JsonProperty("email") String email,

    @JsonProperty("address") String address,

    @JsonProperty("tagged") List<JsonAdaptedTag> tagged) {



    this.name = name;

    this.phone = phone;

    this.email = email;

    this.address = address;

    if (tagged != null) {

    this.tagged.addAll(tagged);

    }

    }

    Q2) For long array indentation what should be the indentation be then? And should it be 4 or 8 indents?

    Format 1


    int arr[] = {

    "hello world",

    "hello world",

    "hello world",

    "hello world",

    "hello world",

    }

    Format 2 (8 indents)


    int arr[] = {"hello world", "hello world", "hello world", "hello world",

    "hello world", "hello world", "hello world", "hello world" }

    Format 3 (4 indents)


    int arr[] = {"hello world", "hello world", "hello world", "hello world",

    "hello world", "hello world", "hello world", "hello world" }

    Thanks in advance.

    IntelliJ version: IntelliJ IDEA 2020.1.2

    Java version: 11.0.8

    OS: macOS Cataline Version 10.15.5

    Problem: Unable to run the JavaFX GUI.

    Error Message: Error: LinkageError occurred while loading main class Launcher

    However, if I were to change the Java Version to 14, it will work. Is there any way to make it work for java 11?

    Not sure whats the problem but for java 14, i can press the green button to run as well as gradle run to run.

    However in java 11, i have to use gradle run to run, green button doesnt seem to be working.

    @damithc Thanks for the clarification.

    Hi Kc, I believe most of the properties in FXML are available in the JavaFX documentation under the properties portion. And most of it follows the notation that we have often use such as setSOMETHING. And SOMETHING would be the FXML properties.

    Some examples are


    setAlignment (java) -&gt; alignment (fxml)

    setBottomAnchor (java) -&gt; AnchorPane.bottomAnchor (fxml)

    In the case where properties are not available, most likely than not, that method you have seen is only available as a method in java such as binding of heights

    Also if you are ok with CSS, you can consider using JavaFX CSS instead. Note that there are some FXML properties that are not available in CSS as well. https://openjfx.io/javadoc/11/javafx.graphics/javafx/scene/doc-files/cssref.html

    You can also look at the CSS properties to convert it to fxml properties like fx-fill-height in CSS is equivalent to fillHeight in FXML.

    Thanks for the insight @damithc

    @damithc . Hi Prof, can this be applied to the sequence diagram as well? (or whatsoever diagrams). It helps the diagram to be more compact and readable.

    Library

    ikonli

    Purpose

    Provides modern icons and fonts

    License

    Apache

    Library

    DataFX

    Purpose

    As a bridge between fxml and java classes

    License

    NA

    Class-level members can be accessed by using class name AND an object/instance of the class. So the answer should be correct.

    I tried adding a conflict marker in a text file ( with an existing commit id) and it seems like git won't generate such conflicts and manually entering conflict markers will not work. If you want to create conflicts yourself, you need to use git commands as https://stackoverflow.com/questions/52614012/manually-create-markers-like-git-merge-with-conflict-from-a-diff shows

    To delete a tag, I use git tag --delete origin tagname. Just make sure that the tagname does not clash with any branch's name or it will delete the branch as you said. The former method you used is indeed safer and it works for me, but remember to delete to local tag also.

    The AnchorPanel should have fx:controller, you should add the package path to your MainWindow here (default is MainWindow)

    e.g fx:controller="duke.MainWindow"

    The above response is expected as your code violates some coding standards which could be found in the html file generated. To resolve this, simply open the html file and fix all errors specified.

    I suppose the runtest script is not linking javafx (3rd party library), thats why it says those classes do not exist.

    On a side note, the runtest is to test the text UI, but since you have added GUI, the text is not in standard output anymore which could not be tested by the script. You can use Junit to test methods output though.

    For actuall GUI testing, we need another 3rd party library, maybe Espresso?

    Hi Prof, am here to just report a few small typos made in week 10 slides

    Under Command Pattern section

    In week 10 quiz

    Not here to nitpick but just informing in case you're unaware and want to make changes, thank you!

    Hi Prof! I would like to clarify if peer reviews only need to be done in week 4 (as assigned) or do we have to

    review 4 out of 6 weeks too?? Thank you! Although we pretty much can't change anything by now..

    I have this error when running from the Main class. The thing is everything runs fine if its initiated from Launcher class.

    Does anyone have the same issue?

    My current implementation in Launcher class is this:

    '

    public static void main(String[] args) {
    
        Application.launch(Main.class, args);
    
    }
    

    '

    That is because your path will read from where you run the command, meaning running from runtest.bat vs Duke class would have different starting file location. One way to solve this is by doing this:


    public final static String FILEPATH = System.getProperty("user.dir") + (System.getProperty("user.dir").endsWith("text-ui-test")

    ? "/saved-tasks.txt"

    : "/text-ui-test/saved-tasks.txt");

    This assumes that you put your storage inside text-ui-test, you have to adjust the accordingly depending on where you put your storage file.

    Use this FILEPATH as an argument in your FileReader/Writer. Hope this helps!

    Are you trying to merge the level branches with master branch? If so, you have to ensure that you are at master branch before pulling other branches.

    Use git branch to check the branches available in your code, and use git checkout &gt;branch_name>

    to enter the branch.

    Once you're at master branch, enter git merge --no-ff &gt;branch_name>

    Not really sure whats the best way to move forward as I do not know your current github status (since udk too..) but the best bet would be forcing yourself to move to a particular commit. You can check on github with commit code you want to revert your work to, and enter git reset --hard &gt;commit_id> or git reset --hard HEAD

    I think from here onwards, you should be able to push and pull, just take note of the changes you have done before the issue came about.

    You can also check https://github.com/nus-cs2103-AY2021S1/forum/issues/77 to see if you have the same issue

    In your build.gradle, you have to change the versioning to '8.29'

    'checkstyle {

    toolVersion = '8.29'
    

    }'

    The bug was just found recently and prof just made the changes to the branch. Hope this helps!

    IntelliJ will direct you to the exact location when you click on the link. Sadly checkstyle can't be used to automate correction so you have to do it manually.

    In terms of functionality, whether it is interface or abstract class it will work the same way.

    However, in my opinion, since Command only have a contract of public abstract CommandResult execute(Model model) throws CommandException; where there is no method body, interface would be better suited in this case.

    This however, would change if in the future you want to add more methods that have a method body in Command, hence the need for an abstract class arises as this will reduce the amount of code to be rewritten to those classes that extends Command.

    Is it wrong to use a line when it the code hints a certain direction? E.g. If it's clearly meant to be in a certain direction, would it be wrong to represent it as just a line?

    In the Week 8 Quiz, there is a question regarding association roles. I initially thought that association labels and association roles are distinct, s.t. only association "roles," and not "labels," may represent the "highlighted association role." Prof Damith clarified the different uses of roles and labels during the lecture, but this concept of "representation" still feels a bit ambiguous to me personally. Since roles and labels are basically describing the same association with a different format, is it correct to say that a diagram depicting an association label represents the highlighted association role?

    Hi, whenever I try to run the Launcher, it keeps giving me this error:

    and my code in MainWindow.fxml doesn't seem to be able to compile:

    Does anyone know why this is not working for me but fine for everyone else?

    Thank you!

    I faced this error too. If you took the FXML from the guide, make sure that the field fx:controller="MainWindow" is changed to include the package name like fx:controller="duke.MainWindow".

    I changed the fx:controller variable but the links are still not recognized. 😕

    @kormingsoon thank you! I eventually solved it by just moving the files and directories around a bit

    Not many visual upgrades, but for DaMemes. 😄

    @damithc Okay, thank you for the clarification!

    Ah okay, thank you for the response!

    Hello! I would like to ask for Level 8 minimal requirement, do we assume that the dates inputs are restricted to yyyy-mm-dd format only (without any time or words like Today/June 6th/No idea etc that was seen when we were dealing with date/time prior to Level 8)?

    Do we need to consider cases where users give input such as dd/mm/yyyy?

    Appreciate any help provided! 😃

    Alright noted, thank you prof for the prompt reply! 😃

    Hello, not too sure if this will work for you, have you tried changing the command to run the program to

    java -classpath ../bin dobby.Dobby > input.txt > ACTUAL.TXT

    😃 glad to hear that it solves your problem! Also, here is a link that explains why dobby.Dobby is required instead of just Dobby when you invoke the command to run your program:

    https://stackoverflow.com/questions/17408769/how-do-i-resolve-classnotfoundexception

    Hello, the gradle toolbar can be found on the right side of the IntelliJ window as shown in the photo below (you can view the gradle panel/toolbar by clicking on the 'gradle' tab:

    Yes, I am using windows. Can you try to click the gradle tab I have circled in your image to see if the gradle tool bar shows up for you? 😃

    Hello, what I did was to create the config/checkstyle directory myself. Afterwards, I proceed to add checkstyle.xml and suppressions.xml obtained from the link given in the Checkstyle tutorial https://github.com/se-edu/addressbook-level3/tree/master/config/checkstyle into the checkstyle directory. The structure of the folders and files is shown below:

    Do remember to install the checkstyle plugin and do the relevant configuration mentioned in "Using Checkstyle" guide.

    This worked for me, let me know if it works for you as well 😃 Not too sure if there is another way to go about solving this issue without manually creating the directories and xml files.

    Hi guys, my team and I are trying to modify the GUI such that a panel will contain multiple sections, each with their own list of information.

    Our target layout will be a header of the section, followed by cards that encapsulate the info we want to display, for multiple sections. Our target is to be able to scroll across the sections but currently we can only scroll within a section.

    We used the stackpane implementation used by the initial GUI, and we got multiple scrollbars on the panel (see right panel on screenshot). Any ideas on how to modify the right panel so that it displays the header, followed by all the cards of the respective section?

    Right now, the hierarchy is in the Scenebuilder screenshot:

    We wrap everything inside a VBox followed by the headers (Labels) and Stackpanes (ListView).

    Because of the different layouts of the cards and headers, we can’t fit everything inside a stackpane, and i don’t think we’re supposed to do that either ._.”

    Current GUI Layout:

    GUI Layout

    SceneBuilder:

    Current Layout

    Hi all, does anyone know how to set up checkstyle properly?

    I'm using the default version for checkstyle defined in build.Gradle (v8.23). I downloaded the config/checkstyle folder from the addressbook repo and when I tried to configure checkstyle, I'm have to initialise config_loc and have the following error. Wasn't really shown in the tutorial so I'm not sure how to go around this.

    Screenshot 2020-08-30 at 12 18 00 AM Screenshot 2020-08-30 at 12 18 27 AM

    I got the same issue but for testing wise I changed from System.err to System.out. I think it might be better because we can track the errors that we are testing as well

    I've tried that too but I still ran into errors. Thanks though!!

    Yup works now, thank you! Would the older version affect our iP?

    Added some basic layouts! Probably would make it responsive to resizing and more styling!

    Screenshot 2020-09-03 at 6 40 36 PM Screenshot 2020-09-03 at 6 40 53 PM

    Adjusted the layout to different orientation

    Hi,

    The iP progress dashboard has not been detecting my branch-A-CodeQuality, even though it is on my remote github. Anyone have any idea on how to resolve this?

    Thank you!

    Hi,

    I got carried away and did the levels of A-JavaDoc, A-CodingStandard, and Level-9 on the Master branch by accident. I committed the changes and push all 3 levels on the master branch before realizing my mistake.

    I have then created the branches separately and checked out the branch.

    Now my git history looks like this:

    Is there any way to revert it or can am I able to leave it as it is? Any advice will be appreciated.

    Thank you!

    Alright got it. Thank you!

    Thanks for the helpful tip!

    Yes I have merged it to the master branch.

    Sorry for the late response, the origin/branch-A-CodeQuality is shown in the screenshot below.

    As for the commits that haven't been pushed, I tried pushing it to my remote branch, the commits as shown in your image will still be present even after I pushed it to my remote branch.

    Hi Prof,

    I just checked and the branch has been detected in the dashboard after my last commit of merging it into master.

    Thank you for your help!

    On codecov, there is a metric called code complexity. What is it, should we be concerned by the percentages and if yes, what can we do to increase the percentages?

    To setup Gradle for my project, I created a build.gradle file and added these into the file:


    plugins {

    id 'java'

    id 'application'

    id 'checkstyle'

    id 'com.github.johnrengelman.shadow' version '5.1.0'

    }



    test {

    useJUnitPlatform()

    }



    dependencies {

    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.4.0'

    testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.4.0'

    }

    These were taken from the Gradle tutorial and the JUnit tutorial.

    Afterwards, I imported the project using scenario 1 as mentioned in the Gradle tutorial and all seemed to work fine.

    However, when I tried to add the annotation @Test and imports org.junit.jupiter.api.Test, org.junit.jupiter.api.Assertions.assertEquals, org.junit.jupiter.api.Assertions.fail, to my test files, I encountered an error and the suggested fix was to add JUnit5.4 to the class path. However, nothing happened after clicking on it.

    I've tried looking at my project settings and under "Libraries", it tells me that the library "Gradle: org.junit.jupiter:junit-jupiter-api:5.4.0" "cannot resolve external dependency org.junit.jupiter:junit-jupiter-api:5.4.0 because no repositories are defined"

    Anyone could help explain how to integrate Gradle and JUnit properly, that would be greatly appreciated.

    Is it possible to do the stretch goal after completing the other levels? How would I tag my commits then?

    I assume you are referring to level 7 and level 8. Please correct me if I'm wrong but I believe you just need to push your branches normally. So just git checkout the branch you want to push and then just git push. This will push the branches to your fork. Then go back to your master, and merge the level 7 and level 8 branch. then you commit the merge and tag afterwards. Once done just push your commits and tags from the master branch.

    Okay thanks Prof!

    Adding


    repositories {

    mavenCentral()

    }

    to the build.gradle file seems to have resolved the issue but I'm not entirely sure what what I was doing the entire time I was integrating Gradle and JUnit.

    I have learnt in CS2030 that classes are better if they are immutable, so I kept all my classes immutable.

    I don't think classes are necessarily "better" if they are immutable. But it's better in the sense that they allow for more control and helps in debugging.

    And so to answer the question:

    Is immutability no longer strictly desirable in higher level programming modules?

    I believe it's still desirable as you want to have greater control over your program flow. So, I think a better question to ask would be "do I want my class to be immutable?" (so as to get the benefits from immutability) rather than does this programming module require/desire immutability for my classes.

    Someone do correct me if my understanding is wrong.

    When we use parallel paths in activity diagrams, does it mean that the corresponding code runs asynchronously or does it just mean that the actions are independent? For e.g let's say there is a method with 3 lines and each of the 3 lines runs the same way regardless of the result of the other 2 lines. However, they are technically executed sequentially in the code. Would it be wrong to represent each of the 3 lines as being done in parallel in the activity diagram?

    I've cloned the tp project onto my machine and imported it into Intellij as per the instructions, however, when I try to run gradlew clean test, it fails and gives the following error:

    I thought it could be a JDK issue, but I've tried reinstalling the JDK, using both OpenJDK 11 and OracleJDK 11.0.8 but the problem still persists. Also the other gradle tasks (checkstyle and coverage) run fine. Running the tests through Intellij works fine as well. Any help would be greatly appreciated!

    While working on removing unused code, I found out that we can get IntelliJ to perform an inspection of your whole project and flag out any unused variable and method declarations!

    Here's how to do it:

    1. Navigate to Analyze > Run Inspection by Name. A small popup should appear.

    2. In the popup, search for and select "Unused declaration"

    1. Choose the inspection scope and options (I left it as it is)

    2. The inspection results should appear like so:

    When you deleted the Level-5 tag, I think you did not delete it from the remote. Went to take a look at your repo and your Level-5 tag commit hash does not match the one that is shown when you did git log Maybe you can try the following:

    1. git tag -d Level-5 - This will delete the Level-5 tag locally

    2. git push origin :refs/tags/Level-5 - This will delete the Level-5 tag on the remote. If that doesn't work, try:

    git push --delete origin Level-5

    1. Create the Level-5 tag at the commit you want again

    2. git push origin refs/tags/Level-5 or git push origin Level-5 - This will push your local Level-5 tag onto the remote

    You can skip 1 and 3 if you are sure there's nothing wrong with your Level-5 tag locally.

    I did some basic styling and made the GUI responsive to changes in window size so the GUI window can be maximised!

    Personally, I would use streams to make use of map, filter and reduce. These functions are well known and quite commonly used in many other programming languages like javascript or python, hence developers who read your code will find them familiar and easy to understand. Furthermore, you can chain them together. For instance, something like:


    list.stream()

    .map(x -&gt; x * 2)

    .filter(x -&gt; x < 1000)

    .reduce(0, (a,b) -&gt; a + b)

    Imo this is very concise, one look and you will know what the intended result is. Doing this without streams, you will need a for loop, some if statements, another variable to keep track of the sum and i think it'll generally be a little harder to understand.

    However, if the logic starts become too complicated to be succinctly expressed in terms of chaining the lambda expressions, then yea I do agree that perhaps it'll be clearer not to use streams.

    I think I found the issue. The issue was with the jacoco plugin: I think it was by default using a version that is incompatible with jdk 11. Adding the following into build.gradle to specify the latest version of jacoco solved the problem.


    jacoco {

    toolVersion = "0.8.5"

    }

    Is there a default value if the multiplicity isn't specified for an association in a class diagram? Or is it just no limit which is like *?

    I believe I made a fast forward merge for branch-Level-7 instead, by accident. Is it okay to leave it like that or is there any way to revert the merge? Thanks!

    Ok, will take note! Thanks prof!

    Not sure if you solved it yet but I encountered the same problem and solved it by going to Run > Edit Configurations and changing VM options to -Dfile.encoding=UTF-8

    Found this thread really informative and useful to get ideas!! heres my updated GUI:

    Thank you!!

    @ktaekwon000 I modified the version string before and its true, the version string reverts back after every update in the scene builder. It wasnt a very ideal solution, so thanks for sharing your method, i think ill use that instead!

    截屏2020-10-14 下午2 56 23

    Gradle for tP is not working and the error reported is shown in the screenshot

    Thanks in advance!

    Hi guys! I checked on the ip progress board yesterday and found that all the tasks suddenly got marked as overdue and not done yet.

    B39E85B3-A611-4A1C-82AE-67F8BC3CA23B

    It seems to be that the script can not pull my repo due to some extra files. However, these files are automatically downloaded when I was building Gradle.

    Does anyone have the same issue? Thanks a lot in advance!

    Hi guys!

    I forgot to create a new branch and did the level 8 implementations as well as A-More-OOP on the master branch. I couldn't really remember the exact steps I took but apparently I must have done something wrongly. I'm currently having trouble both pushing or pulling

    The branches now look like this

    09011764-8F2E-4CF9-829C-386EBB9D962C

    Can anyone enlighten me how to resolve the problem? Lot of thanks in advance!

    @yyutong IIRC, this problem got resolved around that time, so I didn't bother to reply here. But you mentioned you are facing a new problem now. Can you give the details?

    Yes sure!

    When I was trying to merge the GUI branch which is branch level 10 to my master brunch, the error below occurs.

    If the problem can not be resolved, can I just redo the GUI in my master branch?

    WeChatf52c0dabb71d5ae2ddf91bb301e2b3d7

    The rogue files are in the first commit of your gui branch.

    I suggest the following (I tried on a clone of your repo and seems to work).

    1. Switch to the gui branch
    1. Reset the branch to the start but do a mixed (not hard) reset so that your code is not lost. At this point the branch will have no commits but you'll still have all the changes. The rogue files will not appear among the changed files as they are ignored by the .gitignore file
    1. Stage all the changes and commit. Now you should have only one commit in the branch.
    1. Switch to the master branch
    1. Merge the gui branch to the master -- there will be conflicts; resolve, stage, and complete the merge.
    1. Push master branch to the fork
    1. Force-push the gui branch to the fork

    Hi Prof,

    for the second step, do you mean resst the gui branch to the first commit of the gui branch?

    @yyutong which country are you in at the moment?

    @damithc I am currently in China now.

    While waiting for a solution, you can temporarily remove the shadow plugin from gradle as you only need it when creating a JAR file.

    @damithc Thank you prof! I removed the shadowJar part from gradle and it works now!

    When I end my program, I get this error:

    Screenshot 2020-09-18 at 4 51 02 PM

    This error does not affect my program in any way but it would be much appreciated if anyone knows how to fix this.

    Thank you very much.

    Does anyone encounter this issue when running their application. When I went online to find out what this error means, it says that "Crash on focus loss from dialog on macOS 10.14 Mojave". I would really appreciate it if someone could help me out with this issue. The image below shows the full description of the error displayed when the application is running:

    Screenshot 2020-09-16 at 10 23 15 PM

    I am currently attempting the A-Streams increment for iP and I have encountered various instances when I am uncertain on whether I should keep my existing code or change it to utilise streams. This dilemma stems from the fact that the textbook says that we should practice "Keep it simple, stupid" and when I change my code to use streams, it looks more complicated for another reader to understand what is going on. So my question is, is there any guidelines that we can refer to so that we can use streams appropriately and not overuse it?

    Added a bit of background styling to the dialog container as well the dialog itself

    Screenshot 2020-09-02 at 1 00 20 AM

    I think Java assert cannot be used as a form of unit testing because it just checks that the assumption at a certain point in code is correct. It does not verify that the logic of code you have written is entirely correct. Because if your assumption is incorrect then the assertion will be incorrect. Java assert is also used mainly for debugging and improving your code quality.

    This is why I think that using java assert is not the best for unit testing. I may be wrong on this but this is my take on why java assert should not be used as a form of unit testing but more so to make sure your assumptions at a certain point in your code is correct.

    I tried to update the javafx version in my build.gradle file to 11.0.2 but I still face the same error.

    Thank you so much that worked.

    For a sequence diagram in DG, if depending on the situation, a method may be called once only or for multiple times, it is okay to draw the diagram as if the method is called only once and state the assumption that this diagram assumes the method is called once?

    Thank you!

    May I ask for commands that does not have additional parameters, for example, help command in AB3, is there a reason behind the handling of extra parameters in AB3? For instance, help 1 will give the same outcome as help.

    Hi, may I ask if anyone has encounter this warning: "Java has been detached already, but someone is still trying to use it at -[GlassViewDelegate dealloc]:/Users/jenkins/workspace/OpenJFX11-mac/modules/javafx.graphics/src/main/native-glass/mac/GlassViewDelegate.m:198"?

    This warning is there when I try to exit from GUI using &gt;Platform.exit> when the response of Duke is an exit response. I searched online but did not find good solutions for this.

    To add on, "compare with Clipboard" is helpful to check where the missing empty spaces are.

    I am not sure if my interpretation is correct, but if you would like to put the image in GUI, maybe you can move it to resources/images?

    Noted, thank you so much!

    Noted, thank you so much!

    I am facing issues using the Plantuml in Itellij.

    I have reinstalled the plugin / Graphviz multiple times but it still does not work.

    set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

    I am using this but have an issue:

    _Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

    java.lang.UnsupportedClassVersionError: Duke has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0_

    I am currently using JDK 11 as required

    I am currently using JDK 11 as required

    The batch file does not follow Intellij settings. It will take the JDK that is in the path variable (if on Windows).

    Actually the java version in my system (environment variable) is jdk11.0.5 and I'm using that for intelliJ also. Cannot figure out whats wrong 😦

    If it turns out the terminal is using Java 8, try uninstalling it entirely. Java 8 is stickier than other versions of Java.

    Thanks prof, it's finally fixed! Seems that I have some remaining JDK8 pieces on my computer

    I had this error as well.

    Alternatively.

    If you check your javac -version it will be JDK11, but if you check your java -version it is likely not 11.

    You can change your java runtime environment to the required environment it should then work.

    Thanks for your help! I have solved it by uninstalling Java 8 entirely.

    Hi, I faced the same problem and if I recall correctly I solved it by downloading and using the 32-bit version of graphviz. The result of running dot -v on my computer gives this:

    dot - graphviz version 2.44.1 (20200629.0800)

    Thanks for the reply but this does not work for me.

    I solved this by downloading the zip version and manually set environment variables.

    https://www2.graphviz.org/Packages/stable/windows/10/msbuild/Release/Win32/

    Hi,

    I encounter this "file not found" error when running jar file, however the storage function has no problem when building in IntelliJ, and other functions are also ok when running jar.

    Hi prof, TAs and classmates,

    I encounter the error "JavaFX runtime components are missing, and are required to run this application" while running Duke.main(), (Duke is my main class), however when running Launcher.main(), the gui is shown properly and the functionality is ok.

    Hi prof, TAs and classmates,

    I encounter this problem when doing text-ui-testing, I'm not sure how should I modify the script to make it run?

    Hi Prof, TA and classmates

    I encounter this problem in project set up: after importing the cloned ip in IntelliJ, the run button is disabled. I strictly follow the instruction but there is no "Run Duke.main()" option when right click as step 4 stated.

    As you are on Windows, shouldn't yo be using a .bat file, not a .sh file?

    You can check out a few batch files used by other class mates from the RepoSense dashboard.

    I tried to run .bat file but it closes immediately after i open it.

    Thanks very much! It's solved after I add code to handle this case.

    After following the tutorial for gradle, I tried using the launcher class to run my code but it throws an error saying class file javafx.event.EventTarget not found. This error is at stage.setScene(scene) on line 38 as well as stage,show() on line 39.


    import javafx.application.Application;

    import javafx.scene.Scene;

    import javafx.scene.control.Label;

    import javafx.stage.Stage;



    /**

    * Initializes the chatbot and starts up the UI to take in user input

    */

    public class Duke extends Application {

    /**

    * ui refers to the User Interface object which will be used to accept user input

    */

    private UI ui;



    /**

    * Uses the filepath to intiialize the storage and hence, the UI object

    * @param filePath

    */

    public Duke(String filePath) {

    Storage storage = new Storage(filePath);

    this.ui = new UI(storage);

    }



    /**

    * Looks for user input using the UI object

    */

    public void run() {

    ui.welcome();

    ui.run();

    ui.escape();

    }



    @Override

    public void start(Stage stage) {

    Label helloWorld = new Label("Hello World!"); // Creating a new Label control

    Scene scene = new Scene(helloWorld); // Setting the scene to be our Label



    stage.setScene(scene); // ERROR - cannot access javafx.event.EventTarget

    stage.show();

    }



    public static void main(String[] args) {

    new Duke("Data/duke.txt").run();

    }

    }



    💡 You can use Markdown to format your text

    After following the tutorial given on the website, I am unable to run Duke using gradle because of this error - Could not find or load main class seedu.duke.Duke

    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 = "

    @ECHO OFF



    SET MY_PATH="my_file_location"



    REM create bin directory if it doesn't exist

    if not exist "%MY_PATH%\bin" mkdir "%MY_PATH%\bin"



    REM delete output from previous run

    del ACTUAL.TXT



    REM compile the code into the bin folder

    javac -cp "%MY_PATH%\src\main\java" -Xlint:none -d "%MY_PATH%\bin" "%MY_PATH%\src\main\java\Duke.java"

    IF ERRORLEVEL 1 (

    echo ********** BUILD FAILURE **********

    exit /b 1

    )

    REM no error here, errorlevel == 0



    REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT

    java -classpath "%MY_PATH%\bin" Duke < input.txt > ACTUAL.TXT



    REM compare the output to the expected output

    FC ACTUAL.TXT EXPECTED.TXT"

    💡 You can use Markdown to format your text

    Regarding this line:

    SET MY_PATH="my_file_location"

    Did you encase your location path in double quotes (")? If you did, try removing the double quotes.

    i.e. Suppose my path is something like C:\Users\blah\CS2103\ip. Then that line would be:

    SET MY_PATH=C:\Users\blah\CS2103\ip

    The former (I just tried) gave me a similar error in your post while the latter worked just fine.

    Regarding this line:

    SET MY_PATH="my_file_location"

    Did you encase your location path in double quotes (")? If you did, try removing the double quotes.

    i.e. Suppose my path is something like C:\Users\blah\CS2103\ip. Then that line would be:

    SET MY_PATH=C:\Users\blah\CS2103\ip

    The former (I just tried) gave me a similar error in your post while the latter worked just fine.

    Removing the quotation marks made the program run. Thanks sooo much!!!

    just to check do u have doublequotes surrounding these lines:

    "%MY_PATH%\bin"

    I also have the same problem even if i removed the doublequotes regarding the SET_MY_PATH line

    Yup I have quotation marks around them

    In the build.gradle file (should be in your root folder), I think you will need to make the following change:

    Change the class name according to your main class name (and package).

    Hope this helps!

    Thanks a lot!!!

    I remember that last week when I checked the tp dashboard the "assertions" tag has been marked as done. While now as I check the dashboard, it says overdue. I did use a few assertions in last week's commits which have been merged into master last week.

    May I check why this happened? My GitHub name is zhXchD, student number is A0194512H and my Git author name is Zhu Xiaochen &gt;zhuxiaochen1005@gmail.com>.

    I have updated my user guide and released the .jar file, and A-UserGuide can be deteced on the iP progress dashboard. However, Published UG and JAR released are not detected.

    May I ask whether I did something wrong when publishing the page (rooted at /docs and can be checked here) or releasing the .jar (released here), or the detection script has not updated (but my increments have been detected)?

    Screen Shot 2020-09-14 at 5 17 30 PM

    Perhaps you uploaded this after the dashboard was updated? Let me know if still not detected after the next update (which will happen before this time tomorrow)

    They have been detected today and I will be closing this issue.

    You may want to have a look at this commit, which was committed by me 7 days ago, at here. I think I included assertions in this commit.

    We go by what's shown in the cod dashboard. Check if any asserts are included in the code that is shown as your code in the code dashboard.

    I just checked the reposense code dashboard. I found the commit (named Add assertions, on 2020-10-20, can check at here). This is the commit I mentioned in the previous comment. The screenshot is shown below

    Screen Shot 2020-10-27 at 10 29 43

    Inside this commit, you can find there are assert() used in my code.

    It doesn't matter if the commit is detected as past commits can be overwritten by later commits. What matters is the code view which shows the final state of the code. Check if those lines are shown under your name in the code view (click on the </> icon to see the code view)

    I checked the code and it shows something like this.

    Screen Shot 2020-10-27 at 10 40 58

    Only the assert() lines are not highlighted as green, does this mean that the assertions are not detected as my code? I think it is because that someone else in the group make changes after I wrote the code because last week this item was detected as done but not this week. If I use the author tags to indicate these lines are actually my code, will the system detect this and mark this item as done (it is now marked as overdue)? Thanks prof!

    Hello guys, I have a quick question.

    If reviewing PR, and the code has multiples of the same mistake (eg. wrong indent for multiple files), do we flag every single mistake, or just flag one? I'm thinking that if you flag every mistake, it will just make the other member angry at why you are focusing on such minor mistakes.

    Any thoughts on this?

    So for each coding violation that is the same, I should just write "I noticed this issue as well"? It seems like it will clog the comments section.

    Ok thanks, so I just wite that line.

    Where did you read the part that methods must be less than 30LOC? I think I missed that part

    I got something similar, when I right click the red import and chose the fix issues by intellij somehow it was fixed

    This is mine without tweaks 😦 looks so bad compared to some of the ones here

    Group: CS2103T-T17-1

    Issue:

    Our code coverage is average~80%, but on codecov it is not reflecting coverage in our Ui components, currrently showing 67%.. Need some help!

    My team: T17-1

    Our team had release our v1.3 trial last week(week 10) and it passed the checklist on the tP dashboard in week 10. This week, however, the v1.3 trial released failed, v1.3 release passed instead. Not sure what happened there, help or clarification would be appreciated!

    Yup i think we replaced a new one afterwards for our own downloads. Did not know that is not allow!

    Is there any way to resolve this, we did not know updating the release will fail the check.

    Alright i see, thank you!

    alright thank you!

    On the left was the output on screen from running using IntelliJ IDEA, whereas on the right was the output on screen using gradle. Even though trivial, is there a way to correctly display the tick/cross on the screen?

    I've tried the solutions from stackoverflow answers here (which modifies the build.gradle) but to no avail: https://stackoverflow.com/questions/21267234/show-utf-8-text-properly-in-gradle

    This is a old problem that I'm facing, after repackaging my classes into their respective packages, I could not use runtest.bat anymore. I will attach some screenshots below!

    Try using javac -cp ..\src\main\java\ -Xlint:none -d ..\bin ..\src\main\java\*.java with the -cp flag changed to ..\src\main\java\

    Omg worked like a charm, how did packaging change the classpath?

    I've tried the following method from this issue but doesn't solve the problem for me: https://github.com/nus-cs2103-AY2021S1/forum/issues/95

    Run > Edit Configuration (Duke) > VM options: -Dfile.encoding=UTF-8

    Adding

    systemProperty "file.encoding", "utf-8"

    to both my run{ ... } and test{ ... } helped me solve the problem, thank you!

    I've updated my GUI to have better aesthetics! (rounded corners, borners etc) Big thank you to other contributors!

    When I try to PRs, I found that my JAVA CI fail and I go on to investigate the error, the error messages show some line got " no newline at EOF" and some line got " trailing whitespace"

    Any one knows what the messages mean and how to resolve them?

    Thanks!

    Not sure whether anyone have the similar issue of unable to generate jar from IntelliJ (like what we did previously) or generate the jar using Gradle but encounter "no manifest attribute error"

    I had this issue yesterday and it took me 2 hours to debug

    let me share a useful Youtube Video first: https://www.youtube.com/watch?v=BwdkyrnJQsg&t=194s

    I follows the steps shown in the video and add in jar {xxxx} in my build.gradle as shown in the video

    Then I run the following command in the terminal: ./gradlew clean build

    the Jar file should be available in build/lib folder

    Then you can run the jar in the terminal using the following command: java -jar [your jar address]

    Take note, there are two jar files and choose the correct one, most people might be duke.jar (I guess) ?

    Anyway you can trial and error to see which jar is the correct one

    Hope it helps

    Yes, the tip is very insufficient.

    I encountered this and debug for 2 hours yesterday

    Use this command on terminal ./gradlew clean build

    To run the programme, you need to locate the folder, then use this command java -jar [your jar address]

    Useful Youtube video https://www.youtube.com/watch?v=BwdkyrnJQsg

    Hope it helps

    I've taken a few examples out of your failing CI:

    ERROR:../src/main/java/seedu/address/logic/commands/RemarkCommand.java:98: no newline at EOF.

    This means that your RemarkCommand.java file does not have a newline at the end of file. To resolve this, simply add an empty line at the bottom of the file.

    ERROR:../src/main/java/seedu/address/model/person/Person.java:54: trailing whitespace.

    This means that at line 54 of your Person.java file, you have extra whitespace. To resolve this, delete off the additional whitespace at the end of the line. You can see the additional whitespace if you select it.

    Thanks for the reply! I manage to solve the "no newline at EOF" error but " trailing whitespace" still exists despite I delete the whitespace at the end of the line. May I know how should I properly delete the whitespace?

    To automatically strip trailing white space in intellij, you can go to settings -&gt; editor -&gt; general, then scroll to other and change strip trailing white space on save to all

    Thanks! This one helps ! 👍

    Thanks for the reply! I manage to solve the "no newline at EOF" error but " trailing whitespace" still exists despite I delete the whitespace at the end of the line. May I know how should I properly delete the whitespace?

    In case the problem is in multiple places, check carefully that you have deleted trailing whitespaces in all locations reported by CI.

    Yup, some parts I did not check carefully 😦

    Now resolved already, thanks! 😃

    Hi guys, this is what I encountered:

    I've done some research online and it might be related to some missing graphic library, but I have no idea where to start.

    The solutions I found online are mostly related to JVM options and libraries, not sure what to do with my code D:

    Hi, I have some concerns about my level-5/6 not being found though I've pushed the local repo with the completed iP on 18 Aug(the dashboard says last updated 19 Aug). Is there anything I can do to fix this or I can only wait for the next dashboard update?

    ...and how heavy is the penalty if there's late submission?(just in case)

    Here are some screenshots fyi:

    Thanks!

    Problem solved.

    The actual issue is that I can't push the detached HEAD without actually merging so I thought I pushed those commits but actually didn't, I'm a beginner to git/sourcetree so didn't know this. xD

    May I know if javaFX runtime/lib is installed during the Linux smoke test? It seems like it requires .so files for javaFX programs.

    I had this problem because when I was refering to filepaths in my program, I used the full filepath(D://joven//UNI//CS2103... ) for the storage(and even in the javafx libraries to select an image).

    So I solved it by changing the name to a generic filepath.

    Im not sure did this solve the problem on linux since I do not have linux to test my program on, but on a fresh mac and windows, it did work.

    Seems like my problem is different from yours. I've checked file paths and they are all relative paths. 😦

    Problem solved. The issue is the version of openjfx.

    @GilbertTan19 , hi can I ask how did you manage to solve that issue?

    Try going to the Gradle toolbar and under the build option double click everything. Not sure which was the specific one that solved it for me 😅

    Hi! I cannot find the build option in the Gradle toolbar you are referring to. Could you provide a ss? I am having the same error of "JavaFX runtime components are missing, and are required to run this application". Thx in advance.

    Try all the build options and clean as well

    @RuiFengg hmm oh no doesn't seem to work for me .-.

    Okay, sorry, I realised I had to either change the main class in the build gradle file.

    Hi I am facing the same issue. Can you describe how do you do it? Thanks in advance.

    Try all the build options and clean as well

    @RuiFengg hmm oh no doesn't seem to work for me .-.

    Do you still get the same "JavaFX runtime components are missing" error?

    yeap sadly. only when running Duke

    Try all the build options and clean as well

    @RuiFengg hmm oh no doesn't seem to work for me .-.

    Do you still get the same "JavaFX runtime components are missing" error?

    yeap sadly. only when running Duke

    I ran mine with launcher instead of Duke shown in the ss I sent beside the green play button. If that doesn't work I'm not really sure how to fix it 😅

    it's ok! thanks for the help. appreciated 👍🏻

    I got this error when I try to build gradle:

    Image_2

    I tried to run gradlew assembleDebug as suggested by one of the previously closed issues, but got the following message:

    Image_1

    May I please seek some help on how to fix this?

    Really appreciated!

    Hi. I thought shadow is one of the important plugins needed in Duke. In this case, can I just remove the mention?

    Thanks!

    Hi. Thanks for the reply!

    My build gradle looks like this:

    1 2

    Attached is the output I got when running with stacktrace.

    output when running with stacktrace.txt

    Thank again for the help!

    Hi. Thanks for the suggestion! The same error still pops up after adding in that:(

    Hi, I haven't solved my problem here. I will update later if I managed to solve it.

    Hi, gradle was build successfully after I deleted the entire directory at C:/Users/username/.gradle and restart the whole process. While this is a weird solution, do try and see if it works!

    Hi Prof @damithc,

    Where can we find answers to the mock exam?

    Thank you in advance.

    Having read up some online forums, I noticed that there is a divide between programmers supporting the use of assertions in parameter checking and those that are against it. That said, where are the best uses of assertions?

    Level 7 says:

    Save the tasks in the hard disk automatically whenever the task list changes.

    Can I check if if we need to write to the hard disk whenever there is a change to the task list? I was thinking writing to the hard disk after the user inputs "bye" would be more efficient.

    Alright thank you Prof! That made a lot of sense.

    I noticed for array the checkstyle insists on 4 indents. Does anyone know what is the configuration for Intellij to support 4 indents for array and 8 indents for wrapped lines?

    @aidoxe-123 That would make the indentation for wrapped lines 4 too though :x

    Three amigos: in the future, we can use UML to generate code

    2020: we need to learn PlantUML code to generate UML diagrams

    Suppose there is a Class Toy and there subclasses BigToy, MediumToy and SmallToy. All toys have to be either Big, Medium, or Small. There is a static Factory method createToy in Toy that returns an object of the respective subclass depending on the arguments passed to it. Pseudocode:


    class Toy {

    Toy createToy(identifier) {

    switch (identifier) {

    case BIG: return new BigToy();

    case MEDIUM: return new MediumToy();

    case SMALL: return new SmallToy();

    default: throw exception;

    }

    }

    }

    This solution to dynamically return a subclass in a factory method, albeit working, is in clear violation of the Open-Closed Principle as there is need to modify/change the factory every time a new Sub-Class is created. Is there a better, more-dynamic solution to the problem of returning the appropriate sub-class object in the super-class factory method?

    One solution I can think of is to have a "map" of the identifier to the subclasses and modify that. However, I am unsure as to how the value of this "map" can be made to create an object. Something like: return new map[identifier];. Is this solution a valid approach or does it fall prey to the Open-Closed Principle also?

    I would like to ask exactly how much freedom do we have with respect to the Individual Project. Is it only limited to the appearance level? Or do we have some freedoms with respect to the actual functionality of the chatbot? For example, let's say that the user enters the command: todo finish ip /by Thursday 2359. Should we interpret it as the description is "finish ip /by Thursday 2359" (which is what the current documentation on the website implies)? Or are we allowed to customize it in such a way that it throws an exception as there is an additional parameter?

    @halcon-blanco Thanks a lot! This works perfectly in the context of the iP!

    Mine is just a visual increment too!

    p

    I think this warning is caused when you use scene builder to edit the fxml. I was able to clear this warning by changing the xml namespace of the root elements in the FXML files to this xmlns="http://javafx.com/javafx/11.0.0".

    Hi ,

    I am having a strange problem relating the debugger function. I followed the Tutorial : Tracing Code and everything was smooth until I ran debug.main.

    I started by Edit Configuration and I changed the Program arguments as shown:

    Screenshot 2020-09-28 at 6 12 45 PM Screenshot 2020-09-28 at 6 13 02 PM

    Then , I clicked Debug button.

    I can see the GUI pops up:

    Screenshot 2020-09-28 at 6 07 33 PM

    However, when I go back to check the debugger, it is empty (i.e. Not showing any variable/ steps) and the STEP IN buttons and other buttons are also grey, as shown below:

    Screenshot 2020-09-28 at 6 16 00 PM

    Please may I ask, what might be causing this issue ? I am really confused as this moment.

    Thank you in advance for your help.

    Hi everyone

    I discovered today that my tags' naming was not right and thus the issue tracker didnot catch my commits for all levels. Therefore I edited my tags today, may I know if this change can be captured in time ? Also, may I ask if the catching of the tag names is case-sensitive ? As I have name some level using small letters and for git, it is the same (NOT case sensitive).

    Thank you for your help !

    Noted, thank you Prof Damithc !

    @Raymond0212 Hi friend, I found out to update the tag letter cases, we need to $ git push origin :refs/tags/level-1 to delete the original lower case tag and then $git push --tags to push our new local tags (Suppose you alr have Level-1 tag locally).

    Hope this helps!

    Thanks to everyone who has taken time to read this issue, I have managed to resolve it with trial and error.

    Basically, I resolved this problem of unable to use buttons like STEP IN by changing the way of running the debugger. So, this is a workable route for me :

    1. Set a break point as usual.

    2. Instead of using the top menu Run > Debug, use Gradle at the right side bar to run Debug 'tp[run]'.

    Screenshot 2020-09-28 at 10 09 00 PM

    Then pass in the argument of 'edit 1 n/Alice Yeoh' through the GUI.

    Now go back to the debugger and all steps and variables are shown correctly.

    Screenshot 2020-09-28 at 10 13 01 PM

    Furthermore, after one single run with Gradle, the top bar menu is updated to be the same as what is present in the side bar containing Gradle. From this observation, I suspect the initial problem I encountered is caused by the design of cache of intelliJ, i.e. the project is not properly imported from Gradle and some cache information which should be changed are not changed. However, this is just a very rough feeling in my guts and I have no evidence to support it. (I think I am the only person, but ) if anyone by any change faced the same problem as me, try File > Invalidate Cache/Restart and use Gradle to run the debugger.

    Not an answer but I don't think you can use the program arguments property like that. I think it's meant for applications that take arguments when you run the main program. e.g., java HelloWorld arg1 arg2

    ^

    Noted, thank you Prof Damithc for the information !

    The test cases for my PR are passing on my local machine and also on the machines of other teammates but it is not passing in the CI checks on github. How do I go about with this? I don't know how to debug this because the test cases are all passing as it should be.

    This is the link to my github PR for reference:

    https://github.com/AY2021S1-CS2103-F10-1/tp/pull/148

    Let me know if additional information is needed.

    Yes Prof. I know which exact tests are failing and they are failing on Mac OS and Unix OS. The windows OS check was cancelled because the other two OS failed their checks.

    I just asked my other teammate running a mac to do the tests. And the tests fail on his machine. May I know what the cause of this is? Why can the tests pass on one OS but not another?

    Alright thanks Prof. We managed to fixed the issue. I'm just intrigued why the test cases give different results on different OS because our issue was not with the file path.

    I will close this issue for now.

    It was the use of one of our testUtil classes. One of the test cases added into the new PR modified the testUtil variables which caused the failure of 2 other tests. Though I'm not sure why it only fails in an OS other than Windows.

    Hi, for the Automated Text UI Testing for IP week 2, we are required to replace the classpath for the .bat file(on Windows)

    From the guide, it mentioned:

    Update the javac and java commands in the script to match the name/location of your main class.

    If you are using packages, the two commands need to take the packages into account too.

    However, im not sure what javac and java commands that we would have to change. What I did was to change the locations after the ..\bin command to the directory of my java files. But everytime I ran the .bat file, a command prompt window opens and quickly closes. There is no ACTUAL.txt in the same directory as well.

    Thanks for helping 😄


    @ECHO OFF



    REM create bin directory if it doesn't exist

    if not exist ..\bin mkdir ..\bin



    REM delete output from previous run

    del ACTUAL.TXT



    REM compile the code into the bin folder

    javac -cp ..\src -Xlint:none -d ..\bin ..D:\24092014\Joven\UNI STUFF\CS2103\IP\src\main\java\Duke.java

    IF ERRORLEVEL 1 (

    echo ********** BUILD FAILURE **********

    exit /b 1

    )

    REM no error here, errorlevel == 0



    REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT

    java -classpath ..\bin D:\24092014\Joven\UNI STUFF\CS2103\IP\src\main\java\Duke < input.txt > ACTUAL.TXT



    REM compare the output to the expected output

    FC ACTUAL.TXT EXPECTED.TXT

    First issue regarding the cmd window closing:

    Try putting a PAUSE command at the end of the script, so something like:

    Second issue regarding the .bat not working properly:

    I'm not sure where your respective directories are but here's what you should be inputting for each command javac and java:

    javac -cp <your_source_code_directory> Xlint:none -d <destination_directory> <file(s)_to_compile>

    -cp <your_source_code_directory>: (classpath) your .java files should be in this specified directory.

    -d <destination_directory>: (destination directory) where your .java files will end up in after compilation (as .class files).

    java -classpath <your_source_code_directory> <file_to_run> < input.txt > ACTUAL.TXT

    classpath <your_source_code_directory>: note this should match the directory where your .class files ended up after compilation.

    As a reference here is what my .bat file looks like atm:

    Hope this helps!

    Edit: fixed typo

    Thanks so much, but right now I realised that I have multiple java files since I have more than 1 class,

    So what I did was to just to repeat the javac statement multiple times.

    I.e


    REM compile the code into the bin folder

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Task.java

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\ToDo.java

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Deadline.java

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\EventTask.java

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Duke.java

    But it is still treated as if Task.java is not compiled, resulting in an error when ToDo tries to extend from Task.java but is unable to find Task.java

    May I ask please ask how to then compile multiple java files?

    Thanks!

    You can try the following:

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java*.java

    But iirc if you compile your top-level class first (in terms of dependencies) every other relevant class should be compiled as well. Hence why calling javac on just Duke.java works for me

    THANKS so much it worked:D

    hey there i also having a similar problem now. I have checked my file paths and it seems to be correct. The window also appears. The error comes when i am type an input and press enter. Anyone has a solution to this?

    Screenshot 2020-08-31 at 3 11 37 PM

    Hi, if you packaged your duke class, perhaps you want to try going to your fx:controller="MainWindow" in the fxml file and changing it to duke.MainWindow?

    I had this problem because when I was refering to filepaths in my program, I used the full filepath(D://joven//UNI//CS2103... ) for the storage(and even in the javafx libraries to select an image).

    So I solved it by changing the name to a generic filepath.

    Im not sure did this solve the problem on linux since I do not have linux to test my program on, but on a fresh mac and windows, it did work.

    I have retried, but CATcher still "Unable to verify CATcher's version".

    I cloned tp onto my computer and imported it into IntelliJ, then it told me "tp failed: Data error (cyclic redundancy check)"

    The screenshot is below, sorry that my system language is Chinese, the Chinese characters mean "Data error (cyclic redundancy check)"

    I tried to re-clone the repo and reinstall IntelliJ, the problem still exists.

    This example is shown in W4.2b, however, wouldn't this result in a cyclic dependency?

    There has been a similar discussion in issue #100, please refer to the reply by Prof

    thank you, I'll close this question!

    thank you prof! I retried just now and the problem was resolved!

    I have set up all the files for stage 4 of javafx tutorial however, when i am running the code i run into the following error. I have made sure the images are in the correct path. How do i go about fixing this?

    Screenshot 2020-09-01 at 12 43 13 AM

    I have been getting this error when i tried run graddle. How do i go about fixing this. I have merged the branches properly and deleted the .idea file before doing this step

    Thank you works now

    hey there i also having a similar problem now. I have checked my file paths and it seems to be correct. The window also appears. The error comes when i am type an input and press enter. Anyone has a solution to this?

    Screenshot 2020-08-31 at 3 11 37 PM

    yup i did not change anything from the website

    As I am switching to gradle and use FXML, I encountered this problem.

    Screenshot 2020-09-01 at 20 11 52

    I mark my src folder as source root and following the naming convention by naming my package as "package main.java.commands;" However, it gives me Package name 'main.java.commands' does not correspond to the file path 'commands' error. The quick fix suggest me to use "package commands;" directly. Is this the appropriate way to do it?

    Screenshot 2020-08-31 at 17 17 38

    solved: unmark main as module

    Screenshot 2020-09-01 at 20 44 33

    It also gives a new error now.

    The source error was due to the missing resources folder in main

    I'll also have to find a way to create a file with my code if there isn't any file right?

    https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html#createNewFile()

    https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html#exists()

    https://stackoverflow.com/questions/9620683/java-fileoutputstream-create-file-if-not-exists

    Some of the information here might be useful to you.

    I would like to add on to mention that you can also "prevent" the instantiation of such a class by declaring a private (inaccessible) constructor. e.g. private Parser() {}

    Perhaps you could check your project structure? (ctrl+alt+shift+S)

    Under Project Settings > Project check that the Project SDK and language level is still correct.

    https://github.com/Criss-Wang/ip/blob/master/src/main/java/META-INF/MANIFEST.MF

    If your main class has changed, you might need to change the manifest so that the JAR can find the correct main method.

    Oh okay, so the quiz bonus deadline is also pushed to 28 September?

    Yes, all deadlines basically "pause" for 7 days during Recess Week.

    Hi everyone, I'm not sure how to ensure the search bar can be seen after scaling the window down. Any tips or tricks?

    I also encountered this when I ran my bat file. For me it was because I had both java 8 and java 11 in my environment variable paths 😕 I removed the java 8 environment path, and it worked.

    My method is:

    Add something like this to your CSS file.

    Then

    Add this to your MainWindow.fxml

    Hope this helps!

    Hi and thanks so much for the fast reply. But now I am facing another issue.

    Now when I extend the window, the send button doesn't move with the text box.

    Oh thank you so much! It works now

    If you are running Windows 10, you can make use of a new Windows feature called Windows Sandbox.

    "Windows Sandbox provides a lightweight desktop environment to safely run applications in isolation. Software installed inside the Windows Sandbox environment remains "sandboxed" and runs separately from the host machine." - From https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-overview#:~:text=Windows Sandbox provides a lightweight,and the state are deleted.

    If you do not know which version of Windows 10 you have, you can check by going into Settings -> Update & Security -> OS build info (on the right, under related links), then scroll down. You should see something like this:

    (If you are running the Home edition, follow this link:

    https://www.tenforums.com/tutorials/131437-enable-windows-sandbox-feature-windows-10-home-edition.html)

    If you are running Pro edition, it's even easier! First, follow the guide below to add Windows Sandbox.

    https://www.windowscentral.com/how-use-windows-sandbox-windows-10-may-2019-update#:~:text=Inside the Windows Sandbox experience,application files using Microsoft Edge.

    After you are done setting up, proceed to install Java SE 11 inside of Windows Sandbox.

    After you are done installing, to transfer your .jar file from your main windows to Windows Sandbox, simply right click and copy (in your main Windows), then right-click and paste (in Windows Sandbox).

    Try running your .jar file by double-clicking on it. If all works well, you should see your application running inside!

    This way, you can isolate any Java issues you have on your main Windows, and try it on a fresh copy of Windows.

    Remember to change your mainClassName in build.gradle!

    Chances are that if you follow the JavaFx Tutorial, you would use a "Launcher" class instead.

    Hence, if your .jar does not open, try changing from "Duke" to "Launcher".

    Hi guys,

    The respective ✓ and ✘ shows up as an empty "?" box in the command line. (Tried using Window's CMD and WSL Bash)

    Running my ip project in IntelliJ works perfectly fine though.

    I've tried googling for solutions, such as changing all my file encoding to UTF-8. But it seems to still not work. 😦

    Thank you for your attention. 😃

    Thanks for the help 😃

    Turns out its the console font issue, and using Windows Terminal solves it!

    Sorry, I realized that another user has posted a similar tip!

    Hi, I plan to set up Gradle for my iP, but I have no idea if it is already installed and if it is not I'm rather confused on how to install it. My question is by default which scenario applies to us?

    Is it scenario 3? I remember seeing "added gradle support" in a previous commit from the repo, does that mean anything?

    Any help is appreciated!

    Assuming you have been doing the project on Intellij, then like (me and many others) yours should fall under Scenario 2!

    As per the instructions in A-Gradle, merge the branch that "added gradle support" into your current master branch and follow the instructions in Scenario 2 from there.

    I managed to merge it, thank you so much for the help!

    Hi I'm facing the same exact issue, do update if you find any solutions, thanks!

    Hi! I had the same problem as well! The error only went away after I added the suppression.xml file.

    Hi sorry, where do you add this? @zhengweii

    @zhengweii Got it! It works now thank you!

    Screenshot 2020-11-06 at 10 29 06 AM

    As you can see on the right part of the ui, it is able to scroll horizontally but not vertically.

    Screenshot 2020-11-06 at 10 31 35 AM

    In scene builder, I put the scroll pane in a VBox.

    Screenshot 2020-11-06 at 10 31 47 AM

    For the component named projectDashboard which I want it to be scrollable is placed in the scrollable pane.

    I don't see why the stack pane is still not scrollable. I can't even find a solution on how to solve this issue online.

    This is the link of corresponding PR: https://github.com/AY2021S1-CS2103T-W10-3/tp/pull/101

    Yes, it helps. Thanks a lot!

    @fall9x It shows the vertical bar now but it is still not able to scroll up and down. @JinHao-L I have set the vgrow of stack pane to be place in the scroll pane and the vgrow of scroll pane to be always.

    Screenshot 2020-11-06 at 2 14 44 PM Screenshot 2020-11-06 at 2 15 21 PM

    I solved it by removing the stackpane of my projectDashboard.

    Screenshot 2020-11-06 at 5 03 09 PM

    The height of scrollpane doesn't affect the vertical scroll bar.

    Screenshot 2020-11-06 at 5 03 34 PM

    But the stackpane of my dashboard restricts the grow of my vbox. Even though i set the max height of the stack pane to be max_integer but it still doesn't allow the grow of the vbox inside. So i use only the vbox for my project dashboard and set the max height to be max_integer.

    THANK YOU ALL FOR YOUR EFFORT!! : )

    I have followed the same exact steps fro using javafx with gradle and i tried running launcher.java after doing the hello world GUI and it gives me this error.

    Caused by: java.lang.NoSuchMethodException: duke.Duke.>init>()

    before implementing javafx i can run the class.

    Dear Prof,

    I used the wrong name for one of the branch, do i need to change the name of the branch or i do not need to as long as the tags is still the same?

    Thank you @damithc

    @ypinhsuan the Launcher now works but not my Duke program. For the Duke program it give me the error of JavaFX runtime components are missing, and are required to run this application

    @Royxuzeng I change the build.gradle to run the launcher.

    The programme runs well on IntelliJ regardless whether I use absolute path or relative path to create new file.

    However, .jar file only works if I use absolute path. From my understanding, we are supposed to use relative path so that the application can run on other devices too.

    Screenshot 2020-09-21 at 20 21 14

    this is my code to create the file.

    And the relative path I've been using is


    seedu/duke/todo.txt

    Is there something wrong?

    When I run Duke.java manually everything is fine as expected. However when I try the test, the following error shows up:

    "Task.java:10: error: unmappable character (0x97) for encoding US-ASCII

                return "[???] "
    
    Screenshot 2020-08-20 at 04 13 06

    this is line 10 of Task.java

    May I ask how should I solve this issue? Does it matter?

    I think you need to install dos2unix

    If you are using Mac, simply run

    brew install dos2unix
    

    on your terminal (if you have homebrew haha)

    What is the exact error you get?

    Does it make a difference if you specify a filename only e.g., todo.txt (i.e., without folders)

    Ahh yes, this works! Thanks so much!

    The error I got was


    java.io.IOException: No such file or directory

    at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)

    at java.base/java.io.File.createNewFile(File.java:1024)

    at seedu.duke.Storage.<init>(Storage.java:30)

    at seedu.duke.Duke.<init>(Duke.java:47)

    at seedu.duke.Main.<init>(Main.java:15)

    ... 11 more

    Ahh yes, this works! Thanks so much!

    In that case most likely the folder doesn't exist and your code needs to create the folders as well.

    I see! Thank you!!

    Hi when I uploaded the tests to GitHub, the checks for Ubuntu said they fail for the 3 tests but it passed on Windows and MACOS. May I ask what is the problem? The filepaths used are all relative paths.

    @Test

    public void read_notJsonFormat_exceptionThrown() {
    
        assertThrows(DataConversionException.class, () -&gt; readCommonCents("notJsonFormatCommonCents.json"));
    
    }
    
    
    
    @Test
    
    public void readCommonCents_invalidPersonCommonCents_throwDataConversionException() {
    
        assertThrows(DataConversionException.class, () -&gt; readCommonCents("invalidAccountNameCommonCents.json"));
    
    }
    
    
    
    @Test
    
    public void readCommonCents_invalidAndValidPersonCommonCents_throwDataConversionException() {
    
        assertThrows(DataConversionException.class, () -&gt; readCommonCents(
    
            "invalidAndValidAccountCommonCents.json"));
    
    }
    

    Hi prof, this is the error (in case this link https://github.com/AY2021S1-CS2103T-T13-4/tp/pulls doesn't work)

    and this is the test report when I build on my com

    and got this time when the check on MACOS runs first

    Ah I see thank you very much!

    Note that file/folder names are case insensitive in Windows but case-sensitive in Linux/OS-X.

    Furthermore, name case changes (if you are using Windows) might not get reflected in the repo as git on Windows may ignore such changes.

    You may want to look at file/folder names involved carefully, in the GitHub repo in particular.

    Hi, I've just run into a problem where my actual output (file is always empty) does not match expected output, unless the expected.txt is empty. I am able to run the runtest.bat , but says that the files do not match, even though my expected output matches the output I get when running Duke.java.

    It may help to post the full output you see when you run the batch file.

    This is the output from running the file

    I see. looks like there are no compilation errors. Can you post the code of Duke.java as well?

    Also. delete the bin folder and run again, to confirm that the latest .class file is being used.

    This is the Duke.java file and the result after deleting the bin folder and running again

    The same output occurs (There was a line Cannot find file .... /ACTUAL.TXT the first time I ran it, the error was gone the second time I ran it)

    so i must cd twice to the previous directory to go to the main iP folder directory. Then mkdir there ah.

    You can also go to where your main iP folder is and create a new folder inside called data. It will appear in intellij, then right click on the new folder in intellij and create a new file (Duke.txt) from there. Hope this helps!

    Hello, runtest.sh does not run after I added javaFx into my class files for Level-10.

    May I ask how can I solve this issue?

    Any help is much appreciated! Thanks!

    image

    Thank you everyone for the response. Like what @daongochieu2810, I think the problem is likely due to runtest script not linking to javafx. Since we are moving to GUI, I think I will focus my efforts on JUnit testing for now.

    Hi, I was facing the same issue when I tried double-clicking on it. Maybe you can try opening it on the command line using java -jar &gt;filename>.jar. Not too sure what is the issue here though.

    Hello, I am facing the same issue. May I ask how did u resolve it?

    It works! Thank you. I found an explanation online regarding this if anyone is interested. https://stackoverflow.com/questions/46053974/using-platform-exit-and-system-exitint-together

    Hi! I recently merged a pull request (which has passed all the checks) to my team's tP repository.

    However, after merging it, I was notified that checks were failing on our team's pull request to nus-cs2103-AY2021S1/tp:

    with the following error:

    I am wondering why there is a difference in the checks outcome and I hope to get some help on how I can resolve this issue.

    Hello, I found a small bug in my uploaded iP JAR file and would like to correct it.

    However, I noticed that the iP tracker for JAR released was defined by: "The JAR file was released via GitHub releases in the period 2020-09-10 00:00:00+08:00 to 2020-10-02 00:00:00+08:00" where the end date was last midnight.

    I have already released it once and passed the tracker for JAR released but I was wondering if modifications to my file and reuploading of a new JAR file is allowed and whether I would fail the tracker?

    Thank you! 😃

    Here is my really super duper ultra simple GUI without tweaks!

    GUI screenshot

    @damithc Noted, thank you!

    @damithc I see, thank you! 😃

    Greetings!

    JDK 11; IntelliJ 2020.2

    After I improved the packaging of my classes and added J-Unit tests, the runtest.sh file is unable to give a successful result. I tried to fix it with extensive searching and help from peers but I am unable to solve still.

    Following is the error I get when I run runtest.sh (My bot name is Dobby):

    Error: Could not find or load main class Dobby

    Caused by: java.lang.ClassNotFoundException: Dobby

    dos2unix: converting file ACTUAL.TXT to Unix format...

    dos2unix: converting file EXPECTED-UNIX.TXT to Unix format...

    I also made a shell-script configuration (script path is of runtest.sh) for runtest.sh which gives a build failure:

    no matches found: ../src/main/java/dobby/*.java

    ********** BUILD FAILURE **********

    Compiling code in runtest.sh:

    javac -cp ../src/main/java/dobby -Xlint:none -d ../bin ../src/main/java/dobby/.java ../src/main/java/dobby/task/.java

    Code to run the program in runtest.sh:

    java -classpath ../bin Dobby < input.txt > ACTUAL.TXT

    My code structure is as follows:

    ip/src/main/java/dobby/Dobby.java (and other java files- package dobby)

    ip/src/main/java/dobby/task/Task.java (and other task related java files - package dobby.task)

    The java folder inside main is the sources root.

    Thank you in advance! I can clarify anything if required!

    Screenshot 2020-08-26 at 3 17 53 PM

    Can you check if you have indicated the correct folder as Test Sources Root.

    It should be the java folder inside the test folder.

    Hope this helps!

    I tried that. It did not work. Tried again just now but same result.

    Thank you so much for your help!

    @tohyuting, I did what you said and it worked.

    Link for my fork- https://github.com/sagarsureka/ip

    Made a modification in the configuration setting with the working directory set as the text-ui-test directory. That works as well now.

    Thanks once again!

    Noted. Thank you so much!

    I am trying to use JUnit to test my Ui class, specifically testing if my showList method is printing the correct result to standard output.

    Here is part of my UiTest class


    private static final String TICK_ICON = "\u2713";

    private static final String CROSS_ICON = "\u2718";



    private static final List<Task> DEFAULT_TASKS = Arrays.asList(

    new Todo("t1", false),

    new Deadline("t2", true, LocalDateTime.of(2020, 8, 24, 10, 0)),

    new Deadline("t3", false, LocalDateTime.of(2020, 8, 27, 11, 0)),

    new Event("t4", true, LocalDateTime.of(2020, 8, 24, 11, 0)),

    new Event("t5", false, LocalDateTime.of(2020, 8, 27, 12, 0)));



    //@@author sc-arecrow-reused

    //Reused from https://www.baeldung.com/java-testing-system-out-println with minor modifications

    private final PrintStream standardOut = System.out;

    private final ByteArrayOutputStream outputStreamCaptor = new ByteArrayOutputStream();



    @BeforeEach

    public void setUp() {

    System.setOut(new PrintStream(outputStreamCaptor));

    }



    @AfterEach

    public void tearDown() {

    System.setOut(standardOut);

    }

    //@@author



    @Test

    public void showList_emptyModifierAndDate_success() {

    new Ui().showList(DEFAULT_TASKS, "", "");



    String listMessage = "Here are the tasks in your list:" + System.lineSeparator() +

    "1.[T][" + CROSS_ICON + "] t1" + System.lineSeparator() +

    "2.[D][" + TICK_ICON + "] t2 (by: Aug 24 2020, 10:00)" + System.lineSeparator() +

    "3.[D][" + CROSS_ICON + "] t3 (by: Aug 27 2020, 11:00)" + System.lineSeparator() +

    "4.[E][" + TICK_ICON + "] t4 (at: Aug 24 2020, 11:00)" + System.lineSeparator() +

    "5.[E][" + CROSS_ICON + "] t5 (at: Aug 27 2020, 12:00)";



    String expectedResult = putInChatBox(listMessage);

    String actualResult = outputStreamCaptor.toString();



    assertEquals(expectedResult, actualResult);

    }



    private static String putInChatBox(String message) {

    return HORIZONTAL_LINE + System.lineSeparator() +

    message + System.lineSeparator() +

    HORIZONTAL_LINE + System.lineSeparator() +

    System.lineSeparator();

    }

    and my showList method in the Ui class


    public void showList(List<Task> tasks, String modifier, String dateString) {

    String finalDateString = dateString.isEmpty()

    ? dateString

    : ("occurring " + (dateString.equals("today")

    ? dateString

    : "on " + dateString) + " ");





    speak(String.format("Here are the %ss %sin your list:\n%s",

    modifier.isEmpty() ? "task" : modifier,

    finalDateString,

    convertTaskListToString(tasks)));

    }



    private String convertTaskListToString(List<Task> tasks) {

    String result = "";



    for (int i = 0; i < tasks.size(); i++) {

    result += (i == tasks.size() - 1)

    ? String.format("%d.%s", i + 1, tasks.get(i).toString())

    : String.format("%d.%s\n", i + 1, tasks.get(i).toString());

    }



    return result;

    }

    Below is the result that I get for both expectedResult and actualResult


    __________________________________________________

    Here are the tasks in your list:

    1.[T][✘] t1

    2.[D][✓] t2 (by: Aug 24 2020, 10:00)

    3.[D][✘] t3 (by: Aug 27 2020, 11:00)

    4.[E][✓] t4 (at: Aug 24 2020, 11:00)

    5.[E][✘] t5 (at: Aug 27 2020, 12:00)

    __________________________________________________

    Even though there is an AssertionFailedError,

    IntelliJ tells me that the contents are identical

    Why is this happening?

    💡 You can use Markdown to format your text

    I am facing the same problem with a similar setup as OP.


    package viscount;



    import org.junit.jupiter.api.Test;



    import static org.junit.jupiter.api.Assertions.assertEquals;



    public class UiTest {

    @Test

    public void dummyTest() {

    assertEquals(2, 2);

    }

    }

    When I right click the class and select Run 'UiTest' as instructed here, IntelliJ tells me that no tests were found. My current project structure is (renamed Duke to Viscount):

    Hello, I think I found the problem! All this while, the wrong directory was marked as the module in my project structure (it was [project root] but it should be [project root]/src/main). I followed these steps to solve the issue:

    1. Remove old [project root]/src/test directory as module and delete it

    2. Remove [project root] directory as module

    3. Go to File > New > Module from Existing Sources and choose [project root]/src/main, then selecting Create module from existing sources followed by all the default settings.

    4. Mark [project root]/src/main/java as source root if you havent done so

    5. Now follow the instructions here again and it should work!

    The solution that @luo-git suggested worked! Thank you so much

    So I was wondering why some of my commits seemed to not have my profile pic then I noticed that the commits made through sourcetree were being attributed to another email of mine. Long story (included below) short, I am trying to correct it but currently facing some difficulty. I am following this guide and it is resulting in duplicated commits. And when I try to preview the PR, it is showing 900+ commits.

    Including this here partly because it was meant to be my initial issue post:

    Previously my tp fork was quite messy because I tried to resolve the conflicts arising from the duplicated commits by merging and I made a mistake by mass merging without checking. After quite a bit of searching. I managed to hard revert it back to the commit before all the above were done.

    Would appreciate any help if anyone has been through this or knows a bit more about the process! Thanks!

    @AlexCQY try using a more powerful diff tool such as WinMerge to compare the two files. There may be differences not visible to the naked eye.

    Thank you @AlexCQY, I had the same issue and the suggested program by prof helped to identify the differences (mine were due to white spaces) that were indeed missed by sight.

    By the way, I would like to ask if there is a solution/need to address the weird characters appearing on the terminal as seen in the screenshot above. It's working fine in the ACTUAL.TXT though.

    Sharing my simple GUI too! Featuring nana 😃

    Ui

    Oh thank you Prof for the fast response, I believe most of my commits are detected but I will definitely look through the reposense again.

    I shall delay the email update to after this module has concluded then so as not to cause inconveniences.

    As I'm wrapping up iP, I tried sending to a few friends the duke.jar file to test out the bot. Most of them (coming from non-CS background) do not have java and hence cannot open the program. It feels super strange to request them to install java on their own systems.

    I did some digging around and found out that many products now are also bundled with their own JRE so users can run them without native java. However, I have two questions regarding that:

    1. How do I do that? I tried launch4J but it didn't really work (I probably did it wrongly)

    2. Doesn't this bloat up your program by a lot? duke.jar itself is around 11 mb, adding a JRE is like ~100+ mb

    In case 2, duplication of code can be mitigated if you have a single method for creating the subclasses of Task.

    public Task createTask(String type, String description) throws DukeException

    Then there will only be a single check for whether description is empty or poorly formatted, which throws exception.

    This was how I attempted this issue, hope it provides some clarity.

    Here's my gui

    I encountered InvocationTargetException in the past. For my case it was because the path for the image in userImage/dukeImage didnt exist/typed incorrectly

    Had this issue too, just to add on: path is case-sensitive

    When I tried running ./gradlew checkstyleMain checkstyleTest, the following error appears:

    Execution failed for task ':checkstyleMain'.

    Unable to create Root Module: config {[root]/config/checkstyle/checkstyle.xml}, classpath {/Users/marcus/Desktop/workspace/ip/build/classes/java/main:/Users/marcus/Desktop/workspace/ip/build/resources/main}.

    I already placed the checkstyle configuration files in the directory [root]/config/checkstyle/checkstyle.xml. Does anyone have any idea on where the error is?

    @zhengweii Yup I had the suppressions.xml file as well, but it still wouldn't work

    @qlchan24 which version number did you change it to? I took the following screenshot of the error message:

    @qlchan24 I changed my version to 8.32 and I think it works (it produced an HTML file showing the errors), but the following still appears:

    Is it running properly?

    ok thanks! @zhengweii @qlchan24

    Hi I'm using a mac as well and also have the dos2unix error but I left it because it doesn't seem to affect my test cases and I can run them just fine. As others have said the problem is probably with the ACTUAL and EXPECTED files and not the dos2unix error.

    You can also use your IDE to help you with conflicting changes. If you are using intellij, more details about resolving conflicts can be found here https://www.jetbrains.com/help/idea/resolving-conflicts.html#distributed-version-control-systems

    Added some basic styling as well!

    Screenshot 2020-09-01 at 9 10 19 PM

    The official java docs gave some nice concrete examples and reasoning (such as the default clause in switch case blocks, method preconditions and postconditions) where assertions can be used. Maybe reading it can help shed some light (link provided in the textbook as well): https://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html#intro

    I have recently received an email titled iP JAR file failed our smoke test, and it said that an automated testing of my .jar file found that the application crashes with the following error(s) upon launching:

    On Windows, using Java 11:

    Error: LinkageError occurred while loading main class duke.Launcher java.lang.UnsupportedClassVersionError: duke/Launcher has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0

    On Linux, using Java 11:

    Error: LinkageError occurred while loading main class duke.Launcher java.lang.UnsupportedClassVersionError: duke/Launcher has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0

    Therefore, I have deleted all my Java JDKs on my computer and reinstalled Java 11, and remade my .jar file.

    However, I am still uncertain whether my .jar file is able to pass the automated smoke tests.

    Is there any way for me to check whether all class files inside my duke.jar file has versions that are less than or equal to 55.0?

    I have followed the instructions for JavaFX tutorial part 1, where I

    • Downloaded the JavaFX 11 SDK and unzipped it.

    • Imported the libs folder into my project

    • Added the following line to my VM options for the duke.Duke class


    --module-path /Users/joshuachewjianxiang/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml

    However, after I followed the instructions above and tried to run the program, I received the following error:


    Error occurred during initialization of boot layer

    java.lang.module.FindException: Hash of javafx.base (7d002bf1e3ab1a71413dc71407f8cd5b5825a50d4fa6ce72af927935b58075a0) differs to expected hash (6f82f10f1e646a3d56e40b4e8fa51bc207c27591688524db7074c5285269ed24) recorded in java.base

    Does anyone face a similar issue?

    @EugeneTeu Yep, I decided to use Gradle instead, and the problem is resolved. What I did was as follows:

    1. Add the following code to build.gradle:

    repositories {

    mavenCentral()

    }



    dependencies {

    String javaFxVersion = '11'



    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'linux'

    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-controls', version: javaFxVersion, classifier: 'linux'

    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaFxVersion, classifier: 'linux'

    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'

    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'

    implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'

    }

    1. In the Terminal, I ran ./gradlew build.

    After that, I was able to follow the rest of the instructions for JavaFX tutorial part 1 with no problem. I shall close this issue.

    I am currently experiencing the same problem after I made some commits where I increased the number of JUnit tests.

    Using preview to open my PPP pdf and because the reposense link includes a "#" character

    https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=nopenotj&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other

    Somehow when I try to click on this link it the "#" transforms into "%23" and results in this link which leads me to an error page.

    https://nus-cs2103-ay2021s1.github.io/tp-dashboard/%23breakdown=true&search=nopenotj&sort=groupTitle&sortWithin=title&since=2020-08-14&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other

    Not sure why this is happening........

    just looking through the git config file in .git/config which looks something like this

    does anyone know what does the fetch = +refs/heads/*:refs/remotes/origin/* mean? can't really seem to find much on google... I assume it means something like fetch all head refs + and all refs in remote/origin.

    What sort of path syntax is this?

    Thank you!!! @ianyong

    I think the issue has to do with preview because I was able to open the same link in chrome's pdf reader

    How to fix this error?

    I tried to run the runtest.bat, but then that error showed up.

    Hmm okay, let me check it

    Thanks!

    Can we modify the CheckStyle? Currently I am trying to write something like

    But CheckStyle insists that the left parenthesis '(' of line 117 and 121 should be on previous lines, even though they are parenthesis for lambdas. What do you guys think?

    I believe in most cases this can be solved by using an association class. Similar to Student, Book, and Loan.

    Seems like this is mis-configuration between your jar builder and your packages. Did you package your Duke class under seedu.duke? Because the default jar builder configuration from the gradle support is under that, but I doubt any of us are packaging it under seedu.

    However I am not too sure how to go about this without just straight up disabling check for left parenthesis. Because there are legitimate reasons for have '(' on the previous line for function calls (such as line 115). It's just that now CheckStyle cannot differentiate parenthesis for lambda or for function calls. Any idea how I can go about this?

    Update:

    For those interested, here is the link to the modified CheckStyle file that disables the check for "(" to be at EOL.

    https://github.com/duckmoon99/ip/blob/9dc0adeb38ba31ef534917941300b76bc3badc64/config/checkstyle/checkstyle.xml

    You can check the history of the file to find what exactly changed. I am still a bit iffy with this change but I don't know how we can do better straight disabling the check for "(" since there are cases where that needs to be enforced.

    Hi, does anyone have a simple guide on how to add a background image using CSS? I've been following a few guides that I found online but I'm not sure how to apply the css background to the mainwindow fxml file.

    hi this is my gui

    Screenshot 2020-09-15 at 2 10 41 PM
    Screenshot 2020-09-15 at 2 23 03 PM

    u can select the textfield here in the main window here

    Screenshot 2020-09-15 at 2 22 54 PM

    next click the bring to front button on the top which would bring the text field on top of the dialog box so that when u rescale it, it will be in front.

    Hope this helps u out! 😃

    thanks for the share, really appreciate it!

    Adding export LC_ALL=en_GB.UTF-8 in runtest.sh works for me

    Have you handled the case where dataFile doesn't exist?

    Could you try printing the dataFile object and see what the output is?

    Sorry for the unclear suggestion previously but maybe print it right before fos = new FileOutputStream(dataFile); instead. Could you also show the part of your code where you call saveData?

    Try to post the error message for the sub process, it will give more info on the error. The error message that you posted will be shown regardless of why checkstyle failed.

    That being said, when I first transferred the files, i had to change the checkstyle version number on build.gradle to the one mentioned in the github where i downloaded the file.

    Oh it still doesn't show the error. I think you can run gradle checkstyleMain alone to run with --stacktrace to get the error message.

    mine is 8.32

    put this in your gradle.build so that it compiles in utf8:

    tasks.withType(JavaCompile) {

    options.encoding = 'UTF-8'
    

    }

    also put this to ensure the jvm runs with utf8:

    applicationDefaultJvmArgs = ["-Dfile.encoding=utf-8"]

    I think Gradle does not actually know the version, and completely relies on whatever number you put in the build.gradle file. Its just that the structure between checkstyle of version 8.32 and 8.23 is different so if you tell gradle that you are using 8.23 then they will give you an error because the structure seems wrong to them. I only knew the correct version from the commit header too.

    Library

    JFoenix

    Purpose

    Make our UI look elegant and feel native

    License

    Apache License

    I think reading each others' data refers to (directly) accessing other objects' instance variables, which is widely known as bad practice.

    However, for sending each other messages, it could refer to method invocation in the case of Java/C#/C++ (see this answer) which is a more "desirable" method (no pun intended) for objects to interact with other objects (as methods serve as encapsulation of the object's variables).

    From 'error: invalid flag: C:\Users\Rui' and the line after, it seems as if 'javac' in 'javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Duke.java

    ' in 'runtest.bat' is attempting to use 'C:\Users\Rui' as a flag. And as you correctly pointed out, this is caused by having whitespaces in folder or file names.

    I can think of two possible solutions:

    1. remove the whitespaces in your file and folder names, or

    2. replace 'javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Duke.java' with 'javac -cp "..\src" -Xlint:none -d "..\bin ..\src\main\java\Duke.java"' in 'runtest.bat' (line 10). Basically surround all paths with " ".

    Hope this helps! Do let me know if 2 works so I can submit a PR to the repo to prevent future occurrences of this issue for anyone else.

    Ah I see.

    What I meant was double quoting "..\src" and "..\bin" in runtest.bat so that javac can recognize them as file paths rather than options.

    As for the disappearing \, trying double backslash \\ rather than single \ backslash for each path in sources.txt might work... if my memory of hosting minecraft servers serves me right 😂 (as each backslash character needs to be escaped within " ") .

    eg "C:\foo\bar" -> "C:\\foo\\bar"

    This happened when one of my team members added his AboutUs picture in a PR. The only change was the addition of 1 .png file, and no code was changed so the CI should not fail. But it did.

    We can see from the CI logs that the build process failed because gradle failed to download and install the shadow package. Note that this build process happens one one of github's cloud VMs, and not on your local machine.

    To fix this, you can close and reopen the PR, making github restart the CI process.

    Note that this will only fix problems that are github's fault (e.g. failing to download a package). It will not magically make your CI pass. In particular, the CI may fail again if your code does not pass all the test cases (repeatedly closing and opening the PR will never fix this!).

    Library

    Apache commons-cli

    Purpose

    Implements some basic command parsing functionality and automated help generation for commands.

    Allows me to build up even more complicated features for the command line (e.g. creating easier syntax, allowing users to create simple macro commands, etc..).

    License

    Apache License v2

    Library

    Google Gson library

    Purpose

    To implement robust storage features in the iP.

    License

    Apache 2.0 License

    Yes, my team will be using jackson for the tP, but I have been using Gson for my iP. Only just found out that we need to request permission to use external libraries in the iP as well.

    Library

    Apache POI

    Purpose

    Write .xlsx MS Excel files

    License

    Apache License V2.0

    According to this section of the style guide:

    This means that we should configure our IDE to not use wildcard imports.

    To do so in IntelliJ IDEA:

    1. Open Preferences > Editor > Code Style > Java > Imports

    2. Set both Class count to use import with '*' and Names count to use static import with '*' to an unreachably high number.

    1. Remove the two entries in Packages to Use Import with '*'.

    1. Apply!

    We'd need more details in order to help you! When using Git, when in doubt and confused, always look at git status and git log. git status tells you the current status of your source directory, which should tell you which files are having merge conflicts. git log helps you to see how your commit history is like, to see if you've perhaps added some commits wrongly.

    Wow! Thanks for sharing such a great tip! Great guide as well!

    I added gradle to my project as per the instructions given. However, now everything seem to not work. the Java files no longer seem to be recognised by Intellij. Gradle run command still seem to work though

    Git uses this format

    //>>>>>> HEAD

    //XXX

    //=======

    //YYYY

    //>>>>>> ZZZ

    to indicate that there is a conflict. (I had to add // to prevent weird formatting)

    My question is what if for some reason (maybe you are writing a txt tutorial on how to deal with git conflicts), that segment format is actually part of your content? Will git think it is an actual conflict? Is it thus possible to generate fake conflicts by inserting this segment intentionally to your code?

    I meant to say that intellij no longer recognise the java libraries, as shown from the red markers. (unable to resolve symbol error) Gradlew run still manages to compile the code.

    I checked the project settings, the SDK and everything seem to be correct

    Edit: I reinstalled the JDK and it works now

    Currently, our only heuristic for picking cases within equivalence partitions is to pick boundary values and a few non-boundary values. Instead of picking an arbitrary non-boundary value, would it be a good idea to test a random value within the equivalence partition, so that every time the test suite is run, it covers a different possible value.

    The main issue I see with this is that the testing functions are non deterministic and failed test cases become hard to reproduce, but if we simply log the values used, it shouldn't be an issue.

    Hey Naumie, did you try and javac all the files instead of just the Duke.java in the script

    http://tutorials.jenkov.com/java/enums.html#enum-abstract-methods

    You can try something like the abstract methods for enums mentioned here. Each enum type will then implement a method like makeToy() that returns the appropriate Toy. Then in your Toy class you can just return identifier.makeToy()

    Did you download the checkstyle xml files into your project. If you look at the Gradle tutorial, you'll see a resource called Checkstyle Tutorial. It is in that resource where it is explained the further steps you need to take

    Development Environment

    • IntelliJ version: 2020.2.1

    • OS: Windows 10

    • Java version: 13.0.1 (Erroneous)

    I received an email stating that my iP JAR File failed the smoke test. The error messages were:

    • On Windows, using Java 11:

    Error: LinkageError occurred while loading main class duke.Duke java.lang.UnsupportedClassVersionError: duke/Duke has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0

    • On Linux, using Java 11:

    Error: LinkageError occurred while loading main class duke.Duke java.lang.UnsupportedClassVersionError: duke/Duke has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0

    Following which, I realized that the SDK I have been using was JDK 13 instead of JDK 11.

    1. The following actions were taken but it did not solve the problem:
    • File >> Project Structure >> Project >> Project SDK set to java version 11

    • File >> Settings >> Build, Execution, Deployment >> Build Tools >> Gradle >> Gradle projects >> Gradle >> Gradle JVM set to java version 11

    1. Not sure if this is related, but on the terminal, running gradlew properties reveals that:
    • sourceCompatability: 13

    • targetCompatability: 13

    even when the actions in (1.) were taken. Currently I have no way of knowing if those properties are the cause, nor of how to change the values in those properties.

    Try specifying the following in your build.gradle:

    sourceCompatibility = JavaVersion.VERSION_11

    targetCompatibility = JavaVersion.VERSION_11

    Running gradlew build after making those changes returns the following error:


    FAILURE: Build failed with an exception.



    * Where:

    Build file 'C:\Users\Yong Ping\repos\ip2\build.gradle' line: 63



    * What went wrong:

    A problem occurred evaluating root project 'ip2'.

    > Could not set unknown property 'sourceCompatability' for root project 'ip2' of type org.gradle.api.Project.

    The spelling error has been corrected. The following error message is returned.


    > Task :checkstyleMain FAILED



    FAILURE: Build failed with an exception.



    * What went wrong:

    Execution failed for task ':checkstyleMain'.

    > Unable to create Root Module: config {C:\Users\Yong Ping\repos\ip\config\checkstyle\checkstyle.xml}, classpath {C:\Users\Yong Ping\repos\ip\build\classes\java\main;C:\Users\Yong Ping\repos\ip\build\resources\main;C:\Users\Yong Pin

    g\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-fxml\11\d5ff9262ef49d166db658d15f37e3ecff38fde4b\javafx-fxml-11-win.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-fxml\11\e0f5bb81e21054b59f2ebfa

    727d40a90ee0260d3\javafx-fxml-11-mac.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-fxml\11\e7a757b580fc3e2e1a121768606c7836eef418c\javafx-fxml-11-linux.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\f

    iles-2.1\org.openjfx\javafx-controls\11\af8d24de44e16a19ae959028eb23a48c145fb682\javafx-controls-11-win.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-controls\11\e3a24a14e8732abc6dc173f15872dc63e2a32e1

    6\javafx-controls-11-mac.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-controls\11\794488e3b1f4635d9a1b842bdc872a5eb8fd54ca\javafx-controls-11-linux.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\file

    s-2.1\org.openjfx\javafx-controls\11\58d961774262ec972bf304e16c154a8e18c2050b\javafx-controls-11.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-graphics\11\9345c7ea43dbcc73a62eca5332717b4ce617e6c6\javaf

    x-graphics-11-win.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-graphics\11\af47a6d3668d3ce1c61e1fe13c44471b6f8d469\javafx-graphics-11-mac.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.

    openjfx\javafx-graphics\11\4ab9edd8d481a420044c473fdb5718ccdd35c836\javafx-graphics-11-linux.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-graphics\11\a736dd079047ec0b72b8c4970842a5c5e0c19f2f\javafx-gr

    aphics-11.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-base\11\ad3a4acfaa28b484d30c40c1f009445cc3f6e68b\javafx-base-11-win.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-

    base\11\4b060dad0affd866df9d959e064faa8a1a2f4af0\javafx-base-11-mac.jar;C:\Users\Yong Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-base\11\f8d1ced6047b010f1e3bb92dc060862179ce5897\javafx-base-11-linux.jar;C:\Users\Yong

    Ping\.gradle\caches\modules-2\files-2.1\org.openjfx\javafx-base\11\9fcd3e8e3227ec97bf503f7991fad1f3b14d005\javafx-base-11.jar}.

    Thank you Prof @damithc and @ianyong!

    @GilbertTan19 , hi can I ask how did you manage to solve that issue?

    Try going to the Gradle toolbar and under the build option double click everything. Not sure which was the specific one that solved it for me 😅

    @GilbertTan19 , hi can I ask how did you manage to solve that issue?

    Try going to the Gradle toolbar and under the build option double click everything. Not sure which was the specific one that solved it for me 😅

    Hi! I cannot find the build option in the Gradle toolbar you are referring to. Could you provide a ss? I am having the same error of "JavaFX runtime components are missing, and are required to run this application". Thx in advance.

    Try all the build options and clean as well

    Try all the build options and clean as well

    @RuiFengg hmm oh no doesn't seem to work for me .-.

    Do you still get the same "JavaFX runtime components are missing" error?

    Try all the build options and clean as well

    @RuiFengg hmm oh no doesn't seem to work for me .-.

    Do you still get the same "JavaFX runtime components are missing" error?

    yeap sadly. only when running Duke

    I ran mine with launcher instead of Duke shown in the ss I sent beside the green play button. If that doesn't work I'm not really sure how to fix it 😅

    Hi everyone. I was looking into how to handle the case when a user accidentally terminates the java program without the proper exit command (e.g. via the "bye") keyword and I came across the idea of adding a JVM Shutdown hook. This seems to be one solution to handle this situation, and I tried implementing it like so:

    Thought this might be useful for others. Also if anyone can explain more in-depth into what's happening under-the-hood for how the ShutdownHook works (the JVM is the one that executes the code within the hook?) ...

    Started this thread to point others to this and get pointed at similar concepts to understand this better. (Also, not sure if there's any better way than to use System.exit() for the ExitCommand)

    Is there any thing that I have to note when implementing this shutdown hook? 'cause when I try to use it, I cannot pressing ctrl + c to terminate the program any more

    Hi @aidoxe-123 , did you manage to make it work?

    I didn't have to add any other code other than the screenshot on the left (with the relevant import statements magically added by IntelliJ).

    If you implemented your main class as suggested, I don't think you'll need to use System.exit() since the program will automatically terminate when it reaches the end of the main() function.

    @seowalex I'm not fully sure about this. I added in the System.exit() just in the meantime because prior to adding it:

    1. after user is done and sends the exit command to Duke, the exit greeting is displayed by the UI and Duke.main() is done running

    2. this shuts down the JVM since everything is done, and the hook runs, doing the necessary saving and displaying the exit greeting a second time

    So I decided to just call System.exit() for the execute method for ExitCommand

    On a side note the hooks will not execute in the event of an unexpected termination of JVM, so its still a safer choice to save on add.

    @LeeEnHao Thanks for the heads up man! yes I realise now that OS related signals (SIGKILL) and other situations can prevent the hook from running, and you're right about writing onto the hard disk upon add being a safer option.

    This is a neat trick, but ensure you are using it for the right reasons (if you are doing this because you want to save only at the shutdown, see this comment).

    Thank you Prof @damithc ! This echoes @LeeEnHao 's point about writing on every add/change to the TaskList being a safer option. Now that I realise this may not be that useful a tip, should I just close this Issue?

    Thanks @kormingsoon for such a detailed description!

    I tried using gifs and the scene builder, here's it now:

    I am currently facing difficulties running test cases for removing field tutorial but encountered errors as the pic shows. I have run it via intelliJ and it was perfectly fine, but just failed when using Gradle to run.

    Will really appreciate if someone can help!

    Hi Prof, can I know if commenting affects the grading?

    @ZhangWanlin98 is this blocking your tP progress, or are you able to proceed by using intellij to run tests instead?

    this occurs in running the tutorial tests, but i can use intellij to run.

    while this is the case, i think it would be better if i can know the reason why gradle run for tests failed

    @ZhangWanlin98 doesn't look like this is a common problem as no one else reported it. Did you manage to solve it?

    No, I have not solved it.

    I think it is somehow because of the setting problem since within the tp code, I can only run new tests that are written locally with Gradle.

    I have tried to add jvmArgs '--enable-preview' into test, but did not work.

    In the end, I adapt to choose IntelliJ in the setting for the test and all tests works.

    we've changed our group icon but it is not update for windows user. Is there any way to resolve this?

    (updated icon)

    (non updated AB3 icon)

    Screenshot 2020-09-02 at 12 58 30 AM

    I got this error when i tried to add the code from tutorial2 inside my project. I have added the dependencies in build.gradle as well as set up JavaFX 11 SDK. Has anyone encountered the same problem as me?

    ya i missed that part out carelessly, thanks for the help! @tanweijie123

    it works! thanks for the help :>

    Hello, I followed the instructions on how to install graphviz and installed the PlantUML integration plugin on intellij. However, I am unable to see the diagrams and keep getting the error below. I am not sure why this is happening.

    Screenshot 2020-10-26 at 12 13 53 AM

    I tried to do a smoke test by dragging the fat jar file out of Intelli-j onto my desktop. But I get this error and I do not know what the issue is. Please help me.

    Screenshot 2020-09-18 at 1 55 26 AM

    Task cannot be accessed by the other classes after merging gradle branch and following the gradle instructions. I also cannot run the Duke class. Please help, I have been stuck on this for very long.

    Screenshot 2020-09-08 at 6 06 42 PM Screenshot 2020-09-08 at 6 08 19 PM

    @ianyong Thank you I am able to run Duke now!

    Development environment:

    IntelliJ IDEA 2020.2 (Community Edition)

    Build #IC-202.6397.94, built on July 27, 2020

    Runtime version: 11.0.7+10-b944.20 amd64

    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

    Windows 10 10.0

    Issue:

    I was trying to do the Automated Text UI Testing for Individual Project and initially it has the same problem as mentioned in Issue #3. Therefore, I have replaced line 10 with the codes given in the solution. However, when I tried to run runtest.bat, another error appeared. I googled and I think it has to do with the white spaces in the name of the folders containing the classes. This was the error message shown:

    >pre>>code>cmd.exe /c runtest.bat

    Could Not Find C:\Users\Rui Ling\Desktop\uni y2s1\cs2103t\ip\text-ui-test\ACTUAL.TXT

    error: invalid flag: C:\Users\Rui

    Usage: javac > options > > source files >

    use --help for a list of possible options

    ********** BUILD FAILURE **********

    Process finished with exit code 1>/code>>/pre>

    I would appreciate any help given, thank you in advance!

    Hi, thank you for the prompt reply!

    For solution 1, I have tried to rename the "Rui Ling" folder but I am unable to do so, since it is under Users folder. To create a new folder with no white spaces would be to create a new user account.

    For solution 2, as I used these:

    >pre>>code>dir /s /B ..\src\main\java*.java > sources.txt

    javac -cp ..\src -Xlint:none -d ..\bin @sources.txt>/code>>/pre>

    all the paths are in sources.txt file, and therefore I am unsure of what to do next.

    Other than that, I have tried double quoting all paths in sources.txt but it does not work, meaning it will be as such:

    C:UsersRui LingDesktopuni y2s1cs2103tip

    when I run runtest.bat.

    Was this what you meant? Sorry if I didn't catch you!

    Hmm for the first solution do you mean this way:

    >pre>>code>dir /s /B ..\src\main\java*.java > sources.txt

    javac -cp "..\src" -Xlint:none -d "..\bin" @sources.txt>/code>>/pre>

    I have double quoted ..\src and ..\bin in the second line.

    I will try the second solution tomorrow!

    Thank you!

    @erisjacey Yes, it worked for me, thank you!

    Hi, I tried the aforementioned solution of following the steps under "if you are not using Gradle" as well, but I am still facing the issue, anyone managed to solve it?

    Okay, sorry, I realised I had to either change the main class in the build gradle file.

    Hi more things that I checked are here:

    The tutorial mentioned the use of a Launcher class, so the main class name has to be changed to "duke.Launcher" or whatever other name used.

    Also, since the Launcher class has the main method, the main method in Duke needs to be removed.

    One more thing is to follow the step 3 of the tutorial for those without gradle,

    " 3. From Run > Edit Configurations, add the following line into your VM options for each of the main classes.

    --module-path {JAVAFX_HOME}/lib --add-modules javafx.controls,javafx.fxml

    e.g., --module-path C:/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml "

    Find the configuration with gradle task run and add the above into the VM options of that particular configuration. Not sure if this is clear, do sound out for any further clarifications.

    Hope this helps!

    Hello, here's my gui, Kept it simple and neat

    Hi! I had the same problem as well! The error only went away after I added the suppression.xml file.

    @marcus2k yup! These errors will go away once you fix the coding style violations!

    @EthanTheGoondu Hello! By convention suppressions.xml should be placed in the same folder as checkstyle.xml. So it should be placed at ip/config/checkstyle/suppressions.xml

    I faced this issue myself, whereby test cases were failing due to differences in trailing white spaces between my ACTUAL.TXT and EXPECTED.TXT. The trailing white spaces were indeed expected, but not saving properly in my EXPECTED.TXT file. This is despite:

    1. copying and pasting EXACTLY my expected output, and also

    2. manually adding trailing white spaces that were expected to the EXPECTED.TXT file.

    I noticed that whenever I added the trailing white spaces to EXPECTED.TXT, the moment I saved the file the trailing white spaces were automatically removed by IntelliJ, causing my test cases to fail.

    Solution: This can be easily solved by configuring your IntelliJ settings. Under Preferences (or Files) > Editor > General > Save Files (or Other), change the setting for "Strip trailing spaces on Save for:" to "None", as shown below.

    Hope this was helpful! 😃

    Perhaps you can put the wait for input and receive input inside the try block as well? That way exceptions from the input process will be caught as well.

    Just a little add-on (in case the “catch Exception” was not just an example): It would also be better practice to catch more specific Exceptions as opposed to a catch-all Exception, so you can handle each type of exception appropriately, and also avoid bug masking. And you can also use a finally block to clean up after the try catch blocks! 😃

    You can read up more on some exception handling best practices here .

    Cheers!

    This is my GUI, inspired by my favourite game :"")

    I accidentally create the branch-A-CodingStandard onto the previous branch (branch-A-JavaDoc) instead of onto the master branch, I kinda scared that ill mess it up if I just try out myself, so could anyone help fix this? thanks in advance

    thanks a lot for the tip!

    yup that's the case, and I fixed it by interactive rebase, thx.

    Hello, I am currently testing my program from jar file and realise that certain decorative texts in my Ui cannot be shown properly.

    Error message is as follows: error: unmappable character for encoding US-ASCII

    I understand that it may be the issue of encoding method chosen for compilation, but I do not know how to solve this exactly.

    Please help!

    Screenshot of my Duke while running from IntelliJ (all texts shown as intended)

    Screenshot of my Duke while running from jar file (decorative text messed up)

    Hello, I think you may try to copy and paste the jar file instead of dragging it. It works for me.

    Some possibly relevant past issues https://github.com/nus-cs2103-AY2021S1/forum/issues?q=is%3Aissue+utf+

    Thank you prof, problem resolved!

    Dear professors, TA and fellow course mates.

    I tried to run the runtest.sh file but there is an error showing line 30: dos2unix: command not found. Moreover, there are random numbers around the output which I do not know why they appear. My actual output and expected output looks similar. I am running the file in macbook intelj IDE.

    Screenshot 2020-08-20 at 2 39 09 PM
    Screenshot 2020-08-20 at 2 39 23 PM

    Thank you so much guys!!!!!

    I setup JavaFX using gradle on intelliJ, After that, I followed the code to setup Duke and Launcher in the JavaFX instructions. But when I tried to run Lacunher.main(), I got error "Caused by: java.lang.NoSuchMethodException: duke.Duke.>init>()".

    Duke.java (My Duke class extends Application):

    Launcher.java:

    In my Duke.java, I have a FileWriter than writes to "./src/main/java/data/list.txt".

    When I run main using IntelliJ, it runs the program from my project folder and the path works.

    However, if I run runtest.bat, an IOException is thrown with message ".\src\main\java\data\list.txt (The system cannot find the path specified)".

    May I know what is the proper relative path I should be using?

    Oh yea, implementing one solved my issue. Thanks @erisjacey !

    Hi, I think you are confusing the keywords final with static

    Final keyword:


    // Use 'final' to make a variable immutable

    private final List<Task> taskList = new ArrayList<>(100);



    // Error because taskList is final

    taskList = new ArrayList<>(100);

    Static keyword:


    // 'static' keyword ensures that there is one and only one instance at all time

    class TinyCircle {

    public static int MIN_SIZE = 1; // Note: static only

    public static final int DEFAULT_SIZE = 100; // Note: static final

    }



    class Main {

    public static void main(String args[]) {



    // Modifying static variable

    TinyCircle.MIN_SIZE = 10; // Success



    // Modifying static final variable

    TinyCircle.DEFAULT_SIZE = 50; // Error

    }

    }

    So, should we use final to make List<Task> taskList immutable? Yes, we should. It prevents accidental modifications to taskList.

    But should we use static so that we can use TaskList.add() instead of new TaskList().add()? I would say no, to accomodate for future versions of our project in case we need to have multiple TaskLists.

    I managed to get it printed correctly after some google

    It involves 3 steps

    Step 1: Type chcp 65001 to change set your terminal to use UTF-8

    Step 2: Run java -Dfile.encoding=UTF-8 -jar ip.jar

    Step 3: Change your terminal font until you see the correct symbol shows

    DejaVu Sans Mono worked for me

    To revert to original settings:

    Type chcp 437

    I use consolas as the default terminal font.

    Whoops! i got confused by the immutability part.

    I can kind of see where you are getting from, but i will not venture there.

    My short opinion is that if you make the classes immutable, you could adopt a more functional style instead of OOP. There's nothing wrong with that, it mainly depends on the style you adopt.

    My code doesn't look too different from yours. Maybe someone else could give a better analysis.


    List<Task> taskList = new ArrayList<>(5);

    Task task1 = new ToDo("Todo 1");

    taskList.add(task1);

    Command c1 = new DoneCommand(task1);

    c1.execute();

    assertTrue(taskList.get(0).isCompleted());

    I have just started using Gradle inside my project. I tried to run the project using Gradle and everything went fine (e.g. testing whether it could print list, add a proper task) until I gave an invalid command and the project failed to give me the expected error notification output I wanted.

    For instance, when I typed in "event ". I was expecting to get the following, from printing the exception message:


    ERROR: Please provide a summary and date of event.

    Separate the dates from summary using " /at " and separate the two dates using a space.

    However, what I got was the following screenshot.

    error

    I left the project loading for a few minutes but nothing came out and eventually it just remained loading there. I could not type anything.

    I tried running using Intellij instead and managed to print out the expected message as seen here.

    non error

    I fiddled a bit more and realised that as long as my error message did not contain "error:", it would work fine. So the following examples of error messages would work under Gradle.


    ERRORS: Please provide a summary and date of event.

    Separate the dates from summary using " /at " and separate the two dates using a space.


    ERROR| Please provide a summary and date of event.

    Separate the dates from summary using " /at " and separate the two dates using a space.

    However the following would not work.


    Error: Please provide a summary and date of event.

    Separate the dates from summary using " /at " and separate the two dates using a space.

    I have already changed my error message to allow my project to run, but I'm confused about why something like this would happen. Hope somebody can clarify this for me. Thank you.

    Thank you prof. The link below directs to the directory right after I changed the error message.

    https://github.com/hopinxian/ip/tree/edf3563dd13317a61b999e300d535a1f9713898e

    The change is on this line in this link. https://github.com/hopinxian/ip/blob/edf3563dd13317a61b999e300d535a1f9713898e/src/main/java/butler/io/Ui.java#L54

    It is possible to reproduce the error by changing "ERRORS:" to "ERROR:" and typing in an invalid command.

    Thank you very much for the explanation!

    Development environment:

    IntelliJ IDEA 2019.3.5 (Community Edition)

    Runtime version: 11.0.6+8-b520.66 x86_64

    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

    macOS 10.15.5

    Issue

    I was able to run on my terminal without any problem, as seen in https://ibb.co/6XWdCLk.

    However, when I tried to run the runtest.sh, there seem to be many errors in compiling.

    I am confused over this issue and would appreciate any help here!

    Error message


    Michaelias-MacBook-Pro:text-ui-test mich.aelia$ /bin/bash /Users/mich.aelia/Desktop/ip/text-ui-test/runtest.sh

    ../src/main/java/Duke.java:56: error: cannot find symbol

    ArrayList<Task> tasks = new ArrayList<>();

    ^

    symbol: class Task

    location: class Duke

    ../src/main/java/Duke.java:67: error: cannot find symbol

    Task.getListOfTasks(tasks);

    ^

    symbol: variable Task

    location: class Duke

    ../src/main/java/Duke.java:72: error: cannot find symbol

    ToDos.createTask(tasks, task);

    ^

    symbol: variable ToDos

    location: class Duke

    ../src/main/java/Duke.java:74: error: cannot find symbol

    ToDos.invalid_input();

    ^

    symbol: variable ToDos

    location: class Duke

    ../src/main/java/Duke.java:82: error: cannot find symbol

    Deadlines.createTask(tasks, task, due);

    ^

    symbol: variable Deadlines

    location: class Duke

    ../src/main/java/Duke.java:84: error: cannot find symbol

    Deadlines.invalid_input();

    ^

    symbol: variable Deadlines

    location: class Duke

    ../src/main/java/Duke.java:90: error: cannot find symbol

    Events.createTask(tasks, event, scheduled);

    ^

    symbol: variable Events

    location: class Duke

    ../src/main/java/Duke.java:92: error: cannot find symbol

    Events.invalid_input();

    ^

    symbol: variable Events

    location: class Duke

    ../src/main/java/Duke.java:97: error: cannot find symbol

    Task.done(tasks, index);

    ^

    symbol: variable Task

    location: class Duke

    ../src/main/java/Duke.java:106: error: cannot find symbol

    Task.delete(tasks, index);

    ^

    symbol: variable Task

    location: class Duke

    10 errors

    ********** BUILD FAILURE **********

    Link to my fork:

    https://github.com/Michaeliaaa/ip/

    Thanks guys!

    Here is my simple GUI with BT21 characters!

    Screenshot 2020-10-14 at 1 25 10 AM

    I had experienced the same problem with preview as well, "#" just transforms into "%23". @nopenotj 's solution of using chrome's pdf reader works fine for me.

    When I try to give Duke a command it does nothing and throws java.lang.reflect.InvocationTargetException and nullPointerException. The only thing that works is the "Bye" command and I suspect it has something to do with how the other commands attempt to manipulate elements within Duke like the TaskList.

    I tried to make the command call return just the toString of a Task but the exceptions were still thrown. Anyone encountered similar problems or know what could be causing this?

    Does the run function also happen to be able to show the line number where the exception was thrown?

    It launches fine with the images, if I type rubbish the "OOPS!!!" message comes up fine as well. It's only when the other commands are called that those exceptions are thrown 😦

    Library

    jfxtras-agenda

    jfxtras-icalendarfx

    jfxtras-icalendaragenda

    Purpose

    Display a calendar for appointment scheduling.

    License

    BSD 3

    Here's GUI with a cascading background 😄

    Ok thanks Prof!

    Some of you may have encountered the following error when attempting to create a new fat jar file using Gradle.


    Error: LinkageError occurred while loading main class duke.Launcher

    java.lang.UnsupportedClassVersionError: duke/Launcher has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0

    Essentially, the error occurred as we tried to run our class with an older version of Java compared to the version used to compile it.

    More specifically, in this case, we compiled our class with Java 13 and tried to run it with Java 11 as specified by versions 57 and 55 respectively.

    To solve this error, navigate down to your system environment variables and set JAVA_HOME to the java 11 sdk.

    Do refer to the following tutorial for a more detailed guide: https://mkyong.com/java/how-to-set-java_home-on-windows-10/

    You can also print the directory of your java installation by typing where java in the cmd.

    Hope this helps!

    Hi @xnmng, I managed to solve the issue by creating a default constructor in my Duke class. It can be as simple as

    public Duke()

    Hope this helps!

    Here's my variant of duke!

    Hi all,

    I am still facing the issue of some weird characters appearing in the console despite the ACTUAL.TXT and EXPECTED.TXT file has the exact output.

    I am using windows 10 OS terminal on intellij to run the runtest.bat.

    I have followed the thread:

    1. Added SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 to the runtest.bat

    2. Copied the ACTUAL.TXT contents to the EXPECTED.TXT and then run test agn

    Below is a screenshot of the issue.

    @AlexCQY try using a more powerful diff tool such as WinMerge to compare the two files. There may be differences not visible to the naked eye.

    Thanks prof indeed it is due to white spaces

    Hi the information on this thread solved the same issue i faced too.

    But I have a clarification that I would like to make. I am using a windows 10 OS with java version openJDK 11.0.5

    1. In the JavaFX tutorial it is mentioned that there are 2 choices for setting up javaFX (no gradle vs gradle), I am not sure if following just 1 option will do? Meaning if I have an openJDK after following option 1, do i still have to follow option 2 (Copy the code to gradle)?

    Thank you.

    After building my jar file using "gradle shadowJar", there is no response when I press "Enter" or click on the "Send" button in the GUI. However this does not happen when I run the GUI from IntelliJ. Does anyone else face the same issue?

    That didn't work though, still having the same problem. Tried running the jar file from the command line using java -jar duke.jar and got this exception:

    Just found the error, it's in my DialogBox.java when setting my fxmlLoader.

    After implementing javaFx, my duke logo is not displaying properly, I have tried playing around with the width and height to no avail. My other text is not truncated as well.


    String logo = ""

    + " ____ _ \n"

    + "| _ \\ _ _| | _____ \n"

    + "| | | | | | | |/ / _ \\\n"

    + "| |_| | |_| | < __/\n"

    + "|____/ \\__,_|_|\\_\\___|";

    Hi @damithc , I have this issue as well, when the repo I am reviewing also commits many of the same mistake. After reading the Best practices for reviewing PRs, I still did not find the answer I am looking for.

    Thanks prof, and everyone who helped.

    Set dialog.setStyle("-fx-font-family: monospace"); in DialogBox, where dialog is of type Label

    I encountered this error when running gradlew checkstyleMain

    which says that class org.codehaus.groovy.runtime.InvokerHelper could not be initialized.

    This was solved after updating the gradle version from 6.2 to 6.3 as shown in the image below. Hope this helps!

    Hi, I ran into the same issue. I fixed this by downloading the javaFX 11 SDK and following the steps under "if you are not using Gradle". Hope it helps!

    Hi! I'm not sure if I understand your question correctly. But if it is the case where your assert failing does not give an error message, it may be due to your JVM options. Here's the link that I used to rectify mine: https://stackoverflow.com/questions/48396274/how-to-enable-assertions-in-the-gradle-run-task

    I see that there are some solutions for getting Gradle checkstyle to work

    The current exception message is: Unable to create Root Module .... (shown in picture)

    I tried changing from version 8.23 to 8.29 and 8.1 following some advice from other issues but i'm still met with this error.

    May I know what else can I do to resolve this issue? Thanks!

    I also had that error.

    In the end, I compared my project structure to that of my friend's and apparently I had an extra Main module.

    I also had an extra Main method in the Duke class which might have been the cause of it.

    Delete the extra Main module using the tiny Minus button on top to make it like this

    I then reimported the whole project and ran Launcher and it worked.

    *edit: grammar edits

    Turns out I missed the part where I had to download the Checkstyle.xml and put it in the config file (Selfcreated)

    Thanks for all the help! Really appreciate it

    Maybe you can try adding System.exit(0) after Platform.exit()

    Hi I just left a comment on #180 but maybe you can try adding System.exit(0) after Platform.exit()?

    Here's mine

    I have been using the semantic commit style to do the IP. However, I just read 2103's Git Convention and realized that the style is not included in the convention. While it is mentioned that the format scope: change (e.g. Person class: remove static imports) is acceptable, the semantic commit style differs in capitalization and the addition of the type of change. As such, I would like to ask if it is acceptable to use the semantic commit style.

    Thank you!

    Reference:

    The format of semantic commit style is >type>(>scope>): >subject> (e.g. feat: add hat wobble, feat(parser): add the ability to parse arrays).

    (https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716)

    Thank you for the reply, Prof @damithc.

    With regard to your answer, I would like to ask if I need to change my last week's IP commit messages to match CS2103's convention, to avoid any penalty?

    Thank you!

    Noted, Prof @damithc

    Thank you for your help and clarification!

    Hello,

    does anyone know how to solve this error? It appears a few seconds after I run my Launcher. Everything works fine and I am still able to continue the operation on my duke window.

    Screenshot 2020-09-01 at 12 35 31 AM

    Thank you in advance:)

    @EugeneTeu Yup I am on macOs and my current version is JDK11.0.5. I look through the website you provided but it doesn't seem to provide any solution on this error except updating JDK, but we are restricted to JDK11 right?

    I think it works. Thank you very much.

    The problem is ICON_APPLICATION is trying to use address_book_32.png image from images folder but I got no image with that name in the folder.

    This is the error message:

    The problem is ICON_APPLICATION is trying to use address_book_32.png image from images folder but I got no image with that name in the folder.

    This is the error message:

    Hi @luo-git ! My team faced a similar issue and I think this will help you.

    try {
    
        if (SystemUtils.IS_OS_LINUX) {
    
            // Workaround for Linux because "Desktop.getDesktop().browse()" doesn't work on some Linux implementations
    
            if (Runtime.getRuntime().exec(new String[] { "which", "xdg-open" }).getInputStream().read() != -1) {
    
                Runtime.getRuntime().exec(new String[] { "xdg-open", urlString });
    
            } else {
    
                showAlert("Browse URL", "xdg-open not supported!", true);
    
            }
    
        } else {
    
            if (Desktop.isDesktopSupported())
    
            {
    
                Desktop.getDesktop().browse(new URI(urlString));
    
            } else {
    
                showAlert("Browse URL", "Desktop command not supported!", true);
    
            }
    
        }
    
    
    
    } catch (IOException | URISyntaxException e) {
    
        showAlert("Browse URL", "Failed to open URL " + urlString , true);
    
    }
    

    This is a workaround I found on the internet.

    After creating a jar file using shadow plugin, I tried to run it but encountered this error

    The way I solved it was to change the mainClassName under application in build.gradle.

    Assuming your main entrypoint is src/main/java/Launcher.java, you can change the mainClassName from main.java.Launcher to just Launcher and re-run the shadow task

    Hi prof, I am not too clear on what is included as the project management part of the individual project, and the team project. Can you clarify on this matter?

    Thanks prof! @damithc

    I encountered the same bug as you did and I have done the following to fix the bug.

    *It seems this bug is only encountered if you use Windows because it works fine when I run from UNIX terminal using WSL2.

    in the build.gradle file, add the following lines:


    compileJava.options.encoding = 'UTF-8



    tasks.withType(JavaCompile) {

    options.encoding = 'UTF-8'

    }

    and inside run{ ... } and test{ ... } in the build.gradle file, add the following:


    systemProperty "file.encoding", "utf-8"

    Now at this point, it should not display ? anymore when you run your chatbot using IntelliJ. However, since powershell by default does not use UTF-8, you will need to configure powershell to use UTF-8 encoding or else you will see ? replaced with other random characters. To configure, I simply typed the following commands inside powershell


    $OutputEncoding = New-Object -typename System.Text.UTF8Encoding

    [Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding

    Your powershell now should be able to display unicode characters 😃

    Hope this helps!

    References:

    https://gist.github.com/xoner/4671514

    https://stackoverflow.com/questions/21267234/show-utf-8-text-properly-in-gradle

    I encountered the same bug as you did and I have done the following to fix the bug.

    *It seems this bug is only encountered if you use Windows because it works fine when I run from UNIX terminal using WSL2.

    in the build.gradle file, add the following lines:


    compileJava.options.encoding = 'UTF-8



    tasks.withType(JavaCompile) {

    options.encoding = 'UTF-8'

    }

    and inside run{ ... } and test{ ... } in the build.gradle file, add the following:


    systemProperty "file.encoding", "utf-8"

    Now at this point, it should not display ? anymore when you run your chatbot using gradle in IntelliJ. If you use powershell to run gradle you will need to configure powershell to use UTF-8 encoding or else you will see ? replaced with other random characters. To configure, I simply typed the following commands inside powershell


    $OutputEncoding = New-Object -typename System.Text.UTF8Encoding

    [Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding

    Your powershell now should be able to display unicode characters 😃

    Hope this helps!

    References:

    https://gist.github.com/xoner/4671514

    https://stackoverflow.com/questions/21267234/show-utf-8-text-properly-in-gradle (Fernando Sanchiz's answer)

    Here's my very minimalistic GUI which will be updated in future increments 😄.

    Does anyone know how to get image files (the right image file path to use) from the data folder? I was able to write the images that were downloaded using URL into the local data folder which has the same directory as jar file but couldn't retrieve them to display in the application.

    I tried using ("data/" + filename) as the image path but doesn't seem to work.

    Ohh thanks for your reply! but I meant like how to get the correct image filepath (files in data folder) to parse and create an Image(filepath) object so that I can do imageView.setImage(Image) to display in the application for jar file testing 😢

    Yes. I solved the issue by adding these paths to the original image path then it works. Thanks everyone for the help!

    1. "file://"

    2. Using this.getClass().getProtectionDomain().getCodeSource().getLocation(); to get the location of folder where user saves the jar file

    Library

    ControlsFX

    Purpose

    To provide autocomplete feature and UI-related add-ons to JavaFX

    License

    {BSD 3-Clause License}(https://github.com/controlsfx/controlsfx/blob/master/license.txt)

    Hi. I encountered the same problem as you, and managed to fix it by changing:

    Run > Edit Configuration (Duke) > VM options: -Dfile.encoding=UTF-8

    Hi. You might have missed out the class attributes

    Should the tag for the release of my .jar file be named A-Jar, or should it be named v0.1?

    Hi all, I am facing this problem when running the runtest.bat file on my terminal.

    First I encountered this

    -> 'Javac' is not recognized as an internal or external command, operable program or batch file.

    I managed to solve it by writing this in my terminal

    -> ...\text-ui-test>set path=C:\Program Files\Java\jdk-11.0.5\bin;

    Then I ran into this error

    ->'FC' is not recognized as an internal or external command, operable program or batch file.

    smh my head... did anyone encounter this or is facing the same problem?

    @xnoobftw @damithc Thank you very much! After much searching, it finally works!

    Hi guys, on my mac, If i were to create a separate package for all my exceptions, the sh file doesn't seem to be able to read that package, any idea how to change my sh file such that it can read the package too? Currently, its as such:

    error message says:

    Hi if i were to create a separate package for all my exceptions, the sh file doesnt seem to be able to read that package, any idea how to change my sh file such that it can read the package too?

    Yeap its working now, thank you very much!

    I merged one of my team member's PR into our own tp master branch (that passed all CI tests), and have received an error message of

    Error:getaddrinfo ENOTFOUND downloads.gradle-dn.com from [nus-cs2103-AY2021S1/tp] Java CI workflow run

    Anyone knows how to solve this issue?

    Thanks in advance.

    Screenshot 2020-11-08 at 1 12 47 AM Screenshot 2020-11-08 at 12 47 04 AM

    @damithc I re-ran the CI tests under our own tp repo and have passed the tests. However, I'm not passing the CI thats done under [nus-cs2103-AY2021S1/tp] Java CI workflow run and unable to rerun as well.

    If the merge action has passed the CI on our own tp repo side, can the above issue be ignored?

    @damithc okay sure thank you for your help Prof! 😃

    I encountered InvocationTargetException in the past. For my case it was because the path for the image in userImage/dukeImage didnt exist/typed incorrectly

    Late to the party 😂 but now that everythings finalised, heres mine

    hello, this is likely because the path for the image in userImage/dukeImage doesnt exist or was typed incorrectly

    can see #219

    Hi I have a question regarding how the grading/progress checking is done for the individual project

    For the grading script used for the individual project, is it sufficient to push all changes to the master branch of our own repository forked from https://github.com/nus-cs2103-AY2021S1/ip or do we have to submit a pull request to the master branch of https://github.com/nus-cs2103-AY2021S1/ip?

    Also do we have to work purely on the master branch or can we create a new branch from the master branch and work on the branch created and then merge that branch into the master branch?

    Thank you

    Okay thank you Professor

    I just followed the tutorial of JavaFX step by step.

    But found this problem:

    At first, the label from Duke is displayed well, but once Duke displays a shorter label, the previous labels will become short too.

    And later labels cannot be displayed well also.

    Does anyone know how to fix this?

    I think this is a similar issue to the one in #125

    IT WORKS! THANKS !!!!!👍

    I had pushed the assertions branch earlier than the code quality branch, yet the script somehow only detected the code quality branch. How do I solve this? Thanks!

    No, I haven't. Does the script only detect branches merged to master/up to date with master?

    For the NoSuchElementException, it might be the case that sc.nextLine() is called without checking sc.hasNext(). Since the test input.txt file is empty, it will throw an error when the scanner cannot find the next line.

    For me, for the .sh (or .bat) file, I added a line that deleted the data file before running the test if the file exists initially. So that the test can run from a clean slate.

    Dear Prof,

    I have added the tags after commit sequentially which results in

    Screenshot 2020-08-20 at 5 08 48 PM

    My commits are in sequence.

    Will it cause any issues in grading or testing?

    Thank you prof ☺️

    Versions:

    IntelliJ : 2019.3.1

    SourceTreeSetUp-3.3.9

    JDK: 11

    Context (What I did step by step):

    1. Did not create branch for JavaDoc, CodingStandard and Level 9. Did all on master branch. Pushed to GitHub.

    2. Decided to revert master branch on local repo to the commit before all those changes. (Point A-Jar).

    3. Created the 3 branches but named some branch wrongly (A-JavaDoc, A-CodingStandard)

    4. Did the coding on the branches and push to GitHub. (Before merging to master branch)

    5. Merged the branches to master branch, retag the commit.

    6. Realised branch is name wrongly and went to rename.

    7. Revert master branch to the commit before all changes again (Point A-Jar).

    8. Merge branch to master again, retag.

    9. Try to push but failed.

    10. Went to GitHub to delete the wrongly named branch and pushed local repo again but failed.

    tl;dr: My branch-A-JavaDoc and branch-A-CodingStandard is not appearing as local repo option to push. When I try to push there is some error which I do not know how to resolve.

    Thank you for the assistance in advance. I can clarify again if there is anything not clear.

    Screenshot below:

    ![Error1](https://user-images.githubusercontent.com/54731199/91254557-46ab5b80-e795-11ea-807e-e14120c90d6c.JPG

    Thank you so much Prof! I managed to push it to GitHub with that! However 2 of my branches (branch-A-CodingStandard and branch-A-JavaDoc) is still missing from the push option. May I know why is this so and how to resolve?

    *Edit: I manage to push my branch to GitHub using CLI but it's still not showing on SourceTree.

    Hii !

    When I copied the jar file to an empty folder and used the required command, it said that the file could not be accessed. Here are some things I've noted :

    -> I can run Duke smoothly with no errors but when I compiled Duke.java manually, it produced errors but I suspect the root issue is because the package does not exist. However, the packages were set by Intellij automatically for me.

    -> In the Manifest.MF file, the main class reference to Duke is in red

    -> For some reason, I am unable to create new directories in my iP root folder (Intellij doesn't give me the option to). Im unsure if my Intellij configurations are affecting this issue

    These are the main errors from compiling Duke.java :

    Screenshot 2020-08-27 at 8 21 42 PM

    This is how my project structure looks like:

    Screenshot 2020-08-27 at 8 27 19 PM Screenshot 2020-08-27 at 8 27 39 PM

    I followed the instructions in creating the JAR file and it was created, just could not access it. Pls advise me on this ! Thankyouu 😃

    Thanks for the recommendation prof ! It prompted me to relook at my project configurations and I realised that there was an issue with packaging because my src>main>java folders were configured as packages by Intellij. After manually converting them to Sources Root folders, I could compile successfully and my JAR file works now 😃

    This is where I converted src.main.java under Project Structures :

    Screenshot 2020-08-27 at 9 08 57 PM

    Might be useful for those who have issues with Intellij configurations. Thanks prof ~

    My team has had this issue several times and am wondering how we should manage it.

    Thanks!

    Hi Prof,

    I reverted my PR and remerged so the problem is fixed alr. But just wanted to check if there's a way to determine what the issue is. Because what happened was when I merged my PR, it was passing all the JavaCI. But it then turned red after it merged into the master (about 1 hour after).

    The above image is from my PR.

    Context

    By default, github unfolds all files in the Pull Request file diff view.

    Sometimes it may be helpful to get an overview of the directory structure before going straight into reviewing the code. You could fold each file manually, but it can take a lot of work to fold all the files that has been changed.

    Tip

    In order to fold all files, hold down the alt key and click on the inverted caret icon in any file header.

    src: https://github.blog/changelog/2018-08-17-collapse-all-diffs-in-a-pull-request-at-once/

    This may be because the text content in your label exceeds the height of the label and hence it is being cut short.

    What worked for me was adding minHeight="-Infinity" as an attribute to the label component in DialogBox.fxml to show the full content of the text. Maybe you could try this?

    I have just configured the mainwindow for part 4 of the FXML setup and when I run launcher, it shows this

    Caused by: java.lang.reflect.InvocationTargetException

    Caused by: java.lang.NullPointerException: Input stream must not be null

    Has anyone faced this problem as well?

    bug

    @aizatazhar @sudogene alright thank you guys it worked for me 👍

    I noticed that there's this submission via TEAMMATES for week 4 tP.

    Do we follow the general deadline for tP (which is 23:59 before the tutorial day, in my case is this Wednesday 23:59) or the deadline given on TEAMMATES submission page (which is this Friday 23:59)?

    OK, noted! Thank you!

    Hi prof,

    May I ask whether the grading bot follows redirections? Since I have a personal domain and somehow github by default published my ip to my personal domain and https://asthenosphere.github.io/ip/ is redirected to http://asthenosphere.me/ip/. I have checked github settings and couldn't find any place to stop using my own domain (I didn't add custom domain either). Thank you!

    Hi prof,

    Thank you very much for the help! I think my domain server has some problem as I could access it sometimes but other times it will be a 502 bad gateway. Will investigate that more.

    Remember to give sufficient details e.g.,

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

    JavaFX 11.0.2, Gradle 6.6.1, IntelliJ IDEA 2020.2.1 (Ultimate Edition), Java 11.0.8, Windows 10

    Hi, I'm having trouble getting the tick and cross symbols to appear in my JavaFX gui.

    I'm currently using the unicode characters in my code as seen in the first screenshot:

    After some testing I realised that the only instance the symbols get output correctly is when I run the task directly from IntelliJ.

    The second screenshot shows when I run Duke as a run configuration and it outputs the tick and crosses perfectly:

    The third screenshot is when i try to run the gradle task (as you can see from the elephant symbol) to start Duke (run task) it outputs the symbols incorrectly.

    I have viewed others' code who have successfully output the symbol in their sample GUI as seen here: #147, and they have used the same unicode in their code. My gut feeling tells me it could be some unicode character issues with gradle and possibly JavaFX, but I have no clue on how to remedy it, does anyone have any idea how to do so?

    Yup this worked for me

    Not sure if you solved it yet but I encountered the same problem and solved it by going to Run > Edit Configurations and changing VM options to -Dfile.encoding=UTF-8

    after some digging in #95.

    Thanks for the replies!

    Hi I realise its been a while since but ,my tag for Level-8 was not detected even though its clearly been up for a while already. Could I get some help on rectifying this? Thanks!

    Hi I would like to ask how to test such a method, for example my deadline class throws a exception in the constructor


    @Test

    public void testDeadlineClassAutoCorrectsBlankDateField(){

    try{

    Deadline deadline = new Deadline("random_desc","");

    assertEquals(deadline.getDateby(),LocalDate.now().toString());

    }catch (Exception e){

    e.printStackTrace();

    }

    }

    As show, i need to enclose it within a try catch method in order to even get it to function. Is there some cleaner way to do this in jUnit?

    Googling this, I saw some code examples where they did:


    @Test(expected = Exception.class)

    But i am unable to reproduce this on my intelij

    Thanks

    the file strucutre is as follows

    I can run the main method in Duke.java by using the green run button next to the method however when i open the intellij terminal and try to run the .bat file i get the following errors:

    Appreciate any help. Thanks

    Thanks Saad. That worked!

    For instance, do we need to create individual issues for uploading .png images to AboutUs page or just individual pull requests is fine for this?

    Also, for the initial week 7 v1.1 minor changes to docs, do we need to create individual issues per change?

    Regards and Thanks,

    Kamil

    noted with thanks sir

    I have 2 options to handling errors, the System.out.println way and the throw DukeException.something way.

    More specifically, in the todo example in Level-5,

    If I do System.out.println("todo bad"), Duke continues running, which is good*

    If I throw DukeException.empty("todo bad"), Duke exits, which may not be good*

    *personal preference

    Since Level-5 recommends implementing Exceptions, does this mean it's ok for Duke to exit upon encountering an error?

    Is there a 3rd approach I'm not seeing? Something that uses Exceptions but allows Duke to continue running?

    Thanks for the replies,

    inside my catch block is simply a

    sys.out.println(e.getmessage())

    this solved my problem.

    Right now we're using the initial table of contents, which as points for each section shown below.

    Is this ok? Should we change it?

    https://github.com/nus-cs2103-AY2021S1/forum/issues/361, found the answer here.

    In the Checkstyle tutorial, we are directed to the checkstyle.xml found in AB3. However, under the header "Using Checkstyle with Gradle", a sample build.gradle file is given as such:


    plugins {

    id 'checkstyle'

    // other plugins

    }



    checkstyle {

    toolVersion = '8.23'

    }

    However, the checkstyle.xml file found in AB3 uses Checkstyle v8.29, which notably causes the LineLength rule to fail with an ambiguous error (Unable to create Root Module) if one follows the sample build.gradle as seen above. The build.gradle file provided in the add-gradle-support branch of the ip repo also fixes Checkstyle at v8.23. Should these references be updated?

    If you implemented your main class as suggested, I don't think you'll need to use System.exit() since the program will automatically terminate when it reaches the end of the main() function.

    My group brainstormed user stories before we started on the tp and noted them in our DG. However, at the end of v1.4 we realize some user stories are not relevant anymore as we did not manage to implement the features related to those stories. Do we keep the irrelevant user stories in the DG or should we remove them to and only keep relevant user stories? (By relevant, I mean user stories which the related feature is implemented)

    Ok thank you prof!

    After completing level 10 got this error

    Screenshot 2020-09-01 at 9 36 01 PM

    I tried to revert the commit and that didnt help also

    I manage to fix the problem by setting up java Fx and gradle again. Thanks

    Hi everyone,

    I followed the instructions under the scenario 2 of "adding gradle to the project". However, after closing the project and reopening it, I am unable to see my files in intellij (as shown below). I have tried closing and reopening the project a few times but there is no difference.

    If anyone else had a similar issue before, may I ask how you managed to resolve it? Thank you!

    Thank you Prof and @Nahoyhp. I actually forgot to import the project using the build.gradle file and I think that could be a reason why my files were not accessible on the left panel. I copied my files to another folder (e.g ip2) and imported the project (pointing to the build.gradle file this time) and it works fine now.

    Does anyone know how to disable codecov? I can't seem to find an instruction on how this is done.

    Can confirm

    After following the guides for using Gradle, I now get this error when running DukeTest. Anyone knows how to fix it?

    Thanks! That worked!

    How much should we write into the Implementation Section of the DG? Do we have to write about the features we inherited from AB3?

    I see, thank you Prof!

    Hi Prof,

    Lets say I have done Level-1 and have pushed everything to the remote repo but realised later on that there is a bug in Level-1 and fixed it at Level-8 and pushed it to the remote repo along with the Level-8 tasks. Do I get penalised for that? Or only the end product matters?

    Thank you!

    Alright thank you Prof!

    Hi,

    after importing my project with Gradle, I found that my project structure had changed. It had marked my /src/main/java folder as the sources root causing issues with my import statements, as main.java is no longer as a package. When I tried marking /src/ as the sources root instead of /src/main/java, my class files are no longer recognized as class files by intelliJ.

    I was wondering if anyone else had encountered such an issue and was able to resolve it. Any input would be appreciated.

    Thanks in advance.

    Thanks!

    I realized that I may have been using an incorrect initial project structure and packaging.

    I have changed my project structure and packaging, and everything seems better now.

    Our product is called HairStyleX, should we rename the AddressBook class/packages to reflect this?

    Sorry I realised this question was already answered and I was searching with the open issues filter on 😅

    It would be better to link to that issue so people can find it when they arrive here.

    It was #125 . The solution was adding minHeight="-Infinity" as an attribute to the label component in DialogBox.fxml

    I had a similar problem when I was first setting up. I resolved it by resetting up the project, but this time using IntelliJ's "Import", instead of "Open".

    i.e.

    I think codecov is back up. It is working for my team.

    Hello, I followed all the instructions for creating a JUnit test but when i tried to refer to Duke from the DukeTest class when running the test, I got a "java: package duke does not exist" error message. I tried imported the Duke class as well but it didnt help. I've attached my JUnit test code below. Any help is greatly appreciated!

    Capture

    hello prof, yes i used option 1 where Intellij helps me add the main module as a dependency. However, when I went to check the module dependencies for my 'test' module i saw this. Is this supposed to be correct? Thank you!

    Okay, sorry, I realised I had to either change the main class in the build gradle file.

    Hi, I'm also having the same problem, do you mind to share more details? thanks in advance!

    Okay, sorry, I realised I had to either change the main class in the build gradle file.

    @yanbingtao You could try the solution posed in #101. Hope this helps!

    thanks!

    I was looking at the new example videos for UML diagrams and was wondering if we need to include the functions from the base class in the derived class. In the videos, the classes all inherits from an abstract class so the functions should be included in the derived class. However let's say we have the following example:

    class Human {

    void sleep()

    }

    class Male extends Human

    Do we need to write the method sleep() in the Male class (assuming the function is not overridden) since it is already in Human class?

    Hi all,

    I was reading the textbook and under the section OOP Associations -> Multiplicity and there is an example regarding bi-directional association as below:

    In the code below, the Foo class has a variable to hold a Bar object and vice versa i.e., each object can have an association with an object of the other type.


    class Foo {

    Bar bar;

    //...

    }



    class Bar {

    Foo foo;

    //...

    }

    I was just wondering since this code leads to cyclic dependency and considering how cyclic dependency makes it harder to test your code and thus should not be used from OOP perspective, when will bi-directional associations actually be useful or important?

    I had this problem too, managed to fix it by shifting the test folder into this specific directory: src/test/java

    Thanks for the tip!

    I am having trouble with the launcher. My application seems to work fine when it is Application.launch(Duke.class, args), however when i change it to Application.launch(Main.class, args), the application echos back whatever i type to it. This means that my Duke class is handling everything. I have followed the tutorial step by step.

    I am also only able to launch the GUI from the launcher class and not from gradle. Am very confused at this point.

    I managed to solve it. I think i was a little confused, I had a start and handleUserInput methods in Duke.java as well, after i removed the methods it works with Main.class.

    Library

    fx-progress-circle

    Purpose

    We want to incorporate this JavaFX implementation to show the % progress of a product's development in a circular manner.

    License

    Licensed under the Apache License 2.0. See more at https://github.com/torakiki/fx-progress-circle/blob/master/LICENSE

    Hi @xnmng, I had this issue also. I just commented out the entirety of the old code and followed the JavaFX tutorial. Only after you finish the tutorial should you figure out how to incorporate both together. Hope this works! ⛄

    Hello, when I try to run the jar file that I created, I run into this error message:

    Error: LinkageError occurred while loading main class duke.Launcher

    java.lang.UnsupportedClassVersionError: duke/Launcher has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 55.0
    

    My project sdk is 11.0.5 but the java version on my com is 13.0.2 Do I need to download java 11 on my com to run it? or is there some other issue?

    Thanks!

    I see thanks so much!

    I had a similar problem and solved it by adding set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 in the runtest.bat file

    Maybe you can try adding an empty constructor public Duke() {} in the Duke class. I managed to solve the problem after adding it.

    Hi, perhaps you should check the console for the error messages! My jar file worked perfectly fine in the original directory within the ip folder, but it didn't work in another directory because of bugs in my Storage code. If your jar file works in your original directory, I think there might be an issue with retrieving/creating data files in your new directory. Hope it helps!

    Here's my KING BOB chat bot!!

    Ui

    Hi @TCQian , perhaps you might want to look at the Vbar policy of the ScrollPane under"properties". By default it is vbarPolicy="AS_NEEDED" but you can consider changing it to vbarPolicy="ALWAYS" to force the scrollbar to appear.

    If your UI is not resizable, you can try setting a fixed value to your MAX_HEIGHT as your VGrow properties might cause the ScrollPane to grow larger than your Stage and hence the excess will not be shown.

    @TCQian Try removing your prefHeight for the scrollpane, and/or your vBox wrapper

    I keep getting this error after adding Gradle to my project. My test classes stopped working too even with my old import statements. Anyone encountered this?

    I shifted my test classes to the test root folder. I overlooked this as it worked before I incorporated it with Gradle

    upz leh

    Here's my gui 😃

    Screenshot 2020-09-08 at 10 52 15 AM

    Library

    Apache Commons Validator

    Purpose

    To validate format of url links that users input

    License

    Apache License (http://www.apache.org/licenses/LICENSE-2.0)

    Screenshot 2020-09-03 at 5 00 54 PM

    Hi, does anyone know how to add audio to the application using JavaFX? I've tried importing the relevant packages but IntelliJ doesn't seem to be able to detect them.

    Any help would be appreciated! Thanks!

    Thank you prof! @damithc . I think I will be closing this thread for now as it doesn't seem like anyone has any suggestions regarding this feature.

    Just testing my iP for final submission and thought I should share this little edge case which others should consider handling:

    If you use "|" or any other symbols for storage, consider disallowing your user from using them for task description. Otherwise, if a user does:

    event CS2103 | Lecture /at 2020-09-18

    This will cause an error when the file is saved and reloaded the next time the application is launched.

    Personally, I show an error message when the user uses "|" and "" in their description. Hope this is not too late for others to make changes! 😃

    Edit: Grammar

    Hi guys,

    Is the checking program case-sensitive? I just noticed that I wrote all my tags in lowercase but in instruction, the first character of the tag should be capitalized, like 'Level-1'. Do i need to change my tag and make it exactly the same as the instruction?

    Thanks a lot.

    edited my gui so that it now has max kawaii-ness :DDD

    Hi,

    I had the hardest time fixing this error. Don't forget to check for Java version on IntelliJ terminal using java --version, if it still says Java 13, restart your computer. I've found that IntelliJ does not register the changes to environment variables until I restarted my computer (I've done "File -> Invalidate Caches/Restart" at least 10 times before to no avail).

    Here's a few extra tips to ensure you're compiling correctly:

    1. Ensure your JAVA_HOME points to the Java 11 sdk folder and not the bin folder.

    2. Double check your Path variables as well. Path variable should point to your Java 11 bin folder.

    3. IntelliJ, File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler, ensure that bytecode version is set to 11.

    4. IntelliJ, File -> Project Structure -> Project Settings -> Project, ensure that project SDK is set to Java 11.

    5. IntelliJ, File -> Project Structure -> Project Settings -> Modules, ensure module SDK is set to Java 11.

    6. IntelliJ, File -> Project Structure -> Platform Settings -> SDKs, ensure JDK home path is pointing to correct Java 11 folder.

    7. Check your build.gradle file, ensure that all dependencies are compatible with Java 11.

    Cheers!

    Checkstyle is failing me when I do type-casts; it tells me that the left parenthesis should be on the previous line. It does not really make sense though. How do I fix this?

    @florenciamartina Your screenshot shows that it's looking for ACTUAL.TXT in the src\text-ui-test, but that folder isn't supposed to be in src. I don't use Windows but I'll give this a shot.

    To fix this we first need to understand what this command is doing. Those tokens starting with a - e.g. -cp and -d are flags you can pass to javac to specify certain arguments. Running javac -help gives a brief description of what each flag does. So -cp specifies a class path, and -d where to place the generated class files.

    Now, back to the command. You modified -cp to ..\src\main\java, which is probably fine for now (it'll look for your Java Files in that folder). You then modified -d to ..\src\bin. This means that it'll place your generated class files in that folder. You probably don't want that, because Line 22 runs Duke from ..\bin. Since your files are in different folders, it's likely the cause of your Could Not Find error.

    How might we fix this then? You need to fix the paths. You'll probably want to change the ..\src\bin back to ..\bin. Btw, I also suggest removing -source 1.8 -target 1.8, as the website tells us to use Java 11 and those 2 will make it use Java 8.

    So something like this might work:


    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java

    Most of my work has been either adding additional fields to existing classes or integrating pull requests, and the only thing worthy of a DG entry is the user interface. Am I allowed to explain the user interface for the DG assignment?

    Abit late but heres my GUI!

    Screenshot 2020-09-04 at 9 04 14 AM

    Here is my GUI with a spongebob theme!

    Screenshot 2020-09-12 at 11 53 50 PM

    I met the same issue and narrowed it down to the following line in PersonBuilder:

    public static final String DEFAULT_REMARK = "She likes aardvarks.";

    Because we set every Person to be built with the above default remark unless they have a remark specified, when building each Person in TypicalPersons.java, every person without a specified remark will have the default remark. However, in the equivalent json file, each person is built with their respective empty remarks.

    In the original tutorial that does not ask us to modify the equals method, this bug is not apparent because we do not compare the Remark of each Person.

    Edit: Not sure if this was the intended effect of the tutorial, or if this was a bug?

    just to check do u have doublequotes surrounding these lines:

    "%MY_PATH%\bin"

    I also have the same problem even if i removed the doublequotes regarding the SET_MY_PATH line

    I had a lot of problems with runtest.bat, which (thankfully!) got solved eventually. My question is why are there so many different solutions, and why do they not work for some? Referring to the solutions found in #3 #4 #7

    I'm curious as to why some only need an extra path to get their .bat to run while some need complete overhauls like:

    dir /s /B ..\src\main\java*.java > sources.txt

    javac -cp ..\src -Xlint:none -d ..\bin @sources.txt

    which replaces

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Duke.java

    and also what does the overhaul even mean? In the original, I roughly understand what the flags mean, but I have no clue what the overhaul is talking about.

    Thanks in advance! 😃

    Library

    Commons IO

    Purpose

    To facilitate in file operations such as displaying external PNG, JPEG files in our team's application

    License

    I pushed the A-Assertion, A-CodeQuality, and BCD extension tags last Thursday, but somehow only the A-Assertion tag was detected. How could I solve this? Thanks in advance!

    Hi, I would like to suggest an alternative to the two methods above. In this case, it could be good to separate out the functionality into another class. You've accurately determined that both the deadline tasks and event tasks could be referred to as "timed tasks". So, you could try having an abstract class, TimedTask, for example, to be a child of the Tasks class.

    In this case, all timed tasks will extend this new class and have the additional functionality of a returnTime() method while still maintaining the functionality of a Task class itself. While it does not fix the typecasting issue as you would still have to typecast the tasks to TimedTask in order to access the returnTime() method, it will prevent code duplication in this case.

    Hope this comment was helpful in helping you find your solution.

    Personally, I don't think using exceptions as logic statements (using exceptions to determine a Todo class) is a very good practice, but it may just be me.

    I'm guessing that runtest.bat is using an outdated version of the Duke.class file. This might occur after you implement packaging.

    First, try deleting all the files in ./bin/, then running the batch file again. There should be some error about not being able to find the Duke class, which you can then resolve by using java -classpath ..\bin duke.Duke &gt; input.txt > ACTUAL.TXT instead of java -classpath ..\bin Duke &gt; input.txt > ACTUAL.TXT

    Try replacing the cross symbol with the unicode u2718 i.e. "\u2718" and see if it works.

    https://medium.com/@osamadwairi/unmappable-character-for-encoding-java-compiler-issue-e2c5cfc28273

    Hi, i think you need to change the mainClassName under application in build.gradle. For example,

    Hello, Im having issues with my Level-5 tag... Basically it says that my commit does not belong to any branch on my repo.

    Below is a snapshot of my sourcetree.

    Also, when i do git log Level-5, it shows that it is linked to my previous commits as shown below.

    When i try to push all tags on Master,

    I get these error messages:

    I tried deleting the Level-5 tag, pushing, and re-creating the Level-5 tag at the same commit and pushing it again.

    The same error occurred.

    Any help will be greatly appreciated... Thanks in advance!

    Hi there Lingy12 I am not entirely sure since your screen shot cut off the import lines above, but you could try adding this import line. The error looks like its due to u importing the wrong line. Cheers!

    import static org.junit.jupiter.api.Assertions.assertEquals;

    Hi and thanks so much for the fast reply. But now I am facing another issue.

    Now when I extend the window, the send button doesn't move with the text box.

    In SceneBuilder, click on the send button, then on the right panel, click on layout and make sure the value in this box is the same as the textfield.

    This will ensure that the button will scale together with the textfield.

    I had this error as well.

    Alternatively.

    If you check your javac -version it will be JDK11, but if you check your java -version it is likely not 11.

    You can change your java runtime environment to the required environment it should then work.

    Technical details:

    • Using a Mac

    • Working on IntelliJ

    • Java Version 11

    My code works perfectly fine, i have also resolved all checkstyle issues. However, when I push onto my team's repo I always get the following error message that fails the CI:


    ERROR:../docs/UserGuide.md:146: prohibited \r\n line ending, use \n instead.

    ERROR:../docs/UserGuide.md:147: prohibited \r\n line ending, use \n instead.

    ERROR:../docs/UserGuide.md:148: prohibited \r\n line ending, use \n instead.

    WARN:../README.md:7: trailing whitespace.

    WARN:../docs/AboutUs.md:25: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:245: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:294: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:296: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:302: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:304: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:306: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:310: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:316: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:318: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:319: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:336: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:338: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:340: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:367: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:388: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:390: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:394: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:396: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:424: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:485: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:486: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:495: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:503: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:509: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:513: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:525: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:533: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:541: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:571: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:594: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:614: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:616: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:618: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:626: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:628: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:630: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:631: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:634: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:646: trailing whitespace.

    WARN:../docs/DeveloperGuide.md:658: trailing whitespace.

    WARN:../docs/UserGuide.md:31: trailing whitespace.

    WARN:../docs/UserGuide.md:33: trailing whitespace.

    WARN:../docs/UserGuide.md:124: trailing whitespace.

    Error: Process completed with exit code 1.

    So the scenario is that I accidentally deleted my docs folder and I already committed with new code afterwards so i asked my team member who happens to be using windows to pass me a zipped copy to replace it. Since CI kept rejecting, i decided to try cloning the docs folder from my previous git commit on the master branch and placing it inside the branch i'm working on, however the error message as shown above still keeps popping up. Is there any way to fix this issue?

    @StopTakingAllTheNames Thank you for the guide!

    Here's mine

    Were you at iteration 2 of part 3? I previously had this problem there too. Have you added the 2 images to the main/resources/images folder before running Launcher?

    If it was at an earlier stage, I guess you could ensure that your Duke class is public. https://coderanch.com/t/646737/java/subclass-javafx-application-Application-public

    Library

    Mockito

    Purpose

    Allow dependency-free unit testing using mocks. Reduce time needed to write stubs.

    License

    Licensed under the MIT License.

    Is there any way to solve this issue without updating JDK? I encountered the same problem on macOS as well.

    Added a bit of styling and changed the icons!

    Hi Prof, can I ask a question about the format of the command that the user inputs? If for a command, for example "list", there are white spaces in front of the word "list", should it be considered as the same as the command where there are no white space in front of the word or should it be considered as a different command? Thank you very much!

    I have another issue when testing using the runtest.sh file after including error messages thrown using custom exception classes for Level-5.

    Not sure if it is caused due to using System.err.print(ex); instead of System.out.print(ex);, causing the error messages to not be captured in the EXPECTED-UNIX.TXT and ACTUAL.TXT files although I included them in my EXPECTED.TXT file for testing.

    Hence would like to ask if it's alright to not include "expected" error messages thrown using System.err.print(ex); in our EXPECTED.TXT file?

    Hi everyone

    When I was typing JavaDoc comments for Constructors, I searched up examples online and decided to go with this format:

    /** Constructor.
    
     *
    
     * @param num The index of the task to be marked as done.
    
     */
    
    public DoneCommand(int num) {
    
        this.num = num;
    
    }
    

    I have a question though. Since the constructor is also a public method, should the Javadocs comment also start with a verb?

    i.e. instead of "Constructor." its "Constructs a DoneCommand.'

    I also seek for a quick clarification. Are JavaDoc comments not needed for private fields and methods?

    Thank you!

    solved: unmark main as module

    Hello! may I ask how did you unmark main as module please?

    Library

    Font Awesome 5

    Purpose

    Add icons to improve the app's UI

    License

    Apache License 2.0

    Hii! Here's my simple GUI, changed it to a cat theme and increased the width. 😃))

    You can try using assertThrows as seen here https://howtodoinjava.com/junit5/expected-exception-example/