Questions tagged [lookup]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

PSET9 Finance: USD function returns error only when both rendering Index AND after BUY completes a 'purchase'

"unsupported format string passed to Undefined.format"--I know this happens because the non-numerical value is passed into the USD function, but I can't seem to spot the culprit. As ...
user avatar
0 votes
0 answers
21 views

PSET9 finance: lookup always returns 404 None or 200 None

I reinstalled helpers.py and the entire IEX key is being submitted (IEX console shows credit is being used--see attached photo) but I keep getting: https://cloud.iexapis.com:443 "GET /stable/...
user avatar
0 votes
1 answer
92 views

Why does my lookup function keep returning "None"?

I have the latest (I think) distribution code and I have exported the API key. Here is my code and it keeps returning 'None'. I can't figure out why I can't look up a stock quote. Do I need to change ...
user avatar
  • 14
0 votes
1 answer
155 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
149 views

Minor change in pset6/dna required, need some help or hint

I am really really close to completing pset/dna. But there seems to be some problem in the 'if statement'. Somebody please guide. Before the line of underscores in the terminal, I have printed the ...
user avatar
0 votes
1 answer
282 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
443 views

Finance PROBLEM with lookup: TypeError: quote_from_bytes() expected bytes

I have Finance barely ready but like most codes, it has a buggy near the finish line. I have a problem with lookup. Always return None. I check it. and Terminal shows this error: TypeError: ...
user avatar
0 votes
1 answer
685 views

CS50 Finance lookup function always returns NONE

After a week or so of idle i returned to finance and tried to chek my buy function. I bought some stocks of apple(AAPL) but got invalid symbol error, when i tried to use quote(this function always ...
user avatar
0 votes
0 answers
75 views

Pset7 buy route error due to API use by lookup function

I am experiencing an error each time I call the lookup function within the buy route when the request method equals post. However, calling lookup during quote does not result in the same error. I ...
user avatar
  • 1
0 votes
1 answer
78 views

Scramble.c lookup function found flag

So I've got the binary search function working for this problem, but I have no idea how to deal with the "found" flag portion of the problem. I think the idea is to add a "true" condition to the bool ...
user avatar
0 votes
1 answer
303 views

LOOKUP IS GLITCHY??? PSET7

Lookup sometimes returns None for actual stocks (the ones I have tried are NFLX, GOOG, and FB). Sometimes lookup works successfully and my code correctly executes updating the database. However, ...
user avatar
0 votes
1 answer
414 views

PSET7 Finance Question Quote Lookup Page

I can't seem to get the lookup to work right. I just keep getting an error of "404 Not Found". Here is the URL and it does load but doesn't load when I post to it for some reason http://ide50-...
user avatar
0 votes
1 answer
256 views

scramble lookup function

I'm having a lot of difficulties with this problem since there are lots of concepts that I don't know. I'm trying to treat dictionary as an array of strings as below: bool lookup(string s) { int min =...
user avatar
1 vote
1 answer
909 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 ...
user avatar
2 votes
3 answers
868 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 ...
user avatar
0 votes
0 answers
199 views

pset7 - buy() , problem accesing the dictionary that was returned when calling the lookup function

I'd been struggled with this. Here's my code: @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): if request.method == "GET": return render_template('buy.html') ...
user avatar
  • 215
-1 votes
1 answer
443 views

Not able to get values from lookup function

i am trying to show user his current portfolio but from the output it seems that i am not able to access pre-built lookup function.also i am directed to portfolio page without asking for login or ...
user avatar
0 votes
1 answer
50 views

Why is all my check50 server2 red?

Below are my parse() and lookup() functions for server.c pset6. I have gone over and over but maybe I didn't understand what lookup does. Any help is highly welcome and appreciated. My check50 for ...
user avatar
0 votes
1 answer
78 views

Pset6 - Help with Lookup Function

const char* lookup(const char* path) { const char* MIME = NULL; const char* first = strchr(path, '.')+2; const char* last = strrchr(first, ' '); //(need to declare a type here) len = last -...
user avatar
0 votes
1 answer
37 views

PSET6 Lookup - Read-Only Variable As Well As How to Approach

I have started implementing lookup. When I try to compile my code, the terminal gives an error when I try to assign one of my variables to another variable. The error says that I am trying to assign a ...
user avatar
0 votes
1 answer
45 views

PSET6 Server - fails the request two files in a row check

My server fails the last check in check50-server2 - "request two files in a row" Because it only fails that test I'm assuming the problem is somewhere in the parse or lookup functions. Valgrind shows ...
user avatar
1 vote
2 answers
105 views

Alternative to multiple if statements?

Just started this problem set about a day or two ago and while implementing lookup() I was wondering if there was an alternative to using multiple if statements to compare the path and return the MIME ...
user avatar
  • 23
1 vote
2 answers
78 views

Pset6 check50 server1 parse error

I am having trouble addressing the below two errors when I run the first check50 of pset6. check50 2015.fall.pset6.server1 server.c :( Requesting cat.exe returns error code 501 \ expected output, ...
user avatar
  • 11
1 vote
2 answers
125 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 ...
user avatar
0 votes
1 answer
69 views

debug50 segfault in pset6

I am having problems with debug50 since when I pass the executable through it, it gives me a segfault in the strncasecmp line. But if I execute the program normally, it works fine. This happens also ...
user avatar
  • 25
0 votes
0 answers
39 views

pset6 lookup and parse - don't compile please help

I wrote codes for lookup and parse functions. It does not compile. Can anyone spot obvious errors?
user avatar
  • 103
0 votes
2 answers
55 views

pset6: requesting php from within html isn't working

Almost there, I'm only failing the following two tests now: :( Requesting hello.php? returns 200, text/html, and correct output \ expected output, not an exit code of 0 :( Requesting hello.php?...
user avatar
  • 15
0 votes
0 answers
118 views

Test file for pset's 6 lookup creates numerous errors

I've created a new file in order to test my lookup function for pset6. Here's the content of my test file: #include <stdio.h> #include "server.c" int main(int argc, char* argv[]) { ...
user avatar
0 votes
1 answer
66 views

Pset6 - check50 missing cat.exe and non-existant file request

I've been checking similar questions about the problem I'm having but couldn't solve it myself. Help would be really appreciated. After implementing lookup and parse and running check50 I'm receiving ...
user avatar
  • 9
0 votes
1 answer
103 views

pset6 2 errors with parse and lookup [duplicate]

i been stuck with these 2 errors for days which i don't really know what causes them..tried debugging parse and as far as i can tell abs_path is working as it should(although i'm not sure it's written ...
user avatar
0 votes
1 answer
281 views

Problem with check50 for server1

I know that when lookup returns NULL when called, error 501 should appear and that's what I did in lookup's implementation. If the extension of the file is none of the ones mentioned in the pset's ...
user avatar
0 votes
1 answer
60 views

(PSET6) hello.php always displays hello, hello, world regardless of input?

Me again. I've basically sorted out most of the issues now. I can load cat.html normally in the browser and indexes definitely works. From testing, I believe that my parse function is still fine. ...
user avatar
0 votes
1 answer
160 views

Need help with pset6, lookup and parse function!

I think my parse and lookup are working fine, but check50 is not happy. Maybe anyone has an idea. here my functions: const char* lookup(const char* path) { // if there is a path, compare and ...
user avatar
  • 104
0 votes
1 answer
207 views

Pset6 one check50 error [duplicate]

Please help me. I have passed every check except 1. Here is my error: check50 2015.fall.pset6.server1 server.c :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :) Method of '...
user avatar
  • 23
0 votes
1 answer
69 views

Why Pset6 check cat.exe and non-existant file going wrong?

:( Requesting cat.exe returns error code 501 \ expected output, not an exit code of 0 :( Requesting non-existant file returns error code 404 \ expected output, not an exit code of 0 code for ...
user avatar
  • 39
0 votes
1 answer
181 views

pset 6 server - Load produces inconsistent results

I'm really confused about what is wrong with my code as load works for certain files but not others and the reading of the file isn't something that is altered in any of the functions we're tasked ...
user avatar
  • 5
0 votes
1 answer
92 views

PSET6 check50 server1 cat.exe and non-existant file return error 505

So, i have looked everywhere for the answer to why my program returns error 505 for cat.exe and non-existant file. I have tested isolating the two functions but they work fine outside of the main ...
user avatar
0 votes
1 answer
130 views

pset6 server.c 403 forbidden for "/", problems for lookup and indexes

I finished all four functions to my best knowledge but the server seems not working well. Once I started the program and then tried to access https://ide50-(myusername).cs50.io/, 403 forbidden popped ...
user avatar
0 votes
1 answer
191 views

Pset6 server.c Error 403

server.c is giving error(403) inside transfer function (written by default) lookup function : const char* lookup(const char* path) { char* s=(char*)calloc(20,1); strcpy(s,""); char *...
user avatar
0 votes
1 answer
144 views

first version of check50 not working pset6

I have almost completed lookup() and parse() function but check50(version 1) shows :( in 2 cases. Below is my check50 result. :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :...
user avatar
0 votes
1 answer
151 views

check50 is returning errors on pset6 but if I search the pages on browser all of the pages work [duplicate]

I am running check50 and get these errors: :) server.c exists :) server compiles :( Requesting cat.jpg returns 200, image/jpeg, and correct image :( Requesting cat.html returns 200, text/html, and ...
user avatar
1 vote
1 answer
134 views

Bug in the pset7 distribution code Lookup

When doing the symbol lookup in pest7, I noticed that a non-valid input for symbol (i.e., inputing "asdfafda") would not give a valid warning response. (Not on my computer and not on the staff ...
user avatar
0 votes
1 answer
466 views

Is it possible to code lookup function without malloc?

I have finally managed to have my WebServer working, but I would like to improve my implementation of the "lookup" function. The only option that avoided segfaults was to malloc a char* and use it as ...
user avatar
  • 111
1 vote
0 answers
100 views

Cannot download csv file from yahoo in pset7

i have proxy server in my college through which the internet is accessed. I had setup my appliance to work with proxy as given in the cs50 appliance manual. Now in pset 7 while calling the lookup() ...
user avatar