Hacker Timesnew | past | comments | ask | show | jobs | submit | romnon's commentslogin

ubuntu


Umm, proceed and persist sounds better imo.


Or “pursue and persist”.

“Cease and desist” has nice assonance, I feel “pursue and persist” matches a little more in that regard, though both are decent.

As regards meaning, “proceed” and “pursue” are both good, taking slightly different angles but to essentially the same purpose.


Maybe, but ‘continue’ is a better negation of ‘cease’. Proceed can mean (usually means?) to do something one has not yet started, rather than to not cease.


By the latin roots:

Continue - hold together (cum + tenere -- same root as contain)

Proceed - go forward (pro + cedere)


I'm not sure what you're trying to conclude...


people be rough


full circle indeed


ive seen people doing += !!(c=='s')-!!(c=='p') for that


I'm sure people do that (even though it's not necessary per some year C standard) but generally the pattern is actually for converting things which are not already 0 or 1 into 0 or 1. For example, you might want to use it here:

    int num_empty_strings = !!(strlen(s1)) + !!(strlen(s2)) + !!(strlen(s3))
which is equivalent to:

    int num_empty_strings = (strlen(s1) != 0) + (strlen(s2) != 0) + (strlen(s3) != 0)
Which you use is really a matter of coding style.


If we are being cryptic already, why not

    int num_empty_strings = !!*s1 + !!*s2 + !!*s3;


That isn't only more cryptic, it's also potentially a lot more efficient -- strlen takes time proportional to the length of the string, which of course you don't need to do if you only care whether or not the length is zero. You shouldn't use strlen for empty-string tests.


In practice, GCC and Clang don't seem to have any issues inlining the necessary part of strlen at -O1 or higher (https://godbolt.org/z/rM198aYea). But MSVC inlines the empty-string case, while still calling out for nonempty strings, probably since it doesn't realize that the returned length will be nonzero.


I guess since strlen uses an unsigned size, which has specified overflow behavior the compiler not only has to proof the initial iteration, but also all the ULLONG_MAX+1 multiples, which of course refer to the same memory address. But maybe its harder for the optimizer to see.


Note that your code computes the number of nonempty strings.


That is entirely unneccessary. An == expression will always evaluate to 1 or 0. The !!x trick can be useful in some other situations, though.

Here’s a thing you could do (but I don’t know why):

+= !(c-’s’) - !(c-’p’)


this, anyone above 20 can operate.


It is seems there is yet insufficient data for meaningful answer.


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

Search: