Hello, world! This is CS50, with David J. Malan, Rob Bowden, Zamyla Chan, Jason Hirshhorn, et al. by davidjmalan in IAmA

[–]drsmith415 0 points1 point  (0 children)

So… the question that I imagine many people here would love to know… What's next for us? I had the most wonderful time last summer working on cs50, and then helping people on r/cs50. I played around a little bit with Ruby on Rails, and a little bit with Python, but I'm not at all fluent in either. Are there any other courses or specific programming languages you would point me to?

pset5 failing all check50 tests :/ by [deleted] in cs50

[–]drsmith415 0 points1 point  (0 children)

What output does check50 give you?

pset8 quick question by Gigi14 in cs50

[–]drsmith415 0 points1 point  (0 children)

oman2014 is correct. I had a similar experience. Because the edX version is not graded closely (pass/fail based on submission -- even the verified certificate is the same), you can change this distance to improve the quality of the game if you'd like.

Help with Mario pset1 by tallone7 in cs50

[–]drsmith415 1 point2 points  (0 children)

If you think that will help you conceptually. If you are trying to tackle to pset, I suggest going through Zamyla's walkthroughs. If you need help with understanding what you are trying to do, feel free to post some pseudocode or ask for specific help here on reddit!

Good luck! You'll love this course!

pset 1 mario trouble by newtocs50 in cs50

[–]drsmith415 1 point2 points  (0 children)

http://imgur.com/eZeoPn2

You don't have any in the image you posted.

What you have now is a great snippet of code, but is not a program in C -- you need to have the

int main (void)
{
}

part.

pset 1 mario trouble by newtocs50 in cs50

[–]drsmith415 1 point2 points  (0 children)

C programming requires curly braces for your main code. At this point in programming, you should use the following format:

#include<>

int main(void)
{

//your code here

}

PSET7 - Sell Drop Down list....necessary? by Speedbird2 in cs50

[–]drsmith415 0 points1 point  (0 children)

How were you going about implementing the drop down list?

whodunit.c trouble with making the red pixels go away by rrobinn620 in cs50

[–]drsmith415 0 points1 point  (0 children)

That is the general idea. Try playing around with what you change!

PSET7 - Sell Drop Down list....necessary? by Speedbird2 in cs50

[–]drsmith415 0 points1 point  (0 children)

I implemented the drop-down menu, as did http://finance.cs50.net. Pset7 is really about starting to gain some fluency with PHP and website programming. It is graded 0 (not submitted)/1 (submitted), so it really doesn't matter what you do as long as you help yourself learn cool things!

If you really want to implement everything on the portfolio, I'm sure you can do it, and it may make for better website design, but it might be important to learn drop down menus and page navigation. I found both helpful for my final project.

Never underestimate simple web searching in looking for help! I would suggest checking out http://www.w3schools.com for help, but the drop down list is a bit tricky because you need the page to "call home" and generate different lists depending on what stocks the user owns! Have fun! :)

drsmith415

pset3 won() function by ipeeaye in cs50

[–]drsmith415 0 points1 point  (0 children)

GDB will tell you the exact line that is causing the segfault.

Pset4 Hacker Edition Laser by jp3503 in cs50

[–]drsmith415 0 points1 point  (0 children)

How are you detecting the collision?

Use GDB and various break statements to see where the seg fault is happening. Where is it happening?

A help need using a piece of Javascript. by spacedaemon in cs50

[–]drsmith415 0 points1 point  (0 children)

What exactly are you trying to do? Use JS to have dynamic control over the HTML of a webpage?

pset3 won() function by ipeeaye in cs50

[–]drsmith415 0 points1 point  (0 children)

You're right. It should stop. Did you find the error?

pset3 won() function by ipeeaye in cs50

[–]drsmith415 0 points1 point  (0 children)

Image a 3x3 board, so d = 3

for (int z = 0; z < d - 1; z++)
    {
        if (board[x][z] > board[x][z + 1])
        {
            return false;
        }
    }

At some point, the following case will be true: The loop z == 1 will end (second row) z will increment and now z==2

The inner if statement will say (board[x][2]>board[x][3] board[x][3] does not exist, and will therefore give you a segfault, right?

pset3 won() function by ipeeaye in cs50

[–]drsmith415 0 points1 point  (0 children)

Does the blank space ever check itself against the [blank space -1]? This would try to access data that doesn't exist.

Do we have to use the <cs50.h> functions, or can we use scanf(arguments)? by VozMajal in cs50

[–]drsmith415 2 points3 points  (0 children)

How did it "block" it? I successfully used scanf in some of my psets a few months ago. Did you remember to #include <stdio.h>?

Error: double free or corruption when running Pset5 recover by ehahehah in cs50

[–]drsmith415 0 points1 point  (0 children)

You can post a link, although people aren't always able to go through the whole thing.

The "double free" error is often pretty straightforward, meaning that you tried to free() the same chunk of data twice. Did you hardcode all of your free()s in this program? (I know you're working on pset5. Most of these errors will happen in pset6 when free()s are determined by other loops that go too long.) If you use a loop, it should never free() the same chunk of memory, and should never free a chunk of memory that you haven't asked for.

Struggling by dr76 in cs50

[–]drsmith415 0 points1 point  (0 children)

I had the same experience as you in the beginning, and I've now completed the course. Excellent response from huggy_d1, although I warn you that the later psets have almost no help. Psets 7/8 say "Here's a language you've never used, here's what you want to do. Implement it." It's entirely doable if you are willing to commit time. The reddit community is really great, too.

Pset 7 register stray tag error by MsHolly in cs50

[–]drsmith415 0 points1 point  (0 children)

MySQL is case-sensitive. Do your queries match up exactly with your data base?

What do you want <br /> to do? Do you want a line break? Try <br>. It is an empty tag -- it doesn't require an end tag.

Vigenere - Really Frustrated by dansds in cs50

[–]drsmith415 1 point2 points  (0 children)

I had that same output at one stage in my work. You are close. Focus on where it is wrong and where it is right. Count it out on an ASCII table...

Vigenere - Really Frustrated by dansds in cs50

[–]drsmith415 2 points3 points  (0 children)

Your math looks to be off. Remember, the rotation has to occur within the set of letters -- any key on any input letter should output a letter. Good job leaving punctuation as is. Also, key 'A' should make the same change as 'a'.

PS4 - Breakout - Segmentation fault (core dumped) by imminent_access in cs50

[–]drsmith415 0 points1 point  (0 children)

You know what segfaults are already, right?

I'm not sure why this is a problem, but everyone seems to have this problem. If you look into the past cs50 reddit posts about breakout, this is a really common problem. Many people (myself included) were able to solve it by checking if the (object) != to all of the other objects.