Questions tagged [pset7]

For problem set 7 (CS50 Finance)

Filter by
Sorted by
Tagged with
0
votes
2answers
239 views

pset7 which files to alter to run the pset on a local machine, not on cs50.io: You don't have permission to access

My system: Mac OS 10.11.6 Server version: Apache/2.4.18 (Unix) Server built: Feb 20 2016 20:03:19 Server version: 5.7.13 MySQL Community Server (GPL) PHP Version 5.5.36 I am trying to test the ...
1
vote
1answer
88 views

My implementation of cs50 finance goes wrong with check50

My implementation of CS50 finance has security questions as personal touch on the register page. I believe this is why check50 is failing to detect successful user registration. What do I do in such a ...
0
votes
1answer
369 views

what is the username and passwrod when sending mail via phpmailer?

how do i know what is the password and username for phpmailer for pset7. i am using the off campus smtp server smtp.comcast.net but everytime i try to send an email it gets rejected due to the need ...
0
votes
1answer
20 views

I am not sure what is wrong with my substrings code

def substrings(a, b, n): """Return substrings of length n in both a and b""" # takes in strings input a and b # splits each string into substrings lista = [a[i:j] for i in range(0, (...
0
votes
1answer
460 views

pset7 index fields are empty in page

When I logged into the webpage and bought a stock, the price of the stock was deducted from the cash balance. However, the details of all the other fields are missing as shown in the picture below. I ...
0
votes
1answer
42 views

Survey,clarification on What does methods=[“GET”] and methods=[“POST”] do?

@app.route("/form", methods=["POST"]) the methods=["POST"] what specifically is that doing ? is it just saying any time that /form is posting something the below functions will be triggered/...
0
votes
1answer
63 views

pset7 sell.php reloads itself

My sell.php file renders sell_form.php but when I submit some stock symbol I don't get anything but reload of the same file. I can't figure out why. Can someone help me with this? // Code deleted ...
0
votes
1answer
152 views

pset7 finance key error but there is a key? def index

i have trouble with KeyError although my dict have key here is my def index() http://imageshack.com/a/img922/5265/LsdzWU.png here is my error massage http://imageshack.com/a/img923/6976/...
0
votes
1answer
368 views

PSET7/C$50Finance/buy

I have created two tables in my database named : portfolio and user_data. portfolio has fields as: user_id, Symbol, Name, Shares, Price, Total, Datetime all of them "NOT UNIQUE" so as to let the user ...
0
votes
1answer
198 views

pset7, buy-checking balance

I have the following lines of code to check the balance of the user. $balance = query("SELECT cash FROM users WHERE id = ?", $_SESSION["id"]); $balance = number_format($balance[0]["cash"],2); And ...
0
votes
1answer
431 views

RuntimeError: no such column: shares

My error is above. This is weird because it does exist. http://imgur.com/a/kGXsX That is my portfolio table. This is my command: purchase = db.execute("INSERT INTO portfolio (shares, stock, price) ...
0
votes
2answers
24 views

pset7 movies sql7

I'm doing the pset8 tasks. Currently, I have some issues with sql7. In 7.sql, write a SQL query to list all movies released in 2010 and their ratings, in descending order by rating. For movies with ...
2
votes
1answer
286 views

I receive “Not authorized to access this private project” page when trying to get to CS50 Finance page in pset7

I think something is incorrect with my permissions when I'm trying to set up my pset7 materials per the spec. I've followed the spec exactly. I used username50 and password50 to put my username and ...
0
votes
3answers
30 views

accidentally imported data multiple times (pset7 houses)

I was testing the code out and ended up running "python import.py characters.csv" multiple times. Now when I go into sqlite3 and print out the data it's repeated itself 3 times over, once ...
0
votes
1answer
161 views

PSET 7 Movies 12.sql

can someone explain the difference between using IN and "="? Here is my code. When I use IN it runs perfectly but when I use "=" there is no output. Thank you! SELECT title FROM ...
0
votes
1answer
219 views

Finance - PSET 8 (2019) - Check50 bug -> :( buy handles valid purchase

I'm encountering the following bug with one of check50s test scripts: expected to find "112.00" in page, but it wasn't found Log sending POST request to /login sending POST request to /buy ...
1
vote
1answer
345 views

Pset7 - CS50 Finance - Register - returns the same apology each time

When im testing my code by entering in blank entries in username or password, i expect the site to show me the apologies like "Must provide username" or "Must provide password", but it only shows the ...
0
votes
1answer
19 views

pset 7 houses passes check 50 but shows the names 4 times

I have a really strange problem here: both import and rooster passes every check in check 50, but if I run Rooster the names on every house appear 4 times. I have no clue about why this is happening, ...
0
votes
1answer
25 views

Pset 7 Houses: Import seems to work but check50 doesn´t agree

I am confuse with this one: The program doesn´t return any error when I run it and if I go to the students table the names are there, but check50 says it imports "[]". Am I at least close to ...
0
votes
1answer
89 views

Pset7 Movies Q12: I don't get what's wrong

I can't figure out why my pset7 movies Q12 code isn't working. Can anyone tell me why? Here is my code: SELECT DISTINCT title FROM movies, stars, people WHERE movie_id IN (SELECT movie_id FROM stars ...
0
votes
1answer
65 views

pset7 Q7: How many actors are named “Meryl”?

I am at a complete loss for something that should be very simple to find in SQLite. In the IMDB database, I have to find how many actors have the name 'Meryl', I have tried select name, count(name) ...
0
votes
2answers
707 views

pset7 - Houses problem with check50

I'm running into some issue with check50. I know it's been ask before but the answer of some other topic do not apply to me. I re-do both files but still getting the same output. This is my output ...
0
votes
1answer
101 views

CHECK50 Bug in pset7: movies SQL

I have been banging my head on this for an hour and half. Finally finished the pset, uploaded it. Check 50 says: Now, both cs50 ide and DB browser return the correct results, and number of lines for ...
3
votes
1answer
2k views

can't get the site to run

i'm almost done with the pset7 and this happend , something has gone wrong and cant figure it out . first i couldn't get the apache50 to start then i found this on web "echo > ~/lib/apache2/log/error....
0
votes
1answer
24 views

In students its printing all the data correctly but when I try to insert it into db its showing this funny error

File "import.py", line 58, in db.execute("INSERT INTO students (first, middle, last, house, birth) VALUES (name[0], NULL, name[1],house, birth)") File "/usr/local/lib/python3....
1
vote
0answers
28 views

Students only passing 4/6 the last two showing concatnation error but works locally somebody help

[33mTraceback (most recent call last):[0m [33mFile "roster.py", line 34, in main()[0m [33mFile "roster.py", line 27, in main print(row[0] + " " + row[1]+" "+ ...
1
vote
1answer
239 views

pset 7 survey: trying to redirect to /sheet returns invalid syntax error

For part of CS50's survey problem from pset7, I'm supposed to redirect from a route that checks if the user has entered in all the survey's fields / appends the values to a csv file --> a route that ...
0
votes
1answer
2k views

Pset7 Houses Issue

I thought I had this one figured out, but check50 disagrees. The specification suggests that the output needs to be formatted as "Harry James Potter, born 1980 or Luna Lovegood, born 1981." To ...
0
votes
1answer
27 views

pset7 6.sql rounding problem

My code works fine but check50 give me an error because it´s not rounded the same way. :( 6.sql produces correct result expected "7.74", not "7.75" SELECT ROUND(AVG(rating), 2) ...
0
votes
0answers
13 views

Poor JOIN performance?

From my limited understanding, JOIN operations are supposed to generally be faster than nested subqueries. However, when solving the various Movies SQL problems, I'm finding queries with JOINs (...
0
votes
1answer
35 views

I am working through roster.py, but the first line in the solution is not printing in my output. why is this happening?

import cs50 import sys import sqlite3 db = sqlite3.connect("students.db") house_reader = db.cursor() if len(sys.argv) != 2: print('Usage: import.py file.csv') exit() house_reader.execute("...
0
votes
1answer
144 views

pset7 survey - for loop to give alerts not working properly, why not?

I can't figure out what's wrong with my for loop, written in Javascript. It isn't functioning as needed. 1- It only sometimes gives the javascript alert message saying "Please make sure you have ...
0
votes
2answers
30 views

How does flask work

I typed: flask run and flask runs ok, but I cannot 'serve' form.html, why is this and how can I see form.html in a browser?
0
votes
1answer
62 views

confusion about CSVs and Jinja in pset7--generating a table

I'm deeply confused about how CSV files work in this context. Below is my application.py code and my form.html code; I can't see how to use Jinja to call on the information stored in my CSV file. In ...
0
votes
2answers
42 views

How can I check my number of rows on pset7 movies?

I wanted to check my queries one by one as I am doing them, my 1.sql works fine but how I find out how many rows I am getting?
0
votes
1answer
79 views

unindent error on the template given

I have been stuck on pset7 finance due to an error called 'unexpected unident'. It is giving me an error on the @app.route("/history) portion, the arrow is specifically pointing to the @ symbol. I ...
0
votes
1answer
22 views

How to disable a button after it was clicked ? finance-pset7

I would like to add a button (Give me $12.000) to my index.html. The purpose is that a user can only once receive additional cash = 12000 by clicking that button. After a click, I do not want to ...
0
votes
1answer
74 views

PSET7 sell selling the wrong number

On sell,if i try a number more than one, it sells the wrong number sometimes. I had 5, and sold 3, and now I have -28. I'm not sure why it does this, any help would be appreciated! if request.method =...
0
votes
1answer
114 views

Hi, In pset7 finance I still have this error I feel i'll be stuck here forever, help me please

@app.route("/register", methods=["GET", "POST"]) def register(): """Register user""" # Forget any user_id session.clear() # User reached route via POST (as by submitting a form via POST) if ...
0
votes
1answer
22 views

7.sql CASE error

I'm getting an error where it says Error: near line 3: near "DESC": syntax error My code is SELECT title, rating FROM movies JOIN ratings ON movies.id = ratings.movie_id WHERE year = 2010 ...
0
votes
1answer
96 views

PSET 7 similarities substrings function seems ok but dont pass test

I make a substrings function, it seems to work for me, but i cant pass check. :( handles one substring in common Expected 1 matches, not 0 :( handles multiple substrings in common Expected 4 ...
0
votes
1answer
28 views

PSET7 7.sql Error

The code gives the right amount of rows but is not passing the check50 SELECT movies.title, ratings.rating FROM movies JOIN ratings ON ratings.movie_id = movies.id WHERE year = 2010 ORDER BY title ASC
0
votes
1answer
42 views

pset7 finance where to write buy

I'm having trouble on buy because I'm not sure where to write the html, it doesn't specify where to write the inputs for but and I'm confused about where to write that, do I make a buy.html? I have ...
1
vote
1answer
63 views

style50 not updating

I recently submitted the pset7/finance in cs50. I checked for style in style50 and it returned looks good! which is an indication that it is correct. But when I submitted to using submit50 I ended ...
0
votes
1answer
80 views

javascript not running in pset7 survey

I finished form in html. I wrote script below form in script in body. It is not having any syntax errors (hopefully). entire script is a single function called validate() which returns true or false ...
0
votes
1answer
101 views

I'm making a route “/Account” to allow user to change password. I'm a bit confused about GET and POST requests

I thought I sort of understood GET and POST requests in that: GET request means the user only retrieves data from the server; cannot change anything like the database POST request means the user can ...
0
votes
2answers
46 views

On duplicate key update doesn't work correctly

I'm trying to figure out how to, On a duplicate key, add the amount of shares from the form, to the existing amount of shares. This is proving to be very tricky for me, I described a variable called ...
0
votes
1answer
37 views

I can't find where my variable names are mixed up

I'm stuck on pset7 and I have been for a while. I'm working on index and I'm pretty sure some of my variable names got mixed up, or I used the wrong names or something like that. I just can't figure ...
0
votes
1answer
51 views

Fatal error: in /home/ubuntu/workspace/pset7/vendor/library50-php-5/CS50/CS50.php on line 313

Fatal error: SQLSTATE[HY000] [1045] Access denied for user 'antoniy274'@'localhost' (using password: YES) in /home/ubuntu/workspace/pset7/vendor/library50-php-5/CS50/CS50.php on line 313 line 313 on ...
0
votes
1answer
437 views

Problem retrieving index variables in finance

The table is not able to access different variables to display in the table. Here is the index function def index(): """Show portfolio of stocks""" """Selecting shares that have been purchased ...

1
2 3 4 5
15