Evan Martin (evan) wrote in evan_tech,
Evan Martin


This weekend I've been working on the ICFP contest again.
I'm taking much more casually than last year -- I started after dinner last night and gave it just a few hours -- but the fun is not in being a strong competitor but in solving the problems.

I lost a good four hours today tracking down a C++ precedence bug. I needed to test whether a number was even and wrote
if (i & 1 == 0)
which unfortunately parses as
if (i & (1 == 0))
which is true for all nonzero i always false.

The worst part of it is, they provided a check program that told me nearly exactly where the problem was, but I looked over that code and convinced myself it was so obviously correct that a bug elsewhere must be cascading into the failure here.

That's what I get for being too clever, I guess! Shoulda just used mod in the first place.
(I'm also a little bummed that speed concerns have kept me from using any languages other than C++, though really we should've gotten to this point midday yesterday...)
Tags: icfp

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • google ime

    Japanophiles might be interested to learn that Google released a Japanese IME. IME is the sort of NLP problem that Google is nearly uniquely…

  • ghc llvm

    I read this thesis on an LLVM backend for GHC, primarily because I was curious to learn more about GHC internals. The thesis serves well as an…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.