This dashboard is updated weekly.
[This page was last updated on Apr 08 2021] [ indicates those watching the forum (kudos π)]
@Leeyp
(21 posts)1. [Code Quality] Question about Exceptions
I received this comment on my PR, but I don't quite understand what it means:
"It is good that new exception classes are created for different purpose. However, in this case, it currently seems to be doing the same thing as its parent class, Exception. Consider revising empty classes by removing them or updating them accordingly."
Aren't more exceptions to catch bad error cases better? That's what I understood from one of my previous questions.
2. Linkage Error in my ip jar
My teammate tried my jar and he got this error on my jar:
Error: LinkageError occurred while loading main class duke.Duke
java.lang.UnsupportedClassVersionError: duke/Duke has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Why does this happen, is this a problem?
How to fix this problem, if it is not acceptable problem?
3. Forgot to do ip 7 work in New Branches
I was too excited to start doing the Level 9 increment (and A-JavaDoc), that I overlooked the instructions to do them in separate branches again (since A-MoreOOP was done on master branch).
So, my work is done on master branch. How to reverse it and make the new branches for the git merging requirement? I'm sure it would be quite troublesome. During final grading, will they track this git merging, or will only the final product be graded?
4. How to condense all my exceptions into a small exception Duke Exception?
try {
Parser.executeCommand(Parser.input, command);
} catch (InvalidCommandException e) {
Ui.showInvalidCommandError();
} catch (EmptyInputException e) {
Ui.showEmptyInputError();
} catch (StringIndexOutOfBoundsException e) {
Ui.showNoTimeAddedError();
} catch (InvalidEventTimeException e) {
Ui.showInvalidEventTimeError();
} catch (InvalidDeadlineTimeException e) {
Ui.showInvalidDeadlineTimeError();
} catch (NumberFormatException e) {
Ui.showInvalidIntegerTaskIndexError();
} catch (IndexOutOfBoundsException e) {
Ui.showTaskIndexNotExistsError();
}
The above is my code. As you can see, there are many exceptions I tried to catch. But, I didn't know you can shrink them all down to this:
public void run() {
ui.showWelcome();
boolean isExit = false;
while (!isExit) {
try {
String fullCommand = ui.readCommand();
ui.showLine(); // show the divider line ("_______")
Command c = Parser.parse(fullCommand);
c.execute(tasks, ui, storage);
isExit = c.isExit();
} **catch (DukeException e) {**
ui.showError(e.getMessage());
} finally {
ui.showLine();
}
}
}
Source: Week 7, A-MoreOOP.
How to do that?
5. Build failed on autograder but works fine on my computer
I'm not sure why the Github Classroom autograder is rejecting my work, even though my code works fine on my local machine.
I've pushed the entire thing to the Github Classroom, so I don't see why there would be a build error.
Therefore, I am stuck on Week 2 Ex 2. Why is this?
6. Do we push the iP weekly homeworks to our public github account?
In Week 2, the iP weekly homework instructs us to complete "Level-0: Greet", and commit it. But, I believe that my sourcetree only commits to my local repository, rather than my public Github account for some reason. To do so, I need to push the commit to my account. Is this the correct way?
Does the automatic grading script check our accounts at 00:00 before our tutorial and grades us accordingly?
7
Sorry, could I ask, what are the tags thing you just mentioned? I was not aware of that feature.
Iβm happy to say that I have managed to push my commit to my online GitHub fork for the first implementation π
8
Very nasty to give us invalid inputs so early in the course! Is this the expectation we should have for future encounters in the module? If I recall correctly, it was mentioned that the "Practical Exam" would be other students attempting to break our software, isn't it?
9
Update: I have completed Week 2 Ex 3 and Ex 4 with no issue, it is only Ex 2 that is having issue. I'm confused at why this is the case, could it be because of the risk of invalid input in args?
Thanks for viewing.
10
as prof said in the other thread, try checking for null and return nothing
I did that, but it seems like my autograder is still rejecting my answer, for some reason. :>
11
as prof said in the other thread, try checking for null and return nothing
Okay, did a bit more googling and managed to solve it. Apparently, in Java, having null arguments is not equivalent to having 0 arguments. π Learnt something new about Java today!
Though, it is a bit too tricky to be the second testcase overall for this course π¦
12
@Leeyp it was not done intentionally.
Hopefully, no such encounters in the future π€
PE is a different matter entirely. We will talk about it when it is the right time!
Hi, would like to clarify on this task too. Is it expected to observe a "Autograding fail" result (Points 0/1) in the Git autograding status upon pushing?
Expansion of the error message states testMain failed.
But the code runs fine on local terminal upon manual insertion of the names.
The test case can be completed assuming adversarial inputs. If you solved it, you will get a green tick like for Ex 3 and 4 (arguably a lot easier!). Good luck.
13
Dear Prof,
I'm unclear about the requirements for Task 3.
The prompt from Task 3 expects this, when a task is marked as done, with [x], and if its not done, it is [ ].
But, the partial code generously provided by the prompt using "A-Classes" gives us a [tick] and [x] instead:
So, which style of "done" is expected of us?
14
A secondary question - do we need to include tags for special increments like A-CodingStandard and Extension: A-Classes? I don't think I really need to code anything for those since they seem about 'style' and 'good coding practices'. π
15
Lastly, may I clarify what it means to commit for A-CodingStandards or A-Classes? Are those compulsory for the project, or for students to "get "A"" ? How do we submit or fulfill those extensions?
Thank you!
16
Great, thank you prof. I will leave it like this then. I was just concerned if it was too long or ugly.
17
Dear Prof,
Thank you so much for your advice. I have managed to solve the problem and do things the right way.
Now, I have another question.
In my "wrong" A-JavaDoc, I wrote javadoc comments for "Find" methods written in Level 9.
But, when I did the "right" way and branched out, then merged back, my Javadoc comments are gone, since Javadoc is meant to be done parallel from Level 9, the "Find" functions didn't exist yet!
So, my new master branch had lost the Javadoc comments for Level-9 work. This, is intended, by design.
But, now, how do I get back the Javadoc comments from my old commit/push? Since the "new" master branch is now "behind" my old branch, missing Javadoc comments for Find methods, I tried merging back to the old commit to make a new commit, but it wouldn't let me, because the new commits deleted information from the old commits.
In the end, to solve this problem, I did a very non-gitty way of copy pasting my old work (Javadoc comments for Level 9 work) into my newest master branch, re-committed, and re-pushed as per normal.
But I wonder if there is a more gitty way of doing things, that is to save/merge with an older commit which has useful stuff that was deleted later, but you didn't want it to be deleted previously?
Sorry if my question doesn't make much sense, I tried making it as clear as I can!
TL;DR: Old work done sequentially has Javadoc comments for "Find" function. New work done in parallel has no Javadoc comments for "Find" function. How to get my Javadoc comments from an old commit to reappear in git?
18
Dear Prof,
Thank you for your advice. Seems like that was a careless mistake that could have led to very disturbing and urgent consequences!
Do I have to fix all my commits for all my previous IP work? Since, if the TA checks, then it would be disturbing if they cannot run my code for something like Level-1 or Level-6, etc? Or is that fine, since only my final Jar is being graded?
Thank you so much!
19
Ok, thanks prof!
20
I have a custom exception message, but I put it into Ui class instead. So, it will print the message when this exception is triggered. Is that the wrong way?
Because otherwise my try/catch statement will be the one that is empty, and that is the one that the Coding Quality guidelines say is bad.
21
Great idea, thanks prof!
@kwokyto
(18 posts) 1. Try-Catch blocks in Sequence Diagrams
What is the correct format for representing try-catch blocks in sequence diagrams? Would it be using alt? Because technically 90% of the code in try block still can get executed before the catch is triggered. Alt implies that it is a strict either or.
Thanks!
2. UML notation for overloaded methods
Is there any specific UML notation for methods with the same name that are overloaded?
e.g.
public void printThing(String message) {
print(message);
}
public void printThing(String message, int x) {
while (x--) {
print(message);
}
}
3. π‘ Fixing permissions for TP
The original commands from prof didnt work for me. I did this instead and it works:
git update-index --chmod=+x runtest.sh
git commit -m "Update runtest.sh"
4. Formatting of exceptions without exceeding line limit
I have to define a function that may throw several exceptions, but that makes the function definition line very long. I remember that there is a "hard limit" on how long a line can be. If this function definition line exceeds this limit, how do I format the layout? Thank you!
5. Pushing and deleting tags
I have pushed a "Level-1" tag on a commit for my ip, but i found some bugs, fixed them, committed and push again. From what i understand, i cannot assign 2 commits with the same tag. How do i delete tags and re-tag the correct commit? will the tags be used to trace which commit will be graded? thanks!
6. week 2 ex 2
i dont quite understand what we are supposed to do with this. i understand that we are required to take in 2 values and compare them, but in the test file, null is passed into main, are we also expected to be managing the error handling for "wrong" arguments passed into the function? thanks
7
i see, so on github it will be alright for it to be left as failed?
8
as prof said in the other thread, try checking for null and return nothing
9
Adding this if statement to check for null works for me.
Also, would like to know if
|| args.length > 1
is redundant in this case? Thank anyone in advance.
if (args == null || args.length > 1) { return; }
its the length that is redundant, you cannot check length of null
10
no problem, actually you can check it out by running each condition individually, i believe only args==null will work
11
edit: i realised there are differences between local and remote tags, i have deleted remote tags via github browser, but local tags tripped me a bit. using this command in cmd in your repo folder works
git tag -d tagname
12
you can try if this works for you
13
okay thanks prof!
14
I have also observed in some sites that suggest using a break block to catch an exception
15
do you have an example that we could follow from? currently im using a opt, and using my main method to "create" and exception instance, which is isnt very accurate but the closest that i can get
16
sure prof, without giving too much of what i have, this is what i have for now (changed from opt to alt)
i named the 2 conditions "successful execution" and "exception caught"
the only inaccurate part is where the main function calls the constructor of exception, which should actually be called during method1 or method 2
17
i would think that might be too complex for the diagram itself, because my structure is a bit more nested than this. when comparing readability and accuracy, should i prioritise readability and acknowledge the "bug"
18
hi prof, may i personally message you about this? how can i reach you?
@8kdesign
(13 posts) 1
Not sure about the grading thing, but you have to push the changes from sourcetree (after you commit) in order to see it on GitHub.
2
On GitHub, go to the Actions tab. You should see your latest revision getting checked. If it is correct, you should see a green tick once it is done.
3
The test case is when null is given instead of the 2 names. You have to check for null. (And do nothing if null)
4
What is the link that you used?
5
You should directly use != for comparison with null instead. Null is not an empty string, but the lack of one, so you can't check its length.
6
Try without .git behind
7
Hmm strange. You managed to do the other exercises?
8
Could it be that your Github account is not set up properly on Sourcetree?
9
You need to add a configuration by clicking on the "Add Configuration" button beside the run button. A window will pop up, then click on "+" on the top left and select application. Select Java 11 for the first input, and Duke class for the main class. Press ok and you should see the run button turn green.
10
Yep it is the Corretto 11 option. (By the way, you need to select "Application" in the screenshot)
11
Click on the icon on the right of the input box. Something should pop up and you should be able to select from there.
12
For expected.txt, you only want to include the parts that the program outputs and exclude what the user is supposed to input.
13
I also had the same issue. The way I solved it was to add an empty line before the code for the table.
@jovanhuang
(11 posts) 1. Difficulty cloning from Github Classroom
I am having some difficulties cloning from GitHub Classroom.
When I try to clone using HTTPS on source tree, this error below came up. Please assist, thanks!
2
I used this link:
https://github.com/cs2113-AY2021S2/week-2-ex3-jovanhuang.git
3
The page is valid when I click on the link using my github account though.
4
The same happens for the other exercises.
5
I followed @okkhoy tutorial on connecting SourceTree with Github closely though. Are there any ways to check if that is set up properly?
6
I tried cloning using command line, but this error persists.
7
try this:
Sourcetree doesnt have all the required credentials for private repo
This works! Thank you so much to Prof and all the others who helped! π π
8
It is the right place to add your account.
This is what I did -
Under authentication, try deleting the old account and add again. This time round, add using your github username and for the password, use generated token.
9
It's because Windows has a different line ending (
\r\n
) compared to Linux (\n
) which is used by the platform for running the test cases.
Try replacing each
System.out.println(thingToPrint)
call withSystem.out.print(thingToPrint + '\n')
instead as a temporary workaround... trying to find a more permanent one too myself.
Thank you so much for this workaround solution. I was having the same problem where the test cases failed on my local computer but passed on github. Tried this solution and it works!
10
I had the same issue. I changed the tick to "X" and the cross to " ". The "X" is the alphabet X in this case.
11
Hello, I'm wondering how I can add in exceptions in my sequence diagram. This is my attempt in displaying it on my sequence diagram. Am I displaying the exception handling part correctly?
There are 2 exception being thrown here, one under the alt, another at the end.
@okkhoy
EDIT: (RESOLVED)
I asked my TA and she suggested to change the break box to a return arrow.
@Rye98
(11 posts)1. Error when executing runtest.bat
I am getting the error below when attempting to execute runtest.bat in IntelliJ. (I have already changed the directory of the folder to the one that my current project is located in.)
Any suggestions to fix this?
2. Failing testcases on IntelliJ
I am failing every testcase on IntelliJ when I try to run TestMain, but I get the correct output on my console when I run Main. The error message is shown below, how should I interpret it?
π‘ You can use Markdown to format your text
3. SourceTree not showing commits from IntelliJ
After I have edited the "Duke.java" code in IntelliJ, and committed in IntelliJ, my SourceTree sensed that it is the readme.md file that got changed?
4. Unable to run Duke.java (and confusion with admin isses)
Hi, my IDE seems to be unable to run the Duke.java file. (There is no "run" button available.) Attached is the screenshot of how the IDE page.
Also, Im very lost at how I should be downloading the files for the exercises and submitting my answers using sourcetree.
5
Have you configured the JDK?
My IDE's homescreen looks different from the one shown in the video. Any advice on how to select the JDK?
6
You need to add a configuration by clicking on the "Add Configuration" button beside the run button. A window will pop up, then click on "+" on the top left and select application. Select Java 11 for the first input, and Duke class for the main class. Press ok and you should see the run button turn green.
There doesnt seem to be a Java11 option under configuration... (My SDK is selected as: "11 Amazon Corretto version 11.0.9", is this the correct version to be used?)
7
Yep it is the Corretto 11 option. (By the way, you need to select "Application" in the screenshot)
Thanks, found the java 11 option. However, the code is still unable to run. (Attached error message below). I have tried changing "Duke class" to "Duke" and "class Duke", similar error message is shown for both.
8
I suspect this is not imported properly.
Why is the folder named Duke.java on the left side of your second screen shot? Can you expand that and show what you have?
The only item under the folder is "Duke.java". (No other visible files)
Click on the icon on the right of the input box. Something should pop up and you should be able to select from there.
Nothing shows up when I search for "Duke".
9
I suspect this is not imported properly.
Why is the folder named Duke.java on the left side of your second screen shot? Can you expand that and show what you have?
Update: Seems that it is indeed a problem with my importing. I failed to import the entire folder. Sorry for the troubles.
10
Thanks prof! (Didnt realise it was the same problem)
11
You need to set the Java path. The command prompt is unable to fetch the Java compiler.
The error message is :
'javac' is not recognized as an internal or external command ...
Sorry I don't really understand. The main file is able to run with no problem. Are the following settings correct? I cant seem to find an option asking for Java path
@cswbibibi
(9 posts)1. IP-Tracker
Hi Im trying to finish the "Tracker" task at the IP dashboard. I have followed the instruction on week 2 ip to tick the "Issue" check box to enabled the issue tracker of my fork. However in my ip progress dashboard, the Tracker task is still in red meaning not done yet.
I can access the URL for issues so i guess my tracker has been enabled successfully, and i also waited for more than a day for the dashboard website to update. However its still mark as undone. Can somebody help why?
2. Enquirers on ip
For different increment level, do we need to ensure the feature for the previous level can work simultaneously with the new level feature? For example when I'm done with level 2 increment, which is to add task to a tasks list. And then for level-3 do I still need to keep this feature in the code, or I just need to rewrite the code to satisfy the level3 requirement only?
Besides, there are 3 tasks(read book, return book and buy bread) given in the level 3 example for list output, so my question is that when we are designing our code, do we need to set the list and program output the same as given in the example?Β That is only task 2 needs to be done.
Thank you.
3
Thank you for answering my first questions prof. My second question is regarding level3 βmark as doneβ increment. Do we need to design our own task list and can choose which ever task to be done and undone? Or do we have to run our code to give same output as the website level-3 example? @okkhoy
4
Got it thank you very much:) @okkhoy
5
hey prof my wk4 ex 1 passed the test locally but when i pushed it to Github classroom it always faild. Is it bcz the github classroom auto-grading is still not availableοΌ @okkhoy
6
Sorry prof but my output is correct when i run Main, and i changed all println in Main to print( + "\n"), i still failed the test case. My error message is the same as shown in the screenshot above. π¦ @okkhoy
7
Yea... i think there's no problem with the letter cases... @okkhoy
8
omg thanks for the tips, after changing all the println to print + "\n" and line separator to "\n", it finally passed the test locally π
9
@okkhoy hi prof can you help to take a look at this? Thank you!
@NgManSing
(6 posts)1. About text-ui-test
I am trying to use the batch file which is for text-ui testing. I have put some inputs into input.txt and have written the expected output into EXPECTED.TXT.
input.txt
EXPECTED.TXT
However, the program only takes the first line in the input.txt and ignored other lines. The compiler replied "Exception in thread "main" java.util.NoSuchElementException: No line found".
Where have I made mistakes?
2. Is previous version editable in Sourcetree (Git)?
If I have completed programming up to Level-3 (tag) but I found a typo in Level-1 (tag). Is it possible to edit Level-1 (tag)?
3. Regarding encountering an error during running tests in Exercises
My computer setup:
IntelliJ Idea version 2020.2.2
Java 11.0.9_12
Exercise: Create Rectangle objects
Expected output: "java.awt.Rectangle[x=0,y=0,width=5,height=10]"
I failed to run the tests althought my actual output is the same as the expected output.
The IDE keeps reporting that "contents have differences only in line separators".
What am I doing wrongly? π¦
4
What if I found a bug in my Level-1 but I have already working on Level-3? Is it OK to correct the bug in Level-3 only?
5
I made big changes between Level-1 and Level-2. Will it be problematic?
6
I find out that if I declare the Scanner object outside a static method (i.e. declare the static final Scanner object globally) can solve the problem.
@heyjinwei
(5 posts) 1. Coding Standards to Follow
May I know where we can find the coding standards that we are to follow? I can't seem to find it through the slides or the website.
2
Hi, when I don't input an argument the code exits cleanly when i run Main. However, when running TestMain I encounter a NullPointe Exception and I am unable to figure out why.
3
Thank you!
4
oh right, I referred to @Leeyp 's closed post for the answer. Thank you!
5
I'm not sure if it's the right way to correct this issue, but I solved the problem by printing a '\n' character instead of a println.
@JoviYeung92
(5 posts)1. π‘Guide to bundle resources to jar file and handling it.
Hi everyone, i will provide the guide on how to bundle and handle the resource in the jar file.
First, create a resource directory under the build path.
You need to put your resource(eg txt file) into that resource directory.
3)When you build your shadow jar the resource is supposed to be inside(to check just open it with winrar).
To access this resource file, you will first need to create a InputStream and direct it to your resource directory.
Next, create a InputStreamReader to store the content of your inputStream. (You cannot use FileReader because the resource will be inside your jar file and your jar file is like a ZIP file.)
6)Next, once the data is stored into your InputStreamReader you will need a BufferedReader to decrypt and read the content like how you read a normal file using file reader.
Note: You cannot write to the resource file inside the jar file, it is meant to be read only. If you want, you can copy the file inside the resource of the jar and save it outside the jar file.
2. PR merge
Hi, when we do a PR merge on GITHUB they will prompt to delete away the old branch . Is it okay if we delete that old branch ?
3. Teamwork submission link for TP this week
Submission: Submit your product name, target user profile, the value proposition, and the public link to your collaborative project notes via TEAMMATES. You'll receive an email from TEAMMATES with the submission link. Only one member needs to submit on behalf of the team. All members can view/update the submission.
Hi prof,
When will the submission link be avail? Thank You
4
If i don't push my file from source tree i can also edit it directly from the main file inside github right?
How can we know our codes are 100% correct? Are there any checkers?
5
@JoviYeung92 just to be sure I answer correctly, are you talking about the individual project (iP) or the exercises on GitHub classroom?
For iP, each increment would add something new to the codebase you have developed so far. You need to test it on your machine to see if things are working. During the tutorials, you are required to show a quick demo to your tutors. So things get validated there.
If you are talking about the exercises on GitHub classrooms, there are tests that run via GitHub actions (as mentioned by @8kdesign ) if the test passes, you are doing the right thing.
I am preparing a video to demonstrate how to import the exercise to the IDE, do your development and testing; once your tests pass locally, you can push your code, which forms the submissions.
okay prof, thanks for the information.
@Song0180
(5 posts)1
Ensure the correct version of JDK is selected in File -> Project Structure...
2
Adding this if statement to check for null works for me.
Also, would like to know if '|| args.length > 1' is redundant in this case? Thank anyone in advance.
'if (args == null || args.length > 1) {
return;
}'
3
Adding this if statement to check for null works for me.
Also, would like to know if
|| args.length > 1
is redundant in this case? Thank anyone in advance.
if (args == null || args.length > 1) { return; }
its the length that is redundant, you cannot check length of null
Thank you
4
May I know how to see if the result is passed on GitHub?
5
you will see a green tick next to the commit like this:
Thank you!
@kewenlok
(5 posts) 1. Request for permission to use Argparse4j library
Argparse4j Library (https://argparse4j.github.io/)
This library is used for parsing user arguments from the command-line interface.
The library is released under the MIT License and it could be found at https://argparse4j.github.io/license.html.
2. Request for permission to use Gson library
Gson Library (https://github.com/google/gson)
This library is used for serializing and deserializing JSON data to and from Java objects when storing data in files.
The library is released under the Apache-2.0 License and it could be found at https://github.com/google/gson.
3
I believe the NoSuchElementException error can be solved by checking if your scanner object has next line using hasNextLine() method before getting the nextLine() value or in the while loop.
4
Thanks prof!
5
Thanks prof!
@LeeHanYongAndy
(5 posts)1. Java Exercises (Week 4 Exercise 3)
Can I clarify if this is intended?
In Circle.Java and Rectangle.Java, line 1 was written as "public class Circle implements Shape{" and "public class Rectangle implements Shape{".
Was the use of "implements" intended as I could not get my program to produce the expected output unless I change the implement to extends.
2. Enquirers on iP: Creating Additional File
I completed the Level-2 iP by creating a new Class and realized that if commit and push to GitHub, I will have 2 files in src/main/java/.
My questions are:
Can I check whether we are allowed to create a new class (.java file)?
If we are allowed to, would having such additional files affects the grading? (be it manual or auto-grading in the future)
(Edit) 3. Do we assign the tag (Level-2) to Duke.java or Task.java?
Thank you. π
3
- You are allowed to create new classes. Just please don't change the folder structure inside
- Additional java files are necessary for many of the increments, so it is OK to create them appropriately. It won't adversely affect the grading.
- Tag the commit, not the file. One way to go about it to tag the latest commit which has the feature completed, irrespective of what files are updated in that commit.
Hi Professor, understood with much thanks. π
4
I believe we have to use "implements" if we are accessing an interface method and use "extends" to access a class. So since Circle is a class, extends should be used here. Not sure tho.
Yes, I have googled it as well. You're absolutely correct on using "implements" for interfaces.
Similarly, I believe that it should be "extends" since it's referring to a superclass but I'm lost too haha.
5
This is an oversight on my part. I did not remove the
implements
from the template.
For this one,
- If you wish to continue with
implements
, please makeShape
aninterface
(Interfaces are covered in Week 5 material).
- If not, you can change
implements
toextends
and makeShape
aclass
.
in both cases, the polymorphic behavior of the area method is apparent.
Hi Professor, Understood. Thank you for the clarification! ππΌ
@jonahtwl
(5 posts)1. Issues with text-ui-tests
Am wondering if anyone has faced the same issue as I can't seem to understand where the issue lies.
Prior to implementing Level-5, running the runtest was simple as no exceptions were raised
Adding exception handlers caused the following to happen (Figure 1) during the text-ui-test
(Figure 1. Using text-ui test showed this)
(Figure. 2 Doing manual testing will show this)
This (Figure 2) was printed in System.err.println if anyone is wondering. Have tried changing it back to System.out.println but the issue still remains that the exception was caught and the program was terminated ONLY in the text-ui and not manual.
2. SourceTree Cloning Error
Anyone had faced this error when cloning?
I have finished from ex 1 to 8 without issues then left for awhile, upon returning, I can't seem to clone the file as this error was shown.
Can't seem to find any fixes on the internet either.
Update: Have tried the solutions from the other threads but none seems to work for me
Update 2: Apparently the cause was the changing of the credentials manager. Have revert it back to nothing and it works!
3
I have traced all my data, methods and objects but then I realized that somehow the text-ui test on intellij is having some issues that I can't find answers on the internet.
These are some new issues that I found that shows more issues with the exception and text-ui testing
It somehow throws an exception when I do manual testing for having insufficient parameters, but it allows it when using text-ui testing? Both of which i did the exact same inputs of a (space) after the todo
4
Thanks for the help Prof @okkhoy, I realized it was a logical error on my end when handling the exceptions itself. Apologies for the confusion.
5
Did the same as above and it worked. Thanks!
@hazelhedmine
(5 posts) 1. Are we supposed to update text-ui-test and AboutMe page?
Must we include photos for AboutMe page or is it optional?
Are we graded on what we include in our text-ui-test component (such as our new features) or is it just for our own testing?
Thank you!
2. tP JUnit test not being detected in dashboard
I've implemented TaskListTest using JUnit but it was not reflected as done on the tP individual dashboard. The commit was counted in hence I believe that the dashboard was updated.
What should I do so that it will be updated as done?
3. sourcetree credential helper selector
Hi, whenever I use source tree to clone/push anything the credential helper selector keep popping up and I'm not sure what to select. Just clicking cancel works but it will still pop up the next time I use source tree. Does anyone know which option I should select or is there a way to get rid of it? Thank you!
4
It seems like that was the issue, thank you!
5
Noted, thank you prof!
@FarmZH98
(4 posts) 1. tP implementation
To roughly put, our team is thinking of implementing a program to allow the user to clear emails more efficiently by streamlining the process. However, we thought of some questions on our implementation and would love to have some clarifications. The questions are listed below:
Can we implement a fake email inbox, sent mailbox etc? So all the data will be pre-loaded to simulate a real email account. This is due to a concern of Internet issue. Otherwise,
Can we send emails to actual email accounts? (Requires the use to internet, to check that emails are received, and using external packages)
If checking of gmail online is not allowed, what is the suggested method we can implement the send email function
Thank you!
2. tick icon when running in IntelliJ becomes ? when running in jar file
I think the title is self explanatory. Does anyone know what am I doing wrong and if there is a way to solve this issue?
Thank you in advanced!
3. Linking SourceTree to Github
I am having trouble linking sourcetree to Github. The details of error I am facing is exactly like what was described in the link below:
Any help is deeply appreciated, thank you so much!
4
Thanks all for the help. In the end, I think i managed to login by setting the following:
Once i type in my username and click on "Refresh OAuth Token", it will lead me to a webpage and i just have to allow access.
@jadenwjh
(4 posts)1. Gradle-wrapper needs to be edited for runtest.sh / runtest.bat to build successfully
Wondering if any groups are facing this issue where by:
text-ui-test is not building successfully due to the version of gradle stated in gradle-wrapper?
I am referring to the distributionUrl in gradle > wrapper > gradle-wrapper.properties.
6.2-bin is not working for me but once I changed to 6.3 it is fine.
2. Calling constructor in Sequence diagram in PlantUML
Is there a way to 'create' another object in PlantUML sequence diagram?
For example: Parser should create CloseCommand object. But I cant seem to join the activation block for CloseCommand to the top.
3. [Week 4] Waiting for invitation from module organization
As depicted, this week we are supposed to be accepting an invitation. However, I have yet to receive any of it + the link provided does not work. Has anyone managed to accept the invite?
4
Just received an invite
@JonathanKhooTY
(4 posts)1. Invitation for Week 2 Assignment 4 disabled
The link for Week 2 Ex 4 states that "Invitations for this assignment have been disabled", upon clicking "Accept this assignment".
Would like to check if there's an "Ex 4" task to be completed for Week 2?
2
It now works, thanks.
3
@Leeyp it was not done intentionally.
Hopefully, no such encounters in the future π€
PE is a different matter entirely. We will talk about it when it is the right time!
Hi, would like to clarify on this task too. Is it expected to observe a "Autograding fail" result (Points 0/1) in the Git autograding status upon pushing?
Expansion of the error message states testMain failed.
But the code runs fine on local terminal upon manual insertion of the names.
4
The test case is when null is given instead of the 2 names. You have to check for null. (And do nothing if null)
I did some googling, and apparently passing a "null" string into main is highly unusual. However, I still attempted to insert a checker for null by checking for the length of the string input, and exiting Main in the event of a null input, but still failing testMain. Any ideas where I'm going wrong?
@oscarlai1998
(4 posts) 1. When I push my code from IntelliJ to Github, tabsize is automatically size 8
Hello,
When I push my code to Github, the tabsize is automatically size 8. So I manually edit and change the tab size on github to size 4 and commit again but it is still size 8.
Please advise. Thanks
2
Hello Prof, My tab space is 4 on intellJ and my indentation is correct on intellJ but when i push to github it becomes 8.
3
Hello Prof,
I am using the same directory to edit/commit and push, also only using IntelliJ and I did not change any settings and did not install any plugins.
4
Hello Prof, I have fixed it by just reformatting the entire code again.
@tehtea
(3 posts) 1. Disabling Java CI Action for tP temporarily
Hello, we were facing some checkstyle failures with our initial tP PRs so we wanted to disable the Java CI Action for now since these are just initial parts of the code. I want to check, does it disable anything else that's required if we do that, because I see that there might be other tasks in gradle.yml
.
2
Nah, for each question repository you have to:
Clone the repository
Make changes to the code such that the tests in the repository can be passed
Commit your changes and push it back to GitHub.
Then, the Autograding workflow will run the test cases, and if your changes passed the test cases you'll get the tick.
3
It's because Windows has a different line ending (\r\n
) compared to Linux (\n
) which is used by the platform for running the test cases.
Try replacing each System.out.println(thingToPrint)
call with System.out.print(thingToPrint + '\n')
instead as a temporary workaround... trying to find a more permanent one too myself.
@Vinci-Hu
(3 posts) 1. PlantUML arrow is halfway on the link
How can I fix the arrow?
Specification on the link:
Fridge -down-> "*" Food : maintain
2. Cannot find my identifier when trying to join github classroom
I could not find my identifier when joining github classroom so I skipped that part and did wk2-ex1 directly.
May I ask if anyone has chosen the identifier #0230650_ ? Maybe we have a similar student number.
3
Prof helped to manually match identifier to account.
@wjchoi0712
(3 posts) 1
https://se-education.org/guides/conventions/java/basic.html
It is under other links
2
Also, Im very lost at how I should be downloading the files for the exercises and submitting
You should refer to the e-lecture videos like "W2-Admin-SubmittingExercisesOnGHClassroom" on luminous.
3
"If you give it two different string objects that contain the same letters, it is supposed to yield true because they are two distinct objects even if they contain the same text. "(From W3.5 comparing strings)
Shouldn't the "true" in the sentence be "false"?
@iamakilahamed
(3 posts) 1. Problem with rendering markdown tables
Hi, currently I'm having a problem with rendering the markdown table when doing user guide. Everything looks good in Intellij preview. However when I push it to github, the table is causing problems as shown in the picture.
This is how it should be done right?
action | format
--- | ---
command1 | format1
command2 | format2
command3 | format 3
Here's the link to the document if need:
2
It works now when I was fixing some spelling mistakes from other parts of the website not related to the table. However, I don't think that spelling mistakes could be the problem behind the table not being able to render.
3
Yes, you are right. That was the problem. Thank you.
@Cocokkkk
(3 posts) 1
I followed the link above and created a personal token. Can I ask where to do step 9: click on sourceTree preference & Click add Account. I'm not sure if I am on the right track because I failed to add an account as the screenshot on StackOverflow shown, the comment is I already have a Github account. Maybe I found the wrong place to add the account?
2
@jovanhuang Thanks! It successfully works now!
3
@okkhoy Sure. Sorry about that, I will pay attention next time!
@ivanchongzhien
(3 posts)1. Build failed with an exception when testing exercises locally but passes on Github
Setup:
IntelliJ 2020.3.1 (Community Version)
Windows 10
Java 11.0.9_12 (corretto-11, the one recommended by the module)
Hi, I'm failing most of my test cases when testing locally on the IDE with these errors.
Its passing on Github however (green tick), anyone know the fix to this issue?
Also, are my exercises considered to have passed (seeing that they passed on Github but failed when tested locally)?
2
My IDE showed the same test case failed as yours but it passed on Github.
3
Thanks @tehtea and @okkhoy ! It seems to fix the issue for now π
@marklowsk
(3 posts)1. Request for permission to use Apache Commons Lang library
This library is used for parsing user input strings into a command and/or its argument(s).
commons-lang3 (v3.4) is released under Apache License 2.0.
Stated under README.md > License.
2
Thanks Prof, will let you know the updated version we will change to.
3
My team and I decided to use version 3.11.
@zikunz
(3 posts) 1
Similar question here. I did not choose my identifier and skipped it to attempt the exercises directly.
It seems like I cannot go back to choose my identifier now, could anyone advise me on how to do so or it does not matter since the submission of the work is associated to my GitHub account?
2
@okkhoy Hi Prof, I just sent you an email with my student number and the associated Github username. Sorry for the inconvenience caused.
3
I am able to visit https://github.com/cswbibibi/ip/issues as well. Perhaps you could contact the teaching team since the problem is not rectified after the daily update?
@geezzzyyy
(2 posts)1. Unable to push using sourcetree
I am using sourcetree for macOs Catalina 10.15.6
when I try to push to my forked repository, I get an error message like this:
Pushing to https://github.com/geezzzyyy/lender.git
remote: Permission to geezzzyyy/lender.git denied to geezzzyyy.
fatal: unable to access 'https://github.com/geezzzyyy/lender.git/': The requested URL returned error: 403
how should I solve this issue? thanks
2
I first realized this problem during last Friday's lecture, till now, still unable to push.
Could be a temporary issue, please try again?
@blank-bank
(2 posts)1. Usage of strip() vs trim()
Hi Prof, can i check if there are any preferences between the usage of strip() and trim() function? Ex 7 does not permit the usage of strip() from the result of my submissions.
Ive read
and it suggests to use strip() instead of trim().
Would like to ask for any guidance on this issue. Thank you!
2
Thanks Prof! Appreciate the honesty π
@tzexern
(2 posts)1. Week6-Lecture-Part3
Hi,
I'd like to ask if part 3 of the week 6 lecture is intentionally left out as I don't seem to find it.
Thanks in advance!
2
Alright, thanks prof!
@jalvinchan
(1 posts) 1
try this:
https://stackoverflow.com/a/62145210
Sourcetree doesnt have all the required credentials for private repo
@Zufiqqar
(1 posts) 1. GitHub Classroom Autograding Workflow
How do we get a tick for the GitHub Classroom Autograding Workflow component? Do we just attend the GitHub Classroom sessions during our respective tutorial sessions?
@lowwilliam
(1 posts)1. I try to push commits to github but fail the grading
It keep saying: The job was not started because the spending limit for Actions and Packages has been exceeded.
I am not sure if it is the problem of my code or a setting issue.
@BlubberMonster
(1 posts)1. Request for permission to use Apache Commons Validator
Apache Commons Validator Library
This library is used to validate a given URL input
@H-horizon
(1 posts) 1
I believe we have to use "implements" if we are accessing an interface method and use "extends" to access a class. So since Circle is a class, extends should be used here. Not sure tho.
@e00426142
(1 posts)1
just change the line separator method to "\n" and it will be fine
@fupernova
(1 posts) 1
Ctrl + Alt + Shift + S to open up the JDK selection screen