All Questions

Filter by
Sorted by
Tagged with
26
votes
1answer
7k views

Greedy.c works for all numbers except 4.2

When testing greedy.c, all numbers appeared to work except 4.2 (annoying since 4.2 is in the check50 test). I get 22 coins instead of 18. I printed my variables at each stage of the problem and ...
17
votes
3answers
15k views

Life after CS50!

I have completed CS50 successfully and it was great fun. I want to learn more about computer science. What courses are recommended as a follow-up to CS50?
15
votes
2answers
35k views

Difference between char and char* in c

suppose we declare two variable char s[]= "hello" char* p = "hello". what is the difference between these two?
13
votes
6answers
5k views

Missing network adapter

I'm using Cs50 appliance 2014. I get missing network adapter message in bottom right side. "ifconfig" gives the following output. "sudo service network restart" gives the following output ) I have ...
12
votes
1answer
3k views

check50 returns unexpected end of input

I recently finished my code for pset5 recover.c. It compiles, and runs successfully and recovers all 50 pictures. But when I try check50, it gives Checking.............................................
12
votes
2answers
905 views

What does the linker do?

If pre-processor copies the code from library to my source code, and then compiles the combined code, that should mean, that with my code, the library is also compiled, and linked. What does the ...
10
votes
1answer
2k views

pset7 phpMyAdmin errors on loading pset7.sql

I am working on pset7 and have loaded pset7.sql into phpMyAdmin, but whenever I try and click on 'users' in the left hand column I get an error message which includes "#1146 - Table 'phpmyadmin....
10
votes
5answers
12k views

How to Start Studying CS50?

I have seen many students joining CS50 and feeling a bit lost: the recurring questions are: I enrolled CS50 on edx. What next? Should I watch all videos, walkthroughs, sessions? Should I follow and ...
10
votes
1answer
15k views

How to Use check50?

Here are some of the most frequently asked questions about check50. What is check50? What is an ID? How to run check50? How to know if my program is correct? Does check50 record my scores in CS50's ...
9
votes
3answers
889 views

pset4 speller - can't pass valgrind test - 32 bytes still reachable

Can't pass valgrind test on pset4 speller (hashtable). The speller works perfectly but, I'm getting this message from valgrind: ==3911== ==3911== HEAP SUMMARY: ==3911== in use at exit: 32 bytes ...
9
votes
1answer
4k views

How to Update bfSize in resize?

In resize problem, we have to update the headers of image. Which attributes should be updated and how do i update bfSize attribute?
9
votes
1answer
1k views

How exactly are final projects graded for edX verified certificate?

I'm curious as to how the grading for the final project is done for participants via edX. Is it auto-graded?
8
votes
1answer
4k views

How to Check Sort Function with GDB

I've implemented my sort function in helpers.c and I have no clue as to how to check if it does actually sort. I've tried to call on the printf function so it can print out the sorted array, but find....
8
votes
2answers
2k views

How does fread progress through each byte in copy.c?

In copy.c (and the other apps using the same start code), how does freed know to read one byte after another? It seems to just do it automatically. Eg, this will read each byte, from first until bi....
8
votes
4answers
302 views

Running “update50” cause “Settings Manager” to dissappear from CS50 2014 Appliance's menu

I've just installed the new 2014 CS50 Appliance (v.2014-24) inside VMware Workstation 11 according to the instructions. And its working fine, with the following exception: If I run in terminal ...
8
votes
1answer
3k views

Surprise with GDB way of reading bfType BMP headers

Why if i check with the xxd an image eg. small.bmp the bfType is 0x424d and when you run copy in GDB the value of bf.bfType is 19778 and the program "copy" in line 55 check with 0x4d42. Is it reading ...
8
votes
5answers
5k views

Debugger button missing

I'm presently working on the pset3 sort and search functions and I've found that the debugger button is missing from the menu bar, the viewer is still on the right, but my ability to place breakpoints ...
8
votes
1answer
555 views

Why is my final grade 0%?

My final grade for CS50 is 0%. How come? I've uploaded all problems sets except for pset8 because I could not get the Google Earth plugin to work. All my other psets were graded 1.0. I Guess my final ...
8
votes
1answer
2k views

cs50w project1 - AttributeError: 'NoneType' object has no attribute '_instantiate_plugins'

I am trying to import the books.csv file into the online PostgreSQL database via Python code, as shown in the lectures and I get this error message when sqlalchemy is attempting to create the engine. ...
7
votes
6answers
44k views

“Error while powering on: Internal error.” when starting the appliance in VMware Player

I've formatted my laptop, but when I open the appliance it says internal error:
7
votes
4answers
6k views

What's the point of the modulo operation in the Caesar cipher formula?

According to the problem set specification, the formula for encrypting a message using the Caesar cipher is: ci = (pi + k) % 26 I don't get why you need to do modulo 26. What does it even do here?
7
votes
1answer
2k views

Gedit bottom panel terminal plugin missing

I have researched for 3 days and can't find an answer. My Gedit is not showing the bottom panel terminal, and the bottom panel option in "view" is grayed out. I went to Edit > Preferences >Plugins, ...
7
votes
2answers
11k views

how do you convert ascii to alphabetical index

I am working on Caesar Cipher and have written my code but do not know how to convert ascii to alphabetical index. This is what has got me stuck with this assignment for over a week. I have checked ...
7
votes
1answer
2k views

Hacker4/Resize: can't resize when factor is a decimal number

Everything went good so far until this pset and the resize exercise, it seems that I'm stuck and need help! Everything works perfectly when the factor is a whole number (eg. 2). In my code, the ...
7
votes
1answer
7k views

What is the difference between bfSize and biSizeImage?

I'm working through pset5's resize right now and I'm at the point where I've got to update the headers for the new file. I'm having trouble computing them, mainly because I can't really tell the ...
7
votes
2answers
230 views

What happens under the hood when performing a cast?

In the walkthrough example, ASCII-0.c, a cast has been performed to convert a number (integer in specific) to a character. I would like to know what exactly happens at the lower level when we cast an ...
7
votes
2answers
2k views

PSET6 Server - Parse function (requesting two files in a row)

I'm currently working on PSET6 and have implemented the parse() and lookup() functions. When I try to test my code using CS50 (the first part), I get all checks minus the last one, "Requesting two ...
7
votes
1answer
843 views

Help me write sexier code : ) counters as pointers, buffering files, feof, sprintf [pset4.recover]

I have completed the pset, and am happy with my code and how it works. But had some design questions so that I know for future programs what and why to use. I understand that it does not really ...
7
votes
3answers
570 views

pset7 error 403, forbidden, (even after going over the instructions over and over)

I've executed the chmod command as described in the instructions. My permissions is as in the image below: I've one problem though. I could not find the ⓘ icon toward CS50 IDE’s top-right corner. So, ...
6
votes
3answers
2k views

Pset7 - Forbidden 403. I can't even get started

I have done a ton of research online regarding this problem and have found several similar threads, but none of those solutions are working for me. I saw somebody posted the same question yesterday ...
6
votes
8answers
8k views

Undefined reference to `GetString'

I'm having the following error myName.c:(.text+0x18): undefined reference to `GetString' It seems that something is wrong with the cs50 library. What is this file suppose to contain? In my case it ...
6
votes
2answers
2k views

How to Compile the CS50 Library on Another Linux Distro?

I have copied cs50.c and cs50.h from the appliance. Now, what's the command that should be run to compile this library using gcc or clang on any other Linux distro (e.g., Ubuntu 14.04 in my case)?
6
votes
2answers
14k views

Downloading cs50.h

where i can download the cs50.h file? I don't want the cs50 appliance.
6
votes
7answers
4k views

CS50w - list.py - AttributeError: 'NoneType' object has no attribute '_instantiate_plugins'

I'm trying to run the list.py code on my Ubuntu machine, but I'm getting the following error: AttributeError: 'NoneType' object has no attribute '_instantiate_plugins' I looked at this post and it ...
6
votes
1answer
1k views

What is the purpose of #undef statements in speller.c?

Can someone please explain why do the following lines exist in speller.c I do know what #undef does but why is it used here? I think this is an incorrect use of #undef because calculate and ...
6
votes
1answer
1k views

having trouble validating request line in server.c

My main issue is doing this without using the heap, I think. I set up arrays for each of the pieces of the request-line (e.g. method, request-target, etc.) and set all of them to be of length = strlen(...
6
votes
2answers
416 views

getType() causing a seg fault when called on object as returned by detectcollision?

This one is driving me nuts! Why would I get a seg fault when calling getType() on 'object' as returned by detectCollision()? gdb revels this is where the memory error is happening but as far as I can ...
6
votes
4answers
14k views

Where can I get CS50 textbooks?

Where can I get CS50's recommended list of books? Absolute Beginner’s Guide to C, Second Edition by Greg Perry Programming in C, Third Edition by Stephen Kochan How Computers Work, Ninth Edition by ...
6
votes
2answers
963 views

Is Pset8 optional?

It is mentioned "if unable to get the Google Earth Plug-in working on your computer, you may skip this problem set." Does this means pset8 is optional??
6
votes
11answers
83k views

Why can't I import the Appliance OVA into Virtualbox?

I can't import the Appliance OVA file, appliance50-2014-vbox.ova, into VirtualBox. I keep getting the error message: Result Code: VBOX_E_FILE_ERROR (0x80BB0004) How do I fix this without switching ...
6
votes
3answers
61k views

Array Initializer Must Be an Initializer List or String Literal

Given this array: char p[90] = GetString(); I get this error when compiling: error: array initializer must be an initializer list or string literal How to initialize this array properly?
6
votes
2answers
262 views

How can char* contain a collection of characters instead of a memory address?

I'm a little confused as to how C treats int* differently from char*. For example, in section, we see things like: int x = 5; int* ptr_x = &x; So, here, ptr_x points to the address in memory of ...
6
votes
6answers
931 views

No IP address in CS50 appliance

I literally have no IP address in my CS50 Appliance. I can still access the internet perfectly fine though. Take a look:
5
votes
1answer
1k views

Please explain char* dictionary = (argc == 3) ? argv[1] : DICTIONARY; from speller.c

I am not sure if I understand what this piece of code in speller.c is trying to accomplish. char* dictionary = (argc == 3) ? argv[1] : DICTIONARY;
5
votes
6answers
8k views

How to Install the Tools for the Course on Ubuntu

As per the question I have had nothing but trouble trying to use the virtual versions of the cs50 software, namely the virtual machine crashes runs slowly or just generally feels like my fingernails ...
5
votes
1answer
687 views

Is something wrong with getType(object)?

For pset4, in this code(in main, to check collision of ball and anything else): GObject object = detectCollision(window, ball); if (strcmp(getType(object), "GRect") == 0) { ...
5
votes
3answers
6k views

How to handle the lack of argv[1] in caesar?

I think my program handles lack of argv[1] correctly, yet it fails check50's test. here my code: if ( argc != 2 ) printf ("usage : ./caesar + key \n"); return 1;
5
votes
3answers
2k views

Explanation of the formula for padding

This is the formula given for padding in PSET5 from WEEK7 : int padding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4; I don't understand what the outermost %4 is meant for. It seems redundant ...
5
votes
1answer
61k views

How to fix the “conditional jump or move depends on uninitialized value” valgrind error?

Need help again. I've got my linked list working. It copies a list of words from a file into a linked list. Now I want to make a hash table so that all words starting with the letter 'A' go into a ...
5
votes
3answers
6k views

Pset4 Whodunit: Any way to enhance the image?

So I removed all the 'red noise' from the image but I don't recognize the person. My question is : Do I have to enhance the colors any more or do I need to just guess the identity of the person ...

15 30 50 per page
1
2 3 4 5
235