Live data from Hacker News

If (((_ok)? true: (Math.random() 0.1))) {return res;}

github.com

1–4 of 4 posts

Re: If (((_ok)? true: (Math.random() 0.1))) {return res;}

#2
The code in question is:

            } catch (Exception e) {
                if (!((_ok) ? true : (Math.random() > 0.1))) {
                    return res;
                }
                (error logging)
                _ok = false;
            }
A 10% percent chance to skip logging under certain circumstances. Very strange code, and a strange way to write it. Also wouldn't this be equivalent to

    if (!_ok || (Math.random() > 0.1))

Re: If (((_ok)? true: (Math.random() 0.1))) {return res;}

#3

The code in question is: } catch (Exception e) { if (!((_ok) ? true : (Math.random() > 0.1))) { return res; } (error logging) _ok = false; } A 10% percent chance to skip logging under certain circumstances. Very strange code, and a strange way to write it. Also wouldn't this be equivalent to if (!_ok || (Math.random() > 0.1))

http://stackoverflow.com/questions/16833100/why-does-the-mon...

Re: If (((_ok)? true: (Math.random() 0.1))) {return res;}

#4
post #3

The code in question is: } catch (Exception e) { if (!((_ok) ? true : (Math.random() > 0.1))) { return res; } (error logging) _ok = false; } A 10% percent chance to skip logging under certain circumstances. Very strange code, and a strange way to write it. Also wouldn't this be equivalent to if (!_ok || (Math.random() > 0.1))

http://stackoverflow.com/questions/16833100/why-does-the-mon...

Well that should be the article link. That's a good answer too.