close

Privacy guaranteed - Your email is not shared with anyone.

Chasing a code bug

Discussion in 'Tech Talk' started by devildog2067, Jul 12, 2007.

  1. devildog2067

    devildog2067

    Joined:
    Apr 20, 2005
    Messages:
    16,325
    Likes Received:
    1,125
    Location:
    Chicago
    I just spent three hours chasing a code bug which turned out to be me being stupid.

    Oddly enough,
    gain[eta-1][phi-1][depth-1] += (w[layer-1] * e0 * ws_fc[eta-1][phi-1][layer-1][depth-1]);

    doesn't give the right answers if you're supposed to DIVIDE by ws_fc.

    I'm an idiot.

    That is all.
     
  2. Blinky

    Blinky Rocket Surgeon

    Joined:
    Jul 14, 2005
    Messages:
    1,916
    Likes Received:
    0
    Location:
    Beaver, OR
    I'll say! Any monkey with a computer could have found that!




    :tongueout:
     

  3. HerrGlock

    HerrGlock Scouts Out CLM

    Joined:
    Dec 28, 2000
    Messages:
    23,796
    Likes Received:
    211
    Sounds like the ol' semi-colon in the wrong place in a perl script :animlol:
     
  4. vote Republican

    vote Republican White and nerdy Moderator

    Joined:
    Aug 23, 2002
    Messages:
    11,139
    Likes Received:
    2,056
    Location:
    OAF Mecca, MD
  5. 686Owner

    686Owner NRA Life Member

    Joined:
    Mar 10, 2007
    Messages:
    13,150
    Likes Received:
    2,047
    Location:
    KY
    I've done similar things. I got real good at debugging by printing out all the variables to the console and/or letting the compiler step thru it line by line.
     
  6. captainstormy

    captainstormy

    Joined:
    Jul 3, 2007
    Messages:
    5,061
    Likes Received:
    571
    Location:
    Columbus, Ohio
    Its always something small like that and it always takes hours to find it.
     
  7. freepatriot

    freepatriot Retired GT Mod Moderator Moderator

    Joined:
    Aug 8, 2002
    Messages:
    3,857
    Likes Received:
    29
    Location:
    South FL
    You are referring to my brain, right? :supergrin:
     
  8. freepatriot

    freepatriot Retired GT Mod Moderator Moderator

    Joined:
    Aug 8, 2002
    Messages:
    3,857
    Likes Received:
    29
    Location:
    South FL

































    Geek.
     
  9. vote Republican

    vote Republican White and nerdy Moderator

    Joined:
    Aug 23, 2002
    Messages:
    11,139
    Likes Received:
    2,056
    Location:
    OAF Mecca, MD

    :hugs:

    ;f ;f ;f ;f
     
  10. freepatriot

    freepatriot Retired GT Mod Moderator Moderator

    Joined:
    Aug 8, 2002
    Messages:
    3,857
    Likes Received:
    29
    Location:
    South FL

    :rofl: :rofl: :rofl: :rofl:

    <--- almost had forgotten about ;f;f;f