All Questions

0
votes
1answer
5 views

Pset4 recover.c fwrite if header is not found but already found the first jpeg

Can someone explain to me, why will there be a case where the first jpeg has already been found but subsequent jpeg doesn’t match the header? I thought all jpegs should match the header? If (...
0
votes
1answer
13 views

:( qualifies for Big Board CS50 pset4 speller

I'm trying to implement these four functions load, check, size and unload. I debugged them manually by printf function and breakpoint. in load function I checked it by valgrind it displays no errors, ...
0
votes
0answers
10 views

I know how to fix the code but why in index.html does len(session[“user_symbol”]) return 0?

index @app.route("/") @login_required def index(): current_symbol = session["user_symbol"] print ("current_symbol in index {}",current_symbol) if len(current_symbol) != 0: """...
0
votes
1answer
6 views

pset8 c$50 finance /buy - transactions RuntimeError: (sqlite3.OperationalError) near “''”: syntax error

I'm stuck on pset8 c$50 finance /buy: Form validation works properly but when i try to execute the INSERT INTO transactions table i get the following error: RuntimeError: (sqlite3.OperationalError) ...
0
votes
1answer
10 views

CS50 IDE Serve isn't working

I'm working on Pset5, and when I use Serve to view my webpage, this is what I get: I have no idea what happened.
0
votes
1answer
13 views

cs50 pset4 speller trie word too long “index 46 out of bounds for type 'char [46]'”. Isn't that handled by the code already written?

My code is giving all the right answers (lalaland.txt), but valgrind says: ==9947== dictionary.c:69:25: runtime error: index 46 out of bounds for type 'char [46]' (and I printf the problem - too ...
0
votes
0answers
14 views

I am getting an error in the lookup function. I already posted about this. I updated the API and it is still happening. Can someone help?

Here is the old post. I did change some of the code. I am getting an errors in the code no idea how to fix them? I followed the steps and am still getting the same errors. Any reason? What I did was ...
0
votes
1answer
19 views

CS50 Mario Less Comfortable Printing Pyramid

I have been working on this problem for about 2 weeks. I can receive input from the user and print hashes based on the number the user entered. However, I can't print a right aligned pyramid made up ...
0
votes
0answers
17 views

Speller Trie not reading apostrophes?

For a reason I have fruitlessly tried over and over to work out, my trie code, while functioning well in all other aspects, either is not reading apostrophes into its dictionary or is not properly ...
0
votes
3answers
56 views

CS50 IDE doesn't load but keep saying “Preparing your environments”

I have an issue when log in cs50 IDE. After I go the site, login with github, cs50 IDE keeps loading with the message "Preparing your environments" but doesn't take me to sandbox with the project I ...
0
votes
0answers
12 views

http-server won't quit

In lecture 5, we used the http-server command to launch a basic webpage, and it spit out a link which we could click on, and it produced the results to the various pages. Since CS50 IDE is in ...
0
votes
1answer
24 views

pset4 recover - doesn`t recover all files

Struggling with recover at this moment. My code creates just 8 pictures out of 50 - from 2nd to 9th. Other jpegs are also made but i am unable to see them due to "Invalid or Unsupported Image Format". ...
0
votes
1answer
11 views

Fread doesn't return new values to buffer - recover - pset4

I am currently working with recover and when I first compiled my program with debug50, my program was able to return 6 corrupted files without a propre name. When I wanted to get a closer look as to ...
0
votes
1answer
19 views

MarioLess - declaration shadows a local variable error

Any suggestions on how to fix this error? "mario.c:10:14: error: declaration shadows a local variable" Code sample below. Thanks in advance! #include <cs50.h> #include <stdio.h> int ...
0
votes
1answer
29 views

Need help finding bug in resize

I have been staring at this code for hours now and can't find what is wrong with it. It makes a new bmp image that is "n" times larger, but there is something wrong with the reading frame because the ...
0
votes
1answer
18 views

Pset8 Finance problems with SQLite inserting into a table

Inserting into a table in finance.db fails. I'm able to run the sqlite3 command via cli without errors and populate the table with the debugging snippet command: INSERT INTO history (date, symbol, ...
0
votes
0answers
19 views

Pset7 survey table not loading

For Pset7 Survey, my table is not loading. My error checking is now working, but when I submit a form, it simply shows me an ugly list of all the <thead>. May somebody please help? Application....
0
votes
1answer
34 views

I have some code below getting error from session[“user_id”]. What is causing the error?

Here is a link to the code. I am getting an errors in the code no idea how to fix them? Here is the error message * Serving Flask app "application.py" (lazy loading) * Environment: production ...
0
votes
1answer
18 views

pset3 recover, only get 49 jpgs and all are wrong by check50, but look correctly

I recently started with CS50 and I struggle a bit with pset3's recover. While the jpgs look correct to me, my code only recovers 49 jpgs total, not the 50 which are expected. Check50 fails on the ...
0
votes
1answer
11 views

PSET 2, Issue with crypt function output

Trying to finish the crack assignment and I'm getting different outputs using the crypt function with what I believe is the same input. Using a different set of code (that just returns the output of ...
0
votes
1answer
6 views

Check does not like my spacing on Mario.sentimental. Is the program unwilling to print ' ' * 0 as no spaces?

I've run this in various configurations, when I remove excess spaces, it still prints out with a space at the beginning of each line. And the center spacing seems to be larger than check50 expects, ...
0
votes
1answer
20 views

Why am i not getting an error when trying to overflow a signed integer in cs50 sandbox?

According to this question on stack overflow, signed integer overflow is not defined - https://stackoverflow.com/questions/18195715/why-is-unsigned-integer-overflow-defined-behavior-but-signed-...
0
votes
1answer
15 views

pset3 Recover - problem with final image

Hi I'm working on recover in pset3 and seems there is some problem when my code ends, can anyone point out the direction I should look into? Check50 returns the following error while all others are ...
0
votes
1answer
15 views

pset 8 finance: :( sell handles valid sale

:) Struggle with the last check. Get this error message: expected to find "56.00" in page, but it wasn't found Tried the same approach like I used for the buy-function. Create an extra template to ...
0
votes
1answer
21 views

Need help with recover

I have been working with recover for a long time and I have a great problem with detecting the beginning of a JPEG. I have tried for a long time to no avail. I feel my problem may be with buffer but ...
0
votes
1answer
12 views

Why removing a printf function messes up with my code? CS50 pset1 cash greedy challenge

I finished the challenge and my first C code worked apparently well, returning each time the correct minimum number of coins needed for change. Then when I tried to "clean it up" a bit and remove a ...
0
votes
1answer
9 views

Move function do not working

I cant understend why, but my move function does not work properly. It looks correct to y mind. But no Can you please chck what's wrong? bool move(int tile) { if(tile > d*d-1 || tile <= 0) ...
0
votes
0answers
25 views

I am getting an errors in the code no idea how to fix them? [duplicate]

I did a little googling pset7 index TypeError: 'NoneType' object is not subscriptable error Found an error similar in my code. But it doesn't say how to fix it. How do I fix the code? ...
0
votes
1answer
37 views

My CS50 Finance Lookup stopped working on 15 Jun 2019. Is there trouble with the API?

Per the title, the API appears to not work.
0
votes
1answer
21 views

pset8 New errors without changing any old code [duplicate]

I've been working hard on pset8 lately and making great progress. I was busy and didn't get to work on it for about a week. I'm now getting errors that I didn't get before, and as far as I'm aware, I ...
0
votes
1answer
16 views

Stuck on Caesar, analyzing command line arguments

I've posted my code blow. I'm supposed to check if the 2nd command line argument (the key) is an number or not, and if it is, print it out as an integer. I'm having two issues: I get an error ...
0
votes
1answer
10 views

How to pass value from HTML to python?

I'm setting up a new project in python ,and want to setting up a web pageresturant.html using FLASK , this code in html get the selected value from drop down box when button is clicked ,how can i pass ...
0
votes
0answers
21 views

Can someone show what the list of dictionary looks like for application.py in finance when selecting something?

I know what a list of dict is, I just don't know the format of when using a select statement. Feel free to use any select statement that you want. db[0]["symbol"] = [{}] I want to know what is ...
-1
votes
1answer
21 views

How do I submit all my problem sets for evaluation?

I have finally went through all problem sets and submitted them (on GitHub and on the Google form for the final project). Now I wonder how to proceed for a request to be graded? It is confusing... at ...
0
votes
1answer
27 views

PSET3: Resize (more comfortable) - What am I doing wrong?

This code outputs a seemingly random assortment of colors after the initial scanline, which is correct. If I comment out the for loop that fwrites the scanline "n"(the multiplier) times for every row, ...
0
votes
1answer
13 views

PSET 6 [Similarities - less] How is the compare file accessed in this problem since it is not imported to application.py

(Dont be intimidated by length of code chunks, I included all of my guess as to what's going on, so most of it is just stuff to skim over) The folder similarities contains static and template folders ...
0
votes
1answer
23 views

Cannot run Flask - TypeError

Whenever I try "flask run" I get this error in the IDE. I have no idea what the problem actually is. ~/workspace/pset7/survey/ $ flask run * Serving Flask app "application.py" (lazy loading) * ...
0
votes
2answers
61 views

CS50 IDE now CS50 IDE Beta all files missing

After a couple of weeks break I've returned to finish Pset5 to find that the CS50 IDE is now CS50 IDE Beta and all of my files are missing. I now have only one folder in my root directory called 'lost+...
0
votes
1answer
40 views

Can’t see my error on Mario for loop, rows won’t execute!

I’ve gotten stuck on the Less Comfortable Mario set: the height input portion works, but the loop does not execute. I really wanted to figure this out on my own, but I’ve been stuck for days! Please ...
0
votes
1answer
17 views

Pset 4: Speller (trie) - misspelled words

I'm stuck. In Speller, implemented with trie, I get more misspelled words than I should. The number of words loaded into the dictionary is correct, there are no leaks or error messages. When checking ...
0
votes
1answer
15 views

All words are returned misspelled

I'm running this program on a small dictionary and a small text sample. I think that loading the dictionary is working correctly. But how can I know for sure? When I implement the load and check ...
0
votes
1answer
17 views

python pset1 cash problem

Trying to solve pset1 cash less comfortale with python. Whats my mistake as I cant figure it out. Lets say I add 5.16 as cash owed that is 20*0.25+1*0.1 +1*0.05 +1*0.01 , 23 coins total used. ...
0
votes
2answers
35 views

Pset3 recover __ How can I read and store data from card.raw to an array, and print this data-array byte by byte?

(This is the 1st time I use this site) I've tried many different ways, and all failed. Mostly 0s are being printed. Any idea how to approach this? I've spent the entire week on this already. Actually,...
0
votes
1answer
19 views

problem with recover.c using malloc and fread

i tried to write a function that sample 4 bytes from card.raw file but i doesn't work because fread doesn't put any data into block buffer so i wrote this simple code and i found out that fgetc works ...
0
votes
1answer
33 views

Pset1 cash.c Can't seem to wrap my head around it

So I'm just trying to slowly navigate my way through this problem by seeing if I can get the total amount to subtract 25 from the float. I keep getting an error message that says cash3.c:18:27: ...
0
votes
1answer
25 views

PSET3 Resize (Less) - works in debug50 but segmentation error when executing

I'm working on resize (less comfortable) in pset3 and it returns segmentation error when I execute the code. However, when I try to work out which line actually went wrong using debug50 and go through ...
0
votes
1answer
33 views

Is scan line not moving to the next line? I'm badly stuck. Please advice

I am getting only one green line, then a brown line and rest (about 90%) of the space filled with white and grey squares. I think, I am facing problem in moving the cursor to the next line. I tried to ...
0
votes
1answer
23 views

Unload works on small dictionary, but not on large? (speller.c / hash table method)

When testing with the small dictionary, it unloads as expected however when testing with the large dictionary, I receive the error "Could not unload dictionaries/large." The only difference that I've ...
0
votes
1answer
20 views

Pset 1: Cash help

I've put together my answer for the cash problem set, but when I run the program and enter an amount for "change owed" it always outputs 1. Being new to all of this, I'm not sure what I'm doing wrong ...
0
votes
1answer
25 views

pset 8 finance: “:( buy handles valid purchase” fails

I`am bug fixing my application and can't find a solution for the ":( buy handles valid purchase" test. Here is Log: expected to find "112.00" in page, but it wasn't found Log sending POST ...

15 30 50 per page