kzidane
Moderator
  • Member for 7 years, 7 months
  • Last seen more than a week ago
How do I get rid of the "expression result unused" error?
Accepted answer
0 votes

else does not take an expression. else if does.

View answer
Global Variable vs Local variables?
2 votes

candidate_count is not declared in main. It's a global variable (declared outside of main) on line 20 in the distribution file plurality.c at the time of this writing. The definition of main starts ...

View answer
If statement: evaluating if my variable equals one of 2 values (C)
0 votes

If we're not assuming anything about the values A, B, C, and D, I don't think it gets any simpler than this.

View answer
Why table is not inserting here in buy route
0 votes

As the error is telling you in the first screenshot, trans doesn't have a key called stock.

View answer
int object not subscriptable in register route
Accepted answer
1 votes

Are you sure both session and results are dicts?

View answer
CS50 IDE doesn't load but keep saying "Preparing your environments"
2 votes

Apologies for the trouble! Should be working now. In the future, please report issues to sysadmins@cs50.harvard.edu!

View answer
Cant see less comfortable/more comfortable View option or the tools option on CS50 IDE
1 votes

More comfortable mode has been removed from the CS50 IDE for quite some time now. If you suspect your settings are out of sync, you should be able reset your settings to the default by clicking CS50 ...

View answer
Finance - local development- How to get CS50 package?
Accepted answer
0 votes

It's quite difficult to try and guide you through setting up a local development environment without knowing more details, but assuming you have Python 3 and pip installed, you should be able to ...

View answer
Update50 stopping with error
Accepted answer
1 votes

Try running the following command: sudo nano /etc/init.d/udev and add the following line under ### END INIT INFO: exit 0 Then hit Ctrl + x, then y, then Enter. After that try update50 again. If it ...

View answer
How to install SPL libraries on ubuntu?
Accepted answer
1 votes

Just for reference, the problem was that the OP installed Oracle's JDK manually, and the directories containing the JDK's programs were not on root's PATH. That's why sudo make install failed, when it ...

View answer
week 1 string.c errors
1 votes

Be sure to save before making your program!

View answer
Why Can't I See My CS50 Project Scores On GitHub?
Accepted answer
2 votes

Your grades should be available on your gradebook after linking your edX account. Head to https://cs50.me/gradebook, and link your edX account (if not already linked)!

View answer
Ensuring Permissions on PSET8
Accepted answer
0 votes

Assuming you're on the latest version of the IDE (run update50 to make sure), no need to set any permissions anymore. Perhaps just ensure that the files under bin are executable. If we're considering ...

View answer
Uninstall cs50 library
Accepted answer
1 votes

Just execute the following command $ sudo rm -f /usr/local/include/cs50.h /usr/local/lib/libcs50.a To install the latest version of the CS50 C library on Ubuntu, execute the following commands $ ...

View answer
Ubuntu password required when starting apache 50 - pset7
10 votes

Apologies for the inconvenience! Should be fixed ASAP! But until it's fixed, yet another solution to this is to execute: $ echo "#includedir /etc/sudoers.d" | sudo tee -a /etc/sudoers in a terminal ...

View answer
Problem with the cs50 ofline ide text editor
0 votes

Sorry about that! Should've been fixed long ago!

View answer
pset4: Order in structs and "word-aligning" by clang
2 votes

Arrays vs Structures First off, a struct is not the same thing as an array. structs and arrays are different data types. They have similarities (e.g., they are both complex data types, they can group ...

View answer
Should the condition have >= instead of == in find.c?
Accepted answer
1 votes

In addition to being the maximum value that an int can represent, INT_MAX is the value returned by the CS50 library's GetInt function in case of error or EOF (see man get_int!) Testing whether straw ...

View answer
Why are functions defined where a parameter should go?
Accepted answer
5 votes

Two different things here: there is a function and there is a function call In JavaScript, functions are so-called first-class objects, and what this means is that they, like other values, can be ...

View answer
pset7 buy fatal error
Accepted answer
0 votes

The answer is of course to use VALUES(column name) per http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_values! :-)

View answer
How to implement ANSI sequences in pset3?
1 votes

per the Wikipedia article: Escape sequences start with the character ESC (ASCII decimal 27/hex 0x1B/octal 033). However, most of the sequences are more than two characters, and start with ...

View answer
Problem with CS50 IDE offline
1 votes

basically this tells you that you have already run the docker run command before. no need to re-run this command. to start the IDE, execute: docker start cs50ide per step 7 in the docs https://cs50....

View answer
What's wrong with my recursive binary search function?
Accepted answer
0 votes

classic mistake! what are you doing with the value returned by a recursive call?

View answer
is the end of a word in a text file marked by a particular char?
Accepted answer
1 votes

a text file is a stream of individual characters, not strings. the way you read/store a group of these chars, from the file, totally depends on you. for example, you may wanna read collectively or ...

View answer
pset6 indexes problem with string pointers
Accepted answer
1 votes

first I wanna mention that it's really bad practice to have magical numbers (e.g., 10 and 11) in your code as they make your code difficult to understand. second, you don't really need to check ...

View answer
pset7 - Portfolio prints multiple times stocks
Accepted answer
0 votes

instead of using the array function, you could use []. using the following code: $positions = array( "name"=>$stock["name"], "price"=>$stock["price"], "shares"=>$row["shares"],...

View answer
PSET 4 recover jpg images
Accepted answer
1 votes

per the specs The fourth byte, meanwhile, is either 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, or 0xef. you are not ensuring the 4th byte ...

View answer
PSet6 Load function doesn't load any image
0 votes

there are many problems that I could spot in your code: ptr is a temporary buffer. it doesn't really have to have memory allocated for it on the heap. generally, you shouldn't allocate memory on the ...

View answer
Whats's difference between declaring and defining variables?
1 votes

when you #define DIM_MIN 3, you are defining a constant not a variable. what's the difference? well, there are many differences actually, but probably the most important one is that, in case of a ...

View answer
why doesn't my implementation to binary search correctly handle not finding an element?
Accepted answer
0 votes

here are my takes on the code: you are duplicating some stuff. for example, why calculating length - 1 twice? instead, you could start with defining min and max. you don't really need midpoint to be ...

View answer
1
2 3 4 5
22