check50 | This is check50 , a command-line program
kandi X-RAY | check50 Summary
kandi X-RAY | check50 Summary
check50 is a testing tool for checking student code. As a student you can use check50 to check your CS50 problem sets or any other Problem sets for which check50 checks exist. check50 allows teachers to automatically grade code on correctness and to provide automatic feedback while students are coding. You can find documentation and instructions for writing your own checks at
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Process command line arguments
- Log a line
- Send a request to a given route
- Send a GET request
- Run checks
- Returns the dependencies of the given check
- Builds the dependency graph
- Recursively skip children of a check
- Run valgrind command
- Check for valgrind errors
- Register a callback to run after a check
- Compile checks
- Prompt for yes or no
- Import check module
- Import a file
- Install dependencies
- Wait for check50 results
- Load config file
- Format a check50 result
- Hashes a file
- Set the package version
- Include given paths
- Raise an error
- Install translations
- Register a callback function to run after each check
- Setup check50 translation
check50 Key Features
check50 Examples and Code Snippets
Community Discussions
Trending Discussions on check50
QUESTION
My problem might be related to cs50x 2020 - pset2 - substitution - duplicate characters in key or CS50 - pset2 - substitution but I still can't figure it out.
When I run the test manually it passes it, but when I run check50
it fails with:
ANSWER
Answered 2021-Jun-06 at 00:05Never giving up, I found the solution.
The problem was that I didn't understand some details (immutability) of how string arrays work so I did some lame workarounds (remember the "aaaaaaaa"
assignment...).
Eventually Initializing an array of characters with a string variable, How to convert a string to character array in c (or) how to extract a single char form string?, C char array initialization plus implementing the rule that the key should contain each chracter exactly once (which I do not find necessary!) led me to the solution which passes all the tests. I post it here:
QUESTION
I get error ":( program is free of memory errors valgrind tests failed; see log for more information."
Here is my code:
...ANSWER
Answered 2021-May-11 at 16:48This is wrong
QUESTION
First post here, hoping you can help! Apologies for the length - just trying to be thorough.
I'm working on CS50 Problem Set 4, and I've stumbled across an interesting issue that I haven't been able to resolve yet. I'm successfully recovering 49 images, and approximately half of the images appear to be correctly recovered. However, the remaining images have varying extents of "corrupt" data at the end of the files, as per the attached image from Windows Explorer.
Given that this occurs in the middle of a file, and I appear to be finding the start of each file correctly, I believe this occurs in the second half of my while loop - i.e. "not a jpg header". We're told that the jpg files are stored back to back on the raw data, so I don't think I need to be accounting for anything unusual at the end of the jpg files.
I've carried out a number of tests in an attempt to resolve the issue, with no success so far:
- Verified that total output file size is correct by comparing to card.raw.
- Verified that the second half of my while loop runs the expected number of times for image 001.jpg - the first with an issue.
- Running on another IDE
- Checked if file size appears to be related to the "corrupt" files, as there's no obvious pattern to the successful/unsuccessful outputs.
- Various syntax changes in the areas I think may be the root cause (definition of buffer variable, fread/fwrite statement modes.)
My final debugging endeavour was a comparison of my version of 001.jpg, with a known correct version of 001.jpg from a friend that has completed this problem set. I compared these in a hex editor, and found that two bytes (of 105984 in total) were incorrect. At line 00002400 and line 00012400, I have "d8" in place of "00" in the hex view of the jpg file. There are no further differences.
I've included the areas of code which I believe to be relevant below, along with check50 results. I'm happy to provide further code if required. I feel like I've reached the limits of my understanding at the moment, and I'm unsure on how to proceed with resolving this issue. Can anyone give me some advice on what the issue may be here?
Code sample:
...ANSWER
Answered 2021-Mar-17 at 11:52There is a missing =
in this line:
QUESTION
This is my first post on here so please tell me if i made any mistakes. I tried to find an answer to my question on here but i couldn't find anything fitting.
so i have a problem in my code for the 'Credit' problem set of CS50x's week 1. In the problemset the user has to enter a creditcard number that we have to verify as either VISA, MASTERCARD or AMEX. Otherwise the output should be INVALID.
The verification should work like this:
4 0 0 3 6 0 0 0 0 0 0 0 0 0 1 4
every second digit, starting from the second to last digit (the bold ones), is multiplied by 2 and added together. If however the multiplied digit has 2 digits, those two digits are added seperatly like:
2 * 6 = 12 so twelve will be 1 + 2
after that you take the other half of the digits (without multiplying them) and add them together so in the end you have something like
8 + 0 + 1 + 2 + 0 + 0 + 0 + 0 + 2 = 13 (for the digits displayed in bold)
and
0 + 3 + 0 + 0 + 0 + 0 + 0 + 4 = 7 (for the other half of the digits)
You add both together to get 20 (which in the problem set is called the checksum. If the last digit of the calculated number is a 0 the card is valid and after that you just have to check some conditions to tell if its an AMEX, VISA or MASTERCARD.
Conditions for the different creditcards:
American Express = 15 Digits, starting with 34 or 37
VISA = 13 or 16 Digits, starting with 4
MasterCard = 16 Digits, starting with 51, 52, 53, 54 or 55
(Sorry for the long introduction)
I tried to make a formular for this calculation but for some reason it doesn't work for all of the numbers we get to test it. I tried a lot of things to change the calculation and the conditions at the end of my code but everytime i fix one problem, another one appears and right now it feels like i thought myself into a rabbit hole so maybe i'm just too blind to see the obvious.
We only use the libraries - - so far.
...ANSWER
Answered 2021-Mar-30 at 21:21The handling of sum2
is wrong in that it does not sum up something, but overwrites sum2
each time. A possible remedy is to initialize int sum2 = 0;
and change
QUESTION
I'm working on tideman problem for the CS50x (https://cs50.harvard.edu/x/2020/psets/3/tideman/). When I run check50 all the tests is passed except one:
:( lock_pairs skips final pair if it creates cycle lock_pairs did not correctly lock all non-cyclical pairs
I have been looking for the bug but can't figure out what the issue is. i need help.
heres the code below:
...ANSWER
Answered 2021-Mar-13 at 14:02There are two bugs.
You forgot to generalize for any number of pairs other than the
Alice Bob Charlie
case:
QUESTION
I have problems with my check50, I'm wondering if what I'm doing is actually getting the correct boxes.
the goal for blurring is to get all of the grey boxes colors and average them
for each pixel, if the pixel is not on the first row, I know I can have top boxes. If the pixel is not on the bottom row, I know I can have bottom boxes. Same logic with the edges to.
but there also cases where a pixel is in a corner or at a edge
...ANSWER
Answered 2021-Mar-01 at 00:56In the first failed rest result (by the way, please avoid putting images of text in your questions), you're supposed to calculate a value of 127 for the red component of the middle pixel. You calculated 128.
The red components of the nine pixels in this image are as follows:
QUESTION
I´m new to programming, doing CS50 and currently struggling to complete the Pset9 - Finance, version from 2021. I´ve read as many threads I could find about the same issue, but none of the answers helped me to solve the problem yet.
Application.py is doing what the problem briefing required, and I passed all tests except for this one, check50 is expecting a status code 200 but I send a 400.
Something to keep in mind:
- Registration works as expected. I am able to register new users, and when the same username tries to register I show a 400 error.
- Index function is completed, and fully functional showing all required data.
- No script in Register.html to check username when pressing the submit button. I have been unable to write the right script. Not sure if this is something CS50 is expecting after all, but happy to hear anyone who has passed this test.
I would really appreciate it if someone can take a look at the code below, and let me know if I am doing something wrong or just point me in the right direction. Thanks in advance!
Here is my code for register in application.py :
...ANSWER
Answered 2021-Jan-30 at 20:44The problem is in the index, where you query for stocks doesn't make sense to me
try using:
QUESTION
I had a problem when I was trying to solve the edge detection problem in the CS50.
Below is my code:
ANSWER
Answered 2021-Feb-06 at 18:02Your edges
function is almost correct. You just missed that with
QUESTION
I have written a code to solve the DNA problem from week 6 of CS50. However, when I am running it on large.csv databases and sequences, it takes at least one minute to produce an output. On small.csv it produces an output instantly. Because of it, I can't pass check50. I suppose that the problem is on the stage of a function for generating the number of max repeating sequences of STRs, but I don't know how to write it more efficiently. The full description of the problem is here: https://cs50.harvard.edu/x/2021/psets/6/dna/#:~:text=check50%20cs50/problems/2021/x/dna
And here are the source files for databases and sequences: https://cdn.cs50.net/2019/fall/psets/6/dna/
This is my code:
...ANSWER
Answered 2021-Feb-03 at 19:05I know that problem. There are some parts of your code that make it slow.
First, lets try to read each file only once. For instance:
QUESTION
I am having troubles with this submission, I don't see a problem with my code and it works fine when I test it but for some reason I don't know when I use check50, it returns this result:
...ANSWER
Answered 2021-Jan-27 at 05:29Your actual problem looks to be the fact that you have overlooked the simple output required if no-input is provided, or if an invalid key is provided, e.g. from Pset2 - Substitution
And what if a user doesn’t provide a valid key?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install check50
You can use check50 like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page