Questions tagged [load]

the first part of pset5, loading a dictionary into memory

Filter by
Sorted by
Tagged with
0
votes
1answer
48 views

I've implemented pset6 server.c, but something is wrong that it fails all tests in check50 server2

I've been stuck for a few days. My implementation passed check50 server1 except for the non-existant file test, but it failed all check50 server2 test. I am guessing it is due to the load function. ...
0
votes
1answer
88 views

pset5 loading too many words with trie

I am testing my load() with ./speller texts/austinpowers.txt and comparing the result with stuff version with stuff version ~cs50/pset5/speller texts/austinpowers.txt I have been stuck here for a ...
0
votes
2answers
91 views

in pset6 (server.c) the load function give me segmentation fault

I implemented the load function, I compiled it without errors, but if I run it with gdb I get segmentation fault, sometimes after the first fread, sometimes after the second. That's my code: bool ...
1
vote
1answer
109 views

pset5 load with tries, not permanently creating connections between nodes

I'm trying to use tries with pset5. Based on some error checking, it seems the newNodes I'm creating and the links between them are not carrying over from one word to the next. In other words, if the ...
0
votes
1answer
146 views

PSET 5, Segfault in load

When I run speller I get a segmentation fault - I am pretty sure that the error is in this excerpt of my load function. I don't understand why; hashtable is an array of node pointers. Then new_word is ...
0
votes
1answer
133 views

Pset 6 load and index, totally confused

When i run my code i get a error proxy could not be processed request. During check50 2 everything is red with no reason as to why, I am thinking its a seg fault but valgrind didn't give one. Honestly,...
0
votes
1answer
61 views

Pset6 Server seg fault in load and main (because of parse)

Server is functional and gives the correct output using the curl requests individually. However, using gdb, if I use curl to request hello.html after I've requested cat.html (specifically), I get a ...
0
votes
1answer
91 views

pset6 | Server.c | load and indexes doesn't work

I can't seem to find a problem in my load and indexes function. I need help. Thank you!! bool load(FILE* file, BYTE** content, size_t* length) { *content = NULL; *length = 0; BYTE temp; ...
0
votes
1answer
133 views

Help pset6 load and indexes

I am getting these check50 errors can someone tell me in easy english what they are and why they are caused and the possible solution for it and if my approach to load and indexes functions are ...
0
votes
1answer
63 views

Pset 6 'server.c' file size is 0, only for 'hello.php' - And maybe a check50 error?

Alright. I'm becoming crazy, so here I come. I finished the pset, and everything works. At least that's what check50 tells me. When I launch the server and try each file, they work, except for hello....
0
votes
1answer
85 views

pset6 Server.c compiles but server not working

I'm convinced that the issues lie within my parse and/or load function but can't seem to identify them. Maybe I'm incorrectly allocating memory?? I'm not sure. Can someone please help me out? Here's ...
0
votes
1answer
35 views

Two sad faces remain on server.c

The two sad faces are the following: :( Requesting hello.php?name=Alice returns 200, text/html, and correct output and :( Requesting /test/ outputs /test/index.html Here's the code: bool load(FILE* ...
0
votes
1answer
80 views

Can you review my code? Pset5-load

I just finished my Load function for the speller program in pset5. It seems to be working fine, but I'd like to make sure it's the best I can make it before I move on to the next function. Can you ...
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 ...
0
votes
1answer
60 views

pset5: All works correctly except “a”, “A” and “I” come up misspelled too

I've implemented load and check in pset5. It works, but one-letter words "a", "A" and "I" are also coming up misspelled along with the words that are correctly identified as misspelled words. My code ...
0
votes
1answer
101 views

pset6 server.c not working properly

my server.c load and indexes functions are not working properly, and I'm not sure what's up. My parse and lookup functions pass all the tests. Any thoughts? bool load(FILE* file, BYTE** content, ...
0
votes
1answer
198 views

pset5: All words misspelled after load and check

Was hoping someone could help me figure out why I'm getting all words misspelled with my code in pset5. I've done load and check so far and can't see where the problem is. Here's a link to pastebin (...
0
votes
1answer
49 views

seg fault in load

I get a seg fault on my load function and I can't figure out why because the debugging of the problem set doesn't make much sense to me. Here is my code: bool load(FILE* file, BYTE** content, size_t* ...
0
votes
1answer
81 views

error in load and indexes function

I can't seem to find a problem in my load and indexes function. I need help asap. PS- my lookup and parse functions show all green ticks on check50 char* indexes(const char* path) { // TODO ...
0
votes
1answer
58 views

(PSET6) hello.php always displays hello, hello, world regardless of input?

Me again. I've basically sorted out most of the issues now. I can load cat.html normally in the browser and indexes definitely works. From testing, I believe that my parse function is still fine. ...
0
votes
1answer
160 views

Need help with pset6, lookup and parse function!

I think my parse and lookup are working fine, but check50 is not happy. Maybe anyone has an idea. here my functions: const char* lookup(const char* path) { // if there is a path, compare and ...
1
vote
1answer
139 views

Server.c, errors in Check50, probably a problem with load function

I'm almost done with server.c but can't seem to find the last error which doesn't allow me to pass check50. I tried to analyse the existing responses to similar questions but couldn't use them to ...
1
vote
1answer
64 views

Using gdb for load function in speller

I am trying to figure out if all my words of the dictionary are uploaded in my declared node* hashtable[100]but when I am using gdb its just giving me the hexadecimal address of the nodes, be it a ...
0
votes
1answer
119 views

extra word in dictionary count

I am trying to count the number of words in pset5 dictionary while loading them but for some reason my code counts one extra word. here is my code bool load(const char* dictionary) { // open ...
2
votes
1answer
73 views

How will I know that I uploaded the dictionary sucessfully?

I have just implemented the load function for dictionary, I am just confused right now as to how to check speller if my load was a success, I made the load function on a seperate file and edited the ...
0
votes
1answer
148 views

Do I have to declare 26 Heads if my hashtable is of size 26?

I have just started pset5 and for the implementation of the function load i was practicing on the smaller dictionary with making another .txt file and filling it with 3 words for each alphabet, The ...
0
votes
1answer
34 views

Pset5: not setting bools correctly?

I'm having trouble with my load function because it seems that the is_word bools are and aren't being set like they should be (as I can see when I go through it with GDB). Some of them are being set ...
0
votes
1answer
176 views

Extra word in the dictionary pset5

I really need your help because I'm stuck on pset5 for so many days:( I don't know for what reason but my program always sees one extra word in the dictionary! I mean even in the example with ...
1
vote
1answer
70 views

Pset6 Server works fine for cat.jpg, but fails check50

I've implemented load and indexes and the website seems to work ok. I say ok because it prints out hello, hello, world when I access hello.php, and fails pretty much all the checks in the second ...
0
votes
1answer
262 views

All words are misspelled in check

I have been looking at other questions like mine but none of the answers have helped me so im asking myself. I have been debugging for awhile and im pretty sure the problem is that im not accessing ...
0
votes
1answer
115 views

recursive trie generation segfaultin

Halp, I'm trying to implement a clever and zippy recursive trie makin function for load() in pset5, but my program's exploding when I trie, and I'm struggling to educe the problem (probably an ...
0
votes
1answer
156 views

load check & unload

I've been trying to implement load using trie but I have been told that I have something wrong with the place of my declaration of root and with the way I'm handling EOF. I'm trying to fix it but I ...
0
votes
1answer
34 views

Pset5: trie check outputs 18000 out of 19000 words in austin powers

Please help me figure this problem out. The program outputs around 14000 words out of the 19000 words in austinpowers. Here is my code: int getSpot(int letter, node* cursor) { if (cursor-...
1
vote
1answer
93 views

Trie isn't working correctly in pset5

I thought my trie was finally working but when I ran it in the debugger using a dictionary containing the words cat and caterpillar, current->children[value] always equalled NULL. I have spent the ...
0
votes
1answer
38 views

What is the difference between int* and char* in context of my load function?

Please take a look at the codes (both correct and incorrect) first- incorrect code- char* buffer = malloc(*counter); char* ch = malloc(sizeof(char)); for (*ch=fgetc(file);*c != EOF;*ch=...
0
votes
1answer
83 views

Server.c Load function can read HTML but not images or PHP?

I'm not sure if what I did makes sense but here's the code for the load function: if (file != NULL) { char c; int counter = 0; while ((c = fgetc(file)) != EOF) { counter++; } ...
1
vote
1answer
66 views

pset6: load gets the first byte from an image file as EOF

My load functions works with all the cs50checks except for the images. It doesn't load the image instead it just shows a white square. When i stepped through it I found out that in my while loop it ...
1
vote
0answers
135 views

Problem in pset5 load

I've been stuck on pset5 load for a while now (like 1 month...) and I've advanced quite a lot but I'm so close to completing it but, unfortunately, I've reached a bit of a dead end when it comes to ...
0
votes
1answer
42 views

pset5 - Segementation Error on Load

I´ve been fighting to undestand a segmentation error I´m getting when trying the load function. Any help will be really appreciated. Also any tips on how to debug for this type of errors will be ...
0
votes
1answer
95 views

Pset6 Load function problems. Returns true but no file loaded

After many hours of grinding with this pset I finally seem to have both lookup() and parse() functions working correctly. I tried a few methods for load() and finally seem to have it close to working,...
0
votes
1answer
88 views

Problem with edX pset 5 - Spellchecker load - segfaults with large dictionary

Below is the code from my spellchecker load procedure; other parts of the code omitted. When I use a small dictionary, everything seems to run fine, but when I try to load the large dictionary, I get ...
0
votes
0answers
83 views

having problem in load in pset5.valgrind says Conditional jump or move depends on uninitialised value(s)

bool load(const char* dictionary) { FILE* fp=fopen(dictionary,"r"); if (fp==NULL) { printf("Could not open dictionary"); return 2; } for (int i=0;i<SIZE;i++) ...
1
vote
1answer
49 views

pset 5 The dictionary pointer, why is it a char*?

Just wondering, why is the dictionary pointer passed into load a char* instead of a file pointer? Since the dictionaries to be loaded are files.
0
votes
1answer
54 views

jpg and ico files appear corrupt after load function

Implemented the fread, to read byte by byte, and all goes well with all files except the jpg and ico. Can someone point me to the error in my load function? server.c /** * Loads a file into memory ...
0
votes
1answer
180 views

pset 6 server - Load produces inconsistent results

I'm really confused about what is wrong with my code as load works for certain files but not others and the reading of the file isn't something that is altered in any of the functions we're tasked ...
0
votes
1answer
99 views

Pset5: Not able to free allocated heap space in dictionary.c load function

I have implemented all 4 functions and the program seems to be working without issues. Here's the result for austinpowers.txt: WORDS MISSPELLED: 644 WORDS IN DICTIONARY: 143091 WORDS IN TEXT: ...
0
votes
1answer
106 views

All words not getting loaded in speller.c's dictionary

This is my load function: #ifndef N #define N 200 #endif #ifndef LENGTH #define LENGTH 45 #endif #ifndef LL_LENGTH #define LL_LENGTH 1000 #endif typedef struct node { char word[LENGTH+1]; ...
0
votes
1answer
91 views

So close with load in pset6!

I got stuck a while back on load, put this pset down, moved on to complete (and thoroughly enjoy) pset7, but I don't like that I didn't finish this one. Here's what is happening: when I start the ...
0
votes
1answer
89 views

PSET 5 Check 50 errors

I have implemented the four functions and although load is slow it seems to load all the words correctly, and spell checker seems to be working correctly. I think the problem could be at load or ...
0
votes
2answers
529 views

Pset6 problem in indexes and load function

Check 50 returns a lot of errors https://sandbox.cs50.net/checks/caefd03d8ac2485b820743724297b846 Edit: New check50 https://sandbox.cs50.net/checks/fa32659c01b742b78c18f1568d48b90d My load function ...

1
4
5
6 7 8