All Questions

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

runoff tabulate error :( tabulate counts votes when multiple candidates are eliminated

void tabulate(void) { for (int i = 0; i < voter_count; i++) //as long as the number of total voters has not been met; this increases which voter we are on { int j = 0; ...
1
vote
2answers
31 views

Major Help Needed on CS50 - Recover

I would love any possible help with this code. I think I've got the general idea, but I keep running into segmentation faults. Thank you to anyone who gets a chance to look this over! I've been very ...
0
votes
1answer
51 views

CS50 good hash function for PSET5 Speller

I was looking up different hash functions and was getting really confused following what the code was doing. I stumbled upon this hash function: int hash(const char * str) { int hash = 401; ...
0
votes
1answer
17 views

i don't know what is wrong when i run the program the output is all zeros

void blur(int height, int width, RGBTRIPLE image[height][width]) { double red_sum ; double green_sum ; double blue_sum ; double counter; RGBTRIPLE new_image[height][width]; ...
0
votes
0answers
74 views

raise JSONDecodeError(“Expecting value”, s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@app.route('/api/<string:isbn>', methods = ['GET']) def isbn(isbn): #import api from Goodreads (stats) book_data = db.execute("SELECT * FROM books WHERE isbn=:isbn",{'isbn':isbn})....
0
votes
1answer
19 views

PS2 - substitution

thanks for helping me out :) When I am running my code I get a weird output, an intractable char that is being added randomly to my output. The weird thing is that that the char that is being added is ...
0
votes
0answers
53 views

Confused about DNA in pset6

I've just started DNA, and I've got what seems to be a working algorithm to see if the count of the STRs in the database and sequence are the same, but it does not seem to be working. I've been a bit ...
0
votes
1answer
35 views

The view function did not return a valid response. The function either returned None or ended without a return statement

I can't figure out what is wrong in my code My python code: def buy(): """Buy shares of stock""" if request.method == "GET": render_template("buy....
0
votes
2answers
36 views

Help with pset4 filter edge detection function

I have some problems with the edges function. The code compiles fine and all but the result looks like this: https://imgur.com/a/S2MQLom The edges of the image and one third of it don't look as ...
0
votes
1answer
39 views

Pset4 Recover - Unexpected Output

My program outputs JPEG files, but not enough and they are corrupted. It has been a long day and it is Friday. Any kind of push in the right direction would be fantastic thank you. #include <stdio....
0
votes
0answers
23 views

i dont know why i'm getting 45% when it looks like it's working

while True: n=int (input("enter height: ")) if n>=1 and n<=8: break k = 2 * n - 2 for i in range(0, n): for j in range(0, k): print(end=" ") k = k - 2 for j in ...
0
votes
0answers
9 views

I am working on project 1 and created .pylintrc file but db: scoped_session Instance of 'scoped_session' has no 'execute' memberpylint(no-member)

I am working on project 1 and I have also created the .pylintrc file and write ignored-classes=SQLObject,Registrant,scoped_session but still get db: scoped_session Instance of 'scoped_session' has no '...
0
votes
1answer
27 views

pset7 Q10 Weird Result

The challenge is apparently straightforward: write an SQL query to list the names of all people who have directed a movie that received a rating of at least 9.0. To get from names (which lives in the '...
1
vote
2answers
40 views

Hey. Please help me find my mistake. The number of words in my sentences is not counted properly

I tried using debugger but could not figure out where I went wrong. please help #include <stdio.h> #include <cs50.h> #include <string.h> #include <math.h> int main(void) { ...
0
votes
1answer
30 views

CS50 Web Track Finance Index not displaying Data

EDIT: I fixed the issues with the Data but now the webpage looks really bland (default text, font, etc) and does not match the format of the other pages. Am I missing something in my HTML? {% extends &...
0
votes
1answer
25 views

PSET 4 Recover - Copy-Pasting 1 Line from 1 Place to Another Causes Huge Error

This Code Below Worked Fine, I got Passed!! #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *...
0
votes
1answer
24 views

Pset4 Filter Help

So far I only have gray scale done, but whenever I try to run it to see if it'll work with ./filter -g infile.bmp outfile.bmp it gives me an error message saying Could not open infile.bmp. It works ...
0
votes
1answer
30 views

pset4 filter - blur function only filters image corners

This is my second attempt at this problem, and a full rewrite; I tried once before to be as eloquent as I could, and it was just totally wrong and bizarre. So I just tried to make this one as readable ...
0
votes
1answer
37 views

PSET1 Cash - less comfortable - errors only for 0.41, 0.15

I hope you can help me with the PSET1 task - cash - less comfortable. Here is my code but I cannot figure out why - when testing the code - only 0.41 and 0.15 deliver wrong outputs (8 instead of 4 and ...
0
votes
1answer
34 views

Pset 2 Readability

What's going wrong? I think I've got it figured out but I'm unable to compile the program and print out what I want it to say.
0
votes
1answer
27 views

HELP! Pset1 Credit

I got a question on the credit. I don't know why it automatically quit. Like this: ~/pset1/credit/ $ ./credit Number: 4003600000000014 ~/pset1/credit/ $ Please see the code below. #include <cs50....
0
votes
2answers
33 views

how do i write pesudocode.txt for Mario? (less comfortable)

After I input: mkdir ~/pset1/mario its asking me to write pseudocode.txt and i am not sure how i can do that. I've tried inputting the pseudocode.txt and that gives me "command not found"
0
votes
0answers
44 views

PSET 6 DNA! Stuck for so long

so the problem I face is when computing the greatest number of STR's in a sequence. I was able to hardcode "GATA" and compute the greatest sequence for a textfile using my sequencecount ...
0
votes
1answer
48 views

CS50 pset5 segmentation fault

I've spent a whole day trying to solve pset5. When i try to run the code it kept showing "Segmentation fault". Here's what i get from Valgrind ==21210== HEAP SUMMARY: ==21210== in use at ...
0
votes
1answer
19 views

Sepia Filter won't work for more complex 3x3 and 4x4 images

:) sepia correctly filters single pixel :) sepia correctly filters simple 3x3 image :( sepia correctly filters more complex 3x3 image expected "25 22 17\n66 5...", not "25 22 17\n66 ...
0
votes
1answer
35 views

i don't know what's wrong with my code. Trying to convert from string to long

INPUT int main(void) { long long cardnumber, calc; string credit[0]; string nonnumeric; //long long calc = card number; int countcardcharacters = 0; long long c; //user input do { credit[0]= ...
0
votes
0answers
16 views

Final Project: dynamic page creation to show just 10 SQL entries per page

I'm developing a web-page for my CS50's Final Project for contacting japanese students around Argentina. The only official japanese exam takes place in Buenos Aires, and there are no many good places ...
0
votes
1answer
47 views

valgrind Pset5 error

All checks with check50 are green except the memory error. This is what valgrind shows me: ==3259== ==3259== HEAP SUMMARY: ==3259== in use at exit: 8,013,096 bytes in 143,091 blocks ==3259== ...
0
votes
1answer
19 views

Pset1 Creating and Changing Directory Does Nothing

For the first problem set, I attempted to create and change the directory with the following commands: $ mkdir ~/pset1 $ cd ~/pset1 $ mkdir ~/pset1/hello $ cd ~/pset1/hello Despite doing these ...
0
votes
1answer
43 views

Pset5 speller getting valgrind error

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

Pset 4 Filter - Blur

My blur filter produces a decent looking blurred image and passes the Check50 corner pixel case. I define the cases for the edges and the middle pixels and then manually calculate the average RGB ...
0
votes
0answers
10 views

Ive been getting a syntax error for this Python code. Id appreciate If someone could help me

This is from a python course by mosh The code is this -> import pandas as pd from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split from sklearn....
0
votes
2answers
26 views

are we supposed to use the set from hello.c to begin with Mario (less comfortable) or do we need a new terminal and file?

the first thing that the Mario instructions say is this : First, create a new directory (i.e., folder) called Mario inside of your pset1 directory by executing ~/ $ mkdir ~/pset1/mario. I do not ...
0
votes
1answer
51 views

My print_winner from pset3/tideman is doing everything right and still check50 says it's wrong

void print_winner(void) { bool looser; for (int i = 0; i < pair_count; i++) { looser = false; for (int j = 0; j < pair_count; j++) //checks if each winner ever lost ...
0
votes
1answer
17 views

CS50 Runoff – Cannot get program to execute, am I stuck in an infinite loop somewhere?

I'm trying to execute runoff but after I enter the voters' ranks, the terminal window blinks back at me with nothing. I've scoured all over for similar problems but cannot figure out a solution. I've ...
0
votes
1answer
13 views

Pset3 Plurality returning “Invalid vote” in main programme code

When inputting vote names in "Plurality", the programme is returning Invalid vote. It looks like this in the terminal: ./plurality Alice Bob Garry Jim Number of votes: 4 Vote: Alice Invalid ...
0
votes
1answer
23 views

PSET4 Reflection Filter

I'm having trouble getting my head around the pointers needed for the reflection filter. I have got to here and can't get the syntax right. Any tips would be much appreciated. Thanks. void reflect(int ...
0
votes
0answers
32 views

How do I create an advanced query page using HTML and CSS? Should I use any other langauges to make it a faster process?

How do I create an advanced query in HTML and CSS? I have to create a front end similar to Google and have already outfitted the first two pages, it's the 3rd page, the advanced query page that I need ...
0
votes
0answers
74 views

cs50 pset6 DNA, minor differences in counting STRs |Spoiler entire code included|

My code counts STRs for some people correctly, but for others the difference is very small. For example for python dna.py databases/large.csv sequences/5.txt expected output is Luna, whose STR counts ...
0
votes
0answers
11 views

Final Project ajax issue

Hi I'm working on my final project, an online two player game based on the cs5o Finace distribution code, I got tic-tac-toe to work and am now trying to update the playing field displayed to the user ...
0
votes
0answers
29 views

decoding to str: need a bytes-like object, HttpResponse found

While converting markdown to html i am getting this error def title(request, title): global mdValue mdValue = util.get_entry(title) htmlValue = m.convert(mdValue) # error occurs on this ...
0
votes
1answer
34 views

Pset2 Readability. I am starting to do readbility and for some reason the code i wrote this far seems not to be compiling properly

My for loop doesn't seem to be executing. When i run the program it seems for loop is been skipped. Can someone please help me out. #include <stdio.h> #include <cs50.h> #include <string....
1
vote
2answers
85 views

pset1 (mario, more) - problem with unwanted leading spaces

This is what check50 gives me: > :( handles a height of 1 correctly > expected ""# #"", not "" "\n"# #"" > :( handles a ...
0
votes
0answers
28 views

PSET 6 - credit, pythonic or not?

I didn't do credit for problem set 1 (I chose less comfortable) so I don't know what the C implementation was. I was wondering if you guys think this is too C-like or if it's okay for python code. Any ...
0
votes
1answer
38 views

Pset3 runoff tabulation error

[![enter image description here][1]][1] I keep getting a tabulation error with check50 that I cannot replicate 11 voters, 4 candidates, 3 or 4 rounds of voting works fine with I run it, and debug50 ...
0
votes
1answer
43 views

PSET4 Recover: Where do my ###.jpg files end up?

My code looks right, and after some segmentation errors, I finally fixed that, but I've run into a problem: My created ###.jpg files don't actually seem to be written to anywhere, as in I can't find ...
1
vote
1answer
52 views

Week 4: Recover (invalid stdio handle)

As I'm sure you're aware, the goal of this assignment is to recover a number of deleted jpeg files from a provided memory card image. My code compiles and executes, but I'm receiving the error "...
0
votes
1answer
31 views

Error Code - Use of undeclared identifier in PSET 1, Mario

An error code popped up while trying to compile my code, saying that the variable n had not been declared earlier. It had been declared however at the beginning. Here is the code and the terminal ...
0
votes
1answer
31 views

Desperately need help with DNA Python! please help!

Desperately need help with my DNA python code. I get the correct sequence printed out but I can't seem to find a working comparison code. Please someone take a look: https://pastebin.com/DCdxtxMx
0
votes
1answer
46 views

Speller week 5 Segmentation fault

I can't understand where and what my error is I think it's because of "load", but I can't fix it it returns an error when checking :) dictionary.c, dictionary.h, and Makefile exist :) ...

15 30 50 per page
1
3 4
5
6 7
235