Skip to main content

Questions tagged [pset4]

The standard edition of Problem Set 4 will move beyond C programming language basics, testing your knowledge of pointers, memory management, file i/o and structs.

Filter by
Sorted by
Tagged with
1 vote
1 answer
11 views

PSet4, Filter-less blurs but gets a lot darker and doesn't match output

I'm having an issue with the blur filter; when working with Duck to understand how to structure my code, I was able to come up with a solution, but the output image was darkened and blurred up until ...
Manny's user avatar
  • 13
0 votes
1 answer
7 views

What is the return value of fread when it reads slack space?

This is my code for recover.c in pset4: #include <stdint.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc != 2) { printf("...
StarBirds007's user avatar
0 votes
1 answer
16 views

check50 says program isn't free of memory errors while valgrind says no memory leak is possible in recover.c

There is only one use of malloc in the program and it is freed before the program exits: #include <stdint.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) {...
StarBirds007's user avatar
0 votes
2 answers
32 views

CS50 python little professor problem

import random def main(): level = get_level("Level: ") correct_count = 0 for _ in range(10): x = generate_integer(level) y = generate_integer(level) ...
subhasis dehury's user avatar
0 votes
0 answers
20 views

Pset4: Check50 is not compiling my code for Filter-More

I tested my code and all functions seem to be working fine, I don't know what else to do. This is the output from check50, there are no warnings or hints about what I might be doing wrong. https://...
gabi's user avatar
  • 1
1 vote
1 answer
51 views

Problem Set 4 - Recover (timed out while waiting for program to exit)

After spending almost a week working on the code for the Recover exercise, I have finally made it work. However, when I check with check50, I get the error: :( program is free of memory errors timed ...
Stavros Marinos's user avatar
-1 votes
1 answer
67 views

pset4 adieu problem set 4

I am having trouble with the check50. On manual check, the code functions exactly as it is suppose to but on check50 I get the following error codes. :) adieu.py exists Log checking that adieu.py ...
Marilyn's user avatar
0 votes
1 answer
32 views

PSET 4 filter-less problem

I'm confused about the reason I can't pass this test, if anyone can notice what's the cause I would be grateful :) here is the log : :( blur correctly filters 3x3 image Expected Output: 70 85 95 80 ...
rida brahim's user avatar
0 votes
0 answers
13 views

pset4 reverse, check50 says file is not reversing as specified, even though the output file has a reversed version and seems fine

#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "wav.h" int check_format(WAVHEADER header); int get_block_size(WAVHEADER ...
Bijal Shrestha's user avatar
0 votes
1 answer
37 views

pset 4 recover program error

there is a problem in my recover program. when ever i run it, it always shows this command "free(): double free detected in tcache 2 Aborted (core dumped)."i cant point my finger to the ...
dhan8293's user avatar
1 vote
1 answer
34 views

Pset 4 Recover - Unable to read card.raw -fread issue?

Trying to see where I am getting caught up here. I thought that I had a grasp on the idea of the function. It complies and does not result in a segmentation fault although it does not pass check50. I ...
Jeff's user avatar
  • 21
0 votes
1 answer
53 views

Pset 4 - filter (less comfortable) Blur function

I am having difficulty understanding what the next step should be for the blur function. I have rewritten the code to try to make it at least more understandable to me after a few trials, however, it ...
Jeff's user avatar
  • 21
1 vote
1 answer
195 views

Little Professor display number of problems correct

Providing the whole code i cant spot what causing this error tried already shifting etc python tutor and rewriting getting back to the same spot. Can you spot whats wrong?? import random def main(): ...
Alkir man's user avatar
0 votes
1 answer
27 views

Incorrect blur for filtermore

for this problem, I have opted to use a strategy where I create a 1 pixel border in a copy image with RBG values = 0, to avoid running into segmentation errors when trying to access a pixel. I also ...
Kik's user avatar
  • 1
0 votes
1 answer
35 views

filter-less blur function

I am stuck at pset4 filer-less, blur function. The duck and chatgpt say that my code is correct but it doesn't give excepted outputs in any of Check50 result for blur function. //Blur image void blur(...
Arman Chauhan's user avatar
0 votes
0 answers
140 views

Little Professor check50 shows error even though program run completely fine

I'm facing an annoying issue while trying to validate my Little Professor results. I've ran the program several times and it does run as per the specs however when running the check50 it keeps on ...
Gilardino's user avatar
1 vote
2 answers
47 views

pset4 blur; artifacts on a white parts of an image

I believe I've done this part of filter-more task pretty well, but, unfortunately, an output image has some artifacts - blur works badly with white parts of an image. void blur(int height, int width, ...
REJEN RJ's user avatar
0 votes
1 answer
57 views

Pset4- recover: recovered jpgs appear to be empty

I tried to implement recover through the simplest and shortest way I could imagine. The code compiles and saves 50 JPGs with proper names, but when I open them, all of them are just empty and even ls -...
Fawz's user avatar
  • 1
0 votes
1 answer
47 views

Recover PSET 4 Week 4 - skipping while loop

This is a follow up to my previous question. After I went through my code on debug50 it shows that my while on line 35 is not going through. I checked my code with other others on this site and they ...
Raheel A's user avatar
0 votes
0 answers
146 views

bitcoin excersise problem set 4

the code works in my pc but check50 find this error and I don't understand why: Traceback (most recent call last): File "/tmp/tmptndsrole/test_two_coins/testing.py", line 28, in bitcoin....
domionico's user avatar
-1 votes
1 answer
48 views

CS50 PSET 4 Recover - segmentation fault and blank file

I have been trying to solve this question for a while now but I am still not sure what is wrong. The program works fine before the while loop but after it stops working and when checking with check50 ...
Raheel A's user avatar
0 votes
1 answer
47 views

CS50 Recover Problem: Why does it give Segmentation fault (core dumped)

I have looked all over to see other people with issues with segmentation default on this problem. I don't see that i have the same issue and i am not sure what i did wrong // Ensure proper command ...
TrytoLearn's user avatar
0 votes
1 answer
219 views

Why am I failing check50, Cs50p Little Professor

I get this reply after executing check50: :) professor.py exists :( Little Professor rejects level of 0 expected program to reject input, but it did not :( Little Professor rejects level of 4 ...
Mikail Kuehl's user avatar
-1 votes
1 answer
47 views

Pset 4 Filter (More) -- PLZ HELP

When I declare the array earlier, I end up with the wrong output. But when I declare it inside the loop, the final output is correct. Plz tell me how to explain this. The wrong one: void edges(int ...
xyj's user avatar
  • 1
-1 votes
1 answer
72 views

CS50 Pset 4 edges: Why do I keep getting segmentation fault?

Please help me figure out what's wrong! I've been doing this pset for so long now, and I feel like everthing should work, But I just get a seg fault! The code looks like... void edges(int height, int ...
Harr's user avatar
  • 35
0 votes
0 answers
6 views

I have an issue with my code in Pset4 Recover: It compiles right and makes all 50 needed images, yet there's no data seemingly in any of the images

#include <stdint.h> #include <stdio.h> #include <stdlib.h> // Defining a datatype for BYTEs typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("...
Kasra's user avatar
  • 1
0 votes
0 answers
36 views

CS50 PSET4 Recover. Files created, images visible, why check50 fail?

Why isn't check50 clearing even though the files are created and the images are visible? #include <stdint.h> #include <stdio.h> #include <stdlib.h> typedef uint8_t BYTE; typedef ...
Don Tan's user avatar
-1 votes
1 answer
42 views

pset4 reverse confusion

Just checking, are we supposed to write each block we fread() from the input with each element in the same order as we read them from the input file, or are we supposed to write them with each element ...
Joseph J Filoramo's user avatar
0 votes
1 answer
91 views

program is free of memory errors

Im about to finish pset4, currently on recover! Everything is ok at the first look, program compiles, however, there is a problem when I run check50. As you can see from the title, something is off ...
liza's user avatar
  • 13
0 votes
0 answers
41 views

pset4 filter/more edge

My code compiles and run okay I does everything but when checking with check50 It shows error My code is : #include "helpers.h" #include <math.h> // Make a copy of array void ...
Rex Kartik's user avatar
0 votes
2 answers
86 views

CS50 pset4 filters/less check50 error

I am trying to check my code using check50 but it gives me the error But when I am compiling it and running it from the terminal it runs just fine. My code for helper.c is #include "helpers....
Rex Kartik's user avatar
0 votes
0 answers
19 views

Pset 04 Edges FIlter. I don't know whats wrong with the code

I've been trying to implement the function edges with an auxiliary one, determineEdges. It compiles, but generates, probably by an error, a black image. I'm having trouble to figure out what is the ...
Alex's user avatar
  • 1
0 votes
0 answers
23 views

program in recover pset4, please help me find the errors and if you could add how to debug the code, its will be helpful

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("./usage: recover filename\n"); ...
Trex Vanga's user avatar
0 votes
1 answer
32 views

Problem with Edges Pset4

I've been at this Pset for a while now, I've got everything down except for Edges, and if I'm understanding correctly, every single value is coming out correctly except for the values for blue are 99% ...
Mohamed Amr's user avatar
0 votes
1 answer
24 views

Pset 4 Filter - The Blur filter. I only pass the "Blur correctly filters pixel in corner" though I can see that the output is entirely filtered

Here is my code.. It seems to work fine. I just can't tell why can't I pass the stupid checker! Hope someone can assist me. void blur(int height, int width, RGBTRIPLE image[height][width]) { ...
Mostafa Abdelnaser's user avatar
0 votes
0 answers
24 views

Recover, Produces 50 JPGS but doesn't pass check50 and the memory leak check is neutral (can't check)

#include <stdio.h> #include <stdlib.h> #include <string.h> int check(); int main(int argc, char *argv[]) { int name = 0; FILE *fptr = NULL; char filename[8]= {0}; int x = 0; int i = ...
Mohamed Khedr's user avatar
0 votes
0 answers
18 views

Having issues with PS4 Filter (Less) Blur Function

I feel like I'm really close to a solution to this problem, I just can't put my finger on where the issue is occurring any tips would be greatly appreciated. void blur(int height, int width, RGBTRIPLE ...
Daniel Thane's user avatar
0 votes
1 answer
25 views

Can someone please help me in resolving this issue. I don't quite understand what I am supposed to change here

Ok, so apparently there are no compilation errors. But what exactly is happening here. Like, why am I getting this error? P.S-Even help50 doesn't seem to be of much help here... The actual code is as ...
Soham Roy's user avatar
0 votes
1 answer
15 views

Iterating over the members of RGBTRIPLE struct

The RGBTRIPLE data type specified in bmp.h has three members, and I want to be able to iterate over them like: for (int k = 0; k < 3; k++) { printf("%i\n", image[i][j][k]) // prints ...
pherb's user avatar
  • 1
0 votes
0 answers
6 views

No error when image array out of index

I wrote some code for reversing the image, and was finding one of the columns wasn't moving - realised I was indexing image[i][width] element, which didn't exist due to 0-indexing. However it didn't ...
pherb's user avatar
  • 1
0 votes
1 answer
60 views

my 'reverse' code works on wav files but it doesn't pass check50

#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include "wav.h" int check_format(WAVHEADER header); int get_block_size(WAVHEADER header); int main(int argc, ...
ME Desings's user avatar
0 votes
1 answer
58 views

in pset4, recover, why is the first jpg found treated differently from the other jpg files?

I'm starting to work on pset4, recover, and (as you can tell) things are not going well. I read posts from other students working on the same problem and realize some of them check for the jpg header ...
Alvaro Barboza's user avatar
0 votes
1 answer
34 views

pset 4: recover only recovers grey and black squares

I am unsure on why my code is only recovering black and grey squares, instead of images. I have tried closing the file img in multiple places, and I still can't seem to solve the problem, I believe it ...
Robbie's user avatar
  • 5
0 votes
1 answer
174 views

cs50p pset4 bitcoin

According to the presentation of week 4, we can access to the dictionary element with the following expression: o = response.json() for result in o["results"]: print(result["trackName&...
Victor Araya's user avatar
0 votes
1 answer
40 views

PSET4 Recover Successfully Generates Images But Does Not Match Correctly

Currently on PSET4 Recover. My code manages to generate 50 images which can be opened, however check50 states the images do not match correctly. Would anyone be able to offer some advice? #include <...
chonker's user avatar
1 vote
1 answer
15 views

PSet 4 - Recover. The first picture (000.jpg) doesn't get recovered, all other images do (049.jpg is the last image recovered)

Everything else works in my code, no memory leaks, all other images are loaded properly, except the first one. I've gone through debug50 to try and see the problem, but I can't seem to find one since ...
They think im slow EH's user avatar
0 votes
1 answer
38 views

pset4 recover segmentation fault (core dumped)

I am getting segmentation fault and i was searching on the internet, comparing with other codes, reading this forum, etc. and i still can not fix mine. Explaining my code from the while: read the ...
Victor Araya's user avatar
0 votes
1 answer
28 views

Pset4 Recover getting segmentation fault but I have no idea why

This is the answer I have come up with for pset 4 recover: #include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char *argv[]) { // Ensure proper usage ...
dbergkamp5's user avatar
0 votes
1 answer
39 views

What is wrong in my TODO 8? PSET04 - RECOVER

I'm Currently doing the PSET04 Recover. I've done all the TODOS, but in the last one, I think I have an error and I don't know why. Check50 prompts me everything is ok except for the last requirement. ...
AlvaroAndLukeTheCoder's user avatar
1 vote
1 answer
49 views

Why does the 0.49 jpg file doesn't match correctly?

I'm doint the recover PSET04. I think, I've done everything correct expect of the 0.49 jpg file. It says that it doesn't match correctly. And the last error in Check50 is "can't check until a ...
AlvaroAndLukeTheCoder's user avatar

1
2 3 4 5
37