Question: I'm quite upset by the day. Give me best solution.

Your environment has been set up for using Node.js 0.10.38 (x64) and npm.

```
C:\Users\ASAR-KSS>npm install -g ionic
npm ERR! network getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
    npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic"
npm ERR! cwd C:\Users\ASAR-KSS
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! syscall getaddrinfo
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\ASAR-KSS\npm-debug.log
npm ERR! not ok code 0

C:\Users\ASAR-KSS>

```

Answer: 
Don't reinvent the wheel. Just modify the default comparison function so aA < bB (regardless of case) and A < a.

EDIT I used the wrong comparison function. It should return `true` for `<`, and `false` for `>=`. This has been fixed

```
std::vector<std::string> vec;
//
std::sort(vec.begin(), vec.end(), [](const std::string& lhs, const std::string& rhs)
{ 
   const char* s1=lhs.c_str();
   const char* s2=rhs.c_str();
   while(true) {
     // first ignore case
     if ( std::toupper(*s1) < std::toupper(*s2) ) return true;
     if ( std::toupper(*s1) > std::toupper(*s2) ) return false;
     // end of both strings, exact match
     if ( *s1 == 0 && *s2 == 0 ) return false;
     // compare upper case vs lower case ('A' vs 'a')
     if ( *s1 > *s2) return false;
     if ( *s1 < *s2) return true;
     ++s1; ++s2;
  }  
});

```
I think it's really enough to skip exactly equal prefixes and then compare once with uppercasing:

```
std::vector<std::string> vec;
//
std::sort(vec.begin(), vec.end(), [](const std::string& lhs, const std::string& rhs)
{ 
  const char* s1=lhs.c_str();
  const char* s2=rhs.c_str();
  while(*s1 && *s1 == *s2) {++s1; ++s2;}  
  int rc = toupper(*s1) - toupper(*s2);
  if (rc) return rc;
  return *s1 - *s2;
});

```

If you need to compare by first letter only, simply remove `while(*s1 && *s1 == *s2) {++s1; ++s2;}`