Solved - USB Debuging - OnePlusX Greyed / Disabled / Enabled

Enable Developer Option in OnePlus X

Step 1: Unlock your phone and go to settings.
Step 2: Under Settings, scroll down and open About phone.
Step 3: Under About phone, find Build Number and tap seven times on it. 
After tapping seven times on it, you will get a message on your screen that you are now a developer. That’s it you have successfully enabled developer option on your OnePlus X.

Enable USB Debugging in OnePlus X

Step 1: Go to settings.
Step 2: Under Settings, Scroll down and tap on Developer option.
Step 3: Under developer option, tap on USB debugging, select USB Debugging to enable it.
That’s it. You have successfully enabled USB Debugging on your OnePlus X.
 
 
If still its greyed out for you, this is the final step
 
Go to Settings > Storage ... click on the 3 dots on top right corner, Enable as Media device.  
Repeat above steps you will be able to enable USV|B Debugging option and get connected to PC/MAC
Click here to View more...

Sort file contents

import java.io.*;
import java.util.*;

public class Sort {

    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new FileReader("fileToRead"));
        Map<String, String> map=new TreeMap<String, String>();
        String line="";
        while((line=reader.readLine())!=null){
         map.put(getField(line),line);
        }
        reader.close();
        FileWriter writer = new FileWriter("fileToWrite");
        for(String val : map.values()){
         writer.write(val); 
         writer.write('\n');
        }
        writer.close();
    }

    private static String getField(String line) {
     return line.split(" ")[0];//extract value you want to sort on
    }
}
Click here to View more...