Questions tagged [index]

The tag has no usage guidance.

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

Cs50 Finance :(sell handle valid sales :values appearing in index table but check50 doesnt recognise it

updated the code to display history properly,ie when sold shows negative,and when bought shows positive updated index to remove entire row when stocks is 0 I cant figure out why check 50 is not ...
0
votes
1answer
28 views

pset9: finance // jinja syntax error in index

I'm working on my index page and I have two errors. For the first, I'm not sure what's wrong. It seems like it's something with my return statement but I have no idea what's wrong with it. File "...
0
votes
0answers
21 views

Pset Finance - issue with usd

I'm stuck with pset9 Finance... When I try to sell a quote and return to index.html, I have an error with : File "/home/ubuntu/pset9/finance/templates/index.html", line 1, in top-level ...
0
votes
1answer
54 views

Pset 9 Finance index function, current stock price not displaying correctly

I am working on getting the proper information to display on the index page. I have one piece left, and it is displaying the current value of the stock. When I look at my output for my 'user' and '...
0
votes
1answer
35 views

CS50 Finance index doesn't display what it needs to

I'm at the last check for the 'buy' part and I keep getting: :( buy handles valid purchase expected to find "9,888.00" in page, but it wasn't found I'm pretty sure that number is supposed to ...
0
votes
1answer
36 views

Buy/Sell on Index - button attributes & form value issues

I've got a couple issues adding my own buy/sell buttons to the index page. First, each "Buy" or "Sell" buttons opens up the form for all of the table rows. How can I modify these ...
0
votes
0answers
16 views

Index route_TypeError: 'NoneType' object is not subscriptable

I tried to run the program and encountered this error: My code: @app.route("/") @login_required def index(): """Show portfolio of stocks""" # Selecting ...
0
votes
1answer
421 views

pset9 Finance "jinja2.exceptions.TemplateSyntaxError: expected name or number" error

In my index function, every time I try "flask run" it outputs that error (jinja2.exceptions.TemplateSyntaxError: expected name or number). Everywhere I've checked most people have been ...
0
votes
1answer
85 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
2answers
51 views

Finance - Index showing correct number of rows but all the same record. For- loop issue?

So I've been looking at this all morning and can't figure what I'm doing wrong. All my variables are producing the correct values so it seems to be something to do with my For loop. In the html ...
0
votes
1answer
90 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
1answer
151 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 ...
1
vote
1answer
198 views

CS50 Finance: Index - list indices must be integers or slices, not str

I've been stuck on this for quite some time. I believe that I'm getting back data in the form of a dictionary but can't figure out how to get the information that I need. Error messages that have ...
0
votes
1answer
223 views

Finance index function does not return lookup value in index.html

I'm trying to render my lookup values inside of my index function implementation, but I cannot get these values to render in my index.html page. I added share = lookup(record['share_symbol']) to grab ...
0
votes
1answer
49 views

Finance index.html is not rendering values from my index function

I'm having some issues trying to render values on my index.html page. In my index function, I created a dictionary of values from my transactions table to grab each record of my share symbols, share ...
0
votes
1answer
51 views

Runtime error in pset4

I'm currently working on filter.c, and I'm struggling with the blur segment of it. I tried to write a code (I'm aware it's a mess of hard-code, but it's an attempt!), but I keep getting this error: ...
0
votes
1answer
32 views

Finance Portfolio (index) I can't go on. Need to take to HTML the actual price and total of stock

I am stopped at this part of Finance now. I can print at HTML the symbol and the sum of the shares... but I don't know how to take the iteration for each symbol to the HTML to know the actual price ...
1
vote
2answers
66 views

My Coleman-Liau index gives the wrong answer

the program seems to be running fine but I don't know what went wrong in the index, it just doesn't give the right answer. #include <cs50.h> #include <stdio.h> #include <string.h> #...
0
votes
1answer
146 views

Finance - Error with Index

I can't seem to figure out where I've gone wrong with index. I keep running into these two errors: After login, when directing to index - 500: Internal Server Error (raise TypeError("...
0
votes
1answer
65 views

Pset8 Finance - SELECT is blank

Stock holdings are not printing on my index webpage. "cash" prints correctly. I think the SELECT on my finance.activity table is somehow coming up blank. I am not receiving any errors, and when I ...
0
votes
1answer
154 views

Pset8 finance, index not working after migrating to new IDE, why?

My "index" was working fine, but it no longer works and i get the 500 internal server error now, which has been happening after migrating to the new IDE. I does not seem to be my code. Here is what ...
0
votes
1answer
116 views

Pset7 - index() ValueError: could not convert string to float

I got ValueError: could not convert string to float at line 66 grand_total = total_holdings + float(current_cash[0]["cash"]) Can anyone show me my mistake? current_cash[0]["cash"] returns a string....
0
votes
1answer
372 views

pset7 finance: index not working after register

I have an issue with my index function after a user newly registers. After registering, a new row is created in the table users with a cash value set to 10000 by default. After registering, the user ...
0
votes
1answer
45 views

When I go to '/' page for Finance it only shows the cash I have available

I've been struggling for hours with trying to get the '/' page to display the current portfolio. It displays the remaining cash fine but nothing else. On phpliteadmin I can see that the table gets ...
0
votes
1answer
129 views

pset7 index function won't iterate through stocks

I'm having some serious trouble getting the index function to iterate through each of the user's stocks to obtain the current market price. It correctly outputs a list of the user's stocks along with ...
0
votes
1answer
1k views

Pset7 index TypeError: quote_from_bytes() expected bytes

Pset7 index. I’m getting raise TypeError("quote_from_bytes() expected bytes") TypeError: quote_from_bytes() expected bytes. I tried several times to rewrite the code but I always come across this ...
0
votes
1answer
129 views

Pset7 index RuntimeError object has no attribute name

I’m working on index part for two days now and I’m keep getting AttributeError: 'RuntimeError' object has no attribute 'name'. I changed things around but still the same error. Please, help me.
0
votes
1answer
70 views

Pset7 finance, after I run buy function, portfolio table updated check 50 fails and I get 404 error

after I run check 50, everything shows green except these: I am trying to fix the error for buy. After I run flask and tried to make purchase, it shows 404 however my portfolio table get updated. So ...
0
votes
1answer
697 views

pset7 finance register and index check50 error

I have implemented all functions. However when i run check50, it gets following errors The errors might come from my index code. I am not sure. Below are my code for register and index. Any ...
0
votes
1answer
512 views

Problem retrieving index variables in finance

The table is not able to access different variables to display in the table. Here is the index function def index(): """Show portfolio of stocks""" """Selecting shares that have been purchased ...
0
votes
1answer
29 views

TypeErrors and variable storage questions

I have been struggling with this problem set (pset7) for a couple weeks now and I have looked at countless resources while trying to get my code working. I am the point where I do not remember what is ...
0
votes
2answers
610 views

pset7 finance/index problem updating values in table

First time asking question, sorry if formatted badly. I am trying to set up to update my price and total column in my sql table. I seem to have it mostly correct, as values are being updated properly, ...
0
votes
1answer
253 views

pset7 index table not showing all values

When I try to use index, the table doesn't show all the values: [![erroneous table][1]][1] I'm not sure why it only shows some. My index code is as follows: def index(): """Show portfolio of ...
0
votes
1answer
59 views

why can't I even log in now ? pset7

code: def index(): """Show portfolio of stocks""" portfolio_symbols = db.execute("SELECT shares, symbol \ FROM log WHERE id = :id", \ ...
0
votes
1answer
156 views

pset7 index TypeError: 'NoneType' object is not subscriptable error

Me again with this error. I do not know what happened, this has been working for a couple of weeks and I have not changed the code (though I did copy and paste it) but all of a sudden this afternoon I ...
0
votes
1answer
77 views

pset7 "index" - using SQL SUM adds a parenthesis to returned dict strings

I executed the following to return a dict (grouped by stock symbols) of stock symbols, total shares and total value owned. stocks = db.execute("SELECT buy.stock_code, SUM(buy.value), SUM(buy.shares) ...
1
vote
1answer
103 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 ...
0
votes
1answer
546 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
109 views

cs50 pset7 finance always get an error in valid buy execution;;;;;

@app.route("/") @login_required def index(): """Show portfolio of stocks""" cash = db.execute('SELECT cash FROM users where id=:id',id=session["user_id"]) cash = cash[0]["cash"] stocks ...
0
votes
1answer
290 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
2answers
169 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
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 =...
0
votes
1answer
135 views

pset7 index only one stock gets passed into html

My code for index is at https://pastebin.com/Ct7xCdYv. My code for html is at https://pastebin.com/VFFAWEzc Currently, I'm just trying to get the code for the stocks in, and will then tackle adding ...
0
votes
2answers
294 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
339 views

Pset7 Index not outputting some fields in table

I am in desperate need of help, since the index method is the last method I have left to finish for this pset! So far, my index code works partially - as in, only the values I passed in from my ...
1
vote
1answer
191 views

Why is my table in index.html pset7 showing up blank? (for dummies)

I've been stuck on this for a couple hours now, it seems that whatever I put into my for loop in my index for html doesn't print at all? Thoughts? index method: def index(): portfolio = db.execute("...
0
votes
2answers
125 views

pset 7 [buy] Unable to render user's cash

I've spent a lot of time trying to solve this problem and can't seem to find were I went wrong. Any help is greatly appreciated. I am unable to render the user's cash balance on the index. def ...
0
votes
1answer
315 views

Index Pset7 - Symbol, Shares, and Total show [] instead of value

I was able to successfully create my index table and it shows the Name and Price correctly. However, it only shows [] for the values of Symbol, Shares, and Total. Here is my code: // edited out I'...
0
votes
2answers
2k views

pset2 caesar converting from ascii to alphabetical

#include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, string argv[]) { if (argc == 2) { int ...
1
vote
1answer
51 views

pset2 Initials - negative index

I finished the Initials (more comfortable) problem, but when trying to detect initials, I'd like to avoid negative indeces. Here's what I used for the detection of initials, if it's not a space at ...