Questions tagged [check]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
31 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
1answer
20 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
1answer
18 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
1answer
23 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
2answers
47 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
1answer
30 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
1answer
23 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
2answers
44 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
1answer
42 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
1answer
88 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
1answer
42 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
1answer
907 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
1answer
126 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
1answer
93 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
2answers
91 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
1answer
260 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
0answers
307 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
0answers
155 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
1answer
159 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
1answer
28 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
1answer
434 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
1answer
70 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
2answers
342 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
0answers
165 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
1answer
53 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
1answer
211 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
1answer
348 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
1answer
50 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
1answer
106 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
1answer
271 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
1answer
612 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
1answer
204 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
1answer
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
1answer
240 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
1answer
716 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
3answers
3k 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
1answer
405 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
1answer
150 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
1answer
284 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
1answer
311 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
1answer
148 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
1answer
367 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
1answer
104 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. ...
0
votes
1answer
100 views

pset5 check - stuck in loop

My check function compiles, but gets stuck in a my while-loop when running. Using debugger, it looks like the values are set correctly for "word" in the node ("LA" from lalaland.txt), but the loop ...
0
votes
1answer
465 views

Pset5 Speller Check (Segmentation Fault)

I have narrowed down my error to this specific line (in the check function) using debug50. // For last char in word if (trav -> is_word == true) { return true; } I am still not sure what the ...
0
votes
1answer
314 views

Check function too slow in pset5

I've completed "Speller" successfully, but have been trying to optimise it as the run time for "check" is significantly longer than the staff solution. I suspect the reason is that I don't have ...
0
votes
1answer
1k views

More help with speller Check()

I am (still!!!) stuck. I have a number of problems. Above is what I get if I run the cat text through both functions. Load and check are labeled to show which is which. The first is that my hash ...
0
votes
2answers
72 views

PSET5 Speller Trie Errors

So far, all other methods except check have already been implemented properly in my code. The problem with check is that it only returns true a lot fewer times than expected, which means that most ...
0
votes
1answer
231 views

Help moving cursor in speller check()

I have the dictionary loaded, and the first part of check done but - I cannot move the cursor properly. strcmp is not working properly. I tested it alone in another file and it did work. It is just ...
0
votes
1answer
56 views

pset5, don't know if [load] successfully, [check] return no misspelled

could you please teach me how to make sure if i load the dictionary successfully. when i run check, no word misspelled.. Thank you. typedef struct node { bool is_word; struct node *children[27]; } ...