Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 10074

The problem set for Week 7

0 votes
Accepted

Problem with caesar in python

crumb 1 Expected input is an integer, ord is the wrong function to create key. crumb 2 from the python doc str.upper() Return a copy of the string with all the cased characters [4] converted to upper …
DinoCoderSaurus's user avatar
0 votes

Why does my code for indexes in web server generate 15 errors?

See answer 2 in this post for a good and detailed explanation of the first error. Next: server.c:459:10: error: incompatible pointer to integer conversion initializing 'char' with an expres …
DinoCoderSaurus's user avatar
2 votes
Accepted

pset6 failing just 1 test: /test/ returns /test/test.html

The staff's implementation does return /test/index.html. While your statement "However it does in fact call indexes() function to modify the URL, and redirect to index.html." is a reasonable human des …
DinoCoderSaurus's user avatar
1 vote

pset6 unexpected end of input in 2nd check50 and in first check50 Method of 'abcGET' error

You are never populating path2. That will cause the "test/index.html" fail. Look carefully at your strcat statements. Also, review the first 5 or so minutes of Week 2 lecture. You are not properly {} …
DinoCoderSaurus's user avatar
2 votes

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

See the section on "interpret" (around page 8) of the instructions. Odds are you’re unfamiliar with popen. That function opens a "pipe" to a process (php-cgi in our case), which provides us with …
DinoCoderSaurus's user avatar
1 vote

The code doesn't see the newline in the string (doing pset6)

Oh, you elusive one! If line is "cat\n" then strlen(line) is 4. The individual chars are addressed at indexes 0 through 3. So this line if(line[len] == '\n') needs to be corrected to get the result yo …
DinoCoderSaurus's user avatar
1 vote
Accepted

Pset6 throws invalid next size error

If path is /home/ubuntu/pset6/public.... well, you see what's happening. Is it necessary to look at all the files in path to determine whether index.php|html exist? …
DinoCoderSaurus's user avatar
1 vote
Accepted

pset6 staff version not working

The -o (little letter o) switch outputs a log file, in this case ~cs50/pset6/server. The correct switch is -O (big letter O). …
DinoCoderSaurus's user avatar
1 vote

PSet 6 Size of new in htmlspecialchars

Since you asked: it's just you. It's not forgetting the escaped character, it's using that already-allocated space. A string needs to be allocated such that there is room for the null terminator. In …
DinoCoderSaurus's user avatar
1 vote
Accepted

Help with cs50 server

This line if (copy[strlen(copy - 1)] != '/') might be causing problems in your indexes function. It looks wrong in any case. Look carefully at your parentheses. Your variable copy is not properly nu …
DinoCoderSaurus's user avatar
2 votes
Accepted

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

As you say, your curl request (properly) gives a 404 because you do not have a cat.exe file. There probably is a cat.exe file on the check50 server. You could copy cat.html to cat.exe. Then issue the …
DinoCoderSaurus's user avatar
1 vote
Accepted

Trouble with pset6

This feedback \ expected an exit code of 0, not standard error of "======= Backtrace: =========\n==== indicates a seg fault. Try requesting cat.jpg in your browser and see if server bails with a seg f …
DinoCoderSaurus's user avatar
2 votes
Accepted

Server.c failing with open ended query

The problem starts here char* possible_query = strtok(NULL, "?");. In the case where request_line is "/hello.php?", strtok will return NULL, because the first call to strtok consumed all of request_li …
DinoCoderSaurus's user avatar
2 votes
Accepted

These two both get a 505 Error even though they shouldn't

It appears this if(strncmp(httpVersion, "HTTP/1.1\r\n", strlen(httpVersion)) == 0) { is always false, based on check50 output. Since program is comparing httpVersion to a string literal, one can draw …
DinoCoderSaurus's user avatar
0 votes
Accepted

pset6 Trying to undertsand getopt()

Try man 3 getopt. The salient info is int getopt(int argc, char * const argv[], const char *optstring); ... The getopt() function parses the command-line arguments. …
DinoCoderSaurus's user avatar

1
2 3 4 5
18
15 30 50 per page