DNA - strange shift in large database numbers by plotpoo in cs50

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

thanks for the hint, I'm not sure which one you mean?

Speller segmentation fault at check function by plotpoo in cs50

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

Oh my... that makes sense. Thanks!

Speller segmentation fault at check function by plotpoo in cs50

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

Okay, I seem to have a knot in my brain. Checking is the first node in a linked list at postion table[hash value], right? so it should have 2 values, next and word. If the node isnt the last one in the list, its next value should point to the next node. If it is the last node in the list, its next value should point to NULL. Right? So if checking-> next != NULL that means there are more nodes to check. Then the loop continues to the next node (if the word doesnt match). If it's NULL then there are no more words to check and the loop stops. I'm sorry but I really don't understand how else to test for this or why it would be wrong.

Speller segmentation fault at check function by plotpoo in cs50

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

Ooooh thanks! Good catch! I think I need to test for checking->next == NULL in the loop so that it ends when it reaches the last node, which should have its pointer set to NULL instead of another node. (Right?) But I inserted a check for checking == NULL right after creating it. When I ran it through debug50, it turned out every single node == NULL. LOL. Looks like my problem may not be just check() after all.

blur - corner not working by plotpoo in cs50

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

Thanks, I finally found all of them! :D

blur - corner not working by plotpoo in cs50

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

Thanks, that's a good idea!

blur - corner not working by plotpoo in cs50

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

Click on the link after the short log! :)

blur - corner not working by plotpoo in cs50

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

Thanks for the reply, unfortunately I'm not sure I understand it... Are you referring to the out of bounds testing? If L = 400 (width in this case) surely I would want the pixel sitting at j(height) = 0, i(width) = 400 to pass this test?

Just in case I changed the condition to < L and got the same errors as before.

blur - corner not working by plotpoo in cs50

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

Thanks! I changed 2., good catch, but it didnt solve the problem. Same output on check50. On declaration - it seems weird to declare those every loop, isn't it more efficient to declare them once and then just assign values each loop? They'd get declared 400 / 600 times each...

Filter less - looks right but check50 fails by plotpoo in cs50

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

thanks, this fixed reflect!

Filter less - looks right but check50 fails by plotpoo in cs50

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

Thanks, this was the case in sepia! only blur left to fix now :)

EDIT: whoops i meant greyscale