Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
1answer
3k views

cs50 finance / pset-7 confused on index() table

I am trying to work on pset7, but am having a problem printing it out to the screen in the table format. I have all the values I need (the values I have are correct), but just can't figure out how to ...
5
votes
3answers
3k views

CS50 Finance/pset8 2019 /check

I am trying to write the script for a form such that if a username is taken, the user is alerted that it is taken, and submission of the form is blocked. If the username then types in the correct ...
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....
3
votes
0answers
956 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
3answers
818 views

Problem with query quotes from Yahoo finance

Does anyone recently have problem with this url "http://download.finance.yahoo.com/d/quotes.csv?f=snl1&s={}" in helpers.py of pset7? Before yesterday, the lookup() in helpers.py worked fine but ...
2
votes
2answers
543 views

Using jinja to render template based on previous url - pset7 finance

For the finance website homepage, I want to render index.html differently based on the previous url. For example, if I logged in I want to render a panel saying 'logged in', but if I registered I want ...
2
votes
1answer
144 views

Does CS50 Finance follow MVC design?

To the experts, is it designed by following the MVC approach or is it just procedural programming that separates logic and views?
2
votes
2answers
1k views

pset8 2019 - jinja_env.filters error

I have just downloaded the code for pset8 and the line 26 app.jinja_env.filters["usd"] = usd shows an error. The code hasn't been modified yet and when I run the flask run command I get this error: ...
2
votes
1answer
329 views

CS50 Finance: Register unique username (/check) problem: pythion GET function not working

I am working on the new /check additional on the Finance problem. I am trying to prevent the register form from being submitted when the username is already taken, is empty, or is just one character. ...
2
votes
1answer
1k views

should I create a table for every user on buy, cs50 finance

here is my pseudocode for the buy method: if the request method is post: remember symbol if provided, if not return apology check if symbol is valid via lookup() remember shares if it exists and ...
2
votes
1answer
73 views

Pset7 How to Program Popup?

I'm trying to create a popup after a user successfully sells a stock. I want it to look like Chrome's confirm form resubmission popup I'm pretty sure I need javascript, html, and css, but I'm not ...
2
votes
1answer
285 views

Not able to access staffs solution for PSET7 CS50 finance. Non connection to YAHOO at line 74

while accessing the staffs solutions, I get this error : Fatal error: Could not connect to Yahoo! in /home/cs50/vhosts/finance.cs50.net/includes/functions.php on line 74. I have already tried from 3 ...
2
votes
1answer
212 views

CS50 2019 PSET8 updating API from 2017 API

I have a lot of work from finance 2017, but it seems to use a different API than what I used last year. How do I update my code to use this new API? Or can I just use the one from last year? (I don't ...
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
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
1answer
2k views

pset7 finance check50 ':( buy handles valid purchase'

reading the specification of 'buy' for pset7, which says the following: buy Complete the implementation of buy in such a way that it enables a user to buy stocks. Require that a user input a stock’s ...
1
vote
1answer
1k views

pwd_context.encrypt Depreciation Warning Pset7

I've noticed an error that pops up whenever I try to register a new user in cs50 finance. I've first noticed this today - I've never this problem before, and I've used the registration many times. ...
1
vote
1answer
638 views

finance 500 internal server error on registration

I've hit a snag when trying to implement register in pset7. Every time I enter a new username, password, and password confirmation, I'm getting a 500 server error. I don't know how to read the log to ...
1
vote
1answer
308 views

Pset7 Can't Print How Much Cash a User has? [closed]

Earlier today, I was trying to print out how much cash a user has for portfolio.php. I kept on getting a bunch of errors. I changed my code many times, but could never get rid of the errors I was ...
1
vote
1answer
412 views

Pset7 - :( quote handles valid ticker symbol

Check50 showed me expected to find "28.00" in page, but it wasn't found. I don't know where is my mistake. Can anyone help me out? Any help will be greatly appreciated. Here is my quote(): @app....
1
vote
1answer
677 views

Pset7 How do I log a user in after they register?

I'm trying to make users be automatically logged in when they register, so they don't have to log in after they register, which is happening with my code right now. Here is my code, starting from ...
1
vote
1answer
413 views

Server Error when trying to load CS50 Finance for first time

I followed all the steps in the intro of the pset7 spec (up until the xkcd sandwich joke) but cs50 finance loads a blank page in appliance's Chrome browser when I enter the pset7 URL. The element ...
1
vote
1answer
740 views

Extra feature to send receipts - PHP Mailer not connecting

I'm trying to add the feature to send "receipts" after buying and selling stocks. It seems to be very straightforward, I'm just using the code that David used in froshims, but I get the following ...
1
vote
1answer
75 views

line 541, in sell user_id = current_id coming back as an error, Why? Is it caused by global variables? Thanks

I know my variable names suck. sell application.py @app.route("/sell", methods=["GET", "POST"]) @login_required def sell(): """Sell shares of stock""" current_id = session["user_id_2"] ...
1
vote
1answer
333 views

pset8 finance “/check”: Dont understand how the JS code works

I am currently working on the implementation of "/check" in pset8. I tried to implement it by reading trough the documentation of "event.preventDefaul()", "$.get()" and etc. functions. That is what I ...
1
vote
1answer
622 views

pset7 finance check50 doesn't detect a valid sale despite portfolio updating correctly

I'm puzzled why check50 shows me this error despite my portfolio and SQLite database correctly reflecting the sold shares :( sell handles valid sale expected to find "56.00" in page, but it ...
1
vote
1answer
405 views

CS50 PSET7 Finance: in SELL; expected to find select field with name “symbol”, but none found

My CS50 finance app passes all check50 tests except just one in the SELL component. I just can't find the error and need thoughts/ideas / tried a lot ( read: a-lot). My code was created in 2017 and ...
1
vote
1answer
577 views

pset7 fractions being rejected causing Buy to fail

Everything seems to be working fine on my end, however I am running into a single error for buy when running check50. :( buy handles fractional, negative, and non-numeric shares. expected status code ...
1
vote
3answers
371 views

Problem loading phpMyAdmin

After working on pset7 for about a month now. I have reached a position where I thought that I was making some progress. However, it wasn't to be. When I logged on to my IDE and tried to load ...
1
vote
5answers
666 views

Cannot get started on pset7

I'm having problems with getting started with pset7. firstly, after following the instructions carefully and downloading the files for pset7. I tried accessing the CS50 Finance page within my IDE but ...
1
vote
1answer
173 views

How to determine how much cash a user has in C$50 Finance's portfolio.php

I've read portfolio's specifications. However, I have a doubt regarding how to update a given users's balance. Suppose a user with an id '1' buys a stock whose symbol is 'A' for a price '$B'. Now ...
1
vote
1answer
29 views

INDEX only pulling row of data from database

For the life of me I cannot get my index page to properly display the data from my database. I have tried multiple methods and research on several sites. I'm thinking it is something right in front of ...
1
vote
1answer
1k views

Pset8 Finance Check error

I consistently get this error when running check50 on pset8 Finance problem from CS50 when I assume it tries to add a new user that isn't in the user database. However when I enter a new user myself, ...
1
vote
1answer
36 views

Pset7 finance Submission not working?

I recently uploaded my cs50 finance with my own personal touch. I noticed that I am getting 0 out of 5 correctness I double checked the site and it is working perfectly, I can get stock/buy/sell etc. ...
1
vote
1answer
95 views

Portfolio not updating in SQLite, Problem Set 7, Buy

I've been having an issue in PSET7 buy where I am prompted with an error whenever I attempt to update my portfolio. Cash is deducted from the users total, but there is no new table containing the ...
1
vote
1answer
395 views

expected 400 but got 200 OK?

I have implemented Pset-7 (Finance) but check50 shows an error called expected 400 but got 200 in all my apology pages and it is being rejected by check50. Since it successfuly landed to apology page, ...
1
vote
1answer
63 views

Helper in finance seems to be missing name

I am currently working on the C$50 Finance problem. The assignment asks to return the stock's name, price and symbol but in the return dict from the helper the name seems missing.. (whereas the ...
1
vote
1answer
46 views

How to disable a table (portfolio) in index.html?

If there are no records in my portfolio, I do not want to show the table in index.html So, I tried as a parameter to pass a variable empty with value to index.html, where it was checked {% if {{ ...
1
vote
1answer
73 views

Why do I get a wrong html file after executing a quote function? pset finance

I am implementing a quote function in application.py. But the result is ridiculous. After I enter a symbol to search for, I get an apology.html(saying Missing Username!), but this apology.html with ...
1
vote
1answer
158 views

application.py explain login?

I'm a little confused about something. login() @app.route("/login", methods=["GET", "POST"]) def login(): """Log user in.""" # forget any user_id session.clear() # if user reached ...
1
vote
1answer
184 views

New users not being entered into database

I'm trying to code the register function for 2017 pset7. The proper screen comes up, and the program behaves correctly for missing username, missing password, incorrectly repeated passwords, and ...
1
vote
2answers
253 views

cs50 pset7 finance addcash function

I am implementing addcash function to finance and I have one issue with checking if input value is an integer value, the problem is whenever I input non-integer value for testing purposes my page ...
1
vote
1answer
98 views

Can't get to cs50 finance login page?

When I follow the instructions in pset7 and i enter https://ide50-username.cs50.io/ where username is my username i dont get to cs50 finace login page, but instead I get to a page that tells me the ...
1
vote
1answer
92 views

Duplicate entry Error when inserting into portfolios pset7

I am having an issue when inserting a symbol more than once into the portfolio table. I followed pset7 directions making both user_id and symbol as unique: A neat way to impose this restriction ...
1
vote
1answer
82 views

Explain the syntax for function render in PSET 7

I don't completely understand this line of render. function render($view, $values = []) I know it passes two arguments, the second is an empty array that you can fill I think? I used this in 'Quote'...
1
vote
1answer
61 views

C$50 Finance Pset7 - Buy.php not INSERTing shares correctly

My code for Buy.php. For some reason whenever I fill out both fields of shares and symbol correctly I get the apologize error that the data wasn't inserted into the table correctly. (I don't think I ...
1
vote
1answer
31 views

General PSET7 question

I am trying to fully understand what is happening with pset7 and I had some general questions. How does login_form.php (in views) know where (or send the information to) login.php is (under /public/...
1
vote
1answer
27 views

Confused about Pset7 Distro Code

Currently working through pset7 (Finance) and can't seem to wrap my head around how this piece of code works: $positions = []; //iterate through rows foreach ($rows as $row) { $stock = lookup($...
1
vote
2answers
363 views

Pset7 Finance: register.php gives me an error

Haven't started my implementation of register but I followed the spec up to creating register.php and copying the contents on the specs over. When I navigate to register.php I get this error: Is this ...
1
vote
1answer
237 views

Debugging in Problem Set 7: CS50 Finance

I am in the process of completing Problem Set 7 and I would like to know if there is a better way to debug than using print statements.

1
2 3 4 5
9