Questions tagged [index]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
67 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 ...
user avatar
  • 1
0 votes
1 answer
68 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 "...
user avatar
  • 3
0 votes
0 answers
53 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 ...
user avatar
0 votes
1 answer
134 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 '...
user avatar
0 votes
1 answer
128 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 ...
user avatar
  • 3
0 votes
1 answer
43 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 ...
user avatar
  • 1
0 votes
1 answer
1k 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 ...
user avatar
0 votes
1 answer
126 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 ...
user avatar
  • 1
0 votes
2 answers
66 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 ...
user avatar
  • 9
0 votes
1 answer
130 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 ...
user avatar
  • 35
0 votes
1 answer
203 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 ...
user avatar
1 vote
1 answer
277 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 ...
user avatar
0 votes
1 answer
267 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 ...
user avatar
0 votes
1 answer
64 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 ...
user avatar
0 votes
1 answer
55 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: ...
user avatar
0 votes
1 answer
34 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 ...
user avatar
1 vote
2 answers
78 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> #...
user avatar
0 votes
1 answer
172 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("...
user avatar
0 votes
1 answer
72 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 ...
user avatar
0 votes
1 answer
162 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 ...
user avatar
  • 7
0 votes
1 answer
128 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....
user avatar
0 votes
1 answer
405 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 ...
user avatar
0 votes
1 answer
48 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 ...
user avatar
0 votes
1 answer
136 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 ...
user avatar
  • 17
0 votes
1 answer
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 ...
user avatar
0 votes
1 answer
133 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.
user avatar
0 votes
1 answer
74 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 ...
user avatar
  • 27
0 votes
1 answer
712 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 ...
user avatar
  • 27
0 votes
1 answer
531 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 ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
  • 3
0 votes
2 answers
644 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, ...
user avatar
0 votes
1 answer
267 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 ...
user avatar
0 votes
1 answer
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", \ ...
user avatar
0 votes
1 answer
158 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 ...
user avatar
  • 21
0 votes
1 answer
82 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) ...
user avatar
1 vote
1 answer
109 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 ...
user avatar
  • 135
0 votes
1 answer
553 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 ...
user avatar
0 votes
1 answer
110 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 ...
user avatar
0 votes
1 answer
294 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 ...
user avatar
  • 1
1 vote
2 answers
173 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",...
user avatar
1 vote
2 answers
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 =...
user avatar
0 votes
1 answer
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 ...
user avatar
0 votes
2 answers
296 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 ...
user avatar
  • 302
0 votes
1 answer
342 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 ...
user avatar
  • 184
1 vote
1 answer
197 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("...
user avatar
0 votes
2 answers
130 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 ...
user avatar
  • 231
0 votes
1 answer
325 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'...
user avatar
0 votes
2 answers
3k 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 ...
user avatar
1 vote
1 answer
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 ...
user avatar
  • 15
1 vote
1 answer
39 views

Pupose of index in speller.c

What's the use of index in speller.c and where it is declared? I can't understand how it is used in the speller.c.
user avatar
  • 266