Questions tagged [pset7]

For problem set 7 (CS50 Finance)

Filter by
Sorted by
Tagged with
0
votes
1answer
84 views

PSET7 using jinja and binding variables to output in to HTML

I'm looking to output my db row info though am getting nothing but a blank page instead. Here is my python code which works: @app.route("/") @login_required def index(): """Show portfolio of stocks""...
0
votes
1answer
182 views

Pset7 - buy updates shares in portfolio but not cash in users

My portfolio table tracks correctly the number of shares bought, however I encounter issues when I also try to update the cash that's left after this "purchase" in the users table. I have defined the ...
0
votes
1answer
401 views

pset7 finance check50 invalid purchase

I have seen a couple of questions on this problem, but the answers for them do not work for me. I am having the check50 problem on pset7 with check50 not finding 112.00. One answer was to use usd in ...
1
vote
1answer
446 views

Issue with Check50 PSET7 buy.html :( buy handles valid purchase

:( buy handles valid purchase application raised an exception (see log for details) Log sending POST request to /login sending POST request to /buy exception raised in application: TypeError: '...
0
votes
1answer
162 views

Keep Getting “Invalid Username/Password” error

I can utilize most of the pages I have created when I register as a new user. However, when I try to log in as a user that I know is in the database I get apology returned. I'm not sure why I keep ...
0
votes
1answer
281 views

PSET7 - Register returns 'RuntimeError: no such table…'

I've implemented everything and register worked fine at first but now I'm getting stuck with a RuntimeError: no such table: Porfolio [SQL: 'SELECT * FROM Porfolio WHERE id = 1']. Any help in how to ...
0
votes
1answer
725 views

pset7 finance ':( sell handles valid sale'

if someone would please help me, I've been struggling with this for hours. I am receiving this failure of a check within check50 for pset7 finance: :( sell handles valid sale expected to find "56....
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 ...
0
votes
2answers
721 views

Pset7 Finance Register - Works fine but error in check50

I'm struggeling with this bug for several days now and don't know how to fix it. I didn't find an answer in all the previous questions. Except my personal touch I finished pset7. If I start flask ...
0
votes
1answer
251 views

pset7 sell: can not make drop down menu work

i can not get why drop down menu does not work. It seems that the list is empty, but when I check it in another program, it contains information as expected. I just don't get why the dorpdown list is ...
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 ...
0
votes
1answer
451 views

Pset7 Finance, Sell problem with POST requests

My problem is that I'm not getting any value back from my select form. I pass a list of stocks to the jinja template via return render_template("sell.html", stocks=stocks) and on the sell.html page I ...
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) ...
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 ...
0
votes
1answer
283 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 ...
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
298 views

pset7 finance register where and how to write sql

I'm working on register as part of the finance pset, and I think I have just about all of it, but I don't know where I need to write the SQL, my understanding is that when they click the register ...
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
147 views

pset7 finance register sql

I've been working on the register part of the finance problem and I think I have most of it but I really don't understand how to do the SQL parts of it. I need to learn how to store the username and ...
0
votes
1answer
677 views

PSET7 Finance - check50 error

I passed all test except one. ":( registration rejects duplicate username" (picture below) However I get the correct error message (400) in terminal when try to use username that is already taken. ...
0
votes
0answers
106 views

pset 7 buy always returns error 400 HELP!

Whenever I click buy on my buy page, a 400 error is given. New values are also not added to the transactions table. I have been stuck here for hours now. Please help! def buy(): """Buy shares of ...
0
votes
0answers
92 views

C$50 Finance - Trouble with buy()

I am currently working on finance. My buy function doesn't seem to insert anything into the database. The debugger does not detect an error, and it seems to ignore all insert statements. I have tried ...
0
votes
1answer
704 views

PSET7 - finance check50 error

I'm getting the following error from check50 for Pset7 Finance: Why does check50 fail to login as a registered user?! It works perfectly fine for me to log in. That login function is contained in ...
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
174 views

pset7 I can't use usd() and have a problem with datetime method

1- pset7 I can't use usd() because I still need the values(int) to select the number for calculation 2- I used datetime.datetime.now()and it gives me just date without the time. anyone can help me :) ...
0
votes
1answer
218 views

[pset7][Finance-SELL] bootsrap select list to accept symbol(from jinja2 Template) and pass it on to the flask

I was able to create a select list using bootstrap for my 'sell.html': <div class="form-group"> <select class="form-control","input-group" id="sel1" autocomplete="off" autofocus name="...
0
votes
1answer
91 views

Buy and Sell Function not working correctly

Okay I have been working for very long on pset7 but my buy function seemed to be working correctly however when I try to buy the same stock a second time it doesn't get updated in the portfolio table ...
0
votes
1answer
317 views

phpliteadmin refused to connect

I am having trouble opening phpliteadmin from the CS50 IDE. I keep getting the error message "ide50-devon-brown.cs50.io refused to connect." I had similar problems with running flask directly from ...
0
votes
1answer
91 views

Dropdown menu not showing. How do I fix it?

https://imgur.com/a/CrV15 You can see the above Imgur album to see what I'm talking about. Basically I can't see what options I have selected in my dropdown menu after selection. This is my sell....
0
votes
1answer
227 views

pset7, html: {{ stock.name }} displays same value as {{ stock.symbol }}?

I have question with displaying values from stock structure that returns by lookup - name and symbol are the same. Here is how quoted.html is called #ask for stock stock_symbol = lookup(request.form....
1
vote
1answer
187 views

Pset 7 - Cannot replicate None type not subscritable error

I am running check50 on my code and at buy, it cannot validate a purchase because Log sending POST request to /login sending POST request to /buy exception raised in application: TypeError: '...
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 ...
0
votes
0answers
195 views

pset7 no such column price

The following is my code for buy: def buy(): """Buy shares of stock.""" if request.method == "POST": try: symbol = lookup(request.form.get("symbol")) shares = int(request.form....
0
votes
1answer
439 views

Finance how to use pwd_context.hash()

When running the web server and attempting to purchase stocks, I run into this very odd error regarding the register() function. I had to change pwd_context.encrypt() to pwd_context.hash() since the ...
0
votes
1answer
1k views

Pset7 finance quote problem

I'm trying to get the stocks by quote and it worked just fine a week ago but it suddenly stopped working. Can someone please explain me what has changed and how I should alter my code to get it ...
0
votes
1answer
361 views

pset7/finance: internal server error after running update50

I was debugging my codes and finally seemed to got it to work but after I ran update50 at the command line I got a new error which seems to suggest that the function of usd() distributed to us in ...
1
vote
2answers
4k views

pset7 index TypeError: 'NoneType' object is not subscriptable

I'm working on pset7 index, and I've hit a snag. When I try to log in and render index, I get this error: TypeError: 'NoneType' object is not subscriptable It says the main error is on line 50: name =...
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 ...
0
votes
1answer
445 views

Pset7 Finance register NameError: name 'pwd_context' is not defined

def register(): session.clear() if request.method == "POST": if not request.form.get("username"): return apology("Missing Username!") elif not request.form.get("...
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 ...
0
votes
1answer
151 views

pset7 buy typeError can't multiply

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock.""" session["user_id"] #check the way of request if request.method == "GET": return ...
0
votes
1answer
64 views

Blank webpage for quote(). No data returns

All my completed functions in: quote, sell, history, etc. return nothing: only a blank webpage appears after sending forms. In here, I want to know the reason by taking my 'quote()' function an ...
0
votes
1answer
34 views

else syntax error finance

I am on pset 7 and my quote function is throwing me a syntax error on else. Anyone can detect it? I know that an error where it is obvious mean that the lines before might be errorneous, but I can't ...
0
votes
1answer
111 views

Where is session file and where is company's name in csv file?

I have spent three days on learning the code in pset7 but i still have few questions. 1) In here: # configure session to use filesystem (instead of signed cookies) app.config["SESSION_FILE_DIR"] = ...
0
votes
1answer
91 views

What is cache and how could you stop it?

In pset7 code in application.py there is this snippet of code: if app.config["DEBUG"]: @app.after_request def after_request(response): help(response.headers) response.headers["...
0
votes
0answers
273 views

pset7 buy/sell shares via index

As last task to do for pset7, "personal touch", I'd like to empower the user to buy and sell shares via index without having to type the stock symbol. From here I found interesting to create a form ...
0
votes
0answers
85 views

Pset 7 - finance - request.form.get

I am trying to check that the entry in to one of my forms only contains digits. I have found a method , isdigit(), however this is only applicable to strings. I have tried a number of things, but ...
0
votes
0answers
135 views

Pset7, history,date

In Pset7, history, I'm trying to sort the data by date, I tried ORDER BY but it gave me"syntax error near when"(when is the date column name, and its data type is: DATETIME) .. what is the right way ...

1
3 4
5
6 7
15