3

Think about what's happening. When using the full dictionary, there are words for every letter of the alphabet. Since your hashmax is 32, there's also a really good chance that every possible hash number is used. Now, think about what happens when you use a small dictionary with a few words. Some of the hash numbers will not be used. The hashtable is ...


3

This is pointing to a problem with your index.html page. Have you completed your index function? If not, why are you running check50 which should be used as a final check once you've completed the problem? The check50 tests assume that all parts of the problem have been completed.


3

This is an easy one. How is "ciphertext" supposed to be spelled, according to the spec? And is it supposed to be capitalized? Very important lesson here. When given a spec, you need to write the code to EXACTLY satisfy the spec, not just get close. ;-) BTW, another tip. check50 has been executed and tested very robustly. The odds of check50 being ...


2

What bool does 0 represnet - true or false? Your search() routine returns a bool, meaning either true or false. However, you have fallen into the trap of using numbers instead of true or false. The compiler treats 0 as false and any non-0 as true, so you are returning false where you want to return true and vice versa. This is understandable, because ...


2

These three failed tests should give you a hint that it's testing the code you wrote for indexes. :( Requesting /test redirects to /test/ :( Requesting /test/ outputs /test/index.html :( Requesting directory containing index.php outputs index.php \ expected output, but not "HTTP/1.1 200 OK\r\nContent-Type: text/h..." From man access: ...


2

check50 actually uses a different data set for testing, so it is working correctly. (Sneaky of them, isn't it? ;-) It's because of a series of issues over time and is a long story. ) As for not recovering the last file correctly, this is most commonly caused by the last 512 byte block being written to the output file twice because the EOF condition isn't ...


2

Your output does not match the spec. The spec says Implement a program that encrypts messages using Vigenère’s cipher, per the below. $ ./vigenere ABC plaintext: HELLO ciphertext: HFNLP Your result should match exactly; you are missing some "things". Specifically: Otherwise, your program must proceed to prompt the user for a ...


2

In many cases, exact spelling is required, and is found in the problem specification. How else would an automated check test your programmes? If you think check50 does something wrong, please provide more information, like your output, what check50 complains about (maybe with the check50 link), and what the specs say or don't say (with link to the problem, ...


2

Change your function to a name other than index. Looks like that is getting confused with the index declaration in string.h. (check50 is running a different compile version, which I'll see about fixing).


2

SOLVED. I added the following: try: shares = int(request.form.get("shares")) except ValueError: return apology("shares must be a posative integer", 400) I was under the impression that, since I was receiving the popup error before posting /buy, there was something else causing the problem.


2

Prepare for a painful self-headslap. ;-) File names are important. The code created 50 files with the extension .jpeg. The spec said to create files using the extension .jpg, without the "e". Guess what's happening. ;-) If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)


2

I ran your code and got something different than what you posted. After further checking, I found that the results are actually unpredictable. The code may or may not print extra characters after processing the plaintext, depending on what was left in memory from prior activity. Here's the problem. The code encodes each char and stores it in ciphertext[]. ...


1

You already use usd in both possible ways, using like usd(price) in Python (bought.html), or {{ price | usd }} in the template (index.html). I think the issue is that the value it searches for is the total price of the transaction. Most people would redirect to index/portfolio, maybe using a flash message to inform the user of the successful operation. Oh, ...


1

Remember your C code. Reject in this case means to ask again. Use a loop around the input, and leave it on valid input (via loop condition or break). If the code were in a function, I'd raise an exception (or let an existing one pass without catching it). Or return None, but maybe not in this case.


1

After reviewing your actual code /sell needs to accept a POST request where shares is a number of shares, and symbol is a stock symbol. Your code has /sell take symbol as the ID of a row in a table called symbols So that’s throwing things off. check50 is sending a payload like {"shares": 2, "symbol": "AAAA"}, but you are asking for something like {"shares"...


1

Might be you have a slightly different version of cs50 library. On 64 bit Linux (but not on Windows), long long is same as long, both 8 bytes, so somebody decided to deprecate get_long_long (see get_long_long in the reference). I guess you need to use get_long, not get_long_long, for the same result on this platform. BTW, the task description includes ...


1

The first error "quote handles invalid ticker symbol" indicates the quote route gives an error if nothing is returned from lookup. Note this exception raised in application: TypeError: 'NoneType' object is not subscriptable. You can look at the log in the flask terminal to see where this error is produced. You need to do some error checking after this quote =...


1

Let's have a look at one of those error messages: :( handles a height of 2 correctly expected " ##\n###\n", not "##\n" This means that for a height of 2, the test expected to get: ## ### while the actual output of your program was: ## So your program should print two output lines when height is 2. But if I look into your program loop, I see: for (...


1

The issue here is that, when the index.html page is rendered, the lookup function is returning None for the stock (in this particular case, it's because you are converting your symbols to lowercase before storing them, so check50 is expecting "AAAA" but you've stored "aaaa").


1

You use bi.biHeight in your for loop, but that means you are writing bi.biHeight*n lines, that's too many by a factor of n. Easiest fix would be to use bi.biHeight/n instead.


1

You can "check50" login and register without completing index.html....as long as it doesn't return a 400. If you examine the apology function in helpers.py, you will notice that the code parameter is optional and defaults to 400. If you change return apology("TODO") in index (which returns a 400 by default) to return apology("TODO",200) you will be able to ...


1

There is something wrong with your code. In the first screen shot, the issue is that the code didn't reject anything when it should have. In all the later examples, check50 will fail all tests because of the extra printf statements. Without seeing code to test, there's no way to determine the cause of the problem. Did you thoroughly test with your own ...


1

It is not complaining about the compile, that gives a :). It is complaining that the board is not initialized correctly. Remember from the check50 section of the spec: Note that check50 assumes that your board’s blank space is implemented in board as 0; if you’ve chosen some other value, best to change to 0 for check50's sake. It looks like you have ...


1

Pay attention to extra spaces. Check50 expects that yo do exactly what has been asked. If you put extra space, it would look the same for your eyes, but not for check50. I strongly suspect (not sure), from scare info that you give, that you have one extra space before ##.


1

0 and 23 are valid input values. By using >0 and <23 you exclude them. Use >= and <=.


1

Either: Is lookup always returning something? You could check this before applying a subscript. Reasoning is that Yahoo shut down its API a few weeks ago. Have you updated your helpers.py file? The one on the CS50 repo has a fallback for another service (sadly does not provide company names, will return the symbol instead). Or: Is your database query ...


1

So dict they use is small containing cat caterpillar and text is ca cat cats caterpill caterpillar caterpillars Maybe this helps in reproducing locally, unless they use their own speller.c (which could have anything at line 100), which they totally can, as you're supposed to make changes to dictionary.c only. This alternative version might include a ...


1

The checker does not use your draw function. As you might add any kind of border or colours to your board representation, it's unreliable for testing, so the checker replaces it with a minimal implementation. Instead of setting blank_row and blank_col in draw, initialise them to d-1 in init, and update them whenever you swap a tile.


1

From the spec [emphasis added]: Moreover, rather than read my CF card’s bytes one at a time, you can read 512 of them at a time into a buffer for efficiency’s sake. Thanks to FAT, you can trust that JPEGs' signatures will be "block-aligned." That is, you need only look for those signatures in a block’s first four bytes. What does this program do if it ...


1

You'll see what your problem is if you do this: Think about it for a while and come back here again if this doesn't make it click for you... and I can add other tips.


Only top voted, non community-wiki answers of a minimum length are eligible