Is it possible to create a piece of code that can learn?
like a robot? e.g if it see's a picture of me, the code will learn and understand that the picture is me every time it see's it??

Im going to say yes. But its not as simple as writing some source in c++. You have to deal with hardware, and other software that all interact with eachother. But they have been doing that stuff for a while now, especially in japan. Its on TV a lot about robots and what not.

What ur seeking for , is actually a whole different field of science called artificial intelligence .
Well ur imagination is possible but requires u to know a lot of concepts and knowledge on those specifics , hence its not a viable option if ur a newbie .

check out clever bot; its a prime example of artificial intelligence....It can supposedly learn from people (according to the creators);)

i remember hearing about how tto turn your computer into A.I only basic programming skills nessacary, i am really interested in my A.I, i think this was called LEAF A.I any one heard of that?

(please excuse the spelling)