Fine line between "figuring it out on my own" and "asking for help" in research labs? For some background: I'm very new to graduate school, in fact I just started unofficially doing research a few months ago, my official PhD program starts in the Fall (I moved out there early). Currently, I'm at a big R01 institution, coming from a pretty low ranking obscure undergraduate school, and there is an intimidation factor when I'm surrounded by accomplished postdocs (they pushed out more papers than my professors with tenure in my undergraduate). It's slightly amplified when I consider that, so far, I effectively only have a Bachelor's degree. 

Anyway, I was given some code to modify for a specific device. I'm not really pestered or swarmed for deadlines, and I'm trying to figure it out. I honestly think there is an error in the syntax that prevents me from being able to carry out a colleague's request. I have prior coding experience. I'm a traditional "I want the challenge of figuring it out so I can develop and learn" kind of guy, but where do you draw the line between the latter mentality and requesting help? I don't want to come off as stupid or needy, and I want my lab to be able to depend on me. So far I have been pretty reliable (and that's saying a lot considering I'm a big critic of myself), and I don't want to kill the momentum.
Can you ask your colleague (or whoever wrote the code) a quick question to ascertain whether it's a simple error in the code, or some more complex hurdle that you need to work around?

Don't be afraid to ask for help! You'll be a lot more productive if you ask for help when you really are stuck, rather than waiting too long.

A more experienced mind can usually tell quite quickly whether it's an easy or difficult problem to solve. There's no use banging your head against a brick wall for days if your supervisor has a sledgehammer hidden in his cupboard!