Questions tagged [index]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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, ...
0
votes
1answer
70 views

want to create a new dict in pset7

In index, how do I create a new dict which takes all the non-zero share entries to display. For example I can use stocks = db.execute and use SUM(shares) to get the total shares for each stock. But ...
0
votes
1answer
946 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
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
712 views

Error messag “TypeError: can't multiply sequence by non-int of type 'float'”

I'm trying to implement index, and I'm having a bit of trouble. When trying to determine the total value of a user's holdings by doing the current price of each stock * the number of shares of stock, ...
0
votes
1answer
99 views

question about pset7 transferring variables to html

Here is my code: https://gist.github.com/a97f6c4eb5a834f2c99fe9e5f1e919ee Getting this error message: AttributeError: 'dict' object has no attribute 'startswith' Anywhere I can understand better ...
0
votes
1answer
40 views

Problem with pointers, getting seg fault while indexing with variable instead of plain number

I would like to ask why is that giving me seg fault. int **a = (int**) malloc (sizeof(int*) * 3); a[0][0] = 1; a[0][1] = 2; a[0][2] = 3; for(int i = 0; i < 3; i++) { printf("%d",...
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 ...
0
votes
1answer
110 views

pset7: portfolio table gives error

I'm following the instructions in pset7's page, and I have to give users free shares, by inserting a new table in portfolios. However, i get this error: #1062 - Duplicate entry '1' for key 'PRIMARY' ...
0
votes
1answer
90 views

For portfolio, only the first digit of a user's cash amount will display

Right now, everything except cash in my portfolio implementation seems to be working well. The cash value, however, seems to report only the first digit of a user's cash balance. (For example, a $10,...
0
votes
1answer
89 views

pset7 - Portfolio prints multiple times stocks

Can anyone help me with a problem in portfolio? I have the webpage completed and presenting all stocks in someones portfolio, but it prints each stock 5 times instead of just one. Below I have the ...
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"])) { ...

1
2