Better HN
topnewbestaskshowjobs
Log inSign up

muraty

1 karma · joined Dec 6, 2012 (13y ago) · 3 submissions

Submissions

comment 12y ago · link · parent

From `The CERT Oracle Secure Coding Standard for Java`

public static int safeAdd(int l, int r) throws OverflowException {

    if (r > 0
            ? l > Integer.MAX_VALUE - r
            : l < Integer.MIN_VALUE - r)
        throw new ArithmeticException(String.format(
                "Integer overflow: %d + %d", l, r));
    return l + r;
}

https://www.securecoding.cert.org/confluence/display/java/NU...

comment 12y ago · link · parent

There is checkio.org for Pythonistas. As I know, there is no language choice for now but there will be on the future.It motivates coders with gamification and also level of problems.