Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

icfp!

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
Subscribe

  • socks5 proxying flash via ssh

    Suppose you're in Germany and want to watch some Flash-based videos that are IP-limited to the US for whatever reason. At first you'd think you could…

  • use chrome as your emacs browser

    The emacs-configured browser is used for operations like previewing your markdown buffer ( markdown-preview; C-c C-c p in markdown-mode). I still…

  • recovering a disk clobbered with dd

    I managed to accidentally dd 600mb over my primary disk; I haven't done that in many years. Adam thankfully pointed out that my data should be…

  • Post a new comment

    Error

    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.
  • 9 comments