All Questions

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

CS50 Web 2020, Project 1 - Wiki, CSS not working

I'm currently using Django as explained in cs50w 2020 lecture 3. Under the static folder inside encyclopedia directory is the styles.css. This was in the distro code and there is already some styles ...
0
votes
1answer
19 views

Pset4 reflect works but doesn't pass check50

I am so close on the reflect function for pset4. When I run the program it appears to work properly, but it doesn't pass check50. Does anyone know what I am doing wrong? void swap(RGBTRIPLE *a, ...
0
votes
0answers
27 views

Almost Done… But substrings

// Returns true if word is in dictionary else false bool check(const char *word) { //Variables bool looping = true; int hashWord = hash(word); //Create a new pointers node *head = table[hashWord]; ...
0
votes
1answer
17 views

PSET 7 HOUSES - Syntax error on case function

I'm trying to select the first name and last name and ONLY select the middle name when there is one. The logic of my query makes sense. Every time I am extracting the first name, last name, and birth. ...
0
votes
0answers
31 views

PSET5 dictionaries won't load

I cannot get my dictionaries to load and cannot figure out why. Here is my load function: // Loads dictionary into memory, returning true if successful else false bool load(const char *dictionary) { ...
0
votes
1answer
48 views

CS50Web python. I can't get a new entry to save and show on the homepage of my wiki project. I am using Django with python

I can't get my code to save a new entry and return an error message if entry already existed. its just the views.py I can't figure out help please. code below
0
votes
0answers
54 views

CS50W - Wiki w/ Django - Search Bar

I cannot for the life of me get the HTML form to transfer the user's search into my search function within views.py. I've tried this a number of different ways and I either just get no movement (as I ...
0
votes
1answer
20 views

PSET6 Credit - checksum not giving the correct number

list1 = list(input("Number: ").strip()) even_count, odd_count, count = 0, 0, 0 # if the length is even if len(list1)%2 == 0: # iterating each number in list for num in list1: ...
0
votes
2answers
32 views

PSET 1 Credit; Sometimes Check50 works and other times it doesn't

Why does Check50 work for certain credit numbers and not others? I ran debug and found that for some credit numbers and not others it may randomly be always one away from a multiple of 10 preventing ...
0
votes
1answer
29 views

CS50 PSET 4 REFLECT FAILS CS50

This code does indeed reflect the image, but, there is a slight line in the middle. And CS50 fails it completely // Reflect image horizontally void reflect(int height, int width, RGBTRIPLE image[...
0
votes
1answer
15 views

incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *

bool vote(int voter, int rank, string name) { // TODO for(voter=0;voter<=voter_count;voter++) { for(rank=0;!strcmp(name, candidates[rank].name == 0);rank++) { preferences[voter][...
0
votes
1answer
47 views

pset4 filter blur problem

the images is blurry but the check gives errors (it only blurs correctly the edges and corners apparently ...): :( blur correctly filters middle pixel expected "127 140 149\n", not "...
1
vote
1answer
23 views

Unexpected error in homemade string search function

I am playing around with Python on the DNA problem. I realize there are some string methods that might make this problem easier but my gut instinct was to try and make an "search function" ...
0
votes
3answers
78 views

pset3 plurality check50 invalid vote

So I have a few questions on Plurality check50 errors for this Pset: My Code is as follows: #include <cs50.h> #include <stdio.h> #include <string.h> #include <math.h> // Max ...
0
votes
1answer
23 views

Struggling to align pyramid and check for extra spaces at the end of each line in pset6 mario.py less

I'm struggling to meet these specifications - "Be sure that the pyramid is aligned to the bottom-left corner of your terminal, and that there are no extra spaces at the end of each line." ...
0
votes
1answer
24 views

CS50 Pset4 Filter (More comfortable) Edges Function

I am trying to code CS50's Pset4 Filter (More comfortable)'s edges function, but I keep on getting a different value. This is the link to the video explaining what I am trying to do in this function, ...
0
votes
0answers
12 views

Problem with endblock tag in finance. “endblock” tag unknown

{% extends "layout.html" %} {% block title %} Quote {% endblock %} {% block main %} <form action="/quote" method="post"> <div class="form-...
0
votes
1answer
15 views

Week 1 Credit; Not Creating Variable

I'm starting the week 1 credit problem, however, when trying to set together every second digit it simply does not print. Could you help me identify where I went wrong? Thanks! #include <stdio.h>...
0
votes
1answer
26 views

Can't submit or check

I'm trying to upload my assignment, but I keep getting the same error whenever I run the check50 or submit50 command: "Make sure your username and/or password are valid and submit50 is enabled ...
0
votes
1answer
35 views

Pset5: Speller. incorrect counting of mispelled words

I've been working on this code for the last two weeks... I load the correct # of words into the dictionary, but I get an incorrect number for misspelled words. I believe its an issue either with my ...
0
votes
1answer
32 views

CS50 Week 4 Recover. Generating 50 Blank images

Here is the code any help is greatly appreciated. Thanks! #include <stdio.h> #include <stdlib.h> #include <cs50.h> #include <stdint.h> #include <stdbool.h> typedef ...
0
votes
1answer
40 views

pset3 Tideman: checking for cycles

I made it so that if a losing candidate in any pair wins in another, a function checks whether there's the losing candidate in that pair wins in any other, and so forth. this here is the unlocks the ...
0
votes
1answer
29 views

pset 1 - cash problem - No errors, am rounding, but still not always correct amount of coins

I'm having trouble finding out where the problem with my code is on the Cash problem in the CS50 problem set 1. In the other questions for this problem on this forum it often seems to be the round() ...
0
votes
2answers
23 views

Pset 5 Help understanding Valgrind output

I was wondering if anyone could help me with interpreting the Valgrind error to trouble shoot. There are no memory leaks, but I am getting this error "Conditional jump or move depends on ...
0
votes
2answers
32 views

Logic for reflect function in pset4 filter

I'm working through pset4 filter and the code for the reflect function. I'm still getting errors so clearly there's some kind of issue with my logic. When I try to apply filter to an actual image, I ...
0
votes
1answer
22 views

pset4 filter: blur check50 shows same values, but is returning an error

The blur image seems to be working and according to the error I am seeing, it looks like it is getting the right values, so I thought it might be a rounding error, but I have tried every combination ...
0
votes
1answer
36 views

I get segmentation fault after this line and I don't know why

I get segmentation fault at this point in my code and I can't figure out why string convert(string text, int num_copy) { string new_index = NULL, answer; for (int j = 0; ; j ++) { if (isupper(text[...
0
votes
1answer
12 views

When I run the testing code, it says that movies.db does not exist. How should I fix it?

This is my code in the terminal: cat 1.sql | sqlite3 movies.db This is the output: Error: near line 1: no such table: movies.db
0
votes
1answer
19 views

Dynamically change the row colour of a table in HTML that was generated using jinja

As part of PSET8 finance additional implementations, I want to dynamically colour the table in history.html. The simple code uses jinja2? to populate and print out a table in html. {% extends "...
0
votes
0answers
20 views

DNA Pset6 Can't run my program

I cant even run my program it keeps saying "list index out of range". I don't know whats wrong... Does anyone have any idea? import sys import csv def repeats(seq, part): rep = [0] * ...
0
votes
1answer
68 views

Pset6 DNA help - trouble calculating STR repeats with long database

I have really tried to just solve this one myself but after a few weeks this seems futile without guidance. I am having trouble getting a for loop to calculate the maximum consecutive occurrences of ...
0
votes
1answer
26 views

pset4: recover segmentation fault

The code compiles fine but when running ./recover i keep getting a seg fault. i tried valgrind but still can't seem to get what the problem is exactly. #include <stdio.h> #include <stdlib.h&...
0
votes
0answers
15 views

Facing issues while trying to Post HTML form contents to views.py route using fetch method POST in javascript

Hello I am trying to post information i get from a form to an API that submits it to the views.py file in Django. Can anyone tell me where i am going wrong. Below is my javascript code ...
0
votes
1answer
11 views

Can anyone tell me why this doesn't work?

#include using namespace std; int countDigit(int n) { int digits; while (n != 0) { n = n / 10; digits++; } return digits; } int main() { int number; cin >> number; int cycles = ...
0
votes
0answers
16 views

Program just exits instead of printing errors

#include <stdio.h> #include <ctype.h> #include <string.h> #include <stdbool.h> #include <cs50.h> int checkerrors(int argc, string argv[]); int main(int argc, string ...
0
votes
1answer
28 views

Recover jpeg runs only in debug

When I run my code in debug mode it works fine and creates 50 jpg images. When I run it like ./recover card.raw it waits forever without an error code. When I submit it, it times out. What am I doing ...
0
votes
1answer
8 views

Find hex values inside a string in C?

I have a long string "given_string", and I'm trying to find hex values within that string. Here's a simplified example: /* Find a sub-string in a given string: */ char * given_string = &...
0
votes
1answer
15 views

Do I need to install any compiler for compiling a C program in cs50 sandbox? If not then why am I not being able to compile my program?

I am new to programming and has basicly started with c program but after i write a code and try to compile it by,"make untitled1" I get an error message.
0
votes
2answers
32 views

I keep getting segmentation fault and I don't know why

I'm trying to print the value of argv[1] to check if the program will run as expected. It compiles fine, but I keep getting 'segmentation fault' when the program runs. #include <cs50.h> #include ...
0
votes
0answers
24 views

isalpha() returns non-zero integer with non-alphabetic character

#include <stdio.h> #include <ctype.h> int main(void) { char c = '+'; int example = isalpha(c); printf("%i\n", example); } It should return 0 but it gives me random ...
0
votes
1answer
17 views

Pset5 - :( program is free of memory errors valgrind tests failed; rerun with --log for more information.)

// Implements a dictionary's functionality #include <ctype.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #...
0
votes
2answers
19 views

CS50 pset4 filter reflect issue

i am missing something here...but not sure what... it doesn't work on normal images... check50 passes for 1X2 and 1X3 images but fails for 3x3 and 4x4 images (so i guess it is an issue of iterating ...
0
votes
0answers
24 views

check50 showing all okay for incomplete submission

Editing my question slightly. After uploading submission, check50 is only showing a smiley with "Finance submitted" (see screenshot below). My "progress" page is also showing ...
0
votes
1answer
14 views

Pset5 - ( program is free of memory errors valgrind tests failed; rerun with --log for more information

Please assist me how to resolve such an error. see my code below: // Scans dictionary word by word (populating hash table with nodes containing words found in dictionary) char word[LENGTH + 1]; while (...
0
votes
1answer
17 views

Understanding the contents of the raw file

I'm playing around with file pointers in preparation for the Recover Problem. I'm trying to understand something here. I can't actually open up the raw file to read on my IDE. And neither can I read ...
1
vote
2answers
36 views

My Coleman-Liau index gives the wrong answer

the program seems to be running fine but I don't know what went wrong in the index, it just doesn't give the right answer. #include <cs50.h> #include <stdio.h> #include <string.h> #...
0
votes
3answers
39 views

PSET6 Mario Python

I have been experiementing with this code for a couple hours and have come across an issue with each implementation. I can no longer put in any time at the moment so I figured I would go ahead and ask....
0
votes
1answer
18 views

Looking at Posts with regards to Academic Honesty

Does anyone know if getting help from a post that contains spoilers is considered academically dishonest? I'm not sure because even though the spoiler code in the post isn't an outright solution to ...
0
votes
0answers
20 views

How do I fix my code for PSET 4 blur?

What I tried to do was go to each pixel and see if any neighboring ones existed. If they did, I saved the neighboring pixel's colors. Then I ran a loop to add up all the values in that specific color ...
0
votes
0answers
8 views

Pset4 filter (more) - Edge Help

I stuck on pset4 for days. Only the corners passed check50. Any help, please? void edges(int height, int width, RGBTRIPLE image[height][width]) { int cap (int c); //get a copy of all the ...

15 30 50 per page