Questions tagged [cs50x]

The tag has no usage guidance.

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

Pset5: check returns hashtable pointers as NULL despite hashtable values printed correctly in load

My check function returns all hashtable indexes as NULL (I printed a known index of 124 and still returns NULL), despite all indexes printed correctly in load. I am not sure where exactly the problem ...
0
votes
1answer
10 views

CS50 Final Project Jinja For Loop Not Running

My final project is a task website that allows you to create tasks, complete them, and get alerted when you haven't done a task on time. Currently, I am working on alerting when the task is due. The ...
0
votes
1answer
11 views

how can I rewind the fread() funtion as byte

is there a way to fread() the same bytes you just had read? fread(buffer, 512, 1, inptr); if (header(buffer) == true) { //execute these lines do { //execute these lines } ...
0
votes
1answer
9 views

Pset 4 Filter(less) Blur

I'm having an issue with the counter variable of my code. I wrote a printf to see if it returns 4, 6, or 9. Which is what it should do, if my IF conditions are correct. Unfortunately it does not ...
0
votes
1answer
7 views

Errors with Valgrind on Speller (Still Reachable) - PSET5

I am almost done with speller but when I pass it through valgrind, it says there are some mistakes. More specifically, it says a bunch of bytes are still reachable. I don't know whether my problem is ...
0
votes
1answer
20 views

CS50 Recover (pset4). Images dont seem to load

my program compiles successfully but it doesn't seem to produce any images at all. I tried using debug50 and it seems like the if condition for buffer[0] through to buffer[3] isn't fulfilled, or the ...
0
votes
1answer
17 views

How can I create a loop to read end of the card.raw file?

I'm using the basic expressions have been taught in the short videos but probably I'm implementing them wrong, especially I believe I'm using the wrong data types for my variables :/ My loop ...
0
votes
0answers
18 views

Students only passing 4/6 the last two showing concatnation error but works locally somebody help

[33mTraceback (most recent call last):[0m [33mFile "roster.py", line 34, in main()[0m [33mFile "roster.py", line 27, in main print(row[0] + " " + row[1]+" "+ ...
0
votes
0answers
16 views

pset3 tideman cs502020 locked pairs error

I am new to coding and I am trying to solve the locked pairs part of the Tideman problem. Currently, I am receiving the following two errors: :) lock_pairs locks all pairs when no cycles :( lock_pairs ...
0
votes
0answers
18 views

Finance - Buy Implementation

I am getting the error message "500 Internal Server Error" when trying to buy shares. Can you please tell me what I am missing? The application.py code is: @app.route("/buy", ...
0
votes
0answers
9 views

cs50 pset3 print winner function

Im strugling with print_winner function in Tideman election program. In my opinion function workes fine. It prints the candidate which has all false values in column under his name (number) in locked ...
0
votes
1answer
15 views

Pset 2 - Caesar - segmentation fault when input is null

I recently started cs50 and I finished caesar after great difficulty. Everything is working when I run check50 except there is a segmentation error when the input is null. I did search a few forums ...
0
votes
2answers
35 views

Check50 all green but my own tests fail

I completed Runoff with 100% pass in check50 but when i do my own tests i get wrong winners. I checked everything to the best of my abilities but i just can't find the problem and it's driving me ...
0
votes
1answer
14 views

Cash 50 - Less Comfortable. Trying to nest so the algorithm will consider all money levels. Not working

coder newbie here. As far as I understand, this should work. This is the logic of my code... I get the float input from the user, and keep asking until I receive a positive number. I change this into ...
0
votes
1answer
15 views

Pset 2 - Readability -> Wrong grade

I'm having problems with the Pset 2 problem: readability. The goal of exercise is to implement a program that computes the approximate grade level needed to comprehend some text using the Coleman-Liau ...
1
vote
0answers
19 views

Are we allowed to upload the class solutions to our personal Github account?

I just started the intro course for CS50 and I was hoping to upload my solutions onto my personal Github once completed. I do not remember seeing any rule against this but I wanted to be sure I was ...
0
votes
1answer
11 views

Error in CS50 IDE Terminal

I was working on the cs50 IDE and noticed this happen a couple of time - As you can see in the last terminal in the last entry the substitution changed to subst i don't know why. This happens mainly ...
0
votes
0answers
24 views

Skipping More Comfortable psets

People who have completed the psets how often did you skip the more comfortable psets and did you complete them all before submitting the course and if not did you miss out on stuff due to that?
0
votes
0answers
15 views

Private cs50 Repository

Whenever I submit the psets they are added to a private repository in my Github account. After I complete the course will I be able to make them public too? Is it a good idea to add a readme file ...
0
votes
0answers
14 views

What is the difficulty level of cs50 problems?

I am totally new to coding and I struggle a lot with each problem, I learn a lot this way as well. I was wondering what is the actual level of difficulty of these psets? Will someone who studies CS ...
0
votes
0answers
17 views

Week 4 recover seg fault

#include <stdio.h> #include <stdlib.h> #define BYTE 512 #define NAME 8 int main(int argc, char *argv[]) { //check for valid input if(argc != 2) { //Promt user for valid input printf("...
0
votes
3answers
35 views

When to Start the Next Week?

I finished the pset from Week 1 however I am still unable to finish the credit problem. Should I move on to Arrays and come back at a later time or wait until I am able to solve it?
0
votes
1answer
19 views

check50 for plurality

Every example I try myself works perfectly fine but once I check50 it, I get error messages for not printing one,two, or all three winners. I saw some people having format issues with spaces, but I ...
0
votes
0answers
16 views

Django form does not render in html template

so I've been trying to render a django form in an html template for about two hours now and I can't seem to get it to work. Any one with an idea or solution to this should kindly share, thanks :) Here'...
0
votes
1answer
34 views

cs50 2019 Vs 2020

I have just started with cs50 and registered via EdX as auditing the course, now I noticed the lectures linked on EdX are noted as 2019 on Youtube while a new session is going on as 2020 on Youtube. ...
0
votes
2answers
26 views

How can I check my number of rows on pset7 movies?

I wanted to check my queries one by one as I am doing them, my 1.sql works fine but how I find out how many rows I am getting?
0
votes
1answer
26 views

cs50 speller code complies and run also successfully. but it not qualifying for big board

:) dictionary.c and dictionary.h exist :) speller compiles :( qualifies for Big Board expected exit code 0, not 139 :| passes benchmarking can't check until a frown turns upside down how to fix this *...
0
votes
0answers
23 views

cs50 pset3 tideman lock pairs and print winner function are not working rest all are working

in lock pair (lock_pairs skips final pair if it creates cycle is working) rest all lock_pair and print winner is not working. #include <cs50.h> #include <stdio.h> #include <string.h> ...
0
votes
0answers
8 views

CS50 pset 3 Plurality - Works until…Segmentation fault, and not enough vote prompts?

Task is to have people type in their votes for the candidates given in the command line, then the most voted candidate wins. I only need to and am allowed to write code for the last two function ...
0
votes
0answers
35 views

I'm STUCK for a good while in pset3 Tideman last 3 functions :(

I'm mostly concerned about the sort_pairs() function atm, but i'm willing to receive answers regarding the whole code. I can't really see what's wrong with the way i coded it in general, but mostly ...
0
votes
0answers
11 views

My program does **NOT** skip the last pair if it creates cycle. #PSET3 #Tideman

my program has apparently one bug. check50 says my program does NOT skip the last pair if it creates cycle. However, I ran my function through debug and it did skip the last pair and did not write ...
0
votes
0answers
58 views

I'm stack with dna (pset6). can you please help me?

I have divided my code into three main pieces: 1- open the CSV file and read its contents into memory and open the DNA sequence and read its contents into memory 2- compute the longest run of ...
0
votes
0answers
17 views

In pset2: why i am able to iterate through the for loop for just one ? and also the program is processing after looping once?

#include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string.h> int main(void) { string str= "Hello"; int l =strlen(str); string str2[l-1]; ...
0
votes
1answer
113 views

PSET 6 DNA: How to get number of repeats for each value of STR's? [SPOILER: Full code]

I have written a code to count the highest number of consecutive repeats of specific DNA substring sequences in a long string of DNA...or so I thought. While my code can correctly count the longest ...
0
votes
0answers
10 views

i am Unable to Generate the ssh-key ,and what does ssh-aget mean and how to generate one?

i am unable get through the process of the SSH-key creation,below is the terminal error i am getting related the ssh-key.hope you all there try to figure this tedious quest of mine... ~/pset1/hello/ $ ...
0
votes
0answers
10 views

cs50 pset4 filter edge function. HOW TO FIX STACK OVERFLOW

void edges(int height, int width, RGBTRIPLE image[height][width]) { float b[height][width]; float g[height][width]; float r[height][width]; int gx_b[height][width]; int gx_g[height][width]; int ...
0
votes
0answers
5 views

cs50 pset4 fliter more edge function. CODE IS GETTING COMPILED BUT WHILE RUNNING IT IS SHOWING STACK OVERFLOW. HOW TO FIX IT

void edges(int height, int width, RGBTRIPLE image[height][width]) { float b[height][width]; float g[height][width]; float r[height][width]; float *blue; blue = malloc(sizeof(float)); float *green; ...
0
votes
1answer
19 views

Is it just me or PSET2 Correction seems to have a mistake

I ran the check50 on my pset2 Substition.c I get everything right except for 1 encrypts "This is CS50" as "Cbah ah KH50" using YUKFRNLBAVMWZteogxhcipjsqd as key expected "...
0
votes
1answer
29 views

Pset2 Readability Not Working

I need help in executing the program here. This is my program and when I execute it, it asks me for a text. I copy-pasted the first HOW TO TEST YOUR CODE "One fish. Two fish. Red fish. Blue fish.&...
0
votes
1answer
23 views

Cash program only outputs input*4

I'm very new to coding and am really struggling with pset1- cash. I watched some tutorials and walkthrough videos, and with my limited knowledge, I cannot find any issue in the code I made. With the ...
0
votes
2answers
54 views

Wanting to understand PSET4 Recover Else if statement

I have a question regarding a else if statement for the PSET4 Recover while (fread(buffer, 512, 1, card_raw)) { if (buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff &...
0
votes
1answer
40 views

pset 4 - recover. Can't figure out what is going wrong!

Can't figure out what I'm doing wrong, I've spent like 2 days on it already, please help! #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc != 2) {...
0
votes
1answer
52 views

Issue with recording STRs in memory (PSET6 - DNA)

I'm trying to record the number of repetitions of each str in the sequence. I created a dictionary as below and another empty dict because i couldn't update a dict while iterating through it. But for ...
0
votes
0answers
19 views

pset4 (less) filter - blur please help

I've been stuck on this project for a while... I looked at other people's questions but still cannot find our where I did wrong. Can someone help me see where the bug is... void blur(int height, int ...
0
votes
1answer
20 views

CS50 Recover - Cannot figure out why my While loop is not being invoked

When I run the following code, it doesn't appear as if my while loop is being invoked because it never prints the print statement, but I cannot find a reason why it is not running the while loop. #...
0
votes
1answer
49 views

CS50 Pset4 Blur

Greatings fellow Humans So I am about at my wit's end with this one. I have set it all out and have the maths (I beleive) correct on the averages. BUT... check 50 says that some of the averages are ...
0
votes
2answers
47 views

CS50 Speller returns all word as mispelled and I can't find any mistake in my code

I need help, I can't get around this problem set. I have searched everywhere and I think the code is equal to most of the other students... The problem is that the check function is returning true ...
0
votes
1answer
34 views

pset4 - can't figure out what i'm doing wrong - recover

This is the code: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc != 2) { return 1; } FILE *file = fopen(argv[1], "r&...
0
votes
1answer
38 views

set8 tracks/finance cs50

Im getting error 500 messages, when it should instead show the index page after buying or when clicking on history and sell. This is my code for index(). def index(): """Show ...
0
votes
1answer
19 views

How to add files to Desktop in CS50 Sandbox

I am wondering how to add files to the desktop in CS50 Sandbox. If you are wondering how to make a desktop, here is a list of step by step insturctions. Open CS50 Sandbox. Click on the plus. Click ...

1
2 3 4 5
16