Questions tagged [index]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
335 views

CS50 Pset7: rows inside the for loop are not showing up in index.html

I have been trying to implementing my code for Index and index.html. My code for Index seems to work very well, but my index.html isn't. My implementation of index() and index.html are pasted below. ...
1
vote
1answer
595 views

pset 7 index - how to get total value of shares held and add to cash balance

Still working on index in pset 7. I am able to display details of the shares held by the user and their cash balance in a table. I have done this by iterating over their holdings in a portfolio table, ...
1
vote
2answers
123 views

pset6 server fails check50

I can't find why this doesn't work, can someon help me? Thanks. My code fails the following in check50 server1: :( Requesting cat.exe returns error code 501 \ expected output, but not "HTTP/1.1 ...
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
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 ...
1
vote
1answer
32 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.
1
vote
1answer
150 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 ...
1
vote
2answers
58 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> #...
1
vote
1answer
101 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 ...
1
vote
2answers
167 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
1answer
187 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
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 ...
0
votes
1answer
730 views

PSET 7 Index.php Fatal error: Call to undefined function query()

Fatal error: Call to undefined function query() in /home/ubuntu/workspace/pset7/public/index.php on line 8. <?php // configuration require("../includes/config.php"); if(isset($_SESSION["id"])) { ...
0
votes
1answer
99 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
2answers
592 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
945 views

pset7 index.html Jinja

In index.html, should I only be passing in one variable with all my information? I currently am passing three. They each contain their own iterable items which I need access to simultaneously. I'm ...
0
votes
1answer
56 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
98 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
1answer
188 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
38 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
49 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
30 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 ...
0
votes
1answer
133 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
62 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
356 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
126 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
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
1answer
240 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
58 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
70 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) ...
0
votes
1answer
103 views

CS50 Pset7: rows inside the for loop aren't showing up in index.html

I have been trying to implementing my code for Index and index.html. My code for Index seems to work very well, but my index.html isn't. The jinja template is pasted below. For some reasons, the table ...
0
votes
1answer
89 views

PSET 2 - Vigenere's cipher: Index of key's current letter not working properly

I know that I've posted a question very recently about the same PSET, but I've encountered another problem and I've been trying to solve it for hours. Sorry if I'm wasting anyone's precious time. My ...
0
votes
1answer
151 views

How to figure out “Who bought what and whe?” - pset7 - buy - index

I can't seem to wrap my head around what should be the primary key in my Portfolio table. I am able to get a quote, buy a stock, and have the price taken from the corresponding user but my Portfolio ...
0
votes
1answer
105 views

pset7 index - can't get anything from the db to html

Well, I'm not doing well this weekend! Still struggling on pset7, this time I can't even get anything at all from the db to display on an html file. I've cut it down to the simplest code I can (...
0
votes
1answer
5k views

Jinja template exception: “jinja2.exceptions.TemplateSyntaxError”

I have an exception thrown from a template, which reads like this: "jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'holding'. Jinja was looking for the following tags: 'endfor' or '...
0
votes
1answer
92 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
58 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
37 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
150 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
39 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
126 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
65 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
685 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
493 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
148 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
526 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
108 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
287 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 ...
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 ...