All Questions

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

CS50 Web Programming Mail Pset - DOM reloading on every form submission

On the mail pset the inbox page loads as default whenever the DOM is loaded. Whenever I submit my form to send an email the DOM is reloaded and inbox pops up. I'm trying to get the sent mailbox to pop ...
0
votes
1answer
8 views

pset4 / recover / invalid or unsupported image format

I've been working on RECOVER from PSET4. I'm able to compile and it creates all 50 images. When I try to open any of the images I get an error saying "invalid or unsupported image format". I'...
0
votes
1answer
11 views

pset5 speller: valgrind 937 errors from 1 context

I have done check50 and the only error is "valgrind tests failed; rerun with --log for more information". I can't find the source of the memory leak and I thought that my unload made sense. ...
0
votes
0answers
5 views

Placing django_markdown2 somewhere in my PYTHONPATH

I am going over the documentation for using django-markdown2 in Project1, and I don't know what is the best way to: 'Place django_markdown2 somewhere in your PYTHONPATH.' https://github.com/...
0
votes
0answers
7 views

Why do the deepcopies in my minimax implementation (project 0b) look like they're getting altered?

The minimax function has a max function and a min function. The recursion takes place between them, where the max function calls the min function and the min, calls the max. While exploring a node, ...
0
votes
0answers
12 views

CS50 - PSET2 - Substitution Segmentation fault

I keep getting 'Segmentation fault' every time I run the code(mentioned below). The code is compiling just fine. It's asking for input and is returning required message when the command line argument ...
0
votes
0answers
7 views

Why do I have a segmentation fault in my Caesar coding from pset2?

#include <stdio.h> #include <math.h> #include <cs50.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int main(int argc, string argv[]) { if (argc != 2)...
0
votes
1answer
10 views

Query related to Mario program(more) in CS50 pset1

I can't figure out the problem in my code, it successfully creates a pyramid but doesn't reprompt when value other than 1-8 is entered, also it gives a space before printing the pyramid, causing ...
0
votes
1answer
11 views

pset4 / recover Segmentation Fault

I have been trying to solve RECOVER from PSET4 and I keep getting a segmentation fault. Any ideas on why this happens? Thank you so much for any help. #include <stdio.h> #include <stdlib.h>...
0
votes
1answer
8 views

CASH issue - help needed

I've been struggling with this for a month now so any help will be appreciated. The program just returns the value of input, so although there are no errors in compiling, it doesnt actually produce ...
0
votes
1answer
8 views

My program doesn't run when i close the condition's range. When i leave the range open it does't give the answer i want

#include <cs50.h> #include <stdio.h> #include <math.h> int main(void) { float change; int cents = 0, coin_number = 0, quart = 25, dime = 10, nickel = 5, penny = 1; //...
0
votes
0answers
4 views

CS50w flack (chat) project: channel user list stops updating after a while, can't understand why

This is a weird one, so I've recorded a short video to better illustrate the problem. As an additional feature to my chat app I have a panel on the right that displays the users currently on the ...
0
votes
0answers
7 views

Internal Server Error

Error Message: "Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.&...
0
votes
1answer
12 views

Caesar Pset2 Handles non-numeric key :(

I am tearing my hair out on this exercise. I cannot get it to pass a non-numeric key. I've played around with the code for 2 weeks now. I can either get it to handle a numeric key or handle a lack of ...
0
votes
0answers
17 views

Help with Python DNA!

Here is the code I have an issue with: https://i.ibb.co/0VrvCqj/code2.jpg It works for small databases but not the big ones. Here the code works and shows Albus when it should show Lavander. As you ...
0
votes
1answer
15 views

PSET 4 BLUR and 2 of REFLECT

All of reflect works except reflected a 1 x 2 and a 4 x 4 (3x3 works fine) None of blur works except for when a point is in the corner, which makes little sense. I've sluthed around other answers and ...
0
votes
1answer
17 views

PSET5: memory leak in check function

bool check(const char *word) { unsigned int hash_index = hash(word); node *trav = table[hash_index]; while (trav != NULL) { int len = strlen(trav->word); char ...
0
votes
0answers
7 views

Why does the code output incorrect amounts?

The code is here: https://pastebin.com/gKnVmPFf I've checked that it's not because of neighboring cells, because I am translating them onto a different array. I can't seem to figure out want is wrong. ...
0
votes
0answers
25 views

PSET 5 SPELLER - HELP!

i'm not sure why this happens when I execute the code. The program seems to never end as if it's running an infinite loop. When I run valgrind on it misspelled words keep spewing out and it gives me a ...
0
votes
1answer
14 views

PSET4 recover: program compiles but doesn't recover any image

So, I'm using quarantine to learn C. I'm currently stuck at the Recover problem. My code compiles, runs but the result is not what I would've expected. I've explained this code to myself a thousand ...
0
votes
0answers
7 views

Project 0 submission date

Hope you are doing well. I wanted to inform you guys that i had enrolled in this course on 6/26/2020, and now the course material has been changed. Can someone please tell me that from where i can ...
0
votes
1answer
17 views

PSET 5 SPELLER - seg fault

I need help with my unloads function. I keep getting a segmentation fault on "while(cursor->next != NULL)." When I hover over the "cursor->next" part it says no value. I don'...
0
votes
1answer
18 views

Pset5 - Where am I leaking 1 block of memory?

// Implements a dictionary's functionality #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include "dictionary.h" #include <string.h> #include <...
0
votes
0answers
18 views

CS50x pset2 substitution, check50 test returns negative even though output is correct

My code fails only one of the test in check50 even though the output is correct and passes other ones. The test it fails: :( encrypts all alphabetic characters using DWUSXNPQKEGCZFJBTLYROHIAVM as key ...
0
votes
1answer
12 views

Making code neater: a way to reduce repeated logical operators?

For CS50 pset1 Credit I'm using repeated logical-OR operators (||) to work out the validity and card brand of a credit card number. When I evaluate the style of my code using style50 it says to insert ...
0
votes
1answer
13 views

Pset4 less comfortable compile error

When I try to compile my helpers.c file the compiler shows me clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow helpers.c -...
0
votes
1answer
15 views

Pset5: strcasecmp doesn't return 0 when given the same string input

// Implements a dictionary's functionality #include <stdbool.h> #include <strings.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> ...
0
votes
1answer
12 views

PSET 5 SPELLER - segmentation fault

I keep getting a segmentation fault on my load function when using the debugger. Specifically, the line with "if(table[num]->next != NULL)" is what is causing it. I need some help, please....
0
votes
1answer
14 views

Pset 3 Plurality Help (still not working)

When I compile my code it works, but when I try to run it, it says segmentation fault. I believe the segmentation fault is on the line that says printf("Winner is %s with %i votes\n", winner,...
0
votes
0answers
13 views

How can I compare 2 dataframes on DNA?

obtained 2 data frames but I really don't know how can I compare them. Do you have any ideas? ~/pset6/dna/ $ python dna.py databases/small.csv sequences/1.txt name AGATC AATG TATC 0 0 4 1 ...
0
votes
1answer
17 views

Finance - Error with Index

I can't seem to figure out where I've gone wrong with index. I keep running into these two errors: After login, when directing to index - 500: Internal Server Error (raise TypeError("...
0
votes
1answer
15 views

pset5 valgrind tests failed

I'm very close to completing pset5; all smiley faces except the Valgrind memory leak. I'm hoping someone can help find the problem. I am only leaking 112 bytes and have tried to fix the issue by ...
0
votes
0answers
9 views

Uploading Website

I forgot how to upload a website using cs50's server. Can someone please remind me? (I'm referring to the url of the form "username.cs50.site") Thank you!
0
votes
1answer
18 views

pset4 - My recover programme compiles but doesn't generate JPEGs as expected

After 12hrs of banging my head against this, and having trawled Stack Exchange, I've decided that it's time to ask for help! Really not sure where I'm going wrong, but suspect it's related to the ...
0
votes
1answer
16 views

pset8 finance - 'NoneType' object is not subscriptable - issue

I have read in other comments that API may return error sometimes due to volume and others. Is there a way around it? Can we temporary bypass the issue, or is there any way to continue checking other ...
0
votes
1answer
25 views

How do you find the first digit of a long number?

I wrote the following code to try to find the first digit of a long number (this is for the CS50x "Credit" exercise), but it's not working. Any tips? // Conditions and relational operators #...
0
votes
1answer
10 views

pset4 recover only recovers 25 correct images

This is my code for recover. When I run the program, it gives me 25 successfully recovered photos. I don't know why it is only giving me half the required photos. I believe it might have something to ...
0
votes
1answer
14 views

CS50 - edge filter pset4

I'm working on the edge filter in pset4 in CS50. The code compiles but when checking the code with check50 I get multiple errors. Looking closer at the output of the error check the first row and last ...
0
votes
1answer
18 views

pset5 speller - valgrind & case sensitivity

So valgrind has identified line 102 as the potential source of memory leak which is the following within the load function: node *n = malloc(sizeof(node)); Have I missed freeing up this memory later ...
0
votes
1answer
7 views

Prints “ Invalid vote ” for “ code 1 ” as vote function But works fine for “ code 2 ” as vote function. Whats wrong with “ code 1 ”?

// CODE 1 :- bool vote(string name) { // TODO for (int i = 0; i < candidate_count; i++) { if ( candidates[i].name == name ) { candidates[i].votes = candidates[i].votes + 1 ; return true ; } } ...
0
votes
1answer
11 views

Pset5 : Valgrind seg fault in load function

Currently doing the pset5, and keep getting seg fault when running Valgrind. This is the error messsage I get: /etc/profile.d/cli.sh: line 94: 1150 Segmentation fault valgrind ./speller texts/...
0
votes
1answer
10 views

Readability check50 error

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // Letters detects letters // Words detects spaces // Sentences detects ...
0
votes
1answer
6 views

CS50 cash problem question

Since I'm a complete newbie to writing programs, I'm utterly stumped for the "cash" problem for the first week's lessons. I've watched some practice videos and tested those, but something or ...
0
votes
1answer
9 views

Readability compiling issue

Readability (Problem Set 2) #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> // Letters detects letters // Words detects ...
0
votes
1answer
17 views

PSET2 Readability - tests no passing

I am not sure what I am doing wrong. #include <stdio.h> #include <cs50.h> #include <ctype.h> #include <string.h> #include <math.h> int main(void) { //Create integers ...
0
votes
0answers
16 views

pset 3: i dont understand why runoff is not being ececuted?

#include <cs50.h> #include <stdio.h> #include <string.h> // Max voters and candidates #define MAX_VOTERS 100 #define MAX_CANDIDATES 9 // preferences[i][j] is jth preference for voter ...
0
votes
1answer
17 views

Trouble with find_min

I'm trying to implement a bubble sort in the find_min function in pset3 runoff. But It looks like it is not returning the correct min. I think it is because candidates[0].votes may not be the lowest ...
0
votes
1answer
12 views

Week 2: valid_triangle function example — compiling [errors]

This goes to week 2: Functions mini lecture. We create a custom function for verifying whether we have a valid triangle by assessing it's 3 sides. I wanted to elaborate on the code. Since, this ...
0
votes
0answers
21 views

SPOILER - CS50: Python PSET6. How do I ensure that my code does not show 1 and 2?

I am about halfway done with my python Pset6 code for DNA. One problem I have been having is that without this particular line of code below: lresults = [i for i in lresults if i != '1' and i != '2'] ...
0
votes
0answers
8 views

project0 - degrees/ ModuleNotFoundError: No module named 'util'

i'm new in the AI course and i'm trying to solve project 0 (degrees). i still haven't written any code but was trying to run degrees.py and its giving me an error ModuleNotFoundError: No module named '...

15 30 50 per page
1
2 3 4 5
230