repl.it
link[This page was last updated on Apr 11 2020]
@SibingWu
(64 contributions)1. IO Redirection test passes locally but fails on github
The text-ui-test passes locally on my computer
but it fails when pulling request
Wonder how I can fix it?
2. Page limit for PPP
I wonder if the heading and the tail count into the page limit? Those really occupy a lot of space
3. Incorrect format of content inside Topic
tab
The format seems problematic here.
4. Linkage Error when running text-ui-test
when running the text-ui-test, such error occurs. Such error never happens before, my JDK is set to be 11.
5. CATcher unauthorized user
When I logged into CATcher using github for the first time, it saids that
How I can fix it?
6. Jar has no manifest attribute
I generated the jar file for tp via
project structure -> artifacts -> JAR -> from modules with dependencies ->
however, when running the jar file, terminal shows that "jar has no manifest attribute"
I wonder how I can fix it?
7. How to conduct check style on local computer?
As per subject. It is inconvenient to wait for github to check on submission
8. JUnitest on void return function
Given than we can have JUnitest for those functions that return something, I wonder if we can test for functions such as "execute" which return "void"?
9. JDK 12 issue
Hi professor, since my computer was configured with JDK 12, so do intellij, the jar file generated cannot be run on JDK 11. I wonder how I can fix it?
10. How to convert a java project into gradle project
How to convert an existing ordinary java project into a gradle project in intellij. In Topic, it seems that it only mentions how to create brand new gradle and import existing gradle project.
Do we need to convert it to gradle project for iP?
11. Must we update the user guide on the main page of project?
As per issue subject. I wonder if we can just update the README.md on docs/README.md since I think the tutorial on the README.md in the original duke is quite good.
12. Inquiry on documentation
I wonder if there is a abstract methods for superclass and polymorphism shown in subclasses, do we need to write documentation for the abstract method in superclass? Or we just need to write documentation for that method (specific implementation) in each subclass?
13. Edit does not reflect when doing test-ui-test
I modified the code and the demo looks like this.
However, when I ran test-ui-test, it told me that there was difference.
I wonder why this is so and how I can make changes
14. Not able to read file properly via relative path
I tried to read the txt file using relative path, however it always said "file not exists"; if I changed it to absolute path, then it can be read. I wonder what is wrong with it?
private static String filePath = ".." + File.separator + ".." + File.separator + "data" + File.separator + "duke.txt";
15. Inquiry on Merge Conflict
I wonder what the three markers mean?
16. Inquiry on Coding Style of main function
I wonder for good coding style, it is better to put the function definition before main function/where it is called or after?
17. IP: Cannot show tick icon properly
For IP, when generating the ACTUAL.txt file, it seems that tick icon cannot be shown properly. I wonder how I can fix it? Any help would be appreciated!
18. Problem when importing contacts project to Intellij
I tried to import contacts project mentioned in Lecture 3, but the IDE only recognize "src\main\java" as source directory so project only includes files under this directory after import. However the project still need files from "text-ui-test" or something. How can I fix this problem? Any help would be appreciated!
19. Inquiry on Ex4: getMultipleGradeCaps
When running the test case, it shows "assertEquals(Arrays.toString(new double[]{5.0, 0, 2.5, 3.0}), Arrays.toString(Main.getMultipleGradeCaps(new String[]{"A+", "Foo", "C", "B-"})));"
It seems that it expects "0" instead of "0.0" for "Foo". However, as a double, the result will be 0.0. In this case, should we do any special manipulation on "0.0" case?
20
It seems that it expects "0" instead of "0.0" for "Foo".
Are you sure this is the cause of the test failure? As no one else reported a similar problem, my initial thought is that the test failure caused by something something else.
I found the reason, due to the wrong function name...
21
You can change the view to 'Project Files' instead of 'Project' to see non-java files.
Thanks that help! However I wonder when you demo during lecture, it seems that it showed all files including non-java files with "Project", why this is so?
22
Also I am not sure what is wrong here, but there seems to ACTUAL.txt
23
Also I am not sure what is wrong here, but there seems to ACTUAL.txt
ACTUAL.TXT is generated by the script and contains the actual output from the program, so it doesn't need to be present before the script runs. If ACTUAL.TXT is present, the script deletes it before compiling and running the program again (e.g. in the .bat script on line 7):
del ACTUAL.TXT
OK thx so much! Problem fixed!
24
Thanks for the help @rdimaio
Go ahead and close this issue if the problem is resolved @SibingWu
Professor I am still wondering why when you demo during lecture, it seems that it showed all files including non-java files with "Project" instead of Project Files
25
Professor I am still wondering why when you demo during lecture, it seems that it showed all files including non-java files with "Project" instead of Project Files
I suspect that earlier (before the lecture), I must have set some setting in Intellij to make those files visible by default, although I can't remember exactly what though.
OK, thank you so much for your help!
26
replace line 18 in runtest.bat to
java -Dfile.encoding=UTF-8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT
Thank you so much for your help! Problem fixed!
27
As that aspect is not specified in the coding standard, you are free to choose your own, but apply in consistently throughout the code base.
Thank you so much! Confusion clarified.
28
One thing you can try is to print the 'current working directory' from your code. That should tell you what directory is your path 'relative to'. It may not be the location of the java file.
Thank you so much! Problem fixed!
29
I think you may run the jar file in a improper directory. Maybe you can try this:
cd to the directory of "duke" project
then "java -jar xxxx.jar"
I think it will be fixed
Since that the path we used to find txt file is a relative path, so it is very important that which directory we are relative to (just guess
30
Maybe you have added some new package and you forgot to put the path?
if this is so, the idea will just report error for not finding the classes
31
I think she is referring to your runtest.bat. It may compile and run as normal in the terminal but shows this response because the new classes have not been included in the batch script.
I understand, and I have tried; if the batch script does not include the new package, it will report the error
32
May I ask what kind of operation will produce “empty list” in your code, list or a message after you add a new task
It will display "Empty List." when there is no tasks in the duke.txt file, so nothing will be loaded to the screen
33
So 2 possible reasons, is it because your duke.txt is empty or when your program cannot find the file, it has a default constructor to build an empty task list?
I think the second one is possible (since if it is the first reason, then it should display "Empty List." as expected). However I wonder how I can write the batch script to let it find the duke.txt?
34
Here comes another problem:
when running the project in intellij, it works perfectly fine.
However when it comes to runtest.bat, error occurs:
2 problems:
how come there is no bug when running in intellij and there is an exception for runtest.bat
there is no line 90 in Duke.java
35
Search for all *.class files (that were generated by previous runs) and delete them.
Make sense! I wonder where I can find those .class files?
36
Make sense! I wonder where I can find those .class files?
try out folder, bin folder (if any)
I deleted all .class files under the two folders, but there is another problem: java.lang.ClassNotFoundException: Duke
Such exception only occurs when runtest.bat
37
I deleted all .class files under the two folders, but there is another problem: java.lang.ClassNotFoundException: Duke
Such exception only occurs when runtest.bat
Did you update the javac command in the runtest.bat to account for the packages you introduced?
I did: javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke*.java ..\src\main\java\duke\commands*.java ..\src\main\java\duke\exceptions*.java ..\src\main\java\duke\parser*.java ..\src\main\java\duke\storage*.java ..\src\main\java\duke\tasklist*.java ..\src\main\java\duke\tasks*.java ..\src\main\java\duke\ui*.java ..\src\main\java\duke\utils*.java
38
I did: javac -cp ..\src -Xlint:none -d ..\bin ..\src\main\java\duke*.java ..\src\main\java\duke\commands*.java ..\src\main\java\duke\exceptions*.java ..\src\main\java\duke\parser*.java ..\src\main\java\duke\storage*.java ..\src\main\java\duke\tasklist*.java ..\src\main\java\duke\tasks*.java ..\src\main\java\duke\ui*.java ..\src\main\java\duke\utils*.java
Does that command work when you run it manually, from the same directory as the runtest.bat?
It can work:
Actually runtest.bat successfully generates the *.class files under bin directory
39
Actually runtest.bat successfully generates the *.class files under bin directory
Then, check the java command in the runtest.bat. Is it updated to use the packaged Duke class?
I wonder how I can know if it is updated?
40
I wonder how I can know if it is updated?
See the end of this textbook section.
Thank you so much!!! Problem fixed!
41
Not entirely sure what you mean.
[root]/docs/README.md is supposed to be a user guide whereas [root]/README.md is meant for developers. So, best not to copy content from latter to the former.
Is that what you wanted to know?
Yes! Thank you prof!
42
- Do we need to convert it to gradle project for iP?
No. We start using Gradle in the tP.
Ok Thank you
43
Testing is essentially ensuring that the actual behavior is same as the expected behavior. If the return value of a method is not able to tell you the actual behavior, you can try some other ways to verify it.
For example, if the execute method is supposed to add an object to a list, you can check the last element in the list to confirm that the object has been added there as expected.
If the actual behavior is hard to verify (e.g., the method simply prints something), that means the testability of the method is low -- you can try to redesign the method to improve the testability e.g, get the method to return the string instead of printing it directly.
So it means that, when doing JUnitest for adding something to the list, the thing used for test is truely added into the list, and we need to remove it after test finishes?
44
So it means that, when doing JUnitest for adding something to the list, the thing used for test is truely added into the list, and we need to remove it after test finishes?
Yes, if that addition could affect the result of other tests.
Thx Prof!
45
gradlew checkstyleMain
Thx!
46
@damithc dear professor, I also created a PR to the https://github.com/nus-cs2113-AY1920S2/tp repo, could u please take a look? we tried many times, but the problem of IO redirection test still not resolved... I modifed the INPUT.txt, but the corresponding EXPECTED.txt generated on my local computer still cannot pass the test. I wonder if it can run properly on your end?
47
gradlew shadowJar
then where can find the generated jar file?
48
build/libs
Thank you, problem fixed!
49
You are trying to access a session of CS2103. Our module code is CS2113.
my bad... thx prof!
50
Looks like another Java version is being used somewhere along the way.
If possible, remove all other java versions from your computer.
just curious why this never happens before?
51
Well, something must have changed somewhere. Perhaps an automatic update?
I fix it by changing the computer environment path from jdk11 back to jdk 12... seems that I need to remove all the .class files generated when my computer was still jdk 12
52
Well, something must have changed somewhere. Perhaps an automatic update?
no use if I just delete the .class files from out
directory; I have to change back to jdk12...
53
Keep in mind that using JDK 12 might appear to solve the problem in your computer but you should be using JDK 11 for all PE work and the jar file your team releases must be produced using JDK 11. If your jar file doesn't work on JDK 11, you are going to lose a lot of marks as your product will be completely unusable in the target execution environment.
notice with thx!
54
Can you elaborate?
The overall format looks like this. I cannot see the content for "What BVA recommends"; it is blocked
55
Looks fine to me. May be a caching issue. Try force-reloading the page?
I restart the whole browser but the problem still exists; however, when I changed another browser, it is normal now
56
ctrl+F5
still problematic
57
Which Browser is problematic?
EDGE
58
Yes, older Edge Browsers seem to have this problem. Upgrade to the new edge:
OK, thx prof!
59
Yes. The page limit takes into account that a significant amount of space is wasted by the template. Try to make the PPP concise; peer evaluators are not going to like it if you make them read a lot. Same applies for other 'tricks' such as using small fonts or narrow margins. It's not enough to meet the page limit in theory; you should also meet it in spirit -- i.e., make the content concise. If the content is concise, evaluators are unlikely to fault you for going over the page limit slightly.
OK Got it! Thx Prof!
60
Hi, I've encountered this issue too. It could be caused by an old jar file in your local build/lib directory, resulting in a false positive test pass. Try deleting the old jar and making a new jar via gradle shadowJar, after which your local test would be similar to the CI tool and you can fix accordingly.
thx!
61
@damithc Professor, I wonder if the instruction for source code here means that we need to make a pull request of our code to the main repo? or it simply means the "source code" shown after we release the jar file?
62
@damithc Professor, I wonder if the instruction for source code here means that we need to make a pull request of our code to the main repo? or it simply means the "source code" shown after we release the jar file?
No need to do anything extra @SibingWu Just make sure your team repo source code matches the jar file.
Noted with thx!
63
@damithc is it OK for the jar name to look like this in github? it is [xxx][xxx].jar in local, but when submitted, it becomes the following
64
@damithc is it OK for the jar name to look like this in github? it is [xxx][xxx].jar in local, but when submitted, it becomes the following
It's OK, as long as the file submitted to LumiNUS has the correct name.
OK!
@Zhilin-Huang
(44 contributions)1. Final exam format?
Will we have in-person final exam for the course? I think many exchange students have already left NUS.
2. Tutorial 9 Exercise Answers
Is it possible for the teaching team to share Tutorial 9 Exercise Answers with us? 😃
3. Path coverage and statement coverage
Understood from the explanation that 100% path coverage gives the highest intensity, but why doesn't 100% statement coverage give highest intensity as well? Doesn't all statements being executed mean all paths are executed?
Any help is appreciated!
4. Week 8 Tutorial Exercise 3
Does anyone know why Alfred
and Bruce
are using the same home address? I know it's logical to assume they have the same home address since Alfred
is a guardian of Bruce
, but this is not explicitly mentioned.
The screenshot is as below:
5. Week 9 Quiz Part 2 is worth 0 mark?
It seems that Week 9 Quiz Part 2 is worth 0 mark - is this a mistake?
6. Do we need to publish User Guide for tP v1.0?
We've submitted UG v1.0 before during tutorial, but do we need to publish the UG v1.0 on GitHub like we did for iP?
7. Will the answers to tutorial exercises be posted?
I noticed that there are some exercises in Week 8 Tutorial - just wondering whether the answers to these exercises will be posted?
8. Are we supposed to add JavaDoc comments in tP v1.0?
I'm not sure whether we are supposed to add JavaDoc comments in tP v1.0, but when we do not add the JavaDoc comments, the Java CI tests fail?
9. iP Demo in Week 6 Tutorial
Is the iP demo in next week's tutorial graded as part of our iP mark?
The iP grading page is here but I didn't find anything related to the demo.
10. Help with gradlew run command
After I merged the branch gradle
to my master
branch, I'm unable to run gradlew run
as it gives zsh: command not found: gradlew
error. But I'm able to run ./gradlew run
.
Is it okay to just run ./gradlew run
? And why is it failing to execute gradlew run
?
Any help is appreciated!
11. Model answer for post-lecture quizzes
I noticed that we do not get direct feedback on whether or not the answers we submit for post-lecture quizzes on LumiNUS are correct. Will we get the model answers after the deadline?
12. Broken links in Week 6 e-learning instructions
It seems that the links to the textbook chapters required for week 6 [e-learning](https://nus-cs2113-ay1920s2.github.io/website/schedule/week6/index.html
) are broken.
I get a page not found error when clicking on any of the 3 links: e.g. https://nus-cs2113-ay1920s2.github.io/website/schedule/week6/se-book-adapted/chapters/requirements.html
13. Javadoc Comments for iP
Does anyone have any idea about which functions we are supposed to write Javadoc comments for?
Any help is appreciated 😄
14. How to reference when using code from Stack Overflow
I'm looking to use a few lines of code in my iP similar to that I found on Stack Overflow. Does anyone know how do we indicate that we referenced from online sources? Can I just put the link in my code?
Any help is appreciated!
15. Tutors email addresses?
Understood that the tutors for each tutorial group are listed in the module website. But where could we get the email addresses of our tutors?
Any help is appreciated!
16. Are our iP graded on a weekly basis?
Understood from the previous issue here that we are to push our work to our GitHub repo starting from Week 3.
However, are we going to get grade/feedback for our iP every week?
17
I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃
18
I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃
That's correct. Thanks @Zhilin-Huang
In that case, are we still supposed to push our commits to the public repo?
Yes, but no need to push this week. You'll need to push your code from week 3.
Thanks for the clarification!
19
Noted! Also, for the exercises on repl.it every week, will we get frequent grade/feedback on this component? Or is it sufficient that we make sure we submit solutions that pass all the test cases?
20
Thanks for the clarification!
21
https://nus-cs2113-ay1920s2.github.io/website/admin/instructors.html
Thank you!
22
Not sure what's the problem with the second screenshot, but from your GitHub repo I see that your tags are attached to different commits instead of the first commit: https://github.com/kokjoon97/duke/releases
23
This solves my problem! Thanks for your help 😃
24
Noted! Thanks Prof 😃
25
Based on how I understand the requirements, I think we are allowed to customize the output of our bot as we see fit
26
Thanks Prof!
27
I see! But it seems that A-Gradle
is an increment under A-Jar
for Week 6 iP tasks here?
28
Thanks for the clarification 👍
29
Thanks for the clarification!
30
If you are very sure that you want to delete that commit, then it should be fine to do so.
31
I think the iP progress dashboard is not updated in real time? So maybe it's because you released the JAR file after the last update
32
I'm not sure whether we are supposed to add JavaDoc comments in tP v1.0, but when we do not add the JavaDoc comments, the Java CI tests fail?
The code is expected to be well-documented, which includes using javadoc comments appropriately.
Having said that, you can modify the checkstyle config file to allow methods without javadoc comments as the given coding standard does not specifically disallow methods/classes without javadoc comments. I'll look into removing that rule from the checkstyle config so that it will not be enforced against your PRs in https://github.com/nus-cs2113-AY1920S2/tp/pulls
Thanks for the clarification!
33
Thanks Prof!
34
Which tP requirement in which week are you referring to?
Anyhow, yes the tP UG must be published on GitHub. Your project template comes with a UG file that you need to update https://github.com/nus-cs2113-AY1920S2/tp/blob/master/docs/UserGuide.md
Okay, we'll update and publish UG v1.0 on GitHub!
I was asking about tP v1.0 requirements for Week 8 and 9 because I cannot seem to find a requirement corresponding to UG update.
35
I was asking about tP v1.0 requirements for Week 8 and 9 because I cannot seem to find a requirement corresponding to UG update.
Updating UG is not required at v1.0, but you are welcome to update the UG as you go.
Noted! Thanks Prof
36
It's a LumiNUS bug. Will contact NUS IT to see if they can help. Meanwhile, you can go ahead and attempt the quiz as marks calculation can be changed later.
Noted with thanks
37
It was mentioned during tutorial that it's because the question stated to assume that we are trying to minimize the number of total objects.
Oh I see! Thanks
38
To add on to this problem - I think our team have followed the forking workflow but this task it is not marked as done for us (or anyone else in the class?)
39
It's not being checked yet.
I see 😃 Thanks Prof!
40
Good question @Zhilin-Huang
Consider a case of a while-loop in the code. An execution path that does only one iteration through the loop executes all statements in the loop, achieving 100% statement coverage. But that does not mean all unique paths through the loop have been executed because a path that does only one iteration in the loop is different from another path that does two iterations in the loop.
I see! So does this mean that in the case that we have a while-loop, we can never achieve 100% path coverage because executing 1, 2, 3... n iterations are considered different paths?
41
I see! So does this mean that in the case that we have a while-loop, we can never achieve 100% path coverage because executing 1, 2, 3... n iterations are considered different paths?
Yes, if the possible number of loops is not a fixed number of possibilities. In other cases it is not impossible but the number of paths can be too big for 100% path coverage to be feasible.
Thanks for the clarification Prof!
42
Thanks for the reminder @Zhilin-Huang . Posted as an announcement.
Hmmm I cannot seem to find the announcement @damithc ? The latest announcement is the one about Week 10 Tutorial arrangement.
43
Hmmm I cannot seem to find the announcement @damithc ? The latest announcement is the one about Week 10 Tutorial arrangement.
Sorry, it turns out I posted it in the wrong module :-p
Re-posted it in CS2113 just now.
Just saw the announcement 😃 Thanks!
44
Yes, we will have a final on-site exam. There will be an alternative assessment option given to exchange students who are no longer in Singapore.
Noted with thanks!
@JTWang2000
(30 contributions)1. Loading of package suddently becomes unavailable
This is my current IntelliJ:
All the loading suddently becomes unavailable. I have shifted to the original status when every code should be correct, but still cannot work.
2. Markdown syntax
When I am implementing the UG, I want to write things in different lines so I use </p>
. This works when I display in Github:
This is the code for UG:
This is the display when I see it on github or my IDE:
However, when I see it on the website of my project, the will displayed:
I am confused why this happens.
I also wonder how to add return in markdown.
3. User Guide Not Update
I have updated the user guide on docs/readme
However, when i am visiting the website: http://{your username}.github.io/duke/, it still appears the readme of origin duke.
4. Merge conflict issues
When want to solve the merge conflict, I have carried out some wrong steps. Currently, my branch-A-JavaDoc is in some strange location. May I ask how to slove this and how to continue to merge master and javadoc?
If i pull the javadoc , then it becomes:
5. Redo Merge issue
When i want to do the merge for JavaDoc and master, i accidently check out the branch-java doc, and then pull the master. Such thing appear. May i ask if there is any way that can come back to the previous status so that i can first check out master, then pull master, then merge master to branch?
6. Delete a commit in github
Is it okay to delete a commit on github by:
git reset --hard HEAD^
git push origin +branchName --force
7. Unknown error when doing A-oop
Remember to give sufficient details e.g.,
Your development environment (IntelliJ version, Java version, OS, ...)
Relevant code, error message, stack trace
Relevant code snippet (an example given below), or link to the relevant code on your GitHub repo
String value = "Some code here"
When i am refactoring the code, there are some unknown errors displayed on Intellij.
All newly created class suffer from this errors. I have searched and tried to change encoding. However, still cannot really see the errors.
💡 You can use Markdown to format your text
8. [Text-ui-test] Can not find /data/duke.txt
When I am running the text-ui-test after creating the Level-7, it cannot find the duke.txt. May I ask what to deal with? Do we need to add some lines in the runtest.bat?
9. IP: Cannot show tick icon properly both in terminal and ACTUAL.txt
Hi, even in the terminal, my tick icon cannot display properly. I am not sure if that is because the encoding of the project has something wrong.
10
I am not sure if this solution is okay. I add a folder called "data" which is in the same directory as the jar file, then the jar file works.
11
Thank you for your reply. Then i just use the a regular character.
12
I have tried creating a new file when there is no duke.txt However, it still does not work. I suppose that the jar cannot find the data folder?
13
@JTWang2000 Something to consider: What would happen after your code catches the
FIleNotFoundException
? Will it continue to run yourwhile
loop?
I suppose that it will not run the while loop? It means there is no such file so it will create a duke.txt file. However, it cannot find the data folder so it cannot create?
14
@Jeremy733 yeah i tried to make it File f = new File(duke.txt). OMG it works! But is that okay that we do not a data foler?
15
A general tip: if you expects the data file to be in specific folder e.g.,
./data/
, your code must check if the folder exists and create it if it doesn't. If your code doesn't have that, your text ui tests could fail too.
yep. I find that even if i add the data directory in the runtest.bat, still got similar error as the jar file which is cannot find data directory.
16
Do you mean when you run the jar file, the initial task list is not loaded because can not find the file?
Sorry for answering so late. Yes. I think because there is no data folder.
17
can you check if
;
is the chinese character?...
Have tried. If it is the Chinese character, then the display will be:
So it should be the English character
18
You can copy paste some code from the problematic files into a tool like this one to see if there are some hidden characters in the code.
Also check if your other Intellij java projects suffer from this problem. If they don't, you can try reimporting this project.
Thank you for your reply.
After pasting the code to the website:
I suppose that there is no hidden characters?
I tried the circus class we used to use during lecture. When i am creating class and package, it works fine. Then, I tried to reimport this project, still have the same problem.
I tried to change the console to UTF -16 to try to see if the strange "characters" are chinese character:
Also failed. Very confusing.
19
I tried to rewrite the: package duke.command;
a new error appears.
I suppose that maybe my encoding of all the files are wrong?
Then, i check the setting which displays:
20
I tried the Remove BOM function. It works! Thank you so much.
21
@Zhilin-Huang Sure. Thanks. This command works
@damithc Thank you for your advice.
22
My understanding for this problem is that: Previously, there is no data/duke.txt. When we first run duke, it will be created. Therefore, we may need to add code to create a data folder and a duke.txt. This may solve both jar problem and test-ui problem?
23
Maybe you have added some new package and you forgot to put the path?
24
uhhh. I solve it by myself
25
@damithc Thank you for your reply. I tried and it worked.
But then i followed this to try to solve conflict, then my master leaves at previous stage:
26
@damithc Thanks. I have understood now and merged to master successfully.
27
I have added a test when loading the duke.txt file and will create a data folder. Then, even if I do not add the path in runtest.bat, it still works. It is just that every time when a runtest, I need to delete the data folder to ensure the actual and expected txt matches.
Thanks for those who have helped me.
28
Thanks, I have fixed!
29
@damithc @rdimaio Thank you for the reply. I will try to add line break by using two consecutive blank lines instead of one.
30
I re-import and it worked!. Thanks.
@kokjoon97
(28 contributions)1. Project submission
Hello,
Should all v2.1 deliverables including the portfolio go into the final submission folder on LumiNUS?
Also, it says on the website that for the product demo the submission is to a different folder, though I do not see any other folder on LumiNUS. Will this be created later on?
2. Week 12 Quiz Results
Hello,
It seems I am unable to view the results for the week 12 quiz in LumiNUS and also cannot see the questions I got correct or wrong even though its past the closing time of the quiz.
3. Saving markdown file to pdf
Hello,
Can I check if there is a recommended way of converting our md files into pdf format (since it seems the final submission for the portfolio page is in pdf)?
It seems I am unable to save the md file as any other file format and I'm not sure if it is safe to rely on an online converter also. When I tried to print as pdf on the rendered md file on Github, it then has the problem of including the UI of the webpage as well.
4. RepoSense not recording some of my code contributions
Hi,
In order for the code to be RepoSense-compatible, does this mean that all the code contributions by me should be recorded in the code dashboard?
Currently, it seems that the code that is attributed to me in the dashboard is indeed contributed by me however some of the other code portions which I have written as well are not reflected in the dashboard but are instead showing up in the dashboard for other members of my team. Do I have to create the config.json file to fix this? Its just one method that is missing though so I'm not sure if its considered a serious issue too
5. Week 10 Post-lecture quiz
Hi,
It seems that in LumiNUS, I am only able to see Week 10 - Quiz Part II. Can I check if there is supposed to be a part I which I am not seeing in the quizzes section?
6. Final-JAR
Hello,
I have already released the JAR file using Github releases, however the iP progress dashboard shows that I have not completed the Final Jar increment. Is this because I checked the box that says it is a pre-release when publishing the release?
If that is the case, do I have to create a new release or can I simply edit the release and uncheck that option?
7. Scripts ignoring untagged commits?
I made a costly mistake by creating a branch from one of my branches instead of from the master branch. As a result, when I created the PRs and tried to merge, the results were disastrous.
I have then tried to delete the changes manually and make a new commit to "undo" the change since I don't think it is possible to revert commits on GitHub. After this, I did the merging of the PRs correctly and also tagged the merge commits.
Will the scripts only focus on the commits that are tagged and ignore the erratic commits that I have made to the fork?
8. Duke output
Can I check if it is a must to follow the output of Duke exactly as given in the iP tasks? Is it acceptable if we vary the format of the output but still achieve the same functions?
For example, even after I have fixed writing of UTF-8 characters into txt files using
-Dfile.encoding=UTF8, I am still having problems with the command prompt not displaying UTF-8 characters when I tried running the JAR file which I created. I have tried changing the code page to 65001 but it does not seem to work and most solutions I have found suggested editing the registry which seems pretty risky.
9. Tags on GitHub
I have unintentionally removed one of my tags on the commits in Github and I tried to undo that removal by re-pushing my latest commit (with all tags pushed). Now, for my latest commit (first picture below) it shows its own tag, whereas for my first commit (second picture below), it shows all the tags which I have ever included in a commit.
Can I clarify if this is what I am supposed to see if I have tagged the commits correctly?
10. (A-TextUiTesting) Unicode characters in txt files
When redirecting output from the console into a txt file, I find that I am unable to represent Unicode characters properly. This problem occurs since in the Duke chatbot, stylized ticks and crosses are used to indicate the status of completion for different tasks.
Every time when I try to run the batch script, I get something like this:
***** ACTUAL.TXT
Got it. I've added this task:
[E][?] project meeting (at: Mon 2-4pm)
Now you have 3 tasks in the list.
***** EXPECTED.TXT
Got it. I've added this task:
[E][Γ£ÿ] project meeting (at: Mon 2-4pm)
Now you have 3 tasks in the list.
Any stylized symbols get transformed into a "?" the moment I try to put them in a txt file. May I know if there is a workaround for this issue?
11
Just found a solution, I basically added the "-Dfile.encoding=UTF8" into the java command in the batch script.
java -Dfile.encoding=UTF8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT
Referenced from this website: http://hints.macworld.com/article.php?story=20050208053951714
12
I wonder if it is a feature of GitHub for commits to show their own tag and tags of commits that come after them, though I could imagine that might make it hard to track which tag is for which commit specifically
13
Okay thank you for clarifying prof!
14
Okay thank you for clarifying!
15
I was just wondering if the scripts would detect the erratic commits and if there are any penalties for those commits
16
Okay thank you for clarifying prof!
17
Hmm I uploaded the JAR file before these new tasks were added to the dashboard though
18
My final release was on the evening of 28th, not sure what time the update to the dashboard was done. I have also changed that release to be a final release for consistency because I realized I marked one of my earlier releases as a final release while this one was not.
19
My final release was on the evening of 28th, not sure what time the update to the dashboard was done. I have also changed that release to be a final release for consistency because I realized I marked one of my earlier releases as a final release while this one was not.
@kokjoon97 dashboard updated. Your jar should be visible now.
Okay thank you prof!
20
Hi, on behalf of the OP, this is the commit where our team last edited the code that had to do with scanning of user input:
21
It seems I have resolved the issue by changing the path to 'dir /b duke-0.0.1.jar' in the runtest.bat file where it was previously 'dir /b *.jar'. I don't think it was an issue with the Scanner like IntelliJ was warning about, it seemed no matter how I changed the code, it kept warning about the same line of code even though that line only contained a curly bracket.
I have just merged a PR which passes all the CI tests.
EDIT: Not very sure why shadowJar creates two different jar files in the build/libs directory, of which only one works (duke-0.0.1.jar)
22
Ohhhh I see, that explains why one of the jar files had such weird behaviour. Thanks for clarifying prof!
23
Okay I see it now! Thank you prof!
24
Ah okay so I only have to add the @@author tag in the code? I thought it was a much more complex process. Thanks for clarifying prof!
25
Okay thank you for clarifying prof!
26
Its still not working for me for some reason though
27
It works now! Thank you prof!
28
Okay thank you prof!
@A11riseforme
(19 contributions)1. typos
https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/uml.html#associations
https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/oop.html#classes
to indication the three priority levels -> to indicate the three priority levels
without having a direction association with it -> without having a direct association with it
woment -> women
because the code realated to that change -> because the code related to that change
https://nus-cs2113-ay1920s2.github.io/website/se-book-adapted/chapters/codeQuality.html#intermediate
it has no value on matter how fast/efficient it it. -> it has no value on matter how fast/efficient it is.
Git will now show ignored fiels as ‘unstaged modifications’ -> Git will now show ignored files as ‘unstaged modifications’
Note that the URL of the Github project is different form the URL -> Note that the URL of the Github project is different from the URL you
Creating Pull Requsts (PRs) is needed -> Creating Pull Requests (PRs) is needed
2
on repl, the class name should be Main if you want to click run
to test your code.
3
you can run your own command in the repl console to specify your argument passing to the program.
4
Maybe you can define a finalize method? https://javaconceptoftheday.com/garbage-collection-finalize-method-java/
5
I think that is what you need. finalize() is called before the garbage collector tries to release the unreferenced object memory, and you can put the decrement of the static class variable in the finalize() method. But when the garbage collector works is totally up to jvm, even you reference an object to null, the JVM may start garbage collection only when it runs out of memory. so the finalize method may not be called throughout the entire programme running time.
Correct me if I am wrong.
6
https://nus-cs2113-ay1920s2.github.io/website/admin/instructors.html
7
replace line 18 in runtest.bat to
java -Dfile.encoding=UTF-8 -classpath ..\bin Duke < input.txt > ACTUAL.TXT
8
can you check if ;
is the chinese character?...
9
GBK is the encoding for Chinese characters... and 0xBF is part of the BOM header. I suspect that you edited the file using the windows notepad before.... you can copy the content of the file, paste into notepad, delete this file, create a new one, then paste it back and try if error is still there.
actually the IntelliJ is providing a Remove BOM
function, right click on the file and select Remove BOM
10
No problem, glad I can help.
11
Hi may I ask what GSON actually helps with? Not familiar with this particular library
Probably saving the objects(tasks) into file as json string, and loading json string from the file back to objects.
but acually ObjectOutputStream and ObjectInputStream can do the work well already, just the output file is in binary, and cannot be edited by text editor.
12
change this
13
"check1" and "check2" will remain in the buffer until a newline "\n" is at the end, which is "Please enter your gender\n", then these three strings will be printed to the stdout together.
14
gradlew checkstyleMain
15
gradlew shadowJar
16
build/libs
17
ctrl+F5
18
replace the line
![Image of SwitchCase](https://github.com/AY1920S2-CS2113-T14-2/tp/blob/master/docs/images/switchCase.png)
by
![Image of SwitchCase](images/switchCase.png)
or
![Image of SwitchCase](https://raw.githubusercontent.com/AY1920S2-CS2113-T14-2/tp/master/docs/images/switchCase.png)
it is because https://github.com/AY1920S2-CS2113-T14-2/tp/blob/master/docs/images/switchCase.png is not even a pure image resource.
19
<img src="images/xxx.jpg" style="zoom:50%;" />
@brandoncjh
(17 contributions)1. Resizing local images in Markdown
Hello, how can I resize images in Markdown? Several images are taking a lot of space in my PPP section. I tried the <img src="" +="" width=""> tags but it didn't work.
Any help would be appreciated!
2. Unable to run JUnit tests
I am having issues with trying to build and run the JUnit tests. For example, using the default tests provided, the test classes encounter an error when trying to build the module, IntelliJ is unable to import the Assertions class:
After adding the recommended library to the classpath:
I can build the module, but trying to run all tests it gives this error:
Is there any way to rectify this? Have tried deleting and reimporting the project but it makes no difference.
3. Clarification on possible typo in UML notes
https://nus-cs2113-ay1920s2.github.io/website/book/uml/classDiagrams/associations/navigability/
In the exercise, it says, "In the implementation, the Unit
object will hold a Unit
object in one of its variables." Was wondering if the 2nd Unit was meant to be an Item instead?
4. Github Page for User Guide not showing
Hello, the Github page for my user guide says it has been published, but when I access the link, there is no page available. Anyone able to help with this?
5. Repl.it W3 Ex10
Hello, my program for Repl.it W3 Ex10 keeps failing the final test case, even though I am able to get the required output. It passes the other 2 test cases when submitting, may I know is there some sort of time limit for the program or any other issue?
6
import java.util.Scanner;
import java.util.Arrays;
public class Main {
// You can add more methods here
public static String[] filterExpenses(String[] words){
String[] results = new String[words.length];
int currCount = 0; //keep track of the index of next free space in validItems
for (String word : words){
if (word.substring(0,1).equals("$")){
results[currCount] = word;
currCount++;
}
}
//print the 2nd line of output
System.out.println("Expenses in overseas currency:" + Arrays.toString(Arrays.copyOf(results, currCount)));
return Arrays.copyOf(results, currCount);
}
public static void printTotal(String[] args){
double total = 0;
//add floats together
for (String arg: args){
//get rid of the preceding $ char and convert value to double
double currItemValue = Double.parseDouble(arg.substring(1, arg.length()));
total += 1.7 * currItemValue; //convert exchange rate
}
//convert final value to string, print $ + final value
System.out.println("Total in local currency: $" + String.format("%.2f", total));
}
public static void main(String[] args) {
String line;
Scanner in = new Scanner(System.in);
System.out.print("Your expenses while overseas?");
// TODO: add your code here
line = in.nextLine();
String[] separated = line.split(" ");
printTotal(filterExpenses(separated));
}
}
Apologies for the delay!
7
Hi Prof, have resolved the issue! I didn't realize the last test case differs from the other two in that it is preceded by a trailing whitespace. This is resolved by adding a .trim()
before the split function in the 2nd last line of main.
Thank you for your help!
8
@damithc I feel it could become an issue if I create a duke.txt everytime I run the .jar file in a new directory without keeping track 😆 Is there anyway to redirect to the original duke.txt, maybe create a shortcut/symlink to data/duke.txt?
9
createNewFile will try to create the file according to the path you have specified in the File object. If the directory your jar file is located in does not have a subfolder path "src/main/java/data", it will throw an error. So maybe you could try to see how you can rectify this error.
Note: the jar file should be run in an empty directory
10
I think she is referring to your runtest.bat. It may compile and run as normal in the terminal but shows this response because the new classes have not been included in the batch script.
11
Relative path points to the path of the file relative to your current location/directory. So say if I'm in "./src/main" and I want to access "./src/main/java/duke/duke.txt", the relative path would be "java/duke/duke.txt".
For the jar case, you could run it in an empty directory eg "test". So for this example, the jar file will try to locate the saved tasklist file in whatever relative path you specified ie "test/<relativepath>" </relativepath>
12
Yup, it works now. Thanks Prof!
13
Yes, it says build successful.
14
After uninstalling and reinstalling IntelliJ, it seems I can run the tests now. Very weird:
Thank you for the help Prof!
15
I think it depends not so much on the access modifier but the level of encapsulation and whether the rest of the program outside the class has a reference to it. Taking an example from an SO post:
Composition
class Car {
private final Engine engine;
Car(EngineSpecs specs) {
engine = new Engine(specs);
}
void move() {
engine.work();
}
}
Notice how the Car constructor creates an Engine object that exists only within the Car object. When the Car is destroyed, the Engine must be destroyed as well. (in your Email example, the Email and Subjects have a 'part-of' relationship meaning they co-depend on each other)
Aggregation
final class Car {
private Engine engine;
void setEngine(Engine engine) {
this.engine = engine;
}
void move() {
if (engine != null)
engine.work();
}
}
For this example, I can create a Car object at a certain time, then put in an Engine into that Car at a later time. The Engine object doesn't exist exclusively within the Car, and there is some way to reference it from outside. So when the Car is destroyed, the Engine can still exist and maybe be put into another Car. (like for your Team example, a Person can still live even if his Team is disbanded) In the example, there isn't a constructor but if there was, it probably wouldn't specify the Engine attribute at creation time.
I could be wrong, please feel free to correct me!
SO reference:
16
I feel that it refers to the latter as well.
https://www.youtube.com/watch?v=XQnytAeZrWE#t=16m15s In the diagram that he draws, he describes the function calls to the OS as the external couplings rather than between different functions. So a change in 1 function call wouldn't necessarily affect the other function call couplings, whereas if they changed the OS all the function call couplings would have to change as well.
17
Noted, thank you for your help!
@dejunnn
(16 contributions)1. Error with Text-ui-testing multiple lines in input.txt
The following error occurs when I enter more than 1 line in input.txt. Im not sure why this is happening and what I can do to solve it.
I tried methods recommended by other forum posts such as deleting old jar files and running gradlew clean but nothing seems to work. Would really appreciate any help. Thanks!!!
2. Facing a weird issue regarding the printing of lines and scanning of input
Hi everyone. I am facing a really weird issue and I honestly have no idea why it is happening.
In the attached picture is a snippet of my code with a few checks to see how it prints. I would expect "Check 1" to be printed before I enter the user input but it only gets printed after scanning in userAge which is very weird. The same happens for userGender, where "Check 3" gets printed after the input.
When I change all the println() statements to print() statements it ends up becoming weirder as they do not get printed until all the inputs have been entered. May I know why this is the case and why this happens? Because it does not make much sense to me personally.
This issue seems simple enough but I have no idea why it's happening this way. Hopefully, someone would be able to help me out 😃
3
Just to clarify, by all classes having to be in some package does that also include the Main class (Duke.java)?
4
Im actually also having issues with saving the file. It only works if I use the absolute pathway but that will cause errors when using the jar file. Tried many variations but none of them is working 😦
5
Hi may I ask what GSON actually helps with? Not familiar with this particular library
6
Ohh, not exactly sure how to do that. Guess I'm gonna have to go look it up
7
Thanks for the help 😃
8
This was what I used previously. I actually redid a lot of my code so it looks different now.
The brute force rewriting of the file was just a temporary measure as I was more focused on getting the reading and saving parts to work.
9
The one above is an absolute path but that won't work when using a jar file, still trying to figure out the relative path. Though honestly not exactly sure how it would work in that case.
10
Why does this happen though? I tried using an online java compiler and runner and it works fine, where I can put my input on the same line as the printed prompt
Why is there a difference with the 2 results?
11
It works fine when i replace the println() to print(). The error only occurs when I run it using Intellij/Gradle. Not sure why that is happening.
Oh, noted prof 😃 I was just doing this initially to test the input all at once when I encountered this issue.
12
Oh ok noted. Makes testing a little harder but I guess I can work around it. Thanks a bunch 😃
13
I have a related question regarding Composition and Aggregation. Based on the above example, its shown that there is an obvious difference between the 2, where
However, it was also mentioned in the textbook that the aggregation symbol can be omitted.
Would it be possible for an aggregation symbol to be replaced with a composition symbol?
For example, in the example above, where a "whole-part" relationship is not present. Is replacing the aggregation with a composition be wrong in this case?
This also applies for the example in the textbook:
where removing the club doesn't actually remove the person as well, and thus a whole-part relationship is not observed. Can the aggregation be replaced with a composition in this case?
14
Oh noted, thanks for the reply. So am I correct to assume that if we were told to not use aggregation we should in fact be replacing all non-whole-part relationships with normal associations? Which means that only strong whole-part relationships should be labelled with composition while all container-contained relationships are labelled with an aggregation/association?
15
I have a related question regarding coupling. If I have multiple classes utilising the same static class, is that considered high coupling? For example, multiple command classes utilising methods from a static class.
Alternatively, what if those multiple classes are utilising methods from another class (an instantiated object)? For example, multiple command classes utilising methods from an object passed in as a parameter.
Is there a difference if the class is static or not?
16
Oh, I think I managed to figure out the issue already. I honestly have no idea what I did to fix it but I messed around with it a little and now it works. Thanks a bunch! 😃
@Jeremy733
(11 contributions)1. Data files cant be found when running JAR
I added the file duke.txt in /data and had
File file = new File("data/duke.txt");
in my code.
But when packaged as JAR,
"Exception in thread "main" java.io.FileNotFoundException: data/duke.txt (No such file or directory)"
How should I package data folder into JAR.
2. Do we have quiz this week?
I saw on the Admin Notes that we have a quiz this week but I coudn't find it
3
Did you have this issue with CompareNames? You will need a main class to run it. You can try your code on your local machine and just copy and paste it to repl.it as the lecturer said in an earlier post.
4
I got the JAR file running however it still does not save. Therefore if you shut down and rerun the JAR file, you will start with an empty file.
5
@JTWang2000 This is also my temporary fix but I believe we should only be distributing JAR files when releasing it
6
7
I have adopted the solution of creating a new file if it doesn't exist. As long as the user of the jar doesn't move around files into different folders I think it should work.
8
@damithc Thank you for your advice, I'm refactoring the code to make it works better
9
@JTWang2000 You need to check if data folder exists or not or to make life easier just cdo
File f = new File(duke.txt)
10
@JTWang2000 From what I understand as long as you can save the file locally it's fine
11
Well it's always a good habit to have JavaDoc especially when you are working as a team
@wangqinNick
(9 contributions)1. Packaging a JavaFX application in a .jar is possible only with Java 8.
With Java 11, "Error:Java FX Packager: Can't build artifact – fx:deploy is not available in this JDK"
issue: IDEA-200721
Is it possible to build a jar file if I change the SDK to Java 8 ?
2. (A-TextUiTesting) Error: Could not find or load main class Main
I tried to implement the automated text ui texting and followed the Text UI Testing Tutorial in the repo.
I have trouble in updating the java / javac commands to match my main class. The terminal output is:
Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main
My main class's address is
/Users/xxx/Documents/cs2113T/ip/src/seedu/duke
How should I edited these two lines:
if ! javac -cp ../src -Xlint:none -d ../bin ../src/main/java/Duke.java
java -classpath ../bin Duke < input.txt > ACTUAL.TXT
Thanks very much.
3
The only working solution I found so far is build a shadowJar with shadow plug-in using Gradle. It works perfectly.
However, other methods I tried like, a normal fat jar with dependencies does not work. Maybe it is because I am using external library?
4
Do you mean when you run the jar file, the initial task list is not loaded because can not find the file?
5
Are you building the project before running it again? Normally if you made edits and then pressed run it should automatically build it before running, but maybe this feature could have been disabled in the settings. Have you tried going to Build -> Clean build?
Thanks for your suggestion, but there's no "clean Build" option under "Build" though
Did you implement gradle? Gradle can help build and also can clean build.
6
Hi may I ask what Jason actually helps with? Not familiar with this particular library
An open source library published by google. It can parse an obj to Json String or from the other way back.
7
An open source library published by google. It can parse String obj to Gson obj or from the other way back.
Actually it is capable of parsing any Object to JSON (not GSON object). JSON is a format for storing data.
Sorry my bad English, I mean Json String.
8
May I ask what kind of operation will produce “empty list” in your code, list or a message after you add a new task
9
So 2 possible reasons, is it because your duke.txt is empty or when your program cannot find the file, it has a default constructor to build an empty task list?
@GanapathySanathBalaji
(8 contributions)1. Java CI check keeps getting cancelled
Hi Prof,
Our Java CI check keeps getting cancelled. What might the issue be?
Our group retagged v2.1 because we had to make changes after we released.
2. Video link for W12.1b seems to be invalid and a typo in W12.2b
Testing all pairs between p1 and p3 only while ensuring all p3 p2 values are tested at least once
3
I think this would help you:
https://nus-cs2113-ay1920s2.github.io/website/admin/appendixB-policies.html#policy-on-reuse
4
Thanks Prof, Will try
5
When I created a new PR, the CI doesn't run and it's stuck at the starting state.
6
Hi Prof, It ended up failing again.
7
Pushing a dummy commit didn't resolve the issue. But thanks a lot Prof, we weren't planning to push any more code.
The mysterious thing is that the code seems to still pass CI on the PR created at the nus-cs2113-AY1920S2 branch.
8
Thanks for the update. Our code passes Java CI now.
@rdimaio
(7 contributions)1. Submit post-lecture quiz missing from Week 12 Admin info section
Whereas for week 11:
2. Arrow pointing the wrong way in the new UML video?
I think the error may be in the diagram drawn for Q2(b) in the bottom left corner.
It says "one ActionX object containing one Task object has been created and added to the History"; I think it means that :ActionX should be added to :History (in which case History should point to :ActionX instead of :Task)
(supported by the fact that History adds Repeatable objects, which is an interface implemented by Action, but not by Task)
3
Also I am not sure what is wrong here, but there seems to ACTUAL.txt
ACTUAL.TXT is generated by the script and contains the actual output from the program, so it doesn't need to be present before the script runs. If ACTUAL.TXT is present, the script deletes it before compiling and running the program again (e.g. in the .bat script on line 7):
del ACTUAL.TXT
4
Are you building the project before running it again? Normally if you made edits and then pressed run it should automatically build it before running, but maybe this feature could have been disabled in the settings. Have you tried going to Build -> Clean build?
5
HI, I am also having this issue; I uploaded my final .jar file in a release called v0.2 on the 20th, but it shows up as gray on the iP progress dashboard.
6
GitHub uses a version of Markdown called GitHub Flavored Markdown (GFM), which implements things in a slightly different way than standard Markdown. This section in particular talks about the <p>
HTML tag.
7
A couple suggestions:
There may be an issue with the cache for the GitHub Pages page; you can try Shift + F5
to load the page again, ignoring the cached content
If you 're linking your images using their relative path, you could try using their absolute paths instead (or viceversa)
@JosephLimWeiJie
(6 contributions)1. Need help troubleshooting ##[error]Process completed with exit code 1.
Hi everyone, I am having some issues passing the Java CI / build for my PR. Specifically, the check that fails is the 'Perform IO redirection test (*NIX)' part. You can view it here: [https://github.com/AY1920S2-CS2113-T14-4/tp/pull/28/checks?check_run_id=505277833].
I have tried to run my IO tests locally and it is working fine. See here:
However, on Java CI, it is showing this error. See here:
How should I approach to rectify this issue? The link to the source code is here: https://github.com/AY1920S2-CS2113-T14-4/tp/tree/branch-Joseph
Thank you.
2
Hi, you might want to check your save function and see if it writes to the same file path as the one you use for your load function
3
Well you may want to add the data/duke.txt into the runtest.bat. This is what I've got.
4
Hi Prof Damith,
I have tried to reorder the I/O tests. Is it supposed to look like this?
Also, I've tried to replace "\n" and it hasn't been working. May I know if there are other OS-specific characters that I should look out for?
Thank you.
5
It seems that after I updated to the lastest gradle.yml, the CI test still fails.
You can see it here: https://github.com/AY1920S2-CS2113-T14-4/tp/pulls
6
Hi Prof, I managed to solve this issue by applying your solution in which to convert the EXPECTED.txt
to a unix format. I figured that my IDE has set the default file format as dos
that caused this issue to happen. I had since, configured the necessary settings and rectified this issue.
Thank you for your help, prof.
@MeLoveCarbs
(6 contributions)1. Emulating destructor in C++
I understand that Java uses garbage collector and thus, there is no need for destructor methods. But without destructors, how can I know the total number of objects within a class during runtime? For eg, if I can only increment the number of objects in the constructor method but not decrement it under the destructor method, wouldn't the total count be inaccurate if an unreferenced object gets garbage collected without decrementing total object count explicitly?
2. wrong method name in Week 2 Ex4: getMultipleGradeCaps method
The method we should create to prevent the wrong submission is :
double[] caps = getMultipleGradeCaps(grades);
insead of repl's skeleton code method:
double[] caps = getGradeCaps(grades);
3
From what i understand, finalize method only cleans unreferenced objects when called, but my issue is that i want to have a static class member variable that has the total count of objects in runtime, and i want to decrement it whenever unreferenced object gets garbage collected, and increment it whenever a new object is created.
4
Oh okay, thanks for explaining! Closing this issue now!
5
With regards to this arrow, The instructions for ActionFactory is: creates ActionsX, ActionY objects and adds them to the History object.
Since ActionFactory did not specify that History object is a member object within its class, the History object is transient within ActionFactory and the arrow should be a dotted arrow indicating ActionFactory depends on History as well as ActionX and ActionY.
6
Hi, I've encountered this issue too. It could be caused by an old jar file in your local build/lib directory, resulting in a false positive test pass. Try deleting the old jar and making a new jar via gradle shadowJar, after which your local test would be similar to the CI tool and you can fix accordingly.
@kcubey
(6 contributions)1. Deletion of Branches (tP)
During the iP we have been told not to delete our completed branches in our individual forks. For the tP are we allowed to delete the branches in our local forks once we are done with them?
2. Repl.it W3 Ex2 & Website W3.2b Exercise Typo
In both the main website and repl Ex2 (use Rectangle objects), the given code states:
//TODO: add a line here to set the size of r to 8x10 (width x height)
//Recommended: use the setSize(int height, int width) method of the Rectangle object
However, the method should be setSize(int width, height) instead
3. Sentence Phrasing Clarification
Under Week 2 > Project > iP > Point 4, it says
'In this initial skeletal version of Duke, it starts by greeting the user, simply echos commands entered by the user, and exits when the user types bye. '
Wording should be corrected/added to, and state something along the lines of 'You are to modify the current duke project to implement the following:' to reduce confusion as to what the task actually is. The phrasing seems to imply that duke already does the above stated functions
4. Clarification/Typo on Statement
Found on page https://nus-cs2113-ay1920s2.github.io/website/admin/ip-w2.html
Potential clarification needed on above mentioned page, under Section 1, Admin - iP Grading > Project Management section:
Deliver some deliverables in least in 4 out of weeks 2-7)
5
If when you run the jar file alone, you're getting errors because there is no data folder, that probably means that you need to add code to your program that will create folder(s) if they do not already exist
6
Okay noted, thank you.
@chengTzeNing
(6 contributions)1. Edits done in IntelliJ does not show when I run the code
Hello, I'm not sure when this problem started, but now any edits that I make on IntelliJ are not reflected when I run the code. I have tried printing strings when I greet the user to ensure that this is not caused by any error in logic, but it did not work.
Did anyone face the same problem?
2. SourceTree: Cant commit changes because of Binary file
Hello,
I tried to commit some changes in SourceTree after editing. However, it says "No changes in this file have been detected, or it is a binary file".
I tried to google and they suggested changing the Size Limit in settings but it still didn't work.
I'm not sure what is the issue
3
I'm not sure if this counts. Because when I click on the file to be staged, no preview comes out
4
Okay thank you Prof
5
Are you building the project before running it again? Normally if you made edits and then pressed run it should automatically build it before running, but maybe this feature could have been disabled in the settings. Have you tried going to Build -> Clean build?
Thanks for your suggestion, but there's no "clean Build" option under "Build" though
6
Thank you for all the suggestions! I have somewhat solved the issue.
@Shannonwje
(6 contributions)1. Formatting problems of DG
Hi sir, my group's DG seems to be having some formatting issues in terms of the spaces for diagrams. We tried to resize our diagrams but the formatting still seems off.
Will we be penalised for this?
2. A-JavaDoc not in a branch
Hi I've been adding the headers and the comments for my code for a while and so throughout my code in all my branches, majority of my code already has headers so I won't be to do my A-Javadoc in a separate branch and merging it into my master.
How should I proceed? Please advise, thank you 😃
3. Wrong tagging and unable to change it
Hi, I did my A-MoreOOP but I realised I missed out one part of it after I pushed the incomplete commit with the tag A-MoreOOP. Now after I finished my A-MoreOOP increment, I tried to push that commit with the same tag but it told me that I couldn't do so due to a conflict.
I tried to change the old tag name, and tried to delete the tag on github but it looks like nothing changed, even though now I can push the tag on my completed commit. Unsure if I did this retagging correctly, hope it doesn't affect my grades 😦
4
Ok! Have created a branch for it and did some minor javadoc comments in it. Thank you!!
5
Ok thank you Sir!!!
6
Ok thank you Sir.
@melylopez99
(5 contributions)1. Java CI build Fails only for Windows
Hello,
When I was trying to merge some changes to the JUnit tests, some of the tests failed but just for windows, and they work locally on my windows machine. I have tried multiple times to change things in the code that might affect the CI build for windows, but I still can't figure out why it only fails on windows machines.
2
https://github.com/AY1920S2-CS2113-T14-2/tp/pull/33/checks?check_run_id=530870712
3
I have also tried to run runtest.bat on my computer but it passed all tests so I am not able to figure out the error
4
I created functions that sorts all of our data in our arraylist every time an action takes place and the error is still evident. I don't know what to do at this point now
5
Since the build is successful on my windows computer, I am unable to test and find the error that is causing this. What do you recommend we do at this point in order to move forward with the project?
@alaukiknpant
(4 contributions)1. Why does GitHub Pages not show images?
I can see the image in my .md file but I cannot seem to see it in GitHub Pages. Is there any particular reason this happens?
2. Java CI build failure only for windows
My build has been failing for Windows only as seen in the attached photo. I thought the error was in runtest.bat, but my friend could successfully run the test in runtest.bat in her Windows machine.
Are there any potential reasons for this error?
3
Thank you Prof and @j-lum for helping us figure this out. I replaced all the "\n" with System.lineSeparator() and also removed the fancy ﹊ characters and replaced them with the normal straight line: "__". I am still getting the same error. Everything else seem seems to be fine as before though.
4
Thank you all, I was able to fix the issue eventually. The problem was @j-lum pointed out. It was basically characters that Windows didn't recognise.
@g-lilian
(4 contributions)1. Build keeps failing with assertion error
After I opened a PR for some JUnit tests, the build keeps failing on Github with an assertion error in one of the tests. However, when I run the test locally, the build is successful. I'm not sure how to debug the test in Intellij because the local build doesn't have any errors.
We initially suspected that this was due to the list (checked in the assertion) being modified in some other tests, but even after I reinitialized the list to be private to the failed test, the problem still persists.
Any suggestions as to how to resolve this issue?
2
It was mentioned during tutorial that it's because the question stated to assume that we are trying to minimize the number of total objects.
3
Noted, here is the link to the PR: https://github.com/AY1920S2-CS2113-T14-1/tp/pull/43
4
Thanks prof. The issue has been resolved. The assertion error was caused by some other constants being modified. Strangely enough, the error did not show up in my Intellij but it did on my teammate's Intellij.
@Keith-JK
(4 contributions)1. iP Admin Tasks: Merged branch not found
Hi,
According to the iP Progress Dashboard, the merged branch-Level-X has not been found in the fork although I have merged the latest master to all the existing branches as a merge commit that is reflected in the branches itself.
Have i misunderstood the instructions? If so, please advise. Thank you
2
It seems that i had misunderstood the instructions here.
I had completed the merged branches-level-X (did the work in the branch and merge it to master) prior to this mistake and it seems that the script cannot detect them anymore when it could the last time. What are the steps i should take to allow the script to properly pick up the merged branches again?
3
Prior to the merging the master to each of the branches, branches contain work done for the respective increments i.e. Branch-Level-6 contains the increment Level-6 which is subsequently merged to master in a merge commit as per Level-6 increments instructions in that particular week and left alone thereafter. This applies for Level-5, Level-6 and Level-7 increments as can be seen below:
Level-9 increments and A-JavaDoc were merged to master through a PR requests as seen below:
However, due to the recent incorrect merges as can be seen above where i incorrectly merge master into all branches, all of them now contain the same code as master which is the most recent increment A-Release.
4
Ok thank you
@matthewc97
(4 contributions)1. Committing Increments
I have followed the instructions given under the Week 2 Project tab to set up the project. After making changes for increment Level-1, committing and pushing it, I realised that my fork of Duke is public and I am unable to make it private without duplicating it. Can I check if we are supposed to leave it as public or otherwise? Thank you.
2
Perhaps I have misread the instructions given for adding increments. Are we supposed to just commit locally without pushing it?
3
I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃
In that case, are we still supposed to push our commits to the public repo?
4
I believe the prof has mentioned during the first lecture that our repos are to remain public. Correct me if I'm wrong 😃
That's correct. Thanks @Zhilin-Huang
In that case, are we still supposed to push our commits to the public repo?
Yes, but no need to push this week. You'll need to push your code from week 3.
Thank you for the clarification!
@lowxizhi
(4 contributions)1. How to tell the difference between composition and aggregation association
class Email {
private Subject subject;
...
}
class Team {
Person leader;
...
void setLeader(Person p) {
leader = p;
}
}
Is the key difference how the part/containee object is declared in the whole/container class? Does declaring the object as a private variable result in composition association?
2. 1. How to tell the difference between composition and aggregation
In this case, there is a composition association between Email class and Subject object
class Email {
private Subject subject;
...
}
In this case, there is an aggregation association between Team class and Person object.
class Team {
Person leader;
...
void setLeader(Person p) {
leader = p;
}
}
3
Follow up question: Are composition and aggregation associations between
a class and a object
two classes
two objects
?
4
I accidentally posted this issue by pressing Enter. Will take note!
@itskesin
(4 contributions)1. UG submission
Hi,
For our team's UG, it is split into 4 markdown documents UG link. May I know whether I can convert each page into pdf and combine them together ?
For the team files, do everyone in the team have to submit the UG/DG/JAR file respectively?
2. Week 12 Quiz Typo
May I know whether this is a typo or it is intended? 🤔
3. Failed I/O redirection test
Hi,
I failed my I/O redirection test in git when I tried to create a pull request. I have no idea how to resolve this problem? Can somebody give me some guidance?
4
Alright thanks for the prompt reply 😄
@DeetoMok
(4 contributions)1. Submission of deliverable tonight
For the submission today, must everybody submit the Jar file, UG pdf and DG pdf to luminus? Or just one person of the team to submit?
2. Error when merging master branch to another branch
I uploaded a png file on my local repo, and now am having trouble merging that particular branch to my master branch. This is the error that appears, and I am not sure how to solve it.
3. Request to use GSON
Apache 2.0
4
I have found the problem. The file was untracked, and once I removed it, and commited the new changes, it works fine.
@JLoh579
(3 contributions)1. Issues with runtest.bat for tp
Hi,
Our team is having issues with the tp, when we try to run the runtest.bat in the terminal. The program works fine when we run it using Gradle in IntelliJ, however, we keep getting this error when we run the runtest.bat:
BUILD SUCCESSFUL in 11s
2 actionable tasks: 2 executed
Exception in thread "main" java.util.NoSuchElementException: No line found
at java.base/java.util.Scanner.nextLine(Scanner.java:1651)
at seedu.duke.Duke.readCommand(Duke.java:68)
at seedu.duke.Duke.runCommandLoopUntilExitCommand(Duke.java:53)
at seedu.duke.Duke.run(Duke.java:30)
at seedu.duke.Duke.main(Duke.java:24)
Test failed!
Currently we have the following code to read commands from user input:
private static Scanner in = new Scanner(System.in);
// some other code
public String readCommand() {
String input = "";
while (input.isEmpty()) {
input = in.nextLine();
input.trim();
}
return input;
}
Please advise. Thanks in advance!
2. Clarification on iP evaluation
When I was running an iP's Jar file for evaluation using the java -jar {file_name}
command, I got a "java.lang.UnsupportedClassVersionError" which says that it has been compiled by a more recent version of the Java Runtime (class file version 56.0). (Picture below)
According to this website: https://mkyong.com/java/java-lang-unsupportedclassversionerror/ , class file version 56 refers to JDK 12. So I'm guessing I can't run it because I'm using JDK 11.
May I clarify how I should go about the peer evaluation? More specifically, is it ok for me to download the source files and compile it myself for testing and evaluation? Or do I evaluate the program as is (not able to run)?
3
Ok, issue posted, thanks Prof!
@bennychanya
(3 contributions)1. Release quiz answer for online quiz.
Dear Prof Damith,
Is it possible to release the results of the online quiz on luminus so that we know which questions were answered incorrectly, so as to be able to correct any misconception.
2. Unable to run my code on repl.it
I could not run my code on repl.it as it kept giving me this error.
"Error: Could not find or load main class Main
exit status 1"
I do not encounter this issue when I compile and run my code on cmd.exe.
Unable to resolve this issue. Should I just submit my code?
3
Thanks for your input. I manage to get past the problem. Now I'm having this error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Main.main(Main.java:3)
exit status 1"
I googled that it means that there is no additional argument as I compile and run the code on repl.it, which causes my code to get that error
@RenzoTsai
(3 contributions)1. New update cannot be found in tp code dashboard.
Our tp PR was closed by mistake and I have reopened it. But after reopening, it seems that the new update of our code cannot be tracked in tp code dashboard. Here is the link of our tp PR
How can I fix this problem? Thanks in advance!
2
tP code dashboard is not linked to the team PR. It is only based on the code in the
master
branch of your team repo, and is updated only once per 24 hours. Does that clarify the situation or is something still amiss?
Yeah, and our code is updated now. Thank you, professor!
3
I also meet this problem. And I find it is because there is something wrong with storage and runtest.bat. e.g, if your storage file path is data/example.csv
, then when you run runtest.sh, it will create a folder under text-ui-test and will get text-ui-test/data/example.csv
. But for runtest.bat, it will create a folder under build/libs
and will get build/libs/data/example.csv
. So I edit runtest.bat in this way:
And now when I run runtest.bat, the storage file will in the same folder as the runtest.sh's.
@terrytay
(2 contributions)1
Filename and class name should be the same. You can try doing a copy of it on your desktop and save the file as WordComparator.java and try running it. If it works, you can just paste the code and submit. Hope it helps!
https://netjs.blogspot.com/2015/04/why-file-name-and-class-name-same-in-java.html
2
In the Object Diagram, I think that :History should be linked to :ActionX instead of :Task. This will then align with the Class Diagram. Correct me I'm wrong. I'm still learning :-p
@Yukilite
(2 contributions)1. Possible bug in Week 2: Ex 2 Compare Names??
Keeps throwing either the error of class Main cannot be found.
or
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Main.main(Main.java:3).
2
mm I see, where did I go wrong here?
class WordComparator {
public static void main(String[] args) {
if (args.length > 0) {
String x = args[0];
String y = args[1];
System.out.println("Words given: " + x + ", " + y);
boolean isSame = y.equals(x);
System.out.println("They are the same: "+ isSame);
}
}
}
@synCKun
(2 contributions)1. iP Continuation
May i ask if we can continue to update our iP for testing/exploration/fun?
2
Thank you!
@JensonWee
(1 contributions)1
Hi, I've encountered similar issue. I've found out that it could be the result of Hashmap or Arraylist. For different OS, if your array is not sorted, it could result in failing runtest for different OS.
@jinfayap
(1 contributions)1
Github status for workflow actions is up now.
@thanhduc2000
(1 contributions)1
Then may be you have accessed out of bound index in array i guess