query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
This function prints contents of linked list starting from the given node | public void printList()
{
Node tnode = head;
while (tnode != null)
{
System.out.print(tnode.data+" ");
tnode = tnode.next;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void printlist(Node node) {\n\t\twhile (node != null) {\n\t\t\tSystem.out.print(node.data + \"->\");\n\t\t\tnode = node.next;\n\t\t}\n\t}",
"void printList(Node node) {\n\t\twhile (node != null) {\n\t\t\tSystem.out.print(node.data + \" \");\n\t\t\tnode = node.next;\n\t\t}\n\t}",
"public void pri... | [
"0.7803719",
"0.7774481",
"0.76632714",
"0.76465195",
"0.762311",
"0.75960416",
"0.75607383",
"0.751654",
"0.7514664",
"0.74883306",
"0.7486307",
"0.74784636",
"0.74757874",
"0.74649453",
"0.7442837",
"0.74317086",
"0.74030715",
"0.7390856",
"0.73891675",
"0.7368258",
"0.7330... | 0.77008724 | 2 |
======= private Button backButton; >>>>>>> 119aa4894c2e45db3ce3b525cae85ac9d9c30345 | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_kebijakan_privasi);
//<<<<<<< HEAD
backButton = (ImageView) findViewById(R.id.backButton);
//=======
// backButton = (Button)findViewById(R.id.backButton);
//>>>>>>> 119aa4894c2e45db3ce3b525cae85ac9d9c30345
// backButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
//
// startActivity(new Intent(KebijakanPrivasiActivity.this,HomePageActivity.class));
// finish();
// }
// });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }",
"@Override\r\n\tpublic void backButton() {\n\t\t\r\n\t}",
"@Override\n\tpublic void backButton() {\n\n\t}",
"public void goBack() {\n goBackBtn();\n }",
"private void configureBackButton() {\n LinearLayo... | [
"0.83464426",
"0.8303687",
"0.8192091",
"0.80647445",
"0.80423635",
"0.8025823",
"0.79928744",
"0.77522564",
"0.7726775",
"0.76804465",
"0.7635073",
"0.7634089",
"0.76169497",
"0.75851905",
"0.75718117",
"0.7555924",
"0.751378",
"0.75094336",
"0.74889857",
"0.7484366",
"0.748... | 0.0 | -1 |
This is valid even for unsorted lists but the specification assumes the parametarized arrays are sorted | public static int[] merge_v1(int[] arr1, int[] arr2) {
// checking if the arrays are null
if ((arr1 == null || arr1.length == 0) && (arr2 == null || arr2.length == 0)) {
return null;
} else if (arr1 == null || arr1.length == 0) {
return arr2;
} else if (arr2 == null || arr2.length == 0) {
return arr1;
}
int[] result = new int[arr1.length + arr2.length];
boolean[] isUsed = new boolean[arr1.length + arr2.length];
Arrays.fill(isUsed, false);
int index = -1;
boolean check;
for (int i = 0; i < result.length; i++) {
result[i] = Integer.MIN_VALUE;
check = false;
for (int j = 0; j < arr1.length; j++) {
// if the current int is greater than lowest and is not used
if ((check == false && isUsed[j] == false) || (result[i] > arr1[j] && isUsed[j] == false)) {
result[i] = arr1[j];
index = j;
check = true;
// isUsed[j] = true;
}
}
for (int j = 0; j < arr2.length; j++) {
// if the current int is greater than lowest and is not used
if ((check == false && isUsed[j + arr1.length] == false)
|| (result[i] > arr2[j] && isUsed[j + arr1.length] == false)) {
result[i] = arr2[j];
index = j + arr1.length;
check = true;
// isUsed[j + + arr1.length] = true;
}
}
isUsed[index] = true;
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void givenAnArrayWithTwoElements_ThenItIsSorted() {\n\t\tList<Integer> unsorted = new ArrayList<>();\n\t\tunsorted.add(2);\n\t\tunsorted.add(1);\n\t\t\n\t\t// Execute the code\n\t\tList<Integer> sorted = QuickSort.getInstance().sort(unsorted);\n\t\t\t\n\t\t// Verify the test result(s)\n\t\tassertTh... | [
"0.61285144",
"0.6115892",
"0.6083639",
"0.6003909",
"0.5952579",
"0.59414834",
"0.5925763",
"0.58924824",
"0.5892448",
"0.58900267",
"0.5884143",
"0.58153445",
"0.5811471",
"0.57446367",
"0.5739827",
"0.5729019",
"0.57250977",
"0.57247734",
"0.5722034",
"0.5720706",
"0.57000... | 0.0 | -1 |
checking if the arrays are null | public static int[] merge_v2(int[] arr1, int[] arr2) {
if ((arr1 == null || arr1.length == 0) && (arr2 == null || arr2.length == 0)) {
return null;
} else if (arr1 == null || arr1.length == 0) {
return Arrays.copyOf(arr2, arr2.length);
} else if (arr2 == null || arr2.length == 0) {
return Arrays.copyOf(arr1, arr1.length);
}
// assuming arr1 and arr2 are null
int pointer1 = 0;
int pointer2 = 0;
int[] result = new int[arr1.length + arr2.length];
for (int i = 0; i < result.length; i++) {
if (pointer2 > arr2.length - 1) {
result[i] = arr1[pointer1];
pointer1++;
} else if ((pointer1 > arr1.length - 1) || (arr1[pointer1] > arr2[pointer2])) {
result[i] = arr2[pointer2];
pointer2++;
} else {
result[i] = arr1[pointer1];
pointer1++;
}
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean checkEmpty() {\n\t\treturn this.array[0] == null;\n\t}",
"protected boolean arrayIsEmpty(Object arr[]) {\n boolean empty = true;\n \n for (Object obj : arr) {\n \tif (obj != null) {\n \t\tempty = false;\n \t\tbreak;\n \t}\n }\n \tretur... | [
"0.7407028",
"0.7116774",
"0.69554156",
"0.6815766",
"0.6782189",
"0.6574275",
"0.65640604",
"0.65471154",
"0.65221983",
"0.651497",
"0.64830196",
"0.6455924",
"0.64379495",
"0.64083546",
"0.6398787",
"0.6376817",
"0.63604224",
"0.62838364",
"0.62705064",
"0.6259737",
"0.6239... | 0.0 | -1 |
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.synonym, container, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup... | [
"0.6739604",
"0.67235583",
"0.6721706",
"0.6698254",
"0.6691869",
"0.6687986",
"0.66869223",
"0.6684548",
"0.66766286",
"0.6674615",
"0.66654444",
"0.66654384",
"0.6664403",
"0.66596216",
"0.6653321",
"0.6647136",
"0.66423255",
"0.66388357",
"0.6637491",
"0.6634193",
"0.66251... | 0.0 | -1 |
=========================================================== Getter & Setter =========================================================== | public Orientation getOrientation() {
return mOrientation;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"@Override\n public void get() {}",
"@Override\r\n\tpublic void get() {\n\t\t\r\n\t}",
"protected abstract Set method_1559();",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"@Override\n\tpublic void initValue() {\n\t\t\n\t}",
"@Override\r\... | [
"0.65319645",
"0.64282036",
"0.64009315",
"0.6387676",
"0.63788813",
"0.6266885",
"0.6217548",
"0.6172981",
"0.6143174",
"0.6143174",
"0.6134374",
"0.6133767",
"0.6102565",
"0.6064462",
"0.60481626",
"0.6023258",
"0.60172707",
"0.60172707",
"0.60172707",
"0.60172707",
"0.6017... | 0.0 | -1 |
=========================================================== Methods for/from SuperClass/Interfaces =========================================================== | @Override
public void setScaleX(final float pScaleX) {
super.setScaleX(1f); //scale not allowed on Layout Object
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"... | [
"0.6647618",
"0.66267765",
"0.6450554",
"0.6426596",
"0.6335329",
"0.6322835",
"0.6322835",
"0.62517524",
"0.62289923",
"0.6216249",
"0.6193892",
"0.6193518",
"0.6172878",
"0.6164457",
"0.61408776",
"0.613328",
"0.6111796",
"0.61112046",
"0.6110321",
"0.6108772",
"0.6068662",... | 0.0 | -1 |
/ 3.Electricity bill is calculated based on below conditions find the actual amount to be paid by the user.Units Cost/Unit 0100 $1 100300 $0.75 300500 $0.50 500> $0.25 Write program to calculate the monthly bill user needs to pay get units consumed from user? cumulative amount | public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter the number of units consumed: ");
int units = input.nextInt();
double amount;
double totalamt = 0;
if (units < 0 || units == 0) {
System.out.println("Error! Units consumed should be more than 0");
} else if (units > 0 && units <= 100) {
amount = 1;
totalamt = amount * units;
} else if (units > 100 && units <= 300) {
amount = 0.75;
totalamt = 100 * 1 + (amount * (units - 100));
} else if (units > 300 && units <= 500) {
amount = 0.50;
totalamt = 100 * 1 + 200 * 0.75 + (amount * (units - 300));
} else {
amount = 0.25;
totalamt = 100 * 1 + 200 * 0.75 + 200 * 0.50
+ (amount * (units - 500));
}
System.out.println("Your monthly bill is: $" + totalamt);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calculateBill() {\n\t\tif (unit <= 100) {\r\n\t\t\tbill = unit * 5;\r\n\t\t}else if(unit<=200){\r\n\t\t\tbill=((unit-100)*7+500);\r\n\t\t}else if(unit<=300){\r\n\t\t\tbill=((unit-200)*10+1200);\r\n\t\t}else if(unit>300){\r\n\t\t\tbill=((unit-300)*15+2200);\r\n\t\t}\r\n\t\tSystem.out.println(\"EB amoun... | [
"0.7619908",
"0.66972136",
"0.62433606",
"0.62324554",
"0.6147246",
"0.61425817",
"0.6104827",
"0.61029863",
"0.6087097",
"0.60799354",
"0.60632205",
"0.6062701",
"0.6059543",
"0.60392916",
"0.60332406",
"0.5981073",
"0.5928855",
"0.59235895",
"0.5912168",
"0.5907946",
"0.590... | 0.7133997 | 1 |
TODO Autogenerated method stub | @Override
public IBinder onBind(Intent arg0) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
stopService(new Intent(MainActivity.this, MyService.class)); Toast.makeText(MainActivity.this, "SAVE", Toast.LENGTH_SHORT).show(); | @Override
public void onClick(View view) {
Log.d("CALL_TEST", "SAVE!");
DbManager db = DbManager.getInstance(getApplicationContext());
ContentValues contentValues = new ContentValues();
contentValues.put("NAME", "홍길동");
contentValues.put("PHONE", "1234");
db.insert(contentValues);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onClick(View v) {\n stopService(new Intent(MainActivity.this, MyService.class));\n }",
"public void stopService() {\r\n Log.d(LOG, \"in stopService\");\r\n stopService(new Intent(getBaseContext(), EventListenerService.class));\r\n ... | [
"0.81537366",
"0.7517958",
"0.7455601",
"0.7317528",
"0.72603095",
"0.7236622",
"0.7234201",
"0.7230419",
"0.7207137",
"0.7142005",
"0.71348965",
"0.70397407",
"0.70235956",
"0.70197177",
"0.695734",
"0.6945227",
"0.693374",
"0.6919167",
"0.6918961",
"0.6900625",
"0.6873573",... | 0.0 | -1 |
Constructor for the class. At the moment, it initializes it with a single user: "Bob", with "user" and "pass" as username and password. TODO: Remove the default user Bob once registration is correctly implemented. | public UserManager() {
allUsers = new ArrayList<>();
allUsers.add(new RegularUser("Bob", "user","pass", new int[0] , "email"));
allUserNames = new ArrayList<>();
allUserNames.add("user");
allPasswords = new ArrayList<>();
allPasswords.add("pass");
allEmails = new ArrayList<>();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public User(String username, String nPassword)\n {\n userName = username;\n password = nPassword;\n }",
"User()\n\t{\n\n\t}",
"public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTech... | [
"0.77166003",
"0.76513964",
"0.75114894",
"0.74837315",
"0.7481479",
"0.74341846",
"0.74198925",
"0.7419679",
"0.73354214",
"0.7334358",
"0.7306078",
"0.7304095",
"0.7302035",
"0.7267574",
"0.7215345",
"0.7189101",
"0.7182249",
"0.7164451",
"0.7152559",
"0.71271956",
"0.71240... | 0.7117103 | 21 |
Getter for the ArrayList of all users. | public ArrayList<User> getAllUsers() {
return allUsers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ArrayList<User> getUsers() {return users;}",
"@Override\n\tpublic ArrayList<User> getAll() {\n\t\treturn this.users;\n\t}",
"public ArrayList<User> getUserList () {\n return (ArrayList<User>)Users.clone();\n \n }",
"public ArrayList<User> getList() {\n return list;\n }",
"... | [
"0.86127526",
"0.8485676",
"0.83944374",
"0.8385196",
"0.8229148",
"0.81949097",
"0.8184374",
"0.8183042",
"0.8173175",
"0.81103045",
"0.8101233",
"0.80909395",
"0.8084691",
"0.80812013",
"0.80804616",
"0.8059694",
"0.8032945",
"0.8016001",
"0.8009374",
"0.7992226",
"0.798960... | 0.8598155 | 1 |
Getter for the ARrayList of all usernames. | public ArrayList<String> getAllUserNames() {
return allUserNames;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Collection<String> getUsernames();",
"public List<String> getAllUserNames()\n\t{\n\t\treturn userDao.findUserNames();\n\t}",
"List<String> loadAllUserNames();",
"public ArrayList<String> getAllUsers() {\n\t\tSystem.out.println(\"Looking up all users...\");\n\t\treturn new ArrayList<String>(users.keySet());\t... | [
"0.78376406",
"0.76319057",
"0.76202106",
"0.75356627",
"0.7441992",
"0.7407089",
"0.73874295",
"0.7358704",
"0.72650075",
"0.7240533",
"0.70682156",
"0.7062485",
"0.7062018",
"0.7026442",
"0.6988742",
"0.6869374",
"0.68329346",
"0.6791059",
"0.6771802",
"0.67707366",
"0.6762... | 0.83501035 | 0 |
Getter for the ArrayList of all passwords. | public ArrayList<String> getAllPasswords() {
return allPasswords;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Password> getPasswordList() {\n return passwordList;\n }",
"public String getPasswords() {\n return this.passwords;\n }",
"public char[] getPassword() {\n return password;\n }",
"private char[] getPass()\n {\n return password.getPassword();\n }",
"publ... | [
"0.8363361",
"0.77632785",
"0.69769096",
"0.67916673",
"0.6577719",
"0.6577719",
"0.65620047",
"0.64950657",
"0.649441",
"0.6476778",
"0.6441971",
"0.6441971",
"0.640782",
"0.63509417",
"0.6293036",
"0.62868345",
"0.62714",
"0.62672883",
"0.62450665",
"0.62418926",
"0.6241892... | 0.8551669 | 0 |
Getter for the ArrayList of all passwords. | public ArrayList<String> getAllEmails() {
return allEmails;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ArrayList<String> getAllPasswords() {\n return allPasswords;\n }",
"public List<Password> getPasswordList() {\n return passwordList;\n }",
"public String getPasswords() {\n return this.passwords;\n }",
"public char[] getPassword() {\n return password;\n }",
"p... | [
"0.8552069",
"0.83631593",
"0.77630395",
"0.69767195",
"0.6791195",
"0.6577507",
"0.6577507",
"0.65614027",
"0.6495167",
"0.6494583",
"0.6475918",
"0.6440947",
"0.6440947",
"0.64067626",
"0.6350428",
"0.62919074",
"0.6286496",
"0.62705415",
"0.6266359",
"0.6244095",
"0.624087... | 0.0 | -1 |
Searches through all users in the ArrayList to check if any of them have the username and password provided. In which case it returns true. | public boolean loginAttempt(String username, String password) {
for(User u: allUsers) {
if (u.getUserName().equals(username) && u.getPassword().equals(password)) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean checkCredentials(String userName, String password)\n {\n int count = 0;\n for(String user : userNames)\n {\n if(user.contentEquals(userName))\n {\n if(passwords[count].contentEquals(password))\n {\n retur... | [
"0.7525746",
"0.73264474",
"0.72557455",
"0.7060866",
"0.7021739",
"0.6958311",
"0.68639344",
"0.68180305",
"0.6778055",
"0.6682553",
"0.6622533",
"0.66193914",
"0.66074526",
"0.6600222",
"0.65515137",
"0.65331733",
"0.65290624",
"0.6528763",
"0.6462035",
"0.643893",
"0.64089... | 0.6509924 | 18 |
Adds a user to the list of all users, along with the username and password. | public User addUser(User user) {
allUsers.add(user);
allUserNames.add(user.getUserName());
allPasswords.add(user.getPassword());
allEmails.add(user.getEmail());
return user;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addUser(User user){\r\n users.add(user);\r\n }",
"public void addUser(User user) {\n\t\tuserList.addUser(user);\n\t}",
"public void add(User user) {\r\n this.UserList.add(user);\r\n }",
"public void addUser(User user) {\n\t\tSystem.out.println(\"adding user :\"+user.toString());\n\t... | [
"0.8308536",
"0.81180215",
"0.80255216",
"0.7981064",
"0.7890688",
"0.78592485",
"0.78306675",
"0.7819011",
"0.77797824",
"0.7571688",
"0.7476158",
"0.73968273",
"0.73891914",
"0.72982854",
"0.72980124",
"0.7283897",
"0.72740537",
"0.72612524",
"0.7259495",
"0.72229046",
"0.7... | 0.7367618 | 13 |
Takes in a username and sees if it already exists in the UserManager. Prevents the creation of multiple users with the same username. | public boolean findValidUsername(String username) {
if (allUserNames.isEmpty()) {
return true;
}
for (String s: allUserNames) {
if(s.equals(username)) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean checkExistingUsername(String username) {\n boolean existingUsername = false;\n User user = userFacade.getUserByUsername(username);\n if (user != null) {\n existingUsername = true;\n }\n return existingUsername;\n }",
"public boolean userDuplicateCh... | [
"0.7557953",
"0.7461996",
"0.7240872",
"0.71811146",
"0.7155683",
"0.71125335",
"0.69979674",
"0.6992297",
"0.6921815",
"0.6903648",
"0.68622637",
"0.6857359",
"0.68357927",
"0.6795942",
"0.67933667",
"0.67464435",
"0.67291594",
"0.67192084",
"0.66818714",
"0.6671705",
"0.666... | 0.6029141 | 74 |
Takes in a password and sees if it already exists in the UserManager. Prevents the creation of multiple users with the same username. | public boolean findValidPassword(String password) {
if (allPasswords.isEmpty()) {
return true;
}
for (String s: allPasswords) {
if(s.equals(password)) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic User checkUserLogin(String userName, String password) {\n\t\treturn objUserRegistrationDao.checkUserLogin(userName, password);\r\n\t}",
"public synchronized boolean validateUser(String username, String password) {\r\n\t\tif (!mapping.containsKey(username)) {\r\n\t\t\treturn false;\r\n\t\t}\... | [
"0.64300084",
"0.6350061",
"0.6333303",
"0.6315518",
"0.63142943",
"0.6297901",
"0.628268",
"0.62794197",
"0.6262565",
"0.62313545",
"0.62252635",
"0.62089366",
"0.61974",
"0.6169811",
"0.613727",
"0.61153173",
"0.61015093",
"0.6092",
"0.609171",
"0.6062452",
"0.60577464",
... | 0.0 | -1 |
METHOD CONTRACT: Signature: method name is findValidEmail, parameters is an email string, returns boolean Preconditions: can be called at anytime Postconditions: object is not modified by method only accessed Framing Conditons: no instance variables are modified Invariants: none Takes in a email and sees if it already exists in the UserManager. Prevents the creation of multiple users with the same email. | public boolean findValidEmail(String email) {
if (allEmails.isEmpty()) {
return true;
}
for (String e: allEmails) {
if(e.equals(email)) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public User validExistingEmail(TextInputLayout tiEmail, EditText etEmail) {\n boolean result = isValidEmail(tiEmail, etEmail);\n User user = null;\n\n if (result) {\n String email = etEmail.getText().toString().trim();\n UserRepository userRepository = new UserRepository(... | [
"0.6996556",
"0.69522566",
"0.6822273",
"0.6682347",
"0.6625094",
"0.6565667",
"0.65576166",
"0.65305847",
"0.6525182",
"0.6511668",
"0.65062714",
"0.6501044",
"0.64982945",
"0.6490325",
"0.6488355",
"0.6486104",
"0.64730716",
"0.6467168",
"0.6460338",
"0.6447296",
"0.6430105... | 0.60848826 | 66 |
ToString method for the UserManager class. | @Override
public String toString() {
return "UserManager{";
//+ "allUsers=" + allUsers +
//"\n, allPasswords=" + allPasswords +
//"\n, allUserNames=" + allUserNames +
//'}';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public String toString() {\n StringBuffer sb = new StringBuffer(\"[User |\");\n sb.append(\" iduser=\").append(getIduser());\n sb.append(\"]\");\n return sb.toString();\n }",
"public String toString () {\n\t\treturn \"User, name = \" + this.getName() + \" id = \" + t... | [
"0.789604",
"0.78530777",
"0.7816114",
"0.7694717",
"0.76630366",
"0.7625734",
"0.7490825",
"0.7487844",
"0.7475417",
"0.7436646",
"0.7423196",
"0.74056995",
"0.7349455",
"0.728115",
"0.7278921",
"0.72615117",
"0.72606015",
"0.72366583",
"0.71866286",
"0.7178046",
"0.71761096... | 0.8272346 | 0 |
Constructs a new CrawlerThread object. It will use the information from the newThreadVertex object to search through that url and find more urls to add to the graph and queue up to the maximum pages and maximum depth, adhering to a politeness policy. | public CrawlerThread(Vertex newThreadVertex, LinkedHashMap<String, Vertex> crawledGraph, Queue<Vertex> graphQueue,
int maximumPages, int maximumDepth, AtomicInteger politenessInt, Semaphore politenessSem)
{
threadVertex = newThreadVertex;
graph = crawledGraph;
urlQueue = graphQueue;
maxPages = maximumPages;
maxDepth = maximumDepth;
politenessInteger = politenessInt;
politenessSemaphore = politenessSem;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public WebCrawler(MultithreadedInvertedIndex index, int limit) {\n\t\tthis.index = index;\n\t\tthis.limit = limit;\n\t\tthis.queue = new WorkQueue(limit);\n\t\tthis.urls = new ArrayList<URL>();\n\t}",
"@Override\n public void run()\n {\n Document doc = null;\n try\n {\n // P... | [
"0.60596025",
"0.5916516",
"0.5643408",
"0.5570551",
"0.54848677",
"0.5476425",
"0.54543585",
"0.5428461",
"0.5330394",
"0.5268289",
"0.5254906",
"0.52231836",
"0.51661956",
"0.50530785",
"0.50457275",
"0.5021119",
"0.49977547",
"0.49472445",
"0.49109793",
"0.4885748",
"0.485... | 0.76555556 | 0 |
This method connects to the base url provided in the constructor and begins searching through the page for more urls. If it finds a valid url, it will check the graph to determine if it has been discovered before or not. If it hasn't add it to the graph if either of the maximums hasn't been achieved yet, and add it to the queue as well. If it has been discovered, update its indegree as well as the original vertex's outdegree. | @Override
public void run()
{
Document doc = null;
try
{
// Politeness policy
try
{
// Used so that we don't have multiple threads sleeping, instead the rest just wait on the
// semaphore
if (PolitenessPolicy()) return;
doc = Jsoup.connect(threadVertex.getUrl()).get();
}
catch (InterruptedException e)
{
e.printStackTrace();
return;
}
}
catch (UnsupportedMimeTypeException e)
{
// System.out.println("--unsupported document type, do nothing");
return;
}
catch (HttpStatusException e)
{
// System.out.println("--invalid link, do nothing");
return;
}
catch (IOException e)
{
e.printStackTrace();
return;
}
finally
{
politenessInteger.incrementAndGet();
}
Elements links = doc.select("a[href]");
for (Element link : links)
{
String v = link.attr("abs:href");
// System.out.println("Found: " + v);
// Document temp = null;
if (!Util.ignoreLink(threadVertex.getUrl(), v))
{
// This was originally trying to catch invalid links before adding them to the graph
// but I realized those are also valid notes, just leaf nodes.
// This also greatly speeds up the execution of the program.
// try
// {
// try
// {
// // Used so that we don't have multiple threads sleeping, instead the rest just wait on the
// // semaphore
// if (PolitenessPolicy()) return;
//
// temp = Jsoup.connect(v).get();
// }
// catch (InterruptedException e)
// {
// e.printStackTrace();
// return;
// }
// }
// catch (UnsupportedMimeTypeException e)
// {
// System.out.println("--unsupported document type, do nothing");
// return;
// }
// catch (HttpStatusException e)
// {
// System.out.println("--invalid link, do nothing");
// return;
// }
// catch (IOException e)
// {
// e.printStackTrace();
// return;
// }
Vertex newVertex = new Vertex(v);
// We need to synchronize the graph and the queue among each thread
// This avoids dirty reads and dirty writes
synchronized(graph)
{
synchronized(urlQueue)
{
if (!graph.containsKey(newVertex.getUrl()))
{
int newVertexDepth = threadVertex.getDepth() + 1;
int currentPages = graph.size();
if (currentPages < maxPages && newVertexDepth <= maxDepth)
{
// Set the new vertex's depth and add an ancestor
newVertex.setDepth(newVertexDepth);
newVertex.addAncestor(threadVertex);
// Update the current vertex to have this one as a child
threadVertex.addChild(newVertex);
graph.put(threadVertex.getUrl(), threadVertex);
// Place the new vertex in the discovered HashMap and place it in the queue
graph.put(newVertex.getUrl(), newVertex);
urlQueue.add(newVertex);
}
}
else
{
// Done to update relationships of ancestors and children
Vertex oldVertex = graph.get(newVertex.getUrl());
oldVertex.addAncestor(threadVertex);
threadVertex.addChild(oldVertex);
graph.put(oldVertex.getUrl(), oldVertex);
graph.put(threadVertex.getUrl(), threadVertex);
}
}
}
}
else
{
// System.out.println("--ignore");
return;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressWarnings(\"unchecked\")\n\tpublic Indexer crawl (int limit) \n\t{\n\t\n\t\t////////////////////////////////////////////////////////////////////\n\t // Write your Code here as part of Priority Based Spider assignment\n\t // \n\t ///////////////////////////////////////////////////////////////////... | [
"0.5916012",
"0.5897817",
"0.57034117",
"0.5577567",
"0.5481147",
"0.5479456",
"0.54596364",
"0.54560405",
"0.5450447",
"0.5344706",
"0.52831554",
"0.52691156",
"0.5260269",
"0.5209498",
"0.52058214",
"0.5205392",
"0.5197493",
"0.5183504",
"0.508242",
"0.5053828",
"0.50502545... | 0.6126445 | 0 |
/ renamed from: a | public final C2445a m8809a() {
this.f7382a.add(GoogleSignInOptions.zzehk);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064... | 0.0 | -1 |
/ renamed from: a | public final C2445a m8810a(Scope scope, Scope... scopeArr) {
this.f7382a.add(scope);
this.f7382a.addAll(Arrays.asList(scopeArr));
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064... | 0.0 | -1 |
/ renamed from: b | public final C2445a m8811b() {
this.f7382a.add(GoogleSignInOptions.zzehi);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo2508a(bxb bxb);",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n public void b() {\n }",
"public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }",
"@Override\n\tpublic void b2() {\n\t\t\n\t}",
"v... | [
"0.64558864",
"0.6283203",
"0.6252635",
"0.6250949",
"0.6244743",
"0.6216273",
"0.6194491",
"0.6193556",
"0.61641675",
"0.6140157",
"0.60993093",
"0.60974354",
"0.6077849",
"0.6001867",
"0.5997364",
"0.59737104",
"0.59737104",
"0.5905105",
"0.5904295",
"0.58908087",
"0.588663... | 0.0 | -1 |
/ renamed from: c | public final GoogleSignInOptions m8812c() {
if (this.f7382a.contains(GoogleSignInOptions.SCOPE_GAMES) && this.f7382a.contains(GoogleSignInOptions.SCOPE_GAMES_LITE)) {
this.f7382a.remove(GoogleSignInOptions.SCOPE_GAMES_LITE);
}
if (this.f7385d && (this.f7387f == null || !this.f7382a.isEmpty())) {
m8809a();
}
return new GoogleSignInOptions(new ArrayList(this.f7382a), this.f7387f, this.f7385d, this.f7383b, this.f7384c, this.f7386e, this.f7388g, this.f7389h);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo5289a(C5102c c5102c);",
"public static void c0() {\n\t}",
"void mo57278c();",
"private static void cajas() {\n\t\t\n\t}",
"void mo5290b(C5102c c5102c);",
"void mo80457c();",
"void mo12638c();",
"void mo28717a(zzc zzc);",
"void mo21072c();",
"@Override\n\tpublic void ccc() {\n\t\t\n\t}",
... | [
"0.646086",
"0.6442468",
"0.6433268",
"0.64192164",
"0.6413362",
"0.63989705",
"0.62524456",
"0.624802",
"0.62461454",
"0.62326145",
"0.6192456",
"0.61676776",
"0.61534023",
"0.61514014",
"0.61394924",
"0.6138327",
"0.6131722",
"0.6104166",
"0.6099028",
"0.6077975",
"0.606239... | 0.0 | -1 |
elmina (status false o 0) un registro. Eliminacion logica | List<O> obtenertodos() throws DAOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void carroNoEncontrado(){\n System.out.println(\"Su carro no fue removido porque no fue encontrado en el registro\");\n }",
"@Override\r\n\tprotected boolean beforeDelete() {\r\n\t\t\r\n\t\tString valida = DB.getSQLValueString(null,\"SELECT DocStatus FROM C_Hes WHERE C_Hes_ID=\" + getC_Hes_ID()... | [
"0.6683469",
"0.6578711",
"0.6394368",
"0.6315347",
"0.61588526",
"0.6106411",
"0.6068982",
"0.6055684",
"0.5988657",
"0.59766513",
"0.59694475",
"0.5964265",
"0.5964",
"0.5963999",
"0.59542024",
"0.5931825",
"0.59243",
"0.5892895",
"0.58666325",
"0.58540756",
"0.58492005",
... | 0.0 | -1 |
todos los registros en un list | O obtener(PK id) throws DAOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void listarRegistros() {\n System.out.println(\"\\nLISTA DE TODOS LOS REGISTROS\\n\");\n for (persona ps: pd.listaPersonas()){\n System.out.println(ps.getId()+ \" \"+\n ps.getNombre()+ \" \"+\n ps.getAp_paterno()+ \" \"+ \n ... | [
"0.7191243",
"0.6155988",
"0.6055079",
"0.60520613",
"0.5880459",
"0.5850659",
"0.5832921",
"0.5798411",
"0.5786416",
"0.57837075",
"0.5777163",
"0.5775584",
"0.5746515",
"0.5746351",
"0.5745456",
"0.5711531",
"0.571095",
"0.5709421",
"0.5707482",
"0.5706424",
"0.56977475",
... | 0.0 | -1 |
obtiene un registro con su identidicador | void iniciarOperacion() throws DAOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ParqueaderoEntidad agregar(ParqueaderoEntidad parqueadero);",
"ParqueaderoEntidad agregar(String nombre);",
"TblSecuencia findByIdSecuencia(long idSecuencia );",
"AuditoriaUsuario find(Object id);",
"public void findbyid() throws Exception {\n try {\n Con_contadorDAO con_contadorDAO = getCon_contad... | [
"0.67224693",
"0.6669365",
"0.66187626",
"0.66101986",
"0.66012853",
"0.6593852",
"0.65328485",
"0.65157574",
"0.6410607",
"0.63813734",
"0.63728964",
"0.63717926",
"0.6370542",
"0.63693166",
"0.6318511",
"0.63066316",
"0.6297834",
"0.6283799",
"0.62818575",
"0.62667936",
"0.... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public List<Book> findSomeBook(PageEntiy entiy) {
String sql = "select * from books where tag=1 limit ?,?";
try {
List<Book> books = runner.query(sql,new BeanListHandler<Book>(Book.class),entiy.getPageNum()*entiy.getPageSize(),entiy.getPageSize());
return books;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public boolean deleteByBookId(String id) {
Connection conn=null;
PreparedStatement pst=null;
boolean flag=false;
try {
conn=Dbconn.getConnection();
String sql = "update books set tag=0 where id=?";
pst = conn.prepareStatement(sql);
pst.setString(1, id);
if(0<pst.executeUpdate()){
flag=true;
}
return flag;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
Dbconn.closeConn(pst, null, conn);
}
return flag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int findtotalbooks() {
String sql="select count(*) from books where tag=1";
try {
Object query = runner.query(sql, new ScalarHandler<Object>(1));
Long long1=(Long)query;
return long1.intValue();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public boolean updateByBookId(Book book) {
boolean flag=false;
String sql="update books set title=?,author=?,publisherId=?,publishDate=?,isbn=?,wordsCount=?,unitPrice=?,contentDescription=?,aurhorDescription=?,editorComment=?,TOC=?,categoryId=?,booksImages=?,quantity=?,address=?,baoyou=? "
+ "where id=?";
List<Object> list=new ArrayList<Object>();
if(book!=null){
list.add(book.getTitle());
list.add(book.getAuthor());
list.add(book.getPublisherId());
list.add(book.getPublishDate());
list.add(book.getIsbn());
list.add(book.getWordsCount());
list.add(book.getUnitPrice());
list.add(book.getContentDescription());
list.add(book.getAurhorDescription());
list.add(book.getEditorComment());
list.add(book.getTOC());
list.add(book.getCategoryId());
list.add(book.getBooksImages());
list.add(book.getQuantity());
list.add(book.getAddress());
if(book.getBaoyou()=="0"){
book.setBaoyou("不包邮");
}else{
book.setBaoyou("包邮");
}
list.add(book.getBaoyou());
list.add(book.getId());
}
try {
int update = runner.update(sql, list.toArray());
if(update>0){
flag=true;
}
return flag;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return flag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int findTitletotal(String title, PageEntiy entiy) {
String sql="select count(*) from books where tag=1 and title like ? ";
try {
Object query = runner.query(sql, new ScalarHandler<Object>(1),"%"+title+"%");
Long long1=(Long)query;
return long1.intValue();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public Book findOneBook(String id) {
String sql="select * from books where id= ?";
String sql2 ="select * from categories where id=?";
String sql3 ="select * from publishers where id=?";
try {
Book book = runner.query(sql, new BeanHandler<Book>(Book.class), id);
Category category = runner.query(sql2, new BeanHandler<Category>(Category.class), book.getCategoryId());
Publisher publisher = runner.query(sql3, new BeanHandler<Publisher>(Publisher.class), book.getPublisherId());
book.setPublisher(publisher);
book.setCategory(category);
if(book!=null)
return book;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
obj check not null | public static boolean checkObjNotNull(Object obj) {
Optional<Object> optional = Optional.ofNullable(obj);
if (optional.isPresent()) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean m16125a(Object obj) {\n return obj == null || obj.toString().equals(\"\") || obj.toString().trim().equals(\"null\");\n }",
"public static boolean checkObjNull(Object obj) {\n Optional<Object> optional = Optional.ofNullable(obj);\n if (!optional.isPresent()) {\n ... | [
"0.74929416",
"0.74792445",
"0.7405809",
"0.72891694",
"0.70827276",
"0.7066216",
"0.70415145",
"0.6864137",
"0.68003595",
"0.67883605",
"0.67651665",
"0.6749931",
"0.6737828",
"0.6727513",
"0.6667715",
"0.66343945",
"0.6622818",
"0.655487",
"0.65519047",
"0.65378165",
"0.650... | 0.7313843 | 3 |
obj check not null | public static boolean checkObjNull(Object obj) {
Optional<Object> optional = Optional.ofNullable(obj);
if (!optional.isPresent()) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean m16125a(Object obj) {\n return obj == null || obj.toString().equals(\"\") || obj.toString().trim().equals(\"null\");\n }",
"public static <T> void checkNull(T obj){\n if(obj == null){\n throw new IllegalArgumentException(\"Object is null\");\n }\n }",
"pub... | [
"0.7493826",
"0.74062717",
"0.7314597",
"0.72895086",
"0.7083003",
"0.7066163",
"0.7041482",
"0.6865454",
"0.68007374",
"0.67887276",
"0.6764647",
"0.67501056",
"0.673827",
"0.6728176",
"0.66675323",
"0.66349065",
"0.66223687",
"0.6554849",
"0.65515167",
"0.6537416",
"0.65043... | 0.7480148 | 1 |
public static void exit(int status) | public static void main(String[] args) {
System.out.println("我们喜欢");
// System.exit(0);
System.out.println("我们也喜欢");
System.out.println("-------------");
[]
// public static void currentTimeMillis()以毫秒为单位返回当前值
System.out.println(System.currentTimeMillis());
// 单独得到这样的时间目前对我们来说意义不大,那么他有啥意义
long start = System.currentTimeMillis();
for (int i = 0; i < 100000; i++){
System.out.println("hello" + i);
}
long end = System.currentTimeMillis();
System.out.println("共耗时" + (end - start) + "ms");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void exit (int status);",
"public static void exit(int status) {\n\t\tif(status != SUCCESS)\n\t\t\tlogger.error(\"This application was terminated abnormally.\");\n\t\t\n\t\t// TODO deprecated\n\t\tif(dcenter != null) dcenter.close();\n\t\t\n\t\t// Quartz scheduler\n\t\tboolean waitForJobsToComple... | [
"0.91235155",
"0.8355717",
"0.8337362",
"0.7751619",
"0.7721719",
"0.7658243",
"0.75419897",
"0.7540272",
"0.74423087",
"0.74378574",
"0.74378574",
"0.74367267",
"0.7342468",
"0.7301032",
"0.7240541",
"0.71982276",
"0.7177544",
"0.71473825",
"0.7116036",
"0.71141714",
"0.7098... | 0.0 | -1 |
/ 5. write an int[] return method that can sort an int array in desending order 6. write a double[] return method that can sort a double array in desending order 7. write a char[] return method that can sort a char array in desending order NOTE: MUST apply method overloading | public static void main(String[] args) {
int[] arr1 = {4,6,7,2,9};
int[] result1 = descending(arr1);
System.out.println(Arrays.toString(result1));
double[] arr2 = {41.3, 5.6, 17,1,2.9};
double[] result2 = descending(arr2);
System.out.println(Arrays.toString(result2));
char[] ch={'f','e','i','g','a'};
char[] result3= descending(ch);
System.out.println(Arrays.toString(result3));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String...args){\nbyte[] byte_arr = new byte[]{69,66,65,68,67,70};\r\nchar[] char_arr = new char[]{'D','F','C','A','E','B'};\r\ndouble[] double_arr = new double[6];\r\nfloat [] float_arr = new float[]{25F,21F,27F,19F,59F,3F};\r\nint[] int_arr = new int[]{16,7,28,9,13,10};\r\nlong [] long_arr... | [
"0.7130317",
"0.6627146",
"0.6589652",
"0.65124315",
"0.64861685",
"0.64647543",
"0.63670534",
"0.6324743",
"0.6324743",
"0.6318293",
"0.6276453",
"0.62391204",
"0.6224227",
"0.620949",
"0.61850214",
"0.6173734",
"0.6165428",
"0.61470276",
"0.60910976",
"0.60300463",
"0.60243... | 0.7189391 | 0 |
TODO Autogenerated method stub | @Override
protected void onDestroy() {
super.onDestroy();
//取消某个网络请求
NMApplication.getRequestQueue().cancelAll(VOLLEY_POST);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
After inorder traversal [1,2,3,4,7,8,9] | public static TreeNode getMockWithSuccessorTreeRoot() {
TreeNode<Integer> root = new TreeNode<>(4);
TreeNode<Integer> node1 = new TreeNode<>(2);
TreeNode<Integer> node2 = new TreeNode<>(8);
TreeNode<Integer> node3 = new TreeNode<>(1);
TreeNode<Integer> node4 = new TreeNode<>(3);
TreeNode<Integer> node5 = new TreeNode<>(7);
TreeNode<Integer> node6 = new TreeNode<>(9);
root.left = node1;
root.right = node2;
node1.parent = root;
node2.parent = root;
node1.left = node3;
node1.right = node4;
node3.parent = node1;
node4.parent = node1;
node2.left = node5;
node2.right = node6;
node5.parent = node2;
node6.parent = node2;
return root;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private List<Integer> inOrderTraversal(Tree tree, List<Integer> arr){\n if(tree==null){\n return null;\n }\n\n if(tree.left!=null){\n inOrderTraversal(tree.left, arr);\n }\n arr.add(tree.data);\n\n if(tree.right!=null){\n inOrderTraversal(tree.right,arr);\n }\n return a... | [
"0.7125334",
"0.6955005",
"0.6882478",
"0.6875517",
"0.67846006",
"0.67781866",
"0.6777857",
"0.67730325",
"0.6765573",
"0.6717016",
"0.66818947",
"0.66384244",
"0.65810275",
"0.65810275",
"0.6528373",
"0.64780444",
"0.6438296",
"0.64328706",
"0.64257747",
"0.64133424",
"0.64... | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.list_view, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {... | [
"0.7249256",
"0.72037125",
"0.7197713",
"0.7180111",
"0.71107703",
"0.70437056",
"0.70412415",
"0.7014533",
"0.7011124",
"0.6983377",
"0.69496083",
"0.69436663",
"0.69371194",
"0.69207716",
"0.69207716",
"0.6893342",
"0.6886841",
"0.6879545",
"0.6877086",
"0.68662405",
"0.686... | 0.0 | -1 |
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_posts, container, false);
bookRecyclerView = view.findViewById(R.id.posts_RView);
bookRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
bookRecyclerView.setHasFixedSize(true);
firebaseDatabase = FirebaseDatabase.getInstance();
databaseReference = firebaseDatabase.getReference("Posts");
bookRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
if (dy > 0 ) {
//hide bottom app bar
((AppCompatActivity) getActivity()).getSupportActionBar().hide();
} else if (dy < 0 ) {
//show bottom app bar
((AppCompatActivity) getActivity()).getSupportActionBar().show();
}
}
});
return view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup... | [
"0.6739604",
"0.67235583",
"0.6721706",
"0.6698254",
"0.6691869",
"0.6687986",
"0.66869223",
"0.6684548",
"0.66766286",
"0.6674615",
"0.66654444",
"0.66654384",
"0.6664403",
"0.66596216",
"0.6653321",
"0.6647136",
"0.66423255",
"0.66388357",
"0.6637491",
"0.6634193",
"0.66251... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
WebDriver driver;
System.setProperty("webdriver.gecko.driver",
"C:\\Users\\dell\\Downloads\\Compressed\\geckodriver-v0.20.1-win64_2\\geckodriver.exe");
driver=new FirefoxDriver();
driver.get("https://www.google.com");
ScreenShot(driver,"c://test.png");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | private static void ScreenShot(WebDriver driver, String Filepath) {
TakesScreenshot screen=((TakesScreenshot)driver);
File SrcFile=screen.getScreenshotAs(OutputType.FILE);
//Move image to new destination
File DestFile=new File(Filepath);
//Copy file at destination location
//FileUtils.copyFile(SrcFile, DestFile);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
List all the products in the website containing the keyword | @GetMapping("/list/{name}")
public ResponseEntity<List<Product>> getProd(@PathVariable String name, final HttpSession session) {
log.info(session.getId() + " : Retrieving products with given keyword");
return ResponseEntity.status(HttpStatus.OK).body(prodService.getProdList(name));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printProductThroughName(String keyword)\n {\n System.out.println(\"List of products with keyword \" + \"[\" + keyword\n + \"]\\n\");\n \n for(Product product : stock)\n {\n if(product.name.contains(keyword))\n {\n System.out.pri... | [
"0.6917237",
"0.68623614",
"0.6646246",
"0.6534466",
"0.65184695",
"0.642844",
"0.6383309",
"0.6303107",
"0.62726796",
"0.6238936",
"0.621272",
"0.6211624",
"0.6194036",
"0.6188458",
"0.615789",
"0.6139403",
"0.6130325",
"0.61299074",
"0.6129244",
"0.61207724",
"0.61197066",
... | 0.6208843 | 12 |
Retrieve all the products in the market | @GetMapping("/retrieve")
public ResponseEntity<List<Product>> getProdAll(final HttpSession session) {
log.info(session.getId() + " : Retrieving all products");
return ResponseEntity.status(HttpStatus.OK).body(prodService.getAll());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<Product> getAllProducts();",
"List<Product> getAllProducts();",
"List<Product> getAllProducts();",
"List<Product> retrieveProducts();",
"public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Prod... | [
"0.77771086",
"0.77771086",
"0.77771086",
"0.7702293",
"0.7607474",
"0.7422748",
"0.7404341",
"0.73987293",
"0.73987293",
"0.73776704",
"0.7360006",
"0.7328789",
"0.7303137",
"0.7303137",
"0.7272853",
"0.7243286",
"0.7216202",
"0.7156576",
"0.71548533",
"0.71525484",
"0.71468... | 0.7136126 | 21 |
Place the order from your cart | @PostMapping("/order")
public ResponseEntity<OrderConfirmation> placeOrder(final HttpSession session) throws Exception {
Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);
log.info(session.getId() + " : Reviewing the order");
//check if the cart is empty
ControllerUtils.checkEmptyCart(initialCart, session.getId());
//check if items are still available during confirmation of order
List<OrderProduct> orderProducts = new ArrayList<>();
for (String key : initialCart.keySet())
orderProducts.add(ControllerUtils.parse(initialCart.get(key)));
List<String> chckQuantity = prodService.checkQuantityList(orderProducts);
if (chckQuantity != null) {
log.error(session.getId() + " : Error submitting order for products unavailable");
throw new AvailabilityException(chckQuantity);
}
//Confirm order and update tables
log.info(session.getId() + " : confirming the order and killing the session");
OrderConfirmation orderConfirmation = prodService.confirmOrder(initialCart);
session.invalidate();
return ResponseEntity.status(HttpStatus.OK).body(orderConfirmation);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void placeOrder(String custID) {\r\n //creates Order object based on current cart\r\n Order order = new Order(custID, getItems());\r\n //inserts new order into DB\r\n order.insertDB();\r\n }",
"public void placeOrder(TradeOrder order)\r\n {\r\n brok... | [
"0.7668923",
"0.74642473",
"0.6984423",
"0.6792965",
"0.67289156",
"0.6695371",
"0.6675998",
"0.6635571",
"0.6625487",
"0.66122377",
"0.65631396",
"0.65364176",
"0.6527442",
"0.6517904",
"0.6369132",
"0.63634694",
"0.6361355",
"0.6346567",
"0.62973094",
"0.627734",
"0.6262297... | 0.66103446 | 10 |
Add an item to your cart | @PostMapping(value = "/addcart")
public ResponseEntity<String> addCart(@RequestBody @Valid OrderProduct orderProduct, final HttpSession session) throws Exception {
//Get the initial cart
log.info(session.getId() + " : Reviewing the initial cart");
Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);
Integer quantity = orderProduct.getQuantity();
//Check if cart is empty and instantiate it, if product is already there in the cart, update them
if (CollectionUtils.isEmpty(initialCart)) {
log.info("No Items added yet");
initialCart = new HashMap<>();
} else {
if (initialCart.containsKey(orderProduct.getProductName()))
quantity = quantity + initialCart.get(orderProduct.getProductName()).getQuantity();
}
//check if the store has the available quantity and update the cart
log.info(session.getId() + " : Processing the addition of product to the cart");
Product product = prodService.getProd(orderProduct.getProductName());
if (product.getQuantity() >= quantity) {
CartProduct cartProduct = ControllerUtils.buildCartProduct(product, quantity);
initialCart.put(orderProduct.getProductName(), cartProduct);
session.setAttribute(CART_SESSION_CONSTANT, initialCart);
return ResponseEntity.status(HttpStatus.OK).body("Product " + orderProduct.getProductName() + " added to the cart");
} else {
log.error(session.getId() + " : Error updating cart for products unavailable");
throw new AvailabilityException(orderProduct.getProductName());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void add() {\n\t\tcart.add(item.createCopy());\n\t}",
"Cart addToCart(String productCode, Long quantity, String userId);",
"public static void addItem(int id,int quantity){\n\t\tif(userCart.containsKey(id)){\n\t\t\tint newQuantity = userCart.get(id).getQuantity() + quantity;\n\t\t\tuserCart.get(id).setQ... | [
"0.8619967",
"0.76432824",
"0.7492064",
"0.7454246",
"0.74109656",
"0.74044496",
"0.73724437",
"0.73696876",
"0.731515",
"0.72940654",
"0.72529286",
"0.7251111",
"0.7250049",
"0.72171134",
"0.7208884",
"0.71525383",
"0.7128583",
"0.7110952",
"0.70687425",
"0.7025819",
"0.7013... | 0.0 | -1 |
View your current cart | @GetMapping(value = "/viewcart")
public ResponseEntity<List<CartProduct>> viewCart(final HttpSession session) {
log.info(session.getId() + " : Retrieving the cart to view");
Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);
ControllerUtils.checkEmptyCart(initialCart, session.getId());
List<CartProduct> result = new ArrayList();
for (String key : initialCart.keySet()) {
result.add(initialCart.get(key));
}
return ResponseEntity.status(HttpStatus.OK).body(result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void ViewCart() {\r\n\t\tthis.ViewCart.click();\r\n\t}",
"public static void viewCart() {\n click(CART_BUTTON);\n click(VIEW_CART_BUTTON);\n }",
"private static void viewCart() {\r\n\t\tSystem.out.println(\"********************************************************************************... | [
"0.83849317",
"0.8279616",
"0.7972255",
"0.7551765",
"0.7239961",
"0.72003335",
"0.71291995",
"0.69074184",
"0.68898916",
"0.68806607",
"0.68702716",
"0.6834814",
"0.66766393",
"0.66004646",
"0.6534031",
"0.6475991",
"0.6473123",
"0.6416568",
"0.638857",
"0.638214",
"0.637011... | 0.6688758 | 12 |
Remove a product from the cart | @DeleteMapping(value = "/deleteproduct")
public ResponseEntity<String> deleteProduct(@RequestBody String productName, final HttpSession session) {
log.info(session.getId() + " : Reviewing the initial cart");
Map<String, CartProduct> initialCart = (Map<String, CartProduct>) session.getAttribute(CART_SESSION_CONSTANT);
//check if the cart is empty
ControllerUtils.checkEmptyCart(initialCart, session.getId());
if (!initialCart.containsKey(productName)) {
log.error(session.getId() + " : Error removing product not present in the cart");
throw new ProductNotFoundException(productName);
}
log.info(session.getId() + " : Remove the product from the cart");
initialCart.remove(productName);
session.setAttribute(CART_SESSION_CONSTANT, initialCart);
return ResponseEntity.status(HttpStatus.OK).body("Product " + productName + " removed");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void removeProduct(Product product);",
"private void removeProduct() {\n\t\tif (!CartController.getInstance().isCartEmpty()) {\n\t\t\tSystem.out.println(\"Enter Product Id - \");\n\t\t\tint productId = getValidInteger(\"Enter Product Id - \");\n\t\t\twhile (!CartController.getInstance().isProductPresentInCart(\n... | [
"0.8261058",
"0.80081296",
"0.7754476",
"0.76727986",
"0.75819707",
"0.75423974",
"0.7534745",
"0.74525464",
"0.73434323",
"0.72808635",
"0.72352403",
"0.7141418",
"0.71259403",
"0.7094623",
"0.69780266",
"0.6972037",
"0.696461",
"0.6938921",
"0.69327086",
"0.69302046",
"0.69... | 0.66976064 | 37 |
the subfolders Construct root folder. | public TaskFolder(TaskFolder parent, String name, String description)
{
super(parent, name, description, null);
this.tasks = new ArrayList<Task>();
this.folders = new ArrayList<TaskFolder>();
if (parent != null) parent.addFolder(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract String[] getBaseFolders();",
"@Override\n\tpublic Iterable<Path> getRootDirectories() {\n\t\treturn null;\n\t}",
"@Override\n protected void createRootDir() {\n }",
"protected abstract String childFolderPath();",
"public static String getRootFolderName() {\n\n return rootFol... | [
"0.6319689",
"0.61413026",
"0.6135961",
"0.60947675",
"0.6063466",
"0.60189086",
"0.587666",
"0.5867669",
"0.5763626",
"0.5677522",
"0.56484824",
"0.5644552",
"0.5610977",
"0.5603095",
"0.5585873",
"0.55716705",
"0.55639756",
"0.5561641",
"0.55562055",
"0.5529059",
"0.5521323... | 0.0 | -1 |
Set new parent folder | public void setParent(TaskFolder parent)
{
super.setParent(parent);
if (parent != null) parent.addFolder(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testSetParent_fixture28_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture28();\n\t\tFolder parent = new Folder();\n\n\t\tfixture.setParent(parent);\n\n\t\t// add additional test code here\n\t}",
"protected void setParentFolder(Folder f) {\n\t\tparentFolder = f;\n\t\tif(f!= null) {\n\t\t\tp... | [
"0.67498446",
"0.6737316",
"0.6676586",
"0.6674751",
"0.6657037",
"0.6635675",
"0.6631445",
"0.6618154",
"0.66101557",
"0.6600802",
"0.65965664",
"0.65772766",
"0.6572936",
"0.6557566",
"0.65554816",
"0.65554553",
"0.6553628",
"0.6535793",
"0.653195",
"0.65270287",
"0.6526951... | 0.7203541 | 0 |
Get tasks as array. | public Task[] getTasks()
{
return tasks.toArray(new Task[tasks.size()]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Task[][] getTasks() {\n\t\tList<Server> servers = this.scheduler.getServers();\n\t\tTask[][] tasks = new Task[servers.size()][];\n\t\tfor (int i = 0; i < servers.size(); i++) {\n\t\t\ttasks[i] = servers.get(i).getTasks();\n\t\t}\n\t\treturn tasks;\n\t}",
"public ArrayList<Task> getAllTasks() {\n \tret... | [
"0.75937533",
"0.7369134",
"0.7210738",
"0.7111246",
"0.7071655",
"0.7038894",
"0.7038894",
"0.7038894",
"0.69979",
"0.69979",
"0.69600356",
"0.6948311",
"0.69330865",
"0.6909587",
"0.690759",
"0.68943936",
"0.6892427",
"0.6885126",
"0.6843163",
"0.6825516",
"0.6742419",
"0... | 0.8103638 | 0 |
Get subfolders as array. | public TaskFolder[] getFolders()
{
return folders.toArray(new TaskFolder[folders.size()]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract String[] getBaseFolders();",
"protected abstract String[] getFolderList() throws IOException;",
"@Override\r\n\tpublic String[] listFolders() throws FileSystemUtilException {\r\n\t\t// getting all the files and folders in the given file path\r\n\t\tString[] files = listFiles();\r\n\t\tList f... | [
"0.709551",
"0.6899344",
"0.662543",
"0.6394365",
"0.6266431",
"0.6242996",
"0.62356687",
"0.62049687",
"0.6166231",
"0.61420125",
"0.6113502",
"0.61034304",
"0.60688883",
"0.6068049",
"0.60574967",
"0.60433424",
"0.6013885",
"0.6008967",
"0.59690803",
"0.59369105",
"0.584382... | 0.6918355 | 1 |
Add task to folder. | public void addTask(Task task)
{
tasks.add(task);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addTask(Task task);",
"@Override\n\tpublic void addTask(Task task) {\n\t\t\n\t}",
"public void add(Task task){ this.tasks.add(task);}",
"@Override\n public CommandResult execute() {\n tasks.add(taskToAdd);\n try {\n storage.appendToFile(taskToAdd);\n return new Com... | [
"0.7507139",
"0.7393556",
"0.73470765",
"0.7320471",
"0.7282133",
"0.72149825",
"0.71976054",
"0.71799254",
"0.71753514",
"0.71753514",
"0.71753514",
"0.7171873",
"0.7145094",
"0.704088",
"0.70150787",
"0.69614214",
"0.6955382",
"0.69433904",
"0.69420785",
"0.6833621",
"0.683... | 0.72571695 | 5 |
Add subfolder to folder. | public void addFolder(TaskFolder folder)
{
folders.add(folder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void addFolder(){\n }",
"public void addFolder(Folder f) {\n folders.add(f);\n }",
"public void add(Directory subDir) {\n\t\tthis.content.add(subDir);\n\t\tif(subDir.getParent() != null) {\n\t\t\tsubDir.getParent().content.remove(subDir);\n\t\t}\n\t\tsubDir.setParent(this);\n\t}",
"public ... | [
"0.7668136",
"0.68847084",
"0.68211544",
"0.6423417",
"0.61827177",
"0.61390615",
"0.59592754",
"0.5882618",
"0.5786594",
"0.5771318",
"0.57609856",
"0.5749575",
"0.57429636",
"0.573822",
"0.57317126",
"0.57073563",
"0.56495315",
"0.56183106",
"0.5574427",
"0.5571329",
"0.556... | 0.6726287 | 3 |
Centra elementos de la tabla > solo 'Body' | public void Centrar_Tabla(JTable tabla) {
DefaultTableCellRenderer modelocentrar = new DefaultTableCellRenderer();
modelocentrar.setHorizontalAlignment(SwingConstants.CENTER);
int columnas = tabla.getColumnCount(), i = 0;
while (i < columnas) {
tabla.getColumnModel().getColumn(i).setCellRenderer(modelocentrar);
i++;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createBody() {\n\t\tTableView<Debiteur> table = new TableView<>();\n\t\tTableColumn<Debiteur, String> naam = new TableColumn<>(\"Gast\");\n\t\tTableColumn<Debiteur, CheckBox> checkbox = new TableColumn<>(\" \");\n\t\ttable.getColumns().addAll(naam, checkbox);\n\t\tnaam.setCellValueFactory(new PropertyV... | [
"0.6887031",
"0.6854006",
"0.6358507",
"0.60561824",
"0.59842557",
"0.5940625",
"0.5760206",
"0.57063663",
"0.5677545",
"0.56514937",
"0.56220454",
"0.561165",
"0.56058943",
"0.55497193",
"0.5542085",
"0.55169874",
"0.5509294",
"0.54999024",
"0.54571474",
"0.5453296",
"0.5391... | 0.55562836 | 13 |
/ 3.SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.BusinessBlackSteelSkin"); 8.SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.CremeSkin "); 13.SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.MagmaSkin"); 15.SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.MistAquaSkin"); 21.SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.OfficeSilver2007Skin"); JFrame.setDefaultLookAndFeelDecorated(true); SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.MagmaSkin"); | public void Skin() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setupLookAndFeel() {\n SwingUtilities.invokeLater(() -> {\n model.getUserPreferences().getThemeSubject().subscribe((skin) -> {\n try {\n UIManager.setLookAndFeel(new SubstanceLookAndFeel(\n (SubstanceSkin) skin.getTheme().n... | [
"0.7476397",
"0.71138513",
"0.6953357",
"0.6857919",
"0.6632993",
"0.661241",
"0.66028357",
"0.65616596",
"0.6535818",
"0.65231395",
"0.6477454",
"0.646058",
"0.6456272",
"0.63558096",
"0.63337916",
"0.6322381",
"0.62977475",
"0.6290675",
"0.62292904",
"0.6221355",
"0.6205944... | 0.63335896 | 15 |
Load all configurations from files. | public static void loadConfig() throws Exception {
unloadConfig();
ConfigManager cm = ConfigManager.getInstance();
cm.add(new File("test_files/stresstest/" + CONFIG_FILE).getAbsolutePath());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadConfigs() {\n\t configYML = new ConfigYML();\n\t configYML.setup();\n }",
"public static void loadFromFile() {\n\t\tloadFromFile(Main.getConfigFile(), Main.instance.getServer());\n\t}",
"public void loadConfigurations(Dictionary configurations) {\n\t}",
"public void setConfigFiles(final Se... | [
"0.71509385",
"0.68861043",
"0.68239623",
"0.66869605",
"0.6636681",
"0.662102",
"0.6613157",
"0.63995886",
"0.6375427",
"0.6348021",
"0.6265025",
"0.62435544",
"0.6204592",
"0.6202941",
"0.6130943",
"0.60744804",
"0.6063121",
"0.6062016",
"0.60345966",
"0.6034291",
"0.601897... | 0.5761654 | 34 |
unload all configurations from files. | public static void unloadConfig() throws Exception {
ConfigManager cm = ConfigManager.getInstance();
for (Iterator it = cm.getAllNamespaces(); it.hasNext();) {
cm.removeNamespace((String) it.next());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@After\n public void cleanUp() {\n mApConfigFile.delete();\n }",
"static void releaseConfigFiles() throws Exception {\r\n ConfigManager configManager = ConfigManager.getInstance();\r\n for (Iterator iterator = configManager.getAllNamespaces(); iterator.hasNext();) {\r\n conf... | [
"0.6377725",
"0.6313848",
"0.6292915",
"0.6145872",
"0.612287",
"0.60811704",
"0.6018563",
"0.6009026",
"0.5994829",
"0.5969016",
"0.5915307",
"0.58696634",
"0.58396614",
"0.58351237",
"0.58322436",
"0.5798663",
"0.5788874",
"0.57663924",
"0.5759672",
"0.57524633",
"0.574819"... | 0.63291043 | 1 |
public int updateVorlageAuktions_texte(int auktion_texteId, int templateId); | public List<Map<String, Object>> getAuktionPath(int objectId, int templateId); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateOneWord(Pojo.OneWord e){ \n template.update(e); \n}",
"@Test\n public void updateTemplateTest() throws IdfyException, Exception {\n UUID id = UUID.randomUUID();\n UpdatePdfTemplate model = new UpdatePdfTemplate.Builder().build();\n PdfTemplate response = api.update... | [
"0.58228695",
"0.5813584",
"0.58018947",
"0.57084256",
"0.5603835",
"0.5550859",
"0.55459183",
"0.5515439",
"0.5506558",
"0.5496149",
"0.5468511",
"0.54237986",
"0.53736967",
"0.5357217",
"0.5325004",
"0.5293543",
"0.5280248",
"0.527236",
"0.52330464",
"0.5224916",
"0.5220293... | 0.0 | -1 |
public int saveAuktion_zusatz(int offerId, int auktion_texte_id); | public int getVorlageShopObjectID(int templateId); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int inserir(OfertaDisciplina offer){\n\t\tint id = 0;\n\t\tString sql = \"INSERT INTO deinfo.oferta_disciplina(ano, semetrstre, disciplina_oferta, localizalicao, ID_CURSO_DISPONIVEL) \"\n\t\t\t\t+ \"values(?,?,?,?)\";\n\t\ttry{\n\n\t\t\tPreparedStatement smt = (PreparedStatement) bancoConnect.retornoStateme... | [
"0.62533903",
"0.61326265",
"0.58489436",
"0.58014435",
"0.5791349",
"0.57506406",
"0.57365876",
"0.57346576",
"0.5682598",
"0.56441593",
"0.5614985",
"0.5614985",
"0.5614985",
"0.5614985",
"0.56020325",
"0.56010216",
"0.55980295",
"0.558691",
"0.55826986",
"0.5575029",
"0.55... | 0.0 | -1 |
public int saveAuktion_texte(int templateId, int offerId); | public List<Map<String,Object>> getOffersData(int objectid,Integer templateid); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveOneWord(Pojo.OneWord e){ \n template.save(e); \n}",
"public void save(Activity e){ \n\t template.save(e); \n\t}",
"public void saveTemplate(String toastText) {\n SimpleDateFormat simpleDateFormatY = new SimpleDateFormat(\"yyyy\");\n SimpleDateFormat simpleDateFormatM = n... | [
"0.6483644",
"0.6241744",
"0.61914843",
"0.58475494",
"0.5656186",
"0.56431526",
"0.55757785",
"0.5555959",
"0.5532806",
"0.55040956",
"0.54536235",
"0.54436475",
"0.5432536",
"0.5427682",
"0.54165864",
"0.5408154",
"0.54074556",
"0.5403948",
"0.5403948",
"0.5403948",
"0.5403... | 0.0 | -1 |
creation of the whole structure | @SuppressWarnings("deprecation")
public static void main(String[] args) throws InterruptedException {
Logic logic = new Logic();
Interface interfac = new Interface(logic);
Graphic graphic = new Graphic(logic);
//start of the graphic
graphic.start();
//start of the listener
interfac.listen();
//terminate lib
graphic.stop();
GLFW.glfwTerminate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Structure createStructure();",
"CreationData creationData();",
"public void create() {\n\t\t\n\t}",
"@Override\n\tpublic void generate() {\n\t\tJavaObject object = new JavaObject(objectType);\n\n\t\t// Fields\n\t\taddFields(object);\n\n\t\t// Empty constructor\n\t\taddEmptyConstructor(object);\n\n\t\t// Type... | [
"0.76049453",
"0.7071772",
"0.6878263",
"0.67076916",
"0.65467346",
"0.6500537",
"0.6460891",
"0.6458463",
"0.64334697",
"0.6403476",
"0.6352528",
"0.6349483",
"0.63348484",
"0.62962985",
"0.628511",
"0.6278673",
"0.6253897",
"0.62342566",
"0.61941963",
"0.61729234",
"0.61544... | 0.0 | -1 |
Retourne le nombre de colonnes | public int getColumnCount() {
return this.title.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int nbColonnes();",
"public int obtenirColonne() {\n return this.colonne;\n }",
"int getNombreColonnesPlateau();",
"@Override\n\tpublic int getColumnCount()\n\t{\n\t\treturn nomColonnes.length;\n\t}",
"public void displayColonies() {\r\n\t\tchar[][] temp;\r\n\t\tint count;\r\n\r\n\t\tfor (int row... | [
"0.8160502",
"0.80282825",
"0.7286599",
"0.6924315",
"0.6276242",
"0.5839355",
"0.56989104",
"0.5638027",
"0.55965585",
"0.55934244",
"0.55425406",
"0.5533613",
"0.5460152",
"0.5436126",
"0.54177815",
"0.53936243",
"0.5374076",
"0.5343103",
"0.5343103",
"0.53411216",
"0.53236... | 0.0 | -1 |
Retourne le nombre de lignes | public int getRowCount() {
return this.data.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNombreLiaison()\t{\r\n \treturn this.routes.size();\r\n }",
"public Integer getNumLoteLanc() {\n\t\treturn numLoteLanc;\n\t}",
"int nbLignes();",
"Integer getNLNDreu();",
"public int lireCount() {\n\t\treturn cpt;\n\t}",
"public int getNunFigli() {\n\t\tint numFigli = 0;\n\t\tfor (Nod... | [
"0.68001187",
"0.6649068",
"0.64486533",
"0.6353754",
"0.6197806",
"0.6173627",
"0.6167821",
"0.61526895",
"0.6148767",
"0.61460453",
"0.6069791",
"0.60680115",
"0.6043863",
"0.60343945",
"0.59884644",
"0.59749204",
"0.59749204",
"0.59749204",
"0.59749204",
"0.5923247",
"0.59... | 0.0 | -1 |
Test method for 'com.elasticpath.service.ProductServiceImpl.setProductCategoryFeatured(long, long)'. | @Test
public void testSetProductCategoryFeatured() {
// set up product and category
final long productUid = 123L;
final long categoryUid = 234L;
final Product product = new ProductImpl();
product.setUidPk(productUid);
product.setGuid("productGuid");
Category category = new CategoryImpl();
category.setUidPk(categoryUid);
category.setGuid("categoryGuid");
category.setCatalog(new CatalogImpl());
product.addCategory(category);
// mock methods
ArrayList<Integer> returnList = new ArrayList<Integer>();
returnList.add(Integer.valueOf(2));
context.checking(new Expectations() {
{
oneOf(mockProductDao).getWithCategories(with(any(long.class)));
will(returnValue(product));
oneOf(mockProductDao).getMaxFeaturedProductOrder(with(any(long.class)));
will(returnValue(2));
oneOf(mockProductDao).saveOrUpdate(with(same(product)));
}
});
// run the service
int newOrder = this.productServiceImpl.setProductCategoryFeatured(product.getUidPk(), category.getUidPk());
// check result
assertEquals(newOrder, 2 + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic final void testResetProductCategoryFeatured() {\n\t\tfinal Product mockProduct = context.mock(Product.class);\n\t\tfinal Category mockCategory = context.mock(Category.class);\n\n\t\tProductServiceImpl service = new ProductServiceImpl() {\n\t\t\t@Override\n\t\t\tpublic Category getCategoryFromProduc... | [
"0.8029201",
"0.6885217",
"0.58937895",
"0.58133006",
"0.5778207",
"0.57653",
"0.5698052",
"0.563435",
"0.5626581",
"0.5579202",
"0.55509216",
"0.55376565",
"0.5517951",
"0.5517258",
"0.5448059",
"0.5410232",
"0.53945124",
"0.53808874",
"0.53607315",
"0.5322413",
"0.5320038",... | 0.88283044 | 0 |
Test that given one category and two products, the ProductServiceImpl.updateFeaturedProductOrder method will swap the preferred featured index of the two products in that category. e.g. product1 is the first featured item in the category and product2 is the second featured item in the category. After calling the method, product1 should be the second featured item, and product2 should be the first featured item. | @Test
public void testUpdateFeaturedProductOrder() {
// set up product and category
final long productUid = 123L;
final long categoryUid = 234L;
final Product firstProduct = new ProductImpl();
firstProduct.setUidPk(productUid);
firstProduct.setGuid(String.valueOf(productUid));
Category category = new CategoryImpl();
category.setUidPk(categoryUid);
category.setGuid("categoryGuid");
category.setCatalog(new CatalogImpl());
//Add the
firstProduct.addCategory(category);
firstProduct.setFeaturedRank(category, 1);
final long productUid2 = 12345L;
final Product secondProduct = new ProductImpl();
secondProduct.setUidPk(productUid2);
secondProduct.setGuid(String.valueOf(productUid2));
secondProduct.addCategory(category);
secondProduct.setFeaturedRank(category, 2);
// mock methods
context.checking(new Expectations() {
{
oneOf(mockProductDao).getWithCategories(productUid);
will(returnValue(firstProduct));
oneOf(mockProductDao).getWithCategories(productUid2);
will(returnValue(secondProduct));
oneOf(mockProductDao).saveOrUpdate(with(same(firstProduct)));
oneOf(mockProductDao).saveOrUpdate(with(same(secondProduct)));
}
});
// run the service
this.productServiceImpl.updateFeaturedProductOrder(firstProduct.getUidPk(), category.getUidPk(), secondProduct.getUidPk());
// check result
assertEquals("firstProduct should now have a preferred featuring order of 2",
2, firstProduct.getFeaturedRank(category));
assertEquals("secondProduct should now have a preferred featuring order of 1",
1, secondProduct.getFeaturedRank(category));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testSetProductCategoryFeatured() {\n\t\t// set up product and category\n\t\tfinal long productUid = 123L;\n\t\tfinal long categoryUid = 234L;\n\t\tfinal Product product = new ProductImpl();\n\t\tproduct.setUidPk(productUid);\n\t\tproduct.setGuid(\"productGuid\");\n\n\t\tCategory category = new... | [
"0.6689348",
"0.6006757",
"0.58770543",
"0.5875618",
"0.5646415",
"0.5602729",
"0.5582713",
"0.55456966",
"0.55050933",
"0.54658353",
"0.5435835",
"0.5382483",
"0.53649586",
"0.53351593",
"0.53217393",
"0.5280963",
"0.52474856",
"0.52405655",
"0.5235042",
"0.5208972",
"0.5198... | 0.7993383 | 0 |
Test that resetProductCategoryFeatured removes the "featuredness" of a product in a given category. | @Test
public final void testResetProductCategoryFeatured() {
final Product mockProduct = context.mock(Product.class);
final Category mockCategory = context.mock(Category.class);
ProductServiceImpl service = new ProductServiceImpl() {
@Override
public Category getCategoryFromProductByUid(final Product product, final long categoryUid) {
return mockCategory;
}
};
service.setProductDao(mockProductDao);
final long productUid = 123L;
final long categoryUid = 234L;
context.checking(new Expectations() {
{
//make sure it's set to 0
oneOf(mockProduct).setFeaturedRank(mockCategory, 0);
oneOf(mockProductDao).getWithCategories(with(any(long.class)));
will(returnValue(mockProduct));
oneOf(mockProductDao).saveOrUpdate(with(any(Product.class)));
will(returnValue(mockProduct));
}
});
service.resetProductCategoryFeatured(productUid, categoryUid);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testSetProductCategoryFeatured() {\n\t\t// set up product and category\n\t\tfinal long productUid = 123L;\n\t\tfinal long categoryUid = 234L;\n\t\tfinal Product product = new ProductImpl();\n\t\tproduct.setUidPk(productUid);\n\t\tproduct.setGuid(\"productGuid\");\n\n\t\tCategory category = new... | [
"0.7342913",
"0.6270855",
"0.57907045",
"0.57043827",
"0.56581146",
"0.55652994",
"0.5531046",
"0.5470135",
"0.54143614",
"0.53620106",
"0.5357685",
"0.5332458",
"0.5266757",
"0.52530223",
"0.52300453",
"0.52157277",
"0.5214855",
"0.518571",
"0.51597035",
"0.5140823",
"0.5120... | 0.8514937 | 0 |
Test that getCategoryFromProductByUid returns the product's default category, or null if the given category does not exist. | @Test
public final void testGetCategoryFromProductByUid() {
final long categoryUid = 234L;
final Category mockCategory = context.mock(Category.class);
context.checking(new Expectations() {
{
allowing(mockCategory).getUidPk();
will(returnValue(categoryUid));
}
});
final Set<Category> categories = new HashSet<Category>();
categories.add(mockCategory);
final long productUid = 123L;
final Product mockProduct = context.mock(Product.class);
context.checking(new Expectations() {
{
allowing(mockProduct).getUidPk();
will(returnValue(productUid));
allowing(mockProduct).getCategories();
will(returnValue(categories));
}
});
final Product product = mockProduct;
assertSame("Returned category should be the one the product belongs to", mockCategory,
productServiceImpl.getCategoryFromProductByUid(product, categoryUid));
assertNull("non-existent category should return a null result", productServiceImpl.getCategoryFromProductByUid(product, 0L));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ULocale getDefault(Category category) {\n/* 169 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n\tpublic Category getCategory(String categoryId) throws Exception {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic ProductDAO getByCategory(int categoryId) {\n\t\treturn n... | [
"0.5872045",
"0.5639661",
"0.5613185",
"0.5409056",
"0.54080844",
"0.537687",
"0.5355031",
"0.5328784",
"0.5325678",
"0.532199",
"0.53214264",
"0.53174835",
"0.5289604",
"0.52770525",
"0.52631956",
"0.5257034",
"0.524503",
"0.52436686",
"0.5236736",
"0.51915973",
"0.5168588",... | 0.7130992 | 0 |
CounterDemo demo = new CounterDemo(); | public static void main(String[] args) {
SlidingWindowDemo demo = new SlidingWindowDemo();
// LeakyBucketDemo demo = new LeakyBucketDemo();
// TokenBucketDemo demo = new TokenBucketDemo();
for (int i = 0; i < 10000; i++) {
try {
Thread.sleep(1L);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(demo.grant());
System.out.println(System.currentTimeMillis());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Counter() {\r\n this.count = 0;\r\n }",
"public BasicCounter() {\n count = 0;\n }",
"public myCounter() {\n\t\tcounter = 1;\n\t}",
"public Counter() {\r\n value = 0;\r\n }",
"public Counter() {\n //this.max = max;\n }",
"public int getCounter() {\nreturn this.coun... | [
"0.7507154",
"0.7312432",
"0.7274258",
"0.7211198",
"0.71135736",
"0.6974763",
"0.6974218",
"0.6948884",
"0.6928491",
"0.6785207",
"0.67260873",
"0.6664612",
"0.66337526",
"0.6614072",
"0.6600296",
"0.6565101",
"0.6562679",
"0.6548219",
"0.6524321",
"0.6491644",
"0.6491644",
... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
from_calendar.set(Calendar.YEAR, year);
from_calendar.set(Calendar.MONTH, monthOfYear);
from_calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
updateFromLabel();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
to_calendar.set(Calendar.YEAR, year);
to_calendar.set(Calendar.MONTH, monthOfYear);
to_calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
updateToLabel();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
... | 0.0 | -1 |
Scanner sc = new Scanner(System.in); | public static void main(String[] args) {
String[][] example = {
//Boston ... Manila
{"-" ,"225","575","200","70" ,"85" ,"340","675","975"},
{"225","-" ,"225","50" ,"125","220","120","435","550"},
{"575","225","-" ,"510","650","675","735","225","200"},
{"200","50" ,"510","-" ,"-" ,"-" ,"-" ,"-" ,"-" },
{"70" ,"125","650","-" ,"-" ,"-" ,"-" ,"-" ,"-" },
{"85" ,"220","675","-" ,"-" ,"-" ,"-" ,"-" ,"-" },
{"340","120","735","-" ,"-" ,"-" ,"-" ,"-" ,"-" },
{"675","435","225","-" ,"-" ,"-" ,"-" ,"-" ,"-" },
{"975","550","200","-" ,"-" ,"-" ,"-" ,"-" ,"-" }};
int n = example.length; //n x n grid
Node[] nodes = new Node[n];
for (int i = 0; i < n; i++)
nodes[i] = new Node(cities[i]);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (!example[i][j].equals("-")) {
int cost = Integer.parseInt(example[i][j]);
nodes[i].addEdge(new Edge(nodes[i], nodes[j], cost));
}
}
}
int start = cityIndex("Boston"); //start of our trip
int end = cityIndex("Beijing"); //end of our trip
System.out.println("total cost:");
System.out.println(dijkstra(nodes[start], nodes[end]));
System.out.println("optimal path taken:");
tracePath(nodes[end]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n\n\n\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t}",
"public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n Strin... | [
"0.8116788",
"0.7859288",
"0.7456636",
"0.7390904",
"0.7370572",
"0.726009",
"0.7220934",
"0.7188939",
"0.71190596",
"0.7016008",
"0.6999161",
"0.69791657",
"0.6916052",
"0.6864569",
"0.6834009",
"0.6791698",
"0.6791698",
"0.6768515",
"0.6752971",
"0.67184204",
"0.6700116",
... | 0.0 | -1 |
METHODS Constructor method for class DateIn which is a gregorian date. | public DateIn(int day, int month, int year){
this.day = day;
this.month = month;
this.year = year;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MyDate(int inYear, int inDay, int inMonth)\n {\n year = inYear;\n day = inDay;\n month = inMonth;\n }",
"public Date() {\r\n\t\tGregorianCalendar c = new GregorianCalendar();\r\n\t\tmonth = c.get(Calendar.MONTH) + 1; // our month starts from 1\r\n\t\tday = c.get(Calendar.DAY_OF_... | [
"0.714184",
"0.6383858",
"0.6302757",
"0.6262385",
"0.62443435",
"0.6230256",
"0.62141854",
"0.6211856",
"0.61001503",
"0.6076377",
"0.6076377",
"0.60745156",
"0.60686535",
"0.60363346",
"0.60100543",
"0.6004953",
"0.5979122",
"0.5910414",
"0.5896438",
"0.5845586",
"0.5831111... | 0.7019686 | 1 |
Allows to get the number of the day of a date. | public int getDay() {
return day;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Integer getDay();",
"public static long getDayNumber() {\n return getSecondsSinceEpoch() / SECS_TO_DAYS;\n }",
"public static int getDayNumberByDate(Date val) {\n\t\t if (val != null) {\n\t\t SimpleDateFormat format = new SimpleDateFormat(\"dd\");\n\t\t return parseInt(format.format(val));\n\t\t... | [
"0.77164567",
"0.7704618",
"0.7585432",
"0.7568434",
"0.74916774",
"0.74519",
"0.7403083",
"0.7371118",
"0.7371118",
"0.7371118",
"0.73580086",
"0.7347779",
"0.7323158",
"0.72776735",
"0.7266793",
"0.7260241",
"0.7260241",
"0.725481",
"0.7237165",
"0.7221136",
"0.7177551",
... | 0.7403494 | 6 |
Allows to change the number of the day of a date. post: The number of the day of a date is changed. | public void setDay(int day) {
this.day = day;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDay(int day) {\r\n this.day = day;\r\n }",
"public void setDay(int day)\n {\n this.day = day;\n }",
"private static void incrementDate() {\n\t\ttry {\r\n\t\t\tint days = Integer.valueOf(input(\"Enter number of days: \")).intValue();\r\n\t\t\tcalculator.incrementDate(days); // variab... | [
"0.68618625",
"0.68186206",
"0.67685777",
"0.67335325",
"0.6733076",
"0.6654667",
"0.66353595",
"0.66006845",
"0.64741284",
"0.6428438",
"0.6421532",
"0.6421532",
"0.6421532",
"0.6421532",
"0.6421532",
"0.63713646",
"0.63645816",
"0.6321471",
"0.6299136",
"0.6293333",
"0.6278... | 0.67061245 | 5 |
Allows to get the number of the month of a date. | public int getMonth() {
return month;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getMonthInteger() \n\t{\n\t\t// 1 will be added here to be able to use this func alone to construct e.g adate\n\t\t// to get the name of the month from getMonth(), 1 must be deducted.\n\t\treturn 1+m_calendar.get(Calendar.MONTH);\n\n\t}",
"public int getMonth() {\n\t\treturn date.getMonthValue();\n\t}... | [
"0.7885915",
"0.77433646",
"0.7521998",
"0.74926144",
"0.74742055",
"0.72518843",
"0.7236595",
"0.7218186",
"0.719003",
"0.71541566",
"0.71502596",
"0.71474016",
"0.71472985",
"0.70584387",
"0.7055716",
"0.703526",
"0.703526",
"0.7024168",
"0.6958424",
"0.6958424",
"0.6944895... | 0.7096558 | 13 |
Allows to change the number of the month of a date. post: The number of the month of a date is changed. | public void setMonth(int month) {
this.month = month;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void changeMonth(int newMonth) {\n this.month = newMonth;\n }",
"public void setMonth(int newMonth) {\n setMonth(newMonth, true);\n }",
"@Override\n public void onMonthChanged(Date date) {\n }",
"public void updateMonth(int value)\n {\n this.currentCalenda... | [
"0.750042",
"0.7158422",
"0.6897947",
"0.6856341",
"0.6637831",
"0.6626816",
"0.6592572",
"0.6584638",
"0.6547272",
"0.6500699",
"0.6450485",
"0.6450485",
"0.64220786",
"0.6390702",
"0.6388572",
"0.6388572",
"0.6388572",
"0.63308126",
"0.63283104",
"0.6324287",
"0.63239855",
... | 0.6286314 | 22 |
Allows to get the number of the year of a date. | public int getYear() {
return year;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Integer getYear(Date date){\r\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy\"); //EX 2016,02\r\n return new Integer(df.format(date));\r\n }",
"public static int getYearByDate(Date val) {\n\t\tif (val != null) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy\");\... | [
"0.8095071",
"0.804312",
"0.80366313",
"0.7999429",
"0.796354",
"0.7772162",
"0.77547365",
"0.7710615",
"0.7657734",
"0.76456076",
"0.763713",
"0.7623165",
"0.7600327",
"0.7600327",
"0.7600327",
"0.7594946",
"0.75658464",
"0.75415415",
"0.75412536",
"0.7530933",
"0.7526668",
... | 0.75348604 | 19 |
Allows to change the number of the year of a date. post: The number of the year of a date is changed. | public void setYear(int year) {
this.year = year;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setYear(int value) {\r\n this.year = value;\r\n }",
"public void setYear(int value) {\n\tthis.year = value;\n }",
"public void setYear(int _year) { year = _year; }",
"public void setYear (int yr) {\n year = yr;\n }",
"public void addYear(){\n\t\tyearAdd++;\n\t}",
... | [
"0.75621736",
"0.75581765",
"0.754759",
"0.7385298",
"0.7283381",
"0.72722745",
"0.7236689",
"0.7193484",
"0.71896255",
"0.70948637",
"0.7078723",
"0.70619386",
"0.7058398",
"0.7047256",
"0.70384294",
"0.7036741",
"0.7036741",
"0.70273536",
"0.7019502",
"0.6987176",
"0.697951... | 0.69087857 | 35 |
Allows to get a date as a String in the format: DD/MM/YY. | public String convertDateToString(){
String aDate = "";
aDate += Integer.toString(day);
aDate += "/";
aDate += Integer.toString(month);
aDate += "/";
aDate += Integer.toString(year);
return aDate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String dateToString(Date date){\r\n SimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n return df.format(date);\r\n }",
"public String getDateString(){\n return Utilities.dateToString(date);\n }",
"public String dar_fecha(){\n Date date = new Date();\... | [
"0.78790665",
"0.77892613",
"0.7751528",
"0.7746233",
"0.76780075",
"0.7614406",
"0.75804216",
"0.7539404",
"0.75294477",
"0.74909085",
"0.7456167",
"0.7339441",
"0.73107195",
"0.72967976",
"0.7264198",
"0.7258059",
"0.7252787",
"0.7243775",
"0.72186244",
"0.71994686",
"0.719... | 0.79619485 | 0 |
TextView testRepairID = (TextView)findViewById(R.id.testRepairID); testRepairID.setText(repairIDText); | @Override
public void onClick(View v) {
AsyncDataClass asyncRequestObject = new LoginActivity.AsyncDataClass();
asyncRequestObject.execute(serverUrlCancel, LoginText);
//Intent returnIntent = new Intent();
//setResult(Activity.RESULT_OK,returnIntent);
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setText(@StringRes int resId) {\n setText(getContext().getText(resId));\n }",
"private void display() {\n TextView textview = (TextView) findViewById(R.id.textView);\n EditText editText = (EditText) findViewById(R.id.editNumber) ;\n textview.setText(\"TEXT\");\n editTe... | [
"0.6352057",
"0.62632716",
"0.6213397",
"0.62025315",
"0.6157191",
"0.61571264",
"0.6136717",
"0.6030252",
"0.60274136",
"0.60164416",
"0.6008825",
"0.5991974",
"0.59844655",
"0.5981383",
"0.59382397",
"0.58917046",
"0.5838577",
"0.5835744",
"0.5833197",
"0.5827438",
"0.58116... | 0.0 | -1 |
Intent intent = new Intent(LoginActivity.this, MainActivity.class); startActivity(intent); | @Override
public void onClick(View v) {
Intent returnIntent = new Intent();
setResult(Activity.RESULT_OK, returnIntent);
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void goLogin(){\n Intent intent = new Intent(Menu.this, MainActivity.class);\n startActivity(intent);\n }",
"@Override\n public void onClick(View view) {\n Intent loginIntent = new Intent(MainActivity.this, LoginActivity.class);\n startActivity(lo... | [
"0.88879496",
"0.86671394",
"0.8518129",
"0.8482547",
"0.8311792",
"0.83075523",
"0.82577217",
"0.8249876",
"0.82399726",
"0.8231952",
"0.8084301",
"0.80293876",
"0.7967507",
"0.7964355",
"0.79336137",
"0.7864394",
"0.78543425",
"0.78421116",
"0.77645135",
"0.77423954",
"0.77... | 0.0 | -1 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_login, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {... | [
"0.7249256",
"0.72037125",
"0.7197713",
"0.7180111",
"0.71107703",
"0.70437056",
"0.70412415",
"0.7014533",
"0.7011124",
"0.6983377",
"0.69496083",
"0.69436663",
"0.69371194",
"0.69207716",
"0.69207716",
"0.6893342",
"0.6886841",
"0.6879545",
"0.6877086",
"0.68662405",
"0.686... | 0.0 | -1 |
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml. | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ... | [
"0.79039484",
"0.78061193",
"0.7765948",
"0.772676",
"0.76312095",
"0.76217103",
"0.75842994",
"0.7530533",
"0.748778",
"0.7458179",
"0.7458179",
"0.7438179",
"0.74213266",
"0.7402824",
"0.7391232",
"0.73864055",
"0.7378979",
"0.73700106",
"0.7362941",
"0.73555434",
"0.734530... | 0.0 | -1 |
instanciar objetos modelo y vista | public static void main(String[] args) {
ClienteView vista = new ClienteView();
Cliente modelo = llenarDatosCliente();
// se crea un objeto controlados y se le pasa
// un model y un view
ClienteControlador controller = new ClienteControlador(modelo, vista);
// se muestra los datos del cliente
controller.actualizaVista();
// actualizamos un cliente y mostramos los datos de nuevo
controller.SetNombre("Felipe mistico");
controller.SetApellido("Magia");
controller.setId(6543);
controller.actualizaVista();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }",
"private static void generModeloDePrueba() {\n\t\tCSharpArchIdPackageImpl.init();\n // Retrieve the default fa... | [
"0.7099208",
"0.67760843",
"0.6723387",
"0.66961485",
"0.6647664",
"0.66123736",
"0.6511574",
"0.65050715",
"0.64063436",
"0.6399991",
"0.6351632",
"0.63340294",
"0.63189244",
"0.63186884",
"0.63175243",
"0.6291254",
"0.6243146",
"0.62420154",
"0.6241474",
"0.6218133",
"0.620... | 0.0 | -1 |
metodo estatico que retorna el cliente con todos sus datos | private static Cliente llenarDatosCliente() {
Cliente cliente1 = new Cliente();
cliente1.setApellido("De Assis");
cliente1.setDni(368638373);
cliente1.setNombre("alexia");
cliente1.setId(100001);
return cliente1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<Cliente> consultarClientes();",
"public ArrayList<Cliente> listarClientes(){\n ArrayList<Cliente> ls = new ArrayList<Cliente>();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, idioma, categoria FROM clientes\";\n\t\tPreparedStatemen... | [
"0.7522278",
"0.74219495",
"0.7366895",
"0.7331336",
"0.72618705",
"0.7242617",
"0.7232715",
"0.7207234",
"0.7193815",
"0.7192866",
"0.71903026",
"0.71792483",
"0.71692",
"0.71597326",
"0.71567965",
"0.71505123",
"0.7149951",
"0.71484005",
"0.7137916",
"0.7117699",
"0.7102515... | 0.74532866 | 1 |
TODO Autogenerated method stub | @Override
public void onClick(View v) {
switch(v.getId()){
case R.id.modifypwd_ensure:
strNewPasswd = CEnewPasswd.getText().toString();
strRenewPasswd = CErenewPasswd.getText().toString();
if (strOldPasswd == null || strNewPasswd == null || strRenewPasswd == null){
Toast.makeText(ModifyPassword.this, "请输入密码!", Toast.LENGTH_SHORT).show();
return;
}
if (!strNewPasswd.equals(strRenewPasswd)){
Toast.makeText(ModifyPassword.this, "两次输入的密码不一致,请重新输入!", Toast.LENGTH_SHORT).show();
return;
}
if (strOldPasswd.equals(strNewPasswd)){
Toast.makeText(ModifyPassword.this, "新旧密码一样,请重新输入!", Toast.LENGTH_SHORT).show();
return;
}
if ((strNewPasswd.length() < 6) || (strNewPasswd.length() > 16)){
Toast.makeText(ModifyPassword.this, "密码应为6-16位字母和数字组合!", Toast.LENGTH_SHORT).show();
return;
} else{
Pattern pN = Pattern.compile("[0-9]{6,16}");
Matcher mN = pN.matcher(strNewPasswd);
Pattern pS = Pattern.compile("[a-zA-Z]{6,16}");
Matcher mS = pS.matcher(strNewPasswd);
if((mN.matches()) || (mS.matches())){
Toast.makeText(ModifyPassword.this,"密码应为6-16位字母和数字组合!", Toast.LENGTH_SHORT).show();
return;
}
}
if (new ConnectionDetector(ModifyPassword.this).isConnectingTOInternet()) {
pd = ProgressDialog.show(ModifyPassword.this, "", "正在加载....");
new RequestTask().execute();
} else {
Toast.makeText(ModifyPassword.this, "网络连接不可用,请检查网络后再试", Toast.LENGTH_SHORT).show();
}
break;
case R.id.modify_pwd_back:
startActivity(new Intent(ModifyPassword.this, ShowUserMessage.class));
this.finish();
break;
default:
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.66713095",
"0.6567948",
"0.652319",
"0.648097",
"0.64770466",
"0.64586824",
"0.64132667",
"0.6376419",
"0.62759",
"0.62545097",
"0.62371093",
"0.62237984",
"0.6201738",
"0.619477",
"0.619477",
"0.61924416",
"0.61872935",
"0.6173417",
"0.613289",
"0.6127952",
"0.6080854",
... | 0.0 | -1 |
The constructor which essentially calculates the textual similarities between two files. | public CodeComparisonScores(String[] filesOne, String[] filesTwo) throws IOException {
scoreForLD = 0;
scoreForLCS = 0;
overallTextDiffScore = 0;
List<String> normalizedOfFilesOne = new ArrayList<String>();
List<String> normalizedOfFilesTwo = new ArrayList<String>();
for (int a = 0; a < filesOne.length; a++) {
Normalizer normalizer = new Normalizer(filesOne[a]);
normalizer.runNormalization();
normalizedOfFilesOne.add(normalizer.getNormalized());
}
for (int b = 0; b < filesTwo.length; b++) {
Normalizer normalizer = new Normalizer(filesTwo[b]);
normalizer.runNormalization();
normalizedOfFilesTwo.add(normalizer.getNormalized());
}
for (int i = 0; i < normalizedOfFilesOne.size(); i++) {
for (int j = 0; j < normalizedOfFilesTwo.size(); j++) {
CodeComparisonScoresHelper(normalizedOfFilesOne.get(i), normalizedOfFilesTwo.get(j));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public TextFileComparator(String f1, String f2) {\n\t\tfileName1 = f1;\n\t\tfileName2 = f2;\n\t\tcompareFiles();\n\t}",
"private void CompareTwoFiles() {\n GetCharactersFromProject prog1Char;\r\n KGram prog1KGram;\r\n HashKGram prog1HashKGram;\r\n FingerPrint prog1FingerPrint;\r\n ... | [
"0.6672584",
"0.6206244",
"0.6001743",
"0.6001529",
"0.59337586",
"0.5863953",
"0.5853523",
"0.5793654",
"0.5709727",
"0.5681692",
"0.56206024",
"0.56039876",
"0.5544966",
"0.5524772",
"0.55011874",
"0.5471499",
"0.54667044",
"0.54606193",
"0.5407048",
"0.5395178",
"0.5383867... | 0.6634566 | 1 |
A helper function which computes the similarity levels between two files. It updates the scores which are otherwise utilized in the constructor. | private void CodeComparisonScoresHelper(String fileOne, String fileTwo) {
double maxLength = Math.max(fileOne.length(), fileTwo.length());
int amountOfChangesLD = new LevensthienDistance(fileOne, fileTwo).getEditDistance();
int amountLCS = new LongestCommonSubsequence(fileOne, fileTwo).getLengthOfLCS();
double LDScore = (maxLength - amountOfChangesLD) / maxLength * 100;
double LCSScore = amountLCS / maxLength * 100;
double overallScore = (LCSScore + LDScore) / 2;
if (LDScore > scoreForLD) {
scoreForLD = LDScore;
}
if (LCSScore > scoreForLCS) {
scoreForLCS = LCSScore;
}
if (overallScore > overallTextDiffScore) {
overallTextDiffScore = overallScore;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public CodeComparisonScores(String[] filesOne, String[] filesTwo) throws IOException {\n\n scoreForLD = 0;\n scoreForLCS = 0;\n overallTextDiffScore = 0;\n\n List<String> normalizedOfFilesOne = new ArrayList<String>();\n List<String> normalizedOfFilesTwo = new ArrayList<String>()... | [
"0.67399937",
"0.576408",
"0.5685069",
"0.56772166",
"0.5584238",
"0.5535638",
"0.55006737",
"0.5490995",
"0.5431398",
"0.54113203",
"0.54094785",
"0.53361464",
"0.53195125",
"0.53123677",
"0.5281552",
"0.52717215",
"0.52138233",
"0.5182461",
"0.51541466",
"0.5153789",
"0.514... | 0.6514118 | 1 |
A getter function for the LD results. | public double getScoreForLD() {
return scoreForLD;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getLastrunresult();",
"double getResult() {\r\n\t\treturn result;\r\n\t}",
"public Result getResults()\r\n {\r\n return result;\r\n }",
"public abstract int getLapResult();",
"public double getResult() {\n\t\treturn result; // so that skeleton code compiles\n\t}",
"public Do... | [
"0.64709175",
"0.63382155",
"0.62771857",
"0.62770903",
"0.6262138",
"0.62347054",
"0.60562533",
"0.6047397",
"0.59989834",
"0.59968984",
"0.59006363",
"0.5881551",
"0.5859362",
"0.5838118",
"0.58114564",
"0.57952374",
"0.57719696",
"0.5767604",
"0.5767604",
"0.5765196",
"0.5... | 0.602021 | 8 |
A getter function for the LCS results. | public double getScoreForLCS() {
return scoreForLCS;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getLastrunresult();",
"public String getLovResult() {\r\n\t\treturn lovResult;\r\n\t}",
"public Set<Cdss4NsarLabor> getLabResults();",
"public abstract int getLapResult();",
"public Result getResults()\r\n {\r\n return result;\r\n }",
"public RLSClient.LRC getLRC() {\n ... | [
"0.63638943",
"0.6112409",
"0.60653526",
"0.60527915",
"0.6030946",
"0.59541273",
"0.5950754",
"0.58783776",
"0.5805889",
"0.5793769",
"0.5754726",
"0.5733138",
"0.5698238",
"0.56128734",
"0.5606544",
"0.5582991",
"0.5571527",
"0.5569314",
"0.5565326",
"0.55572855",
"0.554517... | 0.6589449 | 0 |
A getter function for the overall score results. | public double getOverallTextDiffScore() {
return overallTextDiffScore;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"float getScore();",
"float getScore();",
"Float getScore();",
"@Override\r\n\tpublic double getScore() \r\n\t{\r\n\t\treturn this._totalScore;\r\n\t}",
"public int getScore() {\n return getStat(score);\n }",
"public abstract float getScore();",
"int getScore();",
"long getScore();",
"long getSc... | [
"0.7926607",
"0.7926607",
"0.77791494",
"0.7775989",
"0.77721363",
"0.77464205",
"0.77318215",
"0.7706582",
"0.7706582",
"0.7706582",
"0.7706582",
"0.76964396",
"0.76504236",
"0.7648591",
"0.76452565",
"0.76316535",
"0.7616123",
"0.7596729",
"0.7573435",
"0.7512238",
"0.74725... | 0.0 | -1 |
For parsing response message | public MMPGetAuthMethod(MMPCtrlMsg copy) {
super(copy);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void parseResponse();",
"public ResponseMessage extractMessage(String response) {\n \n \t\tString[] res = response.split( Ending.CRLF.toString() );\n \t\tif ( ( res == null ) || ( res.length == 1 ) ) {\n \t\t\tcontent = \"\";\n \t\t}\n \t\telse {\n \t\t\tint count = 0;\n \t\t\tint current = 0;\n \t\t\tfor... | [
"0.7727258",
"0.70068574",
"0.69505256",
"0.6943738",
"0.67993915",
"0.6785666",
"0.6657643",
"0.66185385",
"0.65641886",
"0.6561199",
"0.6536179",
"0.64913356",
"0.6461817",
"0.64525187",
"0.64372486",
"0.6425787",
"0.64200544",
"0.63470817",
"0.6335402",
"0.6335402",
"0.631... | 0.0 | -1 |
Scanner in = new Scanner(System.in); | public static void main(String[] args) {
int firstValue = 24, secondValue = 32, thirdValue = 11;
int mostLargestValue, secondLargeValue, minimumValue;
int temporary; // 임시로 사용할 저장 공간
// System.out.print("첫번째 수 = ");
// firstValue = in.nextInt();
//
// System.out.print("두번째 수 = ");
// secondValue = in.nextInt();
//
// System.out.print("세번째 수 = ");
// thirdValue = in.nextInt();
// and
// if (secondValue >= firstValue && secondValue >= thirdValue) {
// temporary = firstValue;
// firstValue = secondValue;
// secondValue = temporary;
// } else if (thirdValue >= firstValue && thirdValue >= secondValue) {
// temporary = firstValue;
// firstValue = thirdValue;
// thirdValue = temporary;
// }
//
// if (thirdValue >= secondValue) {
// temporary = secondValue;
// secondValue = thirdValue;
// thirdValue = temporary;
// }
if (secondValue >= firstValue && secondValue >= thirdValue) {
mostLargestValue = secondValue;
}
System.out.println();
System.out.println(firstValue + " >= " + secondValue + " >= " + thirdValue);
// in.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n\n\n\n }",
"public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\n\t}",
"public static void main(String args[])\n {\n Scanner in=new Scanner(System.in);\n String str=in.nextLine();\... | [
"0.81365585",
"0.75688446",
"0.7479002",
"0.7420761",
"0.73658776",
"0.7230861",
"0.7184454",
"0.7119603",
"0.70545423",
"0.70302045",
"0.6945125",
"0.69425946",
"0.69132465",
"0.6858622",
"0.68580383",
"0.6843713",
"0.6805035",
"0.6786793",
"0.67522013",
"0.67522013",
"0.674... | 0.0 | -1 |
/ access modifiers changed from: protected | public void logDebug(String str) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void prot() {\n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override... | [
"0.7374581",
"0.704046",
"0.6921078",
"0.6907657",
"0.68447137",
"0.68278503",
"0.68051183",
"0.6581499",
"0.65379775",
"0.65013164",
"0.64906055",
"0.64906055",
"0.6471428",
"0.64376146",
"0.64308655",
"0.64308655",
"0.6427683",
"0.6424486",
"0.64190304",
"0.640871",
"0.6405... | 0.0 | -1 |
/ access modifiers changed from: protected | public void reportThrowable(int i, String str, String str2, Object obj, Throwable th) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void prot() {\n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override... | [
"0.7375736",
"0.7042321",
"0.6922649",
"0.6909494",
"0.68470824",
"0.6830288",
"0.68062353",
"0.6583185",
"0.6539446",
"0.65011257",
"0.64917654",
"0.64917654",
"0.64733833",
"0.6438831",
"0.64330196",
"0.64330196",
"0.64295477",
"0.6426414",
"0.6420484",
"0.64083177",
"0.640... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.