Hacker Newsnew | past | comments | ask | show | jobs | submit | OseOse's commentslogin

    void strcpy(char *x, char *y) { while(*x++ = *y++); }
In this example, why does the loop terminate? Is it because the null terminator counted as a false?


Exactly, since C strings are just pointers to raw memory you usually assume that either the user passes the length explicitly to you or that they're \0-terminated.


If anyone is still not seeing them, do a hard refresh (Ctrl+F5).


Ctrl+F5 is amazing, how have I been developing websites without knowing this?


You should also do CSS versioning if you are pushing to a live website, like main.css?v=2 or something so that users (well, mainly nitpicky clients) will always see the latest.


In Chrome at least, having the devtools panel open[0] disables {all,most,some,infuriatingly inconsistent} parts of the cache system, so every refresh is a 'hard refresh'[1].

[0] Might be an option in the dev-tools settings, but I think it's enabled by default.

[1] Except when it's not, of course.


This is true, and I always have that option checked.

But if I am on a site that seems to be loading the old cached stuff during my regular browsing of the internet (not building stuff) I always open dev tools and refresh to do a "hard" refresh.

But learning that CTRL-F5 does the same thing is really neat, and I feel very silly at the same time!


command - R for Firefox on OS X


command - shift - R on Chrome\OS X


Shift + Cmd + R (on Chrome,OSX)


When you say CPython, do you mean Cython? I've only recently learned what "Python" really is myself, and it's easy to miss the difference between these two:

http://en.wikipedia.org/wiki/CPython

http://en.wikipedia.org/wiki/Cython


I meant Cython, yes.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: