Questions tagged [check]
The check tag has no usage guidance.
193
questions
0
votes
1
answer
27
views
can't check until a frown turns upside down for my check twitter code
i am getting check50 error for my below code.
from twttr import shorten
def test_default():
assert shorten("asif") == "sif"
def test_argument():
assert shorten("...
0
votes
1
answer
64
views
PSET5: Problem with my check function, but I'm not sure
I have been stuck with this problem for many hours now, but I still can't wrap the idea around my head. When I test run this code, it just prints out "MISSPELLED WORDS", and nothing more. ...
0
votes
0
answers
15
views
my check and size functions are having problems and check50 returns all frowns
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#...
0
votes
1
answer
29
views
I write all the function but the actual misspelled words are much greater than the expected misspelled value, not working well with substrings
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>
#include <string.h>
...
0
votes
1
answer
38
views
I just can't figure out how to put the word into lowercase for the hash function to provide the same index
bool check(const char *word)
{
char mot2[46];
for (int o = 0, h = strlen(word); o < h + 1; o++)
{
mot2[o] = tolower(word[o]);
}
int y = hash(word);
node *cursor = table[y];
while (cursor != ...
0
votes
2
answers
32
views
Pset5 CHECK cursor returns NULL erroneously
I keep getting most, if not all, of the words in the text returned as misspelled. I tried debug50 with the small dictionary and cat text and found that the cursor in CHECK always returned NULL, so the ...
0
votes
1
answer
99
views
problems in unload function-pset5
// Implements a dictionary's functionality
#include <strings.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#...
0
votes
1
answer
356
views
PSET6 DNA Almost done - matching not working correctly
I have been stuck with last part of the code that is supposed to match the DNA sequence from sequence.txt with the one in database.csv.
It passes most of the tests in check50 and fails only in ...
0
votes
1
answer
55
views
Check function pset5 speller
I've been stuck on this for hours, please help.
bool check(const char *word)
{
char check_buffer[LENGTH + 1];
for(int i = 0; i < strlen(word); i++)
{
check_buffer[i] = word[i];
...
0
votes
1
answer
54
views
Can't check CAESAR pset2
I solved the Caesar problem and it works flawlessly. But I can not check it properly. The results are correct but
'''
check50 cs50/problems/2021/x/caesar
'''
says it is incorrect. If I view the ...
0
votes
2
answers
91
views
Plurality error :( vote produces correct counts when all votes are zero
#include <cs50.h>
#include <stdio.h>
#include <string.h>
// Max number of candidates
#define MAX 9
// Candidates have name and vote count
typedef struct
{
string name;
int ...
0
votes
2
answers
158
views
Pset5 Speller,Check function isn't working as expected, strcasecmp always returns false
The problem is the word is found in loaded dictionary it's found but check function still returns false
i've been like 7 days in this problem someone helps please,
((I'm Trying to test code ./speller ...
0
votes
1
answer
63
views
speller is case sensitive
I tried to convert each word to lower before hashing in check, but it seems like it didnt do anything :( however, in the output the misspelled word is now lower
// Implements a dictionary's ...
0
votes
1
answer
50
views
The strcsecmp() function is not working as expected
I am currently trying to solve pset5, speller. I managed to write every funtion correctly except of the check() function.
This is the check() function I wrote so far:
// Returns true if word is in ...
0
votes
2
answers
64
views
Segmentation fault error in pset5
I did the speller and had some errors that I solved, but now I'm stuck and need help.
I debug the load and hash (I know it's not ideal, but it works:))
Now I'm receiving the Segmentation fault error ...
0
votes
1
answer
132
views
PSET5 Speller - Can't handle substrings properly
I've been doing the speller exercise for a while and I'm stuck in the "handle substrings properly". Here's my code:
// Implements a dictionary's functionality
#include <stdbool.h>
...
0
votes
1
answer
192
views
Pset5: Speller. incorrect counting of mispelled words
I've been working on this code for the last two weeks... I load the correct # of words into the dictionary, but I get an incorrect number for misspelled words. I believe its an issue either with my ...
0
votes
1
answer
56
views
PSET5: memory leak in check function
bool check(const char *word)
{
unsigned int hash_index = hash(word);
node *trav = table[hash_index];
while (trav != NULL)
{
int len = strlen(trav->word);
char ...
3
votes
1
answer
1k
views
Help with PSet 5 2020 - Speller - Check & Unload Functions (EDIT: logic error in Load Function)
EDIT: Fixed the problem. The issue was not with the check or unload function but with the load function which had a small but very significant logic error. Figured it out with some great help from a ...
0
votes
1
answer
202
views
PSET5 - Speller - Doesn't display anything past MISSPELLED WORDS
I've been debugging for quite a while now and can't seem to figure out the solution to this problem. When I use the large or small dictionary on any of the texts, the program becomes stuck at ...
0
votes
1
answer
109
views
pset5 - almost all words misspelled
I'm having trouble with the implementation of the PSET5 spell check code. I've looked through a lot of CS50 Stack Exchange posts, but haven't found any help. The problem is either in the check or in ...
2
votes
2
answers
104
views
2019 PSET4 SPELLER, I have no clue why it isn't working, I'm sure size and unload function is right, but unsure about load and check
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#...
0
votes
1
answer
327
views
pset3 (runoff) check50 is giving an error for print_winner
I can't find what's wrong with my code but check50 keeps telling me
:( print_winner prints name when someone has a majority
print_winner did not print winner of election
:( print_winner returns ...
0
votes
0
answers
537
views
FINANCE [UNIQUE constraint failed: users.username] Error encountered using check50
I have finally got my entire program working for PSET8 Finance. I receive no errors in my dev console and all functions are working correctly after registering 15 users.
For some reason, though I get ...
0
votes
0
answers
189
views
PSET8 CS50 Finance: /Check fails to run, does not catch or notify of duplicate usernames
I have been struggling with the check function in PSET8 for a few weeks now, and have run into various problems as I tried to work through my issues.
Currently, it seems by check .get function does ...
0
votes
1
answer
178
views
Cs50 Pset 1 Cash
I am getting the desired number of cents however when I am submitting I am getting the below error :(. I tried to do some research but still not able to find the fault. Please check. Thank you!.
:( ...
0
votes
1
answer
29
views
Speller (hashtable) check-function marks everything as correct
When using a small dictionary, everything is working fine. But with larger ones I'm getting output like this:
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: ...
0
votes
1
answer
643
views
Pset8 Finance - request.args.get() is returning None in check()
I've been banging my head on writing check().
My request.args.get() is returning None and therefore unable to query the username in my javascript.
Here's a screenshot of my console:
I'm expecting: ...
0
votes
1
answer
115
views
Javascript isn't running at all in pset8 check
I'm not sure how to run my javascript in pset 8. I used a normal script tag to link it in my register/html file. I'm not sure I need to link it from the application file. Do I need all the JS to be ...
0
votes
2
answers
352
views
PSET 8: Finance /check
I am stuck on the final section of PSET8 finance, /check. It seems that the data for "username" is not being passed from the web page to the python script. The value for "username" in the python ...
0
votes
0
answers
230
views
Pset8 - Check - Cannot get duplicate username to give javascript alert (that user must choose other username)
Below is a description of the problem, the "check() function" code, and the "register.html" file:
Problem description:
I haven't been able to write correct javascript (and maybe my check function ...
0
votes
1
answer
55
views
PSET3 Recover - Creating only textfiles for .JPG not images
My version of Recover for pset3 is creating 50 .jpg files but only as textfiles not images and I can't work out why. I've looked through this forum and saw one similar question but the issue ...
0
votes
1
answer
369
views
pset 8 finance: ":( buy handles valid purchase" fails
I`am bug fixing my application and can't find a solution for the ":( buy handles valid purchase" test. Here is Log:
expected to find "112.00" in page, but it wasn't found
Log sending POST ...
1
vote
1
answer
383
views
pset8 finance "/check": Dont understand how the JS code works
I am currently working on the implementation of "/check" in pset8. I tried to implement it by reading trough the documentation of "event.preventDefaul()", "$.get()" and etc. functions. That is what I ...
1
vote
1
answer
59
views
Pset5-- program isn't checking all words, marks all words it checks as misspelled
I've been running the code with the small dictionary and a sample text of "cat hgsgk caterpillar", so the code should theoretically return a wordcount of 3, and hgsgk as the only misspelled word. ...
0
votes
1
answer
151
views
CS50 Speller seems to be stuck even after finding all the incorrect words
I've been completing the fourth problem set on the CS50 course. After checking multiple times for errors in my code I finally managed to make it compile. The program works as it finds all of the ...
0
votes
1
answer
277
views
pset8 finance check sub-problem
Working on 'check' problem in finance.
I've implemented the actual check function via GET HTTP and responses are valid, have also implemented into the register.html page, with simply displaying the ...
0
votes
1
answer
708
views
CS50 Pset8 Finance /check - TypeError: The view function did not return a valid response
I've got most of finance working but I can't for the life of me sort out /check.
No matter what I do, I get the error:
'TypeError: The view function did not return a valid response. The function ...
0
votes
1
answer
223
views
2018 pset4 dictionary check() doesn't check dictionary
I'm in a pickle here.
I have followed walkthrough step by step for this part.
But my code just keeps on refusing to load dictionary.
(Sorry for the low quality code here)
bool load(const char *...
1
vote
1
answer
1k
views
Pset8 Finance Check error
I consistently get this error when running check50 on pset8 Finance problem from CS50 when I assume it tries to add a new user that isn't in the user database.
However when I enter a new user myself, ...
0
votes
1
answer
247
views
Pset8 Finance problem with preventDefault
guys! I have created script in "check" template, but it looks like there is something wrong with conditional part where script should select between proceeding with "submit" and preventDefault. In my ...
0
votes
1
answer
749
views
pset8 - finance - check - ajax - preventDefault()
I have been working on the final check part for the pset8 exercise. In the registration part, when the username is taken, I could get an alert. However, I couldn't seem to stop it from logging in. I ...
5
votes
3
answers
4k
views
CS50 Finance/pset8 2019 /check
I am trying to write the script for a form such that if a username is taken, the user is alerted that it is taken, and submission of the form is blocked. If the username then types in the correct ...
0
votes
1
answer
411
views
CS50 Speller (hash table) - Check returning 0 misspelled words
I'm looking for help with my (hash) code in check to properly handle misspelled words with apostrophes and substrings:
bool check(const char *word)
{
int len = strlen(word);
char copy[len + 1];
...
0
votes
1
answer
224
views
pset5 "words in dictionary" is 0
I'm not having much luck troubleshooting my speller code. It returns the correct misspelled words and words in text, but words in dictionary returns as 0. I ran valgrind and it said there is a leak in ...
0
votes
1
answer
360
views
PSET7 Finance- Quote and Buy not passing all checks
I've just come back to CS50 after the semester ended and have been trying to debug my program to no avail. The application appears to be working when I test it myself, passes all checks, but has ...
1
vote
1
answer
352
views
Pset5: Need Help with Check
My 'Check' function outputs words that are not misspelled and skips over the ones that actually are. It also doubles the words that it outputs. For instance, in a sentence "There was once a catapillar"...
0
votes
1
answer
158
views
Pset5 Speller : Check gives segmentation fault : Tries
I am not getting where the segmentation fault is happening.
// Implements a dictionary's functionality
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <...
0
votes
1
answer
377
views
pset5 speller check function returning all words as misspelled
please take a look of my code and offer me some suggestion on why my code returning all words as misspelled. thank you so much.
// Implements a dictionary's functionality
#include<stdio.h>
#...
0
votes
1
answer
109
views
cs50 pset5 hashtable check, misspelled more than expected
i have been working on the check for many days and not able to find why the misspelled word is more than stuff solution. Rest of the programs looks ok, and i used debug50 ,there is not too much clue. ...