Do you have a green card? Is there legal issues with staying in America? I think this would be helpful information; otherwise, getting a new job in Silicon Valley (or America) should be fine for someone as capable as you.
"Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us." -Calvin and Hobbes
When I read this, I was really hit because I was the same way my entire high school life. So this topic makes me very emotional and I'm saddened by your story. No one should experience the loneliness you're experiencing...I'm sorry.
But I think you're definitely not alone in this area--many computer science students feel the same way. Many people have mentioned making yourself respected, doing activities, etc...these things help but a relationship is two-way. To make a friendship work, you really just have to be other-centered: thinking about other before yourself, actively remembering someone's name, actively listening to people.
One good book to check out on this very topic is "How to Win Friends and Influence Others" by Dale Carnegie. And if you want you can email me :)
"...we've found a very serious problem: no matter how carefully we select the mean, no matter how patiently we make the analysis, when they get here something happens: it always turns out that approximately half of them are below average!"
-Richard Feynman
Programming IS hard. You can ask the PhD. Computer Science students at any decent college and they will tell you that they are humbled because the field of programming is so vast and wonderful and full of mystery. I think we can admit that we have discovered .000000000000000001% of the things that can be discovered at this point in the field of programming.
Well...it seems like Eric Z. and the UC Berkeley Hackers@Berkeley club really can easily vote their way up on HackerNews. It's happened more than once and its not a coincidence :\
Still, amazing article and learned a lot in 5 minutes :)