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 |
|---|---|---|---|---|---|---|
verifica cadastro existente que retornou de uma lista | public void validaCadastro(List<ProdutoModel> produto) {
if (produto.size() == 0) {
cadastraProduto();
} else {
JOptionPane.showMessageDialog(null, "Produto existente");
jtf_nome.requestFocus();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean estaVacia(ArrayList lista){\n if(lista.isEmpty()){\n System.out.println(\"No hay usuarios u objetos registrados por el momento\");\n return true;\n }\n else{\n return false;\n }\n }",
"boolean getExists();",
"public boolean g... | [
"0.67254394",
"0.6509066",
"0.6264686",
"0.6192742",
"0.6140763",
"0.6104741",
"0.6095401",
"0.60576415",
"0.60538816",
"0.60415006",
"0.60381395",
"0.60123444",
"0.5964874",
"0.596372",
"0.5917596",
"0.5912333",
"0.5888859",
"0.5888859",
"0.58858776",
"0.5874119",
"0.5825195... | 0.5565831 | 60 |
Tests parseAndSortParagraph() on positive scenario data. | @Test(description = "Test on positive scenario data")
public void parseAndSortParagraphTestPositive() throws ServiceException {
final String fileName = "test_input/paragraph_sort_data.txt";
final String expectedString =
" Bye?!\n"
+ " It is a established fact that a reader will"
+ " be of a page"
+ " when looking at its layout.\n"
+ " It is a long established fact that a reader "
+ "will be"
+ " distracted by the readable "
+ "content of a page when looking at its layout?!"
+ " The point of"
+ " using Ipsum is that "
+ "it has a more-or-less normal distribution of"
+ " letters, as"
+ " opposed to using 'Content here, "
+ "content here', making it look like readable"
+ " English.";
assertEquals(expectedString,
service.parseAndSortParagraph(fileName).compose());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test(description = \"Test on empty file\")\n public void parseAndSortParagraphTestEmpty() throws ServiceException {\n final String fileName = \"test_input/test_empty.txt\";\n var text = service.parseAndSortParagraph(fileName);\n assertEquals(text.compose(), \" \");\n }",
"@Test(des... | [
"0.7256235",
"0.6225053",
"0.59146607",
"0.5735779",
"0.56675315",
"0.5508799",
"0.5505062",
"0.55024034",
"0.5494361",
"0.54711604",
"0.53961784",
"0.52986056",
"0.5293696",
"0.5287519",
"0.5265567",
"0.5247701",
"0.52456015",
"0.5244129",
"0.52378905",
"0.52292705",
"0.5221... | 0.8690597 | 0 |
Test on empty file. | @Test(description = "Test on empty file")
public void parseAndSortParagraphTestEmpty() throws ServiceException {
final String fileName = "test_input/test_empty.txt";
var text = service.parseAndSortParagraph(fileName);
assertEquals(text.compose(), " ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isEmptyFile(String filename) {\n try (InputStream in = IO.openFile(filename)) {\n int b = in.read();\n return (b == -1);\n } catch (IOException ex) {\n throw IOX.exception(ex);\n }\n }",
"public boolean isEmpty() {\r\n return mFile.i... | [
"0.7927013",
"0.7665208",
"0.73948085",
"0.6956226",
"0.6793067",
"0.67890924",
"0.6715115",
"0.66632605",
"0.6621057",
"0.6621057",
"0.65747696",
"0.65640706",
"0.6436861",
"0.6374023",
"0.6334884",
"0.6333641",
"0.6294381",
"0.62878513",
"0.6286278",
"0.62411416",
"0.622510... | 0.0 | -1 |
Test on negative scenario data. | @Test(description = "Test on negative scenario data",
dataProvider = "NegativeScenarioData")
public void parseAndSortParagraphTestNegative(final String fileName) {
assertThrows(ServiceException.class,
() -> service.parseAndSortParagraph(fileName));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testGetTrackStatusForNegative() throws Exception {\r\n try {\r\n target.getTrackStatus(-10);\r\n fail(\"IllegalArgumentException expected.\");\r\n } catch (IllegalArgumentException ex) {\r\n // success\r\n }\r\n }",
"public boolean isNegative()... | [
"0.680366",
"0.67081624",
"0.65494347",
"0.65411705",
"0.63777286",
"0.6298451",
"0.61904943",
"0.6175335",
"0.61689115",
"0.6159291",
"0.6150325",
"0.61309767",
"0.61235857",
"0.61017996",
"0.60795623",
"0.603162",
"0.60310286",
"0.59915274",
"0.59825885",
"0.5976095",
"0.59... | 0.0 | -1 |
Test of getVehicleById method, of class vehicleDaoImpl. | @Test
public void testGetVehicleById() {
//Arrange
Vehicle vehicle = new Vehicle();
Model model = new Model();
Make make = new Make();
make.setMakeName("Ford");
Make createdMake = makeDao.addMake(make);
model.setModelName("Explorer");
model.setMake(createdMake);
Model createdModel = modelDao.addModel(model);
vehicle.setYear(2018);
vehicle.setTransmission("Automatic");
vehicle.setMileage(1000);
vehicle.setColor("Blue");
vehicle.setInterior("Leather");
vehicle.setBodyType("SUV");
vehicle.setVin("W9D81KQ93N8Z0KS7");
vehicle.setSalesPrice(new BigDecimal("35000.00"));
vehicle.setMsrp(new BigDecimal("40000.00"));
vehicle.setDescription("A practical vehicle");
vehicle.setPicURL("http://www.sampleurl.com/samplepic");
vehicle.setModel(createdModel);
Vehicle createdVehicle = vehicleDao.addVehicle(vehicle);
//Act
Vehicle fetchedVehicle = vehicleDao.getVehicleById(createdVehicle.getVehicleId());
//Assert
assertEquals(fetchedVehicle.getYear(),(int) 2018);
assertEquals(fetchedVehicle.getTransmission(), "Automatic");
assertEquals(fetchedVehicle.getMileage(), (int) 1000);
assertEquals(fetchedVehicle.getColor(), "Blue");
assertEquals(fetchedVehicle.getInterior(),"Leather");
assertEquals(fetchedVehicle.getBodyType(),"SUV");
assertEquals(fetchedVehicle.getVin(), "W9D81KQ93N8Z0KS7");
assertEquals(fetchedVehicle.getSalesPrice(), new BigDecimal("35000.00"));
assertEquals(fetchedVehicle.getMsrp(), new BigDecimal("40000.00"));
assertEquals(fetchedVehicle.getDescription(), "A practical vehicle");
assertEquals(fetchedVehicle.getPicURL(), "http://www.sampleurl.com/samplepic");
assertEquals(fetchedVehicle.getModel().getModelName(), "Explorer");
assertEquals(fetchedVehicle.getModel().getMake().getMakeName(), "Ford");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void findByIdTest() {\n Long id = 1L;\n reservation1.setId(id);\n Mockito.when(reservationDao.findById(id)).thenReturn(reservation1);\n Reservation result = reservationService.findById(id);\n Assert.assertEquals(reservation1, result);\n Assert.assertEqual... | [
"0.7371547",
"0.7345536",
"0.73277247",
"0.7110837",
"0.70692384",
"0.6886535",
"0.67377806",
"0.6718975",
"0.66981465",
"0.6525449",
"0.65177256",
"0.6505143",
"0.64442027",
"0.6409316",
"0.6401787",
"0.639066",
"0.6373482",
"0.63687265",
"0.6324982",
"0.63243455",
"0.630116... | 0.77957284 | 0 |
Test of updateVehicle method, of class vehicleDaoImpl. | @Test
public void testUpdateVehicleSold() {
//Arrange
Vehicle vehicle = new Vehicle();
Model model = new Model();
Make make = new Make();
make.setMakeName("Ford");
Make createdMake = makeDao.addMake(make);
model.setModelName("Explorer");
model.setMake(createdMake);
Model createdModel = modelDao.addModel(model);
vehicle.setYear(2018);
vehicle.setTransmission("Automatic");
vehicle.setMileage(1000);
vehicle.setColor("Blue");
vehicle.setInterior("Leather");
vehicle.setBodyType("SUV");
vehicle.setVin("W9D81KQ93N8Z0KS7");
vehicle.setSalesPrice(new BigDecimal("35000.00"));
vehicle.setMsrp(new BigDecimal("40000.00"));
vehicle.setDescription("A practical vehicle");
vehicle.setPicURL("http://www.sampleurl.com/samplepic");
vehicle.setModel(createdModel);
Vehicle createdVehicle = vehicleDao.addVehicle(vehicle);
createdVehicle.setSalesPrice(new BigDecimal ("30000.00"));
createdVehicle.setInStock(false);
//Act
vehicleDao.updateVehicle(createdVehicle);
//Assert
Vehicle fetchedVehicle = vehicleDao.getVehicleById(createdVehicle.getVehicleId());
assertEquals(vehicle.getSalesPrice(), fetchedVehicle.getSalesPrice());
assertFalse(fetchedVehicle.isInStock());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void updateTest() {\n reservation3.setId(13L);\n reservation3.setReserveDate(LocalDate.now().plusDays(2));\n reservationService.update(reservation3);\n Mockito.verify(reservationDao, Mockito.times(1)).update(reservation3);\n }",
"@Test\n public void testUpdateC... | [
"0.7574852",
"0.7225217",
"0.71853983",
"0.71156716",
"0.7059337",
"0.705465",
"0.70343196",
"0.70083517",
"0.69422644",
"0.6881333",
"0.6857964",
"0.68023914",
"0.67568755",
"0.6754721",
"0.67416203",
"0.67232543",
"0.67052186",
"0.66804034",
"0.66751426",
"0.6655289",
"0.66... | 0.80110526 | 0 |
Test of deleteVehicleById method, of class vehicleDaoImpl. | @Test
public void testDeleteVehicleById() {
//Arrange
Vehicle vehicle = new Vehicle();
Model model = new Model();
Make make = new Make();
make.setMakeName("Ford");
Make createdMake = makeDao.addMake(make);
model.setModelName("Explorer");
model.setMake(createdMake);
Model createdModel = modelDao.addModel(model);
vehicle.setYear(2018);
vehicle.setTransmission("Automatic");
vehicle.setMileage(1000);
vehicle.setColor("Blue");
vehicle.setInterior("Leather");
vehicle.setBodyType("SUV");
vehicle.setVin("W9D81KQ93N8Z0KS7");
vehicle.setSalesPrice(new BigDecimal("35000.00"));
vehicle.setMsrp(new BigDecimal("40000.00"));
vehicle.setDescription("A practical vehicle");
vehicle.setPicURL("http://www.sampleurl.com/samplepic");
vehicle.setModel(createdModel);
Vehicle createdVehicle = vehicleDao.addVehicle(vehicle);
//Act
vehicleDao.deleteVehicleById(vehicle.getVehicleId());
//Assert
Vehicle fetchedVehicle = vehicleDao.getVehicleById(createdVehicle.getVehicleId());
assertNull (fetchedVehicle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void deleteVehicle(String vehicleID);",
"@Test\n void deleteSuccess() {\n carDao.delete(carDao.getById(1));\n assertNull(carDao.getById(1));\n\n //Delete repairs\n GenericDao<Repair> repairDao = new GenericDao(Repair.class);\n Repair repair = repairDao.getById(2);\n a... | [
"0.7803002",
"0.76082075",
"0.74382055",
"0.742895",
"0.7335392",
"0.72995865",
"0.72564167",
"0.7241217",
"0.7200469",
"0.71963096",
"0.71813124",
"0.7160203",
"0.715858",
"0.7093472",
"0.7058635",
"0.70390207",
"0.69954",
"0.6812918",
"0.68003553",
"0.67747426",
"0.6768629"... | 0.8572125 | 0 |
Test of readAllVehicle method, of class vehicleDaoImpl. | @Test
public void testReadAllVehicle() {
//Arrange
//Vehicle 1
Vehicle vehicle = new Vehicle();
Model model = new Model();
Make make = new Make();
make.setMakeName("Ford");
Make createdMake = makeDao.addMake(make);
model.setModelName("Explorer");
model.setMake(createdMake);
Model createdModel = modelDao.addModel(model);
vehicle.setYear(2018);
vehicle.setTransmission("Automatic");
vehicle.setMileage(1000);
vehicle.setColor("Blue");
vehicle.setInterior("Leather");
vehicle.setBodyType("SUV");
vehicle.setVin("W9D81KQ93N8Z0KS7");
vehicle.setSalesPrice(new BigDecimal("35000.00"));
vehicle.setMsrp(new BigDecimal("40000.00"));
vehicle.setDescription("A practical vehicle");
vehicle.setPicURL("http://www.sampleurl.com/samplepic");
vehicle.setModel(createdModel);
Vehicle createdVehicle = vehicleDao.addVehicle(vehicle);
//Vehicle 2
Vehicle vehicle2 = new Vehicle();
Model model2 = new Model();
Make make2 = new Make();
make2.setMakeName("Chevy");
Make createdMake2 = makeDao.addMake(make2);
model2.setModelName("Silverado");
model2.setMake(createdMake2);
Model createdModel2 = modelDao.addModel(model2);
vehicle2.setYear(2015);
vehicle2.setTransmission("Automatic");
vehicle2.setMileage(30000);
vehicle2.setColor("Silver");
vehicle2.setInterior("Cloth");
vehicle2.setBodyType("Truck");
vehicle2.setVin("ALEDC65KPY8PSVKD");
vehicle2.setSalesPrice(new BigDecimal("28000.00"));
vehicle2.setMsrp(new BigDecimal("35000.00"));
vehicle2.setDescription("A sturdy vehicle meant for hauling trailers or other oversized loads");
vehicle2.setPicURL("http://www.sampleurl.com/samplepic2");
vehicle2.setModel(createdModel2);
Vehicle createdVehicle2 = vehicleDao.addVehicle(vehicle2);
//Vehicle 3
Vehicle vehicle3 = new Vehicle();
Model model3 = new Model();
Make make3 = new Make();
make3.setMakeName("Toyota");
Make createdMake3 = makeDao.addMake(make3);
model3.setModelName("Carolla");
model3.setMake(createdMake3);
Model createdModel3 = modelDao.addModel(model3);
vehicle3.setYear(2016);
vehicle3.setTransmission("Automatic");
vehicle3.setMileage(25000);
vehicle3.setColor("Red");
vehicle3.setInterior("Cloth");
vehicle3.setBodyType("Sedan");
vehicle3.setVin("EZ4FPVL6NPD7VJCD");
vehicle3.setSalesPrice(new BigDecimal("23000.00"));
vehicle3.setMsrp(new BigDecimal("26000.00"));
vehicle3.setDescription("A feul efficient vehicle great for commuting in the city.");
vehicle3.setPicURL("http://www.sampleurl.com/samplepic3");
vehicle3.setModel(createdModel3);
Vehicle createdVehicle3 = vehicleDao.addVehicle(vehicle3);
//Act
List<Vehicle> vehicles = vehicleDao.readAllVehicle();
//Assert
assertEquals(createdVehicle.getVehicleId(),vehicles.get(0).getVehicleId());
assertEquals(createdVehicle2.getVehicleId(),vehicles.get(1).getVehicleId());
assertEquals(createdVehicle3.getVehicleId(),vehicles.get(2).getVehicleId());
assertEquals(createdVehicle.getVin(),vehicles.get(0).getVin());
assertEquals(createdVehicle2.getVin(),vehicles.get(1).getVin());
assertEquals(createdVehicle3.getVin(),vehicles.get(2).getVin());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void retriveAllTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n List<Servizio> lista = manager.retriveAll();\n assertEquals(7,lista.size(),\"It should return a list of length 7\");\n }",
"@Test\n public void findAllVehiclesTest() throws ItemNotFoundExcepti... | [
"0.699085",
"0.6789147",
"0.6476477",
"0.64209336",
"0.6353405",
"0.6351758",
"0.63266677",
"0.631067",
"0.6295785",
"0.62900484",
"0.6287417",
"0.62710243",
"0.6257331",
"0.62330556",
"0.62122107",
"0.6187118",
"0.6185232",
"0.6167928",
"0.6152808",
"0.6151729",
"0.6143524",... | 0.6948623 | 1 |
Create a new slice (without flowspace) | public Boolean createSlice(String sliceName, String passwd,
String controller_url, String drop_policy, String slice_email)
throws MalformedControllerURL, InvalidSliceName, InvalidDropPolicy,
PermissionDeniedException, DuplicateControllerException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Buffer slice();",
"Buffer slice(int start, int length);",
"@Override\r\n\tpublic Buffer slice(int start, int end) {\n\t\t\r\n\t\treturn null;\r\n\t}",
"public ByteBuf slice(int index, int length)\r\n/* 65: */ {\r\n/* 66: 82 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 67: 83 */ retu... | [
"0.6565846",
"0.656165",
"0.6482745",
"0.5955686",
"0.5762123",
"0.5690528",
"0.5682744",
"0.56233567",
"0.56206876",
"0.5598476",
"0.55823475",
"0.5563694",
"0.5548701",
"0.55243236",
"0.54151404",
"0.5386336",
"0.5368481",
"0.5368246",
"0.5348829",
"0.53194237",
"0.52684367... | 0.0 | -1 |
Changes a key of a slice to value Only callable by a the slice owner or a transitive creator | public Boolean changeSlice(String sliceName, String key, String value)
throws MalformedURLException, InvalidSliceName,
PermissionDeniedException, InvalidUserInfoKey, DuplicateControllerException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testSetSliceWithoutUpdate() {\n\t}",
"@Override\n\tpublic void set(K key, List<V> value) {\n\t\t\n\t}",
"public abstract void Put(WriteOptions options, Slice key, Slice value) throws IOException, BadFormatException, DecodeFailedException;",
"public void owned(K key, GridCacheVersion owne... | [
"0.5133464",
"0.5131453",
"0.5124034",
"0.5079632",
"0.50712883",
"0.50368226",
"0.5023486",
"0.48851445",
"0.48840794",
"0.487744",
"0.48629034",
"0.48389497",
"0.48288435",
"0.48154056",
"0.48002368",
"0.47745427",
"0.47713438",
"0.47621506",
"0.47534654",
"0.47345412",
"0.... | 0.6307181 | 0 |
Change the password for this slice A slice is allowed to change its own password and the password of any slice that it has (transitively) created | public Boolean changePasswd(String sliceName, String newPasswd)
throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Boolean change_password(String sliceName, String newPasswd)\n\t\t\tthrows PermissionDeniedException;",
"public void setPassword(java.lang.String newPassword);",
"public void setPw(char[] password) {\n\t\t\r\n\t}",
"public void setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.pas... | [
"0.7383774",
"0.7152932",
"0.69680935",
"0.6711308",
"0.6585785",
"0.6573439",
"0.6572027",
"0.6572027",
"0.6572027",
"0.65405333",
"0.6451468",
"0.6425148",
"0.6409661",
"0.639446",
"0.62960935",
"0.6273322",
"0.62657803",
"0.62634856",
"0.62395763",
"0.62179506",
"0.6202909... | 0.68408793 | 3 |
have both names, b/c it makes the OM's life easier | public Boolean change_password(String sliceName, String newPasswd)
throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract String name ();",
"abstract String name();",
"protected abstract String getName();",
"abstract String getName();",
"abstract public String named();",
"String getName() ;",
"public String getName(){return this.aName;}",
"@Override\n\tString name();",
"private void setName() {\n\t\... | [
"0.6775167",
"0.65405095",
"0.65253085",
"0.6496739",
"0.64153767",
"0.63449293",
"0.63217807",
"0.6294384",
"0.62877095",
"0.62734693",
"0.62734693",
"0.6259115",
"0.6259115",
"0.625125",
"0.62298846",
"0.62298846",
"0.62298846",
"0.62298846",
"0.62298846",
"0.62298846",
"0.... | 0.0 | -1 |
Get the list of device DPIDs (e.g., switches, routers, APs) connected to the FV | public Collection<String> listDevices(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static List<String> getDeviceList() {\n\t\tList<String> str = CommandRunner.exec(CMD_GET_DEVICE_ID);\n\t\tList<String> ids = new ArrayList<String>();\n\t\tfor (int i = 1; i < str.size(); i++) {\n\t\t\tString id = str.get(i).split(\" |\\t\")[0].trim();\n\t\t\tif (!id.isEmpty()) {\n\t\t\t\tids.add(id);\n\t\t\... | [
"0.73398596",
"0.71629244",
"0.6933413",
"0.6759402",
"0.66036385",
"0.65513575",
"0.6546017",
"0.6505245",
"0.6501751",
"0.64887244",
"0.64706665",
"0.646931",
"0.6416605",
"0.63880557",
"0.63721246",
"0.6370571",
"0.60814697",
"0.6056494",
"0.6036838",
"0.6026946",
"0.60116... | 0.68573344 | 3 |
Get information about a device | public Map<String, String> getDeviceInfo(String dpidStr)
throws DPIDNotFound; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DeviceInfo getDeviceInfo(DeviceIdentifier deviceIdentifier) throws DeviceDetailsMgtException;",
"public DeviceDetails getDeviceDetails() throws LedgerException {\n ApduExchange.ApduResponse response = ApduExchange.exchangeApdu(device, CLA_BOLOS, INS_GET_VERSION, 0, 0);\n response.checkSW();\n return new... | [
"0.7429588",
"0.7343639",
"0.7313792",
"0.7307978",
"0.72417164",
"0.7218185",
"0.71319324",
"0.70868206",
"0.6971153",
"0.6928647",
"0.69061",
"0.6870536",
"0.68566436",
"0.6816767",
"0.6783835",
"0.67784107",
"0.6772683",
"0.6728305",
"0.6712035",
"0.6671091",
"0.66543216",... | 0.0 | -1 |
Get the list of links between the devices in getDevices() Links are directional, so switch1 > switch2 does not imply the reverse; they will be both listed if the link is bidirectional | public Collection<Map<String, String>> getLinks(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<ProductLink> links();",
"private void addLinkesToGraph()\n\t{\n\t\tString from,to;\n\t\tshort sourcePort,destPort;\n\t\tMap<Long, Set<Link>> mapswitch= linkDiscover.getSwitchLinks();\n\n\t\tfor(Long switchId:mapswitch.keySet())\n\t\t{\n\t\t\tfor(Link l: mapswitch.get(switchId))\n\t\t\t{\n\t\t\t\tfrom = Long... | [
"0.57385117",
"0.56185687",
"0.5579929",
"0.54305047",
"0.5371914",
"0.5367806",
"0.5366157",
"0.534191",
"0.5288608",
"0.52882475",
"0.5278552",
"0.5273578",
"0.5266385",
"0.5253626",
"0.5236283",
"0.52309763",
"0.5179566",
"0.51642674",
"0.5163191",
"0.5134518",
"0.50976145... | 0.0 | -1 |
Return a list of slices in the flowvisor: root only! | public Collection<String> listSlices() throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int slices() {\n\treturn slices;\n}",
"@Override\n public List<Uri> getSlices() {\n final List<Uri> uris = new ArrayList<>();\n\n uris.add(REMOTE_MEDIA_SLICE_URI);\n uris.add(VOLUME_MEDIA_URI);\n Uri controlUri = getExtraControlUri();\n if (controlUri != null) {\n ... | [
"0.68562126",
"0.6371623",
"0.5890077",
"0.5555424",
"0.5386138",
"0.53634703",
"0.53363496",
"0.52818966",
"0.52692914",
"0.523045",
"0.5220442",
"0.52148813",
"0.5213277",
"0.519253",
"0.5179093",
"0.51703435",
"0.5146435",
"0.5131616",
"0.51313907",
"0.51310855",
"0.512207... | 0.6588685 | 1 |
Set the flood permission for a switch | public Boolean setFloodPerm(String dpidStr, String floodPerm) throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException;",
"public void setFloodValue(short floodValue) {\r\n this.floodValue = floodValue;\r\n }",
"int setCanStatus(int canRegno, int action);",
"public void setFingerprintAllowed(boolean isAllowed) {\n this.isFingerpri... | [
"0.77337646",
"0.6061702",
"0.59464115",
"0.5866684",
"0.56941795",
"0.55380625",
"0.55227566",
"0.54891485",
"0.5472157",
"0.54704446",
"0.5469421",
"0.54292846",
"0.5418938",
"0.53807896",
"0.5364207",
"0.53445894",
"0.5322053",
"0.52923054",
"0.5288566",
"0.5238183",
"0.52... | 0.6965405 | 1 |
Get the flood permission for a switch | public String getFloodPerm(String dpidStr) throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFloodPerm() throws PermissionDeniedException;",
"String getPermission();",
"public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException;",
"int getPermissionRead();",
"abstract public void getPermission();",
"int getPermissionWrite();",
"public String getPermission()... | [
"0.70452064",
"0.6245733",
"0.6235141",
"0.61396635",
"0.59001064",
"0.5771453",
"0.5669008",
"0.5644267",
"0.56366915",
"0.56364214",
"0.5457899",
"0.5442739",
"0.5432906",
"0.5387376",
"0.5320006",
"0.530551",
"0.5255761",
"0.5255761",
"0.524478",
"0.5243216",
"0.5242645",
... | 0.61552906 | 3 |
Set the default flood permission for all switches | public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Boolean setFloodPerm(String dpidStr, String floodPerm) throws PermissionDeniedException;",
"private void initDefaultIslandData() {\n for (IslandProtectionAccessGroup accessLevel : IslandProtectionAccessGroup.values()) {\n protectionFlags.put(accessLevel, (BitSet) EmberIsles.getInstance()... | [
"0.65588313",
"0.59085",
"0.5706392",
"0.5550837",
"0.5542027",
"0.55367243",
"0.5445085",
"0.5431293",
"0.5347407",
"0.5338552",
"0.5304383",
"0.52671164",
"0.52188325",
"0.5210892",
"0.5155831",
"0.5136673",
"0.51266676",
"0.511999",
"0.5114286",
"0.51046085",
"0.5084885",
... | 0.75215983 | 0 |
Get the default flood permission. | public String getFloodPerm() throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic String permission() {\n\t\treturn Permissions.DEFAULT;\r\n\t}",
"String getPermission();",
"public Boolean setFloodPerm(String floodPerm) throws PermissionDeniedException;",
"public String getFloodPerm(String dpidStr) throws PermissionDeniedException;",
"abstract public void getPermis... | [
"0.7152203",
"0.68373233",
"0.68320596",
"0.6511283",
"0.64034224",
"0.6369394",
"0.630686",
"0.6240623",
"0.61883754",
"0.6117661",
"0.6104999",
"0.6072416",
"0.60403544",
"0.60053116",
"0.59312505",
"0.5881652",
"0.5853406",
"0.5775479",
"0.5735268",
"0.57341313",
"0.571925... | 0.7861571 | 0 |
Set the maximum rate of messages a slice can send to a switch. | public boolean setRateLimit (String sliceName, String rate)
throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void setSplayLimit(int limit);",
"public void setMiterLimit(float limit);",
"void setLimit(int limit);",
"void setMaxScale(int value);",
"public void setMaxSpeed(double value) {\n super.setMaxSpeed(value);\n }",
"public synchronized void setMaxRate(int maxRate)\n throws Ill... | [
"0.68076205",
"0.66610366",
"0.6513807",
"0.6371343",
"0.6302014",
"0.6214988",
"0.61925715",
"0.6030719",
"0.5997185",
"0.59667",
"0.5966695",
"0.5958705",
"0.5942059",
"0.5928614",
"0.5896884",
"0.58864427",
"0.58428407",
"0.58386564",
"0.5802814",
"0.5798703",
"0.5795398",... | 0.55787444 | 50 |
Set the maximum number of flow mods per slice per dpid. If dpid is set to any then the global slice limit applies. If no value is set then the number of slices is limitless. | public boolean setMaximumFlowMods (String sliceName, String dpid, String maxFlowMods)
throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Integer getMaximumFlowMods (String sliceName, String dpid)\n\t\t\tthrows PermissionDeniedException;",
"public void setMaxDept(int limit);",
"public abstract void setSplayLimit(int limit);",
"public void setSliceSize(int newSize) {\n ArrayList<Integer> newSlice = new ArrayList<>(slice);\n ... | [
"0.63794935",
"0.5429639",
"0.53993005",
"0.53396684",
"0.5306496",
"0.5204779",
"0.51707464",
"0.5130683",
"0.5123445",
"0.5118186",
"0.5072482",
"0.50273013",
"0.50218785",
"0.49723074",
"0.49701834",
"0.4916968",
"0.49065885",
"0.48996156",
"0.48995292",
"0.48884395",
"0.4... | 0.70393574 | 0 |
Get the maximum per slice per dpid limit. | public Integer getMaximumFlowMods (String sliceName, String dpid)
throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getDMAX() {\n\t\t\treturn DMAX;\r\n\t\t}",
"public int maxSubArray(int[] nums) {\n int[] dp = new int[nums.length];\n dp[0] = nums[0];\n int res = nums[0];\n for (int i = 1; i < nums.length; i++) {\n dp[i] = nums[i] + (dp[i - 1] < 0 ? 0 : dp[i - 1]);\n ... | [
"0.6489437",
"0.6324401",
"0.63067156",
"0.6301296",
"0.62052476",
"0.61031294",
"0.6049379",
"0.60356486",
"0.6030396",
"0.6024389",
"0.600828",
"0.60074776",
"0.5997502",
"0.5960713",
"0.5960713",
"0.59566104",
"0.59544015",
"0.59460455",
"0.5943174",
"0.5922048",
"0.589910... | 0.5985235 | 13 |
Get the current per slice per dpid limit. | public Integer getCurrentFlowMods(String sliceName, String dpid)
throws PermissionDeniedException, SliceNotFound, DPIDNotFound; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int getCurrentLimit(){\n\t\treturn this.LIMIT;\n\t}",
"public int slices() {\n\treturn slices;\n}",
"public int getActivePens(){\n return this.mFarm.getActivePens();\n }",
"int getLimit();",
"int getLimit();",
"protected Limit getLimit() {\n return new Limit(skip, limit);\n }"... | [
"0.5613441",
"0.55518067",
"0.5324211",
"0.52970475",
"0.52970475",
"0.5251366",
"0.52327037",
"0.51747483",
"0.5154272",
"0.51310056",
"0.5081843",
"0.50449014",
"0.50399905",
"0.5013613",
"0.5013184",
"0.4982527",
"0.49741793",
"0.49630406",
"0.49616674",
"0.49616674",
"0.4... | 0.47959974 | 34 |
Enable/Disable flow tracking in FlowVisor | public Boolean setFlowTracking(String flowtracking) throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setPassivateOrgINT(false);\r\n }",
"@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setPassivateTrgINT(false);\r\n }",
"@Override\r\n public void enableStreamFlow() {\r\n ... | [
"0.6552503",
"0.65467083",
"0.63171405",
"0.62388563",
"0.6091026",
"0.60512704",
"0.6050992",
"0.6042464",
"0.59355265",
"0.5919239",
"0.58025813",
"0.5747442",
"0.5709513",
"0.5708158",
"0.5698855",
"0.56598336",
"0.5617756",
"0.5617106",
"0.56004107",
"0.5584879",
"0.55840... | 0.6634903 | 0 |
Get flow tracking status in FlowVisor | public Boolean getFlowTracking() throws PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFlowLogStatus() {\n return this.flowLogStatus;\n }",
"public String getOdlOpenflowFlowstats2() throws SnmpStatusException;",
"EDataType getCurrentFlow();",
"public String getTracking() {\n\t\t\treturn tracking;\n\t\t}",
"public String getVisitFlow() {\r\n\t\treturn visitFlow;\r\n... | [
"0.72735703",
"0.61361706",
"0.61281353",
"0.60594225",
"0.6048734",
"0.60376245",
"0.59720725",
"0.5969836",
"0.5890784",
"0.58759224",
"0.58628035",
"0.5837461",
"0.57952285",
"0.5758726",
"0.5750566",
"0.5743914",
"0.57341176",
"0.57341176",
"0.5727325",
"0.5725225",
"0.57... | 0.62760603 | 1 |
Register an XMLRPC URL to be called when the topology changes. When the topology changes, FV will make a XMLRPC call to URL with parameter "cookie" | public Boolean registerTopologyChangeCallback(String URL, String methodName, String cookie)
throws MalformedURLException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public XmlRpcSession createXmlRpcSession(String url);",
"public void registerWithServer();",
"@Override\n\t\t\tpublic void onConnectRemoteNode(String url) {\t \t\t\t\n\t\t\t}",
"public void registerProtocol(Protocol protocol);",
"public interface RpcURI {\n String rpcproto = \"http\";\n String rpcssl... | [
"0.53556544",
"0.52402437",
"0.49561676",
"0.4856362",
"0.48510194",
"0.4787119",
"0.47722366",
"0.47452864",
"0.46257582",
"0.4596088",
"0.45335716",
"0.45257878",
"0.45206177",
"0.4517698",
"0.4490371",
"0.44546342",
"0.44407123",
"0.44389868",
"0.4436561",
"0.4435078",
"0.... | 0.71407914 | 0 |
Unregister a previously registered callback | public Boolean unregisterTopologyChangeCallback(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void unregisterCallback(@NonNull BleMessageStreamCallback callback) {\n mCallbacks.remove(callback);\n }",
"public void unregisterCallback(IInstrumentServiceCallback callback) {\n\t\t\tif (callback != null)\n\t\t\t\tm_callbacks.unregister(callback);\n\t\t}",
"public void unregis... | [
"0.8125271",
"0.7492366",
"0.7460925",
"0.7221102",
"0.7186095",
"0.7172326",
"0.7161736",
"0.7133035",
"0.7014831",
"0.6976802",
"0.6951651",
"0.69246143",
"0.68281245",
"0.68246806",
"0.6793437",
"0.67723334",
"0.6764263",
"0.6762588",
"0.6758381",
"0.6749236",
"0.6736318",... | 0.63777417 | 42 |
Return a multiline string of the slice's stats The string is of the form: SENT $switch1 :: $type1=$count1[,$type2=$count2[...]] $switch2 :: $type1=$count1[,$type2=$count2[...]] Total :: $type1=$count1[,$type2=$count2[...]] DROP $switch1 :: $type1=$count1[,$type2=$count2[...]] $switch2 :: $type1=$count1[,$type2=$count2[...]] Total :: $type1=$count1[,$type2=$count2[...]] | public String getSliceStats(String sliceName) throws SliceNotFound,
PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String stats()\n\t{\n\t\tString a = \"\"; //initialize string\n\t\t\n\t\tString size1 = points.length + \"\"; //put size into string\n\t\t\n\t\twhile(size1.length() < 12) //go until string is 12 long\n\t\t{\n\t\t\tsize1 += \" \"; //add a new blank space\n\t\t}\n\t\ta = a + algorithm + \" \" + size1 + ti... | [
"0.5332565",
"0.5089803",
"0.50748986",
"0.50579166",
"0.4972105",
"0.49285796",
"0.4924735",
"0.49172688",
"0.49106568",
"0.49043345",
"0.4892864",
"0.4867033",
"0.48467764",
"0.48057947",
"0.480445",
"0.4799068",
"0.47905022",
"0.47900394",
"0.4771964",
"0.4762855",
"0.4761... | 0.45168352 | 43 |
Return a multiline string of the switch's stats The string is of the form: SENT $slice1 :: $type1=$count1[,$type2=$count2[...]] $slice2 :: $type1=$count1[,$type2=$count2[...]] Total :: $type1=$count1[,$type2=$count2[...]] DROP $slice1 :: $type1=$count1[,$type2=$count2[...]] $slice2 :: $type1=$count1[,$type2=$count2[...]] Total :: $type1=$count1[,$type2=$count2[...]] | public String getSwitchStats(String dpidStr) throws DPIDNotFound,
PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String stats()\n\t{\n\t\tString a = \"\"; //initialize string\n\t\t\n\t\tString size1 = points.length + \"\"; //put size into string\n\t\t\n\t\twhile(size1.length() < 12) //go until string is 12 long\n\t\t{\n\t\t\tsize1 += \" \"; //add a new blank space\n\t\t}\n\t\ta = a + algorithm + \" \" + size1 + ti... | [
"0.5823059",
"0.52917695",
"0.5286615",
"0.5253528",
"0.5179713",
"0.51076996",
"0.502927",
"0.50288534",
"0.50134987",
"0.5003809",
"0.49681145",
"0.49645343",
"0.49634543",
"0.4920667",
"0.48989233",
"0.48876956",
"0.48717007",
"0.48695076",
"0.48652118",
"0.48382822",
"0.4... | 0.0 | -1 |
Get a List of FlowDBEnty's converted by toBracketMap() | public Collection<Map<String, String>> getSwitchFlowDB(String dpidstr)
throws DPIDNotFound; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<ObjectTableColumn<E>> getObjectColumnMap();",
"java.util.List<message.Figure.FigureData.FigureLevelTable> \n getLevelTableListList();",
"public Collection<DatabaseMapping> getDatabaseMappings() throws InvalidFormatException;",
"public abstract List<T> convertToEntities(List<D> dtos);",
"Map<S... | [
"0.53492105",
"0.53109115",
"0.5285218",
"0.5211256",
"0.52007204",
"0.51906604",
"0.5146789",
"0.512576",
"0.5094651",
"0.50936794",
"0.5093242",
"0.5077628",
"0.50653446",
"0.50540215",
"0.5033377",
"0.5032719",
"0.50080156",
"0.50078535",
"0.49829012",
"0.49724838",
"0.495... | 0.0 | -1 |
Return a map of the flow entries the slice requested to what the flowvisor produced | public Map<String, List<Map<String, String>>> getSliceRewriteDB(
String sliceName, String dpidstr) throws DPIDNotFound,
SliceNotFound, PermissionDeniedException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Map getPartitionMap(int nPid);",
"public Map getPartitionMap(PartitionSet partitions);",
"private Map<Integer, Request> splitRequest(Command cmd, List<byte[]> args, int start, int end, int step) {\n final Map<Integer, Request> map = new IdentityHashMap<>();\n\n for (int i = start; i < end; i += st... | [
"0.5339344",
"0.51926994",
"0.51587296",
"0.5155986",
"0.510509",
"0.5100833",
"0.49899146",
"0.49207252",
"0.4915642",
"0.48861158",
"0.48690668",
"0.48687527",
"0.48480698",
"0.4835379",
"0.4825577",
"0.4820138",
"0.48146787",
"0.48097518",
"0.48066008",
"0.4796032",
"0.478... | 0.0 | -1 |
Dumps a copy of the config deployed in a db to the file specified. | public String dumpConfig()
throws PermissionDeniedException, FileNotFoundException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeDump(File f) {\n\n }",
"public void saveDbConfig () {\n\t\ttry {\n\t\t\tthis.databaseConfig.store(new FileWriter(new File(this.databaseAddress)), \"\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"[ERROR] Could not save initialization to database properties file: \" + databaseA... | [
"0.6274473",
"0.60412043",
"0.59072155",
"0.55002743",
"0.5477954",
"0.54721606",
"0.5398839",
"0.53816646",
"0.5292912",
"0.5283854",
"0.52779126",
"0.5206785",
"0.517417",
"0.51334095",
"0.5094574",
"0.50691015",
"0.504792",
"0.50037163",
"0.4999656",
"0.4998492",
"0.499370... | 0.5899832 | 3 |
FileResource fr = new FileResource(); String message = fr.asString(); | public void testCaesar(){
int key1 = 23;
int key2 = 17;
String encrypted = encrypt("At noon be in the conference room with your hat on for a surprise party. YELL LOUD!", 15);
System.out.println("key is 15" + "\n" + encrypted);
String encrypted2 = encryptTwoKeys("At noon be in the conference room with your hat on for a surprise party. YELL LOUD!", 8, 21);
System.out.println("key are 8 and 21" + "\n" + encrypted2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getResource();",
"public Resource load(IFile f);",
"Resource getResource();",
"public String getStringFile(){\n return fileView(file);\n }",
"String getFile();",
"String getFile();",
"String getFile();",
"String encodeResourceToString(IBaseResource theResource) throws DataFormatExcep... | [
"0.6892951",
"0.6766676",
"0.67398953",
"0.6615435",
"0.64124465",
"0.64124465",
"0.64124465",
"0.63997114",
"0.63858616",
"0.623774",
"0.620382",
"0.6171873",
"0.6155137",
"0.6096831",
"0.6096831",
"0.6079893",
"0.6072342",
"0.6043107",
"0.60423934",
"0.60349506",
"0.6031744... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public List<Object> getMovie(JSONObject param) {
String type = StringUtil.ToString(param.getString("type"));
String tip = StringUtil.ToString(param.getString("tip"));
int number = Integer.parseInt(param.getString("number"));
Map<String, Object> message = new HashMap<String, Object>();
List<Object> result = new ArrayList<Object>();
message.put("recommand", type);
message.put("number", number);
if(!tip.equals("")){
System.out.println(tip);
message.put("tip", tip);
}
List<Object> movie = (List<Object>) this.queryForList("Movie.selectByCondition",message);
return movie;
} | {
"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 Object getMovieMessage(JSONObject param) {
String id = StringUtil.ToString(param.getString("imageId"));
Map<String, Object> img = new HashMap<String, Object>();
img.put("id", id);
MovieMessage message = (MovieMessage) this.queryForObject("MovieMessage.selectByCondition", img);
return message;
} | {
"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 List<Object> modifyMovies(JSONObject param) {
String name =StringUtil.ToString(param.getString("movieName"));
System.out.println(name);
Map<String, Object> movie = new HashMap<String, Object>();
movie.put("name", name);
List<Object> movies = this.queryForList("Movie.selectByName", movie);
return movies;
} | {
"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 List<Object> modifyByPage(JSONObject params) {
List<Object> resultData = new ArrayList<Object>();
String type = StringUtil.ToString(params.getString("type"));
System.out.println(type);
String tip = StringUtil.ToString(params.getString("tip"));
String area = StringUtil.ToString(params.getString("area"));
String releaseDate = StringUtil.ToString(params.getString("releaseDate"));
int size = Integer.parseInt(params.getString("size"));
int currentPage = Integer.parseInt(params.getString("currentPage"));
Map<String, Object> data = new HashMap<String, Object>();
data.put("type", type);
if(!tip.equals("")){
data.put("tip", tip);
} else if(!area.equals("")){
data.put("area", area);
} else if(!releaseDate.equals("")){
data.put("releaseDate", releaseDate);
}
PageResultBean prb = new PageResultBean();
prb.setPageSize(size);
prb.setCurrentPage(currentPage);
prb.setToPage(currentPage);
PageResultBean resultPrb = new PageResultBean();
String orderBy = "asc";
resultPrb = this.queryForPage(prb, "Movie.selectByType", "Movie.selectPage", data, orderBy);
resultData.add(resultPrb);
return resultData;
} | {
"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 save(JSONObject param) {
Map<String, Object> data = new HashMap<String, Object>();
String movieId = StringUtil.ToString(param.getString("movieId"));
System.out.println(movieId);
String recommand = StringUtil.ToString(param.getString("recommand"));
String tip = StringUtil.ToString(param.getString("tip"));
String str = uuid.toString();
String id = str.substring(0, 8) + str.substring(9, 13) + str.substring(14, 18) + str.substring(19, 23) + str.substring(24);
data.put("id", id);
data.put("movieId", movieId);
data.put("recommand", recommand);
data.put("tip", tip);
int number = this.insert("MovieRecommand.insert", data);
return number;
} | {
"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 delete(JSONObject param) {
Map<String, Object> data = new HashMap<String, Object>();
String movieId = StringUtil.ToString(param.getString("id"));
data.put("movieId", movieId);
int number = this.delete("MovieRecommand.deleteById", data);
return number;
} | {
"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 int saveImage(Movie movie) {
String str = uuid.toString();
String id = str.substring(0, 8) + str.substring(9, 13) + str.substring(14, 18) + str.substring(19, 23) + str.substring(24);
movie.setId(id);
movie.setCreateData(new Date());
int number = this.insert("Movie.insert", movie);
return number;
} | {
"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 |
replace fragment with signUp Screen | @Override
public void getStartedClicked() {
startSignUpFragment();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void gotoSignUp() {\n\t\tgetFragmentManager().beginTransaction()\n\t\t\t\t.replace(R.id.container, new SignUpFragment(), \"signup\")\n\t\t\t\t.commit();\n\n\t}",
"@Override\n public void onClick(View v){\n SignUpFragment fragment = new SignUpFragment();\n ... | [
"0.82447445",
"0.81534046",
"0.7941023",
"0.79298663",
"0.7861881",
"0.7649089",
"0.7405929",
"0.739955",
"0.7382597",
"0.73276734",
"0.7189577",
"0.71565",
"0.70784473",
"0.7077623",
"0.70389044",
"0.6992145",
"0.69791865",
"0.6916462",
"0.691005",
"0.6896801",
"0.68849915",... | 0.6515718 | 46 |
send data to the back End, then login user | @Override
public void getStartedSignUpClicked() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redi... | [
"0.7418615",
"0.7211263",
"0.7176302",
"0.71328706",
"0.7122309",
"0.70622355",
"0.70309657",
"0.70243657",
"0.7020843",
"0.6964187",
"0.6925528",
"0.68933254",
"0.6876803",
"0.681788",
"0.6780174",
"0.674783",
"0.67464375",
"0.6738773",
"0.6675842",
"0.6671429",
"0.66596866"... | 0.0 | -1 |
replace fragment with login Screen | @Override
public void loginClickedSignUp() {
startSignInFragment();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void replaceLoginFragment() {\n\n\n }",
"protected void replaceLoginFragment() {\n\n// fragmentManager\n// .beginTransaction()\n// .setCustomAnimations(R.anim.left_enter, R.anim.right_out)\n// .replace(R.id.frameContainer, new Login_Fragment(),\n//... | [
"0.8557901",
"0.78032833",
"0.72550994",
"0.71363187",
"0.71025705",
"0.70998704",
"0.703747",
"0.696936",
"0.68766683",
"0.68479574",
"0.6803048",
"0.6796876",
"0.67961234",
"0.6775062",
"0.67449236",
"0.67418855",
"0.66783077",
"0.6669719",
"0.66552347",
"0.6654177",
"0.664... | 0.7078765 | 6 |
152 (C, D, H, S) | public Card(int deckValue){
//Guard against an invalid state:
if((deckValue < 1) || (deckValue > 52))
{
throw new IllegalArgumentException();
}
this.deckValue = deckValue;
faceValue = toFaceValue(deckValue);
suitValue = toSuitValue(deckValue);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo304a(C0366h c0366h);",
"void ciff_block_1030()\n{\n int key[] = new int[2];\n key[0] = 0x410;\n key[1] = 0x45f3;\n int i, bpp, row, col, vbits=0;\n long bitbuf=0;\n\n get2();\n if ((get4()) != 0x80008 || get4()==0) return;\n bpp = get2();\n if (bpp != 10 && bpp != 12) return;\n for (i=row=0; row... | [
"0.55911225",
"0.5567254",
"0.5544745",
"0.5524448",
"0.55111784",
"0.54628104",
"0.5446946",
"0.5440372",
"0.5425129",
"0.53871834",
"0.53782785",
"0.5335167",
"0.53153425",
"0.53087854",
"0.5301635",
"0.52786803",
"0.5245718",
"0.52408564",
"0.52405053",
"0.5238689",
"0.523... | 0.0 | -1 |
Guard against an invalid state: | public static int toDeckValue(int faceValue, int suitValue)
{
if((faceValue < 2) || (suitValue > 14))
{
throw new IllegalArgumentException();
}
if((suitValue < 1) || (suitValue > 4))
{
throw new IllegalArgumentException();
}
int deckValue = (13 * (suitValue - 1)) + faceValue - 1;
return deckValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void assertNotInState(T forbidden) {\n synchronized (this) {\n if (state == forbidden) {\n throw new IllegalStateException(\"Should not be in state \" + forbidden + \".\");\n }\n }\n }",
"public static void error()\r\n {\r\n valid=false;\r\n\... | [
"0.6852219",
"0.6731349",
"0.66619045",
"0.65540123",
"0.65162313",
"0.64356536",
"0.6423007",
"0.6374675",
"0.63667935",
"0.63635457",
"0.63630104",
"0.63391125",
"0.63339657",
"0.6333841",
"0.63251376",
"0.6305751",
"0.62737304",
"0.62559843",
"0.6241775",
"0.6230055",
"0.6... | 0.0 | -1 |
Test method for read transaction. It is designed to read two of the three fields stored for each key, to also test if the createResultHashMap() function implemented in RiakKVClient.java works as expected. | @Test
public void testRead() {
// Choose a random key to read, among the available ones.
int readKeyNumber = new Random().nextInt(RiakKVClientTest.recordsToInsert);
// Prepare two fields to read.
Set<String> fields = new HashSet<>();
fields.add(RiakKVClientTest.firstField);
fields.add(RiakKVClientTest.thirdField);
// Prepare an expected result.
HashMap<String, String> expectedValue = new HashMap<>();
expectedValue.put(RiakKVClientTest.firstField, Integer.toString(readKeyNumber));
expectedValue.put(RiakKVClientTest.thirdField, Integer.toString((readKeyNumber * readKeyNumber)));
// Define a HashMap to store the actual result.
HashMap<String, ByteIterator> readValue = new HashMap<>();
// If a read transaction has been properly done, then one has to receive a Status.OK return from the read()
// function. Moreover, the actual returned result MUST match the expected one.
Assert.assertEquals("Read transaction FAILED.", OK, RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(readKeyNumber))), fields, readValue));
Assert.assertEquals("Read test FAILED. Actual read transaction value is NOT MATCHING the expected one.", expectedValue.toString(), readValue.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testInsertRead() {\n\t\tfinal String TABLE1 = \"testInsertRead\";\n\t\tfinal String NON_EXISTENT_TABLE = \"non-existent-table\";\n\t\tfinal String RECORD1 = \"record1\";\n\t\tfinal String NON_EXISTENT_RECORD = \"non-existent-record\";\n\t\tfinal String FIELD1 = \"field1\";\n\t\tfinal String FI... | [
"0.7146797",
"0.6978961",
"0.64215934",
"0.62584317",
"0.6158632",
"0.5981023",
"0.59472275",
"0.58945215",
"0.5859982",
"0.56093395",
"0.5499784",
"0.5466662",
"0.54665846",
"0.545512",
"0.54459554",
"0.5436251",
"0.53971475",
"0.5394238",
"0.5361374",
"0.53589374",
"0.53124... | 0.8627658 | 0 |
Test method for scan transaction. A scan transaction has to be considered successfully completed only if all the requested values are read (i.e. scan transaction returns with Status.OK). Moreover, one has to check if the obtained results match the expected ones. | @Test
public void testScan() {
// Choose, among the available ones, a random key as starting point for the scan transaction.
int startScanKeyNumber = new Random().nextInt(((RiakKVClientTest.recordsToInsert) - (RiakKVClientTest.recordsToScan)));
// Prepare a HashMap vector to store the scan transaction results.
Vector<HashMap<String, ByteIterator>> scannedValues = new Vector<>();
// Check whether the scan transaction is correctly performed or not.
Assert.assertEquals("Scan transaction FAILED.", OK, RiakKVClientTest.riakClient.scan(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(startScanKeyNumber))), RiakKVClientTest.recordsToScan, null, scannedValues));
// After the scan transaction completes, compare the obtained results with the expected ones.
for (int i = 0; i < (RiakKVClientTest.recordsToScan); i++) {
Assert.assertEquals("Scan test FAILED: the current scanned key is NOT MATCHING the expected one.", RiakKVClientTest.createExpectedHashMap((startScanKeyNumber + i)).toString(), scannedValues.get(i).toString());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void retrieveSingleScanResults() throws Exception {\n WifiScanner.ScanSettings requestSettings =\n createRequest(WifiScanner.WIFI_BAND_BOTH_WITH_DFS,\n 0, 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN);\n ScanResults expectedResults = Sc... | [
"0.64421517",
"0.6385423",
"0.635692",
"0.61676085",
"0.60555166",
"0.60418963",
"0.6019483",
"0.5997499",
"0.5963291",
"0.5962202",
"0.59241736",
"0.58630955",
"0.5856687",
"0.58236414",
"0.57997614",
"0.57794905",
"0.57680416",
"0.5744588",
"0.57345146",
"0.57257813",
"0.56... | 0.78024864 | 0 |
Test method for update transaction. The test is designed to restore the previously read key. It is assumed to be correct when, after performing the update transaction, one reads the just provided values. | @Test
public void testUpdate() {
// Choose a random key to read, among the available ones.
int updateKeyNumber = new Random().nextInt(RiakKVClientTest.recordsToInsert);
// Define a HashMap to save the previously stored values for eventually restoring them.
HashMap<String, ByteIterator> readValueBeforeUpdate = new HashMap<>();
RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), null, readValueBeforeUpdate);
// Prepare an update HashMap to store.
HashMap<String, String> updateValue = new HashMap<>();
updateValue.put(RiakKVClientTest.firstField, "UPDATED");
updateValue.put(RiakKVClientTest.secondField, "UPDATED");
updateValue.put(RiakKVClientTest.thirdField, "UPDATED");
// First of all, perform the update and check whether it's failed or not.
Assert.assertEquals("Update transaction FAILED.", OK, RiakKVClientTest.riakClient.update(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), StringByteIterator.getByteIteratorMap(updateValue)));
// Then, read the key again and...
HashMap<String, ByteIterator> readValueAfterUpdate = new HashMap<>();
Assert.assertEquals("Update test FAILED. Unable to read key value.", OK, RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), null, readValueAfterUpdate));
// ...compare the result with the new one!
Assert.assertEquals("Update transaction NOT EXECUTED PROPERLY. Values DID NOT CHANGE.", updateValue.toString(), readValueAfterUpdate.toString());
// Finally, restore the previously read key.
Assert.assertEquals("Update test FAILED. Unable to restore previous key value.", OK, RiakKVClientTest.riakClient.update(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(updateKeyNumber))), readValueBeforeUpdate));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void oldNotUpdateSuccessExchangeWithdraw() {\n dbManager.getDynamicPropertiesStore().saveAllowSameTokenName(0);\n InitExchangeBeforeSameTokenNameActive();\n long exchangeId = 1;\n String firstTokenId = \"abc\";\n long firstTokenQuant = 100000000L;\n String secondTokenId = \"def\";... | [
"0.66049343",
"0.628457",
"0.6242387",
"0.6227525",
"0.61874926",
"0.61463374",
"0.6146128",
"0.61428946",
"0.6065003",
"0.60644275",
"0.6018555",
"0.5957107",
"0.59416914",
"0.5931379",
"0.592344",
"0.5921685",
"0.58422637",
"0.58363265",
"0.5827987",
"0.5807014",
"0.5792361... | 0.79653865 | 0 |
Test method for insert transaction. It is designed to insert a key just after the last key inserted in the setUp() phase. | @Test
public void testInsert() {
// Define a HashMap to insert and another one for the comparison operation.
HashMap<String, String> insertValue = RiakKVClientTest.createExpectedHashMap(RiakKVClientTest.recordsToInsert);
HashMap<String, ByteIterator> readValue = new HashMap<>();
// Check whether the insertion transaction was performed or not.
Assert.assertEquals("Insert transaction FAILED.", OK, RiakKVClientTest.riakClient.insert(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(RiakKVClientTest.recordsToInsert))), StringByteIterator.getByteIteratorMap(insertValue)));
// Finally, compare the insertion performed with the one expected by reading the key.
Assert.assertEquals("Insert test FAILED. Unable to read inserted value.", OK, RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(RiakKVClientTest.recordsToInsert))), null, readValue));
Assert.assertEquals("Insert test FAILED. Actual read transaction value is NOT MATCHING the inserted one.", insertValue.toString(), readValue.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testInsert3() throws Exception {\n DAS das = DAS.FACTORY.createDAS(getConnection());\n Command insert = das.createCommand(\"insert into COMPANY (NAME) values (?)\");\n insert.setParameter(1, \"AAA Rental\");\n insert.execute();\n // Integer key = (Integer) inser... | [
"0.75516045",
"0.7122828",
"0.6673809",
"0.6623586",
"0.6552909",
"0.650532",
"0.64995766",
"0.64858073",
"0.6484451",
"0.64387584",
"0.64238834",
"0.63925683",
"0.639185",
"0.63716155",
"0.6342199",
"0.6280622",
"0.62312573",
"0.6224934",
"0.6223929",
"0.62178403",
"0.621019... | 0.66108954 | 4 |
Test method for delete transaction. The test deletes a key, then performs a read that should give a Status.NOT_FOUND response. Finally, it restores the previously read key. | @Test
public void testDelete() {
// Choose a random key to delete, among the available ones.
int deleteKeyNumber = new Random().nextInt(RiakKVClientTest.recordsToInsert);
// Define a HashMap to save the previously stored values for its eventual restore.
HashMap<String, ByteIterator> readValueBeforeDelete = new HashMap<>();
RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(deleteKeyNumber))), null, readValueBeforeDelete);
// First of all, delete the key.
Assert.assertEquals("Delete transaction FAILED.", OK, RiakKVClientTest.delete(((RiakKVClientTest.keyPrefix) + (Integer.toString(deleteKeyNumber)))));
// Then, check if the deletion was actually achieved.
Assert.assertEquals("Delete test FAILED. Key NOT deleted.", NOT_FOUND, RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(deleteKeyNumber))), null, null));
// Finally, restore the previously deleted key.
Assert.assertEquals("Delete test FAILED. Unable to restore previous key value.", OK, RiakKVClientTest.riakClient.insert(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(deleteKeyNumber))), readValueBeforeDelete));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public KVMessage delete(String key) {\n KVMessage rtn;\n //lock.lock();\n try {\n cacheMap.remove(key);\n String previousValueOnDisk = deleteFromDisk(key);\n if (previousValueOnDisk == null) {\n rtn = new Message(KVMessage.StatusTy... | [
"0.6626598",
"0.65326375",
"0.65222627",
"0.64423186",
"0.6424476",
"0.6422748",
"0.63655466",
"0.6339925",
"0.63377523",
"0.63161963",
"0.63073504",
"0.6281531",
"0.62709826",
"0.62346977",
"0.6216157",
"0.62010616",
"0.6198573",
"0.6197505",
"0.61911577",
"0.6176758",
"0.61... | 0.82272774 | 0 |
super.onSkipPressed(currentFragment); Do something when users tap on Skip button. | @Override
public void onSkipPressed(Fragment currentFragment) {
Dexter.withActivity(this)
.withPermissions(
Manifest.permission.READ_CALENDAR,
Manifest.permission.WRITE_CALENDAR,
Manifest.permission.CAMERA,
Manifest.permission.READ_CONTACTS,
Manifest.permission.WRITE_CONTACTS,
Manifest.permission.GET_ACCOUNTS,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_CALL_LOG,
Manifest.permission.WRITE_CALL_LOG,
Manifest.permission.ADD_VOICEMAIL,
Manifest.permission.USE_SIP,
Manifest.permission.PROCESS_OUTGOING_CALLS,
Manifest.permission.BODY_SENSORS,
Manifest.permission.SEND_SMS,
Manifest.permission.RECEIVE_SMS,
Manifest.permission.READ_SMS,
Manifest.permission.RECEIVE_WAP_PUSH,
Manifest.permission.RECEIVE_MMS,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
).withListener(new MultiplePermissionsListener() {
@Override public void onPermissionsChecked(MultiplePermissionsReport report) {ActivityOptionsCompat compat = setActivityAnimation();
startActivity(new Intent(MainIntroActivity.this, MainActivity.class), compat.toBundle());
finish();}
@Override public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) {/* ... */}
}).check();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onSkipPressed() {\n setCurrentSlide(4);\n }",
"public void handleSkipAction(ActionEvent event){\n sender.sendInput(\"skip action\");\n }",
"@Override\n\tpublic void skip() {\n\t}",
"@Override\r\n\tpublic void skip() {\n\t\tSystem.out.println(\"Skip\");\r\n\t}",
... | [
"0.77712166",
"0.7099674",
"0.6694262",
"0.6485512",
"0.6299569",
"0.62055224",
"0.6175194",
"0.61274797",
"0.6107595",
"0.6048509",
"0.59768915",
"0.59698105",
"0.59640515",
"0.59640515",
"0.5956047",
"0.59189194",
"0.5910111",
"0.59031963",
"0.58442485",
"0.5840544",
"0.582... | 0.69424266 | 2 |
Shows a polygon number as a 7segment LED | public void showNumber(final int number) {
// default to 0 for non-valid numbers
this.number = (number < 0 || number > NEGATIVE_SIGN_DIGIT) ? 0 : number;
for (int i=0; i<7; i++) {
polygons[i].setFill(DIGIT_COMBINATIONS[getNumber()][i] ? onColor
: offColor);
polygons[i].setEffect(DIGIT_COMBINATIONS[getNumber()][i] ? onEffect
: offEffect);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void paintNumbers() {\n\n g2d.setColor(_BOARDCOLOR);\n g2d.drawString(\"0\", 100, 150);\n g2d.drawString(\"1\", 200, 150);\n g2d.drawString(\"2\", 300, 150);\n g2d.drawString(\"3\", 400, 150);\n g2d.drawString(\"4\", 100, 250);\n g2d.drawString(\"5\", 200, 2... | [
"0.594022",
"0.5873124",
"0.5872042",
"0.5579669",
"0.5573503",
"0.55693114",
"0.55145097",
"0.5512468",
"0.54956347",
"0.5466695",
"0.54101795",
"0.5402199",
"0.5365388",
"0.5354745",
"0.5353129",
"0.5345091",
"0.5337314",
"0.5330618",
"0.5278079",
"0.52508664",
"0.5248414",... | 0.6247549 | 0 |
While the view item is in hidden state, make it invisible for the accessibility. | void onEnteredHiddenState(MyRecyclerView parent) {
if (mPendingAccessibilityState != PENDING_ACCESSIBILITY_STATE_NOT_SET) {
mWasImportantForAccessibilityBeforeHidden = mPendingAccessibilityState;
} else {
mWasImportantForAccessibilityBeforeHidden =
ViewCompat.getImportantForAccessibility(itemView);
}
parent.setChildImportantForAccessibilityInternal(this,
ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void hide() {\n visible=false;\n }",
"public void hide() {\n hidden = true;\n }",
"public void hide() {\n\t\thidden = true;\n\t}",
"public void hide() {\r\n\t\tif (item != null) { \r\n\t ShowCaseStandalone.slog(Level.FINEST, \"Hiding showcase: \" + getSHA1());\r\n\t i... | [
"0.76445514",
"0.75979584",
"0.73776716",
"0.7153038",
"0.7099326",
"0.70820206",
"0.7000138",
"0.6982582",
"0.6936991",
"0.6903925",
"0.689805",
"0.6877156",
"0.68746436",
"0.68746436",
"0.68746436",
"0.68746436",
"0.68746436",
"0.68746436",
"0.68746436",
"0.68746436",
"0.68... | 0.7185645 | 3 |
fallback to onItemRangeChanged(positionStart, itemCount) if app does not override this method. | public void onItemRangeChanged(int positionStart, int itemCount, @Nullable Object payload) {
onItemRangeChanged(positionStart, itemCount);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onItemRangeChanged(\n int startPosition, int itemCount, Object payload) {\n }",
"@Override\n public ItemDraggableRange onGetItemDraggableRange(Holder holder, int position) {\n return null;\n }",
"@Override\n ... | [
"0.7295268",
"0.6695842",
"0.6461816",
"0.6431352",
"0.615974",
"0.6158979",
"0.61340326",
"0.6114108",
"0.6078096",
"0.6073609",
"0.6073609",
"0.6047747",
"0.6019603",
"0.6012051",
"0.6011474",
"0.6002053",
"0.6002004",
"0.6002004",
"0.6002004",
"0.6002004",
"0.5968435",
"... | 0.6991418 | 1 |
Constructs with an initial cell count. An exception is thrown when the initial cell count is below 1 or above 10e4. | TestTube(int initialCellCount) {
if (initialCellCount == 0 || initialCellCount > 10e4) {
throw new IllegalArgumentException("initial cell count should be above 1 and below 10e4: " + initialCellCount);
}
//initialize the array with new Cells
cells = new Cell[initialCellCount];
for (int i = 0; i < initialCellCount; i++) {
cells[i] = new Cell();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void initCell(\r\n int row,\r\n int col,\r\n double valueToInitialise);",
"public IntHashGrid() {\n this(0.0018); // About 200m\n }",
"private static void InitializeCells()\n {\n cells = new Cell[Size][Size];\n\n for (int i... | [
"0.61367637",
"0.60569245",
"0.6055493",
"0.6049639",
"0.5882616",
"0.5850271",
"0.5845361",
"0.57328403",
"0.57156783",
"0.5714734",
"0.5699188",
"0.56907654",
"0.5666734",
"0.5568774",
"0.5543978",
"0.5422941",
"0.5415833",
"0.54107934",
"0.5398833",
"0.53916657",
"0.538297... | 0.73152006 | 0 |
Grows the cells, in one single iteration. | void growCells() {
for (Cell cell : cells) {
cell.grow();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void renumberCells() {\r\n int num = 1;\r\n for (Cell cell : cells) {\r\n cell.updateCellNum(num);\r\n num++;\r\n }\r\n }",
"public void update() {\n\t\tfor (Entry<String, Integer> entry : countMap.entrySet()) {\n\t\t\tcountMap.put(entry.getKey(), 0);\n\t\t}\n\t\tfor (int i = 0; i < nu... | [
"0.66604006",
"0.60715985",
"0.6045085",
"0.5985783",
"0.59837615",
"0.5967325",
"0.59539795",
"0.59369665",
"0.5906736",
"0.5833497",
"0.5822691",
"0.57519054",
"0.57146144",
"0.5687744",
"0.56834805",
"0.56608874",
"0.56111324",
"0.5553366",
"0.55453706",
"0.5544782",
"0.55... | 0.8388745 | 0 |
removes the loader from the dom tree | public Preloader stop() {
element().remove();
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected synchronized void clearURLLoader() {\r\n currentLoader = null;\r\n }",
"private void hideLoading()\n {\n relLoadingPanel.setVisibility(View.GONE);\n ViewHelper.setViewGroupEnabled(scrMainContainer, true);\n }",
"public void clearScriptPath() {\r\n loader = null;\... | [
"0.70099324",
"0.6686868",
"0.66530836",
"0.65206116",
"0.6262664",
"0.62432724",
"0.61970854",
"0.6163157",
"0.60715073",
"0.6052596",
"0.6041099",
"0.6041099",
"0.59238106",
"0.59238106",
"0.5916929",
"0.591523",
"0.5900963",
"0.58627707",
"0.58387125",
"0.57521904",
"0.575... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
int zahl = 5;
// abkürzende schreibweisen für verschiedene Operationen
zahl +=10; //zahl + 10
zahl -=5; // zahl - 5
zahl /=9; // zahl /9
zahl %=4; // zahl %4
System.out.println(zahl);
// Inkrement (++) und Dekrement (--) Operatoren
// präfix operator ist --zahl (Präfix-Schreibweise)
// postfix operator ist zahl-- (Postfix-Schreibweise)
//System.out.println(++zahl); //addiert 1 drauf und gibt dann aus = 6
//System.out.println(zahl++); // gibt erst aus (6) und addiert dann. somit steht auf KOnsole 6, zahl hat aber Wert 7
//System.out.println(zahl); // beweis das zuvor addiert wurde
} | {
"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 | public static void main(String[] args) {
int menuNumber;
Scanner input = new Scanner(System.in);
ArrayList<Inventory> newInventory = new ArrayList<>();
int countID=0;
int itemCount = newInventory.size();
int id =0;
double biaya=0;
String name="";
String product="";
String description="";
double price=0;
int stringLength = 16;
// Gadai data = new Gadai(countID, itemCount, id, biaya, name, product, description, price, stringLength);
do {
System.out.println("+-------------------------------+");
System.out.println(" MENU ");
System.out.println("+-------------------------------+");
System.out.println("1. Gadai");
System.out.println("2. Tebus");
System.out.println("3. Tampilkan Inventory");
System.out.println("4. Exit");
System.out.println("+-------------------------------+");
System.out.print("Masukkan Menu Pilihan : ");
menuNumber = input.nextInt();
if(menuNumber==1) {
Gadai gadai = new Gadai(newInventory, name, itemCount, product, description, price, stringLength);
itemCount = gadai.getItemCount();
}
else if(menuNumber==2) {
Inventory.printHeaderTebus();
for (Inventory inventory : newInventory) inventory.printRowTebus();
Inventory.printLine();
do {
try {
System.out.println("Masukkan ID barang yang ingin di tebus : ");
id = input.nextInt();
if (id <= itemCount && id > 0) {
do {
try {
System.out.println("Masukkan biaya yang ingin di tebus : ");
biaya = input.nextDouble();
}
catch (Exception e){
input.next();
continue;
}
} while(biaya > newInventory.get(id-1).getUtang() || biaya <= 0);
if (biaya <= newInventory.get(id-1).getUtang()) {
newInventory.get(id-1).setUtang(newInventory.get(id-1).getUtang() - biaya);
if (newInventory.get(id-1).getUtang() == 0) {
newInventory.get(id-1).setStatus("Lunas");
}
}
}
}
catch (Exception e){
input.next();
continue;
}
} while(id > itemCount || id <= 0 );
} else if(menuNumber==3) {
Inventory.printHeaderInventory();
for (Inventory inventory : newInventory)
if (inventory.getStatus() != "Lunas")
inventory.printRowInventory();
Inventory.printLine();
} else if(menuNumber==4) {
System.out.println("Exit");
} else {
System.out.println("Menu Tidak Ada");
}
} while(menuNumber!=4);
} | {
"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 |
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_musictab, container, false);
folder1 = view.findViewById(R.id.folder1);
folder2 = view.findViewById(R.id.folder2);
folder1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
subFolderActivity = new Intent(view.getContext(),SubFolder.class);
bundle = new Bundle();
bundle.putInt("number",0);
subFolderActivity.putExtras(bundle);
startActivity(subFolderActivity);
}
});
folder2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
subFolderActivity = new Intent(view.getContext(),SubFolder.class);
bundle = new Bundle();
bundle.putInt("number",1);
subFolderActivity.putExtras(bundle);
startActivity(subFolderActivity);
}
});
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 |
temporaty String to hold the value of each line within the text. | public static void main(String[] args){
String tempStringLine;
/* SCANNING IN THE SENTENCE */
// create a queue called sentenceQueue to temporary store each line of the text file as a String.
MyLinkedList sentenceList = new MyLinkedList();
// integer which keeps track of the index position for each new sentence string addition.
int listCount = 0;
// create a new file by opening a text file.
File file2 = new File("testEmail2.txt");
try {
// create a new scanner 'sc' for the newly allocated file.
Scanner sc = new Scanner(file2);
// while there are still lines within the file, continue.
while (sc.hasNextLine()) {
// save each line within the file to the String 'tempStringLine'.
tempStringLine = sc.nextLine();
// create a new BreakIterator called 'sentenceIterator' to break the 'tempStringLine' into sentences.
BreakIterator sentenceIterator = BreakIterator.getSentenceInstance();
// Set a new text string 'tempStringLine' to be scanned.
sentenceIterator.setText(tempStringLine);
// save the first index boundary in the integer 'start'.
// The iterator's current position is set to the first text boundary.
int start = sentenceIterator.first();
// save the boundary following the current boundary in the integer 'end'.
for(int end = sentenceIterator.next();
// while the end integer does not equal 'BreakIterator.DONE' or the end of the boundary.
end != BreakIterator.DONE;
// set the start integer equal to the end integer. Set the end integer equal to the next boundary.
start = end, end = sentenceIterator.next()){
// create a substring of tempStringLine of the start and end boundsries, which are just Strings of
// each sentence.
sentenceList.add(listCount,tempStringLine.substring(start, end));
// add to the count.
listCount++;
}
}
// close the scanner 'sc'.
sc.close();
// if the file could not be opened, throw a FileNotFoundException.
}catch (FileNotFoundException e) {
e.printStackTrace();
}
sentenceProcessor one = new sentenceProcessor(sentenceList);
String[] names = one.findNames();
System.out.println("Speaker " + names[0]);
System.out.println("Subject " + names[1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getValue() {\n\t\treturn value.replace(\"\\\\r\\\\n\", \"\\r\\n\");\n\t}",
"public String asString() {\n StringBuffer result = new StringBuffer();\n\n for (String line : this) {\n result.append(line).append('\\n');\n }\n\n return result.toString();\n }",
... | [
"0.6155596",
"0.6098036",
"0.6062341",
"0.5973267",
"0.58688354",
"0.5856141",
"0.5839921",
"0.58255625",
"0.57917273",
"0.577264",
"0.57457817",
"0.5738761",
"0.5738181",
"0.56416506",
"0.56416506",
"0.56416506",
"0.56416506",
"0.56416506",
"0.56402504",
"0.56402504",
"0.564... | 0.0 | -1 |
read spring config file | public static void main(String[] args) {
ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
//AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(TennisCoach.class);
//get the bean from spring container
//1. Default bean id
Coach theCoach=context.getBean("tennisCoach", Coach.class);
//2. Explicit bean id
//Coach theCoach=context.getBean("thatCoach", Coach.class);
System.out.println(theCoach.getDailyWorkout());
//call method to get a daily fortune
System.out.println(theCoach.getDailyFortune());
context.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String readConfiguration(String path);",
"public ReadConfigFile (){\n\t\ttry {\n\t\t\tinput = ReadConfigFile.class.getClassLoader().getResourceAsStream(Constant.CONFIG_PROPERTIES_DIRECTORY);\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}catch ( IOException e ) {\n\... | [
"0.73487234",
"0.7224019",
"0.6681932",
"0.6636958",
"0.6634243",
"0.6626923",
"0.65764236",
"0.6550251",
"0.653689",
"0.6514539",
"0.6492313",
"0.6422944",
"0.6381089",
"0.6380964",
"0.6378499",
"0.6359117",
"0.6333654",
"0.6294356",
"0.62833077",
"0.6282825",
"0.61303794",
... | 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_main, 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();
switch (item.getItemId()) {
case R.id.action_signin:
Intent intent = new Intent(this, SigninActivity.class);
startActivity(intent);
return true;
case R.id.action_export:
boolean result = JSONHelper.exportToJSON(this, dataItemList);
if (result) {
Toast.makeText(this, "داده های صادر شده..", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "صادر نشد", Toast.LENGTH_SHORT).show();
}
return true;
case R.id.action_import:
List<DataItem> list = JSONHelper.importFromJSON(this);
if (list != null) {
for (DataItem dataItem : dataItemList) {
Log.v(TAG, "Import Json" + dataItem.getItemName());
}
}
return true;
// case R.id.action_all_items:
// // display all items
// displayDataItems(null);
// return true;
// case R.id.action_choose_category:
// //open the drawer
// mDrawerLayout.openDrawer(mDrawerList);
// return true;
}
// if(TextUtils.isEmpty(RegisterActivity.EMAIL_KEY)){
// }
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.7904451",
"0.78051436",
"0.7766031",
"0.77275425",
"0.76321447",
"0.7622237",
"0.7584132",
"0.7530231",
"0.74875915",
"0.7457484",
"0.7457484",
"0.7438372",
"0.74221927",
"0.7403421",
"0.73915446",
"0.738672",
"0.7378976",
"0.73701847",
"0.7362139",
"0.73556066",
"0.734531... | 0.0 | -1 |
Checks whether Bluetooth is enabled. | public static boolean isBleEnabled() {
final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
return adapter != null && adapter.isEnabled();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isBluetoothEnabled() {\n BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();\n if (bluetooth == null)\n return false;//\"device not BT capable\";\n return bluetooth.isEnabled();\n }",
"private void CheckBtIsOn() {\n mBluetoothAdapter = Bluet... | [
"0.83823436",
"0.82361495",
"0.81414324",
"0.79561555",
"0.7855884",
"0.7806559",
"0.7794611",
"0.77944076",
"0.77751803",
"0.77550775",
"0.7731647",
"0.7701338",
"0.76583356",
"0.763259",
"0.761185",
"0.75791407",
"0.7266074",
"0.72204703",
"0.7216572",
"0.71798056",
"0.7140... | 0.734526 | 16 |
Checks for required permissions. | public static boolean isLocationPermissionsGranted(final Context context) {
return ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void checkPermissions() {\n final ArrayList<String> missedPermissions = new ArrayList<>();\n\n for (final String permission : PERMISSIONS_REQUIRED) {\n if (ActivityCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {\n missedPermission... | [
"0.8028617",
"0.7867994",
"0.75528485",
"0.7509034",
"0.74999785",
"0.7497437",
"0.7459591",
"0.7451134",
"0.7386687",
"0.7301822",
"0.7293752",
"0.7288955",
"0.7286605",
"0.7270521",
"0.7245165",
"0.7235031",
"0.7224056",
"0.7196325",
"0.7186636",
"0.7169514",
"0.71446097",
... | 0.0 | -1 |
Returns true if location permission has been requested at least twice and user denied it, and checked 'Don't ask again'. | public static boolean isLocationPermissionDeniedForever(final Activity activity) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
return !isLocationPermissionsGranted(activity) // Location permission must be denied
&& preferences.getBoolean(PREFS_PERMISSION_REQUESTED, false) // Permission must have been requested before
&& !ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_COARSE_LOCATION); // This method should return false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isLocationAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n //If permission is granted returning true\r\n if (result == PackageManager.PERMISSION_GRANTED)\r\n return true;\r\n\r\n //If permiss... | [
"0.7291837",
"0.71232873",
"0.70416987",
"0.6979297",
"0.68826044",
"0.6808455",
"0.67724806",
"0.6768021",
"0.6723492",
"0.6717698",
"0.66301864",
"0.66199976",
"0.6601122",
"0.6601122",
"0.6584181",
"0.6569879",
"0.6563497",
"0.653377",
"0.65192646",
"0.64786327",
"0.643174... | 0.71759117 | 1 |
On some devices running Android Marshmallow or newer location services must be enabled in order to scan for Bluetooth LE devices. This method returns whether the Location has been enabled or not. | public static boolean isLocationEnabled(final Context context) {
if (isMarshmallowOrAbove()) {
int locationMode = Settings.Secure.LOCATION_MODE_OFF;
try {
locationMode = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE);
} catch (final Settings.SettingNotFoundException e) {
// do nothing
}
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isLocationEnabled() {\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) || locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n }",
"private ... | [
"0.81990623",
"0.8195461",
"0.73970824",
"0.73229754",
"0.7279932",
"0.71753883",
"0.7051252",
"0.70487356",
"0.70437276",
"0.69750273",
"0.6953",
"0.69392264",
"0.6934205",
"0.685192",
"0.685192",
"0.6801169",
"0.6797738",
"0.6796874",
"0.67727375",
"0.6769816",
"0.6734508",... | 0.7446636 | 2 |
Location enabled is required on some phones running Android Marshmallow or newer (for example on Nexus and Pixel devices). | public static boolean isLocationRequired(final Context context) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
return preferences.getBoolean(PREFS_LOCATION_NOT_REQUIRED, isMarshmallowOrAbove());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean isLocationEnabled(final Context context) {\n\t\tif (isMarshmallowOrAbove()) {\n\t\t\tint locationMode = Settings.Secure.LOCATION_MODE_OFF;\n\t\t\ttry {\n\t\t\t\tlocationMode = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE);\n\t\t\t} catch (final Settings.S... | [
"0.77148443",
"0.76030326",
"0.7573812",
"0.7566579",
"0.75659925",
"0.7555489",
"0.7537108",
"0.75219893",
"0.74762917",
"0.74714506",
"0.7428901",
"0.74044853",
"0.7401136",
"0.73797333",
"0.7358247",
"0.73264706",
"0.7282858",
"0.7274462",
"0.7257565",
"0.72502184",
"0.722... | 0.70363724 | 44 |
When a Bluetooth LE packet is received while Location is disabled it means that Location is not required on this device in order to scan for LE devices. This is a case of Samsung phones, for example. Save this information for the future to keep the Location info hidden. | public static void markLocationNotRequired(final Context context) {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
preferences.edit().putBoolean(PREFS_LOCATION_NOT_REQUIRED, false).apply();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onReceiveLocation(BDLocation location) {\n if (null != location && location.getLocType() != BDLocation.TypeServerError) {\n StringBuffer sb = new StringBuffer(256);\n sb.append(\"time : \");\n /**\n * 时间也可以使用syst... | [
"0.6296264",
"0.6262284",
"0.5867636",
"0.5753738",
"0.57351625",
"0.56998503",
"0.56957996",
"0.568984",
"0.5666923",
"0.5666653",
"0.56437415",
"0.56288046",
"0.5628116",
"0.5623769",
"0.5620921",
"0.5569744",
"0.5554267",
"0.55507034",
"0.5538116",
"0.55323833",
"0.553106"... | 0.0 | -1 |
System.out.println(c); //compiler error: c is not static | static void staticNestedM()
{
System.out.println(d);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static a c() {\n }",
"public void c() {\n }",
"public static void c1() {\n\t}",
"@Override\r\n\tpublic void A() {\n\t\tSystem.out.println(C.b);\r\n\t}",
"static void staticShow() {\n System.out.println(\"In a static class static method\");\n }",
"@Override\r\n\tpublic void B() {\... | [
"0.7447403",
"0.69687736",
"0.6650871",
"0.65986556",
"0.64849454",
"0.6481083",
"0.6230558",
"0.62305224",
"0.6181112",
"0.6156518",
"0.6147729",
"0.6146572",
"0.61433077",
"0.6074927",
"0.60588366",
"0.6050286",
"0.6044745",
"0.5992442",
"0.5929505",
"0.5892722",
"0.5892722... | 0.57697344 | 30 |
Calculamos el ISSS de un salario que recibimos como parametro y retormanos el ISSS de ese salario. | public double isss(double salario) {
double isss = 0;
if (salario >= 1000) {
isss = 30;
} else if (salario > 0 && salario < 1000) {
isss = salario * 0.03;
}
return isss;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"double getSalario();",
"public String resumenSalario(double salario)\n {\n String str=\"AFP: \"+afp(salario)\n +\"\\nISSS: \"+isss(salario)\n +\"\\nRenta: \"+renta(salario)\n +\"\\nSueldo neto: \" + sueldoNeto(salario);\n return str;\n }",
"@Override\n\tpublic void ... | [
"0.53880465",
"0.5159721",
"0.50992435",
"0.50472564",
"0.49941888",
"0.49289468",
"0.49269086",
"0.49037126",
"0.48897535",
"0.48686337",
"0.48595",
"0.4850303",
"0.4820763",
"0.48135138",
"0.48090628",
"0.4804704",
"0.47981408",
"0.47905922",
"0.47869432",
"0.47598553",
"0.... | 0.6140085 | 0 |
Calculamos el APF de un salario que recibimos como parametro y retormanos el AFP de ese salario. | public double afp(double salario) {
double afp = 0;
afp = salario * 0.0725;
return afp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void calculatePF() {\r\n\t\tfloat pfRate = 10.5f;\r\n\t\tSystem.out.println(\"The PF rate of the employee is \"+pfRate);\r\n\t\tdisplay();\r\n\t}",
"public float impuestoAplicado();",
"public int consultarPrecioVenta(String fruta, String proteina, String grano, String almidon) {\n Almuerzo almuerz... | [
"0.57639575",
"0.54291",
"0.5285785",
"0.5182903",
"0.5105427",
"0.50417286",
"0.5029976",
"0.50201213",
"0.49759093",
"0.49639872",
"0.49345675",
"0.49280438",
"0.49100772",
"0.4894176",
"0.4893676",
"0.48914665",
"0.48764804",
"0.48721102",
"0.48656568",
"0.4854669",
"0.484... | 0.6631568 | 0 |
Calculamos la renta de un salario que recibimos como parametro y retormanos la renta de ese salario. | public double renta(double salario) {
double renta = 0;
double salarioMenosAfpIsss = salario - (afp(salario) + isss(salario));
if (salarioMenosAfpIsss < 470) {
renta = 0;
} else if (salarioMenosAfpIsss > 470 && salarioMenosAfpIsss < 895.24) {
renta = ((salarioMenosAfpIsss-472)*0.10)+17.67;
} else if (salarioMenosAfpIsss > 895.25 && salarioMenosAfpIsss < 2038.1) {
renta = ((salarioMenosAfpIsss-895.24)*0.20)+60;
} else if (salarioMenosAfpIsss > 2038.11) {
renta = ((salarioMenosAfpIsss-2038.10)*0.30)+288.57;
}
return renta;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public double calculaSalario() \n {\n double resultado = valor_base - ((acumulado * 0.05) * valor_base);\n resultado += auxilioProcriacao();\n //vale-coxinha\n resultado += 42;\n return resultado;\n }",
"public void calcularSalario(){\n // 1% do lucr... | [
"0.65896326",
"0.6579118",
"0.64613295",
"0.64360696",
"0.6416142",
"0.60348827",
"0.5982754",
"0.58360493",
"0.58206433",
"0.5798958",
"0.5775545",
"0.576243",
"0.57337135",
"0.5720867",
"0.57139266",
"0.56935424",
"0.56859285",
"0.5676621",
"0.5667193",
"0.56573904",
"0.564... | 0.7480577 | 0 |
Calculamos el sueldo neto de un salario que recibimos como parametro. | public double sueldoNeto(double salario)
{
double salarioN=salario - (isss(salario)+afp(salario)+renta(salario));
return salarioN;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic double neto() {\n\t\treturn 2000;\n\t}",
"@FXML\n\tpublic void xButtonCalcular(ActionEvent event) {\n\t\t\n\t\tNumero n = new Numero();\n if(xTextFieldNumero.getText().isEmpty()) {\n\t\t\tSystem.out.println(\"(CLIENTE) Esta vacio\");\n\t\t\treturn;\n\t\t}\n\n n.setNumero(Integer... | [
"0.54651034",
"0.53697467",
"0.53186345",
"0.52076393",
"0.5206298",
"0.51411265",
"0.5135508",
"0.5073124",
"0.50446594",
"0.5041064",
"0.5017856",
"0.5006892",
"0.49997833",
"0.49996647",
"0.49750882",
"0.49635965",
"0.492482",
"0.49244478",
"0.49238485",
"0.49195394",
"0.4... | 0.61966324 | 0 |
Retorna una cadena con los descuentos que se le aplican a nuestro salario. | public String resumenSalario(double salario)
{
String str="AFP: "+afp(salario)
+"\nISSS: "+isss(salario)
+"\nRenta: "+renta(salario)
+"\nSueldo neto: " + sueldoNeto(salario);
return str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void aplicarDescuento();",
"@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo llamadas telefónicas y atiendo visitas\");\n\t}",
"@Override\n\tpublic String describirActividades() {\n\t\treturn (\"Soy el secretario, recibo documentos, atiendo... | [
"0.63563895",
"0.61162347",
"0.61162347",
"0.6082299",
"0.6024812",
"0.6007814",
"0.59964526",
"0.5977474",
"0.59658456",
"0.59400684",
"0.59396285",
"0.59081715",
"0.5903639",
"0.5872861",
"0.5855614",
"0.5833204",
"0.5809229",
"0.58055335",
"0.5791871",
"0.57881314",
"0.578... | 0.0 | -1 |
/ Create a new FlightBookingManager. In this case, we use the implementation supplied by class FlightBookingManagerImpl. If this confuses you, you should go back and reconsult your notes on Java interfaces. | public static void main(String[] args) {
FlightBookingManager fm = new FlightBookingManagerImpl();
/* If a filename is supplied, try and open it as a collection
of bookings. */
if (args.length > 0) {
try {
fm.loadBookings( new java.io.File( args[0] ) );
} catch (Exception ex) {
System.out.println( "Exception when loading: ");
System.out.println( ex.getMessage() );
}
}
FlightBookingManagerGUI gui =
new FlightBookingManagerGUI( fm );
gui.setVisible( true );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n\tpublic void makeBooking2() {\r\n\t\tnewFlightSearch.setDepartureTime(new Date(2016-1900,7+1,15));\r\n\t\tnewFlightSearch.setDepartureLoc(\"Akureyri\");\r\n\t\tnewFlightSearch.setArrivalLoc(\"Reykjavík\");\r\n\t\tnewFlightSearch.setPriceRange(new int[]{10000,20000});\r\n\t\tnewFlightSearch.setReturnTrip(... | [
"0.6029976",
"0.59591883",
"0.5855496",
"0.57244354",
"0.5653517",
"0.5515913",
"0.5496041",
"0.5405686",
"0.53769535",
"0.53560495",
"0.5284997",
"0.5283189",
"0.52821606",
"0.5275918",
"0.5274907",
"0.52712923",
"0.52142906",
"0.5182742",
"0.51545686",
"0.51251304",
"0.5115... | 0.0 | -1 |
Get customer first name | public String getFirstName() {
return firstName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public java.lang.String getFirstName() {\n return _entityCustomer.getFirstName();\n }",
"java.lang.String getFirstName();",
"java.lang.String getFirstName();",
"public java.lang.String getFirstName();",
"public java.lang.CharSequence getFirstName() {\n return first_name;\n ... | [
"0.8324495",
"0.8118905",
"0.8118905",
"0.78835547",
"0.78174675",
"0.78168535",
"0.7783875",
"0.7740409",
"0.7729708",
"0.7708751",
"0.7703258",
"0.7697741",
"0.7672122",
"0.76698065",
"0.76698065",
"0.76698065",
"0.7659864",
"0.7637864",
"0.7631748",
"0.7619019",
"0.7605420... | 0.0 | -1 |
Set customer first name | public void setFirstName(final String firstName) {
this.firstName = firstName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void setFirstName(java.lang.String firstName) {\n _entityCustomer.setFirstName(firstName);\n }",
"public void setFirstName( String name ) {\n if ( name == null ) \r\n throw new NullPointerException( \"Customer first name can't be null.\" );\r\n else \r\n\t this.firstNa... | [
"0.817456",
"0.79990226",
"0.7965305",
"0.7914213",
"0.7911687",
"0.7873345",
"0.7814672",
"0.77844775",
"0.7728759",
"0.76702464",
"0.766071",
"0.76362795",
"0.76362795",
"0.7634126",
"0.7628179",
"0.761613",
"0.7608238",
"0.76024354",
"0.7601998",
"0.7599353",
"0.7599353",
... | 0.748172 | 34 |
Get customer last name | public String getLastName() {
return lastName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public java.lang.String getLastName() {\n return _entityCustomer.getLastName();\n }",
"java.lang.String getLastName();",
"java.lang.String getLastName();",
"String getLastName();",
"String getLastName();",
"public java.lang.String getLastName();",
"public String getLastName();"... | [
"0.8265083",
"0.792774",
"0.792774",
"0.7921798",
"0.7921798",
"0.79099655",
"0.78644305",
"0.7770867",
"0.7621181",
"0.76139176",
"0.75752294",
"0.7544221",
"0.7543604",
"0.7542248",
"0.75412244",
"0.75384706",
"0.7526478",
"0.7509666",
"0.7507112",
"0.74681",
"0.7467136",
... | 0.7251544 | 70 |
Set customer last name | public void setLastName(final String lastName) {
this.lastName = lastName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setLastName( String name ) {\n if ( name == null ) \r\n throw new NullPointerException( \"Customer last name can't be null.\" );\r\n else \r\n\t this.lastName = name; \r\n }",
"public static void setLastName(String name){\n setUserProperty(Constants.ZeTarget_keyForUserProperty... | [
"0.81189436",
"0.7867656",
"0.7777437",
"0.7729449",
"0.76756185",
"0.7675227",
"0.76595795",
"0.76084405",
"0.75814825",
"0.75127876",
"0.74801964",
"0.7465102",
"0.7381895",
"0.7381215",
"0.73798805",
"0.73529863",
"0.73527676",
"0.7321527",
"0.73036134",
"0.7301433",
"0.72... | 0.6923984 | 52 |
Get customer phone number | public String getPhone() {
return phone;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getPhoneNumber();",
"java.lang.String getPhoneNumber();",
"java.lang.String getPhoneNumber();",
"java.lang.String getUserPhone();",
"java.lang.String getPhone();",
"@Override\n public String provideCustomerMobilePhone( )\n {\n return _signaleur.getIdTelephone( );\n }",
... | [
"0.79880077",
"0.79880077",
"0.79880077",
"0.7945194",
"0.79359466",
"0.7790412",
"0.77265936",
"0.76347566",
"0.7475176",
"0.74667144",
"0.7451632",
"0.74419767",
"0.7439208",
"0.7375104",
"0.73619545",
"0.73533636",
"0.73474765",
"0.7294813",
"0.7290892",
"0.728373",
"0.727... | 0.0 | -1 |
Set customer phone number | public void setPhone(final String phone) {
this.phone = phone;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setPhone(int phone);",
"public void setPhone(String phone);",
"public void setPhoneNumber(java.lang.CharSequence value) {\n this.phone_number = value;\n }",
"public com.politrons.avro.AvroPerson.Builder setPhoneNumber(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.p... | [
"0.7694189",
"0.76733214",
"0.75923264",
"0.75815177",
"0.753809",
"0.7523909",
"0.74596256",
"0.745307",
"0.7383413",
"0.7383413",
"0.73244226",
"0.73015165",
"0.7287307",
"0.72773063",
"0.72669303",
"0.72531295",
"0.72518444",
"0.72516245",
"0.72516245",
"0.72442836",
"0.72... | 0.70912594 | 41 |
Connection nesnesinden baglan fonksiyonu: | private static Connection baglan() {
Connection baglanti = null;
try {
baglanti = DriverManager.getConnection("jdbc:postgresql://localhost:5432/SogutucuKontrolCihazi",
"postgres", "159753");
if (baglanti != null) //bağlantı varsa
System.out.println("Veritabanına bağlandı!");
else
System.out.println("Bağlantı girişimi başarısız!");
} catch (Exception e) {
e.printStackTrace();
}
return baglanti;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void connect()\r\n\t{\r\n\t\tkonekcija = ConnectionClass.getConnection(adresa, port, imeBaze, korisnickoIme, sifra);\r\n\t\tSystem.out.println(\"Konekcija otvorena: \"+ konekcija.toString());\r\n\t}",
"private void openConnection(){}",
"protected void connectionEstablished() {}",
"@FXML\n\tpublic void... | [
"0.712276",
"0.69559366",
"0.675304",
"0.6651728",
"0.65306985",
"0.64532113",
"0.64439344",
"0.64439344",
"0.64439344",
"0.6404359",
"0.6398105",
"0.6380482",
"0.6363088",
"0.63466084",
"0.63308316",
"0.6319004",
"0.6319004",
"0.63109356",
"0.6298396",
"0.6283998",
"0.627078... | 0.654489 | 4 |
TODO Autogenerated method stub | @Override
public void addRecords(Records record) {
recordsDAO.addRecords(record);
} | {
"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 removeRecords(Records record) {
recordsDAO.removeRecords(record);
} | {
"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 |
boolean isGroup = true; | ShapeGroup(){
children = new ArrayList<IShape>();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean isGroup() {\n return false;\n }",
"Boolean groupingEnabled();",
"public boolean getInValidGroup(){return this.inValidGroup;}",
"public boolean isSetGroup() {\n return this.group != null;\n }",
"public boolean getIsGroup() {\n return (mParticipantCount > 1)... | [
"0.77128386",
"0.76583236",
"0.7555779",
"0.74288344",
"0.7410602",
"0.7179238",
"0.7077731",
"0.7072193",
"0.7011268",
"0.7007723",
"0.6978437",
"0.69627553",
"0.69348514",
"0.68774295",
"0.67489976",
"0.66978073",
"0.6684934",
"0.66781086",
"0.66676974",
"0.66424483",
"0.66... | 0.0 | -1 |
Created by grishberg on 23.04.17. | public interface ResponseContainer<T extends Serializable> {
@Nullable
T getPayload();
@Nullable
BaseException getException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n public void func_104112_b() {\n \n }",
"public final void mo51373a() {\n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private void poetries() {\n\n\t}",
"private static void ... | [
"0.5673158",
"0.56356245",
"0.55623806",
"0.55389315",
"0.5534335",
"0.54633325",
"0.5456665",
"0.54514015",
"0.5409067",
"0.5409067",
"0.5387509",
"0.5375327",
"0.5372801",
"0.53472817",
"0.5333535",
"0.5325659",
"0.53209245",
"0.53103477",
"0.53103477",
"0.53103477",
"0.531... | 0.0 | -1 |
need a massByElements. DON'T need a mass by minerals, already pretty simply done in goxel. This gives you the loadout of common and rare elements by percent, if the whole goxel were composed of this one set of minerals in these fractions. THIS IS PROBABLY WRONG, TODO: fix to use twoproportiontiered system in place currently. | public static byte[] byMassFromMinerals(Mineral[] minerals, float[] fractions) {
int totalAtomicWeight = 0;
int[] totalAtomicWeights = new int[24];
for (int e = 0; e < 24; e++) { //per element
if (e < 8) { //primary elements
for (int m = 0; m < minerals.length; m++){ //per mineral
totalAtomicWeights[e] = (int)(minerals[m].commonChemistry[e]*fractions[m]*RockDictionary.elements.get(e).atomicWeight);
totalAtomicWeight += totalAtomicWeights[e];
}
} else { //secondary elements
for (int m = 0; m < minerals.length; m++){ //per mineral
totalAtomicWeights[e] = (int)(minerals[m].rareChemistry[e]*fractions[m]*RockDictionary.elements.get(e).atomicWeight);
totalAtomicWeight += totalAtomicWeights[e];
}
}
}
byte[] result = new byte[24];
double weightPerElementUnit = totalAtomicWeight / 100d;
for (int e = 0; e < 24; e++) { //per element
result[e] = (byte)((totalAtomicWeights[e]/weightPerElementUnit));
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getMass() { return modules.values().stream().mapToDouble(Module::getMass).sum(); }",
"public double[] monteCarloPercentiles(){\n if(!this.monteCarloDone)this.monteCarlo();\n return this.randomEigenValuesPercentiles;\n }",
"public double getMass();",
"double getLeftoverMemoryPer... | [
"0.5454651",
"0.5272028",
"0.51846385",
"0.5157845",
"0.4954949",
"0.49147654",
"0.4887658",
"0.48608765",
"0.4843984",
"0.48435155",
"0.4842749",
"0.4824963",
"0.47955114",
"0.47809646",
"0.4741375",
"0.47392365",
"0.47361475",
"0.47224715",
"0.470403",
"0.4698262",
"0.46967... | 0.61125237 | 0 |
same bt for a rock type | public static byte[] byMassFromMinerals(Rock rock) {
return byMassFromMinerals(rock.getMinerals(), rock.getFractions());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract Barrier inverseKnockType();",
"@Test\n public void test_BoostOnDies() {\n addCard(Zone.HAND, playerA, \"Silumgar Scavenger\", 1); // {4}{B}\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 5);\n //\n addCard(Zone.BATTLEFIELD, playerA, \"Balduvian Bears\", 1);\n\n ... | [
"0.61621225",
"0.5748365",
"0.5690663",
"0.5650853",
"0.5611858",
"0.55170995",
"0.54555315",
"0.5375301",
"0.5362343",
"0.53561836",
"0.5343352",
"0.53415394",
"0.5330926",
"0.53076714",
"0.53012586",
"0.5300452",
"0.5288057",
"0.5276837",
"0.52758276",
"0.52688056",
"0.5263... | 0.0 | -1 |
Create a ChunkImage from a larger BufferedImage. In this example, each of the tiles is translationally offset by tile_X, tile_Y steps. | public TiledImage(BufferedImage image, int tile_X, int tile_Y) {
m_imageWidth = image.getWidth();
m_imageHeight = image.getHeight();
// Determine number of rows and columns required
m_rows = (int) Math.ceil(image.getWidth() / (double) tile_X);
m_columns = (int) Math.ceil(image.getHeight() / (double) tile_Y);
if (m_rows > 0 && m_columns > 0) {
int chunks = m_rows * m_columns;
int count = 0;
// The goal here is to divide
m_sourceTiles = new BufferedImage[chunks]; //Image array to hold image chunks
m_transforms = new Translate[chunks];
m_imageTiles = new Image[chunks];
for (int x = 0; x < m_rows; x++) {
for (int y = 0; y < m_columns; y++) {
// Initialize the image array with image chunks
// https://stackoverflow.com/questions/5836128/how-do-i-make-javas-imagebuffer-to-read-a-png-file-correctly
int imageType = image.getType();
if (imageType == 0) imageType = 5;
m_sourceTiles[count] = new BufferedImage(tile_X, tile_Y, imageType);
// draws the image chunk
Graphics2D gr = m_sourceTiles[count].createGraphics();
gr.drawImage(image, 0, 0, tile_X, tile_Y, tile_X * y, tile_Y * x, tile_X * y + tile_X, tile_Y * x + tile_Y, null);
gr.dispose();
// Create the JavaFX Image tile
m_imageTiles[count] = SwingFXUtils.toFXImage(m_sourceTiles[count], null);
// assign a translate offset Transform for the tile.
int shiftX = tile_X * y;
int shiftY = tile_Y * x;
Translate translate = new Translate();
translate.setX(shiftX);
translate.setY(shiftY);
m_transforms[count] = translate;
count++;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void divideImage() {\n\n int chunkWidth = 70;\n int chunkHeight = 70;\n int count = 0;\n imgs = new BufferedImage[100];\n for (int x = 0; x < 10; x++)\n for (int y = 0; y < 10; y++) {\n\n try{\n\n ... | [
"0.61815816",
"0.5758831",
"0.547372",
"0.5460192",
"0.5174433",
"0.5126944",
"0.5093033",
"0.5085371",
"0.50851035",
"0.5030302",
"0.49660727",
"0.49117345",
"0.49025065",
"0.48483622",
"0.48473942",
"0.4840234",
"0.4820556",
"0.4799768",
"0.477625",
"0.4739321",
"0.47005525... | 0.6728689 | 0 |
Set up the UI and background operations for chat. | private void setupChat() {
Log.d(TAG, "setupChat()");
// Initialize the array adapter for the conversation thread
mConversationArrayAdapter = new ArrayAdapter<String>(getActivity(), R.layout.message);
mConversationView.setAdapter(mConversationArrayAdapter);
// Initialize the compose field with a listener for the return key
// Initialize the send button with a listener that for click events
// Initialize the BluetoothChatService to perform bluetooth connections
mChatService = new BluetoothChatService(getActivity(), mhandler);
// Initialize the buffer for outgoing messages
mOutStringBuffer = new StringBuffer("");
switchForFileSaved.setOnCheckedChangeListener(switchListener) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void run() {\n SimpleChatUI firstWin = new SimpleChatUI();\n windows.add(firstWin);\n firstWin.setVisible(true);\n hub = new HubSession(new LoginCredentials(new ChatKeyManager(CHAT_USER)));\n\n firstWin.setStatus(\"No active chat\");... | [
"0.6964212",
"0.6900218",
"0.68664205",
"0.68163717",
"0.6680134",
"0.6631948",
"0.6625692",
"0.6619833",
"0.6587232",
"0.65761894",
"0.6541866",
"0.65278447",
"0.6524467",
"0.6509683",
"0.6467931",
"0.6362261",
"0.63559175",
"0.63525593",
"0.63113236",
"0.6305086",
"0.630123... | 0.7276926 | 0 |
Makes this device discoverable for 300 seconds (5 minutes). | private void ensureDiscoverable() {
if (mBluetoothAdapter.getScanMode() !=
BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
startActivity(discoverableIntent);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void makeDeviceDiscoverable() {\n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 900);\n startActivity(discoverableIntent);\n }",
"private void setDiscoverable(int di... | [
"0.6540343",
"0.6458488",
"0.6160104",
"0.58699214",
"0.5846094",
"0.5798723",
"0.558037",
"0.5537362",
"0.55022216",
"0.54921734",
"0.54894614",
"0.54707956",
"0.5329388",
"0.5302953",
"0.5297317",
"0.5265223",
"0.5260228",
"0.5239388",
"0.5219427",
"0.5217386",
"0.52048206"... | 0.5741361 | 7 |
If the action is a keyup event on the return key, send the message | public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
String message = view.getText().toString();
sendMessage(message);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void keyReleased(KeyEvent e) {\n if(e.getKeyCode()==10){ //enter key code is 10\r\n // System.out.println(\"you have pressed enter button\");\r\n String contentToSend=messageInput.getText(); //type kia hua msg nikalna\r\n ... | [
"0.6834489",
"0.65789807",
"0.64900964",
"0.645659",
"0.6384659",
"0.6309909",
"0.6295595",
"0.6264026",
"0.6251177",
"0.6222567",
"0.61941504",
"0.61579585",
"0.6150822",
"0.6137383",
"0.60869354",
"0.6073314",
"0.60544914",
"0.6048349",
"0.6029191",
"0.60287416",
"0.5999557... | 0.6020495 | 21 |
Updates the status on the action bar. | private static void setStatus(int resId, Activity activity) {
if (null == activity) {
return;
}
final ActionBar actionBar = activity.getActionBar();
if (null == actionBar) {
return;
}
actionBar.setSubtitle(resId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateStatus(final String newStatus)\n\t{\n\t\tif(statusBar!=null)\n\t\t{\n\t\t\tstatusBar.setText(\"Program Status: \" + newStatus);\n\t\t}\n\t\t//statusBar.repaint();\n\t}",
"private void setStatusBar(String statusMsg)\r\n {\r\n\r\n debug(\"setStatusBar() - get a handle to the main application\... | [
"0.7333305",
"0.6984801",
"0.6980763",
"0.69706786",
"0.66476506",
"0.657311",
"0.65369576",
"0.65346146",
"0.646846",
"0.63885903",
"0.6379249",
"0.637381",
"0.63375705",
"0.6293635",
"0.6283705",
"0.6237755",
"0.6237755",
"0.6217833",
"0.62079126",
"0.6189281",
"0.6181559",... | 0.5955207 | 41 |
Updates the status on the action bar. | private static void setStatus(CharSequence subTitle, Activity activity) {
if (null == activity) {
return;
}
final ActionBar actionBar = activity.getActionBar();
if (null == actionBar) {
return;
}
actionBar.setSubtitle(subTitle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateStatus(final String newStatus)\n\t{\n\t\tif(statusBar!=null)\n\t\t{\n\t\t\tstatusBar.setText(\"Program Status: \" + newStatus);\n\t\t}\n\t\t//statusBar.repaint();\n\t}",
"private void setStatusBar(String statusMsg)\r\n {\r\n\r\n debug(\"setStatusBar() - get a handle to the main application\... | [
"0.7332247",
"0.69843924",
"0.6979507",
"0.6969517",
"0.6647141",
"0.6572785",
"0.65371794",
"0.65335655",
"0.646691",
"0.6389556",
"0.63778776",
"0.63727695",
"0.6336544",
"0.6295822",
"0.6283748",
"0.62367064",
"0.62367064",
"0.6217018",
"0.6206622",
"0.618845",
"0.6181686"... | 0.0 | -1 |
Interface to the state classes in accordance with the state pattern | public interface IState
{
/**
* Gets the state
*
* @pre none
* @post returns the state as defined in the shared definitions
*/
public shared.definitions.TurnStatus getState();
/**
* Advances to the next state in the turn
*
* @pre the player is finished with all required actions in this state
* @post the state is advanced to the next state
*
*/
public void finishPhase(TurnTracker turn_tracker_pointer, int player_index);
/**
* Forces this player into the Discarding State
* @throws Exception
*
* @pre the player is in the Waiting or Rolling State
* @post the player is in the Discarding state
*/
public void forceDiscard(TurnTracker turn_tracker_pointer, int player_index) throws Exception;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface State {\r\n\r\n}",
"public interface IStates {\n\n\t/**\n\t * applyExtraActionPoint. adds extra action point whit the type received by\n\t * parameter\n\t *\n\t * @param extra\n\t * a\n\t * {@link com.github.danielpinto8zz6.ninecardsiege.logic.Constants.EXTRA}\n\t * ... | [
"0.8114059",
"0.76803225",
"0.7536936",
"0.7535125",
"0.7479387",
"0.7447199",
"0.73909414",
"0.7342364",
"0.7336042",
"0.7305688",
"0.7242338",
"0.7242338",
"0.7242338",
"0.7242338",
"0.7192679",
"0.718984",
"0.7168414",
"0.7166199",
"0.71651965",
"0.7132918",
"0.7110622",
... | 0.72657204 | 10 |
Advances to the next state in the turn | public void finishPhase(TurnTracker turn_tracker_pointer, int player_index); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}",
"synchronized void advanceState()\n {\n state = state.advance();\n notifyAll();\n }",
"public void nextTurn(){\n\t\tthis.setCurrentElement(this.getCurrentElement().getNext());\n\t}",
"pub... | [
"0.7822922",
"0.7819356",
"0.7542844",
"0.7266443",
"0.7212551",
"0.7143292",
"0.71306884",
"0.70858854",
"0.70205307",
"0.69940275",
"0.69541097",
"0.6927738",
"0.6905534",
"0.6900795",
"0.68560445",
"0.68558824",
"0.6761558",
"0.6746431",
"0.6716334",
"0.66932434",
"0.66789... | 0.0 | -1 |
Forces this player into the Discarding State | public void forceDiscard(TurnTracker turn_tracker_pointer, int player_index) throws Exception; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void onDiscard() {\r\n this.setActive(false);\r\n }",
"protected void discard() {\r\n discarded = true;\r\n onDiscard();\r\n }",
"public void discard() {\n }",
"public void discard();",
"public void discardLeader(int bool){\n this.leaderCardsPanel.discardLeaderCard(bool);\n ... | [
"0.7702669",
"0.7484544",
"0.6963551",
"0.6893546",
"0.67821133",
"0.6736853",
"0.6650644",
"0.66199046",
"0.65521115",
"0.65504754",
"0.64949816",
"0.6462512",
"0.6454383",
"0.6454383",
"0.63895136",
"0.62782526",
"0.6206933",
"0.6151408",
"0.6145157",
"0.61291265",
"0.61157... | 0.7176622 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.