Questions tagged [check]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
3
votes
1answer
922 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 ...
2
votes
3answers
1k views

PSET5 Speller, faster check and load times hashmap

I am working on the hashmap implementation for the PSET5 Speller problem and seem to keep encountering problems. I have already created a couple of other solutions to the problem (a-z style hashmap ...
2
votes
1answer
85 views

PSET5 Speller / Dictionary - Seg Fault and Incorrect Check

"debug50 ./speller texts/alice.txt" doesn't return a segfault. It runs to completion. But "./speller texts/alice.txt" returns a segfault. Can I PM someone my code to take a look at? Why would running ...
2
votes
1answer
182 views

CS50 PSET5 Won't Work With Apostrophes

I was testing my program with different texts and I found out that my code lists all words with apostrophes as misspelled, even though I have an if statement in my load function that checks for any ...
2
votes
2answers
162 views

Dictionary.c thinks every word is misspelled

my dictionary.c is running but it simply marks every word as misspelled. Also check50 says itsnot compiling. Which it is clearly... Anybody has any ideas? Here my code #include <stdbool.h> #...
2
votes
1answer
266 views

Comparing jpg-signatures with fread-buffer; Can't find something

Using the if condition I am trying to compare the buffer with the given jpg signatures, but I never find something. In GDB I just see the while looping, but never entering the if condition. What have ...
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> #...
2
votes
1answer
887 views

pset 5 check function

I used hash table to store dictionary in pset5. In order to minimize run time, I chose to cite a hash function online instead of writing my own hash table of maybe 26 rows for 26 letters. I wrote the ...
2
votes
1answer
120 views

How do I make dictionary.c compile with strings.h?

There seems to be a useful function -- strcasecmp -- in the strings.h library (notably different from string.h). However, when I try to amend this to my header information (e.g., #include <strings....
1
vote
1answer
2k views

Speller.c appears to be working but is case sensitive (can't recognize capitol letters)

I'm getting my spell checker to load and check. It appears to work (as far as I've tested thus far) except for I can't get it to be case insensitive. I've tried a couple of approaches, but in both ...
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

Pset 5 - Question on check(), diff, and check50 (and I found it interesting)

With the help of @Blauelf and @Yuri Laguardia, I finally made my code working (my previous question here). Then I diff my own results with the staff's, and found that my check() function seem to be ...
1
vote
1answer
48 views

PSET5 : Question about structs

Why if I declare following struct : typedef struct node { bool check; node* children[27]; } node; and now if I create a variable containing this struct : node* var; and now if I check the ...
1
vote
1answer
263 views

pset5 - possessives and substrings

I have posted this questions a few days ago, but none of us were getting anywhere. I thought maybe including my code for load as well as check might yield some new revelations. Anyway, here is the ...
1
vote
1answer
132 views

Check function skipping the check and returning all words as misspelled

Hello my check function keeps returning false for all of the words. I ran it through gdb: Some prints i did in gdb print thisNode (node *) 0x804c170 print thisNode->word $2 = "elephant\n", '\000' ...
1
vote
1answer
207 views

Return value of load()

I just finished implementing load() in problem set 6. However there is still one thing I'm still not sure about: When I finish loading the dictionary file, should I return True or return the actual ...
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. ...
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, ...
1
vote
1answer
314 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"...
1
vote
1answer
1k views

PSET5 - spell checker. How can I make my code faster?

My code for pset5 works reasonably well, it passes check50 and isn't orders of magnitude slower than the staff solution, but I'm just wondering where I am losing time. I'm running my code on the large ...
1
vote
1answer
207 views

pset5 check - do i need to allocate for '\0'? Also, do i need to strcpy when dealing with Const Char and Char?

So I'm building a side code to print out results before implementing onto pset5 dictionary.c I'm getting a seg fault stating i did not initialise the values, can someone help me out? Do i actually ...
1
vote
1answer
162 views

CS50 PSET5 - Segmentation Fault

When I was testing my code, I found that my code gives a segmentation fault using the large dictionary and is unable to load/open the small dictionary. Is this a result of my load function? Thanks in ...
1
vote
1answer
118 views

pset5 check function not working

I have tried to implement load/check function as best as I understand it. When I run it, it prints out all the words in the text as misspelled. I don't even know what is wrong with my code at all. ...
1
vote
1answer
399 views

CS50 PSET5 Speller Check Gets Skipped, All words misspelled

I am not sure why the words are all coming back misspelled, so I will post the global, check, and load. The run time shows that size and unload never get called. Any help is greatly appreciated. (PS. ...
1
vote
1answer
198 views

pset5 cs50 does not handle basic words properly

Can you please help with the following issue with speller from pset5 in cs50: When I run the cs50 check, I get that it does not handle basic words properly, I am guessing, my check function is not ...
1
vote
1answer
225 views

PSET5 How can I test my code with small dictionary?

I'm trying to test my implementations of LOAD and CHECK with small dictionary of cs50 appliance, but it's look like I do the wrong thing... Someone can help me with that please! Thanks jharvard@...
1
vote
1answer
434 views

PSET5 How can CHECK have access to the loaded dictionary?

I'm now working on the implementation of CHECK subfunction. I think I'm on the good way, but my major problem at this moment is to link CHECK with the loaded dictionary. I'm pretty sure I can't access ...
0
votes
2answers
343 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
1answer
2k views

How to make the check function faster?

It seems to be taking too much more time comparing to staff's implementation. The other 3 functions are average, though. dictionary.c: https://gist.github.com/9dcb901f2007d09ae1c9c4fa934f13df Mine: ...
0
votes
1answer
74 views

expected expression pset5 dictionary.c if-else

I am having troubles with the check function in dictionary.c in pset5. Here is my code: /** * dictionary.c * * Computer Science 50 * Problem Set 5 * * Implements a dictionary's functionality. ...
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 ...
0
votes
1answer
228 views

PSET5 - Trie Check Segmentation Fault

I have been trying with this code for some time and tried numerous permutations, however I am still struggling to get anywhere! I am very new to coding so please give any advice that will improve my ...
0
votes
1answer
439 views

pset5 check function and const char* word

I think the biggest issue is at the beginning of check. In the first example, I tried altering its declaration (I know I shouldn't) and since words is not a constant anymore, it gets modified by ...
0
votes
1answer
93 views

pset5 Check Function (trie version) giving a segmentation error

Is there anyone that can help with my check function on pset5. I've got load working fine and confirmed that the correct number of words are loading in both the small and large dictionaries. I've ...
0
votes
1answer
72 views

Load and Check error in pset5

I am having a problem is pset5 mispellings. My function tells me that all my words are mispelled. Here are my load function an my check function. #include <stdbool.h> #include <stdio.h> #...
0
votes
2answers
480 views

pset5 trie check segmentation fault

After completing load, I'm working on the check function. My implementation compiles but leads to a segmentation fault with various dictionaries and text files. My load function works, and the program ...
0
votes
2answers
217 views

Pset5 check() - edited

I have been using Slack exclusively up to this point but, I figured I would give SE a try (plus my boss is out today and I have some free time.) I am working on PSET 5's check(). The error that I ...
0
votes
1answer
246 views

Problems with letters “a” and “I” misspellings

My program loads and checks correctly with small texts and the large dictionary. Although when I load large texts, for some reason calls misspelled for the letters "a" and 'I'. I'm struggling with ...
0
votes
1answer
212 views

Can't free malloc used in check

My pset5 speller is complete works with all check 50. Hell it's even faster then the staff's speller. BUT valgrind is not happy. I am unable to free malloc function used in check. if i do it before ...
0
votes
1answer
503 views

pset5 speller, check function returns all words as false

I've been tearing my hair out over this problem for three days now, and just can;t find where I'm going wrong. All seems okay with this program, it loads the dictionary file (using a trie), gets the ...
0
votes
1answer
461 views

How to pass a pointer to the root node to check(), size() and unload() in speller.c?

For speller.c, you can't pass a pointer to the root node (I'm using a trie) to check(), size(), and unload(). And I couldn't create a global root node in dictionary.c error: initializer element is ...
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
31 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
46 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
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 ...
0
votes
1answer
130 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
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!. :( ...