Questions tagged [pset7]

For problem set 7 (CS50 Finance)

179 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
957 views

How to call the usd function in the jinja template of quoted.html?

I want to display the cost of the share in Quote tab using the "usd" function defined in helpers.py. I've tried adding app.jinja_env.globals.update(usd=usd)in application.py and then calling the ...
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 ...
2
votes
2answers
92 views

Difficulty submitting PSET7 to be graded

My pset7 zip file is about 700kb, i click in "Add files..." button and select pset7.zip, next i click the "Start upload" button, the uploader appears to fill pretty fast as normal but it doesn't ...
2
votes
1answer
156 views

pset7 finance unable to submit

My zipped pset7 folder is about 6oo KB and is taking hours to upload. I eventually abort because it seams to go on forever. In contrast other psets upload in a matter of seconds. Any help is greatly ...
1
vote
0answers
27 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
723 views

roster.py not getting output

import sys import cs50 # checking argv (that there's one and it's a csv) if (len(sys.argv) != 2): sys.exit("Usage: roster.py house_name") housename = sys.argv[1] #print(house_name) #open(f"...
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 ...
1
vote
1answer
92 views

Pset7 Finance Unable to Buy Multiple Shares

I am able to make 1 purchase which appears on my index page, however if I try buy any further stocks my cash goes down but the stocks are not shown and aren't inserted into my portfolio. Here is my ...
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 ...
1
vote
1answer
62 views

Pset7 Yahoo finance broken

I've been working on this problem for a long time. I've asked people about my code and they say everything looks fine with it, and I've been told the yahoo finance has been taken down. I can't do this ...
1
vote
0answers
198 views

PSET7 check50 error code 400 logging in registered user

Running into issue with PSET7 check 50.It frowns at me and says :( logging in as registered user succceeds expected status code 200, but got 400 Log sending POST request to /login checking that ...
1
vote
1answer
269 views

issues with buy - functionality works but fails check50

Can't figure this out. My code passes functionality it buys stocks no problem but fails check50 with this error: :( buy handles valid purchase application raised an exception (see log for details) ...
1
vote
0answers
77 views

Python PSET7 /Buy

Can't figure this out. My code passes functionality it buys stocks no problem but fails check50 with this error :( buy handles valid purchase application raised an exception (see log for details) ...
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 ...
1
vote
2answers
163 views

Pset7 => “NoneType” error on SELECT query (2017)

I’m really stuck on the index part of PSET7…. Flask keeps iterating over the following SELECT query: dab = db.execute("SELECT SUM(share) FROM portfolio WHERE symbol = :symbol AND user_id = :user_id",...
1
vote
0answers
98 views

Pset7 - Quote always returning apology

So, I'm struggling with pset7 a lot (mostly because I've never programmed before either =/) now I'm on quote and it's always rendering an apology after I fill in the form. I can't quite figure out ...
1
vote
1answer
875 views

AlphaVantage API Error “Please consider optimizing your API call frequency”

On C$50 Finance, when I refresh my web server too many times, AlphaVantage stops returning stock quotes. As a result, Flask returns "TypeError: 'NoneType' object is not subscriptable" when my code ...
1
vote
0answers
80 views

CS50 Pset7 Finance login TypeError: invalid method ''

I got some sort of error when i tried to login with an account that has been registered in my database. I have only done the register function. I can register and automatically login to the website ...
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 ...
1
vote
0answers
52 views

CS50 Final Project: Unique URL for each user of my flask app (2 of 2)

I have a pending question here: CS50 Final Project: Unique URL for each user of my flask app (posted two days ago) regarding the implementation of unique URLs. This unanswered question was in fact ...
1
vote
1answer
411 views

Pset7: from cs50 import SQL - 'No name SQL in module CS50'

Getting the above error at the head of my pset7 programme in the cs50 ide. Any advice? I've tried updating cs50 a couple times. edit: Also CS50 IDE is displaying an error: 'Error: [object Object]'
1
vote
2answers
576 views

Password for phpLiteAdmin

I am requested to enter a password for phpLiteAdmin. I was following steps from the lecture, intro to phpliteadmin. After I inserted a new row ("name", "dorm") into the table registrants, I got this ...
1
vote
1answer
3k views

flask.cli.NoAppException Error when trying to launch web server in pset 7

I'm trying to finish up pset7 and was trying to launch the web server to view the result but every time that I do I get the above error. I'm not really sure what I'm doing wrong. I ran flask in the /...
1
vote
1answer
163 views

unable to start apache

while doing pset7 first phpMyAdmin wasn't working, so I searched online and ran a few commands on the terminal and now even apache is not working and shows the following error: Starting web server ...
1
vote
1answer
42 views

Question about php mailer

suppose I have an email address username@gmail.com can I use this email address to send mails through the php mailer code where in the TODOs the password is the password of username@gmail.com and ...
1
vote
1answer
125 views

PSET7 - Using OOP in CS50 library

I´m really curious about the CS50 library (cs50.php). I noticed that the staff implemented OOP there (object oriented php) but not in helpers.php. I just wonder why? Does anybody know?
1
vote
1answer
204 views

accessing pset7 from outside the appliance

I was just wondering if there was anyway to access the cs50finance webpage from outside the appliance, using a browser for example. I was hoping to get some friends who don't live in the same city, (...
1
vote
0answers
285 views

error: token mismatch for pset7

For pset7, I followed steps to do assignment, just till below Zamyla's first video. When I finished the register.php and open http://pset7/register.php to see the result and open phpMyAdmin Browse tab ...
1
vote
0answers
88 views

PHPMailer library not found

I am trying to implement the phpmailer and I am stuck at the first step calling the PHPMailer library. I have tried multiple path variations, but can't figure out where the library is located, e.g.: ...
1
vote
0answers
304 views

Update Cash in “sell.php” is Not Working

Everything is working file but the cash is not updating. I think its due to typecasting. The value for shares is an integer and price is a float-point integer but I'm confused as to how to cast them. ...
1
vote
1answer
356 views

CS50 Finance not showing up

I'm starting CS50 Finance and I've reached a small hitch. When I try to load the page "pset7"/localhost (After doing all the first steps listed in the spec), I don't get the CS50 Finance logo, but ...
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
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
1answer
21 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
0answers
26 views

“Error when executing query: too many statements at once” pset 7 movies

Hi! I wanted to know what this error message meant because all my sql statements give the correct output but submit50 shows that i've only got a 2/14 , "Error when executing query: too many ...
0
votes
1answer
58 views

Pset7 houses - why does my output prints thrice instead of once?

The code is as follows: for row in students_list: first, middle, last, birth = row["first"], row["middle"], row["last"], row["birth"] print(f"{...
0
votes
0answers
28 views

Not able to sort the fetched values of chadwick boseman movies

SELECT title FROM movies WHERE movies.id IN ( SELECT ratings.movie_id FROM ratings WHERE ratings.movie_id IN ( SELECT stars.movie_id FROM stars where stars.person_id = ( SELECT people.id FROM ...
0
votes
1answer
160 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
0answers
97 views

pset7/houses: db.execute(“INSERT”) fails to export data to students.db

I am using pandas to read in the csv file, since I'm familiar with dataframes from R. But I think that may not be the issue here, which is that db.execute fails to export data to students.db. The code,...
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
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 ...
0
votes
1answer
63 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
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
0answers
41 views

Pset7 buy route error due to API use by lookup function

I am experiencing an error each time I call the lookup function within the buy route when the request method equals post. However, calling lookup during quote does not result in the same error. I ...
0
votes
0answers
89 views

Problem with check50 in pset7 houses

I am getting the correct result when I am executing from the terminal but when I am submitting than it is behaving strangely. MY CODE
0
votes
1answer
347 views

pset7/movies/13.sql: exclude Kevin Bacon from the resulting list

In pset7/movies, I want to dynamically exclude Kevin Bacon from the resulting list (e.g. not specifically mentioning his name with NOT or EXCEPT or copying and pasting code that calculates his ID, so ...
0
votes
0answers
159 views

SQL error pset7 houses

with open(argv[1],"r") as inp: reader = csv.DictReader(inp) for row in reader: lis = row["name"].split() print(len(lis)) if (len(lis) == 2): print(row["...
0
votes
1answer
85 views

Not too sure what I did wrong

My program runs fine with the give parameters and outputs what is needed. Students.db also contains the right values. Even after reading a thread similar to this, I still don't know what I did wrong. ...
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
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 ...