Levi Roth
  • Member for 5 years, 11 months
  • Last seen more than 1 year ago
pset2 (Hail, Caesar) - How to refine my code
3 votes

One thing that sticks out about this is that you have special cases for spaces, commas, and exclamation marks. While I haven't tested your code directly, it looks like it wouldn't print characters ...

View answer
server.c indexes - what is to be done?
Accepted answer
2 votes

If it exists, you simply have to return its path, as a string. For example, if the input is the string /gifs/cats, and there is indeed a file named index.html in the /gifs/cats directory, then you ...

View answer
Pset3: strange problem while testing init() function
Accepted answer
2 votes

When you declare an array, such as board, you want to use the actual size of the array, without subtracting 1.

View answer
What does "using" a variable entail and why does this inconsistency come up? (pset1, greedy, general question)
Accepted answer
1 votes

The root of this problem lies in the order of operations. In C, postfix increment (++) binds more tightly than dereference (*). Thus, what the code *coins++; does is not to dereference coins and then ...

View answer
PSET 6 unable to load cat.jpg
1 votes

When you use realloc, you want to store the return value in content, not *content. content refers to a pointer, while *content refers to whatever is at the memory address stored in the pointer - and ...

View answer
Red has been turned to white, now how do I turn blue to black?
1 votes

I'm guessing your error is about comparing a constant to triple.rgbtBlue. Keep in mind that triple.rgbtBlue is just a byte; its values don't range from 0x000000 to 0xff0000, but rather from 0x00 to ...

View answer
Pset4 resize.c headers not correct
Accepted answer
1 votes

You need to consider the fact that bi.biHeight is negative.

View answer
Solving Vinegere using array access addition memory?
Accepted answer
0 votes

Your string needs to be null terminated - that is, it has to have '\0' at the end so that printf and other functions know where it ends. To accomplish this, you will also need to make our output array ...

View answer
byte-compiling disabled? Warning when running "pip3 install --user -r requirements.txt" command
0 votes

This is an option that is deliberately set by CS50's IDE setup, shown in the link below. So, it looks like this is the intended behavior and shouldn't cause problems. https://github.com/cs50/ide50/...

View answer
CS50 2017 vigenere.py Issues "TypeError: not all arguments converted during string formatting"
0 votes

On this line: k = key[j].upper() % 65 The % operator in Python does different things depending on whether the left operand is a number or a string. If it's a number, then % does modulo division as ...

View answer
why always link library at the end of commands?
0 votes

In order to avoid linking code that isn't used, the linker works from left to right, keeping track of functions that are undefined. If a library defines some function that hasn't been used in ...

View answer
pset4 Resize: Don't understand problems with size and dimensions
0 votes

Please don't post your full code here, as it may give away solutions to people still working. One problem I noticed is that~~, when you set biSizeImage, you don't multiply the new padding, even ...

View answer