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 |
|---|---|---|---|---|---|---|
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.layout_movie_fragment, container, false);
//index=getArguments().getInt("position");
movieID = getArguments().getString("movieID");
final String url = MovieDataJson.PHP_SERVER+"movies/id/"+movieID;
Log.d("MovieURL", url);
new MyDownloadJsonAsynTask(v).execute(url);
Log.d("MovieJsonString", movieDataJson.getJsonString());
return v;
} | {
"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.6740675",
"0.6725193",
"0.67224836",
"0.6699259",
"0.6691596",
"0.668896",
"0.6687658",
"0.66861755",
"0.667755",
"0.66756433",
"0.6667425",
"0.66667783",
"0.6665166",
"0.66614723",
"0.66549766",
"0.665031",
"0.6643759",
"0.6639389",
"0.66378653",
"0.66345453",
"0.6626348"... | 0.0 | -1 |
TODO Autogenerated method stub | public List<DocDownloadForm> allActiveUsers(long compid, DataSource dataSource)
{
return impl.allActiveUsers(compid,dataSource);
} | {
"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 List<DocDownloadForm> allDocList(DataSource dataSource)
{
return impl.allDocList(dataSource);
} | {
"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 |
checks if item present in db, fetch if not present from catalog | public Future<Map<String, UUID>> checkReqItems(Map<String, List<String>> request, String userId) {
Promise<Map<String, UUID>> p = Promise.promise();
if (request.containsKey(RES_SERVER)) {
List<String> servers = request.get(RES_SERVER);
if (servers.isEmpty()) {
p.fail(BAD_REQUEST);
return p.future();
}
Future<Map<String, UUID>> checkSer = checkResSer(servers, userId);
checkSer
.onSuccess(
obj -> {
servers.removeAll(obj.keySet());
if (!servers.isEmpty()) p.fail(SERVER_NOT_PRESENT + servers.toString());
else p.complete(obj);
})
.onFailure(failHandler -> p.fail(failHandler.getLocalizedMessage()));
} else {
Future<Map<String, List<String>>> resources = checkResExist(request);
Future<List<JsonObject>> fetchItem =
resources.compose(
obj -> {
if (obj.size() == 0) return Future.succeededFuture(new ArrayList<JsonObject>());
else return fetch(obj);
});
Future<Boolean> insertItems =
fetchItem.compose(
toInsert -> {
if (toInsert.size() == 0) return Future.succeededFuture(true);
else return insertItemToDb(toInsert);
});
Future<Map<String, UUID>> resDetails =
insertItems.compose(
obj -> {
if (request.containsKey(RES)) return getResDetails(request.get(RES));
return Future.succeededFuture(new HashMap<>());
});
Future<Map<String, UUID>> resGrpDetails =
insertItems.compose(
obj -> {
if (request.containsKey(RES_GRP)) return getResGrpDetails(request.get(RES_GRP));
return Future.succeededFuture(new HashMap<>());
});
Map<String, UUID> result = new HashMap<>();
CompositeFuture.all(resDetails, resGrpDetails)
.onSuccess(
success -> {
if (!resDetails.result().isEmpty()) result.putAll(resDetails.result());
if (!resGrpDetails.result().isEmpty()) result.putAll(resGrpDetails.result());
p.complete(result);
})
.onFailure(failHandler -> p.fail(failHandler.getLocalizedMessage()));
}
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected boolean itemExists() {\n\t\treturn false;\n\t}",
"public boolean isItemExist(String item)\n {\n boolean uExist = true;\n Connection conn = DatabaseConnection.getConnection();\n PreparedStatement pss;\n ResultSet rss;\n \n try {\n pss... | [
"0.6277255",
"0.5892201",
"0.5829589",
"0.5817284",
"0.5814188",
"0.5812649",
"0.57595545",
"0.57595545",
"0.57595545",
"0.57595545",
"0.57595545",
"0.57595545",
"0.57595545",
"0.5574329",
"0.5547966",
"0.5543233",
"0.55325335",
"0.5504644",
"0.55042046",
"0.54998124",
"0.549... | 0.0 | -1 |
checks if resource item/ resource groups present in db | public Future<Map<String, List<String>>> checkResExist(Map<String, List<String>> request) {
Promise<Map<String, List<String>>> p = Promise.promise();
Future<List<String>> resGrp;
Future<List<String>> resItem;
if (request.containsKey(RES_GRP)) {
List<String> resGrpIds = request.get(RES_GRP);
resGrp = checkResGrp(resGrpIds);
} else resGrp = Future.succeededFuture(new ArrayList<String>());
if (request.containsKey(RES)) {
List<String> resIds = request.get(RES);
resItem = checkResource(resIds);
} else resItem = Future.succeededFuture(new ArrayList<String>());
CompositeFuture.all(resGrp, resItem)
.onSuccess(
obj -> {
Map<String, List<String>> resp = new HashMap<>();
if (!resGrp.result().isEmpty()) resp.put(RES_GRP, resGrp.result());
if (!resItem.result().isEmpty()) resp.put(RES, resItem.result());
p.complete(resp);
})
.onFailure(fail -> p.fail(INTERNALERROR));
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static boolean rscInGroup(IResourceGroup group,\n AbstractVizResource<?, ?> resource) {\n\n for (ResourcePair pair : group.getResourceList()) {\n if (pair.getResource() == resource) {\n return true;\n }\n AbstractResourceData resourceData = ... | [
"0.60626525",
"0.59616303",
"0.5848859",
"0.57919097",
"0.5696038",
"0.56718206",
"0.56591624",
"0.56579536",
"0.5597511",
"0.5578953",
"0.5543021",
"0.55429703",
"0.553296",
"0.55238456",
"0.5522965",
"0.5521599",
"0.5507202",
"0.5492875",
"0.5488757",
"0.54137355",
"0.53940... | 0.5328131 | 35 |
Verify if resource groups are present in db | public Future<List<String>> checkResGrp(List<String> resGrpList) {
Promise<List<String>> p = Promise.promise();
Collector<Row, ?, List<String>> catIdCollector =
Collectors.mapping(row -> row.getString(CAT_ID), Collectors.toList());
try {
if (resGrpList.isEmpty()) {
p.complete(new ArrayList<>());
return p.future();
}
pool.withConnection(
conn ->
conn.preparedQuery(CHECKRESGRP)
.collecting(catIdCollector)
.execute(Tuple.of(resGrpList.toArray(String[]::new)))
.onFailure(
obj -> {
LOGGER.error("checkResGrp db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
})
.onSuccess(
success -> {
List<String> validItems = success.value();
List<String> invalid =
resGrpList.stream()
.filter(item -> !validItems.contains(item))
.collect(Collectors.toList());
p.complete(invalid);
}));
} catch (Exception e) {
LOGGER.error("Fail checkResGrp : " + e.toString());
p.fail(INTERNALERROR);
}
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n void validateUserGroupExist(){\n\n Boolean testing_result = true;\n int issue_id = 0;\n String issue_group = \"\";\n\n ArrayList<String> groups = new ArrayList<>();\n groups.add(\"admin\");\n groups.add(\"concordia\");\n groups.add(\"encs\");\n gro... | [
"0.6716173",
"0.65076673",
"0.64064324",
"0.6294142",
"0.61625236",
"0.60891527",
"0.60532147",
"0.5938953",
"0.58909625",
"0.5887874",
"0.58204275",
"0.5818385",
"0.5788526",
"0.57744944",
"0.5764792",
"0.57500714",
"0.5745722",
"0.5728841",
"0.5715754",
"0.57116264",
"0.569... | 0.5845058 | 10 |
Verify if resource items are present in db | public Future<List<String>> checkResource(List<String> resourceList) {
Promise<List<String>> p = Promise.promise();
Collector<Row, ?, List<String>> catIdCollector =
Collectors.mapping(row -> row.getString("cat_id"), Collectors.toList());
try {
if (resourceList.isEmpty()) {
p.complete(new ArrayList<>());
return p.future();
}
pool.withConnection(
conn ->
conn.preparedQuery(GET_RES_DETAILS)
.collecting(catIdCollector)
.execute(Tuple.of(resourceList.toArray(String[]::new)))
.onFailure(
obj -> {
LOGGER.error("checkResource db fail :: " + obj.getLocalizedMessage());
p.fail("internal error");
})
.onSuccess(
success -> {
List<String> validItems = success.value();
List<String> invalid =
resourceList.stream()
.filter(item -> !validItems.contains(item))
.collect(Collectors.toList());
p.complete(invalid);
}));
} catch (Exception e) {
LOGGER.error("Fail: " + e.toString());
p.fail("internal error");
}
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void checkNotExistingItems() {\n Item actualItem;\n //non existing items\n actualItem = mDaoToTest.getItem(mContext, -123423);\n assertNull(\"Item not null\", actualItem);\n actualItem = mDaoToTest.getItem(mContext, RainbowBaseContentProviderDao.NOT_FOUND);\n ass... | [
"0.64944136",
"0.6417384",
"0.63076454",
"0.6195153",
"0.60966116",
"0.608772",
"0.5997309",
"0.5997309",
"0.5997309",
"0.5997309",
"0.5997309",
"0.5997309",
"0.5997309",
"0.58828646",
"0.5778598",
"0.5777361",
"0.5775327",
"0.57699203",
"0.5765151",
"0.5746788",
"0.57415587"... | 0.5816128 | 14 |
Verify if server present in db | public Future<Map<String, UUID>> checkResSer(List<String> req, String userId) {
Promise<Map<String, UUID>> p = Promise.promise();
if (req.isEmpty()) {
p.complete(new HashMap<>());
return p.future();
}
Collector<Row, ?, Map<String, UUID>> nameCollector =
Collectors.toMap(row -> row.getString(CAT_ID), row -> row.getUUID(ID));
pool.withConnection(
conn ->
conn.preparedQuery(CHECK_RES_SER)
.collecting(nameCollector)
.execute(
Tuple.of(UUID.fromString(userId)).addArrayOfString(req.toArray(String[]::new)))
.onFailure(
obj -> {
LOGGER.error("checkResSer db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
})
.onSuccess(
success -> {
Map<String, UUID> servers = success.value();
if (servers.isEmpty()) p.fail(SERVER_NOT_PRESENT + req.get(0));
else p.complete(servers);
}));
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasServer();",
"boolean hasServerId();",
"public boolean hasServer(Identity identity);",
"private boolean checkServer(Context mContext) {\n\t\t\t\tConnectivityManager cm = (ConnectivityManager) mContext\n\t\t\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\t\tNetworkInfo netInfo = cm.ge... | [
"0.7505142",
"0.7073974",
"0.70469725",
"0.68158144",
"0.6697003",
"0.6352134",
"0.63238007",
"0.63238007",
"0.6230169",
"0.62173325",
"0.61491495",
"0.614818",
"0.61319596",
"0.6109171",
"0.61074334",
"0.61071384",
"0.6106",
"0.6094537",
"0.6091442",
"0.6080411",
"0.6019",
... | 0.0 | -1 |
get itemid for list of cat_ids | public Future<Map<String, UUID>> getResDetails(List<String> resourceList) {
Promise<Map<String, UUID>> p = Promise.promise();
Collector<Row, ?, Map<String, UUID>> catIdCollector =
Collectors.toMap(row -> row.getString(CAT_ID), row -> row.getUUID(ID));
try {
if (resourceList.isEmpty()) {
p.complete(new HashMap<>());
return p.future();
} else {
pool.withConnection(
conn ->
conn.preparedQuery(GET_RES_DETAILS)
.collecting(catIdCollector)
.execute(Tuple.of(resourceList.toArray(String[]::new)))
.onFailure(
obj -> {
LOGGER.error("checkResource db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
})
.onSuccess(
success -> {
p.complete(success.value());
}));
}
} catch (Exception e) {
LOGGER.error("Fail getResDetails: ");
p.fail(INTERNALERROR);
}
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getID(Object item);",
"int getCategoryID(Vector<Integer> categoryIDs, Vector<String> categoryCodes,String cellValue);",
"public ArrayList<String> getCourseIdsByCat(String category) {\n ArrayList<String> courseIdsByCat = new ArrayList<>(); \r\n for(int i=0; i < courses.size(); i++) {\r\n ... | [
"0.61532",
"0.6012077",
"0.5901066",
"0.576373",
"0.5618612",
"0.5602608",
"0.534485",
"0.5336802",
"0.53153735",
"0.5285608",
"0.5234747",
"0.52323383",
"0.5199333",
"0.51838773",
"0.517396",
"0.5162501",
"0.5154596",
"0.51438004",
"0.5132456",
"0.5117986",
"0.5115537",
"0... | 0.0 | -1 |
get itemid for list of cat_ids | public Future<Map<String, UUID>> getResGrpDetails(List<String> resGrpList) {
Promise<Map<String, UUID>> p = Promise.promise();
Collector<Row, ?, Map<String, UUID>> catIdCollector =
Collectors.toMap(row -> row.getString("cat_id"), row -> row.getUUID("id"));
try {
if (resGrpList.isEmpty()) {
p.complete(new HashMap<>());
return p.future();
}
pool.withConnection(
conn ->
conn.preparedQuery(GET_RES_GRP_DETAILS)
.collecting(catIdCollector)
.execute(Tuple.of(resGrpList.toArray(String[]::new)))
.onFailure(
obj -> {
LOGGER.error("getResGrpDetails db fail :: " + obj.getLocalizedMessage());
p.fail("internal error");
})
.onSuccess(
success -> {
p.complete(success.value());
}));
} catch (Exception e) {
LOGGER.error("Fail: " + e.toString());
p.fail("internal error");
}
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getID(Object item);",
"int getCategoryID(Vector<Integer> categoryIDs, Vector<String> categoryCodes,String cellValue);",
"public ArrayList<String> getCourseIdsByCat(String category) {\n ArrayList<String> courseIdsByCat = new ArrayList<>(); \r\n for(int i=0; i < courses.size(); i++) {\r\n ... | [
"0.6153433",
"0.60113084",
"0.59008026",
"0.57632047",
"0.5618047",
"0.5601322",
"0.5343096",
"0.5338092",
"0.531651",
"0.52854156",
"0.5235654",
"0.52331054",
"0.51952404",
"0.5183304",
"0.51737577",
"0.516365",
"0.515277",
"0.5142901",
"0.5130952",
"0.5120431",
"0.51135534"... | 0.0 | -1 |
get list of items from catalogue server | private Future<List<JsonObject>> fetch(Map<String, List<String>> request) {
Promise<List<JsonObject>> p = Promise.promise();
List<String> resIds = new ArrayList<>();
if (request.containsKey(RES)) {
resIds.addAll(request.get(RES));
// get resGrpId from resID
resIds.addAll(
resIds.stream()
.map(e -> e.split("/"))
.map(obj -> obj[0] + "/" + obj[1] + "/" + obj[2] + "/" + obj[3])
.collect(Collectors.toList()));
}
if (request.containsKey(RES_GRP)) resIds.addAll(request.get(RES_GRP));
List<String> distinctRes = resIds.stream().distinct().collect(Collectors.toList());
List<Future> fetchFutures =
distinctRes.stream().map(this::fetchItem).collect(Collectors.toList());
CompositeFuture.all(fetchFutures)
.onSuccess(
successHandler -> {
p.complete(
fetchFutures.stream()
.map(x -> (JsonObject) x.result())
.collect(Collectors.toList()));
})
.onFailure(
failureHandler -> {
p.fail(failureHandler);
});
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<CatalogItem> getAllCatalogItems();",
"@RequestMapping(method = RequestMethod.GET)\n\tpublic ResponseEntity<?> getCatalogItems() {\n\t\tBraveSpanContext openTracingContext = getTracingContext();\n\t\tio.opentracing.Span span = tracer.buildSpan(\"GetCatalogFromService\").asChildOf(openTracingContext)\n\t\t\t\... | [
"0.79608226",
"0.74481475",
"0.73677844",
"0.6989684",
"0.67977077",
"0.6795701",
"0.6783124",
"0.66968215",
"0.66400886",
"0.66042966",
"0.6581097",
"0.63649726",
"0.6360525",
"0.6354398",
"0.6336861",
"0.6326319",
"0.6322874",
"0.6309341",
"0.6281849",
"0.6276583",
"0.62733... | 0.0 | -1 |
get item from catalogue server | private Future<JsonObject> fetchItem(String id) {
Promise<JsonObject> p = Promise.promise();
client
.get(catPort, catHost, catItemPath)
.addQueryParam(ID, id)
.send()
.onFailure(
ar -> {
ar.printStackTrace();
p.fail(INTERNALERROR);
})
.onSuccess(
obj -> {
JsonObject res = obj.bodyAsJsonObject();
if (obj.statusCode() == 200)
{
if (res.getString(STATUS).equals(status.SUCCESS.toString().toLowerCase()))
p.complete(obj.bodyAsJsonObject().getJsonArray(RESULTS).getJsonObject(0));
}
else{
if (obj.statusCode() == 404)
p.fail(ITEMNOTFOUND + id);
else{
LOGGER.error("failed fetchItem: " + res);
p.fail(INTERNALERROR);
}
}
});
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"CatalogItem getCatalogItemByName(String name);",
"CatalogItem getItembyId(final Long id);",
"@Test\n public void getCatalogItemTest() throws ApiException {\n String asin = null;\n List<String> marketplaceIds = null;\n List<String> includedData = null;\n String locale = null;\n ... | [
"0.69724363",
"0.68679243",
"0.6859262",
"0.6818591",
"0.66364294",
"0.63924694",
"0.62657267",
"0.62655",
"0.6253712",
"0.6226122",
"0.62160844",
"0.62157124",
"0.6179127",
"0.6150853",
"0.61167467",
"0.60665876",
"0.60343975",
"0.602377",
"0.6010073",
"0.5946806",
"0.590967... | 0.6628261 | 5 |
Insert item into resource/resource_group tables | private Future<Boolean> insertItemToDb(List<JsonObject> request) {
Promise<Boolean> p = Promise.promise();
// stream list of Json request to get list of resource groups,id,.resource server
List<JsonObject> resGrps =
request.stream()
.filter(obj -> obj.getJsonArray(TYPE).contains(IUDX_RES_GRP))
.collect(Collectors.toList());
List<String> emailSHA =
resGrps.stream().map(e -> e.getString(PROVIDER)).collect(Collectors.toList());
// stream resGrps to get list of ResourceServers, parse to get url of server, check for
// file/video, use to get resource server id
// TODO
// changing video and file server (.iudx.org.in) to resource server
ListIterator<JsonObject> obj = resGrps.listIterator();
Map<String, String> resUrlMap = new HashMap<>();
while (obj.hasNext()) {
String server = obj.next().getString(RESOURCE_SERVER);
String url = server.split("/")[2];
String[] urlSplit = url.split("\\.", 2);
if (!urlSplit[0].equals("catalogue") && urlSplit[1].equals(domain)) url = resUrl;
resUrlMap.put(server, url);
}
Collector<Row, ?, Map<String, UUID>> collector =
Collectors.toMap(row -> row.getString(URL), row -> row.getUUID(ID));
Future<Map<String, UUID>> resSerId =
pool.withConnection(
conn ->
conn.preparedQuery(GET_RES_SER_ID)
.collecting(collector)
.execute(Tuple.of(resUrlMap.values().toArray()))
.map(SqlResult::value));
Collector<Row, ?, Map<String, UUID>> providerId =
Collectors.toMap(row -> row.getString(EMAIL_HASH), row -> row.getUUID(ID));
Future<Map<String, UUID>> emailHash =
pool.withConnection(
conn ->
conn.preparedQuery(GET_PROVIDER_ID)
.collecting(providerId)
.execute(Tuple.of(emailSHA.toArray()))
.map(SqlResult::value));
Future<List<Tuple>> item =
CompositeFuture.all(resSerId, emailHash)
.compose(
ar -> {
if (emailHash.result() == null || emailHash.result().isEmpty())
return Future.failedFuture(PROVIDER_NOT_REGISTERED);
List<Tuple> tuples = new ArrayList<>();
for (JsonObject jsonObject : resGrps) {
String id = jsonObject.getString(ID);
UUID pid = emailHash.result().get(jsonObject.getString(PROVIDER));
String resServer = jsonObject.getString(RESOURCE_SERVER);
String url = resUrlMap.get(resServer);
UUID serverId = resSerId.result().get(url);
tuples.add(Tuple.of(id, pid, serverId));
}
return Future.succeededFuture(tuples);
});
// create tuple for resource group insertion // not if empty
Future<Void> resGrpEntry =
item.compose(
success -> {
if (success.size() == 0) {
LOGGER.error("failed resGrpEntry: " + "No res groups to enter");
return Future.failedFuture(INTERNALERROR);
}
return pool.withTransaction(
conn -> conn.preparedQuery(INSERT_RES_GRP).executeBatch(success).mapEmpty());
});
List<JsonObject> res =
request.stream()
.filter(arr -> arr.getJsonArray(TYPE).contains(IUDX_RES))
.collect(Collectors.toList());
List<String> resGrpId =
res.stream().map(e -> e.getString(RESOURCE_GROUP)).collect(Collectors.toList());
Future<Map<String, JsonObject>> resourceItemDetails =
resGrpEntry.compose(
ar -> {
Collector<Row, ?, Map<String, JsonObject>> mapCollector =
Collectors.toMap(
row -> row.getString(CAT_ID),
row ->
new JsonObject()
.put(ID, row.getUUID(ID))
.put(PROVIDER_ID, row.getUUID(PROVIDER_ID))
.put(RESOURCE_SERVER_ID, row.getUUID(RESOURCE_SERVER_ID)));
// get map of resid , jsonobj by using data from resource_group table
return pool.withConnection(
conn ->
conn.preparedQuery(GET_RES_SER_DETAIL)
.collecting(mapCollector)
.execute(Tuple.of(resGrpId.toArray()))
.map(map -> map.value()));
});
Future<List<Tuple>> resources =
resourceItemDetails.compose(
x -> {
List<Tuple> tuples = new ArrayList<>();
for (JsonObject jsonObject : res) {
String id = jsonObject.getString(RESOURCE_GROUP);
String cat_id = jsonObject.getString(ID);
UUID pId = UUID.fromString(x.get(id).getString(PROVIDER_ID));
UUID rSerId = UUID.fromString(x.get(id).getString(RESOURCE_SERVER_ID));
UUID rId = UUID.fromString(x.get(id).getString(ID));
tuples.add(Tuple.of(cat_id, pId, rSerId, rId));
}
return Future.succeededFuture(tuples);
});
resources
.compose(
success -> {
return pool.withTransaction(
conn -> conn.preparedQuery(INSERT_RES).executeBatch(success).mapEmpty());
})
.onFailure(
failureHandler -> {
failureHandler.printStackTrace();
p.fail(failureHandler.getLocalizedMessage());
})
.onSuccess(success -> p.complete(true));
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int insert(RoleResource record);",
"int insert(DBPublicResources record);",
"int insert(TUserResources record);",
"int insert(CmGroupRelIndustry record);",
"int insert(PolicyGroup record);",
"int insertSelective(RoleResource record);",
"int insertSelective(DBPublicResources record);",
"int insert(Res... | [
"0.6138235",
"0.596788",
"0.5914515",
"0.58944637",
"0.58362657",
"0.57672334",
"0.57114124",
"0.56496835",
"0.56453335",
"0.5633543",
"0.558742",
"0.55751294",
"0.55076784",
"0.54955304",
"0.54808766",
"0.5473114",
"0.54710346",
"0.54400975",
"0.5429817",
"0.5412651",
"0.540... | 0.5482222 | 14 |
checks if for user owns the resource | public Future<List<UUID>> checkOwner(Map<String, List<String>> req, String userId) {
Promise<List<UUID>> p = Promise.promise();
Future<List<UUID>> resGrp;
Future<List<UUID>> resItem;
if (req.containsKey(RES_GRP)) {
List<String> resGrpIds = req.get(RES_GRP);
resGrp = resGrpOwner(resGrpIds, userId);
} else resGrp = Future.succeededFuture(new ArrayList<>());
if (req.containsKey(RES)) {
List<String> resIds = req.get(RES);
resItem = resOwner(resIds, userId);
} else resItem = Future.succeededFuture(new ArrayList<>());
CompositeFuture.all(resGrp, resItem)
.onSuccess(
obj -> {
List<UUID> resp = new ArrayList<>();
if (!resGrp.result().isEmpty()) resp.addAll(resGrp.result());
if (!resItem.result().isEmpty()) resp.addAll(resItem.result());
p.complete(resp);
})
.onFailure(fail -> p.fail(INTERNALERROR));
// return map of res_id,iowners in place of user id
// check if userid is delegate for any of these owners
// compose
// check if user id is an active delegate of all of the owner ids for resource
// return list of not delegate
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasObjUser();",
"public boolean hasObjUser() {\n return objUser_ != null;\n }",
"private boolean checkAppInstanceOwnership(){\n\n\t\ttry {\n\t\t\t\n\t\t\t\n\t \tif(getUser() != null){\n\t \t\t\n\t \t\tif(getUser().getRole().equalsIgnoreCase(UserRoles.admin.toString()))\n\t \... | [
"0.63823396",
"0.6328504",
"0.6294588",
"0.6233902",
"0.6132485",
"0.6123802",
"0.6120912",
"0.6110282",
"0.6100721",
"0.60578775",
"0.6020685",
"0.5970698",
"0.5967783",
"0.5967783",
"0.59602845",
"0.59308034",
"0.59235865",
"0.58927435",
"0.58927435",
"0.58927435",
"0.58927... | 0.0 | -1 |
checks if for user owns the resource_groups | public Future<List<UUID>> resGrpOwner(List<String> ids, String userId) {
Promise<List<UUID>> p = Promise.promise();
Collector<Row, ?, List<UUID>> providerIdCollector =
Collectors.mapping(row -> row.getUUID(PROVIDER_ID), Collectors.toList());
pool.withConnection(
conn ->
conn.preparedQuery(RES_GRP_OWNER)
.collecting(providerIdCollector)
.execute(
Tuple.of(UUID.fromString(userId)).addArrayOfString(ids.toArray(String[]::new)))
.onFailure(
obj -> {
LOGGER.error("resGrpOwner db fail :: " + obj.getLocalizedMessage());
obj.printStackTrace();
p.fail(INTERNALERROR);
})
.onSuccess(
success -> {
p.complete(success.value());
}));
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasUserManaged();",
"@Override\n public boolean isOwner(String groupingPath, String username) {\n return isMember(groupingPath + OWNERS, username);\n }",
"@Test\n public void ownerArgumentNotAddedIfOwnerIsInGroupWithUserPools() throws AmplifyException {\n final AuthorizationType ... | [
"0.5894318",
"0.5801058",
"0.5673422",
"0.5610296",
"0.5585894",
"0.5500463",
"0.54556257",
"0.5437542",
"0.54335564",
"0.54328614",
"0.5427593",
"0.54263407",
"0.5416047",
"0.5406893",
"0.5386426",
"0.53794044",
"0.53714055",
"0.5365988",
"0.5363266",
"0.5347654",
"0.5345159... | 0.0 | -1 |
checks if for user owns the resource_groups | public Future<List<UUID>> resOwner(List<String> ids, String userId) {
Promise<List<UUID>> p = Promise.promise();
Collector<Row, ?, List<UUID>> providerIdCollector =
Collectors.mapping(row -> row.getUUID(PROVIDER_ID), Collectors.toList());
pool.withConnection(
conn ->
conn.preparedQuery(RES_OWNER)
.collecting(providerIdCollector)
.execute(
Tuple.of(UUID.fromString(userId)).addArrayOfString(ids.toArray(String[]::new)))
.onFailure(
obj -> {
LOGGER.error("resOwner db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
})
.onSuccess(
success -> {
p.complete(success.value());
}));
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasUserManaged();",
"@Override\n public boolean isOwner(String groupingPath, String username) {\n return isMember(groupingPath + OWNERS, username);\n }",
"@Test\n public void ownerArgumentNotAddedIfOwnerIsInGroupWithUserPools() throws AmplifyException {\n final AuthorizationType ... | [
"0.5894318",
"0.5801058",
"0.5673422",
"0.5610296",
"0.5585894",
"0.5500463",
"0.54556257",
"0.5437542",
"0.54335564",
"0.54328614",
"0.5427593",
"0.54263407",
"0.5416047",
"0.5406893",
"0.5386426",
"0.53794044",
"0.53714055",
"0.5365988",
"0.5363266",
"0.5347654",
"0.5345159... | 0.0 | -1 |
checks if for user is a delegate for any of a list of users | public Future<List<UUID>> checkDelegate(List<UUID> provider_ids, String userId) {
Promise<List<UUID>> p = Promise.promise();
Collector<Row, ?, List<UUID>> idCollector =
Collectors.mapping(row -> row.getUUID(ID), Collectors.toList());
try {
pool.withConnection(
conn ->
conn.preparedQuery(CHECK_DELEGATION)
.collecting(idCollector)
.execute(
Tuple.of(authUrl, UUID.fromString(userId))
.addArrayOfUUID(provider_ids.toArray(UUID[]::new)))
.onSuccess(obj -> p.complete(obj.value()))
.onFailure(
obj -> {
LOGGER.error("checkDelegate db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
}));
} catch (Exception e) {
LOGGER.error("Fail checkDelegate:" + e.toString());
p.fail(INTERNALERROR);
}
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isFollowing(User user, String target)\n{\n \n DefaultListModel following = user.getFollowings();\n if (following.contains(target))\n {\n return true;\n }\n return false;\n}",
"private static Boolean isUserACollaborator(User checkedUser, Tasky_Collaborator__c[] collaborators) {\n ... | [
"0.59779394",
"0.58174926",
"0.5807003",
"0.5803623",
"0.57652324",
"0.5728692",
"0.5685535",
"0.56094897",
"0.5595174",
"0.54205036",
"0.5376576",
"0.53709686",
"0.53709686",
"0.53709686",
"0.53345203",
"0.5334326",
"0.53268355",
"0.5278198",
"0.5270513",
"0.52702683",
"0.52... | 0.56100994 | 7 |
checks if resource item/ resource groups present in db | public Future<Map<String, UUID>> getOwnerId(Map<String, List<String>> request) {
Promise<Map<String, UUID>> p = Promise.promise();
Future<Map<String, UUID>> resGrp;
Future<Map<String, UUID>> resItem;
/* if(request.containsKey(RES_SERVER))
{
List<String> resSerIds = request.get(RES_SERVER);
Future<Map<String,UUID>> resSer = getResGrpOwners(resSerIds);
} else {*/
if (request.containsKey(RES_GRP)) {
List<String> resGrpIds = request.get(RES_GRP);
resGrp = getResGrpOwners(resGrpIds);
} else resGrp = Future.succeededFuture(new HashMap<>());
if (request.containsKey(RES)) {
List<String> resIds = request.get(RES);
resItem = getResOwners(resIds);
} else resItem = Future.succeededFuture(new HashMap<>());
CompositeFuture.all(resGrp, resItem)
.onSuccess(
obj -> {
Map<String, UUID> resp = new HashMap<>();
if (!resGrp.result().isEmpty()) resp.putAll(resGrp.result());
if (!resItem.result().isEmpty()) resp.putAll(resItem.result());
p.complete(resp);
})
.onFailure(fail -> p.fail(INTERNALERROR));
// }
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static boolean rscInGroup(IResourceGroup group,\n AbstractVizResource<?, ?> resource) {\n\n for (ResourcePair pair : group.getResourceList()) {\n if (pair.getResource() == resource) {\n return true;\n }\n AbstractResourceData resourceData = ... | [
"0.60597545",
"0.5959568",
"0.5848063",
"0.5790202",
"0.56942254",
"0.56694156",
"0.5657831",
"0.5655353",
"0.5597885",
"0.55766535",
"0.554223",
"0.55403733",
"0.5532502",
"0.5524109",
"0.55240345",
"0.55187345",
"0.5505507",
"0.54915303",
"0.5486895",
"0.54113364",
"0.53930... | 0.0 | -1 |
get owner_id for resource_group items | public Future<Map<String, UUID>> getResGrpOwners(List<String> resGrpId) {
Promise<Map<String, UUID>> p = Promise.promise();
Collector<Row, ?, Map<String, UUID>> ownerCollector =
Collectors.toMap(row -> row.getString(CAT_ID), row -> row.getUUID(PROVIDER_ID));
pool.withConnection(
conn ->
conn.preparedQuery(GET_RES_GRP_OWNER)
.collecting(ownerCollector)
.execute(Tuple.of(resGrpId.toArray()))
.onFailure(
obj -> {
LOGGER.error("getResGrpOwners db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
})
.onSuccess(
success -> {
p.complete(success.value());
}));
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic UUID getOwnerId() {\n\t\treturn this.dataManager.get(OWNER_UUID).orNull();\n\t}",
"int getOwnerID();",
"public Integer getOwnerId() {\n return ownerId;\n }",
"public String getOwnerId() {\n return ownerId;\n }",
"java.lang.String getOwner();",
"java.lang.String g... | [
"0.6816341",
"0.681396",
"0.6640363",
"0.661915",
"0.6523012",
"0.6523012",
"0.6447264",
"0.6446513",
"0.639084",
"0.6361947",
"0.6354002",
"0.63043755",
"0.6301358",
"0.62756974",
"0.6260875",
"0.62496066",
"0.62496066",
"0.61761534",
"0.6119737",
"0.6116363",
"0.6116363",
... | 0.0 | -1 |
get owner_id for resource items | public Future<Map<String, UUID>> getResOwners(List<String> resId) {
{
Promise<Map<String, UUID>> p = Promise.promise();
Collector<Row, ?, Map<String, UUID>> ownerCollector =
Collectors.toMap(row -> row.getString(CAT_ID), row -> row.getUUID(PROVIDER_ID));
pool.withConnection(
conn ->
conn.preparedQuery(GET_RES_OWNERS)
.collecting(ownerCollector)
.execute(Tuple.of(resId.toArray()))
.onFailure(
obj -> {
LOGGER.error("getResOwners db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
})
.onSuccess(
success -> {
p.complete(success.value());
}));
return p.future();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getOwnerID();",
"@Override\n\tpublic UUID getOwnerId() {\n\t\treturn this.dataManager.get(OWNER_UUID).orNull();\n\t}",
"public Integer getOwnerId() {\n return ownerId;\n }",
"public String getOwnerId() {\n return ownerId;\n }",
"long getOwnerIdLong();",
"public int getOwnerID() ... | [
"0.7313634",
"0.6985652",
"0.69363034",
"0.6903274",
"0.68300337",
"0.67219865",
"0.6698851",
"0.66915375",
"0.6690175",
"0.6690175",
"0.666285",
"0.6662611",
"0.665658",
"0.6571009",
"0.6490414",
"0.64867866",
"0.6440448",
"0.6440448",
"0.63549805",
"0.63549805",
"0.634824",... | 0.0 | -1 |
checks if there is a policy for user by auth admin | public Future<Boolean> checkAuthPolicy(String userId) {
Promise<Boolean> p = Promise.promise();
pool.withConnection(
conn ->
conn.preparedQuery(CHECK_AUTH_POLICY)
.execute(Tuple.of(userId, authUrl, status.ACTIVE))
.onFailure(
obj -> {
LOGGER.error("checkAuthPolicy db fail :: " + obj.getLocalizedMessage());
p.fail(INTERNALERROR);
})
.onSuccess(
obj -> {
if (obj.rowCount() > 0) p.complete(true);
else p.fail(NO_AUTH_POLICY);
}));
return p.future();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean checkPolicy(User user);",
"boolean existsAdminPreference(AuthenticationToken admin);",
"boolean isAdmin();",
"public boolean isAdmin();",
"private void checkUser() {\n\t\tlog.info(\"___________checkUser\");\n\t\tList<User> adminUser = userRepository.getByAuthority(AuthorityType.ROLE... | [
"0.7437705",
"0.69913816",
"0.6747886",
"0.65739965",
"0.6521026",
"0.64734995",
"0.6356319",
"0.6249673",
"0.6225645",
"0.6168201",
"0.609397",
"0.60524994",
"0.60319257",
"0.60271364",
"0.60247207",
"0.60136896",
"0.6007075",
"0.5997521",
"0.5994012",
"0.5992291",
"0.599229... | 0.5962609 | 21 |
Paint the marker on given gc and axes. | public void paint(final GC gc, final SWTMediaPool media, final Rectangle bounds, final AxisPart<XTYPE> xaxis) {
int x = xaxis.getScreenCoord(getPosition());
if (x >= bounds.x && x <= bounds.x + bounds.width) {
gc.setForeground(media.get(getColor()));
gc.setLineWidth(getLineWidth());
gc.drawLine(x, bounds.y, x, bounds.y + bounds.height);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void drawMarker(PGraphics pg, float x, float y)\n {\n pg.noFill();\n pg.rectMode(CENTER);\n pg.rect(x,y,this.radius*2,this.radius*2,10);\n }",
"public void drawMark(int x, int y, Color color)\n {\n \tg.setColor(color);\n g.fillRect(x * xScale, y * yScale, xScale-1, ySc... | [
"0.66770905",
"0.6501033",
"0.6471072",
"0.64073086",
"0.6139598",
"0.6052481",
"0.60003793",
"0.5927891",
"0.5889921",
"0.5879551",
"0.5844737",
"0.5838541",
"0.57924575",
"0.5763179",
"0.57376564",
"0.5737564",
"0.5716848",
"0.569406",
"0.56918836",
"0.5580149",
"0.5565182"... | 0.5409405 | 35 |
TODO Autogenerated method stub | private Node CreateTree() {
Scanner sc = new Scanner(System.in);
Queue<Node> q = new LinkedList<>();
int item = sc.nextInt();
Node nn = new Node();
nn.val = item;
root = nn;
q.add(nn);
while (!q.isEmpty()) {
Node rv = q.poll();
int c1 = sc.nextInt();
int c2 = sc.nextInt();
if (c1 != -1) {
Node node = new Node();
node.val = c1;
rv.left = node;
q.add(node);
}
if (c2 != -1) {
Node node = new Node();
node.val = c2;
rv.right = node;
q.add(node);
}
}
return root;
} | {
"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 |
Extracts the uuid from a uri. | private UUID uuidFromUri(URI uri) {
Pattern pairRegex = Pattern.compile("\\p{XDigit}{8}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{12}");
Matcher matcher = pairRegex.matcher(uri.toString());
String uuid = "";
while (matcher.find()) {
uuid = matcher.group(0);
}
return UUID.fromString(uuid);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getIdFromURI(final String uri) {\r\n\r\n if (uri == null) {\r\n return null;\r\n }\r\n Matcher matcher = PATTERN_GET_ID_FROM_URI_OR_FEDORA_ID.matcher(uri);\r\n if (matcher.find()) {\r\n return matcher.group(1);\r\n }\r\n else {\r\... | [
"0.6162363",
"0.5716308",
"0.56288207",
"0.55713326",
"0.5515482",
"0.5448422",
"0.54479945",
"0.544722",
"0.54058325",
"0.5385357",
"0.5316835",
"0.5316835",
"0.52020204",
"0.5170519",
"0.5065249",
"0.50624084",
"0.50115585",
"0.4993503",
"0.4958445",
"0.49574757",
"0.494123... | 0.830757 | 0 |
Constructor for a new Word implementation. | public WordImplementation(final ImmutableMap<Locale, Translation> translations) {
this.translations = Preconditions.checkNotNull(translations);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Word (String word) {\n\t\t// Call another constructor\n\t\tthis(word.length());\n\t\t// save the input word in this.theWord\n\t\tthis.theWord = word.toCharArray();\n\t}",
"public Word(String text) {\n\t\tsuper();\n\t\tthis.text = text;\n\t}",
"public DoubleWord(){\n\t\tsuper();\n\t}",
"public Word (St... | [
"0.8074713",
"0.8020374",
"0.77888304",
"0.76778233",
"0.7583799",
"0.7554693",
"0.7554693",
"0.7554693",
"0.7487913",
"0.7472887",
"0.74173874",
"0.7412295",
"0.7393112",
"0.7323908",
"0.7216839",
"0.72165525",
"0.7123403",
"0.7013357",
"0.7006024",
"0.69569266",
"0.6907954"... | 0.65886134 | 37 |
FOR SEEING AUTOWIRED WORKING | public SpeakerSerivceImpl() {
System.out.println("No args in constructor");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void mo4359a() {\n }",
"public void mo38117a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n ... | [
"0.6478603",
"0.6371431",
"0.6287896",
"0.6287896",
"0.6287896",
"0.6287896",
"0.6287896",
"0.6287896",
"0.6287896",
"0.62408674",
"0.62314636",
"0.61474353",
"0.6111699",
"0.6111699",
"0.6111699",
"0.6111699",
"0.6111699",
"0.6101653",
"0.60963196",
"0.6085081",
"0.60224926"... | 0.0 | -1 |
Create a signature as a point on the E1 curve. | BlsPoint sign(BigInteger privateKey, byte[] data); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getSignature();",
"String getSignature();",
"String getSignature();",
"SignatureIdentification createSignatureIdentification();",
"SignatureSource createSignatureSource();",
"ISModifySignature createISModifySignature();",
"Signature getSignature();",
"public abstract String getSignature();",
... | [
"0.6454586",
"0.6454586",
"0.6454586",
"0.63545877",
"0.6325937",
"0.62766826",
"0.62260187",
"0.6140679",
"0.59875196",
"0.595797",
"0.5943849",
"0.58015937",
"0.5796885",
"0.5794894",
"0.5794567",
"0.5791342",
"0.57665104",
"0.5766486",
"0.5670216",
"0.56698364",
"0.5662844... | 0.5130258 | 68 |
format 1230 = 12h30 | public Train(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String formatTime(long length) {\n\t\tString hms = \"\";\n\t\tif(length < 3600000) {\n\t\t\thms = String.format(\"%02d:%02d\",\n\t\t\t\t\tTimeUnit.MILLISECONDS.toMinutes(length) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(length)),\n\t\t\t\t\tTimeUnit.MILLISECONDS.toSeconds(length) - TimeUnit.... | [
"0.6501716",
"0.6402043",
"0.6366613",
"0.636131",
"0.6324584",
"0.6273941",
"0.6212636",
"0.6171613",
"0.61575186",
"0.6120437",
"0.60720766",
"0.6064707",
"0.6017692",
"0.6010606",
"0.6008996",
"0.5968568",
"0.5958964",
"0.5946261",
"0.5926803",
"0.5919578",
"0.5911836",
... | 0.0 | -1 |
Creates an empty marker file corresponding to storage writer path. | private void createMarkerFile(String partitionPath, String dataFileName) {
WriteMarkers writeMarkers = WriteMarkersFactory.get(writeConfig.getMarkersType(), table, instantTime);
writeMarkers.create(partitionPath, dataFileName, IOType.CREATE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createStorageFile() throws IoDukeException {\n PrintWriter writer = null;\n try {\n writer = getStorageFile();\n } catch (IOException e) {\n throw new IoDukeException(\"Error opening task file for reading\");\n } finally {\n if (writer != nul... | [
"0.6352825",
"0.5926979",
"0.5798716",
"0.5632999",
"0.548742",
"0.5440764",
"0.530832",
"0.52839476",
"0.51685786",
"0.5159995",
"0.5111541",
"0.5089324",
"0.508504",
"0.5079639",
"0.5067076",
"0.5035104",
"0.5007376",
"0.49819985",
"0.49656528",
"0.49512228",
"0.49428877",
... | 0.6193825 | 1 |
final File folder = new File("E:\\STUDY\\Advanced Computing Concepts\\Lab9\\Languages\\W3C Web Pages"); String[] _arrayOfFilesName = listFilesForFolder(folder); | public static void main(String[] args) throws IOException,FileNotFoundException,NullPointerException {
int _fileNumber = 1;
try {
File _directory = new File("C:\\Users\\Aayush\\Desktop\\Advance Computing Concepts\\W3C Web Pages");
File[] _fileArray = _directory.listFiles();
File[] _fileArray2 = new File[102];
int _numberOfFiles=0;
for(int _i=0;_i<(_fileArray.length);_i++)
{
if(_fileArray[_i].isFile())
{
_fileArray2[_numberOfFiles] = _fileArray[_i];
_numberOfFiles++;
}
}
for(int i=0;i<100;i++)
{
convertHtmlToText(_fileArray2[i],_fileNumber);
_fileNumber = _fileNumber + 1;
}
} catch (Exception e) {
System.out.println("Exception:"+e);
}
finally
{
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String[] getFileNames() {\n\t\tFile directory = new File(this.getClass().getClassLoader()\n\t\t\t\t.getResource(\"data\").getFile());\n\t\tList<String> fileNames = new ArrayList<String>();\n\n\t\tfor (File file : directory.listFiles())\n\t\t\tfileNames.add(file.getName());\n\n\t\treturn fileNames.toArray(n... | [
"0.75718445",
"0.7301997",
"0.7295691",
"0.7223733",
"0.7216682",
"0.7191931",
"0.71686405",
"0.70753056",
"0.7014147",
"0.70118797",
"0.69783205",
"0.69719803",
"0.69413507",
"0.69331074",
"0.69240093",
"0.6920463",
"0.6912139",
"0.6883332",
"0.6865604",
"0.68645126",
"0.682... | 0.0 | -1 |
Teen valmis ussi, toidu ja kujunduse. | private Parent content() {
// Kujundus.
BorderPane bp = new BorderPane();
Pane side = new Pane(controls);
side.getStyleClass().add("pane");
Pane window = new Pane();
window.setPrefSize(APP_W, APP_H);
window.getStyleClass().add("board");
bp.setCenter(window);
bp.setLeft(side);
Group snakeBody = new Group();
snake = snakeBody.getChildren();
points.setText("Points: " + punktid);
points.setTextFill(Color.WHITE);
points.setTranslateX(APP_W / 1.15);
points.setTranslateY(2);
controls.setTextFill(Color.WHITE);
Line rLine = new Line(APP_W, 0, APP_W, APP_H);
rLine.getStyleClass().add("line");
rLine.setStrokeWidth(5);
Line tLine = new Line(0, 0, APP_W, 0);
tLine.getStyleClass().add("line");
tLine.setStrokeWidth(5);
Line bLine = new Line(0, APP_H, APP_W, APP_H);
bLine.getStyleClass().add("line");
bLine.setStrokeWidth(5);
// Tekib toit.
Circle food = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5);
food.setFill(Color.CHARTREUSE);
food.setTranslateX((int) (Math.random() * (APP_W - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);
food.setTranslateY((int) (Math.random() * (APP_H - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);
Rfood = 1;
// Aja algus.
KeyFrame frame = new KeyFrame(Duration.seconds(0.1), event -> {
if (!running)
return;
// Kui ussi pikkus on 1 liigub ise edasi, kui 2 v�i enam v�tab
// viimase t�ki ja t�stab ette.
boolean toRemove = snake.size() > 1;
Node tail = toRemove ? snake.remove(snake.size() - 1) : snake.get(0);
// J�tan meelde ussi kordinaadid
double tailX = tail.getTranslateX();
double tailY = tail.getTranslateY();
// kuhu ja kuidas uss liigub iga suuna korral
switch (direction) {
case UP:
tail.setTranslateX(snake.get(0).getTranslateX());
tail.setTranslateY(snake.get(0).getTranslateY() - BLOCK_SIZE);
break;
case DOWN:
tail.setTranslateX(snake.get(0).getTranslateX());
tail.setTranslateY(snake.get(0).getTranslateY() + BLOCK_SIZE);
break;
case LEFT:
tail.setTranslateX(snake.get(0).getTranslateX() - BLOCK_SIZE);
tail.setTranslateY(snake.get(0).getTranslateY());
break;
case RIGHT:
tail.setTranslateX(snake.get(0).getTranslateX() + BLOCK_SIZE);
tail.setTranslateY(snake.get(0).getTranslateY());
break;
}
moved = true;
// Lisame tagasi �rav�etud t�ki
if (toRemove)
snake.add(0, tail);
// Kui uss vastu iseennast
for (Node part : snake) {
if (part != tail && tail.getTranslateX() == part.getTranslateX()
&& tail.getTranslateY() == part.getTranslateY()) {
stopGame();
over.setTextFill(Color.WHITE);
over.setText("GAME OVER !");
over.setTranslateX(APP_W / 2.5);
over.setTranslateY(APP_H / 4);
over.setVisible(true);
break;
}
// Kui uss l�heb vastu seina
if (tail.getTranslateX() < 0 || tail.getTranslateX() == APP_W || tail.getTranslateY() < 0
|| tail.getTranslateY() == APP_H) {
stopGame();
over.setTextFill(Color.WHITE);
over.setText("GAME OVER ! ");
over.setTranslateX(APP_W / 2.25);
over.setTranslateY(APP_H / 4);
over.setVisible(true);
break;
}
}
// Kui uss l�heb vastu boonus toitu
if (tail.getTranslateX() == bonus.getTranslateX() && tail.getTranslateY() == bonus.getTranslateY()) {
bonus.setVisible(false);
bonus.isVisible();
bonus.setDisable(true);
bonus.isDisable();
if (bonusFood == 1) {
punktid = punktid + 50;
points.setText("Points: " + punktid);
points.setTextFill(Color.WHITE);
points.setTranslateX(APP_W / 1.15);
Circle circ2 = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5, Color.WHITE);
circ2.setTranslateX(tailX);
circ2.setTranslateY(tailY);
Circle circ3 = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5, Color.WHITE);
circ3.setTranslateX(tailX);
circ3.setTranslateY(tailY);
snake.addAll(circ2, circ3);
bonusFood = 0;
Rfood = 1;
food.setVisible(true);
}
}
if (Rfood == 1) {
// Kui uss l�heb vastu tavalist toitu
if (tail.getTranslateX() == food.getTranslateX() && tail.getTranslateY() == food.getTranslateY()) {
food.setTranslateX((int) (Math.random() * (APP_W - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);
food.setTranslateY((int) (Math.random() * (APP_H - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);
punktid = punktid + 10;
points.setText("Points: " + punktid);
points.setTextFill(Color.WHITE);
points.setTranslateX(APP_W / 1.15);
points.setTranslateY(2);
Circle circ = new Circle(BLOCK_SIZE / 2, BLOCK_SIZE / 2, 5, Color.WHITE);
circ.setTranslateX(tailX);
circ.setTranslateY(tailY);
// Boonus toidu tekkimine
if (7 < (int) (Math.random() * 10)) {
Rfood = 0;
bonusFood = 1;
bonus.setVisible(true);
bonus.setDisable(false);
bonus.getStyleClass().add("bonus");
bonus.setTranslateX((int) (Math.random() * (APP_W - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);
bonus.setTranslateY((int) (Math.random() * (APP_H - BLOCK_SIZE) / BLOCK_SIZE) * BLOCK_SIZE);
food.setVisible(false);
food.isVisible();
}
snake.add(circ);
}
}
});
// Keyframe k�ib l�pmatult
timeline.getKeyFrames().add(frame);
timeline.setCycleCount(Timeline.INDEFINITE);
window.getChildren().addAll(bonus, food, snakeBody, points, over, rLine, tLine, bLine);
return bp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }",
"public void validerSaisie();",
"public void zapisUrok() {\r\n\r\n\t\taktualnyZostatok = getZostatok() * urokovaSadzba / 100;\r\n\t\tsetVkla... | [
"0.6805984",
"0.66040814",
"0.6594061",
"0.65894973",
"0.6543546",
"0.65216494",
"0.6494137",
"0.64932644",
"0.641487",
"0.6384663",
"0.63518804",
"0.6295488",
"0.62790555",
"0.62503856",
"0.6237463",
"0.6217388",
"0.61957073",
"0.6135661",
"0.6124717",
"0.6112308",
"0.610200... | 0.0 | -1 |
Created by xqy on 17/9/25. | public interface OuterBean {
void testRequired(User user);
void testRequiresNew(User user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final void mo51373a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"protected boolean func_70814_o() { return true; }",
"private void m50366E() {\n }",
"@Override\n public void perish() {\n \n }",
"public void mo38117a() {\n }",
"@Overrid... | [
"0.5996939",
"0.5931904",
"0.58599263",
"0.58556116",
"0.57597005",
"0.5725901",
"0.570835",
"0.5695918",
"0.5677161",
"0.5652634",
"0.5645874",
"0.56228465",
"0.56228465",
"0.55959713",
"0.55888295",
"0.5586134",
"0.55667144",
"0.556616",
"0.55656004",
"0.55358267",
"0.55197... | 0.0 | -1 |
/ Show the event types and user id's also showing a related query if there is one and also showing the amount of the transaction if it is applicable | public static void analyzeEventsQueriesAmounts() throws SQLException
{
Statement stat = conn.createStatement();
ResultSet result = stat.executeQuery("SELECT * FROM fraud.afm_fraudeventrecord;");
while (result.next())
{
String event = result.getString("eventType");
String user = result.getString("userId");
if (
(event.contains("LOAD"))
&& (user.equals("user40"))
){
System.out.print(new Date(result.getInt("timestamp")));
System.out.print(" User : " + user);
System.out.print(" Event : " + event);
String recordId = result.getString("fraudScoreRecordId");
if (recordId != null)
{
Statement stat2 = conn.createStatement();
ResultSet s = stat2.executeQuery("SELECT * FROM fraud.afm_fraudscorerecord where recordId='"+recordId+"';");
while (s.next())
{
System.out.print(" Query Type: " + s.getString("queryType"));
System.out.print(" Amount: " + s.getDouble("transactionAmount"));
}
}
System.out.println();
}
}
stat.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void signUpForEventReporter(int type) {\n switch (type) {\n case 1:\n System.out.println(\"Here are the available Events\");\n break;\n case 2:\n System.out.println(\"Please select one of the available eventID or print '0' to exit\");... | [
"0.5094317",
"0.5069046",
"0.5019887",
"0.49420005",
"0.48263052",
"0.4746721",
"0.47335175",
"0.47171542",
"0.46969768",
"0.4692665",
"0.46880808",
"0.4638181",
"0.4608274",
"0.45968094",
"0.45750904",
"0.45503977",
"0.45492795",
"0.45409834",
"0.45383558",
"0.44947818",
"0.... | 0.57660776 | 0 |
/ Shows the rules which have been triggered throughout the execution of the system... | public static void analyzeRuleComponentsQueries() throws SQLException
{
Statement stat = conn.createStatement();
ResultSet result = stat.executeQuery("SELECT * FROM fraud.afm_fraudscorerecord_afm_rulecomponentrecord");
while (result.next())
{
String queryId = result.getString("afm_fraudscorerecord_recordId");
String ruleId = result.getString("ruleComponentRecords_componentId");
Statement stat2 = conn.createStatement();
ResultSet s = stat2.executeQuery("SELECT * FROM fraud.afm_fraudscorerecord where recordId='"+queryId+"';");
while (s.next())
{
System.out.print(new Date(s.getInt("timestamp")));
System.out.print(" UserID: " +s.getString("userId"));
System.out.print(" Query Type: " + s.getString("queryType"));
//System.out.print(" Amount: " + s.getDouble("transactionAmount"));
}
ResultSet t = stat2.executeQuery("SELECT * FROM fraud.afm_rulecomponentrecord where componentId='"+ruleId+"';");
while (t.next())
{
System.out.print(" >>>>> Rule Name: " + t.getString("ruleLongName"));
//System.out.print(" Amount: " + s.getDouble("transactionAmount"));
}
System.out.println();
}
stat.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getRules();",
"public void showRules() {\r\n data.rulesFlag = true;\r\n setChanged();\r\n notifyObservers(data);\r\n data.rulesFlag = false;\r\n }",
"public void showRules(Application app){\n System.out.println(\"Here are your rules: \\n • GPA >= \" + app.getStand().get... | [
"0.69137365",
"0.6854226",
"0.68103844",
"0.6386362",
"0.62990683",
"0.6234735",
"0.62246704",
"0.622462",
"0.6114625",
"0.6060409",
"0.6040571",
"0.60001534",
"0.5946244",
"0.59404534",
"0.5919034",
"0.59171116",
"0.5882487",
"0.58676034",
"0.58373183",
"0.57999796",
"0.5779... | 0.5177994 | 68 |
/ Shows the actions which have been recommended throughout the execution of the system... the recommended action is the outcome of the whole chain rule...not of a single rule... | public static void analyzeRecommendedActionsQueries() throws SQLException
{
Statement stat = conn.createStatement();
ResultSet result = stat.executeQuery("SELECT * FROM fraud.afm_fraudscorerecord_afm_recommendedactionrecord");
while (result.next())
{
String queryId = result.getString("afm_fraudscorerecord_recordId");
String ruleId = result.getString("recommendedActionRecords_actionId");
Statement stat2 = conn.createStatement();
ResultSet s = stat2.executeQuery("SELECT * FROM fraud.afm_fraudscorerecord where recordId='"+queryId+"';");
while (s.next())
{
System.out.print(new Date(s.getInt("timestamp")));
System.out.print(" UserID: " +s.getString("userId"));
System.out.print(" Query Type: " + s.getString("queryType"));
//System.out.print(" Amount: " + s.getDouble("transactionAmount"));
}
ResultSet t = stat2.executeQuery("SELECT * FROM fraud.afm_recommendedactionrecord where actionId='"+ruleId+"';");
while (t.next())
{
System.out.print(" >>>>> Action Name: " + t.getString("recommendedAction"));
//System.out.print(" Amount: " + s.getDouble("transactionAmount"));
}
System.out.println();
}
stat.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doAction(\r\n\t\t\tAction_To_Choose action,\r\n\t\t\tGuideline_Action_Choices currentDecision,\r\n\t\t\tGuidelineInterpreter interpreter ){\r\n\n\t\tif (getrule_in_conditionValue() != null) {\n\t\t\tCriteria_Evaluation evaluation = HelperFunctions.dummyCriteriaEvaluation();\n\t\t\ttry {\n\t\t\t\tevalua... | [
"0.60562027",
"0.5970901",
"0.5904644",
"0.58883816",
"0.58261436",
"0.57819146",
"0.57774067",
"0.57314324",
"0.5665742",
"0.56622475",
"0.5659219",
"0.55612046",
"0.5535571",
"0.5521024",
"0.54636216",
"0.54480934",
"0.5431689",
"0.5404585",
"0.5393558",
"0.538096",
"0.5380... | 0.6615568 | 0 |
/ improved way to count paths with sum by keeping track of running sums from root for each node (O(N) time, O(N) space) | public static int countPathsWithSumWithHashMap(BinaryTreeNode<Integer> root, int sum) {
HashMap<Integer, Integer> runningSumsCount = new HashMap<>();
return countPathsWithSumWithHashMapHelper(root, sum, 0, runningSumsCount);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int pathSumFrom(TreeNode node, int sum){\n if(node == null){\n return 0;\n }\n if(node.val == sum){\n // if the val in node is equal to sum we have found a path (node only)\n // and we check if we can add more nodes to the left and the right\n ... | [
"0.7387367",
"0.7311666",
"0.7200986",
"0.7155743",
"0.69823086",
"0.6862201",
"0.68323356",
"0.68194926",
"0.6785727",
"0.6701513",
"0.6681145",
"0.65850246",
"0.6550014",
"0.6542001",
"0.653523",
"0.64852774",
"0.6457527",
"0.64546317",
"0.6430736",
"0.6412076",
"0.6406595"... | 0.7430472 | 0 |
Keys are Google file IDs | private GoogleUtils() {
try {
readClientConfig();
readRefreshToken();
httpTransport = GoogleNetHttpTransport.newTrustedTransport();
jsonFactory = JacksonFactory.getDefaultInstance();
driveService = this.getDriveService();
noteList = new LinkedHashMap<>();
imageList = new LinkedHashMap<>();
retrieveData(Extension.note, Parameter.LimitDriveNotes.getValueInt());
retrieveData(Extension.jpg, Parameter.LimitDriveNotes.getValueInt());
} catch (GeneralSecurityException | IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getKeyFilePath();",
"private String getFilenameForKey(String key) {\n\t\tint firstHalfLength = key.length() / 2;\n\t\tString localFilename = String.valueOf(key.substring(0, firstHalfLength)\n\t\t\t\t.hashCode());\n\t\tlocalFilename += String.valueOf(key.substring(firstHalfLength)\n\t\t\t\t.hashCode... | [
"0.65967655",
"0.6304495",
"0.6045456",
"0.6017307",
"0.590231",
"0.58857507",
"0.5726996",
"0.5654685",
"0.56466335",
"0.56466335",
"0.5597962",
"0.55618143",
"0.55169314",
"0.55106866",
"0.5483267",
"0.5478189",
"0.5472883",
"0.54604673",
"0.5445569",
"0.5440264",
"0.543424... | 0.0 | -1 |
if current user clicks the user's comments or their stuff | @Override
public void onClick(View v) {
int position = (Integer) v.getTag();
Object object = getItem(position);
UserRatingDataModel dataModel = (UserRatingDataModel) object;
switch(v.getId()){
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean didUserClick(){\n return userClick;\n }",
"public boolean isClicked() { return clicked; }",
"@Override\n public void onClick(View view) {\n if(myUid.equals(uid)){\n // show deletr dialog\n AlertDialog.Builder builder = new... | [
"0.6510374",
"0.61776733",
"0.6175666",
"0.6075119",
"0.604344",
"0.5952321",
"0.5893232",
"0.58544105",
"0.5849117",
"0.58400226",
"0.58348095",
"0.58008015",
"0.57262",
"0.57049376",
"0.5664615",
"0.56538683",
"0.5622491",
"0.562016",
"0.5595784",
"0.5592449",
"0.55817145",... | 0.0 | -1 |
get the data item for this position | @Override
public View getView(int position, View convertView, ViewGroup parent){
UserRatingDataModel dataModel = (UserRatingDataModel)getItem(position);
//check if an existing view is being reused
ViewHolder viewHolder;
final View result;
if(convertView == null){
viewHolder = new ViewHolder();
LayoutInflater inflater = LayoutInflater.from(getContext());
convertView = inflater.inflate(R.layout.layout_review_row,parent
,false);
viewHolder.userNameTextView = convertView.findViewById(R.id.username_textView);
viewHolder.commentTextView = convertView.findViewById(R.id.comment_textView);
viewHolder.userRatingBar = convertView.findViewById(R.id.user_ratingBar);
viewHolder.userProfilePicture = convertView.findViewById(R.id.profile_imageView);
result = convertView;
convertView.setTag(viewHolder);
}
else{
viewHolder = (ViewHolder)convertView.getTag();
result = convertView;
}
Animation animation = AnimationUtils.loadAnimation(mContext,(position>lastPosition)? R.anim.up_from_bottom: R.anim.down_from_top);
result.startAnimation(animation);
lastPosition = position;
viewHolder.userNameTextView.setText(dataModel.getUsername());
viewHolder.commentTextView.setText(dataModel.getComment());
viewHolder.userRatingBar.setNumStars((int)dataModel.getRating());
viewHolder.userRatingBar.setMax(5);
return convertView;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Item getData()\r\n\t{\r\n\t\treturn theItem;\r\n\t}",
"public E getData(int pos) {\n\t\tif (pos >= 0 && pos < dataSize()) {\n\t\t\treturn data.get(pos);\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n\t\tpublic Object getItem(int position) {\n\t\t\treturn mDatas.get(position);\n\t\t}",... | [
"0.76694506",
"0.7315351",
"0.726411",
"0.72308815",
"0.7181607",
"0.71761715",
"0.7135034",
"0.7135034",
"0.7135034",
"0.71338594",
"0.71194994",
"0.7116197",
"0.7105833",
"0.70824844",
"0.70824844",
"0.7038915",
"0.7038915",
"0.70100677",
"0.69966257",
"0.6902456",
"0.69011... | 0.0 | -1 |
Show icon for relaunching dialog | @Override
public void showFingerprintDialog(CharSequenceX pincode) {
mBinding.fingerprintLogo.setVisibility(View.VISIBLE);
mBinding.fingerprintLogo.setOnClickListener(v -> mViewModel.checkFingerprintStatus());
// Show dialog itself if not already showing
if (mFingerprintDialog == null && mViewModel.canShowFingerprintDialog()) {
mFingerprintDialog = FingerprintDialog.newInstance(pincode, FingerprintDialog.Stage.AUTHENTICATE);
mFingerprintDialog.setAuthCallback(new FingerprintDialog.FingerprintAuthCallback() {
@Override
public void onAuthenticated(CharSequenceX data) {
dismissFingerprintDialog();
mViewModel.loginWithDecryptedPin(data);
}
@Override
public void onCanceled() {
dismissFingerprintDialog();
showKeyboard();
}
});
mDelayHandler.postDelayed(() -> {
if (!isFinishing() && !mIsPaused) {
mFingerprintDialog.show(getSupportFragmentManager(), FingerprintDialog.TAG);
} else {
mFingerprintDialog = null;
}
}, 200);
hideKeyboard();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setIcon(Dialog dialog);",
"public void resetShellIcon() {\r\n\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tGDE.shell.setImage(SWTResourceManager.getImage(GDE.IS_MAC ? \"gde/resource/DataExplorer_MAC.png\" : \"gde/resource/DataExplorer.png\")); //$NON-NLS-1$ //$NON-NLS-2$... | [
"0.69290143",
"0.6596928",
"0.6596143",
"0.6480907",
"0.6378795",
"0.61609954",
"0.60920006",
"0.6062527",
"0.6045653",
"0.6027395",
"0.6010783",
"0.6005491",
"0.59953606",
"0.597883",
"0.5966458",
"0.5960479",
"0.5959439",
"0.59285915",
"0.5926189",
"0.59059465",
"0.59059465... | 0.0 | -1 |
Test for screen overlays before user enters PIN consume event | @Override
public boolean dispatchTouchEvent(MotionEvent event) {
return mViewModel.getAppUtil().detectObscuredWindow(this, event) || super.dispatchTouchEvent(event);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void check_displaysInputOverlay() {\n onView(withId(R.id.voiceInput))\n .check(matches(isDisplayed()));\n // the permission overlay should not\n onView(withId(R.id.voicePermission))\n .check(doesNotExist());\n }",
"void checkCurrentScreen();",
"prot... | [
"0.602509",
"0.5784681",
"0.5750928",
"0.5661613",
"0.5644148",
"0.56115276",
"0.55263203",
"0.5495755",
"0.54598045",
"0.5405888",
"0.53741676",
"0.5373327",
"0.53541523",
"0.5350797",
"0.5350797",
"0.5332403",
"0.5329848",
"0.5323085",
"0.53155994",
"0.53055316",
"0.5281406... | 0.0 | -1 |
An identifier with the intention of being globally unique. | @Schema(required = true, description = "An identifier with the intention of being globally unique. ")
public String getId() {
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getUniqueId();",
"String uniqueId();",
"private UniqueIdentifier(){\n\t\t\n\t}",
"String getUniqueID();",
"public String getUniqueID();",
"public String getUniqueID ( ) { return _uniqueID; }",
"@Override\n\tpublic native final String createUniqueId() /*-{\n // In order to force uid's to be do... | [
"0.7642663",
"0.7632102",
"0.7609607",
"0.75684726",
"0.7332398",
"0.72924423",
"0.7221237",
"0.71983284",
"0.7166887",
"0.7143184",
"0.71310735",
"0.70370036",
"0.70310867",
"0.7003024",
"0.6968177",
"0.6954913",
"0.6951806",
"0.6946664",
"0.69176143",
"0.6914219",
"0.688211... | 0.6646343 | 44 |
An identifier that is unique within a NS descriptor. Representation: string of variable length. | @Schema(required = true, description = "An identifier that is unique within a NS descriptor. Representation: string of variable length. ")
public String getVnffgdId() {
return vnffgdId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.String getIdentifier() {\n java.lang.Object ref = identifier_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = b... | [
"0.7280677",
"0.72733057",
"0.7230234",
"0.68796253",
"0.68629855",
"0.67322963",
"0.6724753",
"0.67064023",
"0.6673972",
"0.66669494",
"0.6628082",
"0.66093117",
"0.65946376",
"0.65516824",
"0.6531636",
"0.6525702",
"0.6519996",
"0.64915544",
"0.6486449",
"0.6449259",
"0.644... | 0.67416483 | 5 |
Identifier(s) of the constituent VNF instance(s) of this VNFFG instance. | @Schema(required = true, description = "Identifier(s) of the constituent VNF instance(s) of this VNFFG instance. ")
public List<String> getVnfInstanceId() {
return vnfInstanceId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Schema(description = \"Identifier(s) of the constituent PNF instance(s) of this VNFFG instance. \")\n public List<String> getPnfdInfoId() {\n return pnfdInfoId;\n }",
"@Schema(description = \"Identifier(s) of the constituent VL instance(s) of this VNFFG instance. \")\n public List<String> getNsVirtualLink... | [
"0.63661623",
"0.6271304",
"0.6098995",
"0.5841622",
"0.56411016",
"0.55400765",
"0.54080707",
"0.5403264",
"0.5373823",
"0.52977556",
"0.5259554",
"0.525756",
"0.52106476",
"0.5207239",
"0.5205963",
"0.5063831",
"0.50532746",
"0.5034664",
"0.5008436",
"0.49713767",
"0.496435... | 0.71739674 | 0 |
Identifier(s) of the constituent PNF instance(s) of this VNFFG instance. | @Schema(description = "Identifier(s) of the constituent PNF instance(s) of this VNFFG instance. ")
public List<String> getPnfdInfoId() {
return pnfdInfoId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Schema(required = true, description = \"Identifier(s) of the constituent VNF instance(s) of this VNFFG instance. \")\n public List<String> getVnfInstanceId() {\n return vnfInstanceId;\n }",
"@Schema(description = \"Identifier(s) of the constituent VL instance(s) of this VNFFG instance. \")\n public List<S... | [
"0.67614174",
"0.5833585",
"0.58052385",
"0.57740134",
"0.5543364",
"0.55268574",
"0.54965353",
"0.5429565",
"0.54084814",
"0.5398682",
"0.5275272",
"0.5264518",
"0.52422494",
"0.51167464",
"0.5093059",
"0.5039149",
"0.5011074",
"0.49963003",
"0.49912584",
"0.49877036",
"0.49... | 0.70426804 | 0 |
Identifier(s) of the constituent VL instance(s) of this VNFFG instance. | @Schema(description = "Identifier(s) of the constituent VL instance(s) of this VNFFG instance. ")
public List<String> getNsVirtualLinkInfoId() {
return nsVirtualLinkInfoId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Schema(required = true, description = \"Identifier(s) of the constituent VNF instance(s) of this VNFFG instance. \")\n public List<String> getVnfInstanceId() {\n return vnfInstanceId;\n }",
"@Schema(description = \"Identifier(s) of the constituent PNF instance(s) of this VNFFG instance. \")\n public List<... | [
"0.68773407",
"0.59596676",
"0.56880826",
"0.56680304",
"0.5604851",
"0.54695207",
"0.54596514",
"0.5304924",
"0.52765316",
"0.5273418",
"0.5269981",
"0.52505875",
"0.5135577",
"0.5115582",
"0.51056236",
"0.50934225",
"0.50738823",
"0.50608313",
"0.50547165",
"0.50517994",
"0... | 0.6885089 | 0 |
Identifiers of the CP instances attached to the constituent VNFs and PNFs or the SAP instances of the VNFFG. See note. | @Schema(description = "Identifiers of the CP instances attached to the constituent VNFs and PNFs or the SAP instances of the VNFFG. See note. ")
public List<NsInstancesNsInstanceNsCpHandle> getNsCpHandle() {
return nsCpHandle;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Schema(required = true, description = \"Identifier(s) of the constituent VNF instance(s) of this VNFFG instance. \")\n public List<String> getVnfInstanceId() {\n return vnfInstanceId;\n }",
"@Schema(description = \"Identifier(s) of the constituent PNF instance(s) of this VNFFG instance. \")\n public List<... | [
"0.63870734",
"0.610348",
"0.5900351",
"0.58799064",
"0.561089",
"0.5411115",
"0.5374121",
"0.5248132",
"0.5208899",
"0.5171775",
"0.5170599",
"0.51341325",
"0.50389284",
"0.5019212",
"0.50118524",
"0.5009151",
"0.49909857",
"0.4984734",
"0.49844792",
"0.498216",
"0.49799776"... | 0.65171766 | 0 |
Convert the given object to string with each line indented by 4 spaces (except the first line). | private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPA... | [
"0.7885785",
"0.75504416",
"0.74982363",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
"0.7462563",
... | 0.0 | -1 |
get the username from User.java Class | @Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
User user = snapshot.getValue(User.class);
//if the user exist in the database
if (user != null) {
String highScore = user.highScore;
int i = Integer.parseInt(highScore);
int j = Integer.parseInt(tCorrect);
if (j >= i) {
snapshot.getRef().child("highScore").setValue(tCorrect);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String getUsername();",
"java.lang.String ge... | [
"0.8727036",
"0.8727036",
"0.8727036",
"0.8727036",
"0.8727036",
"0.8727036",
"0.8727036",
"0.8727036",
"0.8727036",
"0.8579823",
"0.8579823",
"0.8579823",
"0.8267285",
"0.8267285",
"0.8267285",
"0.8267285",
"0.8267285",
"0.8267285",
"0.82072634",
"0.82072634",
"0.80953914",
... | 0.0 | -1 |
Assigns a transmission id from a previously recorded journal item or does nothing if there is no previously recorded journal item. | protected void assignTransmissionId(AeB4PQueueObject aQueueObject,
IAeTransmission aTransmission) throws AeBusinessProcessException
{
long transmissionId = removeInvokeTransmittedEntry(aQueueObject.getLocationId());
if (transmissionId != IAeTransmissionTracker.NULL_TRANSREC_ID)
{
// Restore the invoke's transmission.
aTransmission.setTransmissionId(transmissionId);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"UUID getTransmissionId();",
"public void assignId(int id);",
"public void setTransmission(Transmission transmission) {\n this.transmission = transmission;\n }",
"public void setTransmittedSerialNumber(String transmittedSerialNumber) ;",
"Transmission getTransmission(Long transmissionId);",
"pub... | [
"0.6051971",
"0.5654358",
"0.549141",
"0.54753506",
"0.5390828",
"0.5207353",
"0.5204421",
"0.5195952",
"0.5106321",
"0.50751096",
"0.50739205",
"0.50713795",
"0.50706613",
"0.50520676",
"0.5027506",
"0.50211275",
"0.5005877",
"0.49952242",
"0.4912998",
"0.4910927",
"0.488293... | 0.6328093 | 0 |
Create GLHelper and Surface | void init(){
if(DEBUG) Log.d(TAG, "Creating GlHelper and Surface");
mGLHelper = new GLHelper();
int mDefaultTextureID = 10001;
SurfaceTexture st = new SurfaceTexture(mDefaultTextureID);
st.setDefaultBufferSize(mWidth, mHeight);
mGLHelper.init(st);
textureID = mGLHelper.createOESTexture();
sTexture = new SurfaceTexture(textureID);
sTexture.setOnFrameAvailableListener(this);
surface = new Surface(sTexture);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public GL createSurface(SurfaceHolder holder) {\r\n if (MotoConfig.KEY_LOG) {\r\n Log.w(\"EglHelper\", \"createSurface() tid=\" + Thread.currentThread().getId());\r\n }\r\n /*\r\n * Check preconditions.\r\n */\r\n if (mEgl == null) {\r\n throw new ... | [
"0.7435685",
"0.70422626",
"0.68278885",
"0.6779946",
"0.6758569",
"0.6717796",
"0.67108035",
"0.6709299",
"0.670318",
"0.67016935",
"0.67001987",
"0.66976506",
"0.666591",
"0.6660974",
"0.66560316",
"0.6610447",
"0.65848833",
"0.65844786",
"0.65356576",
"0.65207225",
"0.6503... | 0.7906301 | 0 |
Get Bitmap, only once | Bitmap getBitmap(){
Bitmap bm = frame;
frame = null;
return bm;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Bitmap get() {\n Throwable throwable2222222;\n Object object;\n block4: {\n boolean bl2 = this.zali;\n if (bl2) return this.zalh;\n Object object2 = this.zalg;\n Object object3 = new ParcelFileDescriptor.AutoCloseInputStream(object2);\n ... | [
"0.72365236",
"0.71324337",
"0.7117236",
"0.7086068",
"0.7013504",
"0.7007645",
"0.69312936",
"0.6924373",
"0.6832909",
"0.682504",
"0.68077534",
"0.68004274",
"0.67656493",
"0.67489576",
"0.6674666",
"0.66337126",
"0.65491796",
"0.64994633",
"0.64911634",
"0.64835435",
"0.64... | 0.74360824 | 0 |
On Codec Frame Available, save Frame as Bitmap | @Override
public void onFrameAvailable(SurfaceTexture surfaceTexture) {
if(DEBUG) Log.d(TAG, "Frame available");
mGLHelper.drawFrame(sTexture, textureID);
frame = mGLHelper.readPixels(mWidth, mHeight);
frameProcessed();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IFrameProcessor\n{\n /**\n * @param rawFrame Das Rohdatenframe\n * @return Das verarbeitete Frame\n */\n Bitmap processFrame(Bitmap rawFrame);\n}",
"Bitmap getBitmap(){\n Bitmap bm = frame;\n frame = null;\n return bm;\n }",
"private Image mat2Image(Ma... | [
"0.6599917",
"0.6137475",
"0.6097177",
"0.6058314",
"0.60024226",
"0.5848384",
"0.5838144",
"0.58253807",
"0.58246905",
"0.5816973",
"0.5785438",
"0.5776704",
"0.5704273",
"0.56882787",
"0.56751376",
"0.5657371",
"0.56090075",
"0.56052166",
"0.5602894",
"0.55948603",
"0.55915... | 0.0 | -1 |
Notify awaitFrame() to continue | private void frameProcessed(){
if(DEBUG) Log.d(TAG, "Frame Processed");
synchronized (mWaitFrame) {
mWaitFrame.notifyAll();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void run() {\n try {\n while (true) {\n frame.updateState();\n Thread.sleep(1000);\n }\n ... | [
"0.626359",
"0.6216453",
"0.6078246",
"0.6029275",
"0.59867007",
"0.59554166",
"0.59389377",
"0.59364367",
"0.57840246",
"0.57245064",
"0.57110554",
"0.5692402",
"0.56827486",
"0.5671783",
"0.5645188",
"0.56450415",
"0.5633666",
"0.5633666",
"0.5632703",
"0.5627022",
"0.56235... | 0.67371047 | 0 |
Change background color to light gray | public static void makeBackgroundGray(){
StdDraw.clear(StdDraw.LIGHT_GRAY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setBg(){\n this.setBackground(color);\n }",
"protected void setLightBoxBackground() { Console.setBackground(Console.BLUE); }",
"public void setBackgroundColor(Color c) {\n backColor = c;\n updateFigureForModel(nodeFigure);\n }",
"@Override\n public GralColor setBackgro... | [
"0.7002956",
"0.69711053",
"0.68246454",
"0.68007994",
"0.67767054",
"0.67318326",
"0.6693698",
"0.6692257",
"0.6608852",
"0.65926504",
"0.6569733",
"0.65567696",
"0.6526313",
"0.65009177",
"0.6478659",
"0.6456391",
"0.64363235",
"0.642052",
"0.64012337",
"0.64001644",
"0.639... | 0.83482426 | 0 |
Set scale and canvas size to draw on | public static void main(String[] args) {
StdDraw.setCanvasSize(1000,1000);
StdDraw.setXscale(0, 400);
StdDraw.setYscale(0, 400);
// Change background color to light gray
makeBackgroundGray();
// Draw Wolverine
drawWolverine();
// Artist's signature
StdDraw.text(350, 20, "Christopher Rosenfelt");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n super.onSizeChanged(w, h, oldw, oldh);\n canvasBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);\n drawCanvas = new Canvas(canvasBitmap);\n }",
"public void initSize() {\n WIDTH = 320;\n ... | [
"0.70051414",
"0.69741446",
"0.6921431",
"0.66898286",
"0.66612613",
"0.6659254",
"0.6625056",
"0.6612062",
"0.6602486",
"0.65871096",
"0.6569375",
"0.65415317",
"0.65107864",
"0.64941543",
"0.64807236",
"0.6466947",
"0.645507",
"0.6429574",
"0.6412908",
"0.6399516",
"0.63944... | 0.0 | -1 |
GET for Read and List | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String action = request.getParameter("action");
if (action.equalsIgnoreCase("list")) {
JSONObject json = new JSONObject();
JSONArray ja = new JSONArray();
for (CrisisType c : dao.getAllCrisisType()) {
ja.put(c.toJSON());
}
json.put("data", ja);
response.getWriter().println(json.toString());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List getAll() throws FileNotFoundException, IOException;",
"@GET\r\n @Produces(\"text/plain\")\r\n public Response getResearchObjectList() {\r\n UserProfile user = (UserProfile) request.getAttribute(Constants.USER);\r\n \r\n Set<URI> list;\r\n if (user.getRole() == Role.PUB... | [
"0.64950305",
"0.6455084",
"0.63914305",
"0.63764226",
"0.621033",
"0.6184802",
"0.6183687",
"0.61520886",
"0.61319834",
"0.61222994",
"0.6117875",
"0.6104332",
"0.6066398",
"0.6064593",
"0.6063577",
"0.6053062",
"0.6037641",
"0.60325235",
"0.6027127",
"0.60191894",
"0.601302... | 0.56154186 | 77 |
Creates new form A4Q9 | public A4Q9() {
initComponents();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"FORM createFORM();",
"public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }",
"public static Result startNewForm() {\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tDecision firstDecision = CMSGuidedFormFill.startNewForm(formName,\r\n\t\t\t\tCMSSession.... | [
"0.72535807",
"0.6734193",
"0.6485586",
"0.6430647",
"0.617686",
"0.60488737",
"0.60020447",
"0.5980599",
"0.5972172",
"0.5929175",
"0.5926719",
"0.5918148",
"0.58929944",
"0.58695424",
"0.58634436",
"0.5849182",
"0.5818161",
"0.5802887",
"0.57779413",
"0.57235783",
"0.571392... | 0.5687341 | 21 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
num1 = new javax.swing.JLabel();
num2 = new javax.swing.JLabel();
num3 = new javax.swing.JLabel();
number1 = new javax.swing.JTextField();
number2 = new javax.swing.JTextField();
resultBox = new javax.swing.JTextField();
Add = new javax.swing.JButton();
Subtract = new javax.swing.JButton();
Multiply = new javax.swing.JButton();
Divide = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
num1.setText("First number");
num2.setText("Second number");
num3.setText("Results");
number1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
number1ActionPerformed(evt);
}
});
Add.setText("Add");
Add.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
AddActionPerformed(evt);
}
});
Subtract.setText("Subtract");
Subtract.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SubtractActionPerformed(evt);
}
});
Multiply.setText("Multiply");
Multiply.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
MultiplyActionPerformed(evt);
}
});
Divide.setText("Divide");
Divide.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
DivideActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addGap(54, 54, 54)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(num1)
.addComponent(num2)
.addComponent(num3))
.addGap(115, 115, 115)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(number1)
.addComponent(number2)
.addComponent(resultBox)))
.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(Add)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(Subtract)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(Multiply)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(Divide)))
.addContainerGap(79, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(56, 56, 56)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(num1)
.addComponent(number1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(44, 44, 44)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(num2)
.addComponent(number2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(38, 38, 38)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(num3)
.addComponent(resultBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Add)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Subtract)
.addComponent(Multiply)
.addComponent(Divide)))
.addGap(39, 39, 39))
);
pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n ... | [
"0.73197734",
"0.72914416",
"0.72914416",
"0.72914416",
"0.72862023",
"0.72487676",
"0.7213741",
"0.7207628",
"0.7196503",
"0.7190263",
"0.71850693",
"0.71594703",
"0.7147939",
"0.7093137",
"0.70808756",
"0.70566356",
"0.6987119",
"0.69778043",
"0.6955563",
"0.6953879",
"0.69... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
ArrayList<Integer> arr = new ArrayList<>();
for(int i = 1; i <= 10; i++) {
arr.add(i);
}
arr.set(4, 10);
arr.remove(3);
for(int i : arr) {
System.out.println(i);
}
} | {
"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 |
creates a new external document associated with file 'fileName'. The format of the file is given by 'format'. At present on the format 'sgml' (a file with SGML markup which is to be converted to annotations) is recognized. | public ExternalDocument (String format, String fileName) {
this.format = format;
this.directory = null;
this.fileName = fileName;
this.open = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static RDFFormat syntaxForFileName(String fileName) {\n\t\treturn RDFFormat.forFileName(fileName, RDFFormat.RDFXML);\n\t}",
"public String buildWithFileFormat(String fileFormat) {\n StringBuilder strBuilder = startBuild()\n .append(\" STORED AS \")\n .append(fileFormat);\n\n return finishB... | [
"0.5620377",
"0.5544188",
"0.552198",
"0.5416392",
"0.53828937",
"0.52331215",
"0.52075756",
"0.51565975",
"0.5139678",
"0.5139678",
"0.50879747",
"0.5061238",
"0.50288194",
"0.50249624",
"0.4988616",
"0.497263",
"0.4949829",
"0.49450853",
"0.4920768",
"0.4907248",
"0.4880382... | 0.7094014 | 0 |
sets the list of SGML tags which are to be converted to annotations when this document is opened. Applicable only to documents of format 'sgml'. | public void setSGMLtags (String[] tags) {
SGMLtags = tags;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void save () {\n\t\tif (!open) {\n\t\t\tSystem.out.println (\"ExternalDocument.save: attempt to save unopened document \" + fileName);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tif (format.equals(\"sgml\")) {\n\t\t\t\tString tagToWrite;\n\t\t\t\tif (allTags)\n\t\t\t\t\ttagToWrite = null;\n\t\t\t\telse if (SGM... | [
"0.5401823",
"0.5298121",
"0.5227367",
"0.51060253",
"0.5023826",
"0.4991034",
"0.49334896",
"0.48132387",
"0.4777149",
"0.47735715",
"0.4755849",
"0.47386405",
"0.4736771",
"0.4727366",
"0.4717211",
"0.4715852",
"0.47149137",
"0.4702337",
"0.46973306",
"0.46546564",
"0.46438... | 0.69353205 | 0 |
if allTags == true, specifies that all SGML tags are to be converted to annotations when this document is opened. Applicable only to documents of format 'sgml'. | public void setAllTags (boolean allTags) {
this.allTags = allTags;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setAllTags(ArrayList<String> allTags) {\r\n this.allTags = allTags;\r\n }",
"public void setSGMLtags (String[] tags) {\n\t\tSGMLtags = tags;\n\t}",
"public void setMacthAllSkillTag(boolean macthAllSkillTag) {\n\t\tthis.macthAllSkillTag = macthAllSkillTag;\n\t}",
"public void save () {\... | [
"0.61451703",
"0.59372306",
"0.58254564",
"0.56404674",
"0.5042346",
"0.49269974",
"0.49106574",
"0.46524805",
"0.46506503",
"0.46133614",
"0.45997506",
"0.45970595",
"0.45188835",
"0.4489586",
"0.4478743",
"0.44711867",
"0.44575933",
"0.44558945",
"0.44415298",
"0.44082725",
... | 0.6785455 | 0 |
specify a list of empty tags tags which do not have any corresponding close tags and so should be converted to empty Annotations. | public void setEmptyTags (String[] tags) {
emptyTags = tags;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void removeEmptyFormatting(ArrayList p_tags)\n {\n boolean b_changed = true;\n\n emptytag: while (b_changed)\n {\n for (int i = 0, max = p_tags.size() - 1; i < max; i++)\n {\n Object o1 = p_tags.get(i);\n Object o2 = p_tags.get(i +... | [
"0.6660466",
"0.5991867",
"0.5626654",
"0.5618321",
"0.5503944",
"0.54606265",
"0.5453599",
"0.5440991",
"0.5414494",
"0.5379137",
"0.53492016",
"0.53478104",
"0.5292904",
"0.52901965",
"0.5255586",
"0.52511597",
"0.5219973",
"0.5193764",
"0.51707673",
"0.5164279",
"0.5162144... | 0.65393484 | 1 |
opens the externalDocument: reads the contents of the file, filling the text and annotations of the document. Returns true if the Document was successfully opened, or was already open; returns false if there was an error in opening the file. | public boolean open() {
if (!open) {
try {
if (format.equals("sgml")) {
File file = new File(fullFileName()); //return the full file name,including directory and filename
String line;
BufferedReader reader = new BufferedReader (
// (new FileReader(file));
new InputStreamReader (new FileInputStream(file), JetTest.encoding));
StringBuffer fileText = new StringBuffer(); //store all text in filename
while((line = reader.readLine()) != null)
fileText.append(line + "\n");
String text = fileText.toString(); //Store the converted text
SGMLProcessor.allTags = allTags;
SGMLProcessor.emptyTags = emptyTags;
Document doc = SGMLProcessor.sgmlToDoc (this, text, SGMLtags); //Because format.equals("sgml")
open = true;
return true;
} else if (format.equals("pos")) {
posRead();
open = true;
return true;
} else {
System.out.println ("Error opening document " + fileName);
System.out.println ("Unknown document format.");
return false;
}
} catch (IOException e) {
System.out.println ("Error opening document " + fileName);
System.out.println (e);
return false;
}
} else {
// return true if already open
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doOpen() {\n\n if (!canChangeDocuments()) {\n return;\n }\n\n TextDocument document = fApplication.openDocument(this);\n\n if (document != null) {\n setDocument(document);\n }\n }",
"public boolean openDocument(File file) {\n String p... | [
"0.595098",
"0.58611596",
"0.56336147",
"0.55959696",
"0.55096835",
"0.5363963",
"0.52872634",
"0.520229",
"0.520229",
"0.50544244",
"0.5051833",
"0.5009386",
"0.49685475",
"0.49481317",
"0.48678926",
"0.48511484",
"0.48261604",
"0.48063093",
"0.47806683",
"0.477666",
"0.4771... | 0.6372073 | 0 |
reads a file with partofspeech markup, in the format token/pos token/pos ... and converts it to a document with annotation 'constit' with feature 'cat' whose value is the part of speech. | private void posRead() throws IOException {
File file = new File(fullFileName());
String line;
BufferedReader reader = new BufferedReader(new FileReader(file));
StringBuffer fileText = new StringBuffer();
while((line = reader.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line);
while (st.hasMoreTokens()) {
String tokenAndPos = st.nextToken();
int slashIndex = tokenAndPos.lastIndexOf('/');
if (slashIndex <= 0) throw new IOException("invalid data");
String token = tokenAndPos.substring(0,slashIndex);
String pos = tokenAndPos.substring(1+slashIndex).intern();
int start = this.length();
this.append(token);
if (st.hasMoreTokens())
this.append(" ");
else
this.append(" \n");
int end = this.length();
Span span = new Span(start,end);
this.annotate("token", span, new FeatureSet());
this.annotate("constit", span, new FeatureSet("cat", pos));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void process(JCas aJCas) throws AnalysisEngineProcessException {\n\t\tString text = aJCas.getDocumentText();\n\n\t\t// create an empty Annotation just with the given text\n\t\tAnnotation document = new Annotation(text);\n//\t\tAnnotation document = new Annotation(\"Barack Obama was born in Hawa... | [
"0.54538494",
"0.5408556",
"0.5300944",
"0.5294719",
"0.5226945",
"0.51305044",
"0.51184475",
"0.5051737",
"0.504698",
"0.49098527",
"0.48901078",
"0.48657092",
"0.48523262",
"0.48085657",
"0.47895372",
"0.47591022",
"0.47402188",
"0.4736052",
"0.4728838",
"0.46943864",
"0.46... | 0.6272991 | 0 |
saves the Document to the directory/fileName used for opening the Document. The document must be open. | public void save () {
if (!open) {
System.out.println ("ExternalDocument.save: attempt to save unopened document " + fileName);
return;
}
try {
if (format.equals("sgml")) {
String tagToWrite;
if (allTags)
tagToWrite = null;
else if (SGMLtags.length == 0)
tagToWrite = "***"; // unused annotation type
else if (SGMLtags.length == 1)
tagToWrite = SGMLtags[0];
else {
System.out.println ("ExternalDocument.save: cannot write more than 1 annotation type");
return;
}
String string = writeSGML(tagToWrite).toString();
File file = new File(fullFileName());
BufferedWriter writer = new BufferedWriter (
new OutputStreamWriter (new FileOutputStream(file), JetTest.encoding));
writeWithSystemNewlines (writer, string);
writer.close();
} else {
System.out.println ("Error saving document " + fileName);
System.out.println ("Unknown document format.");
}
} catch (IOException e) {
System.out.println ("Error opening document " + fileName);
System.out.println (e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveDocument() throws IOException;",
"@Override\n\tpublic void saveDocument(String path, String name) {\n\t\t\n\t}",
"public static void saveDocument( Document doc, String path ) {\n\t\ttry {\n\t\t\tFormat format = Format.getPrettyFormat();\n\t\t\tXMLOutputter fmt = new XMLOutputter( format );\n\t\... | [
"0.7785644",
"0.7500736",
"0.72532284",
"0.7189317",
"0.6987403",
"0.6870081",
"0.6825149",
"0.67732304",
"0.6770426",
"0.6640132",
"0.6612119",
"0.6583965",
"0.6554745",
"0.6546546",
"0.6546546",
"0.64671284",
"0.64549047",
"0.6423806",
"0.6416626",
"0.63801247",
"0.6376281"... | 0.70348555 | 4 |
writes string to writer, converting newline characters to systemspecific newlines. | public static void writeWithSystemNewlines (BufferedWriter writer, String string)
throws IOException {
for (int i=0; i<string.length(); i++) {
char c = string.charAt(i);
if (c == '\n')
writer.newLine();
else
writer.write(c);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static String fixPrintWriterNewLine(String decodedString) {\n StringBuilder fixedString = new StringBuilder();\n for(int i = 0; i < decodedString.length(); i++) {\n\n if(decodedString.charAt(i) == '\\n' ) {\n fixedString.append(\"\\r\\n\");\n }\n ... | [
"0.6490562",
"0.61570555",
"0.5985104",
"0.58966947",
"0.5896445",
"0.5862302",
"0.58512527",
"0.5847158",
"0.5748721",
"0.5731886",
"0.5688443",
"0.5671021",
"0.56487036",
"0.5632012",
"0.5626333",
"0.5625066",
"0.561963",
"0.5613481",
"0.56125784",
"0.558689",
"0.5572617",
... | 0.80077374 | 0 |
saves the Document to the originally specified fileName in directory 'directory'. | public void saveIn (String directory) {
this.directory = directory;
save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveAs (String directory, String fileName) {\n\t\tthis.directory = directory;\n\t\tthis.fileName = fileName;\n\t\tsave();\n\t}",
"public static void save(Directory directory) {\n\t\tUtils.FileUtils.write(\n\t\t\t\tdirectory.getDocuments(), \n\t\t\t\tGlobal.Constants.DIRECTORY_LOCATION \n\t\t\t\t+ Glo... | [
"0.7466497",
"0.7303484",
"0.64381456",
"0.6425712",
"0.63505584",
"0.6113318",
"0.6107013",
"0.6076471",
"0.60455024",
"0.60008025",
"0.59457403",
"0.5902409",
"0.58240664",
"0.57808673",
"0.5725216",
"0.5680151",
"0.56738687",
"0.5645665",
"0.56391585",
"0.5635468",
"0.5604... | 0.6685364 | 2 |
saves the Document to file 'fileName' in directory 'directory'. | public void saveAs (String directory, String fileName) {
this.directory = directory;
this.fileName = fileName;
save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void save(Directory directory) {\n\t\tUtils.FileUtils.write(\n\t\t\t\tdirectory.getDocuments(), \n\t\t\t\tGlobal.Constants.DIRECTORY_LOCATION \n\t\t\t\t+ Global.Variables.session.getCurrentUser().getName() \n\t\t\t\t+ \"$\" + directory.getName()\n\t\t\t\t);\n\t}",
"public void save(String fileName)... | [
"0.6978136",
"0.64132714",
"0.63494825",
"0.6309204",
"0.6260036",
"0.6225841",
"0.6180804",
"0.61547333",
"0.6134192",
"0.60622287",
"0.5986781",
"0.58972377",
"0.58246547",
"0.5762408",
"0.57607466",
"0.5750357",
"0.5656457",
"0.5647763",
"0.56367683",
"0.5622777",
"0.56042... | 0.72875905 | 0 |
returns 'true' if the file has been opened. | public boolean isOpen () {
return open;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isFileOpened() {\r\n \t\tif (curFile == null)\r\n \t\t\treturn false;\r\n \t\telse\r\n \t\t\treturn true;\r\n \t}",
"public boolean open() {\n try {\n fileStream = new FileReader( this.fileName );\n scanner = new Scanner( fileStream );\n this.found = true;\n } catch ( FileNotF... | [
"0.8550967",
"0.7795069",
"0.77169603",
"0.7712359",
"0.76099586",
"0.75939876",
"0.7583084",
"0.7425965",
"0.72680134",
"0.7243968",
"0.7203843",
"0.72030246",
"0.71103334",
"0.71065104",
"0.7092534",
"0.702946",
"0.6995047",
"0.69720507",
"0.6934615",
"0.6878422",
"0.682838... | 0.650928 | 40 |
returns the format of the file holding this document: 'sgml' or 'pos'. | public String format () {
return format;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"FileFormat getFormat();",
"public String getDocumentFormat() {\n return this.documentFormat;\n }",
"String documentFormat();",
"public String getFileFormat()\r\n\t{\r\n\t\treturn this.getSerializer().getFileFormat();\r\n\t}",
"@UML(identifier=\"fileFormat\", obligation=MANDATORY, specification=IS... | [
"0.7009432",
"0.6917578",
"0.6811955",
"0.6745307",
"0.6546614",
"0.6526429",
"0.6364159",
"0.6158294",
"0.6140202",
"0.6099692",
"0.5976575",
"0.5867711",
"0.58649606",
"0.58545107",
"0.58515525",
"0.57616144",
"0.5723877",
"0.5699701",
"0.56962025",
"0.56929773",
"0.5674897... | 0.0 | -1 |
returns the directory associated with the document, or 'null' if there is no directory (if the fileName contains the full path). | public String directory () {
return directory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\t\tpublic String getDir()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}",
"public String getDir();",
"public static String getDir(String name) {\n\t\tint s = name.lastIndexOf(FILE_SEP);\n\t\treturn s == -1 ? null : name.substring(0, s);\n\t}",
"public File getDirectory() {\n\t\treturn file.getPar... | [
"0.6035599",
"0.5893726",
"0.5830858",
"0.58284545",
"0.5822884",
"0.5762944",
"0.57441103",
"0.5691828",
"0.5648245",
"0.56288",
"0.554456",
"0.55336624",
"0.55214244",
"0.5497014",
"0.5481806",
"0.5481135",
"0.545247",
"0.5400631",
"0.5396263",
"0.5373848",
"0.5358875",
"... | 0.5370808 | 20 |
returns the file name associated with the document. | public String fileName () {
return fileName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getDocumentName() {\r\n if (resource != null) {\r\n return resource.getFullPath().toString();\r\n }\r\n return \"null\";\r\n }",
"java.lang.String getFilename();",
"java.lang.String getFilename();",
"java.lang.String getFileName();",
"java.lang.String getFil... | [
"0.7703055",
"0.7561839",
"0.7561839",
"0.7505732",
"0.7505732",
"0.7505732",
"0.7505732",
"0.7505732",
"0.7505732",
"0.7505732",
"0.7505732",
"0.7505732",
"0.74738383",
"0.74343425",
"0.7413032",
"0.7392748",
"0.7339256",
"0.73373574",
"0.7302511",
"0.7279686",
"0.7247085",
... | 0.0 | -1 |
the full file name, including both the directory and the file name within the directory | public String fullFileName () {
if (directory == null || directory.equals(""))
return fileName;
else
return directory + File.separator + fileName; //add a '\' in the path
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String filename() {\n int dot = fullPath.lastIndexOf(extensionSeparator);\n int sep = fullPath.lastIndexOf(pathSeparator);\n return fullPath.substring(sep + 1, dot);\n }",
"public String filename() {\n\t int sep = fullPath.lastIndexOf(pathSeparator);\n\t return fullPath.subst... | [
"0.7828763",
"0.78172547",
"0.74946404",
"0.7481221",
"0.7481221",
"0.7481221",
"0.7481221",
"0.7481221",
"0.7481221",
"0.7481221",
"0.7481221",
"0.7481221",
"0.73428744",
"0.73428744",
"0.7309326",
"0.730645",
"0.7271692",
"0.72680867",
"0.7224304",
"0.7208067",
"0.71946406"... | 0.8636382 | 0 |
Processes requests for both HTTP GET and POST methods. | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_... | [
"0.70041305",
"0.6658495",
"0.6603461",
"0.650908",
"0.6447329",
"0.6442597",
"0.6440696",
"0.64322716",
"0.6428243",
"0.64247036",
"0.64247036",
"0.64201605",
"0.64201605",
"0.64201605",
"0.6418442",
"0.64144915",
"0.64144915",
"0.6400502",
"0.6394304",
"0.6394304",
"0.63930... | 0.0 | -1 |
Handles the HTTP GET method. | @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//Edita as allergias do user
String urlbase = "/trabalho2_so2_FINAL/jsp/Perfil.jsp";
PropretiesGetter propriedades = new PropretiesGetter();
String host = propriedades.getProperties("host");
String bd = propriedades.getProperties("bd");
String username = propriedades.getProperties("user");
String password = propriedades.getProperties("pw");
DataBaseManager db = new DataBaseManager(host, bd, username, password);
int size = db.getAllAllergy().size();//Numero de alergias que a web app permite (4)
HttpSession session = request.getSession();
User user = (User) session.getAttribute("login");
ArrayList<Allergy> allergies = new ArrayList();
//Ciclo for para apanhar as allergias "checked" pelo user
for (int i = 0; i < size; i++) {
if (request.getParameter("Allergy" + i) != null) {
Allergy allTemp = new Allergy(request.getParameter("Allergy" + i));
allergies.add(allTemp);
}
}
user.setAllergies(allergies); //Set allergias novas
User edited = db.editUser(user); //update na base de dados
session.setAttribute("login", edited); //update do user no jsp
response.sendRedirect(urlbase);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doGet( )\n {\n \n }",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) thro... | [
"0.7589819",
"0.71670026",
"0.71134603",
"0.7056349",
"0.7030202",
"0.70289457",
"0.6996126",
"0.6975816",
"0.6888662",
"0.6873633",
"0.6853793",
"0.6843488",
"0.6843488",
"0.68354696",
"0.68354696",
"0.68354696",
"0.6819225",
"0.6818393",
"0.6797782",
"0.6780766",
"0.6761152... | 0.0 | -1 |
Handles the HTTP POST method. | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }",
"public void doPost( )\n {\n \n }",
"@Override\n public String getMethod() {\n return \"POST\";\n ... | [
"0.73289514",
"0.71383566",
"0.7116213",
"0.7105215",
"0.7100045",
"0.70236707",
"0.7016248",
"0.6964149",
"0.6889435",
"0.6784954",
"0.67733276",
"0.67482096",
"0.66677034",
"0.6558593",
"0.65582114",
"0.6525548",
"0.652552",
"0.652552",
"0.652552",
"0.65229493",
"0.6520197"... | 0.0 | -1 |
Returns a short description of the servlet. | @Override
public String getServletInfo() {
return "Short description";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getServletInfo()\n {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short d... | [
"0.87634975",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8531295",
"0.8531295",
"0.85282224",
"0.85282224",
... | 0.0 | -1 |
/ renamed from: a | public final int mo4456a(C1902e c1902e, C1202f c1202f) {
AppMethodBeat.m2504i(102744);
if (this.scene == 0 && (this.mgt == null || this.mgt.size() == 0)) {
AppMethodBeat.m2505o(102744);
return -1;
}
bcb bcb = (bcb) this.ehh.fsG.fsP;
bcb.wGE = this.mgt.size();
if (this.mgs != null) {
bcb.wGG = this.mgs.size();
bcb.vKB = this.mgs;
} else {
bcb.wGG = 0;
bcb.vKB = new LinkedList();
}
if (!C5046bo.isNullOrNil(this.mgu)) {
bcb.wGH = this.mgu;
}
bcb.wGE = this.mgt.size();
bcb.wGF = this.mgt;
bcb.vEp = this.mgq;
bcb.Scene = this.scene;
this.ehi = c1202f;
int a = mo4457a(c1902e, this.ehh, this);
AppMethodBeat.m2505o(102744);
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064... | 0.0 | -1 |
/ renamed from: a | public final void mo4498a(int i, int i2, int i3, String str, C1929q c1929q, byte[] bArr) {
AppMethodBeat.m2504i(102745);
C4990ab.m7410d("MicroMsg.Fav.NetSceneModFavItem", "favId: " + this.mgq + ", netId : " + i + " errType :" + i2 + " errCode: " + i3 + " errMsg :" + str);
this.ehi.onSceneEnd(i2, i3, str, this);
C39037b.m66383d(((C7604ae) C1720g.m3530M(C7604ae.class)).getFavItemInfoStorage().mo23694iF((long) this.mgq));
AppMethodBeat.m2505o(102745);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed fr... | [
"0.6249595",
"0.6242955",
"0.61393225",
"0.6117684",
"0.61140615",
"0.60893875",
"0.6046927",
"0.60248226",
"0.60201806",
"0.59753186",
"0.5947817",
"0.5912414",
"0.5883872",
"0.5878469",
"0.587005",
"0.58678955",
"0.58651674",
"0.5857262",
"0.58311176",
"0.58279663",
"0.5827... | 0.0 | -1 |
END OF MAIN METHODS: This method import an aircraft and it's operating conditions from an .xml file overwriting imported data on the default aircraft ones. | public void importUsingCustomXML(OperatingConditions operatingConditions, Aircraft aircraft, ACAnalysisManager analysis, String inFilePathNoExt) {
System.out.println("\n ----- STARTED IMPORTING DATA FROM THE XML CUSTOM FILE -----\n");
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// STATIC FUNCTIONS - TO BE CALLED BEFORE EVERYTHING ELSE
JPADWriteUtils.buildXmlTree();
JPADXmlReader _theReadUtilities = new JPADXmlReader(aircraft, operatingConditions, inFilePathNoExt);
_theReadUtilities.importAircraftAndOperatingConditions(aircraft, operatingConditions, inFilePathNoExt);
System.out.println("\n\n");
System.out.println("\t\tCurrent Mach after importing = " + operatingConditions.get_machCurrent());
System.out.println("\t\tCurrent Altitude after importing = " + operatingConditions.get_altitude());
System.out.println("\n\n");
System.out.println("\t\tCurrent MTOM after importing = " + aircraft.get_weights().get_MTOM());
System.out.println("\n\n");
//-------------------------------------------------------------------
// Export/Serialize
JPADDataWriter writer = new JPADDataWriter(operatingConditions, aircraft, analysis);
String myExportedFile = inFilePathNoExt + "b" + ".xml";
writer.exportToXMLfile(myExportedFile);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void loadAircraftData(Path p) throws DataLoadingException {\t\r\n\t\ttry {\r\n\t\t\t//open the file\r\n\t\t\tBufferedReader reader = Files.newBufferedReader(p);\r\n\t\t\t\r\n\t\t\t//read the file line by line\r\n\t\t\tString line = \"\";\r\n\t\t\t\r\n\t\t\t//skip the first line of the file - ... | [
"0.61119103",
"0.54574174",
"0.51795894",
"0.512282",
"0.51218414",
"0.5093368",
"0.5083196",
"0.50820154",
"0.50742745",
"0.5058799",
"0.50409293",
"0.50398636",
"0.50210077",
"0.4997167",
"0.49877638",
"0.4978585",
"0.49766535",
"0.49640948",
"0.49344966",
"0.49194124",
"0.... | 0.75005233 | 0 |
Get the titles of the charts, with an optional header at the start. | public static String[] getChartTitles(List<PopChart> chartData, boolean addHeader)
{
String[] list = new String[!addHeader ? chartData.size() : (1 + chartData.size())];
int index = 0;
if (addHeader)
{
list[index++] = "Select a chart";
}
for (PopChart chart : chartData)
{
list[index++] = chart.getTitle();
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String[] getTitles() {\n\t\tif (results == null)\n\t\t\treturn null;\n\t\tWebSearchResult[] resultsArray = results.listResults();\n\t\tString[] titles = new String[resultsArray.length];\n\t\tfor (int i = 0; i < titles.length; i++) {\n\t\t\ttitles[i] = resultsArray[i].getTitle();\n\t\t}\n\t\treturn titles;\n... | [
"0.61426544",
"0.59701896",
"0.59701896",
"0.59701896",
"0.59701896",
"0.59701896",
"0.59357095",
"0.5932342",
"0.5912649",
"0.58865494",
"0.5829553",
"0.5821503",
"0.5811877",
"0.5811877",
"0.5811877",
"0.5811877",
"0.5811877",
"0.5811877",
"0.5811877",
"0.5811877",
"0.58118... | 0.76513696 | 0 |
Nothing to do here, but declare it for subclasses that load data on demand | protected void loadData()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void loadData();",
"public abstract void loadData();",
"public abstract void loadData();",
"@Override\r\n\tprotected void load() {\n\t\t\r\n\t}",
"abstract void initializeNeededData();",
"@Override\n public void load() {\n }",
"protected @Override\r\n abstract vo... | [
"0.81656873",
"0.7965385",
"0.7965385",
"0.7273338",
"0.72556996",
"0.7157632",
"0.7128649",
"0.7119317",
"0.7119317",
"0.7119317",
"0.70896596",
"0.70896596",
"0.7086318",
"0.70655906",
"0.7057073",
"0.7032239",
"0.70210534",
"0.6989957",
"0.6989957",
"0.6985586",
"0.6976337... | 0.8036351 | 1 |
Load the data, if necessary | private JFreeChart getBarChart()
{
loadData();
// Create the vertical bar chart
final JFreeChart chart = ChartFactory.createBarChart(getTitle(), "", "", getCategoryDataset(),
PlotOrientation.HORIZONTAL, false, true, false);
final CategoryPlot categoryplot = (CategoryPlot) chart.getPlot();
categoryplot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
categoryplot.setRangePannable(true);
categoryplot.setNoDataMessage("No data available");
final BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer();
barrenderer.setItemLabelAnchorOffset(9D);
barrenderer.setBaseItemLabelsVisible(true);
barrenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
// barrenderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator("{1} = {2}", new DecimalFormat("0")));
final CategoryAxis categoryaxis = categoryplot.getDomainAxis();
categoryaxis.setCategoryMargin(0.25D);
categoryaxis.setUpperMargin(0.02D);
categoryaxis.setLowerMargin(0.02D);
final NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
numberaxis.setUpperMargin(0.10000000000000001D);
ChartUtilities.applyCurrentTheme(chart);
// if (useLegend())
// {
// // pieplot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({1})"));
// chart.getLegend().setPosition(RectangleEdge.RIGHT);
// // pieplot.setLegendLabelToolTipGenerator(new StandardPieSectionLabelGenerator("{0}: {2}%"));
// }
return chart;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void loadData()\n {\n }",
"private void loadData() {\n\t\tOptional<ServerData> loaded_data = dataSaver.load();\n\t\tif (loaded_data.isPresent()) {\n\t\t\tdata = loaded_data.get();\n\t\t} else {\n\t\t\tdata = new ServerData();\n\t\t}\n\t}",
"protected abstract void loadData();",
"void loadData();"... | [
"0.81632406",
"0.80745375",
"0.8047743",
"0.77141607",
"0.77141607",
"0.77054745",
"0.767114",
"0.767114",
"0.7311536",
"0.72100997",
"0.72080255",
"0.7197452",
"0.7167984",
"0.7129897",
"0.7051257",
"0.7026415",
"0.7019144",
"0.70051676",
"0.69865763",
"0.69440806",
"0.69306... | 0.0 | -1 |
Load the data, if necessary | private JFreeChart getPieChart()
{
loadData();
// Create a chart and return it
final JFreeChart chart = ChartFactory.createPieChart(getTitle(), getPieDataset(),
useLegend(), useTooltips(), useURLs());
// Customize the labels and legend
final PiePlot pieplot = (PiePlot) chart.getPlot();
pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2})"));
// pieplot.setSimpleLabels(true);
pieplot.setNoDataMessage("No data available");
if (useLegend())
{
pieplot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({1})"));
chart.getLegend().setPosition(RectangleEdge.RIGHT);
// pieplot.setLegendLabelToolTipGenerator(new StandardPieSectionLabelGenerator("{0}: {2}%"));
}
return chart;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void loadData()\n {\n }",
"private void loadData() {\n\t\tOptional<ServerData> loaded_data = dataSaver.load();\n\t\tif (loaded_data.isPresent()) {\n\t\t\tdata = loaded_data.get();\n\t\t} else {\n\t\t\tdata = new ServerData();\n\t\t}\n\t}",
"protected abstract void loadData();",
"void loadData();"... | [
"0.8163035",
"0.8074418",
"0.804742",
"0.77141476",
"0.77141476",
"0.7705287",
"0.7670667",
"0.7670667",
"0.7311227",
"0.72103363",
"0.72079045",
"0.71979225",
"0.7167437",
"0.7129454",
"0.70502144",
"0.7026352",
"0.70184386",
"0.7005353",
"0.69857997",
"0.6943849",
"0.693063... | 0.0 | -1 |
Date date = new Date(1000000L); Date date=new Date(116,2,15); | public static void main(String[] args) {
System.out.println(new Date().getTime());
// 2016-12-16 11:48:08
Calendar calendar = Calendar.getInstance();
calendar.set(2016, 11, 16, 12, 0, 1);
System.out.println(calendar.getTime());
Date date=new Date();
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(simpleDateFormat.format(date));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n int i =2003;\n long d = 13220100526L;\n System.out.println(new Date(d));\n System.out.println(i / 20 + (i % 20 > 0 ? 1 : 0));\n }",
"public void setDate(long date)\r\n/* 199: */ {\r\n/* 200:299 */ setDate(\"Date\", date);\r\n/* 20... | [
"0.62131315",
"0.6204954",
"0.6125269",
"0.6111394",
"0.61026543",
"0.6028856",
"0.5941289",
"0.59402883",
"0.5926344",
"0.58422464",
"0.58409476",
"0.58200246",
"0.5806983",
"0.5786367",
"0.572818",
"0.5723188",
"0.57229346",
"0.57189703",
"0.57178503",
"0.5717694",
"0.56685... | 0.5628496 | 21 |
Returns the ARGB color used to tint the source pixels when this filter is applied. | @ColorInt
public int getColor() {
return mColor;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic ARGBType get()\n\t{\n\t\tfillWeights();\n\n\t\tfinal int argb = target.get().get();\n\t\taccA = ( ( argb >> 24 ) & 0xff ) * weights[ 0 ];\n\t\taccR = ( ( argb >> 16 ) & 0xff ) * weights[ 0 ];\n\t\taccG = ( ( argb >> 8 ) & 0xff ) * weights[ 0 ];\n\t\taccB = ( argb & 0xff ) * weights[ 0 ];\n\n\t\... | [
"0.58558315",
"0.5810222",
"0.5721642",
"0.5638171",
"0.5589022",
"0.5522763",
"0.5522763",
"0.5344033",
"0.5331323",
"0.53247845",
"0.5267001",
"0.5238026",
"0.5225344",
"0.5215421",
"0.5202892",
"0.51857865",
"0.5185019",
"0.5177531",
"0.5175257",
"0.5169598",
"0.516854",
... | 0.4787882 | 84 |
Returns the PorterDuff mode used to composite this color filter's color with the source pixel when this filter is applied. | public BlendMode getMode() {
return mMode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public PorterDuffColorFilter m16835OooO00o(int i, PorterDuff.Mode mode) {\n return (PorterDuffColorFilter) get(Integer.valueOf(OooO00o(i, mode)));\n }",
"public ColorMode getColorMode() {\n\t\treturn getValue(Property.COLOR_MODE, ColorMode.values(), ColorMode.GRADIENT);\n\t}",
"public @ColorM... | [
"0.588871",
"0.55224544",
"0.53754795",
"0.5026153",
"0.49828458",
"0.4865698",
"0.48247856",
"0.46902686",
"0.46902686",
"0.46457362",
"0.46295303",
"0.46240708",
"0.4592271",
"0.456255",
"0.45569605",
"0.45527792",
"0.45467854",
"0.452382",
"0.45183012",
"0.45164287",
"0.45... | 0.5219442 | 3 |
This is a base class constructor for a SECSItem. When using this constructor, the outbound number of length bytes will be set to the minimum number required to handle an item with the length that is specified by the value of the length parameter. This constructor sets the following base class attributes from the provided data: formatCode lengthInBytes outboundNumberOfLengthBytes | protected SECSItem(SECSItemFormatCode formatCode, int lengthInBytes)
{
if (lengthInBytes < 0 || lengthInBytes > 0x00FFFFFF)
{
throw new IllegalArgumentException(
"The value for the length argument must be between 0 and 16777215 inclusive.");
}
this.formatCode = formatCode;
this.lengthInBytes = lengthInBytes;
outboundNumberOfLengthBytes = calculateMinimumNumberOfLengthBytes(lengthInBytes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected SECSItem(SECSItemFormatCode formatCode, int length, SECSItemNumLengthBytes desiredNumberOfLengthBytes)\n {\n this.formatCode = formatCode;\n lengthInBytes = length;\n setOutboundNumberOfLengthBytes(length, desiredNumberOfLengthBytes);\n }",
"protected SECSItem(byte[] data, in... | [
"0.7584354",
"0.7579418",
"0.6060325",
"0.5861587",
"0.57218677",
"0.56043303",
"0.558623",
"0.55820423",
"0.55789953",
"0.55421567",
"0.54771906",
"0.5465796",
"0.54462415",
"0.5422892",
"0.5362701",
"0.5337246",
"0.53359735",
"0.52948844",
"0.5290991",
"0.52680415",
"0.5266... | 0.77751887 | 0 |
This is a base class constructor for a SECSItem. When using this constructor, the number of length bytes will be set to the greater of, the specified number of length bytes, or the minimum number required to handle an item with the length that is specified by the value of the length parameter. This constructor sets the following base class attributes from the provided data: formatCode lengthInBytes outboundNumberOfLengthBytes Note: An IllegalArgumentException will be thrown if the value of the length parameter is outside the range of 0 16777215 inclusive. | protected SECSItem(SECSItemFormatCode formatCode, int length, SECSItemNumLengthBytes desiredNumberOfLengthBytes)
{
this.formatCode = formatCode;
lengthInBytes = length;
setOutboundNumberOfLengthBytes(length, desiredNumberOfLengthBytes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected SECSItem(SECSItemFormatCode formatCode, int lengthInBytes)\n {\n if (lengthInBytes < 0 || lengthInBytes > 0x00FFFFFF)\n {\n throw new IllegalArgumentException(\n \"The value for the length argument must be between 0 and 16777215 inclusive.\");\n }\n\n... | [
"0.7753299",
"0.7533304",
"0.59537697",
"0.59183246",
"0.57911247",
"0.5759875",
"0.5602522",
"0.55724424",
"0.5568618",
"0.5562665",
"0.5526616",
"0.5435962",
"0.54184",
"0.540983",
"0.5388738",
"0.53074664",
"0.5185994",
"0.51485854",
"0.5147517",
"0.5140906",
"0.5134304",
... | 0.7644506 | 1 |
This is a base class constructor for a SECSItem. This form of the constructor is used when parsing wire/transmission format data and converting it into its "Java form". This constructor sets the following base class attributes from the provided data: formatCode inboundNumberOfLengthBytes outboundNumberOfLengthBytes lengthInBytes or if the formatCode is of type L(List) lengthInBytes will be the number of items in the list | protected SECSItem(byte[] data, int itemOffset)
{
if (data == null)
{
throw new IllegalArgumentException("\"data\" argument must not be null.");
}
if (data.length < 2)
{
throw new IllegalArgumentException("\"data\" argument must have a length >= 2.");
}
formatCode = SECSItemFormatCode.getSECSItemFormatCodeFromNumber((byte)((data[itemOffset] >> 2) & 0x0000003F));
byte[] temp1 = new byte[4];
switch(data[itemOffset] & 0x03) // Extract the number of length bytes from the message
{
case 0:
throw new IllegalArgumentException("The number of length bytes is not allowed to be ZERO.");
case 1:
inboundNumberOfLengthBytes = SECSItemNumLengthBytes.ONE;
outboundNumberOfLengthBytes = inboundNumberOfLengthBytes;
temp1[0] = 0;
temp1[1] = 0;
temp1[2] = 0;
temp1[3] = data[itemOffset+1];
break;
case 2:
inboundNumberOfLengthBytes = SECSItemNumLengthBytes.TWO;
outboundNumberOfLengthBytes = inboundNumberOfLengthBytes;
if (data.length < 3)
{
throw new IllegalArgumentException("With two length bytes the minimum length for the \"data\" argument is 3.");
}
temp1[0] = 0;
temp1[1] = 0;
temp1[2] = data[itemOffset+1];
temp1[3] = data[itemOffset+2];
break;
case 3:
inboundNumberOfLengthBytes = SECSItemNumLengthBytes.THREE;
outboundNumberOfLengthBytes = inboundNumberOfLengthBytes;
if (data.length < 4)
{
throw new IllegalArgumentException("With three length bytes the minimum length for the \"data\" argument is 4.");
}
temp1[0] = 0;
temp1[1] = data[itemOffset+1];
temp1[2] = data[itemOffset+2];
temp1[3] = data[itemOffset+3];
break;
}
ByteBuffer buf = ByteBuffer.wrap(temp1);
buf.order(ByteOrder.BIG_ENDIAN);
lengthInBytes = buf.getInt();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected SECSItem(SECSItemFormatCode formatCode, int lengthInBytes)\n {\n if (lengthInBytes < 0 || lengthInBytes > 0x00FFFFFF)\n {\n throw new IllegalArgumentException(\n \"The value for the length argument must be between 0 and 16777215 inclusive.\");\n }\n\n... | [
"0.76793873",
"0.7371821",
"0.5416792",
"0.52385634",
"0.5218183",
"0.5211045",
"0.51654935",
"0.516012",
"0.5152956",
"0.5116243",
"0.511216",
"0.51096976",
"0.5109098",
"0.50579816",
"0.5037538",
"0.5037292",
"0.50156057",
"0.5013939",
"0.50134945",
"0.50031537",
"0.4989151... | 0.7527197 | 1 |
Return the minimum number of length bytes required based on the specified length. The maximum length of a SECSItem in its "wire/transmission format" is 16777215 (stored in 24 bits). | private static SECSItemNumLengthBytes calculateMinimumNumberOfLengthBytes(int length)
{
SECSItemNumLengthBytes result = SECSItemNumLengthBytes.ONE;
if (length > 255)
{
if (length < 65536)
result = SECSItemNumLengthBytes.TWO;
else
result = SECSItemNumLengthBytes.THREE;
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Integer getMinLength() {\n\t\treturn minLength;\n\t}",
"public SECSItemNumLengthBytes getInboundNumberOfLengthBytes()\n {\n return inboundNumberOfLengthBytes;\n }",
"public int minLen() {\n if (compositions == null) {\n return Math.min(maxLen(getAllele(0)), maxLen(getAllel... | [
"0.662236",
"0.6577405",
"0.6473382",
"0.6288526",
"0.62655735",
"0.6242282",
"0.6234043",
"0.61813456",
"0.6169914",
"0.61675256",
"0.61285716",
"0.6016072",
"0.60155493",
"0.5977215",
"0.59750885",
"0.59578806",
"0.5947232",
"0.5937184",
"0.5935946",
"0.5926343",
"0.5924077... | 0.8379858 | 0 |
Returns the length in bytes of what the outbound item header will require. | protected final int outputHeaderLength()
{
return outboundNumberOfLengthBytes.valueOf() + 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SECSItemNumLengthBytes getOutboundNumberOfLengthBytes()\n {\n return outboundNumberOfLengthBytes;\n }",
"public SECSItemNumLengthBytes getInboundNumberOfLengthBytes()\n {\n return inboundNumberOfLengthBytes;\n }",
"public int getLengthInBytes()\n {\n return lengthInBy... | [
"0.78114855",
"0.7144733",
"0.6910715",
"0.6809242",
"0.67788696",
"0.6713501",
"0.6709758",
"0.6678632",
"0.66591233",
"0.6646881",
"0.6646452",
"0.662069",
"0.6620248",
"0.66101044",
"0.6563594",
"0.6537799",
"0.6510165",
"0.6480753",
"0.64749634",
"0.6446515",
"0.64454234"... | 0.7252162 | 1 |
This method fills in the first 2 to 4 bytes of a SECSItem's value (the SECSItem's header) in its raw wire/transmission format. The first byte contains value of the item's format code and number of length bytes and the next 1 to 3 bytes contain the value of the item's length in bytes. Make sure buffer is large enough!!! | protected final int populateSECSItemHeaderData(byte[] buffer, int numberOfBytes)
{
int offset = 0;
byte[] outputLengthBytes = new byte[]{0, 0, 0, 0};
buffer[0] = (byte)((SECSItemFormatCode.getNumberFromSECSItemFormatCode(formatCode) << 2) | outboundNumberOfLengthBytes.valueOf());
ByteBuffer bb = ByteBuffer.wrap(outputLengthBytes);
bb.order(ByteOrder.BIG_ENDIAN);
bb.putInt(numberOfBytes);
switch(outboundNumberOfLengthBytes)
{
case ONE:
buffer[1] = outputLengthBytes[3];
offset = 2;
break;
case TWO:
buffer[1] = outputLengthBytes[2];
buffer[2] = outputLengthBytes[3];
offset = 3;
break;
case THREE:
buffer[1] = outputLengthBytes[1];
buffer[2] = outputLengthBytes[2];
buffer[3] = outputLengthBytes[3];
offset = 4;
break;
case NOT_INITIALIZED:
System.err.println("The case where outboundNumberOfLengthBytes is still in its NOT_INITIALIZED state should never happen.");
break;
}
return offset;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected SECSItem(byte[] data, int itemOffset)\n {\n if (data == null)\n {\n throw new IllegalArgumentException(\"\\\"data\\\" argument must not be null.\");\n }\n \n if (data.length < 2)\n {\n throw new IllegalArgumentException(\"\\\"data\\\" arg... | [
"0.6526943",
"0.5624061",
"0.551443",
"0.54653734",
"0.5399825",
"0.5108613",
"0.4914542",
"0.4873771",
"0.48684084",
"0.48629382",
"0.4817701",
"0.47874045",
"0.46898833",
"0.4684696",
"0.46716046",
"0.46701705",
"0.4660694",
"0.46547654",
"0.46300262",
"0.4627113",
"0.45568... | 0.5484672 | 3 |
Return the length in bytes of the actual "data" portion of this SECSItem. | public int getLengthInBytes()
{
return lengthInBytes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getDataSize() {\n\t\treturn (int)this.getSize(data);\n\t}",
"public int getLength() {\n\t\treturn data.length;\n\t\t\n\t}",
"public int dataSize() {\n\t\treturn data.size();\n\t}",
"public long dataSize() {\n return this.dataSize;\n }",
"public final int length() {\n return ... | [
"0.7481205",
"0.73426986",
"0.7335534",
"0.73313916",
"0.7300455",
"0.72814876",
"0.72659296",
"0.7253849",
"0.72347105",
"0.7212397",
"0.7035199",
"0.70283586",
"0.7027778",
"0.7026475",
"0.6955051",
"0.69305634",
"0.69023865",
"0.68954355",
"0.6843266",
"0.6813565",
"0.6771... | 0.667396 | 28 |
Returns an enum indicating the number of length bytes used in the wire/transmission format data this SECSItem was constructed from. | public SECSItemNumLengthBytes getInboundNumberOfLengthBytes()
{
return inboundNumberOfLengthBytes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SECSItemNumLengthBytes getOutboundNumberOfLengthBytes()\n {\n return outboundNumberOfLengthBytes;\n }",
"public int getLength()\n {\n return stream.getInt(COSName.LENGTH, 0);\n }",
"public int getLength() {\n/* 301 */ return this.stream.getInt(COSName.LENGTH, 0);\n/* */... | [
"0.7107141",
"0.69061273",
"0.68967277",
"0.6862134",
"0.6795485",
"0.6776869",
"0.6739462",
"0.67341375",
"0.6715814",
"0.66697073",
"0.66639185",
"0.6654374",
"0.6643088",
"0.66411555",
"0.66354305",
"0.66354305",
"0.6632811",
"0.6628921",
"0.6628921",
"0.6628921",
"0.66289... | 0.7031625 | 1 |
Returns an enum indicating the number of length bytes that will be used when creating the wire/transmission format data from this SECSItem. | public SECSItemNumLengthBytes getOutboundNumberOfLengthBytes()
{
return outboundNumberOfLengthBytes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SECSItemNumLengthBytes getInboundNumberOfLengthBytes()\n {\n return inboundNumberOfLengthBytes;\n }",
"public int getLength()\n {\n return this.m_descriptor[1] & 0xFF;\n }",
"public long getSize() {\n\t\treturn this.payloadSize; // UTF-16 => 2 bytes per character\n\... | [
"0.698171",
"0.68478143",
"0.68187",
"0.67869925",
"0.6777389",
"0.67592096",
"0.67433137",
"0.670173",
"0.66861695",
"0.66717935",
"0.66525596",
"0.6642848",
"0.66291606",
"0.65926874",
"0.6567425",
"0.6560113",
"0.65532994",
"0.65532994",
"0.65522736",
"0.65522736",
"0.6552... | 0.7240552 | 0 |
This method is used to change the number of length bytes used when this SECSItem is converted to its wire/transmission format. The value the number of length bytes will actually set to is the greater of the minimum required or the number desired. | public void setOutboundNumberOfLengthBytes(int length, SECSItemNumLengthBytes desiredNumberOfLengthBytes)
{
if (length < 0 || length > 0x00FFFFFF)
{
throw new IllegalArgumentException(
"The value for the length argument must be between 0 and 16777215 inclusive.");
}
outboundNumberOfLengthBytes = calculateMinimumNumberOfLengthBytes(length);
if (outboundNumberOfLengthBytes.valueOf() < desiredNumberOfLengthBytes.valueOf())
{
outboundNumberOfLengthBytes = desiredNumberOfLengthBytes;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setLength( int length ) { setCapacity( length ); this.length = length; }",
"public void setLength(long length);",
"public void setLength(long length);",
"void setLength( long length );",
"private static SECSItemNumLengthBytes calculateMinimumNumberOfLengthBytes(int length)\n {\n SECSI... | [
"0.674997",
"0.6642027",
"0.6642027",
"0.64910614",
"0.64828855",
"0.6452709",
"0.6402221",
"0.63919556",
"0.6380031",
"0.6369243",
"0.63480693",
"0.6338597",
"0.62499297",
"0.6249434",
"0.6249434",
"0.62053615",
"0.6185654",
"0.61693907",
"0.615585",
"0.6128087",
"0.611504",... | 0.72443026 | 0 |
Returns an enum version of this SECSItem's Format Code. | public SECSItemFormatCode getSECSItemFormatCode()
{
return getFormatCode();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SECSItemFormatCode getFormatCode()\n {\n return formatCode;\n }",
"@Field(0) \r\n\tpublic ValuedEnum<DXGI_FORMAT> format() {\r\n\t\treturn this.io.getEnumField(this, 0);\r\n\t}",
"public RMFormat getFormat()\n {\n return getStyle().getFormat();\n }",
"public String getFormatC... | [
"0.8160138",
"0.69669867",
"0.6797673",
"0.66895336",
"0.6564709",
"0.6459871",
"0.6399129",
"0.63804394",
"0.6323754",
"0.6268567",
"0.6260365",
"0.6231562",
"0.6213056",
"0.61948776",
"0.61824983",
"0.6162961",
"0.6154006",
"0.6154006",
"0.6154006",
"0.61342514",
"0.6121089... | 0.7657815 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.