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 |
|---|---|---|---|---|---|---|
Get the name analyser for this key. This is, essentially the analyser used to build the key | public NameAnalyser getAnalyser() {
return analyser;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public K getName() {\n return key;\n }",
"@Override\n public String toString() {\n return getAnalyzerName();\n }",
"public NameKey toNameKey() {\n if (this.scientificNameAuthorship == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null && fl.con... | [
"0.6198281",
"0.6151138",
"0.6051109",
"0.60307044",
"0.59971994",
"0.5979264",
"0.59704286",
"0.5882766",
"0.58767265",
"0.57900876",
"0.5773135",
"0.5754749",
"0.5741453",
"0.5708815",
"0.5682773",
"0.5677364",
"0.5677364",
"0.5677364",
"0.5677364",
"0.5674521",
"0.5674521"... | 0.702995 | 0 |
Get the normenclatural code for this key. | public NomenclaturalCode getCode() {
return code;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final String getLabelCode() {\r\n\t\tString label = this.label;\r\n\t\tif (StringUtil.isEmpty(label))\r\n\t\t\treturn \"\";\r\n\t\tStringBuilder labelCode = new StringBuilder();\r\n\t\tint startIndex = 0;\r\n\t\tfor (int i=0; i<label.length();i++) {\r\n\t\t\tif (label.charAt(i) >= 'A' && label.charAt(i)<= '... | [
"0.5794492",
"0.57231766",
"0.5559371",
"0.5544028",
"0.55164206",
"0.549805",
"0.5491075",
"0.53949535",
"0.53437126",
"0.5333522",
"0.5319529",
"0.5296285",
"0.52810585",
"0.5273381",
"0.5268948",
"0.5268948",
"0.5260973",
"0.5250422",
"0.52491057",
"0.5243922",
"0.52417153... | 0.6384803 | 0 |
Get the normalised scientific name | public String getScientificName() {
return scientificName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@NonNull\n public String getScientificName() {\n return scientificName;\n }",
"public void setScientificName(@NonNull String scientificName) {\n this.scientificName = scientificName;\n }",
"public StrColumn getEbiOrganismScientific() {\n return delegate.getColumn(\"ebi_organism_scientific\", De... | [
"0.7634369",
"0.66436887",
"0.6152614",
"0.6023103",
"0.59789973",
"0.597729",
"0.5906464",
"0.5891818",
"0.5858281",
"0.5806503",
"0.57119447",
"0.5671858",
"0.56711304",
"0.56688434",
"0.5668771",
"0.56558585",
"0.5652768",
"0.561553",
"0.55853605",
"0.5559683",
"0.5557191"... | 0.76696175 | 0 |
Get the normalised scientific name authorship | public String getScientificNameAuthorship() {
return scientificNameAuthorship;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getAuthorName();",
"private String getAuthorStringForLookup(CitedArticle citedArticle) {\n List<CitedArticleAuthor> authors = citedArticle.getAuthors();\n return authors.size() > 0 ? authors.get(0).getSurnames() : \"\";\n }",
"private static String authorLine()\n {\n return String.forma... | [
"0.7252598",
"0.6939766",
"0.6881891",
"0.68106335",
"0.67544276",
"0.67260146",
"0.6616382",
"0.6616061",
"0.6616061",
"0.6569969",
"0.6505794",
"0.64575994",
"0.64575994",
"0.64505905",
"0.643007",
"0.6351748",
"0.63421047",
"0.6341926",
"0.6337829",
"0.6324687",
"0.6319660... | 0.7917891 | 0 |
Get the rank of the name | public RankType getRank() {
return rank;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getRank()\r\n\t{\r\n\t\treturn rank;\r\n\t}",
"public String getRank() {\r\n return rank;\r\n }",
"public String getRank() {\n return rank;\n }",
"long getRank();",
"public String rank() {\r\n return rank;\r\n }",
"public int getRank();",
"public int ... | [
"0.7651758",
"0.7584574",
"0.7527076",
"0.748295",
"0.74666834",
"0.74549484",
"0.74549484",
"0.7428514",
"0.74257654",
"0.72844875",
"0.72361964",
"0.720585",
"0.7199814",
"0.7182512",
"0.71746033",
"0.7163617",
"0.7109785",
"0.7080046",
"0.70722085",
"0.70722085",
"0.707220... | 0.67107224 | 45 |
Get the type of name | public NameType getType() {
return type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String typeName();",
"public String getTypeName();",
"public String getTypeName();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType();",
"java.lang.String getType(... | [
"0.8207587",
"0.80714536",
"0.80714536",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.80047363",
"0.798239",
"0.798239",
"0.798239",
"0.798239",
"0.79... | 0.7773371 | 63 |
Get the name flags | @Nullable
public Set<NameFlag> getFlags() {
return flags;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getFlags() {\r\n \t\treturn flags;\r\n \t}",
"public int getFlags();",
"public int getFlags();",
"long getFlags();",
"public long getFlags() {\n }",
"public java.lang.String getReservedFlags() {\n return reservedFlags;\n }",
"public String getFlaginfo() {\n return... | [
"0.726437",
"0.67256695",
"0.67256695",
"0.6259688",
"0.624504",
"0.62134045",
"0.6165782",
"0.6152825",
"0.61490947",
"0.6135717",
"0.6118438",
"0.609148",
"0.6072247",
"0.60414046",
"0.60347545",
"0.6024302",
"0.5982161",
"0.59648645",
"0.5959696",
"0.5947414",
"0.5923954",... | 0.74380475 | 0 |
Is this name an autonym? | public boolean isAutonym() {
return flags != null && flags.contains(NameFlag.AUTONYM);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean name() {\r\n return (\r\n (letter() && alphas()) ||\r\n (CHAR('`') && nobquotes() && MARK(QUOTE) && CHAR('`'))\r\n );\r\n }",
"boolean hasName();",
"boolean hasName();",
"boolean hasName();",
"boolean hasName();",
"boolean hasName();",
"boolean has... | [
"0.7120799",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"0.6907277",
"... | 0.78107923 | 0 |
Is this an unauthored name, meaning that it does not have a scientific name author? | public boolean isUnauthored() {
return this.scientificNameAuthorship == null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"default String getAuthor() {\r\n\t\treturn \"unknown\";\r\n\t}",
"String getAuthorName();",
"public static String fixAuthor(String in) {\n return(fixAuthor(in, true));\n }",
"@Override\n\tpublic String getAuthor() {\n\t\treturn \"\";\n\t}",
"private static String authorLine()\n {\n re... | [
"0.6932759",
"0.6874928",
"0.6740081",
"0.6646032",
"0.6591489",
"0.6589777",
"0.65018886",
"0.65018886",
"0.64654326",
"0.645965",
"0.6454751",
"0.64398366",
"0.64004916",
"0.63999057",
"0.6372006",
"0.6286673",
"0.6286673",
"0.62794286",
"0.62673235",
"0.61919856",
"0.61660... | 0.74799776 | 0 |
Is this an uncoded name, meaning that it does not have a nomenclatural code to accurately distinguish between homonyms? | public boolean isUncoded() {
return this.code == null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public String getName() {\n return \"synonym\";\n }",
"public String mangle(String sName);",
"@Override\n public String named() {\n return \"soul\";\n }",
"abstract String name();",
"public String getAcronym();",
"@Override\r\n\tpublic char getAcronym() {\r\n\t\tretu... | [
"0.6689626",
"0.64174604",
"0.620846",
"0.62048876",
"0.6171958",
"0.61253655",
"0.612055",
"0.6119789",
"0.60114145",
"0.59715754",
"0.59513056",
"0.5922511",
"0.5913182",
"0.5889301",
"0.5882413",
"0.5860359",
"0.5853551",
"0.5827769",
"0.58172387",
"0.5811511",
"0.5807342"... | 0.0 | -1 |
Is this a formaal name key, meaning that the name type represents something like a scientific name. | public boolean isFormal() {
return this.code != null && this.type != null && (this.type == NameType.SCIENTIFIC || this.type == NameType.HYBRID || this.type == NameType.CULTIVAR || this.type == NameType.VIRUS);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public NameKey(NameAnalyser analyser, NomenclaturalCode code, String scientificName, String scientificNameAuthorship, RankType rank, NameType type, @Nullable Set<NameFlag> flags) {\n this.analyser = analyser;\n this.code = code;\n this.scientificName = scientificName;\n this.scientificN... | [
"0.64832616",
"0.6478625",
"0.6187161",
"0.6170704",
"0.61656815",
"0.60462886",
"0.59768534",
"0.58617234",
"0.5822131",
"0.58089715",
"0.57757837",
"0.5767088",
"0.5752509",
"0.57483166",
"0.5744215",
"0.56955755",
"0.5686623",
"0.5656415",
"0.5646236",
"0.56330097",
"0.562... | 0.0 | -1 |
Compare for equality with another name key Name keys are equal if the analyser says they are | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NameKey nameKey = (NameKey) o;
return this.analyser.compare(this, nameKey) == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void equalsWithDifferentName() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"key1\");\n AttributeKey<Number> key2 = new AttributeKey<Number>(Number.class, \"key2\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(... | [
"0.7647895",
"0.7276807",
"0.7228059",
"0.71436554",
"0.7059388",
"0.70125014",
"0.6985814",
"0.68365186",
"0.6747552",
"0.66823685",
"0.6616152",
"0.6565097",
"0.6534812",
"0.65121925",
"0.6368226",
"0.63665444",
"0.6338365",
"0.6337144",
"0.6296139",
"0.62698305",
"0.623934... | 0.74779975 | 1 |
Compute a has code for the name key | @Override
public int hashCode() {
return this.analyser.hashCode(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasCodeName();",
"java.lang.String getCodeName();",
"com.google.protobuf.ByteString\n getCodeNameBytes();",
"private int genKey()\n {\n return (nameValue.getData() + scopeDefined.getTag()).hashCode();\n }",
"java.lang.String getCode();",
"java.lang.String getCode()... | [
"0.7027334",
"0.6590513",
"0.6278187",
"0.61440206",
"0.60975164",
"0.60975164",
"0.5924652",
"0.5924652",
"0.5924652",
"0.5924652",
"0.5924652",
"0.59024435",
"0.590118",
"0.5871279",
"0.5844276",
"0.5835762",
"0.58317333",
"0.58317333",
"0.58317333",
"0.5827054",
"0.5794651... | 0.0 | -1 |
Convert a full taxon key into a nameonly key. | public NameKey toNameKey() {
if (this.scientificNameAuthorship == null)
return this;
Set<NameFlag> fl = this.flags;
if (fl != null && fl.contains(NameFlag.AUTONYM)) {
fl = new HashSet<>(this.flags);
fl.remove(NameFlag.AUTONYM);
fl = fl.isEmpty() ? null : fl;
}
return new NameKey(this.analyser, this.code, this.scientificName, null, this.rank, this.type, fl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getShortNameKey();",
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"@Override\n public String tagKey(String key) {\n String conventionKey = NamingConvention.snakeCase.tagKey(key);\n\n String sanitized = tagKeyChars.matcher(conventionKey).replaceAll(SEPA... | [
"0.61790824",
"0.6126865",
"0.5883176",
"0.5874781",
"0.5817814",
"0.55421185",
"0.5454125",
"0.53939736",
"0.53794813",
"0.5347349",
"0.52593625",
"0.5225946",
"0.5204215",
"0.5148134",
"0.51268613",
"0.5047275",
"0.50467724",
"0.50336593",
"0.50085837",
"0.49958327",
"0.499... | 0.60507244 | 2 |
Convert a full taxon key into an unranked key. | public NameKey toUnrankedNameKey() {
if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED)
return this;
Set<NameFlag> fl = this.flags;
if (fl != null && fl.contains(NameFlag.AUTONYM)) {
fl = new HashSet<>(this.flags);
fl.remove(NameFlag.AUTONYM);
fl = fl.isEmpty() ? null : fl;
}
return new NameKey(this.analyser, this.code, this.scientificName, null, RankType.UNRANKED, this.type, fl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"public NameKey toUncodedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null)\n return this;\n Set<NameFlag> fl = this.flags;\n if (fl != null ... | [
"0.59763503",
"0.5936155",
"0.5921683",
"0.5744919",
"0.56279683",
"0.5443599",
"0.52858233",
"0.52351564",
"0.50724196",
"0.5047437",
"0.48983386",
"0.48696387",
"0.48300108",
"0.4800497",
"0.47892475",
"0.4773061",
"0.47715575",
"0.47418705",
"0.47389418",
"0.47084576",
"0.... | 0.6363894 | 0 |
Convert a taxon key into an ranked key. | public NameKey toRankedNameKey(RankType rank) {
if (this.rank == rank)
return this;
return new NameKey(this.analyser, this.code, this.scientificName, this.scientificNameAuthorship, rank, this.type, this.flags);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int rank(K key);",
"public int rank(Key key)\n\t{\n\t\treturn rank(root,key);\n\t}",
"private int rank(Integer key, Node x) {\n\t if (x == null) return 0; \n\t int cmp = key.compareTo(x.key); \n\t if (cmp < 0) return rank(key, x.left); \n\t else if (cmp > 0) return 1 + s... | [
"0.6105557",
"0.5554979",
"0.555113",
"0.54889745",
"0.5474506",
"0.5456015",
"0.5447683",
"0.5156969",
"0.5151627",
"0.5069207",
"0.5059742",
"0.4983624",
"0.49625283",
"0.49351892",
"0.49036774",
"0.48891884",
"0.48534393",
"0.4774549",
"0.4774549",
"0.4774549",
"0.4774549"... | 0.6187515 | 0 |
Convert a full taxon key into an unranked and unnomenclatural coded key. | public NameKey toUncodedNameKey() {
if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED && this.code == null)
return this;
Set<NameFlag> fl = this.flags;
if (fl != null && fl.contains(NameFlag.AUTONYM)) {
fl = new HashSet<>(this.flags);
fl.remove(NameFlag.AUTONYM);
fl = fl.isEmpty() ? null : fl;
}
return new NameKey(this.analyser, null, this.scientificName, null, RankType.UNRANKED, this.type, fl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"public abstract Key translateKey(Key key) throws InvalidKeyException;",
"public NameKey toUnrankedNameKey() {\n if (this.scientificNameAuthorship == null && this.rank == RankType.UNRANKED)\n return this;\n ... | [
"0.6292418",
"0.5857915",
"0.58414155",
"0.5594304",
"0.55226636",
"0.54489547",
"0.5317751",
"0.5306089",
"0.52502805",
"0.5186701",
"0.5149866",
"0.51414186",
"0.50789446",
"0.50720996",
"0.50220835",
"0.4984702",
"0.49696022",
"0.49514848",
"0.4937555",
"0.48955742",
"0.48... | 0.6118168 | 1 |
write your code here | public static void main(String[] args) {
int arr1[][] = {{1,89,75},{56,20,15},{63,02,30}};
int arr2[][] = {{48,8,02},{78,280,1895},{3,0562,390}};
//int arr2[][] = {{40,50,60},{8,52,82},{88,90,02}};
//int arr2[][] = {{48,8,02},{78,280,1895},{3,0562,390}};
int arrSum[][] = new int[3][3];
int arrSub[][] = new int[3][3];
int arrMult[][] = new int[3][3];
System.out.println("array1");
for(int i = 0; i<arr1.length; i++){
for(int j=0; j<arr1.length; j++){
System.out.print(arr1[i][j] + " ");
}
System.out.println();
}
System.out.println();
System.out.println("array2");
for(int i = 0; i<arr1.length; i++){
for(int j=0; j<arr1.length; j++){
System.out.print(arr2[i][j] + " ");
}
System.out.println();
}
for(int i = 0; i < arr1.length; i++){
for(int j = 0; j < arr1.length; j++){
arrSum[i][j] = arr1[i][j]+arr2[i][j];
arrSub[i][j] = arr1[i][j]-arr2[i][j];
//arrMult[i][j] = arr1[i][j]*arr2[i][j];
}
System.out.println();
}
for(int i = 0; i <arr2.length;i++){
for(int j = 0; j<arr2.length;j++){
arrMult[i][j] = 0;
for(int k =0; k<3;k++){
arrMult[i][j] += arr1[i][k]*arr2[k][j];
}
}
}
System.out.println();
System.out.println("matrix addition ...");
for(int i = 0; i<arr1.length; i++){
for(int j=0; j<arr1.length; j++){
System.out.print(arrSum[i][j] + " ");
}
System.out.println();
}
System.out.println();
System.out.println("matrix subtraction ...");
for(int i = 0; i<arr1.length; i++){
for(int j=0; j<arr1.length; j++){
System.out.print(arrSub[i][j] + " ");
}
System.out.println();
}
System.out.println();
System.out.println("matrix multiplication ...");
for(int i = 0; i<arr1.length; i++){
for(int j=0; j<arr1.length; j++){
System.out.print(arrMult[i][j] + " ");
}
System.out.println();
}
System.out.println();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void logic(){\r\n\r\n\t}",
"public static void generateCode()\n {\n \n }",
"@Override\n\tprotected void logic() {\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"void pramitiTechTutorials() {\n\t\n}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\tpub... | [
"0.6102675",
"0.60554034",
"0.5881289",
"0.5827861",
"0.5797848",
"0.5699908",
"0.5690402",
"0.5655419",
"0.5649126",
"0.56402504",
"0.56354046",
"0.5604573",
"0.5602213",
"0.56006557",
"0.55898213",
"0.5584013",
"0.5576956",
"0.55739224",
"0.5560841",
"0.55331355",
"0.551296... | 0.0 | -1 |
scene function for intro | public Scene introScene() {
ipField = new TextField("127.0.0.1");
portNum = new TextField("5555");
introHbox = new HBox(30,ipField, portNum);
introHbox.setLayoutX(150);
introHbox.setLayoutY(200);
// login Button
loginButton = new Button("Next");
loginButton.setLayoutX(150);
loginButton.setLayoutY(240);
loginButton.setOnAction(toTheInstr);
// intro Pane with background
introPane = new Pane(introHbox, loginButton);
Image image = new Image("background_intro.jpg");
BackgroundImage backgroundImage = new BackgroundImage(image, BackgroundRepeat.NO_REPEAT,
BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, new BackgroundSize(1.0, 1.0, true, true, false, false));
Background background = new Background(backgroundImage);
introPane.setBackground(background);
return new Scene(introPane,600,600);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createScene();",
"@Override\n\tpublic void onShowScene() {\n\t\t\n\t}",
"public void initIntro() {\n\t\tWorld.clear();\n\t\tstate = STATE.INTRO;\n\t\tinitBackground();\n\t\tWorld.add(new Logo(Screen.getCenterX() - Logo.WIDTH / 2, Screen\n\t\t\t\t.getHeight() * 3 / 4 - Logo.HEIGHT / 2));\n\n\t\tWorl... | [
"0.7164759",
"0.66907495",
"0.66256094",
"0.6595962",
"0.65227735",
"0.65099317",
"0.6405354",
"0.63782364",
"0.6320442",
"0.627565",
"0.62303567",
"0.62028474",
"0.6171888",
"0.61221033",
"0.61216277",
"0.6111197",
"0.6092983",
"0.6068936",
"0.6049413",
"0.6034775",
"0.60240... | 0.70078164 | 1 |
checks if number correct | public boolean isValidPort(String port) {
for(char x : port.toCharArray()) {
if(!Character.isDigit(x)) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkNumber() {\n\t\treturn true;\n\t}",
"public boolean isValid(int number)",
"public static int check() {\r\n\t\tint num = 0;\r\n\t\tboolean check = true;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tnum = input.nextInt();\r\n\t\t\t\tif (num < 0) {\r\n\t\t\t\t\tnum = Math.abs(num);\r\n\t\t\t\t}\r\n\t... | [
"0.76411796",
"0.7173242",
"0.7146938",
"0.7141784",
"0.69321835",
"0.68912596",
"0.68420845",
"0.6803178",
"0.67103535",
"0.66122913",
"0.65642494",
"0.6563043",
"0.6526582",
"0.65099084",
"0.6489859",
"0.6489859",
"0.6489859",
"0.64251745",
"0.6404341",
"0.64035535",
"0.636... | 0.0 | -1 |
checks if Ip is correct | public boolean isValidIP(String port) {
for(char x : port.toCharArray()) {
if((!Character.isDigit(x)) && x != '.') {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasIp();",
"boolean hasIp();",
"boolean hasIp();",
"boolean hasIp();",
"private boolean validate(final String ip){\t\t \n \t Pattern pattern = Pattern.compile(IPADDRESS_PATTERN);\n\t Matcher matcher = pattern.matcher(ip);\n\t return matcher.matches();\t \t \n }",
"private static boo... | [
"0.78556377",
"0.78556377",
"0.78556377",
"0.78556377",
"0.70683974",
"0.6922637",
"0.6883667",
"0.6793384",
"0.6765796",
"0.67652375",
"0.67197436",
"0.6681712",
"0.6679496",
"0.6667079",
"0.6616211",
"0.6616211",
"0.65207016",
"0.6518541",
"0.6504569",
"0.64784586",
"0.6455... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
launch(args);
} | {
"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 |
feel free to remove the starter code from this method | @Override
public void start(Stage primaryStage) throws Exception {
// TODO Auto-generated method stub
primaryStage.setTitle("(Client) Let's Play Morra!!!");
HashMap<String,Scene> sceneMap = new HashMap<String,Scene>();
sceneMap.put("game", gameScene());
// Login button event handler from intro scene
toTheGame = new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
ip.setText("Your IP: " + ipField.getText());
port.setText("Your Port: " + portNum.getText());
primaryStage.setScene(sceneMap.get("game"));
clientConnection = new Client(data->{
Platform.runLater(()->{
listView.getItems().add(data.toString());
// checking if Game is over
int temp = listView.getItems().size();
listView.scrollTo(temp);
String temp1 = listView.getItems().get(temp-1);
if(temp1.contains("GoodBye.")) {
playAgain.setDisable(true);
}
});
}, ipField.getText(), Integer.parseInt(portNum.getText()));
clientConnection.start();
}
};
sceneMap.put("instr", instructionScene());
toTheInstr = new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
if(isValidPort(portNum.getText()) && isValidIP(ipField.getText())) {
primaryStage.setScene(sceneMap.get("instr"));
}
else {
portNum.setText("Check Port Number");
ipField.setText("Check IP number");
}
}
};
sceneMap.put("intro", introScene());
primaryStage.setScene(sceneMap.get("intro"));
primaryStage.show();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n\t... | [
"0.6057878",
"0.601869",
"0.581881",
"0.57666975",
"0.56735593",
"0.566626",
"0.56592035",
"0.56209785",
"0.5609129",
"0.5590294",
"0.5574328",
"0.55422074",
"0.55335736",
"0.5521501",
"0.5521231",
"0.5521231",
"0.5499023",
"0.54845995",
"0.54762703",
"0.54686093",
"0.5453692... | 0.0 | -1 |
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.78847593",
"0.75493765",
"0.74971926",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0.746168",
"0... | 0.0 | -1 |
Asettaa pelin kieleksi parametrina annetun. | public void setLang(LANG language) {
this.language = language;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void elaboraParametri() {\n super.elaboraParametri();\n titoloPagina = TITOLO_PAGINA;\n }",
"public Final_parametre() {\r\n\t}",
"public void setValues(RutaParams params){\n this.costo = params.costo;\n this.tiempoVuelo = params.tiempoVuelo;\n this... | [
"0.71569824",
"0.6536254",
"0.63912773",
"0.62947226",
"0.625974",
"0.62521344",
"0.6216597",
"0.61619186",
"0.60610104",
"0.5980697",
"0.59500045",
"0.59167403",
"0.5909462",
"0.5892415",
"0.5880681",
"0.58604205",
"0.5859322",
"0.58227",
"0.5805038",
"0.57998586",
"0.579854... | 0.0 | -1 |
Palauttaa tiedon onko "Easter Egg" aktivoitu. | public boolean getEasterEgg() {
return easterEgg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setEasterEgg(boolean easterEgg){\n\t\tthis.easterEgg = easterEgg;\n\t}",
"public void onderbreek(){\n \n }",
"void TaktImpulsAusfuehren ()\n {\n \n wolkebew();\n \n }",
"@Override\n\tpublic void eggHatches() {\n\t\t\n\t}",
"public final void dyE() {\n ... | [
"0.65241885",
"0.64581764",
"0.6426587",
"0.63979393",
"0.6147012",
"0.6137614",
"0.6124725",
"0.6086434",
"0.6054551",
"0.6015583",
"0.60096794",
"0.59413373",
"0.5941201",
"0.5924973",
"0.59190845",
"0.5914069",
"0.59089553",
"0.5891293",
"0.58825135",
"0.58604854",
"0.5850... | 0.61015993 | 7 |
Palauttaa "Easter Eggin" xkoordinaatin. | public int getEgX() {
return egX;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setEgX(int x) {\n\t\tthis.egX = x;\n\t}",
"@Override\n\tpublic void office_location() {\n\t\tSystem.out.println(\"Office location is Gurgaon\");\n\t}",
"int getLatE6();",
"int getLatE6();",
"public void Ganhou() {\n\t\tString[] g = new String[10]; \n\t\tg[0] = m[0][0] + m[0][1] + m[0][2];\n\t\t... | [
"0.6147577",
"0.56766564",
"0.56759626",
"0.56759626",
"0.5634787",
"0.55966306",
"0.5594931",
"0.5546423",
"0.55399466",
"0.553828",
"0.55381054",
"0.5530812",
"0.55224067",
"0.5500778",
"0.5485675",
"0.5460618",
"0.5452744",
"0.5452744",
"0.5424041",
"0.54005843",
"0.539436... | 0.61172897 | 1 |
Asettaa "Easter Eggin" xkoordinaatin. | public void setEgX(int x) {
this.egX = x;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setEgY(int y) {\n\t\tthis.egY = y;\n\t}",
"public int getEgX() {\n\t\treturn egX;\n\t}",
"private void setEnergia(double nuovaEnergia)\r\n\t{\r\n\t\tif (nuovaEnergia > MAX) energia = MAX;\r\n\t\telse if (nuovaEnergia < 0.0) energia = 0.0;\r\n\t\telse energia = nuovaEnergia;\r\n\r\n\t\tstorico = all... | [
"0.57874817",
"0.57347363",
"0.5733629",
"0.56671256",
"0.5594216",
"0.55124027",
"0.54933125",
"0.54837227",
"0.54672605",
"0.54597056",
"0.54486763",
"0.54016274",
"0.53524905",
"0.5318439",
"0.5304591",
"0.52957064",
"0.52933866",
"0.52307796",
"0.5208691",
"0.520728",
"0.... | 0.6285393 | 0 |
Palauttaa "Easter Eggin" ykoordinaatin. | public int getEgY() {
return egY;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AutomatZustand()\r\n\t{\r\n\t\tthis.ew_lokal = Automat.eingabewort;\r\n\t}",
"@Override\n public String location() {\n return \"Vị trí sách giáo khoa\";\n }",
"public void eisagwgiFarmakou() {\n\t\t// Elegxw o arithmos twn farmakwn na mhn ypervei ton megisto dynato\n\t\tif(numOfMedicine < 1... | [
"0.5958196",
"0.5956249",
"0.59508145",
"0.59376323",
"0.5907636",
"0.58890074",
"0.5879772",
"0.5854108",
"0.58418447",
"0.5833982",
"0.58172566",
"0.58072084",
"0.57663053",
"0.57411337",
"0.5732581",
"0.57320476",
"0.573148",
"0.573148",
"0.57275796",
"0.572318",
"0.569555... | 0.5936481 | 4 |
Asettaa "Easter Eggin" ykoordinaatin. | public void setEgY(int y) {
this.egY = y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public AutomatZustand()\r\n\t{\r\n\t\tthis.ew_lokal = Automat.eingabewort;\r\n\t}",
"public int getEgY() {\n\t\treturn egY;\n\t}",
"public static void alturaArbol() {\n int angulo = 35;\n\n double anguloConvert = Math.toRadians(angulo);\n int x = 20;\n int y;\n y = (int) Math... | [
"0.60569674",
"0.6047072",
"0.600257",
"0.5946096",
"0.5713729",
"0.5608204",
"0.55904984",
"0.558738",
"0.55216604",
"0.5507674",
"0.5470406",
"0.54481304",
"0.5446601",
"0.5428474",
"0.54123247",
"0.54082954",
"0.53853434",
"0.5374656",
"0.5371615",
"0.5366273",
"0.5354442"... | 0.6401155 | 0 |
Asettaa tiedon onko "Easter Egg" aktivoitu. | public void setEasterEgg(boolean easterEgg){
this.easterEgg = easterEgg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final void beK() {\n AppMethodBeat.i(88975);\n if (this.kaS.aZV().vTW != null && this.kaS.aZV().vTW.size() > 0) {\n tm tmVar = (tm) this.kaS.aZV().vTW.get(0);\n if (this.iPD != null) {\n this.iPD.setText(tmVar.title);\n }\n if (this.ks... | [
"0.6329207",
"0.62777495",
"0.6249328",
"0.619305",
"0.6102993",
"0.6008558",
"0.5990901",
"0.59716505",
"0.59529823",
"0.5952899",
"0.5936674",
"0.5934657",
"0.59086496",
"0.587515",
"0.58648825",
"0.5839845",
"0.58201665",
"0.5797783",
"0.57956845",
"0.57848763",
"0.573854"... | 0.64212006 | 0 |
Palauttaa listan pelin JFramen pikkukuvista. | public List<Image> getIcons() {
ImageIcon icon64 = new ImageIcon(getClass().getResource("/resources/frame_icon64.png"));
ImageIcon icon128 = new ImageIcon(getClass().getResource("/resources/frame_icon128.png"));
List<Image> icons = new ArrayList<Image>();
icons.add(icon64.getImage());
icons.add(icon128.getImage());
return icons;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void listar() {\n\t\t\n\t}",
"public ListaPracownikow() {\n generujPracownikow();\n //dodajPracownika();\n }",
"public void GetVehiculos() {\n String A = \"&LOCATION=POR_ENTREGAR\";\n String Pahtxml = \"\";\n \n try {\n \n DefaultListMod... | [
"0.6865002",
"0.68213093",
"0.6739098",
"0.6737896",
"0.6619484",
"0.64467776",
"0.6410027",
"0.6400275",
"0.63571113",
"0.6354842",
"0.6351304",
"0.63406044",
"0.629157",
"0.62682444",
"0.626503",
"0.6199742",
"0.61811215",
"0.6127937",
"0.612419",
"0.61144614",
"0.61133933"... | 0.0 | -1 |
Implementation of ALPHABETA Game Search | @Override
public Play searchAndSelect(State currState, Evaluation eval, int depthLimit, int playerNum) {
if (currState == null || eval == null) {
throw new IllegalArgumentException("State and Evaluation can not be null");
}
if (playerNum != 1 && playerNum != 2) {
throw new IllegalArgumentException("playerNum must be either 1 or 2");
}
int searchCount = 0;
Map<Move, State> successors = currState.getSuccessors();
Move selectedMove = null;
int alpha = Integer.MIN_VALUE;
int beta = Integer.MAX_VALUE;
if (playerNum == 1) {
for (Move m : successors.keySet()) {
searchCount++;
StateValueAB moveValue = maxValue(successors.get(m), eval, depthLimit, depthLimit, alpha, beta);
searchCount += moveValue.getSearchCount();
if (moveValue.getAlpha() > alpha) {
alpha = moveValue.getAlpha();
selectedMove = m;
}
}
} else {
for (Move m : successors.keySet()) {
searchCount++;
StateValueAB moveValue = minValue(successors.get(m), eval, depthLimit, depthLimit, alpha, beta);
searchCount += moveValue.getSearchCount();
if (moveValue.getBeta() < beta) {
beta = moveValue.getBeta();
selectedMove = m;
}
}
}
return new Play(selectedMove, successors.get(selectedMove), searchCount);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String[] search() {\n\t\t\n\t\troot.setScore(0);\n\t\tleaves = 0;\n\t\t\n\t\t/*\n\t\t * Interrupt the think() thread so we can have the updated game tree\n\t\t */\n\t\t\n\t\tString[] move = new String[2];\n\t\t\n\t\t// Find the max or min value for the white or black player respectively\n\t\tfloat val = alp... | [
"0.6262137",
"0.62172186",
"0.6098121",
"0.60581267",
"0.6024338",
"0.6009342",
"0.5981732",
"0.5917278",
"0.5856014",
"0.57556003",
"0.57356983",
"0.5735059",
"0.5720939",
"0.5719657",
"0.5708759",
"0.56245387",
"0.56245387",
"0.56119",
"0.5606257",
"0.5584892",
"0.5569841",... | 0.0 | -1 |
indicates to stop search | private boolean isCutoff(final int remainingDepth) {
return remainingDepth <= 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void onStop()\n\t{\n\t\tsuper.onStop();\n\t\tNaviWords.setSearchType(null);\t\n\t}",
"@Override\n\tpublic boolean isSearching() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isSearching() {\n\t\treturn false;\n\t}",
"void stopIndexing();",
"void unsetSearchWindowEnd();",
"v... | [
"0.6903087",
"0.6768533",
"0.6768533",
"0.6668062",
"0.65941125",
"0.6367051",
"0.6364052",
"0.6354515",
"0.6314243",
"0.62831223",
"0.62505096",
"0.6190624",
"0.61638606",
"0.61441195",
"0.61307216",
"0.610886",
"0.61073375",
"0.6106832",
"0.61066705",
"0.61020935",
"0.60866... | 0.0 | -1 |
standalone Java programs must have a main() function, which is the point where execution begins | public static void main(String[] Args) {
// note that locals have no public/private/... prefix; also, we
// are using the fact that array objects, in this case Args, have
// "length" variables built in
int NumElements = Args.length;
for (int I = 1; I <= NumElements; I++) {
int Num;
// need to do C's "atoi()"; use parseInt(), a class method of
// the Integer class; inverse operation is toString()
Num = Integer.parseInt(Args[I-1]);
// create a new node
NumNode NN = new NumNode(Num);
NN.Insert();
}
System.out.println("final sorted list:");
NumNode.PrintList();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) // every Java program starts with a main method or function\r\n\t{\n\t}",
"public static void main() {\n }",
"public static void main()\n\t{\n\t}",
"public static void main(){\n\t}",
"public static void main() {\n \n }",
"public static void main(String[... | [
"0.82493436",
"0.8117206",
"0.80676645",
"0.7992671",
"0.7856474",
"0.77653855",
"0.77653855",
"0.7727026",
"0.77004004",
"0.7654147",
"0.7653388",
"0.76490635",
"0.75943047",
"0.75783455",
"0.75419337",
"0.75363266",
"0.75363266",
"0.75363266",
"0.75230503",
"0.7515573",
"0.... | 0.0 | -1 |
make the following methods visible externally, e.g. to main(), via public; the ones which are class methods rather than instance methods also are static | public static NumNode Head() {
return Nodes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void staticFun()\n {\n }",
"public void myPublicMethod() {\n\t\t\n\t}",
"private static void LessonInstanceVsStatic() {\n System.out.println(MathHelper.E);\n System.out.println(MathHelper.PI);\n System.out.println(MathHelper.square(5));\n //Three helper methods ... | [
"0.6626651",
"0.64683336",
"0.64585525",
"0.6350434",
"0.63311774",
"0.63051564",
"0.62818295",
"0.6278019",
"0.6278019",
"0.60943544",
"0.60764486",
"0.6073185",
"0.6017588",
"0.60136163",
"0.60125226",
"0.59922653",
"0.59529346",
"0.59434855",
"0.5881726",
"0.5876949",
"0.5... | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
BubbleSort bs = new BubbleSort();
int[] arr = {9, 1, 5, 8, 3, 7, 6, 4, 2};
// int[] arr = {2, 1, 3, 4, 5, 6, 7, 8, 9};
// bs.bubbleSort0(arr);
// bs.bubbleSortNormal(arr);
bs.bubbleSortImporve(arr);
} | {
"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 |
page.setColor(Color.white); page.drawRect((int)bounds.getX(), (int)bounds.getY(), (int)bounds.getWidth(), (int) bounds.getHeight()); | protected void drawBounds(Graphics page)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void paintComponent(Graphics page)\n {\n super.paintComponent(page);\n\n //set color, then draw a rectangle\n page.setColor(currentColor);\n\n page.drawRect(x1, y1, currentWidth, currentHeight);\n }",
"public void paint(Graphics page)\n\t{\n\t\tpag... | [
"0.75062615",
"0.69421655",
"0.6503448",
"0.6404282",
"0.63462967",
"0.6322428",
"0.62903965",
"0.62880516",
"0.62772197",
"0.62538314",
"0.6133234",
"0.6118428",
"0.6115997",
"0.61130005",
"0.6107456",
"0.61020106",
"0.6086872",
"0.6079941",
"0.60741794",
"0.6067243",
"0.605... | 0.81195354 | 0 |
To set the value of a specific component in the current group of solution | public void set(int index, String value) {
if (index < 0 || index >= this.solutionVector.length) {
throw new RuntimeException();
}
solutionVector[index] = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void setComponentValue(Object value) {\n\t\t\n\t}",
"Builder setComponent(String component);",
"public abstract Vector4fc setComponent(int component, float value);",
"protected void setComponent(Component newComponent) {\n\tcomponent = newComponent;\n}",
"public abstract void updateMain... | [
"0.670347",
"0.6482533",
"0.6230711",
"0.61976683",
"0.60866994",
"0.59129274",
"0.58999664",
"0.5854709",
"0.5844591",
"0.5820163",
"0.581092",
"0.5807404",
"0.57632065",
"0.5691045",
"0.56754214",
"0.5669374",
"0.56557816",
"0.56337434",
"0.5610648",
"0.5602425",
"0.5586760... | 0.0 | -1 |
To get the value of a specific component in the current group of solution | public String get(int index) {
return solutionVector[index];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getComponent() {\n return this.component;\n }",
"private String getComponentValue(JComponent component)\r\n {\r\n\t if (component instanceof JTextField)\r\n\t {\r\n\t\t JTextField text = (JTextField)component;\r\n\t\t return text.getText();\r\n\t }\r\n\t else if (component instanc... | [
"0.6239104",
"0.6209226",
"0.6148551",
"0.59112936",
"0.5864564",
"0.58450055",
"0.5817325",
"0.5807991",
"0.5765024",
"0.5760657",
"0.57368946",
"0.572387",
"0.5690002",
"0.5639285",
"0.56229913",
"0.5621044",
"0.5603928",
"0.559415",
"0.55485183",
"0.5546284",
"0.55453616",... | 0.0 | -1 |
To get a copy of the current group of the solution. | public SolutionVector cloneSolutionVector() {
SolutionVector newSolutionVector
= new SolutionVector(this.solutionVector.length);
for (int i = 0; i < this.solutionVector.length; i++) {
newSolutionVector.set(i, this.solutionVector[i]);
}
return newSolutionVector;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final DodlesGroup getNewObjectGroup() {\n return newObjectGroup;\n }",
"public Group getGroup() { return cGroup; }",
"public Group getGroup() { return cGroup; }",
"public Group getGroup() { return cGroup; }",
"public Group getGroup() { return cGroup; }",
"public Group getGroup() { return... | [
"0.69808984",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
"0.6654809",
... | 0.0 | -1 |
To get the number of the components in the current group of solution | public int size() {
return this.solutionVector.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNumberOfComponents();",
"int countComponents() throws Exception;",
"public int getNumberOfComponents() {\n return components;\n }",
"public int components() {\n return numOfComponents;\n }",
"public int getNumberOfComponents() {\n\t\t\treturn nComponents;\n\t\t}",
"@Overrid... | [
"0.81344694",
"0.7595192",
"0.7587192",
"0.75819844",
"0.7366326",
"0.7243369",
"0.715765",
"0.7077997",
"0.7066381",
"0.7015341",
"0.68885",
"0.67448294",
"0.67448294",
"0.6586457",
"0.6553473",
"0.65292567",
"0.651622",
"0.6496339",
"0.64814186",
"0.64646745",
"0.6435195",
... | 0.5940112 | 98 |
Set runtime environment variable for chromedriver | public void Open_Browser()
{
System.setProperty("webdriver.chrome.driver", "drivers\\chromedriver.exe");
//Brower initiation
driver=new ChromeDriver();
//maximize browser window
driver.manage().window().maximize();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void setChromeDriverProperty() {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\automation_new_code\\\\onfs.alip.accounting\\\\BrowserDriver/chromedriver.exe\");\n\t\t}",
"public void setChromeDriver(){\n System.setProperty(\"webdriver.chrome.driver\", browserDriverPath);\n ... | [
"0.7723882",
"0.7398326",
"0.73428756",
"0.71360725",
"0.6831617",
"0.67497164",
"0.655762",
"0.6532432",
"0.6458216",
"0.6393295",
"0.6354042",
"0.6163517",
"0.6135367",
"0.6027528",
"0.6000634",
"0.59527004",
"0.5926993",
"0.5903626",
"0.5873123",
"0.582797",
"0.5826337",
... | 0.0 | -1 |
Script without referral of webelement | public void User_login()
{
driver.findElement(FB_Locators.Signin_Email).clear();
driver.findElement(FB_Locators.Signin_Email).sendKeys(username);
//Script using element referral..
WebElement Password_Element=driver.findElement(FB_Locators.Signin_password);
Password_Element.clear();
Password_Element.sendKeys(password);
//Login button using webelemnet referral
WebElement Login_btn_Element=driver.findElement(FB_Locators.Signin_btn);
Login_btn_Element.click();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void fw_javascriptClick() {\n WrapsDriver wd = (WrapsDriver) element;\n ((JavascriptExecutor) wd.getWrappedDriver()).executeScript(\"arguments[0].click();\", element);\n }",
"public void handleScript(HtmlObjects.Script t)\n {\n }",
"private native void eval(String s... | [
"0.59155446",
"0.5781837",
"0.5770972",
"0.5716749",
"0.551306",
"0.54230446",
"0.54110557",
"0.53301924",
"0.5282985",
"0.5258561",
"0.52493995",
"0.52393436",
"0.5233133",
"0.51926154",
"0.5181493",
"0.5162622",
"0.51584744",
"0.51327235",
"0.5110947",
"0.50939125",
"0.5074... | 0.0 | -1 |
no response at the mo' | public void vetoableAction(PermissibleActionEvent evt) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void nop() throws Exception {\n reply_ok();\n }",
"@Test\n public void testProcessNoResponse() {\n // NOTE: this json file is a RESPONSE, not a request\n String request = ResourceUtils.getResourceAsString(\"org/onap/policy/simulators/appclcm/appc.lcm.success.json\");\n ... | [
"0.7092719",
"0.7056818",
"0.7041487",
"0.68899256",
"0.68654394",
"0.6689704",
"0.6649218",
"0.647354",
"0.63617283",
"0.6320065",
"0.6320065",
"0.62918335",
"0.62533134",
"0.62533134",
"0.6206062",
"0.6197688",
"0.61820865",
"0.6153419",
"0.6144984",
"0.6096945",
"0.6081273... | 0.0 | -1 |
change key to String | @SuppressWarnings("unused")
private static String getKeyString(Key key)
{
return Base64.encode(key.getEncoded());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String keyToString(Object rawKey)\n {\n if (rawKey instanceof String) {\n return (String) rawKey;\n }\n return String.valueOf(rawKey);\n }",
"private String getString(String key) {\n return key;\r\n }",
"default String normalizeKey(String key) {\r\n\t\treturn... | [
"0.75118774",
"0.74704057",
"0.7341585",
"0.7319837",
"0.7034212",
"0.70149577",
"0.69957113",
"0.6923344",
"0.6907327",
"0.6901825",
"0.68231475",
"0.6791051",
"0.67898667",
"0.6787104",
"0.67645246",
"0.67324257",
"0.6731339",
"0.6712238",
"0.6658419",
"0.6638902",
"0.65820... | 0.73890084 | 2 |
change String to key | private static PublicKey getPublicKey(String keyStr)
throws Exception
{
return KeyFactory.getInstance(RSA).generatePublic(new X509EncodedKeySpec(Base64.decode(keyStr)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract String mapItemToKey(String str);",
"String setKey(String newKey);",
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"public abstract String mapKeyToItem(String str);",
"void setKey(String key);",
"void setKey(java.lang.String key);",
"void setKey(final St... | [
"0.76113594",
"0.74041814",
"0.73996806",
"0.72093105",
"0.6999955",
"0.6957717",
"0.69238275",
"0.67461634",
"0.6732936",
"0.65980625",
"0.65980625",
"0.65980625",
"0.65980625",
"0.65980625",
"0.65980625",
"0.6581003",
"0.6581003",
"0.6581003",
"0.6581003",
"0.6581003",
"0.6... | 0.0 | -1 |
change String to key | private static PrivateKey getPrivateKey(String keyStr)
throws Exception
{
return KeyFactory.getInstance(RSA).generatePrivate(new PKCS8EncodedKeySpec(Base64.decode(keyStr)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract String mapItemToKey(String str);",
"String setKey(String newKey);",
"default String normalizeKey(String key) {\r\n\t\treturn key.intern();\r\n\t}",
"public abstract String mapKeyToItem(String str);",
"void setKey(String key);",
"void setKey(java.lang.String key);",
"void setKey(final St... | [
"0.76113594",
"0.74041814",
"0.73996806",
"0.72093105",
"0.6999955",
"0.6957717",
"0.69238275",
"0.67461634",
"0.6732936",
"0.65980625",
"0.65980625",
"0.65980625",
"0.65980625",
"0.65980625",
"0.65980625",
"0.6581003",
"0.6581003",
"0.6581003",
"0.6581003",
"0.6581003",
"0.6... | 0.0 | -1 |
Remove viewpager_item.xml from ViewPager | @Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((RelativeLayout) object);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void destroyItem(ViewGroup container, int position, Object object) {\n ((ViewPager) container).removeView((RelativeLayout) object);\r\n \r\n }",
"@Override\n\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\t\t((ViewPager) container).removeView((Rel... | [
"0.73336196",
"0.69893646",
"0.6903435",
"0.6846102",
"0.672688",
"0.66912866",
"0.66459155",
"0.6580385",
"0.6556995",
"0.6510951",
"0.6478286",
"0.6467707",
"0.6450891",
"0.6281596",
"0.6265101",
"0.6170592",
"0.6149121",
"0.60744375",
"0.606723",
"0.5915758",
"0.59134984",... | 0.6144742 | 18 |
TODO Autogenerated method stub Inicia metodo holder.progressBar.setVisibility(View.VISIBLE); | @Override
public void onLoadingStarted(String arg0, View arg1) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void onPreExecute() {\n mProgressBar.setVisibility(View.VISIBLE);\n }",
"@Override\n public void esconderBarraProgresso(){\n progressbar.setVisibility(View.GONE);\n listView.setVisibility(View.VISIBLE);\n }",
... | [
"0.7876314",
"0.7666368",
"0.75840485",
"0.7557928",
"0.75538236",
"0.74817926",
"0.7382104",
"0.73802423",
"0.73787016",
"0.73681015",
"0.7325146",
"0.73191464",
"0.72451586",
"0.7231779",
"0.72314095",
"0.7221717",
"0.7203386",
"0.7202192",
"0.71148115",
"0.7107757",
"0.708... | 0.0 | -1 |
TODO Autogenerated method stub Cancelar holder.progressBar.setVisibility(View.GONE); | @Override
public void onLoadingCancelled(String arg0, View arg1) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void goneProgress(){\n mProgressBar.setVisibility(View.GONE);\n }",
"@Override\n\t\t\tpublic void onLoadingCancelled(String imageUri, View view) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t... | [
"0.75403315",
"0.7422775",
"0.72800326",
"0.72531515",
"0.72015125",
"0.7168556",
"0.7133209",
"0.70456994",
"0.7017495",
"0.67753035",
"0.6735299",
"0.67202985",
"0.66988826",
"0.6651375",
"0.66331464",
"0.6567625",
"0.6541337",
"0.6461464",
"0.6444796",
"0.64394706",
"0.640... | 0.0 | -1 |
Creates a new instance of SpectrumSearcher | public SpectrumSearcher(ArrayList <File> lipidLibs, ArrayList <String> mgfFiles,
ArrayList <String> mzxmlFile, JProgressBar progressBar, Double ms1Tol,
Double ms2Tol, int maxResults, Double minMassCutoff)
{
//Update class fields
this.minMS2Mass = minMassCutoff;
this.lipidLibs = lipidLibs;
SpectrumSearcher.progressBar = progressBar;
this.ms1Tol = ms1Tol;
this.ms2Tol = ms2Tol;
this.mgfFiles = mgfFiles;
this.mzxmlFiles = mzxmlFile;
massBinSize = ms1Tol/10.0;
minMass = 999.0;
maxMass = 0.0;
librarySpectra = new ArrayList<LibrarySpectrum>();
fattyAcidsDB = new ArrayList<FattyAcid>();
sampleMS2Spectra = new ArrayList<SampleSpectrum>();
this.maxResults = maxResults;
numSpectra = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SamFilterParams create() {\n return new SamFilterParams(this);\n }",
"public static QRScanner newInstance() {\n QRScanner fragment = new QRScanner();\n return fragment;\n }",
"public MagicSearch createMagicSearch();",
"public static synchronized ClubSearch getInstance()\r\n ... | [
"0.5696496",
"0.5576217",
"0.54888535",
"0.53239214",
"0.5323394",
"0.53157073",
"0.5312836",
"0.5263841",
"0.52046746",
"0.5171699",
"0.5142163",
"0.510441",
"0.5080646",
"0.5065191",
"0.5008993",
"0.5005085",
"0.49689204",
"0.49635428",
"0.4962464",
"0.49597073",
"0.4944288... | 0.55101067 | 2 |
Method to populate hash array and search all spectra | public void runSpectraSearch(ArrayList <File> lipidLibs, double mzTol) throws CustomException, IOException
{
this.lipidLibs = lipidLibs;
//Verifies no result files are open
checkFileStatus();
//Read fatty acids
readFattyAcids("src\\backup\\FattyAcids.csv");
//Read in MSP Files
try
{
readMSP();
}
catch (Exception e)
{
CustomError ce = new CustomError("Error loading library .msp", e);
}
//Sort arrays by mass, lowest to highest
Collections.sort(librarySpectra);
updateProgress(100,"% - Sorting Libraries",true);
//Bin MSP LibrarySpectra
binMasses();
updateProgress(0,"% - Searching Spectra",true);
//Read in all mgf files
for (int i=0; i<mgfFiles.size(); i++)
{
timeStart = System.nanoTime();
numSpectra = 0;
//Read in spectra and search
readMGF(mgfFiles.get(i));
//Iterate through spectra and match
for (int j=0; j<sampleMS2Spectra.size(); j++)
{
matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);
}
//Calculate purity values
for (int j=0; j<sampleMS2Spectra.size(); j++)
{
sampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol);
}
//Write ouput files for mgf
try
{
writeResults(sampleMS2Spectra,mgfFiles.get(i),maxResults);
}
catch (IOException e)
{
CustomError ce = new CustomError("Please close "+mgfFiles.get(i)+" and re-search the data",null);
}
//Clear sample spectra
sampleMS2Spectra = new ArrayList<SampleSpectrum>();
updateProgress((int)((Double.valueOf(i+1)
/(Double.valueOf(mgfFiles.size())))*100.0),"% - Searching Spectra",true);
}
//Create mzxmlparser
MZXMLParser parser = new MZXMLParser();
//Read in mzxml files
for (int i=0; i<mzxmlFiles.size(); i++)
{
timeStart = System.nanoTime();
numSpectra = 0;
//Parse MZXML
parser.readFile(mzxmlFiles.get(i));
//Create SampleSpectrum objects
for (int j=0; j<parser.sampleSpecArray.size(); j++)
{
sampleMS2Spectra.add(parser.sampleSpecArray.get(j));
}
//Iterate through spectra and match
for (int j=0; j<sampleMS2Spectra.size(); j++)
{
matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);
}
//Calculate purity values
for (int j=0; j<sampleMS2Spectra.size(); j++)
{
sampleMS2Spectra.get(j).calcPurityAll(fattyAcidsDB, mzTol);
}
//Write ouput files for mzxml
writeResults(sampleMS2Spectra,mzxmlFiles.get(i),maxResults);
//Clear sample spectra
sampleMS2Spectra = new ArrayList<SampleSpectrum>();
updateProgress((int)((Double.valueOf(i+1)
/(Double.valueOf(mgfFiles.size())))*100.0),"% - Searching Spectra",true);
}
updateProgress(100,"% - Completed",true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void runSpectraSearchOptimizer()\n\t{\n\t\t//Load in information from each library file\n\t\ttry\n\t\t{\n\t\t\t//Read in MSP Files\n\t\t\treadMSP();\n\n\t\t\t//Sort arrays by mass, lowest to highest\n\t\t\tCollections.sort(librarySpectra);\n\t\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t\t... | [
"0.5829255",
"0.576178",
"0.5721972",
"0.5661485",
"0.5415811",
"0.5327088",
"0.5253078",
"0.52527213",
"0.51732355",
"0.51303864",
"0.5042643",
"0.5005838",
"0.4993331",
"0.498472",
"0.49845177",
"0.49338797",
"0.4910225",
"0.4901483",
"0.4895571",
"0.48798406",
"0.48358196"... | 0.48927104 | 19 |
Throws exception if a file is open | private void checkFileStatus() throws CustomException, IOException
{
//For all .mgf files
for (int i=0; i<mgfFiles.size(); i++)
{
String resultFileName =
mgfFiles.get(i).substring(0,mgfFiles.get(i).lastIndexOf("."))+"_Results.csv";
//TODO: Cannot write files if checking for file.
/*
if (isFileUnlocked(resultFileName))
throw new CustomException("Please close "+resultFileName, null);
*/
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testFileOpen() {\n \n FileHandler fileToTest;\n \n fileToTest = new FileHandler(\"Kalle.xml\");\n \n try {\n fileToTest.openFile();\n fail(\"Should have raised a fileNotFoundException\");\n }\n catch (FileNotFoundEx... | [
"0.7128262",
"0.68813664",
"0.669002",
"0.6629287",
"0.66210186",
"0.6613705",
"0.6556221",
"0.6522546",
"0.6517968",
"0.646438",
"0.643477",
"0.63898164",
"0.63892996",
"0.63669205",
"0.63122326",
"0.63029814",
"0.62990683",
"0.6267437",
"0.62122816",
"0.62055403",
"0.619645... | 0.57774466 | 61 |
Method to populate hash array and search all spectra | public void runSpectraSearchOptimizer()
{
//Load in information from each library file
try
{
//Read in MSP Files
readMSP();
//Sort arrays by mass, lowest to highest
Collections.sort(librarySpectra);
updateProgress(100,"% - Sorting Libraries",true);
//Bin MSP LibrarySpectra
binMasses();
for (double l=0.01; l<3.01; l=l+.01)
{
for (double m=0.01; m<3.01; m=m+.01)
{
this.intWeight = l;
this.massWeight = m;
//Read in all mgf files
for (int i=0; i<mgfFiles.size(); i++)
{
updateProgress((int)(Double.valueOf(i+1)
/(Double.valueOf(mgfFiles.size())*100.0)),"% - Loading Spectra",true);
timeStart = System.nanoTime();
numSpectra = 0;
//Read in spectra and search
readMGF(mgfFiles.get(i));
//Iterate through spectra and match
for (int j=0; j<sampleMS2Spectra.size(); j++)
{
matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);
}
//Write ouput files for mgf
writeResults(sampleMS2Spectra,mgfFiles.get(i)+"_"+l+"_"+m+".csv",maxResults);
//Clear sample spectra
sampleMS2Spectra = new ArrayList<SampleSpectrum>();
}
//Create mzxmlparser
MZXMLParser parser = new MZXMLParser();
//Read in mzxml files
for (int i=0; i<mzxmlFiles.size(); i++)
{
timeStart = System.nanoTime();
numSpectra = 0;
//Parse MZXML
parser.readFile(mzxmlFiles.get(i));
//Create SampleSpectrum objects
for (int j=0; j<parser.sampleSpecArray.size(); j++)
{
sampleMS2Spectra.add(parser.sampleSpecArray.get(j));
}
//Iterate through spectra and match
for (int j=0; j<sampleMS2Spectra.size(); j++)
{
matchLibrarySpectra(sampleMS2Spectra.get(j), massBinSize, ms1Tol, ms2Tol);
}
//Write ouput files for mzxml
writeResults(sampleMS2Spectra,mzxmlFiles.get(i)+l+"_"+m+".csv",maxResults);
//Clear sample spectra
sampleMS2Spectra = new ArrayList<SampleSpectrum>();
}
updateProgress(100,"% - Completed",true);
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private List<String> getSpectrumIdsFound()\r\n\t{\r\n\t\treturn this.spectrumIdsFound;\r\n\t}",
"private List<SpectrumInterface> fetchSpectrum(List<String> spectrumIds)\r\n\t{\r\n\t\tif (spectrumIds == null)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tsetSpectrumIdsTarget(spectrumIds);\r\n\t\t/*\r\n\t\t * Res... | [
"0.5762133",
"0.5721538",
"0.5661652",
"0.54163426",
"0.5326599",
"0.5254807",
"0.5254183",
"0.5173523",
"0.5130653",
"0.5043501",
"0.5006661",
"0.49937385",
"0.49846593",
"0.49843168",
"0.49337545",
"0.49101982",
"0.4902364",
"0.4895364",
"0.48926064",
"0.48808235",
"0.48352... | 0.5829713 | 0 |
Returns array of all transition type definition objects for given fatty acids | private static ArrayList<TransitionType> createTransitionTypes(ArrayList<String> typeArray)
{
ArrayList<TransitionType> definitions = new ArrayList<TransitionType>();
//Create static fragment class
definitions.add(new TransitionType("Fragment",null,false,false,0));
//Create static neutral loss class
definitions.add(new TransitionType("Neutral Loss",null,false,true,0));
//For all fatty acid type strings
for (int i=0; i<typeArray.size(); i++)
{
//Create moiety fragment class
definitions.add(new TransitionType(typeArray.get(i)+" Fragment",typeArray.get(i),true,false,1));
//Create moiety neutral loss class
definitions.add(new TransitionType(typeArray.get(i)+" Neutral Loss",typeArray.get(i),true,true,1));
}
//Create cardiolipin DG fragment class
definitions.add(new TransitionType("Cardiolipin DG Fragment","Alkyl",true,false,2));
//Create PUFA neutral loss class
definitions.add(new TransitionType("PUFA Fragment","PUFA",true,false,1));
//Create PUFA fragment class
definitions.add(new TransitionType("PUFA Neutral Loss","PUFA",true,true,1));
return definitions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<DeclarationNaissance> getAllActe();",
"public String[] getFfTypes(){\n return ffc.getFfTypes();\n }",
"public Type[] types();",
"private Collection<TypeDeclaration> getAllTypes() {\n if (allTypes != null) {\n return allTypes;\n }\n allTypes = new ArrayList<Type... | [
"0.5810042",
"0.51572037",
"0.5151993",
"0.5114111",
"0.5103796",
"0.49672037",
"0.49190247",
"0.49144533",
"0.48201513",
"0.48100865",
"0.4792576",
"0.47901773",
"0.47796726",
"0.4772674",
"0.47649696",
"0.4757108",
"0.47526282",
"0.47403654",
"0.47279945",
"0.47276577",
"0.... | 0.5671461 | 1 |
write results to folder where .mgf file is | public void writeResults(ArrayList<SampleSpectrum> spectra, String mgfFilename, int maxResults) throws FileNotFoundException
{
File mgfFile = new File(mgfFilename);
String parentFolder = mgfFile.getParent();
String resultFileName = mgfFile.getName().substring(0,mgfFile.getName().lastIndexOf("."))+"_Results.csv";
//Check if results exists and if not create results folder in mgf file folder
File resultsDir = new File(parentFolder);
if (!resultsDir.exists()) resultsDir.mkdir();
PrintWriter pw = new PrintWriter(resultsDir.toString()+"\\"+resultFileName);
pw.println("MS2 ID,Retention Time (min),Rank,Identification,"
+ "Precursor Mass,Library Mass,Delta m/z,Dot Product,Reverse Dot Product,Purity,Spectral Components,Optimal Polarity,LipiDex Spectrum,Library,Potential Fragments");
for (int i=0; i<spectra.size(); i++)
{
if (spectra.get(i).idArray.size() > 0)
{
if(spectra.get(i).idArray.get(0).dotProduct>1)
{
pw.println(spectra.get(i).toString(maxResults));
}
}
}
pw.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeResults() {\n gfmBroker.storeResults(this.responses, fileOutputPath);\n }",
"private void createOutputFiles(){\n\t\tFile folder = new File(C.appFolderPath + C.DEBUG_FOLDER);\n\t\tboolean success = true;\n\t\tif(folder.exists()){\n\t\t\t// erase the folder\n\t\t\tDeleteRecursive(folder)... | [
"0.6615461",
"0.62997544",
"0.62638235",
"0.6152965",
"0.61506945",
"0.61213684",
"0.5881159",
"0.58398974",
"0.5800974",
"0.5791863",
"0.5774835",
"0.57669646",
"0.57241815",
"0.5711406",
"0.5702353",
"0.56755877",
"0.5675216",
"0.56533587",
"0.56429386",
"0.56415737",
"0.56... | 0.61910826 | 3 |
/ Create array of bins in which to store objects Bins are indexed by precursor mass | public void createBins(int arraySize)
{
//Check if any spectra from each polarity has been created
if (librarySpectra.size()>0)
{
countBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin
addedBin = new int[arraySize]; //Array to store number of positive spectra stored in each bin
//Fill all positive bins with zeroes
for (int i=0; i<countBin.length; i++)
{
countBin[i] = 0;
addedBin[i] = 0;
}
//Create the array to store the actual spectra objects
massBin = new LibrarySpectrum[arraySize][];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<B> getBins() {\n return ImmutableList.copyOf(bins);\n }",
"private void computeHistogramBins() {\r\n int nBins = (int) Math.ceil(hismax / binWidth);\r\n histoBins = new double[nBins];\r\n for (int i = 0; i < nBins; i++) {\r\n histoBins[i] = binWidth * (double... | [
"0.6374558",
"0.63650084",
"0.6178943",
"0.60915816",
"0.60003185",
"0.59288645",
"0.58019674",
"0.57945454",
"0.5755405",
"0.5672623",
"0.5600853",
"0.5586996",
"0.55822164",
"0.54853445",
"0.54682595",
"0.54424804",
"0.543131",
"0.540241",
"0.5266186",
"0.5206013",
"0.51940... | 0.6170257 | 3 |
Convert a precursor mass to the correct bin number | public int findBinIndex(Double precursor, Double binSize, Double minMass)
{
return (int)((precursor-minMass)/binSize);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setInBin(int n) {\n inBin=Translate.decTobinN(n, 4);\n }",
"public void setParBin(int n) {\n parBin=Translate.decTobinN(n, 16);\n }",
"public static float mw2pu(float mw) {return mw/100F;}",
"public void setOpBin(int n) {\n opBin=Translate.... | [
"0.5666311",
"0.54282767",
"0.5266754",
"0.523452",
"0.52031136",
"0.5172806",
"0.511719",
"0.5109256",
"0.50935847",
"0.5090343",
"0.5060429",
"0.50282335",
"0.5023554",
"0.50180316",
"0.4996441",
"0.49959308",
"0.4991634",
"0.4987769",
"0.4985438",
"0.4976965",
"0.496465",
... | 0.6987372 | 0 |
Calculate the correct array size based on a mass range | public int calcArraySize(Double binSize, Double minMass, Double maxMass)
{
return (int)((maxMass - minMass)/binSize)+1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract long[] GetApproximateSizes(Range[] range, int n) throws IOException, DecodeFailedException, BadFormatException;",
"int calculateCapacity(int[] vesselArray);",
"public abstract double getRangeSize();",
"abstract int calculateMaximumSize(int axis);",
"abstract int calculateMinimumSize(int axi... | [
"0.6741079",
"0.6601641",
"0.65393627",
"0.6250966",
"0.60184085",
"0.597105",
"0.5902264",
"0.57673264",
"0.5755311",
"0.5726337",
"0.5714629",
"0.57143426",
"0.56850386",
"0.5638472",
"0.5615592",
"0.5614791",
"0.557017",
"0.551729",
"0.55097264",
"0.55094475",
"0.5492793",... | 0.72227806 | 0 |
Calculate the difference between two masses in ppm | public Double calcPPMDiff(Double mass1, Double mass2)
{
return (Math.abs(mass1 - mass2)/(mass2))*1000000;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public double forceBetween(Planet p1, Planet p2, double distance){ \n double rSquared = Math.pow(distance, 2);\n return (G * p1.mass * p2.mass) / rSquared;\n }",
"public double masse () {return this.volume()*this.element.masseVolumique();}",
"private static double calculateForce(doubl... | [
"0.58917284",
"0.58411735",
"0.58348024",
"0.5755608",
"0.57011175",
"0.5668106",
"0.5631191",
"0.5610723",
"0.5495688",
"0.5410227",
"0.5378318",
"0.5375232",
"0.53535205",
"0.53382725",
"0.53336984",
"0.53312784",
"0.5330097",
"0.5327048",
"0.5317741",
"0.53171057",
"0.5310... | 0.6927625 | 0 |
Find the minimum value of a range needed to search based on a precursor mass | public Double findMinPPMRange(Double mass, Double ppm)
{
return (mass - ((ppm/1000000.0)*mass));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Double findMinMassRange(Double mass, Double mzTol)\n\t{\n\t\treturn (mass - mzTol);\n\t}",
"double getMin();",
"double getMin();",
"public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}",
"public T findMin();",
"public... | [
"0.7134856",
"0.6608645",
"0.6608645",
"0.65454",
"0.648862",
"0.6477615",
"0.64712346",
"0.6461058",
"0.6454667",
"0.6448383",
"0.6370147",
"0.63555425",
"0.63442844",
"0.63122857",
"0.63040495",
"0.6266372",
"0.625926",
"0.6246922",
"0.62174547",
"0.6207044",
"0.6197404",
... | 0.76326406 | 0 |
Find the maximum value of a range needed to search based on a precursor mass | public Double findMaxPPMRange(Double mass, Double ppm)
{
return (mass + ((ppm/1000000.0)*mass));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Double findMaxMassRange(Double mass, Double mzTol)\n\t{\n\t\treturn (mass + mzTol);\n\t}",
"public Double findMinPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass - ((ppm/1000000.0)*mass));\n\t}",
"double getMax();",
"double getMax();",
"Double getMaximumValue();",
"public int best(){\n ... | [
"0.7230798",
"0.64268404",
"0.64238477",
"0.64238477",
"0.62994844",
"0.6271512",
"0.6255003",
"0.6230342",
"0.6147841",
"0.61439705",
"0.61406004",
"0.613108",
"0.613108",
"0.613108",
"0.613108",
"0.613108",
"0.613108",
"0.6093729",
"0.6076454",
"0.6029294",
"0.59997225",
... | 0.7444349 | 0 |
Find the minimum value of a range needed to search based on a precursor mass | public Double findMinMassRange(Double mass, Double mzTol)
{
return (mass - mzTol);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Double findMinPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass - ((ppm/1000000.0)*mass));\n\t}",
"double getMin();",
"double getMin();",
"public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize);\n\t}",
"public T findMin(... | [
"0.76334864",
"0.66088736",
"0.66088736",
"0.654518",
"0.64869964",
"0.6477183",
"0.647114",
"0.6459666",
"0.6453789",
"0.64490724",
"0.6370561",
"0.63538647",
"0.63425833",
"0.631204",
"0.6302553",
"0.6266043",
"0.6257665",
"0.6246193",
"0.6216752",
"0.6206888",
"0.6197156",... | 0.7134872 | 1 |
Find the maximum value of a range needed to search based on a precursor mass | public Double findMaxMassRange(Double mass, Double mzTol)
{
return (mass + mzTol);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Double findMaxPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass + ((ppm/1000000.0)*mass));\n\t}",
"public Double findMinPPMRange(Double mass, Double ppm)\n\t{\n\t\treturn (mass - ((ppm/1000000.0)*mass));\n\t}",
"double getMax();",
"double getMax();",
"Double getMaximumValue();",
"public i... | [
"0.74460304",
"0.64273006",
"0.64234567",
"0.64234567",
"0.6299311",
"0.6270026",
"0.6254972",
"0.6230822",
"0.6148608",
"0.61442006",
"0.61428",
"0.61302394",
"0.61302394",
"0.61302394",
"0.61302394",
"0.61302394",
"0.61302394",
"0.6093566",
"0.6076707",
"0.6027815",
"0.6000... | 0.7233915 | 1 |
A method to bin all precursor masses | public void binMasses()
{
//Create arrays
createBins(calcArraySize(massBinSize,minMass, maxMass));
//Check if any spectra from each polarity has been created
if (librarySpectra.size()>0)
{
//Populate count array to correctly initialize array size for positive library spectra
for (int i=0; i<librarySpectra.size(); i++)
{
countBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)] ++;
}
updateProgress(17,"% - Creating Composite Library",true);
//Use count bin to initialize new arrays to place positive spectra into hash table
for (int i=0; i<countBin.length; i++)
{
massBin[i] = new LibrarySpectrum[countBin[i]];
}
updateProgress(33,"% - Creating Composite Library",true);
//Populate spectrum arrays for positive spectra
for (int i=0; i<librarySpectra.size(); i++)
{
massBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]
[addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]] = librarySpectra.get(i);
addedBin[findBinIndex(librarySpectra.get(i).precursor,massBinSize,minMass)]++;
}
updateProgress(50,"% - Creating Composite Library",true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void calculateBPRange() {\n\t\tbroadPhaseLength = 0.0f;\n\t\tfor (Vector2f p : points) {\n\t\t\tbroadPhaseLength = Math.max(broadPhaseLength, Math.abs(p.length()));\n\t\t}\n\t}",
"public int findBinIndex(Double precursor, Double binSize, Double minMass)\n\t{\n\t\treturn (int)((precursor-minMass)/binSize... | [
"0.5577444",
"0.5472049",
"0.5099241",
"0.50893784",
"0.50516",
"0.50495577",
"0.4946409",
"0.49407056",
"0.49308822",
"0.48964196",
"0.48663893",
"0.48634356",
"0.48419464",
"0.48409238",
"0.47918004",
"0.4764046",
"0.4757855",
"0.47374913",
"0.47360078",
"0.47130242",
"0.47... | 0.6324056 | 0 |
Search all experimental mass spectra against libraries | public void matchLibrarySpectra(SampleSpectrum ms2, Double massBinSize, Double ms1Tol, Double ms2Tol)
{
Double dotProd = 0.0;
Double reverseDotProd = 0.0;
if (minMass < 9998.0 && ms2.precursor<maxMass && ms2.precursor>minMass)
{
//Scale MS2s to maximum peak in spectra (0-1000) and remove peaks below .5%
ms2.scaleIntensities();
// Find range of mass bins which need to be searched
int minIndex = findBinIndex(findMinMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);
int maxIndex = findBinIndex(findMaxMassRange(ms2.precursor,ms1Tol),massBinSize,minMass);
if (minIndex<0) minIndex = 0;
if (maxIndex>(massBin.length-1)) maxIndex = massBin.length-1;
//Iterate through this mass bin range
for (int i=minIndex; i<=maxIndex; i++)
{
//If the bin contains library spectra
if (countBin[i]>0)
{
//For all spectra which are in the same mass bin
for (int j=0; j<addedBin[i]; j++)
{
if (Math.abs(massBin[i][j].precursor-ms2.precursor)<ms1Tol)
{
//Calculate the dot product (spectral similarity) between the two spectra
dotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,false, massWeight, intWeight);
reverseDotProd = ms2.calcDotProduct(massBin[i][j].transitionArray,ms2Tol,true, massWeight, intWeight);
if (dotProd>1)
{
//Add identification to array
ms2.addID(massBin[i][j], dotProd, reverseDotProd,ms2Tol);
}
}
}
}
}
//Sort by dot product
Collections.sort(ms2.idArray);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void runSpectraSearchOptimizer()\n\t{\n\t\t//Load in information from each library file\n\t\ttry\n\t\t{\n\t\t\t//Read in MSP Files\n\t\t\treadMSP();\n\n\t\t\t//Sort arrays by mass, lowest to highest\n\t\t\tCollections.sort(librarySpectra);\n\t\t\tupdateProgress(100,\"% - Sorting Libraries\",true);\n\n\t\t\t... | [
"0.6897322",
"0.6218383",
"0.57389843",
"0.53381425",
"0.5106041",
"0.5049054",
"0.4876247",
"0.4814938",
"0.48121658",
"0.4807421",
"0.48021513",
"0.4795233",
"0.47167805",
"0.47158766",
"0.47146517",
"0.46816978",
"0.46777788",
"0.46773005",
"0.46725062",
"0.46679884",
"0.4... | 0.57605815 | 2 |
Method to read in all .msp files and add them to positive and negative arrays | public void readMSP() throws IOException
{
String line = ""; //Line for reading
String fragType = ""; //Fragment type
String polarity = ""; //Polarity of entry
Double precursor = 0.0; //Precursor mass
String name = ""; //Lipid name
LibrarySpectrum entryTemp = null; //Temp library entry
boolean peakStart = false; //Boolean if peak list beginning
boolean isLipidex = false; //Boolean if spectra was generated using LipiDex
boolean optimalPolarity = false; //Boolean if optimal polarity for class
String[] split; //String array for parsing transitions
for (int i=0; i<lipidLibs.size(); i++)
{
updateProgress((int)(Double.valueOf(i+1)
/Double.valueOf(lipidLibs.size())*100.0),"% - Reading Libraries",true);
BufferedReader reader = new BufferedReader(new FileReader(lipidLibs.get(i)));
//read line if not empty
while ((line = reader.readLine()) != null)
{
//read in retention time
if (line.contains("Name:") || line.contains("NAME:"))
{
//Add entry
if (precursor>0.0)
addSpectrum(entryTemp);
//Erase entry
polarity = "";
precursor = 0.0;
name = "";
fragType = "";
peakStart = false;
isLipidex = false;
optimalPolarity = false;
if (line.contains("]+")) polarity = "+";
else polarity = "-";
name = line.substring(line.indexOf(":")+1);
}
//read in optimal polarity
if (line.contains("OptimalPolarity=true"))
{
optimalPolarity = true;
}
if (line.contains("LipiDex")) isLipidex = true;
if (line.contains("Num Peaks:"))
{
peakStart = true;
entryTemp = new LibrarySpectrum(precursor, polarity, name, lipidLibs.get(i).getName(), isLipidex, optimalPolarity);
}
if (peakStart && line.contains(".") && !line.contains("Num"))
{
if (line.contains(" "))
split = line.split(" ");
else
split = line.split(" ");
if (isLipidex)
fragType = line.substring(line.indexOf("\"")+1,line.lastIndexOf("\""));
if (precursor-Double.valueOf(split[0])>2.0)
entryTemp.addFrag(Double.valueOf(split[0]), Double.valueOf(split[1]), fragType, getTransitionType(fragType));
}
if (line.contains("PRECURSORMZ:"))
{
precursor = Double.valueOf(line.substring(line.lastIndexOf(" ")+1));
}
}
addSpectrum(entryTemp);
reader.close();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public float[] accumulateSimpleMixFiles(ArrayList<File> files){\r\n\t\t\tfloat[] returnValue = new float[10];\r\n\t\t\tfloat[] values = new float[10];\r\n\t\t\t\r\n\t\t for(File file:files){\t\t\t\t\t\r\n\t\t BufferedReader reader;\r\n\t\t try{\r\n\t\t reader = new BufferedReader(new F... | [
"0.6194019",
"0.5927496",
"0.5710768",
"0.56035817",
"0.55440855",
"0.52651185",
"0.5216804",
"0.5209081",
"0.51714736",
"0.51558506",
"0.5140903",
"0.5125931",
"0.51069903",
"0.5082565",
"0.5065659",
"0.50633043",
"0.5038315",
"0.50272447",
"0.5000327",
"0.4996693",
"0.49844... | 0.5392958 | 5 |
Method to add spectrum to proper array and update mass ranges | public void addSpectrum(LibrarySpectrum spectrum)
{
librarySpectra.add(spectrum);
if (spectrum.precursor > maxMass) maxMass = spectrum.precursor;
if (spectrum.precursor < minMass) minMass = spectrum.precursor;
spectrum.scaleIntensities();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addSpectrum(Spectrum spectrum) {\n add(spectrum);\n }",
"private static GeneralMassSpectrum calculateSpectrumFromBasisSpectra(final List<GeneralMassSpectrum> isotopeSpectrums,\n\t\t\tfinal int maxValues, final double minValue, final int charge, final int adduct, final Polarity polarity,\n\t... | [
"0.6156199",
"0.582469",
"0.57082355",
"0.5698598",
"0.56104803",
"0.55037117",
"0.52618366",
"0.52350855",
"0.52060354",
"0.5178714",
"0.5126516",
"0.51251763",
"0.506341",
"0.505852",
"0.50573266",
"0.5050194",
"0.50480676",
"0.4985145",
"0.4948936",
"0.49156415",
"0.491360... | 0.6675819 | 0 |
Return transition type object corresponding to provided string | private static TransitionType getTransitionType(String s)
{
for (int i=0; i<transitionTypes.size(); i++)
{
if (transitionTypes.get(i).name.equals(s)) return transitionTypes.get(i);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static ResourceOperation.Type parseType(String str) {\n if (StringComparator.isSameIgnoreCase(str, \"added\")) {\n return ADDED;\n } else if (StringComparator.isSameIgnoreCase(str, \"removed\")) {\n return REMOVED;\n } else if (StringComparator.... | [
"0.69923276",
"0.6765903",
"0.6695597",
"0.63259107",
"0.63014764",
"0.6278109",
"0.6252124",
"0.6128643",
"0.61250174",
"0.60847586",
"0.60802525",
"0.607993",
"0.6067634",
"0.604857",
"0.6037458",
"0.60303104",
"0.6012987",
"0.59984297",
"0.59912485",
"0.59825057",
"0.59654... | 0.78608096 | 0 |
Processes requests for both HTTP GET and POST methods. | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String url = ERROR;
String msg;
try {
String bookID = request.getParameter("txtBookID");
String title = request.getParameter("txtTitle");
String author = request.getParameter("txtAuthor");
String catID = request.getParameter("cbCat");
String des = request.getParameter("txtDes");
float price = Float.parseFloat(request.getParameter("txtPrice"));
int quantity = Integer.parseInt(request.getParameter("txtQuantity"));
Date importDate = new Date();
String status = "Active";
String appPath = request.getServletContext().getRealPath("/");
String fullSavePath;
if (appPath.endsWith("\\")) {
fullSavePath = appPath + SAVE_DIRECTORY;
} else {
fullSavePath = appPath + "\\" + SAVE_DIRECTORY;
}
File fileSaveDir = new File(fullSavePath);
if (!fileSaveDir.exists()) {
fileSaveDir.mkdir();
}
String image = "";
for (Part part : request.getParts()) {
String fileName = MyUtils.extractFileName(part);
if (fileName != null && fileName.length() > 0) {
String extension = fileName.substring(fileName.lastIndexOf("."));
String filePath = fullSavePath + "\\" + bookID + extension;
image = bookID + extension;
part.write(filePath);
}
}
BookDTO dto = new BookDTO(bookID, title, catID, author, des, image, status, price, quantity, importDate);
BookDAO dao = new BookDAO();
if (dao.update(dto)) {
msg = "Update success";
url = SUCCESS;
} else {
msg = "Update failed";
url = FAILED;
}
request.setAttribute("MSG", msg);
} catch (SQLException | NamingException e) {
log("ERROR at UpdateController: " + e.getMessage());
msg = "ERROR at UpdateController";
request.setAttribute("ERROR", msg);
} finally {
request.getRequestDispatcher(url).forward(request, response);
}
} | {
"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.7004024",
"0.66585696",
"0.66031146",
"0.6510023",
"0.6447109",
"0.64421695",
"0.64405906",
"0.64321136",
"0.6428049",
"0.6424289",
"0.6424289",
"0.6419742",
"0.6419742",
"0.6419742",
"0.6418235",
"0.64143145",
"0.64143145",
"0.6400266",
"0.63939095",
"0.63939095",
"0.6392... | 0.0 | -1 |
Handles the HTTP GET method. | @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"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.7589609",
"0.71665615",
"0.71148175",
"0.705623",
"0.7030174",
"0.70291144",
"0.6995984",
"0.697576",
"0.68883485",
"0.6873811",
"0.6853569",
"0.6843572",
"0.6843572",
"0.6835363",
"0.6835363",
"0.6835363",
"0.68195957",
"0.6817864",
"0.6797789",
"0.67810035",
"0.6761234",... | 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.8763362",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.87320423",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8698972",
"0.8531154",
"0.8531154",
"0.85280526",
"0.85... | 0.0 | -1 |
A SnippetStorage object handles generated snippet sets by name so that there is a history of created sets that all can be retrieved. | public interface SnippetStorage {
/**
* Get the latest added set.
* @return The last added snippet set.
*/
SnippetSet getLatestSet();
boolean addSet(SnippetSet snippetSet);
boolean addSet(String userName, SnippetSet snippetSet);
boolean removeSet(String snippetSetName);
boolean removeSet(String userName, String snippetSetName);
SnippetSet renameSet(String oldSetName, String newSetName);
SnippetSet renameSet(String userName, String oldSetName, String newSetName);
List<String> getWorkingSetNames();
List<String> getWorkingSetNames(String userName);
String[] storedContextIds();
SnippetSet getSet(String id);
SnippetSet getSet(String userName, String id);
Set<String> getAllSetNames();
void deleteSavedSets(List<String> savedSetNames );
void deleteSavedSets(String userName, List<String> savedSetNames );
boolean restoreContext(String id);
boolean storeContext(String id);
void setLogNote(String log, SnippetSet snippetSet);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"SnippetSet getLatestSet();",
"public interface NamedStorage extends Iterable<String>, AutoCloseable {\n\n /**\n * Gets data stored by specified key and puts it to the provided stream.\n * Does not close given stream.\n * @param key data key\n * @param stream stream to process data\n * @ret... | [
"0.55348146",
"0.54461217",
"0.5187794",
"0.5097167",
"0.49962378",
"0.4977272",
"0.49436858",
"0.49182454",
"0.49152753",
"0.48996297",
"0.48631203",
"0.48579276",
"0.4847698",
"0.48458296",
"0.48435307",
"0.4832006",
"0.48286483",
"0.48083505",
"0.47816494",
"0.47783276",
"... | 0.7806722 | 0 |
Get the latest added set. | SnippetSet getLatestSet(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DataPoint getLastAddedPoint() {\n return lastAddedPoint;\n }",
"public V getLatest() {\n return lastItemOfList(versions);\n }",
"Set<Art> getRecentArt();",
"public Item getLast();",
"public SeleniumQueryObject last() {\n\t\treturn LastFunction.last(this, this.elements);\n\t}",
"publi... | [
"0.593924",
"0.5895918",
"0.58155596",
"0.5815232",
"0.57337934",
"0.57306385",
"0.56788236",
"0.56741613",
"0.5570328",
"0.55568117",
"0.55558175",
"0.553951",
"0.55286264",
"0.5527051",
"0.5527051",
"0.5518607",
"0.5511855",
"0.54994404",
"0.5488071",
"0.5460423",
"0.545940... | 0.75324726 | 0 |
TODO Autogenerated method stub | @Override
public void processActivate(String username, String validateCode) throws ParseException, ServiceException {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
User user=userDao.findUserByLoginName(username);
//验证用户是否存在
if(user!=null) {
//验证用户激活状态
if(user.getStatus()==0) {
///没激活
Date currentTime = new Date();//获取当前时间
Date registerTime = user.getRegisterTime();
Date d1 =dateFormat.parse(dateFormat.format(currentTime));
Date d2 =dateFormat.parse(dateFormat.format(registerTime));
long diff = d1.getTime() - d2.getTime();
long days = diff / (1000 * 60 * 60 * 24);
long hours = (diff-days*(1000 * 60 * 60 * 24))/(1000* 60 * 60);
long minutes = (diff-days*(1000 * 60 * 60 * 24)-hours*(1000* 60 * 60))/(1000* 60);
//验证链接是否过期
if(minutes < 15) {
//验证激活码是否正确
if(validateCode.equals(user.getValidateCode())) {
//激活成功, //并更新用户的激活状态,为已激活
logger.info("==sq==="+user.getStatus());
user.setStatus(1);//把状态改为激活
logger.info("==sh==="+user.getStatus());
userDao.updateByPrimaryKey(user);
} else {
throw new ServiceException("激活码不正确");
}
} else { throw new ServiceException("激活码已过期!");
}
} else {
throw new ServiceException("邮箱已激活,请登录!");
}
} else {
throw new ServiceException("该邮箱未注册(邮箱地址不存在)!");
}
} | {
"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 |
return session.selectOne(namespace + ".countPaging", cri); | public int countPaging(Criteria cri) throws Exception {
return session.selectOne(namespace + ".countPaging");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic int countPaging(Criteria cri) throws Exception {\n\t\treturn session.selectOne(\"com.mapper.cook.countPaging\", cri);\r\n\t}",
"int findAllCount() ;",
"@Override\r\n\tpublic int getCount(PageBean bean) {\n\t\treturn session.selectOne(\"enter.getCount\", bean);\r\n\t}",
"@Override\n\tpub... | [
"0.7145933",
"0.6796415",
"0.65262234",
"0.64821297",
"0.63301104",
"0.62488717",
"0.6227942",
"0.6216088",
"0.61595607",
"0.61398536",
"0.6133109",
"0.6117304",
"0.6117304",
"0.6106932",
"0.6101655",
"0.6092592",
"0.60407686",
"0.60352683",
"0.6019321",
"0.60083413",
"0.5985... | 0.6864256 | 1 |
We simply need .class files | private void processClassesFolderIfNotEmpty(Properties sonarProjectProperties, String classFolder) {
if (FileUtils.iterateFiles(new File(classFolder), new String[] {"class"}, true).hasNext()) {
LOG.debug("Class folder: {}", classFolder);
appendProperty(sonarProjectProperties, SonarConfiguratorProperties.LIBRARIES_PROPERTY, classFolder + (classFolder.endsWith("/") ? "" : "/") + "*.class");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void readClasses(SB_SingletonBook book) throws SB_FileException\r\n\t{\r\n\t for (Class javaClass : SB_ClassMap.getBaseJavaClasses()) {\r\n\t addJavaClass(book, javaClass.getSimpleName(), javaClass.getName());\r\n\t }\r\n\t \r\n\t List<String> importedClasses = _dataModel.getJavaScript().getIm... | [
"0.66890335",
"0.658208",
"0.6424544",
"0.6384533",
"0.63660586",
"0.6346557",
"0.6343524",
"0.63378346",
"0.6312088",
"0.6300512",
"0.6293441",
"0.6284997",
"0.6243368",
"0.6231843",
"0.6228309",
"0.6228309",
"0.6211164",
"0.62019545",
"0.61708385",
"0.6069757",
"0.60657144"... | 0.0 | -1 |
Allows to determine directories with resources to exclude them from analysis, otherwise analysis might fail due to SONAR791. This is a kind of workaround, which is based on the fact that M2Eclipse configures exclusion pattern "" for directories with resources. | private boolean isSourceExcluded(IClasspathEntry entry) {
IPath[] exclusionPatterns = entry.getExclusionPatterns();
if (exclusionPatterns != null) {
for (IPath exclusionPattern : exclusionPatterns) {
if ("**".equals(exclusionPattern.toString())) {
return true;
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String[] getExcluded(Resource resource) {\n\n\t\tCollection<String> excludes = new LinkedList<String>();\n\n\t\tString relativePath = PathUtils.subtract(resource.getDirectory(),\n\t\t\t\tthis.project.getBasedir().getAbsolutePath()\n\t\t\t\t\t\t+ PathSeparator.get());\n\n\t\tfor (Platform platform : Platfo... | [
"0.631784",
"0.5796043",
"0.57221353",
"0.56406265",
"0.5561138",
"0.55127144",
"0.54166377",
"0.5369766",
"0.5346998",
"0.534394",
"0.5330572",
"0.528478",
"0.52743286",
"0.525473",
"0.5232022",
"0.5204264",
"0.5201248",
"0.5175415",
"0.5174123",
"0.51564807",
"0.5154997",
... | 0.55660874 | 4 |
Use this check to determine whether BLE is supported on the device. Then you can selectively disable BLErelated features. | public boolean checkBluetooth() {
if (!mActivity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
Toast.makeText(mActivity, R.string.ble_not_supported, Toast.LENGTH_SHORT).show();
}
// Initializes a Bluetooth adapter. For API level 18 and above, get a reference to
// BluetoothAdapter through BluetoothManager.
final BluetoothManager bluetoothManager =
(BluetoothManager) mActivity.getSystemService(Context.BLUETOOTH_SERVICE);
mBluetoothAdapter = bluetoothManager.getAdapter();
// Checks if Bluetooth is supported on the device.
if (mBluetoothAdapter == null) {
Toast.makeText(mActivity, R.string.error_bluetooth_not_supported, Toast.LENGTH_SHORT).show();
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void validateBleSupport() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Snackbar.make(txtStatus, \"No LE Support.\", Snackbar.LENGTH_LONG).show();\n } else {\n\n /*\n * We need to enforce that Bluetooth is first enabled, and take the\n * u... | [
"0.76762134",
"0.74104947",
"0.7264478",
"0.7194611",
"0.70840544",
"0.6855239",
"0.6840546",
"0.67323333",
"0.6692386",
"0.66838706",
"0.6611804",
"0.6603218",
"0.65296865",
"0.6423284",
"0.63525325",
"0.6329183",
"0.626041",
"0.6235608",
"0.62240183",
"0.61773145",
"0.61699... | 0.75268954 | 1 |
If the device is the correct one, go ahead and connect to it | @Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
if(device.getName() == null)
{
//Not interested in these
return;
}
//Log.i(TAG, "Found " + device.getName());
if(device.getName().equals(TARGET_SERVICE_NAME))
{
Log.v(TAG, "Connecting to parallel demo");
mDeviceAddress = device.getAddress();
startBLEService();
scanLeDevice(false);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void connectDevice(Tl1Device device) {\n try {\n // Add device to TL1 controller\n DeviceId deviceId = DeviceId.deviceId(\n new URI(Tl1DeviceConfig.TL1, device.ip() + \":\" + device.port(), null));\n\n if (controller.addDevice(deviceId, device)) {\... | [
"0.7423554",
"0.71987605",
"0.7073695",
"0.69437283",
"0.6904717",
"0.6844241",
"0.67548835",
"0.6751089",
"0.6734193",
"0.67207026",
"0.671776",
"0.66983163",
"0.6697614",
"0.6695905",
"0.6685922",
"0.6662232",
"0.66602176",
"0.6648756",
"0.66459024",
"0.6611971",
"0.6570254... | 0.0 | -1 |
Must be called after startBLEService | private void initializeBLEService(IBinder service) {
mBluetoothLeService = ((BluetoothLeService.LocalBinder) service).getService();
if (!mBluetoothLeService.initialize()) {
Log.e(TAG, "Unable to initialize Bluetooth");
}
mActivity.registerReceiver(mGattUpdateReceiver, makeGattUpdateIntentFilter());
// Automatically connects to the device upon successful start-up initialization.
// mActivity.runOnUiThread(new Runnable() {
// @Override
// public void run() {
// mBluetoothLeService.connect(mDeviceAddress);
//
// }
// });
mBluetoothLeService.connect(mDeviceAddress);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onStart(){ \r\n\t\t//ensure bluetooth is enabled \r\n\t\tensureBluetoothIsEnabled();\r\n\t\tsuper.onStart(); \t\r\n\t}",
"@Override\n public void onServiceConnected(ComponentName componentName, IBinder service) {\n mNanoBLEService = ((NanoBLEService.LocalBinder) service).getService(... | [
"0.69436103",
"0.67517424",
"0.6716884",
"0.6619459",
"0.6588178",
"0.6537906",
"0.6534949",
"0.65321416",
"0.65171653",
"0.6501972",
"0.6479909",
"0.64655083",
"0.64643216",
"0.6458709",
"0.6454149",
"0.6436195",
"0.6414486",
"0.6404026",
"0.6402587",
"0.6387016",
"0.6323549... | 0.6423057 | 16 |
todo: this is desperate for some error handling | public void runShutdown() {
readCharacteristic(blecharMap, GattAttributes.SHUTDOWN);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void correctError()\r\n\t{\r\n\t\t\r\n\t}",
"private static void checkError(String result) {\n String err = Neo4jUtils.extractErrorData(result);\n if (err == null) {\n return;\n }\n throw new RuntimeException(err);\n }",
"@Override\n\t\t\t\t\t\t\tpublic void er... | [
"0.56737417",
"0.52636606",
"0.523638",
"0.5235578",
"0.5189172",
"0.51629925",
"0.5129701",
"0.50992996",
"0.5091085",
"0.5083063",
"0.5002704",
"0.4955163",
"0.49145404",
"0.49139634",
"0.49134055",
"0.49074614",
"0.49051484",
"0.48782626",
"0.48782626",
"0.48712033",
"0.48... | 0.0 | -1 |
/ Traverse the tree starting from the root. If either n1 or n2 matches with the root, then the root is LCA. Otherwise, we recur for the left and right subtree. If a node has one key present in its left subtree and the another key in the right subtree, then the node is the LCA. If both keys lie in the left subtree then the left subtree has LCA also, otherwise, LCA lies in the right subtree. TIME O(n) SPACE O(1) | public static void main(String[] args) {
Node root = TreeUtilA.createNewTreeA1();
int n1 = 4;
int n2 = 6;
Node lca = findLCA(root, n1, n2);
System.out.println(lca.data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Tree findLCA(Tree tree, int n1, int n2){\n\n if(tree == null){\n return null;\n }\n\n\n // If either n1 or n2 matches with root's key, report\n // the presence by returning root (Note that if a key is\n // ancestor of other, then the ancestor key becomes LCA\n if(tree.data==n1 || tree.data... | [
"0.869271",
"0.7296338",
"0.72269905",
"0.71847975",
"0.7115611",
"0.71040195",
"0.7097815",
"0.70960826",
"0.70178515",
"0.69095767",
"0.6809934",
"0.6666851",
"0.6661835",
"0.6574617",
"0.65016615",
"0.6408118",
"0.63287127",
"0.63217545",
"0.63189846",
"0.61969405",
"0.616... | 0.5358887 | 42 |
Not necessary, no parameters for this layout. | @Override
protected void setValue(String name, TipiValue tv) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void layout() {\n // TODO: not implemented\n }",
"public void setupLayout() {\n // left empty for subclass to override\n }",
"public abstract void doLayout();",
"protected abstract void iniciarLayout();",
"public Layout() {\n }",
"@Override\n\tpublic int getLa... | [
"0.76326275",
"0.7387468",
"0.71588296",
"0.7078681",
"0.6937953",
"0.6865011",
"0.67167354",
"0.6710618",
"0.6662436",
"0.6635227",
"0.6596842",
"0.6563882",
"0.6496985",
"0.6496985",
"0.64894384",
"0.64852214",
"0.6449599",
"0.64454746",
"0.64366615",
"0.6417581",
"0.641695... | 0.0 | -1 |
Construct a grammar for Vesper's CLI. | public Grammar(){
this.builder = Cli.<VesperCommand>builder("vesper")
.withDescription("the nice CLI for Vesper")
.withDefaultCommand(HelpCommand.class)
.withCommand(HelpCommand.class)
.withCommand(LogCommand.class)
.withCommand(ResetCommand.class)
.withCommand(InspectCommand.class)
.withCommand(ReplCommand.class)
.withCommand(ConfigCommand.class)
.withCommand(AddCommand.class)
.withCommand(OriginShow.class)
.withCommand(PublishCommand.class)
.withCommand(FormatCommand.class)
.withCommand(DeduplicateCommand.class)
.withCommand(OptimizeImportsCommand.class);
builder.withGroup("whereis")
.withDescription("Locates a program unit found in the tracked source")
.withDefaultCommand(LocateClassCommand.class)
.withCommand(LocateClassCommand.class)
.withCommand(LocateMethodCommand.class)
.withCommand(LocateParamCommand.class)
.withCommand(LocateVarCommand.class)
.withCommand(LocateFieldCommand.class);
builder.withGroup("notes")
.withDescription("Manage set of notes describing the tracked source")
.withDefaultCommand(NotesShow.class)
.withCommand(NotesShow.class)
.withCommand(NoteAdd.class);
builder.withGroup("rename")
.withDescription("Manage set of renaming commands")
.withDefaultCommand(RenameClassCommand.class)
.withCommand(RenameClassCommand.class)
.withCommand(RenameMethodCommand.class)
.withCommand(RenameParameterCommand.class)
.withCommand(RenameFieldCommand.class)
.withCommand(RenameLocalVariableCommand.class);
builder.withGroup("rm")
.withDescription("Remove file contents from the tracked source")
.withDefaultCommand(RemoveSourceCommand.class)
.withCommand(RemoveSourceCommand.class)
.withCommand(RemoveClassCommand.class)
.withCommand(RemoveMethodCommand.class)
.withCommand(RemoveParameterCommand.class)
.withCommand(RemoveFieldCommand.class)
.withCommand(RemoveLocalVariableCommand.class)
.withCommand(RemoveRegionCommand.class);
builder.withGroup("clip")
.withDescription("Clip a code section from the tracked source")
.withDefaultCommand(ClipRangeCommand.class)
.withCommand(ClipRangeCommand.class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Grammar() {\n }",
"IGrammarComp getGrammar();",
"private TraceParser genParser() throws ParseException {\n TraceParser parser = new TraceParser();\n parser.addRegex(\"^(?<VTIME>)(?<TYPE>)$\");\n parser.addPartitionsSeparator(\"^--$\");\n return parser;\n }",
"public Gra... | [
"0.62812734",
"0.5981583",
"0.5910731",
"0.5865507",
"0.5837395",
"0.582275",
"0.5674307",
"0.5578271",
"0.5575832",
"0.5540899",
"0.5530906",
"0.5528431",
"0.5491893",
"0.54841036",
"0.5473227",
"0.5472736",
"0.5469174",
"0.5469174",
"0.5469174",
"0.5433768",
"0.5408123",
... | 0.7532151 | 0 |
Constructs a new cuboid. Note that the world of both locations must be the same. | public Region3D(final Location3D startLoc, final Location3D endLoc) {
this(startLoc.getWorldName(), startLoc.getBlockX(), startLoc.getBlockY(), startLoc.getBlockZ(), endLoc.getWorldName(), endLoc.getBlockX(), endLoc.getBlockY(), endLoc.getBlockZ());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Cube(int l, int b, int h)\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=l;\r\n\t\tbredth=b;\r\n\t\theight=h;\r\n\t}",
"public CubeEarth() {\n this(1, null);\n }",
"Cube()\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=10;\r\n\t\tbredth=20;\... | [
"0.6152252",
"0.5948652",
"0.587532",
"0.57785445",
"0.570838",
"0.5646667",
"0.55446637",
"0.5497795",
"0.54788053",
"0.5462754",
"0.539094",
"0.53908193",
"0.5389",
"0.53761953",
"0.5360036",
"0.53548265",
"0.5340568",
"0.5307449",
"0.52998066",
"0.5266083",
"0.5239345",
... | 0.5457977 | 10 |
Constructs a new cuboid with the given coordinates. | public Region3D(final String world1, final int x1, final int y1, final int z1, final String world2, final int x2, final int y2, final int z2) {
if (!(world1.equals(world2))) {
System.out.println("Can't use two different worlds for Region3D!");
System.out.println("Using the world of the first location instead.");
}
this.world = world1;
final int lowX = Math.min(x1, x2);
final int lowY = Math.min(y1, y2);
final int lowZ = Math.min(z1, z2);
final int highX = Math.max(x1, x2);
final int highY = Math.max(y1, y2);
final int highZ = Math.max(z1, z2);
lowPoint = new Location3D(this.world, lowX, lowY, lowZ);
highPoint = new Location3D(this.world, highX, highY, highZ);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Cube(int l, int b, int h)\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=l;\r\n\t\tbredth=b;\r\n\t\theight=h;\r\n\t}",
"public DynamicModelPart addCuboids() {\n for (int i = 0; i < this.x.length; i++) {\n this.addCuboid(this.x[i], this.y[i], this.z[i], this.sizeX[i... | [
"0.6494905",
"0.6406387",
"0.6270742",
"0.62101907",
"0.60797584",
"0.6035459",
"0.5878379",
"0.58269614",
"0.5813",
"0.5786582",
"0.5785727",
"0.57795036",
"0.5751309",
"0.57052916",
"0.56934893",
"0.5645543",
"0.56425166",
"0.56416464",
"0.5641318",
"0.55559695",
"0.5548348... | 0.0 | -1 |
Determines whether the passed area is within this area. | public boolean isAreaWithinArea(final Region3D area) {
return (containsLoc(area.highPoint) && containsLoc(area.lowPoint));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isInArea(Area area, Position p) {\n long shipLongitude = p.getLongitude();\n long shipLatitude = p.getLatitude();\n\n if (shipLongitude >= area.getLongLeft() && shipLongitude <= area.getLongRight()\n && shipLatitude >= area.getLatBottom() && shipLatitude <= area.... | [
"0.73336",
"0.7264683",
"0.71589863",
"0.7070445",
"0.68226385",
"0.6809341",
"0.6671611",
"0.6561878",
"0.6300765",
"0.6228837",
"0.6228743",
"0.61955345",
"0.6180065",
"0.61711836",
"0.613948",
"0.6136853",
"0.6133505",
"0.6129479",
"0.6099678",
"0.60652584",
"0.6061893",
... | 0.7139255 | 3 |
Determines whether the this cuboid contains the passed location. | public boolean containsLoc(final Location3D loc) {
if (loc == null || !loc.getWorld().equals(highPoint.getWorld())) {
return false;
}
return lowPoint.getBlockX() <= loc.getBlockX()
&& highPoint.getBlockX() >= loc.getBlockX()
&& lowPoint.getBlockZ() <= loc.getBlockZ()
&& highPoint.getBlockZ() >= loc.getBlockZ()
&& lowPoint.getBlockY() <= loc.getBlockY()
&& highPoint.getBlockY() >= loc.getBlockY();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean contains(Location location) {\n String c = chunkToString(location.getChunk());\n ChunkWrapper chunk = chunks.get(c);\n return chunk.contains(location);\n }",
"public boolean containsLocation(Location p) {\n\t\tint r = p.getRow();\n\t\tint c = p.getCol();\n\t\tint offR = r -... | [
"0.7420301",
"0.70708334",
"0.6859434",
"0.6832204",
"0.6832204",
"0.6580775",
"0.65095764",
"0.6441337",
"0.64407855",
"0.6439858",
"0.64367133",
"0.6273417",
"0.62730944",
"0.6237327",
"0.61689323",
"0.61544204",
"0.6131282",
"0.60935545",
"0.6077933",
"0.6066781",
"0.60514... | 0.6690826 | 5 |
Returns the center of the cuboid. | public Location3D getCenter() {
return new Location3D(world, lowPoint.getBlockX() + getXSize() / 2, lowPoint.getBlockY() + getYSize() / 2, lowPoint.getBlockZ() + getZSize() / 2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }",
"public Point centeroid ()\r\n {\r\n return new Point ((v1.getX()+v2.getX()+v3.getX())/3,(v1.getY()+v2.getY()+v3.getY())/3);\r\n }",
"public final Vector getCenter() {\n\t\treturn (cen... | [
"0.7896841",
"0.7783275",
"0.76617587",
"0.76321507",
"0.75220984",
"0.7475531",
"0.7456548",
"0.7445626",
"0.7438238",
"0.74054503",
"0.73782766",
"0.73362875",
"0.7284585",
"0.72170407",
"0.7193089",
"0.71442384",
"0.7125888",
"0.7113249",
"0.70985484",
"0.709153",
"0.70879... | 0.7640314 | 3 |
Returns the volume of this cuboid. | public long getSize() {
return Math.abs(getXSize() * getYSize() * getZSize());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double volume() {\n\t\treturn this.iWidth * this.iLength * this.iDepth\r\n\t}",
"public int volume() {\r\n int xLength = this.getMaximumPoint().getBlockX() - this.getMinimumPoint().getBlockX() + 1;\r\n int yLength = this.getMaximumPoint().getBlockY() - this.getMinimumPoint().getBlockY() + 1;... | [
"0.81957096",
"0.8191939",
"0.8024876",
"0.7877016",
"0.7827709",
"0.77325594",
"0.7684215",
"0.7673877",
"0.7654876",
"0.7598761",
"0.7570459",
"0.75575155",
"0.7532104",
"0.7515729",
"0.7491336",
"0.7456409",
"0.74451226",
"0.7418493",
"0.7417686",
"0.7404129",
"0.7398022",... | 0.0 | -1 |
Returns whether the cuboid has no volume. | public boolean hasZeroVolume() {
return getSize() == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean hasVolume() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }",
"public boolean hasVolume() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }",
"public boolean isZero() {\r\n Vector3 veucl3 = this.getEuclidVector3();\r\n return (veucl3 == null) ?... | [
"0.73230165",
"0.73111635",
"0.72389823",
"0.70474267",
"0.6805759",
"0.66655755",
"0.65963197",
"0.6569363",
"0.65670747",
"0.6525944",
"0.650666",
"0.6487958",
"0.6475656",
"0.64592916",
"0.6438378",
"0.63584375",
"0.6319647",
"0.631086",
"0.6299332",
"0.6298671",
"0.622902... | 0.8063682 | 0 |
Determines a random location inside the cuboid and returns it. | public Location getRandomLocation() {
final Random randomGenerator = new Random();
Location result = new Location(getWorld(), highPoint.getBlockX(), highPoint.getBlockY(), highPoint.getBlockZ());
if (getSize() > 1) {
final double randomX = lowPoint.getBlockX() + randomGenerator.nextInt(getXSize());
final double randomY = lowPoint.getBlockY() + randomGenerator.nextInt(getYSize());
final double randomZ = lowPoint.getBlockZ() + randomGenerator.nextInt(getZSize());
result = new Location(Bukkit.getWorld(world), randomX, randomY, randomZ);
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Location getRandomLocation() {\n\t\tint x = rand.nextInt(WORLD_SIZE);\n\t\tint y = 12;\n\t\tint z = rand.nextInt(WORLD_SIZE);\n\t\treturn new Location(x, y, z);\n\t}",
"public Point randomLocation() {\r\n\t\tRandom rand = new Random();\r\n\t\treturn new Point(this.location.getPosition().getX()+ rand.nextI... | [
"0.7694373",
"0.7388451",
"0.72126335",
"0.7160936",
"0.7149114",
"0.7106666",
"0.6902656",
"0.6868881",
"0.6844593",
"0.66735214",
"0.66580147",
"0.66418546",
"0.6589905",
"0.65276635",
"0.6469215",
"0.6413773",
"0.6360353",
"0.635241",
"0.6344488",
"0.6321221",
"0.6312238",... | 0.72359097 | 2 |
Determines a random location inside the cuboid that is suitable for mob spawning and returns it. | public Location getRandomLocationForMobs() {
final Location temp = getRandomLocation();
return new Location(temp.getWorld(), temp.getBlockX() + 0.5, temp.getBlockY() + 0.5, temp.getBlockZ() + 0.5);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Location getRandomLocation() {\n\t\tint x = rand.nextInt(WORLD_SIZE);\n\t\tint y = 12;\n\t\tint z = rand.nextInt(WORLD_SIZE);\n\t\treturn new Location(x, y, z);\n\t}",
"public Location getRandomLocationForPlayers() {\n\t\tfinal Location temp = getRandomLocationForMobs();\n\t\t\n\t\treturn new Location(tem... | [
"0.79494494",
"0.7810956",
"0.759639",
"0.7595995",
"0.758096",
"0.75456774",
"0.7232269",
"0.71404904",
"0.71388656",
"0.6975363",
"0.68839896",
"0.6815535",
"0.6740154",
"0.6704786",
"0.6679292",
"0.6664731",
"0.66633797",
"0.6649373",
"0.66139597",
"0.65966314",
"0.6572903... | 0.8011004 | 0 |
Determines a random location inside the cuboid that is suitable for player spawning and returns it. | public Location getRandomLocationForPlayers() {
final Location temp = getRandomLocationForMobs();
return new Location(temp.getWorld(), temp.getBlockX(), temp.getBlockY() + 1, temp.getBlockZ());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Location getRandomLocation() {\n\t\tint x = rand.nextInt(WORLD_SIZE);\n\t\tint y = 12;\n\t\tint z = rand.nextInt(WORLD_SIZE);\n\t\treturn new Location(x, y, z);\n\t}",
"public static Location genRandomSpawn() {\n final Random r = new Random();\n\n final World world = Bukkit.getWorld(\"Normal... | [
"0.79340965",
"0.7667087",
"0.7649239",
"0.7585702",
"0.7534933",
"0.74529195",
"0.74265033",
"0.7147623",
"0.7126457",
"0.71210945",
"0.68314886",
"0.6812887",
"0.679384",
"0.6786564",
"0.677024",
"0.67552584",
"0.6750183",
"0.6721311",
"0.6649128",
"0.66291326",
"0.65718514... | 0.79552287 | 0 |
Returns the x span of this cuboid. | public int getXSize() {
return (highPoint.getBlockX() - lowPoint.getBlockX()) + 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SVGLength getX() {\n return x;\n }",
"public int getSpawnX() \n\t{\n\t\treturn spawnX;\n\t}",
"public int getX() {\n\t\treturn this.x_indice * DIM_CASE;\n\t}",
"public int getBlockX()\n\t {\n\t\t if(x >= 0.0) return (int)x;\n\t\t return -1 + (int)(x);\n\t }",
"public int xPos() {\n\t\t... | [
"0.66441983",
"0.65934837",
"0.65529895",
"0.65417117",
"0.6493695",
"0.6459926",
"0.64371073",
"0.6434804",
"0.6377167",
"0.6372886",
"0.63262737",
"0.6307153",
"0.62957454",
"0.6280731",
"0.6280731",
"0.6280731",
"0.6280731",
"0.6280731",
"0.6280731",
"0.6272899",
"0.627085... | 0.0 | -1 |
Returns the y span of this cuboid. | public int getYSize() {
return (highPoint.getBlockY() - lowPoint.getBlockY()) + 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int yPos() {\n\t\treturn Engine.scaleY(y);\n\t}",
"public int getBlockY()\n\t {\n\t\t if(y >= 0.0) return (int)y;\n\t\t return -1 + (int)(y);\n\t }",
"public double getY() {\n\t\tRectangle2D bounds = _parentFigure.getBounds();\n\t\tdouble y = bounds.getY() + (_yt * bounds.getHeight());\n\t\treturn y... | [
"0.7188916",
"0.70940095",
"0.7051512",
"0.6968556",
"0.69453037",
"0.69314396",
"0.6922271",
"0.6912857",
"0.6889724",
"0.68539655",
"0.68489635",
"0.6808321",
"0.6802232",
"0.6799503",
"0.6798091",
"0.6798091",
"0.6798091",
"0.6789355",
"0.67883295",
"0.6786866",
"0.6785531... | 0.0 | -1 |
Returns the z span of this cuboid. | public int getZSize() {
return (highPoint.getBlockZ() - lowPoint.getBlockZ()) + 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getBlockZ()\n\t {\n\t\t if(z >= 0.0) return (int)z;\n\t\t return -1 + (int)(z);\n\t }",
"@Override\n\tpublic double getZLoc() {\n\t\tdouble side = Math.sqrt(getMySize())/2;\n\t\treturn z-side;\n\t}",
"public float getZ() {\n return z_;\n }",
"public double getZ() {\n return ... | [
"0.7206029",
"0.71651936",
"0.704239",
"0.70399386",
"0.7014166",
"0.700771",
"0.69794863",
"0.6943423",
"0.694015",
"0.69090873",
"0.69090873",
"0.69077057",
"0.68586594",
"0.68586594",
"0.6857973",
"0.68239504",
"0.6800037",
"0.6774667",
"0.6751383",
"0.6748",
"0.67382276",... | 0.68140614 | 16 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.