Questions tagged [pset8]
The pset8 tag has no usage guidance.
439 questions
0
votes
0
answers
6
views
CS50P - Seasons of Love output issues
I am unable to fix this error while running the program, kindly find the error S
0
votes
0
answers
18
views
HTTP-Server stopped working
When I run HTTP-Server from codespaces, my browser (Chrome) gives an error saying "This site can’t provide a secure connection"
However, I can open up my desktop VS Code and run python -m ...
0
votes
1
answer
36
views
How to change the port that http-server uses
I got in contact with my internet provider and they told me TCP port 8080 is not available for security purposes. Am I able to change the port http-server uses?
2
votes
2
answers
906
views
CS50p pset 8, Seasons of Love. All tests passed but exit code is still not 0
My code is functional and passes all of the CS50 tests except for the last one. What could be causing this?
This is my main code:
from datetime import timedelta
import inflect
import sys
def main():
...
1
vote
0
answers
151
views
"GET /" Error (404): "Not found"
I had worked on lab8 for a while but it was not completed. Now that I have gone back, when I run http-server index.html and click on the link I get this error:
[2023-04-07T23:34:58.289Z] "GET /&...
0
votes
0
answers
31
views
My program is exiting unitentionally due to my class or regular expression, why?
For Pset 8 seasons of love, I am struggling to get my code working. I still have to add in the inflect code to put my output into words; however, I am running into the issue that my program is always ...
0
votes
2
answers
2k
views
CS50P - PSet 8 - Seaons of love - seasons.py
I am trying to follow instructions for the exercice Seasons of Love on PSET8. Unfortunately, while running the "check50" command, it seems that I missing one input in order to replace "...
0
votes
0
answers
2k
views
Week 8 - Lab - Trivia
I have completed the lab and my page works, but I had to move my javascript around the page, and I can't work out why.
I tried use the DOMContentLoaded approach, but code within that function wouldn't ...
0
votes
1
answer
155
views
Getting error in pset8 Finance
I get this error in register in pset8/finance when I run check50:
:) application.py exists
:) application starts up
:) register page has all required elements
:( registering user succeeds
expected ...
0
votes
1
answer
4k
views
How to fix if statements within event listeners in Javascript
I'm struggling to spot the error in my javascript code in pset8. Specifically the code doesn't execute as I'd expect when using an if statement within an event listener.
I've tried talking to the duck,...
0
votes
1
answer
1k
views
Lab 8 // Resetting button colors not working properly
I am doing the lab 8 trivia question and I am try to reset all the colors of the buttons when you press another from the rest. I am not sure how to do it. I have the function for resetting the colors ...
0
votes
2
answers
238
views
I cannot get the color of the button to change
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
...
0
votes
1
answer
18
views
Why do my defaultdict get overwritten?
I'm trying to add two lists to a defaultdict, by the following code:
for index, holding in enumerate(holdings):
# Get all relevant numbers
symbol = holding['symbol']
stock = lookup(symbol)
...
0
votes
1
answer
84
views
Pset8 Finance Register HTTP 500 error
I am working on the Finance PSET8 and am having trouble with the Register part of the problem.
This is my application.py code:
@app.route("/register", methods=["GET", "...
0
votes
1
answer
405
views
CS50 finance SELL - Cannot get the code to subtract the stock from the database or index
I have tried a number of versions of this code, except I cannot get it to subtract shares from my ("/") index page it does nothing and shows nothing in the shares column in the transaction ...
0
votes
1
answer
214
views
Pset8 Finance personal touch
I decided to go with trading from index without manually typing the symbol. Also, I decided to simply go to the buy/sell page with the symbol pre-selected by a GET method (without quantities being ...
0
votes
2
answers
379
views
CS50 pset8 finance buy
I have been struggling with the buy portion of the finance assignment for CS50. I have created my new tables and written down the logic concerning buying stocks. When I run flask and try to purchase ...
0
votes
0
answers
206
views
Final Project - Get sql to work html, python and flask
On my website for my final project I am able to enter the user info on the website, but the information is not being inserted into the sql table.
I feel that I am not understanding something very ...
0
votes
1
answer
52
views
PSET8 Web Finance - Index/Portfolio - Why do my for loop variables not pull over to Portfolio.html?
I have the below code for my application:
#valid stock row queries
valid_stocks_rows = db.execute("SELECT symbol, SUM(shares) as sum_total FROM ledger WHERE user_id=:user_id GROUP BY symbol ...
0
votes
0
answers
84
views
Finance - Buy Implementation
I am getting the error message "500 Internal Server Error" when trying to buy shares. Can you please tell me what I am missing? The application.py code is:
@app.route("/buy", ...
0
votes
1
answer
50
views
Week 8 - Finance - Buy - Getting Error Message Missing Shares
I'm trying to get the Buy implementation to work but I keep on getting the error message "Missing Shares" when I log into the cs50 finance site and enter in the symbol and number of shares. ...
0
votes
1
answer
253
views
CS50 Finance Register
I was able to figure out the POST and /register, but I am confused on how to use INSERT a new user into users. Any help would be appreciated. Thank you.
From application.py
@app.route("/...
0
votes
1
answer
196
views
FINANCE: GROUP BY doesn't add up the numbers of shares of the same stock
So in index i'm trying to display a table with all the stocks that the user has bought, one row for each stock, displaying the total number of shares in the user's portfolio along with the total value ...
0
votes
0
answers
51
views
FINANCE: how to commafy numbers in jinja?
I was wondering about how to commafy large digits in jinja so that instead of [$10000 / $100000 / $1000000] these numbers would be displayed as such [$10,000 / $100,000 / $1,000,000]
I've been looking ...
1
vote
1
answer
169
views
pset8 API not functioning
I am struggling with the finance API. I am calling the lookup function as I have seen many others code on these message boards but I keep receiving "none" as the return value from the ...
0
votes
1
answer
398
views
Problem Set 8 / Finance. How to incorporate current price (index)
I'm currently struggling with index(). In buy() I created the custom table with, one might say, too many columns. Among others are symbol, name, shares, price, total.
So far I was able to plug some of ...
0
votes
1
answer
171
views
PSET8 Finance Buy. SQL query not executing
My buy function is crashing at the SQL query where I'm trying to insert data from the transaction into a transactions table. The types of each column are transaction_id(integer, primary key), user_id(...
0
votes
2
answers
225
views
Finance Register Checking for Duplicate Username Not Working
I've looked at lots of other questions with people who have code for register, and my SQL code is exactly the same as most of them, but when I register, it lets multiple people have the same username. ...
0
votes
1
answer
593
views
Showing a picture saved in CS50 IDE in Homepage
I am trying to display a picture on one of my Homepage webpages. I have copied the picture to pset8/homepage subdirectory. If I double click on it, it will open in a new tab in the IDE.
My html code ...
0
votes
1
answer
70
views
how to autofit a webpage to any screen size
I am pursuing web track for pset8. I am using fixed number instead of percentages for size of each element.
How can I make sure that the webpage can fit to all screen / window sizes without getting ...
0
votes
1
answer
59
views
The tools from the android track are'nt working
I cannot seem to figure out why, but the code and autocorrect from the lectures don't work. I might be because I'm using Nougat, and he's using Pie, but I don't really see why that would make much of ...
0
votes
1
answer
1k
views
Dynamically change the row colour of a table in HTML that was generated using jinja
As part of PSET8 finance additional implementations, I want to dynamically colour the table in history.html.
The simple code uses jinja2? to populate and print out a table in html.
{% extends "...
0
votes
1
answer
313
views
PSET8 Finance Buy
For some reason, my buy function will not work. When I try to "buy" a share of stock, it always goes to internal server error. Here is my code:
def buy():
if request.method == "POST&...
0
votes
0
answers
55
views
Finance CS50 Buy Function - Sufficient Cash check not working
I've been stuck on buy function for PSET8 Finance for a long time now. I'm stumbling at the very beginning and can't seem to proceed further. The code error checks for incorrect or no inputs in the ...
0
votes
1
answer
72
views
Password leak in finance
I'm running into an issue on finance. Whenever I register a new account a google alert pops up and tells me that my password has been leaked and that I should change it. Is anyone else running into ...
0
votes
1
answer
172
views
cs50 Finance Runtime error FOREIGN KEY constraint failed
I'm working on pset8 cs50 finance and I'm encountering a runtime error with buy. I've gotten both register and quote to work without issue so I've tried comparing my code to check for incorrect syntax,...
0
votes
1
answer
76
views
How to enter Jinja variables as values in my tags
I am using Jinja and am trying to set the "value" of the option to a variable. I tried this: <option value = {{stock['name']}}>{{stock['name]}}</option>, but it thinks that the {{stock['...
0
votes
1
answer
85
views
PSET 8 Description Struct problems
So I have chosen the iOS path. I have completed every part of the required Pokedex except the dictionary. I am 99% sure that the message I get about failing is because I do not correctly make the ...
0
votes
1
answer
806
views
Problem Set 8 / Web Track - Finance (Redirect Error)
My functions seens to work fine, but when i have that redirect the user to the homepage (redirect("/")) the application crash and show the error message: 500 internal server error and I don't know if ...
0
votes
1
answer
242
views
Problem Set 8 / Web Track - Finance (RuntimeError: UNIQUE constraint failed)
y'all. My register function seems to work just fine when inputting new and different usernames. However, when I tested it for the 403 error (ie the one which checks if there is an already existing ...
0
votes
1
answer
79
views
Pset8 Finance stocks typed in lower case don't appear in portfolio
I noticed a beta-tester was typing in the stock symbols in lower case. This didn't seem to cause a problem for purchasing or selling, and the transactions appeared in the History table. However, they ...
0
votes
1
answer
40
views
Pset8 Finance occasional NoneType error
I had someone beta-test the website today and they ran into an internal server error when trying to return to the index/show portfolio of stocks screen.
The error was this:
File "/home/ubuntu/...
0
votes
0
answers
55
views
Pset8 Finance def buy() throws internal server error
Everything was going fine and I refreshed the page to check my updates when I got an internal server error and the whole page didn't load. I looked in my IDE terminal and it said
File "/home/ubuntu/...
1
vote
1
answer
6k
views
TypeError: a bytes-like object is required, not 'NoneType' in Finance
I finished doing finance and tested it without many errors i would say. Fun fact, i was implementing a change password and it got me this error
TypeError: a bytes-like object is required, not '...
0
votes
0
answers
598
views
FINANCE [UNIQUE constraint failed: users.username] Error encountered using check50
I have finally got my entire program working for PSET8 Finance. I receive no errors in my dev console and all functions are working correctly after registering 15 users.
For some reason, though I get ...
0
votes
1
answer
59
views
Week 8 web track Code replication problem
So I am trying to replicate the code done in Flask lecture video, which still revolves around submitting and inputting a user's name. I think I have done the exact same code as Brian's, but the code ...
0
votes
0
answers
34
views
Pset8 showing code on webpage instead of proper format
I am working on PSet8 and I have this problem now: I can successfully logged in the app, but I landed on the index page that looks like the snapshot below, instead of proper formatting and css style ...
0
votes
0
answers
83
views
Pset 8 finance buy internal server error
I am doing PSet 8's finance and am stuck in the buy section because of an error message produced by this code:
# Store user's cash balance
share_counts = int(request.form.get("shares"))
db.execute("...
0
votes
0
answers
196
views
PSET8 CS50 Finance: /Check fails to run, does not catch or notify of duplicate usernames
I have been struggling with the check function in PSET8 for a few weeks now, and have run into various problems as I tried to work through my issues.
Currently, it seems by check .get function does ...
0
votes
1
answer
85
views
int object not subscriptable in register route
Hello:
while registering int object not subscriptable error coming, even though i truncate [0] from results. Any thoughts