23
votes
Accepted
can't get the site to run
CS50 course materials will tell you that the permissions need to be set as follows:
chmod 711 for directories
chmod 644 for images, HTML, CSS, JavaScript
chmod 600 for PHP files.
In general, this is ...
15
votes
Pset7 - Forbidden 403. I can't even get started
I found that deleted post over on reddit with an answer from delipity. But the user continued to have problems. I unzipped a fresh pset7, and did these chmods and finally got RockRolld! (oops. Spoiler ...
13
votes
Pset7 - Forbidden 403. I can't even get started
This is the same solution as posted in Reddit, simply with clean code ready for copy/paste to terminal. Please note that you have to start in "workspace" directory.
chmod 711 pset7
cd pset7
...
13
votes
Accepted
pset7 finance check50 ':( buy handles valid purchase'
There is nothing in the spec saying to output the purchase price to the user.
That is because such a page is not required.
check50 is parsing your index.html page after it makes one purchase, so it ...
10
votes
Ubuntu password required when starting apache 50 - pset7
Apologies for the inconvenience! Should be fixed ASAP! But until it's fixed, yet another solution to this is to execute:
$ echo "#includedir /etc/sudoers.d" | sudo tee -a /etc/sudoers
in a terminal ...
8
votes
Accepted
Pset7: Forbidden 403
Due to a recent update the permissions required has changed, but the specifications has not been updated. All PHP files and config.json must now be set to chmod 644, whilst all directories must be set ...
8
votes
PSET7 Movies Q9: Why is my number of rows generated different from what the assignment requires?
I had the same problem. In the end I've solved it by getting rid of DISTINCT and using both ORDER BY and GROUP BY.
Hope that helps!
7
votes
Accepted
pset7 movies Q12
It doesn't select any rows because there is no people record with both those names.
The immediate suggestion would be to use OR instead of AND.
Another option would be to use an alias of the people ...
6
votes
Ubuntu password required when starting apache 50 - pset7
UPDATE 24-Dec-2016: As of IDE version 94, this has been fixed.
Suspect some cloud9 change. For the "more comfortable", a patch is needed in apache50 script. You need elevated permissions. (I used ...
6
votes
Accepted
pwd_context.encrypt Depreciation Warning Pset7
Use hash instead of encrypt in your register function. I tried it, it worked for me. I was able to sign on as an existing user, or register (and sign on as) a new user. I am not advocating blindly ...
6
votes
Accepted
pset7- finance register invalid syntax error
When an obviously correct line gives a syntax error, look to the preceding line. Are there enough ')' on the db.execute?
6
votes
pset7 fractions being rejected causing Buy to fail
SOLVED. I added the following:
try:
shares = int(request.form.get("shares"))
except ValueError:
return apology("shares must be a posative integer", 400)
I was under the impression that, ...
6
votes
Accepted
PSET7 Movies Q9: Why is my number of rows generated different from what the assignment requires?
Your DISTINCT would make the result records appear only once. But that means the name, and multiple stars might share a name. In other SQL dialects you could use DISTINCT ON (col1, col2) with an "ON" ...
5
votes
Problem with query quotes from Yahoo finance
Thank Brenda Anderson from Facebook group CS50 for providing a new code for helpers.py
5
votes
pset7 movies Q12
I've found GROUP BY to be very useful:
WHERE name = 'Johnny Depp' OR name = 'Helena Bonham Carter'
GROUP BY title
HAVING COUNT(*) > 1;
5
votes
Accepted
PSET7 Movies Q8 - Why these queries return different results?
It's because in your first query you said where id = (.... this query here is expecting only 1 value so in the query inside the parentheses the first value it gets is the only value that is checked. ...
4
votes
pset7 error 403, forbidden, (even after going over the instructions over and over)
Permissions have changed due to a recent update, but the problem specification has not been edited to reflect this.
PHP files and config.json now need to be set chmod 640, even though the problem ...
4
votes
How can one use git to source-control for pset7?
If you want to run your own git server on cloud9, I have to warn you that it's a very long process and very easy to screw up. If you still want want to set up your own server, take a look at this from ...
4
votes
Accepted
PSET7: web server permissions problem
403 Forbidden / permissions / chmod: the Definitive Guide
TL;DR:
PHP files and config.json need to be set to chmod 640 despite what it says in the Problem Specification.
Hope this helps!
4
votes
Accepted
Ubuntu password required when starting apache 50 - pset7
The root cause is a Cloud9 change, github bug to track here: https://github.com/cs50/ide50/issues/27
DinoCoderSaurus's workaround should work until they update the cs50 ide.
Also: you should learn ...
4
votes
Accepted
cs50 finance / pset-7 confused on index() table
Since "stocks" are in one list and "currentprices" are in another list you will get this result when you use two lists and two loops.
One solution would be to use one loop and use currentprices[i] ...
4
votes
Accepted
Using jinja to render template based on previous url - pset7 finance
Inside the function for the respective routes you can just call the function "flash(message)" before the "return redirect()" function, where "message" is the message you want to display. for example:
...
4
votes
Accepted
How to factor out similarities in history and portfolio tables?
All very good questions. You're thinking about what redundancies can be eliminated. But then, you need to think further. What's more important, conserving storage or making queries more efficient?
...
4
votes
Accepted
finance 500 internal server error on registration
The last line in the log about errorhandler is a red herring. More on that later; will edit after proper research.
The important line in the log is where it says something about bind parameters (if ...
4
votes
Accepted
pset7 movies sql7
I also completed pset7 recently. You can easily make this query by joining the two tables using the JOIN and ON keywords and with the id as the primary key. The code should be as follows.
SELECT title,...
3
votes
Accepted
pset7 register.php and register_form.php how do they work with render() and extract()
1) Take a look at this line of code from register.php: render("register_form.php", ["title" => "Register"]);.
This is in the public folder, and it is calling render() on a file that lives within ...
3
votes
Accepted
pset7 index, portfolio table problem
After looking at the original question and the edited version, I think I see a couple of issues, but there's still missing information. First, I'm assuming that in the edited question, the table ...
3
votes
Accepted
I need help setting up pset7
The navigation/menu bar changed with the recent update to CS50 IDE. You can find your username and password by typing at the command line username50 and password50, respectively.
Also, consult this ...
3
votes
phpMyAdmin: "mysql extension missing" error
We all know that phpMyAdmin can be flaky sometimes. Unfortunately, I can't tell you how to fix it -- but I can tell you how to use mysql50 shell from the command line. Try stuff like this:
mysql50 ...
3
votes
Accepted
PSET7-quote.php Not doing displaying quote
You definitely don't need to do this:
redirect("/../views/quote_template.php");
... after you have used the render() function.
EDIT:
For quote.php, you should be doing something like this (in ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pset7 × 743finance × 198
buy × 65
sql × 56
python × 55
sell × 53
index × 38
php × 37
register × 35
cs50x × 33
quote × 29
html × 28
portfolio × 26
flask × 25
mysql × 21
houses × 20
jinja × 18
sqlite × 16
check50 × 15
index.html × 15
phpmyadmin × 15
movies × 14
error × 13
cs50x2017 × 13
query × 13