Questions tagged [pset7]

For problem set 7 (CS50 Finance)

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

Querying portfolio for index route PSET7/C$50 Finance/index

I have created a table named "portfolio" in my database which stores users purchase data while I kept the user_id field of this table NOT UNIQUE ie no primary key so as to let the user buy more same ...
0
votes
1answer
284 views

pset7 - Buy doesn't return correct value

I've ran into an issue while running Check50 on what I thought was my functioning solution for pset7, namely it doesn't find the correct value in the index after trying to run the buy function. This ...
0
votes
1answer
357 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
1answer
143 views

Registration Form

When I load the registration form, two of the fields contain data. username Paul password *** What have I done for this situation to arise. How do I prevent it from occurring ...
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",...
0
votes
1answer
214 views

Pset7, I cannot display result of quote

Pset7, I cannot display result of quote. Am I misunderstanding concept of render function? Quote form is displayed, just not result... Could anyone gives me any advises, please? quote: if ($_SERVER["...
0
votes
2answers
695 views

pset7 , history table not inserting

The history table only inserts sell transaction and i don't know why because both insertions are identical both use query("INSERT INTO history (id, transaction, symbol, shares, price) VALUES (?, ?, ...
2
votes
1answer
157 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 ...
0
votes
2answers
280 views

history.php doesn't work

I am implementing history.php as a controller and history.php as a template to display user's history. but it doesn't display anything. I made sure that history.php(controller) is readable -rw-r--r-- ...
0
votes
1answer
241 views

Pset7 sell - list out of range

So I am having trouble implementing the if function to test whether the number of shares the user is requesting to sell is less than the number of shares they have for that stock. Here's what I have ...
1
vote
1answer
412 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]'
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
464 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
43 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
437 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
27 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
35 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
163 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
220 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
348 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
28 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
30 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
73 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
715 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
102 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
28 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
30 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
15 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
36 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
46 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
75 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 ...

1
2 3 4 5
15