Questions tagged [check]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
16 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
35 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
30 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 ...
1
vote
1answer
317 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
71 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
64 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
82 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
207 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
151 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
92 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
0answers
16 views

trie speller always leaves last word out for check()

My check function seems to find all incorrect words except the last work in the text. I've tried to move around my is_word==true statement to check if its because I'm not checking that the word ...
0
votes
1answer
92 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
0answers
43 views

pset8 Finance check() issues

I've been struggling with check() for days now. My preventdefault doesn't seem to be working and this still returns 200 when username is duplicated. Here's the flask part: @app.route("/check", ...
0
votes
1answer
26 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
234 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
57 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
308 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
133 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
52 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
144 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
317 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
48 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
81 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
267 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
539 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
192 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
238 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
699 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
397 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
116 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
195 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
238 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
131 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
336 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
99 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
89 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
339 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
281 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
64 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
190 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]; } ...
0
votes
1answer
145 views

pset5 compiling but not functioning

I just rubber ducked my code and I still don't understand where my logic is failing for my code. It compiles but does not produce an expected outcome, if I could be pointed in the right direction it ...
0
votes
1answer
32 views

My program of speller give me so much misspelling words!!

I don't know what I'm doing wrong :s . I'm using the trie to organized the data. This is my implementation of check : // difference between the number Ascii of the letter and it's index in the ...
0
votes
0answers
45 views

can’t pass valgrind in pset5

I don’t know where is the error and when i use help50 that what i get and here is the code unsigned long hash(char* str); int count ; int table_size = 18788; typedef struct node { char word[...
0
votes
1answer
53 views

pse5 ttrie less misspelled words and size not working

please help me figure out why am getting wrong mispelt words and 0 size.below is is my load , check and size: bool load(const char *dictionary) { // TODO FILE *fp=fopen(dictionary,"r"); if(fp==NULL) {...
0
votes
1answer
76 views

segmentation fault in speller, but gbd exits with status 0?

I'm getting a segmentation fault. It came up when I added check() into dictionary.c (been writing mini programs to test my functions in isolation whenever possible), but decided to continue and fight ...
0
votes
1answer
69 views

can I just return trav->is_word from check?

I've been struggling terribly w/speller. Most recently the check function. I'm troubled by how convoluted my code looks because I see it as indicative of convoluted logic. I most recently generated a ...