Go to CS2113/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 πŸ‘)]

    In one of my exception handlers, I print some helpful, user-readable error messages, followed by a call to e.printStackTrace(); which prints the exception stack trace to System.err. The application then continues as normal, printing normal operation messages.

    The expected output is:


    Sorry there was an error, here's the stack trace:

    *stack trace*

    *normal operation message*

    But the actual output is:


    Sorry there was an error, here's the stack trace:

    *normal operation message*

    *stack trace*

    I've experienced in the past that System.err is much slower to print to than System.out, and I suspect that's why this is happening. Is there any recommended workaround for this problem then? I could use Thread.sleep() but that doesn't sound like good code...

    Hi again everyone, it's me back again with yet another thing I broke...

    So for my Junit test, I wanted to test the (printed) output of a piece of code, which in itself required some wonky workarounds (setting System.out to a different outputstream and comparing...) However, the same issue with CRLF vs LF reared its ugly head... again.

    As we know, running the program in Windows will result in using CRLF for the output. However, when I use assertEquals, my String uses LF so it doesn't pass the test. I changed the string to use \r\n instead of \n and it passed the test; however, now it fails on Ubuntu (and I suspect it will also do so on macOS)

    Is there any way to modify the test for different platforms so it, for example, matches to a different String depending on the platform?

    Suppose I have a class defined as follows:


    public class Notebook() {

    private String title;

    private String content;



    // method 1: using parameters

    private void printNotebookWithTitleParameters(String notebookTitle, String notebookContent) {

    // print it with both notebookTitle and notebookContent

    }



    private void printNotebookParameters(String notebookContent) {

    // print the notebookContent

    }



    // method 2: using the instance members defined

    private void printNotebookWithTitleNoParameters() {

    // print this.title, this.content

    }



    private void printNotebookNoParameters() {

    // print this.content

    }

    ...

    public void print(boolean withTitle) {

    if (withTitle) {

    // method 1:

    printNotebookWithTitleParameters(title, content);

    // method 2:

    printNotebookWithTitleNoParameters();

    } else {

    // method 1:

    printNotebookParameters(content);

    // method 2:

    printNotebookNoParameters();

    }

    }

    }

    Which of the two methods (1 or 2) is preferred for elegance and testability? @longngng argues that method 1 is better, because it makes the methods more general, and easier to test because they do not depend on the instance variables. I argue that method 2 is better, because in unit testing, we would have to instantiate the class anyway to test the methods, and using the parameters causes unnecessary redundancy and increased coupling.

    Great day, everyone πŸ˜„

    According to the lectures, and the notes on the website/textbook, something like

    InputParser ip = new InputParser ();
    arguments = ip.getArguments(input);

    Is preferred over

    arguments = InputParser.getArguments(input);

    However, if we have a class for printing the messages in the UI, must that also be instantiated every time? It would have to be instantiated in almost every single class in our program which I feel would bloat it somewhat. On the other hand it would make it less easily testable.

    In my iP, I wanted to use some text files as resources, containing some (not user-generated) data for my program. In the IDE, I was able to do so using the normal Files method, but this doesn't work with accessing files within a jar, as seen in #51 .

    I followed the tutorials online, but I couldn't seem to get the IDE to package the resources folder inside my jar, no matter what I tried. Finally, after poking around in the project settings, here's what I found out you have to do:

    1. Create a resources folder under src/main, and put the resources you will need in that directory.

    2. Go to File -> Project Structure

    3. Go to Modules on the left

    4. Go to the Sources tab on the right

    5. Find your resources folder

    6. Select the resources folder, and then click on "Mark as: Resources"

    7. Click OK

    Now whenever you build the project, or build a JAR, it will also include the resources folder and you can use it correctly.

    (NB. This might be super obvious but it sure wasn't to me yesterday when I spent four hours trying to figure it out)

    As NUS SoC students, we all have to do many group projects, most of which involve collaborating on code. I've used GitHub in the past for this, but mostly in the very simple "everyone just commits to master" style. Of course, with CS2113T, we're all now more familiar with advanced git and revision control strategies.

    Prof, can I ask, in your opinion, for the type of small group project that we often undertake, what's the best approach of these:

    • Creating a GitHub Organisation for the project and creating a repository under the organisation that everyone contributes to via forks and PRs.

    • One member making a repository on their account and everyone making a fork and submitting PRs.

    • One member making a repository on their account and everyone making a separate branch and submitting PRs.

    • One member making a repository on their account and everyone committing to a separate "development" branch, and then submitting PRs to master.

    • Committing directly to master.

    While PRs are very good for organising code, I think they can be a bit of a hassle for smaller projects where speed is more important than code quality (as long as there are no bugs, which should be tested before committing). I wonder if Prof has any advice on choosing an approach? Or maybe any of my classmates have any ideas/stories/suggestions?

    Thank you all in advance, have a lovely weekend!

    Hi Prof and everyone,

    I was looking through the RepoSense dashboard with all of our iPs, and I noticed that my iP is quite behind (the last commit was on 4th September). However, I have made more commits to my iP since then (including on the same day) but those don't seem to be picked up by RepoSense. I noticed others' commits as new as today are being picked up; is there something I'm doing wrong? Have I perhaps messed up a branch or something?

    Thank you!

    EDIT: Links for reference: RepoSense for my iP, GitHub for my iP

    Is it ever acceptable to use the * wildcard in an import statement? For example, I have a package called "task" with some different classes, all of which are accessed by my main Duke class in another package. Is it necessary to import every single class separately, or may I use, say, import com.neilbaner.duke.task.* ?

    Thank you!

    Can I clarify when we are expected to use the "this" keyword to access member variables in a class? Personally, I prefer to use "this" at all times to be explicit, but I seem to remember being told (either in lecture or in tutorial, can't seem to recall which) not to use it when not required to cut down on clutter. I couldn't find anything on this in the Java coding standard guide. The notes on the website on the use of the "this" keyword don't cover this either.

    I just wanted to confirm if I should always use it or not?

    Thank you!

    Note that repl.it uses Java version 1.8.0, aka Java 8, NOT Java 11 as we are using for class normally. This may or may not have implications for one of the exercises, due to differences in the String class (eg. Java 11 having some very convenient additions not present in Java 8...)

    https://nus-cs2113-ay2021s1.github.io/website/schedule/week3/topics.html#key-exercise-pass-objects-to-move-method

    The instructions for creating the move method specifies the following behaviour:

    • Returns null and does nothing if either p or r is null
    • Returns a new Point object that has attributes x and y that match those of r
    • Does not modify p
    • Updates r so that its attributes x and y match those of p

    I think the instructions do not make clear whether the returned Point object should have attributes x and y matching those of r before the modification or after.

    The expected output seems to indicate that it is the former; that is, the method returns the previous/initial position of the rectangle as a Point. There's also little point (no pun intended) in directly returning one of the parameters.

    Perhaps the written instructions could be made slightly more explicit in mentioning this?

    Hi Prof,

    Week 3 Ex2 on repl.it requires us to calculate the area of a rectangle object, by multiplying its height and width together. Is it recommended to use the getter methods for the dimensions of the rectangle, or to just directly access the height and width variables? I noticed the model solution used the latter approach, but I used the getter methods myself.

    The comments in the skeleton code suggest using the setter for changing the dimensions rather than directly modifying the member variables, so I'm wondering why the model solution accessed the member variables directly rather than using the getters.

    Thank you, have a great day!

    I hear a lot of my friends having issues with installing Java - specifically, the part about getting it to show up in their PATH as expected - so I thought I'd share what worked for me.

    I installed OpenJDK using the AdoptOpenJDK installer, linked here. I chose OpenJDK 11 and Hotspot JVM.

    Simply downloading and running the installer should, in theory, configure everything as necessary. By default, the installer will add the JDK to the PATH, so you should not need to perform any additional setup, except configuring your IDE (IntelliJ IDEA or whatever you might be using) to use the appropriate JDK.

    Has anyone else had success using this particular installer?

    Hi Prof, should our repository for the individual project be made public or private? If the latter, then who should we add as collaborators?

    Thank you!

    Good day πŸ˜ƒ

    I might be getting ahead of myself, but I was trying to access the class Gitter chat, and can't seem to do so.

    The first link on this page, which appears to link to https://nus-cs2113-ay2021s1.github.io/website/admin/urt_gitter, leads me to a 404 page on GitHub, while the other link https://gitter.im/nus-cs2113-AY2021S1/community takes me to a 404 on the Gitter website.

    Is the chat just not up yet?

    Ah, thank you. I suspected I was being a bit eager. I'll check back later.

    Agreed, I'm fairly sure indentation counts towards the limit.

    Don't ask me what happens if you have 30 levels of nested indentation though.

    Ah, I didn't look at the hint. I figured it out when I saw the expected output. Thank you!

    If it makes you feel any better @farice9 I did the same thing. Whoops. A bit more care while reading the instructions would go a long way I guess πŸ˜›

    Ah, thank you @hughjazzman don't know how I missed that.

    I appear to have received the invite a few hours ago.

    Sorry for the late response. Understood. Thank you.

    @wangqinNick Ahhh I think I see the problem then. Thank you. I also just double checked that all my tags were pushed because some of my tags this morning were only on my local repo πŸ˜• I was just very confused since no one else seemed to have this issue; perhaps they already merged their branches.

    @okkhoy The user.name seems to be fine. I'll wait for the reposense to update tomorrow.

    Thank you to everyone πŸ˜ƒ

    Update: All is well, the latest changes have been picked up.

    Thank you for the helpful insight. When you say PR workflow, are there any significant advantages or disadvantages to creating forks vs. branches? I imagine forks keep the production repository cleaner, but branches are a bit easier to manage?

    Interesting update: If I use IntelliJ to automatically import each class (i.e. delete my import com.neilbaner.duke.exceptions.* and then Alt-Enter on each exception manually), then by the time I import every single exception (eg. import com.neilbaner.duke.exceptions.TaskIndexOutOfBoundsException, com.neilbaner.duke.exceptions.UnknownCommandException etc. etc, IntelliJ decides that it should combine them all back into com.neilbaner.duke.exceptions.*. This does throw a bit of a spanner in the works.

    I see. I guess I need to try all the different approaches before settling on one. Thanks for your advice. It was very helpful. I'll close this issue now.

    I, too, am facing something similar. The same path that works in IntelliJ no longer works when I create a JAR and test it usingjava -jar. I handled the exception, but the feature doesn't work as expected which is a bit of a shame.

    For mine, there are some text files containing lists of application data (i.e. not user generated data) that I want to bundle with the application. I made sure that those text files are inside the jar, but the same path that works when running in IntelliJ don't work with the jar. Can I ask how we can access files within the jar? Should the path be something like ./ip.jar/... ?

    Since we no longer need Replit, I guess this issue can be closed.

    Ah yes, very useful for those of us who won't be lucky enough to win the weekly pollev and also the subsequent wheel spin... Thanks.

    It does this for me too intermittently, and it seems to go away by itself after a while or when I restart IntelliJ. For a program whose name is derived from "intelligent", it can be quite dense at times...

    A possible issue is that your Manifest may have been edited/not included in the JAR. So try to rebuild the JAR.

    Some leads here: https://stackoverflow.com/questions/7559072/corrupt-jar-file

    Chiming in to say that I faced this same issue and this was indeed the problem. For me it was because I was working on the project across multiple computers, and the default .gitignore didn't push the manifest, and somehow somewhere along the line it got deleted.

    @HengFuYuen The error would be produced when running the .jar file produced with java -jar or double clicking. If you download the jar file you published and you can run it, then you needn't worry.

    Hi, how were you able to solve this?

    I think prof mentioned in lecture, assertions are for when the programmer causes the error, and exceptions are for when the user or the environment causes the error. The main issue with assertions for errors that can be caused by the user is that ideally they should be disabled for production builds...

    In this case, I'd say num can conceivably be null if the user enters, say "omae wa mou shindeiru", so I'm going to go against the grain and say an exception would be the appropriate choice here.

    Sorry, I'm not 100% sure what you mean @hughjazzman . Am I right to say that, according to the link you sent, my Ui class should be the only one printing messages anyway?

    I had a bit of an idea on how to resolve this. What if, instead of using the dos2unix command, we simply create the EXPECTED_UNIX file manually? I believe many text editors, and indeed, IntelliJ, allow the user to choose between CRLF and LF...

    Update: I FIXED IT!!

    I've managed to figure out a workaround for this issue, involving getting rid of the dos2unix command entirely.

    How I found this fix:

    I tested on my own machine on Ubuntu (with WSL, didn't feel like rebooting multiple times), and I faced the same error with dos2unix. One sudo apt install dos2unix later, it worked fine. I suspect dos2unix isn't included on the CI system.

    How I fixed:

    First, I removed the lines


    cp EXPECTED.TXT EXPECTED-UNIX.TXT

    dos2unix EXPECTED-UNIX.TXT input.txt

    Then, I manually created a copy of EXPECTED.TXT and named it EXPECTED-UNIX.txt. (Remember to update the .gitignore to push this file as well!)

    Finally, I used the button at the bottom right on IntelliJ

    to change the EXPECTED-UNIX.txt to use LF instead of CRLF

    et voila!

    hi prof pls giv me a plus grade thank u

    (NB. This method does require you to update 2 different files every time you need to update your tests, but it's not too bad since you can simply copy and paste it, or you can use dos2unix on your own machine to do it for you even though copy and paste and changing the format is probably fewer keystrokes/clicks)

    @TomLBZ @Lee-Juntong @okkhoy

    Does this mean that if our program uses, say, usernames and passwords, the passwords must also be stored in plaintext? What about API keys?

    It was certainly very satisfying seeing the green tick finally πŸ˜„

    I was thinking for logging into online services, such as GitHub perhaps.

    I see what you mean. How would you suggest I do this for exceptions though? java.lang.Exception, for example, includes a printStackTrace method which means the exception, not the UI class is responsible for printing error messages. For my ip I (not knowing better until much too late) used a static messages class and called it's methods everywhere I needed to print something, including in my DukeException.printErrorMessage().

    Thanks for your input πŸ˜ƒ I think we'll go for method 1 then for now, because it's a bit cleaner too.

    Oh wow I didn't know of this. Thanks!

    I am currently working around this by using System.setErr(System.out) and changing it back later.

    What is the exact call to System.err that you are doing?

    I'm actually not calling System.err directly, I'm using Exception.printStackTrace() which prints to System.err.

    I tried printing my own error message with System.err.println() and observed the same result.

    For now I'm just using the workaround above with setting System.err to System.out and setting it back to normal once I'm done. Not the most elegant workaround ever, but I'm sure you'll agree it beats using sleep() πŸ˜›

    Nice, thank you prof! Now it's red too which makes it much easier to tell apart.

    Should I close this issue now or leave it open?

    In general, how many lines of User Guide should be enough to get full mark for User Guide part and what is the weight of UG for IP? Do I need to illustrate all functions in good detail ?

    I want to insert several gif files in the README.md. I would like to upload the gif files to the GitHub ip repo as well so that I could insert pictures with their urls. However, I am not sure where to put and how to upload those gif files. Should I put them in my resources folder? I am afraid of resulting in a too large jar file, generating through shadowJar.

    I was using the IntelliJ IDEA version 2019.2 on a macOS 10.15. After updating the the IDEA to version 2020.3, it could not recognise some of my third-party libraries. I tried several methods and still could not solve the issue, including manually set up the jar path and etc. The IDEA also crashed several times when I set the library path. In the end, I had to reinstall the 2019.2 version.

    Library

    https://github.com/google/gson

    Purpose

    To save and load the task list more easily

    License

    https://github.com/google/gson/blob/master/LICENSE

    I want to ask the DukeException class should inherit whether the Exception class or the RuntimeException class.

    The example in the textbook, uses the Exception class as the father class, but I find in the project, it is more convenient to use runtimeException as the father class.

    I think perhaps it is because you use the ArrayList, but you did not declare the generic.

    Since generic does not do type-check and you did not declare either, it gave such warning.

    Try ArrayList > String > filteredList = new ArrayList >>();

    There is a line in runtest.sh doing "# run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT"

    Change it to:

    java -Dfile.encoding=UTF-8 -classpath ../bin sample.Main > input.txt > ACTUAL.TXT

    don't forget to change the class name to yours

    (I am using a Mac and not sure if this works or not. )

    This is perhaps you have changed you main class name, or moved it to another package.

    You can try to change this line.

    For example, if you have moved it to another package, you should also compile it with your class name with the package's name

    eg. "sample.Main".

    java -Dfile.encoding=UTF-8 -classpath ../bin sample.Main > input.txt > ACTUAL.TXT

    You need to declare and compile all the classes you have, not only the main class.

    Like this:

    if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/sample.Main.java ../src/main/java/commands/add/.java ../src/main/java/commands/.java ../src/main/java/common/.java ../src/main/java/data/exceptions/.java ../src/main/java/data/task/.java ../src/main/java/data/.java ../src/main/java/parser/.java ../src/main/java/storage/.java ../src/main/java/ui/*.java

    Or you could run the test-ui by a jar file, which is more convenient when you have complicated structures such as multiple classes and packages.

    @Colin386

    Hi,

    Yes that is my project structure, however, when I run the java -classpath ..\bin main.java.Duke < input.txt > ACTUAL.TXT, it gives me the error "Error: Could not find or load main class main.java.Duke".

    Even though an ACTUAL.txt is created, it does not get updated based on the inputs given.

    Capture

    This is because your project structure. Your source file is "java" folder (the blue one in the picture) instead of src folder

    Screenshot 2020-09-03 at 4 41 34 PM

    You should either change the project structure or change the command in runtest.bat according to your current structure.

    To change the structure, you goto File->Project Structure-> source

    Or perhaps try this, if you do not want to change your current structure.

    java -classpath ..\bin Duke > input.txt > ACTUAL.TXT

    I tried runtest but the ACTUAL.txt file could not be found. Anyone has any idea...?

    I have no clear thought. But I am interested in your structure πŸ˜•

    You project content root is week4circus, instead of circus as normal. Did you import the project or you just open it? Could you click File -> Project Structure ->modules and screen shot your modules?

    I tried runtest but the ACTUAL.txt file could not be found. Anyone has any idea...?

    I have no clear thought. But I am interested in your structure πŸ˜•

    You project content root is week4circus, instead of circus as normal. Did you import the project or you just open it? Could you click File -> Project Structure ->modules and screen shot your modules?

    This is my project structure.

    The "week4circus" is a folder created by me and I cloned the github repo into it

    Maybe you can try this: whenever you have ..\bin, you change it to ..\circus\bin

    But in case it won't not work, you either "git reset" to reset it later, or save a copy of it beforehand.

    It should inherit the Exception class. (RuntimeException is a subclass of Exception)

    See: https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html

    Thanks, I understand difference about checked and unchecked exceptions now.

    The responseSense does not detect branch unless it has been merged to master and pushed to the remote. You just merge your level-five one hour ago and I think you can check the progress tomorrow.

    And similar for the tags, 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. Tag the merging commits, instead of the branch commit.

    Try: type "chcp 65001" in your cmd

    https://ss64.com/nt/chcp.html

    then try run your jar by: java -Dfile.encoding=UTF-8 -jar duke.jar

    I get this error.

    This is interesting. I am not sure why it treats the parameter as the jar file name. The command works on my laptop. Could you try without the .\before the jar name?

    Oh the command doesn't work in powershell but it works in cmd, however, the icons still show as question marks

    For the cmd, I think according to the "The default code page in the USA is 437, the default in most of Europe is 850. " , also need chcp 65001 first, before the java command with -Dfile.encoding=UTF-8 parameter.

    Oh the command doesn't work in powershell but it works in cmd, however, the icons still show as question marks

    For the cmd, I think according to the "The default code page in the USA is 437, the default in most of Europe is 850. " , also need chcp 65001 first, before the java command with -Dfile.encoding=UTF-8 parameter.

    Yea I tried this as well

    Then maybe because your output is not in UTF-8? You can try force the print a tick in UTF-8 and see if there is a tick at cmd to check if it is the problem.

    Solved: I configured the path and use another SDK instead of the one Intellij IDEA provide.

    Same here. The branch level-5 is not detected on ip progress dashboard, though the tag is detected.

    The tag for Level-5,6,7 are all not detected on RepoSense Report, but they are detected on the ip progress dashboard.

    @wangqinNick you don't have a branch called branch-level-5 in your IP repo

    @adinata15 and @f0fz you have a slightly stranger problem

    Go to the tags/release and click on the commit listed to view the details:

    According to GitHub, this can happen due to a few reasons e.g., force push, un-merged merge conflict commit etc.,

    Since the script cannot trace back to this commit, it was not detected.

    You can try to tag some other commit in your repo after the level was completed and push the new tag.

    [Edit] Ack: Thanks to Prof. Damith for helping me figure this out!

    I forgot to push the branch level 5 to the remote. Thanks very much

    I see. Thanks very much.

    I think in terms of member functions: if a method do not invoke any non-static variables, the method should be static.

    If your gif files are only for the README I think you can place them in the docs folder as that should not be compiled. You can then use relative paths in your README such as ![Alt Text](./gifs/one.gif)

    Thanks, I will try it out.

    Thanks for the explanation!

    So given the following code


    class A() {

    private Integer a;



    A(int a) {

    assert a != null; // Method 1 - assert in constructor

    if (a == null) {

    throw new SpecialException(); // Method 2 - throw Exception to be caught

    }

    this.a = a;

    }

    }



    public class Main() {

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



    public static void main(String[] args) {

    String line = IN.nextLine().strip();

    Integer num = null;

    try {

    num = Integer.parseInt(line);

    } catch (NumberFormatException e) {} // Is exception handling here enough?



    assert num != null; // Method 3 - assert before initialising

    try {

    A objA = new A(num);

    } catch (SpecialException e) {} // Method 2 - catch Exception thrown

    }

    }

    If we want to prevent A.a from being initialised as null, should I

    1. assert within the constructor (Method 1)?

    2. catch Exception while initialising (Method 2)?

    3. assert before initialising (Method 3)?

    The use of assertions and exceptions depends whether the input is from the user or the programmer, so if it's parsed properly would it be considered from the user or the programmer after parsing?

    Thanks to TA @nishanthelango for the following input as well:

    I think if you want num to be never null at any point of the code then method 3 makes sense

    But if you just don't want any instance of Class A to have a null variable a then you could use method 1

    If you made a User Guide with tables, you might be wondering why the formatting for the tables works in GitHub but breaks in GitHub pages. Following the advice at this link - https://github.com/pages-themes/cayman/issues/82 - you just need to change the _config.yml file to render with GFM (GitHub Flavored Markdown). More details found here.

    As for adding emojis like seen at this link to your GitHub pages, there is an extra step explained at this link for the change needed in the _config.yml file.

    For example, if you were using the Cayman theme, you could do something like this:


    theme: jekyll-theme-cayman

    markdown: GFM

    plugins:

    - jemoji

    The _config.yml file should be automatically created in the docs folder and committed when you choose a theme for your User Guide, but you'll have to add the extra stuff yourself.

    Also, here's a use of the emoji and table combination - nice informational boxes:

    | πŸ“ | Take note of this |

    |---------------|:------------------------|

    | ☝️ | Remember to not forget! |

    |---------------|:------------------------|

    Source: https://stackoverflow.com/questions/58737436/how-to-create-a-good-looking-notification-or-warning-box-in-github-flavoured-mar

    OS: Windows 10

    Increment: A-TextUiTesting

    File: runtest.bat

    While working on the increment, I find an issue when using file compare (FC) for the special characters βœ“ and ✘. In the output file ACTUAL.TXT, the corresponding characters seem to get converted to ? (question mark), and the follow lines will be shown in the diff:


    Comparing files ACTUAL.TXT and EXPECTED.TXT

    ***** ACTUAL.TXT

    Got it. I've added this task:

    [D][?] do homework (by: no idea)

    Now you have 8 tasks in the list.

    ***** EXPECTED.TXT

    Got it. I've added this task:

    [D][Γ£ÿ] do homework (by: no idea)

    Now you have 8 tasks in the list.

    *****



    ***** ACTUAL.TXT

    Nice! I've marked this task as done:

    [T][?] read book

    ------------------------------------------------------------

    ***** EXPECTED.TXT

    Nice! I've marked this task as done:

    [T][Γ£ô] read book

    ------------------------------------------------------------

    *****

    To fix it, I basically had to change the the expected character to be a ? in EXPECTED.TXT and it will give me that no differences were encountered. However, this would mean that the test cannot check for βœ“ and ✘ characters being different.

    I guess that the error probably comes from the special characters being unicode characters which is an issue if FC isn't expecting it. From the docs, there is an option for unicode, but it will be on the whole file and not just a single character.

    I also note that in Updating test as the program evolves, "we accept that the actual behavior should be the new expected behavior".

    Is there any way for the test to check for those characters, or should I just stick with the question marks?


    import java.util.*;



    public class Task {

    public static final String descriptionPrefix = "description: ";

    private String description;

    private boolean important;

    List<String> pastDescription = new ArrayList<>(); // a list of past descriptions



    public Task(String d) {

    this.description = d;

    if (!d.isEmpty())

    this.important = true;

    }



    public String getAsXML() { return "<task>"+description+"</task>"; }



    /**

    * Print the description as a string.

    */

    public void printingDescription(){ System.out.println(this); }



    @Override

    public String toString() { return descriptionPrefix + description; }

    }

    Other than the given ones regarding descriptionPrefix, printingDescription(), and important, these should be the other ones:

    • import java.util.* should be import java.util.ArrayList to be explicit

    • pastDescription should be pastDescriptions to indicate collection

    • this.description = d can just be description = d to reduce noise

    • if statement should be in wrapped in brackets

    • getAsXML() should be getAsXml() - lowercase

    Did I miss anything?

    I assume since the wrapped lines is about the layout to improve readability, it is so that the code is easily viewable on smaller widths. Then this means the spaces would be part of the limit.

    I would assume all the input we get is completely ideal, and that we will learn about catching errors in future weeks.

    Nice! It works, thanks @wangqinNick.

    It’s here: https://se-education.org/guides/conventions/java/index.html#variables

    Avoid unnecessary use of this with fields.

    Use the this keyword only when a field is shadowed by a method or constructor parameter.

    Assuming the data from the classrooms follows what's said here - https://docs.repl.it/classrooms/exports - then that's probably why they can't use our repl.it usernames. If only repl.it gave the data with usernames.

    @adinata15 What's your OS? The forward/backslash seems like something to do with using the right file on the right OS.

    @adinata15 Hmm then maybe not. Looking at your package structure, because you packaged Duke in main.java I believe these should work:


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

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

    @kaijiel24 Yep, since they are special characters you would need to change the console code page as well as the font to print them. Of the fonts available in my cmd, only MS Gothic, NSimSun, SimSun-ExtB could display them.


    chcp 65001

    Sources:

    https://ss64.com/nt/chcp.html

    https://github.com/rrrene/credo/issues/422

    Answered in #22

    It's in the Coding Standard: https://se-education.org/guides/conventions/java/basic.html#package-and-import-statements

    Imported classes should always be listed explicitly.

    https://stackoverflow.com/questions/47457105/class-has-been-compiled-by-a-more-recent-version-of-the-java-environment

    Yup it looks like Java 14 was used to compile, and Java 8 is being used to run.

    For reference, this goes as far back as #22.

    @okkhoy Whoops yep.

    Follow this: https://www.jetbrains.com/help/idea/creating-and-optimizing-imports.html#disable-wildcard-imports

    From the page:

    [This page was last updated on Sep 21 2020]

    Looks like your commits were all after then. (The grading scripts have to be run, they aren’t automatic.)

    Hi, try tips from #61.

    Try tips in #61, was also asked in #65.

    @AndreWongZH Good point, I've changed the example to Integer.

    If we were to take https://se-education.org/addressbook-level3/DeveloperGuide.html#architecture as an example, then the navigability shows that Ui should be the one aware of the Logic and Model of the application instead of the other way round. I haven't implemented this, but if I were to guess, you could initialise the Ui in the main app class and check the other 2 components in the while loop.

    Let me see if I can try to illustrate. Suppose we have a Command class.


    public class Duke {

    /** Instances of class objects for UI. **/

    private final Ui ui;

    private final Parser parser;



    private Duke() {

    ui = new Ui();

    parser = new Parser();

    }



    public void run() {

    boolean isExit = false;

    while (!isExit) {

    String line = ui.readLine();

    Command c = parser.parse(line);

    c.execute();

    isExit = c.isExit();

    ui.printCommand(c); // here, we could try have the Command c as input to the Ui instance

    }

    }



    /**

    * Main entry-point for the java.duke.Duke application.

    */

    public static void main(String[] args) {

    new Duke().run();

    }

    }

    Maybe the Command class might have an overridden toString() method? This leaves the Logic not having to deal with Ui as well.

    Not necessarily. If you have proper abstraction within the Parser class, a new command could simply use an existing method to prepare the arguments. If your Parser, Command, Messages don't need to be aware of Ui as discussed in #88, then a new command would just be a new Command subclass, with Messages being associated with the Command.

    https://se-education.org/addressbook-level3/DeveloperGuide.html#proposed-undoredo-feature

    In this particular example, I agree with you. There shouldn't be any case where a Notebook is printing a title of another Notebook; that other Notebook should call its own method, especially since the methods in question are private, not public. Perhaps if you are talking about public methods using method 1 could be better.

    You are part of https://github.com/nus-cs2113-AY2021S1 not CS2103.

    So... as our UGs and DGs get longer and longer, I figured we wouldn't want to spend 15 minutes manually write our table of contents. A quick search found this: https://ecotrust-canada.github.io/markdown-toc/

    Highly recommend!

    Edit: Note this does not handle more complicated scenarios, e.g., headers like these

    >code>### Create new: `create`>/code>

    I tried looking into this, but can't seem to figure out how it works for multiple special characters.

    I have found the repl.it link under Week 2 Admin Info - https://repl.it/classroom/invite/sclqjqn

    Seems right

    I believe you can keep it, change it, or remove it.

    I sure hope error-handling is not required considering we technically haven't gone over try-catch statements and other error-handling, but I am curious to know as well!

    Because you compiled the files into &gt;root>/bin/, your java command should be

    java -Dfile.encoding=UTF-8 -classpath ..\bin Duke &gt; input.txt > ACTUAL.TXT ?

    Just change this line in runtest.bat: javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\Duke.java

    to

    javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\*.java, similar to in runtest.sh

    @zhixiangteoh When java -Dfile.encoding=UTF-8 -classpath ..\bin Duke &gt; input.txt > ACTUAL.TXT is used, it still gives the same error.

    @wangqinNick Regarding file location, I do not create another package nor more the file from src/main/java.

    @AndreWongZH For the uninitialised value, I declared some variable without assigning a value for them at first (only assign when user input data) but everything works fine when I tried running it on the console.

    Your main class and file are still "Duke" and "Duke.java" respectively?

    @zhixiangteoh When java -Dfile.encoding=UTF-8 -classpath ..\bin Duke &gt; input.txt > ACTUAL.TXT is used, it still gives the same error.

    @wangqinNick Regarding file location, I do not create another package nor more the file from src/main/java.

    @AndreWongZH For the uninitialised value, I declared some variable without assigning a value for them at first (only assign when user input data) but everything works fine when I tried running it on the console.

    Your main class and file are still "Duke" and "Duke.java" respectively?

    I am not sure where to find the file Duke.java but my main class is still Duke. This is the screenshot of the directory:

    Hey, i think perhaps this will work:

    java -Dfile.encoding=UTF-8 -classpath ..\bin main\java\Duke &gt; input.txt > ACTUAL.TXT

    It seems that because your compilation destination is >root>\bin but the package main.java was compiled and not the files, the classpath is ..\bin but you need to execute the &gt;package>.&gt;subpackage>.&gt;main class>.

    See also: https://stackoverflow.com/questions/7509295/noclassdeffounderror-wrong-name/13697239

    If this still doesn't work, try changing your javac command in runtest.bat to:

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

    to see what files or packages are being loaded.

    I personally feel using explicit imports is still better; on top of the stated benefits, I feel it is also more flexible in that it allows you to more clearly and easily remove particular import statements in the event you reorganize your packages and/or the code in the class to which you are importing the packages/classes to.

    Honestly think this should be perfectly sound and acceptable, although it isn't exactly specified in most places I've looked (including all the reference links at the bottom of the SE-EDU Java coding standard page).

    The alternative to indexing your array would be to write something like int nameIndex = 0; int dateIndex = 1 which for a 2-element array feels like it actually makes the code a little less readable.

    A possibly relevant section I found is in this doc under section 10.3, but no explicit mention of array indexing.

    Agree this is not so clear cut, so would also like to see what the general recommendation is.

    so your branch-A-Packages is found but not branch-Level-5? Might it be due to a small typo in the uppercase 'L', given that the name technically should be branch-level-5? Don't know if they accounted for typos like this.

    Edit: It seems your branch-A-Packages is a branch from branch-Level-5, when it should be a branch from master?

    so your branch-A-Packages is found but not branch-Level-5? Might it be due to a small typo in the uppercase 'L', given that the name technically should be branch-level-5? Don't know if they accounted for typos like this

    branch-A-Packages is not even detected. um its an upper case 'L' and my friends did with upper case 'L' worked but mine didn't

    from your commit history it seems you created the branch-A-Packages branch from branch-Level-5, but i think we are supposed to merge branch-Level-5 into master, git checkout master, then git branch branch-A-Packages or git checkout -b branch-A-Packages from master.

    have you pushed the tags, like

    git push β€”tags?

    β€” is two β€˜-β€˜s

    ^If you click the info icon under your student ID on the dashboard, you can see this short statement.

    It seems you released your A-Jar two days ago, which falls within the period the script probably expects for the Final Jar.

    Oh no...What should I do ? Would my final JAR submission be affected because of this ?

    I doubt it would, it should probably be fine if your final JAR submission is in by the deadline, and tagged A-Release.

    As for multiline code blocks within markdown tables, can try:

    &gt;pre>&gt;code>list&gt;br>&nbsp;&nbsp;&nbsp;&nbsp; ____________________________________________________________&gt;br>&nbsp;&nbsp;&nbsp;&nbsp;Here are the tasks in your list:&gt;br>&nbsp;&nbsp;&nbsp;&nbsp;1.[D][βœ“] test (by: Sep 24 2020 11:59 PM)&gt;br>&nbsp;&nbsp;&nbsp;&nbsp;____________________________________________________________&gt;/code>&gt;/pre>

    **Note: &nbsp;s can be replaced with normal spaces .

    which renders to (if used in a table cell)

    | column1 | column2

    | ---------|----------

    | >pre>list>br> ____________________________________________________________>br> Here are the tasks in your list:>br> 1.[D][βœ“] test (by: Sep 24 2020 11:59 PM)>br> ____________________________________________________________>/pre>

    For some reasoning about the above code,

    See also: https://stackoverflow.com/questions/24190085/markdown-multiline-code-blocks-in-tables-when-rows-have-to-be-specified-with-one

    It's not specified so I personally assumed it's up to the individual's discretion: my tp mate implemented error-checking to only allow the strict date formatting but I personally coded it such that if you get the right format (i.e. YYYYMMDD) the program converts it, otherwise it just uses whatever the user entered (e.g. in 10min). Either way, include it in your user guide!

    FWIW:

    Hacktoberfest now requires PRs be in a repo with hacktoberfest topic and be accepted: PR

    Oh wow! Didn't know that... This is awesome, thanks prof

    I haven't used this library at all myself, chanced upon it while reading about monads in Java, but perhaps you could use CompletableFuture and use the thenRun() method?

    EDIT: I just read the method description more closely and it says that action is the process to be performed before completing the returned CompletionStage, so perhaps it doesn't work as I thought; although there might be another method, or use case for this method, that you could perhaps somehow get to work

    Previously, I plan to remove the text-ui-test file since we are not using it, but the Github checks disallow it. Hence, I copy and paste back the file but it results in a permission denied error as shown below:

    This is the current structure of the text-ui-test folder:

    Does anyone know what to do? Any help will be super helpful! πŸ˜ƒ

    Regarding the team project, there are several questions:

    1. What should we do if we have implemented the previous commits wrongly into the team repository? (i.e: commits done before the lecture)

    2. If we realised that we have committed too much for the current week/iteration and cannot commit more for the subsequent one, are we allowed to git --reset to the older version?

    After implementing the Date on Level-8, can we assume the user can only register in the correct date format(YYYYMMDD) and nothing else(eg: 9 pm later)?

    When implementing the JAR file, I encounter the FileNotFoundException. When I tried on the normal java terminal everything works, with or without the duke.txt. Is this something we need to fix or is this ok? My code is as follows:


    public static final String filepath = "./data/duke.txt";//file path from root file

    private static void handlePastData() {

    File pastFile = new File(filepath); // create a File for the given file path

    String wholeDoc = readFile(pastFile);

    //when file is empty or not created

    if (wholeDoc == null) {

    return;//skip parsing data

    }

    //convert file entry to tasks

    parseFile(wholeDoc);

    }

    This is the error:

    I am still a bit confused about automated testing. After following the guide on the cs2113 website and changing the path, I still get the error:


    Error: Could not find or load main class Duke

    Caused by: java.lang.NoClassDefFoundError: main/java/Duke (wrong name: Duke)

    These are my java and javac command lines:


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

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

    Does anyone know how to solve this error? Thank you!

    Regarding the settings for the wrapped lines, do we include the indentation spaces into the 120 chars limit?

    It is on this part of the website settings:

    Thank you!

    @zhixiangteoh When java -Dfile.encoding=UTF-8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT is used, it still gives the same error.

    @wangqinNick Regarding file location, I do not create another package nor more the file from src/main/java.

    @AndreWongZH For the uninitialised value, I declared some variable without assigning a value for them at first (only assign when user input data) but everything works fine when I tried running it on the console.

    @zhixiangteoh When java -Dfile.encoding=UTF-8 -classpath ..\bin Duke &gt; input.txt > ACTUAL.TXT is used, it still gives the same error.

    @wangqinNick Regarding file location, I do not create another package nor more the file from src/main/java.

    @AndreWongZH For the uninitialised value, I declared some variable without assigning a value for them at first (only assign when user input data) but everything works fine when I tried running it on the console.

    Your main class and file are still "Duke" and "Duke.java" respectively?

    I am not sure where to find the file Duke.java but my main class is still Duke. This is the screenshot of the directory:

    @zhixiangteoh When java -Dfile.encoding=UTF-8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT is used, it still gives the same error.

    @wangqinNick Regarding file location, I do not create another package nor more the file from src/main/java.

    @AndreWongZH For the uninitialised value, I declared some variable without assigning a value for them at first (only assign when user input data) but everything works fine when I tried running it on the console.

    Your main class and file are still "Duke" and "Duke.java" respectively?

    I am not sure where to find the file Duke.java but my main class is still Duke. This is the screenshot of the directory:

    Hey, i think perhaps this will work:

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

    It seems that because your compilation destination is \bin but the package main.java was compiled and not the files, the classpath is ..\bin but you need to execute the <package>.<subpackage>.<main class>.

    See also: https://stackoverflow.com/questions/7509295/noclassdeffounderror-wrong-name/13697239

    If this still doesn't work, try changing your javac command in runtest.bat to:

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

    to see what files or packages are being loaded.

    I try changing it to:


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

    The same error still comes out. However, when I change it to:


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

    It works πŸ˜„. I then try to change all backslash to slash in the runtime.bat file and it also works. I am not really sure why this works, but could this lead to a problem in the future?

    @adinata15 What's your OS? The forward/backslash seems like something to do with using the right file on the right OS.

    My OS is Windows 10.

    The Windows 10 version might be the cause, is it?

    It works now, thank you! Similar to the issue of @NeilBaner, all the symbols (ie: tick and smiley faces) does not work in JAR files anymore (it previously works on Java terminal). Is this acceptable or need to be fixed too?

    Thank you, it is working now! @NeilBaner @okkhoy

    I also experienced the same case for my Level-4, I have tagged Level-4 on 30th August (Week 4) but it is not registered on the progress dashboard. However, the rest of the tag such as A-UiTesting and A-CodeQuality are registered.

    On Github:

    On Progress details:

    @wangqinNick you don't have a branch called branch-level-5 in your IP repo

    @adinata15 and @f0fz you have a slightly stranger problem

    Go to the tags/release and click on the commit listed to view the details:

    According to GitHub, this can happen due to a few reasons e.g., force push, un-merged merge conflict commit etc.,

    Since the script cannot trace back to this commit, it was not detected.

    You can try to tag some other commit in your repo after the level was completed and push the new tag.

    [Edit] Ack: Thanks to Prof. Damith for helping me figure this out!

    Thank you for the help @okkhoy ! I have deleted the old tag and pushed a new tag of "Level-4" into my repo. Just wondering, will we be deducted marks for this?

    Thank you for the clarification! @okkhoy @felixhalim @zhixiangteoh

    Thank you for the advice! @okkhoy. I will leave this open for future questions.

    Hi prof and friends! I encountered a problem with creating tables using GFMD for the user guide and would like to request for help.

    In my docs\README.md file on github the table seems to be presented properly.

    However, when I view the user guide at http://{your username}.github.io/{repo name}/ the table formatting is gone.

    Hi prof and friends!

    Apparently my JAR file for week 6 was detected as my final JAR file (as shown below) in the iP progress dashboard. Did I perhaps do something wrong? Or could it be because I submitted it late?

    Hi prof and friends! I actually have an identical problem as in forum #33, however, even after following the suggestions to change my project structure, my runtest.bat still does not seem to work. This problem only started after I added the delete functionality into Duke. Any help will be greatly appreciated! Thank you!

    The error message: (where ACTUAL.TXT is empty)

    My project structure and runtest.bat javac and java command lines:

    My source files:

    Hi prof! Is it a problem if there is a red exclamation mark next to my remote icon on SourceTree (refer to picture below)? It seems to be able to successfully redirect me to the github page when I click on it although I have not tried to push any new commits yet.

    Thank you very much!

    Ok! Thank you very much prof!

    I also had the same problem of a build failure and the terminal being unable to find the classes that I have used in Duke. However, I was testing things out and either of these two compile lines seems to make it work:

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

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

    However, I am not sure if this is correct.

    I see! Thanks for the clarification prof!

    @okkhoy It worked after I made the comments in #33 but failed when I’m trying to do level-6 the part where we have to add delete functions to duke. Thank you!

    @okkhoy @jerichochua Thank you so much! It finally works!

    Oh no...What should I do ? Would my final JAR submission be affected because of this ?

    I see! Thanks @zhixiangteoh and @okkhoy !

    Oh! Thanks so much for the tips!

    Hi! Sorry, may I know where did your get this error message? Was it via email? Because I actually didn't push my manifest files to my repo but when I checked, it seems to be included in my JAR file (?). So I'm worried that I might have the same error but don't know where to check to see if my JAR passed the smoke test. Also, do I need to push my manifest.mf file? If so, do I have to resubmit my JAR file again? Thank you!

    I see! Thank you so much @NeilBaner !

    Personally, I would use method 1 because if it was an invalid input from the user I would assume that the parser/main class caught the error as an exception perhaps while parsing. Therefore, if class A was initialised with null it would be a programmer error. For example, in my tp I actually worked on a person class and the age of a person cannot be > 0 and I used assertion in my constructor rather than an exception because I assumed that the parser class would have caught the error as an exception. However, I am not sure if I'm right either...

    Regarding method 3, I think it can still be used, however, I would still prefer method 1 because I am assuming that having num == null in main is fine but num == null in Class A is not.

    Library

    JSON.simple

    Purpose

    Parsing json files which stores our data

    License

    Apache 2.0

    Since we make many pull requests for this module, you might as well join Hacktoberfest this year if you haven't already. You can gain good exposure to the open source community and get a free t-shirt at the same time. All you need to do is complete 4 pull requests to any public repository during the event period to be eligible.

    https://hacktoberfest.digitalocean.com/

    My status icons show "?" instead of the ticks and crosses when I run from my JAR file although they can be saved fine in my duke.txt.

    I have tried this before and it is already active

    I get this error.

    Oh the command doesn't work in powershell but it works in cmd, however, the icons still show as question marks

    Oh the command doesn't work in powershell but it works in cmd, however, the icons still show as question marks

    For the cmd, I think according to the "The default code page in the USA is 437, the default in most of Europe is 850. " , also need chcp 65001 first, before the java command with -Dfile.encoding=UTF-8 parameter.

    Yea I tried this as well

    Maybe because your terminal is using a font that doesn't support this character? Try changing to a different font? Or maybe one from here? I hope this works

    Changing the font to NSimSun on cmd works, thank you @daniellimws, @wangqinNick and @daniellimzj !

    I think it means you have multiple versions of Java installed and your command prompt defaults to an older version of Java Runtime than what your IDE used to compile, maybe you can check your installations? We should be using Java 11 for this module

    If your gif files are only for the README I think you can place them in the docs folder as that should not be compiled. You can then use relative paths in your README such as ![Alt Text](./gifs/one.gif)

    I think you can refer to #30

    I think this is a very valid concern and my team has also faced this issue with many merge conflicts over the Ui class. However, I think putting a lot of logic into the Command classes would start to violate SRP and as a result the code becomes more procedural in nature rather that being object-oriented.

    Will it still be valid if the data should not be changed by the user and we have warned them to not edit the file in the user guide?

    Hi, I would like to enquire the style of the demo video. Do all the members need to be present in the demo video or is it okay for just one presenter?

    Library

    Apache WordUtils

    Purpose

    Purpose of using this library is to handle text wrapping when printing out help file

    License

    {Apache Software License 2.0}http://www.apache.org/licenses/

    Hi, I noticed that the link to the developer guide (https://nus-cs2113-ay2021s1.github.io/tp/DeveloperGuide.html#proposed-undoredo-feature) is not found. I was wondering if there is another way to obtain an example for reference for this developer guide. Thanks

    Hi, I would like to ask if there is a specific way of tagging Junit code contributions. I have committed Junit code alongside my other code for my team project. But I noticed that when the dashboard updated recently, my Junit code is not shown to have been completed.

    Thank you

    Is there anyway for one to rewind the commits made on the repository. I have mistakenly forgot to make parallel branches for the JavaDoc branch and the dashboard did not seem to have detected my commits for the other assignments though I have tag them correctly. Thanks

    Hi there!

    How does your file structure look like in the project?

    If yours looks like this where you have a main.java folder with all the classes inside it, you may need to change the runtest.bat file:

    instead of writing:

    java -classpath ..\bin Duke &gt; input.txt > ACTUAL.TXT

    you will need to write:

    java -classpath ..\bin main.java.Duke &gt; input.txt > ACTUAL.TXT

    Im not sure if this will help, but it did help me resolve the issue of missing classes. Do let me know how it goes

    From the page:

    [This page was last updated on Sep 21 2020]

    Looks like your commits were all after then. (The grading scripts have to be run, they aren’t automatic.)

    Oh... I see I see. No wonder the tags were not updated... Thanks for the help πŸ˜ƒ.

    Maybe you can make some edits and create a branch to push for that?

    I guess I can try making a separate branch for the JavaDoc section. My concern is that it will no longer be in order with the other parts of the assignments such as the User Guide

    Thanks prof.

    I would like to clarify on how do we "cherry pick" the commits? Also, if I were to merge the branch will it end up merging at the very top of my master branch?

    Thanks for the help Prof. And thanks for the help everyone.

    I have successfully created the parallel A-JavaDoc branch and produced the tag as shown.

    You can click on "branches" here (which links you to https://github.com/e0426051/circus/branches)

    Then you should be able to delete the in-lecture branch on GitHub

    Then there shouldn't be a problem with pushing anymore.

    Maybe because your terminal is using a font that doesn't support this character? Try changing to a different font? Or maybe one from here? I hope this works

    Yay!

    Maybe it is because of different line endings? In windows, the files have CRLF at the end of lines, and in MacOS/Linux they end with LF. I think dos2unix is supposed to fix this but it failed to run because your system doesn't have it.

    Double check if you deleted the correct file? Because it does look like the program is reading from a file.

    Double check if you deleted the correct file? Because it does look like the program is reading from a file.

    Might be issue with nus WiFi. Happened to my team also.

    As I was considering whether I should throw/catch an exception for this, I wondered how would I handle this exception. I will most likely need to print an error message to the user. But I don't see any good way of letting the user know what went wrong, and how to correct it in this situation, since this is almost certainly a problem with the code itself. So, I don't think using an exception is useful.

    I would prefer Method 1 so that this assertion is always made. If I do Method 3 I may forget to assert when doing new A(num) somewhere else.

    Oh but I guess num will be null when there is a NumberFormatException so I think Method 2 could just be done in the catch clause for that?

    Please refer to #5

    Error-handling is not necessary for Level-3. Based on #17

    I believe that this issue has been resolved and ready to be closed.

    Same case here

    Noted. Thanks prof.

    To prevent repeated question regarding this, it would be better if the solution is added to the documentation. @okkhoy

    Thanks for your information!

    I agree with @zhixiangteoh. There is no strict rule regarding that, hence, you might implement any variant but remember to provide relevant information on the user guide.

    Library

    Apache Commons Validator

    Purpose

    Use the UrlValidator class and methods to validate URLs.

    License

    Apache License 2.0

    These data files are generated in the Level-7 increment of the iP. As these files are user generated, it might not be useful to others who want to test or run the project on their own computer. Does it make sense to include such files in .gitignore?

    I believe the dashboard is only updated once a week.

    @okkhoy Thanks for the clarification prof!

    I think you need to include all the other packages/classes for it to be compiled properly.

    i.e. by adding ../src/main/java/duke/task/*.java into the end of the line and for all the other classes.

    We'll be installing the library from the Maven Repository here using Gradle, just making sure if it's still allowed since it's from a difference source than their homepage.

    See: https://nus-cs2113-ay2021s1.github.io/addressbook-level3/DeveloperGuide.html

    You can get a TOC by using {\:toc} at the top of the file (Raw file for DG: https://raw.githubusercontent.com/se-edu/addressbook-level3/master/docs/DeveloperGuide.md)

    Just to add on this seems to be a feature of Kramdown, which AB3 also uses by changing the configuration in the YAML file because I was trying to get this to work on GFMD (which didn't work I think). Kramdown is not 100% compatible with GFMD so make sure to double check the documentation if it's changed.

    As shown in the picture below, my original code is not marked as green but my comments for them are.

    I would like to get help on fixing this issue, as non of the given fixes work.

    This happens in multiple files, mostly from the contents that haven't been changed by others since my initial commit.

    As shown on this image, the runtest.sh prompts "line 14: dos2unix: command not found\r\n1,10c1,10" when executed (I did not modify that file). As a result, my pull request for tp is blocked and cannot get processed.

    On my own computer this problem never occurred and I cannot reproduce it on my computer. It only occurs online when I push the code to the pull request (then the automatic checks starts).

    Need urgent fix.

    Can you change it to dos2unix instead of dot2unix and see if the PR passes?

    Edit: Errr... I noticed from the screenshot it is dos2unix. Let me check with the devel team and update.

    Oops... Sorry for my typo, I have corrected the text now...

    (If my text description is inaccurate or wrong, please kindly refer to the picture. Thanks πŸ˜ƒ)

    Apparently, that message is harmless; the failure is caused due to a difference in the line number (10 in your case) in the expected/actual file, which could be a bug.

    Please check.

    My code is printing exactly the same thing (a same string consisting of ansi escape codes) without the use of user input, so there shouldnt be a difference. Also, I cannot reproduce the error on my pc (always no difference) and I have no idea of what I could do to reproduce it.

    also, I'm wondering why it shows dos2unix command not found instead of showing me my output is unexpected.

    I will check my code later but I don't know what I can do about it. it is already printing the same string anyways...

    Apparently, that message is harmless; the failure is caused due to a difference in the line number (10 in your case) in the expected/actual file, which could be a bug.

    Please check.

    This problem has been occuring forever. The only way to pass is to print nothing at all. As long as something is printed, the test will fail. I can not find the difference between two files. Using fc command and diff command locally both says they are the same.

    Can you check if the Author name for your commits :

    • are the same for the relevant commits?

    My Author Name is present in the config file. However, my Commits before 29 Sept seem not allocated to anyone. Although I have commits on 26 Sept under the same author name, that commit seem to be missing from reposense. Need Help. Thank you very much!

    The TP contribution tracking is done since 27 September. Any code written earlier is not tracked for TP

    Thanks for the clarification. But a very large chunk of my code was commited on 26 Sept. In this case can I use @@author to mark them as mine? (I am aware that they are commited before 26 Sept so they technically are not counted, but they are functional codes that makes up for the backbone of our program. In fact a large portion of my initial commit has not been modified and are still being used now in multiple critical functionalities.)

    Hi prof, for the PPP, do we need to strictly edit using markdown or can we create and work on a word document and then covert it to a pdf?

    Hi prof, i wanted to clarify, for this exercise, only the main method has to be unchanged right? Am i able to directly edit the getGradeCap method or that has to remain unchanged as well?

    Hi prof, just wanted to check if the Exercises in the Topics are mandatory to do?

    Yes besides the one on repl.it.

    Exercises (For Example)

    SE vs Civil Engineering

    Software vs Bridges

    Coding as a manufacturing activity

    List pros and cons of SE

    Which one of these is not included in Brook’s list of β€˜Woes of the Craft’?

    Do these exercises also contribute to the participation marks?

    Alright thanks

    Alright sure, thanks

    As per the instruction from the email, we renamed the jar file to the format [team ID][product name].jar but when we release on GitHub, the file name is converted to teamID.productName.jar. Would like to confirm that the file name for GitHub release is to be the same as the LumiNUS one.

    @dojh111 I am trying to use this library as well but apparently windows terminal does not support ansi escape codes. So the output became (string) instead. I am wondering if its working for you.

    Yeah, I found the reg command for enabling colored output but I'm trying to leave it as the last resort. I tried running with powershell but the output is similar as the command prompt.

    After some more searching, I have found a way (not sure if it's the correct one). Calling SetConsoleMode() to enable virtual terminal processing. The sample code in the first link gives the desired output, however when I try to digest and simplify it I could not the same output.

    1. https://stackoverflow.com/questions/52767585/how-can-you-use-vt100-escape-codes-in-java-on-windows

    2. https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

    Thought I should leave it here:

    https://github.com/fusesource/jansi/issues/31

    Noted, thanks!

    I cannot log-in using this Github account on CATcher 3.3.2 on Mac OS, because it said I am Error: Unauthorized user.

    What should I do?

    Thank you for any kind of help

    I am attempting Week 3 Ex9: filterEmails method, using java.util.ArrayList; however, repl.it prompts the message in output like:


    Note: Main.java uses unchecked or unsafe operations.

    Note: Recompile with -Xlint: unchecked for details.

    []

    []

    [adam@example.com, john@example.com, some@]

    [@bee.com]

    where the first 2 lines make the output different from the expected and thus the solution cannot be accepted.

    My full code:


    import java.util.ArrayList;

    import java.util.Arrays;



    public class Main {

    public static String[] filterEmails(String[] items){

    // TODO: add your code here

    ArrayList filteredList = new ArrayList();

    for (String email: items){

    if (email.contains("@")){

    filteredList.add(email);

    }

    }

    String[] result = new String[filteredList.size()];

    filteredList.toArray(result);

    return result;

    }



    public static void printItems(String[] items){

    // TODO: add your code here

    System.out.println(Arrays.toString(items));

    }



    public static void main(String[] args) {

    printItems(filterEmails(new String[]{}));

    printItems(filterEmails(new String[]{"abc"}));

    printItems(filterEmails(new String[]{"adam@example.com", "aab", "john@example.com", "some@"}));

    printItems(filterEmails(new String[]{"xyz", "@bee.com", "aab"}));

    }

    }

    How can I solve the issue, especially the one that Recompile with -Xlint: unchecked for details.? (I tried searching from StackOverflow but failed to understand the answers there. 😦 )

    Any help will be appreciated. πŸ˜ƒ

    I think perhaps it is because you use the ArrayList, but you did not declare the generic.

    Since generic does not do type-check and you did not declare either, it gave such warning.

    Try ArrayList > String > filteredList = new ArrayList >>();

    That works, thank you! It seems both warnings are caused because of it.

    Same issue. Thank you for pointing out it. Appreciate all the replies here.

    I've just changed my repl's first name too.

    Same issue here

    @hughjazzman ahhhh, thanks for pointing out

    Hi, can I ask why IntelliJ treats some of my methods used in other classes as unused? I ctrl-click the method and it says no usage found, but if I ctrl-click the method in where I actually use it, it will refer back to the greyed out method. My classes are also in grey color while I actually have used them.

    For example, I have used printGreet() from Ui.java and initFile() from Storage.java in Duke.java, but all the methods and class names are in grey and I am warned that they are not used.

    Thank you!!

    According to the video, .Jar file should be found in .out/artifact directory. However, I could not find my .out directory, but everything else works well. How to solve this? Thank you!

    Okay. Here is the screenshot of my project structure window. Thank you!

    ohhh okok thank you prof!! But still, may I know why I do not have .out directory? Sorry that this question may sound stupid haha

    Ok thank you prof!

    Hahaha alrite

    Hey! I don't understand why I did not get the participation mark for Week 2/3 despite attending lecture and answered the in-lecture questions (the one hosted on pollev), finished the repl.it questions & ip progress before tutorial.

    I would appreciate it if I can understand why this happened so that I can avoid the same mistake in the future. Thanks!

    Hi! I noticed that the link to repl.it "cs2113-2020 Aug-Dec" classroom is not attached under https://nus-cs2113-ay2021s1.github.io/website/schedule/week1/admin.html > "Tools - repl.it"

    I see, thanks for the reply. I opened up and noticed that my "First Name" on repl.it was my real name instead of GitHub name. I hadn't considered that an issue as my repl.it username was the same as github.

    I've changed the "First Name" to the GitHub name afterward.

    Thanks @tobiasceg for pointing out and @okkhoy for verifying the issue. Really appreciate it!

    I'll keep this issue open, hopefully affected people will notice this.

    Borrowing this thread for a related issue. I noticed the example given in the email was :"[CS2113T-T12-1][Tasks Pro].jar".

    Naming it this way might cause issue when running the program in command prompt due to space between "Tasks" and "Pro". Are we more advised to use "_" to replace spaces instead?

    Edit: Realized we can use quotation " " to encapsulate the name. But would still appreciate the quick check!

    Noted, thanksss! πŸ˜„

    Hi, I have pushed the branch-Level-5 but it is not detected by the iP dashboard. May I know if there's anything I merged wrong?

    I believe the dashboard is only updated once a week.

    I don't think so. The dashboard detected my Level-5 tag but not the branch

    I think the script runs once a day, and its probably a good idea to try having your final merge as branch-Level-5.

    but its pushed to github already how do I leave the the final merge as branch-Level-5?

    so your branch-A-Packages is found but not branch-Level-5? Might it be due to a small typo in the uppercase 'L', given that the name technically should be branch-level-5? Don't know if they accounted for typos like this

    branch-A-Packages is not checked on the dashboard. um its an upper case 'L' and my friends did with upper case 'L' worked but mine didn't

    Maybe you can make some edits and create a branch to push for that?

    I faced the same issue. Do we need to tag our codes?

    I do not understand what this method mean. I tried login into github is the popup by the error always come out even after i reset my password for github

    Despite having MarkDown plugin installed, it is not found in my Language & Frameworks. Did I miss out on anything during the setting up process?

    I have checked the file type and *.md is included for the MarkDown

    How do I re-add github authentication mechanism?

    oh @imhm 's method worked! thanks!

    @okkhoy what if i have already made changes for cs2101, made PR and merged?

    Hi Prof,

    I have a doubt regarding the A-MoreOOP increment for the iP. The classes that we are supposed to extract, is it a must that their instances have to be present in main class or is it ok if I have an instance of that paricular class in another class (other than the main class) ? Example: I have an instance of the storage class in the ArrayList Class.

    Hi Prof,

    In our Level-0 Greet implementation of the iP our we suppose to retain the initial logo "Duke" that was initially present or do we just remove the logo for now and just add in the code to greet the user?

    Hi Prof, Just wanted to raise this issue there doesn't seem to be an assignment file for the Grade helper key exercise on repl.it.

    oh ok noted, thanks prof πŸ˜ƒ

    oh ok thanks guys πŸ˜ƒ

    Alright Prof thanks for the clarification πŸ˜ƒ

    Library

    NUSMods API

    Purpose

    We want to use NUSMods API to check the existence of the module entererd by user and get more information on each module.

    License

    MIT license

    https://github.com/nusmodifications/nusmods

    URL issues

    Is it okay that the app only work if there is internet connection? Because we need to send requests to the API and fetch data from it. We have tried to download the json file in advance and put it into the resource folder. But there are many problems when packaging the jar. So we want to make the app fetch data from api once it is started, where internet connection is necessary.

    The reposense seems to be very far behind our upstream repo. It shows that we only write a few hundreds lines and does not show the commits we have added to the upstream recently. Are there any reasons causing that?

    Are we allowed to modify the gradle.yml files? The file gradle.yml provided uses runtest file which we don't want to use.

    When I create a pull request to the upstream, it will be automatically tested for building on ubuntu, windows and MacOs.

    But I don't know why this process lasts too long like more than 1 hour. Are there any possible reasons casusing this?

    In our case, I changed the gradle.yml file that teacher provided in the workflow. This file will let github automatically test runtest.bat/sh, which has some problems that will make our program keep running for hours. So we just delete that part of code in the file to not test it.

    OK, thank you!

    I think the script runs once a day, and its probably a good idea to try having your final merge as branch-Level-5.

    I think the script runs once a day, and its probably a good idea to try having your final merge as branch-Level-5.

    but its pushed to github already how do I leave the the final merge as branch-Level-5?

    im not entirely sure if im right, but you can either create another branch and called it that, followed by a merge, or do a git reset back to your previous commit, and merge again.

    May i also extend this issue to whether a .prn file is allowed as well?

    @scjx123 what is a prn file?

    its a type of spreadsheet text file. (:

    If this example is correct, I wouldn't suggest/approve using this.

    You can open it in a text editor, so human editable, yes, but it is hard to find where the data is!

    So defeats the purpose of having a human editable text file.

    the file i have does not resemble this, let me email you a copy!

    Library

    JDOM

    Purpose

    A more simpler parser to parse XML files

    License

    Apache 2.0

    Library

    https://www.tutorialspoint.com/java_xml/java_dom_parser.htm

    Purpose

    Parsing xml files which stores our data

    License

    Apache 2.0

    Are we allowed to use a default text editor such as notepad to edit files by calling methods from the java.awt. library?

    For our cheatsheet app, we were planning on providing a function for the users to edit the contents of the cheatsheet. Hence, we were thinking of using the methods from the library to open up the default text editor for the user to carry out this function

    Oops my bad prof!

    Here it is

    https://github.com/hunterhacker/jdom

    Library

    Notify

    Purpose

    Purpose is to show notification to users

    License

    Apache License, Version 2.0

    Is it okay to disable the page build and github/pages check?

    Maybe you did not initialize a value and called it?

    It seems like your version 1.0 is listed as a pre-release or maybe the progress dashboard is not updated yet.

    I think there is no need for assertions or exceptions to check if num is null. Since int is a primitive type and not an object, the programmer will get a compile time error if they happen to do int num = null. All primitive types have a default value, so if the parsing of user input into an integer fails, we can assume that num will be initialized into 0.

    However if you are asking for other object types, my answer would be method 1. Because it lets the programmer know that the program had tried to initialize with a null value. Prompting the programmer to look for instances of where this was called.

    Library

    Dozer

    Purpose

    To map JSON to Java object.

    License

    Apache 2.0

    Library

    json-simple

    Purpose

    Load and store persistent data as JSON. This library has a similar name as the other library that was requested here, but it is different.

    License

    Apache 2.0

    Hello, can I check if the following array indexes used are deemed as magic numbers?


    String name = arguments[0];

    String date = arguments[1];

    My understanding is that this is pretty straight forward as I'm assigning them directly to two variables which have descriptive names.

    That's what I thought so too, thanks for the clarification!

    I believe this is the successor of the previous JSON simple, the other JSON simple is authored by a single person (Yidong). For this JSON simple it is merged with the old JSON simple and maintained under Clifton Labs. I was confused by it as well haha.

    Hi, I was unable to complete all the steps during the lecture for the circus activity, so I attempted them again. However, I made the mistake of deleting my previous forked repository on Github as I thought it was interfering with my unsuccessful pushes. Currently, the main branch has been updated and hence I was unable to make another branch called "in-lecture". May I know how I should go about solving this issue?

    Error:

    hint: Updates were rejected because the tip of your current branch is behind

    hint: its remote counterpart. Integrate the remote changes (e.g.

    hint: 'git pull ...') before pushing again.

    hint: See the 'Note about fast-forwards' in 'git push --help' for details.

    Hi,

    I was wondering whether we are supposed to retain the traditional task entry feature (e.g. type anything, added as task) as we code Level-4. This seems redundant since the old task method seems to be identical to "ToDo" tasks now.

    Also, may I ask how strictly should we stick to the example outputs? It seems possible to detect the types of tasks automatically by looking for the "by" and "at" keywords in the string itself, but I'm not sure if such implementation/deviation from example output is allowed. (This method will follow the input of Level-2/Level-3)

    Thanks for any advice regarding these queries.

    @okkhoy Thanks for the clarification.

    Regarding the second part, I meant to write the program such that it automatically categorizes the type of task by detecting "/at" and "/by" (or the lack thereof) on the input so that the user does not need to enter specifically the type of task(e.g. typing project meeting /at Mon 2-4pm instead of event project meeting /at Mon 2-4pm). However, since the Level-2 commands are retained, I am uncertain of how the automated categorization can distinguish (or is required to distinguish) between a Level-2 "task" and To-Do since they seem like the same thing. Is it a better idea to stick with the guidelines provided by the sample output?

    @okkhoy Thank you for the advice. I will stick with the recommended method for Level-4 and will instead consider implementing automatic flag detection for the tP.

    @daniellimws @okkhoy

    Apologies for the delayed reply. I just realized my issue is the result of my blunder of forking @okkhoy 's Circus fork instead of the one at https://github.com/nus-cs2113-AY2021S1/circus. I have since re-done the activity with the correct fork and everything seems to work now.

    Appreciate the help provided.

    @okkhoy

    I was mistaken that the https://github.com/nus-cs2113-AY2021S1/circus project (I probably shouldn't have called that the 'main branch') had been updated with an in-lecture branch when in actual fact I accidentally forked your fork instead. Apologies for the inconvenience caused.

    I am not able to get the automated testing to work. It keeps on giving the error ACTUAL.txt not found and cannot find class that have been incorporated in the main class, resulting in a build failure.

    @Colin386

    Hi,

    Yes that is my project structure, however, when I run the java -classpath ..\bin main.java.Duke < input.txt > ACTUAL.TXT, it gives me the error "Error: Could not find or load main class main.java.Duke".

    Even though an ACTUAL.txt is created, it does not get updated based on the inputs given.

    Capture

    @HengFuYuen @okkhoy

    Yes this command worked to compile all the classes in the folder.

    Yes I tried this, it works. Understood the problem, thanks

    Hi,

    I am facing the same issue and cannot resolve it. Tried using chcp 65001 and java -Dfile.encoding=UTF-8 -jar

    For Level-3 of the iP, can we assume that the input from the user will always be done > int > and no other variations like > int > done/I have done > int >?

    Thanks all

    Or if you don't want to restart the program, I tend to just right-click to create the method, then copy-paste the code!

    Would it be an issue if we do not turn off the icon features? Can we leave it as it was?

    Hi,

    I don't really understand about why the example code for the increment A-MoreOOP initialises instances of classes instead of just using static methods.

    For example, it initialises a instance ui of class Ui to print things, but couldn't we achieve the functionality of printing things with static methods?

    Would like to know if there's any benefits of using instances of classes instead of static methods in these cases that I'm missing.

    Thank you!

    I seem to have the same issues. Running the command with the -Dfile.encoding=UTF-8 parameter just changes my output from a regular question mark "?" to the same symbol that @kstonekuan sees.

    I think in terms of member functions: if a method do not invoke any non-static variables, the method should be static.

    I also thought this way, that's why I was a bit confused why the example code used non-static methods even though I don't see how the methods for those classes could invoke non-static variables.

    Hi Prof,

    Okay! Thank you for the clarifications.

    Library

    Jacoco

    Purpose

    Code coverage reports

    License

    Eclipse Public License Version 2.0 ("EPL")

    Library

    Project ':json Path'

    Purpose

    For parsing our data source .json file into objects.

    We are planning to use this instead of the currently approved gson as gson parser has limitations on how they parse data.

    License

    Apache-2.0 License

    Library

    AniList GraphQL

    GraphQL Plugin

    Purpose

    To obtain information on anime and manga via a credible source.

    License

    Free for non-commercial use.

    Our team has obtained permission from the AniList administrator for making use of this. We will minimize the usage of the library whenever possible to avoid stressing their service.

    AniList Terms of Use

    Hello, I believe you could try to revert the merge. Check this out for more information.

    I wanted to amend a commit message, and after I did that I push to github. This however caused the commit timing on my repo to all become today's date. Is this going to be an issue!? The commit date is remains unchanged, but the day I pushed to github changed.

    I believe when creating branch-A-Packages later on, it might have messed up the branches as it shows the package branching from the level 5 branch and not from master.

    Okay thank you for verifying!

    On the site it shows:

    It says "the test class is in the same package as the SUT" is that how the script checks?

    Hi, I was merging branch-Level-6 to master branch but did not check the "Create a new commit even if fast forward is possible". It resulted in something like this:

    Then I did a git reset --keep branch-Level-6@{1} but was unable to revert back to the previous state before merging as the branch-Level-6 returned to the 2nd last commit in branch-Level-6 and master stayed at my last commit of branch-Level-6. So I merged master back into branch-Level-6 which went back into the situation shown in the picture above. I was unable to revert the merge after that.

    How do I move master back to origin/master? Would it be safe to checkout origin/master and reset master branch there? Or may I know if there is any other solution to this?

    Hi Prof, regarding Level-0 of the iP, the task states that we should commit after making changes, for this increment are we supposed to push the changes to the fork on github after committing? In addition, are we supposed to keep the DUKE logo that shows at the start?

    Noted, thank you prof

    Thank you! It is working now.

    Should this line be interpreted as we should have 1~2 negative examples per function or in total for the whole demo?

    I am not sure whether "code" here contains the documentation.

    Can we update UG to meet some requirements for CS2101?

    I faced the same problem. The expected is the same as the actual, so quite confusing

    A few thought the demo is OK. Definitely no more than 1-2 per feature.

    Does it mean we can have none for some features?

    Hi sorry I pushed branch-Level-5 two days ago (8sep) and it says the ip progress dashboard updated yesterday (9sep) but it still says it doesn't detect the branch-Level-5.

    did I do something wrongly?

    I merged the branch that it was merged to to the master is that ok?

    Or how do I undo the merging mess I made?

    I reverted it to branch-Level-5 and then merged it to master so now it's like this:

    master now has the latest version of the code

    is this acceptable? (also do i need to undo all of the other merge stuff I did or can I just leave it? I'm afraid I might accidentally delete something important?)

    Thank you @okkhoy and @ChanJianHao for your help!

    Library

    Not sure if anyone requested before.

    fastjson by alibaba

    Purpose

    Use fast JSON parser to read an existing JSON file.

    License

    Apache License 2.0

    Hi prof and friends! I encountered a problem when testing my JAR file using MacBook. My JAR file is running perfectly fine on Windows and Linux but it failed to run on MacBook due to DateTimeParseException.

    I have attached a photo of the error message in this post.

    My JAR has no Text input named 'sunday' at all and I even deleted the output.txt (which is used to save my data), but it still shows the same error. Any kind soul can help? Much appreciated!

    Double check if you deleted the correct file? Because it does look like the program is reading from a file.

    Thanks! I found the issue, there was a pre-existing txt.file.

    Thank you, prof. I tried to use org.json and simplejson libraries and followed the online guide exactly but I can't seem to cast to JSONObject and thus unable to search for a particular key.

    Hi, I tried to run the .JAR but experiences this error

    However, when I double click the jar file though no window pops up but it seems like the mkdir function is activated. So I'm not sure if its due to an error with my code or something happened during the creation of the JAR file. Please advise.

    For some reasons, I had to rebase my commit history to merge 2 different branches. As a result, the timings for my commits became very recent (ie all the commit timings became that of the time where I did my rebase). Will I be penalised because of my commit timings as they are past the deadlines?

    Hi prof, I have a function that requries the printing of unicode characters and could not find an alternative in a short period of time. Would it be considered too much to ask if I required the user to enter chcp 65001 in the UG before actually starting the app or should I manually call the command using in the java code?

    I see. Thanks for the clarification!

    Library

    Color Factory

    Purpose

    Used to convert user input color option from String to Color object.

    License

    GNU GENERAL PUBLIC LICENSE

    Library

    Apache POI API

    Purpose

    Used to create PowerPoint slides (.pptx) based on existing decks of flash cards that user creates via CLI.

    License

    Apache License, Version 2.0

    I faced the same issue and after implementing @wangqinNick solution, the terminal will still show Γ£ÿ and Γ£ô instead of ✘ and βœ“ when I have yet to change the EXPECTED.txt to match ACTUAL.txt. But when I open ACTUAL.txt it shows ✘ and βœ“ correctly.

    After I changed EXPECTED.txt to match ACTUAL.txt, no differences will be detected when I run runtest.bat so I believe it is the terminal that is not able to show the correct symbol rather than java.


    Comparing files ACTUAL.TXT and EXPECTED.TXT

    FC: no differences encountered

    Library

    alphavantage4j

    Purpose

    License

    Hi Sir @okkhoy ,

    There is not many alternatives that we could find. Although it's no longer maintained, we tried it and found it to be the most intuitive to use.

    Regards,

    Alvin

    Hi Sir,

    Thanks. Will take note of the limits.

    Regards,

    Alvin

    I tried runtest but the ACTUAL.txt file could not be found. Anyone has any idea...?

    I tried runtest but the ACTUAL.txt file could not be found. Anyone has any idea...?

    I have no clear thought. But I am interested in your structure πŸ˜•

    You project content root is week4circus, instead of circus as normal. Did you import the project or you just open it? Could you click File -> Project Structure ->modules and screen shot your modules?

    This is my project structure.

    The "week4circus" is a folder created by me and I cloned the github repo into it

    The ACTUAL file gets created on successfully running the runtest.bat file.

    Were you able to run the runtest.bat?

    Oh wow it works now.... πŸ˜• idk what changed but it works now! Thanks for the help

    Library

    JColor

    Purpose

    We intend to use this library to see if it will help with allowing colours for text outputs in the windows CMD terminal. If it does not work, we will be removing it from the project.

    License

    MIT License - https://github.com/dialex/JColor/blob/main/LICENSE

    @Chongjx I did some research and I think the issue is the windows command terminal (cmd) just does not enable ANSI escape codes by default. As such I think the only way to get coloured outputs in windows cmd would be to get the user to enable it on their terminal window, or ask them to use powershell instead

    I'll continue taking a look to find something that can enable colors on windows cmd, and update here if I find any. Don't want to resort to reg commands also.

    As per coding standards, constants should be in all caps separated by an underscore "_". However, for my team's tp, the checkstyle has flagged all our constants as error with the following


    Abbreviation in name 'STARTING_SEMESTER_INDEX' must contain no more than '2' consecutive capital letters.

    Inside the code it looks like this


    private final int STARTING_SEMESTER_INDEX = 1;

    I have tried running the script again when I have deleted the private and it is still appearing as an error. Unsure of how to proceed, whether to change the names for constants to fit the check style or ignore the check style warnings.

    Library

    Apache Commons Lang

    Purpose

    To allow for the class to be printed as a string.

    License

    Apache (http://www.apache.org/licenses/)

    Thank you Zhi You! That solved the problem!

    On using the print option in the chrome browser to obtain a PDF of the tp UG or DG (jekyll theme: Minima):

    The PDF is rendered, however, at page breaks it looks something like this:

    Sometimes, even the titles are split at page breaks. I have tried the following things:

    (some involving CSS which I'm not very proficient in, so I'm probably doing something wrong)

    • Played with the settings in the print mode and seeing whether anything changes. (A trivial thing, most definitely didn't help)

    • One thing I did was try and render the web page after changing some settings in the developer tools:

    Selecting the "print" style under rendering:

    However, this was to no avail 😦

    • Another thing is saw a post in stackoverflow recommended changing the CSS style of the theme (?) . So according to this link one may customise the CSS of a jekyll theme in the following manner:

    So I created style.css in assets and populated it with the following (+ the import statement from the instructions):


    @media print {

    div, image, svg {

    break-inside: avoid;

    }

    However, still can't seem to print without splitting images and text at page breaks. I think this will be considered as a UG/DG bug if the pdf is like this..

    I speculate I'm doing something wrong with CSS OR that I might have to go through the process of installing Bundler and then the Ruby Gems to set up the webpage with jekyll and then be able to add to the existing CSS files. However, still not quite sure.

    It would be great to get some help on this issue _"

    Thank you in advance!

    I think this could have been added to #1 under website issues?

    Is this the link that's supposed to be referenced: https://se-education.org/addressbook-level3/team/johndoe.html ?

    Also this ^ yup I do believe this is the link that was supposed to be referenced.

    @okkhoy I see. Alright thank you so much Prof!

    Hi prof, is there a problem with the script/compiler?

    Screenshot 2020-08-19 at 8 43 45 PM

    A bit of context, I save and did not submit my draft and moved on to the other questions. Now this question have error...

    Ohh.. I've reloaded the website, alls good πŸ˜ƒ

    When I run the code on IntelliJ, the characters for the ticks and the cross appear. However, when I run the code using the command line, they appear as question marks. How to fix this issue?

    Sorry I might have missed that. Thanks guys

    Library

    [Crypto] (https://docs.oracle.com/javase/8/docs/api/javax/crypto/Cipher.html)

    Purpose

    Encrypt the saved data file so it is not saved in plaintext to protect the privacy of users.

    License

    Oracle? Sorry not sure if there's one.

    Ah okay, then I guess we won't be using this

    I was unable to run my gradle file during tutorial.

    The error i got was "Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle."

    I tried changing the setting to allow HTTPS but it still does not work.

    I also deleted everything and cloned one more time but it still doesnt work.

    For some reason i am unable to post a screenshot of the error onto the forum.

    Nevermind. There was a problem with the NUS Wifi

    During the PE dry run, it appears some of our testers decided to edit the files created by the application, hence the application did not work as intended. \

    Additionally, some have tried to force close the application (by using ctrl-c) and stated that the application did not save that session.

    Are these considered bugs?

    Library

    NUSMods API

    Purpose

    We would like to use NUSMods API to check the existence of the module that is entered by the user.

    License

    MIT License

    https://github.com/nusmodifications/nusmods

    There's the usual problem of the default tick and cross showing up as question marks, but my group wants to try adding more Unicode characters like emojis into the program.

    Some members in my team have difficulty displaying the output (question marks instead of actual characters), while others have no issue.

    Are we allowed to assume that the user is able to display Unicode characters properly? Given that the tick and cross were shown to us by the syllabus despite some not being able to display them, I think it's a fair assumption but we're checking just in case.

    So far, I've made a release on my repo for the jar file and tagged it with the A-Jar tag. Is there anything else I'm missing out?

    For context, I made the Level-6, Level-7, and A-Collections increments on the same day and they were marked on the Dashboard as complete.

    Hi,

    After I divide classes into packages, the automated test doesn't seem to work anymore.

    My code structure now looks like this

    I tried changing line 16 in runtest.sh to duke/Duke.java instead of just /Duke.java, but I still have errors

    Does anyone have tips to fix this?

    I see. Thanks guys!

    Hi Prof, for IP level-3 (mark as done), do we have to account for the cases where the user inputs a task number(positive or negative) that does not exist or if the user simply inputs done with no number and print out an error message?

    Thank you!

    If anyone else still has problems, mine worked from clicking edit on your github account and click edit and refresh the Oauth token!

    Hi Prof, are we able to see the updates in the iP progress dashboard https://nus-cs2113-ay2021s1.github.io/dashboards/contents/ip-progress.html now?

    I have made my first commit to the forked project, with a summary "Update Level-0", but I didn't see any change in the dashboard. The last update is still on Mar 03 2020.

    @okkhoy @imhm Thanks for the brilliant solution! I encounter the same problem today and this works for me!

    I am getting this when trying out the runtest.bat for some reason. List is a custom class I declared. I have not changed my runtest.bat file at all.

    Thank you so much! It works now.

    I think the link to the example ppp on https://nus-cs2113-ay2021s1.github.io/website/admin/tp-deliverables.html#deliverable-project-portfolio-page-ppp is broken.

    Is this the link that's supposed to be referenced: https://se-education.org/addressbook-level3/team/johndoe.html ?

    @gmit22 have you changed the font in your terminal to nsimsun?

    Hi prof, for Level-3 of the IP, are we free to use anything we want in the square brackets before the name of the task to indicate if the task is done or not done?

    Hi Prof, just for confirmation, is it okay to use the StringUtils in this org.apache.commons.lang3 library?

    An automated smoke testing of your iP JAR file found the application crashes with the following error(s) upon launching:

    On Windows, using Java 11, for the ip.jar uploaded on 10-02-2020 (DD-MM-YYYY) at 04:22:13:

    Error: Invalid or corrupt jarfile ip.jar

    On Linux, using Java 11, for the ip.jar uploaded on 10-02-2020 (DD-MM-YYYY) at 04:22:13:

    Error: Invalid or corrupt jarfile ip.jar

    On Mac, using Java 11, for the ip.jar uploaded on 10-02-2020 (DD-MM-YYYY) at 04:22:13:

    Error: Invalid or corrupt jarfile ip.jar

    Anyone know what causes this errors? I tried running this jar file on my windows and it works. I asked my friends using MAC and Windows to try running the jar file and all of them said that they can run it.

    Anyone encounter this problem in your github pages ?

    Hi.

    I did not receive any invite to the organization and tried to follow the link in the admin info but did not work.

    I just made the pull request a couple of hours earlier. Is that a factor?

    Hi friends!

    I have built my artifact for my ip for A-Jar commit and keep receiving this class file version error when i try to run the .JAR file.

    Does anyone know what does this mean?

    Thank you in advance!!

    Regards,

    Shao Jing

    Library

    org.apache.commons.cli

    Specifically, commons-cli:commons-cli:1.5-SNAPSHOT

    Purpose

    Parse command line arguments without reinventing the wheel.

    License

    Apache License 2.0

    It has been frequently suggested during the course that output be extracted out to Ui and messages class and parsing functionalities be extracted to Parser class.

    Doesn't this approach mean for every command added, we need to change Ui, Parser, Command, Messages and object classes extensively? Does this indicate high coupling? As most of our development are adding commands over time, are we changing too many classes every time we do that?

    Would a better approach be to put most of the logic for every command in Command classes? Then, adding a command would mostly require changes only to that specific command class. Other teammates can work on other commands with lesser conflicts.

    @imhm aiseh

    This is something new to me too as I thought the code that you have written for your constant is fine. I tried what you did and the check gave me the same warning. However, when I added 'static' before 'final' the check passed. So, I believe that constants should have the 'static' keyword in it and hence the check only passes such cases.

    Also, if you try to refactor something in your code into a constant, the IDE will automatically declare it with the 'static' key word in it, like so:

    Below are some useful information I found about what static does and I hope this might explain why we need 'static' when declaring our constants.

    StackOverflow (see the comment with 104 upvotes)

    you can use System.lineSeparator()

    Maybe you can try the following? So instead of using Duke, it's duke.Duke instead, based on the structure inside the bin folder:

    java -Dfile.encoding=UTF-8 -classpath ..\bin duke.Duke &gt; input.txt > ACTUAL.TXT

    Does it have anything to do with our tests being packaged in another command folder

    the prof mentioned that theres a possibility that ur repl account name was set up according to the instructions: github name into the first name part of the repl account

    Library

    Jansi

    Purpose

    To allow colourisation for text outputs in the windows CMD terminal.

    License

    Apache-2.0 License - https://github.com/fusesource/jansi

    My Junit is still not updated on the dashboard...

    Faced the same issue today. The method works. After deleting, click Add. I could not use Basic authentication and used Oauth and it works

    Library

    Apache POI

    Purpose

    Used to export data to Excel files as well as to achieve data visualization.

    License

    Apache License, Version 2.0

    Hi Prof, instead of using .txt file, can we use a .csv file to store the data on the local machine?