nseadlc-2020/package-todo-cli-task

Error In just the printing statement

inst-cicada opened this issue · 72 comments

Expected: StringContaining "[3] find needle in the haystack
[2] water the plants
[1] the thing i need to do
"
Received: "[3] find needle in the haystack·
[2] water the plants·
[1] the thing i need to do·

"

I tried to put \n, different print(), and also tried tripple quoted strings but I dont know from where that (·)dot comes when I test the code with npm test. While testing with my powershell everything is fine with no dots but with npm test there is dots. Please help.

Name: Abhishek Joshi

@inst-cicada Could you check for trailing spaces in your output? It's likely that the dot character is being used to indicate additional spaces at the end of the line in your output.

The test doesn't handle additional spaces within the output lines, at the moment.

The same error persists in my system too. I'm using python and regardless of whatever is done, regex, strip, split, join; nothing works. Removing whitespace, newlines, others, nothing is working.
What is to be done?

I'm having the same issue, where that (·)dot comes when I test the code with npm test with Python

I'm not a specialist but I think its becz windows uses Windows-1252 and npm tests are converting text to utf-8. on Top of that (again i think) python by default uses system encoder "Windows-1252" on Windows and after python 2.0 there is no easy option to change encoding (or I'm unable to find) so that "\n" (Windows-1252) is converted to (·) utf-8 still not sure

  • and python3 should be replaced with python in todo.bat to make it run on Windows other wise it gives "Python Not Found!"

I tried my code on Ubuntu (linux) and it works without any problem 👍

EDIT:
found a solution for Python on Windows

instead of print(string_variable) try sys.stdout.buffer.write(string_variable.encode('utf8')) and don't forget to import sys to print to console, (where String_variable is ur variable name)

Hope helps :-)

Yeah, I'll try doing that. Thanks a lot @MrAdiii!

I am using Cpp, can you tell me the solution for dot problem ???

I am using Cpp, can you tell me the solution for dot problem ???

Try on Linux, running on Ubuntu fix the problem for me in Python

I am using Cpp, can you tell me the solution for dot problem ???

Yeah @MrAdiii is right, try linux. If you dont have a linux operating sys, try using one with the help of VMWare.

One more workaround discovered was that in python using the print statement with end in no spaces as print(text,end='') also works. Since python by default has end='\n', changing it to '' would help.

found a solution for Python on Windows

instead of print(string_variable) try sys.stdout.buffer.write(string_variable.encode('utf8')) and don't forget to import sys to print to console, (where String_variable is ur variable name)

thanks to
Saurav Uppoor

todo app took 4-5 hours to code in C++ on Windows 10 😊, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code ☹
Here's the screenshot 📸 : npm test
2020-12-18_10_55_57_Code

What's solution of this issue ??

@inst-cicada Could you check for trailing spaces in your output? It's likely that the dot character is being used to indicate additional spaces at the end of the line in your output.

The test doesn't handle additional spaces within the output lines, at the moment.

I fixed the issue. It took because I was having exams. I encoded it to utf8. It fixed it for me. Thank you.

todo app took 4-5 hours to code in C++ on Windows 10 😊, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code ☹
Here's the screenshot 📸 : npm test
2020-12-18_10_55_57_Code

What's solution of this issue ??

Solution is to encode the output to 'utf8'. Im not sure for c++ but in python it fixed the issue.

found a solution for Python on Windows

instead of print(string_variable) try sys.stdout.buffer.write(string_variable.encode('utf8')) and don't forget to import sys to print to console, (where String_variable is ur variable name)

thanks to
Saurav Uppoor

Yes. Sempai. ;-)

todo app took 4-5 hours to code in C++ on Windows 10 😊, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code ☹
Here's the screenshot 📸 : npm test
2020-12-18_10_55_57_Code

What's solution of this issue ??

https://stackoverflow.com/questions/45575863/how-to-print-utf-8-strings-to-stdcout-on-windows

I haven't tried but, check this

I am facing issues with NPM test, Can any help me out ?
I dont know what is meaning of this error :(

image

I am facing issues with NPM test, Can any help me out ?
I dont know what is meaning of this error :(

image

Please try to run npm test from the directory where your todo.py and todo.bat files are. Running it in default path won't help you!

Now its showing this ?
Can you tell me, what can I do now ?

image

Now its showing this ?
Can you tell me, what can I do now ?

image

Before running npm test in your todo.py directory please run npm install -g jest command to install jest and after that you can use npm test . Good Luck @anshulsinghchouhan4

Hello,
npm test is throwing this error

'D:\Java' is not recognized as an internal or external command,
operable program or batch file.

Everything is working fine on command line, it is npm test which is showing errors. My working folder is in "D:\java"

Screenshot (38)

Help me please!!
having problem to run todo
it runs fine when I manually type ./todo
but when it was manually opend by test this error occurs " C:\Users\Neelam\OneDrive\Desktop\project\java/todo"
How to fix this??

Screenshot (39)
Here it works fine when I manually type ./todo

Screenshot (38)

Help me please!!
having problem to run todo
it runs fine when I manually type ./todo
but when it was manually opend by test this error occurs " C:\Users\Neelam\OneDrive\Desktop\project\java/todo"
How to fix this??

The issue was with your directory path which contains space in the folder names and child_process package couldn't able to resolve it.
This problem occurred due to the test cases which didn't handled this error.

Hello,
npm test is throwing this error

'D:\Java' is not recognized as an internal or external command,
operable program or batch file.

Everything is working fine on command line, it is npm test which is showing errors. My working folder is in "D:\java"

The issue was might be with your directory path which contains space in the folder names and child_process package couldn't able to resolve it in todo.test.js.

Hello,
npm test is throwing this error
'D:\Java' is not recognized as an internal or external command,
operable program or batch file.
Everything is working fine on command line, it is npm test which is showing errors. My working folder is in "D:\java"

The issue was might be with your directory path which contains space in the folder names and child_process package couldn't able to resolve it in todo.test.js.

export is not for windows maybe , how to change that , because of export command this line is reoccuring
'export' is not recognized as an internal or external command,

Help me please!!
having problem to run todo
it runs fine when I manually type ./todo
but when it was manually opend by test this error occurs " C:\Users\Neelam\OneDrive\Desktop\project\java/todo"
How to fix this??

As others said, its due to space in the path name. So here's how you can fix it (it worked for me):
In the todo.test.js, replace the line let todoTxtCli = (...args) => [`${__dirname}/todo`, ...args].join(" "); with this let todoTxtCli = (...args) => [`"${__dirname}"\todo`, ...args].join(" ");

This will tell the cmd that the space encountered is a part of the path and it wont end there. Hope this helps.

Help me please!!
having problem to run todo
it runs fine when I manually type ./todo
but when it was manually opend by test this error occurs " C:\Users\Neelam\OneDrive\Desktop\project\java/todo"
How to fix this??

As others said, its due to space in the path name. So here's how you can fix it (it worked for me):
In the todo.test.js, replace the line let todoTxtCli = (...args) => [${__dirname}/todo, ...args].join(" "); with this let todoTxtCli = (...args) => ["${__dirname}"\todo, ...args].join(" ");

This will tell the cmd that the space encountered is a part of the path and it wont end there. Hope this helps.

It works in some cases but didn't work for me.

WHEN I TRY TO RUN IT, IT'S TAKE A LOT OF TIME
Can anyone tell how much time it takes ?

image

WHEN I TRY TO RUN IT, IT'S TAKE A LOT OF TIME
Can anyone tell how much time it takes ?

image

For me, it took around 10 to 20 seconds.

Please help me with this someone. I am new to programming in Java. Stuck on this for more than 1 day.

Screenshot 2020-12-20 142445

WHEN I TRY TO RUN IT, IT'S TAKE A LOT OF TIME
Can anyone tell how much time it takes ?
image

For me, it took around 10 to 20 seconds.

I wait for more than 5 minute still, it didn't run the file. Can you tell me what can I do

Did you run the command npm install before executing the npm test command?

WHEN I TRY TO RUN IT, IT'S TAKE A LOT OF TIME
Can anyone tell how much time it takes ?
image

For me, it took around 10 to 20 seconds.

I wait for more than 5 minute still, it didn't run the file. Can you tell me what can I do

Did you run the command npm install before executing the npm test command?

YES

WHEN I TRY TO RUN IT, IT'S TAKE A LOT OF TIME
Can anyone tell how much time it takes ?
image

For me, it took around 10 to 20 seconds.

I wait for more than 5 minute still, it didn't run the file. Can you tell me what can I do

How did you run your first test?

WHEN I TRY TO RUN IT, IT'S TAKE A LOT OF TIME
Can anyone tell how much time it takes ?
image

For me, it took around 10 to 20 seconds.

I wait for more than 5 minute still, it didn't run the file. Can you tell me what can I do

How did you run your first test?

What do you mean ?

Screenshot (44)

export is not recognized as internal or external command,
How to fix this??

I am working in windows , and why this problem is occurring.
export is not recognized as internal or external command

Screenshot (44)

export is not recognized as internal or external command,
How to fix this??

That time my file is in a folder whose name having space, So I change the path and error resolve.

Screenshot (44)
export is not recognized as internal or external command,
How to fix this??

That time my file is in an folder whose name having space, So I change the path and error resolve.

My file path doesn't have space now.. I removed that .

Screenshot (44)
export is not recognized as internal or external command,
How to fix this??

That time my file is in an folder whose name having space, So I change the path and error resolve.

My file path doesn't have space now.. I removed that .

Ping me on linkedIn https://www.linkedin.com/in/anshulsinghchouhan4/

Screenshot (44)

export is not recognized as internal or external command,
How to fix this??

I even changed the path of the file .. but still the same problem is arising.
export command is not recognized .

Screenshot (44)
export is not recognized as internal or external command,
How to fix this??

I even changed the path of the file .. but still the same problem is arising.
export command is not recognized .

Try this fix : https://stackoverflow.com/questions/55443351/how-to-solve-vscode-unsupportedclassversionerror

we have to write a code for what i can not understand ...can anyone tell me what we have to do in this challenge ,..
can we write some code or using only CLI or any other thing??

Screenshot (38)

Help me please!!
having problem to run todo
it runs fine when I manually type ./todo
but when it was manually opend by test this error occurs " C:\Users\Neelam\OneDrive\Desktop\project\java/todo"
How to fix this??

Did you find any solution ?? I am also facing this issue...

Screenshot (38)
Help me please!!
having problem to run todo
it runs fine when I manually type ./todo
but when it was manually opend by test this error occurs " C:\Users\Neelam\OneDrive\Desktop\project\java/todo"
How to fix this??

Did you find any solution ?? I am also facing this issue...

Maybe this could help you #34
btw, Please let me know if it had worked in your case!

image

Hi why is it throwing error? I am not printing full stops but they are automatically being appended
IN java

@inst-cicada Could you check for trailing spaces in your output? It's likely that the dot character is being used to indicate additional spaces at the end of the line in your output.
The test doesn't handle additional spaces within the output lines, at the moment.

I fixed the issue. It took because I was having exams. I encoded it to utf8. It fixed it for me. Thank you.

Can you please tell how to solve this issue for c++ on windows?

todo app took 4-5 hours to code in C++ on Windows 10 😊, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code ☹
Here's the screenshot 📸 : npm test
2020-12-18_10_55_57_Code
What's solution of this issue ??

https://stackoverflow.com/questions/45575863/how-to-print-utf-8-strings-to-stdcout-on-windows

I haven't tried but, check this

hey!! can you please help me .. because I assume that my code is correct but still test cases are failing ..
here is the screnshot
Screenshot (47)

hey!! can you please help me .. because I assume that my code is correct but still test cases are failing ..
here is the screnshot
Screenshot (47)

Does your cli work when you add/del/done the items? Did you test your app by manually giving arguments?

hey!! can you please help me .. because I assume that my code is correct but still test cases are failing ..
here is the screnshot
Screenshot (47)

Does your cli work when you add/del/done the items? Did you test your app by manually giving arguments?

yes bro I am also facing this issue and I tested manually its working fine but the test cases are failing help .

todo app took 4-5 hours to code in C++ on Windows 10 😊, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code ☹
Here's the screenshot 📸 : npm test
2020-12-18_10_55_57_Code
What's solution of this issue ??

https://stackoverflow.com/questions/45575863/how-to-print-utf-8-strings-to-stdcout-on-windows
I haven't tried but, check this

hey!! can you please help me .. because I assume that my code is correct but still test cases are failing ..
here is the screnshot
Screenshot (47)

ya same issue here pls help

se I was having

were you using c++, or other language?

If c++, can you tell how you resolved this issue.

@inst-cicada Could you check for trailing spaces in your output? It's likely that the dot character is being used to indicate additional spaces at the end of the line in your output.

The test doesn't handle additional spaces within the output lines, at the moment.

How to rectify this?

I was unable to submit my zip file. Though i was uploading a file with .zip extension , it is giving me error as:
You must upload a ZIP file to submit
Can some help?

It says 'remove any binary file before uploading'.
Also, should the done.txt and todo.txt files be empty in my zip folder that I want to upload?

Should I also remove the 'package-lock' folder from my zip folder that I want to upload?
@harigopal

image

Hi why is it throwing error? I am not printing full stops but they are automatically being appended
IN java
I too facing this same issue. Can anyone suggest a solution for this.

image
Hi why is it throwing error? I am not printing full stops but they are automatically being appended
IN java
I too facing this same issue. Can anyone suggest a solution for this.

I think there is no proper answer to this for C++ , either code in pyhton or check in Linux, I struggled with the same problem , I think maybe our cases will pass in their server even when they are not passing for us( because we are using windows which does not uses utf8 encoding ) , just focus on getting the content right and pass the rest of the test parts. Tests can pass in their server because the dot(.) will not be inserted there( I guess );

todo app took 4-5 hours to code in C++ on Windows 10 😊, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code ☹
Here's the screenshot 📸 : npm test
2020-12-18_10_55_57_Code

What's solution of this issue ??

Hey, did you find the solution? what to do to solve this in C++ ?

Expected: StringContaining "[3] find needle in the haystack [2] water the plants [1] the thing i need to do " Received: "[3] find needle in the haystack· [2] water the plants· [1] the thing i need to do·
"

I tried to put \n, different print(), and also tried tripple quoted strings but I dont know from where that (·)dot comes when I test the code with npm test. While testing with my powershell everything is fine with no dots but with npm test there is dots. Please help.

Name: Abhishek Joshi

any solution of this in C++ ?

It says 'remove any binary file before uploading'.
Also, should the done.txt and todo.txt files be empty in my zip folder that I want to upload?

Remove the node_modules folder and any binary or hidden files like .vscode or .gitignore

I am unable to uplaod my zip file it says application error at heroku app

The same error persists in my system too. I'm using python and regardless of whatever is done, regex, strip, split, join; nothing works. Removing whitespace, newlines, others, nothing is working.
What is to be done?

same here

Uploading IMG20201224181811.jpg…
I got stuck at this point, please help me to resolve this out.

temp_1
I don't know why i get this error msg while running npm test
`.\todo.out is not recognized as an internal or external command'
Can any one figure out what i am doing wrong?

Screenshot (39)
Here it works fine when I manually type ./todo

can you plzz tel me how would you can run using ./todo because its not working in my system

todo app took 4-5 hours to code in C++ on Windows 10 blush, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code frowning_face
Here's the screenshot camera_flash : npm test
2020-12-18_10_55_57_Code
What's solution of this issue ??

https://stackoverflow.com/questions/45575863/how-to-print-utf-8-strings-to-stdcout-on-windows
I haven't tried but, check this

hey!! can you please help me .. because I assume that my code is correct but still test cases are failing ..
here is the screnshot
Screenshot (47)

ya same issue here pls help

you need to create a txt file to insert list data

Expected: StringContaining "[3] find needle in the haystack [2] water the plants [1] the thing i need to do " Received: "[3] find needle in the haystack· [2] water the plants· [1] the thing i need to do·
"

I tried to put \n, different print(), and also tried tripple quoted strings but I dont know from where that (·)dot comes when I test the code with npm test. While testing with my powershell everything is fine with no dots but with npm test there is dots. Please help.

Name: Abhishek Joshi

everything is working fine on Linux platform this problem is only on windows.
So dont worry if your solution is only failing on those 3 tests

todo app took 4-5 hours to code in C++ on Windows 10 😊, but "\n" is converted to dot(·)
its been 1 day, but couldn't find the solution......
I tried every possible way to encode but couldn't find the solution, and I don't have Linux to test code ☹
Here's the screenshot 📸 : npm test
2020-12-18_10_55_57_Code
What's solution of this issue ??

Hey, did you find the solution? what to do to solve this in C++ ?

hey my first test case which is invisible not solving you have some idea to solve this issue

Screenshot (38)

Help me please!!
having problem to run todo
it runs fine when I manually type ./todo
but when it was manually opend by test this error occurs " C:\Users\Neelam\OneDrive\Desktop\project\java/todo"
How to fix this??

change the todotest.js in which (.) may be not present and add it to there.(./todo)

I'm unable to understand where exactly am I supposed to have the text files. Because it always throws an error that text file is missing in the directory. When I put the text file manually, after running a test, the files disappear on their own. Would appreciate if someone could help

Should the text files be present elsewhere and not in the application directory?

Hey, If someone has completed the app. can you share the source code?

jasim commented

@samarthshiramshetty Please see the README of the repo:

Kindly desist from sharing your solution privately or publicly. This is because the programming task is not complex for those who've written non-trivial amount of code before. But for beginners, solving this can be quite instructive - frustrating at times, but rewarding in the end.

But if you share your solution with them - through a GitHub repo, or by circulating in your private networks, you're only robbing them of a rewarding experience that would have helped them grow as programmers.

It is trivial to detect copy-cat code submissions and students who submit plagiarized code will be unable to find a place among the limited seats in the course. It is just that it'll take us a few more moments to read through the code and tag it. A lose-lose proposition for all concerned.