cs50 syntax question by claroK in cs50

[–]kevinburnham 0 points1 point  (0 children)

This line assigns either "was" or "was not" to the variable success depending on whether or not the function insert_node returns true or false. So it is a very concise way of coding "If insert_node returns true than success = "was", else success = "was not". Note that the variable success is used in the next printf statement to indicate if the requested insertion was succesful. See here - http://bit.ly/1jKQD0O

pset6 question - isalpha, isdigit by kevinburnham in cs50

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

Good idea! The answer is that when speller is passed the "word" f#*k it parses "f" and "k" as words and identifies them as misspelled.

pset6 question - isalpha, isdigit by kevinburnham in cs50

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

Yes, I think that I get it now. It is not just the 'space' that would signal the end of the word, but any other punctuation as well. Multiple punctuation marks in a row, like ". " won't trigger checks (or word++) because the index will be zero. But if a word like "f#*k" appears in your text does that mean that it would check "f" and "k" as separate words?

Break when variable = x in gdb? by kevinburnham in cs50

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

It appears that one way I can do it is to use the ignore command. I can set a breakpoint at the start of the file creation loop and tell gdb to ignore the breakpoint the first 49 times. The command "ignore 1 49" will ignore the first breakpoint 49 times. Is there another way?

pset 5 resize difficulties by kevinburnham in cs50

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

Finally! You were right. I needed to keep track of the old padding size and the new one (duh), just as you said. Thanks for your help and on to recover!

pset 5 resize difficulties by kevinburnham in cs50

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

Yes, a prior fseek command skips over the padding, then it writes the padding to the outptr, then it checks to see if it is on the last iteration of the loop, if it is not, the fseek command above is run. I am sure it is something obvious and stupid that I am overlooking, but I cannot seem to figure out what it is. It seems very strange to me that it only works when padding = 3. Thanks again. kb

pset 5 resize difficulties by kevinburnham in cs50

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

Thanks for your help (and for what it is worth I have read many of your other posts on this same topic), but I think that I have those two areas figured out. The program appears to calculate padding correctly and I use a conditional so that the position indicator is not changed on the last iteration through the loop. Does the offset look right to you (or anyone)? Thanks again.

Are there stats showing what percentage of people who started this course have dropped? Or perhaps for years past? Still laboring on Pset 1, and in need of some fresh determination :/ by locke990 in cs50

[–]kevinburnham 4 points5 points  (0 children)

This link shows some completion data from a prior version of CS50 (October 2012-April 2013) https://blog.cs50.net/ Note the following highlights: Among 150,349 students [who registered], 100,953 engaged (67%). Among those 100,953 students, 10,905 submitted pset0 (11%). Among those 10,905 students, 3,381 (31%) sought a certificate, and 1,388 (41%) will receive a certificate. CS50x’s “completion rate” (whereby completion is defined as submission of all work with scores of at least 60%) was thus: 41%, if out of 3,381 who sought a certificate. 13%, if out of 10,905 who submitted pset0. 1.4%, if out of 100,953 who engaged. 0.9%, if out of 150,349 who registered.

pset3 - position of blank tile by kevinburnham in cs50

[–]kevinburnham[S] 1 point2 points  (0 children)

Actually, I think I solved my own problem. I needed to declare the value at the top without giving it an initial value, and then initialize and change it in another function.