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 |
|---|---|---|---|---|---|---|
Compare vector clocks of process and message to see if we can deliver | public boolean canLCBdeliver(Message message) {
boolean canLCBdeliver = true;
ArrayList<Integer> messageVC = message.getVectorClock();
ArrayList<Integer> processVC = p.getVectorClock();
if (processVC.get(message.getSender() - 1) != message.getId() - 1) {
canLCBdeliver = false;
}
for (Integer i = 0; i < messageVC.size(); i++) {
if (messageVC.get(i) > processVC.get(i)) {
canLCBdeliver = false;
break;
}
}
return canLCBdeliver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasReceiveTime();",
"@Override\n\tpublic boolean isNextMessage(User from, Vector comparison){\n\n\t\tfor (Object o1 : comparison.getClock().entrySet()) {\n\t\t\tHashMap.Entry pair = (HashMap.Entry) o1;\n\n\t\t\tif(this.clock.containsKey(pair.getKey())){\n\n\t\t\t\tLong reVal = (Long)pair.getValue();\n\t\... | [
"0.64359176",
"0.59977245",
"0.59943616",
"0.5729425",
"0.56631804",
"0.55847365",
"0.5581183",
"0.5553",
"0.55315256",
"0.54633915",
"0.5447595",
"0.5425267",
"0.53908026",
"0.5372248",
"0.53717715",
"0.5327821",
"0.53198737",
"0.5287507",
"0.5284474",
"0.5256515",
"0.522708... | 0.64741755 | 0 |
Thread that keeps trying to deliver pending messages. | @Override
public void run() {
while (true) {
try {
for (Message message : pending) {
if (canLCBdeliver(message)) {
fifoBC.canDeliver(message);
p.Pendinglock.lock();
pending.remove(message);
p.Pendinglock.unlock();
}
}
} finally {
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
System.out.println("Failed to sleep in deliver thread.");
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void run() {\r\n while(true) { // outer loop\r\n if(first) // we already have the queue CAS acquired\r\n first=false;\r\n else {\r\n if(!queue.acquire())\r\n return;\r\n }\r\n\r\n ... | [
"0.7043771",
"0.70215917",
"0.6918349",
"0.6657741",
"0.6647701",
"0.6481122",
"0.6428643",
"0.6408474",
"0.6381869",
"0.63534606",
"0.6279245",
"0.6252477",
"0.6249847",
"0.61991227",
"0.61858577",
"0.61781865",
"0.61734784",
"0.61398256",
"0.610544",
"0.6095137",
"0.6087892... | 0.77042514 | 0 |
SL21117: Revenue Pull Code change starts | public List <String> getPermittedUsers() throws BusinessServiceException{
return financeManagerBO.getPermittedUsers();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void revenue() {\n\t\t// Revenue Event only requires the Revenue Value to be passed\n AdGyde.onRevenue(5);\n Toast.makeText(this, \"Revenue clicked\", Toast.LENGTH_SHORT).show();\n }",
"public void trackRevenue() {\n track(\"_revenue\");\n }",
"@Override\r\n public void upd... | [
"0.5858775",
"0.56258124",
"0.55334014",
"0.5481229",
"0.5438504",
"0.5427819",
"0.53724664",
"0.5364589",
"0.5340743",
"0.52319425",
"0.52275676",
"0.5203029",
"0.5114257",
"0.51005083",
"0.50824285",
"0.50299746",
"0.50281197",
"0.5022823",
"0.499017",
"0.49821758",
"0.4973... | 0.0 | -1 |
Fetch buyer bitFlag and threshold limit | public PIIThresholdVO getBuyerThresholdMap(String role) throws BusinessServiceException
{
PIIThresholdVO pIIThresholdVO = new PIIThresholdVO();
pIIThresholdVO = financeManagerBO.getBuyerThresholdMap(role);
return pIIThresholdVO;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pb4server.MaxPrisonBuffAskReq getMaxPrisonBuffAskReq();",
"pb4server.FindBuffIsHaveAskReq getFindBuffIsHaveAskReq();",
"boolean getIsLimited();",
"public int getCustomInformationTransferRate();",
"public int getThreshold() {\n return threshold; \n }",
"public int getWorkCredGain();",
"boolean has... | [
"0.5756011",
"0.54364246",
"0.5320251",
"0.5281794",
"0.5281456",
"0.5259337",
"0.5231672",
"0.52262414",
"0.520361",
"0.519146",
"0.5174884",
"0.5159709",
"0.51429445",
"0.51350343",
"0.5133484",
"0.51223165",
"0.5121276",
"0.51093143",
"0.5107393",
"0.5090095",
"0.50643843"... | 0.5459096 | 1 |
Sets the wallet client bo. | public void setWalletBO(IWalletBO walletBO) {
this.walletBO = walletBO;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetClientToBSResponse setClientToBS\n (\n nl.tudelft.ewi.st.atlantis.tudelft.v1.services.SetClientToBSRequest setClientToBSRequest\n )\n ;",
"private void setClient(ClientImpl model) {\n if (cl... | [
"0.6457634",
"0.62466586",
"0.599927",
"0.59151644",
"0.58681035",
"0.58359873",
"0.58335376",
"0.581842",
"0.57956105",
"0.5786096",
"0.5764567",
"0.56319743",
"0.5622939",
"0.55821145",
"0.5372886",
"0.5356587",
"0.5347645",
"0.5307401",
"0.5295438",
"0.5273082",
"0.5252124... | 0.6218942 | 2 |
CHECK 2) [typechecking] is this implementation correct for type promotion | @Override
public Type arithmetic(Type type, ASTNode node) {
String errorMsg = "Type " + this + " cannot be used in arithmetic operation with " + type;
if (type instanceof RealType)
return RealType.getInstance();
if (type instanceof IntType)
return this;
if (type instanceof CharType)
return IntType.getInstance();
if (type instanceof ErrorType)
return type;
return new ErrorType(errorMsg, node);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void typePromition(int a, long b){\n\t\tSystem.out.println(\"Method-5 (TypePromotion) Result is: \" + (a+b));\n\t}",
"public Exp\nadjustTypesOfBinaryOperands( Exp pExp1, Exp pExp2 );",
"public void puzzle4(){\n\t\tshort x = 0;\n\t\tint i = 123456;\n\t\tx += i; // narrowing primitive conversion [JLS 5.1.3]\n\t\... | [
"0.59705985",
"0.5896647",
"0.5690818",
"0.5570746",
"0.5480897",
"0.5476526",
"0.54672515",
"0.54644704",
"0.5454702",
"0.5358128",
"0.53020895",
"0.52990156",
"0.5284731",
"0.52568656",
"0.52353764",
"0.5230707",
"0.5209695",
"0.5149141",
"0.51244414",
"0.5095467",
"0.50846... | 0.0 | -1 |
Method for getting root | public Node<T> getRoot() {
return root;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getRoot();",
"public String getRoot() {\n return root;\n }",
"public Object getRoot(){\r\n\t\treturn _root;\r\n\t}",
"public String getRoot() {\n\t\treturn null;\n\t}",
"java.lang.String getRoot();",
"public int getRoot(){\n\t\t\treturn root;\n\t\t}",
"public Object\tgetRoot() {... | [
"0.8318338",
"0.794826",
"0.79063296",
"0.78452915",
"0.7767702",
"0.766684",
"0.7652384",
"0.76041967",
"0.7602748",
"0.7387991",
"0.73708165",
"0.7309429",
"0.7309429",
"0.73067355",
"0.72847795",
"0.72748375",
"0.72687215",
"0.7220353",
"0.72162783",
"0.7190968",
"0.718287... | 0.6853736 | 58 |
Method for setting root | public void setRoot(Node<T> root) {
this.root = root;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setRoot(String root);",
"public void setRoot(Node root) {\n this.root = root;\n }",
"public void setRootDir(String rootDir);",
"public void setRoot(WAVLNode root)\r\n\t {\r\n\t\t this.root = root;\r\n\t }",
"public void setRootPath(String rootPath) {\r\n this.rootPath = r... | [
"0.84795684",
"0.7596296",
"0.7489637",
"0.7350482",
"0.7302276",
"0.7200791",
"0.71995914",
"0.7153684",
"0.7128898",
"0.7119908",
"0.71051514",
"0.70930874",
"0.7067256",
"0.69880295",
"0.69581836",
"0.69487673",
"0.69338894",
"0.69246835",
"0.69075286",
"0.6864546",
"0.684... | 0.7455592 | 3 |
Method for deleting Tree | public void delete() {
this.root = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void deleteTree(TreeNode node) \n {\n root = null; \n }",
"public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\... | [
"0.80019397",
"0.7488443",
"0.7349736",
"0.7312485",
"0.72883135",
"0.7229144",
"0.71200883",
"0.71047527",
"0.6980364",
"0.69771904",
"0.696516",
"0.69539106",
"0.6938648",
"0.68949836",
"0.68862283",
"0.6869541",
"0.6853555",
"0.68529034",
"0.6851678",
"0.68450236",
"0.6842... | 0.77759874 | 1 |
Method for adding node | public boolean add(int id, Node<T> addingNode) {
Node<T> parent = search(id);
if (parent.getId() <= addingNode.getId()) {
addingNode.setParent(parent);
parent.addChildren(addingNode);
return true;
} else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addNode() {\r\n \r\n Nod nod = new Nod(capacitate_noduri);\r\n numar_noduri++;\r\n noduri.add(nod);\r\n }",
"void addNode(String node);",
"protected void addingNode( SearchNode n ) { }",
"void addNode(int node);",
"void addNode()\n {\n Node newNode = new... | [
"0.79463196",
"0.7939092",
"0.7668136",
"0.7648159",
"0.762835",
"0.75754714",
"0.75586224",
"0.7555025",
"0.74729216",
"0.7426751",
"0.73817503",
"0.7260464",
"0.72353625",
"0.7149989",
"0.71473247",
"0.7129191",
"0.709074",
"0.7068975",
"0.7062597",
"0.70583016",
"0.7027049... | 0.0 | -1 |
Removing node from the parent's collection of child nodes | public boolean removeSubNode(int subNodeId, Node<T> node) {
Iterator<Node<T>> iterator = node.getChildren().iterator();
while (iterator.hasNext()) {
Node<T> tmp = (Node<T>) iterator.next();
if (tmp.getId() == subNodeId) {
iterator.remove();
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeFromParent();",
"public void removeChild(WSLNode node) {children.removeElement(node);}",
"public void removeFromParent() { if(_parent!=null) _parent.removeChild(this); }",
"public abstract void removeChild(Node node);",
"public void removeFromParent(){\n\t\tif(getParent() != null){\n\t\t... | [
"0.7823705",
"0.7345794",
"0.7303474",
"0.7209148",
"0.7195504",
"0.70855695",
"0.7039129",
"0.6955771",
"0.6902545",
"0.6894479",
"0.66911066",
"0.6613372",
"0.66002727",
"0.65967894",
"0.6590338",
"0.6587633",
"0.65283054",
"0.6515754",
"0.64793724",
"0.6416018",
"0.6412219... | 0.0 | -1 |
Search node by id | public Node<T> search(int id) {
Node<T> res = root;
res = search(res, id);
if (res.getId() == id) return res;
else return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Node searchNode(int id) {\n\t\tNode node = searchRec(root,id);\n\t\treturn node;\n\t}",
"public Node find(int id) {\n return tree.find(id);\n }",
"private Node searchRec(Node node, int id) {\n\t\tNode found = null;\n\t\tif(node == null || node.getId() == id){\n\t\t\treturn node;\n\t\t}\n\t\te... | [
"0.82622087",
"0.7294052",
"0.72399914",
"0.7191593",
"0.7080953",
"0.6800149",
"0.6676568",
"0.6605127",
"0.6484829",
"0.64830136",
"0.6459724",
"0.64488035",
"0.64253426",
"0.6413334",
"0.640748",
"0.63375235",
"0.632112",
"0.630371",
"0.62971336",
"0.6296668",
"0.62859917"... | 0.78062075 | 1 |
Method for writing tree with using Writer | public void write(Writer writer) throws TreeException {
try {
writer.write(this.toString());
} catch (IOException e) {
throw new TreeException(ErrorMessage.O_ERROR_MESSAGE, e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeTree(String path) {\n this.sb = new StringBuilder();\n writeTreeRec(this._root);\n\n try (PrintWriter out = new PrintWriter(path)){\n out.println(sb.toString());\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }",
"pr... | [
"0.7426652",
"0.7408411",
"0.67427117",
"0.6699066",
"0.62981606",
"0.6230433",
"0.6140448",
"0.6116374",
"0.611392",
"0.6074642",
"0.59823006",
"0.58755594",
"0.58702296",
"0.58612424",
"0.5856731",
"0.5854141",
"0.5807063",
"0.57960176",
"0.5762506",
"0.57353497",
"0.568949... | 0.66187364 | 4 |
Method for reading tree with using Reader | public void read(Reader reader) throws TreeException {
Tree<T> tree;
try {
ObjectMapper mapper = new ObjectMapper();
tree = mapper.readValue(reader, Tree.class);
} catch (IOException e) {
throw new TreeException(ErrorMessage.I_ERROR_MESSAGE, e);
}
this.root = tree.getRoot();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void read(IDevTree tree, Map options, boolean readOnly, boolean createNew) throws IOException;",
"public Node readTree() {\n boolean totuusarvo = b.readBoolean();\n if (totuusarvo == true) {\n return new Node(b.readShort(), -1, null, null);\n } else {\n return new Node(... | [
"0.63550854",
"0.6279715",
"0.61506236",
"0.59935033",
"0.59550726",
"0.5941252",
"0.58839667",
"0.58193576",
"0.579912",
"0.5781301",
"0.574675",
"0.5742545",
"0.5739131",
"0.57049286",
"0.5690226",
"0.56884825",
"0.56783056",
"0.5662374",
"0.5622975",
"0.5615021",
"0.559848... | 0.72172135 | 0 |
Method for adding node/branch by id | public void addBranch(int id, Node<T> nodeAdd) throws TreeException {
Node<T> destinationNode = search(id).clone();
if (add(id, nodeAdd)) {
if (destinationNode.getChildren() != null) {
Collection<Node<T>> children = destinationNode.getChildren();
for (Node<T> child : children) {
addBranch(nodeAdd.getId(), child);
}
}
} else throw new TreeException(ErrorMessage.ADDING_BRANCH_ERROR);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean addNode(long idNum, String label);",
"void nodeCreate( long id );",
"void addNode(int node);",
"public Node(final String id) {\n super();\n this.id = id;\n }",
"public void insert(int id){\n Node newNode= new Node (id);\n Node temp=root;\n Node parent=null;\n ... | [
"0.7367696",
"0.7020806",
"0.6745041",
"0.6713127",
"0.66886204",
"0.6608958",
"0.6597608",
"0.65871084",
"0.65295947",
"0.64944476",
"0.62947893",
"0.6292641",
"0.62169355",
"0.62046134",
"0.6196146",
"0.61735374",
"0.6171371",
"0.616534",
"0.61281514",
"0.6067845",
"0.60105... | 0.765748 | 0 |
Method for delete node/branch by id | public void deleteBranch(int id) {
Node<T> delNode = search(id);
Node<T> parent = delNode.getParent();
if (delNode.getParent() != null) {
Collection<Node<T>> children = parent.getChildren();
for (Node<T> child : children) {
if (child.getId() == id) child = null;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteNode (NodeId id) throws IOException\n\t{\n\t}",
"public void delete(int id) { \n\t\tint save = findPosition(id);\n\t\t\n\t\tif (save == numOfNode - 1) {\n\t\t\tnode [save] = null;\n\t\t\tnumOfNode--;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// dich dan cac node vao\n\t\tfor (int i = save; i < numOfNode... | [
"0.7920065",
"0.7790143",
"0.70865065",
"0.7085325",
"0.7076329",
"0.7040511",
"0.7040511",
"0.7040511",
"0.7040511",
"0.7040511",
"0.70358014",
"0.70358014",
"0.70358014",
"0.7013244",
"0.7013244",
"0.7013244",
"0.7013244",
"0.7013244",
"0.6986801",
"0.69864124",
"0.6974416"... | 0.7919941 | 1 |
Method for clone Tree | public Tree<T> clone() {
Node<T> clonedRoot = this.root.clone();
clone(this.root, this.root.clone());
return new Tree<T>(clonedRoot);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Object clone()\n\t{\n\t\treturn new Tree();\n\t}",
"public QueryNode cloneTree() throws CloneNotSupportedException;",
"public abstract TreeNode copy();",
"public abstract Type treeCopy();",
"@Override\n public Node clone() {\n Node node = null;\n try {\n node = (Node) sup... | [
"0.82353276",
"0.8180933",
"0.8062726",
"0.7499502",
"0.73934597",
"0.7255462",
"0.7248068",
"0.72350824",
"0.7133473",
"0.7114139",
"0.7087158",
"0.69958174",
"0.6948259",
"0.693555",
"0.6927856",
"0.6896988",
"0.6872019",
"0.68608916",
"0.68608916",
"0.6852564",
"0.68143225... | 0.791987 | 3 |
Method for recursive clone | private void clone(Node<T> sourceNode, Node<T> cloneNode) {
Node<T> tmp;
Collection<Node<T>> collection = sourceNode.getChildren();
for (Node<T> child : collection) {
tmp = child.clone();
if (sourceNode.getParent() != null) tmp.setParent(cloneNode);
cloneNode.addChildren(tmp);
clone(child, tmp);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Function clone();",
"public T cloneDeep();",
"public abstract Object clone() ;",
"Object clone();",
"Object clone();",
"Component deepClone();",
"public abstract Object clone();",
"public Object clone()\n\t{\n\t\treturn new Tree();\n\t}",
"public Object clone()\n/* */ {\n/* 835 */ ... | [
"0.7647078",
"0.7637707",
"0.7477019",
"0.74283904",
"0.74283904",
"0.7399746",
"0.739218",
"0.7251253",
"0.7249438",
"0.718821",
"0.718821",
"0.718821",
"0.718821",
"0.7076648",
"0.7064038",
"0.7027544",
"0.7005743",
"0.6968184",
"0.6949933",
"0.6913887",
"0.6910697",
"0.6... | 0.6480299 | 84 |
Method for converting Tree to String in JSON format | @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String treeJSON() {\n\t\ttry{\r\n\t\tList trees = this.getTransedTrees();\r\n\t\tString result = this.treeJSON(trees);\r\n\t\treturn result;\r\n\t\t}catch(Exception e){\r\n\t\t\tlog.info(\">>>>faceye error in method:treeJSON() is\"+e.toString());\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}",
"public Str... | [
"0.7893306",
"0.72191405",
"0.7208058",
"0.70118684",
"0.69565433",
"0.69457275",
"0.6940753",
"0.69309664",
"0.6918711",
"0.6913096",
"0.6898428",
"0.68924266",
"0.68924266",
"0.68924266",
"0.6886943",
"0.68858486",
"0.6879197",
"0.686375",
"0.6863328",
"0.68420964",
"0.6826... | 0.0 | -1 |
create board and actors | public void executeGame(String[] names) {
IBuilder builder = new Builder();
builder.newBoard(this);
graphicInterface.connect(b);
//get dino names
for (int z = 0; z < 4; z++) {
dinos[z].setName(names[z]);
}
//print game
graphicInterface.connect(dinos);
graphicInterface.connect(b);
graphicInterface.printGame();
//buttonUpperLeft - 7, buttonUp - 8, buttonUpperRight - 9, buttonLeft - 4, buttonEgg - 5, buttonRight - 6, buttonLowerLeft - 1, buttonDown - 2, buttonLowerRight - 3;
graphicInterface.getMenuBar().buttonUpperLeft.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 7 apertado");
command = 7;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonUp.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 8 apertado");
command = 8;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonUpperRight.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 9 apertado");
command = 9;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonLeft.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 4 apertado");
command = 4;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonEgg.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 5 apertado");
command = 5;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonRight.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 6 apertado");
command = 6;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonLowerLeft.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 1 apertado");
command = 1;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonDown.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 2 apertado");
command = 2;
turno++;
System.out.println("c" + command + "t" + turno);
});
graphicInterface.getMenuBar().buttonLowerRight.addActionListener(actionEvent -> {
System.out.println("reconheceu botao 3 apertado");
command = 3;
turno++;
System.out.println("c: " + command + " t: " + turno + " t+1: " + turno_anterior + " cond: " + (turno == turno_anterior + 1));
});
while (atLeastOneAlive()) {
System.out.println();
if (turno == turno_anterior + 1) {
dinoPos = turno % 4;
System.out.println("entrou no if do turno: dino " + dinoPos);
if (dinos[dinoPos].getIsAlive()) {
System.out.println("dino " + dinoPos + "vivo ");
if (command != 0) {
System.out.println("num comando " + command);
System.out.println("pos dino " + dinoPos);
System.out.println("turno " + turno);
//System.out.println("posicoes iniciais do dino: i:" + dinos[dinoPos].getI() + "j:" + dinos[dinoPos].getJ());
makeMove(command, dinoPos);
//System.out.println("posicoes iniciais do dino: i:" + dinos[dinoPos].getI() + "j:" + dinos[dinoPos].getJ());
command = 0;
}
}
else {
turno++;
}
turno_anterior++;
if (dinoPos == 3) {
b.insertLavas(volcanoes);
graphicInterface.updateBoardView(next(dinoPos));
roundNumber++;
if(winnersNum != 0){
//one or more have reached the fort
//decide who wins
int winner = whoWins(winnersNum);
System.out.println(dinos[winner].getName() + "has won the game");
break;
}
}
}
}
if (!atLeastOneAlive()){
System.out.println("No dino has won this round");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void testBoardCreation() {\n for (int r = 0; r < Constants.BOARD_GRID_ROWS; r++) {\n for (int c = 0; c < Constants.BOARD_GRID_COLUMNS; c++) {\n Vector2 tokenLocation = this.mBoardLevel.getCenterOfLocation(r, c);\n Image tokenImage = new Image(this.mResources.... | [
"0.7476637",
"0.7359465",
"0.7253612",
"0.7208259",
"0.7196418",
"0.71541166",
"0.7140893",
"0.7055376",
"0.70340115",
"0.7031235",
"0.70195645",
"0.68229926",
"0.6775259",
"0.67653924",
"0.6761061",
"0.67464566",
"0.66606295",
"0.66528714",
"0.6633376",
"0.6627919",
"0.66069... | 0.0 | -1 |
check if more than one dino has reached its fort | public int whoWins(int winnersNum){
if(winnersNum > 1){
//decide who wins based on the score
int first = -1;
for(int i = 0; i < 4; i++){
if(dinos[i].getHasWon()){
if(first != -1){
if(dinos[i].getScore() > dinos[first].getScore()){
first = i;
}
}
else{
first = i;
}
}
}
return first;
}
else if (winnersNum == 1) {
for(int i = 0; i < 4; i++){
if(dinos[i].getHasWon()){
return i;
}
}
}
return -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean checkGreedyDefense() {\r\n return enTotal.get(2)+1 < myTotal.get(2) && enTotal.get(0)+1 < myTotal.get(0);\r\n }",
"private boolean caughtEmAll(){\n\t\tint howMany = 1;\n\t\tArrayList<Pokemon> pokedex = theTrainer.getPokedex();\n\t\tCollections.sort(pokedex);\n\t\tfor(int i = 0; i < pok... | [
"0.6609117",
"0.63930684",
"0.62482923",
"0.6211691",
"0.6107063",
"0.60759234",
"0.60468435",
"0.59885955",
"0.5967015",
"0.59633535",
"0.5939371",
"0.5935623",
"0.5932047",
"0.5917547",
"0.5900979",
"0.5875271",
"0.5867941",
"0.5855895",
"0.5847447",
"0.5823697",
"0.5801497... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void setCorporation(String corporation) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public String getModel() {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void setModel(String model) {
} | {
"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 |
Expression = A + Z B B | @Test
public void digestVariables() {
IllegalStateException actualException = assertThrows(IllegalStateException.class, () -> expressionStack
.addVariableName("A")
.addBinaryOperator(getMethodMapping("+", 2, BINARY_OPERATION))
.addVariableName("Z")
.addBinaryOperator(getMethodMapping("-", 2, BINARY_OPERATION))
.addVariableName("B")
.addBinaryOperator(getMethodMapping("*", 2, BINARY_OPERATION))
.addVariableName("B")
.closeWithState(DIGESTED_MATHEMATICAL_FUNCTIONS)
.digestVariables(Collections.emptyMap()));
assertEquals("Unknown variable(s) 'A', 'B', 'Z'.", actualException.getMessage());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Expression addExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = multExpression();\r\n\t\twhile(isKind(OP_PLUS, OP_MINUS)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = multExpression();\r\n\t\t\te0 = new ExpressionBinary(first,e0,op,e1);\r\n\t\t}\r\n\t\treturn e0;\r\n... | [
"0.65419376",
"0.6323951",
"0.6321462",
"0.6213602",
"0.61622626",
"0.60793257",
"0.6030714",
"0.60242206",
"0.5998381",
"0.59932065",
"0.5986322",
"0.5934987",
"0.5929868",
"0.5883602",
"0.588106",
"0.5845301",
"0.58107257",
"0.58087164",
"0.58009124",
"0.57958686",
"0.57556... | 0.0 | -1 |
/ Getters / Setters | @Override
public PermutationSolution<Integer> createSolution() {
return new DefaultBinaryIntegerPermutationSolution(this) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract Set method_1559();",
"@Override\r\n\tpublic void get() {\n\t\t\r\n\t}",
"@Override\n public void get() {}",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"public void get() {\n }",
"public void setdat()\n {\n }",
"@Override\n\tpublic void getData() {\n\t\t\n\t}",
... | [
"0.68003595",
"0.6558789",
"0.6552484",
"0.64120036",
"0.62294185",
"0.6210205",
"0.61401826",
"0.61208946",
"0.6081686",
"0.6043031",
"0.5965628",
"0.5945217",
"0.59434736",
"0.5939926",
"0.5920166",
"0.5899987",
"0.5898689",
"0.58881354",
"0.5869365",
"0.5869247",
"0.583858... | 0.0 | -1 |
Sync the config with another resource. This method can be used as an auto updater for your config files. | public void syncWithConfig(File file, InputStream resource, String... ignoredSections) throws IOException {
if (creationFailure) return;
CommentedConfiguration cfg = loadConfiguration(resource);
if (syncConfigurationSection(cfg, cfg.getConfigurationSection(""), Arrays.asList(ignoredSections)) && file != null)
save(file);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void updatePendingConfiguration(Configuration config);",
"private void updateConfig(){\n try {\n BeanUtils.copyProperties(config_,newConfig_);//copy the properties of newConfig_ into config_\n } catch (IllegalAccessException ex) {\n ReportingUtils.logError(ex, \"Failed t... | [
"0.6219816",
"0.60190403",
"0.5892562",
"0.58466595",
"0.5804089",
"0.57957006",
"0.5621616",
"0.5615254",
"0.5574855",
"0.5549935",
"0.5544471",
"0.5522111",
"0.54775405",
"0.54320157",
"0.5401615",
"0.53819644",
"0.5358077",
"0.53264636",
"0.532206",
"0.52933675",
"0.526130... | 0.6056032 | 1 |
Set a new comment to a path. You can remove comments by providing a null as a comment argument. | public void setComment(String path, String comment) {
if (comment == null)
configComments.remove(path);
else
configComments.put(path, comment);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setComment(String comment);",
"public void setComment(String comment);",
"public final void setComment(final String comment) {\n this.comment = comment;\n }",
"public void setComment(String new_comment){\n this.comment=new_comment;\n }",
"public void setComment(String c) {\n ... | [
"0.73547894",
"0.73547894",
"0.7220789",
"0.7090984",
"0.70351106",
"0.7033811",
"0.70197684",
"0.698772",
"0.698772",
"0.698772",
"0.6928017",
"0.6927496",
"0.6927496",
"0.6927496",
"0.6927496",
"0.6914796",
"0.69099605",
"0.69085914",
"0.6856074",
"0.6841515",
"0.6841515",
... | 0.8621672 | 0 |
Get a comment of a path. | public String getComment(String path) {
return getComment(path, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getComment(String path, String def) {\n return configComments.getOrDefault(path, def);\n }",
"String getComment();",
"String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public String getComment();",
"public Stri... | [
"0.7320479",
"0.68116075",
"0.68116075",
"0.6381035",
"0.6381035",
"0.6381035",
"0.6381035",
"0.6381035",
"0.6381035",
"0.63183945",
"0.62329006",
"0.621452",
"0.6211977",
"0.62037706",
"0.61571443",
"0.60800236",
"0.6079935",
"0.6076409",
"0.606197",
"0.59773636",
"0.5968305... | 0.8641099 | 0 |
Get a comment of a path with a default value if no comment exists. | public String getComment(String path, String def) {
return configComments.getOrDefault(path, def);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getComment(String path) {\n return getComment(path, null);\n }",
"public Optional<String> getComment() {\n\t\treturn Optional.ofNullable(_comment);\n\t}",
"public void setComment(String path, String comment) {\n if (comment == null)\n configComments.remove(path);\n ... | [
"0.7039166",
"0.6287678",
"0.6186063",
"0.5945583",
"0.5945583",
"0.5639605",
"0.5582492",
"0.55397105",
"0.55397105",
"0.55397105",
"0.55397105",
"0.55397105",
"0.55397105",
"0.5419284",
"0.5361807",
"0.53572464",
"0.5338601",
"0.53153706",
"0.52709574",
"0.5256022",
"0.5233... | 0.73566204 | 0 |
Checks whether a path has a comment or not. | public boolean containsComment(String path) {
return getComment(path) != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isComment(String line) {\n\t\tif (line.equals(\"\")) return true;\n\t\t\n\t\t// If the line starts with \"//\".\n\t\tif (line.substring(0, 2).equals(\"//\")) return true;\n\t\t\n\t\treturn false;\n\t}",
"boolean hasComment();",
"public boolean isComment(String line){\n //Assume false\n ... | [
"0.7394256",
"0.7364197",
"0.72540385",
"0.70961046",
"0.68654877",
"0.6791347",
"0.6735054",
"0.6722439",
"0.65404844",
"0.65209746",
"0.65153295",
"0.64837533",
"0.6470592",
"0.64100045",
"0.63089746",
"0.62075907",
"0.6168798",
"0.616523",
"0.61552656",
"0.6116456",
"0.602... | 0.85129213 | 0 |
Check if the config has failed to load. | public boolean hasFailed() {
return creationFailure;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void verifyConfig() {\r\n if (getIbnrRiskManager() == null)\r\n throw new ConfigurationException(\"The required property 'ibnrRiskManager' is missing.\");\r\n }",
"public boolean configurationIsValid() {\n\t\tif (this.maxThreadNumberResourceWorker + this.maxThreadNumberSeedWorker != t... | [
"0.6651743",
"0.6589772",
"0.65783286",
"0.6523385",
"0.62957036",
"0.62685",
"0.6196911",
"0.6187892",
"0.61659086",
"0.61604565",
"0.6140195",
"0.61342627",
"0.60849327",
"0.60466504",
"0.6029513",
"0.6026778",
"0.6023508",
"0.6021307",
"0.5986945",
"0.59438735",
"0.5936250... | 0.0 | -1 |
Load all data related to the config file keys, values and comments. | @Override
public void loadFromString(String contents) throws InvalidConfigurationException {
//Load data of the base yaml (keys and values).
super.loadFromString(contents);
//Parse the contents into lines.
String[] lines = contents.split("\n");
int currentIndex = 0;
//Variables that are used to track progress.
StringBuilder comments = new StringBuilder();
String currentSection = "";
while (currentIndex < lines.length) {
//Checking if the current line is a comment.
if (isComment(lines[currentIndex])) {
//Adding the comment to the builder with a new line at the end.
comments.append(lines[currentIndex]).append("\n");
}
//Checking if the current line is a valid new section.
else if (isNewSection(lines[currentIndex])) {
//Parsing the line into a full-path.
currentSection = getSectionPath(this, lines[currentIndex], currentSection);
//If there is a valid comment for the section.
if (comments.length() > 1)
//Adding the comment.
setComment(currentSection, comments.toString().substring(0, comments.length() - 1));
//Reseting the comment variable for further usage.
comments = new StringBuilder();
}
//Skipping to the next line.
currentIndex++;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void loadConfig() {\n\t}",
"public void loadConfig(){\n \t\tFile configDir = this.getDataFolder();\n \t\tif (!configDir.exists())\n \t\t\tconfigDir.mkdir();\n \n \t\t// Check for existance of config file\n \t\tFile configFile = new File(this.getDataFolder().toString() + \"/config.yml\");\n \t\tconfig = Ya... | [
"0.7047127",
"0.6938834",
"0.692749",
"0.6768285",
"0.67199033",
"0.6655478",
"0.6513463",
"0.6454047",
"0.6447206",
"0.6443406",
"0.6413834",
"0.63804144",
"0.63722366",
"0.6339265",
"0.6332967",
"0.62964684",
"0.62486124",
"0.6218726",
"0.6207145",
"0.6202535",
"0.62011576"... | 0.60419726 | 32 |
Parsing all the data (keys, values and comments) into a valid string, that will be written into a file later. | @Override
public String saveToString() {
//First, we set headers to null - as we will handle all comments, including headers, in this method.
this.options().header(null);
//Get the string of the data (keys and values) and parse it into an array of lines.
List<String> lines = new ArrayList<>(Arrays.asList(super.saveToString().split("\n")));
//Variables that are used to track progress.
int currentIndex = 0;
String currentSection = "";
while (currentIndex < lines.size()) {
String line = lines.get(currentIndex);
//Checking if the line is a new section.
if (isNewSection(line)) {
//Parsing the line into a full-path.
currentSection = getSectionPath(this, line, currentSection);
//Checking if that path contains a comment
if (containsComment(currentSection)) {
//Adding the comment to the lines array at that index (adding it one line before the actual line)
lines.add(currentIndex, getComment(currentSection));
//Skipping one line so the pointer will point to the line we checked again.
currentIndex++;
}
}
//Skipping to the next line.
currentIndex++;
}
//Parsing the array of lines into a one single string.
StringBuilder contents = new StringBuilder();
for (String line : lines)
contents.append("\n").append(line);
return contents.length() == 0 ? "" : contents.substring(1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void dump(StringBuilder builder, int indent, char quote)\n {\n String spacing = \"\";\n for (int i = 0; i < indent; i++)\n {\n spacing += ' ';\n }\n\n for (String key : keys)\n {\n // Comments first\n if (comments.containsKey(key... | [
"0.568595",
"0.5424573",
"0.52305734",
"0.52283925",
"0.5142156",
"0.51401746",
"0.51157224",
"0.5028543",
"0.5009238",
"0.5007034",
"0.49988538",
"0.49672744",
"0.4949321",
"0.4948932",
"0.49281788",
"0.49196538",
"0.49169138",
"0.49138793",
"0.48904425",
"0.48839343",
"0.48... | 0.6464166 | 0 |
Sync a specific configuration section with another one, recursively. | private boolean syncConfigurationSection(CommentedConfiguration commentedConfig, ConfigurationSection section, List<String> ignoredSections) {
//Variables that are used to track progress.
boolean changed = false;
//Going through all the keys of the section.
for (String key : section.getKeys(false)) {
//Parsing the key into a full-path.
String path = section.getCurrentPath().isEmpty() ? key : section.getCurrentPath() + "." + key;
//Checking if the key is also a section.
if (section.isConfigurationSection(key)) {
//Checking if the section is ignored.
boolean isIgnored = ignoredSections.stream().anyMatch(path::contains);
//Checking if the config contains the section.
boolean containsSection = contains(path);
//If the config doesn't contain the section, or it's not ignored - we will sync data.
if (!containsSection || !isIgnored) {
//Syncing data and updating the changed variable.
changed = syncConfigurationSection(commentedConfig, section.getConfigurationSection(key), ignoredSections) || changed;
}
}
//Checking if the config contains the path (not a section).
else if (!contains(path)) {
//Saving the value of the key into the config.
set(path, section.get(key));
//Updating variables.
changed = true;
}
//Checking if there is a valid comment for the path, and also making sure the comments are not the same.
if (commentedConfig.containsComment(path) && !commentedConfig.getComment(path).equals(getComment(path))) {
//Saving the comment of the key into the config.
setComment(path, commentedConfig.getComment(path));
//Updating variable.
changed = true;
}
}
/*Keys cannot be ordered easily, so we need to do some tricks to make sure
all of them are ordered correctly (and the new config will look the same
as the resource that was provided).*/
//Checking if there was a value that had been added into the config
if (changed)
correctIndexes(section, getConfigurationSection(section.getCurrentPath()));
return changed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void syncConfig(Configuration config)\n {\n userModCfgs = new HashMap<String, ThirdPartyModConfig>();\n /*\n * Get / Set 3rd Party Mod configs\n */\n TCSettings.userConfigOverridesIMC = config.getBoolean(\"userConfigOverridesIMC\", Reference.CTGY_TREE_MOD_CFG,\n ... | [
"0.62235105",
"0.5984865",
"0.56119585",
"0.5591881",
"0.5463242",
"0.5402631",
"0.5395903",
"0.53606874",
"0.5323345",
"0.5306227",
"0.53053457",
"0.5273371",
"0.51781815",
"0.5170368",
"0.51625323",
"0.5066016",
"0.5004729",
"0.49748603",
"0.49019042",
"0.48805204",
"0.4873... | 0.68366283 | 0 |
Flag this config as failed to load. | private CommentedConfiguration flagAsFailed() {
creationFailure = true;
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void RomLoadErr(){\n\t\tloadError = true;\t\t\n\t}",
"@LogMessage(level = WARN)\n @Message(\n value = \"A configurationResourceName was set to %s but the resource could not be loaded from the classpath. \" +\n \"SpringCache will configure itself using defaults.\",\n... | [
"0.63546944",
"0.62040776",
"0.6202138",
"0.61708766",
"0.6135844",
"0.59236825",
"0.5922977",
"0.5912613",
"0.5857835",
"0.58428895",
"0.5786213",
"0.57651544",
"0.57435554",
"0.56968224",
"0.55669785",
"0.5538397",
"0.55290884",
"0.5528816",
"0.5523657",
"0.5522291",
"0.549... | 0.58214164 | 10 |
Load a config from a file. | public static CommentedConfiguration loadConfiguration(File file) {
try {
FileInputStream stream = new FileInputStream(file);
return loadConfiguration(new InputStreamReader(stream, StandardCharsets.UTF_8));
} catch (FileNotFoundException ex) {
Bukkit.getLogger().warning("File " + file.getName() + " doesn't exist.");
return new CommentedConfiguration().flagAsFailed();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public T loadConfig(File file) throws IOException;",
"public FileConfiguration loadConfiguration(File file);",
"private static YamlConfig load(File file) {\n\t\tif (file == null) {\n\t\t\tthrow new IllegalArgumentException(\"Config file is null\");\n\t\t}\n\t\tif (!file.exists()) {\n\t\t\tthrow new IllegalArgu... | [
"0.82310164",
"0.75497663",
"0.7100135",
"0.69386727",
"0.6856586",
"0.6691456",
"0.6608758",
"0.6543393",
"0.6462273",
"0.6446739",
"0.64335877",
"0.6368229",
"0.6316452",
"0.6289504",
"0.6277827",
"0.62713253",
"0.6240056",
"0.6233765",
"0.6164405",
"0.6126581",
"0.6117897"... | 0.64556074 | 9 |
Load a config from an inputstream, which is used for resources that are obtained using JavaPlugingetResource. | public static CommentedConfiguration loadConfiguration(InputStream inputStream) {
return loadConfiguration(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static Config loadConfig(InputStream inputStream) {\n try {\n return loadConfig(asMap(new Yaml().load(inputStream)));\n } catch (ScannerException e) {\n throw new YamlParserException(e);\n }\n }",
"public ConfigBuilder<C> addYamlConfig(InputStream inputStream) {\n String content;\n... | [
"0.68449765",
"0.6478719",
"0.6154964",
"0.6144388",
"0.61234134",
"0.6091545",
"0.6077269",
"0.6064586",
"0.6031663",
"0.5979761",
"0.58611155",
"0.5846612",
"0.58204615",
"0.5816573",
"0.57121754",
"0.5615375",
"0.5600661",
"0.55936",
"0.5581758",
"0.55441993",
"0.5534827",... | 0.5641336 | 15 |
Load a config from a reader (used for files and streams together). | public static CommentedConfiguration loadConfiguration(Reader reader) {
//Creating a blank instance of the config.
CommentedConfiguration config = new CommentedConfiguration();
//Parsing the reader into a BufferedReader for an easy reading of it.
try (BufferedReader bufferedReader = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader)) {
StringBuilder contents = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
contents.append(line).append('\n');
}
config.loadFromString(contents.toString());
} catch (IOException | InvalidConfigurationException ex) {
config.flagAsFailed();
ex.printStackTrace();
}
return config;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static ConfigImpl loadJson(Reader reader) {\n ConfigImpl ret = new ConfigImpl();\n JsonParser parser = new JsonParser();\n JsonElement element = parser.parse(reader);\n loadJson(element, ret, \"\");\n return ret;\n }",
"private static ConfigImpl loadProperties(Reader reader) throws IOExce... | [
"0.70076156",
"0.69644773",
"0.6649765",
"0.6481551",
"0.6391237",
"0.6375923",
"0.6304415",
"0.60394114",
"0.5989678",
"0.5963579",
"0.58599895",
"0.5857459",
"0.58271146",
"0.5806216",
"0.5783878",
"0.57663614",
"0.57497317",
"0.57315576",
"0.5687297",
"0.5669944",
"0.56671... | 0.71683705 | 0 |
Checks if a line is a new section or not. Sadly, that's not possible to use ":" as a spacer between key and value, and ": " must be used. | private static boolean isNewSection(String line) {
String trimLine = line.trim();
return trimLine.contains(": ") || trimLine.endsWith(":");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean addNewLineAfterSemocolon(Token<CppTokenId> current) {\n if (!ts.isLastLineToken()) {\n ts.addAfterCurrent(current, 1, getIndent(), true);\n return true;\n }\n return false;\n }",
"abstract protected boolean isHeaderLine(String line);",
"public boole... | [
"0.5632257",
"0.55733013",
"0.5557022",
"0.54597926",
"0.5407663",
"0.53685063",
"0.5349459",
"0.531271",
"0.52501845",
"0.52193755",
"0.52192235",
"0.5212173",
"0.5184956",
"0.51799023",
"0.5179328",
"0.5176952",
"0.5164508",
"0.5130919",
"0.51072395",
"0.5092793",
"0.508500... | 0.8050033 | 0 |
Creates a full path of a line. | private static String getSectionPath(CommentedConfiguration commentedConfig, String line, String currentSection) {
//Removing all spaces and getting the name of the section.
String newSection = line.trim().split(": ")[0];
//Parsing some formats to make sure having a plain name.
if (newSection.endsWith(":"))
newSection = newSection.substring(0, newSection.length() - 1);
if (newSection.startsWith("."))
newSection = newSection.substring(1);
if (newSection.startsWith("'") && newSection.endsWith("'"))
newSection = newSection.substring(1, newSection.length() - 1);
//Checking if the new section is a child-section of the currentSection.
if (!currentSection.isEmpty() && commentedConfig.contains(currentSection + "." + newSection)) {
newSection = currentSection + "." + newSection;
}
//Looking for the parent of the the new section.
else {
String parentSection = currentSection;
/*Getting the parent of the new section. The loop will stop in one of the following situations:
1) The parent is empty - which means we have no where to go, as that's the root section.
2) The config contains a valid path that was built with <parent-section>.<new-section>.*/
while (!parentSection.isEmpty() &&
!commentedConfig.contains((parentSection = getParentPath(parentSection)) + "." + newSection)) ;
//Parsing and building the new full path.
newSection = parentSection.trim().isEmpty() ? newSection : parentSection + "." + newSection;
}
return newSection;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Line createLine();",
"Path createPath();",
"public Line getLine(String targetLine);",
"private void Create_Path() {\n lines = new Line[getPoints().size()];\n for (int i = 1; i < getLines().length; i++) {\n lines[i] = new Line(getPoints().get(way[i]).getX(), getPoints().get(way[i]).ge... | [
"0.66254634",
"0.6311212",
"0.6128411",
"0.58775926",
"0.5810444",
"0.5704714",
"0.56980157",
"0.56547517",
"0.56508726",
"0.5610886",
"0.54727805",
"0.54495245",
"0.54199445",
"0.53865576",
"0.5355361",
"0.5346794",
"0.5337805",
"0.530272",
"0.5291592",
"0.52838373",
"0.5274... | 0.0 | -1 |
Checks if a line represents a comment or not. | private static boolean isComment(String line) {
String trimLine = line.trim();
return trimLine.startsWith("#") || trimLine.isEmpty();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isComment(String line) {\n\t\tif (line.equals(\"\")) return true;\n\t\t\n\t\t// If the line starts with \"//\".\n\t\tif (line.substring(0, 2).equals(\"//\")) return true;\n\t\t\n\t\treturn false;\n\t}",
"public boolean isCommentedLine(@NotNull String line) {\n return line.trim().startsWith... | [
"0.8602354",
"0.82944536",
"0.82073593",
"0.70022696",
"0.6962595",
"0.67232835",
"0.67018795",
"0.6595775",
"0.6583219",
"0.65565777",
"0.6545362",
"0.6462679",
"0.63755804",
"0.636857",
"0.6300304",
"0.62288326",
"0.62285995",
"0.62250495",
"0.62193286",
"0.6209231",
"0.619... | 0.83610696 | 1 |
Get the parent path of the provided path, by removing the last '.' from the path. | private static String getParentPath(String path) {
return path.contains(".") ? path.substring(0, path.lastIndexOf('.')) : "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String getParentPath(String path) {\n int slash = path.lastIndexOf('/');\n if (slash == -1) {\n return null;\n } else {\n if (slash == 0) {\n // return \"root\" if parent path is empty string\n return \"/\";\n } els... | [
"0.8217277",
"0.7043375",
"0.67020756",
"0.66937625",
"0.66114354",
"0.65223646",
"0.65223646",
"0.6501627",
"0.64084077",
"0.6404562",
"0.6329756",
"0.62825185",
"0.6234165",
"0.62242323",
"0.60144186",
"0.5896713",
"0.58871657",
"0.5828477",
"0.58013624",
"0.5784097",
"0.57... | 0.83533627 | 0 |
Convert keyindexes of a section into the same keyindexes that another section has. | private static void correctIndexes(ConfigurationSection section, ConfigurationSection target) {
//Parsing the sections into ArrayLists with their keys and values.
List<Pair<String, Object>> sectionMap = getSectionMap(section), correctOrder = new ArrayList<>();
//Going through the sectionMap, which is in the correct order.
for (Pair<String, Object> entry : sectionMap) {
//Adding the entry into a new list with the correct value from the target section.
correctOrder.add(new Pair<>(entry.key, target.get(entry.key)));
}
/*The only way to change key-indexes is to add them one-by-one again, in the correct order.
In order to do so, the section needs to be cleared so the indexes will be reset.*/
//Clearing the configuration.
clearConfiguration(target);
//Adding the entries again in the correct order.
for (Pair<String, Object> entry : correctOrder)
target.set(entry.key, entry.value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private HashMap<String, HashSet<String>> convertIndexToMap(IndexReader reader) throws IOException{\n\t\t HashMap<String, HashSet<String>> hmap = new HashMap<String, HashSet<String>>();\n\t\t HashSet<String> docIdSet;\n\t\t \n\t\t for(int i=0; i<reader.numDocs(); i++){\n\t\t\t Fields termVect = reader.getTermVector... | [
"0.49161717",
"0.4757262",
"0.47102037",
"0.4691927",
"0.46267033",
"0.45788836",
"0.45538932",
"0.45354435",
"0.45291972",
"0.44972184",
"0.44600487",
"0.44446924",
"0.44347432",
"0.43853256",
"0.4374521",
"0.4369378",
"0.4350188",
"0.43416667",
"0.43271402",
"0.43234223",
"... | 0.61451614 | 0 |
Parsing a section into a list that contains all of it's keys and their values without changing their order. | private static List<Pair<String, Object>> getSectionMap(ConfigurationSection section) {
//Creating an empty ArrayList.
List<Pair<String, Object>> list = new ArrayList<>();
//Going through all the keys and adding them in the same order.
for (String key : section.getKeys(false)) {
list.add(new Pair<>(key, section.get(key)));
}
return list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Map<String, String> readIniSectionMap(Section section) {\n\t\tMap<String,String> sectionMap = new HashMap<String, String>();\n\t\tfor(String key:section.keySet()) {\n\t\t\tif(!key.equals(\"NaN\")) {\n\t\t\t\tif(section.getAll(key).size()>1) { // TODO always == 1 ???\n\t\t\t\t\tlog.warn(\"multiple ent... | [
"0.60963565",
"0.5593461",
"0.5311834",
"0.5301589",
"0.5155574",
"0.5148847",
"0.5135729",
"0.5121205",
"0.5118133",
"0.5099624",
"0.49615657",
"0.49580777",
"0.4939253",
"0.4884173",
"0.4818863",
"0.47907987",
"0.47472358",
"0.47370854",
"0.47269997",
"0.46915892",
"0.46901... | 0.76534706 | 0 |
Clear a configuration section from all of its keys. This can be done by setting all the keys' values to null. | private static void clearConfiguration(ConfigurationSection section) {
for (String key : section.getKeys(false))
section.set(key, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void clear()\r\n {\r\n for (int i = 0; i < values.length; i++)\r\n keys[i] = null;\r\n size = 0;\r\n }",
"public static void clear() {\r\n for (ConfigurationOption<?> opt : OPTIONS.values()) {\r\n opt.clear();\r\n }\r\n }",
"public void clear()\... | [
"0.68862176",
"0.68061405",
"0.6660689",
"0.6624698",
"0.6446007",
"0.6411263",
"0.6352976",
"0.63484156",
"0.6318933",
"0.6311357",
"0.6284557",
"0.6284285",
"0.62779284",
"0.62273747",
"0.6203296",
"0.61144555",
"0.6097841",
"0.6093209",
"0.6042137",
"0.60335946",
"0.601751... | 0.8138255 | 0 |
Raises the <a href=" log level. | void k2h_bump_debug_level(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void disableLink(Link<Void> l) {\n\t\tl.add(new AttributeAppender(\"class\", new Model<String>(\"current\"), \" \"));\n\t\tl.setRenderBodyOnly(true);\n\t\tl.setEnabled(false);\n\t}",
"private void writeLink() throws SAXException, IOException {\n if (state.uri != null && state.uri.trim().length()... | [
"0.5728434",
"0.550913",
"0.5382882",
"0.52805823",
"0.51804584",
"0.5079654",
"0.5048717",
"0.5041244",
"0.5017372",
"0.50100756",
"0.49822143",
"0.49107188",
"0.49072644",
"0.48809457",
"0.4847478",
"0.4829891",
"0.48134878",
"0.47955334",
"0.47882774",
"0.47844237",
"0.477... | 0.0 | -1 |
Sets the <a href=" level of the importance of the message is the "silent" level which is the highest level | void k2h_set_debug_level_silent(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPriority (int level)\n\t{\n\tthis.level = level;\n\n\tif (level == 1)\n\tpriority = \"Critical\";\n\tif (level == 2)\n\tpriority = \"Very Important\";\n\tif (level == 3)\n\tpriority = \"Normal\";\n\tif (level == 4)\n\tpriority = \"Low\";\n\tif (level == 5)\n\tpriority = \"Not Important\";\n\t}",
"... | [
"0.50203",
"0.50104463",
"0.4970318",
"0.49447128",
"0.4941463",
"0.49291307",
"0.49219167",
"0.48998234",
"0.487744",
"0.4875923",
"0.48691106",
"0.4865814",
"0.48481488",
"0.4832007",
"0.48274776",
"0.4826119",
"0.48254248",
"0.48245457",
"0.48223013",
"0.48108852",
"0.4810... | 0.0 | -1 |
Sets the <a href=" level of the importance of the message is the "error" level or higher. | void k2h_set_debug_level_error(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setMinimumLevel(ErrorLevel el);",
"public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder setErrorLevel(java.lang.String value) {\n validate(fields()[5], value);\n this.errorLevel = value;\n fieldSetFlags()[5] = true;\n return this;\n }",
"@Override\n publ... | [
"0.60628235",
"0.5350114",
"0.53044206",
"0.5303955",
"0.5254274",
"0.5070745",
"0.50251037",
"0.5010739",
"0.4988342",
"0.4975659",
"0.49519476",
"0.49479496",
"0.48650578",
"0.48619553",
"0.4839681",
"0.4831019",
"0.4819078",
"0.4818484",
"0.4796807",
"0.47875908",
"0.47863... | 0.0 | -1 |
Sets the <a href=" level of the importance of the message is the "warning" level or higher. | void k2h_set_debug_level_warning(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addWarning(String warning);",
"private void setWarning(String message)\n\t{\n\t\tstatus.setTextFill(RED);\n\t\tstatus.setText(message);\n\t}",
"public static void showWarnings() {\n\t\tenableWarn = true;\n\t}",
"public void warningPermit();",
"public CompilationBuilder setWarningLevel(int level... | [
"0.5734884",
"0.5644224",
"0.5532802",
"0.5479714",
"0.5410398",
"0.5402529",
"0.52510613",
"0.5249719",
"0.5191916",
"0.5188174",
"0.5154231",
"0.51492655",
"0.51321614",
"0.51138973",
"0.5088238",
"0.5058547",
"0.5032888",
"0.5031883",
"0.5021672",
"0.5010349",
"0.50092065"... | 0.4962126 | 31 |
Sets the <a href=" level of the importance of the message is the "dump" level which is the lowest level. | void k2h_set_debug_level_message(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setLevel(int aLevel, Context context){\n this.level = aLevel;\n writeFile(context);\n }",
"public void setLevel(String level);",
"public void setThreshold(String level) {\n\t\tthis.hierarchy.setThreshold(level);\n\t}",
"public void setLevel(String newLevel) {\n level = newLe... | [
"0.55252075",
"0.53890705",
"0.5313277",
"0.5290004",
"0.5283299",
"0.5250507",
"0.52258545",
"0.519321",
"0.5186452",
"0.5186452",
"0.5182231",
"0.5159651",
"0.5158401",
"0.5141887",
"0.51389664",
"0.51086634",
"0.5108148",
"0.51078534",
"0.5100415",
"0.5100415",
"0.508143",... | 0.0 | -1 |
Sets the <a href=" log file name. | boolean k2h_set_debug_file(String filepath); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setLogFilesUrls() {\n String s = \"\";\n s = s + makeLink(\"NODE-\" + getNodeName() + \"-out.log\");\n s = s + \"<br>\" + makeLink(\"NODE-\" + getNodeName() + \"-err.log\");\n s = s + \"<br>\" + makeLink(\"log-\" + getNodeName() + \".html\");\n logFilesUrls = s;\n }",
"protec... | [
"0.67624396",
"0.5863965",
"0.58156145",
"0.5751431",
"0.5594126",
"0.5568222",
"0.5563098",
"0.5561917",
"0.5516046",
"0.54762614",
"0.5475624",
"0.54672015",
"0.5447303",
"0.5424419",
"0.5340203",
"0.53350353",
"0.53170466",
"0.52585167",
"0.5249861",
"0.52436644",
"0.52346... | 0.0 | -1 |
Sets the <a href=" log file to the standard error(stderr). | boolean k2h_unset_debug_file(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setStderrFile(File file);",
"public void setLogFilesUrls() {\n String s = \"\";\n s = s + makeLink(\"NODE-\" + getNodeName() + \"-out.log\");\n s = s + \"<br>\" + makeLink(\"NODE-\" + getNodeName() + \"-err.log\");\n s = s + \"<br>\" + makeLink(\"log-\" + getNodeName() + \".html\");\n ... | [
"0.64637804",
"0.6303985",
"0.62078387",
"0.59790623",
"0.58275044",
"0.56886464",
"0.56613916",
"0.565891",
"0.56246424",
"0.5399398",
"0.5392383",
"0.53853136",
"0.5380609",
"0.52857465",
"0.5265973",
"0.5244235",
"0.52223134",
"0.51788497",
"0.5171775",
"0.51658005",
"0.51... | 0.0 | -1 |
Sets the <a href=" level of the importance of the message by referring the K2HDBGMODE enviroment and sets a log file by referring the K2HDBGFILE enviroment. | boolean k2h_load_debug_env(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void k2h_set_debug_level_message();",
"void k2h_set_debug_level_error();",
"public void setLevel(int aLevel, Context context){\n this.level = aLevel;\n writeFile(context);\n }",
"void k2h_set_debug_level_warning();",
"boolean k2h_set_debug_file(String filepath);",
"void k2h_set_debug_lev... | [
"0.60594994",
"0.5461171",
"0.54563195",
"0.5389732",
"0.5355843",
"0.5353282",
"0.53341484",
"0.53293437",
"0.5174453",
"0.5139018",
"0.51366913",
"0.50516737",
"0.49848557",
"0.49749997",
"0.49559605",
"0.48860145",
"0.48603743",
"0.48507836",
"0.48200664",
"0.48108864",
"0... | 0.0 | -1 |
Sets the <a href=" level of the importance of the message higher by receiving a SIGUSR1 signal. If the level reachs the highest, the level falls back to the lowest level. | boolean k2h_set_bumup_debug_signal_user1(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPriority (int level)\n\t{\n\tthis.level = level;\n\n\tif (level == 1)\n\tpriority = \"Critical\";\n\tif (level == 2)\n\tpriority = \"Very Important\";\n\tif (level == 3)\n\tpriority = \"Normal\";\n\tif (level == 4)\n\tpriority = \"Low\";\n\tif (level == 5)\n\tpriority = \"Not Important\";\n\t}",
"... | [
"0.53103656",
"0.51724905",
"0.51215965",
"0.507006",
"0.5054943",
"0.50360805",
"0.50283134",
"0.5012031",
"0.4994141",
"0.49896297",
"0.49716684",
"0.49605834",
"0.49266964",
"0.4925102",
"0.490948",
"0.4846871",
"0.48452133",
"0.48121357",
"0.48081934",
"0.47945336",
"0.47... | 0.0 | -1 |
Frees the address of the K2HKEYPCK pointer. | boolean k2h_free_keypack(PointerByReference pkeys, int keycnt); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void freeMemory() {\n native_freeMemory();\n }",
"boolean k2h_free_keyarray(String[] pkeys);",
"public void internal_dispose_GC (int phGC, GCData data) {\n\tOS.PgDestroyGC(phGC);\r\n}",
"public native void free();",
"public static native void Destroy(long lpjFbxDataType);",
"private nati... | [
"0.58055645",
"0.57075775",
"0.5667326",
"0.55000037",
"0.5468704",
"0.5449418",
"0.54213154",
"0.540238",
"0.5392695",
"0.5352974",
"0.5322258",
"0.5321285",
"0.52951103",
"0.5286332",
"0.5285489",
"0.52728194",
"0.5269704",
"0.52442235",
"0.52435255",
"0.5239448",
"0.523944... | 0.60018176 | 0 |
Frees the array of a pointer of a subkey string. | boolean k2h_free_keyarray(String[] pkeys); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract void _del(String key);",
"boolean k2h_free_keypack(PointerByReference pkeys, int keycnt);",
"public void dec(String key);",
"void releaseKey(int entryIndex) {\n long keyReference = getKeyReference(entryIndex);\n int[] keyArray = longToInts(keyReference);\n int blockID ... | [
"0.5743887",
"0.55958194",
"0.54765284",
"0.54458696",
"0.5281135",
"0.52576816",
"0.52145237",
"0.5188935",
"0.51790607",
"0.50897634",
"0.50816536",
"0.5072918",
"0.5005807",
"0.49763232",
"0.49684837",
"0.4967702",
"0.49632314",
"0.49562103",
"0.49494708",
"0.48096728",
"0... | 0.6458684 | 0 |
Frees the address of the K2HATTRPCK pointer. | boolean k2h_free_attrpack(K2hashAttrPack[] pattrs, int attrcnt); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void freeMappedRecord(Record record)\n {\n record.free(); // Frees both\n }",
"public void freeMemory() {\n native_freeMemory();\n }",
"public static native void Destroy(long lpjFbxDataType);",
"public void mo9198a() {\n nativeDestroyWhenAppropriate(this.f2197b);\n ... | [
"0.5802163",
"0.5652743",
"0.5610698",
"0.55735886",
"0.5573059",
"0.55106854",
"0.5502599",
"0.5412609",
"0.540229",
"0.5313038",
"0.529023",
"0.52702856",
"0.5266047",
"0.5262548",
"0.5254449",
"0.5254376",
"0.521681",
"0.52077526",
"0.5204075",
"0.52030504",
"0.5198569",
... | 0.65974706 | 0 |
Get the context for this encounter. Can be used to resolve names and other types. | GraphQLResolverContext getContext(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getContext() {\r\n\t\treturn context;\r\n\t}",
"public String getContext() {\n\t\treturn context;\n\t}",
"@java.lang.Override\n public POGOProtos.Rpc.QuestProto.Context getContext() {\n @SuppressWarnings(\"deprecation\")\n POGOProtos.Rpc.QuestProto.Context result = POGOProtos.Rpc.Que... | [
"0.69850457",
"0.6953578",
"0.6906356",
"0.6861171",
"0.6861171",
"0.6861171",
"0.68476087",
"0.68374574",
"0.683518",
"0.6834014",
"0.6823786",
"0.68065923",
"0.6769895",
"0.6679334",
"0.6678928",
"0.6675453",
"0.6675453",
"0.6673438",
"0.66715646",
"0.6668914",
"0.6613172",... | 0.56161696 | 88 |
Get the type being resolved. | TypeRef getType(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"Type getType();",
"public Type getType();",
"public Class getType();",
"Class<?> getType();",
"Cl... | [
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.73429644",
"0.7331211",
"0.7243086",
"0.715766",
"0.715766",
"0.715766",
"0.71199864",
"0.70640415",
"0.7050672",
"0.70434886",
"0.69... | 0.6755529 | 53 |
masukin order ke database | @Override
public void onClick(View v) {
mon = getIntent().getStringExtra("monday");
tue = getIntent().getStringExtra("tuesday");
wed = getIntent().getStringExtra("wednesday");
thu = getIntent().getStringExtra("thursday");
fri = getIntent().getStringExtra("friday");
sat = getIntent().getStringExtra("saturday");
sun = getIntent().getStringExtra("sunday");
deliveryday.add(mon);
deliveryday.add(tue);
deliveryday.add(wed);
deliveryday.add(thu);
deliveryday.add(fri);
deliveryday.add(sat);
deliveryday.add(sun);
Payment payment = new Payment();
payment.setCartMenu(carts);
payment.setUserEmail(usrEmail);
payment.setTransDate(transDate);
payment.setTotalPrice(totalPayment);
payment.setOngkir("10000");
payment.setDeliveryDay(deliveryday);
payment.setPaymentMethod(method[paymentMethod]);
payment.setTrans_number(String.valueOf(System.currentTimeMillis()));
if(!carts.isEmpty()){
databaseReference.child(String.valueOf(System.currentTimeMillis())).setValue(payment);
}
Commons.cartRepository.emptyCart();
Intent intent2 = new Intent(PaymentActivity.this, MainActivity.class);
startActivity(intent2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void addOrderDB(){\n OrganiseOrder organiser = new OrganiseOrder();\n Order finalisedOrder = organiser.Organise(order);\n // Generate the order id\n String id = UUID.randomUUID().toString();\n // Set the name of the order to the generated id\n finalisedOrder.setNam... | [
"0.62028784",
"0.61740613",
"0.6119974",
"0.6098835",
"0.600979",
"0.5944096",
"0.5927319",
"0.5924834",
"0.5909626",
"0.5874636",
"0.5864832",
"0.5862065",
"0.5845974",
"0.5830784",
"0.57086104",
"0.5693834",
"0.5637993",
"0.56373817",
"0.5617384",
"0.560433",
"0.5566569",
... | 0.0 | -1 |
Show confirmation dialog with two buttons | public void showConfirmDialog() {
mDialogClickInterface = (DialogueInterface) mContext;
final Dialog dialog = new Dialog(mContext);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialogue_modify);
Button buttonCancel = dialog.findViewById(R.id.btn_cancel);
Button buttonOK = dialog.findViewById(R.id.btn_ok);
final RadioGroup radioGroupLanguage = dialog.findViewById(R.id.radio_group);
dialog.setCancelable(true);
dialog.show(); // if decline button is clicked, close the custom dialog
buttonCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Close dialog
mDialogClickInterface.onLanguageSelected(dialog);
}
});
buttonOK.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Close dialog
int selectedId = radioGroupLanguage.getCheckedRadioButtonId();
switch (selectedId) {
case R.id.rb_arabic:
view.editItem(listModel,index);
break;
case R.id.rb_english:
view.deleteItem(listModel);
break;
}
mDialogClickInterface.onLanguageSelected(dialog);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void confirm();",
"public void Confirm(){\n new AlertDialog.Builder(MapsActivity.this)\n .setTitle(\"Confirm Location\")\n .setMessage(\"Are you sure about this location?\")\n .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {\n ... | [
"0.7237129",
"0.7113782",
"0.6984299",
"0.6925142",
"0.6910002",
"0.68835735",
"0.68244463",
"0.67984307",
"0.6787157",
"0.67700315",
"0.67658174",
"0.67401606",
"0.67204213",
"0.6719968",
"0.67183256",
"0.6715697",
"0.67129827",
"0.67087895",
"0.6696175",
"0.6694102",
"0.668... | 0.0 | -1 |
We ignore the srcip since we are considering distributed attacks the sources could be different but the destination port and ip should stay fixed | @Override
public int hashCode() {
return dstip.hashCode() ^ dstport.hashCode();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private byte[] obtainPackets4Source(Packet packet){\n\t\t//filter IPV6\n\t\tif(packet.contains(IpPacket.class)){\n\t\t\t\n\t\t\tIpPacket ipPkt = packet.get(IpPacket.class);\n\t\t\tIpHeader ipHeader = ipPkt.getHeader();\n\t\t\n\t\t\tbyte[] src=ipHeader.getSrcAddr().getAddress();\n\t\t\tbyte[] dest = ipHeader.getDst... | [
"0.6919657",
"0.6434495",
"0.6357554",
"0.6270063",
"0.61764294",
"0.60815716",
"0.6058007",
"0.60569584",
"0.60358876",
"0.6023868",
"0.60237813",
"0.5974595",
"0.59393585",
"0.5858912",
"0.58364767",
"0.5649172",
"0.5607319",
"0.560409",
"0.560409",
"0.5563338",
"0.5563338"... | 0.53966373 | 45 |
Compilation controller from metamodel could not be used for getting TreePath via dot because it is not based on one FileObject ( Document ). So this method is required for searching Element at dot. If appropriate element is found it's name is placed into list along with name of containing type. Resulted element could not be used in metamodel for injectable access. This is because element was gotten via other Compilation controller so it is from other model. | static boolean getVariableElementAtDot( final JTextComponent component,
final Object[] variable , final boolean showStatusOnError)
{
return getVariableElementAtDot(component, variable, showStatusOnError,
CARET_POSITION_STRATEGY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.util.List getClassPathElements();",
"Elem getQualifiedElem();",
"public AnnotatedElement getQualifiedElement()\n/* */ {\n/* 241 */ return this.qualifiedElement;\n/* */ }",
"public WebElement element(String strElement) throws Exception {\n String locator = prop.getProperty(strEleme... | [
"0.58080417",
"0.56947213",
"0.5312022",
"0.5277627",
"0.5211695",
"0.51850873",
"0.51622677",
"0.5152099",
"0.5128531",
"0.51007193",
"0.50802225",
"0.50802225",
"0.50670475",
"0.5048157",
"0.50408226",
"0.50308055",
"0.5003481",
"0.4989328",
"0.49814117",
"0.4981114",
"0.49... | 0.0 | -1 |
Compilation controller from metamodel could not be used for getting TreePath via dot because it is not based on one FileObject ( Document ). So this method is required for searching Element at dot. If appropriate element is found it's name is placed into list along with name of containing type. Resulted element could not be used in metamodel for injectable access. This is because element was gotten via other Compilation controller so it is from other model. | static boolean getVariableElementAtDot( final JTextComponent component,
final Object[] variable , final boolean showStatusOnError,
final PositionStrategy strategy)
{
JavaSource javaSource = JavaSource.forDocument(component.getDocument());
if ( javaSource == null ){
Toolkit.getDefaultToolkit().beep();
return false;
}
try {
javaSource.runUserActionTask( new Task<CompilationController>(){
@Override
public void run(CompilationController controller) throws Exception {
controller.toPhase( Phase.ELEMENTS_RESOLVED );
int dot = strategy.getOffset(component);
TreePath tp = controller.getTreeUtilities().pathFor(dot);
Element contextElement = controller.getTrees().getElement(tp );
if ( contextElement == null ){
StatusDisplayer.getDefault().setStatusText(
NbBundle.getMessage(
WebBeansActionHelper.class,
"LBL_ElementNotFound"));
return;
}
Element element = getContextElement(contextElement, controller);
if ( element == null ){
return;
}
if ( !( element instanceof VariableElement) && showStatusOnError){
StatusDisplayer.getDefault().setStatusText(
NbBundle.getMessage(
WebBeansActionHelper.class,
"LBL_NotVariableElement",
StatusDisplayer.IMPORTANCE_ERROR_HIGHLIGHT));
return;
}
else {
if ( element.getKind() == ElementKind.FIELD ){
ElementHandle<VariableElement> handle =
ElementHandle.create((VariableElement)element);
variable[0] = handle;
variable[1] = element.getSimpleName().toString();
variable[2] = InspectActionId.INJECTABLES_CONTEXT;
}
else {
setVariablePath(variable, controller, element);
}
}
}
}, true );
}
catch(IOException e ){
Logger.getLogger( GoToInjectableAtCaretAction.class.getName()).
log( Level.INFO, e.getMessage(), e);
}
return variable[1] !=null ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.util.List getClassPathElements();",
"Elem getQualifiedElem();",
"public AnnotatedElement getQualifiedElement()\n/* */ {\n/* 241 */ return this.qualifiedElement;\n/* */ }",
"public WebElement element(String strElement) throws Exception {\n String locator = prop.getProperty(strEleme... | [
"0.58076864",
"0.5692975",
"0.53104925",
"0.5276586",
"0.5209527",
"0.51839375",
"0.516407",
"0.5151208",
"0.512713",
"0.5100795",
"0.507775",
"0.507775",
"0.50650287",
"0.50464267",
"0.50406545",
"0.50308275",
"0.500164",
"0.4987475",
"0.49821213",
"0.49799818",
"0.49764508"... | 0.0 | -1 |
Based on the context element method chooses different element. If element is not "injection" ( not injection point and has no injection context ) method sets the error message in the status and return null. | static Element getContextElement(Element element ,
CompilationController controller )
{
if ( element instanceof TypeElement ){
if ( hasAnnotation(element, DECORATOR) ){
List<VariableElement> fieldsIn = ElementFilter.fieldsIn(
controller.getElements().getAllMembers((TypeElement)element));
for (VariableElement variableElement : fieldsIn) {
if ( hasAnnotation(variableElement, DELEGATE)){
return variableElement;
}
}
StatusDisplayer.getDefault().setStatusText(
NbBundle.getMessage(
WebBeansActionHelper.class,
"LBL_NotDecorator"));
}
return null;
}
return element;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void fail(String message, @Nullable Element element);",
"@Test\n\tvoid bindStatusGetErrorMessagesAsString() throws JspException {\n\t\tPageContext pc = createPageContext();\n\t\tErrors errors = new ServletRequestDataBinder(new TestBean(), \"tb\").getBindingResult();\n\t\terrors.reject(\"code1\", null, \"message1... | [
"0.55778915",
"0.5307942",
"0.52985215",
"0.52289784",
"0.49891803",
"0.49846295",
"0.4827672",
"0.4812211",
"0.47568074",
"0.4755651",
"0.47494325",
"0.4744178",
"0.47228044",
"0.4672488",
"0.46609968",
"0.46271276",
"0.46207166",
"0.46060285",
"0.46041772",
"0.46001503",
"0... | 0.5083941 | 4 |
Created by gvoiron on 24/11/16. Time : 16:25 | public interface IEventBFormatterVisitable {
String accept(EventBFormatter visitor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void mo38117a() {\n }",
"public void mo4359a() {\n }",
"public final void mo51373a() {\n }",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n ... | [
"0.57819504",
"0.5730286",
"0.57007194",
"0.56820583",
"0.5679561",
"0.5650072",
"0.5650072",
"0.5650072",
"0.5650072",
"0.5650072",
"0.5650072",
"0.5650072",
"0.56332064",
"0.5576775",
"0.5576775",
"0.5565775",
"0.5539615",
"0.5530225",
"0.55260915",
"0.55158865",
"0.5486376... | 0.0 | -1 |
/ Format the given BigInteger | @Override
public void format(StringBuilder buffer, Object o, String pattern) {
formatter = new Formatter();
if (pattern == null) {
throw new FormatterException("Null pattern string");
}
if (!pattern.matches(".*[" + conv + "]")) {
throw new FormatterException("Pattern for BigInteger must end with one of " + conv);
}
try {
buffer.append(formatter.format("%" + pattern, o));
} catch (Exception ex) {
throw new FormatterException(
"Error while formatting BigInteger: "
+ ex.getMessage(),
ex);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public StringBuffer format(BigInteger number, StringBuffer toAppendTo, FieldPosition pos)\n/* */ {\n/* 1137 */ return format(new com.ibm.icu.math.BigDecimal(number), toAppendTo, pos);\n/* */ }",
"static void print(BigInteger[] P) \r\n{\r\n\tString a = P[0].toString(1... | [
"0.7083026",
"0.6335124",
"0.6193413",
"0.6042525",
"0.6042303",
"0.60340905",
"0.6010842",
"0.60026616",
"0.57203877",
"0.5702397",
"0.56918",
"0.56800115",
"0.56440073",
"0.5640886",
"0.56181407",
"0.5617697",
"0.56116027",
"0.56002504",
"0.5560092",
"0.5539484",
"0.5533290... | 0.5907972 | 8 |
Calculates the difference in coordinates between two sets of fiducial data. | public static double[][] calcDeltas( int dataLen, int dataWid, double[][] dataIdeal, double[][] dataMeasured )
{
if( dataIdeal == null ){ throw new IllegalArgumentException("no data"); }
if( dataMeasured == null ){ throw new IllegalArgumentException("no data"); }
if( dataLen == 0 || dataWid == 0 ){ throw new IllegalArgumentException("no info"); }
double[][] dataDeltas = new double[dataLen][dataWid];
for( int j = 0; j < dataLen; j++ )
{
if( VERBOSE ) System.out.printf("calculating deltas for point %d\n", j );
for( int i = 0; i < dataWid; i++ )
{
dataDeltas[j][i] = dataMeasured[j][i] - dataIdeal[j][i];
if( VERBOSE ) System.out.printf("% 8.3f - % 8.3f = % 8.3f\n", dataMeasured[j][i], dataIdeal[j][i], dataDeltas[j][i] );
}
}
return dataDeltas;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private double feetBetweenCoordinates(double latitude1, double longitude1, double latitude2, double longitude2) {\n int radiusOfEarth = 20903520; // mean radius of Earth in feet\n double deltaLat = Math.toRadians(latitude2 - latitude1); // change in latitude\n double deltaLong = Math.toRadians... | [
"0.56351876",
"0.55822843",
"0.55502886",
"0.5513089",
"0.5496532",
"0.5470421",
"0.54356164",
"0.5434008",
"0.5359525",
"0.534222",
"0.53252286",
"0.5294727",
"0.5294012",
"0.5291671",
"0.5261635",
"0.52554995",
"0.52540916",
"0.51908976",
"0.51903903",
"0.511773",
"0.511301... | 0.0 | -1 |
Calculates the difference in coordinates between two sets of fiducial data. | public static double[][][] calcDeltas( int dataLen, int dataWid, int dataThk, double[][][] dataIdeal, double[][][] dataMeasured )
{
if( dataIdeal == null ){ throw new IllegalArgumentException("no data"); }
if( dataMeasured == null ){ throw new IllegalArgumentException("no data"); }
if( dataLen == 0 || dataWid == 0 ){ throw new IllegalArgumentException("no info"); }
double[][][] dataDeltas = new double[dataLen][dataWid][dataThk];
for( int j = 0; j < dataLen; j++ )
{
if( VERBOSE ) System.out.printf("calculating deltas for point %d\n", j );
for( int i = 0; i < dataWid; i++ )
{
dataDeltas[j][i][0] = dataMeasured[j][i][0] - dataIdeal[j][i][0]; // calculate difference
dataDeltas[j][i][1] = dataMeasured[j][i][1] - dataIdeal[j][i][1]; // sum uncertainties
if( VERBOSE ) System.out.printf("% 8.3f:% 8.3f - % 8.3f:% 8.3f = % 8.3f:% 8.3f\n",
dataMeasured[j][i][0], dataMeasured[j][i][1],
dataIdeal[j][i][0], dataIdeal[j][i][1],
dataDeltas[j][i][0], dataDeltas[j][i][1] );
}
}
return dataDeltas;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private double feetBetweenCoordinates(double latitude1, double longitude1, double latitude2, double longitude2) {\n int radiusOfEarth = 20903520; // mean radius of Earth in feet\n double deltaLat = Math.toRadians(latitude2 - latitude1); // change in latitude\n double deltaLong = Math.toRadians... | [
"0.5633379",
"0.5582344",
"0.55520904",
"0.55131763",
"0.5495416",
"0.54694164",
"0.54338706",
"0.54337496",
"0.53579235",
"0.5342003",
"0.532584",
"0.5294594",
"0.5293422",
"0.5290912",
"0.5261849",
"0.5255112",
"0.5253118",
"0.5190798",
"0.5190031",
"0.5116934",
"0.51119775... | 0.0 | -1 |
long time = new Date().getTime(); String strFlapjackTextFile = "Flapjack" + String.valueOf(time); System.out.println(" listOfAllQTLDetails:"+listOfAllQTLDetails); System.out.println(" hmOfQtlIdandName:"+hmOfQtlIdandName); System.out.println(" strSelectedExportType=:"+strSelectedExportType); System.out.println(" bQTLExists=:"+bQTLExists); | private void writeTextFile(
GDMSMain theMainHomePage,
ArrayList<QtlDetailElement> listOfAllQTLDetails, HashMap<Integer, String> hmOfQtlPosition, HashMap<String, Integer> hmOfQtlNameId,
HashMap<Integer, String> hmOfQtlIdandName, String strSelectedExportType, boolean bQTLExists) throws GDMSException {
String strFlapjackTextFile = "Flapjack";
File baseDirectory = theMainHomePage.getMainWindow().getApplication().getContext().getBaseDirectory();
File absoluteFile = baseDirectory.getAbsoluteFile();
File[] listFiles = absoluteFile.listFiles();
File fileExport = baseDirectory;
for (File file : listFiles) {
if(file.getAbsolutePath().endsWith("Flapjack")) {
fileExport = file;
break;
}
}
String strFilePath = fileExport.getAbsolutePath();
//System.out.println("strFilePath=:"+strFilePath);
generatedTextFile = new File(strFilePath + "\\" + strFlapjackTextFile + ".txt");
/** writing tab delimited qtl file for FlapJack
* consisting of marker chromosome & position
*
* **/
try {
/*
//factory = new ManagerFactory(GDMSModel.getGDMSModel().getLocalParams(), GDMSModel.getGDMSModel().getCentralParams());
factory=GDMSModel.getGDMSModel().getManagerFactory();
OntologyDataManager ontManager=factory.getOntologyDataManager();
*/
FileWriter flapjackTextWriter = new FileWriter(generatedTextFile);
BufferedWriter flapjackBufferedWriter = new BufferedWriter(flapjackTextWriter);
//getAllelicValuesByGidsAndMarkerNames
//genoManager.getAlle
// fjackQTL.write("QTL\tChromosome\tPosition\tMinimum\tMaximum\tTrait\tExperiment\tTrait Group\tLOD\tR2\tFlanking markers in original publication");
flapjackBufferedWriter.write("QTL\tChromosome\tPosition\tMinimum\tMaximum\tTrait\tExperiment\tTrait Group\tLOD\tR2\tFlanking markers in original publication\teffect");
flapjackBufferedWriter.write("\n");
for (int i = 0 ; i < listOfAllQTLDetails.size(); i++){
//System.out.println(listOfAllQTLDetails.get(i));
QtlDetailElement qtlDetails = listOfAllQTLDetails.get(i);
/*QtlDetailsPK id = qtlDetails.getQtlName().get.getId();
Integer qtlId = id.getQtlId();*/
//String strQtlName = hmOfQtlIdandName.get(qtlId);
String strQtlName =qtlDetails.getQtlName();
int qtlId=hmOfQtlNameId.get(strQtlName);
//qtlDetails.get
//Float clen = qtlDetails.getClen();
//Float fEffect = qtlDetails.getEffect();
int fEffect = qtlDetails.getEffect();
Float fMaxPosition = qtlDetails.getMaxPosition();
Float fMinPosition = qtlDetails.getMinPosition();
//Float fPosition = qtlDetails.getPosition();
String fPosition = hmOfQtlPosition.get(qtlId);
Float frSquare = qtlDetails.getRSquare();
Float fScoreValue = qtlDetails.getScoreValue();
String strExperiment = qtlDetails.getExperiment();
//String strHvAllele = qtlDetails..getHvAllele();
//String strHvParent = qtlDetails.getHvParent();
//String strInteractions = qtlDetails.getInteractions();
String strLeftFlankingMarker = qtlDetails.getLeftFlankingMarker();
String strLinkageGroup = qtlDetails.getChromosome();
//String strLvAllele = qtlDetails.getLvAllele();
//String strLvParent = qtlDetails.getLvParent();
String strRightFM = qtlDetails.getRightFlankingMarker();
//String strSeAdditive = qtlDetails.getSeAdditive();
//String strTrait = qtlDetails.getTrait();
String strTrait = qtlDetails.getTRName();
flapjackBufferedWriter.write(strQtlName + "\t" + strLinkageGroup + "\t" + fPosition + "\t" + fMinPosition + "\t" + fMaxPosition + "\t" +
strTrait + "\t" + strExperiment + "\t \t" + fScoreValue + "\t" + frSquare+
"\t" + strLeftFlankingMarker+"/"+strRightFM + "\t" + fEffect);
flapjackBufferedWriter.write("\n");
}
flapjackBufferedWriter.close();
} catch (IOException e) {
throw new GDMSException(e.getMessage());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getPrintToFileTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HHmmss\");\n return sdf.format(System.currentTimeMillis());\n }",
"public void restock(String fileName) {\n\t\tString timeFormat = \"dd'/'MM'/'yyyy' 'hh:mm:ss ... | [
"0.5398774",
"0.53567046",
"0.5350394",
"0.53091145",
"0.5299318",
"0.5196487",
"0.51892203",
"0.5154467",
"0.5150715",
"0.50313157",
"0.50309783",
"0.50269204",
"0.50221133",
"0.5008692",
"0.49861628",
"0.49642408",
"0.49525377",
"0.4949383",
"0.49435443",
"0.4931865",
"0.49... | 0.6372521 | 0 |
long time = new Date().getTime(); String strFlapjackMapFile = "Flapjack" + String.valueOf(time); | private void writeMapFile(
GDMSMain theMainHomePage,
ArrayList listOfAllMapInfo) throws GDMSException {
String strFlapjackMapFile = "Flapjack";
File baseDirectory = theMainHomePage.getMainWindow().getApplication().getContext().getBaseDirectory();
File absoluteFile = baseDirectory.getAbsoluteFile();
File[] listFiles = absoluteFile.listFiles();
File fileExport = baseDirectory;
for (File file : listFiles) {
if(file.getAbsolutePath().endsWith("Flapjack")) {
fileExport = file;
break;
}
}
String strFilePath = fileExport.getAbsolutePath();
generatedMapFile = new File(strFilePath + "\\" + strFlapjackMapFile + ".map");
/** writing tab delimited .map file for FlapJack
* consisting of marker chromosome & position
*
* **/
//System.out.println("............:"+listOfAllMapInfo);
try {
FileWriter flapjackMapFileWriter = new FileWriter(generatedMapFile);
BufferedWriter flapjackBufferedWriter = new BufferedWriter(flapjackMapFileWriter);
//flapjackBufferedWriter.write("\n");
//flapjackBufferedWriter.write("Marker-Name\tLinkage-Group\tStarting-Position\n");
for (int m=0; m<listOfAllMapInfo.size();m++){
String[] MapInfo=listOfAllMapInfo.get(m).toString().split("!~!");
flapjackBufferedWriter.write(MapInfo[0]);
flapjackBufferedWriter.write("\t");
flapjackBufferedWriter.write(MapInfo[1]);
flapjackBufferedWriter.write("\t");
flapjackBufferedWriter.write(MapInfo[2]);
flapjackBufferedWriter.write("\n");
}
flapjackBufferedWriter.close();
} catch (IOException e) {
throw new GDMSException(e.getMessage());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String getPrintToFileTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HHmmss\");\n return sdf.format(System.currentTimeMillis());\n }",
"public static String getFileName()\r\n\t{\r\n\t\tString name = \"d3_\";\r\n\t\tjava.util.Dat... | [
"0.6364448",
"0.62550765",
"0.6037194",
"0.5956747",
"0.58606297",
"0.58115846",
"0.57811403",
"0.57606953",
"0.57434964",
"0.5735405",
"0.56664574",
"0.5639255",
"0.561677",
"0.55950725",
"0.5568868",
"0.5565222",
"0.5555379",
"0.55306256",
"0.5512138",
"0.5499205",
"0.54900... | 0.5301809 | 27 |
perform a binary search to ascertain if given target value is present in the array of strings | private int binarySearch(String[] arr, int low, int high, String targetVal) {
while(low <= high) {
int mid = (low + high) / 2;
arr[mid] = arr[mid].toLowerCase();
targetVal = targetVal.toLowerCase();
if (arr[mid].compareTo(targetVal) < 0) {
low = mid + 1;
} else if (arr[mid].compareTo(targetVal) > 0) {
high = mid -1;
} else {
return mid;
}
}
return -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int binarySearch(String[] strings,\n String target) {\n int min = 0;\n int max = strings.length - 1;\n \n while (min <= max) {\n int mid = (max + min) / 2;\n int compare = strings[mid].compareTo(target);\n if (compare == 0) {\n return ... | [
"0.69202787",
"0.6494548",
"0.63925064",
"0.6337544",
"0.63162017",
"0.6234958",
"0.62168914",
"0.61724555",
"0.6147439",
"0.61405444",
"0.61315256",
"0.6105257",
"0.6094581",
"0.60918033",
"0.6080692",
"0.5980371",
"0.59714067",
"0.5965263",
"0.5963801",
"0.5963279",
"0.5959... | 0.6933685 | 0 |
Set response content type | public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Configuration of delete log-event";
String docType =
"<!doctype html public \"-//w3c//dtd html 4.0 " +
"transitional//en\">\n";
ServletHelper helper = new ServletHelper();
StringBuilder eventValues = new StringBuilder();
eventValues.append(helper.getTRTag(helper.getDisabledInputTextTag(MessTypes.CLICK_LOG.getMyValue())));
for(ServletHelper.ClickLogValues aValue : ServletHelper.ClickLogValues.values()){
eventValues.append(helper.getTRTag(helper.getInputTextTag(aValue.getMyValue())));
}
// out.println(docType +
// "<html>\n" +
// "<head><title>" + title + "</title></head>\n" +
// "<body bgcolor=\"#f0f0f0\">\n" +
// "<h1 align=\"center\">" + title + "</h1>\n" +
// "<form method=\"POST\" action=\"/servlet/saveTestLog\">" +
// "<table>\n" +
// eventValues.toString() +
// "</table>\n" +
// "<input type=\"submit\" value=\"Save log\">" +
// "</form>" +
// "<br/>" +
// "<h1 align=\"center\">" + titleEventLog + "</h1>\n" +
// "<form method=\"POST\" action=\"/servlet/saveTestLog\">" +
// "<table>\n" +
// eventLogInputs.toString() +
// "</table>\n" +
// "<input type=\"submit\" value=\"Save log\">" +
// "</form>" +
//
// "</body></html>");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setContentType(HttpServletResponse response);",
"public void setContentType(String type) {\n this.response.setContentType(type);\n }",
"private static void setContentTypeHeader(HttpResponse response, File file) {\n\t\tresponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICAT... | [
"0.85155076",
"0.7930608",
"0.7492048",
"0.734203",
"0.73247683",
"0.7253214",
"0.72322834",
"0.71463054",
"0.6991876",
"0.6971935",
"0.69708157",
"0.6853685",
"0.682858",
"0.6819522",
"0.6748494",
"0.6692843",
"0.6492454",
"0.6473172",
"0.6362589",
"0.633632",
"0.62639844",
... | 0.0 | -1 |
METHODS Closes the device. | void close() throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void close() throws IOException {\n if (mDevice!=null) {\n try {\n mDevice.close();\n } finally {\n mDevice = null;\n }\n }\n }",
"void close(){\r\n // check precondition: device must be opened\r\n ... | [
"0.7492669",
"0.73872787",
"0.7301621",
"0.70791805",
"0.6815504",
"0.6798648",
"0.6779637",
"0.6775988",
"0.67525023",
"0.67525023",
"0.67525023",
"0.67450994",
"0.6721471",
"0.6719702",
"0.67093635",
"0.67093635",
"0.67093635",
"0.67093635",
"0.67093635",
"0.67093635",
"0.6... | 0.0 | -1 |
Opens the device for acquisition. | void open() throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void open() throws FTD2XXException {\n Memory memory = new Memory(16);\n memory.setString(0, devSerialNumber);\n PointerByReference handle = new PointerByReference();\n ensureFTStatus(ftd2xx.FT_OpenEx(memory, FTD2XX.FT_OPEN_BY_SERIAL_NUMBER, handle));\n this.ftHandle = han... | [
"0.6875278",
"0.6726139",
"0.6553511",
"0.64214873",
"0.64197636",
"0.61941105",
"0.6089354",
"0.60871905",
"0.60329115",
"0.60253495",
"0.59840727",
"0.5952458",
"0.5952458",
"0.59407073",
"0.58828634",
"0.5847791",
"0.58469594",
"0.5827077",
"0.57694644",
"0.5765638",
"0.57... | 0.0 | -1 |
Checks if the space is empty. | private boolean isEmpty()
{
return dimensions.isEmpty();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean hasSpace() {\r\n\t\treturn hasSpace;\r\n\t}",
"private boolean isBlank() {\n\t\tchar currentChar = data[index];\n\t\tif (currentChar == '\\r' || currentChar == '\\n' || currentChar == '\\t' || currentChar == ' ') {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Test\n\tpublic void nonEmp... | [
"0.7372317",
"0.7336953",
"0.7167956",
"0.71639884",
"0.71385926",
"0.71147615",
"0.7035006",
"0.7031285",
"0.68465",
"0.6829735",
"0.68169075",
"0.6805194",
"0.67895085",
"0.67667514",
"0.67630494",
"0.67497283",
"0.6748953",
"0.674218",
"0.6736965",
"0.67279595",
"0.6724211... | 0.0 | -1 |
Splits the space into subspaces to accommodate the item. | public Collection<Space> split(ItemPlacement placement)
{
List<Space> spaces = new ArrayList<>();
Dimension size = placement.getPlacement().getDimensions();
Point position = placement.getPlacement().getPosition();
spaces.add(new Space(
new Dimension(
this.dimensions.getWidth() - size.getWidth(),
this.dimensions.getHeight(),
this.dimensions.getLength()
),
new Point(
this.position.getX() + position.getX(),
this.position.getY(),
this.position.getZ()
)
));
spaces.add(new Space(
new Dimension(
this.dimensions.getWidth(),
this.dimensions.getHeight() - size.getHeight(),
this.dimensions.getLength()
),
new Point(
this.position.getX(),
this.position.getY() + position.getY(),
this.position.getZ()
)
));
spaces.add(new Space(
new Dimension(
this.dimensions.getWidth(),
this.dimensions.getHeight(),
this.dimensions.getLength() - size.getLength()
),
new Point(
this.position.getX(),
this.position.getY(),
this.position.getZ() + position.getZ()
)
));
spaces.add(new Space(
new Dimension(
this.dimensions.getWidth() + size.getWidth(),
this.dimensions.getHeight(),
this.dimensions.getLength() - size.getLength()
),
new Point(
this.position.getX() + position.getX(),
this.position.getY(),
this.position.getZ() + position.getZ()
)
));
spaces.removeIf(Space::isEmpty);
return spaces;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void split(Space s);",
"public List<Space> getSubSpaces() {\n\t\treturn subSpaces;\n\t}",
"private void split(TFNode node) {\r\n // Move item at index 2 up to the parent\r\n TFNode parent = node.getParent();\r\n int childIndex;\r\n\r\n // Make new right node\r\n ... | [
"0.67423743",
"0.60255635",
"0.56468743",
"0.5646457",
"0.5535615",
"0.54693514",
"0.5462315",
"0.52112067",
"0.52089375",
"0.51598716",
"0.51221025",
"0.5118899",
"0.5104874",
"0.5064772",
"0.5052047",
"0.5050039",
"0.5049143",
"0.5042267",
"0.5042267",
"0.49622065",
"0.4959... | 0.63694143 | 1 |
/ test TraversePsi::findFile Contains only 1 file | public void testFindFile() throws TimeoutException, ExecutionException {
AnActionEvent e = createAnActionEvent("file2.java");
Project project = e.getProject();
String expected = "[PsiJavaFile:file2.java]";
assertEquals(TraverseProjectPsi.findFile(project).size(), 1);
assertEquals(TraverseProjectPsi.findFile(project).toString(), expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testFindFile2() throws TimeoutException, ExecutionException {\r\n String file1 = \"TravProjPsiFile1.java\";\r\n String file2 = \"TravProjPsiFile2.java\";\r\n String file3 = \"TravProjPsiFile3.java\";\r\n String file4 = \"TravProjPsiDir/TravProjPsiFile4.java\";\r\n Str... | [
"0.7283043",
"0.6534914",
"0.6531093",
"0.64168984",
"0.6255544",
"0.61464244",
"0.6088775",
"0.60768",
"0.6025758",
"0.5945856",
"0.58402777",
"0.5813756",
"0.57932764",
"0.57815635",
"0.57328767",
"0.572022",
"0.5688754",
"0.5670358",
"0.565529",
"0.56521255",
"0.56394494",... | 0.71245766 | 1 |
/ test TraversePsi::findFile Contains several files | public void testFindFile2() throws TimeoutException, ExecutionException {
String file1 = "TravProjPsiFile1.java";
String file2 = "TravProjPsiFile2.java";
String file3 = "TravProjPsiFile3.java";
String file4 = "TravProjPsiDir/TravProjPsiFile4.java";
String file5 = "TravProjPsiDir/TravProjPsiFile5.java";
String[] fileNames = {file1, file2, file3, file4, file5};
AnActionEvent e = createAnActionEventWithSeveralFiles(fileNames);
Project project = e.getProject();
List<PsiFile> actual = TraverseProjectPsi.findFile(project);
List<String> expected = Arrays.asList("TravProjPsiFile4.java", "TravProjPsiFile5.java", "TravProjPsiFile1.java", "TravProjPsiFile2.java", "TravProjPsiFile3.java");
assertEquals(actual.size(), 5);
for (PsiFile f : actual) {
assertTrue(expected.contains(f.getName()));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void testFindFile() throws TimeoutException, ExecutionException {\r\n AnActionEvent e = createAnActionEvent(\"file2.java\");\r\n Project project = e.getProject();\r\n String expected = \"[PsiJavaFile:file2.java]\";\r\n assertEquals(TraverseProjectPsi.findFile(project).size(), 1);... | [
"0.6795878",
"0.6635912",
"0.66127115",
"0.63416535",
"0.6307873",
"0.61424476",
"0.6139156",
"0.6048765",
"0.602089",
"0.60120255",
"0.5855792",
"0.58027864",
"0.5790715",
"0.578949",
"0.5741578",
"0.5735056",
"0.57312727",
"0.5728862",
"0.57271194",
"0.56923634",
"0.5692032... | 0.7677172 | 0 |
/ test TraversePsi::getRootClasses root classes and nonroot classes mixed case | public void testGetRootClasses() throws TimeoutException, ExecutionException {
String file1 = "TravProjPsiFile1.java";
String file2 = "TravProjPsiFile2.java";
String file3 = "TravProjPsiFile3.java";
String file4 = "TravProjPsiDir/TravProjPsiFile4.java";
String file5 = "TravProjPsiDir/TravProjPsiFile5.java";
String[] fileNames = {file1, file2, file3, file4, file5};
AnActionEvent e = createAnActionEventWithSeveralFiles(fileNames);
Project project = getProject();
Set<PsiClass> actual = TraverseProjectPsi.getRootClasses(project);
List<String> expected = Arrays.asList("ClassInFile1", "ClassInFile2", "Class1InFile3", "Class2InFile3");
assertEquals(actual.size(), 4);
for (PsiClass c : actual) {
assertTrue(expected.contains(c.getName()));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean start(RootDoc root) {\n System.out.println(\"ClassDoc packages: \" + root.classes().length);\n Path rootPath = FileSystems.getDefault().getPath(gitRepoRoot);\n\n for (String hierarchyRoot: hierarchyRoots) {\n ClassDoc hierarchyRootDoc = root.classNamed(hierarch... | [
"0.6549852",
"0.6263395",
"0.60102457",
"0.58462346",
"0.5817394",
"0.5813401",
"0.5812528",
"0.58061177",
"0.57996386",
"0.5791628",
"0.573521",
"0.5726114",
"0.5712403",
"0.57023007",
"0.5698762",
"0.5681554",
"0.56262696",
"0.5622473",
"0.5588176",
"0.55681086",
"0.5558210... | 0.6955793 | 0 |
Method to create dummy AnActionEvent with given file | public AnActionEvent createAnActionEvent(String fileName) throws TimeoutException, ExecutionException {
if(fileName!=null) {
myFixture.configureByFile("testData/traversePsi/" + fileName);
}
AnAction anAction = new AnAction() {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
// do nothing
}
};
Promise<DataContext> contextResult = DataManager.getInstance().getDataContextFromFocusAsync();
AnActionEvent anActionEvent = new AnActionEvent(null, contextResult.blockingGet(10, TimeUnit.SECONDS),
"", anAction.getTemplatePresentation(), ActionManager.getInstance(), 0);
return anActionEvent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void actionPerformed( ItemActionEvent<File> event )\r\n {\n }",
"ActionEvent createActionEvent();",
"private ActionListener loadFile() {\n\t\treturn new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tFile file = nul... | [
"0.6823491",
"0.6717069",
"0.65846705",
"0.64237726",
"0.63942236",
"0.63489443",
"0.63343984",
"0.6320836",
"0.630637",
"0.62858117",
"0.62544775",
"0.62512076",
"0.6213815",
"0.61960965",
"0.61902285",
"0.6160436",
"0.6156563",
"0.6151626",
"0.61449677",
"0.61364347",
"0.61... | 0.68178904 | 1 |
Method to create dummy AnActionEvent with given file | public AnActionEvent createAnActionEventWithSeveralFiles(String[] fileNames) throws TimeoutException, ExecutionException {
myFixture.configureByFiles(fileNames);
AnAction anAction = new AnAction() {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
// do nothing
}
};
Promise<DataContext> contextResult = DataManager.getInstance().getDataContextFromFocusAsync();
AnActionEvent anActionEvent = new AnActionEvent(null, contextResult.blockingGet(10, TimeUnit.SECONDS),
"", anAction.getTemplatePresentation(), ActionManager.getInstance(), 0);
return anActionEvent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void actionPerformed( ItemActionEvent<File> event )\r\n {\n }",
"public AnActionEvent createAnActionEvent(String fileName) throws TimeoutException, ExecutionException {\r\n if(fileName!=null) {\r\n myFixture.configureByFile(\"testData/traversePsi/\" + f... | [
"0.6823725",
"0.68158513",
"0.6712865",
"0.65842426",
"0.6393955",
"0.63480467",
"0.6334176",
"0.63217676",
"0.6306716",
"0.62854856",
"0.62543195",
"0.6252397",
"0.6214522",
"0.61961657",
"0.6191217",
"0.6160434",
"0.6157876",
"0.61518127",
"0.6144999",
"0.61344576",
"0.6132... | 0.6422214 | 4 |
Return range according to the type of setting | private String getRange(SimpleSetting simpleSetting) {
String visibleRange = NOT_AVAILABLE;
TYPE settingType = simpleSetting.getType();
if (TYPE.INT.equals(settingType)) {
MinInclusive minInclusive = simpleSetting.getMinInclusive();
MaxInclusive maxInclusive = simpleSetting.getMaxInclusive();
MinExclusive minExclusive = simpleSetting.getMinExclusive();
MaxExclusive maxExclusive = simpleSetting.getMaxExclusive();
BigDecimal min = new BigDecimal(Integer.MIN_VALUE);
BigDecimal max = new BigDecimal(Integer.MAX_VALUE);
String minMark = EMPTY;
String maxMark = EMPTY;
if (minExclusive != null) {
min = (BigDecimal) minExclusive.getValue();
minMark = "(";
}
if (minInclusive != null) {
min = (BigDecimal) minInclusive.getValue();
if (minMark.contains("("))
minMark.replace("(", "[");
else
minMark = "[";
}
if (maxExclusive != null) {
max = (BigDecimal) maxExclusive.getValue();
maxMark = ")";
}
if (maxInclusive != null) {
max = (BigDecimal) maxInclusive.getValue();
if (maxMark.contains(")"))
maxMark.replace(")", "]");
else
maxMark = "]";
}
if (!EMPTY.equals(minMark) || !EMPTY.equals(maxMark)) {
if (Integer.MIN_VALUE == min.intValue()
&& Integer.MAX_VALUE != max.intValue())
visibleRange = "(-" + INFINITY + "; " + max + maxMark;
if (Integer.MIN_VALUE != min.intValue()
&& Integer.MAX_VALUE == max.intValue())
visibleRange = minMark + min + "; " + INFINITY + ")";
if (Integer.MIN_VALUE != min.intValue()
&& Integer.MAX_VALUE != max.intValue())
visibleRange = minMark + min + "; " + max + maxMark;
}
return visibleRange;
}
if (TYPE.REAL.equals(settingType)) {
MinInclusive minInclusive = simpleSetting.getMinInclusive();
MaxInclusive maxInclusive = simpleSetting.getMaxInclusive();
MinExclusive minExclusive = simpleSetting.getMinExclusive();
MaxExclusive maxExclusive = simpleSetting.getMaxExclusive();
BigDecimal min = new BigDecimal(Long.MIN_VALUE);
BigDecimal max = new BigDecimal(Long.MAX_VALUE);
String minMark = EMPTY;
String maxMark = EMPTY;
if (minExclusive != null) {
min = (BigDecimal) minExclusive.getValue();
minMark = "(";
}
if (minInclusive != null) {
min = (BigDecimal) minInclusive.getValue();
if (minMark.contains("("))
minMark.replace("(", "[");
else
minMark = "[";
}
if (maxExclusive != null) {
max = (BigDecimal) maxExclusive.getValue();
maxMark = ")";
}
if (maxInclusive != null) {
max = (BigDecimal) maxInclusive.getValue();
if (maxMark.contains(")"))
maxMark.replace(")", "]");
else
maxMark = "]";
}
if (!EMPTY.equals(minMark) || !EMPTY.equals(maxMark)) {
if (Long.MIN_VALUE == min.longValue()
&& Long.MAX_VALUE != max.longValue())
visibleRange = "(-" + INFINITY + "; " + max + maxMark;
if (Long.MIN_VALUE != min.longValue()
&& Long.MAX_VALUE == max.longValue())
visibleRange = minMark + min + "; " + INFINITY + ")";
if (Long.MIN_VALUE != min.longValue()
&& Long.MAX_VALUE != max.longValue())
visibleRange = minMark + min + "; " + max + maxMark;
}
return visibleRange;
}
if (TYPE.DATE.equals(settingType) || TYPE.DATE_TIME.equals(settingType)
|| TYPE.TIME.equals(settingType)) {
MinInclusive minInclusive = simpleSetting.getMinInclusive();
MaxInclusive maxInclusive = simpleSetting.getMaxInclusive();
MinExclusive minExclusive = simpleSetting.getMinExclusive();
MaxExclusive maxExclusive = simpleSetting.getMaxExclusive();
XMLCalendar min = null;
XMLCalendar max = null;
if (TYPE.DATE.equals(settingType)) {
min = new XMLCalendar("1970-01-01", XMLCalendar.DATE);
max = new XMLCalendar("2099-12-31", XMLCalendar.DATE);
} else if (TYPE.DATE_TIME.equals(settingType)) {
min = new XMLCalendar("1970-01-01T00:00:00Z",
XMLCalendar.DATETIME);
max = new XMLCalendar("2099-12-31T23:59:59Z",
XMLCalendar.DATETIME);
} else if (TYPE.TIME.equals(settingType)) {
min = new XMLCalendar("00:00:00+00:00", XMLCalendar.TIME);
max = new XMLCalendar("23:59:59+00:00", XMLCalendar.TIME);
}
XMLCalendar minValue = min;
XMLCalendar maxValue = max;
String minMark = EMPTY;
String maxMark = EMPTY;
if (minExclusive != null) {
min = (XMLCalendar) minExclusive.getValue();
minMark = "(";
}
if (minInclusive != null) {
min = (XMLCalendar) minInclusive.getValue();
if (minMark.contains("("))
minMark.replace("(", "[");
else
minMark = "[";
}
if (maxExclusive != null) {
max = (XMLCalendar) maxExclusive.getValue();
maxMark = ")";
}
if (maxInclusive != null) {
max = (XMLCalendar) maxInclusive.getValue();
if (maxMark.contains(")"))
maxMark.replace(")", "]");
else
maxMark = "]";
}
if (!EMPTY.equals(minMark) || !EMPTY.equals(maxMark)) {
if (minValue.equals(min) && !maxValue.equals(max))
visibleRange = "(-" + INFINITY + "; " + max + maxMark;
if (!minValue.equals(min) && maxValue.equals(max))
visibleRange = minMark + min + "; " + INFINITY + ")";
if (!minValue.equals(min) && !maxValue.equals(max))
visibleRange = minMark + min + "; " + max + maxMark;
}
return visibleRange;
}
if (TYPE.DURATION.equals(settingType)) {
MinInclusive minInclusive = simpleSetting.getMinInclusive();
MaxInclusive maxInclusive = simpleSetting.getMaxInclusive();
MinExclusive minExclusive = simpleSetting.getMinExclusive();
MaxExclusive maxExclusive = simpleSetting.getMaxExclusive();
XMLDuration min = null;
XMLDuration max = null;
XMLDuration minValue = min;
XMLDuration maxValue = max;
String minMark = EMPTY;
String maxMark = EMPTY;
if (minExclusive != null) {
min = (XMLDuration) minExclusive.getValue();
minMark = "(";
}
if (minInclusive != null) {
min = (XMLDuration) minInclusive.getValue();
if (minMark.contains("("))
minMark.replace("(", "[");
else
minMark = "[";
}
if (maxExclusive != null) {
max = (XMLDuration) maxExclusive.getValue();
maxMark = ")";
}
if (maxInclusive != null) {
max = (XMLDuration) maxInclusive.getValue();
if (maxMark.contains(")"))
maxMark.replace(")", "]");
else
maxMark = "]";
}
if (!EMPTY.equals(minMark) || !EMPTY.equals(maxMark)) {
if (minValue == min && maxValue != max)
visibleRange = "max " + getParsedString(max);
// visibleRange = "(-" + INFINITY + "; " + max + maxMark;
if (minValue != min && maxValue == max)
visibleRange = "min " + getParsedString(min);
// visibleRange = minMark + min + "; " + INFINITY + ")";
if (minValue != min && maxValue != max)
visibleRange = "from " + getParsedString(min) + "\nto "
+ getParsedString(max);
// visibleRange = minMark + min + "; " + max + maxMark;
}
return visibleRange;
}
return visibleRange;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getRange();",
"@Override\n public Map<SquadronConfig, Integer> getRange() {\n return configuration\n .stream()\n .map(this::buildRange)\n .collect(Collectors.toMap(Pair::getKey, Pair::getValue));\n }",
"RangeOfValuesType createRangeOfValuesType();",... | [
"0.6882599",
"0.6503533",
"0.6482568",
"0.6419378",
"0.6367153",
"0.6343101",
"0.6332966",
"0.6285963",
"0.6268657",
"0.6229284",
"0.6184001",
"0.6127156",
"0.61057335",
"0.6088662",
"0.6087718",
"0.6048343",
"0.60312206",
"0.59826267",
"0.5943689",
"0.5936258",
"0.59242547",... | 0.6832568 | 1 |
Search using the csv files for lists of creatures// | public void loadData() {
String[] animalsListRaw = loadStrings("data/animalList.csv");
//String[] animalsListRaw = loadStrings("data/mythical.creatures.csv");
String[] animalList = getList(animalsListRaw);
SearchQuery newSearch = new SearchQuery(animalList);
allMaps = newSearch.getMap();
map = new UnfoldingMap(this);
map.setBackgroundColor(color(179, 223, 222, 255));
map.zoomAndPanTo(width/2, height/2, 2);
//MapUtils.createDefaultEventDispatcher(this, map);
countries = GeoJSONReader.loadData(this, "countries.geo.json");
marks = new MarkerMaker(allMaps, countries);
map.draw();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws FileNotFoundException {\n\n ArrayList<String> names = new ArrayList<>();\n Scanner scanner = new Scanner(new File(\"People.csv\"));\n scanner.nextLine();\n while (scanner.hasNext()) {\n String line = scanner.nextLine();\n ... | [
"0.64461994",
"0.61302966",
"0.5997853",
"0.5977069",
"0.59607154",
"0.59360486",
"0.5909394",
"0.5889969",
"0.58559513",
"0.5848102",
"0.5825632",
"0.57760394",
"0.5775633",
"0.57732815",
"0.57728523",
"0.5714636",
"0.56823",
"0.5616811",
"0.5599188",
"0.55623925",
"0.554330... | 0.0 | -1 |
return the first item of subject | public String getFirstSubject() {
String subject = "";
try {
JSONArray array = sr.getJSONArray("subject");
JSONObject entry = array.getJSONObject(0);
subject += entry.getString("name");
return subject;
} catch (Exception f) {
return "NA";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Item getFirst();",
"public Object getFirst() {\n\t\tcurrent = start;\n\t\treturn start == null ? null : start.item;\n\t}",
"public T getFirst();",
"public T getFirst();",
"public Optional<T> getFirstItem() {\n return getData().stream().findFirst();\n }",
"public Object firstElement();",
... | [
"0.76191705",
"0.70097303",
"0.6819898",
"0.6819898",
"0.6798968",
"0.6730904",
"0.6692803",
"0.66644603",
"0.666122",
"0.66443276",
"0.66274786",
"0.65926975",
"0.6578379",
"0.65562314",
"0.6553351",
"0.6532453",
"0.6514152",
"0.6510361",
"0.6503485",
"0.6490942",
"0.6479757... | 0.76125133 | 1 |
Return original URL of item | public String getItemURL() {
String shownAt = jsonParent.getString("isShownAt");
println(shownAt);
return shownAt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getURL(int position){\n Item current = getItem(position);\n return current.URL();\n }",
"@Schema(description = \"Link to get this item\")\n public String getUrl() {\n return url;\n }",
"String getURL(FsItem f);",
"@java.lang.Override\n public java.lang.String getUrl()... | [
"0.7142636",
"0.7021738",
"0.7013978",
"0.6853817",
"0.6853817",
"0.66560864",
"0.65795463",
"0.6566602",
"0.6566602",
"0.6566602",
"0.6566602",
"0.6566602",
"0.6566602",
"0.6489317",
"0.64621025",
"0.64503247",
"0.64503247",
"0.6449277",
"0.6439975",
"0.64333385",
"0.6425985... | 0.67162573 | 5 |
Get inside SourceResource (Where a lot of useful info resides) | public JSONObject SourceResource() {
JSONObject source = jsonParent.getJSONObject("sourceResource");
return source;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getSource() {\n/* 312 */ return getValue(\"source\");\n/* */ }",
"public String getSourceResource() {\r\n\t\treturn requestSource;\r\n\t}",
"public String getSource ();",
"public String getSource() {\n\t\treturn (String) _object.get(\"source\");\n\t}",
"public interface IResourceSou... | [
"0.71432436",
"0.7047199",
"0.68371654",
"0.6789475",
"0.67042506",
"0.66701746",
"0.66589475",
"0.66456693",
"0.66216457",
"0.6587403",
"0.65870315",
"0.6520084",
"0.6502042",
"0.6487232",
"0.64751416",
"0.64539826",
"0.6414375",
"0.6412617",
"0.6406862",
"0.6406862",
"0.640... | 0.7334197 | 0 |
CHecking if mouse is over the Entry | public void rollover(float px, float py) {
float d = dist(px, py, x, y);
if (d < diameter/2) {
over = true;
} else {
over = false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isHovered();",
"public boolean isMouseOver(){\n\t\treturn this.contains(Main.camera.getMousePos());\n\t}",
"public boolean checkMouseOver(Rectangle selectionBox) {\n\t\tdouble zoom = editor.control.viewControl.zoom;\n\t\treturn (tool.mousePosition.distanceTo(getDrawPosition(selectionBox)) < Tool... | [
"0.72927475",
"0.70959276",
"0.69466066",
"0.68988633",
"0.66990507",
"0.6673844",
"0.66294074",
"0.6593533",
"0.65700805",
"0.655631",
"0.6520763",
"0.6501331",
"0.64860046",
"0.6479449",
"0.64788187",
"0.64497405",
"0.64497405",
"0.64497405",
"0.64497405",
"0.64497405",
"0.... | 0.0 | -1 |
find the animal that has the max number of items | public AnimalList findMax(HashMap<String, AnimalList> animalEntries) {
//HashMap<String, AnimalList> animalEntries = country.getValue();
AnimalList max = new AnimalList("emptyAnimal");
for (Entry<String, AnimalList> animal : animalEntries.entrySet ()) {
if (max.compareTo(animal.getValue()) < 0) {
max = animal.getValue();
}
} //for each animal type in a country (HashMap)
if (max.getAnimalName().equals("emptyAnimal")) { //if the country is empty (no animals)
return null;
} else { //found a max animal
return max;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"long getMaxItemFindings();",
"public Animal biggestAnimal() {\n\t\tAnimal biggest = new Dog();\n\t\tbiggest.setSize(0);\n\t\tfor (Animal a : animals) {\n\t\t\tif (a.isBigger(biggest)) {\n\t\t\t\tbiggest = a;\n\t\t\t}\n\t\t}\n\t\treturn biggest;\n\t}",
"int getMaxCount();",
"int getMaxCount();",
"public abs... | [
"0.7122549",
"0.66591054",
"0.658297",
"0.658297",
"0.6514549",
"0.64815974",
"0.6276422",
"0.62003124",
"0.6180429",
"0.610686",
"0.60526526",
"0.59430444",
"0.59337616",
"0.59143734",
"0.59112954",
"0.58741206",
"0.58368665",
"0.579036",
"0.5778963",
"0.5778963",
"0.5777229... | 0.6122054 | 9 |
Parses the "docs" JSON array// | public void parseData(JSONObject jsonObject, String title) {
JSONArray value = jsonObject.getJSONArray("docs");
//println("Size: " + value.size());
//-----Goes through all entries-----//
if (value.size() != 0) {
//MyEntries newEntry = new MyEntries(title);
//AnimalList newList = new AnimalList(title);
for (int i = 0; i < value.size (); i++) {
//println(i);
JSONObject entry = value.getJSONObject(i);
DplaItem item = new DplaItem(entry);
//newList.add(item);
String country = item.getCountry();
if (!country.equals("NA")) { //if has a country info
println("[" + item.getCountry() + "]");
AnimalList tempList;
try {
HashMap<String, AnimalList> animals = directory.get(country); //get the map by country name key
try {
tempList = animals.get(title); //get the list of one kind of animal by animal name key
tempList.add(item);
//println("Added " + title + " in " + country);
}
catch (Exception f) {
tempList = new AnimalList(title);
tempList.add(item);
animals.put(title, tempList);
//println("Created " + title + " for " + country);
println("Loading images, please be patient");
tempList.getImageCSV();
// if (tempList.getImageUrl().equals("NA") ) { //search weird images on DPLA
// tempList.searchImage(country);
// }
}
}
catch (Exception e) {
HashMap<String, AnimalList> newMap = new HashMap();
tempList = new AnimalList(title);
tempList.add(item);
newMap.put(title, tempList);
directory.put(country, newMap);
//println("Created " + country + " with " + title );
println("Loading images, please be patient");
tempList.getImageCSV();
// if (tempList.getImageUrl().equals("NA") ) {
// tempList.searchImage(country);
// }
}
}//if
}//end outer for loop
}//if
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract List<T> readDoc(final Document document);",
"@Override\r\n protected void parseDocuments()\r\n {\n\r\n }",
"@Test\r\n public void testRevisionParser() {\r\n JsonParser parser = new JsonParser();\r\n InputStream inputstream = getClass().getClassLoader().getResourceAsStr... | [
"0.59049",
"0.58928835",
"0.5751193",
"0.5687491",
"0.56605476",
"0.56605476",
"0.56252813",
"0.5525954",
"0.5486716",
"0.54809344",
"0.54037356",
"0.53630644",
"0.5353212",
"0.5343747",
"0.5330402",
"0.5330387",
"0.5321919",
"0.5304384",
"0.52944064",
"0.5281483",
"0.5264221... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public User1 userRegistration() {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public User logedInUserProfile(User user) {
return userFacade.logedInUserProfile(user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExr... | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.608016... | 0.0 | -1 |
TODO: Change Throw exception to custom exceptions | AccountDetail getAccount(String number) throws Exception; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void throwException() throws Exception {\n\t\tthrow new Exception();\r\n\t}",
"Throwable cause();",
"void mo57276a(Exception exc);",
"@Override\r\n\tpublic void doException() {\n\r\n\t}",
"private void throwsError() throws OBException {\n }",
"@Override\n protected boolean shouldSend... | [
"0.6837148",
"0.6057325",
"0.6049334",
"0.6040001",
"0.6032542",
"0.60134035",
"0.5872752",
"0.5850488",
"0.58355457",
"0.58232975",
"0.5765882",
"0.57611793",
"0.5741522",
"0.57359886",
"0.5722557",
"0.5701326",
"0.570051",
"0.5692559",
"0.5692559",
"0.5678742",
"0.56426084"... | 0.0 | -1 |
Push element x onto stack. | public void push(int x) {
q.offer(x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void push(int x) {\n stack.add(x);\n }",
"public void push(int x) {\r\n inStack.push(x);\r\n }",
"public void push(int x) {\n this.stack1.add(x);\n }",
"public void push(int x) {\n pushStack.add(x);\n }",
"public void push(int x) {\n\t\tstack.push(x);\n\t}",
... | [
"0.8672601",
"0.8593213",
"0.8557095",
"0.8550046",
"0.85248345",
"0.849857",
"0.8488204",
"0.8461919",
"0.84580845",
"0.8428048",
"0.8376647",
"0.8370228",
"0.83689076",
"0.834321",
"0.8338629",
"0.83351046",
"0.8333088",
"0.8321995",
"0.83110845",
"0.82998204",
"0.82648087"... | 0.7560953 | 69 |
Removes the element on top of the stack. | public void pop() {
int size = q.size();
for(int i = 1; i<size;i++){
q.offer(q.poll());
}
q.poll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void pop()\r\n\t{\r\n\t\ttop--;\r\n\t\tstack[top] = null;\r\n\t}",
"public void pop() {\n // if the element happen to be minimal, pop it from minStack\n if (stack.peek().equals(minStack.peek())){\n \tminStack.pop();\n }\n stack.pop();\n\n }",
"public void pop(){\n ... | [
"0.7765505",
"0.7564374",
"0.7486899",
"0.7481785",
"0.7467112",
"0.74231863",
"0.7370439",
"0.7337617",
"0.73331475",
"0.72395754",
"0.722032",
"0.719834",
"0.7194046",
"0.7146135",
"0.7144848",
"0.71363336",
"0.7118481",
"0.7098051",
"0.70946324",
"0.70856357",
"0.7077734",... | 0.0 | -1 |
Get the top element. | public int top() {
int size = q.size();
for(int i = 1; i<size;i++){
q.offer(q.poll());
}
int value = q.peek();
q.offer(q.poll());
return value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int top() {\n return topElem;\n }",
"public E top() {\n return !isEmpty() ? head.item : null;\n }",
"public int topElement() {\n\t\tif(isEmpty()){\n\t\t\tthrow new AssertionError();\n\t\t}\n\t\telse {\n\t\t\treturn heap.get(0).element;\n\t\t\n\t\t}\n\t}",
"public T getTop( ... | [
"0.8335419",
"0.79350287",
"0.77536744",
"0.7748599",
"0.76948357",
"0.76440716",
"0.76287603",
"0.76287603",
"0.76210487",
"0.761078",
"0.75897783",
"0.757352",
"0.75697553",
"0.75569373",
"0.75336695",
"0.74941546",
"0.7478168",
"0.7464024",
"0.7455516",
"0.744731",
"0.7420... | 0.7051931 | 45 |
Return whether the stack is empty. | public boolean empty() {
return q.isEmpty();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean emptyStack() {\n return (expStack.size() == 0);\n }",
"public boolean isEmpty()\n {\n return stack.size() == 0;\n }",
"public boolean isEmpty() {\n \treturn stack.size() == 0;\n }",
"public boolean isEmpty()\n {\n return stack.isEmpty();\n }",
"publi... | [
"0.9066117",
"0.90027034",
"0.89577776",
"0.89295036",
"0.88910544",
"0.88681304",
"0.8840347",
"0.88153386",
"0.88096553",
"0.88096553",
"0.8760622",
"0.8759322",
"0.87508786",
"0.87422633",
"0.8738757",
"0.8725327",
"0.87200683",
"0.8688953",
"0.8647964",
"0.86373746",
"0.8... | 0.0 | -1 |
Push element x onto stack. | public void push(int x) {
q2.offer(x);
while(!q1.isEmpty()) {
q2.offer(q1.poll());
}
Queue tmp = q1;
q1 = q2;
q2 = tmp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void push(int x) {\n stack.add(x);\n }",
"public void push(int x) {\r\n inStack.push(x);\r\n }",
"public void push(int x) {\n this.stack1.add(x);\n }",
"public void push(int x) {\n pushStack.add(x);\n }",
"public void push(int x) {\n\t\tstack.push(x);\n\t}",
... | [
"0.8672601",
"0.8593213",
"0.8557095",
"0.8550046",
"0.85248345",
"0.849857",
"0.8488204",
"0.8461919",
"0.84580845",
"0.8428048",
"0.8376647",
"0.8370228",
"0.83689076",
"0.834321",
"0.8338629",
"0.83351046",
"0.8333088",
"0.8321995",
"0.83110845",
"0.82998204",
"0.82648087"... | 0.0 | -1 |
Removes the element on top of the stack. | public void pop() {
q1.poll();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void pop()\r\n\t{\r\n\t\ttop--;\r\n\t\tstack[top] = null;\r\n\t}",
"public void pop() {\n // if the element happen to be minimal, pop it from minStack\n if (stack.peek().equals(minStack.peek())){\n \tminStack.pop();\n }\n stack.pop();\n\n }",
"public void pop(){\n ... | [
"0.7765505",
"0.7564374",
"0.7486899",
"0.7481785",
"0.7467112",
"0.74231863",
"0.7370439",
"0.7337617",
"0.73331475",
"0.72395754",
"0.722032",
"0.719834",
"0.7194046",
"0.7146135",
"0.7144848",
"0.71363336",
"0.7118481",
"0.7098051",
"0.70946324",
"0.70856357",
"0.7077734",... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.