Questions tagged [pset6]

The problem set for Week 7

Filter by
Sorted by
Tagged with
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 ...
0
votes
1answer
938 views

Debugging Webserver in C

I have an error in my server.c file for PSET6 but have no idea how to find it. I am trying to use GDB and it does not seem to be very useful. I would love some help learning how to better debug this ...
2
votes
1answer
402 views

IndexError in initial state of pset6 Sentiments

I am working on Pset 6, Sentiments and followed the steps to create my app on twitter. I added keys, installed requirements.txt and did everything in order, but when I type "flask run" and visit the ...
1
vote
2answers
1k views

Help with .php files in Pset6 -> Load

Me again, still in pset6, right now working on "load", I did this so far: bool load(FILE* file, BYTE** content, size_t* length) { fseek(file, 0, SEEK_END); long size = ftell(file); fseek(...
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
281 views

PSET6 - Server.c why is this load function not working for PHP files?

My server.c works perfectly except for .php files. It displays the PHP correctly but is infinitely loading. The code for my load function is: bool load(FILE* file, BYTE** content, size_t* length) ...
0
votes
1answer
133 views

pset3 output seemingly correct but not for check50

My problem is that I cannot make it correct in the check50 although the output from the simple testing seemingly fine. It would be grateful if anyone could help me understanding how to solve this. ...
1
vote
1answer
379 views

my server pset throws up “505 HTTP Version Not Supported” but i think it should not

Am done with pset6 but want to test if I implemented the server correctly but when I type in the URL (e.g: 192.#.#.#:port#/cat.jpg) into the browser as specified by David, I get the following error "...
0
votes
1answer
544 views

pset6 (webserver) - hello.php not loading properly [duplicate]

Everything is working except for hello.php. In the load function I try to obtain the length of the file passed to it as shown, but when hello.php is interpreted and the load function is called, it ...
0
votes
1answer
2k views

pset6 | Server.c | issue with load and indexes

I am currently working on server.c in pset 6. I have completed all the four functions and the first check50 gives all green smilies indicating that lookup and parse function seems to be working fine. ...
2
votes
2answers
1k views

how to close port 8080?

~cs50/pset6/server public and ./server public in my own directory worked fine for a long time but now when I try to run it I get the message "Port 8080 already in use, stopping server." How can I ...
1
vote
1answer
371 views

pset6: /hello.php?name=david shows up in URL but hello.html page content loads

Currently working on pset6 server.c. All of my pages load properly except for one thing: when I submit a name in the text box from hello.html, the query properly shows up in the URL, but the hello....
1
vote
1answer
169 views

greedy.py returning integer variable ending with .0 even w/ conversion from float to int() & round()

I am converting my greedy.py function and since python does not have datatypes, i'm getting really confused as to why my code does not convert to an int w/out a .0 ending. Code: import cs50 class ...
0
votes
2answers
141 views

Pset 6 - load - Help!

I don't think I've ever been so frustrated with a pset so far. I sort of understand what I have to do, but I can't just write proper code that'll make it happen. I don't think I've learnt pointers ...
0
votes
1answer
89 views

parse function in pset6

When using Check50 on server.c, I get this result: :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :( Method of 'abcGET' returns error code 405 \ expected output, ...
0
votes
1answer
141 views

Check50 cat.exe returning error code 500, not 501, but abs_path is correct

I've been trying to debug this code for days and can't find the problem. As far as I can tell, GDB tells me my abs_path is correct and NULL terminated properly, but still I get: :( Requesting cat.exe ...
0
votes
1answer
32 views

Pset6 Web-server - Storing a char* at address of argument(parameter)

Pset6 Web-server... In Parse function, how do you store absolute-path at the address in abs_path? bool parse(char* line, char* abs_path, char* query) { char* absolute-path; // assume I've ...
0
votes
1answer
162 views

Pset6, getting error: *** Error in `/home/ubuntu/workspace/pset6/server': free(): invalid pointer: 0x00007fffffff9dc0 ***

When running server.c, and requesting a site, I get this output Using /home/ubuntu/workspace/pset6/public for server's root ...
0
votes
1answer
314 views

PSET6 - No Data Received AND No Errors

This is the very last thing I seem to have to fix here. Telnet and GDB are returning no errors, but when I try to use my server.c in Chrome, I don't get the requested page. Instead, I get an error on ...
0
votes
1answer
261 views

pset6: what does check50 “TODO” error mean?

When I run ./server, it seems all working good. All files in root been opend correctly. But when I checking my code with Check50, it show me errors "TODO". It can be seen in the screenshot. What does ...
0
votes
1answer
90 views

Pset6 Unexpected end of input

On the first check I get all correct except error 404. Not sure where to implement that. After implementing Indexes and Load, I tried check50 only to get Unexpected end of input. Not sure how to debug ...
0
votes
1answer
1k views

Pset 6 Web Server

This isn't a specific programming question, but having watched and re-watched edx lectures in weeks 6, 7 and 8, I am still completely overwhelmed and confused by pset6 "web server". I've read through ...
0
votes
2answers
187 views

Pset6 Server Parse Function

Currently working on Pset6 and I can't seem to get the parse function to work. I haven't fully implemented the function but requesting the home page should work. I was wondering if someone could help ...
0
votes
1answer
123 views

realloc and length in load(), server.c

I need help with load() in server.c. This is a follow-up to the other question, except now I'll post the updated code and make it a bit more specific. When I tested the server after implemented ...
0
votes
1answer
72 views

Load and server not working, am confused

Am really trying to solve server.c though I don't really understand the specification for load and indexes functions. My parse and lookup seems to be working well, they passed check50 for server1 ...
0
votes
2answers
232 views

Pset6 “Size” giving the wrong output

I am counting one word too many every time my dictionary loads, what could be the cause? I initialize the variable 'word_count' here: bool load(const char* dictionary) { // Open the "dictionary"...
0
votes
1answer
171 views

When I run ./tweets @user_name, I get API_KEY not set and when do flask run ,I get this e What could be wrong?

builtins.SyntaxError File "/home/ubuntu/workspace/pset6/sentiments/application.py", line 26 return redirect (url_for("index")) ^ SyntaxError: 'return' outside function
0
votes
1answer
1k views

CS50 2017 ProblemSet6 Mario.py

What is the problem with this simple code? I'm new with Python Also I know Python doesn’t have a do while loop, so instead I use while True, but break, or stop the loop, if n < 0 or n > 23: ...
0
votes
1answer
35 views

PSET6 Load - My web-browser downloads the file instead of displaying it

Is there something wrong with my load method? It seems fine and looks correct compared to code others have posted on Stack. What is happening is the main page displays correctly. When I navigate to ...
0
votes
2answers
412 views

Valgrind error in PSET6

I implemented the tree data structure for pset6. It's all doing it right. On checking with valgrind it is even freeing the memory. The valgrind shows that all the blocks were freed. But the error ...
2
votes
1answer
647 views

How does the Makefile from pset 6 work?

Could someone help provide clarity in the matter of the Makefile used for pset 6? I understand everything up to line 32, that is where it gets confusing. Here the dependencies for the program $(EXE) ...
1
vote
1answer
101 views

Pset6: Errors with Check50

When I use check50 to check my parse function, I find that check50 fails multiple tests and that the terminal generates multiple errors. I am using strtok to separate the request line into different ...
0
votes
1answer
53 views

Pset6 Parse() - How to Approach

I've read the explanation and specification for parse, but I still do not know what I am supposed to do for parse. I've looked at other questions, but I am still confused about the objectives of parse....
0
votes
0answers
245 views

Guys getting problem with cat.exe

Hey friends thakyou for your help in advance I am having problem with my parse and lookup function. check50 is returning all fine except this :disappointed: Requesting cat.exe returns error code 501 ...
0
votes
1answer
255 views

Pset6 - Server.c gives me 505 error (HTTP Version Not Supported)

When trying to access cat.html in pset6 on my local host, I get a 505: HTTP Version Not Supported error in both the browser and the terminal where my server is running. According to my server.c code, ...
0
votes
2answers
523 views

Pset6 Undefined index: name in /home/jharvard/Dropbox/pset6/public/hello.php on line 8

I'm almost through the end of debugging my Pset 6 (Server) code. The server now implements cat.jpg and cat.html properly, but I'm still facing trouble when I try to insert anything into hello.html. I ...
2
votes
1answer
627 views

pset6 : cs50 IDE problem starting my server The webpage is not avialable

I have just started the lecture of week7 and struggling to start. I had my cloud9 account and when I started the server using apache50 start . Setting Apache's document root to /home/ubuntu ......
1
vote
1answer
139 views

not fully understanding dynamically sized array in server.c pest

I am not fully understanding what is happening in the line below Char line[needle - haystack + 2 + 1] Is it subtracting the address of needle from haystack(haystack and needle are pointers) then ...
1
vote
1answer
75 views

Pset6 Server 403 Error, problem with path

I passed the first check50 for Pset6 but still can't seem to get my server working after implementing indexes and load. I've been getting 403 errors whenever I request my homepage, as well as an ...
1
vote
1answer
713 views

valgrind messages about “unititialised value(s)” - are they an issue?

My speller program functions fine, but when I run it in valgrind, I get a lot of messages saying Conditional jump or move depends on uninitialised value(s). Looking into this a little, I think this ...
1
vote
2answers
2k views

implementation of hash table

I have been having trouble with the implementation of the hash table and linked lists. I don't know if I am on the right track or not, but I think my main problem is not knowing how to automate the ...
1
vote
1answer
464 views

I am getting “HTTP/1.1 501 Not Implemented” when I run 192.#.#.#:port#/cat.jpg

@curiouskiwi, Thanks a lot....your response helped a lot. I wonder why I missed out such little detail. However guys, I have another problem which I believe am missing out something but can not seem ...
1
vote
1answer
146 views

Parse wont pass check50

for some reason my code isnt passing: :( Two spaces after GET returns error code & :( Two spaces before HTTP/1.1 returns error code I cant see what would cause that. A previous question indicates ...
0
votes
1answer
447 views

Where are the dictionaries for speller?

When I run speller.c it says it could not load dictionary. I can't find the dictionaries anywhere in the appliance. Home directory only has jharvard in it and when I put gedit ~cs50/pset6/dictionaries/...
0
votes
1answer
385 views

Kind of lost in pset6 dna, How to compare the max number of occurrences of the STR's with the database?

I'm kind of lost I don't know how I can compare the max number of occurrences with the database. My program here can get the max number of it stored in a list called counts to get it I used a function ...
0
votes
1answer
569 views

pset6 check50 doesn't pass for possessives and substrings properly

I probably almost got my pset6 working. When I run the check50 on it, it says: :( handles possessives properly \ expected output, not standard error of "/opt/sandbox50/bin/run.sh: line 31: 184..." ...
0
votes
1answer
182 views

Pset6 server.c Error 403

server.c is giving error(403) inside transfer function (written by default) lookup function : const char* lookup(const char* path) { char* s=(char*)calloc(20,1); strcpy(s,""); char *...
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++; } ...
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
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=...