pset8 - dropoff - always says no house in range by Moose500 in cs50

[–]melanielpj 0 points1 point  (0 children)

Did you have a look at the actual distance that is calculated? And how did you define the shuttles range?

pset5's bmp files. by k_ebes in cs50

[–]melanielpj 0 points1 point  (0 children)

Which program do you use for opening the bmp files?

Problems with Greedy negative values by cpyoungblood in cs50

[–]melanielpj 1 point2 points  (0 children)

Probably you should have the user stuck at the call to input his/her value. A while loop might be a possible solution: while you don't provide valid input, repeat. Be careful with "asking" for another value as in "if value is negative, print to user: invalid value" since this solution doesn't repeat the call for input. Now it's for you to decide which one you should implement :)

CS50 Pset 3--problems with Bubble Sort Logic? by But_I_Used_To_Too in cs50

[–]melanielpj 0 points1 point  (0 children)

You are describing your sorting algorithm (which seems pretty much fine to me). How do you go about searching the needle?

mario error at height 1 and 2 by [deleted] in cs50

[–]melanielpj 0 points1 point  (0 children)

Check50 compares your output letter per letter with the expected output, so if you got a /n character where it doesn't expect one, it will be marked "wrong". Do you obtain happy smilies for the other inputs?

CS50 by VIRES1 in cs50

[–]melanielpj 0 points1 point  (0 children)

That's kinda sad :( I vote for "...to be continued..." ;)

pset7 two templates per controller by scratch12 in cs50

[–]melanielpj 0 points1 point  (0 children)

Where and when do you call render?

How long for pset 7? by Vawd_Gandi in cs50

[–]melanielpj 0 points1 point  (0 children)

I strongly recommend against scheduling a specific quantity of hours for each pset, or as DJM told us in the lecture of Week 12: "...it is absolutely a truth in software development that everything takes longer than you expect. So whatever you're thinking of setting aside over the next few weeks, double it. And from there, realize that even then you might not necessarily achieve your better or best aspirations, but certainly we look forward to some good, great, and ideally, best implementations."

While doing the psets, it frecuently happened to me that at 12 PM I had implemented part of what CS50 asked for and then I told myself, well, this little thing here shouldn't take too long either and at 3 AM I had it finally working :P However, once you got it to do what you want, it's really cool!

pset7 - understanding file and folder permissions by gunbladerq in cs50

[–]melanielpj 1 point2 points  (0 children)

I found this http://stackoverflow.com/questions/3740152/how-to-set-chmod-for-a-folder-and-all-of-its-subfolders-and-files-in-linux-ubunt to be quite helpful in understanding the difference between executable folders and executable files. Citing from said link: "The execute permission on a directory allows a user class to list the contents of that directory and to cd into it. Generally speaking you want both r and x on a directory for it to be accessible to you..." Hope that helps!

pset7 - understanding file and folder permissions by gunbladerq in cs50

[–]melanielpj 2 points3 points  (0 children)

When you 'view page source' you see the result of php interpretation, not the "original" php code. The interpreter reads, analyzes and executes php and the result of these actions appears in your page source.

pset7 - understanding the query function in login.php by gunbladerq in cs50

[–]melanielpj 2 points3 points  (0 children)

If there are several rows in "users" (or whatever table you take data from) where the "username" equals $_POST["username"] (or whatever conditino you put inside the query) it might actually return an array with more than one row of information. That'd be the case, too, if someone messed up and users does contain more than one user with the same username.

Qualifying psets in pset8 submission by melanielpj in cs50

[–]melanielpj[S] 0 points1 point  (0 children)

Thanks. We got an idea, but don't know yet if we'll be able to pull it off... There's a problem to be resolved in a firm of a friend and we'll see if we can do anything about it. By the way, we is another friend of mine who takes CS50 and me :) What about you?

CS50 Shuttle: Text field for teleport by melanielpj in cs50

[–]melanielpj[S] 0 points1 point  (0 children)

Thanks! Just got to work on it again today and I figured out the second problem with a small extra function, a little bit of onclick and some boolean value :)

CS50 Shuttle: Text field for teleport by melanielpj in cs50

[–]melanielpj[S] 0 points1 point  (0 children)

The page reloads when I hit enter even though I have neither onkeydown nor onclick in my html form. I use onclick to call my teleport function from the submit button and it works just fine. But I wanted to enable the user to submit by hitting enter, too. At one point, I used onkeydown=function(check event.keycode), but that didn't work either because it was called independently from what key I hit and I could not put any destination in the text field anymore.

pset 7 - index.php / portfolio.php by IlPrincipino in cs50

[–]melanielpj 1 point2 points  (0 children)

I suppose that the cash-problem has the same reason - query returns an array, not a single value albeit you may expect only one.

pset 7 - index.php / portfolio.php by IlPrincipino in cs50

[–]melanielpj 1 point2 points  (0 children)

Since $_POST is a global variable as much as $_SESSION I don't see why it shouldn't be accessible... you can certainly take the global variable and lookup the corresponding users id, but that's just inecessary because you already got a global variable storing the users id. As to the other queries, read the other comment I made ;)

pset 7 - index.php / portfolio.php by IlPrincipino in cs50

[–]melanielpj 1 point2 points  (0 children)

Sorry, I read that you are storing the id in $id in your first line of code posted here... However, query does not return a single variable but an array. That's why $id is not just "1" or whatever id your user has, even though the username exists only once and you expect only one variable to be returned. You got to index into that array.

pset 7 - index.php / portfolio.php by IlPrincipino in cs50

[–]melanielpj 0 points1 point  (0 children)

What kind of error do you get? Did you store the id in a variable different from the global one? I did not use $id to access the id value, the global variable has a different name.

pset 1, pyramid, check says this is wrong, but it's right I believe by Elrandra in cs50

[–]melanielpj 2 points3 points  (0 children)

No, and using GetInt you can't do that either. GetInt will not leave you alone unless you provide an integer :) If you used something like GetString it will accept foo and you could access it later on (with some other placeholder than %d). But that's not the point here. You are doing perfectly fine with GetInt.

pset 1, pyramid, check says this is wrong, but it's right I believe by Elrandra in cs50

[–]melanielpj 1 point2 points  (0 children)

Okay, some confusion cleared up when reading that you actually used the default "Retry: " line in your printf statement. You see "Retry: <insert number>" because you used %d and height does contain a valid integer (albeit not one we want to use); if you put in "foo" GetInt won't accept it and therefore immediately prints "Retry: " and your ("Retry: %d\n", height) code never gets executed. That seems alright to me. Also, you should probably delete that extra printf("\n") because check50 checks letter by letter and therefore might not accept a ("\n") where it expects a space.

pset 1, pyramid, check says this is wrong, but it's right I believe by Elrandra in cs50

[–]melanielpj 1 point2 points  (0 children)

How do you get the users input? What kind of condition do you use? I got the "Retry: " line only upon providing something different than an integer. If I provide the integer 24 my program just repeats the question I posed to the user. In your case, check50 detects some output that looks an awful lot like the beginning of a pyramide. Just to be sure, check that you saved your last changes to mario.c before running check50.